[PVFS2-CVS] commit by bradles in pvfs2: configure configure.in

CVS commit program cvs at parl.clemson.edu
Wed Jun 15 17:52:23 EDT 2005


Update of /projects/cvsroot/pvfs2
In directory parlweb:/tmp/cvs-serv31258

Modified Files:
	configure configure.in 
Log Message:
Change configure test for db stat function so that test for malloc 
function ptr and txnid are tested in order.


Index: configure
===================================================================
RCS file: /projects/cvsroot/pvfs2/configure,v
diff -p -u -r1.230 -r1.231
--- configure	9 Jun 2005 23:09:55 -0000	1.230
+++ configure	15 Jun 2005 20:52:21 -0000	1.231
@@ -5279,9 +5279,10 @@ fi
 rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
     fi
 
+
     CFLAGS="$CFLAGS -Wall"
-        echo "$as_me:$LINENO: checking for txnid parameter to DB stat function" >&5
-echo $ECHO_N "checking for txnid parameter to DB stat function... $ECHO_C" >&6
+    echo "$as_me:$LINENO: checking for four-parameter DB stat" >&5
+echo $ECHO_N "checking for four-parameter DB stat... $ECHO_C" >&6
     cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -5289,18 +5290,19 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-    #include <db.h>
+      #include <db.h>
+      #include <stdlib.h>
 
 int
 main ()
 {
 
-    int ret = 0;
-    DB *db = db;
-    DB_TXN *txnid = txnid;
-    u_int32_t flags = 0;
+      int ret = 0;
+      DB *db = db;
+      int dummy = 0;
+      u_int32_t flags = 0;
 
-    ret = db->stat(db, txnid, NULL, flags);
+      ret = db->stat(db, &dummy, malloc, flags);
 
   ;
   return 0;
@@ -5331,44 +5333,43 @@ if { (eval echo "$as_me:$LINENO: \"$ac_c
 echo "${ECHO_T}yes" >&6
 
 cat >>confdefs.h <<\_ACEOF
-#define HAVE_TXNID_PARAMETER_TO_DB_STAT 1
+#define HAVE_UNKNOWN_PARAMETER_TO_DB_STAT 1
 _ACEOF
 
-    have_txnid_param_to_stat=yes
+    have_db_stat_malloc=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 echo "$as_me:$LINENO: result: no" >&5
 echo "${ECHO_T}no" >&6
-    have_txnid_param_to_stat=no
+    have_db_stat_malloc=no
 fi
 rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 
-    CFLAGS=$oldcflags
-
-    if test "x$have_txnid_param_to_stat" = "xno" ; then
+        if test "x$have_txnid_param_to_stat" = "xno" ; then
 
-        echo "$as_me:$LINENO: checking for four-parameter DB stat" >&5
-echo $ECHO_N "checking for four-parameter DB stat... $ECHO_C" >&6
-        cat >conftest.$ac_ext <<_ACEOF
+       echo "$as_me:$LINENO: checking for txnid parameter to DB stat function" >&5
+echo $ECHO_N "checking for txnid parameter to DB stat function... $ECHO_C" >&6
+       cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-        #include <db.h>
+       #include <db.h>
 
 int
 main ()
 {
 
-        int ret;
-        DB *db;
-        u_int32_t flags;
+       int ret = 0;
+       DB *db = db;
+       DB_TXN *txnid = txnid;
+       u_int32_t flags = 0;
 
-        ret = db->stat(db, NULL, NULL, flags);
+        ret = db->stat(db, txnid, NULL, flags);
 
   ;
   return 0;
@@ -5399,18 +5400,23 @@ if { (eval echo "$as_me:$LINENO: \"$ac_c
 echo "${ECHO_T}yes" >&6
 
 cat >>confdefs.h <<\_ACEOF
-#define HAVE_UNKNOWN_PARAMETER_TO_DB_STAT 1
+#define HAVE_TXNID_PARAMETER_TO_DB_STAT 1
 _ACEOF
 
+        have_txnid_param_to_stat=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 echo "$as_me:$LINENO: result: no" >&5
 echo "${ECHO_T}no" >&6
+        have_txnid_param_to_stat=no
 fi
 rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
     fi
+
+    CFLAGS=$oldcflags
 
         echo "$as_me:$LINENO: checking for txnid parameter to DB open function" >&5
 echo $ECHO_N "checking for txnid parameter to DB open function... $ECHO_C" >&6

Index: configure.in
===================================================================
RCS file: /projects/cvsroot/pvfs2/configure.in,v
diff -p -u -r1.232 -r1.233
--- configure.in	9 Jun 2005 23:09:56 -0000	1.232
+++ configure.in	15 Jun 2005 20:52:22 -0000	1.233
@@ -676,49 +676,54 @@ if test "x$NEED_BERKELEY_DB" = "xyes" ; 
     fi
     
     CFLAGS="$CFLAGS -Wall"    
-    dnl Test to check for txnid parameter to DB stat (DB 4.3.xx+)
-    AC_MSG_CHECKING(for txnid parameter to DB stat function)
+    dnl Test to check for unknown third param to DB stat (four params 
+    dnl total).  The unknown parameter is a function ptr so that the
+    dnl the user can pass in a replcaement for malloc.
+    dnl Note: this is a holdover from relatively old DB implementations,
+    dnl while the txnid parameter is new.  So we don't test for the old
+    dnl unknown parameter if we found the new one.
+    AC_MSG_CHECKING(for DB stat with malloc function ptr)
     AC_TRY_COMPILE([
-    #include <db.h>
-    ], [
-    int ret = 0;
-    DB *db = db;
-    DB_TXN *txnid = txnid;
-    u_int32_t flags = 0;
-    
-    ret = db->stat(db, txnid, NULL, flags);
-    ], AC_MSG_RESULT(yes)
-    AC_DEFINE(HAVE_TXNID_PARAMETER_TO_DB_STAT, 1, 
-    Define if DB stat function takes txnid parameter)
-    have_txnid_param_to_stat=yes,
+      #include <db.h>
+      #include <stdlib.h>
+      ], [
+      int ret = 0;
+      DB *db = db;
+      int dummy = 0;
+      u_int32_t flags = 0;
+        
+      ret = db->stat(db, &dummy, malloc, flags);
+      ], AC_MSG_RESULT(yes)
+    AC_DEFINE(HAVE_UNKNOWN_PARAMETER_TO_DB_STAT, 1,
+    Define if DB stat function takes malloc function ptr)
+    have_db_stat_malloc=yes,
     AC_MSG_RESULT(no)
-    have_txnid_param_to_stat=no)
-    
-    CFLAGS=$oldcflags
+    have_db_stat_malloc=no)
 
-    if test "x$have_txnid_param_to_stat" = "xno" ; then
-        dnl Test to check for unknown third param to DB stat (four params 
-        dnl total).  The unknown parameter is a function ptr so that the
-        dnl the user can pass in a replcaement for malloc.
-        dnl Note: this is a holdover from relatively old DB implementations,
-        dnl while the txnid parameter is new.  So we don't test for the old
-        dnl unknown parameter if we found the new one.
+    dnl Test to check for txnid parameter to DB stat (DB 4.3.xx+)
+    if test "x$have_db_stat_malloc" = "xno" ; then
+
+       AC_MSG_CHECKING(for txnid parameter to DB stat function)
+       AC_TRY_COMPILE([
+       #include <db.h>
+       ], [
+       int ret = 0;
+       DB *db = db;
+       DB_TXN *txnid = txnid;
+       u_int32_t flags = 0;
     
-        AC_MSG_CHECKING(for four-parameter DB stat)
-        AC_TRY_COMPILE([
-        #include <db.h>
-        ], [
-        int ret;
-        DB *db;
-        u_int32_t flags;
-        
-        ret = db->stat(db, NULL, NULL, flags);
+        ret = db->stat(db, txnid, NULL, flags);
         ], AC_MSG_RESULT(yes)
-        AC_DEFINE(HAVE_UNKNOWN_PARAMETER_TO_DB_STAT, 1,
-        Define if DB stat function takes extra parameter),
-        AC_MSG_RESULT(no))
+        AC_DEFINE(HAVE_TXNID_PARAMETER_TO_DB_STAT, 1, 
+        Define if DB stat function takes txnid parameter)
+        have_txnid_param_to_stat=yes,
+        AC_MSG_RESULT(no)
+        have_txnid_param_to_stat=no)
+    
     fi
     
+    CFLAGS=$oldcflags
+
     dnl Test to check for txnid parameter to DB open (DB4.1+)
     AC_MSG_CHECKING(for txnid parameter to DB open function)
     AC_TRY_COMPILE([



More information about the PVFS2-CVS mailing list