source: main/trunk/greenstone2/runtime-src/configure.in@ 21329

Last change on this file since 21329 was 21329, checked in by ak19, 14 years ago

Changes to makefiles, configure files, and source code to work with the new configure flags that allow indexers to be individually compiled up by setting each indexer to be enabled or disabled (enable-mg, enable-mgpp, enable-lucene).

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