[552] | 1 | dnl Process this file with autoconf to produce a configure script.
|
---|
| 2 | AC_INIT(lib/text_t.h)
|
---|
[684] | 3 | AC_CONFIG_HEADER(config.h)
|
---|
[552] | 4 |
|
---|
[554] | 5 | PACKAGE=gsdl
|
---|
[674] | 6 | VERSION=2.1
|
---|
[552] | 7 | AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
|
---|
| 8 | AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
|
---|
| 9 | AC_SUBST(PACKAGE)
|
---|
| 10 | AC_SUBST(VERSION)
|
---|
[567] | 11 |
|
---|
[1860] | 12 | dnl
|
---|
| 13 | dnl Set use of fast cgi
|
---|
| 14 | dnl
|
---|
[566] | 15 | USE_FASTCGI=0
|
---|
| 16 | if test USE_FASTCGI = 1; then
|
---|
| 17 | AC_DEFINE(USE_FASTCGI)
|
---|
| 18 | AC_SUBST(USE_FASTCGI)
|
---|
| 19 | fi
|
---|
[552] | 20 |
|
---|
[1860] | 21 | dnl
|
---|
| 22 | dnl Set use of corba
|
---|
| 23 | dnl
|
---|
[2470] | 24 | AC_ARG_ENABLE(corba, [ --enable-corba Enable CORBA support], USE_CORBA=1, USE_CORBA=0)
|
---|
[2296] | 25 | AC_DEFINE_UNQUOTED(USE_CORBA, $USE_CORBA)
|
---|
[2051] | 26 | AC_SUBST(USE_CORBA)
|
---|
[1860] | 27 |
|
---|
[2470] | 28 | AC_ARG_WITH(micodir, [ --with-micodir Use installed MICO directory], MICO_DIR=$enableval, MICO_DIR="default")
|
---|
[2296] | 29 | AC_DEFINE_UNQUOTED(MICO_DIR, "$MICO_DIR")
|
---|
[2051] | 30 | AC_SUBST(MICO_DIR)
|
---|
[1860] | 31 |
|
---|
[1938] | 32 | dnl
|
---|
| 33 | dnl Set use of z39.50
|
---|
| 34 | dnl
|
---|
| 35 | AC_ARG_ENABLE(z3950, [ --enable-z3950 Enable Z39.50 client support], USE_Z3950=1, USE_Z3950=0)
|
---|
[2296] | 36 | if test USE_Z3950 = 1; then
|
---|
| 37 | AC_DEFINE(USE_Z3950, $USE_Z3950)
|
---|
[1938] | 38 | AC_SUBST(USE_Z3950)
|
---|
[2296] | 39 | fi
|
---|
[1938] | 40 |
|
---|
[2279] | 41 | dnl
|
---|
| 42 | dnl look for libgdbm if not in standard location
|
---|
| 43 | dnl
|
---|
| 44 | AC_ARG_WITH(gdbm, [ --with-gdbm=dir Use local gdbm library and headers], gdbmdir=$withval)
|
---|
| 45 |
|
---|
[552] | 46 | dnl Checks for programs.
|
---|
[794] | 47 | LDFLAGS=
|
---|
[1722] | 48 | dnl only set CFLAGS if not already set in environment
|
---|
| 49 | if test -z "$CFLAGS"; then
|
---|
[794] | 50 | CFLAGS=-O2
|
---|
[1722] | 51 | fi
|
---|
[575] | 52 | AC_SUBST(CFLAGS)
|
---|
| 53 |
|
---|
[552] | 54 | AC_PROG_CC
|
---|
| 55 | AC_PROG_CXX
|
---|
[684] | 56 | AC_PROG_AWK
|
---|
| 57 | AC_PROG_YACC
|
---|
[2279] | 58 | dnl get $target_cpu, $target_vendor, and $target_os
|
---|
| 59 | dnl (as well as host_*)
|
---|
| 60 | AC_CANONICAL_SYSTEM
|
---|
| 61 | dnl do we actually want this? It adds a prefix based on host, system etc
|
---|
| 62 | dnl AC_ARG_PROGRAM
|
---|
[703] | 63 | AC_PROG_INSTALL
|
---|
[552] | 64 | AC_PROG_LN_S
|
---|
| 65 | AC_PROG_MAKE_SET
|
---|
| 66 | AC_PROG_RANLIB
|
---|
| 67 |
|
---|
[2173] | 68 | #moved CORBA MICO directory test to get version of MICO
|
---|
| 69 | if test $USE_CORBA = 1; then
|
---|
| 70 |
|
---|
[2213] | 71 | if test $MICO_DIR = "default"; then
|
---|
[2173] | 72 | #do something
|
---|
| 73 | MICO_INC="-I packages/mico/mico/include"
|
---|
| 74 | else
|
---|
| 75 | #build the micotest program
|
---|
| 76 | MICO_INC= ""
|
---|
| 77 | if test $MICO_DIR != yes; then
|
---|
| 78 | MICO_INC="-I $MICO_DIR"
|
---|
| 79 | fi
|
---|
| 80 | fi
|
---|
| 81 |
|
---|
| 82 | #get MICO_VER value
|
---|
| 83 | sh -c "$CC -c micotest.cpp -o micotest.o $MICO_INC 2>&1" > /dev/null
|
---|
| 84 | sh -c "$CC -o micotest micotest.o -lstdc++ 2>&1" > /dev/null
|
---|
[2214] | 85 | MICO_VER=`./micotest` || MICO_VER=2.3.5
|
---|
[2173] | 86 | sh -c "rm micotest"
|
---|
| 87 | sh -c "rm micotest.o"
|
---|
| 88 |
|
---|
| 89 | #do test of MICO_VER
|
---|
| 90 | if test MICO_VER != 0; then
|
---|
| 91 | AC_DEFINE(MICO_VER)
|
---|
| 92 | AC_SUBST(MICO_VER)
|
---|
| 93 | fi
|
---|
| 94 | #end USE_CORBA test
|
---|
| 95 | fi
|
---|
| 96 |
|
---|
[684] | 97 | dnl Checks for typedefs, structures, and compiler characteristics.
|
---|
| 98 | AC_AIX
|
---|
| 99 | AC_ISC_POSIX
|
---|
| 100 | AC_MINIX
|
---|
| 101 | fp_C_PROTOTYPES
|
---|
| 102 | AC_C_CONST
|
---|
| 103 | AC_TYPE_OFF_T
|
---|
| 104 | AC_TYPE_SIZE_T
|
---|
| 105 | AC_HEADER_TIME
|
---|
| 106 | AC_STRUCT_TM
|
---|
| 107 |
|
---|
| 108 | dnl --- This should be in the stdc checking -----------------
|
---|
| 109 | if test "$ac_cv_prog_cc_stdc" = '-Xc'; then
|
---|
| 110 | dnl The Pyramids running SMP_DC.OSx on MIPS r3000 chips with
|
---|
| 111 | dnl /usr/opt/cc3.11/bin/cc treat -Xc as full ANSI mode - no POSIX or
|
---|
| 112 | dnl XOPEN extensions (like popen).
|
---|
| 113 | dnl Unfortunately -D_{XOPEN,POSIX}_SOURCE can't provide all that mg
|
---|
| 114 | dnl needs. So drop back to -Xa
|
---|
| 115 | AC_TRY_COMPILE(
|
---|
| 116 | [#include <stdio.h>
|
---|
| 117 | ], [ FILE *rubbish = popen("yes", "r"); ],,
|
---|
| 118 | [CC="`echo $CC | sed 's/-Xc/-Xa/'`" ac_cv_prog_cc_stdc='-Xa'])
|
---|
| 119 | fi
|
---|
| 120 | dnl ----------------------
|
---|
| 121 |
|
---|
| 122 |
|
---|
[552] | 123 | dnl Checks for libraries.
|
---|
| 124 | dnl Replace `main' with a function in -lg:
|
---|
| 125 | AC_CHECK_LIB(g, main)
|
---|
| 126 | dnl Replace `main' with a function in -lgdbm:
|
---|
| 127 | AC_CHECK_LIB(gdbm, main)
|
---|
| 128 | dnl Replace `main' with a function in -lm:
|
---|
| 129 | AC_CHECK_LIB(m, main)
|
---|
[986] | 130 | dnl Replace `main' with a function in -lstdc++:
|
---|
| 131 | AC_CHECK_LIB(stdc++, main)
|
---|
| 132 | dnl Replace `main' with a function in -lcrypt:
|
---|
| 133 | AC_CHECK_LIB(crypt, main)
|
---|
[552] | 134 |
|
---|
[986] | 135 |
|
---|
[552] | 136 | dnl Checks for header files.
|
---|
[684] | 137 | AC_HEADER_DIRENT
|
---|
[552] | 138 | AC_HEADER_STDC
|
---|
[998] | 139 | AC_CHECK_HEADERS(fcntl.h limits.h sys/time.h unistd.h crypt.h string.h memory.h sys/procfs.h)
|
---|
[684] | 140 | AC_EGREP_HEADER(fread, stdio.h, AC_DEFINE(HAVE_FREAD_DECL))
|
---|
| 141 | AC_EGREP_HEADER(fgetc, stdio.h, AC_DEFINE(HAVE_FGETC_DECL))
|
---|
| 142 | AC_EGREP_HEADER(pr_brksize, sys/procfs.h, AC_DEFINE(HAVE_PR_BRKSIZE))
|
---|
[552] | 143 |
|
---|
[684] | 144 | dnl Checks for library functions.
|
---|
| 145 | AC_FUNC_ALLOCA
|
---|
| 146 | AC_PROG_GCC_TRADITIONAL
|
---|
| 147 | AC_TYPE_SIGNAL
|
---|
| 148 | AC_FUNC_VPRINTF
|
---|
[786] | 149 | AC_CHECK_FUNCS(ftime select strftime strtol getrusage times mallinfo setbuffer getpagesize strerror)
|
---|
[684] | 150 | AC_REPLACE_FUNCS(ftruncate strstr strcasecmp)
|
---|
[552] | 151 |
|
---|
| 152 |
|
---|
[684] | 153 | # *** Custom checking (based on GNU tar configure.in) ***
|
---|
| 154 | # ---------------------------------------------------------------------------
|
---|
| 155 | AC_MSG_CHECKING(for HP-UX needing gmalloc)
|
---|
| 156 | if test "`(uname -s) 2> /dev/null`" = 'HP-UX'; then
|
---|
| 157 | AC_MSG_RESULT(yes)
|
---|
| 158 | LIBOBJS="$LIBOBJS gmalloc.o"
|
---|
| 159 | AC_DEFINE(HAVE_VALLOC)
|
---|
| 160 | else
|
---|
| 161 | AC_MSG_RESULT(no)
|
---|
| 162 | AC_CHECK_FUNCS(valloc)
|
---|
| 163 | fi
|
---|
| 164 |
|
---|
| 165 | fp_WITH_DMALLOC
|
---|
| 166 | fp_WITH_REGEX
|
---|
| 167 |
|
---|
| 168 | # ---------------------------------------------------------------------------
|
---|
| 169 | if test "$ac_cv_func_alloca" = 'no'; then
|
---|
| 170 | dnl support functions for alloca.c
|
---|
| 171 | LIBOBJS="$LIBOBJS xmalloc.o error.o"
|
---|
| 172 | fi
|
---|
| 173 |
|
---|
| 174 |
|
---|
| 175 | # ---------------------------------------------------------------------------
|
---|
| 176 |
|
---|
[552] | 177 | dnl
|
---|
[684] | 178 | dnl Switch into C++
|
---|
| 179 | dnl
|
---|
| 180 | AC_LANG_CPLUSPLUS
|
---|
| 181 |
|
---|
| 182 | dnl
|
---|
| 183 | dnl Check that the GDBM library is available
|
---|
| 184 | dnl
|
---|
[2279] | 185 | dnl check libgdbm manually, in case it's not in the standard location.
|
---|
| 186 |
|
---|
| 187 | AC_MSG_CHECKING(that the GDBM library is available)
|
---|
[2470] | 188 | if test ! -z "$gdbmdir" ; then
|
---|
[2279] | 189 | # look in given directory for header file
|
---|
[2884] | 190 | if test -r $gdbmdir/include/gdbm.h ; then
|
---|
[2279] | 191 | GDBM_INCLUDE="-I$gdbmdir/include" ;
|
---|
[2884] | 192 | elif test -r $gdbmdir/gdbm.h ; then
|
---|
[2279] | 193 | GDBM_INCLUDE="-I$gdbmdir" ;
|
---|
| 194 | fi
|
---|
| 195 |
|
---|
| 196 | # look in given directory for library
|
---|
[2884] | 197 | if test -r $gdbmdir/libgdbm.a ; then
|
---|
[2279] | 198 | GDBM_LIBPATH="-L$gdbmdir" ;
|
---|
[2884] | 199 | elif test -r $gdbmdir/lib/libgdbm.a ; then
|
---|
[2279] | 200 | GDBM_LIBPATH="-L$gdbmdir/lib" ;
|
---|
[2884] | 201 | elif test -r $gdbmdir/.libs/libgdbm.a ; then
|
---|
[2279] | 202 | GDBM_LIBPATH="-L$gdbmdir/.libs" ;
|
---|
| 203 | fi
|
---|
| 204 |
|
---|
[2470] | 205 | if test ! -z "$GDBM_LIBPATH" -a ! -z "$GDBM_INCLUDE" ; then
|
---|
[2279] | 206 | AC_MSG_RESULT($gdbmdir) ;
|
---|
| 207 | else
|
---|
[2603] | 208 | AC_MSG_RESULT(can't find gdbm.h and libgdbm.a in $gdbmdir);
|
---|
[2279] | 209 | AC_MSG_CHECKING( looking for GDBM library in default locations)
|
---|
| 210 | fi
|
---|
| 211 | fi
|
---|
| 212 |
|
---|
[2603] | 213 | # look in default path and in /usr/local
|
---|
[2470] | 214 | if test -z "$GDBM_INCLUDE" ; then
|
---|
[2279] | 215 | # try in system directory
|
---|
| 216 | AC_TRY_COMPILE(
|
---|
| 217 | [#include <gdbm.h>
|
---|
[684] | 218 | ],
|
---|
[2279] | 219 | [],
|
---|
| 220 | success=yes,
|
---|
| 221 | success=no
|
---|
| 222 | )
|
---|
[2603] | 223 |
|
---|
| 224 | if test $success = "no"; then
|
---|
| 225 | # last chance - look in /usr/local (eg FreeBSD)
|
---|
| 226 | GDBM_LIBPATH=-L/usr/local/lib
|
---|
| 227 | GDBM_INCLUDE=-I/usr/local/include
|
---|
| 228 | ac_save_CXXFLAGS="$CXXFLAGS"
|
---|
| 229 | ac_save_LIBS="$LIBS"
|
---|
| 230 | CXXFLAGS="$CXXFLAGS -I/usr/local/include"
|
---|
| 231 | LIBS="$LIBS -L/usr/local/lib -lgdbm"
|
---|
| 232 | AC_TRY_LINK(
|
---|
| 233 | [#include <gdbm.h>
|
---|
| 234 | #include <stdio.h>
|
---|
| 235 | ],
|
---|
| 236 | [printf("%s",gdbm_version);],
|
---|
| 237 | success=/usr/local,
|
---|
| 238 | success=no
|
---|
| 239 | )
|
---|
| 240 | CXXFLAGS=$ac_save_CXXFLAGS
|
---|
| 241 | LIBS=$ac_save_LIBS
|
---|
| 242 | fi
|
---|
| 243 |
|
---|
[2279] | 244 | AC_MSG_RESULT($success)
|
---|
| 245 | if test $success = "no"; then
|
---|
| 246 | AC_MSG_ERROR(GDBM Library not available - cannot install)
|
---|
| 247 | fi
|
---|
[684] | 248 | fi
|
---|
[2603] | 249 | dnl I don't think anything actually checks this define, but...
|
---|
| 250 | AC_DEFINE(HAVE_LIBGDBM , 1)
|
---|
[684] | 251 |
|
---|
[2279] | 252 | AC_SUBST(GDBM_LIBPATH)
|
---|
| 253 | AC_SUBST(GDBM_INCLUDE)
|
---|
| 254 |
|
---|
[684] | 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 |
|
---|
[684] | 347 | # ---------------------------------------------------------------------------
|
---|
| 348 | if test "$ac_cv_func_alloca" = 'no'; then
|
---|
| 349 | dnl support functions for alloca.c
|
---|
| 350 | LIBOBJS="$LIBOBJS xmalloc.o error.o"
|
---|
| 351 | fi
|
---|
[552] | 352 |
|
---|
[3062] | 353 | # ---------------------------------------------------------------------------
|
---|
[552] | 354 |
|
---|
[3062] | 355 | dnl
|
---|
| 356 | dnl Locate all children of the modules folder
|
---|
| 357 | dnl
|
---|
| 358 | moduleDirs=""
|
---|
| 359 | MODULEDIRS=""
|
---|
| 360 | for x in `find modules -mindepth 1 -maxdepth 2`; do
|
---|
| 361 | if test -d "$x"; then
|
---|
| 362 | d="$x/Makefile.in"
|
---|
| 363 | if test -e "$d"; then
|
---|
| 364 | dnl echo $d
|
---|
| 365 | moduleDirs="$moduleDirs $x/Makefile"
|
---|
| 366 | MODULEDIRS="$MODULEDIRS $x"
|
---|
| 367 | fi
|
---|
| 368 | fi
|
---|
| 369 | done
|
---|
| 370 | echo "Making$moduleDirs in modules directory"
|
---|
| 371 | AC_SUBST(MODULEDIRS)
|
---|
| 372 |
|
---|
[684] | 373 | # ---------------------------------------------------------------------------
|
---|
[2279] | 374 | dnl for Darwin, as our packages don't (yet) correctly guess our system type.
|
---|
| 375 | ac_configure_args="$ac_configure_args --host=$host --target=$target"
|
---|
[1668] | 376 | AC_CONFIG_SUBDIRS(packages)
|
---|
| 377 |
|
---|
[3062] | 378 | # the list of folders in the src folder
|
---|
| 379 | srclist="src/mgpp/lib/Makefile src/mgpp/text/Makefile src/mgpp/Makefile \
|
---|
| 380 | src/hashfile/Makefile src/colservr/Makefile src/recpt/Makefile src/txt2db/Makefile \
|
---|
| 381 | src/db2txt/Makefile src/getpw/Makefile src/phind/generate/Makefile"
|
---|
| 382 |
|
---|
[1938] | 383 | AC_OUTPUT(packages/Makefile packages/mg/Makefile packages/mg/src/text/Makefile packages/mg/src/images/Makefile
|
---|
[3062] | 384 | packages/mg/src/scripts/Makefile packages/mg/lib/Makefile
|
---|
| 385 | lib/Makefile Makefile $srclist $moduleDirs)
|
---|
[684] | 386 |
|
---|
| 387 |
|
---|