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

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

Added enable-indexer processing.

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