summaryrefslogtreecommitdiff
path: root/toolchain
diff options
context:
space:
mode:
Diffstat (limited to 'toolchain')
-rw-r--r--toolchain/Makefile8
-rw-r--r--toolchain/binutils/Makefile2
-rw-r--r--toolchain/gcc/Makefile41
-rw-r--r--toolchain/glibc/Makefile2
-rw-r--r--toolchain/gmp/Makefile5
-rw-r--r--toolchain/libelf/Makefile2
-rw-r--r--toolchain/mpc/Makefile4
-rw-r--r--toolchain/mpfr/Makefile2
8 files changed, 29 insertions, 37 deletions
diff --git a/toolchain/Makefile b/toolchain/Makefile
index db5f65fd5..c70ea9820 100644
--- a/toolchain/Makefile
+++ b/toolchain/Makefile
@@ -53,17 +53,11 @@ else
$(LIBC)-fixup: gcc-install
endif
-$(STAGING_HOST_DIR):
- @mkdir -p $(STAGING_HOST_DIR)/lib
- @mkdir -p $(STAGING_HOST_DIR)/include
- @mkdir -p $(STAGING_HOST_DIR)/$(GNU_TARGET_NAME)
- @ln -sf ../lib $(STAGING_HOST_DIR)/$(GNU_TARGET_NAME)/lib
-
%-download:
$(TRACE) toolchain/$(patsubst %-download,%,$@)/download
$(MAKE) -C $(patsubst %-download,%,$@) fetch
-%-prepare: $(STAGING_HOST_DIR)
+%-prepare:
$(TRACE) toolchain/$(patsubst %-prepare,%,$@)/prepare
@if test x"$(patsubst %-prepare,%,$@)" = x"$(LIBC)"; then \
$(MAKE) -C $(patsubst %-prepare,%,$@) prepare \
diff --git a/toolchain/binutils/Makefile b/toolchain/binutils/Makefile
index fc256c578..6a01f1c9a 100644
--- a/toolchain/binutils/Makefile
+++ b/toolchain/binutils/Makefile
@@ -34,7 +34,7 @@ $(WRKBUILD)/.headers:
$(WRKBUILD)/.configured:
(cd $(WRKBUILD); \
$(WRKBUILD)/configure \
- --prefix=$(STAGING_HOST_DIR) \
+ --prefix=$(TOOLCHAIN_DIR)/usr \
--target=$(GNU_TARGET_NAME) \
--with-sysroot=$(STAGING_TARGET_DIR) \
--disable-dependency-tracking \
diff --git a/toolchain/gcc/Makefile b/toolchain/gcc/Makefile
index 475c90662..98e150f7a 100644
--- a/toolchain/gcc/Makefile
+++ b/toolchain/gcc/Makefile
@@ -8,14 +8,14 @@ TARGET_CFLAGS:= $(filter-out -fstack-protector,$(TARGET_CFLAGS))
include Makefile.inc
-GCC_CONFOPTS:= --prefix=$(STAGING_HOST_DIR) \
+GCC_CONFOPTS:= --prefix=$(TOOLCHAIN_DIR)/usr \
--with-bugurl="http://www.openadk.org/" \
--build=$(GNU_HOST_NAME) \
--host=$(GNU_HOST_NAME) \
--target=$(GNU_TARGET_NAME) \
- --with-gmp=$(STAGING_HOST_DIR) \
- --with-mpfr=$(STAGING_HOST_DIR) \
- --with-libelf=$(STAGING_HOST_DIR) \
+ --with-gmp=$(STAGING_HOST_DIR)/usr \
+ --with-mpfr=$(STAGING_HOST_DIR)/usr \
+ --with-libelf=$(STAGING_HOST_DIR)/usr \
--disable-__cxa_atexit \
--with-gnu-ld \
--with-gnu-as \
@@ -120,15 +120,17 @@ GCC_BUILD_DIR_FINAL:= $(WRKBUILD)-final
$(GCC_BUILD_DIR_MINIMAL)/.configured:
mkdir -p $(GCC_BUILD_DIR_MINIMAL)
# these symlinks are very important, do not remove
- rm -rf $(STAGING_HOST_DIR)/$(GNU_TARGET_NAME)/sys-include
- ln -sf ${STAGING_TARGET_DIR}/usr/include $(STAGING_HOST_DIR)/$(GNU_TARGET_NAME)/sys-include
- rm -rf ${STAGING_HOST_DIR}/$(GNU_TARGET_NAME)/lib
- ln -sf ${STAGING_TARGET_DIR}/lib $(STAGING_HOST_DIR)/$(GNU_TARGET_NAME)/lib
+ rm -rf $(TOOLCHAIN_DIR)/$(GNU_TARGET_NAME)/sys-include
+ ln -sf ${STAGING_TARGET_DIR}/usr/include \
+ $(TOOLCHAIN_DIR)/usr/$(GNU_TARGET_NAME)/sys-include
+ rm -rf ${TOOLCHAIN_DIR}/usr/$(GNU_TARGET_NAME)/lib
+ ln -sf ${STAGING_TARGET_DIR}/lib $(TOOLCHAIN_DIR)/usr/$(GNU_TARGET_NAME)/lib
ifeq ($(ADK_LINUX_SH),y)
(cd ${STAGING_TARGET_DIR}/ && ln -sf . m4 && ln -sf . m4-nofpu)
endif
- sed -i '/k prot/agcc_cv_libc_provides_ssp=yes' $(WRKBUILD)/gcc/configure
- cd $(GCC_BUILD_DIR_MINIMAL); PATH='$(TARGET_PATH)' \
+ $(SED) '/k prot/agcc_cv_libc_provides_ssp=yes' $(WRKBUILD)/gcc/configure
+ cd $(GCC_BUILD_DIR_MINIMAL); \
+ PATH='$(TARGET_PATH)' \
CFLAGS="-O0 -g0" \
CXXFLAGS="-O0 -g0" \
$(WRKBUILD)/configure \
@@ -151,7 +153,8 @@ $(WRKBUILD)/.headers: $(GCC_BUILD_DIR_MINIMAL)/.compiled
$(GCC_BUILD_DIR_INITIAL)/.configured:
mkdir -p $(GCC_BUILD_DIR_INITIAL)
- cd $(GCC_BUILD_DIR_INITIAL); PATH='$(TARGET_PATH)' \
+ cd $(GCC_BUILD_DIR_INITIAL); \
+ PATH='$(TARGET_PATH)' \
CFLAGS="-O0 -g0" \
CXXFLAGS="-O0 -g0" \
$(WRKBUILD)/configure \
@@ -174,7 +177,8 @@ $(WRKBUILD)/.configured: $(GCC_BUILD_DIR_INITIAL)/.compiled
$(GCC_BUILD_DIR_FINAL)/.configured:
mkdir -p $(GCC_BUILD_DIR_FINAL)
- cd $(GCC_BUILD_DIR_FINAL); PATH='$(TARGET_PATH)' \
+ cd $(GCC_BUILD_DIR_FINAL); \
+ PATH='$(TARGET_PATH)' \
$(WRKBUILD)/configure \
${GCC_CONFOPTS} \
${GCC_FINAL_CONFOPTS} \
@@ -192,19 +196,12 @@ $(WRKBUILD)/.installed: $(WRKBUILD)/.compiled
PATH='$(TARGET_PATH)' $(MAKE) -C $(GCC_BUILD_DIR_FINAL) install
# remove duplicate tools, convert hardlinks to symlinks
set -e; \
- cd $(STAGING_HOST_DIR)/$(GNU_TARGET_NAME)/bin; \
+ cd $(TOOLCHAIN_DIR)/usr/$(GNU_TARGET_NAME)/bin; \
for app in ar as c++ g++ gcc ld ld.bfd nm objcopy objdump ranlib strip; do \
ln -sf ../../bin/$(GNU_TARGET_NAME)-$${app} $${app}; \
done;
- (cd $(STAGING_HOST_DIR)/bin && \
+ (cd $(TOOLCHAIN_DIR)/usr/bin && \
ln -sf $(GNU_TARGET_NAME)-gcc $(GNU_TARGET_NAME)-gcc-${PKG_VERSION})
- # setup symlink, so that gcc/g++ find cc1plus
- (cd $(STAGING_HOST_DIR)/$(GNU_TARGET_NAME)/ && \
- ln -sf ../libexec .)
- # setup symlink, so that gcc/g++ find stddef.h
- (cd $(STAGING_HOST_DIR)/$(GNU_TARGET_NAME)/lib/ && \
- ln -sf ../../host_${CPU_ARCH}_${ADK_TARGET_LIBC}_${ADK_TARGET_SUFFIX}/lib/gcc .)
- # fix linking g++ apps with libtool
@-test -d $(STAGING_TARGET_DIR)/lib32 && \
cd $(STAGING_TARGET_DIR)/lib32 && \
ln -sf libstdc++.so.6.0.18 libstdc++.so && \
@@ -218,7 +215,7 @@ $(WRKBUILD)/.installed: $(WRKBUILD)/.compiled
ln -sf libstdc++.so.6.0.18 libstdc++.so && \
ln -sf libstdc++.so.6.0.18 libstdc++.so.6
# cleanup unneeded docs
- rm -rf $(STAGING_HOST_DIR)/share
+ rm -rf $(TOOLCHAIN_DIR)/usr/share
touch $@
include ${TOPDIR}/mk/toolchain.mk
diff --git a/toolchain/glibc/Makefile b/toolchain/glibc/Makefile
index 4af17c3d7..996f9dd87 100644
--- a/toolchain/glibc/Makefile
+++ b/toolchain/glibc/Makefile
@@ -76,7 +76,7 @@ $(WRKBUILD)/.fixup:
ifeq ($(ADK_TOOLCHAIN),y)
# strip target libs and host tools for toolchain builds
PATH="$(TARGET_PATH)" debug='0' prefix='${TARGET_CROSS}' ${BASH} ${SCRIPT_DIR}/rstrip.sh $(STAGING_TARGET_DIR)
- debug='0' prefix=' ' ${BASH} ${SCRIPT_DIR}/rstrip.sh $(STAGING_HOST_DIR)/bin $(STAGING_HOST_DIR)/$(GNU_TARGET_NAME)/
+ debug='0' prefix=' ' ${BASH} ${SCRIPT_DIR}/rstrip.sh $(TOOLCHAIN_DIR)/usr
endif
touch $@
diff --git a/toolchain/gmp/Makefile b/toolchain/gmp/Makefile
index 692216b97..3e6e6c626 100644
--- a/toolchain/gmp/Makefile
+++ b/toolchain/gmp/Makefile
@@ -15,9 +15,10 @@ $(WRKBUILD)/.configured:
ifneq ($(OStype),Darwin)
(cd $(WRKBUILD); cp configfsf.guess config.guess)
endif
- (cd $(WRKBUILD); PATH="$(STAGING_HOST_DIR)/usr/bin:$$PATH" \
+ (cd $(WRKBUILD); \
+ PATH="$(STAGING_HOST_DIR)/usr/bin:$$PATH" \
./configure \
- --prefix=$(STAGING_HOST_DIR) \
+ --prefix=$(STAGING_HOST_DIR)/usr \
--with-pic \
--disable-shared \
--enable-static \
diff --git a/toolchain/libelf/Makefile b/toolchain/libelf/Makefile
index c243cdd00..90bf4cb8d 100644
--- a/toolchain/libelf/Makefile
+++ b/toolchain/libelf/Makefile
@@ -14,7 +14,7 @@ $(WRKBUILD)/.headers:
$(WRKBUILD)/.configured:
(cd $(WRKBUILD); \
$(WRKBUILD)/configure \
- --prefix=$(STAGING_HOST_DIR) \
+ --prefix=$(STAGING_HOST_DIR)/usr \
--disable-nls \
--disable-shared \
--enable-static \
diff --git a/toolchain/mpc/Makefile b/toolchain/mpc/Makefile
index 81f5b151d..40e7f615e 100644
--- a/toolchain/mpc/Makefile
+++ b/toolchain/mpc/Makefile
@@ -14,8 +14,8 @@ $(WRKBUILD)/.headers:
$(WRKBUILD)/.configured:
(cd $(WRKBUILD); \
$(WRKBUILD)/configure \
- --prefix=$(STAGING_HOST_DIR) \
- --with-gmp=$(STAGING_HOST_DIR) \
+ --prefix=$(STAGING_HOST_DIR)/usr \
+ --with-gmp=$(STAGING_HOST_DIR)/usr \
--disable-shared \
--enable-static \
);
diff --git a/toolchain/mpfr/Makefile b/toolchain/mpfr/Makefile
index 019d14d77..954040b85 100644
--- a/toolchain/mpfr/Makefile
+++ b/toolchain/mpfr/Makefile
@@ -15,7 +15,7 @@ $(WRKBUILD)/.headers:
$(WRKBUILD)/.configured:
(cd $(WRKBUILD); \
$(WRKBUILD)/configure \
- --prefix=$(STAGING_HOST_DIR) \
+ --prefix=$(STAGING_HOST_DIR)/usr \
--with-gmp-build=$(GMP_BUILD_DIR) \
--disable-shared \
--enable-static \