root/gs2runtime/configure.in @ 16613

Revision 16613, 10.5 KB (checked in by davidb, 12 years ago)

configure regenerated

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