Makefile.in: add CPPFLAGS support
authorSamuel Martin <s.martin49@gmail.com>
Wed, 25 Jul 2012 17:40:46 +0000 (17:40 +0000)
committerPeter Korsgaard <jacmet@sunsite.dk>
Wed, 10 Oct 2012 21:50:26 +0000 (23:50 +0200)
Signed-off-by: Samuel Martin <s.martin49@gmail.com>
Acked-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
package/Makefile.in

index 30a542a653f1400c2c97e4e17172a03d1fbc921f..c04298441c95e0f8301c48567d0691575b85863b 100644 (file)
@@ -85,14 +85,16 @@ ifeq ($(BR2_DEBUG_3),y)
 TARGET_DEBUGGING=-g3
 endif
 
-TARGET_CFLAGS=$(TARGET_ABI) $(TARGET_OPTIMIZATION) $(TARGET_DEBUGGING)
+TARGET_CPPFLAGS =
 
 ifeq ($(BR2_LARGEFILE),y)
-TARGET_CFLAGS+=-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
+TARGET_CPPFLAGS += -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
 endif
 
-TARGET_CXXFLAGS=$(TARGET_CFLAGS)
-TARGET_LDFLAGS=$(call qstrip,$(BR2_TARGET_LDFLAGS))
+TARGET_CFLAGS = $(TARGET_CPPFLAGS) $(TARGET_ABI) $(TARGET_OPTIMIZATION) $(TARGET_DEBUGGING)
+
+TARGET_CXXFLAGS  = $(TARGET_CFLAGS)
+TARGET_LDFLAGS   = $(call qstrip,$(BR2_TARGET_LDFLAGS))
 
 ifeq ($(BR2_TOOLCHAIN_BUILDROOT)$(BR2_TOOLCHAIN_CTNG),y)
 TARGET_CROSS=$(HOST_DIR)/usr/bin/$(GNU_TARGET_NAME)-
@@ -149,9 +151,10 @@ FLEX:=$(shell which flex || type -p flex)
 BISON:=$(shell which bison || type -p bison)
 SED:=$(shell which sed || type -p sed) -i -e
 
+HOST_CPPFLAGS  = -I$(HOST_DIR)/usr/include
 HOST_CFLAGS   ?= -O2
-HOST_CFLAGS   += -I$(HOST_DIR)/include -I$(HOST_DIR)/usr/include
-HOST_CXXFLAGS += -I$(HOST_DIR)/include -I$(HOST_DIR)/usr/include
+HOST_CFLAGS   += $(HOST_CPPFLAGS)
+HOST_CXXFLAGS += $(HOST_CFLAGS)
 HOST_LDFLAGS  += -L$(HOST_DIR)/lib -L$(HOST_DIR)/usr/lib -Wl,-rpath,$(HOST_DIR)/usr/lib
 HOST_PATH=$(HOST_DIR)/bin:$(HOST_DIR)/usr/bin:$(PATH)
 
@@ -180,12 +183,14 @@ TARGET_CONFIGURE_OPTS=PATH=$(TARGET_PATH) \
                CXX_FOR_BUILD="$(HOSTCXX)" \
                FC_FOR_BUILD="$(HOSTFC)" \
                LD_FOR_BUILD="$(HOSTLD)" \
+               CPPFLAGS_FOR_BUILD="$(HOST_CPPFLAGS)" \
                CFLAGS_FOR_BUILD="$(HOST_CFLAGS)" \
                CXXFLAGS_FOR_BUILD="$(HOST_CXXFLAGS)" \
                LDFLAGS_FOR_BUILD="$(HOST_LDFLAGS)" \
                FCFLAGS_FOR_BUILD="$(HOST_FCFLAGS)" \
                DEFAULT_ASSEMBLER="$(TARGET_AS)" \
                DEFAULT_LINKER="$(TARGET_LD)" \
+               CPPFLAGS="$(TARGET_CPPFLAGS)" \
                CFLAGS="$(TARGET_CFLAGS)" \
                CXXFLAGS="$(TARGET_CXXFLAGS)" \
                LDFLAGS="$(TARGET_LDFLAGS)" \
@@ -206,6 +211,7 @@ HOST_CONFIGURE_OPTS=PATH=$(HOST_PATH) \
                GCC="$(HOSTCC)" \
                CXX="$(HOSTCXX)" \
                CPP="$(HOSTCPP)" \
+               CPPFLAGS="$(HOST_CPPFLAGS)" \
                CFLAGS="$(HOST_CFLAGS)" \
                CXXFLAGS="$(HOST_CXXFLAGS)" \
                LDFLAGS="$(HOST_LDFLAGS)" \