source: main/trunk/gs2build/configure.in@ 21371

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

ENABLE_JNI switch added in

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