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

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

New configuration and compilation flag ENABLE_JNI added which will be disabled by default for GS2 since in general GS doesn't need mg and mgpp compiled up with jni. GS3's build.xml will need to explicitly set ENABLE_JNI to compile mg and mgpp with jni.

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