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

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

Update to use of -m32, which is activated when compiling on a 64-bit machine. The requirement for needing to using -m32 is mg and mg++ (which currently only work with 32-bit sized data-types). If both --disable-mg and --disable-mgpp are specified this means that we don't need to use -m32. Configure files updated to detect this and 'cancel' the -m32 flag.

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