From patchwork Sun Mar 24 08:26:30 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Petazzoni X-Patchwork-Id: 230386 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from fraxinus.osuosl.org (fraxinus.osuosl.org [140.211.166.137]) by ozlabs.org (Postfix) with ESMTP id 5FB5E2C00BE for ; Sun, 24 Mar 2013 19:28:05 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id D5F01101D71; Sun, 24 Mar 2013 08:27:48 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id cfRBocaGScSV; Sun, 24 Mar 2013 08:27:42 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 5E1C110B85C; Sun, 24 Mar 2013 08:27:09 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 221998F7A4 for ; Sun, 24 Mar 2013 08:27:17 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 857868BF6F for ; Sun, 24 Mar 2013 08:27:09 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id dDTD74EcrwJu for ; Sun, 24 Mar 2013 08:27:04 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail.free-electrons.com (mail.free-electrons.com [94.23.35.102]) by whitealder.osuosl.org (Postfix) with ESMTP id 050768C66A for ; Sun, 24 Mar 2013 08:27:03 +0000 (UTC) Received: by mail.free-electrons.com (Postfix, from userid 106) id C50AD864; Sun, 24 Mar 2013 09:27:02 +0100 (CET) Received: from localhost (humanoidz.org [82.247.183.72]) by mail.free-electrons.com (Postfix) with ESMTPSA id E885C73F for ; Sun, 24 Mar 2013 09:27:01 +0100 (CET) From: Thomas Petazzoni To: buildroot@uclibc.org Date: Sun, 24 Mar 2013 09:26:30 +0100 Message-Id: <1364113606-20836-7-git-send-email-thomas.petazzoni@free-electrons.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1364113606-20836-1-git-send-email-thomas.petazzoni@free-electrons.com> References: <1364113606-20836-1-git-send-email-thomas.petazzoni@free-electrons.com> Subject: [Buildroot] [PATCH 06/22] gcc: introduce BR2_GCC_NEEDS_MPC to reduce code duplication X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: buildroot-bounces@busybox.net For each version of gcc, we need to check whether it requires mpc as a dependency. Since this is true for 4.5, 4.6, 4.7, snapshots and now 4.8, let's factorize this code a bit by using a Kconfig symbol that tells us whether we are using a gcc version that requires mpc. Signed-off-by: Thomas Petazzoni --- toolchain/gcc/Config.in | 8 +++++++ toolchain/gcc/gcc-uclibc-4.x.mk | 44 +-------------------------------------- 2 files changed, 9 insertions(+), 43 deletions(-) diff --git a/toolchain/gcc/Config.in b/toolchain/gcc/Config.in index 1499c05..87d9cc1 100644 --- a/toolchain/gcc/Config.in +++ b/toolchain/gcc/Config.in @@ -2,6 +2,9 @@ comment "GCC Options" +config BR2_GCC_NEEDS_MPC + bool + choice prompt "GCC compiler Version" default BR2_GCC_VERSION_4_6_X if !BR2_avr32 && !BR2_sparc_sparchfleon && !BR2_sparc_sparchfleonv8 && !BR2_sparc_sparcsfleon && !BR2_sparc_sparcsfleonv8 @@ -24,22 +27,27 @@ choice config BR2_GCC_VERSION_4_5_X depends on !BR2_avr32 && !BR2_cortex_a15 && !BR2_sparc_sparchfleon && !BR2_sparc_sparchfleonv8 && !BR2_sparc_sparcsfleon && !BR2_sparc_sparcsfleonv8 + select BR2_GCC_NEEDS_MPC bool "gcc 4.5.x" config BR2_GCC_VERSION_4_6_X depends on !BR2_avr32 && !BR2_sparc_sparchfleon && !BR2_sparc_sparchfleonv8 && !BR2_sparc_sparcsfleon && !BR2_sparc_sparcsfleonv8 + select BR2_GCC_NEEDS_MPC bool "gcc 4.6.x" config BR2_GCC_VERSION_4_7_X depends on !BR2_avr32 && !BR2_sparc_sparchfleon && !BR2_sparc_sparchfleonv8 && !BR2_sparc_sparcsfleon && !BR2_sparc_sparcsfleonv8 + select BR2_GCC_NEEDS_MPC bool "gcc 4.7.x" config BR2_GCC_VERSION_4_8_X depends on !BR2_avr32 && !BR2_sparc_sparchfleon && !BR2_sparc_sparchfleonv8 && !BR2_sparc_sparcsfleon && !BR2_sparc_sparcsfleonv8 + select BR2_GCC_NEEDS_MPC bool "gcc 4.8.x" config BR2_GCC_VERSION_SNAP depends on !BR2_avr32 && !BR2_sparc_sparchfleon && !BR2_sparc_sparchfleonv8 && !BR2_sparc_sparcsfleon && !BR2_sparc_sparcsfleonv8 + select BR2_GCC_NEEDS_MPC bool "gcc snapshot" endchoice diff --git a/toolchain/gcc/gcc-uclibc-4.x.mk b/toolchain/gcc/gcc-uclibc-4.x.mk index 4f1bb49..db9715a 100644 --- a/toolchain/gcc/gcc-uclibc-4.x.mk +++ b/toolchain/gcc/gcc-uclibc-4.x.mk @@ -161,49 +161,7 @@ endif GCC_HOST_PREREQ = host-gmp host-mpfr GCC_TARGET_PREREQ += mpfr gmp -# GCC 4.5.x prerequisites -ifeq ($(findstring x4.5.,x$(GCC_VERSION)),x4.5.) -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 - -# GCC 4.6.x prerequisites -ifeq ($(findstring x4.6.,x$(GCC_VERSION)),x4.6.) -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 - -# 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 - -# GCC 4.8.x prerequisites -ifeq ($(findstring x4.8.,x$(GCC_VERSION)),x4.8.) -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 - -# GCC snapshot prerequisites -# Since we don't know and it can be quite new just ask for everything known -ifneq ($(GCC_SNAP_DATE),) +ifeq ($(BR2_GCC_NEEDS_MPC),y) GCC_WITH_HOST_MPC = --with-mpc=$(HOST_DIR)/usr GCC_TARGET_PREREQ += mpc ifeq ($(BR2_TOOLCHAIN_BUILDROOT),y)