Re: PHP 4.0 Bug #6889: ./configure script does not disable ndbm
| From: | Jani Taskinen | Date: | Tue, 26 Sep 2000 15:13:14 +0000 |
| Subject: | Re: PHP 4.0 Bug #6889: ./configure script does not disable ndbm | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-33738@lists.php.net to get a copy of this message | ||
On 26 Sep 2000 lmit@home.com wrote:
>From: lmit@home.com
>Operating system: Linux
>PHP version: 4.0.2
>PHP Bug Type: PHP options/info functions
>Bug description: ./configure script does not disable ndbm
>
>The Configure script does not allow ndbm to be disabled.
>The --without-ndbm flag does not work.
>NDBM is still picked as the default dbm library, even though configure sais gdbm was
>"chosen".
>
>when I run phpinfo() NDBM is the supported default even though gdbm is listed. ie
>
> dba
>V1 ($Id: dba.c,v 1.21 2000/07/13 18:44:57 eschmid Exp $) gdbm
>
> db
>Sleepycat Software: DB 2.4.14: (6/2/98)ndbm support enabled
>
>
>The hell this causes me is that I have databases created with php3 that will not open using
>php4.0.2 using the dbmopen().. functions.
>dblist() tells me that ndbm is being used, BUT NOWHERE ON FAQ'S, PHP.NET, KNOWLEDGE BASE,
>NEWSGROUPS, PHP.INI IS THERE MENTION ON HOW TO SWITCH DBM LIBRARIES.
>
>I CANNOT DISABLE IT, A CANNOT SWITCH IT.
>upgrading from 4.0.1pl2 to 4.0.2 has just killed me.
Can I commit this patch which makes ext/db to not be enabled by default??
--Jani
Index: config.m4
===================================================================
RCS file: /repository/php4/ext/db/config.m4,v
retrieving revision 1.8
diff -u -r1.8 config.m4
--- config.m4 2000/05/04 09:42:27 1.8
+++ config.m4 2000/09/26 15:10:33
@@ -2,10 +2,7 @@
dnl config.m4 for extension db
dnl don't forget to call PHP_EXTENSION(db)
-divert(3)dnl
-AC_CHECK_HEADERS(db1/ndbm.h)
-
# Checks for libraries.
# Prefer gdbm, Berkeley DB and ndbm/dbm, in that order
AC_DEFUN(AC_PREFERRED_DB_LIB,[
@@ -25,31 +22,35 @@
PHP_SUBST(DBM_TYPE)
])
-AC_PREFERRED_DB_LIB
-divert(5)dnl
+PHP_ARG_WITH(db, whether to include old xDBM support,
+[ --with-db Include old xDBM support (deprecated)])
-if test "$DBM_LIB" = "-lgdbm"; then
- AC_CHECK_HEADER(gdbm.h, [ GDBM_INCLUDE="" ], [
- AC_MSG_RESULT("Try /usr/local/include/gdbm.h");
- AC_CHECK_HEADER(/usr/local/include/gdbm.h, [ GDBM_INCLUDE="-I/usr/local/include" ],[
- AC_MSG_RESULT("Try /opt/local/include/gdbm.h");
- AC_CHECK_HEADER(/opt/local/include/gdbm.h, [ GDBM_INCLUDE="-I/opt/local/include"
],[
- dnl if in /usr/pkg/include, do not add anything. See above.
- AC_MSG_RESULT("Try /usr/pkg/include/gdbm.h");
- AC_CHECK_HEADER(/usr/pkg/include/gdbm.h, [ GDBM_INCLUDE="" ],[
- AC_MSG_RESULT("Giving up - You need to install gdbm.h somewhere");
- exit
- ])
- ])
- ])
- ])
-fi
+if test "$PHP_DB" != "no"; then
-if test -n "$DBM_LIB"; then
- INCLUDES="$INCLUDES $GDBM_INCLUDE"
- EXTRA_LIBS="$EXTRA_LIBS $DBM_LIB"
-fi
+ AC_PREFERRED_DB_LIB
-PHP_EXTENSION(db)
+ if test "$DBM_LIB" = "-lgdbm"; then
+ AC_CHECK_HEADER(gdbm.h, [ GDBM_INCLUDE="" ], [
+ AC_MSG_RESULT("Try /usr/local/include/gdbm.h");
+ AC_CHECK_HEADER(/usr/local/include/gdbm.h, [ GDBM_INCLUDE="-I/usr/local/include"
],[
+ AC_MSG_RESULT("Try /opt/local/include/gdbm.h");
+ AC_CHECK_HEADER(/opt/local/include/gdbm.h, [ GDBM_INCLUDE="-I/opt/local/include"
],[
+ dnl if in /usr/pkg/include, do not add anything. See above.
+ AC_MSG_RESULT("Try /usr/pkg/include/gdbm.h");
+ AC_CHECK_HEADER(/usr/pkg/include/gdbm.h, [ GDBM_INCLUDE="" ],[
+ AC_MSG_RESULT("Giving up - You need to install gdbm.h somewhere");
+ exit
+ ])
+ ])
+ ])
+ ])
+ fi
+
+ if test -n "$DBM_LIB"; then
+ INCLUDES="$INCLUDES $GDBM_INCLUDE"
+ EXTRA_LIBS="$EXTRA_LIBS $DBM_LIB"
+ fi
+ PHP_EXTENSION(db)
+fi