summaryrefslogtreecommitdiff
path: root/toolchain/gcc/gcc-uclibc-4.x.mk
diff options
context:
space:
mode:
Diffstat (limited to 'toolchain/gcc/gcc-uclibc-4.x.mk')
-rw-r--r--toolchain/gcc/gcc-uclibc-4.x.mk81
1 files changed, 32 insertions, 49 deletions
diff --git a/toolchain/gcc/gcc-uclibc-4.x.mk b/toolchain/gcc/gcc-uclibc-4.x.mk
index 9e7127dc1..0d6f2aec6 100644
--- a/toolchain/gcc/gcc-uclibc-4.x.mk
+++ b/toolchain/gcc/gcc-uclibc-4.x.mk
@@ -53,9 +53,6 @@ else
GCC_OPTSPACE=--enable-target-optspace
endif
-GCC_TARGET_PREREQ=
-GCC_STAGING_PREREQ=
-
#############################################################
#
# Setup some initial stuff
@@ -106,25 +103,28 @@ ifeq ($(BR2_INSTALL_OBJC),y)
GCC_TARGET_LANGUAGES:=$(GCC_TARGET_LANGUAGES),objc
endif
+ifeq ($(BR2_INSTALL_FORTRAN),y)
+GCC_TARGET_LANGUAGES:=$(GCC_TARGET_LANGUAGES),fortran
+endif
+
GCC_WITH_HOST_GMP = --with-gmp=$(HOST_DIR)/usr
GCC_WITH_HOST_MPFR = --with-mpfr=$(HOST_DIR)/usr
HOST_SOURCE += host-gmp-source host-mpfr-source
+GCC_HOST_PREREQ = host-gmp host-mpfr
ifeq ($(findstring x4.5.,x$(GCC_VERSION)),x4.5.)
GCC_WITH_HOST_MPC = --with-mpc=$(HOST_DIR)/usr
HOST_SOURCE += host-mpc-source
+GCC_HOST_PREREQ += host-mpc
endif
-ifeq ($(BR2_INSTALL_FORTRAN),y)
-GCC_TARGET_LANGUAGES:=$(GCC_TARGET_LANGUAGES),fortran
-#GCC_TARGET_PREREQ+=$(TARGET_DIR)/usr/lib/libmpfr.so $(TARGET_DIR)/usr/lib/libgmp.so
-#GCC_STAGING_PREREQ+=$(TOOLCHAIN_DIR)/mpfr/lib/libmpfr.so
+GCC_TARGET_PREREQ += mpfr gmp
GCC_WITH_TARGET_GMP = --with-gmp=$(STAGING_DIR)/usr
GCC_WITH_TARGET_MPFR = --with-mpfr=$(STAGING_DIR)/usr
ifeq ($(findstring x4.5.,x$(GCC_VERSION)),x4.5.)
+GCC_TARGET_PREREQ += mpc
GCC_WITH_TARGET_MPC = --with-mpc=$(STAGING_DIR)/usr
endif
-endif
ifeq ($(BR2_GCC_SHARED_LIBGCC),y)
GCC_SHARED_LIBGCC:=--enable-shared
@@ -203,17 +203,12 @@ endif
#############################################################
GCC_BUILD_DIR1:=$(TOOLCHAIN_DIR)/gcc-$(GCC_VERSION)-initial
-
-# The --without-headers option stopped working with gcc 3.0 and has never been
-# fixed, so we need to actually have working C library header files prior to
-# the step or libgcc will not build...
-
$(GCC_BUILD_DIR1)/.configured: $(GCC_DIR)/.patched
mkdir -p $(GCC_BUILD_DIR1)
(cd $(GCC_BUILD_DIR1); rm -rf config.cache; \
$(HOST_CONFIGURE_OPTS) \
$(GCC_DIR)/configure $(QUIET) \
- --prefix=$(STAGING_DIR)/usr \
+ --prefix=$(HOST_DIR)/usr \
--build=$(GNU_HOST_NAME) \
--host=$(GNU_HOST_NAME) \
--target=$(REAL_GNU_TARGET_NAME) \
@@ -243,7 +238,6 @@ $(GCC_BUILD_DIR1)/.configured: $(GCC_DIR)/.patched
touch $@
$(GCC_BUILD_DIR1)/.compiled: $(GCC_BUILD_DIR1)/.configured
- # gcc >= 4.3.0 have to also build all-target-libgcc
ifeq ($(BR2_GCC_SUPPORTS_FINEGRAINEDMTUNE),y)
$(GCC_CONF_ENV) $(MAKE) -C $(GCC_BUILD_DIR1) all-gcc
else
@@ -252,16 +246,11 @@ endif
touch $@
gcc_initial=$(GCC_BUILD_DIR1)/.installed
-$(gcc_initial) $(STAGING_DIR)/usr/bin/$(REAL_GNU_TARGET_NAME)-gcc: $(GCC_BUILD_DIR1)/.compiled
- # gcc >= 4.3.0 have to also install install-target-libgcc
-ifeq ($(BR2_GCC_SUPPORTS_FINEGRAINEDMTUNE),y)
+$(gcc_initial) $(HOST_DIR)/usr/bin/$(REAL_GNU_TARGET_NAME)-gcc: $(GCC_BUILD_DIR1)/.compiled
PATH=$(TARGET_PATH) $(MAKE) -C $(GCC_BUILD_DIR1) install-gcc
-else
- PATH=$(TARGET_PATH) $(MAKE) -C $(GCC_BUILD_DIR1) install-gcc
-endif
touch $(gcc_initial)
-gcc_initial: binutils $(STAGING_DIR)/usr/bin/$(REAL_GNU_TARGET_NAME)-gcc
+gcc_initial: $(GCC_HOST_PREREQ) host-binutils $(HOST_DIR)/usr/bin/$(REAL_GNU_TARGET_NAME)-gcc
gcc_initial-clean:
rm -rf $(GCC_BUILD_DIR1)
@@ -276,22 +265,16 @@ gcc_initial-dirclean:
#############################################################
GCC_BUILD_DIR2:=$(TOOLCHAIN_DIR)/gcc-$(GCC_VERSION)-intermediate
-
# The --without-headers option stopped working with gcc 3.0 and has never been
# fixed, so we need to actually have working C library header files prior to
# the step or libgcc will not build...
$(GCC_BUILD_DIR2)/.configured: $(GCC_DIR)/.patched
mkdir -p $(GCC_BUILD_DIR2)
- -rmdir $(STAGING_DIR)/usr/$(REAL_GNU_TARGET_NAME)/lib
- mkdir -p $(STAGING_DIR)/lib
- ln -snf ../../lib $(STAGING_DIR)/usr/$(REAL_GNU_TARGET_NAME)/lib
- $(if $(BR2_ARCH_IS_64),mkdir -p $(STAGING_DIR)/lib64)
- $(if $(BR2_ARCH_IS_64),ln -snf ../../lib64 $(STAGING_DIR)/usr/$(REAL_GNU_TARGET_NAME)/lib64)
(cd $(GCC_BUILD_DIR2); rm -rf config.cache; \
$(HOST_CONFIGURE_OPTS) \
$(GCC_DIR)/configure $(QUIET) \
- --prefix=$(STAGING_DIR)/usr \
+ --prefix=$(HOST_DIR)/usr \
--build=$(GNU_HOST_NAME) \
--host=$(GNU_HOST_NAME) \
--target=$(REAL_GNU_TARGET_NAME) \
@@ -338,7 +321,7 @@ else
endif
touch $(gcc_intermediate)
-gcc_intermediate: uclibc-configured $(STAGING_DIR)/usr/bin/$(REAL_GNU_TARGET_NAME)-gcc
+gcc_intermediate: uclibc-configured $(HOST_DIR)/usr/bin/$(REAL_GNU_TARGET_NAME)-gcc
gcc_intermediate-clean:
rm -rf $(GCC_BUILD_DIR2)
@@ -363,11 +346,11 @@ GCC_BUILD_DIR3:=$(TOOLCHAIN_DIR)/gcc-$(GCC_VERSION)-final
$(GCC_BUILD_DIR3)/.configured: $(GCC_SRC_DIR)/.patched $(GCC_STAGING_PREREQ)
mkdir -p $(GCC_BUILD_DIR3)
# Important! Required for limits.h to be fixed.
- ln -snf ../include/ $(STAGING_DIR)/usr/$(REAL_GNU_TARGET_NAME)/sys-include
+ ln -snf ../include/ $(HOST_DIR)/usr/$(REAL_GNU_TARGET_NAME)/sys-include
(cd $(GCC_BUILD_DIR3); rm -rf config.cache; \
$(HOST_CONFIGURE_OPTS) \
$(GCC_SRC_DIR)/configure $(QUIET) \
- --prefix=$(STAGING_DIR)/usr \
+ --prefix=$(HOST_DIR)/usr \
--build=$(GNU_HOST_NAME) \
--host=$(GNU_HOST_NAME) \
--target=$(REAL_GNU_TARGET_NAME) \
@@ -412,19 +395,19 @@ $(GCC_BUILD_DIR3)/.installed: $(GCC_BUILD_DIR3)/.compiled
fi
# Strip the host binaries
ifeq ($(GCC_STRIP_HOST_BINARIES),true)
- strip --strip-all -R .note -R .comment $(filter-out %-gccbug %-embedspu,$(wildcard $(STAGING_DIR)/usr/bin/$(REAL_GNU_TARGET_NAME)-*))
+ strip --strip-all -R .note -R .comment $(filter-out %-gccbug %-embedspu,$(wildcard $(HOST_DIR)/usr/bin/$(REAL_GNU_TARGET_NAME)-*))
endif
# Make sure we have 'cc'.
- if [ ! -e $(STAGING_DIR)/usr/bin/$(REAL_GNU_TARGET_NAME)-cc ]; then \
+ if [ ! -e $(HOST_DIR)/usr/bin/$(REAL_GNU_TARGET_NAME)-cc ]; then \
ln -snf $(REAL_GNU_TARGET_NAME)-gcc \
- $(STAGING_DIR)/usr/bin/$(REAL_GNU_TARGET_NAME)-cc; \
+ $(HOST_DIR)/usr/bin/$(REAL_GNU_TARGET_NAME)-cc; \
fi
- if [ ! -e $(STAGING_DIR)/usr/$(REAL_GNU_TARGET_NAME)/bin/cc ]; then \
- ln -snf gcc $(STAGING_DIR)/usr/$(REAL_GNU_TARGET_NAME)/bin/cc; \
+ if [ ! -e $(HOST_DIR)/usr/$(REAL_GNU_TARGET_NAME)/bin/cc ]; then \
+ ln -snf gcc $(HOST_DIR)/usr/$(REAL_GNU_TARGET_NAME)/bin/cc; \
fi
# Set up the symlinks to enable lying about target name.
set -e; \
- (cd $(STAGING_DIR)/usr; \
+ (cd $(HOST_DIR)/usr; \
ln -snf $(REAL_GNU_TARGET_NAME) $(GNU_TARGET_NAME); \
cd bin; \
for app in $(REAL_GNU_TARGET_NAME)-*; do \
@@ -438,31 +421,31 @@ endif
$(STAMP_DIR)/gcc_libs_target_installed: $(GCC_BUILD_DIR3)/.installed
ifeq ($(BR2_GCC_SHARED_LIBGCC),y)
- # These are in /lib, so...
+ # These go in /lib, so...
rm -rf $(TARGET_DIR)/usr/lib/libgcc_s*.so*
- -cp -dpf $(STAGING_DIR)/usr/$(REAL_GNU_TARGET_NAME)/lib*/libgcc_s* \
+ -cp -dpf $(HOST_DIR)/usr/$(REAL_GNU_TARGET_NAME)/lib*/libgcc_s* \
$(TARGET_DIR)/lib/
-$(STRIPCMD) $(STRIP_STRIP_UNNEEDED) $(TARGET_DIR)/lib/libgcc_s*
endif
ifeq ($(BR2_INSTALL_LIBSTDCPP),y)
ifeq ($(BR2_GCC_SHARED_LIBGCC),y)
mkdir -p $(TARGET_DIR)/usr/lib
- -cp -dpf $(STAGING_DIR)/usr/$(REAL_GNU_TARGET_NAME)/lib*/libstdc++.so* \
+ -cp -dpf $(HOST_DIR)/usr/$(REAL_GNU_TARGET_NAME)/lib*/libstdc++.so* \
$(TARGET_DIR)/usr/lib/
-$(STRIPCMD) $(STRIP_STRIP_UNNEEDED) $(TARGET_DIR)/usr/lib/libstdc++.so*
endif
endif
ifeq ($(BR2_INSTALL_LIBGCJ),y)
- cp -dpf $(STAGING_DIR)/usr/$(REAL_GNU_TARGET_NAME)/lib*/libgcj.so* $(TARGET_DIR)/usr/lib/
+ cp -dpf $(HOST_DIR)/usr/$(REAL_GNU_TARGET_NAME)/lib*/libgcj.so* $(TARGET_DIR)/usr/lib/
mkdir -p $(TARGET_DIR)/usr/lib/security
- cp -dpf $(STAGING_DIR)/usr/lib/security/classpath.security \
+ cp -dpf $(HOST_DIR)/usr/lib/security/classpath.security \
$(TARGET_DIR)/usr/lib/security/
-$(STRIPCMD) $(STRIP_STRIP_UNNEEDED) $(TARGET_DIR)/usr/lib/libgcj.so*
endif
mkdir -p $(@D)
touch $@
-cross_compiler:=$(STAGING_DIR)/usr/bin/$(REAL_GNU_TARGET_NAME)-gcc
+cross_compiler:=$(HOST_DIR)/usr/bin/$(REAL_GNU_TARGET_NAME)-gcc
cross_compiler gcc: gcc_intermediate \
$(LIBFLOAT_TARGET) uclibc $(GCC_BUILD_DIR3)/.installed \
$(STAMP_DIR)/gcc_libs_target_installed \
@@ -473,8 +456,8 @@ gcc-source: $(DL_DIR)/$(GCC_SOURCE)
gcc-clean:
rm -rf $(GCC_BUILD_DIR3)
for prog in cpp gcc gcc-[0-9]* protoize unprotoize gcov gccbug cc; do \
- rm -f $(STAGING_DIR)/usr/bin/$(REAL_GNU_TARGET_NAME)-$$prog; \
- rm -f $(STAGING_DIR)/usr/bin/$(GNU_TARGET_NAME)-$$prog; \
+ rm -f $(HOST_DIR)/usr/bin/$(REAL_GNU_TARGET_NAME)-$$prog; \
+ rm -f $(HOST_DIR)/usr/bin/$(GNU_TARGET_NAME)-$$prog; \
done
gcc-dirclean: gcc_initial-dirclean
@@ -487,7 +470,7 @@ gcc-dirclean: gcc_initial-dirclean
#############################################################
GCC_BUILD_DIR4:=$(BUILD_DIR)/gcc-$(GCC_VERSION)-target
-$(GCC_BUILD_DIR4)/.prepared: $(STAMP_DIR)/gcc_libs_target_installed $(GCC_TARGET_PREREQ)
+$(GCC_BUILD_DIR4)/.prepared: $(STAMP_DIR)/gcc_libs_target_installed
mkdir -p $(GCC_BUILD_DIR4)
touch $@
@@ -556,7 +539,7 @@ $(TARGET_DIR)/usr/bin/gcc: $(GCC_BUILD_DIR4)/.compiled
# Work around problem of missing syslimits.h
if [ ! -f $(TARGET_DIR)/usr/$(GCC_LIB_SUBDIR)/$(GCC_INCLUDE_DIR)/syslimits.h ]; then \
echo "warning: working around missing syslimits.h"; \
- cp -f $(STAGING_DIR)/$(GCC_LIB_SUBDIR)/$(GCC_INCLUDE_DIR)/syslimits.h \
+ cp -f $(HOST_DIR)/$(GCC_LIB_SUBDIR)/$(GCC_INCLUDE_DIR)/syslimits.h \
$(TARGET_DIR)/usr/$(GCC_LIB_SUBDIR)/$(GCC_INCLUDE_DIR)/; \
fi
# Make sure we have 'cc'.
@@ -567,7 +550,7 @@ $(TARGET_DIR)/usr/bin/gcc: $(GCC_BUILD_DIR4)/.compiled
#rm -rf $(TARGET_DIR)/usr/lib/libgcc_s*.so*
touch -c $@
-gcc_target: uclibc_target binutils_target $(TARGET_DIR)/usr/bin/gcc
+gcc_target: uclibc_target $(GCC_TARGET_PREREQ) binutils $(TARGET_DIR)/usr/bin/gcc
gcc_target-clean:
rm -rf $(GCC_BUILD_DIR4)