[Pvfs2-cvs] commit by pcarns in pvfs2-1/maint/config: gm.m4 mx.m4 kernel.m4 openssl.m4 portals.m4 rt.m4

CVS commit program cvs at parl.clemson.edu
Mon Apr 7 11:07:10 EDT 2008


Update of /projects/cvsroot/pvfs2-1/maint/config
In directory parlweb1:/tmp/cvs-serv26608/maint/config

Modified Files:
      Tag: small-file-branch
	kernel.m4 openssl.m4 portals.m4 rt.m4 
Added Files:
      Tag: small-file-branch
	gm.m4 mx.m4 
Log Message:
syncing small-file-branch back up with trunk at small-file-branch-point2 tag
(reverse merge)


--- /dev/null	2004-06-24 14:04:38.000000000 -0400
+++ gm.m4	2008-04-07 11:07:10.000000000 -0400
@@ -0,0 +1,72 @@
+#
+# Configure rules for GM
+#
+# Copyright (C) 2008 Pete Wyckoff <pw at osc.edu>
+#
+# See COPYING in top-level directory.
+#
+AC_DEFUN([AX_GM],
+[
+    dnl Configure options for GM install path.
+    dnl --with-gm=<dir> is shorthand for
+    dnl    --with-gm-includes=<dir>/include
+    dnl    --with-gm-libs=<dir>/lib  (or lib64 if that exists)
+    gm_home=
+    AC_ARG_WITH(gm,
+    [  --with-gm=<dir>     Location of the GM install (default no GM)],
+	if test -z "$withval" -o "$withval" = yes ; then
+	    AC_MSG_ERROR([Option --with-gm requires the path to your GM tree.])
+	elif test "$withval" != no ; then
+	    gm_home="$withval"
+	fi
+    )
+    AC_ARG_WITH(gm-includes,
+    [  --with-gm-includes=<dir>  Location of the GM includes],
+	if test -z "$withval" -o "$withval" = yes ; then
+	    AC_MSG_ERROR([Option --with-gm-includes requires path to GM headers.])
+	elif test "$withval" != no ; then
+	    GM_INCDIR="$withval"
+	fi
+    )
+    AC_ARG_WITH(gm-libs,
+    [  --with-gm-libs=<dir>      Location of the GM libraries],
+	if test -z "$withval" -o "$withval" = yes ; then
+	    AC_MSG_ERROR([Option --with-gm-libs requires path to GM libraries.])
+	elif test "$withval" != no ; then
+	    GM_LIBDIR="$withval"
+	fi
+    )
+    dnl If supplied the incls and libs explicitly, use them, else populate them
+    dnl using guesses from the --with-gm dir.
+    if test -n "$gm_home" ; then
+	if test -z "$GM_INCDIR"; then
+	    GM_INCDIR=$gm_home/include
+	fi
+	if test -z "$GM_LIBDIR"; then
+	    GM_LIBDIR=$gm_home/lib64
+	    if test ! -d "$GM_LIBDIR" ; then
+		GM_LIBDIR=$gm_home/lib
+	    fi
+	fi
+    fi
+    dnl If anything GM-ish was set, go look for header.
+    if test -n "$GM_INCDIR$GM_LIBDIR" ; then
+	save_cppflags="$CPPFLAGS"
+	CPPFLAGS="$CPPFLAGS -I$GM_INCDIR -I$GM_INCDIR/gm"
+	AC_CHECK_HEADER(gm.h,, AC_MSG_ERROR([Header gm.h not found.]))
+	dnl Run test is not possible on a machine that does not have a GM NIC.
+	dnl Link test would work, but just check for existence.
+	if test ! -f $GM_LIBDIR/libgm.so ; then
+	    if test ! -f $GM_LIBDIR/libgm.a ; then
+		AC_MSG_ERROR([Neither GM library libgm.so or libgm.a found.])
+	    fi
+	fi
+	BUILD_GM=1
+	CPPFLAGS="$save_cppflags"
+    fi
+    AC_SUBST(BUILD_GM)
+    AC_SUBST(GM_INCDIR)
+    AC_SUBST(GM_LIBDIR)
+])
+
+dnl vim: set ft=config :

--- /dev/null	2004-06-24 14:04:38.000000000 -0400
+++ mx.m4	2008-04-07 11:07:10.000000000 -0400
@@ -0,0 +1,73 @@
+#
+# Configure rules for MX
+#
+# Copyright (C) 2008 Pete Wyckoff <pw at osc.edu>
+#
+# See COPYING in top-level directory.
+#
+AC_DEFUN([AX_MX],
+[
+    dnl Configure options for MX install path.
+    dnl --with-mx=<dir> is shorthand for
+    dnl    --with-mx-includes=<dir>/include
+    dnl    --with-mx-libs=<dir>/lib  (or lib64 if that exists)
+    mx_home=
+    AC_ARG_WITH(mx,
+    [  --with-mx=<dir>     Location of the MX install (default no MX)],
+	if test -z "$withval" -o "$withval" = yes ; then
+	    AC_MSG_ERROR([Option --with-mx requires the path to your MX tree.])
+	elif test "$withval" != no ; then
+	    mx_home="$withval"
+	fi
+    )
+    AC_ARG_WITH(mx-includes,
+    [  --with-mx-includes=<dir>  Location of the MX includes],
+	if test -z "$withval" -o "$withval" = yes ; then
+	    AC_MSG_ERROR([Option --with-mx-includes requires path to MX headers.])
+	elif test "$withval" != no ; then
+	    MX_INCDIR="$withval"
+	fi
+    )
+    AC_ARG_WITH(mx-libs,
+    [  --with-mx-libs=<dir>      Location of the MX libraries],
+	if test -z "$withval" -o "$withval" = yes ; then
+	    AC_MSG_ERROR([Option --with-mx-libs requires path to MX libraries.])
+	elif test "$withval" != no ; then
+	    MX_LIBDIR="$withval"
+	fi
+    )
+    dnl If supplied the incls and libs explicitly, use them, else populate them
+    dnl using guesses from the --with-mx dir.
+    if test -n "$mx_home" ; then
+	if test -z "$MX_INCDIR"; then
+	    MX_INCDIR=$mx_home/include
+	fi
+	if test -z "$MX_LIBDIR"; then
+	    MX_LIBDIR=$mx_home/lib64
+	    if test ! -d "$MX_LIBDIR" ; then
+		MX_LIBDIR=$mx_home/lib
+	    fi
+	fi
+    fi
+    dnl If anything MX-ish was set, go look for header.
+    if test -n "$MX_INCDIR$MX_LIBDIR" ; then
+	save_cppflags="$CPPFLAGS"
+	CPPFLAGS="$CPPFLAGS -I$MX_INCDIR -I$MX_INCDIR/mx"
+	AC_CHECK_HEADER(myriexpress.h,,
+			AC_MSG_ERROR([Header myriexpress.h not found.]))
+	dnl Run test is not possible on a machine that does not have a MX NIC.
+	dnl Link test would work, but just check for existence.
+	if test ! -f $MX_LIBDIR/libmyriexpress.so ; then
+	    if test ! -f $MX_LIBDIR/libmyriexpress.a ; then
+		AC_MSG_ERROR([Neither MX library libmyriexpress.so or libmyriexpress.a found.])
+	    fi
+	fi
+	BUILD_MX=1
+	CPPFLAGS="$save_cppflags"
+    fi
+    AC_SUBST(BUILD_MX)
+    AC_SUBST(MX_INCDIR)
+    AC_SUBST(MX_LIBDIR)
+])
+
+dnl vim: set ft=config :

Index: kernel.m4
===================================================================
RCS file: /projects/cvsroot/pvfs2-1/maint/config/kernel.m4,v
diff -p -u -r1.51.2.1 -r1.51.2.2
--- kernel.m4	16 Feb 2008 22:09:31 -0000	1.51.2.1
+++ kernel.m4	7 Apr 2008 15:07:09 -0000	1.51.2.2
@@ -415,54 +415,60 @@ AC_DEFUN([AX_KERNEL_FEATURES],
 
 	fi
 
-	dnl certain Fedora FC5 kernel header files throw extra (spurious)
-	dnl warnings, which -Wno-pointer-sign silences, but that option is 
-	dnl only supported by gcc-4.
-	if test "x$GCC" = "xyes" ; then
-		AC_MSG_CHECKING(for gcc major version)
-		gcc_version=`$CC --version| head -1 | tr . ' ' | cut -d ' ' -f 3`
-		AC_MSG_RESULT($gcc_version)
-		if test $gcc_version -gt 3 ; then
-			extra_gcc_flags="-Wno-pointer-sign  -Wno-strict-aliasing -Wno-strict-aliasing=2"
-		fi
-	fi
-		
-	tmp_cflags=$CFLAGS
-	CFLAGS="$CFLAGS -Werror $extra_gcc_flags"
-	dnl if this test passes, there is a struct dentry* argument
-	AC_MSG_CHECKING(if statfs callbacks' arguments in kernel has struct dentry argument)
-	dnl if this test passes, the kernel has it
-	dnl if this test fails, the kernel does not have it
+	AC_MSG_CHECKING(for dentry argument in kernel super_operations statfs)
+	dnl Rely on the fact that there is an external vfs_statfs that is
+	dnl of the same type as the .statfs in struct super_operations to
+	dnl verify the signature of that function pointer.  There is a single
+	dnl commit in the git history where both changed at the same time
+	dnl from super_block to dentry.
+	dnl
+	dnl The alternative approach of trying to define a s_op.statfs is not
+	dnl as nice because that only throws a warning, requiring -Werror to
+	dnl catch it.  This is a problem if the compiler happens to spit out
+	dnl other spurious warnings that have nothing to do with the test.
+	dnl
+	dnl If this test passes, the kernel uses a struct dentry argument.
+	dnl If this test fails, the kernel uses something else (old struct
+	dnl super_block perhaps).
 	AC_TRY_COMPILE([
 		#define __KERNEL__
 		#include <linux/fs.h>
-		extern int pvfs_statfs(struct dentry *, struct kstatfs *);
-			  static struct super_operations s_op = {
-				  .statfs = pvfs_statfs,
-			  };
-		], [ s_op.statfs = 0; ],
+		int vfs_statfs(struct dentry *de, struct kstatfs *kfs)
+		{
+			return 0;
+		}
+		], [],
 		AC_MSG_RESULT(yes)
-		AC_DEFINE(HAVE_DENTRY_STATFS_SOP, 1, Define if statfs callback has struct dentry argument),
+		AC_DEFINE(HAVE_DENTRY_STATFS_SOP, 1, Define if super_operations statfs has dentry argument),
 		AC_MSG_RESULT(no)
 	)
 
-	AC_MSG_CHECKING(if get_sb callback in kernel has struct vfsmount argument)
-	dnl if this test passes, the kernel has it
-	dnl if this test fails, the kernel does not have it
+	AC_MSG_CHECKING(for vfsmount argument in kernel file_system_type get_sb)
+	dnl Same trick as above.  A single commit changed mayn things at once:
+	dnl type and signature of file_system_type.get_sb, and signature of
+	dnl get_sb_bdev.  This test is a bit more tenuous, as get_sb_bdev
+	dnl isn't used directly in a file_system_type, but is a popular helper
+	dnl for many FSes.  And it has not exactly the same signature.
+	dnl
+	dnl If this test passes, the kernel has the most modern known form,
+	dnl which includes a stfuct vfsmount argument.
+	dnl If this test fails, the kernel uses something else.
 	AC_TRY_COMPILE([
 		#define __KERNEL__
 		#include <linux/fs.h>
-		#include <linux/mount.h>
-		extern int pvfs_get_sb(struct file_system_type *fst, int flags, const char *devname, void *data, struct vfsmount *);
-			  static struct file_system_type fst = {
-				  .get_sb = pvfs_get_sb,
-			  };
-		], [fst.get_sb = 0;],
+		int get_sb_bdev(struct file_system_type *fs_type, int flags,
+				const char *dev_name, void *data,
+				int (*fill_super)(struct super_block *, void *,
+						  int),
+				struct vfsmount *vfsm)
+		{
+			return 0;
+		}
+		], [],
 		AC_MSG_RESULT(yes)
-		AC_DEFINE(HAVE_VFSMOUNT_GETSB, 1, Define if get_sb callback has struct vfsmount argument),
+		AC_DEFINE(HAVE_VFSMOUNT_GETSB, 1, Define if file_system_type get_sb has vfsmount argument),
 		AC_MSG_RESULT(no)
 	)
-	CFLAGS=$tmp_cflags
 
 	AC_MSG_CHECKING(for xattr support in kernel)
 	dnl if this test passes, the kernel has it
@@ -845,15 +851,18 @@ AC_DEFUN([AX_KERNEL_FEATURES],
 	)
 
 	dnl old linux kernels do not have class_create and related functions
+        dnl
+        dnl check for class_device_destroy() to weed out RHEL4 kernels that
+        dnl have some class functions but not others
 	AC_MSG_CHECKING(if kernel has device classes)
 	AC_TRY_COMPILE([
 	    #define __KERNEL__
 	    #include <linux/device.h>
 	], [
-	    class_create(NULL, "pvfs2")
+	    class_device_destroy(NULL, "pvfs2")
 	],
 	AC_MSG_RESULT(yes)
-	AC_DEFINE(HAVE_KERNEL_DEVICE_CLASSES, 1, Define if kernel lacks device classes),
+	AC_DEFINE(HAVE_KERNEL_DEVICE_CLASSES, 1, Define if kernel has device classes),
 	AC_MSG_RESULT(no)
 	)
 
@@ -945,6 +954,20 @@ AC_DEFUN([AX_KERNEL_FEATURES],
 	],
 	AC_MSG_RESULT(yes)
 	AC_DEFINE(HAVE_MAPPING_NRPAGES_MACRO, 1, [Define if kernel defines mapping_nrpages macro -- defined by RT linux]),
+	AC_MSG_RESULT(no)
+	)
+
+	dnl Starting with 2.6.25-rc1, .read_inode goes away.
+	AC_MSG_CHECKING(if kernel super_operations contains read_inode field)
+	AC_TRY_COMPILE([
+		#define __KERNEL__
+		#include <linux/fs.h>
+	], [
+		struct super_operations sops;
+		sops.read_inode(NULL);
+	],
+	AC_MSG_RESULT(yes)
+	AC_DEFINE(HAVE_READ_INODE, 1, [Define if kernel super_operations contains read_inode field]),
 	AC_MSG_RESULT(no)
 	)
 

Index: openssl.m4
===================================================================
RCS file: /projects/cvsroot/pvfs2-1/maint/config/openssl.m4,v
diff -p -u -r1.7 -r1.7.20.1
--- openssl.m4	19 Sep 2006 21:44:49 -0000	1.7
+++ openssl.m4	7 Apr 2008 15:07:09 -0000	1.7.20.1
@@ -12,7 +12,7 @@ AC_DEFUN([AX_OPENSSL],
             LDFLAGS="$LDFLAGS -L${opensslpath}/lib64 -L${opensslpath}/lib"
             SERVER_LDFLAGS="$SERVER_LDFLAGS -L${opensslpath}/lib64 -L${opensslpath}/lib"
         fi
-        LIBS="$LIBS -lcrypt -lssl"
+        LIBS="$LIBS -lcrypto -lssl"
     
         AC_COMPILE_IFELSE(
     	    [#include "openssl/bio.h"],
@@ -36,7 +36,7 @@ AC_DEFUN([AX_OPENSSL_OPTIONAL],
 [
     AC_MSG_CHECKING([for openssl library])
     TMPLIBS=${LIBS}
-    LIBS="$LIBS -lcrypt -lssl"
+    LIBS="$LIBS -lcrypto -lssl"
 
     AC_COMPILE_IFELSE(
       [#include "openssl/bio.h"],

Index: portals.m4
===================================================================
RCS file: /projects/cvsroot/pvfs2-1/maint/config/portals.m4,v
diff -p -u -r1.5 -r1.5.6.1
--- portals.m4	18 Oct 2007 15:55:33 -0000	1.5
+++ portals.m4	7 Apr 2008 15:07:09 -0000	1.5.6.1
@@ -74,7 +74,7 @@ AC_DEFUN([AX_PORTALS],
 	CPPFLAGS="$CPPFLAGS $PORTALS_INCS"
 
 	PORTALS_LIBS="$libs"
-	LIBS="$LIBS $PORTALS_LIBS"
+	LIBS="$save_libs $PORTALS_LIBS"
 
 	AC_MSG_CHECKING([for portals3.h header])
 	ok=no
@@ -102,7 +102,7 @@ AC_DEFUN([AX_PORTALS],
 
 	if test "$ok" = no ; then
 	    PORTALS_LIBS="$libs -lportals"
-	    LIBS="$LIBS $PORTALS_LIBS"
+	    LIBS="$save_libs $PORTALS_LIBS"
 	    AC_TRY_LINK(
 		[#include <portals/portals3.h>],
 		[int m, n; m = PtlInit(&n);],
@@ -111,7 +111,7 @@ AC_DEFUN([AX_PORTALS],
 
 	if test "$ok" = no ; then
 	    PORTALS_LIBS="$libs -lp3api -lp3lib -lp3utcp -lp3rt -lpthread"
-	    LIBS="$LIBS $PORTALS_LIBS"
+	    LIBS="$save_libs $PORTALS_LIBS"
 	    AC_TRY_LINK(
 		[#include <portals/portals3.h>],
 		[int m, n; m = PtlInit(&n);],

Index: rt.m4
===================================================================
RCS file: /projects/cvsroot/pvfs2-1/maint/config/rt.m4,v
diff -p -u -r1.1 -r1.1.54.1
--- rt.m4	10 Nov 2005 01:26:56 -0000	1.1
+++ rt.m4	7 Apr 2008 15:07:09 -0000	1.1.54.1
@@ -3,8 +3,6 @@ AC_DEFUN([AX_CHECK_NEEDS_LIBRT],
 [
 
 AC_MSG_CHECKING([if server lib needs -lrt])
-oldldflags=$LDFLAGS
-
 AC_TRY_LINK(
 	[#include <stdlib.h>
 	 #include <unistd.h>
@@ -12,7 +10,8 @@ AC_TRY_LINK(
 	[lio_listio(LIO_NOWAIT, NULL, 0, NULL);],
 	[AC_MSG_RESULT(no)],
 	[
-		LDFLAGS="$LDFLAGS -lrt"
+		oldlibs=$LIBS
+		LIBS="$LIBS -lrt"
 		AC_TRY_LINK(
 			[#include <stdlib.h>
 			 #include <unistd.h>
@@ -22,7 +21,6 @@ AC_TRY_LINK(
 			 AC_SUBST(NEEDS_LIBRT)
 			 AC_MSG_RESULT(yes)],
 			[AC_MSG_ERROR(failed attempting to link lio_listio)])
+		LIBS=$oldlibs
 	])
-
-LDFLAGS=$oldldflags
 ])



More information about the Pvfs2-cvs mailing list