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