source: gsdl/trunk/runtime-src/configure.in@ 18483

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