[Pvfs2-cvs] commit by pw in pvfs2: configure

CVS commit program cvs at parl.clemson.edu
Fri Jan 11 15:07:22 EST 2008


Update of /projects/cvsroot/pvfs2
In directory parlweb1:/tmp/cvs-serv21374

Modified Files:
	configure 
Log Message:
Fix struct kmem_cache test, as much as it can be, as it was indeed previously
broken for old kernels that did not have this type---the test always succeeded.
Define the result in preparation for fixing kmem_cache ctor changes in 2.6.24.


Index: configure
===================================================================
RCS file: /projects/cvsroot/pvfs2/configure,v
diff -u -p -p -u -r1.372 -r1.373
--- configure	11 Jan 2008 15:02:15 -0000	1.372
+++ configure	11 Jan 2008 20:07:20 -0000	1.373
@@ -8349,7 +8349,9 @@ fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
-		{ echo "$as_me:$LINENO: checking for struct kmem_cache in kernel" >&5
+									        tmp_cflags=$CFLAGS
+        CFLAGS="$CFLAGS -Werror"
+	{ echo "$as_me:$LINENO: checking for struct kmem_cache in kernel" >&5
 echo $ECHO_N "checking for struct kmem_cache in kernel... $ECHO_C" >&6; }
 	cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -8360,7 +8362,11 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 		#define __KERNEL__
 		#include <linux/slab.h>
-		static struct kmem_cache;
+
+		int foo(struct kmem_cache *s)
+		{
+		    return (s == NULL) ? 3 : 4;
+		}
 
 int
 main ()
@@ -8389,21 +8395,24 @@ eval "echo \"\$as_me:$LINENO: $ac_try_ec
        } && test -s conftest.$ac_objext; then
   { echo "$as_me:$LINENO: result: yes" >&5
 echo "${ECHO_T}yes" >&6; }
+		have_kmem_cache=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
 
 cat >>confdefs.h <<\_ACEOF
 #define HAVE_STRUCT_KMEM_CACHE 1
 _ACEOF
 
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	{ echo "$as_me:$LINENO: result: no" >&5
+		have_kmem_cache=no
+		{ echo "$as_me:$LINENO: result: no" >&5
 echo "${ECHO_T}no" >&6; }
 
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+        CFLAGS=$tmp_cflags
 
 		{ echo "$as_me:$LINENO: checking for SLAB_KERNEL flag in kernel" >&5
 echo $ECHO_N "checking for SLAB_KERNEL flag in kernel... $ECHO_C" >&6; }



More information about the Pvfs2-cvs mailing list