From: Thomas Petazzoni Date: Fri, 21 Aug 2009 23:12:02 +0000 (+0200) Subject: external toolchains: take into account architecture variant X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7b7a4be0e1d59b9218b6145331c700ac8199e24e;p=buildroot.git external toolchains: take into account architecture variant Until now, many TARGET_CFLAGS where missing when using an external toolchain, due to how package/Makefile.in was written. Now, a lot more definitions are common between the Buildroot toolchain case and the external toolchain case. Signed-off-by: Thomas Petazzoni --- diff --git a/package/Makefile.in b/package/Makefile.in index 983caf38e3..3dfc712da1 100644 --- a/package/Makefile.in +++ b/package/Makefile.in @@ -34,16 +34,7 @@ ifeq ($(BR2_DEBUG_3),y) TARGET_DEBUGGING=-g3 endif - -######################################################################### -ifeq ($(BR2_TOOLCHAIN_BUILDROOT),y) -TARGET_CFLAGS=$(TARGET_OPTIMIZATION) $(TARGET_DEBUGGING) \ - -I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include -TARGET_LDFLAGS+=-L$(STAGING_DIR)/lib -L$(STAGING_DIR)/usr/lib -ifeq ($(BR2_TOOLCHAIN_SYSROOT),y) -TARGET_CFLAGS+= $(BR2_SYSROOT) $(BR2_ISYSROOT) -TARGET_LDFLAGS+= $(BR2_SYSROOT) -endif +TARGET_CFLAGS=$(TARGET_OPTIMIZATION) $(TARGET_DEBUGGING) CC_TARGET_TUNE_:=$(call qstrip,$(BR2_GCC_TARGET_TUNE)) CC_TARGET_ARCH_:=$(call qstrip,$(BR2_GCC_TARGET_ARCH)) @@ -86,11 +77,20 @@ ifeq ($(BR2_LARGEFILE),y) TARGET_CFLAGS+=-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 endif + +######################################################################### +ifeq ($(BR2_TOOLCHAIN_BUILDROOT),y) +TARGET_CFLAGS+=-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include +TARGET_LDFLAGS+=-L$(STAGING_DIR)/lib -L$(STAGING_DIR)/usr/lib TARGET_CXXFLAGS=$(TARGET_CFLAGS) +ifeq ($(BR2_TOOLCHAIN_SYSROOT),y) +TARGET_CFLAGS+= $(BR2_SYSROOT) $(BR2_ISYSROOT) +TARGET_LDFLAGS+= $(BR2_SYSROOT) +endif ######################################################################### else ifeq ($(BR2_TOOLCHAIN_EXTERNAL),y) -TARGET_CFLAGS=$(TARGET_OPTIMIZATION) $(TARGET_DEBUGGING) --sysroot $(STAGING_DIR)/ +TARGET_CFLAGS+=--sysroot $(STAGING_DIR)/ TARGET_CXXFLAGS=$(TARGET_CFLAGS) TARGET_LDFLAGS=--sysroot $(STAGING_DIR)/ endif