root/gsdl/trunk/build-src/configure.in @ 18375

Revision 18214, 9.1 KB (checked in by mdewsnip, 11 years ago)

Removed --with-gdbm option and no longer checks for GDBM library existing, because we know we have it.

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