source: gsdl/trunk/configure.in@ 18629

Last change on this file since 18629 was 18483, checked in by davidb, 15 years ago

Addition of Apache's httpd web server (version 2.x) into runtime-src packages; plus changes to configure and Makefile.in scripts

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