summaryrefslogtreecommitdiff
path: root/package/Makefile.in
diff options
context:
space:
mode:
authorPeter Korsgaard <jacmet@sunsite.dk>2010-07-08 10:21:16 +0200
committerPeter Korsgaard <jacmet@sunsite.dk>2010-07-08 10:21:16 +0200
commit74708bad1512a917a28c59646d1f9491f6fe9ea6 (patch)
tree7f3bf126d8251e99dda6da042be1fe016d59e3c3 /package/Makefile.in
parent049cf426e32d6f789439d0d06905c977bfd25c02 (diff)
parentd0169fda2144ef5dfe25e801d58a227ed119a38c (diff)
Merge branch 'misc-fixes' of git://git.busybox.net/~tpetazzoni/git/buildroot
Diffstat (limited to 'package/Makefile.in')
-rw-r--r--package/Makefile.in120
1 files changed, 42 insertions, 78 deletions
diff --git a/package/Makefile.in b/package/Makefile.in
index 5147dc851..189806d7b 100644
--- a/package/Makefile.in
+++ b/package/Makefile.in
@@ -77,23 +77,13 @@ 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)
-TARGET_CFLAGS+= $(BR2_SYSROOT) $(BR2_ISYSROOT)
-TARGET_LDFLAGS+= $(BR2_SYSROOT)
+endif
-#########################################################################
-else ifeq ($(BR2_TOOLCHAIN_EXTERNAL),y)
-TARGET_CFLAGS+=--sysroot=$(STAGING_DIR)/
-TARGET_CXXFLAGS=$(TARGET_CFLAGS)
-TARGET_LDFLAGS=--sysroot=$(STAGING_DIR)/
TARGET_LDFLAGS+=-L$(STAGING_DIR)/lib -L$(STAGING_DIR)/usr/lib
-endif
-#########################################################################
+TARGET_CXXFLAGS=$(TARGET_CFLAGS)
+TARGET_SYSROOT_OPT=--sysroot=$(STAGING_DIR)
# Compute GNU_TARGET_NAME and REAL_GNU_TARGET_NAME
GNU_TARGET_NAME=$(ARCH)-linux
@@ -113,32 +103,36 @@ endif
REAL_GNU_TARGET_NAME=$(ARCH)-unknown-linux-$(LIBC)$(ABI)
ifeq ($(BR2_TOOLCHAIN_BUILDROOT),y)
-
-# Quotes are needed for spaces et al in path components.
-TARGET_PATH="$(TOOLCHAIN_DIR)/bin:$(HOST_DIR)/bin:$(HOST_DIR)/usr/bin:$(HOST_DIR)/usr/sbin/:$(STAGING_DIR)/bin:$(STAGING_DIR)/usr/bin:$(PATH)"
TARGET_CROSS=$(STAGING_DIR)/usr/bin/$(REAL_GNU_TARGET_NAME)-
else ifeq ($(BR2_TOOLCHAIN_EXTERNAL),y)
TOOLCHAIN_EXTERNAL_PREFIX:=$(call qstrip,$(BR2_TOOLCHAIN_EXTERNAL_PREFIX))
TOOLCHAIN_EXTERNAL_PATH:=$(call qstrip,$(BR2_TOOLCHAIN_EXTERNAL_PATH))
-TARGET_PATH="$(HOST_DIR)/bin:$(HOST_DIR)/usr/bin:$(HOST_DIR)/usr/sbin/:$(TOOLCHAIN_DIR)/bin:$(TOOLCHAIN_EXTERNAL_PATH)/bin:$(PATH)"
TARGET_CROSS=$(TOOLCHAIN_EXTERNAL_PATH)/bin/$(TOOLCHAIN_EXTERNAL_PREFIX)-
endif
-TARGET_AR=$(TARGET_CROSS)ar
-TARGET_AS=$(TARGET_CROSS)as
-TARGET_CC=$(TARGET_CROSS)gcc
-TARGET_CPP=$(TARGET_CROSS)cpp
-TARGET_CXX=$(TARGET_CROSS)g++
-TARGET_FC=$(TARGET_CROSS)gfortran
-TARGET_LD=$(TARGET_CROSS)ld
-TARGET_NM=$(TARGET_CROSS)nm
-TARGET_RANLIB=$(TARGET_CROSS)ranlib
-TARGET_OBJCOPY=$(TARGET_CROSS)objcopy
-TARGET_OBJDUMP=$(TARGET_CROSS)objdump
+
+# Quotes are needed for spaces et al in path components.
+TARGET_PATH="$(HOST_DIR)/bin:$(HOST_DIR)/usr/bin:$(HOST_DIR)/usr/sbin/:$(PATH)"
+
+# Define TARGET_xx variables for all common binutils/gcc tools by
+# including the --sysroot option where necessary.
+TARGET_AR = $(TARGET_CROSS)ar
+TARGET_AS = $(TARGET_CROSS)as
+TARGET_CC = $(TARGET_CROSS)gcc $(TARGET_SYSROOT_OPT)
+TARGET_CPP = $(TARGET_CROSS)cpp $(TARGET_SYSROOT_OPT)
+TARGET_CXX = $(TARGET_CROSS)g++ $(TARGET_SYSROOT_OPT)
+TARGET_FC = $(TARGET_CROSS)gfortran $(TARGET_SYSROOT_OPT)
+TARGET_LD = $(TARGET_CROSS)ld $(TARGET_SYSROOT_OPT)
+TARGET_NM = $(TARGET_CROSS)nm
+TARGET_RANLIB = $(TARGET_CROSS)ranlib
+TARGET_OBJCOPY = $(TARGET_CROSS)objcopy
+TARGET_OBJDUMP = $(TARGET_CROSS)objdump
+
ifeq ($(BR2_TOOLCHAIN_BUILDROOT),y)
-TARGET_LDCONFIG=$(TARGET_CROSS)ldconfig
+TARGET_LDCONFIG = $(TARGET_CROSS)ldconfig
else ifeq ($(BR2_TOOLCHAIN_EXTERNAL),y)
-TARGET_LDCONFIG=/sbin/ldconfig
+TARGET_LDCONFIG = /sbin/ldconfig
endif
+
ifeq ($(BR2_STRIP_strip),y)
STRIP_DISCARD_ALL:=--discard-all
STRIP_STRIP_UNNEEDED:=--strip-unneeded
@@ -167,7 +161,7 @@ BISON:=$(shell which bison || type -p bison)
HOST_CFLAGS += -I$(HOST_DIR)/include -I$(HOST_DIR)/usr/include
HOST_CXXFLAGS += -I$(HOST_DIR)/include -I$(HOST_DIR)/usr/include
-HOST_LDFLAGS += -L$(HOST_DIR)/lib -L$(HOST_DIR)/usr/lib
+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)
# hostcc version as an integer - E.G. 4.3.2 => 432
@@ -179,11 +173,11 @@ TARGET_CONFIGURE_OPTS=PATH=$(TARGET_PATH) \
AS="$(TARGET_AS)" \
LD="$(TARGET_LD)" \
NM="$(TARGET_NM)" \
- CC="$(TARGET_CC) $(TARGET_CFLAGS)" \
- GCC="$(TARGET_CC) $(TARGET_CFLAGS)" \
- CPP="$(TARGET_CPP) $(TARGET_CFLAGS)" \
- CXX="$(TARGET_CXX) $(TARGET_CXXFLAGS)" \
- FC="$(TARGET_FC) $(TARGET_FCFLAGS)" \
+ CC="$(TARGET_CC)" \
+ GCC="$(TARGET_CC)" \
+ CPP="$(TARGET_CPP)" \
+ CXX="$(TARGET_CXX)" \
+ FC="$(TARGET_FC)" \
RANLIB="$(TARGET_RANLIB)" \
STRIP="$(TARGET_STRIP)" \
OBJCOPY="$(TARGET_OBJCOPY)" \
@@ -198,63 +192,33 @@ TARGET_CONFIGURE_OPTS=PATH=$(TARGET_PATH) \
CXXFLAGS_FOR_BUILD="$(HOST_CXXFLAGS)" \
LDFLAGS_FOR_BUILD="$(HOST_LDFLAGS)" \
FCFLAGS_FOR_BUILD="$(HOST_FCFLAGS)" \
- AR_FOR_TARGET="$(TARGET_AR)" \
- AS_FOR_TARGET="$(TARGET_AS)" \
- CC_FOR_TARGET="$(TARGET_CC)" \
- LD_FOR_TARGET="$(TARGET_LD)" \
- NM_FOR_TARGET="$(TARGET_NM)" \
DEFAULT_ASSEMBLER="$(TARGET_AS)" \
DEFAULT_LINKER="$(TARGET_LD)" \
+ CFLAGS="$(TARGET_CFLAGS)" \
+ CXXFLAGS="$(TARGET_CXXFLAGS)" \
+ LDFLAGS="$(TARGET_LDFLAGS)" \
+ FCFLAGS="$(TARGET_FCFLAGS)" \
PKG_CONFIG_SYSROOT_DIR="$(STAGING_DIR)" \
PKG_CONFIG="$(PKG_CONFIG_HOST_BINARY)" \
PKG_CONFIG_PATH="$(STAGING_DIR)/usr/lib/pkgconfig:$(PKG_CONFIG_PATH)" \
PERLLIB="$(HOST_DIR)/usr/lib/perl" \
STAGING_DIR="$(STAGING_DIR)"
-TARGET_CONFIGURE_ENV=\
- CFLAGS="$(TARGET_CFLAGS)" \
- CXXFLAGS="$(TARGET_CXXFLAGS)" \
- LDFLAGS="$(TARGET_LDFLAGS)" \
- FCFLAGS="$(TARGET_FCFLAGS)" \
-
TARGET_MAKE_ENV=PATH=$(TARGET_PATH) \
PERLLIB="$(HOST_DIR)/usr/lib/perl"
HOST_CONFIGURE_OPTS=PATH=$(HOST_PATH) \
AR="$(HOSTAR)" \
AS="$(HOSTAS)" \
- LD="$(HOSTLD) $(HOST_LDFLAGS)" \
+ LD="$(HOSTLD)" \
NM="$(HOSTNM)" \
- CC="$(HOSTCC) $(HOST_CFLAGS)" \
- GCC="$(HOSTCC) $(HOST_CFLAGS)" \
- CXX="$(HOSTCXX) $(HOST_CXXFLAGS)" \
- CPP="$(HOSTCPP) $(HOST_CFLAGS)" \
- AR_FOR_BUILD="$(HOSTAR)" \
- AS_FOR_BUILD="$(HOSTAS)" \
- CC_FOR_BUILD="$(HOSTCC)" \
- GCC_FOR_BUILD="$(HOSTCC)" \
- CXX_FOR_BUILD="$(HOSTCXX)" \
- LD_FOR_BUILD="$(HOSTLD)" \
- FC_FOR_BUILD="$(HOSTFC)" \
- CFLAGS_FOR_BUILD="$(HOST_CFLAGS)" \
- CXXFLAGS_FOR_BUILD="$(HOST_CXXFLAGS)" \
- LDFLAGS_FOR_BUILD="$(HOST_LDFLAGS)" \
- FCFLAGS_FOR_BUILD="$(HOST_FCFLAGS)" \
- AR_FOR_TARGET="$(TARGET_AR)" \
- AS_FOR_TARGET="$(TARGET_AS)" \
- CC_FOR_TARGET="$(TARGET_CC)" \
- LD_FOR_TARGET="$(TARGET_LD)" \
- NM_FOR_TARGET="$(TARGET_NM)" \
- RANLIB_FOR_TARGET="$(TARGET_RANLIB)" \
- STRIP_FOR_TARGET="$(TARGET_STRIP)" \
- OBJCOPY_FOR_TARGET="$(TARGET_OBJCOPY)" \
- OBJDUMP_FOR_TARGET="$(TARGET_OBJDUMP)" \
- DEFAULT_ASSEMBLER="$(TARGET_AS)" \
- DEFAULT_LINKER="$(TARGET_LD)" \
- ORIGINAL_AS_FOR_TARGET="$(TARGET_AS)" \
- ORIGINAL_LD_FOR_TARGET="$(TARGET_LD)" \
- ORIGINAL_NM_FOR_TARGET="$(TARGET_NM)" \
- ORIGINAL_OBJDUMP_FOR_TARGET="$(TARGET_OBJDUMP)" \
+ CC="$(HOSTCC)" \
+ GCC="$(HOSTCC)" \
+ CXX="$(HOSTCXX)" \
+ CPP="$(HOSTCPP)" \
+ CFLAGS="$(HOST_CFLAGS)" \
+ CXXFLAGS="$(HOST_CXXFLAGS)" \
+ LDFLAGS="$(HOST_LDFLAGS)" \
PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1 \
PKG_CONFIG_ALLOW_SYSTEM_LIBS=1 \
PKG_CONFIG="$(PKG_CONFIG_HOST_BINARY)" \