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