[PVFS2-CVS] commit by rbross in pvfs2: configure configure.in pvfs2-config.h.in

CVS commit program cvs at parl.clemson.edu
Fri Jan 14 15:09:02 EST 2005


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

Modified Files:
	configure configure.in pvfs2-config.h.in 
Log Message:
Additional test to see if third parameter to DB error callback is const.
We expect that it is, but it isn't strictly related to the previous test.


Index: configure
===================================================================
RCS file: /projects/cvsroot/pvfs2/configure,v
diff -p -u -r1.212 -r1.213
--- configure	14 Jan 2005 18:53:19 -0000	1.212
+++ configure	14 Jan 2005 20:09:00 -0000	1.213
@@ -4660,14 +4660,86 @@ cat >>confdefs.h <<\_ACEOF
 #define HAVE_DBENV_PARAMETER_TO_DB_ERROR_CALLBACK 1
 _ACEOF
 
+have_dbenv_parameter_to_db_error_callback=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_dbenv_parameter_to_db_error_callback=no
 fi
 rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+if test "x$have_dbenv_parameter_to_db_error_callback" = "xyes" ; then
+                echo "$as_me:$LINENO: checking if third parameter to error callback function is const" >&5
+echo $ECHO_N "checking if third parameter to error callback function is const... $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>
+
+    void error_callback_fn(const DB_ENV *dbenv,
+                           const char *prefix,
+                           char *message)
+    {
+        return;
+    }
+
+int
+main ()
+{
+
+    DB *db;
+
+    db->set_errcall(db, error_callback_fn);
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_CONST_THIRD_PARAMETER_TO_DB_ERROR_CALLBACK 1
+_ACEOF
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
 CFLAGS=$oldcflags
 
 echo "$as_me:$LINENO: checking for txnid parameter to DB stat function" >&5

Index: configure.in
===================================================================
RCS file: /projects/cvsroot/pvfs2/configure.in,v
diff -p -u -r1.211 -r1.212
--- configure.in	14 Jan 2005 18:53:20 -0000	1.211
+++ configure.in	14 Jan 2005 20:09:01 -0000	1.212
@@ -456,7 +456,9 @@ dnl try: http://www.sleepycat.com/downlo
 dnl or: /parl/pcarns/rpms/db4-4.0.14-1mdk.src.rpm (to build rpm))
 dnl       )
 
-dnl Test to check for DB_ENV variable to error callback fn
+dnl Test to check for DB_ENV variable to error callback fn.  Then
+dnl test to see if third parameter must be const (related but not 
+dnl exactly the same).
 AC_MSG_CHECKING(for dbenv parameter to DB error callback function)
 oldcflags=$CFLAGS
 CFLAGS="$CFLAGS -Werror"
@@ -475,8 +477,35 @@ DB *db;
 db->set_errcall(db, error_callback_fn);
 ], AC_MSG_RESULT(yes)
 AC_DEFINE(HAVE_DBENV_PARAMETER_TO_DB_ERROR_CALLBACK, 1,
-Define if DB error callback function takes dbenv parameter),
-AC_MSG_RESULT(no))
+Define if DB error callback function takes dbenv parameter)
+have_dbenv_parameter_to_db_error_callback=yes,
+AC_MSG_RESULT(no)
+have_dbenv_parameter_to_db_error_callback=no)
+
+if test "x$have_dbenv_parameter_to_db_error_callback" = "xyes" ; then
+    dnl Test if compilation succeeds without const; we expect that it will
+    dnl not.
+    dnl NOTE: still using -Werror!
+    AC_MSG_CHECKING(if third parameter to error callback function is const)
+    AC_TRY_COMPILE([
+    #include <db.h>
+    
+    void error_callback_fn(const DB_ENV *dbenv,
+                           const char *prefix,
+                           char *message)
+    {
+        return;
+    }
+    ], [
+    DB *db;
+    
+    db->set_errcall(db, error_callback_fn);
+    ], AC_MSG_RESULT(no),
+    AC_MSG_RESULT(yes)
+    AC_DEFINE(HAVE_CONST_THIRD_PARAMETER_TO_DB_ERROR_CALLBACK, 1,
+    Define if third param (message) to DB error callback function is const))
+fi
+
 CFLAGS=$oldcflags
 
 dnl Test to check for txnid parameter to DB stat (DB 4.3.xx+)

Index: pvfs2-config.h.in
===================================================================
RCS file: /projects/cvsroot/pvfs2/pvfs2-config.h.in,v
diff -p -u -r1.38 -r1.39
--- pvfs2-config.h.in	14 Jan 2005 18:53:20 -0000	1.38
+++ pvfs2-config.h.in	14 Jan 2005 20:09:01 -0000	1.39
@@ -10,6 +10,9 @@
 /* Define if berkeley db error reporting was enabled */
 #undef BERKDB_ERROR_REPORTING
 
+/* Define if third param (message) to DB error callback function is const */
+#undef HAVE_CONST_THIRD_PARAMETER_TO_DB_ERROR_CALLBACK
+
 /* Define if DB error callback function takes dbenv parameter */
 #undef HAVE_DBENV_PARAMETER_TO_DB_ERROR_CALLBACK
 



More information about the PVFS2-CVS mailing list