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])
+])
+
])
#
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.])
)]
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
#
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
#
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.])