Whamcloud - gitweb
Branch b1_6
authorscjody <scjody>
Tue, 24 Jul 2007 21:05:44 +0000 (21:05 +0000)
committerscjody <scjody>
Tue, 24 Jul 2007 21:05:44 +0000 (21:05 +0000)
Run modpost without the -m flag when it isn't supported - fixes SLES 9
build issue.  Also move the modpost tests to their own configure rule
and use it only when building ldiskfs.

b=12842
i=mjmac
i=brian

autoMakefile.am
build/autoconf/lustre-build-linux.m4
ldiskfs/configure.ac
ldiskfs/ldiskfs/autoMakefile.am

index a2ad3f6..3224e59 100644 (file)
@@ -1,4 +1,4 @@
-SUBDIRS := . @LIBSYSIO_SUBDIR@ @SNMP_SUBDIR@ @LDISKFS_SUBDIR@ lnet lustre
+SUBDIRS := @LDISKFS_SUBDIR@ . @LIBSYSIO_SUBDIR@ @SNMP_SUBDIR@ lnet lustre
 DIST_SUBDIRS := @SNMP_DIST_SUBDIR@ libsysio ldiskfs lnet lustre
 SOURCES_SUBDIRS := @LDISKFS_SUBDIR@ lnet lustre
 RPM_SUBDIRS := @LDISKFS_SUBDIR@
index ae29434..0c040ec 100644 (file)
@@ -188,16 +188,6 @@ if grep rhconfig $LINUX_OBJ/include/linux/version.h >/dev/null ; then
        EXTRA_KCFLAGS="-include $KERNEL_SOURCE_HEADER $EXTRA_KCFLAGS"
 fi
 
-# Find the modpost utility
-AC_CHECK_FILE([$LINUX_OBJ/scripts/mod/modpost],
-       [MODPOST=$LINUX_OBJ/scripts/mod/modpost],
-       [AC_CHECK_FILE([$LINUX_OBJ/scripts/modpost],
-               [MODPOST=$LINUX_OBJ/scripts/modpost],
-               AC_MSG_ERROR([modpost not found.])
-       )]
-)
-AC_SUBST(MODPOST)
-
 # this is needed before we can build modules
 LB_LINUX_UML
 LB_LINUX_VERSION
@@ -217,6 +207,44 @@ LB_LINUX_RELEASE
 ]) # end of LB_LINUX_PATH
 
 #
+#
+# LB_LINUX_MODPOST
+#
+# Find modpost and check it
+#
+AC_DEFUN([LB_LINUX_MODPOST],
+[
+# Find the modpost utility
+AC_CHECK_FILE([$LINUX_OBJ/scripts/mod/modpost],
+       [MODPOST=$LINUX_OBJ/scripts/mod/modpost],
+       [AC_CHECK_FILE([$LINUX_OBJ/scripts/modpost],
+               [MODPOST=$LINUX_OBJ/scripts/modpost],
+               AC_MSG_ERROR([modpost not found.])
+       )]
+)
+AC_SUBST(MODPOST)
+
+# Ensure it can run
+AC_MSG_CHECKING([if modpost can be run])
+if $MODPOST ; then
+       AC_MSG_RESULT([yes])
+else
+       AC_MSG_ERROR([modpost can not be run.])
+fi
+
+# Check if modpost supports (and therefore requires) -m
+AC_MSG_CHECKING([if modpost supports -m])
+if $MODPOST -m 2>/dev/null ; then
+       AC_MSG_RESULT([yes])
+       MODPOST_ARGS=-m
+else
+       AC_MSG_RESULT([no])
+       MODPOST_ARGS=""
+fi
+AC_SUBST(MODPOST_ARGS)
+])
+
+#
 # LB_LINUX_UML
 #
 # check for a uml kernel
index c63a847..d5c1f7c 100644 (file)
@@ -27,6 +27,7 @@ AC_MSG_RESULT([$enable_modules])
 
 if test x$enable_modules = xyes ; then
        LB_PROG_LINUX
+       LB_LINUX_MODPOST
 fi
 
 LB_CONFIG_HEADERS
index 1815a9d..129ecb6 100644 (file)
@@ -76,5 +76,5 @@ all: @LINUX_OBJ@/Module.symvers
 # Update the kernel's Module.symvers to add ldiskfs symbols before building
 # fsfilt_ldiskfs - see bug 12842.
 @LINUX_OBJ@/Module.symvers: ldiskfs.o
-       cd .. ; $(MODPOST) -m -i @LINUX_OBJ@/Module.symvers \
+       cd .. ; $(MODPOST) $(MODPOST_ARGS) -i @LINUX_OBJ@/Module.symvers \
                -o @LINUX_OBJ@/Module.symvers ldiskfs/ldiskfs.o