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: 204529 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 3D7F82C0172 for ; Sat, 8 Dec 2012 02:40:09 +1100 (EST) Received: from localhost ([::1]:58098 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Th01z-0005Sc-MC for incoming@patchwork.ozlabs.org; Fri, 07 Dec 2012 10:40:03 -0500 Received: from eggs.gnu.org ([208.118.235.92]:49566) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Th01Y-0004cx-5C for qemu-devel@nongnu.org; Fri, 07 Dec 2012 10:39:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Th01Q-0007QO-4V for qemu-devel@nongnu.org; Fri, 07 Dec 2012 10:39:36 -0500 Received: from 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]:60737 helo=mnementh.archaic.org.uk) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Th01P-0007OB-TW for qemu-devel@nongnu.org; Fri, 07 Dec 2012 10:39:28 -0500 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 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-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:8b0:1d0::1 Cc: Paolo Bonzini , Anthony Liguori , =?UTF-8?q?Andreas=20F=C3=A4rber?= , patches@linaro.org Subject: [Qemu-devel] [PATCH v2] configure: Default to 'cc', not 'gcc' X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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}"