2007-06-20 13:26:36 +02:00
|
|
|
# Makefile for to build a gcc/uClibc toolchain
|
|
|
|
#
|
|
|
|
# Copyright (C) 2002-2003 Erik Andersen <andersen@uclibc.org>
|
|
|
|
# Copyright (C) 2004 Manuel Novoa III <mjn3@uclibc.org>
|
|
|
|
#
|
|
|
|
# This program is free software; you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
# the Free Software Foundation; either version 2 of the License, or
|
|
|
|
# (at your option) any later version.
|
|
|
|
#
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
# General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program; if not, write to the Free Software
|
|
|
|
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
|
2009-12-14 12:15:36 +01:00
|
|
|
ifneq ($(GCC_SNAP_DATE),)
|
|
|
|
GCC_SITE:=ftp://sources.redhat.com/pub/gcc/snapshots/$(GCC_VERSION)
|
|
|
|
else ifeq ($(findstring avr32,$(GCC_VERSION)),avr32)
|
|
|
|
GCC_SITE:=ftp://www.at91.com/pub/buildroot/
|
2007-06-20 13:26:36 +02:00
|
|
|
else
|
2009-12-14 12:15:36 +01:00
|
|
|
GCC_SITE:=$(BR2_GNU_MIRROR)/gcc/gcc-$(GCC_VERSION)
|
2007-06-20 13:26:36 +02:00
|
|
|
endif
|
|
|
|
|
2009-07-24 02:32:33 +02:00
|
|
|
ifneq ($(filter xtensa%,$(ARCH)),)
|
|
|
|
include target/xtensa/patch.in
|
|
|
|
GCC_PATCH_EXTRA:=$(call XTENSA_PATCH,gcc,$(GCC_PATCH_DIR),. ..)
|
|
|
|
endif
|
|
|
|
|
2009-12-14 12:04:11 +01:00
|
|
|
GCC_SOURCE:=gcc-$(GCC_VERSION).tar.bz2
|
|
|
|
GCC_PATCH_DIR:=toolchain/gcc/$(GCC_VERSION)
|
|
|
|
GCC_DIR:=$(TOOLCHAIN_DIR)/gcc-$(GCC_VERSION)
|
2007-06-20 13:26:36 +02:00
|
|
|
GCC_CAT:=$(BZCAT)
|
2007-09-19 20:46:45 +02:00
|
|
|
GCC_STRIP_HOST_BINARIES:=nope
|
2007-10-01 23:06:50 +02:00
|
|
|
GCC_SRC_DIR:=$(GCC_DIR)
|
2007-06-20 13:26:36 +02:00
|
|
|
|
2009-12-02 20:36:43 +01:00
|
|
|
# Branding works on >= 4.3
|
2009-12-15 12:03:05 +01:00
|
|
|
ifneq ($(findstring x4.2.,x$(GCC_VERSION)),x4.2.)
|
2009-12-02 20:36:43 +01:00
|
|
|
BUILDROOT_VERSION_STRING=$(call qstrip,$(BR2_VERSION))
|
|
|
|
EXTRA_GCC_CONFIG_OPTIONS+=--with-pkgversion="Buildroot $(BUILDROOT_VERSION_STRING)" \
|
|
|
|
--with-bugurl="http://bugs.buildroot.net/"
|
|
|
|
endif
|
|
|
|
|
2007-10-01 14:56:24 +02:00
|
|
|
GCC_TARGET_PREREQ=
|
|
|
|
GCC_STAGING_PREREQ=
|
|
|
|
|
2007-06-20 13:26:36 +02:00
|
|
|
#############################################################
|
|
|
|
#
|
|
|
|
# Setup some initial stuff
|
|
|
|
#
|
|
|
|
#############################################################
|
|
|
|
|
2007-10-01 14:56:24 +02:00
|
|
|
GCC_STAGING_PREREQ+=$(STAGING_DIR)/usr/lib/libc.a
|
2007-07-08 14:50:06 +02:00
|
|
|
|
2007-06-20 13:26:36 +02:00
|
|
|
GCC_TARGET_LANGUAGES:=c
|
|
|
|
|
2007-07-31 17:07:06 +02:00
|
|
|
GCC_CROSS_LANGUAGES:=c
|
|
|
|
ifeq ($(BR2_GCC_CROSS_CXX),y)
|
|
|
|
GCC_CROSS_LANGUAGES:=$(GCC_CROSS_LANGUAGES),c++
|
|
|
|
endif
|
|
|
|
ifeq ($(BR2_GCC_CROSS_FORTRAN),y)
|
|
|
|
GCC_CROSS_LANGUAGES:=$(GCC_CROSS_LANGUAGES),fortran
|
|
|
|
endif
|
2009-04-27 16:07:36 +02:00
|
|
|
ifeq ($(BR2_GCC_CROSS_JAVA),y)
|
|
|
|
GCC_CROSS_LANGUAGES:=$(GCC_CROSS_LANGUAGES),java
|
|
|
|
endif
|
2007-07-31 17:07:06 +02:00
|
|
|
ifeq ($(BR2_GCC_CROSS_OBJC),y)
|
|
|
|
GCC_CROSS_LANGUAGES:=$(GCC_CROSS_LANGUAGES),objc
|
|
|
|
endif
|
|
|
|
|
2007-08-28 23:42:44 +02:00
|
|
|
GCC_COMMON_PREREQ=$(wildcard $(BR2_DEPENDS_DIR)/br2/install/libstdcpp*)\
|
2007-07-31 17:07:06 +02:00
|
|
|
$(wildcard $(BR2_DEPENDS_DIR)/br2/install/libgcj*)\
|
|
|
|
$(wildcard $(BR2_DEPENDS_DIR)/br2/install/objc*)\
|
|
|
|
$(wildcard $(BR2_DEPENDS_DIR)/br2/install/fortran*)\
|
|
|
|
$(wildcard $(BR2_DEPENDS_DIR)/br2/prefer/ima*)\
|
|
|
|
$(wildcard $(BR2_DEPENDS_DIR)/br2/toolchain/sysroot*)\
|
|
|
|
$(wildcard $(BR2_DEPENDS_DIR)/br2/use/sjlj/exceptions*)\
|
|
|
|
$(wildcard $(BR2_DEPENDS_DIR)/br2/gcc/shared/libgcc*)
|
2007-08-28 23:42:44 +02:00
|
|
|
GCC_TARGET_PREREQ+=$(GCC_COMMON_PREREQ) \
|
2007-07-31 17:07:06 +02:00
|
|
|
$(wildcard $(BR2_DEPENDS_DIR)/br2/extra/target/gcc/config/options*)
|
2007-08-28 23:42:44 +02:00
|
|
|
GCC_STAGING_PREREQ+=$(GCC_COMMON_PREREQ) \
|
2007-07-31 17:07:06 +02:00
|
|
|
$(wildcard $(BR2_DEPENDS_DIR)/br2/extra/gcc/config/options*)\
|
|
|
|
$(wildcard $(BR2_DEPENDS_DIR)/br2/gcc/cross/*)
|
2007-07-08 14:50:06 +02:00
|
|
|
|
2007-06-20 13:26:36 +02:00
|
|
|
ifeq ($(BR2_INSTALL_LIBSTDCPP),y)
|
|
|
|
GCC_TARGET_LANGUAGES:=$(GCC_TARGET_LANGUAGES),c++
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(BR2_INSTALL_LIBGCJ),y)
|
|
|
|
GCC_TARGET_LANGUAGES:=$(GCC_TARGET_LANGUAGES),java
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(BR2_INSTALL_OBJC),y)
|
|
|
|
GCC_TARGET_LANGUAGES:=$(GCC_TARGET_LANGUAGES),objc
|
|
|
|
endif
|
|
|
|
|
|
|
|
GCC_WITH_HOST_GMP=--with-gmp=$(GMP_HOST_DIR)
|
|
|
|
GCC_WITH_HOST_MPFR=--with-mpfr=$(MPFR_HOST_DIR)
|
2010-02-25 17:27:50 +01:00
|
|
|
HOST_SOURCE += host-libgmp-source host-libmpfr-source
|
2007-06-20 13:26:36 +02:00
|
|
|
|
|
|
|
ifeq ($(BR2_INSTALL_FORTRAN),y)
|
|
|
|
GCC_TARGET_LANGUAGES:=$(GCC_TARGET_LANGUAGES),fortran
|
2007-08-28 23:42:44 +02:00
|
|
|
#GCC_TARGET_PREREQ+=$(TARGET_DIR)/usr/lib/libmpfr.so $(TARGET_DIR)/usr/lib/libgmp.so
|
2009-09-23 01:30:00 +02:00
|
|
|
#GCC_STAGING_PREREQ+=$(TOOLCHAIN_DIR)/mpfr/lib/libmpfr.so
|
2007-06-20 13:26:36 +02:00
|
|
|
GCC_WITH_TARGET_GMP=--with-gmp="$(GMP_TARGET_DIR)"
|
|
|
|
GCC_WITH_TARGET_MPFR=--with-mpfr="$(MPFR_TARGET_DIR)"
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(BR2_GCC_SHARED_LIBGCC),y)
|
|
|
|
GCC_SHARED_LIBGCC:=--enable-shared
|
|
|
|
else
|
|
|
|
GCC_SHARED_LIBGCC:=--disable-shared
|
|
|
|
endif
|
|
|
|
|
2009-09-21 01:33:38 +02:00
|
|
|
ifeq ($(BR2_GCC_ENABLE_TLS),y)
|
|
|
|
GCC_TLS:=--enable-tls
|
|
|
|
else
|
|
|
|
GCC_TLS:=--disable-tls
|
|
|
|
endif
|
|
|
|
|
2008-06-21 21:47:17 +02:00
|
|
|
ifeq ($(BR2_GCC_SUPPORTS_FINEGRAINEDMTUNE),y)
|
|
|
|
GCC_DECIMAL_FLOAT:=--disable-decimal-float
|
|
|
|
endif
|
|
|
|
|
2009-01-19 10:18:46 +01:00
|
|
|
# gcc version < 4.2.0 don't have -Wno-overlength-strings and the configure
|
|
|
|
# script has problems detecting it, so help it
|
|
|
|
ifeq ($(shell test $(HOSTCC_VERSION) -lt 420 && echo OLD),OLD)
|
|
|
|
GCC_CONF_ENV:=acx_cv_prog_cc_pedantic__Wno_long_long__Wno_variadic_macros_____________Wno_overlength_strings=no \
|
|
|
|
acx_cv_prog_cc_warning__Wno_overlength_strings=no
|
|
|
|
endif
|
|
|
|
|
2007-10-20 20:09:53 +02:00
|
|
|
HOST_SOURCE+=gcc-source
|
|
|
|
|
2007-06-20 13:26:36 +02:00
|
|
|
$(DL_DIR)/$(GCC_SOURCE):
|
|
|
|
mkdir -p $(DL_DIR)
|
2009-01-16 12:47:05 +01:00
|
|
|
$(call DOWNLOAD,$(GCC_SITE),$(GCC_SOURCE))
|
2007-06-20 13:26:36 +02:00
|
|
|
|
2007-07-31 16:59:58 +02:00
|
|
|
gcc-unpacked: $(GCC_DIR)/.patched
|
2007-06-20 13:26:36 +02:00
|
|
|
$(GCC_DIR)/.unpacked: $(DL_DIR)/$(GCC_SOURCE)
|
2009-09-23 01:30:00 +02:00
|
|
|
mkdir -p $(TOOLCHAIN_DIR)
|
2007-06-20 13:26:36 +02:00
|
|
|
rm -rf $(GCC_DIR)
|
2009-09-23 01:30:00 +02:00
|
|
|
$(GCC_CAT) $(DL_DIR)/$(GCC_SOURCE) | tar -C $(TOOLCHAIN_DIR) $(TAR_OPTIONS) -
|
2008-06-18 17:46:48 +02:00
|
|
|
$(CONFIG_UPDATE) $(@D)
|
2007-06-20 13:26:36 +02:00
|
|
|
touch $@
|
|
|
|
|
|
|
|
gcc-patched: $(GCC_DIR)/.patched
|
|
|
|
$(GCC_DIR)/.patched: $(GCC_DIR)/.unpacked
|
|
|
|
# Apply any files named gcc-*.patch from the source directory to gcc
|
2009-12-14 12:15:36 +01:00
|
|
|
ifneq ($(wildcard $(GCC_PATCH_DIR)),)
|
2009-07-24 02:32:33 +02:00
|
|
|
toolchain/patch-kernel.sh $(GCC_DIR) $(GCC_PATCH_DIR) \*.patch $(GCC_PATCH_EXTRA)
|
2009-12-14 12:15:36 +01:00
|
|
|
endif
|
2007-06-20 13:26:36 +02:00
|
|
|
|
|
|
|
# Note: The soft float situation has improved considerably with gcc 3.4.x.
|
|
|
|
# We can dispense with the custom spec files, as well as libfloat for the arm case.
|
2007-08-22 14:35:41 +02:00
|
|
|
# However, we still need a patch for arm. There's a similar patch for gcc 3.3.x
|
2007-06-20 13:26:36 +02:00
|
|
|
# which needs to be integrated so we can kill of libfloat for good, except for
|
2007-08-22 14:35:41 +02:00
|
|
|
# anyone (?) who might still be using gcc 2.95. mjn3
|
2007-06-20 13:26:36 +02:00
|
|
|
ifeq ($(BR2_SOFT_FLOAT),y)
|
|
|
|
ifeq ("$(strip $(ARCH))","arm")
|
|
|
|
toolchain/patch-kernel.sh $(GCC_DIR) toolchain/gcc/$(GCC_VERSION) arm-softfloat.patch.conditional
|
|
|
|
endif
|
|
|
|
ifeq ("$(strip $(ARCH))","armeb")
|
|
|
|
toolchain/patch-kernel.sh $(GCC_DIR) toolchain/gcc/$(GCC_VERSION) arm-softfloat.patch.conditional
|
|
|
|
endif
|
2009-05-05 22:04:52 +02:00
|
|
|
endif
|
|
|
|
ifeq ($(ARCH)-$(BR2_GCC_SHARED_LIBGCC),powerpc-y)
|
2010-07-28 12:07:04 +02:00
|
|
|
ifneq ($(BR2_SOFT_FLOAT),)
|
2009-05-05 22:04:52 +02:00
|
|
|
toolchain/patch-kernel.sh $(GCC_DIR) toolchain/gcc/$(GCC_VERSION) powerpc-link-with-math-lib.patch.conditional
|
|
|
|
endif
|
2007-06-20 13:26:36 +02:00
|
|
|
endif
|
|
|
|
touch $@
|
|
|
|
|
|
|
|
#############################################################
|
|
|
|
#
|
|
|
|
# build the first pass gcc compiler
|
|
|
|
#
|
|
|
|
#############################################################
|
2009-09-23 01:30:00 +02:00
|
|
|
GCC_BUILD_DIR1:=$(TOOLCHAIN_DIR)/gcc-$(GCC_VERSION)-initial
|
2007-06-20 13:26:36 +02:00
|
|
|
|
|
|
|
|
|
|
|
# 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)
|
2007-08-22 11:56:41 +02:00
|
|
|
(cd $(GCC_BUILD_DIR1); rm -rf config.cache; \
|
2007-06-20 13:26:36 +02:00
|
|
|
$(HOST_CONFIGURE_OPTS) \
|
2009-10-01 21:24:42 +02:00
|
|
|
$(GCC_DIR)/configure $(QUIET) \
|
2007-06-20 13:26:36 +02:00
|
|
|
--prefix=$(STAGING_DIR)/usr \
|
|
|
|
--build=$(GNU_HOST_NAME) \
|
|
|
|
--host=$(GNU_HOST_NAME) \
|
|
|
|
--target=$(REAL_GNU_TARGET_NAME) \
|
|
|
|
--enable-languages=c \
|
|
|
|
$(BR2_CONFIGURE_DEVEL_SYSROOT) \
|
|
|
|
--disable-__cxa_atexit \
|
|
|
|
--enable-target-optspace \
|
|
|
|
--with-gnu-ld \
|
|
|
|
--disable-shared \
|
2009-04-22 09:27:17 +02:00
|
|
|
--disable-libssp \
|
2010-07-28 09:11:37 +02:00
|
|
|
--without-headers \
|
|
|
|
--with-newlib \
|
2010-07-30 09:31:39 +02:00
|
|
|
--disable-multilib \
|
2009-09-21 01:33:38 +02:00
|
|
|
$(GCC_TLS) \
|
2007-06-20 13:26:36 +02:00
|
|
|
$(GCC_WITH_HOST_GMP) \
|
|
|
|
$(GCC_WITH_HOST_MPFR) \
|
|
|
|
$(DISABLE_NLS) \
|
|
|
|
$(THREADS) \
|
2008-06-21 21:47:17 +02:00
|
|
|
$(GCC_DECIMAL_FLOAT) \
|
2007-06-20 13:26:36 +02:00
|
|
|
$(SOFT_FLOAT_CONFIG_OPTION) \
|
2007-07-08 18:27:25 +02:00
|
|
|
$(GCC_WITH_ABI) $(GCC_WITH_ARCH) $(GCC_WITH_TUNE) \
|
2007-10-01 14:56:24 +02:00
|
|
|
$(EXTRA_GCC_CONFIG_OPTIONS) \
|
|
|
|
$(EXTRA_GCC1_CONFIG_OPTIONS) \
|
2008-10-26 10:14:02 +01:00
|
|
|
$(QUIET) \
|
2007-10-01 14:56:24 +02:00
|
|
|
)
|
2007-06-20 13:26:36 +02:00
|
|
|
touch $@
|
|
|
|
|
|
|
|
$(GCC_BUILD_DIR1)/.compiled: $(GCC_BUILD_DIR1)/.configured
|
2008-06-19 21:06:04 +02:00
|
|
|
# gcc >= 4.3.0 have to also build all-target-libgcc
|
|
|
|
ifeq ($(BR2_GCC_SUPPORTS_FINEGRAINEDMTUNE),y)
|
2010-07-28 09:11:37 +02:00
|
|
|
$(GCC_CONF_ENV) $(MAKE) -C $(GCC_BUILD_DIR1) all-gcc
|
2008-06-19 21:06:04 +02:00
|
|
|
else
|
2007-06-20 13:26:36 +02:00
|
|
|
$(MAKE) -C $(GCC_BUILD_DIR1) all-gcc
|
2008-06-19 21:06:04 +02:00
|
|
|
endif
|
2007-06-20 13:26:36 +02:00
|
|
|
touch $@
|
|
|
|
|
2007-09-17 14:30:31 +02:00
|
|
|
gcc_initial=$(GCC_BUILD_DIR1)/.installed
|
2007-09-01 20:46:46 +02:00
|
|
|
$(gcc_initial) $(STAGING_DIR)/usr/bin/$(REAL_GNU_TARGET_NAME)-gcc: $(GCC_BUILD_DIR1)/.compiled
|
2008-06-19 21:06:04 +02:00
|
|
|
# gcc >= 4.3.0 have to also install install-target-libgcc
|
|
|
|
ifeq ($(BR2_GCC_SUPPORTS_FINEGRAINEDMTUNE),y)
|
2010-07-28 09:11:37 +02:00
|
|
|
PATH=$(TARGET_PATH) $(MAKE) -C $(GCC_BUILD_DIR1) install-gcc
|
2008-06-19 21:06:04 +02:00
|
|
|
else
|
2007-06-20 13:26:36 +02:00
|
|
|
PATH=$(TARGET_PATH) $(MAKE) -C $(GCC_BUILD_DIR1) install-gcc
|
2008-06-19 21:06:04 +02:00
|
|
|
endif
|
2007-09-01 20:46:46 +02:00
|
|
|
touch $(gcc_initial)
|
2007-06-20 13:26:36 +02:00
|
|
|
|
2010-07-28 09:11:37 +02:00
|
|
|
gcc_initial: binutils $(STAGING_DIR)/usr/bin/$(REAL_GNU_TARGET_NAME)-gcc
|
2007-06-20 13:26:36 +02:00
|
|
|
|
|
|
|
gcc_initial-clean:
|
|
|
|
rm -rf $(GCC_BUILD_DIR1)
|
|
|
|
|
|
|
|
gcc_initial-dirclean:
|
|
|
|
rm -rf $(GCC_BUILD_DIR1) $(GCC_DIR)
|
|
|
|
|
|
|
|
#############################################################
|
|
|
|
#
|
2010-07-28 09:11:37 +02:00
|
|
|
# build the second pass gcc compiler
|
|
|
|
#
|
|
|
|
#############################################################
|
|
|
|
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)
|
2010-07-30 10:02:23 +02:00
|
|
|
-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)
|
2010-07-28 09:11:37 +02:00
|
|
|
(cd $(GCC_BUILD_DIR2); rm -rf config.cache; \
|
|
|
|
$(HOST_CONFIGURE_OPTS) \
|
|
|
|
$(GCC_DIR)/configure $(QUIET) \
|
|
|
|
--prefix=$(STAGING_DIR)/usr \
|
|
|
|
--build=$(GNU_HOST_NAME) \
|
|
|
|
--host=$(GNU_HOST_NAME) \
|
|
|
|
--target=$(REAL_GNU_TARGET_NAME) \
|
|
|
|
--enable-languages=c \
|
|
|
|
$(BR2_CONFIGURE_DEVEL_SYSROOT) \
|
|
|
|
--disable-__cxa_atexit \
|
|
|
|
--enable-target-optspace \
|
|
|
|
--with-gnu-ld \
|
|
|
|
--enable-shared \
|
|
|
|
--disable-libssp \
|
2010-07-30 09:31:39 +02:00
|
|
|
--disable-multilib \
|
2010-07-28 09:11:37 +02:00
|
|
|
$(GCC_TLS) \
|
|
|
|
$(GCC_WITH_HOST_GMP) \
|
|
|
|
$(GCC_WITH_HOST_MPFR) \
|
|
|
|
$(DISABLE_NLS) \
|
|
|
|
$(THREADS) \
|
|
|
|
$(MULTILIB) \
|
|
|
|
$(GCC_DECIMAL_FLOAT) \
|
|
|
|
$(SOFT_FLOAT_CONFIG_OPTION) \
|
|
|
|
$(GCC_WITH_ABI) $(GCC_WITH_ARCH) $(GCC_WITH_TUNE) \
|
|
|
|
$(EXTRA_GCC_CONFIG_OPTIONS) \
|
|
|
|
$(EXTRA_GCC2_CONFIG_OPTIONS) \
|
|
|
|
$(QUIET) \
|
|
|
|
)
|
|
|
|
touch $@
|
|
|
|
|
|
|
|
$(GCC_BUILD_DIR2)/.compiled: $(GCC_BUILD_DIR2)/.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_DIR2) all-gcc all-target-libgcc
|
|
|
|
else
|
|
|
|
$(MAKE) -C $(GCC_BUILD_DIR2) all-gcc
|
|
|
|
endif
|
|
|
|
touch $@
|
|
|
|
|
|
|
|
gcc_intermediate=$(GCC_BUILD_DIR2)/.installed
|
|
|
|
$(gcc_intermediate): $(GCC_BUILD_DIR2)/.compiled
|
|
|
|
# gcc >= 4.3.0 have to also install install-target-libgcc
|
|
|
|
ifeq ($(BR2_GCC_SUPPORTS_FINEGRAINEDMTUNE),y)
|
|
|
|
PATH=$(TARGET_PATH) $(MAKE) -C $(GCC_BUILD_DIR2) install-gcc install-target-libgcc
|
|
|
|
else
|
|
|
|
PATH=$(TARGET_PATH) $(MAKE) -C $(GCC_BUILD_DIR2) install-gcc
|
|
|
|
endif
|
|
|
|
touch $(gcc_intermediate)
|
|
|
|
|
|
|
|
gcc_intermediate: uclibc-configured $(STAGING_DIR)/usr/bin/$(REAL_GNU_TARGET_NAME)-gcc
|
|
|
|
|
|
|
|
gcc_intermediate-clean:
|
|
|
|
rm -rf $(GCC_BUILD_DIR2)
|
|
|
|
|
|
|
|
gcc_intermediate-dirclean:
|
|
|
|
rm -rf $(GCC_BUILD_DIR2) $(GCC_DIR)
|
|
|
|
|
|
|
|
#############################################################
|
|
|
|
#
|
|
|
|
# third pass compiler build. Build the compiler targeting
|
2007-06-20 13:26:36 +02:00
|
|
|
# the newly built shared uClibc library.
|
|
|
|
#
|
|
|
|
#############################################################
|
|
|
|
#
|
|
|
|
# Sigh... I had to rework things because using --with-gxx-include-dir
|
2007-08-22 14:35:41 +02:00
|
|
|
# causes issues with include dir search order for g++. This seems to
|
2007-06-20 13:26:36 +02:00
|
|
|
# have something to do with "path translations" and possibly doesn't
|
2007-08-22 14:35:41 +02:00
|
|
|
# affect gcc-target. However, I haven't tested gcc-target yet so no
|
|
|
|
# guarantees. mjn3
|
2007-06-20 13:26:36 +02:00
|
|
|
|
2010-07-28 09:11:37 +02:00
|
|
|
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)
|
2007-08-22 14:35:41 +02:00
|
|
|
# Important! Required for limits.h to be fixed.
|
2007-06-20 13:26:36 +02:00
|
|
|
ln -snf ../include/ $(STAGING_DIR)/usr/$(REAL_GNU_TARGET_NAME)/sys-include
|
2010-07-28 09:11:37 +02:00
|
|
|
(cd $(GCC_BUILD_DIR3); rm -rf config.cache; \
|
2007-06-20 13:26:36 +02:00
|
|
|
$(HOST_CONFIGURE_OPTS) \
|
2009-10-01 21:24:42 +02:00
|
|
|
$(GCC_SRC_DIR)/configure $(QUIET) \
|
2010-07-22 15:42:27 +02:00
|
|
|
--prefix=$(STAGING_DIR)/usr \
|
2007-06-20 13:26:36 +02:00
|
|
|
--build=$(GNU_HOST_NAME) \
|
|
|
|
--host=$(GNU_HOST_NAME) \
|
|
|
|
--target=$(REAL_GNU_TARGET_NAME) \
|
2007-07-31 17:07:06 +02:00
|
|
|
--enable-languages=$(GCC_CROSS_LANGUAGES) \
|
2007-06-20 13:26:36 +02:00
|
|
|
$(BR2_CONFIGURE_STAGING_SYSROOT) \
|
|
|
|
$(BR2_CONFIGURE_BUILD_TOOLS) \
|
|
|
|
--disable-__cxa_atexit \
|
|
|
|
--enable-target-optspace \
|
|
|
|
--with-gnu-ld \
|
2009-04-22 09:27:17 +02:00
|
|
|
--disable-libssp \
|
2010-07-30 09:31:39 +02:00
|
|
|
--disable-multilib \
|
2009-09-21 01:33:38 +02:00
|
|
|
$(GCC_TLS) \
|
2007-06-20 13:26:36 +02:00
|
|
|
$(GCC_SHARED_LIBGCC) \
|
|
|
|
$(GCC_WITH_HOST_GMP) \
|
|
|
|
$(GCC_WITH_HOST_MPFR) \
|
|
|
|
$(DISABLE_NLS) \
|
|
|
|
$(THREADS) \
|
2008-06-21 21:47:17 +02:00
|
|
|
$(GCC_DECIMAL_FLOAT) \
|
2007-06-20 13:26:36 +02:00
|
|
|
$(SOFT_FLOAT_CONFIG_OPTION) \
|
2007-07-08 18:27:25 +02:00
|
|
|
$(GCC_WITH_ABI) $(GCC_WITH_ARCH) $(GCC_WITH_TUNE) \
|
2007-06-20 13:26:36 +02:00
|
|
|
$(DISABLE_LARGEFILE) \
|
2007-10-01 14:56:24 +02:00
|
|
|
$(EXTRA_GCC_CONFIG_OPTIONS) \
|
|
|
|
$(EXTRA_GCC2_CONFIG_OPTIONS) \
|
|
|
|
)
|
2007-06-20 13:26:36 +02:00
|
|
|
touch $@
|
|
|
|
|
2010-07-28 09:11:37 +02:00
|
|
|
$(GCC_BUILD_DIR3)/.compiled: $(GCC_BUILD_DIR3)/.configured
|
|
|
|
$(GCC_CONF_ENV) $(MAKE) -C $(GCC_BUILD_DIR3) all
|
2007-06-20 13:26:36 +02:00
|
|
|
touch $@
|
|
|
|
|
2010-07-28 09:11:37 +02:00
|
|
|
$(GCC_BUILD_DIR3)/.installed: $(GCC_BUILD_DIR3)/.compiled
|
2010-07-22 15:42:27 +02:00
|
|
|
PATH=$(TARGET_PATH) $(MAKE) \
|
2010-07-28 09:11:37 +02:00
|
|
|
-C $(GCC_BUILD_DIR3) install
|
2007-08-22 11:56:41 +02:00
|
|
|
if [ -d "$(STAGING_DIR)/lib64" ]; then \
|
|
|
|
if [ ! -e "$(STAGING_DIR)/lib" ]; then \
|
2007-10-07 19:22:56 +02:00
|
|
|
mkdir -p "$(STAGING_DIR)/lib"; \
|
2007-08-22 11:56:41 +02:00
|
|
|
fi; \
|
|
|
|
mv "$(STAGING_DIR)/lib64/"* "$(STAGING_DIR)/lib/"; \
|
|
|
|
rmdir "$(STAGING_DIR)/lib64"; \
|
Create <tuple>/lib -> <sysroot>/lib symlink before installing cross gcc
This commit solves bug #1051. The problem in this bug in that WebKit
compiles a sample C program, which uses WebKit. As WebKit is written
in C++, even though the program it built with CROSS-gcc, it must be
linked with libstdc++. However, CROSS-gcc can't find the libstdc++ has
it's hidden inside <sysroot>/<tuple>/lib.
Therefore, this commit creates a symbolic link <sysroot>/<tuple>/lib
-> <sysroot>/lib before running the CROSS-gcc installation. While this
may look like a hack, this is the solution used by both Crosstool-NG
and OpenWRT.
Moreover, with this symbolic link in place, I think bug #1741 may also
be solved. The problem in this bug is that the linker tries to link
against /lib/libc.so.0. This is due to the fact that the linker finds
a libc.so script file in the original toolchain location and not
inside the copy of the toolchain sysroot in $(STAGING_DIR). As the
script file is found outside of the current toolchain sysroot, ld
considers the script has non-sysrooted, and therefore doesn't prefix
all paths found in the script file (such as /lib/libc.so.0) with the
sysroot path, leading to the failure.
So, in details, this commit :
* Adds a BR2_ARCH_IS_64 invisible config knob that is used to know if
the arch is a 64 bits architecture or not.
* Creates the <sysroot>/<tuple>/lib -> <sysroot>/lib symbolic link,
and the <sysroot>/<tuple>/lib64 -> <sysroot>/lib64 symbolic link if
needed.
* Fixes the external toolchain sysroot detection code so that the
'sed' replacement is done *after* the readlink -f evaluation.
I have tested this by building ARM, x86 and x86_64 toolchains with
Buildroot, and then use these toolchains as external toolchains to
build a full X.org/Gtk/WebKit/Midori stack. I have also done a
complete ARM Buildroot internal toolchain build with the same full
X.org/Gtk/WebKit/Midori stack.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2010-07-27 16:25:15 +02:00
|
|
|
rm "$(STAGING_DIR)/usr/$(REAL_GNU_TARGET_NAME)/lib64";\
|
2007-06-20 13:26:36 +02:00
|
|
|
fi
|
|
|
|
# Strip the host binaries
|
|
|
|
ifeq ($(GCC_STRIP_HOST_BINARIES),true)
|
2008-04-04 16:16:06 +02:00
|
|
|
strip --strip-all -R .note -R .comment $(filter-out %-gccbug %-embedspu,$(wildcard $(STAGING_DIR)/usr/bin/$(REAL_GNU_TARGET_NAME)-*))
|
2007-06-20 13:26:36 +02:00
|
|
|
endif
|
|
|
|
# Make sure we have 'cc'.
|
2007-08-22 11:56:41 +02:00
|
|
|
if [ ! -e $(STAGING_DIR)/usr/bin/$(REAL_GNU_TARGET_NAME)-cc ]; then \
|
2007-06-20 13:26:36 +02:00
|
|
|
ln -snf $(REAL_GNU_TARGET_NAME)-gcc \
|
2007-08-22 11:56:41 +02:00
|
|
|
$(STAGING_DIR)/usr/bin/$(REAL_GNU_TARGET_NAME)-cc; \
|
2007-08-21 21:20:18 +02:00
|
|
|
fi
|
2009-01-30 14:34:42 +01:00
|
|
|
if [ ! -e $(STAGING_DIR)/usr/$(REAL_GNU_TARGET_NAME)/bin/cc ]; then \
|
|
|
|
ln -snf gcc $(STAGING_DIR)/usr/$(REAL_GNU_TARGET_NAME)/bin/cc; \
|
2007-08-21 21:20:18 +02:00
|
|
|
fi
|
2007-06-20 13:26:36 +02:00
|
|
|
# Set up the symlinks to enable lying about target name.
|
|
|
|
set -e; \
|
2009-01-30 14:34:42 +01:00
|
|
|
(cd $(STAGING_DIR)/usr; \
|
2007-06-20 13:26:36 +02:00
|
|
|
ln -snf $(REAL_GNU_TARGET_NAME) $(GNU_TARGET_NAME); \
|
2009-01-30 14:34:42 +01:00
|
|
|
cd bin; \
|
2007-08-22 11:56:41 +02:00
|
|
|
for app in $(REAL_GNU_TARGET_NAME)-*; do \
|
2007-06-20 13:26:36 +02:00
|
|
|
ln -snf $${app} \
|
2007-08-19 23:15:02 +02:00
|
|
|
$(GNU_TARGET_NAME)$${app##$(REAL_GNU_TARGET_NAME)}; \
|
2007-06-20 13:26:36 +02:00
|
|
|
done; \
|
2007-08-21 21:20:18 +02:00
|
|
|
)
|
2009-01-30 14:34:35 +01:00
|
|
|
|
2007-08-28 23:42:44 +02:00
|
|
|
mkdir -p $(TARGET_DIR)/usr/lib $(TARGET_DIR)/usr/sbin
|
2007-06-20 13:26:36 +02:00
|
|
|
touch $@
|
|
|
|
|
2010-07-28 09:11:37 +02:00
|
|
|
$(STAMP_DIR)/gcc_libs_target_installed: $(GCC_BUILD_DIR3)/.installed
|
2007-06-20 13:26:36 +02:00
|
|
|
ifeq ($(BR2_GCC_SHARED_LIBGCC),y)
|
|
|
|
# These are in /lib, so...
|
|
|
|
rm -rf $(TARGET_DIR)/usr/lib/libgcc_s*.so*
|
2009-07-02 09:38:56 +02:00
|
|
|
-cp -dpf $(STAGING_DIR)/usr/$(REAL_GNU_TARGET_NAME)/lib*/libgcc_s* \
|
2007-08-28 23:42:44 +02:00
|
|
|
$(TARGET_DIR)/lib/
|
2008-06-17 15:33:02 +02:00
|
|
|
-$(STRIPCMD) $(STRIP_STRIP_UNNEEDED) $(TARGET_DIR)/lib/libgcc_s*
|
2007-06-20 13:26:36 +02:00
|
|
|
endif
|
|
|
|
ifeq ($(BR2_INSTALL_LIBSTDCPP),y)
|
2007-10-12 14:30:14 +02:00
|
|
|
ifeq ($(BR2_GCC_SHARED_LIBGCC),y)
|
2008-10-02 16:32:07 +02:00
|
|
|
mkdir -p $(TARGET_DIR)/usr/lib
|
2009-07-02 09:38:56 +02:00
|
|
|
-cp -dpf $(STAGING_DIR)/usr/$(REAL_GNU_TARGET_NAME)/lib*/libstdc++.so* \
|
2007-08-28 23:42:44 +02:00
|
|
|
$(TARGET_DIR)/usr/lib/
|
2008-06-17 15:33:02 +02:00
|
|
|
-$(STRIPCMD) $(STRIP_STRIP_UNNEEDED) $(TARGET_DIR)/usr/lib/libstdc++.so*
|
2007-06-20 13:26:36 +02:00
|
|
|
endif
|
2007-10-12 14:30:14 +02:00
|
|
|
endif
|
2007-06-20 13:26:36 +02:00
|
|
|
ifeq ($(BR2_INSTALL_LIBGCJ),y)
|
2009-07-02 09:38:56 +02:00
|
|
|
cp -dpf $(STAGING_DIR)/usr/$(REAL_GNU_TARGET_NAME)/lib*/libgcj.so* $(TARGET_DIR)/usr/lib/
|
2007-08-21 13:25:30 +02:00
|
|
|
mkdir -p $(TARGET_DIR)/usr/lib/security
|
2007-08-28 23:42:44 +02:00
|
|
|
cp -dpf $(STAGING_DIR)/usr/lib/security/classpath.security \
|
|
|
|
$(TARGET_DIR)/usr/lib/security/
|
2009-04-27 16:07:36 +02:00
|
|
|
-$(STRIPCMD) $(STRIP_STRIP_UNNEEDED) $(TARGET_DIR)/usr/lib/libgcj.so*
|
2007-06-20 13:26:36 +02:00
|
|
|
endif
|
2008-10-02 17:02:38 +02:00
|
|
|
mkdir -p $(@D)
|
2007-06-20 13:26:36 +02:00
|
|
|
touch $@
|
|
|
|
|
2007-09-22 23:38:15 +02:00
|
|
|
cross_compiler:=$(STAGING_DIR)/usr/bin/$(REAL_GNU_TARGET_NAME)-gcc
|
2010-07-28 09:11:37 +02:00
|
|
|
cross_compiler gcc: gcc_intermediate \
|
|
|
|
$(LIBFLOAT_TARGET) uclibc $(GCC_BUILD_DIR3)/.installed \
|
Remove the "project" feature
The "project" feature was designed to allow to several projects to be
built inside the same Buildroot source tree and allowing the toolchain
and non-configurable packages to be shared between the different
projects on the same architecture. While being interesting in theory,
this feature adds a level of complexity to Buildroot, both from an
user perspective and from a developer perspective, while one of the
main Buildroot strengh is to be simple. Moreover, this feature is only
seldomly used by our users.
From a user-level perspective, this for example allows to remove the
project_build_ARCH directory, which was very confusing. The
autotools-stamps directory is also removed, since these stamps are
back at their normal location.
Description of the changes involved :
* project/, directory removed
* Makefile
- Don't include project/Makefile.in and project/project.mk anymore
- Grab a copy of the contents of project/Makefile.in at the
location it was imported, but remove the definition related to
PROJECT_BUILD_DIR. The TARGET_DIR is now in
$(BUILD_DIR)/target_dir
- Remove the creation/removal of the $(PROJECT_BUILD_DIR) and
$(PROJECT_BUILD_DIR)/autotools-stamps directories
- Don't make world depends on target-host-info. This target was
defined by project/project.mk to customize /etc/issue,
/etc/hostname and create /etc/br-version depending on the
project definitions. We can of course imagine re-adding such a
feature later.
- Replace PROJECT_BUILD_DIR by BUILD_DIR everywhere
- Remove the update, log and lognr.$(PROJECT) target, they were
specific to the project feature.
* package/Makefile.autotools.in
- Replace PROJECT_BUILD_DIR by BUILD_DIR for the location of the
configure cache
- Move the INSTALL_TARGET and HOOK_POST_INSTALL stamps to the same
directory as the other stamps (i.e, in the package directory).
* package/Makefile.in
- Replace PROJECT_BUILD_DIR by BUILD_DIR for the location of the
configure cache
* package/at/at.mk,
package/busybox/busybox.mk,
package/busybox/initramfs.mk,
package/customize/customize.mk,
package/linux-fusion/linux-fusion.mk,
package/ltp-testsuite/ltp-testsuite.mk,
package/nfs-utils/nfs-utils.mk,
target/cpio/cpioroot.mk,
target/cramfs/cramfs.mk,
target/device/Atmel/DataFlashBoot/DataflashBoot.mk,
target/device/Atmel/Makefile.in,
target/device/Atmel/at91bootstrap/at91bootstrap.mk,
target/device/KwikByte/Makefile.in,
target/ext2/ext2root.mk,
target/initramfs/initramfs.mk,
target/iso9660/iso9660.mk,
target/jffs2/jffs2root.mk,
target/linux/Makefile.in,
target/romfs/romfs.mk,
target/squashfs/squashfsroot.mk,
target/tar/tarroot.mk,
target/ubifs/ubifsroot.mk
- Replace PROJECT_BUILD_DIR by BUILD_DIR
* target/device/Config.in
- Do not include project/Config.in anymore
* target/linux/Makefile.in.advanced
- Replace PROJECT_BUILD_DIR by BUILD_DIR
- Store the stamps file in $(STAMP_DIR) instead of
$(PROJECT_BUILD_DIR)/autotools-stamps
* target/u-boot/Makefile.in
- Replace PROJECT_BUILD_DIR by BUILD_DIR
- Remove $(PROJECT) from the U-Boot target binary name
- Remove the insertion in the configuration of the project name as
the hostname
- The u-boot-autoscript target now generates
$(U_BOOT_AUTOSCRIPT).img instead of
$(U_BOOT_AUTOSCRIPT).$(PROJECT)
* toolchain/gcc/gcc-uclibc-3.x.mk
toolchain/gcc/gcc-uclibc-4.x.mk
- Move the stamps files to $(STAMP_DIR)
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2009-09-05 15:49:30 +02:00
|
|
|
$(STAMP_DIR)/gcc_libs_target_installed \
|
2007-06-20 13:26:36 +02:00
|
|
|
$(GCC_TARGETS)
|
|
|
|
|
|
|
|
gcc-source: $(DL_DIR)/$(GCC_SOURCE)
|
|
|
|
|
|
|
|
gcc-clean:
|
2010-07-28 09:11:37 +02:00
|
|
|
rm -rf $(GCC_BUILD_DIR3)
|
2007-06-20 13:26:36 +02:00
|
|
|
for prog in cpp gcc gcc-[0-9]* protoize unprotoize gcov gccbug cc; do \
|
2007-08-28 23:42:44 +02:00
|
|
|
rm -f $(STAGING_DIR)/usr/bin/$(REAL_GNU_TARGET_NAME)-$$prog; \
|
|
|
|
rm -f $(STAGING_DIR)/usr/bin/$(GNU_TARGET_NAME)-$$prog; \
|
2007-06-20 13:26:36 +02:00
|
|
|
done
|
|
|
|
|
|
|
|
gcc-dirclean: gcc_initial-dirclean
|
2010-07-28 09:11:37 +02:00
|
|
|
rm -rf $(GCC_BUILD_DIR3)
|
2007-06-20 13:26:36 +02:00
|
|
|
|
|
|
|
#############################################################
|
|
|
|
#
|
|
|
|
# Next build target gcc compiler
|
|
|
|
#
|
|
|
|
#############################################################
|
2010-07-28 09:11:37 +02:00
|
|
|
GCC_BUILD_DIR4:=$(BUILD_DIR)/gcc-$(GCC_VERSION)-target
|
2007-06-20 13:26:36 +02:00
|
|
|
|
2010-07-28 09:11:37 +02:00
|
|
|
$(GCC_BUILD_DIR4)/.prepared: $(STAMP_DIR)/gcc_libs_target_installed $(GCC_TARGET_PREREQ)
|
2007-06-20 13:26:36 +02:00
|
|
|
mkdir -p $(GCC_BUILD_DIR3)
|
|
|
|
touch $@
|
|
|
|
|
2010-07-28 09:11:37 +02:00
|
|
|
$(GCC_BUILD_DIR4)/.configured: $(GCC_BUILD_DIR4)/.prepared
|
|
|
|
(cd $(GCC_BUILD_DIR4); rm -rf config.cache; \
|
2007-06-20 13:26:36 +02:00
|
|
|
$(TARGET_CONFIGURE_OPTS) \
|
2007-10-01 14:57:36 +02:00
|
|
|
$(TARGET_CONFIGURE_ARGS) \
|
2010-07-27 18:16:59 +02:00
|
|
|
CFLAGS_FOR_TARGET="$(TARGET_CFLAGS) $(TARGET_SOFT_FLOAT)" \
|
|
|
|
CXXFLAGS_FOR_TARGET="$(TARGET_CFLAGS) $(TARGET_SOFT_FLOAT)" \
|
|
|
|
CFLAGS="$(TARGET_CFLAGS) $(TARGET_SOFT_FLOAT)" \
|
|
|
|
BOOT_CFLAGS="$(TARGET_CFLAGS) $(TARGET_SOFT_FLOAT)" \
|
2010-07-27 18:17:26 +02:00
|
|
|
GCC_FOR_TARGET="$(TARGET_CC)" \
|
|
|
|
CC_FOR_TARGET="$(TARGET_CC)" \
|
2010-07-27 22:32:02 +02:00
|
|
|
CXX_FOR_TARGET="$(TARGET_CXX)" \
|
2009-10-01 21:24:42 +02:00
|
|
|
$(GCC_SRC_DIR)/configure $(QUIET) \
|
2007-06-20 13:26:36 +02:00
|
|
|
--prefix=/usr \
|
|
|
|
--build=$(GNU_HOST_NAME) \
|
|
|
|
--host=$(REAL_GNU_TARGET_NAME) \
|
|
|
|
--target=$(REAL_GNU_TARGET_NAME) \
|
|
|
|
--enable-languages=$(GCC_TARGET_LANGUAGES) \
|
|
|
|
--with-gxx-include-dir=/usr/include/c++ \
|
|
|
|
--disable-__cxa_atexit \
|
|
|
|
--with-gnu-ld \
|
2009-04-22 09:27:17 +02:00
|
|
|
--disable-libssp \
|
2010-07-30 09:31:39 +02:00
|
|
|
--disable-multilib \
|
2009-09-21 01:33:38 +02:00
|
|
|
$(GCC_TLS) \
|
2007-06-20 13:26:36 +02:00
|
|
|
$(GCC_SHARED_LIBGCC) \
|
|
|
|
$(GCC_WITH_TARGET_GMP) \
|
|
|
|
$(GCC_WITH_TARGET_MPFR) \
|
|
|
|
$(DISABLE_NLS) \
|
|
|
|
$(THREADS) \
|
2008-06-21 21:47:17 +02:00
|
|
|
$(GCC_DECIMAL_FLOAT) \
|
2007-06-20 13:26:36 +02:00
|
|
|
$(SOFT_FLOAT_CONFIG_OPTION) \
|
2007-07-08 18:27:25 +02:00
|
|
|
$(GCC_WITH_ABI) $(GCC_WITH_ARCH) $(GCC_WITH_TUNE) \
|
2007-06-20 13:26:36 +02:00
|
|
|
$(DISABLE_LARGEFILE) \
|
|
|
|
$(EXTRA_GCC_CONFIG_OPTIONS) \
|
2007-10-01 14:56:24 +02:00
|
|
|
$(EXTRA_TARGET_GCC_CONFIG_OPTIONS) \
|
2010-07-28 09:11:37 +02:00
|
|
|
$(EXTRA_GCC4_CONFIG_OPTIONS) \
|
2007-10-01 14:56:24 +02:00
|
|
|
)
|
2007-06-20 13:26:36 +02:00
|
|
|
touch $@
|
|
|
|
|
2010-07-28 09:11:37 +02:00
|
|
|
$(GCC_BUILD_DIR4)/.compiled: $(GCC_BUILD_DIR4)/.configured
|
2007-06-20 13:26:36 +02:00
|
|
|
PATH=$(TARGET_PATH) \
|
2010-07-28 09:11:37 +02:00
|
|
|
$(MAKE) -C $(GCC_BUILD_DIR4) all
|
2007-06-20 13:26:36 +02:00
|
|
|
touch $@
|
|
|
|
|
|
|
|
GCC_LIB_SUBDIR=lib/gcc/$(REAL_GNU_TARGET_NAME)/$(GCC_VERSION)
|
2009-01-22 12:18:44 +01:00
|
|
|
ifeq ($(findstring x4.2,x$(GCC_VERSION)),x4.2)
|
2009-01-22 11:04:30 +01:00
|
|
|
GCC_INCLUDE_DIR:=include
|
2010-07-02 07:43:01 +02:00
|
|
|
else
|
2010-02-25 09:44:57 +01:00
|
|
|
GCC_INCLUDE_DIR:=include-fixed
|
|
|
|
endif
|
2007-06-20 13:26:36 +02:00
|
|
|
|
2010-07-28 09:11:37 +02:00
|
|
|
$(TARGET_DIR)/usr/bin/gcc: $(GCC_BUILD_DIR4)/.compiled
|
2007-06-20 13:26:36 +02:00
|
|
|
PATH=$(TARGET_PATH) DESTDIR=$(TARGET_DIR) \
|
2010-07-28 09:11:37 +02:00
|
|
|
$(MAKE1) -C $(GCC_BUILD_DIR4) install
|
2007-06-20 13:26:36 +02:00
|
|
|
# Remove broken specs file (cross compile flag is set).
|
|
|
|
rm -f $(TARGET_DIR)/usr/$(GCC_LIB_SUBDIR)/specs
|
2009-01-30 14:34:35 +01:00
|
|
|
|
2010-07-27 22:32:02 +02:00
|
|
|
# Remove useless copies of gcc, c++, g++
|
2010-07-27 18:21:44 +02:00
|
|
|
rm -f $(TARGET_DIR)/usr/bin/$(REAL_GNU_TARGET_NAME)-gcc*
|
2010-07-27 22:32:02 +02:00
|
|
|
rm -f $(TARGET_DIR)/usr/bin/$(REAL_GNU_TARGET_NAME)-g++*
|
|
|
|
rm -f $(TARGET_DIR)/usr/bin/$(REAL_GNU_TARGET_NAME)-c++*
|
2010-07-27 18:21:44 +02:00
|
|
|
|
2007-06-20 13:26:36 +02:00
|
|
|
# Work around problem of missing syslimits.h
|
2009-01-22 11:04:30 +01:00
|
|
|
if [ ! -f $(TARGET_DIR)/usr/$(GCC_LIB_SUBDIR)/$(GCC_INCLUDE_DIR)/syslimits.h ]; then \
|
2007-08-22 11:56:41 +02:00
|
|
|
echo "warning: working around missing syslimits.h"; \
|
2009-01-22 11:04:30 +01:00
|
|
|
cp -f $(STAGING_DIR)/$(GCC_LIB_SUBDIR)/$(GCC_INCLUDE_DIR)/syslimits.h \
|
|
|
|
$(TARGET_DIR)/usr/$(GCC_LIB_SUBDIR)/$(GCC_INCLUDE_DIR)/; \
|
2007-06-20 13:26:36 +02:00
|
|
|
fi
|
|
|
|
# Make sure we have 'cc'.
|
2007-08-22 11:56:41 +02:00
|
|
|
if [ ! -e $(TARGET_DIR)/usr/bin/cc ]; then \
|
|
|
|
ln -snf gcc $(TARGET_DIR)/usr/bin/cc; \
|
2007-08-21 21:20:18 +02:00
|
|
|
fi
|
2007-06-20 13:26:36 +02:00
|
|
|
# These are in /lib, so...
|
|
|
|
#rm -rf $(TARGET_DIR)/usr/lib/libgcc_s*.so*
|
|
|
|
touch -c $@
|
|
|
|
|
|
|
|
gcc_target: uclibc_target binutils_target $(TARGET_DIR)/usr/bin/gcc
|
|
|
|
|
|
|
|
gcc_target-clean:
|
2010-07-28 09:11:37 +02:00
|
|
|
rm -rf $(GCC_BUILD_DIR4)
|
2007-06-20 13:26:36 +02:00
|
|
|
rm -f $(TARGET_DIR)/usr/bin/$(REAL_GNU_TARGET_NAME)*
|
|
|
|
|
|
|
|
gcc_target-dirclean:
|
2010-07-28 09:11:37 +02:00
|
|
|
rm -rf $(GCC_BUILD_DIR4)
|