root/gsdl/trunk/configure.in @ 18379

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