Whamcloud - gitweb
LU-506 FC15: move some headers to include/generated
authoryangsheng <ys@whamcloud.com>
Mon, 29 Aug 2011 04:22:22 +0000 (12:22 +0800)
committerOleg Drokin <green@whamcloud.com>
Tue, 22 Nov 2011 23:22:14 +0000 (18:22 -0500)
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 <ys@whamcloud.com>
Change-Id: Id2094d8318681aa5ea08b416dc764bcf03bd8595
Reviewed-on: http://review.whamcloud.com/1329
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Lai Siyao <laisiyao@whamcloud.com>
Reviewed-by: Niu Yawei <niu@whamcloud.com>
build/autoMakefile.am.toplevel
build/autoconf/lustre-build-linux.m4
lustre/autoconf/lustre-core.m4
lustre/include/linux/lprocfs_status.h
lustre/include/linux/obd_cksum.h
lustre/include/linux/obd_support.h
lustre/llite/rw.c
lustre/obdclass/linux/linux-sysctl.c

index 036ee86..aa7c810 100644 (file)
@@ -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
index 0f83400..1896190 100644 (file)
@@ -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 <linux/$LINUXRELEASEHEADER>
+       #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 <autoconf.h>
-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 <linux/autoconf.h>
+#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 <linux/autoconf.h>
+#include <$AUTOCONF_HDIR/autoconf.h>
 ],[
 #if !(defined(CONFIG_$1) || defined(CONFIG_$1_MODULE))
 #error CONFIG_$1 and CONFIG_$1_MODULE not #defined
index 91bf08c..52c1db2 100644 (file)
@@ -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 <linux/autoconf.h>
         #include <linux/types.h>
         #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 <linux/autoconf.h>
 #ifdef HAVE_LINUX_MMTYPES_H
         #include <linux/mm_types.h>
 #endif
index b9f52cc..54e9572 100644 (file)
@@ -50,7 +50,6 @@
 #ifndef AUTOCONF_INCLUDED
 #include <linux/config.h>
 #endif
-#include <linux/autoconf.h>
 #include <linux/proc_fs.h>
 #include <linux/seq_file.h>
 #include <linux/version.h>
index f065def..03d3a50 100644 (file)
 #error Do not #include this file directly. #include <obd_chsum.h> instead
 #endif
 
-#ifdef __KERNEL__
-#include <linux/autoconf.h>
-#endif
-
 #include <libcfs/libcfs.h>
 
 /* Prefer the kernel's version, if it exports it, because it might be
index 1443051..22f2a4a 100644 (file)
@@ -49,7 +49,6 @@
 #endif
 #include <linux/seq_file.h>
 #include <linux/module.h>
-#include <linux/autoconf.h>
 #include <linux/slab.h>
 #include <linux/highmem.h>
 #include <linux/swap.h>
index fcef728..93fb344 100644 (file)
@@ -38,7 +38,6 @@
  * Lustre Lite I/O page cache routines shared by different kernel revs
  */
 
-#include <linux/autoconf.h>
 #include <linux/kernel.h>
 #include <linux/mm.h>
 #include <linux/string.h>
index db6edd8..faaa433 100644 (file)
@@ -35,7 +35,6 @@
  */
 
 #include <linux/module.h>
-#include <linux/autoconf.h>
 #include <linux/sysctl.h>
 #include <linux/sched.h>
 #include <linux/mm.h>