Whamcloud - gitweb
Land b1_2_smallfix onto b1_2 (20040616_1009)
[fs/lustre-release.git] / lustre / portals / archdep.m4
index 636ee1d..c78fc34 100644 (file)
@@ -19,20 +19,11 @@ AC_ARG_WITH([cray-portals],
        AC_HELP_STRING([--with-cray-portals=path],
                       [path to cray portals]),
        [
-               if test "$with_cray_portals" != no; then
-                       if test -r $with_cray_portals/include/portals/api.h ; then
-                               CRAY_PORTALS_INCLUDE="-I$with_cray_portals/include"
-                               AC_DEFINE(CRAY_PORTALS, 1, [Building with Cray Portals])
-                       else
-                               AC_MSG_ERROR([--with-cray-portals specified badly])
-                        fi
-                fi
+               CRAY_PORTALS_INCLUDE="-I$with_cray_portals"
+               AC_DEFINE(CRAY_PORTALS, 1, [Building with Cray Portals])
        ],[with_cray_portals=no])
 AC_MSG_RESULT([$with_cray_portals])
-
 AM_CONDITIONAL(CRAY_PORTALS, test x$with_cray_portals != xno)
-
-# -------- enable tests and utils? -------
 if test x$enable_tests = xno ; then
        AC_MSG_NOTICE([disabling tests])
        enable_tests=no
@@ -101,6 +92,7 @@ AC_CHECK_FILE([$LINUX/include/linux/namei.h],
        [
                linux25="yes"
                KMODEXT=".ko"
+               enable_ldiskfs="yes"
        ],[
                KMODEXT=".o"
                linux25="no"
@@ -110,6 +102,16 @@ AC_MSG_RESULT([$linux25])
 AM_CONDITIONAL(LINUX25, test x$linux25 = xyes)
 AC_SUBST(KMODEXT)
 
+AC_PATH_PROG(PATCH, patch, [no])
+AC_PATH_PROG(QUILT, quilt, [no])
+AM_CONDITIONAL(USE_QUILT, test x$QUILT = xno)
+
+if test x$enable_ldiskfs$enable_modules = xyesyes ; then
+       if test x$PATCH$QUILT = xnono ; then
+               AC_MSG_ERROR([Quilt or patch are needed to build the ldiskfs module (for Linux 2.6)])
+       fi
+fi
+
 # -------  Makeflags ------------------
 
 CPPFLAGS="$CRAY_PORTALS_INCLUDE $CRAY_PORTALS_COMMANDLINE -I\$(top_srcdir)/include -I\$(top_srcdir)/portals/include"
@@ -144,7 +146,7 @@ _ACEOF
 AC_DEFUN([LUSTRE_MODULE_COMPILE_IFELSE],
 [m4_ifvaln([$1], [LUSTRE_MODULE_CONFTEST([$1])])dnl
 rm -f kernel-tests/conftest.o kernel-tests/conftest.mod.c kernel-tests/conftest.ko
-AS_IF([AC_TRY_COMMAND(cp conftest.c kernel-tests && make [$2] -f $PWD/kernel-tests/Makefile LUSTRE_LINUX_CONFIG=$LINUX_CONFIG -o tmp_include_depends -o scripts -o include/config/MARKER -C $LINUX EXTRA_CFLAGS="$EXTRA_KCFLAGS" $ARCH_UM SUBDIRS=$PWD/kernel-tests) >/dev/null && AC_TRY_COMMAND([$3])],
+AS_IF([AC_TRY_COMMAND(cp conftest.c kernel-tests && make [$2] -f $PWD/kernel-tests/Makefile LUSTRE_LINUX_CONFIG=$LINUX_CONFIG -o tmp_include_depends -o scripts -o include/config/MARKER -C $LINUX EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM SUBDIRS=$PWD/kernel-tests) >/dev/null && AC_TRY_COMMAND([$3])],
        [$4],
        [_AC_MSG_LOG_CONFTEST
 m4_ifvaln([$5],[$5])dnl])dnl
@@ -218,12 +220,13 @@ if test x$enable_modules != xno ; then
        fi
        LUSTRE_MODULE_TRY_MAKE(
                [#include <linux/version.h>],
-               [LINUXRELEASE=UTS_RELEASE],
+               [char *LINUXRELEASE;
+                LINUXRELEASE=UTS_RELEASE;],
                [$makerule LUSTRE_KERNEL_TEST=conftest.i],
                [test -s kernel-tests/conftest.i],
                [
                        # LINUXRELEASE="UTS_RELEASE"
-                       eval $(grep LINUXRELEASE kernel-tests/conftest.i)
+                       eval $(grep "LINUXRELEASE=" kernel-tests/conftest.i)
                ],[
                        AC_MSG_RESULT([unknown])
                        AC_MSG_ERROR([Could not preprocess test program.  Consult config.log for details.])
@@ -306,11 +309,7 @@ if test -d $LINUX/drivers/net/qsnet ; then
                QSWCPPFLAGS="-DMULTIRAIL_EKC=1"
        else
                AC_MSG_RESULT([not supported])
-               if test -d $LINUX/drivers/net/qsnet/include; then
-                       QSWCPPFLAGS="-I$LINUX/drivers/net/qsnet/include"
-               else
-                       QSWCPPFLAGS="-I$LINUX/include/linux"
-               fi
+               QSWCPPFLAGS="-I$LINUX/drivers/net/qsnet/include"
        fi
 else
        AC_MSG_RESULT([no])
@@ -387,6 +386,39 @@ AC_SUBST(IBNAL)
 AC_SUBST(IBCPPFLAGS)
 AM_CONDITIONAL(BUILD_IBNAL, test x$IBNAL = "xibnal")
 
+def_scamac=/opt/scali/include
+AC_MSG_CHECKING([if ScaMAC support was requested])
+AC_ARG_WITH([scamac],
+       AC_HELP_STRING([--with-scamac=yes/no/path],
+                      [Path to ScaMAC includes (default=/opt/scali/include)]),
+       [
+               case $with_scamac in
+                       yes)
+                               AC_MSG_RESULT([yes])
+                               SCIMACCPPFLAGS="-I/opt/scali/include"
+                               SCIMACNAL="scimacnal"
+                               ;;
+                       no)
+                               AC_MSG_RESULT([no])
+                               SCIMACCPPFLAGS=""
+                               SCIMACNAL=""
+                               ;;
+                       *)
+                               AC_MSG_RESULT([yes])
+                               SCIMACCPPFLAGS="-I$with_scamac -I$with_scamac/icm"
+                               SCIMACNAL="scimacnal"
+                               ;;
+               esac
+       ],[
+               AC_MSG_RESULT([no])
+               SCIMACCPPFLAGS=""
+               SCIMACNAL=""
+       ])
+AC_SUBST(SCIMACCPPFLAGS)
+AC_SUBST(SCIMACNAL)
+AM_CONDITIONAL(BUILD_SCIMACNAL, test x$SCIMACNAL = "xscimacnal")
+# if test "$with_scamac" != no -a -f ${with_scamac}/scamac.h; then
+
 AC_SUBST(MOD_LINK)
 AC_SUBST(LINUX25)
 
@@ -425,7 +457,7 @@ LUSTRE_MODULE_TRY_COMPILE(
 # ---------- Red Hat 2.4.20 backports some 2.5 bits --------
 # This needs to run after we've defined the KCPPFLAGS
 
-AC_MSG_CHECKING([for kernel version])
+AC_MSG_CHECKING([if task_struct has a sighand field])
 LUSTRE_MODULE_TRY_COMPILE(
        [
                #include <linux/sched.h>
@@ -434,9 +466,24 @@ LUSTRE_MODULE_TRY_COMPILE(
                p.sighand = NULL;
        ],[
                AC_DEFINE(CONFIG_RH_2_4_20, 1, [this kernel contains Red Hat 2.4.20 patches])
-               AC_MSG_RESULT([redhat-2.4.20])
+               AC_MSG_RESULT([yes])
        ],[
-               AC_MSG_RESULT([$LINUXRELEASE])
+               AC_MSG_RESULT([no])
+       ])
+
+# ---------- 2.4.20 introduced cond_resched --------------
+
+AC_MSG_CHECKING([if kernel offers cond_resched])
+LUSTRE_MODULE_TRY_COMPILE(
+       [
+               #include <linux/sched.h>
+       ],[
+               cond_resched();
+       ],[
+               AC_MSG_RESULT([yes])
+               AC_DEFINE(HAVE_COND_RESCHED, 1, [cond_resched found])
+       ],[
+               AC_MSG_RESULT([no])
        ])
 
 # ---------- Red Hat 2.4.21 backports some more 2.5 bits --------