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