source: main/branches/64_bit_Greenstone/greenstone2/build-src/configure.in@ 23508

Last change on this file since 23508 was 23508, checked in by sjm84, 13 years ago

Committing 64 bit changes into the branch

  • Property svn:executable set to *
File size: 10.4 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()
5AC_CONFIG_HEADER(config.h)
6
7
8PACKAGE=gsdl
9VERSION=2.x-svn
10AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
11AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
12AC_SUBST(PACKAGE)
13AC_SUBST(VERSION)
14
15dnl
16dnl Set use of fast cgi
17dnl
18USE_FASTCGI=0
19if test USE_FASTCGI = 1; then
20AC_DEFINE(USE_FASTCGI)
21AC_SUBST(USE_FASTCGI)
22fi
23
24dnl
25dnl Set use of langaction
26dnl
27dnl USE_LANGACTION=0
28if test USE_LANGACTION = 1; then
29AC_DEFINE(USE_LANGACTION)
30AC_SUBST(USE_LANGACTION)
31fi
32
33dnl
34dnl Set use of corba
35dnl
36AC_ARG_ENABLE(corba, [ --enable-corba Enable CORBA support], USE_CORBA=$enableval, USE_CORBA=no)
37if test $USE_CORBA = "yes" -o $USE_CORBA = "1" ; then
38 USE_CORBA=1
39 AC_DEFINE(USE_CORBA,[])
40else
41 USE_CORBA=0
42fi
43AC_SUBST(USE_CORBA)
44
45AC_ARG_WITH(micodir, [ --with-micodir Use installed MICO directory], MICO_DIR=$withval, MICO_DIR="default")
46AC_DEFINE_UNQUOTED(MICO_DIR, "$MICO_DIR")
47AC_SUBST(MICO_DIR)
48
49dnl
50dnl Set use of z39.50
51dnl
52AC_ARG_ENABLE(z3950, [ --enable-z3950 Enable Z39.50 client support], USE_Z3950=$enableval, USE_Z3950=no)
53if test $USE_Z3950 = "yes" -o $USE_Z3950 = "1" ; then
54 USE_Z3950=1
55 AC_DEFINE(USE_Z3950,[])
56else
57 USE_Z3950=0
58fi
59AC_SUBST(USE_Z3950)
60
61dnl
62dnl Set use of yaz - now compiled by default even when z3950 support not required
63dnl
64AC_ARG_ENABLE(yaz, [ --disable-yaz Disable YAZ compilation], USE_YAZ=$enableval, USE_YAZ=yes)
65if test $USE_YAZ = "yes" -o $USE_YAZ = "1" ; then
66 USE_YAZ=1
67 AC_DEFINE(USE_YAZ,[])
68else
69 USE_YAZ=0
70fi
71AC_SUBST(USE_YAZ)
72
73dnl
74dnl Disable all Java compilation
75dnl
76AC_ARG_ENABLE(java, [ --disable-java Disable Java compilation], ENABLE_JAVA=$enableval, ENABLE_JAVA=yes)
77if test $ENABLE_JAVA = "yes" -o $ENABLE_JAVA = "1" ; then
78 ENABLE_JAVA=1
79 if test "x$JAVA_HOME" != "x" ; then
80 echo "Detected JAVA_HOME is set, however this will not be used during compilation"
81 echo "To control the version of 'javac' and 'java' set environment variables JAVAC"
82 echo "and JAVA respectively"
83 export JAVA_HOME=
84 fi
85else
86 ENABLE_JAVA=0
87fi
88AC_SUBST(ENABLE_JAVA)
89
90dnl
91dnl Set use of JDBM (enabled by default)
92dnl
93AC_ARG_ENABLE(jdbm, [ --disable-jdbm Disable JDBM compilation], USE_JDBM=$enableval, USE_JDBM=yes)
94if test $ENABLE_JAVA = "1" -a \( $USE_JDBM = "yes" -o $USE_JDBM = "1" \) ; then
95 USE_JDBM=1
96 AC_DEFINE(USE_JDBM,[])
97else
98 USE_JDBM=0
99fi
100AC_SUBST(USE_JDBM)
101
102dnl
103dnl Set use of GDBM (enabled by default)
104dnl
105AC_ARG_ENABLE(gdbm, [ --disable-gdbm Disable GDBM compilation], USE_GDBM=$enableval, USE_GDBM=yes)
106if test $USE_GDBM = "yes" -o $USE_GDBM = "1" ; then
107 USE_GDBM=1
108 AC_DEFINE(USE_GDBM,[])
109else
110 USE_GDBM=0
111fi
112AC_SUBST(USE_GDBM)
113
114dnl
115dnl disable compilation of accent folding stuff for mgpp (and one day mg)
116dnl
117AC_ARG_ENABLE(accentfold, [ --disable-accentfold Disable Accent Folding for MGPP], ENABLE_ACCENTFOLD=$enableval, ENABLE_ACCENTFOLD=yes)
118if test $ENABLE_ACCENTFOLD = "yes" -o $ENABLE_ACCENTFOLD = "1" ; then
119 ENABLE_ACCENTFOLD=1
120 AC_DEFINE(ENABLE_ACCENTFOLD,[])
121else
122 ENABLE_ACCENTFOLD=0
123fi
124AC_SUBST(ENABLE_ACCENTFOLD)
125
126dnl
127dnl Set use of SQLite (enabled by default)
128dnl
129AC_ARG_ENABLE(sqlite, [ --disable-sqlite Disable SQLite support], USE_SQLITE=$enableval, USE_SQLITE=yes)
130if test $USE_SQLITE = "yes" -o $USE_SQLITE = "1" ; then
131 USE_SQLITE=1
132 AC_DEFINE(USE_SQLITE,[])
133else
134 USE_SQLITE=0
135fi
136AC_SUBST(USE_SQLITE)
137
138dnl Checks for programs.
139LDFLAGS=$LDFLAGS
140AC_SUBST(LDFLAGS)
141dnl only set CFLAGS if not already set in environment
142if test -z "$CFLAGS"; then
143CFLAGS=-O2
144fi
145AC_SUBST(CFLAGS)
146
147
148AC_PROG_CC
149AC_PROG_CXX
150if test $ENABLE_JAVA = "1" ; then
151 AC_PROG_JAVAC
152 AC_PROG_JAVA
153fi
154AC_PROG_AWK
155AC_PROG_YACC
156dnl get $target_cpu, $target_vendor, and $target_os
157dnl (as well as host_*)
158AC_CANONICAL_SYSTEM
159dnl do we actually want this? It adds a prefix based on host, system etc
160dnl AC_ARG_PROGRAM
161AC_PROG_INSTALL
162AC_PROG_LN_S
163AC_PROG_MAKE_SET
164AC_PROG_RANLIB
165
166dnl AC_MSG_CHECKING(to see if architecture is 64-bit)
167dnl arch_64bit=no
168dnl case "$host_cpu" in
169dnl x86_64) arch_64bit=yes ;;
170dnl esac
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)
234if test $ENABLE_ACCENTFOLD = 1; then
235AC_HAVE_LIBRARY(iconv)
236fi
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 Now check that Perl is actually around, and can be found
300dnl
301AC_MSG_CHECKING(that Perl 5 is available)
302success="no"
303pl_path="$PATH"
304IFS="${IFS= }"; pl_save_ifs="$IFS"; IFS=":"
305for pl_dir in $pl_path; do
306 test -z "$pl_dir" && pl_dir=.
307 if test -x $pl_dir/perl; then
308 success="yes"
309 break
310 fi
311done
312IFS="$pl_save_ifs"
313
314dnl
315dnl Perl actually can be run; now we see if it is version 5 by
316dnl running a sample script (which returns a "clean" version number
317dnl and then tests the result using expr. If perl errors in some
318dnl way (eg. broken Perl executable, missing script), we set a failure
319dnl value ("0") and then proceed as best we can
320dnl
321if test $success = "yes"; then
322try=`perl configtest.pl` || try="0"
323try=`expr $try \> 5.000`
324if test $try = "1"; then
325AC_MSG_RESULT("yes")
326else
327success="no"
328fi
329fi
330
331if test $success = "no"; then
332AC_MSG_RESULT("no")
333AC_MSG_ERROR("Perl 5 not available - cannot install")
334fi
335
336dnl
337dnl Check if the STL library has any known faults;
338dnl In GCC 2.7.2.x series, some STL library headers are missing
339dnl a file called "new" which is referred to by other headers
340dnl (eg. vector/vector.h); if this applies, then all use of the
341dnl STL will cause a compile fail, so we'd better let the user
342dnl know now, before things really go wrong!
343dnl
344success=no
345AC_MSG_CHECKING("whether STL library has known faults")
346
347dnl - first shot, try simple good old vector on its own
348AC_TRY_COMPILE(
349[#include <vector>
350],
351[],
352success=yes,
353)
354
355dnl - try using the .h equivalent
356if test $success = "no"; then
357AC_TRY_COMPILE(
358[#include <vector.h>
359],
360[],
361success="yes",
362)
363fi
364
365dnl - now try for the objectspace headers
366if test $success = "no"; then
367AC_TRY_COMPILE(
368[#include <ospace\\std\\vector>
369],
370[],
371success="yes",
372)
373fi
374
375if test $success = yes; then
376AC_MSG_RESULT("no")
377else
378AC_MSG_RESULT("yes")
379AC_MSG_ERROR("STL Broken - Obtain newer version of GNU C Compiler")
380fi
381
382gsdlos=`uname | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
383# check for running bash under cygwin
384 if test "`echo $gsdlos | sed 's/cygwin//'`" != "$gsdlos" ;
385 then
386 gsdlos=windows
387 fi
388AC_SUBST(gsdlos)
389
390# check for endianness
391AC_C_BIGENDIAN
392# ---------------------------------------------------------------------------
393if test "$ac_cv_func_alloca" = 'no'; then
394dnl support functions for alloca.c
395 AC_LIBOBJ([xmalloc.o])
396 AC_LIBOBJ([error])
397fi
398
399# ---------------------------------------------------------------------------
400
401dnl
402dnl Locate all children of the modules folder
403dnl
404moduleDirs=""
405MODULEDIRS=""
406if test -d modules ; then
407 for x in `find modules -mindepth 1 -maxdepth 2`; do
408 if test -d "$x"; then
409 d="$x/Makefile.in"
410 if test -e "$d"; then
411 dnl echo $d
412 moduleDirs="$moduleDirs $x/Makefile"
413 MODULEDIRS="$MODULEDIRS $x"
414 fi
415 fi
416 done
417 echo "Making $moduleDirs in modules directory"
418 AC_SUBST(MODULEDIRS)
419fi
420
421
422# ---------------------------------------------------------------------------
423AC_CONFIG_SUBDIRS(packages)
424
425# the list of folders in the src folder
426srclist="src/hashfile/Makefile \
427 src/phind/generate/Makefile \
428 src/java/org/nzdl/gsdl/Makefile"
429
430AC_OUTPUT(packages/Makefile Makefile $srclist $moduleDirs)
431
432
Note: See TracBrowser for help on using the repository browser.