source: main/trunk/greenstone2/common-src/configure.in@ 21409

Last change on this file since 21409 was 21409, checked in by davidb, 14 years ago

Introduction of --enable-jdbm flag

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