Whamcloud - gitweb
Branch b1_6
[fs/lustre-release.git] / build / autoconf / lustre-build-linux.m4
index 83b3a1e..ad29811 100644 (file)
@@ -98,6 +98,36 @@ AC_MSG_CHECKING([for Lustre release])
 RELEASE="`echo ${LINUXRELEASE} | tr '-' '_'`_`date +%Y%m%d%H%M`"
 AC_MSG_RESULT($RELEASE)
 AC_SUBST(RELEASE)
+
+# check is redhat/suse kernels
+AC_MSG_CHECKING([that RedHat kernel])
+LB_LINUX_TRY_COMPILE([
+               #include <linux/version.h>
+       ],[
+               #ifndef RHEL_MAJOR
+               #error "not redhat kernel"
+               #endif
+       ],[
+               RHEL_KENEL="yes"
+               AC_MSG_RESULT([yes])
+       ],[
+               AC_MSG_RESULT([no])
+])
+
+AC_MSG_CHECKING([that SuSe kernel])
+LB_LINUX_TRY_COMPILE([
+               #include <linux/version.h>
+       ],[
+               #ifndef SLE_VERSION_CODE
+               #error "not sles kernel"
+               #endif
+       ],[
+               SUSE_KERNEL="yes"
+               AC_MSG_RESULT([yes])
+       ],[
+               AC_MSG_RESULT([no])
+])
+
 ])
 
 #
@@ -200,6 +230,20 @@ LB_LINUX_TRY_COMPILE([],[],[
 LB_LINUX_RELEASE
 ]) # end of LB_LINUX_PATH
 
+# LB_LINUX_SYMVERFILE
+# SLES 9 uses a different name for this file - unsure about vanilla kernels
+# around this version, but it matters for servers only.
+AC_DEFUN([LB_LINUX_SYMVERFILE],
+       [AC_MSG_CHECKING([name of module symbol version file])
+       if grep -q Modules.symvers $LINUX/scripts/Makefile.modpost ; then
+               SYMVERFILE=Modules.symvers
+       else
+               SYMVERFILE=Module.symvers
+       fi
+       AC_MSG_RESULT($SYMVERFILE)
+       AC_SUBST(SYMVERFILE)
+])
+
 #
 #
 # LB_LINUX_MODPOST
@@ -415,6 +459,9 @@ fi
 #
 AC_DEFUN([LB_PROG_LINUX],
 [LB_LINUX_PATH
+LB_LINUX_ARCH
+LB_LINUX_SYMVERFILE
+
 
 LB_LINUX_CONFIG([MODULES],[],[
        AC_MSG_ERROR([module support is required to build Lustre kernel modules.])
@@ -464,7 +511,7 @@ AC_DEFUN([LB_LINUX_CONDITIONALS],
 # or check 
 AC_DEFUN([LB_CHECK_SYMBOL_EXPORT],
 [AC_MSG_CHECKING([if Linux was built with symbol $1 is exported])
-grep -q -E '[[[:space:]]]$1[[[:space:]]]' $LINUX/Module.symvers 2>/dev/null
+grep -q -E '[[[:space:]]]$1[[[:space:]]]' $LINUX/$SYMVERFILE 2>/dev/null
 rc=$?
 if test $rc -ne 0; then
     export=0