Whamcloud - gitweb
b=15870
[fs/lustre-release.git] / build / autoconf / lustre-build-linux.m4
index 9759b49..e47efd8 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])
+])
+
 ])
 
 #
@@ -209,9 +239,9 @@ LB_LINUX_RELEASE
 AC_DEFUN([LB_LINUX_MODPOST],
 [
 # Find the modpost utility
-AC_CHECK_FILE([$LINUX_OBJ/scripts/mod/modpost],
+LB_CHECK_FILE([$LINUX_OBJ/scripts/mod/modpost],
        [MODPOST=$LINUX_OBJ/scripts/mod/modpost],
-       [AC_CHECK_FILE([$LINUX_OBJ/scripts/modpost],
+       [LB_CHECK_FILE([$LINUX_OBJ/scripts/modpost],
                [MODPOST=$LINUX_OBJ/scripts/modpost],
                AC_MSG_ERROR([modpost not found.])
        )]
@@ -343,9 +373,7 @@ AC_DEFUN([LB_LINUX_TRY_COMPILE],
 AC_DEFUN([LB_LINUX_CONFIG],
 [AC_MSG_CHECKING([if Linux was built with CONFIG_$1])
 LB_LINUX_TRY_COMPILE([
-#ifndef AUTOCONF_INCLUDED
-#include <linux/config.h>
-#endif
+#include <linux/autoconf.h>
 ],[
 #ifndef CONFIG_$1
 #error CONFIG_$1 not #defined
@@ -366,7 +394,9 @@ $3
 #
 AC_DEFUN([LB_LINUX_CONFIG_IM],
 [AC_MSG_CHECKING([if Linux was built with CONFIG_$1 in or as module])
-LB_LINUX_TRY_COMPILE([#include <linux/config.h>],[
+LB_LINUX_TRY_COMPILE([
+#include <linux/autoconf.h>
+],[
 #if !(defined(CONFIG_$1) || defined(CONFIG_$1_MODULE))
 #error CONFIG_$1 and CONFIG_$1_MODULE not #defined
 #endif
@@ -415,6 +445,11 @@ fi
 #
 AC_DEFUN([LB_PROG_LINUX],
 [LB_LINUX_PATH
+LB_LINUX_ARCH
+
+if test $LINUX_ARCH == "powerpc64"; then
+       CFLAGS="$CFLAGS -m64"
+fi
 
 LB_LINUX_CONFIG([MODULES],[],[
        AC_MSG_ERROR([module support is required to build Lustre kernel modules.])