This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.

115 lines
2.4 KiB
Plaintext
Raw Normal View History

dnl Process this file with autoconf to produce a configure script.
AC_INIT(install-sh)
AC_PREREQ([2.50])
AC_CONFIG_HEADER(config.h)
AC_ARG_WITH(prolog,
[ --with-prolog=PLBINARY use given SWI Prolog binary])
AC_SUBST(PL)
AC_SUBST(LD)
AC_SUBST(PLLD)
AC_SUBST(PLLIBS)
AC_SUBST(PLBASE)
AC_SUBST(PLARCH)
AC_SUBST(PLINCL)
AC_SUBST(COFLAGS)
AC_SUBST(CWFLAGS)
AC_SUBST(CMFLAGS)
AC_SUBST(ETAGS)
AC_SUBST(SO)
AC_SUBST(LDSOFLAGS)
AC_SUBST(RUNTEX)
AC_ARG_ENABLE(mt, [ --enable-mt Enable Multi-threading],
[case "$enableval" in
yes) MT=yes
;;
*) ;;
esac])
AC_PROG_CC
LD=$CC
# Do not cache this, it changes too often in many configurations
unset ac_cv_prog_PL
if test -z "$PLINCL"; then
plcandidates="$with_prolog swi-prolog swipl pl"
AC_CHECK_PROGS(PL, $plcandidates, "none")
AC_CHECK_PROGS(PLLD, plld, "none")
if test $PLLD = "none"; then
AC_ERROR("Cannot find SWI-Prolog plld utility. SWI-Prolog must be installed first")
fi
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
PLINCL="$PLBASE/include"
AC_MSG_RESULT(" PLBASE=$PLBASE")
AC_MSG_RESULT(" PLARCH=$PLARCH")
AC_MSG_RESULT(" PLLIBS=$PLLIBS")
AC_MSG_RESULT(" PLLDFLAGS=$PLLDFLAGS")
AC_MSG_RESULT(" PLSHARED=$PLSHARED")
if test "$PLTHREADS" = yes; then MT=yes; fi
else
PLLD=../plld.sh
PL=../pl.sh
fi
if test "$MT" = yes; then
AC_DEFINE([_REENTRANT], 1,
[Define for multi-threaded version])
fi
CC=$PLLD
LD=$PLLD
LDSOFLAGS=-shared
CMFLAGS=-fpic
SO="$PLSOEXT"
if test ! -z "$GCC"; then
COFLAGS="${COFLAGS--O2 -fno-strict-aliasing}"
CWFLAGS="${CWFLAGS--Wall}"
else
COFLAGS="${COFLAGS--O}"
fi
case "$PLARCH" in
*irix*) if test -z "$GCC"; then
CWFLAGS="$CWFLAGS -woff 1164"
fi
;;
*darwin*) CMFLAGS="$CMFLAGS -cc-options,-no-cpp-precomp"
;;
*) ;;
esac
AC_CHECK_PROGS(MAKE, gmake make, "make")
AC_MSG_CHECKING("whether make is GNU-make")
if ($MAKE -v 2>&1) | grep GNU > /dev/null; then
AC_MSG_RESULT(yes)
gmake=yes
else
VPATH="VPATH = "
gmake=no
fi
AC_CHECK_PROGS(ETAGS, etags ctags, ":")
AC_CHECK_PROGS(RUNTEX, runtex, ":")
AC_PROG_INSTALL
AC_PROG_CPP
AC_ISC_POSIX
AC_HEADER_STDC
CFLAGS="$CMFLAGS"
AC_C_BIGENDIAN
AC_C_INLINE
AC_CHECK_SIZEOF(long, 4)
AC_CHECK_HEADERS(malloc.h unistd.h sys/time.h fcntl.h floatingpoint.h)
AC_CHECK_FUNCS(snprintf strerror strtoll)
AC_OUTPUT(Makefile)