root/main/trunk/greenstone2/runtime-src/configure.in @ 22068

Revision 22068, 11.0 KB (checked in by ak19, 10 years ago)

1. Configure files updated to set the USE_HTTPD at the runtime-src packages level. 2. runtime-src/packages/Makefile.in updated to delete its makefile upon distclean.

  • Property svn:executable set to *
Line 
1dnl Process this file with autoconf to produce a configure script.
2dnl Use autoconf-2.59 or later... it might not work anymore with
3dnl the older 2.1x versions - jrm21 12/2004
4AC_INIT()
5AC_CONFIG_HEADER(config.h)
6
7
8
9PACKAGE=gsdl
10VERSION=2.82-svn
11AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
12AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
13AC_SUBST(PACKAGE)
14AC_SUBST(VERSION)
15
16dnl
17dnl Set use of fast cgi
18dnl
19USE_FASTCGI=0
20if test USE_FASTCGI = 1; then
21AC_DEFINE(USE_FASTCGI)
22AC_SUBST(USE_FASTCGI)
23fi
24
25dnl
26dnl Set use of langaction
27dnl
28dnl USE_LANGACTION=0
29if test USE_LANGACTION = 1; then
30AC_DEFINE(USE_LANGACTION)
31AC_SUBST(USE_LANGACTION)
32fi
33
34dnl
35dnl Set use of corba
36dnl
37AC_ARG_ENABLE(corba, [  --enable-corba          Enable CORBA support], USE_CORBA=$enableval, USE_CORBA=no)
38if test $USE_CORBA = "yes" -o $USE_CORBA = "1" ; then
39  USE_CORBA=1
40  AC_DEFINE(USE_CORBA,[])
41else
42  USE_CORBA=0
43fi
44AC_SUBST(USE_CORBA)
45
46AC_ARG_WITH(micodir, [  --with-micodir          Use installed MICO directory], MICO_DIR=$withval, MICO_DIR="default")
47AC_DEFINE_UNQUOTED(MICO_DIR, "$MICO_DIR")
48AC_SUBST(MICO_DIR)
49
50dnl
51dnl Set use of z39.50
52dnl
53AC_ARG_ENABLE(z3950, [  --enable-z3950          Enable Z39.50 client support], USE_Z3950=$enableval, USE_Z3950=no)
54if test $USE_Z3950 = "yes" -o $USE_Z3950 = "1" ; then
55  USE_Z3950=1
56  AC_DEFINE(USE_Z3950,[])
57else
58  USE_Z3950=0
59fi
60AC_SUBST(USE_Z3950)
61
62dnl
63dnl Set use of yaz - now compiled by default even when z3950 support not required
64dnl
65AC_ARG_ENABLE(yaz, [  --disable-yaz           Disable YAZ compilation], USE_YAZ=$enableval, USE_YAZ=yes)
66if test $USE_YAZ = "yes" -o $USE_YAZ = "1" ; then
67  USE_YAZ=1
68  AC_DEFINE(USE_YAZ,[])
69else
70  USE_YAZ=0
71fi
72AC_SUBST(USE_YAZ)
73
74dnl
75dnl Set use of JDBM (enabled by default)
76dnl
77AC_ARG_ENABLE(jdbm, [  --disable-jdbm        Disable JDBM compilation], USE_JDBM=$enableval, USE_JDBM=yes)
78if test $USE_JDBM = "yes" -o $USE_JDBM = "1" ; then
79  USE_JDBM=1
80  AC_DEFINE(USE_JDBM,[])
81else
82  USE_JDBM=0
83fi
84AC_SUBST(USE_JDBM)
85
86dnl
87dnl Set use of GDBM (enabled by default)
88dnl
89AC_ARG_ENABLE(gdbm, [  --disable-gdbm        Disable GDBM compilation], USE_GDBM=$enableval, USE_GDBM=yes)
90if test $USE_GDBM = "yes" -o $USE_GDBM = "1" ; then
91  USE_GDBM=1
92  AC_DEFINE(USE_GDBM,[])
93else
94  USE_GDBM=0
95fi
96AC_SUBST(USE_GDBM)
97
98dnl
99dnl disable compilation of accent folding stuff for mgpp (and one day mg)
100dnl
101AC_ARG_ENABLE(accentfold, [  --disable-accentfold    Disable Accent Folding for MGPP], ENABLE_ACCENTFOLD=$enableval, ENABLE_ACCENTFOLD=yes)
102if test $ENABLE_ACCENTFOLD = "yes" -o $ENABLE_ACCENTFOLD = "1" ; then
103  ENABLE_ACCENTFOLD=1
104  AC_DEFINE(ENABLE_ACCENTFOLD,[])
105else
106  ENABLE_ACCENTFOLD=0
107fi
108AC_SUBST(ENABLE_ACCENTFOLD)
109
110dnl
111dnl Set use of SQLite (enabled by default)
112dnl
113AC_ARG_ENABLE(sqlite, [  --disable-sqlite        Disable SQLite support], USE_SQLITE=$enableval, USE_SQLITE=yes)
114if test $USE_SQLITE = "yes" -o $USE_SQLITE = "1" ; then
115  USE_SQLITE=1
116  AC_DEFINE(USE_SQLITE,[])
117else
118  USE_SQLITE=0
119fi
120AC_SUBST(USE_SQLITE)
121
122dnl
123dnl Set use of Apache httpd (disabled by default)
124dnl
125AC_ARG_ENABLE(apache-httpd, [  --enable-apache-httpd  Enable Apache httpd support], USE_APACHE_HTTPD=$enableval, USE_APACHE_HTTPD=no)
126if test $USE_APACHE_HTTPD = "yes" -o $USE_APACHE_HTTPD = "1" ; then
127  USE_APACHE_HTTPD=1
128  AC_DEFINE(USE_APACHE_HTTPD,[])
129else
130  USE_APACHE_HTTPD=0
131fi
132AC_SUBST(USE_APACHE_HTTPD)
133
134
135dnl
136dnl Set compilation of MG (enabled by default)
137dnl
138AC_ARG_ENABLE(mg, [  --disable-mg        Disable MG compilation], ENABLE_MG=$enableval, ENABLE_MG=yes)
139if test $ENABLE_MG = "yes" -o $ENABLE_MG = "1" ; then
140  ENABLE_MG=1
141  AC_DEFINE(ENABLE_MG,[])
142else
143  ENABLE_MG=0
144fi
145AC_SUBST(ENABLE_MG)
146
147dnl
148dnl Set compilation of MGPP (enabled by default)
149dnl
150AC_ARG_ENABLE(mgpp, [  --disable-mgpp        Disable MGPP compilation], ENABLE_MGPP=$enableval, ENABLE_MGPP=yes)
151if test $ENABLE_MGPP = "yes" -o $ENABLE_MGPP = "1" ; then
152  ENABLE_MGPP=1
153  AC_DEFINE(ENABLE_MGPP,[])
154else
155  ENABLE_MGPP=0
156fi
157AC_SUBST(ENABLE_MGPP)
158
159dnl
160dnl Set compilation of lucene (enabled by default)
161dnl
162AC_ARG_ENABLE(lucene, [  --disable-lucene        Disable Lucene compilation], ENABLE_LUCENE=$enableval, ENABLE_LUCENE=yes)
163if test $ENABLE_LUCENE = "yes" -o $ENABLE_LUCENE = "1" ; then
164  ENABLE_LUCENE=1
165  AC_DEFINE(ENABLE_LUCENE,[])
166else
167  ENABLE_LUCENE=0
168fi
169AC_SUBST(ENABLE_LUCENE)
170
171dnl Checks for programs.
172LDFLAGS=$LDFLAGS
173AC_SUBST(LDFLAGS)
174dnl only set CFLAGS if not already set in environment
175if test -z "$CFLAGS"; then
176CFLAGS=-O2
177fi
178AC_SUBST(CFLAGS)
179
180
181AC_PROG_CC
182AC_PROG_CXX
183AC_PROG_AWK
184AC_PROG_YACC
185dnl get $target_cpu, $target_vendor, and $target_os
186dnl (as well as host_*)
187AC_CANONICAL_SYSTEM
188dnl do we actually want this? It adds a prefix based on host, system etc
189dnl AC_ARG_PROGRAM
190AC_PROG_INSTALL
191AC_PROG_LN_S
192AC_PROG_MAKE_SET
193AC_PROG_RANLIB
194
195AC_MSG_CHECKING(to see if architecture is 64-bit)
196arch_64bit=no
197case "$host_cpu" in
198x86_64) arch_64bit=yes ;;
199esac
200
201if test "$arch_64bit" = yes; then
202  AC_MSG_RESULT(yes)
203  if test -z "$COMPAT32BITFLAGS" ; then
204    COMPAT32BITFLAGS="-m32"
205  fi
206else
207  AC_MSG_RESULT(no)
208  if test -z "$COMPAT32BITFLAGS" ; then
209    COMPAT32BITFLAGS=
210  fi
211fi
212
213# Only need compat32bitflag if using MG or MGPP
214if test "$ENABLE_MG" = "0" ; then
215  COMPAT32BITFLAGS=
216else
217  if test "$ENABLE_MGPP" = "0" ; then
218    COMPAT32BITFLAGS=
219  fi
220fi
221
222export COMPAT32BITFLAGS
223AC_SUBST(COMPAT32BITFLAGS)
224
225
226#moved CORBA MICO directory test to get version of MICO
227if test $USE_CORBA = 1; then
228
229if test $MICO_DIR = "default"; then
230#do something
231MICO_INC="-I packages/mico/mico/include"
232else
233#build the micotest program
234MICO_INC= ""
235if test $MICO_DIR != yes; then
236MICO_INC="-I $MICO_DIR"
237fi
238fi
239
240#get MICO_VER value
241sh -c "$CC -c micotest.cpp -o micotest.o $MICO_INC 2>&1" > /dev/null
242sh -c "$CC -o micotest micotest.o -lstdc++ 2>&1" > /dev/null
243MICO_VER=`./micotest` || MICO_VER=2.3.5
244sh -c "rm micotest"
245sh -c "rm micotest.o"
246
247#do test of MICO_VER
248if test MICO_VER != 0; then
249AC_DEFINE(MICO_VER)
250AC_SUBST(MICO_VER)
251fi
252#end USE_CORBA test
253fi
254
255dnl Checks for typedefs, structures, and compiler characteristics.
256AC_AIX
257AC_ISC_POSIX
258AC_MINIX
259fp_C_PROTOTYPES
260AC_C_CONST
261AC_TYPE_OFF_T
262AC_TYPE_SIZE_T
263AC_HEADER_TIME
264AC_STRUCT_TM
265
266dnl --- This should be in the stdc checking -----------------
267if test "$ac_cv_prog_cc_stdc" = '-Xc'; then
268dnl The Pyramids running SMP_DC.OSx on MIPS r3000 chips with
269dnl /usr/opt/cc3.11/bin/cc treat -Xc as full ANSI mode - no POSIX or
270dnl XOPEN extensions (like popen).
271dnl Unfortunately -D_{XOPEN,POSIX}_SOURCE can't provide all that mg
272dnl needs. So drop back to -Xa
273AC_TRY_COMPILE(
274[#include <stdio.h>
275], [ FILE *rubbish = popen("yes", "r"); ],,
276[CC="`echo $CC | sed 's/-Xc/-Xa/'`"    ac_cv_prog_cc_stdc='-Xa'])
277fi
278dnl ----------------------
279
280
281dnl Checks for libraries.
282dnl check for -lg:
283AC_HAVE_LIBRARY(g)
284dnl check for -lm:
285AC_HAVE_LIBRARY(m)
286dnl check for -lcrypt:
287AC_HAVE_LIBRARY(crypt)
288#if test $ENABLE_ACCENTFOLD = 1; then
289#AC_HAVE_LIBRARY(iconv)
290#fi
291
292dnl Checks for header files.
293AC_HEADER_DIRENT
294AC_HEADER_STDC
295AC_CHECK_HEADERS(fcntl.h limits.h sys/time.h unistd.h crypt.h string.h memory.h sys/procfs.h sys/stat.h)
296AC_EGREP_HEADER(fread, stdio.h, AC_DEFINE(HAVE_FREAD_DECL))
297AC_EGREP_HEADER(fgetc, stdio.h, AC_DEFINE(HAVE_FGETC_DECL))
298AC_EGREP_HEADER(pr_brksize, sys/procfs.h, AC_DEFINE(HAVE_PR_BRKSIZE))
299
300dnl Checks for library functions.
301AC_FUNC_ALLOCA
302AC_PROG_GCC_TRADITIONAL
303AC_TYPE_SIGNAL
304AC_FUNC_VPRINTF
305AC_CHECK_FUNCS(ftime select strftime strtol getrusage times mallinfo setbuffer getpagesize strerror)
306AC_REPLACE_FUNCS(ftruncate strstr strcasecmp)
307
308dnl see if gettext is in libc. (try the textdomain() function).
309AC_CHECK_FUNC(textdomain, AC_DEFINE(ENABLE_NLS ,1) )
310
311# *** Custom checking (based on GNU tar configure.in) ***
312# ---------------------------------------------------------------------------
313AC_MSG_CHECKING(for HP-UX needing gmalloc)
314if test "`(uname -s) 2> /dev/null`" = 'HP-UX'; then
315  AC_MSG_RESULT(yes)
316  AC_LIBOBJ([gmalloc])
317  AC_DEFINE(HAVE_VALLOC)
318else
319  AC_MSG_RESULT(no)
320  AC_CHECK_FUNCS(valloc)
321fi
322
323# we cannot generate static libraries under Darwin
324AC_MSG_CHECKING(for Apple MacOS X/Darwin)
325if test "`(uname -s) 2> /dev/null`" = 'Darwin'; then
326  AC_MSG_RESULT(yes)
327  STATIC=""
328else
329  AC_MSG_RESULT(no)
330  STATIC="-static "
331fi
332AC_SUBST(STATIC)
333
334fp_WITH_DMALLOC
335fp_WITH_REGEX
336
337# ---------------------------------------------------------------------------
338if test "$ac_cv_func_alloca" = 'no'; then
339dnl    support functions for alloca.c
340  AC_LIBOBJ([xmalloc])
341  AC_LIBOBJ([error])
342fi
343
344
345# ---------------------------------------------------------------------------
346
347dnl
348dnl Switch into C++
349dnl
350AC_LANG_CPLUSPLUS
351
352dnl
353dnl Now check that Perl is actually around, and can be found
354dnl
355AC_MSG_CHECKING(that Perl 5 is available)
356success="no"
357pl_path="$PATH"
358IFS="${IFS=   }"; pl_save_ifs="$IFS"; IFS=":"
359for pl_dir in $pl_path; do
360  test -z "$pl_dir" && pl_dir=.
361  if test -x $pl_dir/perl; then
362    success="yes"
363    break
364  fi
365done
366IFS="$pl_save_ifs"
367
368dnl
369dnl Check if the STL library has any known faults;
370dnl In GCC 2.7.2.x series, some STL library headers are missing
371dnl a file called "new" which is referred to by other headers
372dnl (eg. vector/vector.h); if this applies, then all use of the
373dnl STL will cause a compile fail, so we'd better let the user
374dnl know now, before things really go wrong!
375dnl
376success=no
377AC_MSG_CHECKING("whether STL library has known faults")
378
379dnl - first shot, try simple good old vector on its own
380AC_TRY_COMPILE(
381[#include <vector>
382],
383[],
384success=yes,
385)
386
387dnl - try using the .h equivalent
388if test $success = "no"; then
389AC_TRY_COMPILE(
390[#include <vector.h>
391],
392[],
393success="yes",
394)
395fi
396
397dnl - now try for the objectspace headers
398if test $success = "no"; then
399AC_TRY_COMPILE(
400[#include <ospace\\std\\vector>
401],
402[],
403success="yes",
404)
405fi
406
407if test $success = yes; then
408AC_MSG_RESULT("no")
409else
410AC_MSG_RESULT("yes")
411AC_MSG_ERROR("STL Broken - Obtain newer version of GNU C Compiler")
412fi
413
414gsdlos=`uname | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
415# check for running bash under cygwin
416 if test "`echo $gsdlos | sed 's/cygwin//'`" != "$gsdlos" ;
417 then
418  gsdlos=windows
419 fi
420AC_SUBST(gsdlos)
421
422# check for endianness
423AC_C_BIGENDIAN
424# ---------------------------------------------------------------------------
425if test "$ac_cv_func_alloca" = 'no'; then
426dnl    support functions for alloca.c
427  AC_LIBOBJ([xmalloc.o])
428  AC_LIBOBJ([error])
429fi
430
431# ---------------------------------------------------------------------------
432
433
434dnl
435dnl Locate all children of the modules folder
436dnl
437moduleDirs=""
438MODULEDIRS=""
439if test -d modules ; then
440  for x in `find modules -mindepth 1 -maxdepth 2`; do
441    if test -d "$x"; then
442      d="$x/Makefile.in"
443      if test -e "$d"; then
444  dnl      echo $d
445        moduleDirs="$moduleDirs $x/Makefile"
446        MODULEDIRS="$MODULEDIRS $x"
447      fi
448    fi
449  done
450  echo "Making $moduleDirs in modules directory"
451  AC_SUBST(MODULEDIRS)
452fi
453
454
455AC_CONFIG_SUBDIRS(packages)
456
457# the list of folders in the src folder
458srclist="src/colservr/Makefile \
459         src/corba/Makefile \
460         src/protocol/Makefile \
461         src/recpt/Makefile \
462         src/oaiservr/Makefile \
463         src/z3950/Makefile"
464
465AC_OUTPUT(packages/Makefile Makefile $srclist $moduleDirs)
466
467
Note: See TracBrowser for help on using the browser.