1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141
|
dnl Process this file with autoconf to produce a configure script.
AC_INIT(install-sh)
AC_CONFIG_HEADER(config.h)
AC_SUBST(LIBS)
AC_SUBST(PL)
AC_SUBST(PLLIBS)
AC_SUBST(PLBASE)
AC_SUBST(PLARCH)
AC_SUBST(BOOTPL)
AC_SUBST(PLINCLUDE)
AC_SUBST(CIFLAGS)
AC_SUBST(COFLAGS)
AC_SUBST(CWFLAGS)
AC_SUBST(CMFLAGS)
AC_SUBST(ETAGS)
AC_SUBST(LD)
AC_SUBST(SO)
AC_SUBST(LOCALLIB)
AC_SUBST(LDSOFLAGS)
AC_SUBST(SONAMEFLAG)
AC_SUBST(SOWHOLEARCHIVE)
LOCALLIB=
LD=ld
AC_PROG_CC
AC_ARG_WITH(gmp-include,[ --with-gmp-include=DIR DIR holding gmp.h],
[ case $withval in
no|yes) echo 'Specify dir holding gmp.h'
exit 1
;;
*) CIFLAGS="-I$withval $CIFLAGS"
;;
esac
])
AC_ARG_WITH(gmp-lib, [ --with-gmp-lib=DIR DIR holding libgmp.{a,so}],
[ case $withval in
no|yes) echo 'Specify dir holding libgmp.{a,so}'
exit 1
;;
*) LDFLAGS="-L$withval $LDFLAGS"
LOCALLIB="-L$withval -lgmp"
;;
esac
])
plcandidates="pl swipl swi-prolog"
AC_CHECK_PROGS(PL, $plcandidates, "none")
if test $PL = "none"; then
AC_ERROR("Cannot find SWI-Prolog. SWI-Prolog must be installed first")
else
AC_CHECKING("Running $PL -dump-runtime-variables")
eval `$PL -dump-runtime-variables`
fi
if test "$PLSHARED" = "yes"; then
MAKE_SHARED_OBJECT=yes
fi
AC_MSG_RESULT(" PLBASE=$PLBASE")
AC_MSG_RESULT(" PLARCH=$PLARCH")
AC_MSG_RESULT(" PLLIBS=$PLLIBS")
AC_MSG_RESULT(" PLLDFLAGS=$PLLDFLAGS")
AC_MSG_RESULT(" MAKE_SHARED_OBJECT=$MAKE_SHARED_OBJECT")
case "$PLARCH" in
*) LDFLAGS="$PLLDFLAGS $LDFLAGS" ;;
esac
if test "$MAKE_SHARED_OBJECT" = "yes"; then
if test ! -z "$GCC"; then
CMFLAGS="$CMFLAGS -fpic"
fi
SO="so" # Default shared object extension
LD="gcc" # Default linking through gcc
LDSOFLAGS="-shared" # Create a shared object
SONAMEFLAG='-Wl,-soname,$(LIBXPCESOM)' # Set the internal name
SOWHOLEARCHIVE="-Wl,-whole-archive" # Link the whole archive
PLTARGET=soall # Link XPCE dynamically to prolog
case "$OS" in
*solaris* | *sunos5*) LD=/usr/ccs/bin/ld
LDSOFLAGS="-G"
;;
*sunos*) LD=ld
LDSOFLAGS="-assert nodefinitions"
;;
*linux*) ;;
*irix*) ;;
*osf*) if test -z "$GCC"; then
LD=ld
LDSOFLAGS="-shared -expect_unresolved \*"
CMFLAGS="$CMFLAGS -std"
fi
;;
*aix*) SO="o"
LDSOFLAGS="-bI:$PLBASE/include/SWI-Exports"
AC_DEFINE(__unix__)
;;
*hpux*) SO="sl"
LDSOFLAGS="-b"
;;
*) ;;
esac
else
SHLIB=""
fi
AC_CHECK_PROGS(MAKE, gmake make, "make")
AC_CHECK_PROGS(ETAGS, etags ctags, ":")
AC_PROG_INSTALL
AC_PROG_CPP
AC_ISC_POSIX
AC_HEADER_STDC
if test ! -z "$GCC"; then
COFLAGS=-O2
CWFLAGS=-Wall
else
COFLAGS=-O
CWFLAGS=
fi
CFLAGS="$CIFLAGS $CMFLAGS"
AC_FUNC_ALLOCA
AC_C_BIGENDIAN
AC_CHECK_LIB(socket, socket,
[LIBS="$LIBS -lsocket"]
AC_DEFINE(HAVE_LIBSOCKET))
AC_CHECK_LIB(nsl, t_bind,
[LIBS="$LIBS -lnsl"]
AC_DEFINE(HAVE_LIBNSL))
AC_CHECK_LIB(gmp, mpz_init,
[LIBS="$LIBS -lgmp"]
AC_DEFINE(HAVE_LIBGMP))
AC_CHECK_HEADERS(malloc.h unistd.h sys/time.h fcntl.h)
AC_CHECK_FUNCS(setsid strerror)
AC_OUTPUT(Makefile)
|