82 lines
1.9 KiB
Plaintext
82 lines
1.9 KiB
Plaintext
|
dnl Process this file with autoconf to produce a configure script.
|
||
|
|
||
|
m4_ifdef([HAS_TOP],[m4_ignore],[
|
||
|
AC_INIT(install-sh)
|
||
|
AC_PREREQ([2.50])
|
||
|
AC_CONFIG_HEADER(config.h)
|
||
|
])
|
||
|
|
||
|
PKG_PROSQLITE="packages/prosqlite"
|
||
|
AC_SUBST(PKG_PROSQLITE)
|
||
|
|
||
|
AC_SUBST(PROSQLITE_TARGETS)
|
||
|
AC_SUBST(PROSQLITE_PLTARGETS)
|
||
|
AC_SUBST(PROSQLITE_CFLAGS)
|
||
|
AC_SUBST(PROSQLITE_LDFLAGS)
|
||
|
AC_SUBST(PROSQLITE_LIBS)
|
||
|
|
||
|
m4_ifdef([HAS_TOP],[m4_ignore],[
|
||
|
m4_include([../ac_swi_c.m4])
|
||
|
])
|
||
|
|
||
|
yap_cv_prosqlite=yes
|
||
|
|
||
|
yap_cv_prosqlite=yes
|
||
|
AC_ARG_WITH(sqlite,
|
||
|
[ --with-prosqlite(=location) interface to sqlite],
|
||
|
if test "$withval" = yes; then
|
||
|
PROSQLITE_DIR=/usr
|
||
|
elif test "$withval" = no; then
|
||
|
yap_cv_prosqlite=no
|
||
|
else
|
||
|
PROSQLITE_DIR=$withval
|
||
|
fi,
|
||
|
[PROSQLITE_DIR=/usr ])
|
||
|
|
||
|
havelib=no
|
||
|
|
||
|
if test $yap_cv_prosqlite = yes; then
|
||
|
OCFLAGS="${CFLAGS}"
|
||
|
OCPPFLAGS="${CPPFLAGS}"
|
||
|
OCIFLAGS="${CIFLAGS}"
|
||
|
OLDFLAGS="${LDFLAGS}"
|
||
|
|
||
|
if test ! -z "$PROSQLITE_DIR"; then
|
||
|
PROSQLITE_CFLAGS="-I${PROSQLITE_DIR}/include"
|
||
|
PROSQLITE_LDFLAGS="-L${PROSQLITE_DIR}/lib"
|
||
|
CFLAGS="-I${PROSQLITE_DIR}/include ${CFLAGS}"
|
||
|
CPPFLAGS="-I${PROSQLITE_DIR}/include ${CPPFLAGS}"
|
||
|
CIFLAGS="-I${PROSQLITE_DIR}/include ${CIFLAGS}"
|
||
|
LDFLAGS="-L${PROSQLITE_DIR}/lib ${LDFLAGS}"
|
||
|
fi
|
||
|
|
||
|
AC_CHECK_LIB(sqlite3, sqlite3_open,
|
||
|
PROSQLITE_LIBS="-lsqlite3 $LIBS"
|
||
|
havelib=yes)
|
||
|
|
||
|
AC_CHECK_HEADERS(sqlite3.h, [], [])
|
||
|
|
||
|
CFLAGS="${OCFLAGS}"
|
||
|
CPPFLAGS="${OCPPFLAGS}"
|
||
|
CIFLAGS="${OCIFLAGS}"
|
||
|
LDFLAGS="${OLDFLAGS}"
|
||
|
|
||
|
fi
|
||
|
|
||
|
|
||
|
if test "$havelib" = yes &&
|
||
|
test "$ac_cv_header_sqlite3_h" = yes; then
|
||
|
PROSQLITE_TARGETS="prosqlite.$SO"
|
||
|
PROSQLITE_PLTARGETS="prolog/prosqlite.pl"
|
||
|
else
|
||
|
echo "ERROR: Cannot find odbc library or the header sql.h"
|
||
|
echo "WARNING: PROSQLITE interface will not be built"
|
||
|
PROSQLITE_TARGETS=""
|
||
|
fi
|
||
|
|
||
|
m4_ifdef([HAS_TOP],[m4_ignore],[
|
||
|
AC_OUTPUT(Makefile)
|
||
|
])
|
||
|
|
||
|
|