2001-12-01 03:00:13 +08:00
dnl
1999-07-21 23:12:32 +08:00
dnl $Id$
2001-12-01 03:00:13 +08:00
dnl
1999-07-21 23:12:32 +08:00
2002-11-26 20:00:25 +08:00
dnl Suppose we need FlatFile if no support or only CDB is used.
2004-12-30 15:08:39 +08:00
AC_DEFUN([PHP_DBA_STD_BEGIN],[
2003-02-02 02:59:59 +08:00
unset THIS_INCLUDE THIS_LIBS THIS_LFLAGS THIS_PREFIX THIS_RESULT
2002-11-26 20:00:25 +08:00
])
2002-11-16 05:28:42 +08:00
2004-12-30 15:08:39 +08:00
AC_DEFUN([PHP_TEMP_LDFLAGS],[
2001-05-12 17:26:47 +08:00
old_LDFLAGS=$LDFLAGS
2003-01-31 05:36:05 +08:00
LDFLAGS="$1 $LDFLAGS"
2004-09-25 23:29:19 +08:00
old_LIBS=$LIBS
LIBS="$2 $LIBS"
$3
2001-05-12 17:26:47 +08:00
LDFLAGS=$old_LDFLAGS
2004-09-25 23:29:19 +08:00
LIBS=$old_LIBS
1999-07-21 23:12:32 +08:00
])
dnl Assign INCLUDE/LFLAGS from PREFIX
2004-12-30 15:08:39 +08:00
AC_DEFUN([PHP_DBA_STD_ASSIGN],[
2001-05-12 17:26:47 +08:00
if test -n "$THIS_PREFIX" && test "$THIS_PREFIX" != "/usr"; then
2004-11-03 22:32:52 +08:00
THIS_LFLAGS=$THIS_PREFIX/$PHP_LIBDIR
1999-07-21 23:12:32 +08:00
fi
])
dnl Standard check
2004-12-30 15:08:39 +08:00
AC_DEFUN([PHP_DBA_STD_CHECK],[
2007-07-13 22:23:59 +08:00
THIS_RESULT=yes
2002-11-26 20:00:25 +08:00
if test -z "$THIS_INCLUDE"; then
2003-06-14 22:22:13 +08:00
AC_MSG_ERROR([DBA: Could not find necessary header file(s).])
1999-07-21 23:12:32 +08:00
fi
2002-11-26 20:00:25 +08:00
if test -z "$THIS_LIBS"; then
2003-06-14 22:22:13 +08:00
AC_MSG_ERROR([DBA: Could not find necessary library.])
1999-07-21 23:12:32 +08:00
fi
])
dnl Attach THIS_x to DBA_x
2004-12-30 15:08:39 +08:00
AC_DEFUN([PHP_DBA_STD_ATTACH],[
2001-03-28 04:35:04 +08:00
PHP_ADD_LIBRARY_WITH_PATH($THIS_LIBS, $THIS_LFLAGS, DBA_SHARED_LIBADD)
2003-02-02 02:59:59 +08:00
unset THIS_INCLUDE THIS_LIBS THIS_LFLAGS THIS_PREFIX
1999-07-21 23:12:32 +08:00
])
dnl Print the result message
2002-11-26 20:00:25 +08:00
dnl parameters(name [, full name [, empty or error message]])
2007-07-13 22:23:59 +08:00
AC_DEFUN([PHP_DBA_STD_RESULT],[
2002-11-26 20:00:25 +08:00
THIS_NAME=[]translit($1,a-z0-9-,A-Z0-9_)
if test -n "$2"; then
THIS_FULL_NAME="$2"
else
THIS_FULL_NAME="$THIS_NAME"
fi
2007-07-13 22:23:59 +08:00
AC_MSG_CHECKING([for $THIS_FULL_NAME support])
2002-11-26 20:00:25 +08:00
if test -n "$3"; then
AC_MSG_ERROR($3)
fi
2005-11-30 02:26:02 +08:00
if test "$THIS_RESULT" = "yes" || test "$THIS_RESULT" = "builtin"; then
1999-07-21 23:12:32 +08:00
HAVE_DBA=1
2002-11-26 20:00:25 +08:00
eval HAVE_$THIS_NAME=1
2007-07-13 22:23:59 +08:00
AC_MSG_RESULT([$THIS_RESULT])
1999-07-21 23:12:32 +08:00
else
AC_MSG_RESULT(no)
fi
2002-11-26 20:00:25 +08:00
unset THIS_RESULT THIS_NAME THIS_FULL_NAME
1999-07-21 23:12:32 +08:00
])
2007-07-13 22:23:59 +08:00
dnl
dnl Options
dnl
PHP_ARG_ENABLE(dba,,
[ --enable-dba Build DBA with bundled modules. To build shared DBA
2005-06-18 21:28:30 +08:00
extension use --enable-dba=shared])
1999-07-21 23:12:32 +08:00
2007-07-13 22:23:59 +08:00
PHP_ARG_WITH(qdbm,,
[ --with-qdbm[=DIR] DBA: QDBM support], no, no)
2003-12-19 04:25:21 +08:00
2007-07-13 22:23:59 +08:00
PHP_ARG_WITH(gdbm,,
[ --with-gdbm[=DIR] DBA: GDBM support], no, no)
2003-12-19 04:25:21 +08:00
2007-07-13 22:23:59 +08:00
PHP_ARG_WITH(ndbm,,
[ --with-ndbm[=DIR] DBA: NDBM support], no, no)
PHP_ARG_WITH(db4,,
[ --with-db4[=DIR] DBA: Berkeley DB4 support], no, no)
PHP_ARG_WITH(db3,,
[ --with-db3[=DIR] DBA: Berkeley DB3 support], no, no)
PHP_ARG_WITH(db2,,
[ --with-db2[=DIR] DBA: Berkeley DB2 support], no, no)
PHP_ARG_WITH(db1,,
[ --with-db1[=DIR] DBA: Berkeley DB1 support/emulation], no, no)
PHP_ARG_WITH(dbm,,
[ --with-dbm[=DIR] DBA: DBM support], no, no)
2010-03-25 07:38:59 +08:00
PHP_ARG_WITH(tcadb,,
[ --with-tcadb[=DIR] DBA: Tokyo Cabinet abstract DB support], no, no)
2007-07-13 22:23:59 +08:00
dnl
dnl Library checks
dnl
# QDBM
if test "$PHP_QDBM" != "no"; then
PHP_DBA_STD_BEGIN
for i in $PHP_QDBM /usr/local /usr; do
if test -f "$i/include/depot.h"; then
THIS_PREFIX=$i
THIS_INCLUDE=$i/include/depot.h
break
2003-12-19 04:25:21 +08:00
fi
2007-07-13 22:23:59 +08:00
done
if test -n "$THIS_INCLUDE"; then
for LIB in qdbm; do
PHP_CHECK_LIBRARY($LIB, dpopen, [
AC_DEFINE_UNQUOTED(QDBM_INCLUDE_FILE, "$THIS_INCLUDE", [ ])
AC_DEFINE(DBA_QDBM, 1, [ ])
THIS_LIBS=$LIB
], [], [-L$THIS_PREFIX/$PHP_LIBDIR])
if test -n "$THIS_LIBS"; then
2002-11-26 20:00:25 +08:00
break
1999-07-21 23:12:32 +08:00
fi
done
2007-07-13 22:23:59 +08:00
fi
1999-07-21 23:12:32 +08:00
2007-07-13 22:23:59 +08:00
PHP_DBA_STD_ASSIGN
PHP_DBA_STD_CHECK
PHP_DBA_STD_ATTACH
fi
PHP_DBA_STD_RESULT(qdbm)
# GDBM
if test "$PHP_GDBM" != "no"; then
PHP_DBA_STD_BEGIN
if test "$HAVE_QDBM" = "1"; then
PHP_DBA_STD_RESULT(gdbm, gdbm, [You cannot combine --with-gdbm with --with-qdbm])
fi
for i in $PHP_GDBM /usr/local /usr; do
if test -f "$i/include/gdbm.h"; then
THIS_PREFIX=$i
THIS_INCLUDE=$i/include/gdbm.h
break
2002-11-26 20:00:25 +08:00
fi
2007-07-13 22:23:59 +08:00
done
if test -n "$THIS_INCLUDE"; then
PHP_CHECK_LIBRARY(gdbm, gdbm_open, [
AC_DEFINE_UNQUOTED(GDBM_INCLUDE_FILE, "$THIS_INCLUDE", [ ])
AC_DEFINE(DBA_GDBM, 1, [ ])
THIS_LIBS=gdbm
], [], [-L$THIS_PREFIX/$PHP_LIBDIR])
1999-07-21 23:12:32 +08:00
fi
2007-07-13 22:23:59 +08:00
PHP_DBA_STD_ASSIGN
PHP_DBA_STD_CHECK
PHP_DBA_STD_ATTACH
fi
PHP_DBA_STD_RESULT(gdbm)
# NDBM
if test "$PHP_NDBM" != "no"; then
PHP_DBA_STD_BEGIN
for i in $PHP_NDBM /usr/local /usr; do
if test -f "$i/include/ndbm.h"; then
THIS_PREFIX=$i
THIS_INCLUDE=$i/include/ndbm.h
break
elif test -f "$i/include/db1/ndbm.h"; then
THIS_PREFIX=$i
THIS_INCLUDE=$i/include/db1/ndbm.h
break
fi
done
if test -n "$THIS_INCLUDE"; then
for LIB in ndbm db1 c; do
PHP_CHECK_LIBRARY($LIB, dbm_open, [
AC_DEFINE_UNQUOTED(NDBM_INCLUDE_FILE, "$THIS_INCLUDE", [ ])
AC_DEFINE(DBA_NDBM, 1, [ ])
THIS_LIBS=$LIB
], [], [-L$THIS_PREFIX/$PHP_LIBDIR])
if test -n "$THIS_LIBS"; then
2002-11-26 20:00:25 +08:00
break
1999-07-21 23:12:32 +08:00
fi
2002-11-26 20:00:25 +08:00
done
1999-07-21 23:12:32 +08:00
fi
2007-07-13 22:23:59 +08:00
PHP_DBA_STD_ASSIGN
PHP_DBA_STD_CHECK
PHP_DBA_STD_ATTACH
fi
PHP_DBA_STD_RESULT(ndbm)
1999-07-21 23:12:32 +08:00
2010-03-25 07:38:59 +08:00
dnl TCADB
if test "$PHP_TCADB" != "no"; then
PHP_DBA_STD_BEGIN
for i in $PHP_TCADB /usr/local /usr; do
if test -f "$i/include/tcadb.h"; then
THIS_PREFIX=$i
PHP_ADD_INCLUDE($THIS_PREFIX/include)
THIS_INCLUDE=$i/include/tcadb.h
break
fi
done
if test -n "$THIS_INCLUDE"; then
for LIB in tokyocabinet; do
PHP_CHECK_LIBRARY($LIB, tcadbopen, [
AC_DEFINE_UNQUOTED(TCADB_INCLUDE_FILE, "$THIS_INCLUDE", [ ])
AC_DEFINE(DBA_TCADB, 1, [ ])
THIS_LIBS=$LIB
], [], [-L$THIS_PREFIX/$PHP_LIBDIR])
if test -n "$THIS_LIBS"; then
break
fi
done
fi
PHP_DBA_STD_ASSIGN
PHP_DBA_STD_CHECK
PHP_DBA_STD_ATTACH
fi
PHP_DBA_STD_RESULT(tcadb)
2002-11-26 20:00:25 +08:00
dnl Berkeley specific (library and version test)
dnl parameters(version, library list, function)
2004-12-30 15:08:39 +08:00
AC_DEFUN([PHP_DBA_DB_CHECK],[
2007-07-19 18:50:16 +08:00
if test -z "$THIS_INCLUDE"; then
AC_MSG_ERROR([DBA: Could not find necessary header file(s).])
fi
2002-11-26 20:00:25 +08:00
for LIB in $2; do
2005-11-30 02:26:02 +08:00
if test -f $THIS_PREFIX/$PHP_LIBDIR/lib$LIB.a || test -f $THIS_PREFIX/$PHP_LIBDIR/lib$LIB.$SHLIB_SUFFIX_NAME; then
2007-05-21 19:38:53 +08:00
lib_found="";
2004-11-03 22:32:52 +08:00
PHP_TEMP_LDFLAGS(-L$THIS_PREFIX/$PHP_LIBDIR, -l$LIB,[
2003-05-14 14:22:35 +08:00
AC_TRY_LINK([
#include "$THIS_INCLUDE"
],[
2003-05-29 20:33:19 +08:00
$3;
2003-05-14 14:22:35 +08:00
],[
2003-01-31 02:28:42 +08:00
AC_EGREP_CPP(yes,[
2002-11-26 20:00:25 +08:00
#include "$THIS_INCLUDE"
2003-05-14 04:37:54 +08:00
#if DB_VERSION_MAJOR == $1
2003-01-28 14:27:01 +08:00
yes
2003-01-28 08:10:05 +08:00
#endif
2003-01-31 02:28:42 +08:00
],[
THIS_LIBS=$LIB
2007-05-21 19:38:53 +08:00
lib_found=1
2003-01-31 02:28:42 +08:00
])
2003-01-28 14:27:01 +08:00
])
1999-07-21 23:12:32 +08:00
])
2007-05-21 19:38:53 +08:00
if test -n "$lib_found"; then
lib_found="";
break;
fi
2003-01-31 02:28:42 +08:00
fi
2002-11-26 20:00:25 +08:00
done
2003-05-14 04:37:54 +08:00
if test -z "$THIS_LIBS"; then
2010-03-05 13:23:01 +08:00
AC_MSG_CHECKING([for DB$1 major version])
2007-07-19 18:50:16 +08:00
AC_MSG_ERROR([Header contains different version])
2003-05-14 04:37:54 +08:00
fi
2002-12-31 01:42:55 +08:00
if test "$1" = "4"; then
2010-03-05 13:23:01 +08:00
AC_MSG_CHECKING([for DB4 minor version and patch level])
2003-01-28 08:10:05 +08:00
AC_EGREP_CPP(yes,[
2002-12-31 01:42:55 +08:00
#include "$THIS_INCLUDE"
2003-01-28 08:10:05 +08:00
#if DB_VERSION_MINOR != 1 || DB_VERSION_PATCH >= 25
yes
#endif
2002-12-31 01:42:55 +08:00
],[
AC_MSG_RESULT(ok)
],[
2007-07-19 18:50:16 +08:00
AC_MSG_ERROR([Version 4.1 requires patch level 25])
2002-12-31 01:42:55 +08:00
])
fi
2003-12-07 23:59:13 +08:00
if test "$ext_shared" = "yes"; then
2007-07-19 18:50:16 +08:00
AC_MSG_CHECKING([if dba can be used as shared extension])
2003-02-01 04:06:44 +08:00
AC_EGREP_CPP(yes,[
#include "$THIS_INCLUDE"
#if DB_VERSION_MAJOR > 3 || (DB_VERSION_MAJOR == 3 && DB_VERSION_MINOR > 2)
yes
#endif
],[
AC_MSG_RESULT(yes)
],[
2007-07-19 18:50:16 +08:00
AC_MSG_ERROR([At least version 3.3 is required])
2003-02-01 04:06:44 +08:00
])
fi
2002-11-26 20:00:25 +08:00
if test -n "$THIS_LIBS"; then
AC_DEFINE(DBA_DB$1, 1, [ ])
if test -n "$THIS_INCLUDE"; then
AC_DEFINE_UNQUOTED(DB$1_INCLUDE_FILE, "$THIS_INCLUDE", [ ])
fi
2007-07-19 18:50:16 +08:00
else
AC_MSG_ERROR([DBA: Could not find necessary library.])
1999-07-21 23:12:32 +08:00
fi
2007-07-19 18:50:16 +08:00
THIS_RESULT=yes
2005-02-26 07:51:53 +08:00
DB$1_LIBS=$THIS_LIBS
DB$1_PREFIX=$THIS_PREFIX
DB$1_INCLUDE=$THIS_INCLUDE
2002-11-26 20:00:25 +08:00
PHP_DBA_STD_ASSIGN
PHP_DBA_STD_ATTACH
1999-07-21 23:12:32 +08:00
])
2007-07-13 22:23:59 +08:00
# DB4
if test "$PHP_DB4" != "no"; then
PHP_DBA_STD_BEGIN
2007-12-06 22:01:49 +08:00
dbdp="/usr/local/BerkeleyDB.4."
2010-03-05 13:23:01 +08:00
for i in $PHP_DB4 ${dbdp}8 ${dbdp}7 ${dbdp}6 ${dbdp}5 ${dbdp}4 ${dbdp}3 ${dbdp}2 ${dbdp}1 ${dbdp}0 /usr/local /usr; do
2007-07-13 22:23:59 +08:00
if test -f "$i/db4/db.h"; then
THIS_PREFIX=$i
THIS_INCLUDE=$i/db4/db.h
break
2010-03-05 13:23:01 +08:00
elif test -f "$i/include/db4.8/db.h"; then
THIS_PREFIX=$i
THIS_INCLUDE=$i/include/db4.8/db.h
break
elif test -f "$i/include/db4.7/db.h"; then
THIS_PREFIX=$i
THIS_INCLUDE=$i/include/db4.7/db.h
break
2007-12-06 22:01:49 +08:00
elif test -f "$i/include/db4.6/db.h"; then
THIS_PREFIX=$i
THIS_INCLUDE=$i/include/db4.6/db.h
break
2007-07-19 18:50:16 +08:00
elif test -f "$i/include/db4.5/db.h"; then
THIS_PREFIX=$i
THIS_INCLUDE=$i/include/db4.5/db.h
break
2007-07-13 22:23:59 +08:00
elif test -f "$i/include/db4/db.h"; then
THIS_PREFIX=$i
THIS_INCLUDE=$i/include/db4/db.h
break
elif test -f "$i/include/db/db4.h"; then
THIS_PREFIX=$i
THIS_INCLUDE=$i/include/db/db4.h
break
elif test -f "$i/include/db4.h"; then
THIS_PREFIX=$i
THIS_INCLUDE=$i/include/db4.h
break
elif test -f "$i/include/db.h"; then
THIS_PREFIX=$i
THIS_INCLUDE=$i/include/db.h
break
fi
done
2010-03-05 13:23:01 +08:00
PHP_DBA_DB_CHECK(4, db-4.8 db-4.7 db-4.6 db-4.5 db-4.4 db-4.3 db-4.2 db-4.1 db-4.0 db-4 db4 db, [(void)db_create((DB**)0, (DB_ENV*)0, 0)])
2007-07-13 22:23:59 +08:00
fi
PHP_DBA_STD_RESULT(db4,Berkeley DB4)
# DB3
if test "$PHP_DB3" != "no"; then
PHP_DBA_STD_BEGIN
if test "$HAVE_DB4" = "1"; then
PHP_DBA_STD_RESULT(db3, Berkeley DB3, [You cannot combine --with-db3 with --with-db4])
2002-11-26 20:05:59 +08:00
fi
2007-07-13 22:23:59 +08:00
for i in $PHP_DB3 /usr/local/BerkeleyDB.3.3 /usr/local/BerkeleyDB.3.2 /usr/local/BerkeleyDB.3.1 /usr/local/BerkeleyDB.3.0 /usr/local /usr; do
if test -f "$i/db3/db.h"; then
THIS_PREFIX=$i
THIS_INCLUDE=$i/include/db3/db.h
break
elif test -f "$i/include/db3/db.h"; then
THIS_PREFIX=$i
THIS_INCLUDE=$i/include/db3/db.h
break
elif test -f "$i/include/db/db3.h"; then
THIS_PREFIX=$i
THIS_INCLUDE=$i/include/db/db3.h
break
elif test -f "$i/include/db3.h"; then
THIS_PREFIX=$i
THIS_INCLUDE=$i/include/db3.h
break
elif test -f "$i/include/db.h"; then
THIS_PREFIX=$i
THIS_INCLUDE=$i/include/db.h
break
2002-11-26 20:05:59 +08:00
fi
2007-07-13 22:23:59 +08:00
done
PHP_DBA_DB_CHECK(3, db-3.3 db-3.2 db-3.1 db-3.0 db-3 db3 db, [(void)db_create((DB**)0, (DB_ENV*)0, 0)])
fi
PHP_DBA_STD_RESULT(db3,Berkeley DB3)
# DB2
if test "$PHP_DB2" != "no"; then
PHP_DBA_STD_BEGIN
if test "$HAVE_DB3" = "1" || test "$HAVE_DB4" = "1"; then
PHP_DBA_STD_RESULT(db2, Berkeley DB2, [You cannot combine --with-db2 with --with-db3 or --with-db4])
2002-11-26 20:00:25 +08:00
fi
2007-07-13 22:23:59 +08:00
for i in $PHP_DB2 $PHP_DB2/BerkeleyDB /usr/BerkeleyDB /usr/local /usr; do
if test -f "$i/db2/db.h"; then
THIS_PREFIX=$i
THIS_INCLUDE=$i/db2/db.h
break
elif test -f "$i/include/db2/db.h"; then
THIS_PREFIX=$i
THIS_INCLUDE=$i/include/db2/db.h
break
elif test -f "$i/include/db/db2.h"; then
THIS_PREFIX=$i
THIS_INCLUDE=$i/include/db/db2.h
break
elif test -f "$i/include/db2.h"; then
THIS_PREFIX=$i
THIS_INCLUDE=$i/include/db2.h
break
elif test -f "$i/include/db.h"; then
THIS_PREFIX=$i
THIS_INCLUDE=$i/include/db.h
break
1999-11-21 06:50:42 +08:00
fi
2007-07-13 22:23:59 +08:00
done
PHP_DBA_DB_CHECK(2, db-2 db2 db, [(void)db_appinit("", NULL, (DB_ENV*)0, 0)])
fi
PHP_DBA_STD_RESULT(db2, Berkeley DB2)
# DB1
if test "$PHP_DB1" != "no"; then
PHP_DBA_STD_BEGIN
AC_MSG_CHECKING([for DB1 in library])
if test "$HAVE_DB4" = "1"; then
THIS_VERSION=4
THIS_LIBS=$DB4_LIBS
THIS_PREFIX=$DB4_PREFIX
elif test "$HAVE_DB3" = "1"; then
THIS_LIBS=$DB3_LIBS
THIS_PREFIX=$DB3_PREFIX
elif test "$HAVE_DB2" = "1"; then
THIS_VERSION=2
THIS_LIBS=$DB2_LIBS
THIS_PREFIX=$DB2_PREFIX
fi
if test "$HAVE_DB4" = "1" || test "$HAVE_DB3" = "1" || test "$HAVE_DB2" = "1"; then
AC_DEFINE_UNQUOTED(DB1_VERSION, "Berkeley DB 1.85 emulation in DB$THIS_VERSION", [ ])
for i in db$THIS_VERSION/db_185.h include/db$THIS_VERSION/db_185.h include/db/db_185.h; do
if test -f "$THIS_PREFIX/$i"; then
THIS_INCLUDE=$THIS_PREFIX/$i
2002-11-26 20:00:25 +08:00
break
2007-07-13 22:23:59 +08:00
fi
done
else
AC_DEFINE_UNQUOTED(DB1_VERSION, "Unknown DB1", [ ])
for i in $PHP_DB1 /usr/local /usr; do
if test -f "$i/db1/db.h"; then
2002-11-26 20:00:25 +08:00
THIS_PREFIX=$i
2007-07-13 22:23:59 +08:00
THIS_INCLUDE=$i/db1/db.h
2002-11-26 20:00:25 +08:00
break
2007-07-13 22:23:59 +08:00
elif test -f "$i/include/db1/db.h"; then
2002-11-26 20:00:25 +08:00
THIS_PREFIX=$i
2007-07-13 22:23:59 +08:00
THIS_INCLUDE=$i/include/db1/db.h
2002-11-26 20:00:25 +08:00
break
elif test -f "$i/include/db.h"; then
THIS_PREFIX=$i
THIS_INCLUDE=$i/include/db.h
break
fi
1999-11-21 06:50:42 +08:00
done
2007-07-13 22:23:59 +08:00
THIS_LIBS=db
1999-11-21 06:50:42 +08:00
fi
2007-07-13 22:23:59 +08:00
AC_MSG_RESULT([$THIS_LIBS])
AC_MSG_CHECKING([for DB1 in header])
AC_MSG_RESULT([$THIS_INCLUDE])
if test -n "$THIS_INCLUDE"; then
PHP_TEMP_LDFLAGS(-L$THIS_PREFIX/$PHP_LIBDIR, -l$THIS_LIBS,[
AC_TRY_LINK([
2005-02-26 10:15:00 +08:00
#include "$THIS_INCLUDE"
2007-07-13 22:23:59 +08:00
],[
DB * dbp = dbopen("", 0, 0, DB_HASH, 0);
],[
AC_DEFINE_UNQUOTED(DB1_INCLUDE_FILE, "$THIS_INCLUDE", [ ])
AC_DEFINE(DBA_DB1, 1, [ ])
THIS_RESULT=yes
],[
THIS_RESULT=no
2005-02-26 07:51:53 +08:00
])
2007-07-13 22:23:59 +08:00
])
2005-02-26 07:51:53 +08:00
fi
2007-07-13 22:23:59 +08:00
PHP_DBA_STD_ASSIGN
PHP_DBA_STD_CHECK
PHP_DBA_STD_ATTACH
fi
PHP_DBA_STD_RESULT(db1, DB1)
# DBM
if test "$PHP_DBM" != "no"; then
PHP_DBA_STD_BEGIN
if test "$HAVE_QDBM" = "1"; then
PHP_DBA_STD_RESULT(dbm, dbm, [You cannot combine --with-dbm with --with-qdbm])
fi
for i in $PHP_DBM /usr/local /usr; do
if test -f "$i/include/dbm.h"; then
THIS_PREFIX=$i
THIS_INCLUDE=$i/include/dbm.h
break
elif test -f "$i/include/gdbm/dbm.h"; then
THIS_PREFIX=$i
THIS_INCLUDE=$i/include/gdbm/dbm.h
break
2003-12-19 04:25:21 +08:00
fi
2007-07-13 22:23:59 +08:00
done
if test -n "$THIS_INCLUDE"; then
for LIB in dbm c gdbm; do
PHP_CHECK_LIBRARY($LIB, dbminit, [
AC_MSG_CHECKING(for DBM using GDBM)
AC_DEFINE_UNQUOTED(DBM_INCLUDE_FILE, "$THIS_INCLUDE", [ ])
if test "$LIB" = "gdbm"; then
AC_DEFINE_UNQUOTED(DBM_VERSION, "GDBM", [ ])
AC_MSG_RESULT(yes)
else
AC_DEFINE_UNQUOTED(DBM_VERSION, "DBM", [ ])
AC_MSG_RESULT(no)
fi
AC_DEFINE(DBA_DBM, 1, [ ])
THIS_LIBS=$LIB
], [], [-L$THIS_PREFIX/$PHP_LIBDIR])
if test -n "$THIS_LIBS"; then
2003-02-10 03:57:50 +08:00
break
1999-07-21 23:12:32 +08:00
fi
done
fi
2007-07-13 22:23:59 +08:00
PHP_DBA_STD_ASSIGN
PHP_DBA_STD_CHECK
PHP_DBA_STD_ATTACH
fi
PHP_DBA_STD_RESULT(dbm)
dnl
dnl Bundled modules that should be enabled by default if any other option is enabled
dnl
2007-07-13 23:09:19 +08:00
if test "$PHP_DBA" != "no" || test "$HAVE_DBA" = "1" || test "$with_cdb" = "yes" || test "$enable_inifile" = "yes" || test "$enable_flatfile" = "yes"; then
2007-07-13 22:23:59 +08:00
php_dba_enable=yes
else
php_dba_enable=no
fi
PHP_ARG_WITH(cdb,,
[ --without-cdb[=DIR] DBA: CDB support (bundled)], $php_dba_enable, no)
PHP_ARG_ENABLE(inifile,,
[ --disable-inifile DBA: INI support (bundled)], $php_dba_enable, no)
1999-07-21 23:12:32 +08:00
2007-07-13 22:23:59 +08:00
PHP_ARG_ENABLE(flatfile,,
[ --disable-flatfile DBA: FlatFile support (bundled)], $php_dba_enable, no)
# CDB
if test "$PHP_CDB" = "yes"; then
2002-11-16 05:28:42 +08:00
AC_DEFINE(DBA_CDB_BUILTIN, 1, [ ])
AC_DEFINE(DBA_CDB_MAKE, 1, [ ])
AC_DEFINE(DBA_CDB, 1, [ ])
cdb_sources="libcdb/cdb.c libcdb/cdb_make.c libcdb/uint32.c"
THIS_RESULT="builtin"
2007-07-13 22:23:59 +08:00
elif test "$PHP_CDB" != "no"; then
PHP_DBA_STD_BEGIN
for i in $PHP_CDB /usr/local /usr; do
if test -f "$i/include/cdb.h"; then
THIS_PREFIX=$i
THIS_INCLUDE=$i/include/cdb.h
break
fi
done
2002-11-16 05:28:42 +08:00
2007-07-13 22:23:59 +08:00
if test -n "$THIS_INCLUDE"; then
for LIB in cdb c; do
PHP_CHECK_LIBRARY($LIB, cdb_read, [
AC_DEFINE_UNQUOTED(CDB_INCLUDE_FILE, "$THIS_INCLUDE", [ ])
AC_DEFINE(DBA_CDB, 1, [ ])
THIS_LIBS=$LIB
], [], [-L$THIS_PREFIX/$PHP_LIBDIR])
if test -n "$THIS_LIBS"; then
2002-11-26 20:00:25 +08:00
break
1999-07-21 23:12:32 +08:00
fi
2002-11-05 01:53:04 +08:00
done
1999-07-21 23:12:32 +08:00
fi
2007-07-13 22:23:59 +08:00
PHP_DBA_STD_ASSIGN
PHP_DBA_STD_CHECK
PHP_DBA_STD_ATTACH
fi
PHP_DBA_STD_RESULT(cdb)
# INIFILE
if test "$PHP_INIFILE" != "no"; then
2003-02-23 01:20:06 +08:00
AC_DEFINE(DBA_INIFILE, 1, [ ])
ini_sources="libinifile/inifile.c"
THIS_RESULT="builtin"
2007-07-13 22:23:59 +08:00
fi
PHP_DBA_STD_RESULT(inifile, [INI File])
2003-02-23 01:20:06 +08:00
2007-07-13 22:23:59 +08:00
# FLATFILE
if test "$PHP_FLATFILE" != "no"; then
2002-11-16 05:28:42 +08:00
AC_DEFINE(DBA_FLATFILE, 1, [ ])
2003-01-28 08:10:05 +08:00
flat_sources="libflatfile/flatfile.c"
2002-11-16 05:28:42 +08:00
THIS_RESULT="builtin"
2007-07-13 22:23:59 +08:00
fi
PHP_DBA_STD_RESULT(FlatFile, FlatFile)
2002-11-16 05:28:42 +08:00
dnl
2007-07-13 22:23:59 +08:00
dnl Extension setup
dnl
AC_MSG_CHECKING([whether to enable DBA interface])
1999-07-21 23:12:32 +08:00
if test "$HAVE_DBA" = "1"; then
2007-07-13 22:23:59 +08:00
if test "$ext_shared" = "yes"; then
AC_MSG_RESULT([yes, shared])
else
AC_MSG_RESULT([yes])
fi
1999-12-30 12:07:46 +08:00
AC_DEFINE(HAVE_DBA, 1, [ ])
2010-03-25 07:38:59 +08:00
PHP_NEW_EXTENSION(dba, dba.c dba_cdb.c dba_dbm.c dba_gdbm.c dba_ndbm.c dba_db1.c dba_db2.c dba_db3.c dba_db4.c dba_flatfile.c dba_inifile.c dba_qdbm.c dba_tcadb.c $cdb_sources $flat_sources $ini_sources, $ext_shared)
2003-05-29 22:01:21 +08:00
PHP_ADD_BUILD_DIR($ext_builddir/libinifile)
2003-04-01 18:16:12 +08:00
PHP_ADD_BUILD_DIR($ext_builddir/libcdb)
PHP_ADD_BUILD_DIR($ext_builddir/libflatfile)
2000-05-02 11:38:26 +08:00
PHP_SUBST(DBA_SHARED_LIBADD)
1999-07-21 23:12:32 +08:00
else
AC_MSG_RESULT(no)
fi