From b85e9c4dfd29edafbef5cf045b8a839997d15389 Mon Sep 17 00:00:00 2001
From: scjody <scjody>
Date: Fri, 24 Aug 2007 15:36:32 +0000
Subject: [PATCH] Branch b1_6

Add EXPORT_SYMBOL check for node_to_cpumask symbol.

b=12826
i=shadow
i=mjmac
---
 build/Makefile                       |  9 ++++++++-
 build/autoconf/lustre-build-linux.m4 | 15 +++++++++++++++
 2 files changed, 23 insertions(+), 1 deletion(-)

diff --git a/build/Makefile b/build/Makefile
index c0538bdfd2..11c9c6ec62 100644
--- a/build/Makefile
+++ b/build/Makefile
@@ -1,5 +1,5 @@
 #
-# There are three ways this Makefile can be called:
+# There are four ways this Makefile can be called:
 #
 # 
 # 1.  As a subdirectory from the toplevel, for automake
@@ -10,6 +10,8 @@
 # 3.  At configure time, as the toplevel module dir for building
 #     kernel tests
 #
+# 4.  At configure time, to determine the kernel's idea of $(ARCH)
+#
 
 ifeq ($(PATCHLEVEL),)
 
@@ -47,3 +49,8 @@ include $(TOPDIR)/Rules.make
 endif
 
 endif # PATCHLEVEL
+
+# case 4
+
+echoarch:
+	echo $(ARCH) >$(ARCHFILE)
diff --git a/build/autoconf/lustre-build-linux.m4 b/build/autoconf/lustre-build-linux.m4
index 8e7c8c1420..272833476b 100644
--- a/build/autoconf/lustre-build-linux.m4
+++ b/build/autoconf/lustre-build-linux.m4
@@ -308,6 +308,21 @@ m4_ifvaln([$5],[$5])dnl])dnl
 rm -f build/conftest.o build/conftest.mod.c build/conftest.mod.o build/conftest.ko m4_ifval([$1], [build/conftest.c conftest.c])[]dnl
 ])
 
+#
+# LB_LINUX_ARCH
+#
+# Determine the kernel's idea of the current architecture
+#
+AC_DEFUN([LB_LINUX_ARCH],
+         [AC_MSG_CHECKING([Linux kernel architecture])
+          AS_IF([rm -f $PWD/build/arch
+                 make -s --no-print-directory echoarch -f $PWD/build/Makefile \
+                     LUSTRE_LINUX_CONFIG=$LINUX_CONFIG -C $LINUX_OBJ $ARCH_UM \
+                     ARCHFILE=$PWD/build/arch && LINUX_ARCH=`cat $PWD/build/arch`],
+                [AC_MSG_RESULT([$LINUX_ARCH])],
+                [AC_MSG_ERROR([Could not determine the kernel architecture.])])
+          rm -f build/arch])
+
 #
 # LB_LINUX_TRY_COMPILE
 #
-- 
GitLab