From d8709723ebcdb1a33e656bc9962e946a7df1a619 Mon Sep 17 00:00:00 2001 From: yangsheng Date: Mon, 29 Aug 2011 12:22:22 +0800 Subject: [PATCH] LU-506 FC15: move some headers to include/generated In FC15 (2.6.40-4) the generated kernel headers have moved from "include/linux" to "include/generated". Update configure scripts and makefiles to include this new directory. In a number of cases, Lustre code was including generated headers directly, but this was not really needed. Signed-off-by: Yang Sheng Change-Id: Id2094d8318681aa5ea08b416dc764bcf03bd8595 Reviewed-on: http://review.whamcloud.com/1329 Tested-by: Hudson Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Lai Siyao Reviewed-by: Niu Yawei --- build/autoMakefile.am.toplevel | 4 ++-- build/autoconf/lustre-build-linux.m4 | 21 ++++++++++++--------- lustre/autoconf/lustre-core.m4 | 4 +--- lustre/include/linux/lprocfs_status.h | 1 - lustre/include/linux/obd_cksum.h | 4 ---- lustre/include/linux/obd_support.h | 1 - lustre/llite/rw.c | 1 - lustre/obdclass/linux/linux-sysctl.c | 1 - 8 files changed, 15 insertions(+), 22 deletions(-) diff --git a/build/autoMakefile.am.toplevel b/build/autoMakefile.am.toplevel index 036ee86..aa7c810 100644 --- a/build/autoMakefile.am.toplevel +++ b/build/autoMakefile.am.toplevel @@ -72,9 +72,9 @@ CLEANFILES = .depend endif # !LINUX25 modules: $(DEP) all-sources - $(MAKE) $(ARCH_UM) CC="$(CC)" -C $(LINUX_OBJ) \ + $(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/linux/autoconf.h' \ + LINUXINCLUDE='$(EXTRA_LNET_INCLUDE) -I$$(srctree)/arch/$$(SRCARCH)/include -Iinclude $$(if $$(KBUILD_SRC),-Iinclude2 -I$$(srctree)/include) -include include/$(AUTOCONF_HDIR)/autoconf.h' \ $(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 0f83400..1896190 100644 --- a/build/autoconf/lustre-build-linux.m4 +++ b/build/autoconf/lustre-build-linux.m4 @@ -55,13 +55,13 @@ AC_DEFUN([LB_LINUX_RELEASE], [LINUXRELEASE= rm -f build/conftest.i AC_MSG_CHECKING([for Linux release]) -if test -s $LINUX_OBJ/include/linux/utsrelease.h ; then - LINUXRELEASEHEADER=utsrelease.h +if test -s $LINUX_OBJ/include/$AUTOCONF_HDIR/utsrelease.h ; then + LINUXRELEASEHEADER=$AUTOCONF_HDIR/utsrelease.h else - LINUXRELEASEHEADER=version.h + LINUXRELEASEHEADER=linux/version.h fi LB_LINUX_TRY_MAKE([ - #include + #include <$LINUXRELEASEHEADER> ],[ char *LINUXRELEASE; LINUXRELEASE=UTS_RELEASE; @@ -232,8 +232,11 @@ LB_CHECK_FILE([$LINUX_CONFIG],[], # at 2.6.19 # $LINUX/include/linux/config.h is removed # and at more old has only one line # include -LB_CHECK_FILE([$LINUX_OBJ/include/linux/autoconf.h],[], - [AC_MSG_ERROR([Run make config in $LINUX.])]) +LB_CHECK_FILE([$LINUX_OBJ/include/linux/autoconf.h],[AUTOCONF_HDIR=linux], + [LB_CHECK_FILE([$LINUX_OBJ/include/generated/autoconf.h],[AUTOCONF_HDIR=generated + AC_DEFINE(AUTOCONF_INCLUDED, 1, [autoconf.h not define it while move to generated])], + [AC_MSG_ERROR([Run make config in $LINUX.])])]) + AC_SUBST(AUTOCONF_HDIR) LB_CHECK_FILE([$LINUX_OBJ/include/linux/version.h],[], [AC_MSG_ERROR([Run make config in $LINUX.])]) @@ -381,7 +384,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/linux/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 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])], [$4], [_AC_MSG_LOG_CONFTEST m4_ifvaln([$5],[$5])dnl]) @@ -423,7 +426,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([ -#include +#include <$AUTOCONF_HDIR/autoconf.h> ],[ #ifndef CONFIG_$1 #error CONFIG_$1 not #defined @@ -445,7 +448,7 @@ $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 +#include <$AUTOCONF_HDIR/autoconf.h> ],[ #if !(defined(CONFIG_$1) || defined(CONFIG_$1_MODULE)) #error CONFIG_$1 and CONFIG_$1_MODULE not #defined diff --git a/lustre/autoconf/lustre-core.m4 b/lustre/autoconf/lustre-core.m4 index 91bf08c..52c1db2 100644 --- a/lustre/autoconf/lustre-core.m4 +++ b/lustre/autoconf/lustre-core.m4 @@ -475,10 +475,9 @@ $1 AC_DEFUN([LC_CONST_ACL_SIZE], [AC_MSG_CHECKING([calc acl size]) tmp_flags="$CFLAGS" -CFLAGS="$CFLAGS -I$LINUX/include -I$LINUX_OBJ/include -I$LINUX_OBJ/include2 -I$LINUX/arch/`uname -m|sed -e 's/ppc.*/powerpc/' -e 's/x86_64/x86/' -e 's/i.86/x86/'`/include $EXTRA_KCFLAGS" +CFLAGS="$CFLAGS -I$LINUX/include -I$LINUX_OBJ/include -I$LINUX_OBJ/include2 -I$LINUX/arch/`uname -m|sed -e 's/ppc.*/powerpc/' -e 's/x86_64/x86/' -e 's/i.86/x86/'`/include -include $AUTOCONF_HDIR/autoconf.h $EXTRA_KCFLAGS" AC_TRY_RUN([ #define __KERNEL__ - #include #include #undef __KERNEL__ // block include @@ -1152,7 +1151,6 @@ LB_LINUX_TRY_COMPILE([ AC_DEFUN([LC_PAGE_CHECKED], [AC_MSG_CHECKING([kernel has PageChecked and SetPageChecked]) LB_LINUX_TRY_COMPILE([ - #include #ifdef HAVE_LINUX_MMTYPES_H #include #endif diff --git a/lustre/include/linux/lprocfs_status.h b/lustre/include/linux/lprocfs_status.h index b9f52cc..54e9572 100644 --- a/lustre/include/linux/lprocfs_status.h +++ b/lustre/include/linux/lprocfs_status.h @@ -50,7 +50,6 @@ #ifndef AUTOCONF_INCLUDED #include #endif -#include #include #include #include diff --git a/lustre/include/linux/obd_cksum.h b/lustre/include/linux/obd_cksum.h index f065def..03d3a50 100644 --- a/lustre/include/linux/obd_cksum.h +++ b/lustre/include/linux/obd_cksum.h @@ -41,10 +41,6 @@ #error Do not #include this file directly. #include instead #endif -#ifdef __KERNEL__ -#include -#endif - #include /* Prefer the kernel's version, if it exports it, because it might be diff --git a/lustre/include/linux/obd_support.h b/lustre/include/linux/obd_support.h index 1443051..22f2a4a 100644 --- a/lustre/include/linux/obd_support.h +++ b/lustre/include/linux/obd_support.h @@ -49,7 +49,6 @@ #endif #include #include -#include #include #include #include diff --git a/lustre/llite/rw.c b/lustre/llite/rw.c index fcef728..93fb344 100644 --- a/lustre/llite/rw.c +++ b/lustre/llite/rw.c @@ -38,7 +38,6 @@ * Lustre Lite I/O page cache routines shared by different kernel revs */ -#include #include #include #include diff --git a/lustre/obdclass/linux/linux-sysctl.c b/lustre/obdclass/linux/linux-sysctl.c index db6edd8..faaa433 100644 --- a/lustre/obdclass/linux/linux-sysctl.c +++ b/lustre/obdclass/linux/linux-sysctl.c @@ -35,7 +35,6 @@ */ #include -#include #include #include #include -- 1.8.3.1