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