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

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

Changes to makefiles, configure files, and source code to work with the new configure flags that allow indexers to be individually compiled up by setting each indexer to be enabled or disabled (enable-mg, enable-mgpp, enable-lucene).

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