From: Luis R. Rodriguez Date: Sat, 25 Feb 2012 03:40:22 +0000 (-0800) Subject: compat: avoid NOSTDINC_FLAGS during modpost X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=fa4bdef61b2bb3071b8dc1b63164e6e986fa5604;p=openwrt%2Fstaging%2Fblogic.git compat: avoid NOSTDINC_FLAGS during modpost modpost, the second part of module building, does not use NOSTDINC_FLAGS and friends so all the hackery we did to use it to prefer our header files and include compat-2.6.h will not work during modpost for older kernels. We don't really need all that stuff during modpost even for newer kernels so just avoid it all together. Signed-off-by: Luis R. Rodriguez --- diff --git a/Makefile b/Makefile index fdcff5c721ae..d96d09809221 100644 --- a/Makefile +++ b/Makefile @@ -18,6 +18,22 @@ export COMPAT_BASE_TREE := "linux-next.git" # working with. export COMPAT_BASE_TREE_VERSION := "next-20100517" export COMPAT_VERSION := $(shell git describe) + +else +# By stuffing this hear we avoid using +# this hackery on modpost, the 2nd section of module building. +# +# This hack lets us put our include path first than the kernel's +# when building our compat modules. Your own makefile would look +# the same. +NOSTDINC_FLAGS := -I$(M)/include/ \ + -include $(M)/include/linux/compat-2.6.h \ + $(CFLAGS) \ + -DCOMPAT_BASE_TREE="\"$(COMPAT_BASE_TREE)\"" \ + -DCOMPAT_BASE_TREE_VERSION="\"$(COMPAT_BASE_TREE_VERSION)\"" \ + -DCOMPAT_PROJECT="\"Generic kernel\"" \ + -DCOMPAT_VERSION="\"$(COMPAT_VERSION)\"" + endif # to check config and compat autoconf @@ -31,17 +47,6 @@ export MAKE obj-y += compat/ -# This hack lets us put our include path first than the kernel's -# when building our compat modules. Your own makefile would look -# the same. -NOSTDINC_FLAGS := -I$(M)/include/ \ - -include $(M)/include/linux/compat-2.6.h \ - $(CFLAGS) \ - -DCOMPAT_BASE_TREE="\"$(COMPAT_BASE_TREE)\"" \ - -DCOMPAT_BASE_TREE_VERSION="\"$(COMPAT_BASE_TREE_VERSION)\"" \ - -DCOMPAT_PROJECT="\"Generic kernel\"" \ - -DCOMPAT_VERSION="\"$(COMPAT_VERSION)\"" - all: $(COMPAT_CONFIG) modules: $(COMPAT_CONFIG) $(COMPAT_AUTOCONF)