From 8948a997f927cfbccbb241d991cf0698b27076de Mon Sep 17 00:00:00 2001 From: scjody Date: Tue, 24 Jul 2007 21:05:44 +0000 Subject: [PATCH] Branch b1_6 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 | 2 +- build/autoconf/lustre-build-linux.m4 | 48 ++++++++++++++++++++++++++++-------- ldiskfs/configure.ac | 1 + ldiskfs/ldiskfs/autoMakefile.am | 2 +- 4 files changed, 41 insertions(+), 12 deletions(-) diff --git a/autoMakefile.am b/autoMakefile.am index a2ad3f6..3224e59 100644 --- a/autoMakefile.am +++ b/autoMakefile.am @@ -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@ diff --git a/build/autoconf/lustre-build-linux.m4 b/build/autoconf/lustre-build-linux.m4 index ae29434..0c040ec 100644 --- a/build/autoconf/lustre-build-linux.m4 +++ b/build/autoconf/lustre-build-linux.m4 @@ -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 diff --git a/ldiskfs/configure.ac b/ldiskfs/configure.ac index c63a847..d5c1f7c 100644 --- a/ldiskfs/configure.ac +++ b/ldiskfs/configure.ac @@ -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 diff --git a/ldiskfs/ldiskfs/autoMakefile.am b/ldiskfs/ldiskfs/autoMakefile.am index 1815a9d..129ecb6 100644 --- a/ldiskfs/ldiskfs/autoMakefile.am +++ b/ldiskfs/ldiskfs/autoMakefile.am @@ -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 -- 1.8.3.1