From patchwork Fri Dec 7 15:39:13 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 13418 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 4FF4E23FCC for ; Fri, 7 Dec 2012 15:39:25 +0000 (UTC) Received: from mail-ie0-f170.google.com (mail-ie0-f170.google.com [209.85.223.170]) by fiordland.canonical.com (Postfix) with ESMTP id DD38BA19B90 for ; Fri, 7 Dec 2012 15:39:24 +0000 (UTC) Received: by mail-ie0-f170.google.com with SMTP id k10so1422205iea.15 for ; Fri, 07 Dec 2012 07:39:24 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:x-gm-message-state; bh=OET67i9SXliYJakpC2EzogpHsiCl+jN0yK9l9Od1S04=; b=enorsF4B+CCAHDt0gsq+VNfhXL5UhmGNyDGLp2p75BVlGRgN1K88PnFopceBhsVlbA KcDqddxF6OnPfgj0DRV69VJInPcXmK+JEyB1/rzcamQepeX3PDxN9d41Uea94ffIHZXE kzbeFhw05BckGomAiqibTY87alT/SxUAIIXAvVAjj1APZdiGhWI1FjJACwthFpB9yzuh IZI0lzB8vit9g7Tr8dq+4VW4gSBPKssZy1nGJaoiblCpTFEM6Ta5zDAF/0NuaE5T1ZSj MUX6d8qxDOr8e38jQCi09+F+23jrLdKGwLaMsv9QrnjS56XgSUZRDzv4nhtrRhaVI9oB 8t4Q== Received: by 10.50.152.137 with SMTP id uy9mr5184677igb.62.1354894764242; Fri, 07 Dec 2012 07:39:24 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.67.148 with SMTP id n20csp481313igt; Fri, 7 Dec 2012 07:39:23 -0800 (PST) Received: by 10.180.80.201 with SMTP id t9mr9350241wix.0.1354894762797; Fri, 07 Dec 2012 07:39:22 -0800 (PST) Received: from mnementh.archaic.org.uk (1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.d.1.0.0.b.8.0.1.0.0.2.ip6.arpa. [2001:8b0:1d0::1]) by mx.google.com with ESMTPS id ck10si16328696wib.10.2012.12.07.07.39.22 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 07 Dec 2012 07:39:22 -0800 (PST) Received-SPF: neutral (google.com: 2001:8b0:1d0::1 is neither permitted nor denied by best guess record for domain of pm215@archaic.org.uk) client-ip=2001:8b0:1d0::1; Authentication-Results: mx.google.com; spf=neutral (google.com: 2001:8b0:1d0::1 is neither permitted nor denied by best guess record for domain of pm215@archaic.org.uk) smtp.mail=pm215@archaic.org.uk Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.72) (envelope-from ) id 1Th01B-0005o9-PY; Fri, 07 Dec 2012 15:39:13 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org, Paolo Bonzini , Anthony Liguori , =?UTF-8?q?Andreas=20F=C3=A4rber?= Subject: [PATCH v2] configure: Default to 'cc', not 'gcc' Date: Fri, 7 Dec 2012 15:39:13 +0000 Message-Id: <1354894753-22302-1-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.2.5 X-Gm-Message-State: ALoCoQl765tSq12id2/3nVg4WEEY/uIMvWzxaGDxwZztdH6ISjnBZitsn1Iumv5a+Q42y9iE2OA5 Default to 'cc' as our compiler, rather than 'gcc'. We used to have to insist on gcc when we still kept the CPU env in a fixed global register, but this is no longer necessary and we will now compile OK on clang as well as gcc. Using 'cc' should generally result in us using the most standard and maintained system compiler for the platform. (For instance on newer MacOS X 'gcc' exists but is an elderly compiler provided mostly for legacy reasons, and 'cc' (which is clang) is definitely the better choice.) On Linux there will generally be no user-visible change since cc will be gcc. This changeover necessitates a slight reworking of how we set the 'cc' variable, because GNU cross toolchains generally provide a '${cross_prefix}gcc' but not a '${cross_prefix}cc'. Signed-off-by: Peter Maydell --- MacOS X is the main aim here but BSDs would probably also prefer to default to 'cc'. Previous macos-specific version of this patch: http://patchwork.ozlabs.org/patch/199685/ configure | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 994f731..88c8f15 100755 --- a/configure +++ b/configure @@ -116,7 +116,7 @@ audio_drv_list="" audio_card_list="ac97 es1370 sb16 hda" audio_possible_cards="ac97 es1370 sb16 cs4231a adlib gus hda" block_drv_whitelist="" -host_cc="gcc" +host_cc="cc" libs_softmmu="" libs_tools="" audio_pt_int="" @@ -250,7 +250,16 @@ done # Using uname is really, really broken. Once we have the right set of checks # we can eliminate its usage altogether. -cc="${CC-${cross_prefix}gcc}" +# Preferred compiler: +# ${CC} (if set) +# ${cross_prefix}gcc (if cross-prefix specified) +# system compiler +if test -z "${CC}${cross_prefix}"; then + cc="$host_cc" +else + cc="${CC-${cross_prefix}gcc}" +fi + ar="${AR-${cross_prefix}ar}" objcopy="${OBJCOPY-${cross_prefix}objcopy}" ld="${LD-${cross_prefix}ld}"