root/main/trunk/greenstone2/configure.in @ 21330

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