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

Last change on this file since 24901 was 24901, checked in by ak19, 12 years ago

GSDLARCH used in Linux makefiles when working out the cgi-bin path (now cgi-bin\GSDL_OS_ARCH) to install the binaries into.

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