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
|
|
|
|
2001-05-12 17:26:47 +08:00
|
|
|
AC_DEFUN(PHP_TEMP_LDFLAGS,[
|
|
|
|
old_LDFLAGS=$LDFLAGS
|
1999-07-21 23:12:32 +08:00
|
|
|
LDFLAGS="$1 $LDFLAGS"
|
|
|
|
$2
|
2001-05-12 17:26:47 +08:00
|
|
|
LDFLAGS=$old_LDFLAGS
|
1999-07-21 23:12:32 +08:00
|
|
|
])
|
|
|
|
|
|
|
|
|
|
|
|
dnl Assign INCLUDE/LFLAGS from PREFIX
|
2001-05-12 17:26:47 +08:00
|
|
|
AC_DEFUN(PHP_DBA_STD_ASSIGN,[
|
|
|
|
if test -n "$THIS_PREFIX" && test "$THIS_PREFIX" != "/usr"; then
|
2001-05-12 18:33:52 +08:00
|
|
|
THIS_INCLUDE=$THIS_PREFIX/include
|
|
|
|
THIS_LFLAGS=$THIS_PREFIX/lib
|
1999-07-21 23:12:32 +08:00
|
|
|
fi
|
|
|
|
])
|
|
|
|
|
|
|
|
dnl Standard check
|
2001-05-12 17:26:47 +08:00
|
|
|
AC_DEFUN(PHP_DBA_STD_CHECK,[
|
1999-07-21 23:12:32 +08:00
|
|
|
THIS_RESULT="yes"
|
2000-10-21 08:35:10 +08:00
|
|
|
if test "$THIS_PREFIX" != "/usr" -a "$THIS_INCLUDE" = ""; then
|
1999-07-21 23:12:32 +08:00
|
|
|
AC_MSG_ERROR(cannot find necessary header file(s))
|
|
|
|
fi
|
2000-10-21 08:35:10 +08:00
|
|
|
if test "$THIS_LIBS" = "" ; then
|
|
|
|
AC_MSG_ERROR(cannot find necessary library)
|
1999-07-21 23:12:32 +08:00
|
|
|
fi
|
|
|
|
])
|
|
|
|
|
|
|
|
dnl Attach THIS_x to DBA_x
|
2001-05-12 17:26:47 +08:00
|
|
|
AC_DEFUN(PHP_DBA_STD_ATTACH,[
|
2001-03-28 04:35:04 +08:00
|
|
|
PHP_ADD_INCLUDE($THIS_INCLUDE)
|
|
|
|
PHP_ADD_LIBRARY_WITH_PATH($THIS_LIBS, $THIS_LFLAGS, DBA_SHARED_LIBADD)
|
2001-05-12 18:33:52 +08:00
|
|
|
unset THIS_INCLUDE THIS_LIBS THIS_LFLAGS THIS_PREFIX
|
1999-07-21 23:12:32 +08:00
|
|
|
])
|
|
|
|
|
|
|
|
dnl Print the result message
|
|
|
|
AC_DEFUN(AC_DBA_STD_RESULT,[
|
2002-11-05 01:53:04 +08:00
|
|
|
if test "$THIS_RESULT" = "yes" -o "$THIS_RESULT" = "builtin"; then
|
1999-07-21 23:12:32 +08:00
|
|
|
HAVE_DBA=1
|
2002-11-05 01:53:04 +08:00
|
|
|
AC_MSG_RESULT($THIS_RESULT)
|
1999-07-21 23:12:32 +08:00
|
|
|
else
|
|
|
|
AC_MSG_RESULT(no)
|
|
|
|
fi
|
2001-05-12 18:33:52 +08:00
|
|
|
unset THIS_RESULT
|
1999-07-21 23:12:32 +08:00
|
|
|
])
|
|
|
|
|
2000-05-02 11:38:26 +08:00
|
|
|
PHP_ARG_ENABLE(dba,whether to enable DBA,
|
|
|
|
[ --enable-dba=shared Build DBA as a shared module])
|
1999-07-21 23:12:32 +08:00
|
|
|
|
|
|
|
AC_ARG_WITH(gdbm,
|
|
|
|
[ --with-gdbm[=DIR] Include GDBM support],[
|
|
|
|
if test "$withval" != "no"; then
|
|
|
|
for i in /usr/local /usr $withval; do
|
|
|
|
if test -f "$i/include/gdbm.h"; then
|
|
|
|
THIS_PREFIX="$i"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
unset ac_cv_lib_gdbm_gdbm_open
|
2001-05-12 17:26:47 +08:00
|
|
|
PHP_TEMP_LDFLAGS(-L$THIS_PREFIX/lib,[
|
2001-05-12 18:33:52 +08:00
|
|
|
AC_CHECK_LIB(gdbm, gdbm_open, [AC_DEFINE(DBA_GDBM, 1, [ ]) THIS_LIBS=gdbm])
|
1999-07-21 23:12:32 +08:00
|
|
|
])
|
|
|
|
|
2001-05-12 17:26:47 +08:00
|
|
|
PHP_DBA_STD_ASSIGN
|
|
|
|
PHP_DBA_STD_CHECK
|
|
|
|
PHP_DBA_STD_ATTACH
|
1999-07-21 23:12:32 +08:00
|
|
|
fi
|
|
|
|
])
|
|
|
|
AC_MSG_CHECKING(for GDBM support)
|
|
|
|
AC_DBA_STD_RESULT
|
|
|
|
|
|
|
|
AC_ARG_WITH(ndbm,
|
|
|
|
[ --with-ndbm[=DIR] Include NDBM support],[
|
|
|
|
if test "$withval" != "no"; then
|
|
|
|
for i in /usr/local /usr $withval; do
|
|
|
|
if test -f "$i/include/db1/ndbm.h" ; then
|
2001-05-12 18:33:52 +08:00
|
|
|
THIS_PREFIX=$i
|
|
|
|
NDBM_EXTRA=db1/ndbm.h
|
1999-07-21 23:12:32 +08:00
|
|
|
elif test -f "$i/include/ndbm.h" ; then
|
2001-05-12 18:33:52 +08:00
|
|
|
THIS_PREFIX=$i
|
|
|
|
NDBM_EXTRA=ndbm.h
|
1999-07-21 23:12:32 +08:00
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
if test "$NDBM_EXTRA" != ""; then
|
1999-12-30 14:09:46 +08:00
|
|
|
AC_DEFINE_UNQUOTED(NDBM_INCLUDE_FILE, "$NDBM_EXTRA", [ ])
|
1999-07-21 23:12:32 +08:00
|
|
|
fi
|
|
|
|
|
|
|
|
for LIB in db1 ndbm c; do
|
2001-05-12 17:26:47 +08:00
|
|
|
PHP_TEMP_LDFLAGS(-L$THIS_PREFIX/lib,[
|
2001-05-12 18:33:52 +08:00
|
|
|
AC_CHECK_LIB($LIB, dbm_open, [AC_DEFINE(DBA_NDBM,1, [ ]) THIS_LIBS=$LIB])
|
1999-07-21 23:12:32 +08:00
|
|
|
])
|
|
|
|
done
|
|
|
|
|
2001-05-12 17:26:47 +08:00
|
|
|
PHP_DBA_STD_ASSIGN
|
|
|
|
PHP_DBA_STD_CHECK
|
|
|
|
PHP_DBA_STD_ATTACH
|
1999-07-21 23:12:32 +08:00
|
|
|
fi
|
|
|
|
])
|
|
|
|
AC_MSG_CHECKING(for NDBM support)
|
|
|
|
AC_DBA_STD_RESULT
|
|
|
|
|
|
|
|
AC_ARG_WITH(db2,
|
1999-11-05 04:47:19 +08:00
|
|
|
[ --with-db2[=DIR] Include Berkeley DB2 support],[
|
1999-07-21 23:12:32 +08:00
|
|
|
if test "$withval" != "no"; then
|
2001-06-28 23:16:28 +08:00
|
|
|
for i in /usr/local /usr /usr/BerkeleyDB $withval/BerkeleyDB $withval; do
|
1999-07-21 23:12:32 +08:00
|
|
|
if test -f "$i/db2/db.h"; then
|
2001-05-12 18:33:52 +08:00
|
|
|
THIS_PREFIX=$i
|
|
|
|
DB2_EXTRA=db2
|
1999-07-21 23:12:32 +08:00
|
|
|
elif test -f "$i/include/db2/db.h"; then
|
2001-05-12 18:33:52 +08:00
|
|
|
THIS_PREFIX=$i
|
|
|
|
DB2_EXTRA=db2/db.h
|
1999-07-21 23:12:32 +08:00
|
|
|
elif test -f "$i/include/db/db2.h"; then
|
2001-05-12 18:33:52 +08:00
|
|
|
THIS_PREFIX=$i
|
|
|
|
DB2_EXTRA=db/db2.h
|
1999-07-21 23:12:32 +08:00
|
|
|
elif test -f "$i/include/db2.h"; then
|
2001-05-12 18:33:52 +08:00
|
|
|
THIS_PREFIX=$i
|
|
|
|
DB2_EXTRA=db2.h
|
1999-07-21 23:12:32 +08:00
|
|
|
elif test -f "$i/include/db.h" ; then
|
2001-05-12 18:33:52 +08:00
|
|
|
THIS_PREFIX=$i
|
|
|
|
DB2_EXTRA=db.h
|
1999-07-21 23:12:32 +08:00
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
if test "$DB2_EXTRA" = "db2" ; then
|
|
|
|
DBA_INCLUDE="$DBA_INCLUDE -I$THIS_PREFIX/db2"
|
2001-05-12 18:33:52 +08:00
|
|
|
DB2_EXTRA=db.h
|
1999-07-21 23:12:32 +08:00
|
|
|
fi
|
|
|
|
|
1999-11-21 06:50:42 +08:00
|
|
|
if test -n "$DB2_EXTRA"; then
|
1999-12-30 14:09:46 +08:00
|
|
|
AC_DEFINE_UNQUOTED(DB2_INCLUDE_FILE, "$DB2_EXTRA", [ ])
|
1999-07-21 23:12:32 +08:00
|
|
|
fi
|
|
|
|
|
|
|
|
for LIB in db db2 c; do
|
2001-05-12 17:26:47 +08:00
|
|
|
PHP_TEMP_LDFLAGS(-L$THIS_PREFIX/lib,[
|
2001-05-12 18:33:52 +08:00
|
|
|
AC_CHECK_LIB($LIB, db_appinit, [AC_DEFINE(DBA_DB2,1,[ ]) THIS_LIBS=$LIB])
|
1999-07-21 23:12:32 +08:00
|
|
|
])
|
|
|
|
done
|
|
|
|
|
2001-05-12 17:26:47 +08:00
|
|
|
PHP_DBA_STD_ASSIGN
|
|
|
|
PHP_DBA_STD_CHECK
|
|
|
|
PHP_DBA_STD_ATTACH
|
1999-07-21 23:12:32 +08:00
|
|
|
fi
|
|
|
|
])
|
1999-11-05 04:47:19 +08:00
|
|
|
AC_MSG_CHECKING(for Berkeley DB2 support)
|
1999-07-21 23:12:32 +08:00
|
|
|
AC_DBA_STD_RESULT
|
|
|
|
|
1999-11-21 06:50:42 +08:00
|
|
|
AC_ARG_WITH(db3,
|
|
|
|
[ --with-db3[=DIR] Include Berkeley DB3 support],[
|
|
|
|
if test "$withval" != "no"; then
|
2000-03-28 06:40:27 +08:00
|
|
|
for i in /usr/local /usr /usr/local/BerkeleyDB.3.0 $withval; do
|
2002-09-11 23:05:06 +08:00
|
|
|
if test -f "$i/db3/db.h"; then
|
|
|
|
THIS_PREFIX=$i
|
|
|
|
DB3_EXTRA=db3
|
|
|
|
elif test -f "$i/include/db3/db.h"; then
|
2002-03-15 19:26:47 +08:00
|
|
|
THIS_PREFIX=$i
|
|
|
|
DB3_EXTRA=db3/db.h
|
2002-09-11 23:05:06 +08:00
|
|
|
elif test -f "$i/include/db/db3.h"; then
|
|
|
|
THIS_PREFIX=$i
|
|
|
|
DB3_EXTRA=db/db3.h
|
|
|
|
elif test -f "$i/include/db3.h"; then
|
|
|
|
THIS_PREFIX=$i
|
|
|
|
DB3_EXTRA=db3.h
|
2002-09-12 00:17:33 +08:00
|
|
|
elif test -f "$i/include/db.h"; then
|
2001-05-12 18:33:52 +08:00
|
|
|
THIS_PREFIX=$i
|
|
|
|
DB3_EXTRA=db.h
|
1999-11-21 06:50:42 +08:00
|
|
|
fi
|
2000-03-28 06:40:27 +08:00
|
|
|
done
|
1999-11-21 06:50:42 +08:00
|
|
|
|
|
|
|
if test -n "$DB3_EXTRA"; then
|
1999-12-30 14:09:46 +08:00
|
|
|
AC_DEFINE_UNQUOTED(DB3_INCLUDE_FILE, "$DB3_EXTRA", [ ])
|
1999-11-21 06:50:42 +08:00
|
|
|
fi
|
|
|
|
|
2002-11-13 21:12:26 +08:00
|
|
|
for LIB in db-3.1 db-3 db3 db; do
|
2001-05-12 17:26:47 +08:00
|
|
|
PHP_TEMP_LDFLAGS(-L$THIS_PREFIX/lib,[
|
2001-05-12 18:33:52 +08:00
|
|
|
AC_CHECK_LIB($LIB, db_create, [AC_DEFINE(DBA_DB3,1,[ ]) THIS_LIBS=$LIB])
|
1999-11-21 06:50:42 +08:00
|
|
|
])
|
|
|
|
done
|
|
|
|
|
2001-05-12 17:26:47 +08:00
|
|
|
PHP_DBA_STD_ASSIGN
|
|
|
|
PHP_DBA_STD_CHECK
|
|
|
|
PHP_DBA_STD_ATTACH
|
1999-11-21 06:50:42 +08:00
|
|
|
fi
|
|
|
|
])
|
|
|
|
AC_MSG_CHECKING(for Berkeley DB3 support)
|
|
|
|
AC_DBA_STD_RESULT
|
|
|
|
|
1999-07-21 23:12:32 +08:00
|
|
|
AC_ARG_WITH(dbm,
|
|
|
|
[ --with-dbm[=DIR] Include DBM support],[
|
2002-11-06 12:16:18 +08:00
|
|
|
if test "$withval" != "no"; then
|
1999-07-21 23:12:32 +08:00
|
|
|
for i in /usr/local /usr $withval; do
|
|
|
|
if test -f "$i/include/dbm.h" ; then
|
2001-05-12 18:33:52 +08:00
|
|
|
THIS_PREFIX=$i
|
1999-07-21 23:12:32 +08:00
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
for LIB in db1 dbm c; do
|
2001-05-12 17:26:47 +08:00
|
|
|
PHP_TEMP_LDFLAGS(-L$THIS_PREFIX/lib,[
|
2001-05-12 18:33:52 +08:00
|
|
|
AC_CHECK_LIB($LIB, dbminit, [AC_DEFINE(DBA_DBM,1,[ ]) THIS_LIBS=$LIB])
|
1999-07-21 23:12:32 +08:00
|
|
|
])
|
|
|
|
done
|
|
|
|
|
2001-05-12 17:26:47 +08:00
|
|
|
PHP_DBA_STD_ASSIGN
|
|
|
|
PHP_DBA_STD_CHECK
|
|
|
|
PHP_DBA_STD_ATTACH
|
1999-07-21 23:12:32 +08:00
|
|
|
fi
|
|
|
|
])
|
|
|
|
AC_MSG_CHECKING(for DBM support)
|
|
|
|
AC_DBA_STD_RESULT
|
|
|
|
|
|
|
|
AC_ARG_WITH(cdb,
|
|
|
|
[ --with-cdb[=DIR] Include CDB support],[
|
2002-11-05 01:53:04 +08:00
|
|
|
if test "$withval" = "yes"; then
|
|
|
|
PHP_ADD_BUILD_DIR($ext_builddir/libcdb)
|
2002-11-05 20:03:01 +08:00
|
|
|
AC_DEFINE(DBA_CDB_BUILTIN, 1, [ ])
|
2002-11-05 01:53:04 +08:00
|
|
|
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 "$withval" != "no"; then
|
1999-07-21 23:12:32 +08:00
|
|
|
for i in /usr/local /usr $withval; do
|
|
|
|
if test -f "$i/include/cdb.h" ; then
|
2001-05-12 18:33:52 +08:00
|
|
|
THIS_PREFIX=$i
|
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
|
|
|
|
|
|
|
for LIB in cdb c; do
|
2001-05-12 17:26:47 +08:00
|
|
|
PHP_TEMP_LDFLAGS(-L$THIS_PREFIX/lib,[
|
2002-09-19 12:18:20 +08:00
|
|
|
AC_CHECK_LIB($LIB, cdb_read, [AC_DEFINE(DBA_CDB,1,[ ]) THIS_LIBS=$LIB])
|
1999-07-21 23:12:32 +08:00
|
|
|
])
|
|
|
|
done
|
|
|
|
|
2001-05-12 17:26:47 +08:00
|
|
|
PHP_DBA_STD_ASSIGN
|
|
|
|
PHP_DBA_STD_CHECK
|
|
|
|
PHP_DBA_STD_ATTACH
|
1999-07-21 23:12:32 +08:00
|
|
|
fi
|
|
|
|
])
|
|
|
|
AC_MSG_CHECKING(for CDB support)
|
|
|
|
AC_DBA_STD_RESULT
|
|
|
|
|
2002-11-06 12:16:18 +08:00
|
|
|
AC_ARG_WITH(flatfile,
|
2002-11-06 18:08:38 +08:00
|
|
|
[ --with-flatfile Include FlatFile support],[
|
|
|
|
if test "$withval" != "no"; then
|
2002-11-06 12:16:18 +08:00
|
|
|
PHP_ADD_BUILD_DIR($ext_builddir/libflatfile)
|
|
|
|
AC_DEFINE(DBA_FLATFILE, 1, [ ])
|
2002-11-06 17:17:51 +08:00
|
|
|
flat_sources="dba_flatfile.c libflatfile/flatfile.c"
|
2002-11-06 12:16:18 +08:00
|
|
|
THIS_RESULT="builtin"
|
|
|
|
fi
|
|
|
|
])
|
|
|
|
AC_MSG_CHECKING(for FlatFile support)
|
|
|
|
AC_DBA_STD_RESULT
|
|
|
|
|
1999-07-21 23:12:32 +08:00
|
|
|
AC_MSG_CHECKING(whether to enable DBA interface)
|
|
|
|
if test "$HAVE_DBA" = "1"; then
|
|
|
|
AC_MSG_RESULT(yes)
|
1999-12-30 12:07:46 +08:00
|
|
|
AC_DEFINE(HAVE_DBA, 1, [ ])
|
2002-11-06 12:16:18 +08:00
|
|
|
PHP_NEW_EXTENSION(dba, dba.c dba_cdb.c dba_db2.c dba_dbm.c dba_gdbm.c dba_ndbm.c dba_db3.c $cdb_sources $flat_sources, $ext_shared)
|
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
|