2004-09-19 18:55:41 +08:00
|
|
|
dnl $Id$
|
|
|
|
dnl config.m4 for extension pdo_sqlite
|
2005-01-07 13:27:27 +08:00
|
|
|
dnl vim:et:sw=2:ts=2:
|
2004-09-19 18:55:41 +08:00
|
|
|
|
2006-05-03 19:12:54 +08:00
|
|
|
PHP_ARG_WITH(pdo-sqlite, for sqlite 3 support for PDO,
|
2007-07-04 01:25:43 +08:00
|
|
|
[ --without-pdo-sqlite[=DIR]
|
2013-08-07 02:06:09 +08:00
|
|
|
PDO: sqlite 3 support. DIR is the sqlite base
|
|
|
|
install directory [BUNDLED]], $PHP_PDO)
|
2006-05-03 19:12:54 +08:00
|
|
|
|
2004-09-19 18:55:41 +08:00
|
|
|
if test "$PHP_PDO_SQLITE" != "no"; then
|
|
|
|
|
2008-07-25 21:46:24 +08:00
|
|
|
if test "$PHP_PDO" = "no" && test "$ext_shared" = "no"; then
|
|
|
|
AC_MSG_ERROR([PDO is not enabled! Add --enable-pdo to your configure line.])
|
|
|
|
fi
|
|
|
|
|
2005-07-27 12:07:11 +08:00
|
|
|
ifdef([PHP_CHECK_PDO_INCLUDES],
|
|
|
|
[
|
|
|
|
PHP_CHECK_PDO_INCLUDES
|
|
|
|
],[
|
|
|
|
AC_MSG_CHECKING([for PDO includes])
|
|
|
|
if test -f $abs_srcdir/include/php/ext/pdo/php_pdo_driver.h; then
|
2011-05-15 13:03:29 +08:00
|
|
|
pdo_cv_inc_path=$abs_srcdir/ext
|
2005-07-27 12:07:11 +08:00
|
|
|
elif test -f $abs_srcdir/ext/pdo/php_pdo_driver.h; then
|
2011-05-15 13:03:29 +08:00
|
|
|
pdo_cv_inc_path=$abs_srcdir/ext
|
2015-02-06 19:06:29 +08:00
|
|
|
elif test -f $phpincludedir/ext/pdo/php_pdo_driver.h; then
|
|
|
|
pdo_cv_inc_path=$phpincludedir/ext
|
2005-07-27 12:07:11 +08:00
|
|
|
else
|
|
|
|
AC_MSG_ERROR([Cannot find php_pdo_driver.h.])
|
|
|
|
fi
|
2011-05-15 13:03:29 +08:00
|
|
|
AC_MSG_RESULT($pdo_cv_inc_path)
|
2005-07-27 12:07:11 +08:00
|
|
|
])
|
2004-09-19 18:55:41 +08:00
|
|
|
|
2005-01-07 13:27:27 +08:00
|
|
|
php_pdo_sqlite_sources_core="pdo_sqlite.c sqlite_driver.c sqlite_statement.c"
|
|
|
|
|
|
|
|
if test "$PHP_PDO_SQLITE" != "yes"; then
|
|
|
|
SEARCH_PATH="$PHP_PDO_SQLITE /usr/local /usr" # you might want to change this
|
|
|
|
SEARCH_FOR="/include/sqlite3.h" # you most likely want to change this
|
|
|
|
if test -r $PHP_PDO_SQLITE/$SEARCH_FOR; then # path given as parameter
|
|
|
|
PDO_SQLITE_DIR=$PHP_PDO_SQLITE
|
|
|
|
else # search default path list
|
|
|
|
AC_MSG_CHECKING([for sqlite3 files in default path])
|
|
|
|
for i in $SEARCH_PATH ; do
|
|
|
|
if test -r $i/$SEARCH_FOR; then
|
|
|
|
PDO_SQLITE_DIR=$i
|
|
|
|
AC_MSG_RESULT(found in $i)
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
if test -z "$PDO_SQLITE_DIR"; then
|
|
|
|
AC_MSG_RESULT([not found])
|
|
|
|
AC_MSG_ERROR([Please reinstall the sqlite3 distribution])
|
|
|
|
fi
|
|
|
|
|
|
|
|
PHP_ADD_INCLUDE($PDO_SQLITE_DIR/include)
|
|
|
|
|
|
|
|
LIBNAME=sqlite3
|
|
|
|
LIBSYMBOL=sqlite3_open
|
|
|
|
|
|
|
|
PHP_CHECK_LIBRARY($LIBNAME,$LIBSYMBOL,
|
|
|
|
[
|
2006-12-24 01:58:47 +08:00
|
|
|
PHP_ADD_LIBRARY_WITH_PATH($LIBNAME, $PDO_SQLITE_DIR/$PHP_LIBDIR, PDO_SQLITE_SHARED_LIBADD)
|
2005-01-07 13:27:27 +08:00
|
|
|
AC_DEFINE(HAVE_PDO_SQLITELIB,1,[ ])
|
|
|
|
],[
|
|
|
|
AC_MSG_ERROR([wrong sqlite lib version or lib not found])
|
|
|
|
],[
|
2006-12-24 01:58:47 +08:00
|
|
|
-L$PDO_SQLITE_DIR/$PHP_LIBDIR -lm
|
2005-01-07 13:27:27 +08:00
|
|
|
])
|
|
|
|
PHP_CHECK_LIBRARY(sqlite3,sqlite3_key,[
|
|
|
|
AC_DEFINE(HAVE_SQLITE3_KEY,1, [have commercial sqlite3 with crypto support])
|
|
|
|
])
|
|
|
|
|
|
|
|
PHP_SUBST(PDO_SQLITE_SHARED_LIBADD)
|
2011-05-15 13:03:29 +08:00
|
|
|
PHP_NEW_EXTENSION(pdo_sqlite, $php_pdo_sqlite_sources_core, $ext_shared,,-I$pdo_cv_inc_path)
|
2005-01-07 13:27:27 +08:00
|
|
|
else
|
2008-08-01 07:25:39 +08:00
|
|
|
# use bundled libs
|
2008-08-01 07:56:32 +08:00
|
|
|
if test "$enable_maintainer_zts" = "yes"; then
|
|
|
|
threadsafe_flags="-DSQLITE_THREADSAFE=1"
|
|
|
|
else
|
|
|
|
threadsafe_flags="-DSQLITE_THREADSAFE=0"
|
|
|
|
fi
|
|
|
|
|
2009-01-13 10:50:54 +08:00
|
|
|
other_flags="-DSQLITE_ENABLE_FTS3=1 -DSQLITE_CORE=1 -DSQLITE_ENABLE_COLUMN_METADATA=1"
|
|
|
|
|
|
|
|
dnl As long as intl is not shared we can have ICU support
|
|
|
|
if test "$PHP_INTL" = "yes" && test "$PHP_INTL_SHARED" != "yes"; then
|
|
|
|
other_flags="$other_flags -DSQLITE_ENABLE_ICU=1"
|
|
|
|
fi
|
2008-08-01 07:56:32 +08:00
|
|
|
|
2009-01-13 03:03:07 +08:00
|
|
|
if test "$PHP_SQLITE3" != "yes"; then
|
|
|
|
PHP_ADD_SOURCES(PHP_EXT_DIR(sqlite3), libsqlite/sqlite3.c)
|
|
|
|
fi
|
|
|
|
|
2005-01-07 13:27:27 +08:00
|
|
|
PHP_NEW_EXTENSION(pdo_sqlite,
|
2008-08-01 07:25:39 +08:00
|
|
|
$php_pdo_sqlite_sources_core,
|
2011-05-15 13:03:29 +08:00
|
|
|
$ext_shared,,-DPDO_SQLITE_BUNDLED=1 $other_flags $threadsafe_flags -I$pdo_cv_inc_path)
|
2005-01-07 13:27:27 +08:00
|
|
|
|
2005-12-31 08:56:06 +08:00
|
|
|
PHP_SUBST(PDO_SQLITE_SHARED_LIBADD)
|
2008-08-01 07:25:39 +08:00
|
|
|
PHP_ADD_EXTENSION_DEP(pdo_sqlite, sqlite3)
|
|
|
|
PHP_ADD_INCLUDE($abs_srcdir/ext/sqlite3/libsqlite)
|
2005-07-27 19:53:00 +08:00
|
|
|
|
2005-01-07 13:27:27 +08:00
|
|
|
AC_CHECK_FUNCS(usleep nanosleep)
|
|
|
|
AC_CHECK_HEADERS(time.h)
|
|
|
|
fi
|
2008-03-07 18:47:32 +08:00
|
|
|
|
2007-06-26 00:26:39 +08:00
|
|
|
dnl Solaris fix
|
|
|
|
PHP_CHECK_LIBRARY(rt, fdatasync, [PHP_ADD_LIBRARY(rt,, PDO_SQLITE_SHARED_LIBADD)])
|
2005-12-31 08:56:06 +08:00
|
|
|
|
2005-09-25 07:23:25 +08:00
|
|
|
ifdef([PHP_ADD_EXTENSION_DEP],
|
2005-07-27 12:07:11 +08:00
|
|
|
[
|
|
|
|
PHP_ADD_EXTENSION_DEP(pdo_sqlite, pdo)
|
|
|
|
])
|
2004-09-19 18:55:41 +08:00
|
|
|
fi
|