[PHP-CVS] cvs: php4 /ext/dba config.m4

2003-06-14 Thread Jani Taskinen
sniper  Sat Jun 14 10:22:13 2003 EDT

  Modified files:  
/php4/ext/dba   config.m4 
  Log:
  - Fixed some /usr/lib leaks into LIBS/LDFLAGS which later on made other
configure checks fail (old libs in /usr/lib, new ones in /opt/lib :)
  
  
Index: php4/ext/dba/config.m4
diff -u php4/ext/dba/config.m4:1.52 php4/ext/dba/config.m4:1.53
--- php4/ext/dba/config.m4:1.52 Thu May 29 10:01:21 2003
+++ php4/ext/dba/config.m4  Sat Jun 14 10:22:13 2003
@@ -1,5 +1,5 @@
 dnl
-dnl $Id: config.m4,v 1.52 2003/05/29 14:01:21 helly Exp $
+dnl $Id: config.m4,v 1.53 2003/06/14 14:22:13 sniper Exp $
 dnl
 
 dnl Suppose we need FlatFile if no support or only CDB is used.
@@ -26,10 +26,10 @@
 AC_DEFUN(PHP_DBA_STD_CHECK,[
   THIS_RESULT=yes
   if test -z $THIS_INCLUDE; then
-AC_MSG_ERROR(cannot find necessary header file(s))
+AC_MSG_ERROR([DBA: Could not find necessary header file(s).])
   fi
   if test -z $THIS_LIBS; then
-AC_MSG_ERROR(cannot find necessary library)
+AC_MSG_ERROR([DBA: Could not find necessary library.])
   fi
 ])
 
@@ -79,13 +79,11 @@
 
 if test -n $THIS_INCLUDE; then
   unset ac_cv_lib_gdbm_gdbm_open
-  PHP_TEMP_LDFLAGS(-L$THIS_PREFIX/lib,[
-AC_CHECK_LIB(gdbm, gdbm_open, [
-  AC_DEFINE_UNQUOTED(GDBM_INCLUDE_FILE, $THIS_INCLUDE, [ ])
-  AC_DEFINE(DBA_GDBM, 1, [ ]) 
-  THIS_LIBS=gdbm
-])
-  ])
+  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/lib])
 fi
 
 PHP_DBA_STD_ASSIGN
@@ -113,14 +111,14 @@
 
 if test -n $THIS_INCLUDE; then
   for LIB in ndbm db1 c; do
-PHP_TEMP_LDFLAGS(-L$THIS_PREFIX/lib,[
-  AC_CHECK_LIB($LIB, dbm_open, [
-AC_DEFINE_UNQUOTED(NDBM_INCLUDE_FILE, $THIS_INCLUDE, [ ])
-AC_DEFINE(DBA_NDBM,1, [ ]) 
-THIS_LIBS=$LIB
-break
-  ])
-])
+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/lib])
+if test -n $THIS_LIBS; then
+  break
+fi
   done
 fi
 
@@ -316,24 +314,22 @@
 
 if test -n $THIS_INCLUDE; then
   for LIB in dbm c gdbm; do
-PHP_TEMP_LDFLAGS(-L$THIS_PREFIX/lib,[
-  AC_CHECK_LIB($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
-  ])
-  if test -n $THIS_LIBS; then
-break
+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/lib])
+if test -n $THIS_LIBS; then
+  break
+fi
   done
 fi
 
@@ -368,14 +364,14 @@
 
 if test -n $THIS_INCLUDE; then
   for LIB in cdb c; do
-PHP_TEMP_LDFLAGS(-L$THIS_PREFIX/lib,[
-  AC_CHECK_LIB($LIB, cdb_read, [
-AC_DEFINE_UNQUOTED(CDB_INCLUDE_FILE, $THIS_INCLUDE, [ ])
-AC_DEFINE(DBA_CDB,1,[ ]) 
-THIS_LIBS=$LIB
-break
-  ])
-])
+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/lib])
+if test -n $THIS_LIBS; then
+  break
+fi
   done
 fi
 



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php4 /ext/dba config.m4

2003-05-30 Thread Marcus Boerger
helly   Thu May 29 10:01:21 2003 EDT

  Modified files:  
/php4/ext/dba   config.m4 
  Log:
  Fix builddir entry
  
Index: php4/ext/dba/config.m4
diff -u php4/ext/dba/config.m4:1.51 php4/ext/dba/config.m4:1.52
--- php4/ext/dba/config.m4:1.51 Thu May 29 08:33:19 2003
+++ php4/ext/dba/config.m4  Thu May 29 10:01:21 2003
@@ -1,5 +1,5 @@
 dnl
-dnl $Id: config.m4,v 1.51 2003/05/29 12:33:19 helly Exp $
+dnl $Id: config.m4,v 1.52 2003/05/29 14:01:21 helly Exp $
 dnl
 
 dnl Suppose we need FlatFile if no support or only CDB is used.
@@ -434,7 +434,7 @@
   AC_MSG_RESULT(yes)
   AC_DEFINE(HAVE_DBA, 1, [ ])
   PHP_NEW_EXTENSION(dba, dba.c dba_cdb.c dba_db2.c dba_dbm.c dba_gdbm.c dba_ndbm.c 
dba_db3.c dba_db4.c dba_flatfile.c dba_inifile.c $cdb_sources $flat_sources 
$ini_sources, $ext_shared)
-  PHP_ADD_BUILD_DIR($ext_builddir/libini)
+  PHP_ADD_BUILD_DIR($ext_builddir/libinifile)
   PHP_ADD_BUILD_DIR($ext_builddir/libcdb)
   PHP_ADD_BUILD_DIR($ext_builddir/libflatfile)
   PHP_SUBST(DBA_SHARED_LIBADD)



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php4 /ext/dba config.m4

2003-05-29 Thread Marcus Boerger
helly   Thu May 29 08:33:19 2003 EDT

  Modified files:  
/php4/ext/dba   config.m4 
  Log:
  MFB (these parts were missing)
  
Index: php4/ext/dba/config.m4
diff -u php4/ext/dba/config.m4:1.50 php4/ext/dba/config.m4:1.51
--- php4/ext/dba/config.m4:1.50 Tue May 20 20:14:16 2003
+++ php4/ext/dba/config.m4  Thu May 29 08:33:19 2003
@@ -1,5 +1,5 @@
 dnl
-dnl $Id: config.m4,v 1.50 2003/05/21 00:14:16 helly Exp $
+dnl $Id: config.m4,v 1.51 2003/05/29 12:33:19 helly Exp $
 dnl
 
 dnl Suppose we need FlatFile if no support or only CDB is used.
@@ -140,7 +140,7 @@
 AC_TRY_LINK([
 #include $THIS_INCLUDE
 ],[
-  (void)db_create((DB**)0, (DB_ENV*)0, 0);
+  $3;
 ],[
   AC_EGREP_CPP(yes,[
 #include $THIS_INCLUDE
@@ -329,8 +329,10 @@
 fi
 AC_DEFINE(DBA_DBM,1,[ ]) 
 THIS_LIBS=$LIB
-break
   ])
+  if test -n $THIS_LIBS; then
+break
+  fi
 ])
   done
 fi
@@ -352,7 +354,7 @@
 
 AC_ARG_WITH(cdb,
 [  --with-cdb[=DIR]  DBA: Include CDB support],[
-  if test $withval = yes; then
+  if test $withval = yes -o $HAVE_DBA = 1; then
 PHP_DBA_BUILTIN_CDB
   elif test $withval != no; then
 PHP_DBA_STD_BEGIN



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php4 /ext/dba config.m4

2003-04-01 Thread Sascha Schumann
sas Tue Apr  1 05:16:12 2003 EDT

  Modified files:  
/php4/ext/dba   config.m4 
  Log:
  fix VPATH builds
  
Index: php4/ext/dba/config.m4
diff -u php4/ext/dba/config.m4:1.45 php4/ext/dba/config.m4:1.46
--- php4/ext/dba/config.m4:1.45 Sat Feb 22 12:20:05 2003
+++ php4/ext/dba/config.m4  Tue Apr  1 05:16:12 2003
@@ -1,5 +1,5 @@
 dnl
-dnl $Id: config.m4,v 1.45 2003/02/22 17:20:05 helly Exp $
+dnl $Id: config.m4,v 1.46 2003/04/01 10:16:12 sas Exp $
 dnl
 
 dnl Suppose we need FlatFile if no support or only CDB is used.
@@ -426,6 +426,8 @@
   AC_MSG_RESULT(yes)
   AC_DEFINE(HAVE_DBA, 1, [ ])
   PHP_NEW_EXTENSION(dba, dba.c dba_cdb.c dba_db2.c dba_dbm.c dba_gdbm.c dba_ndbm.c 
dba_db3.c dba_db4.c dba_flatfile.c dba_inifile.c $cdb_sources $flat_sources 
$ini_sources, $ext_shared)
+  PHP_ADD_BUILD_DIR($ext_builddir/libcdb)
+  PHP_ADD_BUILD_DIR($ext_builddir/libflatfile)
   PHP_SUBST(DBA_SHARED_LIBADD)
 else
   AC_MSG_RESULT(no)



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php4 /ext/dba config.m4

2003-02-09 Thread Jani Taskinen
sniper  Sun Feb  9 14:57:51 2003 EDT

  Modified files:  
/php4/ext/dba   config.m4 
  Log:
  break: First one not needed, second missing.
  
Index: php4/ext/dba/config.m4
diff -u php4/ext/dba/config.m4:1.43 php4/ext/dba/config.m4:1.44
--- php4/ext/dba/config.m4:1.43 Sat Feb  1 17:19:04 2003
+++ php4/ext/dba/config.m4  Sun Feb  9 14:57:50 2003
@@ -1,5 +1,5 @@
 dnl
-dnl $Id: config.m4,v 1.43 2003/02/01 22:19:04 helly Exp $
+dnl $Id: config.m4,v 1.44 2003/02/09 19:57:50 sniper Exp $
 dnl
 
 dnl Suppose we need FlatFile if no support or only CDB is used.
@@ -84,7 +84,6 @@
   AC_DEFINE_UNQUOTED(GDBM_INCLUDE_FILE, $THIS_INCLUDE, [ ])
   AC_DEFINE(DBA_GDBM, 1, [ ]) 
   THIS_LIBS=gdbm
-  break
 ])
   ])
 fi
@@ -302,6 +301,7 @@
   elif test -f $i/include/gdbm/dbm.h; then
 THIS_PREFIX=$i
 THIS_INCLUDE=$i/include/gdbm/dbm.h
+break
   fi
 done
 



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-CVS] cvs: php4 /ext/dba config.m4

2003-02-09 Thread Marcus Börger
At 20:57 09.02.2003, Jani Taskinen wrote:

sniper  Sun Feb  9 14:57:51 2003 EDT

  Modified files:
/php4/ext/dba   config.m4
  Log:
  break: First one not needed, second missing.




Thanks for the fix :-)

marcus


--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-CVS] cvs: php4 /ext/dba config.m4 dba_cdb.c dba_dbm.c dba_gdbm.c

2003-02-01 Thread Marcus Boerger
helly   Sat Feb  1 13:59:59 2003 EDT

  Modified files:  
/php4/ext/dba   config.m4 dba_cdb.c dba_dbm.c dba_gdbm.c 
  Log:
  - unify configure mechanisms (include file handling)
  - fix dbm
  - allow dbm to be based on gdbm
  
Index: php4/ext/dba/config.m4
diff -u php4/ext/dba/config.m4:1.41 php4/ext/dba/config.m4:1.42
--- php4/ext/dba/config.m4:1.41 Fri Jan 31 15:06:44 2003
+++ php4/ext/dba/config.m4  Sat Feb  1 13:59:59 2003
@@ -1,11 +1,11 @@
 dnl
-dnl $Id: config.m4,v 1.41 2003/01/31 20:06:44 helly Exp $
+dnl $Id: config.m4,v 1.42 2003/02/01 18:59:59 helly Exp $
 dnl
 
 dnl Suppose we need FlatFile if no support or only CDB is used.
 
 AC_DEFUN(PHP_DBA_STD_BEGIN,[
-  unset THIS_INCLUDE THIS_INC_DIR THIS_LIBS THIS_LFLAGS THIS_PREFIX THIS_RESULT
+  unset THIS_INCLUDE THIS_LIBS THIS_LFLAGS THIS_PREFIX THIS_RESULT
 ])
 
 AC_DEFUN(PHP_TEMP_LDFLAGS,[
@@ -35,11 +35,8 @@
 
 dnl Attach THIS_x to DBA_x
 AC_DEFUN(PHP_DBA_STD_ATTACH,[
-  if test -n $THIS_INC_DIR -a $THIS_PREFIX != /usr; then
-PHP_ADD_INCLUDE($THIS_INC_DIR)
-  fi
   PHP_ADD_LIBRARY_WITH_PATH($THIS_LIBS, $THIS_LFLAGS, DBA_SHARED_LIBADD)
-  unset THIS_INCLUDE THIS_INC_DIR THIS_LIBS THIS_LFLAGS THIS_PREFIX
+  unset THIS_INCLUDE THIS_LIBS THIS_LFLAGS THIS_PREFIX
 ])
 
 dnl Print the result message
@@ -76,7 +73,6 @@
   if test -f $i/include/gdbm.h; then
 THIS_PREFIX=$i
 THIS_INCLUDE=$i/include/gdbm.h
-THIS_INC_DIR=$i/include
 break
   fi
 done
@@ -85,6 +81,7 @@
   unset ac_cv_lib_gdbm_gdbm_open
   PHP_TEMP_LDFLAGS(-L$THIS_PREFIX/lib,[
 AC_CHECK_LIB(gdbm, gdbm_open, [
+  AC_DEFINE_UNQUOTED(GDBM_INCLUDE_FILE, $THIS_INCLUDE, [ ])
   AC_DEFINE(DBA_GDBM, 1, [ ]) 
   THIS_LIBS=gdbm
   break
@@ -116,10 +113,10 @@
 done
 
 if test -n $THIS_INCLUDE; then
-  AC_DEFINE_UNQUOTED(NDBM_INCLUDE_FILE, $THIS_INCLUDE, [ ])
   for LIB in ndbm db1 c; do
 PHP_TEMP_LDFLAGS(-L$THIS_PREFIX/lib,[
   AC_CHECK_LIB($LIB, dbm_open, [
+AC_DEFINE_UNQUOTED(NDBM_INCLUDE_FILE, $THIS_INCLUDE, [ ])
 AC_DEFINE(DBA_NDBM,1, [ ]) 
 THIS_LIBS=$LIB
 break
@@ -301,15 +298,26 @@
   if test -f $i/include/dbm.h; then
 THIS_PREFIX=$i
 THIS_INCLUDE=$i/include/dbm.h
-THIS_INC_DIR=$i/include
 break
+  elif test -f $i/include/gdbm/dbm.h; then
+THIS_PREFIX=$i
+THIS_INCLUDE=$i/include/gdbm/dbm.h
   fi
 done
 
 if test -n $THIS_INCLUDE; then
-  for LIB in db1 dbm c; do
+  for LIB in gdbm dbm c; do
 PHP_TEMP_LDFLAGS(-L$THIS_PREFIX/lib,[
   AC_CHECK_LIB($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
 break
@@ -344,7 +352,6 @@
   if test -f $i/include/cdb.h; then
 THIS_PREFIX=$i
 THIS_INCLUDE=$i/include/cdb.h
-THIS_INC_DIR=$i/include
 break
   fi
 done
@@ -353,6 +360,7 @@
   for LIB in cdb c; do
 PHP_TEMP_LDFLAGS(-L$THIS_PREFIX/lib,[
   AC_CHECK_LIB($LIB, cdb_read, [
+AC_DEFINE_UNQUOTED(CDB_INCLUDE_FILE, $THIS_INCLUDE, [ ])
 AC_DEFINE(DBA_CDB,1,[ ]) 
 THIS_LIBS=$LIB
 break
Index: php4/ext/dba/dba_cdb.c
diff -u php4/ext/dba/dba_cdb.c:1.26 php4/ext/dba/dba_cdb.c:1.27
--- php4/ext/dba/dba_cdb.c:1.26 Tue Dec 31 11:06:24 2002
+++ php4/ext/dba/dba_cdb.c  Sat Feb  1 13:59:59 2003
@@ -17,7 +17,7 @@
+--+
  */
 
-/* $Id: dba_cdb.c,v 1.26 2002/12/31 16:06:24 sebastian Exp $ */
+/* $Id: dba_cdb.c,v 1.27 2003/02/01 18:59:59 helly Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -35,12 +35,13 @@
 #include fcntl.h
 
 #if DBA_CDB_BUILTIN
-#include libcdb/cdb.h
-#include libcdb/cdb_make.h
-#include libcdb/uint32.h
+# include libcdb/cdb.h
+# include libcdb/cdb_make.h
+# include libcdb/uint32.h
 #else
-#include cdb.h
-#include uint32.h
+# ifdef CDB_INCLUDE_FILE
+#  include CDB_INCLUDE_FILE
+# endif
 #endif
 
 #define CDB_INFO \
Index: php4/ext/dba/dba_dbm.c
diff -u php4/ext/dba/dba_dbm.c:1.25 php4/ext/dba/dba_dbm.c:1.26
--- php4/ext/dba/dba_dbm.c:1.25 Tue Dec 31 11:06:24 2002
+++ php4/ext/dba/dba_dbm.c  Sat Feb  1 13:59:59 2003
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: dba_dbm.c,v 1.25 2002/12/31 16:06:24 sebastian Exp $ */
+/* $Id: dba_dbm.c,v 1.26 2003/02/01 18:59:59 helly Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -27,7 +27,12 @@
 #if 

[PHP-CVS] cvs: php4 /ext/dba config.m4

2003-02-01 Thread Marcus Boerger
helly   Sat Feb  1 17:19:04 2003 EDT

  Modified files:  
/php4/ext/dba   config.m4 
  Log:
  Change DBM detection order
  
Index: php4/ext/dba/config.m4
diff -u php4/ext/dba/config.m4:1.42 php4/ext/dba/config.m4:1.43
--- php4/ext/dba/config.m4:1.42 Sat Feb  1 13:59:59 2003
+++ php4/ext/dba/config.m4  Sat Feb  1 17:19:04 2003
@@ -1,5 +1,5 @@
 dnl
-dnl $Id: config.m4,v 1.42 2003/02/01 18:59:59 helly Exp $
+dnl $Id: config.m4,v 1.43 2003/02/01 22:19:04 helly Exp $
 dnl
 
 dnl Suppose we need FlatFile if no support or only CDB is used.
@@ -306,7 +306,7 @@
 done
 
 if test -n $THIS_INCLUDE; then
-  for LIB in gdbm dbm c; do
+  for LIB in dbm c gdbm; do
 PHP_TEMP_LDFLAGS(-L$THIS_PREFIX/lib,[
   AC_CHECK_LIB($LIB, dbminit, [
 AC_MSG_CHECKING(for DBM using GDBM)



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-CVS] cvs: php4 /ext/dba config.m4

2003-01-31 Thread Marcus Boerger
helly   Fri Jan 31 15:06:44 2003 EDT

  Modified files:  
/php4/ext/dba   config.m4 
  Log:
  Shared dba requires at least db-3.3
  
Index: php4/ext/dba/config.m4
diff -u php4/ext/dba/config.m4:1.40 php4/ext/dba/config.m4:1.41
--- php4/ext/dba/config.m4:1.40 Thu Jan 30 16:36:05 2003
+++ php4/ext/dba/config.m4  Fri Jan 31 15:06:44 2003
@@ -1,5 +1,5 @@
 dnl
-dnl $Id: config.m4,v 1.40 2003/01/30 21:36:05 helly Exp $
+dnl $Id: config.m4,v 1.41 2003/01/31 20:06:44 helly Exp $
 dnl
 
 dnl Suppose we need FlatFile if no support or only CDB is used.
@@ -165,6 +165,19 @@
   AC_MSG_RESULT(ok)
 ],[
   AC_MSG_ERROR(Version 4.1 requires patch level 25)
+])
+  fi
+  if test $ext_shared = yes; then
+AC_MSG_CHECKING(if db can be used as shared extension)
+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)
+],[
+  AC_MSG_ERROR(At least version 3.3 is required)
 ])
   fi
   if test -n $THIS_LIBS; then



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-CVS] cvs: php4 /ext/dba config.m4

2003-01-30 Thread Marcus Boerger
helly   Thu Jan 30 13:28:42 2003 EDT

  Modified files:  
/php4/ext/dba   config.m4 
  Log:
  Allow to link against chosen modules correctly
  
Index: php4/ext/dba/config.m4
diff -u php4/ext/dba/config.m4:1.38 php4/ext/dba/config.m4:1.39
--- php4/ext/dba/config.m4:1.38 Tue Jan 28 05:55:36 2003
+++ php4/ext/dba/config.m4  Thu Jan 30 13:28:42 2003
@@ -1,5 +1,5 @@
 dnl
-dnl $Id: config.m4,v 1.38 2003/01/28 10:55:36 sniper Exp $
+dnl $Id: config.m4,v 1.39 2003/01/30 18:28:42 helly Exp $
 dnl
 
 dnl Suppose we need FlatFile if no support or only CDB is used.
@@ -10,7 +10,8 @@
 
 AC_DEFUN(PHP_TEMP_LDFLAGS,[
   old_LDFLAGS=$LDFLAGS
-  LDFLAGS=$1 $LDFLAGS
+dnl  LDFLAGS=$1 $LDFLAGS
+  LDFLAGS=$1
   $2
   LDFLAGS=$old_LDFLAGS
 ])
@@ -139,18 +140,20 @@
 dnl parameters(version, library list, function)
 AC_DEFUN(PHP_DBA_DB_CHECK,[
   for LIB in $2; do
-PHP_TEMP_LDFLAGS(-L$THIS_PREFIX/lib,[
-  AC_CHECK_LIB($LIB, $3, [
-AC_EGREP_CPP(yes,[
+if test -f $THIS_PREFIX/lib/lib$LIB.a -o -f 
+$THIS_PREFIX/lib/lib$LIB.$SHLIB_SUFFIX_NAME; then
+  PHP_TEMP_LDFLAGS(-L$THIS_PREFIX/lib,[
+AC_CHECK_LIB($LIB, $3, [
+  AC_EGREP_CPP(yes,[
 #include $THIS_INCLUDE
 yes
 #endif
-],[
-  THIS_LIBS=$LIB
-  break
+  ],[
+THIS_LIBS=$LIB
+break
+  ])
 ])
   ])
-])
+fi
   done
   if test $1 = 4; then
 AC_MSG_CHECKING(for db4 minor version and patch level)



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-CVS] cvs: php4 /ext/dba config.m4

2003-01-30 Thread Jani Taskinen

configure: error: cannot find necessary library

You need to reset the LIBS too..

--Jani


On Thu, 30 Jan 2003, Marcus Börger wrote:

At 00:04 30.01.2003, Marcus Börger wrote:
At 11:55 28.01.2003, Jani Taskinen wrote:
sniper  Tue Jan 28 05:55:36 2003 EDT

   Modified files:
 /php4/ext/dba   config.m4
   Log:
   Fix configure. (typo?)

It didn't notice that...it's from my test version where i could need some help
but currently i am not at all knowing the problem really...

marcus

Ok, one part of my problem is linking against a special version while having
multiple versions of say db3. The following works for. Does it work for 
you, too?
(Now it is *no* type)

cvs -z3 -q diff config.m4 (in directory S:\php4-HEAD\ext\dba)
Index: config.m4
===
RCS file: /repository/php4/ext/dba/config.m4,v
retrieving revision 1.38
diff -u -r1.38 config.m4
--- config.m4   28 Jan 2003 10:55:36 -  1.38
+++ config.m4   30 Jan 2003 00:47:29 -
@@ -1,5 +1,5 @@
  dnl
-dnl $Id: config.m4,v 1.38 2003/01/28 10:55:36 sniper Exp $
+dnl $Id: config.m4,v 1.29.2.6 2003/01/28 06:27:19 helly Exp $
  dnl

  dnl Suppose we need FlatFile if no support or only CDB is used.
@@ -10,7 +10,8 @@

  AC_DEFUN(PHP_TEMP_LDFLAGS,[
old_LDFLAGS=$LDFLAGS
-  LDFLAGS=$1 $LDFLAGS
+dnl  LDFLAGS=$1 $LDFLAGS
+  LDFLAGS=$1
$2
LDFLAGS=$old_LDFLAGS
  ])
@@ -139,18 +140,20 @@
  dnl parameters(version, library list, function)
  AC_DEFUN(PHP_DBA_DB_CHECK,[
for LIB in $2; do
-PHP_TEMP_LDFLAGS(-L$THIS_PREFIX/lib,[
-  AC_CHECK_LIB($LIB, $3, [
-AC_EGREP_CPP(yes,[
+if test -f $THIS_PREFIX/lib/lib$LIB.a -o -f 
$THIS_PREFIX/lib/lib$LIB.$SHLIB_SUFFIX_NAME; then
+  PHP_TEMP_LDFLAGS(-L$THIS_PREFIX/lib,[
+AC_CHECK_LIB($LIB, $3, [
+  AC_EGREP_CPP(yes,[
  #include $THIS_INCLUDE
  yes
  #endif
-],[
-  THIS_LIBS=$LIB
-  break
+  ],[
+THIS_LIBS=$LIB
+break
+  ])
  ])
])
-])
+fi
done
if test $1 = 4; then
  AC_MSG_CHECKING(for db4 minor version and patch level)




-- 
- For Sale! -


-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-CVS] cvs: php4 /ext/dba config.m4

2003-01-30 Thread Marcus Börger
Why? I thought when trying to link with only the new libraries
i could test them alone. On which library did it fail for you?

And if i reset LIBS what is the complete difference?

marcus

At 19:37 30.01.2003, Jani Taskinen wrote:


configure: error: cannot find necessary library

You need to reset the LIBS too..



--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-CVS] cvs: php4 /ext/dba config.m4

2003-01-30 Thread Jani Taskinen
On Thu, 30 Jan 2003, Marcus Börger wrote:

Why? I thought when trying to link with only the new libraries
i could test them alone. On which library did it fail for you?

And if i reset LIBS what is the complete difference?

 Now you reset LDFLAGS, which contains all the -L/path/to/lib
 definitions. But you leave LIBS alone, which is still
 used in the test - test fails because libssl is not found..
 
 --Jani
  


-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-CVS] cvs: php4 /ext/dba config.m4

2003-01-30 Thread Marcus Boerger
helly   Thu Jan 30 16:36:05 2003 EDT

  Modified files:  
/php4/ext/dba   config.m4 
  Log:
  Revert this part, the new one adds more problems than it solves.
  
Index: php4/ext/dba/config.m4
diff -u php4/ext/dba/config.m4:1.39 php4/ext/dba/config.m4:1.40
--- php4/ext/dba/config.m4:1.39 Thu Jan 30 13:28:42 2003
+++ php4/ext/dba/config.m4  Thu Jan 30 16:36:05 2003
@@ -1,5 +1,5 @@
 dnl
-dnl $Id: config.m4,v 1.39 2003/01/30 18:28:42 helly Exp $
+dnl $Id: config.m4,v 1.40 2003/01/30 21:36:05 helly Exp $
 dnl
 
 dnl Suppose we need FlatFile if no support or only CDB is used.
@@ -10,8 +10,7 @@
 
 AC_DEFUN(PHP_TEMP_LDFLAGS,[
   old_LDFLAGS=$LDFLAGS
-dnl  LDFLAGS=$1 $LDFLAGS
-  LDFLAGS=$1
+  LDFLAGS=$1 $LDFLAGS
   $2
   LDFLAGS=$old_LDFLAGS
 ])



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-CVS] cvs: php4 /ext/dba config.m4

2003-01-29 Thread Marcus Börger
At 11:55 28.01.2003, Jani Taskinen wrote:

sniper  Tue Jan 28 05:55:36 2003 EDT

  Modified files:
/php4/ext/dba   config.m4
  Log:
  Fix configure. (typo?)



It didn't notice that...it's from my test version where i could need some help
but currently i am not at all knowing the problem really...

marcus


--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-CVS] cvs: php4 /ext/dba config.m4

2003-01-29 Thread Marcus Börger
At 00:04 30.01.2003, Marcus Börger wrote:

At 11:55 28.01.2003, Jani Taskinen wrote:

sniper  Tue Jan 28 05:55:36 2003 EDT

  Modified files:
/php4/ext/dba   config.m4
  Log:
  Fix configure. (typo?)


It didn't notice that...it's from my test version where i could need some help
but currently i am not at all knowing the problem really...

marcus


Ok, one part of my problem is linking against a special version while having
multiple versions of say db3. The following works for. Does it work for 
you, too?
(Now it is *no* type)

cvs -z3 -q diff config.m4 (in directory S:\php4-HEAD\ext\dba)
Index: config.m4
===
RCS file: /repository/php4/ext/dba/config.m4,v
retrieving revision 1.38
diff -u -r1.38 config.m4
--- config.m4   28 Jan 2003 10:55:36 -  1.38
+++ config.m4   30 Jan 2003 00:47:29 -
@@ -1,5 +1,5 @@
 dnl
-dnl $Id: config.m4,v 1.38 2003/01/28 10:55:36 sniper Exp $
+dnl $Id: config.m4,v 1.29.2.6 2003/01/28 06:27:19 helly Exp $
 dnl

 dnl Suppose we need FlatFile if no support or only CDB is used.
@@ -10,7 +10,8 @@

 AC_DEFUN(PHP_TEMP_LDFLAGS,[
   old_LDFLAGS=$LDFLAGS
-  LDFLAGS=$1 $LDFLAGS
+dnl  LDFLAGS=$1 $LDFLAGS
+  LDFLAGS=$1
   $2
   LDFLAGS=$old_LDFLAGS
 ])
@@ -139,18 +140,20 @@
 dnl parameters(version, library list, function)
 AC_DEFUN(PHP_DBA_DB_CHECK,[
   for LIB in $2; do
-PHP_TEMP_LDFLAGS(-L$THIS_PREFIX/lib,[
-  AC_CHECK_LIB($LIB, $3, [
-AC_EGREP_CPP(yes,[
+if test -f $THIS_PREFIX/lib/lib$LIB.a -o -f 
$THIS_PREFIX/lib/lib$LIB.$SHLIB_SUFFIX_NAME; then
+  PHP_TEMP_LDFLAGS(-L$THIS_PREFIX/lib,[
+AC_CHECK_LIB($LIB, $3, [
+  AC_EGREP_CPP(yes,[
 #include $THIS_INCLUDE
 yes
 #endif
-],[
-  THIS_LIBS=$LIB
-  break
+  ],[
+THIS_LIBS=$LIB
+break
+  ])
 ])
   ])
-])
+fi
   done
   if test $1 = 4; then
 AC_MSG_CHECKING(for db4 minor version and patch level)




[PHP-CVS] cvs: php4 /ext/dba config.m4

2003-01-28 Thread Jani Taskinen
sniper  Tue Jan 28 05:55:36 2003 EDT

  Modified files:  
/php4/ext/dba   config.m4 
  Log:
  Fix configure. (typo?)
  
Index: php4/ext/dba/config.m4
diff -u php4/ext/dba/config.m4:1.37 php4/ext/dba/config.m4:1.38
--- php4/ext/dba/config.m4:1.37 Tue Jan 28 01:27:01 2003
+++ php4/ext/dba/config.m4  Tue Jan 28 05:55:36 2003
@@ -1,5 +1,5 @@
 dnl
-dnl $Id: config.m4,v 1.37 2003/01/28 06:27:01 helly Exp $
+dnl $Id: config.m4,v 1.38 2003/01/28 10:55:36 sniper Exp $
 dnl
 
 dnl Suppose we need FlatFile if no support or only CDB is used.
@@ -10,8 +10,7 @@
 
 AC_DEFUN(PHP_TEMP_LDFLAGS,[
   old_LDFLAGS=$LDFLAGS
-dnl  LDFLAGS=$1 $LDFLAGS
-  LDFLAGS=$1
+  LDFLAGS=$1 $LDFLAGS
   $2
   LDFLAGS=$old_LDFLAGS
 ])



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-CVS] cvs: php4 /ext/dba config.m4

2003-01-27 Thread Marcus Boerger
helly   Mon Jan 27 19:10:06 2003 EDT

  Modified files:  
/php4/ext/dba   config.m4 
  Log:
  - fix --without-flatfile
  - simplify Berkley DB verison check
  
Index: php4/ext/dba/config.m4
diff -u php4/ext/dba/config.m4:1.35 php4/ext/dba/config.m4:1.36
--- php4/ext/dba/config.m4:1.35 Sat Jan 25 14:46:58 2003
+++ php4/ext/dba/config.m4  Mon Jan 27 19:10:05 2003
@@ -1,5 +1,5 @@
 dnl
-dnl $Id: config.m4,v 1.35 2003/01/25 19:46:58 helly Exp $
+dnl $Id: config.m4,v 1.36 2003/01/28 00:10:05 helly Exp $
 dnl
 
 dnl Suppose we need FlatFile if no support or only CDB is used.
@@ -141,34 +141,28 @@
   for LIB in $2; do
 PHP_TEMP_LDFLAGS(-L$THIS_PREFIX/lib,[
   AC_CHECK_LIB($LIB, $3, [
-AC_TRY_RUN([
+  AC_EGREP_CPP(yes,[
 #include $THIS_INCLUDE
-int main() {
-  return (DB_VERSION_MAJOR == $1) ? 0 : 1;
-}
+  yes
+#endif
 ],[
   THIS_LIBS=$LIB
   break
-],[ ],[
-  THIS_LIBS=$LIB
-  break
-])
+],[ ])
   ])
 ])
   done
   if test $1 = 4; then
 AC_MSG_CHECKING(for db4 minor version and patch level)
-AC_TRY_RUN([
+AC_EGREP_CPP(yes,[
 #include $THIS_INCLUDE
-int main() {
-  return (DB_VERSION_MINOR != 1 || DB_VERSION_PATCH = 25) ? 0 : 1;
-}
+#if DB_VERSION_MINOR != 1 || DB_VERSION_PATCH = 25
+  yes
+#endif
 ],[
   AC_MSG_RESULT(ok)
 ],[
   AC_MSG_ERROR(Version 4.1 requires patch level 25)
-],[
-  AC_MSG_RESULT(crosscompiling)
 ])
   fi
   if test -n $THIS_LIBS; then
@@ -366,7 +360,7 @@
 AC_DEFUN(PHP_DBA_BUILTIN_FLATFILE,[
   PHP_ADD_BUILD_DIR($ext_builddir/libflatfile)
   AC_DEFINE(DBA_FLATFILE, 1, [ ])
-  flat_sources=dba_flatfile.c libflatfile/flatfile.c
+  flat_sources=libflatfile/flatfile.c
   THIS_RESULT=builtin
 ])
 
@@ -389,7 +383,7 @@
 if test $HAVE_DBA = 1; then
   AC_MSG_RESULT(yes)
   AC_DEFINE(HAVE_DBA, 1, [ ])
-  PHP_NEW_EXTENSION(dba, dba.c dba_cdb.c dba_db2.c dba_dbm.c dba_gdbm.c dba_ndbm.c 
dba_db3.c dba_db4.c $cdb_sources $flat_sources, $ext_shared)
+  PHP_NEW_EXTENSION(dba, dba.c dba_cdb.c dba_db2.c dba_dbm.c dba_gdbm.c dba_ndbm.c 
+dba_db3.c dba_db4.c dba_flatfile.c $cdb_sources $flat_sources, $ext_shared)
   PHP_SUBST(DBA_SHARED_LIBADD)
 else
   AC_MSG_RESULT(no)



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-CVS] cvs: php4 /ext/dba config.m4

2003-01-25 Thread Marcus Boerger
helly   Sat Jan 25 14:46:58 2003 EDT

  Modified files:  
/php4/ext/dba   config.m4 
  Log:
  The builtin version was always used even if configured otherwise.
  
Index: php4/ext/dba/config.m4
diff -u php4/ext/dba/config.m4:1.34 php4/ext/dba/config.m4:1.35
--- php4/ext/dba/config.m4:1.34 Mon Dec 30 12:42:55 2002
+++ php4/ext/dba/config.m4  Sat Jan 25 14:46:58 2003
@@ -1,5 +1,5 @@
 dnl
-dnl $Id: config.m4,v 1.34 2002/12/30 17:42:55 helly Exp $
+dnl $Id: config.m4,v 1.35 2003/01/25 19:46:58 helly Exp $
 dnl
 
 dnl Suppose we need FlatFile if no support or only CDB is used.
@@ -327,7 +327,7 @@
 
 AC_ARG_WITH(cdb,
 [  --with-cdb[=DIR]  DBA: Include CDB support],[
-  if test $withval != no; then
+  if test $withval = yes; then
 PHP_DBA_BUILTIN_CDB
   elif test $withval != no; then
 PHP_DBA_STD_BEGIN



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-CVS] cvs: php4 /ext/dba config.m4 /ext/mssql config.m4

2002-12-30 Thread Derick Rethans
derick  Mon Dec 30 03:55:21 2002 EDT

  Modified files:  
/php4/ext/mssql config.m4 
/php4/ext/dba   config.m4 
  Log:
  - Align mssql comment and clarify DBA handler selection
  
  
Index: php4/ext/mssql/config.m4
diff -u php4/ext/mssql/config.m4:1.1 php4/ext/mssql/config.m4:1.2
--- php4/ext/mssql/config.m4:1.1Mon Dec 16 17:26:49 2002
+++ php4/ext/mssql/config.m4Mon Dec 30 03:55:21 2002
@@ -1,9 +1,9 @@
 dnl
-dnl $Id: config.m4,v 1.1 2002/12/16 22:26:49 fmk Exp $
+dnl $Id: config.m4,v 1.2 2002/12/30 08:55:21 derick Exp $
 dnl
 
 PHP_ARG_WITH(mssql,for MSSQL support via FreeTDS,
-[  --with-mssql[=DIR] Include MSSQL-DB support.  DIR is the FreeTDS home
+[  --with-mssql[=DIR]  Include MSSQL-DB support.  DIR is the FreeTDS home
   directory, defaults to /usr/local/freetds.])
 
 
Index: php4/ext/dba/config.m4
diff -u php4/ext/dba/config.m4:1.32 php4/ext/dba/config.m4:1.33
--- php4/ext/dba/config.m4:1.32 Tue Nov 26 07:05:59 2002
+++ php4/ext/dba/config.m4  Mon Dec 30 03:55:21 2002
@@ -1,5 +1,5 @@
 dnl
-dnl $Id: config.m4,v 1.32 2002/11/26 12:05:59 helly Exp $
+dnl $Id: config.m4,v 1.33 2002/12/30 08:55:21 derick Exp $
 dnl
 
 dnl Suppose we need FlatFile if no support or only CDB is used.
@@ -69,7 +69,7 @@
 [  --enable-dbaBuild DBA with builtin modules])
 
 AC_ARG_WITH(gdbm,
-[  --with-gdbm[=DIR]   Include GDBM support],[
+[  --with-gdbm[=DIR] DBA: Include GDBM support],[
   if test $withval != no; then
 PHP_DBA_STD_BEGIN
 for i in $withval /usr/local /usr; do
@@ -100,7 +100,7 @@
 AC_DBA_STD_RESULT(gdbm)
 
 AC_ARG_WITH(ndbm,
-[  --with-ndbm[=DIR]   Include NDBM support],[
+[  --with-ndbm[=DIR] DBA: Include NDBM support],[
   if test $withval != no; then
 PHP_DBA_STD_BEGIN
 for i in $withval /usr/local /usr; do
@@ -168,7 +168,7 @@
 ])
 
 AC_ARG_WITH(db4,
-[  --with-db4[=DIR]Include Berkeley DB4 support],[
+[  --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.1 /usr/local/BerkeleyDB.4.0 /usr/local 
/usr; do
@@ -200,7 +200,7 @@
 AC_DBA_STD_RESULT(db4,Berkeley DB4)
 
 AC_ARG_WITH(db3,
-[  --with-db3[=DIR]Include Berkeley DB3 support],[
+[  --with-db3[=DIR]  DBA: Include Berkeley DB3 support],[
   if test $withval != no; then
 PHP_DBA_STD_BEGIN
 if test $HAVE_DB4 = 1; then
@@ -235,7 +235,7 @@
 AC_DBA_STD_RESULT(db3,Berkeley DB3)
 
 AC_ARG_WITH(db2,
-[  --with-db2[=DIR]Include Berkeley DB2 support],[
+[  --with-db2[=DIR]  DBA: Include Berkeley DB2 support],[
   if test $withval != no; then
 PHP_DBA_STD_BEGIN
 if test $HAVE_DB3 = 1 -o $HAVE_DB4 = 1; then
@@ -270,7 +270,7 @@
 AC_DBA_STD_RESULT(db2,Berkeley DB2)
 
 AC_ARG_WITH(dbm,
-[  --with-dbm[=DIR]Include DBM support],[
+[  --with-dbm[=DIR]  DBA: Include DBM support],[
   if test $withval != no; then
 PHP_DBA_STD_BEGIN
 for i in $withval /usr/local /usr; do
@@ -311,7 +311,7 @@
 ])
 
 AC_ARG_WITH(cdb,
-[  --with-cdb[=DIR]Include CDB support],[
+[  --with-cdb[=DIR]  DBA: Include CDB support],[
   if test $withval != no; then
 PHP_DBA_BUILTIN_CDB
   elif test $withval != no; then
@@ -359,7 +359,7 @@
 dnl FlatFile check must be the last one.
 dnl
 AC_ARG_WITH(flatfile,
-[  --with-flatfile Include FlatFile support],[
+[  --with-flatfile   DBA: Include FlatFile support],[
   if test $withval != no; then
 PHP_DBA_BUILTIN_FLATFILE
   fi



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-CVS] cvs: php4 /ext/dba config.m4 dba_db3.c dba_db4.c

2002-12-30 Thread Marcus Boerger
helly   Mon Dec 30 12:42:55 2002 EDT

  Modified files:  
/php4/ext/dba   config.m4 dba_db3.c dba_db4.c 
  Log:
  -disallow using db-n with libraries of different major versions
  -disallow using db-4.1 with patch level  25
  -fix db-4.1
  -added undocumented DB_FCNTL_LOCKING flag for version 3 and 4
  # wow the sleepycat guys answered *very* fast
  
Index: php4/ext/dba/config.m4
diff -u php4/ext/dba/config.m4:1.33 php4/ext/dba/config.m4:1.34
--- php4/ext/dba/config.m4:1.33 Mon Dec 30 03:55:21 2002
+++ php4/ext/dba/config.m4  Mon Dec 30 12:42:55 2002
@@ -1,5 +1,5 @@
 dnl
-dnl $Id: config.m4,v 1.33 2002/12/30 08:55:21 derick Exp $
+dnl $Id: config.m4,v 1.34 2002/12/30 17:42:55 helly Exp $
 dnl
 
 dnl Suppose we need FlatFile if no support or only CDB is used.
@@ -144,7 +144,7 @@
 AC_TRY_RUN([
 #include $THIS_INCLUDE
 int main() {
-  return DB_VERSION_MAJOR = $1 ? 0 : 1;
+  return (DB_VERSION_MAJOR == $1) ? 0 : 1;
 }
 ],[
   THIS_LIBS=$LIB
@@ -156,6 +156,21 @@
   ])
 ])
   done
+  if test $1 = 4; then
+AC_MSG_CHECKING(for db4 minor version and patch level)
+AC_TRY_RUN([
+#include $THIS_INCLUDE
+int main() {
+  return (DB_VERSION_MINOR != 1 || DB_VERSION_PATCH = 25) ? 0 : 1;
+}
+],[
+  AC_MSG_RESULT(ok)
+],[
+  AC_MSG_ERROR(Version 4.1 requires patch level 25)
+],[
+  AC_MSG_RESULT(crosscompiling)
+])
+  fi
   if test -n $THIS_LIBS; then
 AC_DEFINE(DBA_DB$1, 1, [ ]) 
 if test -n $THIS_INCLUDE; then
@@ -194,7 +209,7 @@
 break
   fi
 done
-PHP_DBA_DB_CHECK(4, db-4.1 db-4 db4 db, db_create)
+PHP_DBA_DB_CHECK(4, db-4.1 db-4.0 db-4 db4 db, db_create)
   fi
 ])
 AC_DBA_STD_RESULT(db4,Berkeley DB4)
@@ -229,7 +244,7 @@
 break
   fi
 done
-PHP_DBA_DB_CHECK(3, db-3.3 db-3.2 db-3.1 db-3 db3 db, db_create)
+PHP_DBA_DB_CHECK(3, db-3.3 db-3.2 db-3.1 db-3.0 db-3 db3 db, db_create)
   fi
   ])
 AC_DBA_STD_RESULT(db3,Berkeley DB3)
Index: php4/ext/dba/dba_db3.c
diff -u php4/ext/dba/dba_db3.c:1.25 php4/ext/dba/dba_db3.c:1.26
--- php4/ext/dba/dba_db3.c:1.25 Mon Dec 30 08:07:29 2002
+++ php4/ext/dba/dba_db3.c  Mon Dec 30 12:42:55 2002
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: dba_db3.c,v 1.25 2002/12/30 13:07:29 helly Exp $ */
+/* $Id: dba_db3.c,v 1.26 2002/12/30 17:42:55 helly Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -81,14 +81,13 @@
filemode = Z_LVAL_PP(info-argv[0]);
}
 
+#ifdef DB_FCNTL_LOCKING
+   gmode |= DB_FCNTL_LOCKING;
+#endif
+
if ((err=db_create(dbp, NULL, 0)) == 0) {
dbp-set_errcall(dbp, php_dba_db3_errcall_fcn);
-   if (
-#if (DB_VERSION_MAJOR == 4  DB_VERSION_MINOR = 1)
-   (err=dbp-open(dbp, 0, info-path, NULL, type, gmode, 
filemode)) == 0) {
-#else
-   (err=dbp-open(dbp, info-path, NULL, type, gmode, filemode)) 
== 0) {
-#endif
+   if ((err=dbp-open(dbp, info-path, NULL, type, gmode, filemode)) == 0) {
dba_db3_data *data;
 
data = pemalloc(sizeof(*data), info-flagsDBA_PERSISTENT);
Index: php4/ext/dba/dba_db4.c
diff -u php4/ext/dba/dba_db4.c:1.5 php4/ext/dba/dba_db4.c:1.6
--- php4/ext/dba/dba_db4.c:1.5  Mon Dec 30 08:09:03 2002
+++ php4/ext/dba/dba_db4.c  Mon Dec 30 12:42:55 2002
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: dba_db4.c,v 1.5 2002/12/30 13:09:03 helly Exp $ */
+/* $Id: dba_db4.c,v 1.6 2002/12/30 17:42:55 helly Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -80,6 +80,10 @@
convert_to_long_ex(info-argv[0]);
filemode = Z_LVAL_PP(info-argv[0]);
}
+
+#ifdef DB_FCNTL_LOCKING
+   gmode |= DB_FCNTL_LOCKING;
+#endif
 
if ((err=db_create(dbp, NULL, 0)) == 0) {
dbp-set_errcall(dbp, php_dba_db4_errcall_fcn);



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-CVS] cvs: php4 /ext/dba config.m4

2002-11-26 Thread Marcus Boerger
helly   Tue Nov 26 07:00:26 2002 EDT

  Modified files:  
/php4/ext/dba   config.m4 
  Log:
  -Disallow combining db2 with db3 which are conflicting.
  -Stop searching for headers and libraries when found.
  -Check version for Berkeley DB library headers.
  
  
Index: php4/ext/dba/config.m4
diff -u php4/ext/dba/config.m4:1.30 php4/ext/dba/config.m4:1.31
--- php4/ext/dba/config.m4:1.30 Fri Nov 15 16:28:42 2002
+++ php4/ext/dba/config.m4  Tue Nov 26 07:00:25 2002
@@ -1,8 +1,12 @@
 dnl
-dnl $Id: config.m4,v 1.30 2002/11/15 21:28:42 helly Exp $
+dnl $Id: config.m4,v 1.31 2002/11/26 12:00:25 helly Exp $
 dnl
 
-dnl Suppose we need FlatFile if no or only CDB is used.
+dnl Suppose we need FlatFile if no support or only CDB is used.
+
+AC_DEFUN(PHP_DBA_STD_BEGIN,[
+  unset THIS_INCLUDE THIS_INC_DIR THIS_LIBS THIS_LFLAGS THIS_PREFIX THIS_RESULT
+])
 
 AC_DEFUN(PHP_TEMP_LDFLAGS,[
   old_LDFLAGS=$LDFLAGS
@@ -14,7 +18,6 @@
 dnl Assign INCLUDE/LFLAGS from PREFIX
 AC_DEFUN(PHP_DBA_STD_ASSIGN,[
   if test -n $THIS_PREFIX  test $THIS_PREFIX != /usr; then
-THIS_INCLUDE=$THIS_PREFIX/include
 THIS_LFLAGS=$THIS_PREFIX/lib
   fi
 ])
@@ -22,30 +25,44 @@
 dnl Standard check
 AC_DEFUN(PHP_DBA_STD_CHECK,[
   THIS_RESULT=yes
-  if test $THIS_PREFIX != /usr -a $THIS_INCLUDE = ; then
+  if test -z $THIS_INCLUDE; then
 AC_MSG_ERROR(cannot find necessary header file(s))
   fi
-  if test $THIS_LIBS =  ; then
+  if test -z $THIS_LIBS; then
 AC_MSG_ERROR(cannot find necessary library)
   fi
 ])
 
 dnl Attach THIS_x to DBA_x
 AC_DEFUN(PHP_DBA_STD_ATTACH,[
-  PHP_ADD_INCLUDE($THIS_INCLUDE)
+  if test -n $THIS_INC_DIR -a $THIS_PREFIX != /usr; then
+PHP_ADD_INCLUDE($THIS_INC_DIR)
+  fi
   PHP_ADD_LIBRARY_WITH_PATH($THIS_LIBS, $THIS_LFLAGS, DBA_SHARED_LIBADD)
-  unset THIS_INCLUDE THIS_LIBS THIS_LFLAGS THIS_PREFIX
+  unset THIS_INCLUDE THIS_INC_DIR THIS_LIBS THIS_LFLAGS THIS_PREFIX
 ])
 
 dnl Print the result message
+dnl parameters(name [, full name [, empty or error message]])
 AC_DEFUN(AC_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)
+  if test -n $3; then
+AC_MSG_ERROR($3)
+  fi
   if test $THIS_RESULT = yes -o $THIS_RESULT = builtin; then
 HAVE_DBA=1
+eval HAVE_$THIS_NAME=1
 AC_MSG_RESULT($THIS_RESULT)
   else
 AC_MSG_RESULT(no)
   fi
-  unset THIS_RESULT
+  unset THIS_RESULT THIS_NAME THIS_FULL_NAME
 ])
 
 PHP_ARG_ENABLE(dba,whether to enable DBA,
@@ -54,163 +71,200 @@
 AC_ARG_WITH(gdbm,
 [  --with-gdbm[=DIR]   Include GDBM support],[
   if test $withval != no; then
-for i in /usr/local /usr $withval; do
+PHP_DBA_STD_BEGIN
+for i in $withval /usr/local /usr; do
   if test -f $i/include/gdbm.h; then
-THIS_PREFIX=$i
+THIS_PREFIX=$i
+THIS_INCLUDE=$i/include/gdbm.h
+THIS_INC_DIR=$i/include
+break
   fi
 done
 
-unset ac_cv_lib_gdbm_gdbm_open
-PHP_TEMP_LDFLAGS(-L$THIS_PREFIX/lib,[
-AC_CHECK_LIB(gdbm, gdbm_open, [AC_DEFINE(DBA_GDBM, 1, [ ]) THIS_LIBS=gdbm])
-])
+if test -n $THIS_INCLUDE; then
+  unset ac_cv_lib_gdbm_gdbm_open
+  PHP_TEMP_LDFLAGS(-L$THIS_PREFIX/lib,[
+AC_CHECK_LIB(gdbm, gdbm_open, [
+  AC_DEFINE(DBA_GDBM, 1, [ ]) 
+  THIS_LIBS=gdbm
+  break
+])
+  ])
+fi
 
 PHP_DBA_STD_ASSIGN
 PHP_DBA_STD_CHECK
 PHP_DBA_STD_ATTACH
   fi
 ])
-AC_MSG_CHECKING(for GDBM support)
-AC_DBA_STD_RESULT
+AC_DBA_STD_RESULT(gdbm)
 
 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
-THIS_PREFIX=$i
-NDBM_EXTRA=db1/ndbm.h
-  elif test -f $i/include/ndbm.h ; 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
-NDBM_EXTRA=ndbm.h
+THIS_INCLUDE=$i/include/db1/ndbm.h
+break
   fi
-   done
+done
 
-if test $NDBM_EXTRA != ; then
-  AC_DEFINE_UNQUOTED(NDBM_INCLUDE_FILE, $NDBM_EXTRA, [ ])
+if test -n $THIS_INCLUDE; then
+  AC_DEFINE_UNQUOTED(NDBM_INCLUDE_FILE, $THIS_INCLUDE, [ ])
+  for LIB in ndbm db1 c; do
+PHP_TEMP_LDFLAGS(-L$THIS_PREFIX/lib,[
+  AC_CHECK_LIB($LIB, dbm_open, [
+AC_DEFINE(DBA_NDBM,1, [ ]) 
+THIS_LIBS=$LIB
+break
+  ])
+])
+  done
 fi
 
-for LIB in db1 ndbm c; do
-  PHP_TEMP_LDFLAGS(-L$THIS_PREFIX/lib,[
-  AC_CHECK_LIB($LIB, dbm_open, [AC_DEFINE(DBA_NDBM,1, [ ]) THIS_LIBS=$LIB])
-  ])
-done
-
 PHP_DBA_STD_ASSIGN
 PHP_DBA_STD_CHECK
 

[PHP-CVS] cvs: php4 /ext/dba config.m4 dba.c dba_db4.c php_db4.h

2002-11-26 Thread Marcus Boerger
helly   Tue Nov 26 07:05:59 2002 EDT

  Added files: 
/php4/ext/dba   dba_db4.c php_db4.h 

  Modified files:  
/php4/ext/dba   config.m4 dba.c 
  Log:
  Add Berkeley db4 support
  
  
Index: php4/ext/dba/config.m4
diff -u php4/ext/dba/config.m4:1.31 php4/ext/dba/config.m4:1.32
--- php4/ext/dba/config.m4:1.31 Tue Nov 26 07:00:25 2002
+++ php4/ext/dba/config.m4  Tue Nov 26 07:05:59 2002
@@ -1,5 +1,5 @@
 dnl
-dnl $Id: config.m4,v 1.31 2002/11/26 12:00:25 helly Exp $
+dnl $Id: config.m4,v 1.32 2002/11/26 12:05:59 helly Exp $
 dnl
 
 dnl Suppose we need FlatFile if no support or only CDB is used.
@@ -167,10 +167,45 @@
   PHP_DBA_STD_ATTACH
 ])
 
+AC_ARG_WITH(db4,
+[  --with-db4[=DIR]Include Berkeley DB4 support],[
+  if test $withval != no; then
+PHP_DBA_STD_BEGIN
+for i in $withval /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.1 db-4 db4 db, db_create)
+  fi
+])
+AC_DBA_STD_RESULT(db4,Berkeley DB4)
+
 AC_ARG_WITH(db3,
 [  --with-db3[=DIR]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)
+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
@@ -203,8 +238,8 @@
 [  --with-db2[=DIR]Include Berkeley DB2 support],[
   if test $withval != no; then
 PHP_DBA_STD_BEGIN
-if test $HAVE_DB3 = 1; then
-  AC_DBA_STD_RESULT(db2,Berkeley DB2,You cannot combine --with-db2 with 
--with-db3)
+if test $HAVE_DB3 = 1 -o $HAVE_DB4 = 1; then
+  AC_DBA_STD_RESULT(db2,Berkeley DB2,You cannot combine --with-db2 with 
+--with-db3 or --with-db4)
 fi
 for i in $withval $withval/BerkeleyDB /usr/BerkeleyDB /usr/local /usr; do
   if test -f $i/db2/db.h; then
@@ -339,7 +374,7 @@
 if test $HAVE_DBA = 1; then
   AC_MSG_RESULT(yes)
   AC_DEFINE(HAVE_DBA, 1, [ ])
-  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)
+  PHP_NEW_EXTENSION(dba, dba.c dba_cdb.c dba_db2.c dba_dbm.c dba_gdbm.c dba_ndbm.c 
+dba_db3.c dba_db4.c $cdb_sources $flat_sources, $ext_shared)
   PHP_SUBST(DBA_SHARED_LIBADD)
 else
   AC_MSG_RESULT(no)
Index: php4/ext/dba/dba.c
diff -u php4/ext/dba/dba.c:1.64 php4/ext/dba/dba.c:1.65
--- php4/ext/dba/dba.c:1.64 Fri Nov 22 10:47:47 2002
+++ php4/ext/dba/dba.c  Tue Nov 26 07:05:59 2002
@@ -17,7 +17,7 @@
+--+
  */
 
-/* $Id: dba.c,v 1.64 2002/11/22 15:47:47 helly Exp $ */
+/* $Id: dba.c,v 1.65 2002/11/26 12:05:59 helly Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -44,6 +44,7 @@
 #include php_cdb.h
 #include php_db2.h
 #include php_db3.h
+#include php_db4.h
 #include php_flatfile.h
 
 /* {{{ dba_functions[]
@@ -195,6 +196,9 @@
 #endif
 #if DBA_DB3
DBA_HND(db3, DBA_LOCK_ALL) /* No lock in lib */
+#endif
+#if DBA_DB4
+   DBA_HND(db4, DBA_LOCK_ALL) /* No lock in lib */
 #endif
 #if DBA_FLATFILE
DBA_HND(flatfile, DBA_STREAM_OPEN|DBA_LOCK_ALL) /* No lock in lib */

Index: php4/ext/dba/dba_db4.c
+++ php4/ext/dba/dba_db4.c
/*
   +--+
   | PHP Version 4|
   +--+
   | Copyright (c) 1997-2002 The PHP Group|
   +--+
   | This source file is subject to version 2.02 of the PHP license,  |
   | that is bundled with this package in the file LICENSE, and is|
   | available at through the world-wide-web at   |
   | http://www.php.net/license/2_02.txt. |
   | If you did not receive a copy of the PHP license and are unable to   |
   | obtain it through the world-wide-web, please send a note to  |
   | [EMAIL PROTECTED] so we can mail you a copy immediately.   |
   

[PHP-CVS] cvs: php4 /ext/dba config.m4

2002-11-15 Thread Marcus Boerger
helly   Fri Nov 15 16:28:42 2002 EDT

  Modified files:  
/php4/ext/dba   config.m4 
  Log:
  When --enable-dba is used then include builtin modules unless --without-xxx
  is not used.
  
  
Index: php4/ext/dba/config.m4
diff -u php4/ext/dba/config.m4:1.29 php4/ext/dba/config.m4:1.30
--- php4/ext/dba/config.m4:1.29 Wed Nov 13 08:12:26 2002
+++ php4/ext/dba/config.m4  Fri Nov 15 16:28:42 2002
 -1,7 +1,9 
 dnl
-dnl $Id: config.m4,v 1.29 2002/11/13 13:12:26 edink Exp $
+dnl $Id: config.m4,v 1.30 2002/11/15 21:28:42 helly Exp $
 dnl
 
+dnl Suppose we need FlatFile if no or only CDB is used.
+
 AC_DEFUN(PHP_TEMP_LDFLAGS,[
   old_LDFLAGS=$LDFLAGS
   LDFLAGS=$1 $LDFLAGS
 -9,7 +11,6 
   LDFLAGS=$old_LDFLAGS
 ])
 
-
 dnl Assign INCLUDE/LFLAGS from PREFIX
 AC_DEFUN(PHP_DBA_STD_ASSIGN,[
   if test -n $THIS_PREFIX  test $THIS_PREFIX != /usr; then
 -48,7 +49,7 
 ])
 
 PHP_ARG_ENABLE(dba,whether to enable DBA,
-[  --enable-dba=shared Build DBA as a shared module])
+[  --enable-dbaBuild DBA with builtin modules])
 
 AC_ARG_WITH(gdbm,
 [  --with-gdbm[=DIR]   Include GDBM support],[
 -211,15 +212,19 
 AC_MSG_CHECKING(for DBM support)
 AC_DBA_STD_RESULT
 
+AC_DEFUN(PHP_DBA_BUILTIN_CDB,[
+  PHP_ADD_BUILD_DIR($ext_builddir/libcdb)
+  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
+])
+
 AC_ARG_WITH(cdb,
 [  --with-cdb[=DIR]Include CDB support],[
-  if test $withval = yes; then
-PHP_ADD_BUILD_DIR($ext_builddir/libcdb)
-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
+  if test $withval != no; then
+PHP_DBA_BUILTIN_CDB
   elif test $withval != no; then
 for i in /usr/local /usr $withval; do
   if test -f $i/include/cdb.h ; then
 -237,17 +242,32 
 PHP_DBA_STD_CHECK
 PHP_DBA_STD_ATTACH
   fi
+],[
+  if test $PHP_DBA != no; then
+PHP_DBA_BUILTIN_CDB
+  fi
 ])
 AC_MSG_CHECKING(for CDB support)
 AC_DBA_STD_RESULT
 
+AC_DEFUN(PHP_DBA_BUILTIN_FLATFILE,[
+  PHP_ADD_BUILD_DIR($ext_builddir/libflatfile)
+  AC_DEFINE(DBA_FLATFILE, 1, [ ])
+  flat_sources=dba_flatfile.c libflatfile/flatfile.c
+  THIS_RESULT=builtin
+])
+
+dnl
+dnl FlatFile check must be the last one.
+dnl
 AC_ARG_WITH(flatfile,
 [  --with-flatfile Include FlatFile support],[
   if test $withval != no; then
-PHP_ADD_BUILD_DIR($ext_builddir/libflatfile)
-AC_DEFINE(DBA_FLATFILE, 1, [ ])
-flat_sources=dba_flatfile.c libflatfile/flatfile.c
-THIS_RESULT=builtin
+PHP_DBA_BUILTIN_FLATFILE
+  fi
+],[
+  if test $PHP_DBA != no; then
+PHP_DBA_BUILTIN_FLATFILE
   fi
 ])
 AC_MSG_CHECKING(for FlatFile support)



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-CVS] cvs: php4 /ext/dba config.m4 dba.c dba_flatfile.c dba_flatile.c /ext/dba/libflatfile flatfile.c flatfile.h

2002-11-06 Thread Marcus Börger
helly   Wed Nov  6 04:17:51 2002 EDT

  Added files: 
/php4/ext/dba   dba_flatfile.c 

  Removed files:   
/php4/ext/dba   dba_flatile.c 

  Modified files:  
/php4/ext/dba   config.m4 dba.c 
/php4/ext/dba/libflatfile   flatfile.c flatfile.h 
  Log:
  Use the the name 'flatfile' correctly so the handler support can be built now.
  #I do not like the lock solution since a crashed php would leave the *lck
  #file locked now.
  
  
Index: php4/ext/dba/config.m4
diff -u php4/ext/dba/config.m4:1.26 php4/ext/dba/config.m4:1.27
--- php4/ext/dba/config.m4:1.26 Tue Nov  5 23:16:17 2002
+++ php4/ext/dba/config.m4  Wed Nov  6 04:17:50 2002
@@ -1,5 +1,5 @@
 dnl
-dnl $Id: config.m4,v 1.26 2002/11/06 04:16:17 helly Exp $
+dnl $Id: config.m4,v 1.27 2002/11/06 09:17:50 helly Exp $
 dnl
 
 AC_DEFUN(PHP_TEMP_LDFLAGS,[
@@ -246,7 +246,7 @@
   if test $withval = yes; then
 PHP_ADD_BUILD_DIR($ext_builddir/libflatfile)
 AC_DEFINE(DBA_FLATFILE, 1, [ ])
-flat_sources=php_flatfile.c libflatfile/flatfile.c
+flat_sources=dba_flatfile.c libflatfile/flatfile.c
 THIS_RESULT=builtin
   fi
 ])
Index: php4/ext/dba/dba.c
diff -u php4/ext/dba/dba.c:1.53 php4/ext/dba/dba.c:1.54
--- php4/ext/dba/dba.c:1.53 Tue Nov  5 23:16:17 2002
+++ php4/ext/dba/dba.c  Wed Nov  6 04:17:50 2002
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: dba.c,v 1.53 2002/11/06 04:16:17 helly Exp $ */
+/* $Id: dba.c,v 1.54 2002/11/06 09:17:50 helly Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -35,6 +35,7 @@
 #include php_cdb.h
 #include php_db2.h
 #include php_db3.h
+#include php_flatfile.h
 
 /* {{{ dba_functions[]
  */
Index: php4/ext/dba/libflatfile/flatfile.c
diff -u php4/ext/dba/libflatfile/flatfile.c:1.1 php4/ext/dba/libflatfile/flatfile.c:1.2
--- php4/ext/dba/libflatfile/flatfile.c:1.1 Tue Nov  5 23:16:18 2002
+++ php4/ext/dba/libflatfile/flatfile.c Wed Nov  6 04:17:51 2002
@@ -19,7 +19,7 @@
+--+
  */
 
-/* $Id: flatfile.c,v 1.1 2002/11/06 04:16:18 helly Exp $ */
+/* $Id: flatfile.c,v 1.2 2002/11/06 09:17:51 helly Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -36,7 +36,7 @@
 #include unistd.h
 #endif
 
-#include dbm.h
+#include flatfile.h
 
 /*
  * ret = -1 means that database was opened for read-only
@@ -46,7 +46,7 @@
 
 /* {{{ dbm_file_store
  */
-PHPAPI int dbm_file_store(dba_dbm_data *dba, datum key_datum, datum value_datum, int 
mode TSRMLS_DC) {
+PHPAPI int dbm_file_store(flatfile *dba, datum key_datum, datum value_datum, int mode 
+TSRMLS_DC) {
if (mode == DBM_INSERT) {
if (dbm_file_findkey(dba, key_datum TSRMLS_CC)) {
return 1;
@@ -77,7 +77,7 @@
 
 /* {{{ dbm_file_fetch
  */
-PHPAPI datum dbm_file_fetch(dba_dbm_data *dba, datum key_datum TSRMLS_DC) {
+PHPAPI datum dbm_file_fetch(flatfile *dba, datum key_datum TSRMLS_DC) {
datum value_datum = {NULL, 0};
int num=0, buf_size=1024;
char *buf;  
@@ -105,7 +105,7 @@
 
 /* {{{ dbm_file_delete
  */
-PHPAPI int dbm_file_delete(dba_dbm_data *dba, datum key_datum TSRMLS_DC) {
+PHPAPI int dbm_file_delete(flatfile *dba, datum key_datum TSRMLS_DC) {
char *key = key_datum.dptr;
int size = key_datum.dsize;
 
@@ -164,7 +164,7 @@
 
 /* {{{ dbm_file_findkey
  */
-PHPAPI int dbm_file_findkey(dba_dbm_data *dba, datum key_datum TSRMLS_DC) {
+PHPAPI int dbm_file_findkey(flatfile *dba, datum key_datum TSRMLS_DC) {
char *buf = NULL;
int num;
int buf_size=1024;
@@ -211,7 +211,7 @@
 
 /* {{{ dbm_file_firstkey
  */
-PHPAPI datum dbm_file_firstkey(dba_dbm_data *dba TSRMLS_DC) {
+PHPAPI datum dbm_file_firstkey(flatfile *dba TSRMLS_DC) {
datum buf;
int num;
int buf_size=1024;
@@ -252,7 +252,7 @@
 
 /* {{{ latfile_nextkey
  */
-PHPAPI datum dbm_file_nextkey(dba_dbm_data *dba TSRMLS_DC) {
+PHPAPI datum dbm_file_nextkey(flatfile *dba TSRMLS_DC) {
datum buf;
int num;
int buf_size=1024;
Index: php4/ext/dba/libflatfile/flatfile.h
diff -u php4/ext/dba/libflatfile/flatfile.h:1.1 php4/ext/dba/libflatfile/flatfile.h:1.2
--- php4/ext/dba/libflatfile/flatfile.h:1.1 Tue Nov  5 23:16:18 2002
+++ php4/ext/dba/libflatfile/flatfile.h Wed Nov  6 04:17:51 2002
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: flatfile.h,v 1.1 2002/11/06 04:16:18 helly Exp $ */
+/* $Id: flatfile.h,v 1.2 2002/11/06 09:17:51 helly Exp $ */
 
 #ifndef PHP_LIBDBM_H
 #define PHP_LIBDBM_H
@@ -32,16 +32,16 @@
php_stream *fp;
long CurrentFlatFilePos;
datum nextkey;
-} dba_dbm_data;
+} flatfile;
 
 #define DBM_INSERT 0
 #define DBM_REPLACE 1
 
-PHPAPI int dbm_file_store(dba_dbm_data *dba, datum key_datum, datum value_datum, int 
mode TSRMLS_DC);
-PHPAPI datum 

[PHP-CVS] cvs: php4 /ext/dba config.m4

2002-11-06 Thread Marcus Börger
helly   Wed Nov  6 05:08:38 2002 EDT

  Modified files:  
/php4/ext/dba   config.m4 
  Log:
  There shall never be an external library for this (hopefully).
  
  
Index: php4/ext/dba/config.m4
diff -u php4/ext/dba/config.m4:1.27 php4/ext/dba/config.m4:1.28
--- php4/ext/dba/config.m4:1.27 Wed Nov  6 04:17:50 2002
+++ php4/ext/dba/config.m4  Wed Nov  6 05:08:38 2002
 -1,5 +1,5 
 dnl
-dnl $Id: config.m4,v 1.27 2002/11/06 09:17:50 helly Exp $
+dnl $Id: config.m4,v 1.28 2002/11/06 10:08:38 helly Exp $
 dnl
 
 AC_DEFUN(PHP_TEMP_LDFLAGS,[
 -242,8 +242,8 
 AC_DBA_STD_RESULT
 
 AC_ARG_WITH(flatfile,
-[  --with-flatfile[=DIR]   Include FlatFile support],[
-  if test $withval = yes; then
+[  --with-flatfile Include FlatFile support],[
+  if test $withval != no; then
 PHP_ADD_BUILD_DIR($ext_builddir/libflatfile)
 AC_DEFINE(DBA_FLATFILE, 1, [ ])
 flat_sources=dba_flatfile.c libflatfile/flatfile.c



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-CVS] cvs: php4 /ext/dba config.m4

2002-11-05 Thread Marcus Börger
helly   Tue Nov  5 07:03:02 2002 EDT

  Modified files:  
/php4/ext/dba   config.m4 
  Log:
  added missing compiler define
  
  
Index: php4/ext/dba/config.m4
diff -u php4/ext/dba/config.m4:1.23 php4/ext/dba/config.m4:1.24
--- php4/ext/dba/config.m4:1.23 Mon Nov  4 12:53:04 2002
+++ php4/ext/dba/config.m4  Tue Nov  5 07:03:01 2002
 -1,5 +1,5 
 dnl
-dnl $Id: config.m4,v 1.23 2002/11/04 17:53:04 helly Exp $
+dnl $Id: config.m4,v 1.24 2002/11/05 12:03:01 helly Exp $
 dnl
 
 AC_DEFUN(PHP_TEMP_LDFLAGS,[
 -215,6 +215,7 
 [  --with-cdb[=DIR]Include CDB support],[
   if test $withval = yes; then
 PHP_ADD_BUILD_DIR($ext_builddir/libcdb)
+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



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-CVS] cvs: php4 /ext/dba config.m4 dba.c dba_dbm.c dba_flatile.c php_flatfile.h /ext/dba/libdbm dbm.c dbm.h /ext/dba/libflatfile .cvsignore flatfile.c flatfile.h /ext/dba/tests dba_flatfile.phpt

2002-11-05 Thread Marcus Börger
helly   Tue Nov  5 23:16:18 2002 EDT

  Added files: 
/php4/ext/dba   dba_flatile.c php_flatfile.h 
/php4/ext/dba/libflatfile   .cvsignore flatfile.c flatfile.h 
/php4/ext/dba/tests dba_flatfile.phpt 

  Removed files:   
/php4/ext/dba/libdbmdbm.c dbm.h 

  Modified files:  
/php4/ext/dba   config.m4 dba.c dba_dbm.c 
  Log:
  move newly introduced flatfile support from dbm to new flatfile handler
  # do not make the same mistake as with ext/db where it was not clear
  # which format was used.
  
  
Index: php4/ext/dba/config.m4
diff -u php4/ext/dba/config.m4:1.25 php4/ext/dba/config.m4:1.26
--- php4/ext/dba/config.m4:1.25 Tue Nov  5 20:47:06 2002
+++ php4/ext/dba/config.m4  Tue Nov  5 23:16:17 2002
@@ -1,5 +1,5 @@
 dnl
-dnl $Id: config.m4,v 1.25 2002/11/06 01:47:06 helly Exp $
+dnl $Id: config.m4,v 1.26 2002/11/06 04:16:17 helly Exp $
 dnl
 
 AC_DEFUN(PHP_TEMP_LDFLAGS,[
@@ -190,13 +190,7 @@
 
 AC_ARG_WITH(dbm,
 [  --with-dbm[=DIR]Include DBM support],[
-  if test $withval = yes; then
-PHP_ADD_BUILD_DIR($ext_builddir/libdbm)
-AC_DEFINE(DBA_DBM_BUILTIN, 1, [ ])
-AC_DEFINE(DBA_DBM, 1, [ ])
-dbm_sources=libdbm/dbm.c
-THIS_RESULT=builtin
-  elif test $withval != no; then
+  if test $withval != no; then
 for i in /usr/local /usr $withval; do
   if test -f $i/include/dbm.h ; then
 THIS_PREFIX=$i
@@ -247,11 +241,23 @@
 AC_MSG_CHECKING(for CDB support)
 AC_DBA_STD_RESULT
 
+AC_ARG_WITH(flatfile,
+[  --with-flatfile[=DIR]   Include FlatFile support],[
+  if test $withval = yes; then
+PHP_ADD_BUILD_DIR($ext_builddir/libflatfile)
+AC_DEFINE(DBA_FLATFILE, 1, [ ])
+flat_sources=php_flatfile.c libflatfile/flatfile.c
+THIS_RESULT=builtin
+  fi
+])
+AC_MSG_CHECKING(for FlatFile support)
+AC_DBA_STD_RESULT
+
 AC_MSG_CHECKING(whether to enable DBA interface)
 if test $HAVE_DBA = 1; then
   AC_MSG_RESULT(yes)
   AC_DEFINE(HAVE_DBA, 1, [ ])
-  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 $dbm_sources, $ext_shared)
+  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)
   PHP_SUBST(DBA_SHARED_LIBADD)
 else
   AC_MSG_RESULT(no)
Index: php4/ext/dba/dba.c
diff -u php4/ext/dba/dba.c:1.52 php4/ext/dba/dba.c:1.53
--- php4/ext/dba/dba.c:1.52 Tue Nov  5 10:01:20 2002
+++ php4/ext/dba/dba.c  Tue Nov  5 23:16:17 2002
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: dba.c,v 1.52 2002/11/05 15:01:20 helly Exp $ */
+/* $Id: dba.c,v 1.53 2002/11/06 04:16:17 helly Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -184,6 +184,9 @@
 #endif
 #if DBA_DB3
DBA_HND(db3)
+#endif
+#if DBA_FLATFILE
+   DBA_HND(flatfile)
 #endif
{ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }
 };
Index: php4/ext/dba/dba_dbm.c
diff -u php4/ext/dba/dba_dbm.c:1.20 php4/ext/dba/dba_dbm.c:1.21
--- php4/ext/dba/dba_dbm.c:1.20 Tue Nov  5 21:21:49 2002
+++ php4/ext/dba/dba_dbm.c  Tue Nov  5 23:16:17 2002
@@ -12,12 +12,11 @@
| obtain it through the world-wide-web, please send a note to  |
| [EMAIL PROTECTED] so we can mail you a copy immediately.   |
+--+
-   | Authors: Sascha Schumann [EMAIL PROTECTED]|
-   |  Marcus Boerger [EMAIL PROTECTED]  |
+   | Author: Sascha Schumann [EMAIL PROTECTED] |
+--+
  */
 
-/* $Id: dba_dbm.c,v 1.20 2002/11/06 02:21:49 helly Exp $ */
+/* $Id: dba_dbm.c,v 1.21 2002/11/06 04:16:17 helly Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -28,23 +27,13 @@
 #if DBA_DBM
 #include php_dbm.h
 
-#ifdef DBA_DBM_BUILTIN
-#include libdbm/dbm.h
-#else
 #include dbm.h
-#endif
 
 #include unistd.h
 #include sys/types.h
 #include sys/stat.h
 #include fcntl.h
 
-#ifndef DBA_DBM_BUILTIN
-typedef struct {
-   datum nextkey;
-} dba_dbm_data;
-#endif
-
 #define DBM_DATA dba_dbm_data *dba = info-dbf
 #define DBM_GKEY datum gkey; gkey.dptr = (char *) key; gkey.dsize = keylen
 
@@ -56,43 +45,12 @@
close(fd);
 
 
+typedef struct {
+   datum nextkey;
+} dba_dbm_data;
+
 DBA_OPEN_FUNC(dbm)
 {
-#ifdef DBA_DBM_BUILTIN
-   char *fmode;
-   php_stream *fp;
-
-   info-dbf = ecalloc(sizeof(dba_dbm_data), 1);
-   if (!info-dbf) {
-   *error = Out of memory;
-   return FAILURE;
-   }
-
-   switch(info-mode) {
-   case DBA_READER:
-   fmode = r;
-   break;
-   case DBA_WRITER:
-   fmode = r+b;
-   break;
-   case DBA_CREAT:
-   fmode = 

[PHP-CVS] cvs: php4 /ext/dba config.m4

2002-09-11 Thread Dan Kalowsky

kalowskyWed Sep 11 11:05:06 2002 EDT

  Modified files:  
/php4/ext/dba   config.m4 
  Log:
  Patch for Bug #19341 submitted by [EMAIL PROTECTED]
  
  
Index: php4/ext/dba/config.m4
diff -u php4/ext/dba/config.m4:1.19 php4/ext/dba/config.m4:1.20
--- php4/ext/dba/config.m4:1.19 Thu Apr 18 08:30:18 2002
+++ php4/ext/dba/config.m4  Wed Sep 11 11:05:06 2002
@@ -1,5 +1,5 @@
 dnl
-dnl $Id: config.m4,v 1.19 2002/04/18 12:30:18 derick Exp $
+dnl $Id: config.m4,v 1.20 2002/09/11 15:05:06 kalowsky Exp $
 dnl
 
 AC_DEFUN(PHP_TEMP_LDFLAGS,[
@@ -152,10 +152,19 @@
 [  --with-db3[=DIR]Include Berkeley DB3 support],[
   if test $withval != no; then
 for i in /usr/local /usr /usr/local/BerkeleyDB.3.0 $withval; do
-  if test -f $i/include/db3/db.h; then
+  if test -f $i/db3/db.h; then
+THIS_PREFIX=$i
+DB3_EXTRA=db3
+  elif test -f $i/include/db3/db.h; then
 THIS_PREFIX=$i
 DB3_EXTRA=db3/db.h
-  elif test -f $i/include/db.h ; then
+  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
+  elif test -f $i/include/db.h ; 
 THIS_PREFIX=$i
 DB3_EXTRA=db.h
   fi



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php