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