From 6df47ff8445b7d86ec230b288417d791cf59e474 Mon Sep 17 00:00:00 2001 From: Liu Xuezhao Date: Tue, 19 Jun 2012 10:47:12 +0800 Subject: [PATCH] LU-1337 build: make configure process not break for 3.4 kernel 1. remove "ifeq ($(PATCHLEVEL),4)" from build/Makefile, Rules.in "ifeq ($(PATCHLEVEL),4)" is for old 2.4 kernel, it breaks configuration process for 3.4 kernel. 2. change the "-include" file from "include/$AUTOCONF_HDIR/autoconf.h" to "include/linux/kconfig.h", as kconfig.h includes autoconf.h and defines some macros(IS_ENABLED etc.) which is needed for some header files. 3. Fix a typo from "blkkdev.h" to "blkdev.h" in lustre-core.m4 Signed-off-by: Liu Xuezhao Change-Id: If1c712c194ba76a2fe46c31afad28c37f0b465c6 --- build/Makefile | 8 -------- build/Rules.in | 10 ---------- build/autoMakefile.am.toplevel | 2 +- build/autoconf/lustre-build-linux.m4 | 10 +++++++++- lustre/autoconf/lustre-core.m4 | 2 +- 5 files changed, 11 insertions(+), 21 deletions(-) diff --git a/build/Makefile b/build/Makefile index 0e5c8d4..5efb738 100644 --- a/build/Makefile +++ b/build/Makefile @@ -35,19 +35,11 @@ else # PATCHLEVEL # case 3 ifneq ($(LUSTRE_KERNEL_TEST),) -ifeq ($(PATCHLEVEL),4) -all: $(LUSTRE_KERNEL_TEST) -else extra-y = $(LUSTRE_KERNEL_TEST) endif -endif obj-m := conftest.o -ifeq ($(PATCHLEVEL),4) -include $(TOPDIR)/Rules.make -endif - endif # PATCHLEVEL # case 4 diff --git a/build/Rules.in b/build/Rules.in index 815b3da..dcfa492 100644 --- a/build/Rules.in +++ b/build/Rules.in @@ -65,14 +65,4 @@ EXTRA_CFLAGS += $(EXTRA_POST_CFLAGS) obj-m := $(patsubst %,%.o,$(MODULES)) -ifeq ($(PATCHLEVEL),4) -# 2.4 rules -O_TARGET := $(firstword $(obj-m)) -obj-y := $($(firstword $(MODULES))-objs) -export-objs := $(obj-y) $(filter-out $(O_TARGET),$(obj-m)) -include $(TOPDIR)/Rules.make -$(MODINCL)/%.ver: %.c - @true endif # PATCHLEVEL - -endif # KERNELRELEASE diff --git a/build/autoMakefile.am.toplevel b/build/autoMakefile.am.toplevel index 9ae93da..2f744b1 100644 --- a/build/autoMakefile.am.toplevel +++ b/build/autoMakefile.am.toplevel @@ -84,7 +84,7 @@ endif # !LINUX25 modules: $(DEP) all-sources $(MAKE) $(ARCH_UM) CC="$(CC)" -C $(LINUX_OBJ) \ -f $(PWD)/build/Makefile LUSTRE_LINUX_CONFIG=$(LINUX_CONFIG) \ - LINUXINCLUDE='$(EXTRA_LNET_INCLUDE) -I$$(srctree)/arch/$$(SRCARCH)/include -Iinclude $$(if $$(KBUILD_SRC),-Iinclude2 -I$$(srctree)/include) -include include/$(AUTOCONF_HDIR)/autoconf.h' \ + LINUXINCLUDE='$(EXTRA_LNET_INCLUDE) -I$$(srctree)/arch/$$(SRCARCH)/include -Iinclude $$(if $$(KBUILD_SRC),-Iinclude2 -I$$(srctree)/include) -include $(CONFIG_INCLUDE)' \ $(MODULE_TARGET)=$(PWD) -o tmp_include_depends -o scripts -o \ include/config/MARKER $@ endif # LINUX diff --git a/build/autoconf/lustre-build-linux.m4 b/build/autoconf/lustre-build-linux.m4 index 0833328..2adf6b7 100644 --- a/build/autoconf/lustre-build-linux.m4 +++ b/build/autoconf/lustre-build-linux.m4 @@ -239,6 +239,14 @@ LB_CHECK_FILE([$LINUX_OBJ/include/linux/autoconf.h],[AUTOCONF_HDIR=linux], LB_CHECK_FILE([$LINUX_OBJ/include/linux/version.h],[], [AC_MSG_ERROR([Run make config in $LINUX.])]) +# ----------- kconfig.h exists --------------- +# kernel 3.1, $LINUX/include/linux/kconfig.h is added +# see kernel commit 2a11c8ea20bf850b3a2c60db8c2e7497d28aba99 +LB_CHECK_FILE([$LINUX_OBJ/include/linux/kconfig.h], + [CONFIG_INCLUDE=include/linux/kconfig.h], + [CONFIG_INCLUDE=include/$AUTOCONF_HDIR/autoconf.h]) + AC_SUBST(CONFIG_INCLUDE) + # ------------ rhconfig.h includes runtime-generated bits -- # red hat kernel-source checks @@ -383,7 +391,7 @@ $2 AC_DEFUN([LB_LINUX_COMPILE_IFELSE], [m4_ifvaln([$1], [AC_LANG_CONFTEST([$1])])dnl rm -f build/conftest.o build/conftest.mod.c build/conftest.ko -AS_IF([AC_TRY_COMMAND(cp conftest.c build && make -d [$2] ${LD:+"LD=$LD"} CC="$CC" -f $PWD/build/Makefile LUSTRE_LINUX_CONFIG=$LINUX_CONFIG LINUXINCLUDE="$EXTRA_LNET_INCLUDE -I$LINUX/arch/`uname -m|sed -e 's/ppc.*/powerpc/' -e 's/x86_64/x86/' -e 's/i.86/x86/'`/include -I$LINUX_OBJ/include -I$LINUX/include -I$LINUX_OBJ/include2 -include include/$AUTOCONF_HDIR/autoconf.h" -o tmp_include_depends -o scripts -o include/config/MARKER -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM $MODULE_TARGET=$PWD/build) >/dev/null && AC_TRY_COMMAND([$3])], +AS_IF([AC_TRY_COMMAND(cp conftest.c build && make -d [$2] ${LD:+"LD=$LD"} CC="$CC" -f $PWD/build/Makefile LUSTRE_LINUX_CONFIG=$LINUX_CONFIG LINUXINCLUDE="$EXTRA_LNET_INCLUDE -I$LINUX/arch/`uname -m|sed -e 's/ppc.*/powerpc/' -e 's/x86_64/x86/' -e 's/i.86/x86/'`/include -I$LINUX_OBJ/include -I$LINUX/include -I$LINUX_OBJ/include2 -include $CONFIG_INCLUDE" -o tmp_include_depends -o scripts -o include/config/MARKER -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM $MODULE_TARGET=$PWD/build) >/dev/null && AC_TRY_COMMAND([$3])], [$4], [_AC_MSG_LOG_CONFTEST m4_ifvaln([$5],[$5])dnl]) diff --git a/lustre/autoconf/lustre-core.m4 b/lustre/autoconf/lustre-core.m4 index daed428..a990cab 100644 --- a/lustre/autoconf/lustre-core.m4 +++ b/lustre/autoconf/lustre-core.m4 @@ -1644,7 +1644,7 @@ LB_LINUX_TRY_COMPILE([ AC_DEFUN([LC_BDI_NAME], [AC_MSG_CHECKING([if backing_device_info has name field]) LB_LINUX_TRY_COMPILE([ - #include + #include ],[ struct backing_dev_info bdi; bdi.name = NULL; -- 1.8.3.1