From patchwork Fri Nov 16 16:37:23 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 12900 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 7A2CD23E13 for ; Fri, 16 Nov 2012 16:37:32 +0000 (UTC) Received: from mail-ie0-f180.google.com (mail-ie0-f180.google.com [209.85.223.180]) by fiordland.canonical.com (Postfix) with ESMTP id 35455A1863F for ; Fri, 16 Nov 2012 16:37:32 +0000 (UTC) Received: by mail-ie0-f180.google.com with SMTP id e10so3719825iej.11 for ; Fri, 16 Nov 2012 08:37:31 -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=uQ58/48fYgFYk59oPFPsS10eyqbnhfhZMqi5RDS6X1Q=; b=nefcweYX/RzFqbUe8gf/KMfMF+fTAm/SSH8tLRkb7uEZnZCiSmUgrD1N78mpxrFuUF G/rZZlghWhD9J9etz4Hm15ylryQAvIzpoTh33FCe6aBXdIFpQa5q+qHT8ZC9sp5CLBJR u341g+0avCNPpNaHNMU+0/2UO96434wLlGCAVwkFZCv+HBwao0i5nmMTynRs3uYPZQc/ xEWuYNu0D21Eme6bmNH4J0sOKwX2CsvJ6Yp6sSKoqpdVyQ/r08+e2mSg9bK06A56CycW JrR3RGsj+ft8nYfHZbH6g7pLXgKgNjFeidwwuJOcLseWDSLxIdLKyAGmxCdWLFDTytyM eQig== Received: by 10.50.173.34 with SMTP id bh2mr3746320igc.70.1353083851591; Fri, 16 Nov 2012 08:37:31 -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 n20csp94582igt; Fri, 16 Nov 2012 08:37:30 -0800 (PST) Received: by 10.180.94.41 with SMTP id cz9mr6062102wib.2.1353083849767; Fri, 16 Nov 2012 08:37:29 -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 d10si1172458wiw.40.2012.11.16.08.37.29 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 16 Nov 2012 08:37:29 -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 1TZOux-0004TS-Sv; Fri, 16 Nov 2012 16:37:23 +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] configure: Default to 'cc', not 'gcc', on MacOS X Date: Fri, 16 Nov 2012 16:37:23 +0000 Message-Id: <1353083843-17175-1-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.2.5 X-Gm-Message-State: ALoCoQmNGeN/ZhHiqlgB0hhj1UGbavKkwtG9qZP3qZQMeiFDAndxqKsc4hSuEJVh+xLKYZAG2udH When building for MacOS X, default the C compiler to 'cc' (usually clang) rather than 'gcc'. This avoids the Apple 'gcc', which is generally an elderly llvm-gcc provided mostly for legacy purposes, in favour of the best supported compiler available on the platform. Signed-off-by: Peter Maydell --- I now seem to be getting failures to compile due to weak refs on clang as well, but defaulting to cc seems like a good long term plan anyway. I've mostly been building and testing with --cc=clang so this isn't a sudden compiler switch from my point of view. I'm ambivalent about whether this should go in 1.3 or not, given it doesn't actually fix the weakref issues. configure | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/configure b/configure index f847ee2..ec9932b 100755 --- a/configure +++ b/configure @@ -116,7 +116,13 @@ 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" +if test "$(uname -s)" = "Darwin"; then + # On MacOS X the standard supported system compiler is 'cc' (usually clang), + # and 'gcc' is a legacy llvm-gcc which is rather elderly and best avoided. + host_cc="cc" +else + host_cc="gcc" +fi libs_softmmu="" libs_tools="" audio_pt_int="" @@ -250,7 +256,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}"