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
|
|
|
|
|
2012-04-17 06:45:30 +02:00
|
|
|
GCC_VERSION:=$(call qstrip,$(BR2_GCC_VERSION))
|
|
|
|
|
|
|
|
ifeq ($(BR2_GCC_VERSION_SNAP),y)
|
|
|
|
GCC_SNAP_DATE:=$(call qstrip,$(BR2_GCC_SNAP_DATE))
|
|
|
|
else
|
|
|
|
GCC_SNAP_DATE:=
|
|
|
|
endif
|
|
|
|
|
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-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.)
|
2010-10-31 17:35:15 +01:00
|
|
|
EXTRA_GCC_CONFIG_OPTIONS+=--with-pkgversion="Buildroot $(BR2_VERSION_FULL)" \
|
2009-12-02 20:36:43 +01:00
|
|
|
--with-bugurl="http://bugs.buildroot.net/"
|
|
|
|
endif
|
|
|
|
|
2010-11-03 20:08:21 +01:00
|
|
|
# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43810
|
2011-05-02 20:13:01 +02:00
|
|
|
# Workaround until it's fixed in 4.5.4 or later
|
2010-11-03 20:08:21 +01:00
|
|
|
ifeq ($(ARCH),powerpc)
|
|
|
|
ifeq ($(findstring x4.5.,x$(GCC_VERSION)),x4.5.)
|
|
|
|
GCC_OPTSPACE=--disable-target-optspace
|
|
|
|
endif
|
|
|
|
else
|
|
|
|
GCC_OPTSPACE=--enable-target-optspace
|
|
|
|
endif
|
|
|
|
|
2011-04-13 18:29:29 +02:00
|
|
|
# gcc 4.6.x quadmath requires wchar
|
|
|
|
ifneq ($(BR2_TOOLCHAIN_BUILDROOT_WCHAR),y)
|
|
|
|
GCC_QUADMATH=--disable-libquadmath
|
|
|
|
endif
|
|
|
|
|
2012-04-17 06:45:31 +02:00
|
|
|
# Determine soft-float options
|
|
|
|
ifeq ($(BR2_SOFT_FLOAT),y)
|
|
|
|
SOFT_FLOAT_CONFIG_OPTION:=--with-float=soft
|
|
|
|
ifeq ($(BR2_arm)$(BR2_armeb),y) # only set float-abi for arm
|
|
|
|
TARGET_SOFT_FLOAT:=-mfloat-abi=soft
|
|
|
|
else
|
|
|
|
TARGET_SOFT_FLOAT:=-msoft-float
|
|
|
|
endif
|
|
|
|
else # no softfloat support
|
|
|
|
SOFT_FLOAT_CONFIG_OPTION:=
|
|
|
|
TARGET_SOFT_FLOAT:=
|
|
|
|
endif
|
|
|
|
|
|
|
|
# Determine arch/tune/abi/cpu options
|
|
|
|
ifneq ($(call qstrip,$(BR2_GCC_TARGET_ARCH)),)
|
|
|
|
GCC_WITH_ARCH:=--with-arch=$(BR2_GCC_TARGET_ARCH)
|
|
|
|
endif
|
|
|
|
ifneq ($(call qstrip,$(BR2_GCC_TARGET_TUNE)),)
|
|
|
|
GCC_WITH_TUNE:=--with-tune=$(BR2_GCC_TARGET_TUNE)
|
|
|
|
endif
|
|
|
|
ifneq ($(call qstrip,$(BR2_GCC_TARGET_ABI)),)
|
|
|
|
GCC_WITH_ABI:=--with-abi=$(BR2_GCC_TARGET_ABI)
|
|
|
|
endif
|
|
|
|
ifneq ($(call qstrip,$(BR2_GCC_TARGET_CPU)),)
|
|
|
|
GCC_WITH_CPU:=--with-cpu=$(BR2_GCC_TARGET_CPU)
|
|
|
|
endif
|
|
|
|
|
|
|
|
# AVR32 GCC special configuration
|
|
|
|
ifeq ($(BR2_avr32),y)
|
|
|
|
# For the cross-compiler
|
|
|
|
EXTRA_GCC_CONFIG_OPTIONS += \
|
|
|
|
--disable-libmudflap
|
|
|
|
SOFT_FLOAT_CONFIG_OPTION:=
|
|
|
|
|
|
|
|
# For the target compiler
|
|
|
|
EXTRA_TARGET_GCC_CONFIG_OPTIONS += \
|
|
|
|
--disable-libmudflap
|
|
|
|
EXTRA_TARGET_GCC_CONFIG_OPTIONS += \
|
2012-06-08 03:52:16 +02:00
|
|
|
--with-build-time-tools=$(STAGING_DIR)/$(GNU_TARGET_NAME)/bin
|
2012-04-17 06:45:31 +02:00
|
|
|
EXTRA_TARGET_GCC_CONFIG_OPTIONS += \
|
|
|
|
--with-as=$(TARGET_CROSS)as
|
|
|
|
endif
|
|
|
|
|
|
|
|
# Disable mudflap and enable proper double/long double for SPE ABI
|
|
|
|
ifeq ($(BR2_powerpc_SPE),y)
|
|
|
|
EXTRA_GCC_CONFIG_OPTIONS += \
|
|
|
|
--disable-libmudflap \
|
|
|
|
--enable-e500_double \
|
|
|
|
--with-long-double-128
|
|
|
|
endif
|
|
|
|
|
|
|
|
# End with user-provided options, so that they can override previously
|
|
|
|
# defined options.
|
|
|
|
EXTRA_GCC_CONFIG_OPTIONS += \
|
|
|
|
$(call qstrip,$(BR2_EXTRA_GCC_CONFIG_OPTIONS))
|
|
|
|
EXTRA_TARGET_GCC_CONFIG_OPTIONS += \
|
|
|
|
$(call qstrip,$(BR2_EXTRA_TARGET_GCC_CONFIG_OPTIONS))
|
|
|
|
|
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
|
2010-12-13 17:27:41 +01:00
|
|
|
ifeq ($(BR2_INSTALL_LIBSTDCPP),y)
|
2007-07-31 17:07:06 +02:00
|
|
|
GCC_CROSS_LANGUAGES:=$(GCC_CROSS_LANGUAGES),c++
|
|
|
|
endif
|
|
|
|
ifeq ($(BR2_GCC_CROSS_FORTRAN),y)
|
|
|
|
GCC_CROSS_LANGUAGES:=$(GCC_CROSS_LANGUAGES),fortran
|
|
|
|
endif
|
|
|
|
ifeq ($(BR2_GCC_CROSS_OBJC),y)
|
|
|
|
GCC_CROSS_LANGUAGES:=$(GCC_CROSS_LANGUAGES),objc
|
|
|
|
endif
|
|
|
|
|
2007-06-20 13:26:36 +02:00
|
|
|
ifeq ($(BR2_INSTALL_LIBSTDCPP),y)
|
|
|
|
GCC_TARGET_LANGUAGES:=$(GCC_TARGET_LANGUAGES),c++
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(BR2_INSTALL_OBJC),y)
|
|
|
|
GCC_TARGET_LANGUAGES:=$(GCC_TARGET_LANGUAGES),objc
|
|
|
|
endif
|
|
|
|
|
2010-12-31 12:39:01 +01:00
|
|
|
ifeq ($(BR2_INSTALL_FORTRAN),y)
|
|
|
|
GCC_TARGET_LANGUAGES:=$(GCC_TARGET_LANGUAGES),fortran
|
|
|
|
endif
|
|
|
|
|
2011-04-13 18:29:29 +02:00
|
|
|
# GCC 4.x prerequisites
|
2010-12-06 20:40:07 +01:00
|
|
|
GCC_WITH_HOST_GMP = --with-gmp=$(HOST_DIR)/usr
|
2010-12-06 20:40:09 +01:00
|
|
|
GCC_WITH_HOST_MPFR = --with-mpfr=$(HOST_DIR)/usr
|
2011-01-17 13:13:42 +01:00
|
|
|
ifeq ($(BR2_TOOLCHAIN_BUILDROOT),y)
|
2010-12-06 20:40:09 +01:00
|
|
|
HOST_SOURCE += host-gmp-source host-mpfr-source
|
2011-01-17 13:13:42 +01:00
|
|
|
endif
|
2010-12-31 12:39:01 +01:00
|
|
|
GCC_HOST_PREREQ = host-gmp host-mpfr
|
2011-04-13 18:29:29 +02:00
|
|
|
GCC_TARGET_PREREQ += mpfr gmp
|
2007-06-20 13:26:36 +02:00
|
|
|
|
2011-04-13 18:29:29 +02:00
|
|
|
# GCC 4.5.x prerequisites
|
2010-11-03 19:59:31 +01:00
|
|
|
ifeq ($(findstring x4.5.,x$(GCC_VERSION)),x4.5.)
|
2010-12-06 20:40:10 +01:00
|
|
|
GCC_WITH_HOST_MPC = --with-mpc=$(HOST_DIR)/usr
|
2011-04-13 18:29:29 +02:00
|
|
|
GCC_TARGET_PREREQ += mpc
|
2011-01-17 13:13:42 +01:00
|
|
|
ifeq ($(BR2_TOOLCHAIN_BUILDROOT),y)
|
2010-12-06 20:40:10 +01:00
|
|
|
HOST_SOURCE += host-mpc-source
|
2011-01-17 13:13:42 +01:00
|
|
|
endif
|
2010-12-31 12:39:01 +01:00
|
|
|
GCC_HOST_PREREQ += host-mpc
|
2010-11-03 19:59:31 +01:00
|
|
|
endif
|
|
|
|
|
2011-04-13 18:29:29 +02:00
|
|
|
# GCC 4.6.x prerequisites
|
|
|
|
ifeq ($(findstring x4.6.,x$(GCC_VERSION)),x4.6.)
|
|
|
|
GCC_WITH_HOST_MPC = --with-mpc=$(HOST_DIR)/usr
|
2010-12-31 12:39:01 +01:00
|
|
|
GCC_TARGET_PREREQ += mpc
|
2011-04-13 18:29:29 +02:00
|
|
|
ifeq ($(BR2_TOOLCHAIN_BUILDROOT),y)
|
|
|
|
HOST_SOURCE += host-mpc-source
|
|
|
|
endif
|
|
|
|
GCC_HOST_PREREQ += host-mpc
|
2010-11-03 19:59:31 +01:00
|
|
|
endif
|
2007-06-20 13:26:36 +02:00
|
|
|
|
2012-04-13 14:44:45 +02:00
|
|
|
# GCC 4.7.x prerequisites
|
|
|
|
ifeq ($(findstring x4.7.,x$(GCC_VERSION)),x4.7.)
|
|
|
|
GCC_WITH_HOST_MPC = --with-mpc=$(HOST_DIR)/usr
|
|
|
|
GCC_TARGET_PREREQ += mpc
|
|
|
|
ifeq ($(BR2_TOOLCHAIN_BUILDROOT),y)
|
|
|
|
HOST_SOURCE += host-mpc-source
|
|
|
|
endif
|
|
|
|
GCC_HOST_PREREQ += host-mpc
|
|
|
|
endif
|
|
|
|
|
2011-05-02 22:38:27 +02:00
|
|
|
# GCC snapshot prerequisites
|
|
|
|
# Since we don't know and it can be quite new just ask for everything known
|
|
|
|
ifneq ($(GCC_SNAP_DATE),)
|
|
|
|
GCC_WITH_HOST_MPC = --with-mpc=$(HOST_DIR)/usr
|
|
|
|
GCC_TARGET_PREREQ += mpc
|
|
|
|
ifeq ($(BR2_TOOLCHAIN_BUILDROOT),y)
|
|
|
|
HOST_SOURCE += host-mpc-source
|
|
|
|
endif
|
|
|
|
GCC_HOST_PREREQ += host-mpc
|
|
|
|
endif
|
|
|
|
|
2007-06-20 13:26:36 +02:00
|
|
|
ifeq ($(BR2_GCC_SHARED_LIBGCC),y)
|
|
|
|
GCC_SHARED_LIBGCC:=--enable-shared
|
|
|
|
else
|
|
|
|
GCC_SHARED_LIBGCC:=--disable-shared
|
|
|
|
endif
|
|
|
|
|
2011-05-02 20:16:41 +02:00
|
|
|
ifeq ($(BR2_GCC_ENABLE_OPENMP),y)
|
|
|
|
GCC_ENABLE_OPENMP:=--enable-libgomp
|
|
|
|
else
|
|
|
|
GCC_ENABLE_OPENMP:=--disable-libgomp
|
|
|
|
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
|
|
|
|
|
2010-12-13 17:27:44 +01:00
|
|
|
ifeq ($(BR2_PTHREADS_NONE),y)
|
2011-05-02 20:16:41 +02:00
|
|
|
THREADS:=--disable-threads
|
2010-12-13 17:27:44 +01:00
|
|
|
else
|
|
|
|
THREADS:=--enable-threads
|
|
|
|
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
|
|
|
|
|
2011-01-17 13:13:42 +01:00
|
|
|
ifeq ($(BR2_TOOLCHAIN_BUILDROOT),y)
|
2007-10-20 20:09:53 +02:00
|
|
|
HOST_SOURCE+=gcc-source
|
2011-01-17 13:13:42 +01:00
|
|
|
endif
|
2007-10-20 20:09:53 +02:00
|
|
|
|
2007-06-20 13:26:36 +02:00
|
|
|
$(DL_DIR)/$(GCC_SOURCE):
|
|
|
|
mkdir -p $(DL_DIR)
|
2012-03-16 14:42:53 +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) -
|
2011-08-31 23:35:06 +02:00
|
|
|
$(call CONFIG_UPDATE,$(@D))
|
2012-11-20 09:31:36 +01:00
|
|
|
ifneq ($(call qstrip, $(BR2_XTENSA_CORE_NAME)),)
|
|
|
|
tar xf $(BR2_XTENSA_OVERLAY_DIR)/xtensa_$(call qstrip,\
|
|
|
|
$(BR2_XTENSA_CORE_NAME)).tar -C $(@D) --strip-components=1 gcc
|
2012-11-15 04:53:52 +01:00
|
|
|
endif
|
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)),)
|
2012-09-04 06:04:06 +02:00
|
|
|
support/scripts/apply-patches.sh $(GCC_DIR) $(GCC_PATCH_DIR) \*.patch
|
2009-12-14 12:15:36 +01:00
|
|
|
endif
|
2007-06-20 13:26:36 +02:00
|
|
|
|
2009-05-05 22:04:52 +02:00
|
|
|
ifeq ($(ARCH)-$(BR2_GCC_SHARED_LIBGCC),powerpc-y)
|
2010-07-28 12:07:04 +02:00
|
|
|
ifneq ($(BR2_SOFT_FLOAT),)
|
2011-08-31 23:35:04 +02:00
|
|
|
support/scripts/apply-patches.sh $(GCC_DIR) toolchain/gcc/$(GCC_VERSION) powerpc-link-with-math-lib.patch.conditional
|
2009-05-05 22:04:52 +02:00
|
|
|
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
|
|
|
|
|
|
|
$(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) \
|
2010-12-31 12:39:01 +01:00
|
|
|
--prefix=$(HOST_DIR)/usr \
|
2007-06-20 13:26:36 +02:00
|
|
|
--build=$(GNU_HOST_NAME) \
|
|
|
|
--host=$(GNU_HOST_NAME) \
|
2012-06-08 03:52:16 +02:00
|
|
|
--target=$(GNU_TARGET_NAME) \
|
2007-06-20 13:26:36 +02:00
|
|
|
--enable-languages=c \
|
2012-04-17 06:45:26 +02:00
|
|
|
--with-sysroot=$(TOOLCHAIN_DIR)/uClibc_dev/ \
|
2007-06-20 13:26:36 +02:00
|
|
|
--disable-__cxa_atexit \
|
2010-11-03 20:08:21 +01:00
|
|
|
$(GCC_OPTSPACE) \
|
2011-04-13 18:29:29 +02:00
|
|
|
$(GCC_QUADMATH) \
|
2011-05-02 20:16:41 +02:00
|
|
|
$(GCC_ENABLE_OPENMP) \
|
2007-06-20 13:26:36 +02:00
|
|
|
--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) \
|
2010-11-03 19:59:31 +01:00
|
|
|
$(GCC_WITH_HOST_MPC) \
|
2007-06-20 13:26:36 +02:00
|
|
|
$(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) \
|
2010-11-09 17:27:37 +01:00
|
|
|
$(GCC_WITH_ABI) $(GCC_WITH_ARCH) $(GCC_WITH_TUNE) $(GCC_WITH_CPU) \
|
2012-12-12 21:22:29 +01:00
|
|
|
$(DISABLE_LARGEFILE) \
|
2007-10-01 14:56:24 +02:00
|
|
|
$(EXTRA_GCC_CONFIG_OPTIONS) \
|
|
|
|
)
|
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
|
|
|
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
|
2012-06-08 03:52:16 +02:00
|
|
|
$(gcc_initial) $(HOST_DIR)/usr/bin/$(GNU_TARGET_NAME)-gcc: $(GCC_BUILD_DIR1)/.compiled
|
2010-07-28 09:11:37 +02:00
|
|
|
PATH=$(TARGET_PATH) $(MAKE) -C $(GCC_BUILD_DIR1) install-gcc
|
2007-09-01 20:46:46 +02:00
|
|
|
touch $(gcc_initial)
|
2007-06-20 13:26:36 +02:00
|
|
|
|
2012-06-08 03:52:16 +02:00
|
|
|
gcc_initial: $(GCC_HOST_PREREQ) host-binutils $(HOST_DIR)/usr/bin/$(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)
|
|
|
|
(cd $(GCC_BUILD_DIR2); rm -rf config.cache; \
|
|
|
|
$(HOST_CONFIGURE_OPTS) \
|
|
|
|
$(GCC_DIR)/configure $(QUIET) \
|
2010-12-31 12:39:01 +01:00
|
|
|
--prefix=$(HOST_DIR)/usr \
|
2010-07-28 09:11:37 +02:00
|
|
|
--build=$(GNU_HOST_NAME) \
|
|
|
|
--host=$(GNU_HOST_NAME) \
|
2012-06-08 03:52:16 +02:00
|
|
|
--target=$(GNU_TARGET_NAME) \
|
2010-07-28 09:11:37 +02:00
|
|
|
--enable-languages=c \
|
2012-04-17 06:45:26 +02:00
|
|
|
--with-sysroot=$(TOOLCHAIN_DIR)/uClibc_dev/ \
|
2010-07-28 09:11:37 +02:00
|
|
|
--disable-__cxa_atexit \
|
2010-11-03 20:08:21 +01:00
|
|
|
$(GCC_OPTSPACE) \
|
2011-04-13 18:29:29 +02:00
|
|
|
$(GCC_QUADMATH) \
|
2011-05-02 20:16:41 +02:00
|
|
|
$(GCC_ENABLE_OPENMP) \
|
2010-07-28 09:11:37 +02:00
|
|
|
--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) \
|
2010-11-03 19:59:31 +01:00
|
|
|
$(GCC_WITH_HOST_MPC) \
|
2010-07-28 09:11:37 +02:00
|
|
|
$(DISABLE_NLS) \
|
|
|
|
$(THREADS) \
|
|
|
|
$(MULTILIB) \
|
|
|
|
$(GCC_DECIMAL_FLOAT) \
|
|
|
|
$(SOFT_FLOAT_CONFIG_OPTION) \
|
2010-11-09 17:27:37 +01:00
|
|
|
$(GCC_WITH_ABI) $(GCC_WITH_ARCH) $(GCC_WITH_TUNE) $(GCC_WITH_CPU) \
|
2012-12-12 21:22:29 +01:00
|
|
|
$(DISABLE_LARGEFILE) \
|
2010-07-28 09:11:37 +02:00
|
|
|
$(EXTRA_GCC_CONFIG_OPTIONS) \
|
|
|
|
)
|
|
|
|
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)
|
|
|
|
|
2012-06-08 03:52:16 +02:00
|
|
|
gcc_intermediate: uclibc-configured $(HOST_DIR)/usr/bin/$(GNU_TARGET_NAME)-gcc
|
2010-07-28 09:11:37 +02:00
|
|
|
|
|
|
|
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.
|
2012-06-08 03:52:16 +02:00
|
|
|
ln -snf ../include/ $(HOST_DIR)/usr/$(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-12-31 12:39:01 +01:00
|
|
|
--prefix=$(HOST_DIR)/usr \
|
2007-06-20 13:26:36 +02:00
|
|
|
--build=$(GNU_HOST_NAME) \
|
|
|
|
--host=$(GNU_HOST_NAME) \
|
2012-06-08 03:52:16 +02:00
|
|
|
--target=$(GNU_TARGET_NAME) \
|
2007-07-31 17:07:06 +02:00
|
|
|
--enable-languages=$(GCC_CROSS_LANGUAGES) \
|
2012-04-17 06:45:26 +02:00
|
|
|
--with-sysroot=$(STAGING_DIR) \
|
2012-06-08 03:52:16 +02:00
|
|
|
--with-build-time-tools=$(HOST_DIR)/usr/$(GNU_TARGET_NAME)/bin \
|
2007-06-20 13:26:36 +02:00
|
|
|
--disable-__cxa_atexit \
|
2010-11-03 20:08:21 +01:00
|
|
|
$(GCC_OPTSPACE) \
|
2011-04-13 18:29:29 +02:00
|
|
|
$(GCC_QUADMATH) \
|
2011-05-02 20:16:41 +02:00
|
|
|
$(GCC_ENABLE_OPENMP) \
|
2007-06-20 13:26:36 +02:00
|
|
|
--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) \
|
2010-11-03 19:59:31 +01:00
|
|
|
$(GCC_WITH_HOST_MPC) \
|
2007-06-20 13:26:36 +02:00
|
|
|
$(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) \
|
2010-11-09 17:27:37 +01:00
|
|
|
$(GCC_WITH_ABI) $(GCC_WITH_ARCH) $(GCC_WITH_TUNE) $(GCC_WITH_CPU) \
|
2007-06-20 13:26:36 +02:00
|
|
|
$(DISABLE_LARGEFILE) \
|
2007-10-01 14:56:24 +02:00
|
|
|
$(EXTRA_GCC_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"; \
|
2012-06-08 03:52:16 +02:00
|
|
|
rm "$(STAGING_DIR)/usr/$(GNU_TARGET_NAME)/lib64";\
|
2007-06-20 13:26:36 +02:00
|
|
|
fi
|
|
|
|
# Strip the host binaries
|
|
|
|
ifeq ($(GCC_STRIP_HOST_BINARIES),true)
|
2012-06-08 03:52:16 +02:00
|
|
|
strip --strip-all -R .note -R .comment $(filter-out %-gccbug %-embedspu,$(wildcard $(HOST_DIR)/usr/bin/$(GNU_TARGET_NAME)-*))
|
2007-06-20 13:26:36 +02:00
|
|
|
endif
|
|
|
|
# Make sure we have 'cc'.
|
2012-06-08 03:52:16 +02:00
|
|
|
if [ ! -e $(HOST_DIR)/usr/bin/$(GNU_TARGET_NAME)-cc ]; then \
|
|
|
|
ln -snf $(GNU_TARGET_NAME)-gcc \
|
|
|
|
$(HOST_DIR)/usr/bin/$(GNU_TARGET_NAME)-cc; \
|
2007-08-21 21:20:18 +02:00
|
|
|
fi
|
2012-06-08 03:52:16 +02:00
|
|
|
if [ ! -e $(HOST_DIR)/usr/$(GNU_TARGET_NAME)/bin/cc ]; then \
|
|
|
|
ln -snf gcc $(HOST_DIR)/usr/$(GNU_TARGET_NAME)/bin/cc; \
|
2007-08-21 21:20:18 +02:00
|
|
|
fi
|
2012-06-23 21:26:16 +02:00
|
|
|
# arch-linux-* symlinks
|
|
|
|
cd $(HOST_DIR)/usr/bin; for i in $(GNU_TARGET_NAME)-*; do \
|
|
|
|
ln -snf $$i $(ARCH)-linux$${i##$(GNU_TARGET_NAME)}; \
|
|
|
|
done
|
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)
|
2010-12-31 12:39:01 +01:00
|
|
|
# These go in /lib, so...
|
2007-06-20 13:26:36 +02:00
|
|
|
rm -rf $(TARGET_DIR)/usr/lib/libgcc_s*.so*
|
2012-06-08 03:52:16 +02:00
|
|
|
-cp -dpf $(HOST_DIR)/usr/$(GNU_TARGET_NAME)/lib*/libgcc_s* \
|
2010-12-31 12:39:02 +01:00
|
|
|
$(STAGING_DIR)/lib/
|
2012-06-08 03:52:16 +02:00
|
|
|
-cp -dpf $(HOST_DIR)/usr/$(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
|
2012-06-08 03:52:16 +02:00
|
|
|
-cp -dpf $(HOST_DIR)/usr/$(GNU_TARGET_NAME)/lib*/libstdc++.so* \
|
2010-12-31 12:39:02 +01:00
|
|
|
$(STAGING_DIR)/usr/lib/
|
2012-06-08 03:52:16 +02:00
|
|
|
-cp -dpf $(HOST_DIR)/usr/$(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
|
2011-05-02 20:16:41 +02:00
|
|
|
ifeq ($(BR2_GCC_ENABLE_OPENMP),y)
|
2012-06-08 03:52:16 +02:00
|
|
|
cp -dpf $(HOST_DIR)/usr/$(GNU_TARGET_NAME)/lib*/libgomp.so* $(STAGING_DIR)/usr/lib/
|
|
|
|
cp -dpf $(HOST_DIR)/usr/$(GNU_TARGET_NAME)/lib*/libgomp.so* $(TARGET_DIR)/usr/lib/
|
2011-05-02 20:16:41 +02:00
|
|
|
-$(STRIPCMD) $(STRIP_STRIP_UNNEEDED) $(TARGET_DIR)/usr/lib/libgomp.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 $@
|
|
|
|
|
2012-06-08 03:52:16 +02:00
|
|
|
cross_compiler:=$(HOST_DIR)/usr/bin/$(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 \
|
2010-12-31 12:39:01 +01:00
|
|
|
rm -f $(HOST_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-12-31 12:39:01 +01:00
|
|
|
$(GCC_BUILD_DIR4)/.prepared: $(STAMP_DIR)/gcc_libs_target_installed
|
2010-11-03 19:59:31 +01:00
|
|
|
mkdir -p $(GCC_BUILD_DIR4)
|
2007-06-20 13:26:36 +02:00
|
|
|
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) \
|
2012-06-08 03:52:16 +02:00
|
|
|
--host=$(GNU_TARGET_NAME) \
|
|
|
|
--target=$(GNU_TARGET_NAME) \
|
2007-06-20 13:26:36 +02:00
|
|
|
--enable-languages=$(GCC_TARGET_LANGUAGES) \
|
|
|
|
--with-gxx-include-dir=/usr/include/c++ \
|
|
|
|
--disable-__cxa_atexit \
|
2011-04-13 18:29:29 +02:00
|
|
|
$(GCC_OPTSPACE) \
|
|
|
|
$(GCC_QUADMATH) \
|
2011-05-02 20:16:41 +02:00
|
|
|
$(GCC_ENABLE_OPENMP) \
|
2007-06-20 13:26:36 +02:00
|
|
|
--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) \
|
|
|
|
$(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) \
|
2010-11-09 17:27:37 +01:00
|
|
|
$(GCC_WITH_ABI) $(GCC_WITH_ARCH) $(GCC_WITH_TUNE) $(GCC_WITH_CPU) \
|
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) \
|
|
|
|
)
|
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 $@
|
|
|
|
|
2012-06-08 03:52:16 +02:00
|
|
|
GCC_LIB_SUBDIR=lib/gcc/$(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++
|
2012-06-08 03:52:16 +02:00
|
|
|
rm -f $(TARGET_DIR)/usr/bin/$(GNU_TARGET_NAME)-gcc*
|
|
|
|
rm -f $(TARGET_DIR)/usr/bin/$(GNU_TARGET_NAME)-g++*
|
|
|
|
rm -f $(TARGET_DIR)/usr/bin/$(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"; \
|
2010-12-31 12:39:01 +01:00
|
|
|
cp -f $(HOST_DIR)/$(GCC_LIB_SUBDIR)/$(GCC_INCLUDE_DIR)/syslimits.h \
|
2009-01-22 11:04:30 +01:00
|
|
|
$(TARGET_DIR)/usr/$(GCC_LIB_SUBDIR)/$(GCC_INCLUDE_DIR)/; \
|
2007-06-20 13:26:36 +02:00
|
|
|
fi
|
2011-04-13 18:29:28 +02:00
|
|
|
|
2007-06-20 13:26:36 +02:00
|
|
|
# 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
|
2011-04-13 18:29:28 +02:00
|
|
|
|
|
|
|
# Copy C runtime initialization object files
|
|
|
|
cp -f $(STAGING_DIR)/usr/lib/*crt*.o $(TARGET_DIR)/usr/lib
|
|
|
|
|
2007-06-20 13:26:36 +02:00
|
|
|
# These are in /lib, so...
|
2011-04-13 18:29:28 +02:00
|
|
|
rm -rf $(TARGET_DIR)/usr/lib/libgcc_s*.so*
|
2007-06-20 13:26:36 +02:00
|
|
|
touch -c $@
|
|
|
|
|
2011-02-10 15:19:09 +01:00
|
|
|
gcc_target: $(STAMP_DIR)/gcc_libs_target_installed $(GCC_TARGET_PREREQ) binutils $(TARGET_DIR)/usr/bin/gcc
|
2007-06-20 13:26:36 +02:00
|
|
|
|
|
|
|
gcc_target-clean:
|
2010-07-28 09:11:37 +02:00
|
|
|
rm -rf $(GCC_BUILD_DIR4)
|
2012-06-08 03:52:16 +02:00
|
|
|
rm -f $(TARGET_DIR)/usr/bin/$(GNU_TARGET_NAME)*
|
2007-06-20 13:26:36 +02:00
|
|
|
|
|
|
|
gcc_target-dirclean:
|
2010-07-28 09:11:37 +02:00
|
|
|
rm -rf $(GCC_BUILD_DIR4)
|
2012-04-17 06:45:31 +02:00
|
|
|
|
|
|
|
ifeq ($(BR2_PACKAGE_GCC_TARGET),y)
|
|
|
|
TARGETS+=gcc_target
|
|
|
|
endif
|