summaryrefslogtreecommitdiff
path: root/ext/dba
diff options
context:
space:
mode:
authorJani Taskinen <jani@php.net>2007-07-13 14:23:59 +0000
committerJani Taskinen <jani@php.net>2007-07-13 14:23:59 +0000
commit9d53e19697d848a46f881f3ba648d8b7d47fbb84 (patch)
tree436f4c7a8718ac30e1dd20a2ab31572290e7cf4d /ext/dba
parent6c5e9cc6e42f3e8ba59e7f0e836e6f34fbc4022c (diff)
downloadphp-git-9d53e19697d848a46f881f3ba648d8b7d47fbb84.tar.gz
MFH: cleanups + fixes
Diffstat (limited to 'ext/dba')
-rw-r--r--ext/dba/config.m4708
1 files changed, 358 insertions, 350 deletions
diff --git a/ext/dba/config.m4 b/ext/dba/config.m4
index 9de99b0a05..c1bdd94ae5 100644
--- a/ext/dba/config.m4
+++ b/ext/dba/config.m4
@@ -27,7 +27,7 @@ AC_DEFUN([PHP_DBA_STD_ASSIGN],[
dnl Standard check
AC_DEFUN([PHP_DBA_STD_CHECK],[
- THIS_RESULT="yes"
+ THIS_RESULT=yes
if test -z "$THIS_INCLUDE"; then
AC_MSG_ERROR([DBA: Could not find necessary header file(s).])
fi
@@ -44,128 +44,154 @@ AC_DEFUN([PHP_DBA_STD_ATTACH],[
dnl Print the result message
dnl parameters(name [, full name [, empty or error message]])
-AC_DEFUN([AC_DBA_STD_RESULT],[
+AC_DEFUN([PHP_DBA_STD_RESULT],[
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
- AC_MSG_CHECKING(for $THIS_FULL_NAME support)
+ AC_MSG_CHECKING([for $THIS_FULL_NAME support])
if test -n "$3"; then
AC_MSG_ERROR($3)
fi
if test "$THIS_RESULT" = "yes" || test "$THIS_RESULT" = "builtin"; then
HAVE_DBA=1
eval HAVE_$THIS_NAME=1
- AC_MSG_RESULT($THIS_RESULT)
+ AC_MSG_RESULT([$THIS_RESULT])
else
AC_MSG_RESULT(no)
fi
unset THIS_RESULT THIS_NAME THIS_FULL_NAME
])
-PHP_ARG_ENABLE(dba,whether to enable DBA,
-[ --enable-dba Build DBA with builtin modules. To build shared DBA
+dnl
+dnl Options
+dnl
+
+PHP_ARG_ENABLE(dba,,
+[ --enable-dba Build DBA with bundled modules. To build shared DBA
extension use --enable-dba=shared])
-AC_ARG_WITH(qdbm,
-[ --with-qdbm[=DIR] DBA: Include QDBM support],[
- if test "$withval" != "no"; then
- PHP_DBA_STD_BEGIN
- for i in $withval /usr/local /usr; do
- if test -f "$i/include/depot.h"; then
- THIS_PREFIX=$i
- THIS_INCLUDE=$i/include/depot.h
- break
- fi
- done
+PHP_ARG_WITH(qdbm,,
+[ --with-qdbm[=DIR] DBA: QDBM support], no, no)
- 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
- break
- fi
- done
- fi
+PHP_ARG_WITH(gdbm,,
+[ --with-gdbm[=DIR] DBA: GDBM support], no, no)
- PHP_DBA_STD_ASSIGN
- PHP_DBA_STD_CHECK
- PHP_DBA_STD_ATTACH
- fi
-])
-AC_DBA_STD_RESULT(qdbm)
-
-AC_ARG_WITH(gdbm,
-[ --with-gdbm[=DIR] DBA: Include GDBM support],[
- if test "$withval" != "no"; then
- PHP_DBA_STD_BEGIN
- if test "$HAVE_QDBM" = "1"; then
- AC_DBA_STD_RESULT(gdbm,gdbm,You cannot combine --with-gdbm with --with-qdbm)
+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)
+
+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
fi
- for i in $withval /usr/local /usr; do
- if test -f "$i/include/gdbm.h"; then
- THIS_PREFIX=$i
- THIS_INCLUDE=$i/include/gdbm.h
+ 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
break
fi
done
+ fi
- 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])
+ 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
fi
-
- PHP_DBA_STD_ASSIGN
- PHP_DBA_STD_CHECK
- PHP_DBA_STD_ATTACH
+ 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])
fi
-])
-AC_DBA_STD_RESULT(gdbm)
-
-AC_ARG_WITH(ndbm,
-[ --with-ndbm[=DIR] DBA: Include NDBM support],[
- if test "$withval" != "no"; then
- PHP_DBA_STD_BEGIN
- for i in $withval /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
+
+ 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
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
- break
- fi
- done
- fi
-
- PHP_DBA_STD_ASSIGN
- PHP_DBA_STD_CHECK
- PHP_DBA_STD_ATTACH
fi
-])
-AC_DBA_STD_RESULT(ndbm)
+
+ PHP_DBA_STD_ASSIGN
+ PHP_DBA_STD_CHECK
+ PHP_DBA_STD_ATTACH
+fi
+PHP_DBA_STD_RESULT(ndbm)
dnl Berkeley specific (library and version test)
dnl parameters(version, library list, function)
@@ -240,96 +266,136 @@ AC_DEFUN([PHP_DBA_DB_CHECK],[
PHP_DBA_STD_ATTACH
])
-AC_ARG_WITH(db4,
-[ --with-db4[=DIR] DBA: Include Berkeley DB4 support],[
- if test "$withval" != "no"; then
- PHP_DBA_STD_BEGIN
- for i in $withval /usr/local/BerkeleyDB.4.2 /usr/local/BerkeleyDB.4.1 /usr/local/BerkeleyDB.4.0 /usr/local /usr; do
- if test -f "$i/db4/db.h"; then
- THIS_PREFIX=$i
- THIS_INCLUDE=$i/db4/db.h
- break
- 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
- PHP_DBA_DB_CHECK(4, 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)])
+# DB4
+if test "$PHP_DB4" != "no"; then
+ PHP_DBA_STD_BEGIN
+ for i in $PHP_DB4 /usr/local/BerkeleyDB.4.2 /usr/local/BerkeleyDB.4.1 /usr/local/BerkeleyDB.4.0 /usr/local /usr; do
+ if test -f "$i/db4/db.h"; then
+ THIS_PREFIX=$i
+ THIS_INCLUDE=$i/db4/db.h
+ break
+ 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
+ PHP_DBA_DB_CHECK(4, 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)])
+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])
fi
-])
-AC_DBA_STD_RESULT(db4,Berkeley DB4)
-
-AC_ARG_WITH(db3,
-[ --with-db3[=DIR] DBA: Include Berkeley DB3 support],[
- if test "$withval" != "no"; then
- PHP_DBA_STD_BEGIN
- if test "$HAVE_DB4" = "1"; then
- AC_DBA_STD_RESULT(db3,Berkeley DB3,You cannot combine --with-db3 with --with-db4)
+ 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
fi
- for i in $withval /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
- fi
- 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)])
+ 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])
fi
-])
-AC_DBA_STD_RESULT(db3,Berkeley DB3)
-
-AC_ARG_WITH(db2,
-[ --with-db2[=DIR] DBA: Include Berkeley DB2 support],[
- if test "$withval" != "no"; then
- PHP_DBA_STD_BEGIN
- if test "$HAVE_DB3" = "1" || test "$HAVE_DB4" = "1"; then
- AC_DBA_STD_RESULT(db2,Berkeley DB2,You cannot combine --with-db2 with --with-db3 or --with-db4)
+ 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
fi
- for i in $withval $withval/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
+ 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
break
- elif test -f "$i/include/db/db2.h"; then
+ 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
THIS_PREFIX=$i
- THIS_INCLUDE=$i/include/db/db2.h
+ THIS_INCLUDE=$i/db1/db.h
break
- elif test -f "$i/include/db2.h"; then
+ elif test -f "$i/include/db1/db.h"; then
THIS_PREFIX=$i
- THIS_INCLUDE=$i/include/db2.h
+ THIS_INCLUDE=$i/include/db1/db.h
break
elif test -f "$i/include/db.h"; then
THIS_PREFIX=$i
@@ -337,215 +403,157 @@ AC_ARG_WITH(db2,
break
fi
done
- PHP_DBA_DB_CHECK(2, db-2 db2 db, [(void)db_appinit("", NULL, (DB_ENV*)0, 0)])
+ THIS_LIBS=db
fi
-])
-AC_DBA_STD_RESULT(db2,Berkeley DB2)
-
-AC_ARG_WITH(db1,
-[ --with-db1[=DIR] DBA: Include Berkeley DB1 support/emulation],[
- if test "$withval" != "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
- break
- fi
- done
- else
- AC_DEFINE_UNQUOTED(DB1_VERSION, "Unknown DB1", [ ])
- for i in $withval /usr/local /usr; do
- if test -f "$i/db1/db.h"; then
- THIS_PREFIX=$i
- THIS_INCLUDE=$i/db1/db.h
- break
- elif test -f "$i/include/db1/db.h"; then
- THIS_PREFIX=$i
- THIS_INCLUDE=$i/include/db1/db.h
- break
- elif test -f "$i/include/db.h"; then
- THIS_PREFIX=$i
- THIS_INCLUDE=$i/include/db.h
- break
- fi
- done
- THIS_LIBS=db
- fi
- 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([
+ 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([
#include "$THIS_INCLUDE"
- ],[
- 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
- ])
+ ],[
+ 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
])
- fi
- PHP_DBA_STD_ASSIGN
- PHP_DBA_STD_CHECK
- PHP_DBA_STD_ATTACH
+ ])
fi
-])
-AC_DBA_STD_RESULT(db1,DB1)
-
-AC_ARG_WITH(dbm,
-[ --with-dbm[=DIR] DBA: Include DBM support],[
- if test "$withval" != "no"; then
- PHP_DBA_STD_BEGIN
- if test "$HAVE_QDBM" = "1"; then
- AC_DBA_STD_RESULT(dbm,dbm,You cannot combine --with-dbm with --with-qdbm)
+ 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
fi
- for i in $withval /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
+ 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
break
fi
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
- break
- fi
- done
- fi
-
- PHP_DBA_STD_ASSIGN
- PHP_DBA_STD_CHECK
- PHP_DBA_STD_ATTACH
fi
-])
-AC_DBA_STD_RESULT(dbm)
+
+ 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
+if test "$PHP_DBA" != "no" || test "$HAVE_DBA" = "1" || test "$with_cdb" != "no" || test "$enable_inifile" != "no" || test "$enable_flatfile" != "no"; then
+ 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)
-AC_DEFUN([PHP_DBA_BUILTIN_CDB],[
+PHP_ARG_ENABLE(flatfile,,
+[ --disable-flatfile DBA: FlatFile support (bundled)], $php_dba_enable, no)
+
+# CDB
+if test "$PHP_CDB" = "yes"; then
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"
-])
+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
-AC_ARG_WITH(cdb,
-[ --with-cdb[=DIR] DBA: Include CDB support],[
- if test "$withval" = "yes" || test "$HAVE_DBA" = "1"; then
- PHP_DBA_BUILTIN_CDB
- elif test "$withval" != "no"; then
- PHP_DBA_STD_BEGIN
- for i in $withval /usr/local /usr; do
- if test -f "$i/include/cdb.h"; then
- THIS_PREFIX=$i
- THIS_INCLUDE=$i/include/cdb.h
+ 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
break
fi
done
-
- 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
- break
- fi
- done
- fi
-
- PHP_DBA_STD_ASSIGN
- PHP_DBA_STD_CHECK
- PHP_DBA_STD_ATTACH
fi
-],[
- if test "$PHP_DBA" != "no" && test "$HAVE_DBA" = "1"; then
- PHP_DBA_BUILTIN_CDB
- fi
-])
-AC_DBA_STD_RESULT(cdb)
-AC_DEFUN([PHP_DBA_BUILTIN_INI],[
+ 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
AC_DEFINE(DBA_INIFILE, 1, [ ])
ini_sources="libinifile/inifile.c"
THIS_RESULT="builtin"
-])
-
-AC_ARG_WITH(inifile,
-[ --with-inifile DBA: Include INI support],[
- if test "$withval" != "no"; then
- PHP_DBA_BUILTIN_INI
- fi
-],[
- if test "$PHP_DBA" != "no" && test "$HAVE_DBA" = "1"; then
- PHP_DBA_BUILTIN_INI
- fi
-])
-AC_DBA_STD_RESULT(inifile,INI File)
+fi
+PHP_DBA_STD_RESULT(inifile, [INI File])
-AC_DEFUN([PHP_DBA_BUILTIN_FLATFILE],[
+# FLATFILE
+if test "$PHP_FLATFILE" != "no"; then
AC_DEFINE(DBA_FLATFILE, 1, [ ])
flat_sources="libflatfile/flatfile.c"
THIS_RESULT="builtin"
-])
+fi
+PHP_DBA_STD_RESULT(FlatFile, FlatFile)
dnl
-dnl FlatFile check must be the last one.
-dnl
-AC_ARG_WITH(flatfile,
-[ --with-flatfile DBA: Include FlatFile support],[
- if test "$withval" != "no"; then
- PHP_DBA_BUILTIN_FLATFILE
- fi
-],[
- if test "$PHP_DBA" != "no" && test "$HAVE_DBA" = "1"; then
- PHP_DBA_BUILTIN_FLATFILE
- fi
-])
-AC_DBA_STD_RESULT(FlatFile,FlatFile)
-
-AC_MSG_CHECKING(whether to enable DBA interface)
+dnl Extension setup
+dnl
+AC_MSG_CHECKING([whether to enable DBA interface])
if test "$HAVE_DBA" = "1"; then
- AC_MSG_RESULT(yes)
+ if test "$ext_shared" = "yes"; then
+ AC_MSG_RESULT([yes, shared])
+ else
+ AC_MSG_RESULT([yes])
+ fi
AC_DEFINE(HAVE_DBA, 1, [ ])
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 $cdb_sources $flat_sources $ini_sources, $ext_shared)
PHP_ADD_BUILD_DIR($ext_builddir/libinifile)