From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4522 invoked by alias); 19 Oct 2011 03:24:23 -0000 Received: (qmail 4511 invoked by uid 22791); 19 Oct 2011 03:24:22 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from snapmx1.ironport.snap.net.nz (HELO snapmx1.ironport.snap.net.nz) (202.37.100.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 19 Oct 2011 03:24:07 +0000 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvsEAIpBnk57/y/M/2dsb2JhbABEqHCCdT8/PBUfThO9SogbBJknjEI Received: from rupert.snap.net.nz ([202.37.100.140]) by smtp1.ironport.snap.net.nz with ESMTP; 19 Oct 2011 16:24:05 +1300 X-Sender-IP: 123.255.47.204 X-Sender-IP: 123.255.47.204 Received: from [127.0.1.1] (204.47.255.123.static.snap.net.nz [123.255.47.204]) by rupert.snap.net.nz (Postfix) with ESMTPS id B01A5255B9; Wed, 19 Oct 2011 16:24:05 +1300 (NZDT) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [PATCH] scripts: support an empty vendor string X-Mercurial-Node: 5b1330e7264a72b0b50243394469606ef0f76351 Message-Id: <5b1330e7264a72b0b502.1318994645@crucis> User-Agent: Mercurial-patchbomb/1.7.5 Date: Wed, 19 Oct 2011 03:24:00 -0000 From: Michael Hope To: "Yann E. MORIN" Cc: crossgcc@sourceware.org X-IsSubscribed: yes Mailing-List: contact crossgcc-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: crossgcc-owner@sourceware.org X-SW-Source: 2011-10/txt/msg00047.txt.bz2 # HG changeset patch # User Michael Hope # Date 1318994616 -46800 # Node ID 5b1330e7264a72b0b50243394469606ef0f76351 # Parent a31d097e28cd73d07a5484129929a500b4d58efa scripts: support an empty vendor string For Linux and other targets, config.sub defaults to 'unknown' if no vendor was specified. This patch supplies a fake vendor and then strips it out afterwards. This is needed to have an Ubuntu style vendorless tuple such as arm-linux-gnueabi. Other features like the alias and sed transform don't cover it. Signed-off-by: Michael Hope diff -r a31d097e28cd -r 5b1330e7264a scripts/functions --- a/scripts/functions Wed Oct 19 15:27:32 2011 +1300 +++ b/scripts/functions Wed Oct 19 16:23:36 2011 +1300 @@ -944,6 +944,20 @@ fi } +# Computes the target tuple from the configuration and the supplied +# vendor string +CT_BuildOneTargetTuple() { + local vendor="${1}" + local target + + target="${CT_TARGET_ARCH}" + target="${target}${vendor:+-${vendor}}" + target="${target}${CT_TARGET_KERNEL:+-${CT_TARGET_KERNEL}}" + target="${target}${CT_TARGET_SYS:+-${CT_TARGET_SYS}}" + + echo "${target}" +} + # Compute the target tuple from what is provided by the user # Usage: CT_DoBuildTargetTuple # In fact this function takes the environment variables to build the target @@ -994,10 +1008,7 @@ CT_DoKernelTupleValues # Finish the target tuple construction - CT_TARGET="${CT_TARGET_ARCH}" - CT_TARGET="${CT_TARGET}${CT_TARGET_VENDOR:+-${CT_TARGET_VENDOR}}" - CT_TARGET="${CT_TARGET}${CT_TARGET_KERNEL:+-${CT_TARGET_KERNEL}}" - CT_TARGET="${CT_TARGET}${CT_TARGET_SYS:+-${CT_TARGET_SYS}}" + CT_TARGET=$(CT_BuildOneTargetTuple "${CT_TARGET_VENDOR}") # Sanity checks __sed_alias="" @@ -1012,7 +1023,14 @@ esac # Canonicalise it - CT_TARGET=$(CT_DoConfigSub "${CT_TARGET}") + if [ -n "${CT_TARGET_VENDOR}" ]; then + CT_TARGET=$(CT_DoConfigSub "${CT_TARGET}") + else + # Canonicalise with a fake vendor string then strip it out + local target=$(CT_BuildOneTargetTuple "CT_INVALID") + CT_TARGET=$(CT_DoConfigSub "${target}" |sed -r -s s:CT_INVALID-::) + fi + # Prepare the target CFLAGS CT_ARCH_TARGET_CFLAGS="${CT_ARCH_TARGET_CFLAGS} ${CT_ARCH_ENDIAN_CFLAG}" CT_ARCH_TARGET_CFLAGS="${CT_ARCH_TARGET_CFLAGS} ${CT_ARCH_ARCH_CFLAG}" -- For unsubscribe information see http://sourceware.org/lists.html#faq