From MAILER-DAEMON Tue May 04 23:00:31 2021 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1le7m3-0007vi-0r for mharc-config-patches@gnu.org; Tue, 04 May 2021 23:00:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55460) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1le6bK-0007cx-OV for config-patches@gnu.org; Tue, 04 May 2021 21:45:28 -0400 Received: from mail-oi1-x234.google.com ([2607:f8b0:4864:20::234]:35483) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1le6bD-0008Bo-VC for config-patches@gnu.org; Tue, 04 May 2021 21:45:22 -0400 Received: by mail-oi1-x234.google.com with SMTP id e25so796441oii.2 for ; Tue, 04 May 2021 18:45:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:date:from:reply-to:user-agent:mime-version:to:subject :content-transfer-encoding; bh=yoiCBOEZ6EzbLSJUtHe5I+v3M7PVJiR0oVzC9E11xZA=; b=WG2/aQkPcSKz3ZEJi3ztxxg4J3qhJNENxz0LsxkYQ72b1CxXyp4GBAzUt7lNID3WET 9zrYWHCa/8xNIEa9pD5QZk2k33B05LkwfR/FEWg09aaQQ8blvDuODUHZr7AReX5NwbaW c/54Bv4mMM0XoFyS/c4Z2w1R0Y2FQJyMWd/hpvb4RbunWa1bri9PTDBJm+9N2lKe3smy ap6q5X1CsdDSmdeAKhmo7ivAfQZMCz5aHwb/nuc3gMBFwkvSHbR2OmTghPbFbiJHr0Ds OKoXaXGFXuXGYPopnmbzvIVMKTJSESUFE0cGa6PZJCYnpEwioGWNZNcJ9TZPu3LGm8XG O1hQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:date:from:reply-to:user-agent :mime-version:to:subject:content-transfer-encoding; bh=yoiCBOEZ6EzbLSJUtHe5I+v3M7PVJiR0oVzC9E11xZA=; b=kPVWOyMk9CHZldefW1EosfORgePDIfuO4cgkvNZVyDZWZqRgVQ1HgBcT3R0dTgIpeY VDC6pHjl8Fv3CPbhA6SUA97WGtOSSoGPxrdIxOjyq/+ChIsYg2Jd8EimGQ1O8dBqe9fe T28WoNtpTCdVepqOkIk4rXWh2+IdoTj4Bk89oVsPD+0rZKmsAoO2P0aUz6GLYTvl5UU+ GlSbxS3gttqt2C5rAF7D7CE2xf8Re74Qbv2vxl/+2mlZarCjUqk8JSWl4W7dI1JQ1ajF uGUpxSZgAPdLKLVrmcThsd7qf2bmJJRFxvp7/4EjgzX24+xiOev7yRvgKahrdDGdtzPx pbsA== X-Gm-Message-State: AOAM533z0ohvfuCEihxVdKwalNPa5F73U4yTDTYb7Zd3yG5PpJ8KhtiX B5/BU42yUI2LVFDLCXwI89AU7/pTDxI= X-Google-Smtp-Source: ABdhPJzfe1tMRLpLAdRfxZkp3hcx3J/m9N8RwQTSeLk3sIWPZi7ko02TGYgt5NzpY8yqFXI6gYXnQQ== X-Received: by 2002:aca:3788:: with SMTP id e130mr4983006oia.45.1620179113824; Tue, 04 May 2021 18:45:13 -0700 (PDT) Received: from [192.168.2.42] (adsl-70-133-144-190.dsl.ablntx.sbcglobal.net. [70.133.144.190]) by smtp.gmail.com with ESMTPSA id p127sm1088301oig.16.2021.05.04.18.45.12 for (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 04 May 2021 18:45:13 -0700 (PDT) Message-ID: <6091F8A8.8070208@gmail.com> Date: Tue, 04 May 2021 20:45:12 -0500 From: Jacob Bachmeyer Reply-To: jcb62281@gmail.com User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.8.1.22) Gecko/20090807 MultiZilla/1.8.3.4e SeaMonkey/1.1.17 Mnenhy/0.7.6.0 MIME-Version: 1.0 To: config-patches@gnu.org Subject: config.guess is incompatible with pre-POSIX shells Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Received-SPF: pass client-ip=2607:f8b0:4864:20::234; envelope-from=jcb62281@gmail.com; helo=mail-oi1-x234.google.com X-Spam_score_int: -15 X-Spam_score: -1.6 X-Spam_bar: - X-Spam_report: (-1.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, FREEMAIL_REPLYTO_END_DIGIT=0.25, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Tue, 04 May 2021 23:00:30 -0400 X-BeenThere: config-patches@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Patches for the config.guess and config.sub scripts" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 May 2021 01:45:28 -0000 I am currently in the process of producing a DejaGnu release and I have run into a bit of a problem: unlike most GNU packages, DejaGnu installs config.guess and uses it at runtime if the build system triplet has not otherwise been specified. DejaGnu is installed into an architecture-independent tree, and therefore cannot rely on substitutions made by configure. On Solaris 10, /bin/sh is a non-POSIX shell and fails to execute config.guess because POSIX "$(...)" command substitutions are used instead of the traditional backticks. I have recently fixed similar non-portabilities in the shell scripts packaged with DejaGnu (thanks to Rainer Orth for reporting the issues) and would be willing to write a patch for config.guess and possibly config.sub to restore portability if that patch would be acceptable. -- Jacob From MAILER-DAEMON Wed May 05 17:57:31 2021 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1lePWN-0001vf-2b for mharc-config-patches@gnu.org; Wed, 05 May 2021 17:57:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50086) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lePWL-0001pf-99 for config-patches@gnu.org; Wed, 05 May 2021 17:57:29 -0400 Received: from smtprelay-out1.synopsys.com ([149.117.87.133]:57562) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lePWE-0005ci-Jw for config-patches@gnu.org; Wed, 05 May 2021 17:57:28 -0400 Received: from mailhost.synopsys.com (sv2-mailhost1.synopsys.com [10.205.2.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by smtprelay-out1.synopsys.com (Postfix) with ESMTPS id A97FCC0097; Wed, 5 May 2021 21:57:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1620251837; bh=XzzaDX8PbjyjOF4uxroAFhyrwkqCS4EyxFblsm0Bqsk=; h=From:To:CC:Subject:Date:References:In-Reply-To:From; b=W0oVO8JtNKii8XGN4KunVR+h3On4YfzEv5O3lu6AugI5Tb8sW0phqkWuOlTBB947q q4Mpp8IdsanSpkKnSuhnq8thdDvTazwhdN3pFkWRWJ/jin8+fGTb6aLTNsqmDkEXU7 PpnzMePLFTDYhmrxRuiSLQoS7D+u8MYk5ADd7wtR51MRSQ/CbUYuAnN+gvLC6y8nrl EZFFrAScPItuWIWeTYDWZGITYRIGPhBBz7Gb0DMXe5dfqbK1BSggoEFIxHey18TTuk Pky1wNQLa+TNTxNHjs2UXkMcIAlx8t5mvyCyrPxWCWq1dhi90cacyc0047BfDiOlnU GsbrjyHMTKYHA== Received: from o365relay-in.synopsys.com (sv2-o365relay3.synopsys.com [10.202.1.139]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by mailhost.synopsys.com (Postfix) with ESMTPS id 37D67A0096; Wed, 5 May 2021 21:57:14 +0000 (UTC) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2175.outbound.protection.outlook.com [104.47.59.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "DigiCert Cloud Services CA-1" (verified OK)) by o365relay-in.synopsys.com (Postfix) with ESMTPS id 8509D40155; Wed, 5 May 2021 21:57:13 +0000 (UTC) Authentication-Results: o365relay-in.synopsys.com; dmarc=pass (p=reject dis=none) header.from=synopsys.com Authentication-Results: o365relay-in.synopsys.com; spf=pass smtp.mailfrom=vgupta@synopsys.com Authentication-Results: o365relay-in.synopsys.com; dkim=pass (1024-bit key; unprotected) header.d=synopsys.com header.i=@synopsys.com header.b="n8sXWGtd"; dkim-atps=neutral ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NGlbbYq6HcpncQYHUCP36QyeXgnRaSQY9w/JI9YPaLT11Fc6/uO4Polu8OFGkoLV7G85MCVV+ihEAgJ9IEhRdMOcLh666K3kwHBXU/CEwpYiqIZ1ZN54J8NSuw9DQNlnDXbU5SH8ZyUPjgCACfxSXJSMBkHEkVHuwGrx40nI0qXm/Caj19B1HrwMOh3YazFBqVqK+uGgbs0XkdzmS7iAbtdOpDQi9THP6lx2o7/NcbqWT63Y4VNOGPrC4D6twanGlCDTmcbQy2e1jaUgn1HCZdgXwbVOyO+kf0b/gERZx6UMLwHsuaM1GHnOTww9tXln5HwIEMboAbhQGtpz1/jb5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=XzzaDX8PbjyjOF4uxroAFhyrwkqCS4EyxFblsm0Bqsk=; b=k192IWPC5gc23MhbfiXB3NHt7gUIsdLvGS/MVgcfhRrax43lX5KjMYBl02+cshKWtV0sSxnpDiNHgge+fWMN5rUac4QkJS3R+r8C02NP0x1zLmhlIx1UsiV+Oc0JAhAkmdXP407jfMIdv2G4EcuOrP2+UPi+Xy9PDePPk0sYqUtJXrIadhSIPBgP/3Jk8jBek49lByqBsli12vlI4BracpZdOSKWA1Ur6m6GyUgbjUEv64Dn+XHRS50ohpiOP41/2Py0DWVvaTCxC5kgIGARr6s3YvHdbtNqnv1g5LuDDIeGuo2Gc9r1w8IoZlseaNV1JzcYbGZ1c6HRisvoOjLR7g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=synopsys.com; dmarc=pass action=none header.from=synopsys.com; dkim=pass header.d=synopsys.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=synopsys.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=XzzaDX8PbjyjOF4uxroAFhyrwkqCS4EyxFblsm0Bqsk=; b=n8sXWGtduwSdT6+m/zaZf2yN204Q2Qm0hDxAViUDd9ePeCEVHLORLz28ApRDv2fVpVUNpqa8DSV87He5VTgjvgNHEUp6nVGhPw8Uw57hTR0sfTaugnrUwvpTKZc2kvzwjAbwWjNyF1yL1nsw7qBjSdoc++CpmF/7TXRQYdGqGXg= Received: from BYAPR12MB3479.namprd12.prod.outlook.com (2603:10b6:a03:dc::26) by BY5PR12MB3827.namprd12.prod.outlook.com (2603:10b6:a03:1ab::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4087.38; Wed, 5 May 2021 21:57:10 +0000 Received: from BYAPR12MB3479.namprd12.prod.outlook.com ([fe80::d1a0:ed05:b9cc:e94d]) by BYAPR12MB3479.namprd12.prod.outlook.com ([fe80::d1a0:ed05:b9cc:e94d%7]) with mapi id 15.20.4108.026; Wed, 5 May 2021 21:57:10 +0000 X-SNPS-Relay: synopsys.com From: Vineet Gupta To: "config-patches@gnu.org" CC: "linux-snps-arc@lists.infradead.org" Subject: Re: [PATCH] Recognize arc64 Thread-Topic: [PATCH] Recognize arc64 Thread-Index: AQHXNue0QgK3e27ljUOU/Vw8g57r4KrVhWGA Date: Wed, 5 May 2021 21:57:10 +0000 Message-ID: References: <20210421195118.158464-1-vgupta@synopsys.com> In-Reply-To: <20210421195118.158464-1-vgupta@synopsys.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: user-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 authentication-results: gnu.org; dkim=none (message not signed) header.d=none;gnu.org; dmarc=none action=none header.from=synopsys.com; x-originating-ip: [149.117.75.11] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 03049dd0-cf1a-4bee-a945-08d91010bba0 x-ms-traffictypediagnostic: BY5PR12MB3827: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:5797; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: zxcWb8m7TFTIJocniF4axOm+eKWmsmPW60PJstnk+/Pz22/zdlBHq8xvcZuEcaabaexz/QOiCL8PGO9ggjLcfbt9bDC+LUQg4txQd19HGNcK8yNkJIMcQl3Snyay/+g4XMXLiThVZqqrZ2R3JomhnYtjGCtSQICGV/T+IAn4NqTkX7bVQ4afGkS3RAP/a3NkqkOjgHaa/xaWeLUAgg57m7p9H0ybp81g+nKkjURh/iugZme8hmP/l1cmwtIGkt4V+RLP+jZQhiKG7Khxta6qDefDS9ATL0Og1Meeg9cSgSrNhhLr/CarVqedZqyBvNHM0fVuB9Mu5D0C1gvarsyf1tWcpwsdomPuffDG/sfFgrocx2dsnFXluWV8l1Eoq57ZAjhCKwHc2c6/runyLNOG8Zw+QAi2n6zyOaNI5IQ+VT9acPggNHPlLexo9r16iEqIEmDPTsNtEPiMc3+hUNCsVTckbOInnDVU4zxti65VlBRlwBJjhPz0xL3oEsg2bBJsjBiUo/Bo+zrrvMynoyS1Xqzdq+xX3Tj1ehvlfoLeNPpw63Irn5lsn7uNzftiTvIP1W5c5OiWrCQtYI5svr7vycrRBx1frQpgTc7ei4RO2keTvpfDH8tERUZJFGsEoDLZImYwwpDhA1xiLJCqwNCJ+6y00+WmwZ3PnM1X53/bXnT8kkRDZaF0NpHzIAbsXSdRtnaF9P/sdV8uMPGx5yDXeQ== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BYAPR12MB3479.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(396003)(136003)(376002)(366004)(346002)(39850400004)(83380400001)(186003)(64756008)(66476007)(26005)(76116006)(66946007)(36756003)(71200400001)(6512007)(31686004)(2616005)(6916009)(66446008)(6506007)(66556008)(4326008)(8676002)(31696002)(2906002)(6486002)(122000001)(316002)(478600001)(53546011)(86362001)(38100700002)(5660300002)(8936002)(2004002)(45980500001)(43740500002); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata: =?utf-8?B?RlFYakpYeWtXWER2dlBzOUhsUHk0dGptbDNlYTR1YmRaWlFKRjBDSlFVb0JY?= =?utf-8?B?RHpxVEpLNmRRYVJWUmtlV21qcDIyak94b2VlRXh0eGhyTjRQTmFXcGhya0V5?= =?utf-8?B?TmtBR2gyZXhtbXpZMndYRXEzc1RwQkV6amtSQlFqL0duK0tmYmRZZDZJbW1V?= =?utf-8?B?b3l3dEZZTHkxQ2RPV3FTUHJXQ3lPWHpodlRFek0wSlN1L1phUThsb2JUOEJs?= =?utf-8?B?TktjckRncUE1YTBEamdrb0xrUGtnUVVYaS80Q0h3NWN0WGdTR0tRR0xBbjdy?= =?utf-8?B?QmxVREJ4MkVGVHM4a012WTF6emozSUROZ1AzV2JoTG9XckFhejcycjc0NmNs?= =?utf-8?B?MnhoeExpOE1YeG1mcmQ0VXk5a1k5OU53WWZuRTN2UFZtL21OeTNCcnN2cGtD?= =?utf-8?B?MjlJT09Ta2s1RmlnTGJWamI2cWhGUG1QMGhyOXRVb0F3d1dxQzBDWXhKY3Bz?= =?utf-8?B?NTZWN0lqQTVsd3lQTjc0MEJ6QkRWV1Z1WS9lYjl1R3lxZnZVU0VtZ3Q0YWlM?= =?utf-8?B?WnE3enRmV1YyVTNRY204MFJrZVZiaFBSTkZXWGFhaHE4dXFHZDA3OW4xTGx0?= =?utf-8?B?a0l1V0tJRk84eUlPUi9sSnpmSmdZaSs3NUFodUJVcUx4OHFNVS8yZytJZy9I?= =?utf-8?B?WjRycEZoK2FJcnh4NHFlV2Z6ckNXMWV2T0lhQ282THV3cVI5SU15T01LblY5?= =?utf-8?B?dU9Cc2RobFBPMzhMbW5remxXQTZCRnF1VU95SDhmd2E1ZjVUbkZ4NXltNHRk?= =?utf-8?B?THVXOC8xdDRxVlR5VEV5QjJUTWJUNXkwNURiWVViemdoL0NjbFRYQ2lNZUd3?= =?utf-8?B?MElrTVJ6OXh3akJsT3pWOE8ycHZreFBrYzRydy9vSDZPaUFmL2NJaUJDSXdF?= =?utf-8?B?T3piWWlwQTN5WWMxaHoxSFlkKzgrOEVJTTFScm84MUJhYSt6OC96ajJCVklB?= =?utf-8?B?WnRsZ2cwQUVrSlF4VWR5V2xKVHYzU3h1ZC93UFBPYTRtUTgzZkwvTXVmTmJa?= =?utf-8?B?WFppL2RWa1BaeTRpcFptbUUvVDBUSFBoNDFzUXM3ZUdyckVIUFN4TWFUeFJ2?= =?utf-8?B?MThraEFnWnV0Y1BjekhZcWl0cFRIL1NVZzVabVd4Znl2N1d5NjJTbzV4bjhJ?= =?utf-8?B?Wm5Wc3VmVWhmWjNDQnlWSml2UVhsbHYya1JmdGNkKy82SDdYSU9rT2dvb1Jj?= =?utf-8?B?K1R2U1piMmlaRGVjRm54UTRaUjZIa0dvREUzclo1eVZMa3d1QUgvM0h0TDVs?= =?utf-8?B?K2xBWENQV2lXN2tpRnRQM1NrbTZBOE9SK0x5MG5vMlYwdWZPdVhITlV3Rm1E?= =?utf-8?B?bUNWR2MvdDJWSThKSmYrRUZHMm10ck1uSHRJeFBXZzBEa2U1RFc5NXE5Mk10?= =?utf-8?B?Rkc0TW5YNmk2R0daUEFhSjBMcmdrRDVSZGxobkNtZU5QZzhwWlhYcUFBOWdN?= =?utf-8?B?SWNTKy95YVlZY1pkN2xkM3QwRkZTd1IzKzJDeUsrZUQ2cmR4VlJKLzNFU294?= =?utf-8?B?Y1JDRDJoRDA4aWt5RXZJdVU2aXYzc3lDSTNCYnVXVGQyUjA5TngrSDJzcll3?= =?utf-8?B?cWlCVlk4STNydWIybjNiQW16NGRaWHJrbGhoUVdDcXIwNEVLMDlMeXNmRTFk?= =?utf-8?B?K0NyRmtsTDZQMG1aYm5VN2tjd1NjUklRcUs0TVg2SExpa0xqQ253MksvMmls?= =?utf-8?B?TUs0Sks1NEVlR09KZHg0aldySHYrSnA3VEVOTlE2N3kyckZrbTJWUVY2Z1dY?= =?utf-8?Q?yzL2fOfiBPEWDOCy4U=3D?= x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="utf-8" Content-ID: <10CD6F4F96FE2B40B095E7D4CD2883DB@namprd12.prod.outlook.com> Content-Transfer-Encoding: base64 MIME-Version: 1.0 X-OriginatorOrg: synopsys.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BYAPR12MB3479.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 03049dd0-cf1a-4bee-a945-08d91010bba0 X-MS-Exchange-CrossTenant-originalarrivaltime: 05 May 2021 21:57:10.1576 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: c33c9f88-1eb7-4099-9700-16013fd9e8aa X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: R/VVd/2Q+UQZO4Dfnfgx1/nLWRi6+2UBnEEqj9HVnzPGjK/oCHwzSV1sRkmMhDv9i6lGH1KeWiJO5ApdJWWfkw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR12MB3827 Received-SPF: pass client-ip=149.117.87.133; envelope-from=Vineet.Gupta1@synopsys.com; helo=smtprelay-out1.synopsys.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, NICE_REPLY_A=-0.001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: config-patches@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Patches for the config.guess and config.sub scripts" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 May 2021 21:57:29 -0000 T24gNC8yMS8yMSAxMjo1MSBQTSwgVmluZWV0IEd1cHRhIHdyb3RlOg0KPiBUaGlzIHBhdmVzIHdh eSBmb3Igc2V0dGluZyB1cCBhcmM2NCBzb2Z0d2FyZSBlY29zeXN0ZW0uDQo+IA0KPiAkIG1ha2Ug Y2hlY2sNCj4gY2QgdGVzdHN1aXRlICYmIGJhc2ggY29uZmlnLWd1ZXNzLnNoICYmIHJtIHVuYW1l DQo+IFBBU1M6IGNvbmZpZy5ndWVzcyBjaGVja3MgKDEzNSB0ZXN0cykNCj4gY2QgdGVzdHN1aXRl ICYmIGJhc2ggY29uZmlnLXN1Yi5zaA0KPiBQQVNTOiBjb25maWcuc3ViIGNoZWNrcyAoODUyIHRl c3RzKQ0KPiBQQVNTOiBjb25maWcuc3ViIGlkZW1wb3RlbmN5IGNoZWNrcyAoNzg5IHRlc3RzKQ0K PiBQQVNTOiBjb25maWcuc3ViIGNhbm9uaWNhbGlzZSBlYWNoIGNvbmZpZy5ndWVzcyB0ZXN0Y2Fz ZSAoMTM1IHRlc3RzKQ0KPiANCj4gKiBjb25maWcuZ3Vlc3MgKGFyYzY0OkxpbnV4Oio6Kik6IFJl Y29nbml6ZS4NCj4gKiBjb25maWcuc3ViIChhcmM2NCk6IExpa2V3aXNlLg0KPiAqIGRvYy9jb25m aWcuZ3Vlc3MuMTogUmVnZW5lcmF0ZS4NCj4gKiBkb2MvY29uZmlnLnN1Yi4xOiBMaWtld2lzZS4N Cj4gKiB0ZXN0c3VpdGUvY29uZmlnLWd1ZXNzLmRhdGE6IEFkZCB0ZXN0IGNhc2VzIGZvciBhcmM2 NC4NCj4gKiB0ZXN0c3VpdGUvY29uZmlnLXN1Yi5kYXRhIChhcmM2NCwgYXJjKi1lbGYpOiBBZGQg dGVzdCBjYXNlcy4NCj4gDQo+IFNpZ25lZC1vZmYtYnk6IFZpbmVldCBHdXB0YSA8dmd1cHRhQHN5 bm9wc3lzLmNvbT4NCg0KUGluZyAhDQoNCj4gLS0tDQo+ICAgY29uZmlnLmd1ZXNzICAgICAgICAg ICAgICAgIHwgNCArKy0tDQo+ICAgY29uZmlnLnN1YiAgICAgICAgICAgICAgICAgIHwgNCArKy0t DQo+ICAgZG9jL2NvbmZpZy5ndWVzcy4xICAgICAgICAgIHwgMiArLQ0KPiAgIGRvYy9jb25maWcu c3ViLjEgICAgICAgICAgICB8IDIgKy0NCj4gICB0ZXN0c3VpdGUvY29uZmlnLWd1ZXNzLmRhdGEg fCAxICsNCj4gICB0ZXN0c3VpdGUvY29uZmlnLXN1Yi5kYXRhICAgfCA1ICsrKysrDQo+ICAgNiBm aWxlcyBjaGFuZ2VkLCAxMiBpbnNlcnRpb25zKCspLCA2IGRlbGV0aW9ucygtKQ0KPiANCj4gZGlm ZiAtLWdpdCBhL2NvbmZpZy5ndWVzcyBiL2NvbmZpZy5ndWVzcw0KPiBpbmRleCAxOTcyZmRhOGVi MDUuLmE2NjQ2ZWQyODI1OCAxMDA3NTUNCj4gLS0tIGEvY29uZmlnLmd1ZXNzDQo+ICsrKyBiL2Nv bmZpZy5ndWVzcw0KPiBAQCAtMiw3ICsyLDcgQEANCj4gICAjIEF0dGVtcHQgdG8gZ3Vlc3MgYSBj YW5vbmljYWwgc3lzdGVtIG5hbWUuDQo+ICAgIyAgIENvcHlyaWdodCAxOTkyLTIwMjEgRnJlZSBT b2Z0d2FyZSBGb3VuZGF0aW9uLCBJbmMuDQo+ICAgDQo+IC10aW1lc3RhbXA9JzIwMjEtMDEtMjUn DQo+ICt0aW1lc3RhbXA9JzIwMjEtMDQtMjEnDQo+ICAgDQo+ICAgIyBUaGlzIGZpbGUgaXMgZnJl ZSBzb2Z0d2FyZTsgeW91IGNhbiByZWRpc3RyaWJ1dGUgaXQgYW5kL29yIG1vZGlmeSBpdA0KPiAg ICMgdW5kZXIgdGhlIHRlcm1zIG9mIHRoZSBHTlUgR2VuZXJhbCBQdWJsaWMgTGljZW5zZSBhcyBw dWJsaXNoZWQgYnkNCj4gQEAgLTk0OSw3ICs5NDksNyBAQCBFT0YNCj4gICAJaWYgdGVzdCAiJD8i ID0gMCA7IHRoZW4gTElCQz1nbnVsaWJjMSA7IGZpDQo+ICAgCWVjaG8gIiRVTkFNRV9NQUNISU5F Ii11bmtub3duLWxpbnV4LSIkTElCQyINCj4gICAJZXhpdCA7Ow0KPiAtICAgIGFyYzpMaW51eDoq OiogfCBhcmNlYjpMaW51eDoqOiopDQo+ICsgICAgYXJjOkxpbnV4Oio6KiB8IGFyY2ViOkxpbnV4 Oio6KiB8IGFyYzY0OkxpbnV4Oio6KikNCj4gICAJZWNobyAiJFVOQU1FX01BQ0hJTkUiLXVua25v d24tbGludXgtIiRMSUJDIg0KPiAgIAlleGl0IDs7DQo+ICAgICAgIGFybSo6TGludXg6KjoqKQ0K PiBkaWZmIC0tZ2l0IGEvY29uZmlnLnN1YiBiL2NvbmZpZy5zdWINCj4gaW5kZXggN2Y3ZDBiMDU1 YWM1Li5kNzAyNDdjMDhkMTIgMTAwNzU1DQo+IC0tLSBhL2NvbmZpZy5zdWINCj4gKysrIGIvY29u ZmlnLnN1Yg0KPiBAQCAtMiw3ICsyLDcgQEANCj4gICAjIENvbmZpZ3VyYXRpb24gdmFsaWRhdGlv biBzdWJyb3V0aW5lIHNjcmlwdC4NCj4gICAjICAgQ29weXJpZ2h0IDE5OTItMjAyMSBGcmVlIFNv ZnR3YXJlIEZvdW5kYXRpb24sIEluYy4NCj4gICANCj4gLXRpbWVzdGFtcD0nMjAyMS0wMy0xMCcN Cj4gK3RpbWVzdGFtcD0nMjAyMS0wNC0yMScNCj4gICANCj4gICAjIFRoaXMgZmlsZSBpcyBmcmVl IHNvZnR3YXJlOyB5b3UgY2FuIHJlZGlzdHJpYnV0ZSBpdCBhbmQvb3IgbW9kaWZ5IGl0DQo+ICAg IyB1bmRlciB0aGUgdGVybXMgb2YgdGhlIEdOVSBHZW5lcmFsIFB1YmxpYyBMaWNlbnNlIGFzIHB1 Ymxpc2hlZCBieQ0KPiBAQCAtMTE2NSw3ICsxMTY1LDcgQEAgY2FzZSAkY3B1LSR2ZW5kb3IgaW4N Cj4gICAJCQl8IGFscGhhcGNhNVs2N10gfCBhbHBoYTY0cGNhNVs2N10gXA0KPiAgIAkJCXwgYW0z M18yLjAgXA0KPiAgIAkJCXwgYW1kZ2NuIFwNCj4gLQkJCXwgYXJjIHwgYXJjZWIgXA0KPiArCQkJ fCBhcmMgfCBhcmNlYiB8IGFyYzY0IFwNCj4gICAJCQl8IGFybSB8IGFybVtsYl1lIHwgYXJtZVts Yl0gfCBhcm12KiBcDQo+ICAgCQkJfCBhdnIgfCBhdnIzMiBcDQo+ICAgCQkJfCBhc21qcyBcDQo+ IGRpZmYgLS1naXQgYS9kb2MvY29uZmlnLmd1ZXNzLjEgYi9kb2MvY29uZmlnLmd1ZXNzLjENCj4g aW5kZXggNzVmYmIyMzZmZDY4Li5mNzlmMWM1ZjEwYzUgMTAwNjQ0DQo+IC0tLSBhL2RvYy9jb25m aWcuZ3Vlc3MuMQ0KPiArKysgYi9kb2MvY29uZmlnLmd1ZXNzLjENCj4gQEAgLTEsNSArMSw1IEBA DQo+ICAgLlwiIERPIE5PVCBNT0RJRlkgVEhJUyBGSUxFISAgSXQgd2FzIGdlbmVyYXRlZCBieSBo ZWxwMm1hbiAxLjQ3LjE2Lg0KPiAtLlRIIENPTkZJRy5HVUVTUyAiMSIgIkphbnVhcnkgMjAyMSIg IkdOVSBjb25maWcuZ3Vlc3MgKDIwMjEtMDEtMjUpIiAiVXNlciBDb21tYW5kcyINCj4gKy5USCBD T05GSUcuR1VFU1MgIjEiICJKYW51YXJ5IDIwMjEiICJHTlUgY29uZmlnLmd1ZXNzICgyMDIxLTA0 LTIxKSIgIlVzZXIgQ29tbWFuZHMiDQo+ICAgLlNIIE5BTUUNCj4gICBjb25maWcuZ3Vlc3MgXC0g Z3Vlc3MgdGhlIGJ1aWxkIHN5c3RlbSB0cmlwbGV0DQo+ICAgLlNIIFNZTk9QU0lTDQo+IGRpZmYg LS1naXQgYS9kb2MvY29uZmlnLnN1Yi4xIGIvZG9jL2NvbmZpZy5zdWIuMQ0KPiBpbmRleCAzMTdj OGM0N2ExODAuLjlkNTJjZWJmNThkMCAxMDA2NDQNCj4gLS0tIGEvZG9jL2NvbmZpZy5zdWIuMQ0K PiArKysgYi9kb2MvY29uZmlnLnN1Yi4xDQo+IEBAIC0xLDUgKzEsNSBAQA0KPiAgIC5cIiBETyBO T1QgTU9ESUZZIFRISVMgRklMRSEgIEl0IHdhcyBnZW5lcmF0ZWQgYnkgaGVscDJtYW4gMS40Ny4x Ni4NCj4gLS5USCBDT05GSUcuU1VCICIxIiAiTWFyY2ggMjAyMSIgIkdOVSBjb25maWcuc3ViICgy MDIxLTAzLTEwKSIgIlVzZXIgQ29tbWFuZHMiDQo+ICsuVEggQ09ORklHLlNVQiAiMSIgIk1hcmNo IDIwMjEiICJHTlUgY29uZmlnLnN1YiAoMjAyMS0wNC0yMSkiICJVc2VyIENvbW1hbmRzIg0KPiAg IC5TSCBOQU1FDQo+ICAgY29uZmlnLnN1YiBcLSB2YWxpZGF0ZSBhbmQgY2Fub25pY2FsaXplIGEg Y29uZmlndXJhdGlvbiB0cmlwbGV0DQo+ICAgLlNIIFNZTk9QU0lTDQo+IGRpZmYgLS1naXQgYS90 ZXN0c3VpdGUvY29uZmlnLWd1ZXNzLmRhdGEgYi90ZXN0c3VpdGUvY29uZmlnLWd1ZXNzLmRhdGEN Cj4gaW5kZXggZjI0MGU5Y2U2MWRmLi43MzkwOGFiYjRlMDYgMTAwNjQ0DQo+IC0tLSBhL3Rlc3Rz dWl0ZS9jb25maWctZ3Vlc3MuZGF0YQ0KPiArKysgYi90ZXN0c3VpdGUvY29uZmlnLWd1ZXNzLmRh dGENCj4gQEAgLTM1LDYgKzM1LDcgQEAgYW1kNjQgfCA3LjBfUkMxIHwgTmV0QlNEIHwgaWdub3Jl ZCB8IHg4Nl82NCB8IHg4Nl82NC11bmtub3duLW5ldGJzZDcuMA0KPiAgIGFtZDY0IHwgNy4yLjEg fCBJc2lsb24gT25lRlMgfCBpZ25vcmVkIHwgaWdub3JlZCB8IHg4Nl82NC11bmtub3duLW9uZWZz DQo+ICAgYXJjIHwgaWdub3JlZCB8IExpbnV4IHwgaWdub3JlZCB8IGlnbm9yZWQgfCBhcmMtdW5r bm93bi1saW51eC1nbnUNCj4gICBhcmNlYiB8IGlnbm9yZWQgfCBMaW51eCB8IGlnbm9yZWQgfCBp Z25vcmVkIHwgYXJjZWItdW5rbm93bi1saW51eC1nbnUNCj4gK2FyYzY0IHwgaWdub3JlZCB8IExp bnV4IHwgaWdub3JlZCB8IGlnbm9yZWQgfCBhcmM2NC11bmtub3duLWxpbnV4LWdudQ0KPiAgIGFy bSB8IDEyLjAgfCBGcmVlQlNEIHwgaWdub3JlZCB8IGFybXY2IHwgYXJtdjYtdW5rbm93bi1mcmVl YnNkMTIuMC1nbnVlYWJpaGYNCj4gICBhcm0gfCAxMi4wIHwgRnJlZUJTRCB8IGlnbm9yZWQgfCBh cm12NyB8IGFybXY3LXVua25vd24tZnJlZWJzZDEyLjAtZ251ZWFiaWhmDQo+ICAgYXJtIHwgMTIu MSB8IEFST1MgfCBpZ25vcmVkIHwgYXJtdjcgfCBhcm0tdW5rbm93bi1hcm9zDQo+IGRpZmYgLS1n aXQgYS90ZXN0c3VpdGUvY29uZmlnLXN1Yi5kYXRhIGIvdGVzdHN1aXRlL2NvbmZpZy1zdWIuZGF0 YQ0KPiBpbmRleCAxMDFhNGM0NWVjMzkuLjBhNTllYWYxY2VjNyAxMDA2NDQNCj4gLS0tIGEvdGVz dHN1aXRlL2NvbmZpZy1zdWIuZGF0YQ0KPiArKysgYi90ZXN0c3VpdGUvY29uZmlnLXN1Yi5kYXRh DQo+IEBAIC01OSw5ICs1OSwxNCBAQCBhbWl4CQkJCQkJbTY4ay11bmtub3duLXN5c3Y0DQo+ICAg YXBvbGxvNjgJCQkJCW02OGstYXBvbGxvLXN5c3YNCj4gICBhcG9sbG82OGJzZAkJCQkJbTY4ay1h cG9sbG8tYnNkDQo+ICAgYXJjCQkJCQkJYXJjLXVua25vd24tbm9uZQ0KPiArYXJjLWVsZgkJCQkJ CWFyYy11bmtub3duLWVsZg0KPiAgIGFyYy1saW51eAkJCQkJYXJjLXVua25vd24tbGludXgtZ251 DQo+ICAgYXJjZWIJCQkJCQlhcmNlYi11bmtub3duLW5vbmUNCj4gK2FyY2ViLWVsZgkJCQkJYXJj ZWItdW5rbm93bi1lbGYNCj4gICBhcmNlYi1saW51eAkJCQkJYXJjZWItdW5rbm93bi1saW51eC1n bnUNCj4gK2FyYzY0CQkJCQkJYXJjNjQtdW5rbm93bi1ub25lDQo+ICthcmM2NC1lbGYJCQkJCWFy YzY0LXVua25vd24tZWxmDQo+ICthcmM2NC1saW51eAkJCQkJYXJjNjQtdW5rbm93bi1saW51eC1n bnUNCj4gICBhcm0JCQkJCQlhcm0tdW5rbm93bi1ub25lDQo+ICAgYXJtLWNlZ2NjCQkJCQlhcm0t dW5rbm93bi1jZWdjYw0KPiAgIGFybS1jb2ZmCQkJCQlhcm0tdW5rbm93bi1jb2ZmDQo+IA0KDQo= From MAILER-DAEMON Wed May 05 21:38:14 2021 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1leSxy-00023e-G4 for mharc-config-patches@gnu.org; Wed, 05 May 2021 21:38:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55748) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1leSxw-00023Y-CS for config-patches@gnu.org; Wed, 05 May 2021 21:38:12 -0400 Received: from vmicros1.altlinux.org ([194.107.17.57]:40104) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1leSxu-0005hR-8I for config-patches@gnu.org; Wed, 05 May 2021 21:38:12 -0400 Received: from mua.local.altlinux.org (mua.local.altlinux.org [192.168.1.14]) by vmicros1.altlinux.org (Postfix) with ESMTP id 1EF9172C8B5; Thu, 6 May 2021 04:38:05 +0300 (MSK) Received: by mua.local.altlinux.org (Postfix, from userid 508) id E9A617CC8AF; Thu, 6 May 2021 04:38:04 +0300 (MSK) Date: Thu, 6 May 2021 04:38:04 +0300 From: "Dmitry V. Levin" To: Purple Rain Cc: config-patches@gnu.org Subject: Re: PATCH: config.sub 2021-04-16 Message-ID: <20210506013804.GB27615@altlinux.org> References: <20210416221133.GA76941@amd64.secbsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210416221133.GA76941@amd64.secbsd.org> Received-SPF: pass client-ip=194.107.17.57; envelope-from=ldv@altlinux.org; helo=vmicros1.altlinux.org X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: config-patches@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Patches for the config.guess and config.sub scripts" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 May 2021 01:38:12 -0000 On Fri, Apr 16, 2021 at 10:11:33PM +0000, Purple Rain wrote: > Hi GNU friends! > > I attached a patch for config.sub and info of my OS. > > uname -m = amd64 > uname -r = 1.0 > uname -s = SecBSD > uname -v = GENERIC.MP#1 > > /usr/bin/uname -p = amd64 > /bin/uname -X = > > hostinfo = > /bin/universe = > /usr/bin/arch -k = SecBSD.amd64 > /bin/arch = > /usr/bin/oslevel = > /usr/convex/getsysinfo = > > UNAME_MACHINE = amd64 > UNAME_RELEASE = 1.0 > UNAME_SYSTEM = SecBSD > UNAME_VERSION = GENERIC.MP#1 > --- config.sub Fri Apr 16 21:58:17 2021 > +++ config.sub.patched Fri Apr 16 21:59:25 2021 > @@ -2,7 +2,7 @@ > # Configuration validation subroutine script. > # Copyright 1992-2021 Free Software Foundation, Inc. > > -timestamp='2021-03-10' > +timestamp='2021-04-16' > > # This file is free software; you can redistribute it and/or modify it > # under the terms of the GNU General Public License as published by > @@ -1707,7 +1707,7 @@ > | nindy* | vxsim* | vxworks* | ebmon* | hms* | mvs* \ > | clix* | riscos* | uniplus* | iris* | isc* | rtu* | xenix* \ > | mirbsd* | netbsd* | dicos* | openedition* | ose* \ > - | bitrig* | openbsd* | solidbsd* | libertybsd* | os108* \ > + | bitrig* | openbsd* | secbsd* | solidbsd* | libertybsd* | os108* \ > | ekkobsd* | freebsd* | riscix* | lynxos* | os400* \ > | bosx* | nextstep* | cxux* | aout* | elf* | oabi* \ > | ptx* | coff* | ecoff* | winnt* | domain* | vsta* \ Applied, thanks. -- ldv From MAILER-DAEMON Wed May 05 21:38:23 2021 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1leSy7-00025x-LV for mharc-config-patches@gnu.org; Wed, 05 May 2021 21:38:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55782) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1leSy6-00025L-Cq for config-patches@gnu.org; Wed, 05 May 2021 21:38:22 -0400 Received: from vmicros1.altlinux.org ([194.107.17.57]:40258) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1leSy4-0005qv-Qz for config-patches@gnu.org; Wed, 05 May 2021 21:38:22 -0400 Received: from mua.local.altlinux.org (mua.local.altlinux.org [192.168.1.14]) by vmicros1.altlinux.org (Postfix) with ESMTP id EC43D72C8B5; Thu, 6 May 2021 04:38:19 +0300 (MSK) Received: by mua.local.altlinux.org (Postfix, from userid 508) id E3B6F7CC8AF; Thu, 6 May 2021 04:38:19 +0300 (MSK) Date: Thu, 6 May 2021 04:38:19 +0300 From: "Dmitry V. Levin" To: Purple Rain Cc: config-patches@gnu.org Subject: Re: PATCH FIXED: config.guess 2021-04-16 Message-ID: <20210506013819.GC27615@altlinux.org> References: <20210416222632.GA3697@amd64.secbsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210416222632.GA3697@amd64.secbsd.org> Received-SPF: pass client-ip=194.107.17.57; envelope-from=ldv@altlinux.org; helo=vmicros1.altlinux.org X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: config-patches@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Patches for the config.guess and config.sub scripts" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 May 2021 01:38:22 -0000 On Fri, Apr 16, 2021 at 10:26:32PM +0000, Purple Rain wrote: > Hi GNU friends! > > I attached a patch for config.guess and info of my OS. > > uname -m = amd64 > uname -r = 1.0 > uname -s = SecBSD > uname -v = GENERIC.MP#1 > > /usr/bin/uname -p = amd64 > /bin/uname -X = > > hostinfo = > /bin/universe = > /usr/bin/arch -k = SecBSD.amd64 > /bin/arch = > /usr/bin/oslevel = > /usr/convex/getsysinfo = > > UNAME_MACHINE = amd64 > UNAME_RELEASE = 1.0 > UNAME_SYSTEM = SecBSD > UNAME_VERSION = GENERIC.MP#1 > --- config.guess Fri Apr 16 21:44:57 2021 > +++ config.guess.patched Fri Apr 16 22:23:29 2021 > @@ -261,6 +261,10 @@ > UNAME_MACHINE_ARCH=$(arch | sed 's/OpenBSD.//') > echo "$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE" > exit ;; > + *:SecBSD:*:*) > + UNAME_MACHINE_ARCH=$(arch | sed 's/SecBSD.//') > + echo "$UNAME_MACHINE_ARCH"-unknown-secbsd"$UNAME_RELEASE" > + exit ;; > *:LibertyBSD:*:*) > UNAME_MACHINE_ARCH=$(arch | sed 's/^.*BSD\.//') > echo "$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE" Applied, thanks. -- ldv From MAILER-DAEMON Wed May 05 21:38:52 2021 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1leSyZ-000299-T4 for mharc-config-patches@gnu.org; Wed, 05 May 2021 21:38:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55900) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1leSyY-00028m-JL for config-patches@gnu.org; Wed, 05 May 2021 21:38:50 -0400 Received: from vmicros1.altlinux.org ([194.107.17.57]:40454) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1leSyW-000699-IU for config-patches@gnu.org; Wed, 05 May 2021 21:38:50 -0400 Received: from mua.local.altlinux.org (mua.local.altlinux.org [192.168.1.14]) by vmicros1.altlinux.org (Postfix) with ESMTP id 3FC9772C8B5; Thu, 6 May 2021 04:38:47 +0300 (MSK) Received: by mua.local.altlinux.org (Postfix, from userid 508) id 311EC7CC8AF; Thu, 6 May 2021 04:38:47 +0300 (MSK) Date: Thu, 6 May 2021 04:38:47 +0300 From: "Dmitry V. Levin" To: Vineet Gupta Cc: config-patches@gnu.org, linux-snps-arc@lists.infradead.org Subject: Re: [PATCH] Recognize arc64 Message-ID: <20210506013846.GD27615@altlinux.org> References: <20210421195118.158464-1-vgupta@synopsys.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210421195118.158464-1-vgupta@synopsys.com> Received-SPF: pass client-ip=194.107.17.57; envelope-from=ldv@altlinux.org; helo=vmicros1.altlinux.org X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: config-patches@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Patches for the config.guess and config.sub scripts" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 May 2021 01:38:50 -0000 On Wed, Apr 21, 2021 at 12:51:18PM -0700, Vineet Gupta wrote: > This paves way for setting up arc64 software ecosystem. > > $ make check > cd testsuite && bash config-guess.sh && rm uname > PASS: config.guess checks (135 tests) > cd testsuite && bash config-sub.sh > PASS: config.sub checks (852 tests) > PASS: config.sub idempotency checks (789 tests) > PASS: config.sub canonicalise each config.guess testcase (135 tests) > > * config.guess (arc64:Linux:*:*): Recognize. > * config.sub (arc64): Likewise. > * doc/config.guess.1: Regenerate. > * doc/config.sub.1: Likewise. > * testsuite/config-guess.data: Add test cases for arc64. > * testsuite/config-sub.data (arc64, arc*-elf): Add test cases. > > Signed-off-by: Vineet Gupta > --- > config.guess | 4 ++-- > config.sub | 4 ++-- > doc/config.guess.1 | 2 +- > doc/config.sub.1 | 2 +- > testsuite/config-guess.data | 1 + > testsuite/config-sub.data | 5 +++++ > 6 files changed, 12 insertions(+), 6 deletions(-) > > diff --git a/config.guess b/config.guess > index 1972fda8eb05..a6646ed28258 100755 > --- a/config.guess > +++ b/config.guess > @@ -2,7 +2,7 @@ > # Attempt to guess a canonical system name. > # Copyright 1992-2021 Free Software Foundation, Inc. > > -timestamp='2021-01-25' > +timestamp='2021-04-21' > > # This file is free software; you can redistribute it and/or modify it > # under the terms of the GNU General Public License as published by > @@ -949,7 +949,7 @@ EOF > if test "$?" = 0 ; then LIBC=gnulibc1 ; fi > echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" > exit ;; > - arc:Linux:*:* | arceb:Linux:*:*) > + arc:Linux:*:* | arceb:Linux:*:* | arc64:Linux:*:*) > echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" > exit ;; > arm*:Linux:*:*) > diff --git a/config.sub b/config.sub > index 7f7d0b055ac5..d70247c08d12 100755 > --- a/config.sub > +++ b/config.sub > @@ -2,7 +2,7 @@ > # Configuration validation subroutine script. > # Copyright 1992-2021 Free Software Foundation, Inc. > > -timestamp='2021-03-10' > +timestamp='2021-04-21' > > # This file is free software; you can redistribute it and/or modify it > # under the terms of the GNU General Public License as published by > @@ -1165,7 +1165,7 @@ case $cpu-$vendor in > | alphapca5[67] | alpha64pca5[67] \ > | am33_2.0 \ > | amdgcn \ > - | arc | arceb \ > + | arc | arceb | arc64 \ > | arm | arm[lb]e | arme[lb] | armv* \ > | avr | avr32 \ > | asmjs \ > diff --git a/doc/config.guess.1 b/doc/config.guess.1 > index 75fbb236fd68..f79f1c5f10c5 100644 > --- a/doc/config.guess.1 > +++ b/doc/config.guess.1 > @@ -1,5 +1,5 @@ > .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.16. > -.TH CONFIG.GUESS "1" "January 2021" "GNU config.guess (2021-01-25)" "User Commands" > +.TH CONFIG.GUESS "1" "January 2021" "GNU config.guess (2021-04-21)" "User Commands" > .SH NAME > config.guess \- guess the build system triplet > .SH SYNOPSIS > diff --git a/doc/config.sub.1 b/doc/config.sub.1 > index 317c8c47a180..9d52cebf58d0 100644 > --- a/doc/config.sub.1 > +++ b/doc/config.sub.1 > @@ -1,5 +1,5 @@ > .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.16. > -.TH CONFIG.SUB "1" "March 2021" "GNU config.sub (2021-03-10)" "User Commands" > +.TH CONFIG.SUB "1" "March 2021" "GNU config.sub (2021-04-21)" "User Commands" > .SH NAME > config.sub \- validate and canonicalize a configuration triplet > .SH SYNOPSIS > diff --git a/testsuite/config-guess.data b/testsuite/config-guess.data > index f240e9ce61df..73908abb4e06 100644 > --- a/testsuite/config-guess.data > +++ b/testsuite/config-guess.data > @@ -35,6 +35,7 @@ amd64 | 7.0_RC1 | NetBSD | ignored | x86_64 | x86_64-unknown-netbsd7.0 > amd64 | 7.2.1 | Isilon OneFS | ignored | ignored | x86_64-unknown-onefs > arc | ignored | Linux | ignored | ignored | arc-unknown-linux-gnu > arceb | ignored | Linux | ignored | ignored | arceb-unknown-linux-gnu > +arc64 | ignored | Linux | ignored | ignored | arc64-unknown-linux-gnu > arm | 12.0 | FreeBSD | ignored | armv6 | armv6-unknown-freebsd12.0-gnueabihf > arm | 12.0 | FreeBSD | ignored | armv7 | armv7-unknown-freebsd12.0-gnueabihf > arm | 12.1 | AROS | ignored | armv7 | arm-unknown-aros > diff --git a/testsuite/config-sub.data b/testsuite/config-sub.data > index 101a4c45ec39..0a59eaf1cec7 100644 > --- a/testsuite/config-sub.data > +++ b/testsuite/config-sub.data > @@ -59,9 +59,14 @@ amix m68k-unknown-sysv4 > apollo68 m68k-apollo-sysv > apollo68bsd m68k-apollo-bsd > arc arc-unknown-none > +arc-elf arc-unknown-elf > arc-linux arc-unknown-linux-gnu > arceb arceb-unknown-none > +arceb-elf arceb-unknown-elf > arceb-linux arceb-unknown-linux-gnu > +arc64 arc64-unknown-none > +arc64-elf arc64-unknown-elf > +arc64-linux arc64-unknown-linux-gnu > arm arm-unknown-none > arm-cegcc arm-unknown-cegcc > arm-coff arm-unknown-coff Applied, thanks. -- ldv From MAILER-DAEMON Wed May 05 21:39:27 2021 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1leSz9-0002B9-PC for mharc-config-patches@gnu.org; Wed, 05 May 2021 21:39:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55946) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1leSz8-0002Am-2v for config-patches@gnu.org; Wed, 05 May 2021 21:39:26 -0400 Received: from vmicros1.altlinux.org ([194.107.17.57]:40744) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1leSz6-0006Vv-ID for config-patches@gnu.org; Wed, 05 May 2021 21:39:25 -0400 Received: from mua.local.altlinux.org (mua.local.altlinux.org [192.168.1.14]) by vmicros1.altlinux.org (Postfix) with ESMTP id C0C6C72C8B5; Thu, 6 May 2021 04:39:23 +0300 (MSK) Received: by mua.local.altlinux.org (Postfix, from userid 508) id B41FF7CC8AF; Thu, 6 May 2021 04:39:23 +0300 (MSK) Date: Thu, 6 May 2021 04:39:23 +0300 From: "Dmitry V. Levin" To: "Maciej W. Rozycki" Cc: config-patches@gnu.org Subject: Re: config.sub: Handle MIPS R3 and R5 ISA levels with CPU names Message-ID: <20210506013923.GE27615@altlinux.org> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Received-SPF: pass client-ip=194.107.17.57; envelope-from=ldv@altlinux.org; helo=vmicros1.altlinux.org X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: config-patches@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Patches for the config.guess and config.sub scripts" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 May 2021 01:39:26 -0000 On Sat, May 01, 2021 at 01:15:08AM +0200, Maciej W. Rozycki wrote: > Complement binutils commit ae52f4830604 ("Add MIPS r3 and r5 support.") > and recognize MIPS CPU patterns for the R3 and R5 ISA levels, used by > GAS to set defaults. > > * config.sub (mipsisa32r3, mipsisa32r3el, mipsisa32r5, mipsisa32r5el) > (mipsisa64r3, mipsisa64r3el, mipsisa64r5, mipsisa64r5el): Recognize. > * config-sub.data: Update accordingly. > --- > Hi, > > Obviously someone missed this part when updating binutils long ago. > Please apply. > > Maciej > --- > config.sub | 4 ++++ > testsuite/config-sub.data | 8 ++++++++ > 2 files changed, 12 insertions(+) > > Index: config/config.sub > =================================================================== > --- config.orig/config.sub > +++ config/config.sub > @@ -1204,9 +1204,13 @@ case $cpu-$vendor in > | mips64vr5900 | mips64vr5900el \ > | mipsisa32 | mipsisa32el \ > | mipsisa32r2 | mipsisa32r2el \ > + | mipsisa32r3 | mipsisa32r3el \ > + | mipsisa32r5 | mipsisa32r5el \ > | mipsisa32r6 | mipsisa32r6el \ > | mipsisa64 | mipsisa64el \ > | mipsisa64r2 | mipsisa64r2el \ > + | mipsisa64r3 | mipsisa64r3el \ > + | mipsisa64r5 | mipsisa64r5el \ > | mipsisa64r6 | mipsisa64r6el \ > | mipsisa64sb1 | mipsisa64sb1el \ > | mipsisa64sr71k | mipsisa64sr71kel \ > Index: config/testsuite/config-sub.data > =================================================================== > --- config.orig/testsuite/config-sub.data > +++ config/testsuite/config-sub.data > @@ -414,6 +414,10 @@ mipsisa32 mipsisa32-unknown-elf > mipsisa32el mipsisa32el-unknown-elf > mipsisa32r2 mipsisa32r2-unknown-elf > mipsisa32r2el mipsisa32r2el-unknown-elf > +mipsisa32r3 mipsisa32r3-unknown-elf > +mipsisa32r3el mipsisa32r3el-unknown-elf > +mipsisa32r5 mipsisa32r5-unknown-elf > +mipsisa32r5el mipsisa32r5el-unknown-elf > mipsisa32r6 mipsisa32r6-unknown-elf > mipsisa32r6-elf mipsisa32r6-unknown-elf > mipsisa32r6el mipsisa32r6el-unknown-elf > @@ -422,6 +426,10 @@ mipsisa64 mipsisa64-unknown-elf > mipsisa64el mipsisa64el-unknown-elf > mipsisa64r2 mipsisa64r2-unknown-elf > mipsisa64r2el mipsisa64r2el-unknown-elf > +mipsisa64r3 mipsisa64r3-unknown-elf > +mipsisa64r3el mipsisa64r3el-unknown-elf > +mipsisa64r5 mipsisa64r5-unknown-elf > +mipsisa64r5el mipsisa64r5el-unknown-elf > mipsisa64r6 mipsisa64r6-unknown-elf > mipsisa64r6-elf mipsisa64r6-unknown-elf > mipsisa64r6el mipsisa64r6el-unknown-elf Applied, thanks. -- ldv From MAILER-DAEMON Wed May 05 21:51:15 2021 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1leTAW-0003YX-CK for mharc-config-patches@gnu.org; Wed, 05 May 2021 21:51:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57212) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1leTAL-0003X8-9u for config-patches@gnu.org; Wed, 05 May 2021 21:51:02 -0400 Received: from vmicros1.altlinux.org ([194.107.17.57]:47756) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1leTAC-00050V-VZ for config-patches@gnu.org; Wed, 05 May 2021 21:50:59 -0400 Received: from mua.local.altlinux.org (mua.local.altlinux.org [192.168.1.14]) by vmicros1.altlinux.org (Postfix) with ESMTP id E76F272C8B5; Thu, 6 May 2021 04:50:51 +0300 (MSK) Received: by mua.local.altlinux.org (Postfix, from userid 508) id D7C6D7CC8AF; Thu, 6 May 2021 04:50:51 +0300 (MSK) Date: Thu, 6 May 2021 04:50:51 +0300 From: "Dmitry V. Levin" To: Arsenij Solovjev Cc: config-patches@gnu.org Subject: Re: How to handle a new operating system? Message-ID: <20210506015051.GF27615@altlinux.org> References: <232EF632-1049-4110-868B-2FB5CB407644@crosssoft.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <232EF632-1049-4110-868B-2FB5CB407644@crosssoft.de> Received-SPF: pass client-ip=194.107.17.57; envelope-from=ldv@altlinux.org; helo=vmicros1.altlinux.org X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: config-patches@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Patches for the config.guess and config.sub scripts" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 May 2021 01:51:05 -0000 Hi, On Thu, Apr 29, 2021 at 03:25:22PM +0200, Arsenij Solovjev wrote: > Hi dear GNU Team, > > I’m part of a team that creates our own distribution of FreeBSD called CROSSOS. > I’ve currently run into the problem that I cannot compile certain third party sofware (python gevent). > The problem seems to be that config.guess/sub don’t recognise the output of the uname call to our kernel. > > What would be the recommended way to go about this? We can of course overwrite config.guess/sub in our own portstree. > What is the criteria for an operating system to be listed in config.guess? If config.guess fails to recognize the operating system and suggests to send to this mailing list the information necessary to handle your system, it is recommended to follow this suggestion. -- ldv From MAILER-DAEMON Thu May 06 14:13:08 2021 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1leiUm-0000P4-6Z for mharc-config-patches@gnu.org; Thu, 06 May 2021 14:13:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49426) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1leiUj-0000Ma-GF for config-patches@gnu.org; Thu, 06 May 2021 14:13:06 -0400 Received: from freefriends.org ([96.88.95.60]:60852) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1leiUc-00078O-Ac for config-patches@gnu.org; Thu, 06 May 2021 14:13:03 -0400 X-Envelope-From: karl@freefriends.org Received: from freefriends.org (freefriends.org [96.88.95.60]) by freefriends.org (8.14.7/8.14.7) with ESMTP id 146ICtPR006631 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 6 May 2021 12:12:55 -0600 Received: (from apache@localhost) by freefriends.org (8.14.7/8.14.7/Submit) id 146ICtj8006630; Thu, 6 May 2021 12:12:55 -0600 Date: Thu, 6 May 2021 12:12:55 -0600 Message-Id: <202105061812.146ICtj8006630@freefriends.org> From: Karl Berry To: jcb62281@gmail.com Cc: config-patches@gnu.org Subject: Re: config.guess is incompatible with pre-POSIX shells In-Reply-To: <6091F8A8.8070208@gmail.com> Received-SPF: pass client-ip=96.88.95.60; envelope-from=karl@freefriends.org; helo=freefriends.org X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: config-patches@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Patches for the config.guess and config.sub scripts" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 May 2021 18:13:07 -0000 Hi Jacob, On Solaris 10, /bin/sh is a non-POSIX shell and fails to execute config.guess because POSIX "$(...)" command Yeah. It's been reported wrt config.{guess,sub} several times before, but Dmitry has not replied, so I can only surmise that he does not want to keep portability with Solaris 10 (unfortunately IMHO). and would be willing to write a patch for config.guess and possibly config.sub to restore portability if that patch would be acceptable. I hope he replies now and says yes! --thanks, karl. From MAILER-DAEMON Sat May 22 21:06:00 2021 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1lkcZ6-00074j-By for mharc-config-patches@gnu.org; Sat, 22 May 2021 21:06:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44638) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lkcWz-0006oj-51 for config-patches@gnu.org; Sat, 22 May 2021 21:03:49 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:45510) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lkcWy-0005nH-Ud for config-patches@gnu.org; Sat, 22 May 2021 21:03:48 -0400 Received: from jcb by fencepost.gnu.org with local (Exim 4.90_1) (envelope-from ) id 1lkcWy-00069A-KT for config-patches@gnu.org; Sat, 22 May 2021 21:03:48 -0400 From: Jacob Bachmeyer Date: Sat, 22 May 2021 20:33:04 -0400 Subject: [PATCH 0/6] restore compatibility with pre-POSIX shells in config.guess To: config-patches@gnu.org Message-Id: X-Mailman-Approved-At: Sat, 22 May 2021 21:05:59 -0400 X-BeenThere: config-patches@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Patches for the config.guess and config.sub scripts" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 May 2021 01:03:49 -0000 This patch series tidies config.guess and reverts to classic backtick command substitutions. No shell splits the WORD in "case WORD in ... esac", so instances where WORD was quoted were changed. Quotes while forming the output are pointless, since no valid GNU configuration tuple contains whitespace, therefore no variables interpolated will be candidates for word splitting. However, there are places in the script where unquoted variables could cause legitimate problems, so the script was reworked to store the uname-based guess in a GUESS variable instead of suppressing the shellcheck complaint. Since no shell splits the right hand side of a variable assignment, this form avoids the need to quote variables. Next, the command substitutions used while producing a result in several cases were factored out into separate variables, removing the need for quoting the substitutions and the use of classic backticks restored and the shellcheck complaint silenced. Lastly, a few places that did not match the patterns used for most of the editing were fixed up manually after being found while reverting back to backticks. Logically, config.guess should remain compatible with pre-POSIX shells; this is not difficult and the script purports to identify a variety of older systems that probably never had POSIX shells. DejaGnu 1.6.3 is expected to ship config.guess with these patches applied, and release candidate 5 for DejaGnu 1.6.3 will include them. DejaGnu 1.6.3 will not have Autoconf's "find a good shell" logic and DejaGnu installs config.guess and uses it at runtime, so config.guess needs to "just work". While DejaGnu can rely on Autoconf's "find a good shell" logic for config.sub, I will prepare similar patches for config.sub if there is interest. Jacob Bachmeyer (6): config.guess: remove unneeded quotes in case constructs config.guess: use intermediate variable with uname results config.guess: remove unneeded variable quotes config.guess: factor out command substitutions setting GUESS config.guess: replace POSIX $( ) with classic ` ` throughout config.guess: minor cleanups noticed during previous pass config.guess | 1214 ++++++++++++++++++++++++++------------------------ 1 file changed, 631 insertions(+), 583 deletions(-) -- 2.17.1 From MAILER-DAEMON Sat May 22 21:06:00 2021 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1lkcZ6-00075G-LB for mharc-config-patches@gnu.org; Sat, 22 May 2021 21:06:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44644) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lkcX1-0006or-6p for config-patches@gnu.org; Sat, 22 May 2021 21:03:51 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:45512) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lkcWz-0005nf-BI for config-patches@gnu.org; Sat, 22 May 2021 21:03:50 -0400 Received: from jcb by fencepost.gnu.org with local (Exim 4.90_1) (envelope-from ) id 1lkcWy-00069F-To for config-patches@gnu.org; Sat, 22 May 2021 21:03:48 -0400 From: Jacob Bachmeyer Date: Fri, 21 May 2021 20:49:52 -0500 Subject: [PATCH 1/6] config.guess: remove unneeded quotes in case constructs To: config-patches@gnu.org Message-Id: X-Mailman-Approved-At: Sat, 22 May 2021 21:05:59 -0400 X-BeenThere: config-patches@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Patches for the config.guess and config.sub scripts" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 May 2021 01:03:51 -0000 * config.guess: Tidy case constructs by removing quotes around the argument; the Autoconf portable shell guidelines note that no shell splits that argument in any case. --- config.guess | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/config.guess b/config.guess index cc7a810..92074bd 100755 --- a/config.guess +++ b/config.guess @@ -2,7 +2,7 @@ # Attempt to guess a canonical system name. # Copyright 1992-2021 Free Software Foundation, Inc. -timestamp='2021-04-21' +timestamp='2021-05-20' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -136,7 +136,7 @@ UNAME_RELEASE=$( (uname -r) 2>/dev/null) || UNAME_RELEASE=unknown UNAME_SYSTEM=$( (uname -s) 2>/dev/null) || UNAME_SYSTEM=unknown UNAME_VERSION=$( (uname -v) 2>/dev/null) || UNAME_VERSION=unknown -case "$UNAME_SYSTEM" in +case $UNAME_SYSTEM in Linux|GNU|GNU/*) LIBC=unknown @@ -176,7 +176,7 @@ esac # Note: order is significant - the case branches are not exclusive. -case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in +case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, @@ -192,7 +192,7 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in /sbin/sysctl -n hw.machine_arch 2>/dev/null || \ /usr/sbin/sysctl -n hw.machine_arch 2>/dev/null || \ echo unknown)) - case "$UNAME_MACHINE_ARCH" in + case $UNAME_MACHINE_ARCH in aarch64eb) machine=aarch64_be-unknown ;; armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; @@ -208,7 +208,7 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in esac # The Operating System including object format, if it has switched # to ELF recently (or will in the future) and ABI. - case "$UNAME_MACHINE_ARCH" in + case $UNAME_MACHINE_ARCH in earm*) os=netbsdelf ;; @@ -229,7 +229,7 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in ;; esac # Determine ABI tags. - case "$UNAME_MACHINE_ARCH" in + case $UNAME_MACHINE_ARCH in earm*) expr='s/^earmv[0-9]/-eabi/;s/eb$//' abi=$(echo "$UNAME_MACHINE_ARCH" | sed -e "$expr") @@ -240,7 +240,7 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. - case "$UNAME_VERSION" in + case $UNAME_VERSION in Debian*) release='-gnu' ;; @@ -313,7 +313,7 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=$(/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1) - case "$ALPHA_CPU_TYPE" in + case $ALPHA_CPU_TYPE in "EV4 (21064)") UNAME_MACHINE=alpha ;; "EV4.5 (21064)") @@ -435,7 +435,7 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in echo sparc-sun-solaris3"$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*//')" exit ;; sun4*:SunOS:*:*) - case "$(/usr/bin/arch -k)" in + case $(/usr/bin/arch -k) in Series*|S4*) UNAME_RELEASE=$(uname -v) ;; @@ -449,7 +449,7 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in sun*:*:4.2BSD:*) UNAME_RELEASE=$( (sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null) test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3 - case "$(/bin/arch)" in + case $(/bin/arch) in sun3) echo m68k-sun-sunos"$UNAME_RELEASE" ;; @@ -665,18 +665,18 @@ EOF exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//') - case "$UNAME_MACHINE" in + case $UNAME_MACHINE in 9000/31?) HP_ARCH=m68000 ;; 9000/[34]??) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if test -x /usr/bin/getconf; then sc_cpu_version=$(/usr/bin/getconf SC_CPU_VERSION 2>/dev/null) sc_kernel_bits=$(/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null) - case "$sc_cpu_version" in + case $sc_cpu_version in 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 - case "$sc_kernel_bits" in + case $sc_kernel_bits in 32) HP_ARCH=hppa2.0n ;; 64) HP_ARCH=hppa2.0w ;; '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20 @@ -877,7 +877,7 @@ EOF exit ;; *:FreeBSD:*:*) UNAME_PROCESSOR=$(/usr/bin/uname -p) - case "$UNAME_PROCESSOR" in + case $UNAME_PROCESSOR in amd64) UNAME_PROCESSOR=x86_64 ;; i386) @@ -901,7 +901,7 @@ EOF echo "$UNAME_MACHINE"-pc-pw32 exit ;; *:Interix*:*) - case "$UNAME_MACHINE" in + case $UNAME_MACHINE in x86) echo i586-pc-interix"$UNAME_RELEASE" exit ;; @@ -1472,7 +1472,7 @@ EOF exit ;; *:*VMS:*:*) UNAME_MACHINE=$( (uname -p) 2>/dev/null) - case "$UNAME_MACHINE" in + case $UNAME_MACHINE in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; @@ -1639,7 +1639,7 @@ test -d /usr/apollo && { echo "$ISP-apollo-$SYSTYPE"; exit; } echo "$0: unable to guess system type" >&2 -case "$UNAME_MACHINE:$UNAME_SYSTEM" in +case $UNAME_MACHINE:$UNAME_SYSTEM in mips:Linux | mips64:Linux) # If we got here on MIPS GNU/Linux, output extra information. cat >&2 <) id 1lkcX1-0006os-8Z for config-patches@gnu.org; Sat, 22 May 2021 21:03:51 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:45514) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lkcX1-0005nr-1q for config-patches@gnu.org; Sat, 22 May 2021 21:03:51 -0400 Received: from jcb by fencepost.gnu.org with local (Exim 4.90_1) (envelope-from ) id 1lkcWz-00069O-7F for config-patches@gnu.org; Sat, 22 May 2021 21:03:49 -0400 From: Jacob Bachmeyer Date: Fri, 21 May 2021 22:39:49 -0500 Subject: [PATCH 2/6] config.guess: use intermediate variable with uname results To: config-patches@gnu.org Message-Id: X-Mailman-Approved-At: Sat, 22 May 2021 21:05:59 -0400 X-BeenThere: config-patches@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Patches for the config.guess and config.sub scripts" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 May 2021 01:03:51 -0000 This will allow quoting to be significantly simplified in another pass through the file. This was done with some manual cleanup after running this Emacs Lisp: (defun edit-all-exits () (interactive) (while (re-search-forward "^\\([[:space:]]+\\)echo[[:space:]]+\\([^\n]+\\)\n\\1exit ;;" nil t) (replace-match "\\1GUESS=\\2\n\\1;;"))) * config.guess: add GUESS variable to hold results of uname analysis --- config.guess | 973 ++++++++++++++++++++++++++------------------------- 1 file changed, 492 insertions(+), 481 deletions(-) diff --git a/config.guess b/config.guess index 92074bd..6acddd3 100755 --- a/config.guess +++ b/config.guess @@ -84,6 +84,11 @@ if test $# != 0; then exit 1 fi +# just in case it came from the environment +if test x${GUESS+set} != xset; then + GUESS= +fi + # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a @@ -251,54 +256,54 @@ case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. - echo "$machine-${os}${release}${abi-}" - exit ;; + GUESS="$machine-${os}${release}${abi-}" + ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=$(arch | sed 's/Bitrig.//') - echo "$UNAME_MACHINE_ARCH"-unknown-bitrig"$UNAME_RELEASE" - exit ;; + GUESS="$UNAME_MACHINE_ARCH"-unknown-bitrig"$UNAME_RELEASE" + ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=$(arch | sed 's/OpenBSD.//') - echo "$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE" - exit ;; + GUESS="$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE" + ;; *:SecBSD:*:*) UNAME_MACHINE_ARCH=$(arch | sed 's/SecBSD.//') - echo "$UNAME_MACHINE_ARCH"-unknown-secbsd"$UNAME_RELEASE" - exit ;; + GUESS="$UNAME_MACHINE_ARCH"-unknown-secbsd"$UNAME_RELEASE" + ;; *:LibertyBSD:*:*) UNAME_MACHINE_ARCH=$(arch | sed 's/^.*BSD\.//') - echo "$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE" - exit ;; + GUESS="$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE" + ;; *:MidnightBSD:*:*) - echo "$UNAME_MACHINE"-unknown-midnightbsd"$UNAME_RELEASE" - exit ;; + GUESS="$UNAME_MACHINE"-unknown-midnightbsd"$UNAME_RELEASE" + ;; *:ekkoBSD:*:*) - echo "$UNAME_MACHINE"-unknown-ekkobsd"$UNAME_RELEASE" - exit ;; + GUESS="$UNAME_MACHINE"-unknown-ekkobsd"$UNAME_RELEASE" + ;; *:SolidBSD:*:*) - echo "$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE" - exit ;; + GUESS="$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE" + ;; *:OS108:*:*) - echo "$UNAME_MACHINE"-unknown-os108_"$UNAME_RELEASE" - exit ;; + GUESS="$UNAME_MACHINE"-unknown-os108_"$UNAME_RELEASE" + ;; macppc:MirBSD:*:*) - echo powerpc-unknown-mirbsd"$UNAME_RELEASE" - exit ;; + GUESS=powerpc-unknown-mirbsd"$UNAME_RELEASE" + ;; *:MirBSD:*:*) - echo "$UNAME_MACHINE"-unknown-mirbsd"$UNAME_RELEASE" - exit ;; + GUESS="$UNAME_MACHINE"-unknown-mirbsd"$UNAME_RELEASE" + ;; *:Sortix:*:*) - echo "$UNAME_MACHINE"-unknown-sortix - exit ;; + GUESS="$UNAME_MACHINE"-unknown-sortix + ;; *:Twizzler:*:*) - echo "$UNAME_MACHINE"-unknown-twizzler - exit ;; + GUESS="$UNAME_MACHINE"-unknown-twizzler + ;; *:Redox:*:*) - echo "$UNAME_MACHINE"-unknown-redox - exit ;; + GUESS="$UNAME_MACHINE"-unknown-redox + ;; mips:OSF1:*.*) - echo mips-dec-osf1 - exit ;; + GUESS=mips-dec-osf1 + ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) @@ -356,62 +361,62 @@ case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in trap '' 0 exit $exitcode ;; Amiga*:UNIX_System_V:4.0:*) - echo m68k-unknown-sysv4 - exit ;; + GUESS=m68k-unknown-sysv4 + ;; *:[Aa]miga[Oo][Ss]:*:*) - echo "$UNAME_MACHINE"-unknown-amigaos - exit ;; + GUESS="$UNAME_MACHINE"-unknown-amigaos + ;; *:[Mm]orph[Oo][Ss]:*:*) - echo "$UNAME_MACHINE"-unknown-morphos - exit ;; + GUESS="$UNAME_MACHINE"-unknown-morphos + ;; *:OS/390:*:*) - echo i370-ibm-openedition - exit ;; + GUESS=i370-ibm-openedition + ;; *:z/VM:*:*) - echo s390-ibm-zvmoe - exit ;; + GUESS=s390-ibm-zvmoe + ;; *:OS400:*:*) - echo powerpc-ibm-os400 - exit ;; + GUESS=powerpc-ibm-os400 + ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) - echo arm-acorn-riscix"$UNAME_RELEASE" - exit ;; + GUESS=arm-acorn-riscix"$UNAME_RELEASE" + ;; arm*:riscos:*:*|arm*:RISCOS:*:*) - echo arm-unknown-riscos - exit ;; + GUESS=arm-unknown-riscos + ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) - echo hppa1.1-hitachi-hiuxmpp - exit ;; + GUESS=hppa1.1-hitachi-hiuxmpp + ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "$( (/bin/universe) 2>/dev/null)" = att ; then - echo pyramid-pyramid-sysv3 + GUESS=pyramid-pyramid-sysv3 else - echo pyramid-pyramid-bsd + GUESS=pyramid-pyramid-bsd fi - exit ;; + ;; NILE*:*:*:dcosx) - echo pyramid-pyramid-svr4 - exit ;; + GUESS=pyramid-pyramid-svr4 + ;; DRS?6000:unix:4.0:6*) - echo sparc-icl-nx6 - exit ;; + GUESS=sparc-icl-nx6 + ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case $(/usr/bin/uname -p) in sparc) echo sparc-icl-nx7; exit ;; esac ;; s390x:SunOS:*:*) - echo "$UNAME_MACHINE"-ibm-solaris2"$(echo "$UNAME_RELEASE" | sed -e 's/[^.]*//')" - exit ;; + GUESS="$UNAME_MACHINE"-ibm-solaris2"$(echo "$UNAME_RELEASE" | sed -e 's/[^.]*//')" + ;; sun4H:SunOS:5.*:*) - echo sparc-hal-solaris2"$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*//')" - exit ;; + GUESS=sparc-hal-solaris2"$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*//')" + ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) - echo sparc-sun-solaris2"$(echo "$UNAME_RELEASE" | sed -e 's/[^.]*//')" - exit ;; + GUESS=sparc-sun-solaris2"$(echo "$UNAME_RELEASE" | sed -e 's/[^.]*//')" + ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) - echo i386-pc-auroraux"$UNAME_RELEASE" - exit ;; + GUESS=i386-pc-auroraux"$UNAME_RELEASE" + ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) set_cc_for_build SUN_ARCH=i386 @@ -426,14 +431,14 @@ case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in SUN_ARCH=x86_64 fi fi - echo "$SUN_ARCH"-pc-solaris2"$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*//')" - exit ;; + GUESS="$SUN_ARCH"-pc-solaris2"$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*//')" + ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. - echo sparc-sun-solaris3"$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*//')" - exit ;; + GUESS=sparc-sun-solaris3"$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*//')" + ;; sun4*:SunOS:*:*) case $(/usr/bin/arch -k) in Series*|S4*) @@ -441,26 +446,26 @@ case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. - echo sparc-sun-sunos"$(echo "$UNAME_RELEASE"|sed -e 's/-/_/')" - exit ;; + GUESS=sparc-sun-sunos"$(echo "$UNAME_RELEASE"|sed -e 's/-/_/')" + ;; sun3*:SunOS:*:*) - echo m68k-sun-sunos"$UNAME_RELEASE" - exit ;; + GUESS=m68k-sun-sunos"$UNAME_RELEASE" + ;; sun*:*:4.2BSD:*) UNAME_RELEASE=$( (sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null) test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3 case $(/bin/arch) in sun3) - echo m68k-sun-sunos"$UNAME_RELEASE" + GUESS=m68k-sun-sunos"$UNAME_RELEASE" ;; sun4) - echo sparc-sun-sunos"$UNAME_RELEASE" + GUESS=sparc-sun-sunos"$UNAME_RELEASE" ;; esac - exit ;; + ;; aushp:SunOS:*:*) - echo sparc-auspex-sunos"$UNAME_RELEASE" - exit ;; + GUESS=sparc-auspex-sunos"$UNAME_RELEASE" + ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor @@ -470,41 +475,41 @@ case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint"$UNAME_RELEASE" - exit ;; + GUESS=m68k-atari-mint"$UNAME_RELEASE" + ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint"$UNAME_RELEASE" - exit ;; + GUESS=m68k-atari-mint"$UNAME_RELEASE" + ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) - echo m68k-atari-mint"$UNAME_RELEASE" - exit ;; + GUESS=m68k-atari-mint"$UNAME_RELEASE" + ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) - echo m68k-milan-mint"$UNAME_RELEASE" - exit ;; + GUESS=m68k-milan-mint"$UNAME_RELEASE" + ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) - echo m68k-hades-mint"$UNAME_RELEASE" - exit ;; + GUESS=m68k-hades-mint"$UNAME_RELEASE" + ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) - echo m68k-unknown-mint"$UNAME_RELEASE" - exit ;; + GUESS=m68k-unknown-mint"$UNAME_RELEASE" + ;; m68k:machten:*:*) - echo m68k-apple-machten"$UNAME_RELEASE" - exit ;; + GUESS=m68k-apple-machten"$UNAME_RELEASE" + ;; powerpc:machten:*:*) - echo powerpc-apple-machten"$UNAME_RELEASE" - exit ;; + GUESS=powerpc-apple-machten"$UNAME_RELEASE" + ;; RISC*:Mach:*:*) - echo mips-dec-mach_bsd4.3 - exit ;; + GUESS=mips-dec-mach_bsd4.3 + ;; RISC*:ULTRIX:*:*) - echo mips-dec-ultrix"$UNAME_RELEASE" - exit ;; + GUESS=mips-dec-ultrix"$UNAME_RELEASE" + ;; VAX*:ULTRIX*:*:*) - echo vax-dec-ultrix"$UNAME_RELEASE" - exit ;; + GUESS=vax-dec-ultrix"$UNAME_RELEASE" + ;; 2020:CLIX:*:* | 2430:CLIX:*:*) - echo clipper-intergraph-clix"$UNAME_RELEASE" - exit ;; + GUESS=clipper-intergraph-clix"$UNAME_RELEASE" + ;; mips:*:*:UMIPS | mips:*:*:RISCos) set_cc_for_build sed 's/^ //' << EOF > "$dummy.c" @@ -532,29 +537,29 @@ EOF dummyarg=$(echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p') && SYSTEM_NAME=$("$dummy" "$dummyarg") && { echo "$SYSTEM_NAME"; exit; } - echo mips-mips-riscos"$UNAME_RELEASE" - exit ;; + GUESS=mips-mips-riscos"$UNAME_RELEASE" + ;; Motorola:PowerMAX_OS:*:*) - echo powerpc-motorola-powermax - exit ;; + GUESS=powerpc-motorola-powermax + ;; Motorola:*:4.3:PL8-*) - echo powerpc-harris-powermax - exit ;; + GUESS=powerpc-harris-powermax + ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) - echo powerpc-harris-powermax - exit ;; + GUESS=powerpc-harris-powermax + ;; Night_Hawk:Power_UNIX:*:*) - echo powerpc-harris-powerunix - exit ;; + GUESS=powerpc-harris-powerunix + ;; m88k:CX/UX:7*:*) - echo m88k-harris-cxux7 - exit ;; + GUESS=m88k-harris-cxux7 + ;; m88k:*:4*:R4*) - echo m88k-motorola-sysv4 - exit ;; + GUESS=m88k-motorola-sysv4 + ;; m88k:*:3*:R3*) - echo m88k-motorola-sysv3 - exit ;; + GUESS=m88k-motorola-sysv3 + ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=$(/usr/bin/uname -p) @@ -563,44 +568,44 @@ EOF if test "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx || \ test "$TARGET_BINARY_INTERFACE"x = x then - echo m88k-dg-dgux"$UNAME_RELEASE" + GUESS=m88k-dg-dgux"$UNAME_RELEASE" else - echo m88k-dg-dguxbcs"$UNAME_RELEASE" + GUESS=m88k-dg-dguxbcs"$UNAME_RELEASE" fi else - echo i586-dg-dgux"$UNAME_RELEASE" + GUESS=i586-dg-dgux"$UNAME_RELEASE" fi - exit ;; + ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) - echo m88k-dolphin-sysv3 - exit ;; + GUESS=m88k-dolphin-sysv3 + ;; M88*:*:R3*:*) # Delta 88k system running SVR3 - echo m88k-motorola-sysv3 - exit ;; + GUESS=m88k-motorola-sysv3 + ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) - echo m88k-tektronix-sysv3 - exit ;; + GUESS=m88k-tektronix-sysv3 + ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) - echo m68k-tektronix-bsd - exit ;; + GUESS=m68k-tektronix-bsd + ;; *:IRIX*:*:*) - echo mips-sgi-irix"$(echo "$UNAME_RELEASE"|sed -e 's/-/_/g')" - exit ;; + GUESS=mips-sgi-irix"$(echo "$UNAME_RELEASE"|sed -e 's/-/_/g')" + ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. - echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id - exit ;; # Note that: echo "'$(uname -s)'" gives 'AIX ' + GUESS=romp-ibm-aix # uname -m gives an 8 hex-code CPU id + ;; # Note that: echo "'$(uname -s)'" gives 'AIX ' i*86:AIX:*:*) - echo i386-ibm-aix - exit ;; + GUESS=i386-ibm-aix + ;; ia64:AIX:*:*) if test -x /usr/bin/oslevel ; then IBM_REV=$(/usr/bin/oslevel) else IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" fi - echo "$UNAME_MACHINE"-ibm-aix"$IBM_REV" - exit ;; + GUESS="$UNAME_MACHINE"-ibm-aix"$IBM_REV" + ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then set_cc_for_build @@ -617,16 +622,16 @@ EOF EOF if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=$("$dummy") then - echo "$SYSTEM_NAME" + GUESS=$SYSTEM_NAME else - echo rs6000-ibm-aix3.2.5 + GUESS=rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then - echo rs6000-ibm-aix3.2.4 + GUESS=rs6000-ibm-aix3.2.4 else - echo rs6000-ibm-aix3.2 + GUESS=rs6000-ibm-aix3.2 fi - exit ;; + ;; *:AIX:*:[4567]) IBM_CPU_ID=$(/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }') if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then @@ -640,29 +645,29 @@ EOF else IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" fi - echo "$IBM_ARCH"-ibm-aix"$IBM_REV" - exit ;; + GUESS="$IBM_ARCH"-ibm-aix"$IBM_REV" + ;; *:AIX:*:*) - echo rs6000-ibm-aix - exit ;; + GUESS=rs6000-ibm-aix + ;; ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*) - echo romp-ibm-bsd4.4 - exit ;; + GUESS=romp-ibm-bsd4.4 + ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and - echo romp-ibm-bsd"$UNAME_RELEASE" # 4.3 with uname added to - exit ;; # report: romp-ibm BSD 4.3 + GUESS=romp-ibm-bsd"$UNAME_RELEASE" # 4.3 with uname added to + ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) - echo rs6000-bull-bosx - exit ;; + GUESS=rs6000-bull-bosx + ;; DPX/2?00:B.O.S.:*:*) - echo m68k-bull-sysv3 - exit ;; + GUESS=m68k-bull-sysv3 + ;; 9000/[34]??:4.3bsd:1.*:*) - echo m68k-hp-bsd - exit ;; + GUESS=m68k-hp-bsd + ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) - echo m68k-hp-bsd4.4 - exit ;; + GUESS=m68k-hp-bsd4.4 + ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//') case $UNAME_MACHINE in @@ -743,12 +748,12 @@ EOF HP_ARCH=hppa64 fi fi - echo "$HP_ARCH"-hp-hpux"$HPUX_REV" - exit ;; + GUESS="$HP_ARCH"-hp-hpux"$HPUX_REV" + ;; ia64:HP-UX:*:*) HPUX_REV=$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//') - echo ia64-hp-hpux"$HPUX_REV" - exit ;; + GUESS=ia64-hp-hpux"$HPUX_REV" + ;; 3050*:HI-UX:*:*) set_cc_for_build sed 's/^ //' << EOF > "$dummy.c" @@ -778,36 +783,36 @@ EOF EOF $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=$("$dummy") && { echo "$SYSTEM_NAME"; exit; } - echo unknown-hitachi-hiuxwe2 - exit ;; + GUESS=unknown-hitachi-hiuxwe2 + ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*) - echo hppa1.1-hp-bsd - exit ;; + GUESS=hppa1.1-hp-bsd + ;; 9000/8??:4.3bsd:*:*) - echo hppa1.0-hp-bsd - exit ;; + GUESS=hppa1.0-hp-bsd + ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) - echo hppa1.0-hp-mpeix - exit ;; + GUESS=hppa1.0-hp-mpeix + ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*) - echo hppa1.1-hp-osf - exit ;; + GUESS=hppa1.1-hp-osf + ;; hp8??:OSF1:*:*) - echo hppa1.0-hp-osf - exit ;; + GUESS=hppa1.0-hp-osf + ;; i*86:OSF1:*:*) if test -x /usr/sbin/sysversion ; then - echo "$UNAME_MACHINE"-unknown-osf1mk + GUESS="$UNAME_MACHINE"-unknown-osf1mk else - echo "$UNAME_MACHINE"-unknown-osf1 + GUESS="$UNAME_MACHINE"-unknown-osf1 fi - exit ;; + ;; parisc*:Lites*:*:*) - echo hppa1.1-hp-lites - exit ;; + GUESS=hppa1.1-hp-lites + ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) - echo c1-convex-bsd - exit ;; + GUESS=c1-convex-bsd + ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd @@ -815,17 +820,17 @@ EOF fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) - echo c34-convex-bsd - exit ;; + GUESS=c34-convex-bsd + ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) - echo c38-convex-bsd - exit ;; + GUESS=c38-convex-bsd + ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) - echo c4-convex-bsd - exit ;; + GUESS=c4-convex-bsd + ;; CRAY*Y-MP:*:*:*) - echo ymp-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' - exit ;; + GUESS=ymp-cray-unicos"$(echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/')" + ;; CRAY*[A-Z]90:*:*:*) echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ @@ -833,48 +838,48 @@ EOF -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) - echo t90-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' - exit ;; + GUESS=t90-cray-unicos"$(echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/')" + ;; CRAY*T3E:*:*:*) - echo alphaev5-cray-unicosmk"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' - exit ;; + GUESS=alphaev5-cray-unicosmk"$(echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/')" + ;; CRAY*SV1:*:*:*) - echo sv1-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' - exit ;; + GUESS=sv1-cray-unicos"$(echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/')" + ;; *:UNICOS/mp:*:*) - echo craynv-cray-unicosmp"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' - exit ;; + GUESS=craynv-cray-unicosmp"$(echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/')" + ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=$(uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz) FUJITSU_SYS=$(uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///') FUJITSU_REL=$(echo "$UNAME_RELEASE" | sed -e 's/ /_/') - echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit ;; + GUESS="${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=$(uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///') FUJITSU_REL=$(echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/') - echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit ;; + GUESS="sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) - echo "$UNAME_MACHINE"-pc-bsdi"$UNAME_RELEASE" - exit ;; + GUESS="$UNAME_MACHINE"-pc-bsdi"$UNAME_RELEASE" + ;; sparc*:BSD/OS:*:*) - echo sparc-unknown-bsdi"$UNAME_RELEASE" - exit ;; + GUESS=sparc-unknown-bsdi"$UNAME_RELEASE" + ;; *:BSD/OS:*:*) - echo "$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE" - exit ;; + GUESS="$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE" + ;; arm:FreeBSD:*:*) UNAME_PROCESSOR=$(uname -p) set_cc_for_build if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then - echo "${UNAME_PROCESSOR}"-unknown-freebsd"$(echo ${UNAME_RELEASE}|sed -e 's/[-(].*//')"-gnueabi + GUESS="${UNAME_PROCESSOR}"-unknown-freebsd"$(echo ${UNAME_RELEASE}|sed -e 's/[-(].*//')"-gnueabi else - echo "${UNAME_PROCESSOR}"-unknown-freebsd"$(echo ${UNAME_RELEASE}|sed -e 's/[-(].*//')"-gnueabihf + GUESS="${UNAME_PROCESSOR}"-unknown-freebsd"$(echo ${UNAME_RELEASE}|sed -e 's/[-(].*//')"-gnueabihf fi - exit ;; + ;; *:FreeBSD:*:*) UNAME_PROCESSOR=$(/usr/bin/uname -p) case $UNAME_PROCESSOR in @@ -883,62 +888,62 @@ EOF i386) UNAME_PROCESSOR=i586 ;; esac - echo "$UNAME_PROCESSOR"-unknown-freebsd"$(echo "$UNAME_RELEASE"|sed -e 's/[-(].*//')" - exit ;; + GUESS="$UNAME_PROCESSOR"-unknown-freebsd"$(echo "$UNAME_RELEASE"|sed -e 's/[-(].*//')" + ;; i*:CYGWIN*:*) - echo "$UNAME_MACHINE"-pc-cygwin - exit ;; + GUESS="$UNAME_MACHINE"-pc-cygwin + ;; *:MINGW64*:*) - echo "$UNAME_MACHINE"-pc-mingw64 - exit ;; + GUESS="$UNAME_MACHINE"-pc-mingw64 + ;; *:MINGW*:*) - echo "$UNAME_MACHINE"-pc-mingw32 - exit ;; + GUESS="$UNAME_MACHINE"-pc-mingw32 + ;; *:MSYS*:*) - echo "$UNAME_MACHINE"-pc-msys - exit ;; + GUESS="$UNAME_MACHINE"-pc-msys + ;; i*:PW*:*) - echo "$UNAME_MACHINE"-pc-pw32 - exit ;; + GUESS="$UNAME_MACHINE"-pc-pw32 + ;; *:Interix*:*) case $UNAME_MACHINE in x86) - echo i586-pc-interix"$UNAME_RELEASE" - exit ;; + GUESS=i586-pc-interix"$UNAME_RELEASE" + ;; authenticamd | genuineintel | EM64T) - echo x86_64-unknown-interix"$UNAME_RELEASE" - exit ;; + GUESS=x86_64-unknown-interix"$UNAME_RELEASE" + ;; IA64) - echo ia64-unknown-interix"$UNAME_RELEASE" - exit ;; + GUESS=ia64-unknown-interix"$UNAME_RELEASE" + ;; esac ;; i*:UWIN*:*) - echo "$UNAME_MACHINE"-pc-uwin - exit ;; + GUESS="$UNAME_MACHINE"-pc-uwin + ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) - echo x86_64-pc-cygwin - exit ;; + GUESS=x86_64-pc-cygwin + ;; prep*:SunOS:5.*:*) - echo powerpcle-unknown-solaris2"$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*//')" - exit ;; + GUESS=powerpcle-unknown-solaris2"$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*//')" + ;; *:GNU:*:*) # the GNU system - echo "$(echo "$UNAME_MACHINE"|sed -e 's,[-/].*$,,')-unknown-$LIBC$(echo "$UNAME_RELEASE"|sed -e 's,/.*$,,')" - exit ;; + GUESS="$(echo "$UNAME_MACHINE"|sed -e 's,[-/].*$,,')-unknown-$LIBC$(echo "$UNAME_RELEASE"|sed -e 's,/.*$,,')" + ;; *:GNU/*:*:*) # other systems with GNU libc and userland - echo "$UNAME_MACHINE-unknown-$(echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]")$(echo "$UNAME_RELEASE"|sed -e 's/[-(].*//')-$LIBC" - exit ;; + GUESS="$UNAME_MACHINE-unknown-$(echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]")$(echo "$UNAME_RELEASE"|sed -e 's/[-(].*//')-$LIBC" + ;; *:Minix:*:*) - echo "$UNAME_MACHINE"-unknown-minix - exit ;; + GUESS="$UNAME_MACHINE"-unknown-minix + ;; aarch64:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC" + ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC" + ;; alpha:Linux:*:*) case $(sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null) in EV5) UNAME_MACHINE=alphaev5 ;; @@ -951,63 +956,63 @@ EOF esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC=gnulibc1 ; fi - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC" + ;; arc:Linux:*:* | arceb:Linux:*:* | arc64:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC" + ;; arm*:Linux:*:*) set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC" else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabi + GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC"eabi else - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabihf + GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC"eabihf fi fi - exit ;; + ;; avr32*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC" + ;; cris:Linux:*:*) - echo "$UNAME_MACHINE"-axis-linux-"$LIBC" - exit ;; + GUESS="$UNAME_MACHINE"-axis-linux-"$LIBC" + ;; crisv32:Linux:*:*) - echo "$UNAME_MACHINE"-axis-linux-"$LIBC" - exit ;; + GUESS="$UNAME_MACHINE"-axis-linux-"$LIBC" + ;; e2k:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC" + ;; frv:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC" + ;; hexagon:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC" + ;; i*86:Linux:*:*) - echo "$UNAME_MACHINE"-pc-linux-"$LIBC" - exit ;; + GUESS="$UNAME_MACHINE"-pc-linux-"$LIBC" + ;; ia64:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC" + ;; k1om:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC" + ;; loongarch32:Linux:*:* | loongarch64:Linux:*:* | loongarchx32:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC" + ;; m32r*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC" + ;; m68*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC" + ;; mips:Linux:*:* | mips64:Linux:*:*) set_cc_for_build IS_GLIBC=0 @@ -1056,20 +1061,20 @@ EOF test "x$CPU" != x && { echo "$CPU${MIPS_ENDIAN}-unknown-linux-$LIBCABI"; exit; } ;; mips64el:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC" + ;; openrisc*:Linux:*:*) - echo or1k-unknown-linux-"$LIBC" - exit ;; + GUESS=or1k-unknown-linux-"$LIBC" + ;; or32:Linux:*:* | or1k*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC" + ;; padre:Linux:*:*) - echo sparc-unknown-linux-"$LIBC" - exit ;; + GUESS=sparc-unknown-linux-"$LIBC" + ;; parisc64:Linux:*:* | hppa64:Linux:*:*) - echo hppa64-unknown-linux-"$LIBC" - exit ;; + GUESS=hppa64-unknown-linux-"$LIBC" + ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case $(grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2) in @@ -1079,38 +1084,38 @@ EOF esac exit ;; ppc64:Linux:*:*) - echo powerpc64-unknown-linux-"$LIBC" - exit ;; + GUESS=powerpc64-unknown-linux-"$LIBC" + ;; ppc:Linux:*:*) - echo powerpc-unknown-linux-"$LIBC" - exit ;; + GUESS=powerpc-unknown-linux-"$LIBC" + ;; ppc64le:Linux:*:*) - echo powerpc64le-unknown-linux-"$LIBC" - exit ;; + GUESS=powerpc64le-unknown-linux-"$LIBC" + ;; ppcle:Linux:*:*) - echo powerpcle-unknown-linux-"$LIBC" - exit ;; + GUESS=powerpcle-unknown-linux-"$LIBC" + ;; riscv32:Linux:*:* | riscv32be:Linux:*:* | riscv64:Linux:*:* | riscv64be:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC" + ;; s390:Linux:*:* | s390x:Linux:*:*) - echo "$UNAME_MACHINE"-ibm-linux-"$LIBC" - exit ;; + GUESS="$UNAME_MACHINE"-ibm-linux-"$LIBC" + ;; sh64*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC" + ;; sh*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC" + ;; sparc:Linux:*:* | sparc64:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC" + ;; tile*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC" + ;; vax:Linux:*:*) - echo "$UNAME_MACHINE"-dec-linux-"$LIBC" - exit ;; + GUESS="$UNAME_MACHINE"-dec-linux-"$LIBC" + ;; x86_64:Linux:*:*) set_cc_for_build LIBCABI=$LIBC @@ -1122,53 +1127,53 @@ EOF LIBCABI="$LIBC"x32 fi fi - echo "$UNAME_MACHINE"-pc-linux-"$LIBCABI" - exit ;; + GUESS="$UNAME_MACHINE"-pc-linux-"$LIBCABI" + ;; xtensa*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC" + ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. - echo i386-sequent-sysv4 - exit ;; + GUESS=i386-sequent-sysv4 + ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. - echo "$UNAME_MACHINE"-pc-sysv4.2uw"$UNAME_VERSION" - exit ;; + GUESS="$UNAME_MACHINE"-pc-sysv4.2uw"$UNAME_VERSION" + ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. - echo "$UNAME_MACHINE"-pc-os2-emx - exit ;; + GUESS="$UNAME_MACHINE"-pc-os2-emx + ;; i*86:XTS-300:*:STOP) - echo "$UNAME_MACHINE"-unknown-stop - exit ;; + GUESS="$UNAME_MACHINE"-unknown-stop + ;; i*86:atheos:*:*) - echo "$UNAME_MACHINE"-unknown-atheos - exit ;; + GUESS="$UNAME_MACHINE"-unknown-atheos + ;; i*86:syllable:*:*) - echo "$UNAME_MACHINE"-pc-syllable - exit ;; + GUESS="$UNAME_MACHINE"-pc-syllable + ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) - echo i386-unknown-lynxos"$UNAME_RELEASE" - exit ;; + GUESS=i386-unknown-lynxos"$UNAME_RELEASE" + ;; i*86:*DOS:*:*) - echo "$UNAME_MACHINE"-pc-msdosdjgpp - exit ;; + GUESS="$UNAME_MACHINE"-pc-msdosdjgpp + ;; i*86:*:4.*:*) UNAME_REL=$(echo "$UNAME_RELEASE" | sed 's/\/MP$//') if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then - echo "$UNAME_MACHINE"-univel-sysv"$UNAME_REL" + GUESS="$UNAME_MACHINE"-univel-sysv"$UNAME_REL" else - echo "$UNAME_MACHINE"-pc-sysv"$UNAME_REL" + GUESS="$UNAME_MACHINE"-pc-sysv"$UNAME_REL" fi - exit ;; + ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case $(/bin/uname -X | grep "^Machine") in @@ -1176,26 +1181,26 @@ EOF *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac - echo "$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}" - exit ;; + GUESS="$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}" + ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then - UNAME_REL=$(sed -n 's/.*Version //p' /dev/null >/dev/null ; then - UNAME_REL=$( (/bin/uname -X|grep Release|sed -e 's/.*= //')) - (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 - (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ - && UNAME_MACHINE=i586 - (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ - && UNAME_MACHINE=i686 - (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ - && UNAME_MACHINE=i686 - echo "$UNAME_MACHINE"-pc-sco"$UNAME_REL" + UNAME_REL=$( (/bin/uname -X|grep Release|sed -e 's/.*= //')) + (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 + (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ + && UNAME_MACHINE=i586 + (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ + && UNAME_MACHINE=i686 + (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ + && UNAME_MACHINE=i686 + GUESS="$UNAME_MACHINE"-pc-sco"$UNAME_REL" else - echo "$UNAME_MACHINE"-pc-sysv32 + GUESS="$UNAME_MACHINE"-pc-sysv32 fi - exit ;; + ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about @@ -1203,31 +1208,31 @@ EOF # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configure will decide that # this is a cross-build. - echo i586-pc-msdosdjgpp - exit ;; + GUESS=i586-pc-msdosdjgpp + ;; Intel:Mach:3*:*) - echo i386-pc-mach3 - exit ;; + GUESS=i386-pc-mach3 + ;; paragon:*:*:*) - echo i860-intel-osf1 - exit ;; + GUESS=i860-intel-osf1 + ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then - echo i860-stardent-sysv"$UNAME_RELEASE" # Stardent Vistra i860-SVR4 + GUESS=i860-stardent-sysv"$UNAME_RELEASE" # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. - echo i860-unknown-sysv"$UNAME_RELEASE" # Unknown i860-SVR4 + GUESS=i860-unknown-sysv"$UNAME_RELEASE" # Unknown i860-SVR4 fi - exit ;; + ;; mini*:CTIX:SYS*5:*) # "miniframe" - echo m68010-convergent-sysv - exit ;; + GUESS=m68010-convergent-sysv + ;; mc68k:UNIX:SYSTEM5:3.51m) - echo m68k-convergent-sysv - exit ;; + GUESS=m68k-convergent-sysv + ;; M680?0:D-NIX:5.3:*) - echo m68k-diab-dnix - exit ;; + GUESS=m68k-diab-dnix + ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) @@ -1252,116 +1257,116 @@ EOF /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) - echo m68k-unknown-lynxos"$UNAME_RELEASE" - exit ;; + GUESS=m68k-unknown-lynxos"$UNAME_RELEASE" + ;; mc68030:UNIX_System_V:4.*:*) - echo m68k-atari-sysv4 - exit ;; + GUESS=m68k-atari-sysv4 + ;; TSUNAMI:LynxOS:2.*:*) - echo sparc-unknown-lynxos"$UNAME_RELEASE" - exit ;; + GUESS=sparc-unknown-lynxos"$UNAME_RELEASE" + ;; rs6000:LynxOS:2.*:*) - echo rs6000-unknown-lynxos"$UNAME_RELEASE" - exit ;; + GUESS=rs6000-unknown-lynxos"$UNAME_RELEASE" + ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) - echo powerpc-unknown-lynxos"$UNAME_RELEASE" - exit ;; + GUESS=powerpc-unknown-lynxos"$UNAME_RELEASE" + ;; SM[BE]S:UNIX_SV:*:*) - echo mips-dde-sysv"$UNAME_RELEASE" - exit ;; + GUESS=mips-dde-sysv"$UNAME_RELEASE" + ;; RM*:ReliantUNIX-*:*:*) - echo mips-sni-sysv4 - exit ;; + GUESS=mips-sni-sysv4 + ;; RM*:SINIX-*:*:*) - echo mips-sni-sysv4 - exit ;; + GUESS=mips-sni-sysv4 + ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then - UNAME_MACHINE=$( (uname -p) 2>/dev/null) - echo "$UNAME_MACHINE"-sni-sysv4 + UNAME_MACHINE=$( (uname -p) 2>/dev/null) + GUESS="$UNAME_MACHINE"-sni-sysv4 else - echo ns32k-sni-sysv + GUESS=ns32k-sni-sysv fi - exit ;; + ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says - echo i586-unisys-sysv4 - exit ;; + GUESS=i586-unisys-sysv4 + ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm - echo hppa1.1-stratus-sysv4 - exit ;; + GUESS=hppa1.1-stratus-sysv4 + ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. - echo i860-stratus-sysv4 - exit ;; + GUESS=i860-stratus-sysv4 + ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. - echo "$UNAME_MACHINE"-stratus-vos - exit ;; + GUESS="$UNAME_MACHINE"-stratus-vos + ;; *:VOS:*:*) # From Paul.Green@stratus.com. - echo hppa1.1-stratus-vos - exit ;; + GUESS=hppa1.1-stratus-vos + ;; mc68*:A/UX:*:*) - echo m68k-apple-aux"$UNAME_RELEASE" - exit ;; + GUESS=m68k-apple-aux"$UNAME_RELEASE" + ;; news*:NEWS-OS:6*:*) - echo mips-sony-newsos6 - exit ;; + GUESS=mips-sony-newsos6 + ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if test -d /usr/nec; then - echo mips-nec-sysv"$UNAME_RELEASE" + GUESS=mips-nec-sysv"$UNAME_RELEASE" else - echo mips-unknown-sysv"$UNAME_RELEASE" + GUESS=mips-unknown-sysv"$UNAME_RELEASE" fi - exit ;; + ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. - echo powerpc-be-beos - exit ;; + GUESS=powerpc-be-beos + ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. - echo powerpc-apple-beos - exit ;; + GUESS=powerpc-apple-beos + ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. - echo i586-pc-beos - exit ;; + GUESS=i586-pc-beos + ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. - echo i586-pc-haiku - exit ;; + GUESS=i586-pc-haiku + ;; x86_64:Haiku:*:*) - echo x86_64-unknown-haiku - exit ;; + GUESS=x86_64-unknown-haiku + ;; SX-4:SUPER-UX:*:*) - echo sx4-nec-superux"$UNAME_RELEASE" - exit ;; + GUESS=sx4-nec-superux"$UNAME_RELEASE" + ;; SX-5:SUPER-UX:*:*) - echo sx5-nec-superux"$UNAME_RELEASE" - exit ;; + GUESS=sx5-nec-superux"$UNAME_RELEASE" + ;; SX-6:SUPER-UX:*:*) - echo sx6-nec-superux"$UNAME_RELEASE" - exit ;; + GUESS=sx6-nec-superux"$UNAME_RELEASE" + ;; SX-7:SUPER-UX:*:*) - echo sx7-nec-superux"$UNAME_RELEASE" - exit ;; + GUESS=sx7-nec-superux"$UNAME_RELEASE" + ;; SX-8:SUPER-UX:*:*) - echo sx8-nec-superux"$UNAME_RELEASE" - exit ;; + GUESS=sx8-nec-superux"$UNAME_RELEASE" + ;; SX-8R:SUPER-UX:*:*) - echo sx8r-nec-superux"$UNAME_RELEASE" - exit ;; + GUESS=sx8r-nec-superux"$UNAME_RELEASE" + ;; SX-ACE:SUPER-UX:*:*) - echo sxace-nec-superux"$UNAME_RELEASE" - exit ;; + GUESS=sxace-nec-superux"$UNAME_RELEASE" + ;; Power*:Rhapsody:*:*) - echo powerpc-apple-rhapsody"$UNAME_RELEASE" - exit ;; + GUESS=powerpc-apple-rhapsody"$UNAME_RELEASE" + ;; *:Rhapsody:*:*) - echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE" - exit ;; + GUESS="$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE" + ;; arm64:Darwin:*:*) - echo aarch64-apple-darwin"$UNAME_RELEASE" - exit ;; + GUESS=aarch64-apple-darwin"$UNAME_RELEASE" + ;; *:Darwin:*:*) UNAME_PROCESSOR=$(uname -p) case $UNAME_PROCESSOR in @@ -1397,43 +1402,43 @@ EOF # uname -m returns i386 or x86_64 UNAME_PROCESSOR=$UNAME_MACHINE fi - echo "$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE" - exit ;; + GUESS="$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE" + ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=$(uname -p) if test "$UNAME_PROCESSOR" = x86; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi - echo "$UNAME_PROCESSOR"-"$UNAME_MACHINE"-nto-qnx"$UNAME_RELEASE" - exit ;; + GUESS="$UNAME_PROCESSOR"-"$UNAME_MACHINE"-nto-qnx"$UNAME_RELEASE" + ;; *:QNX:*:4*) - echo i386-pc-qnx - exit ;; + GUESS=i386-pc-qnx + ;; NEO-*:NONSTOP_KERNEL:*:*) - echo neo-tandem-nsk"$UNAME_RELEASE" - exit ;; + GUESS=neo-tandem-nsk"$UNAME_RELEASE" + ;; NSE-*:NONSTOP_KERNEL:*:*) - echo nse-tandem-nsk"$UNAME_RELEASE" - exit ;; + GUESS=nse-tandem-nsk"$UNAME_RELEASE" + ;; NSR-*:NONSTOP_KERNEL:*:*) - echo nsr-tandem-nsk"$UNAME_RELEASE" - exit ;; + GUESS=nsr-tandem-nsk"$UNAME_RELEASE" + ;; NSV-*:NONSTOP_KERNEL:*:*) - echo nsv-tandem-nsk"$UNAME_RELEASE" - exit ;; + GUESS=nsv-tandem-nsk"$UNAME_RELEASE" + ;; NSX-*:NONSTOP_KERNEL:*:*) - echo nsx-tandem-nsk"$UNAME_RELEASE" - exit ;; + GUESS=nsx-tandem-nsk"$UNAME_RELEASE" + ;; *:NonStop-UX:*:*) - echo mips-compaq-nonstopux - exit ;; + GUESS=mips-compaq-nonstopux + ;; BS2000:POSIX*:*:*) - echo bs2000-siemens-sysv - exit ;; + GUESS=bs2000-siemens-sysv + ;; DS/*:UNIX_System_V:*:*) - echo "$UNAME_MACHINE"-"$UNAME_SYSTEM"-"$UNAME_RELEASE" - exit ;; + GUESS="$UNAME_MACHINE"-"$UNAME_SYSTEM"-"$UNAME_RELEASE" + ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 @@ -1444,32 +1449,32 @@ EOF else UNAME_MACHINE="$cputype" fi - echo "$UNAME_MACHINE"-unknown-plan9 - exit ;; + GUESS="$UNAME_MACHINE"-unknown-plan9 + ;; *:TOPS-10:*:*) - echo pdp10-unknown-tops10 - exit ;; + GUESS=pdp10-unknown-tops10 + ;; *:TENEX:*:*) - echo pdp10-unknown-tenex - exit ;; + GUESS=pdp10-unknown-tenex + ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) - echo pdp10-dec-tops20 - exit ;; + GUESS=pdp10-dec-tops20 + ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) - echo pdp10-xkl-tops20 - exit ;; + GUESS=pdp10-xkl-tops20 + ;; *:TOPS-20:*:*) - echo pdp10-unknown-tops20 - exit ;; + GUESS=pdp10-unknown-tops20 + ;; *:ITS:*:*) - echo pdp10-unknown-its - exit ;; + GUESS=pdp10-unknown-its + ;; SEI:*:*:SEIUX) - echo mips-sei-seiux"$UNAME_RELEASE" - exit ;; + GUESS=mips-sei-seiux"$UNAME_RELEASE" + ;; *:DragonFly:*:*) - echo "$UNAME_MACHINE"-unknown-dragonfly"$(echo "$UNAME_RELEASE"|sed -e 's/[-(].*//')" - exit ;; + GUESS="$UNAME_MACHINE"-unknown-dragonfly"$(echo "$UNAME_RELEASE"|sed -e 's/[-(].*//')" + ;; *:*VMS:*:*) UNAME_MACHINE=$( (uname -p) 2>/dev/null) case $UNAME_MACHINE in @@ -1478,28 +1483,34 @@ EOF V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) - echo i386-pc-xenix - exit ;; + GUESS=i386-pc-xenix + ;; i*86:skyos:*:*) - echo "$UNAME_MACHINE"-pc-skyos"$(echo "$UNAME_RELEASE" | sed -e 's/ .*$//')" - exit ;; + GUESS="$UNAME_MACHINE"-pc-skyos"$(echo "$UNAME_RELEASE" | sed -e 's/ .*$//')" + ;; i*86:rdos:*:*) - echo "$UNAME_MACHINE"-pc-rdos - exit ;; + GUESS="$UNAME_MACHINE"-pc-rdos + ;; *:AROS:*:*) - echo "$UNAME_MACHINE"-unknown-aros - exit ;; + GUESS="$UNAME_MACHINE"-unknown-aros + ;; x86_64:VMkernel:*:*) - echo "$UNAME_MACHINE"-unknown-esx - exit ;; + GUESS="$UNAME_MACHINE"-unknown-esx + ;; amd64:Isilon\ OneFS:*:*) - echo x86_64-unknown-onefs - exit ;; + GUESS=x86_64-unknown-onefs + ;; *:Unleashed:*:*) - echo "$UNAME_MACHINE"-unknown-unleashed"$UNAME_RELEASE" - exit ;; + GUESS="$UNAME_MACHINE"-unknown-unleashed"$UNAME_RELEASE" + ;; esac +# Do we have a guess based on uname results? +if test "x$GUESS" != x; then + echo "$GUESS" + exit 0 +fi + # No uname command or uname output not recognized. set_cc_for_build cat > "$dummy.c" <) id 1lkcX2-0006pM-CC for config-patches@gnu.org; Sat, 22 May 2021 21:03:52 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:45518) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lkcX2-0005ot-5X for config-patches@gnu.org; Sat, 22 May 2021 21:03:52 -0400 Received: from jcb by fencepost.gnu.org with local (Exim 4.90_1) (envelope-from ) id 1lkcX1-00069u-Gw for config-patches@gnu.org; Sat, 22 May 2021 21:03:51 -0400 From: Jacob Bachmeyer Date: Fri, 21 May 2021 23:16:05 -0500 Subject: [PATCH 4/6] config.guess: factor out command substitutions setting GUESS To: config-patches@gnu.org Message-Id: X-Mailman-Approved-At: Sat, 22 May 2021 21:05:59 -0400 X-BeenThere: config-patches@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Patches for the config.guess and config.sub scripts" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 May 2021 01:03:52 -0000 This simplifies some constructs that can confuse Emacs' syntax highlighting and generally reduces the amount of quoting required. This patch also somewhat standardizes spacing in a fairly common pattern of applying some sed pattern to $UNAME_RELEASE. * config.guess: factor out some command substitutions --- config.guess | 62 +++++++++++++++++++++++++++++++++++----------------- 1 file changed, 42 insertions(+), 20 deletions(-) diff --git a/config.guess b/config.guess index 7d522eb..bb587c8 100755 --- a/config.guess +++ b/config.guess @@ -406,13 +406,16 @@ case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in sparc) echo sparc-icl-nx7; exit ;; esac ;; s390x:SunOS:*:*) - GUESS=$UNAME_MACHINE-ibm-solaris2"$(echo "$UNAME_RELEASE" | sed -e 's/[^.]*//')" + SUN_REL=$(echo "$UNAME_RELEASE" | sed -e 's/[^.]*//') + GUESS=$UNAME_MACHINE-ibm-solaris2$SUN_REL ;; sun4H:SunOS:5.*:*) - GUESS=sparc-hal-solaris2"$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*//')" + SUN_REL=$(echo "$UNAME_RELEASE" | sed -e 's/[^.]*//') + GUESS=sparc-hal-solaris2$SUN_REL ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) - GUESS=sparc-sun-solaris2"$(echo "$UNAME_RELEASE" | sed -e 's/[^.]*//')" + SUN_REL=$(echo "$UNAME_RELEASE" | sed -e 's/[^.]*//') + GUESS=sparc-sun-solaris2$SUN_REL ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) GUESS=i386-pc-auroraux$UNAME_RELEASE @@ -431,13 +434,15 @@ case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in SUN_ARCH=x86_64 fi fi - GUESS=$SUN_ARCH-pc-solaris2"$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*//')" + SUN_REL=$(echo "$UNAME_RELEASE" | sed -e 's/[^.]*//') + GUESS=$SUN_ARCH-pc-solaris2$SUN_REL ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. - GUESS=sparc-sun-solaris3"$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*//')" + SUN_REL=$(echo "$UNAME_RELEASE" | sed -e 's/[^.]*//') + GUESS=sparc-sun-solaris3$SUN_REL ;; sun4*:SunOS:*:*) case $(/usr/bin/arch -k) in @@ -446,7 +451,8 @@ case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. - GUESS=sparc-sun-sunos"$(echo "$UNAME_RELEASE"|sed -e 's/-/_/')" + SUN_REL=$(echo "$UNAME_RELEASE" | sed -e 's/-/_/') + GUESS=sparc-sun-sunos$SUN_REL ;; sun3*:SunOS:*:*) GUESS=m68k-sun-sunos$UNAME_RELEASE @@ -590,7 +596,8 @@ EOF GUESS=m68k-tektronix-bsd ;; *:IRIX*:*:*) - GUESS=mips-sgi-irix"$(echo "$UNAME_RELEASE"|sed -e 's/-/_/g')" + IRIX_REL=$(echo "$UNAME_RELEASE" | sed -e 's/-/_/g') + GUESS=mips-sgi-irix$IRIX_REL ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. GUESS=romp-ibm-aix # uname -m gives an 8 hex-code CPU id @@ -829,7 +836,8 @@ EOF GUESS=c4-convex-bsd ;; CRAY*Y-MP:*:*:*) - GUESS=ymp-cray-unicos"$(echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/')" + CRAY_REL=$(echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/') + GUESS=ymp-cray-unicos$CRAY_REL ;; CRAY*[A-Z]90:*:*:*) echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \ @@ -838,16 +846,20 @@ EOF -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) - GUESS=t90-cray-unicos"$(echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/')" + CRAY_REL=$(echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/') + GUESS=t90-cray-unicos$CRAY_REL ;; CRAY*T3E:*:*:*) - GUESS=alphaev5-cray-unicosmk"$(echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/')" + CRAY_REL=$(echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/') + GUESS=alphaev5-cray-unicosmk$CRAY_REL ;; CRAY*SV1:*:*:*) - GUESS=sv1-cray-unicos"$(echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/')" + CRAY_REL=$(echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/') + GUESS=sv1-cray-unicos$CRAY_REL ;; *:UNICOS/mp:*:*) - GUESS=craynv-cray-unicosmp"$(echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/')" + CRAY_REL=$(echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/') + GUESS=craynv-cray-unicosmp$CRAY_REL ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=$(uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz) @@ -875,9 +887,11 @@ EOF if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then - GUESS=${UNAME_PROCESSOR}-unknown-freebsd"$(echo ${UNAME_RELEASE}|sed -e 's/[-(].*//')"-gnueabi + FREEBSD_REL=$(echo "$UNAME_RELEASE" | sed -e 's/[-(].*//') + GUESS=${UNAME_PROCESSOR}-unknown-freebsd$FREEBSD_REL-gnueabi else - GUESS=${UNAME_PROCESSOR}-unknown-freebsd"$(echo ${UNAME_RELEASE}|sed -e 's/[-(].*//')"-gnueabihf + FREEBSD_REL=$(echo "$UNAME_RELEASE" | sed -e 's/[-(].*//') + GUESS=${UNAME_PROCESSOR}-unknown-freebsd$FREEBSD_REL-gnueabihf fi ;; *:FreeBSD:*:*) @@ -888,7 +902,8 @@ EOF i386) UNAME_PROCESSOR=i586 ;; esac - GUESS=$UNAME_PROCESSOR-unknown-freebsd"$(echo "$UNAME_RELEASE"|sed -e 's/[-(].*//')" + FREEBSD_REL=$(echo "$UNAME_RELEASE" | sed -e 's/[-(].*//') + GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL ;; i*:CYGWIN*:*) GUESS=$UNAME_MACHINE-pc-cygwin @@ -924,15 +939,20 @@ EOF GUESS=x86_64-pc-cygwin ;; prep*:SunOS:5.*:*) - GUESS=powerpcle-unknown-solaris2"$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*//')" + SUN_REL=$(echo "$UNAME_RELEASE" | sed -e 's/[^.]*//') + GUESS=powerpcle-unknown-solaris2$SUN_REL ;; *:GNU:*:*) # the GNU system - GUESS="$(echo "$UNAME_MACHINE"|sed -e 's,[-/].*$,,')-unknown-$LIBC$(echo "$UNAME_RELEASE"|sed -e 's,/.*$,,')" + GNU_ARCH=$(echo "$UNAME_MACHINE" | sed -e 's,[-/].*$,,') + GNU_REL=$(echo "$UNAME_RELEASE" | sed -e 's,/.*$,,') + GUESS=$GNU_ARCH-unknown-$LIBC$GNU_REL ;; *:GNU/*:*:*) # other systems with GNU libc and userland - GUESS="$UNAME_MACHINE-unknown-$(echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]")$(echo "$UNAME_RELEASE"|sed -e 's/[-(].*//')-$LIBC" + GNU_SYS=$(echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]") + GNU_REL=$(echo "$UNAME_RELEASE" | sed -e 's/[-(].*//') + GUESS=$UNAME_MACHINE-unknown-$GNU_SYS$GNU_REL-$LIBC ;; *:Minix:*:*) GUESS=$UNAME_MACHINE-unknown-minix @@ -1473,7 +1493,8 @@ EOF GUESS=mips-sei-seiux$UNAME_RELEASE ;; *:DragonFly:*:*) - GUESS=$UNAME_MACHINE-unknown-dragonfly"$(echo "$UNAME_RELEASE"|sed -e 's/[-(].*//')" + DRAGONFLY_REL=$(echo "$UNAME_RELEASE" | sed -e 's/[-(].*//') + GUESS=$UNAME_MACHINE-unknown-dragonfly$DRAGONFLY_REL ;; *:*VMS:*:*) UNAME_MACHINE=$( (uname -p) 2>/dev/null) @@ -1486,7 +1507,8 @@ EOF GUESS=i386-pc-xenix ;; i*86:skyos:*:*) - GUESS=$UNAME_MACHINE-pc-skyos"$(echo "$UNAME_RELEASE" | sed -e 's/ .*$//')" + SKYOS_REL=$(echo "$UNAME_RELEASE" | sed -e 's/ .*$//') + GUESS=$UNAME_MACHINE-pc-skyos$SKYOS_REL ;; i*86:rdos:*:*) GUESS=$UNAME_MACHINE-pc-rdos -- 2.17.1 From MAILER-DAEMON Sat May 22 21:06:01 2021 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1lkcZ7-00078c-Hr for mharc-config-patches@gnu.org; Sat, 22 May 2021 21:06:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44656) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lkcX3-0006q3-BH for config-patches@gnu.org; Sat, 22 May 2021 21:03:53 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:45522) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lkcX3-0005pB-4b for config-patches@gnu.org; Sat, 22 May 2021 21:03:53 -0400 Received: from jcb by fencepost.gnu.org with local (Exim 4.90_1) (envelope-from ) id 1lkcX2-0006AF-MO for config-patches@gnu.org; Sat, 22 May 2021 21:03:52 -0400 From: Jacob Bachmeyer Date: Sat, 22 May 2021 00:38:51 -0500 Subject: [PATCH 6/6] config.guess: minor cleanups noticed during previous pass To: config-patches@gnu.org Message-Id: X-Mailman-Approved-At: Sat, 22 May 2021 21:05:59 -0400 X-BeenThere: config-patches@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Patches for the config.guess and config.sub scripts" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 May 2021 01:03:53 -0000 This patch is a few "stragglers" that did not match the patterns used in earlier passes through the script, and were noticed while completing the reversion of command substitutions to traditional form. (No ChangeLog entry for this patch; these belong to earlier changes.) --- config.guess | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/config.guess b/config.guess index 6d9c6ce..d7ebc2a 100755 --- a/config.guess +++ b/config.guess @@ -117,7 +117,7 @@ set_cc_for_build() { # prevent multiple calls if $tmp is already set test "$tmp" && return 0 : "${TMPDIR=/tmp}" - # shellcheck disable=SC2039 + # shellcheck disable=SC2039,SC3028 { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir "$tmp" 2>/dev/null) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } || @@ -127,7 +127,7 @@ set_cc_for_build() { ,,) echo "int x;" > "$dummy.c" for driver in cc gcc c89 c99 ; do if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then - CC_FOR_BUILD="$driver" + CC_FOR_BUILD=$driver break fi done @@ -218,9 +218,9 @@ case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in earmv*) arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'` endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'` - machine="${arch}${endian}"-unknown + machine=${arch}${endian}-unknown ;; - *) machine="$UNAME_MACHINE_ARCH"-unknown ;; + *) machine=$UNAME_MACHINE_ARCH-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently (or will in the future) and ABI. @@ -621,7 +621,7 @@ EOF if test -x /usr/bin/oslevel ; then IBM_REV=`/usr/bin/oslevel` else - IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" + IBM_REV=$UNAME_VERSION.$UNAME_RELEASE fi GUESS=$UNAME_MACHINE-ibm-aix$IBM_REV ;; @@ -662,7 +662,7 @@ EOF IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | \ awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` else - IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" + IBM_REV=$UNAME_VERSION.$UNAME_RELEASE fi GUESS=$IBM_ARCH-ibm-aix$IBM_REV ;; @@ -1111,11 +1111,11 @@ EOF parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in - PA7*) echo hppa1.1-unknown-linux-"$LIBC" ;; - PA8*) echo hppa2.0-unknown-linux-"$LIBC" ;; - *) echo hppa-unknown-linux-"$LIBC" ;; + PA7*) GUESS=hppa1.1-unknown-linux-$LIBC ;; + PA8*) GUESS=hppa2.0-unknown-linux-$LIBC ;; + *) GUESS=hppa-unknown-linux-$LIBC ;; esac - exit ;; + ;; ppc64:Linux:*:*) GUESS=powerpc64-unknown-linux-$LIBC ;; @@ -1157,7 +1157,7 @@ EOF (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_X32 >/dev/null then - LIBCABI="$LIBC"x32 + LIBCABI=${LIBC}x32 fi fi GUESS=$UNAME_MACHINE-pc-linux-$LIBCABI @@ -1480,7 +1480,7 @@ EOF if test "$cputype" = 386; then UNAME_MACHINE=i386 else - UNAME_MACHINE="$cputype" + UNAME_MACHINE=$cputype fi GUESS=$UNAME_MACHINE-unknown-plan9 ;; -- 2.17.1 From MAILER-DAEMON Sat May 22 21:06:02 2021 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1lkcZ8-0007B4-7R for mharc-config-patches@gnu.org; Sat, 22 May 2021 21:06:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44650) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lkcX1-0006p7-PI for config-patches@gnu.org; Sat, 22 May 2021 21:03:51 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:45516) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lkcX1-0005o4-HP for config-patches@gnu.org; Sat, 22 May 2021 21:03:51 -0400 Received: from jcb by fencepost.gnu.org with local (Exim 4.90_1) (envelope-from ) id 1lkcX1-00069j-0z for config-patches@gnu.org; Sat, 22 May 2021 21:03:51 -0400 From: Jacob Bachmeyer Date: Fri, 21 May 2021 22:45:46 -0500 Subject: [PATCH 3/6] config.guess: remove unneeded variable quotes To: config-patches@gnu.org Message-Id: X-Mailman-Approved-At: Sat, 22 May 2021 21:05:59 -0400 X-BeenThere: config-patches@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Patches for the config.guess and config.sub scripts" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 May 2021 01:03:52 -0000 This is further cleanup and is a separate patch due to its size and mostly automated origin. This patch was mostly produced using the following Emacs Lisp: (defun tidy-guess-variables () (interactive) (while (search-forward "GUESS=" nil t) (while (re-search-forward "\"\\(\\$[[:alnum:]_]+\\)\"\\(-\\)?" (line-end-position) t) (if (or (match-end 2) (= (match-end 0) (line-end-position))) (replace-match "\\1\\2"))))) Some further manual cleanup was needed for a few cases where comments on the same line prevented the automation from recognizing a variable substitution that was needlessly quoted. * config.guess: remove unneeded variable quotes when setting GUESS --- config.guess | 306 +++++++++++++++++++++++++-------------------------- 1 file changed, 153 insertions(+), 153 deletions(-) diff --git a/config.guess b/config.guess index 6acddd3..7d522eb 100755 --- a/config.guess +++ b/config.guess @@ -256,50 +256,50 @@ case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. - GUESS="$machine-${os}${release}${abi-}" + GUESS=$machine-${os}${release}${abi-} ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=$(arch | sed 's/Bitrig.//') - GUESS="$UNAME_MACHINE_ARCH"-unknown-bitrig"$UNAME_RELEASE" + GUESS=$UNAME_MACHINE_ARCH-unknown-bitrig$UNAME_RELEASE ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=$(arch | sed 's/OpenBSD.//') - GUESS="$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE" + GUESS=$UNAME_MACHINE_ARCH-unknown-openbsd$UNAME_RELEASE ;; *:SecBSD:*:*) UNAME_MACHINE_ARCH=$(arch | sed 's/SecBSD.//') - GUESS="$UNAME_MACHINE_ARCH"-unknown-secbsd"$UNAME_RELEASE" + GUESS=$UNAME_MACHINE_ARCH-unknown-secbsd$UNAME_RELEASE ;; *:LibertyBSD:*:*) UNAME_MACHINE_ARCH=$(arch | sed 's/^.*BSD\.//') - GUESS="$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE" + GUESS=$UNAME_MACHINE_ARCH-unknown-libertybsd$UNAME_RELEASE ;; *:MidnightBSD:*:*) - GUESS="$UNAME_MACHINE"-unknown-midnightbsd"$UNAME_RELEASE" + GUESS=$UNAME_MACHINE-unknown-midnightbsd$UNAME_RELEASE ;; *:ekkoBSD:*:*) - GUESS="$UNAME_MACHINE"-unknown-ekkobsd"$UNAME_RELEASE" + GUESS=$UNAME_MACHINE-unknown-ekkobsd$UNAME_RELEASE ;; *:SolidBSD:*:*) - GUESS="$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE" + GUESS=$UNAME_MACHINE-unknown-solidbsd$UNAME_RELEASE ;; *:OS108:*:*) - GUESS="$UNAME_MACHINE"-unknown-os108_"$UNAME_RELEASE" + GUESS=$UNAME_MACHINE-unknown-os108_$UNAME_RELEASE ;; macppc:MirBSD:*:*) - GUESS=powerpc-unknown-mirbsd"$UNAME_RELEASE" + GUESS=powerpc-unknown-mirbsd$UNAME_RELEASE ;; *:MirBSD:*:*) - GUESS="$UNAME_MACHINE"-unknown-mirbsd"$UNAME_RELEASE" + GUESS=$UNAME_MACHINE-unknown-mirbsd$UNAME_RELEASE ;; *:Sortix:*:*) - GUESS="$UNAME_MACHINE"-unknown-sortix + GUESS=$UNAME_MACHINE-unknown-sortix ;; *:Twizzler:*:*) - GUESS="$UNAME_MACHINE"-unknown-twizzler + GUESS=$UNAME_MACHINE-unknown-twizzler ;; *:Redox:*:*) - GUESS="$UNAME_MACHINE"-unknown-redox + GUESS=$UNAME_MACHINE-unknown-redox ;; mips:OSF1:*.*) GUESS=mips-dec-osf1 @@ -364,10 +364,10 @@ case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in GUESS=m68k-unknown-sysv4 ;; *:[Aa]miga[Oo][Ss]:*:*) - GUESS="$UNAME_MACHINE"-unknown-amigaos + GUESS=$UNAME_MACHINE-unknown-amigaos ;; *:[Mm]orph[Oo][Ss]:*:*) - GUESS="$UNAME_MACHINE"-unknown-morphos + GUESS=$UNAME_MACHINE-unknown-morphos ;; *:OS/390:*:*) GUESS=i370-ibm-openedition @@ -379,7 +379,7 @@ case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in GUESS=powerpc-ibm-os400 ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) - GUESS=arm-acorn-riscix"$UNAME_RELEASE" + GUESS=arm-acorn-riscix$UNAME_RELEASE ;; arm*:riscos:*:*|arm*:RISCOS:*:*) GUESS=arm-unknown-riscos @@ -406,7 +406,7 @@ case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in sparc) echo sparc-icl-nx7; exit ;; esac ;; s390x:SunOS:*:*) - GUESS="$UNAME_MACHINE"-ibm-solaris2"$(echo "$UNAME_RELEASE" | sed -e 's/[^.]*//')" + GUESS=$UNAME_MACHINE-ibm-solaris2"$(echo "$UNAME_RELEASE" | sed -e 's/[^.]*//')" ;; sun4H:SunOS:5.*:*) GUESS=sparc-hal-solaris2"$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*//')" @@ -415,7 +415,7 @@ case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in GUESS=sparc-sun-solaris2"$(echo "$UNAME_RELEASE" | sed -e 's/[^.]*//')" ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) - GUESS=i386-pc-auroraux"$UNAME_RELEASE" + GUESS=i386-pc-auroraux$UNAME_RELEASE ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) set_cc_for_build @@ -431,7 +431,7 @@ case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in SUN_ARCH=x86_64 fi fi - GUESS="$SUN_ARCH"-pc-solaris2"$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*//')" + GUESS=$SUN_ARCH-pc-solaris2"$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*//')" ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize @@ -449,22 +449,22 @@ case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in GUESS=sparc-sun-sunos"$(echo "$UNAME_RELEASE"|sed -e 's/-/_/')" ;; sun3*:SunOS:*:*) - GUESS=m68k-sun-sunos"$UNAME_RELEASE" + GUESS=m68k-sun-sunos$UNAME_RELEASE ;; sun*:*:4.2BSD:*) UNAME_RELEASE=$( (sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null) test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3 case $(/bin/arch) in sun3) - GUESS=m68k-sun-sunos"$UNAME_RELEASE" + GUESS=m68k-sun-sunos$UNAME_RELEASE ;; sun4) - GUESS=sparc-sun-sunos"$UNAME_RELEASE" + GUESS=sparc-sun-sunos$UNAME_RELEASE ;; esac ;; aushp:SunOS:*:*) - GUESS=sparc-auspex-sunos"$UNAME_RELEASE" + GUESS=sparc-auspex-sunos$UNAME_RELEASE ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not @@ -475,40 +475,40 @@ case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) - GUESS=m68k-atari-mint"$UNAME_RELEASE" + GUESS=m68k-atari-mint$UNAME_RELEASE ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) - GUESS=m68k-atari-mint"$UNAME_RELEASE" + GUESS=m68k-atari-mint$UNAME_RELEASE ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) - GUESS=m68k-atari-mint"$UNAME_RELEASE" + GUESS=m68k-atari-mint$UNAME_RELEASE ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) - GUESS=m68k-milan-mint"$UNAME_RELEASE" + GUESS=m68k-milan-mint$UNAME_RELEASE ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) - GUESS=m68k-hades-mint"$UNAME_RELEASE" + GUESS=m68k-hades-mint$UNAME_RELEASE ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) - GUESS=m68k-unknown-mint"$UNAME_RELEASE" + GUESS=m68k-unknown-mint$UNAME_RELEASE ;; m68k:machten:*:*) - GUESS=m68k-apple-machten"$UNAME_RELEASE" + GUESS=m68k-apple-machten$UNAME_RELEASE ;; powerpc:machten:*:*) - GUESS=powerpc-apple-machten"$UNAME_RELEASE" + GUESS=powerpc-apple-machten$UNAME_RELEASE ;; RISC*:Mach:*:*) GUESS=mips-dec-mach_bsd4.3 ;; RISC*:ULTRIX:*:*) - GUESS=mips-dec-ultrix"$UNAME_RELEASE" + GUESS=mips-dec-ultrix$UNAME_RELEASE ;; VAX*:ULTRIX*:*:*) - GUESS=vax-dec-ultrix"$UNAME_RELEASE" + GUESS=vax-dec-ultrix$UNAME_RELEASE ;; 2020:CLIX:*:* | 2430:CLIX:*:*) - GUESS=clipper-intergraph-clix"$UNAME_RELEASE" + GUESS=clipper-intergraph-clix$UNAME_RELEASE ;; mips:*:*:UMIPS | mips:*:*:RISCos) set_cc_for_build @@ -537,7 +537,7 @@ EOF dummyarg=$(echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p') && SYSTEM_NAME=$("$dummy" "$dummyarg") && { echo "$SYSTEM_NAME"; exit; } - GUESS=mips-mips-riscos"$UNAME_RELEASE" + GUESS=mips-mips-riscos$UNAME_RELEASE ;; Motorola:PowerMAX_OS:*:*) GUESS=powerpc-motorola-powermax @@ -568,12 +568,12 @@ EOF if test "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx || \ test "$TARGET_BINARY_INTERFACE"x = x then - GUESS=m88k-dg-dgux"$UNAME_RELEASE" + GUESS=m88k-dg-dgux$UNAME_RELEASE else - GUESS=m88k-dg-dguxbcs"$UNAME_RELEASE" + GUESS=m88k-dg-dguxbcs$UNAME_RELEASE fi else - GUESS=i586-dg-dgux"$UNAME_RELEASE" + GUESS=i586-dg-dgux$UNAME_RELEASE fi ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) @@ -604,7 +604,7 @@ EOF else IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" fi - GUESS="$UNAME_MACHINE"-ibm-aix"$IBM_REV" + GUESS=$UNAME_MACHINE-ibm-aix$IBM_REV ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then @@ -645,7 +645,7 @@ EOF else IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" fi - GUESS="$IBM_ARCH"-ibm-aix"$IBM_REV" + GUESS=$IBM_ARCH-ibm-aix$IBM_REV ;; *:AIX:*:*) GUESS=rs6000-ibm-aix @@ -654,8 +654,8 @@ EOF GUESS=romp-ibm-bsd4.4 ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and - GUESS=romp-ibm-bsd"$UNAME_RELEASE" # 4.3 with uname added to - ;; # report: romp-ibm BSD 4.3 + GUESS=romp-ibm-bsd$UNAME_RELEASE # 4.3 with uname added to + ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) GUESS=rs6000-bull-bosx ;; @@ -748,11 +748,11 @@ EOF HP_ARCH=hppa64 fi fi - GUESS="$HP_ARCH"-hp-hpux"$HPUX_REV" + GUESS=$HP_ARCH-hp-hpux$HPUX_REV ;; ia64:HP-UX:*:*) HPUX_REV=$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//') - GUESS=ia64-hp-hpux"$HPUX_REV" + GUESS=ia64-hp-hpux$HPUX_REV ;; 3050*:HI-UX:*:*) set_cc_for_build @@ -802,9 +802,9 @@ EOF ;; i*86:OSF1:*:*) if test -x /usr/sbin/sysversion ; then - GUESS="$UNAME_MACHINE"-unknown-osf1mk + GUESS=$UNAME_MACHINE-unknown-osf1mk else - GUESS="$UNAME_MACHINE"-unknown-osf1 + GUESS=$UNAME_MACHINE-unknown-osf1 fi ;; parisc*:Lites*:*:*) @@ -853,21 +853,21 @@ EOF FUJITSU_PROC=$(uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz) FUJITSU_SYS=$(uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///') FUJITSU_REL=$(echo "$UNAME_RELEASE" | sed -e 's/ /_/') - GUESS="${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + GUESS=${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL} ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=$(uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///') FUJITSU_REL=$(echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/') - GUESS="sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + GUESS=sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL} ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) - GUESS="$UNAME_MACHINE"-pc-bsdi"$UNAME_RELEASE" + GUESS=$UNAME_MACHINE-pc-bsdi$UNAME_RELEASE ;; sparc*:BSD/OS:*:*) - GUESS=sparc-unknown-bsdi"$UNAME_RELEASE" + GUESS=sparc-unknown-bsdi$UNAME_RELEASE ;; *:BSD/OS:*:*) - GUESS="$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE" + GUESS=$UNAME_MACHINE-unknown-bsdi$UNAME_RELEASE ;; arm:FreeBSD:*:*) UNAME_PROCESSOR=$(uname -p) @@ -875,9 +875,9 @@ EOF if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then - GUESS="${UNAME_PROCESSOR}"-unknown-freebsd"$(echo ${UNAME_RELEASE}|sed -e 's/[-(].*//')"-gnueabi + GUESS=${UNAME_PROCESSOR}-unknown-freebsd"$(echo ${UNAME_RELEASE}|sed -e 's/[-(].*//')"-gnueabi else - GUESS="${UNAME_PROCESSOR}"-unknown-freebsd"$(echo ${UNAME_RELEASE}|sed -e 's/[-(].*//')"-gnueabihf + GUESS=${UNAME_PROCESSOR}-unknown-freebsd"$(echo ${UNAME_RELEASE}|sed -e 's/[-(].*//')"-gnueabihf fi ;; *:FreeBSD:*:*) @@ -888,37 +888,37 @@ EOF i386) UNAME_PROCESSOR=i586 ;; esac - GUESS="$UNAME_PROCESSOR"-unknown-freebsd"$(echo "$UNAME_RELEASE"|sed -e 's/[-(].*//')" + GUESS=$UNAME_PROCESSOR-unknown-freebsd"$(echo "$UNAME_RELEASE"|sed -e 's/[-(].*//')" ;; i*:CYGWIN*:*) - GUESS="$UNAME_MACHINE"-pc-cygwin + GUESS=$UNAME_MACHINE-pc-cygwin ;; *:MINGW64*:*) - GUESS="$UNAME_MACHINE"-pc-mingw64 + GUESS=$UNAME_MACHINE-pc-mingw64 ;; *:MINGW*:*) - GUESS="$UNAME_MACHINE"-pc-mingw32 + GUESS=$UNAME_MACHINE-pc-mingw32 ;; *:MSYS*:*) - GUESS="$UNAME_MACHINE"-pc-msys + GUESS=$UNAME_MACHINE-pc-msys ;; i*:PW*:*) - GUESS="$UNAME_MACHINE"-pc-pw32 + GUESS=$UNAME_MACHINE-pc-pw32 ;; *:Interix*:*) case $UNAME_MACHINE in x86) - GUESS=i586-pc-interix"$UNAME_RELEASE" + GUESS=i586-pc-interix$UNAME_RELEASE ;; authenticamd | genuineintel | EM64T) - GUESS=x86_64-unknown-interix"$UNAME_RELEASE" + GUESS=x86_64-unknown-interix$UNAME_RELEASE ;; IA64) - GUESS=ia64-unknown-interix"$UNAME_RELEASE" + GUESS=ia64-unknown-interix$UNAME_RELEASE ;; esac ;; i*:UWIN*:*) - GUESS="$UNAME_MACHINE"-pc-uwin + GUESS=$UNAME_MACHINE-pc-uwin ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) GUESS=x86_64-pc-cygwin @@ -935,14 +935,14 @@ EOF GUESS="$UNAME_MACHINE-unknown-$(echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]")$(echo "$UNAME_RELEASE"|sed -e 's/[-(].*//')-$LIBC" ;; *:Minix:*:*) - GUESS="$UNAME_MACHINE"-unknown-minix + GUESS=$UNAME_MACHINE-unknown-minix ;; aarch64:Linux:*:*) - GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC" + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be - GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC" + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; alpha:Linux:*:*) case $(sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null) in @@ -956,62 +956,62 @@ EOF esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC=gnulibc1 ; fi - GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC" + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; arc:Linux:*:* | arceb:Linux:*:* | arc64:Linux:*:*) - GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC" + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; arm*:Linux:*:*) set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then - GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC" + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then - GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC"eabi + GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabi else - GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC"eabihf + GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabihf fi fi ;; avr32*:Linux:*:*) - GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC" + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; cris:Linux:*:*) - GUESS="$UNAME_MACHINE"-axis-linux-"$LIBC" + GUESS=$UNAME_MACHINE-axis-linux-$LIBC ;; crisv32:Linux:*:*) - GUESS="$UNAME_MACHINE"-axis-linux-"$LIBC" + GUESS=$UNAME_MACHINE-axis-linux-$LIBC ;; e2k:Linux:*:*) - GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC" + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; frv:Linux:*:*) - GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC" + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; hexagon:Linux:*:*) - GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC" + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; i*86:Linux:*:*) - GUESS="$UNAME_MACHINE"-pc-linux-"$LIBC" + GUESS=$UNAME_MACHINE-pc-linux-$LIBC ;; ia64:Linux:*:*) - GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC" + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; k1om:Linux:*:*) - GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC" + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; loongarch32:Linux:*:* | loongarch64:Linux:*:* | loongarchx32:Linux:*:*) - GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC" + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; m32r*:Linux:*:*) - GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC" + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; m68*:Linux:*:*) - GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC" + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; mips:Linux:*:* | mips64:Linux:*:*) set_cc_for_build @@ -1061,19 +1061,19 @@ EOF test "x$CPU" != x && { echo "$CPU${MIPS_ENDIAN}-unknown-linux-$LIBCABI"; exit; } ;; mips64el:Linux:*:*) - GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC" + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; openrisc*:Linux:*:*) - GUESS=or1k-unknown-linux-"$LIBC" + GUESS=or1k-unknown-linux-$LIBC ;; or32:Linux:*:* | or1k*:Linux:*:*) - GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC" + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; padre:Linux:*:*) - GUESS=sparc-unknown-linux-"$LIBC" + GUESS=sparc-unknown-linux-$LIBC ;; parisc64:Linux:*:* | hppa64:Linux:*:*) - GUESS=hppa64-unknown-linux-"$LIBC" + GUESS=hppa64-unknown-linux-$LIBC ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level @@ -1084,37 +1084,37 @@ EOF esac exit ;; ppc64:Linux:*:*) - GUESS=powerpc64-unknown-linux-"$LIBC" + GUESS=powerpc64-unknown-linux-$LIBC ;; ppc:Linux:*:*) - GUESS=powerpc-unknown-linux-"$LIBC" + GUESS=powerpc-unknown-linux-$LIBC ;; ppc64le:Linux:*:*) - GUESS=powerpc64le-unknown-linux-"$LIBC" + GUESS=powerpc64le-unknown-linux-$LIBC ;; ppcle:Linux:*:*) - GUESS=powerpcle-unknown-linux-"$LIBC" + GUESS=powerpcle-unknown-linux-$LIBC ;; riscv32:Linux:*:* | riscv32be:Linux:*:* | riscv64:Linux:*:* | riscv64be:Linux:*:*) - GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC" + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; s390:Linux:*:* | s390x:Linux:*:*) - GUESS="$UNAME_MACHINE"-ibm-linux-"$LIBC" + GUESS=$UNAME_MACHINE-ibm-linux-$LIBC ;; sh64*:Linux:*:*) - GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC" + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; sh*:Linux:*:*) - GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC" + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; sparc:Linux:*:* | sparc64:Linux:*:*) - GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC" + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; tile*:Linux:*:*) - GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC" + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; vax:Linux:*:*) - GUESS="$UNAME_MACHINE"-dec-linux-"$LIBC" + GUESS=$UNAME_MACHINE-dec-linux-$LIBC ;; x86_64:Linux:*:*) set_cc_for_build @@ -1127,10 +1127,10 @@ EOF LIBCABI="$LIBC"x32 fi fi - GUESS="$UNAME_MACHINE"-pc-linux-"$LIBCABI" + GUESS=$UNAME_MACHINE-pc-linux-$LIBCABI ;; xtensa*:Linux:*:*) - GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC" + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. @@ -1144,34 +1144,34 @@ EOF # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. - GUESS="$UNAME_MACHINE"-pc-sysv4.2uw"$UNAME_VERSION" + GUESS=$UNAME_MACHINE-pc-sysv4.2uw$UNAME_VERSION ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. - GUESS="$UNAME_MACHINE"-pc-os2-emx + GUESS=$UNAME_MACHINE-pc-os2-emx ;; i*86:XTS-300:*:STOP) - GUESS="$UNAME_MACHINE"-unknown-stop + GUESS=$UNAME_MACHINE-unknown-stop ;; i*86:atheos:*:*) - GUESS="$UNAME_MACHINE"-unknown-atheos + GUESS=$UNAME_MACHINE-unknown-atheos ;; i*86:syllable:*:*) - GUESS="$UNAME_MACHINE"-pc-syllable + GUESS=$UNAME_MACHINE-pc-syllable ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) - GUESS=i386-unknown-lynxos"$UNAME_RELEASE" + GUESS=i386-unknown-lynxos$UNAME_RELEASE ;; i*86:*DOS:*:*) - GUESS="$UNAME_MACHINE"-pc-msdosdjgpp + GUESS=$UNAME_MACHINE-pc-msdosdjgpp ;; i*86:*:4.*:*) UNAME_REL=$(echo "$UNAME_RELEASE" | sed 's/\/MP$//') if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then - GUESS="$UNAME_MACHINE"-univel-sysv"$UNAME_REL" + GUESS=$UNAME_MACHINE-univel-sysv$UNAME_REL else - GUESS="$UNAME_MACHINE"-pc-sysv"$UNAME_REL" + GUESS=$UNAME_MACHINE-pc-sysv$UNAME_REL fi ;; i*86:*:5:[678]*) @@ -1181,12 +1181,12 @@ EOF *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac - GUESS="$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}" + GUESS=$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=$(sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=$( (/bin/uname -X|grep Release|sed -e 's/.*= //')) (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 @@ -1196,9 +1196,9 @@ EOF && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 - GUESS="$UNAME_MACHINE"-pc-sco"$UNAME_REL" + GUESS=$UNAME_MACHINE-pc-sco$UNAME_REL else - GUESS="$UNAME_MACHINE"-pc-sysv32 + GUESS=$UNAME_MACHINE-pc-sysv32 fi ;; pc:*:*:*) @@ -1218,9 +1218,9 @@ EOF ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then - GUESS=i860-stardent-sysv"$UNAME_RELEASE" # Stardent Vistra i860-SVR4 + GUESS=i860-stardent-sysv$UNAME_RELEASE # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. - GUESS=i860-unknown-sysv"$UNAME_RELEASE" # Unknown i860-SVR4 + GUESS=i860-unknown-sysv$UNAME_RELEASE # Unknown i860-SVR4 fi ;; mini*:CTIX:SYS*5:*) @@ -1257,22 +1257,22 @@ EOF /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) - GUESS=m68k-unknown-lynxos"$UNAME_RELEASE" + GUESS=m68k-unknown-lynxos$UNAME_RELEASE ;; mc68030:UNIX_System_V:4.*:*) GUESS=m68k-atari-sysv4 ;; TSUNAMI:LynxOS:2.*:*) - GUESS=sparc-unknown-lynxos"$UNAME_RELEASE" + GUESS=sparc-unknown-lynxos$UNAME_RELEASE ;; rs6000:LynxOS:2.*:*) - GUESS=rs6000-unknown-lynxos"$UNAME_RELEASE" + GUESS=rs6000-unknown-lynxos$UNAME_RELEASE ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) - GUESS=powerpc-unknown-lynxos"$UNAME_RELEASE" + GUESS=powerpc-unknown-lynxos$UNAME_RELEASE ;; SM[BE]S:UNIX_SV:*:*) - GUESS=mips-dde-sysv"$UNAME_RELEASE" + GUESS=mips-dde-sysv$UNAME_RELEASE ;; RM*:ReliantUNIX-*:*:*) GUESS=mips-sni-sysv4 @@ -1283,7 +1283,7 @@ EOF *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=$( (uname -p) 2>/dev/null) - GUESS="$UNAME_MACHINE"-sni-sysv4 + GUESS=$UNAME_MACHINE-sni-sysv4 else GUESS=ns32k-sni-sysv fi @@ -1303,23 +1303,23 @@ EOF ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. - GUESS="$UNAME_MACHINE"-stratus-vos + GUESS=$UNAME_MACHINE-stratus-vos ;; *:VOS:*:*) # From Paul.Green@stratus.com. GUESS=hppa1.1-stratus-vos ;; mc68*:A/UX:*:*) - GUESS=m68k-apple-aux"$UNAME_RELEASE" + GUESS=m68k-apple-aux$UNAME_RELEASE ;; news*:NEWS-OS:6*:*) GUESS=mips-sony-newsos6 ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if test -d /usr/nec; then - GUESS=mips-nec-sysv"$UNAME_RELEASE" + GUESS=mips-nec-sysv$UNAME_RELEASE else - GUESS=mips-unknown-sysv"$UNAME_RELEASE" + GUESS=mips-unknown-sysv$UNAME_RELEASE fi ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. @@ -1338,34 +1338,34 @@ EOF GUESS=x86_64-unknown-haiku ;; SX-4:SUPER-UX:*:*) - GUESS=sx4-nec-superux"$UNAME_RELEASE" + GUESS=sx4-nec-superux$UNAME_RELEASE ;; SX-5:SUPER-UX:*:*) - GUESS=sx5-nec-superux"$UNAME_RELEASE" + GUESS=sx5-nec-superux$UNAME_RELEASE ;; SX-6:SUPER-UX:*:*) - GUESS=sx6-nec-superux"$UNAME_RELEASE" + GUESS=sx6-nec-superux$UNAME_RELEASE ;; SX-7:SUPER-UX:*:*) - GUESS=sx7-nec-superux"$UNAME_RELEASE" + GUESS=sx7-nec-superux$UNAME_RELEASE ;; SX-8:SUPER-UX:*:*) - GUESS=sx8-nec-superux"$UNAME_RELEASE" + GUESS=sx8-nec-superux$UNAME_RELEASE ;; SX-8R:SUPER-UX:*:*) - GUESS=sx8r-nec-superux"$UNAME_RELEASE" + GUESS=sx8r-nec-superux$UNAME_RELEASE ;; SX-ACE:SUPER-UX:*:*) - GUESS=sxace-nec-superux"$UNAME_RELEASE" + GUESS=sxace-nec-superux$UNAME_RELEASE ;; Power*:Rhapsody:*:*) - GUESS=powerpc-apple-rhapsody"$UNAME_RELEASE" + GUESS=powerpc-apple-rhapsody$UNAME_RELEASE ;; *:Rhapsody:*:*) - GUESS="$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE" + GUESS=$UNAME_MACHINE-apple-rhapsody$UNAME_RELEASE ;; arm64:Darwin:*:*) - GUESS=aarch64-apple-darwin"$UNAME_RELEASE" + GUESS=aarch64-apple-darwin$UNAME_RELEASE ;; *:Darwin:*:*) UNAME_PROCESSOR=$(uname -p) @@ -1402,7 +1402,7 @@ EOF # uname -m returns i386 or x86_64 UNAME_PROCESSOR=$UNAME_MACHINE fi - GUESS="$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE" + GUESS=$UNAME_PROCESSOR-apple-darwin$UNAME_RELEASE ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=$(uname -p) @@ -1410,25 +1410,25 @@ EOF UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi - GUESS="$UNAME_PROCESSOR"-"$UNAME_MACHINE"-nto-qnx"$UNAME_RELEASE" + GUESS=$UNAME_PROCESSOR-$UNAME_MACHINE-nto-qnx$UNAME_RELEASE ;; *:QNX:*:4*) GUESS=i386-pc-qnx ;; NEO-*:NONSTOP_KERNEL:*:*) - GUESS=neo-tandem-nsk"$UNAME_RELEASE" + GUESS=neo-tandem-nsk$UNAME_RELEASE ;; NSE-*:NONSTOP_KERNEL:*:*) - GUESS=nse-tandem-nsk"$UNAME_RELEASE" + GUESS=nse-tandem-nsk$UNAME_RELEASE ;; NSR-*:NONSTOP_KERNEL:*:*) - GUESS=nsr-tandem-nsk"$UNAME_RELEASE" + GUESS=nsr-tandem-nsk$UNAME_RELEASE ;; NSV-*:NONSTOP_KERNEL:*:*) - GUESS=nsv-tandem-nsk"$UNAME_RELEASE" + GUESS=nsv-tandem-nsk$UNAME_RELEASE ;; NSX-*:NONSTOP_KERNEL:*:*) - GUESS=nsx-tandem-nsk"$UNAME_RELEASE" + GUESS=nsx-tandem-nsk$UNAME_RELEASE ;; *:NonStop-UX:*:*) GUESS=mips-compaq-nonstopux @@ -1437,7 +1437,7 @@ EOF GUESS=bs2000-siemens-sysv ;; DS/*:UNIX_System_V:*:*) - GUESS="$UNAME_MACHINE"-"$UNAME_SYSTEM"-"$UNAME_RELEASE" + GUESS=$UNAME_MACHINE-$UNAME_SYSTEM-$UNAME_RELEASE ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 @@ -1449,7 +1449,7 @@ EOF else UNAME_MACHINE="$cputype" fi - GUESS="$UNAME_MACHINE"-unknown-plan9 + GUESS=$UNAME_MACHINE-unknown-plan9 ;; *:TOPS-10:*:*) GUESS=pdp10-unknown-tops10 @@ -1470,10 +1470,10 @@ EOF GUESS=pdp10-unknown-its ;; SEI:*:*:SEIUX) - GUESS=mips-sei-seiux"$UNAME_RELEASE" + GUESS=mips-sei-seiux$UNAME_RELEASE ;; *:DragonFly:*:*) - GUESS="$UNAME_MACHINE"-unknown-dragonfly"$(echo "$UNAME_RELEASE"|sed -e 's/[-(].*//')" + GUESS=$UNAME_MACHINE-unknown-dragonfly"$(echo "$UNAME_RELEASE"|sed -e 's/[-(].*//')" ;; *:*VMS:*:*) UNAME_MACHINE=$( (uname -p) 2>/dev/null) @@ -1486,22 +1486,22 @@ EOF GUESS=i386-pc-xenix ;; i*86:skyos:*:*) - GUESS="$UNAME_MACHINE"-pc-skyos"$(echo "$UNAME_RELEASE" | sed -e 's/ .*$//')" + GUESS=$UNAME_MACHINE-pc-skyos"$(echo "$UNAME_RELEASE" | sed -e 's/ .*$//')" ;; i*86:rdos:*:*) - GUESS="$UNAME_MACHINE"-pc-rdos + GUESS=$UNAME_MACHINE-pc-rdos ;; *:AROS:*:*) - GUESS="$UNAME_MACHINE"-unknown-aros + GUESS=$UNAME_MACHINE-unknown-aros ;; x86_64:VMkernel:*:*) - GUESS="$UNAME_MACHINE"-unknown-esx + GUESS=$UNAME_MACHINE-unknown-esx ;; amd64:Isilon\ OneFS:*:*) GUESS=x86_64-unknown-onefs ;; *:Unleashed:*:*) - GUESS="$UNAME_MACHINE"-unknown-unleashed"$UNAME_RELEASE" + GUESS=$UNAME_MACHINE-unknown-unleashed$UNAME_RELEASE ;; esac -- 2.17.1 From MAILER-DAEMON Sat May 22 21:06:02 2021 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1lkcZ8-0007Bu-FE for mharc-config-patches@gnu.org; Sat, 22 May 2021 21:06:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44654) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lkcX3-0006pd-1X for config-patches@gnu.org; Sat, 22 May 2021 21:03:53 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:45520) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lkcX2-0005p4-Qq for config-patches@gnu.org; Sat, 22 May 2021 21:03:52 -0400 Received: from jcb by fencepost.gnu.org with local (Exim 4.90_1) (envelope-from ) id 1lkcX2-0006A2-2L for config-patches@gnu.org; Sat, 22 May 2021 21:03:52 -0400 From: Jacob Bachmeyer Date: Sat, 22 May 2021 00:26:42 -0500 Subject: [PATCH 5/6] config.guess: replace POSIX $( ) with classic ` ` throughout To: config-patches@gnu.org Message-Id: X-Mailman-Approved-At: Sat, 22 May 2021 21:05:59 -0400 X-BeenThere: config-patches@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Patches for the config.guess and config.sub scripts" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 May 2021 01:03:53 -0000 The previous replacement of backticks with POSIX command substitutions was ill-considered and illogical: this script recognizes many archaic machine types that probably never had POSIX shells, therefore it needs to be able to run successfully under pre-POSIX shells. Nor was there any significant difficulty in doing this reasonably, and only a relative few terms needed to be factored into intermediate variables to complete this change. * config.guess: revert POSIX command substitutions to classic form --- config.guess | 217 +++++++++++++++++++++++++++------------------------ 1 file changed, 116 insertions(+), 101 deletions(-) diff --git a/config.guess b/config.guess index bb587c8..6d9c6ce 100755 --- a/config.guess +++ b/config.guess @@ -2,6 +2,8 @@ # Attempt to guess a canonical system name. # Copyright 1992-2021 Free Software Foundation, Inc. +# shellcheck disable=SC2006,SC2268 # see below for rationale + timestamp='2021-05-20' # This file is free software; you can redistribute it and/or modify it @@ -32,7 +34,15 @@ timestamp='2021-05-20' # Please send patches to . -me=$(echo "$0" | sed -e 's,.*/,,') +# The "shellcheck disable" line above the timestamp inhibits complaints +# about features and limitations of the classic Bourne shell that were +# superseded or lifted in POSIX. However, this script identifies a wide +# variety of pre-POSIX systems that do not have POSIX shells at all, and +# even some reasonably current systems (Solaris 10 as case-in-point) still +# have a pre-POSIX /bin/sh. + + +me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] @@ -108,7 +118,7 @@ set_cc_for_build() { test "$tmp" && return 0 : "${TMPDIR=/tmp}" # shellcheck disable=SC2039 - { tmp=$( (umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null) && test -n "$tmp" && test -d "$tmp" ; } || + { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir "$tmp" 2>/dev/null) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } @@ -136,10 +146,10 @@ if test -f /.attbin/uname ; then PATH=$PATH:/.attbin ; export PATH fi -UNAME_MACHINE=$( (uname -m) 2>/dev/null) || UNAME_MACHINE=unknown -UNAME_RELEASE=$( (uname -r) 2>/dev/null) || UNAME_RELEASE=unknown -UNAME_SYSTEM=$( (uname -s) 2>/dev/null) || UNAME_SYSTEM=unknown -UNAME_VERSION=$( (uname -v) 2>/dev/null) || UNAME_VERSION=unknown +UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown +UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown +UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown case $UNAME_SYSTEM in Linux|GNU|GNU/*) @@ -162,7 +172,8 @@ Linux|GNU|GNU/*) #endif #endif EOF - eval "$($CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g')" + cc_set_libc=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` + eval "$cc_set_libc" # Second heuristic to detect musl libc. if [ "$LIBC" = unknown ] && @@ -193,10 +204,10 @@ case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". - UNAME_MACHINE_ARCH=$( (uname -p 2>/dev/null || \ + UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ /sbin/sysctl -n hw.machine_arch 2>/dev/null || \ /usr/sbin/sysctl -n hw.machine_arch 2>/dev/null || \ - echo unknown)) + echo unknown)` case $UNAME_MACHINE_ARCH in aarch64eb) machine=aarch64_be-unknown ;; armeb) machine=armeb-unknown ;; @@ -205,8 +216,8 @@ case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; earmv*) - arch=$(echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,') - endian=$(echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p') + arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'` + endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'` machine="${arch}${endian}"-unknown ;; *) machine="$UNAME_MACHINE_ARCH"-unknown ;; @@ -236,8 +247,7 @@ case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in # Determine ABI tags. case $UNAME_MACHINE_ARCH in earm*) - expr='s/^earmv[0-9]/-eabi/;s/eb$//' - abi=$(echo "$UNAME_MACHINE_ARCH" | sed -e "$expr") + abi=`echo "$UNAME_MACHINE_ARCH" | sed -e 's/^earmv[0-9]/-eabi/;s/eb$//'` ;; esac # The OS release @@ -250,7 +260,7 @@ case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in release='-gnu' ;; *) - release=$(echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2) + release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: @@ -259,19 +269,19 @@ case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in GUESS=$machine-${os}${release}${abi-} ;; *:Bitrig:*:*) - UNAME_MACHINE_ARCH=$(arch | sed 's/Bitrig.//') + UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` GUESS=$UNAME_MACHINE_ARCH-unknown-bitrig$UNAME_RELEASE ;; *:OpenBSD:*:*) - UNAME_MACHINE_ARCH=$(arch | sed 's/OpenBSD.//') + UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` GUESS=$UNAME_MACHINE_ARCH-unknown-openbsd$UNAME_RELEASE ;; *:SecBSD:*:*) - UNAME_MACHINE_ARCH=$(arch | sed 's/SecBSD.//') + UNAME_MACHINE_ARCH=`arch | sed 's/SecBSD.//'` GUESS=$UNAME_MACHINE_ARCH-unknown-secbsd$UNAME_RELEASE ;; *:LibertyBSD:*:*) - UNAME_MACHINE_ARCH=$(arch | sed 's/^.*BSD\.//') + UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` GUESS=$UNAME_MACHINE_ARCH-unknown-libertybsd$UNAME_RELEASE ;; *:MidnightBSD:*:*) @@ -307,17 +317,17 @@ case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) - UNAME_RELEASE=$(/usr/sbin/sizer -v | awk '{print $3}') + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) - UNAME_RELEASE=$(/usr/sbin/sizer -v | awk '{print $4}') + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. - ALPHA_CPU_TYPE=$(/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1) + ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case $ALPHA_CPU_TYPE in "EV4 (21064)") UNAME_MACHINE=alpha ;; @@ -355,7 +365,8 @@ case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. - echo "$UNAME_MACHINE"-dec-osf"$(echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz)" + OSF_REL=`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` + echo "$UNAME_MACHINE"-dec-osf"$OSF_REL" # Reset EXIT trap before exiting to avoid spurious non-zero exit code. exitcode=$? trap '' 0 @@ -389,7 +400,8 @@ case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. - if test "$( (/bin/universe) 2>/dev/null)" = att ; then + PYRAMID_UNIVERSE=`(/bin/universe) 2>/dev/null` + if test x"$PYRAMID_UNIVERSE" = xatt ; then GUESS=pyramid-pyramid-sysv3 else GUESS=pyramid-pyramid-bsd @@ -402,19 +414,19 @@ case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in GUESS=sparc-icl-nx6 ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) - case $(/usr/bin/uname -p) in + case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; s390x:SunOS:*:*) - SUN_REL=$(echo "$UNAME_RELEASE" | sed -e 's/[^.]*//') + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` GUESS=$UNAME_MACHINE-ibm-solaris2$SUN_REL ;; sun4H:SunOS:5.*:*) - SUN_REL=$(echo "$UNAME_RELEASE" | sed -e 's/[^.]*//') + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` GUESS=sparc-hal-solaris2$SUN_REL ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) - SUN_REL=$(echo "$UNAME_RELEASE" | sed -e 's/[^.]*//') + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` GUESS=sparc-sun-solaris2$SUN_REL ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) @@ -434,33 +446,33 @@ case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in SUN_ARCH=x86_64 fi fi - SUN_REL=$(echo "$UNAME_RELEASE" | sed -e 's/[^.]*//') + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` GUESS=$SUN_ARCH-pc-solaris2$SUN_REL ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. - SUN_REL=$(echo "$UNAME_RELEASE" | sed -e 's/[^.]*//') + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` GUESS=sparc-sun-solaris3$SUN_REL ;; sun4*:SunOS:*:*) - case $(/usr/bin/arch -k) in + case `/usr/bin/arch -k` in Series*|S4*) - UNAME_RELEASE=$(uname -v) + UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. - SUN_REL=$(echo "$UNAME_RELEASE" | sed -e 's/-/_/') + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/'` GUESS=sparc-sun-sunos$SUN_REL ;; sun3*:SunOS:*:*) GUESS=m68k-sun-sunos$UNAME_RELEASE ;; sun*:*:4.2BSD:*) - UNAME_RELEASE=$( (sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null) + UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3 - case $(/bin/arch) in + case `/bin/arch` in sun3) GUESS=m68k-sun-sunos$UNAME_RELEASE ;; @@ -540,8 +552,8 @@ case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in } EOF $CC_FOR_BUILD -o "$dummy" "$dummy.c" && - dummyarg=$(echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p') && - SYSTEM_NAME=$("$dummy" "$dummyarg") && + dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` && + SYSTEM_NAME=`"$dummy" "$dummyarg"` && { echo "$SYSTEM_NAME"; exit; } GUESS=mips-mips-riscos$UNAME_RELEASE ;; @@ -568,7 +580,7 @@ EOF ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures - UNAME_PROCESSOR=$(/usr/bin/uname -p) + UNAME_PROCESSOR=`/usr/bin/uname -p` if test "$UNAME_PROCESSOR" = mc88100 || test "$UNAME_PROCESSOR" = mc88110 then if test "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx || \ @@ -596,18 +608,18 @@ EOF GUESS=m68k-tektronix-bsd ;; *:IRIX*:*:*) - IRIX_REL=$(echo "$UNAME_RELEASE" | sed -e 's/-/_/g') + IRIX_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/g'` GUESS=mips-sgi-irix$IRIX_REL ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. GUESS=romp-ibm-aix # uname -m gives an 8 hex-code CPU id - ;; # Note that: echo "'$(uname -s)'" gives 'AIX ' + ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) GUESS=i386-ibm-aix ;; ia64:AIX:*:*) if test -x /usr/bin/oslevel ; then - IBM_REV=$(/usr/bin/oslevel) + IBM_REV=`/usr/bin/oslevel` else IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" fi @@ -627,7 +639,7 @@ EOF exit(0); } EOF - if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=$("$dummy") + if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` then GUESS=$SYSTEM_NAME else @@ -640,15 +652,15 @@ EOF fi ;; *:AIX:*:[4567]) - IBM_CPU_ID=$(/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }') + IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if test -x /usr/bin/lslpp ; then - IBM_REV=$(/usr/bin/lslpp -Lqc bos.rte.libc | - awk -F: '{ print $3 }' | sed s/[0-9]*$/0/) + IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | \ + awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` else IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" fi @@ -676,14 +688,14 @@ EOF GUESS=m68k-hp-bsd4.4 ;; 9000/[34678]??:HP-UX:*:*) - HPUX_REV=$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//') + HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'` case $UNAME_MACHINE in 9000/31?) HP_ARCH=m68000 ;; 9000/[34]??) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if test -x /usr/bin/getconf; then - sc_cpu_version=$(/usr/bin/getconf SC_CPU_VERSION 2>/dev/null) - sc_kernel_bits=$(/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null) + sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case $sc_cpu_version in 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1 @@ -730,7 +742,7 @@ EOF exit (0); } EOF - (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=$("$dummy") + (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac @@ -758,7 +770,7 @@ EOF GUESS=$HP_ARCH-hp-hpux$HPUX_REV ;; ia64:HP-UX:*:*) - HPUX_REV=$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//') + HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'` GUESS=ia64-hp-hpux$HPUX_REV ;; 3050*:HI-UX:*:*) @@ -788,7 +800,7 @@ EOF exit (0); } EOF - $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=$("$dummy") && + $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` && { echo "$SYSTEM_NAME"; exit; } GUESS=unknown-hitachi-hiuxwe2 ;; @@ -836,7 +848,7 @@ EOF GUESS=c4-convex-bsd ;; CRAY*Y-MP:*:*:*) - CRAY_REL=$(echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/') + CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` GUESS=ymp-cray-unicos$CRAY_REL ;; CRAY*[A-Z]90:*:*:*) @@ -846,30 +858,30 @@ EOF -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) - CRAY_REL=$(echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/') + CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` GUESS=t90-cray-unicos$CRAY_REL ;; CRAY*T3E:*:*:*) - CRAY_REL=$(echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/') + CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` GUESS=alphaev5-cray-unicosmk$CRAY_REL ;; CRAY*SV1:*:*:*) - CRAY_REL=$(echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/') + CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` GUESS=sv1-cray-unicos$CRAY_REL ;; *:UNICOS/mp:*:*) - CRAY_REL=$(echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/') + CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` GUESS=craynv-cray-unicosmp$CRAY_REL ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) - FUJITSU_PROC=$(uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz) - FUJITSU_SYS=$(uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///') - FUJITSU_REL=$(echo "$UNAME_RELEASE" | sed -e 's/ /_/') + FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` + FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` + FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'` GUESS=${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL} ;; 5000:UNIX_System_V:4.*:*) - FUJITSU_SYS=$(uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///') - FUJITSU_REL=$(echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/') + FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` + FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` GUESS=sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL} ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) @@ -882,27 +894,27 @@ EOF GUESS=$UNAME_MACHINE-unknown-bsdi$UNAME_RELEASE ;; arm:FreeBSD:*:*) - UNAME_PROCESSOR=$(uname -p) + UNAME_PROCESSOR=`uname -p` set_cc_for_build if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then - FREEBSD_REL=$(echo "$UNAME_RELEASE" | sed -e 's/[-(].*//') + FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` GUESS=${UNAME_PROCESSOR}-unknown-freebsd$FREEBSD_REL-gnueabi else - FREEBSD_REL=$(echo "$UNAME_RELEASE" | sed -e 's/[-(].*//') + FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` GUESS=${UNAME_PROCESSOR}-unknown-freebsd$FREEBSD_REL-gnueabihf fi ;; *:FreeBSD:*:*) - UNAME_PROCESSOR=$(/usr/bin/uname -p) + UNAME_PROCESSOR=`/usr/bin/uname -p` case $UNAME_PROCESSOR in amd64) UNAME_PROCESSOR=x86_64 ;; i386) UNAME_PROCESSOR=i586 ;; esac - FREEBSD_REL=$(echo "$UNAME_RELEASE" | sed -e 's/[-(].*//') + FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL ;; i*:CYGWIN*:*) @@ -939,19 +951,19 @@ EOF GUESS=x86_64-pc-cygwin ;; prep*:SunOS:5.*:*) - SUN_REL=$(echo "$UNAME_RELEASE" | sed -e 's/[^.]*//') + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` GUESS=powerpcle-unknown-solaris2$SUN_REL ;; *:GNU:*:*) # the GNU system - GNU_ARCH=$(echo "$UNAME_MACHINE" | sed -e 's,[-/].*$,,') - GNU_REL=$(echo "$UNAME_RELEASE" | sed -e 's,/.*$,,') + GNU_ARCH=`echo "$UNAME_MACHINE" | sed -e 's,[-/].*$,,'` + GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's,/.*$,,'` GUESS=$GNU_ARCH-unknown-$LIBC$GNU_REL ;; *:GNU/*:*:*) # other systems with GNU libc and userland - GNU_SYS=$(echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]") - GNU_REL=$(echo "$UNAME_RELEASE" | sed -e 's/[-(].*//') + GNU_SYS=`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"` + GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` GUESS=$UNAME_MACHINE-unknown-$GNU_SYS$GNU_REL-$LIBC ;; *:Minix:*:*) @@ -965,7 +977,7 @@ EOF GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; alpha:Linux:*:*) - case $(sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null) in + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; @@ -1077,7 +1089,8 @@ EOF #endif #endif EOF - eval "$($CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI')" + cc_set_vars=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI'` + eval "$cc_set_vars" test "x$CPU" != x && { echo "$CPU${MIPS_ENDIAN}-unknown-linux-$LIBCABI"; exit; } ;; mips64el:Linux:*:*) @@ -1097,7 +1110,7 @@ EOF ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level - case $(grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2) in + case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-"$LIBC" ;; PA8*) echo hppa2.0-unknown-linux-"$LIBC" ;; *) echo hppa-unknown-linux-"$LIBC" ;; @@ -1187,7 +1200,7 @@ EOF GUESS=$UNAME_MACHINE-pc-msdosdjgpp ;; i*86:*:4.*:*) - UNAME_REL=$(echo "$UNAME_RELEASE" | sed 's/\/MP$//') + UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then GUESS=$UNAME_MACHINE-univel-sysv$UNAME_REL else @@ -1196,7 +1209,7 @@ EOF ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. - case $(/bin/uname -X | grep "^Machine") in + case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; @@ -1205,10 +1218,10 @@ EOF ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then - UNAME_REL=$(sed -n 's/.*Version //p' /dev/null >/dev/null ; then - UNAME_REL=$( (/bin/uname -X|grep Release|sed -e 's/.*= //')) + UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 @@ -1258,7 +1271,7 @@ EOF 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ - && OS_REL=.$(sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid) + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ @@ -1269,7 +1282,7 @@ EOF NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ - && OS_REL=.$(sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid) + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ @@ -1302,7 +1315,7 @@ EOF ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then - UNAME_MACHINE=$( (uname -p) 2>/dev/null) + UNAME_MACHINE=`(uname -p) 2>/dev/null` GUESS=$UNAME_MACHINE-sni-sysv4 else GUESS=ns32k-sni-sysv @@ -1388,7 +1401,7 @@ EOF GUESS=aarch64-apple-darwin$UNAME_RELEASE ;; *:Darwin:*:*) - UNAME_PROCESSOR=$(uname -p) + UNAME_PROCESSOR=`uname -p` case $UNAME_PROCESSOR in unknown) UNAME_PROCESSOR=powerpc ;; esac @@ -1425,7 +1438,7 @@ EOF GUESS=$UNAME_PROCESSOR-apple-darwin$UNAME_RELEASE ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) - UNAME_PROCESSOR=$(uname -p) + UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = x86; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc @@ -1493,11 +1506,11 @@ EOF GUESS=mips-sei-seiux$UNAME_RELEASE ;; *:DragonFly:*:*) - DRAGONFLY_REL=$(echo "$UNAME_RELEASE" | sed -e 's/[-(].*//') + DRAGONFLY_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` GUESS=$UNAME_MACHINE-unknown-dragonfly$DRAGONFLY_REL ;; *:*VMS:*:*) - UNAME_MACHINE=$( (uname -p) 2>/dev/null) + UNAME_MACHINE=`(uname -p) 2>/dev/null` case $UNAME_MACHINE in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; @@ -1507,7 +1520,7 @@ EOF GUESS=i386-pc-xenix ;; i*86:skyos:*:*) - SKYOS_REL=$(echo "$UNAME_RELEASE" | sed -e 's/ .*$//') + SKYOS_REL=`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'` GUESS=$UNAME_MACHINE-pc-skyos$SKYOS_REL ;; i*86:rdos:*:*) @@ -1572,7 +1585,7 @@ main () #define __ARCHITECTURE__ "m68k" #endif int version; - version=$( (hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null); + version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else @@ -1664,7 +1677,7 @@ main () } EOF -$CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null && SYSTEM_NAME=$($dummy) && +$CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null && SYSTEM_NAME=`"$dummy"` && { echo "$SYSTEM_NAME"; exit; } # Apollos put the system type in the environment. @@ -1694,9 +1707,11 @@ and https://git.savannah.gnu.org/cgit/config.git/plain/config.sub EOF -year=$(echo $timestamp | sed 's,-.*,,') +our_year=`echo $timestamp | sed 's,-.*,,'` +thisyear=`date +%Y` # shellcheck disable=SC2003 -if test "$(expr "$(date +%Y)" - "$year")" -lt 3 ; then +script_age=`expr "$thisyear" - "$our_year"` +if test "$script_age" -lt 3 ; then cat >&2 </dev/null || echo unknown) -uname -r = $( (uname -r) 2>/dev/null || echo unknown) -uname -s = $( (uname -s) 2>/dev/null || echo unknown) -uname -v = $( (uname -v) 2>/dev/null || echo unknown) +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` -/usr/bin/uname -p = $( (/usr/bin/uname -p) 2>/dev/null) -/bin/uname -X = $( (/bin/uname -X) 2>/dev/null) +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null` -hostinfo = $( (hostinfo) 2>/dev/null) -/bin/universe = $( (/bin/universe) 2>/dev/null) -/usr/bin/arch -k = $( (/usr/bin/arch -k) 2>/dev/null) -/bin/arch = $( (/bin/arch) 2>/dev/null) -/usr/bin/oslevel = $( (/usr/bin/oslevel) 2>/dev/null) -/usr/convex/getsysinfo = $( (/usr/convex/getsysinfo) 2>/dev/null) +hostinfo = `(hostinfo) 2>/dev/null` +/bin/universe = `(/bin/universe) 2>/dev/null` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` +/bin/arch = `(/bin/arch) 2>/dev/null` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = "$UNAME_MACHINE" UNAME_RELEASE = "$UNAME_RELEASE" -- 2.17.1 From MAILER-DAEMON Sat May 22 23:04:10 2021 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1lkePS-0007RJ-CH for mharc-config-patches@gnu.org; Sat, 22 May 2021 23:04:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58314) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lkePQ-0007Ql-Ty for config-patches@gnu.org; Sat, 22 May 2021 23:04:08 -0400 Received: from mailbackend.panix.com ([166.84.1.89]:54848) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lkePM-0000MY-54; Sat, 22 May 2021 23:04:08 -0400 Received: from mail-yb1-f170.google.com (mail-yb1-f170.google.com [209.85.219.170]) by mailbackend.panix.com (Postfix) with ESMTPSA id 4FnlYG2KdDz3pZB; Sat, 22 May 2021 23:04:02 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=panix.com; s=panix; t=1621739042; bh=l+UAL9EFh4Hb9BjiPhama2lZs2Am/boEKKpOMm5LjEc=; h=References:In-Reply-To:From:Date:Subject:To:Cc; b=j7GCbJVJghYy4I5iekrDLTdIMBi/0GAVrR19ZnQlLYRChNJ+2eCAwn+fwH7lM7aiy ol0tdjlHZYxsT/i3LXtgZlTLcDYu6WzA6dLBTUaCNa+MAnKeyzvEve1Ema+pX0dYcu 67RGeL3JH0qdGNd8ohawYQOgsIMVKLSBUYQs/0hE= Received: by mail-yb1-f170.google.com with SMTP id i4so33138766ybe.2; Sat, 22 May 2021 20:04:02 -0700 (PDT) X-Gm-Message-State: AOAM530xzT8DXZP5V1HorJda9lq+SL9ofztc4QAGAXIsIolr5efdtRR3 21fdcIfNzeyDCHTyVvNKWCX3MUt3MZfjNpoUm6E= X-Google-Smtp-Source: ABdhPJxDSZmxFVf4nzzYs7HOxCk4v1q9D0G0vM03khHBT7ZIss6ENbvJIXFokIj5R3Y6iEjZoSa51imQxsN6JFI1TSI= X-Received: by 2002:a25:7ec4:: with SMTP id z187mr24869918ybc.136.1621739041963; Sat, 22 May 2021 20:04:01 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Zack Weinberg Date: Sat, 22 May 2021 23:03:51 -0400 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 0/6] restore compatibility with pre-POSIX shells in config.guess To: Jacob Bachmeyer Cc: config-patches@gnu.org Content-Type: multipart/alternative; boundary="00000000000083c25c05c2f68b85" Received-SPF: pass client-ip=166.84.1.89; envelope-from=zackw@panix.com; helo=mailbackend.panix.com X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: config-patches@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Patches for the config.guess and config.sub scripts" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 May 2021 03:04:09 -0000 --00000000000083c25c05c2f68b85 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sat, May 22, 2021 at 9:06 PM Jacob Bachmeyer wrote: > This patch series tidies config.guess and reverts to classic backtick > command substitutions. I fully endorse reverting config.{sub,guess} to classic backtick command substitutions. However, Autoconf proper (in 2.70+) will continue to look for $(...) support in its =E2=80=9Cbetter shell=E2=80=9D logic. This is bec= ause, even before the 2.70 release, a steadily increasing number of configure.ac=E2=80= =99s and third party macros were casually using it, having never been tested with shells that don=E2=80=99t support it. No shell splits the WORD in "case WORD in ... esac", so instances > where WORD was quoted were changed. This change, however, I think is a mistake, because it=E2=80=99s easier to = *read* shell scripts if you don=E2=80=99t make the reader remember this syntax qui= rk. Quotes while forming the output are pointless, since no valid GNU > configuration tuple contains whitespace, therefore no variables > interpolated will be candidates for word splitting. [and several other tricks to avoid putting shell variable interpolation inside double quotes] > And again, I think you shouldn=E2=80=99t make people remember or deduce tha= t. =E2=80=9C*All* shell variable interpolations will be inside double quotes, = except when word splitting of the result is *desired*=E2=80=9D puts less cognitive= load on people reading the script than =E2=80=9Cshell variable interpolations will = only be inside double quotes when word splitting is both possible and undesirable.= =E2=80=9C Thus it is the style rule I=E2=80=99ve been applying in Autoconf proper, an= d I think it=E2=80=99s appropriate here as well. zw --00000000000083c25c05c2f68b85 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Sat, May 22, 2021 at 9:06 PM Jacob Bachmeyer <jcb@gnu.org> wrote:
This patch series tidies = config.guess and reverts to classic backtick
command substitutions.

I fully endorse reverting config.{sub,guess} to classic backtick comm= and substitutions. However, Autoconf proper (in 2.70+) will continue to loo= k for $(...) support in its =E2=80=9Cbetter shell=E2=80=9D logic. This is b= ecause, even before the 2.70 release, a steadily increasing number of configure.ac=E2=80=99s and =C2=A0third party= macros were casually using it, having never been tested with shells that d= on=E2=80=99t support it.

No shell splits the WORD in "case WORD in ... esac", so instances=
where WORD was quoted were changed.

This change, however, I think is a mistake, because it= =E2=80=99s easier to *read* shell scripts if you don=E2=80=99t make the rea= der remember this syntax quirk.

Quotes while forming the output are point= less, since no valid GNU
configuration tuple contains whitespace, therefore no variables
interpolated will be candidates for word splitting.
[and several other tricks to avoid putting shell variable interpolat= ion inside double quotes]
=

And again, I thi= nk you shouldn=E2=80=99t make people remember or deduce that.

=E2=80=9C*All* shell variable interpo= lations will be inside double quotes, except when word splitting of the res= ult is *desired*=E2=80=9D puts less cognitive load on people reading the sc= ript than =E2=80=9Cshell variable interpolations will only be inside double= quotes when word splitting is both possible and undesirable.=E2=80=9C Thus= it is the style rule I=E2=80=99ve been applying in Autoconf proper, and I = think it=E2=80=99s appropriate here as well.

zw
--00000000000083c25c05c2f68b85-- From MAILER-DAEMON Sun May 23 01:38:53 2021 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1lkgp9-0002Sb-Tu for mharc-config-patches@gnu.org; Sun, 23 May 2021 01:38:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38062) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lkfZz-00082K-56 for config-patches@gnu.org; Sun, 23 May 2021 00:19:07 -0400 Received: from mail-oi1-x233.google.com ([2607:f8b0:4864:20::233]:41635) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lkfZv-0002TT-0f; Sun, 23 May 2021 00:19:06 -0400 Received: by mail-oi1-x233.google.com with SMTP id c3so23863134oic.8; Sat, 22 May 2021 21:19:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:date:from:reply-to:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-transfer-encoding; bh=mLJOejrHkH/gD8hBKJRLWy0JXEcnoRElBU7ZOZUTv4E=; b=MOlrUMfw5dTClr0girnyisPTIWUrIeTIHYVn0m9thX212UxMvhKag23XC3AObsVP9t 8Z28BzEg393fUnepQlglKk+Z8hCDVz59ZKcDBqQBiZdYx3ic2hpM34dT49sdkh7pQjfV ruiO5hGk+5vPkaXgvCDEEB6zCFNEGxuD7ltx7mpEMTSg/hJJ6IGbaDYrOPoYyKgQmh4i K1uTfTFT4cA3fZhMYdk2XcZKZ6jjiiSynjvYqD9V/u1ldNlt3VgOov7K6eLMYGmEYrYm LWnxbAWq5w4qRhqxakdKS1J544WT7DwQgPDTOzaz2UFxMXkHAMesYjiU2E2J8QGOi1Tt 4m9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:date:from:reply-to:user-agent :mime-version:to:cc:subject:references:in-reply-to :content-transfer-encoding; bh=mLJOejrHkH/gD8hBKJRLWy0JXEcnoRElBU7ZOZUTv4E=; b=kBfYyaWGLEmcLlLezkLsma5Q+XXOHlC/l0fjeMH2euUohIUOJYhxoVTDPUP/wNTy/T SM/sw25KRPDvoNaXBzNKWNaPvl9KrUDTD6RGpXAMc78ZtUTdJx4FZqUfzKO7BpueUIny S0tCzVC8ArcKR3LPm3IzMT1EQcMSPnY3QYFOkk/aoHORacP9MebbdbGCXuQ2BN0zr85x 1Zsxp0TutCCUU0D0v6f9MaRDkGT3D/kQQVTgxIcZWpCWgNWV46TMulncx1zZ28dtIePB XXJ0VjKMA+fSCOSqw7Nl50RGmWDDqW3cTVOHvzNlkZKlwcAQGvOiObUjoxQxSLFqUXZ8 WLAw== X-Gm-Message-State: AOAM530OKGy9uaOt5oGTfJir7Yk3H5gs3dGIVdWON+by4ru5j5mwbpjl rWAAq6sEcEVMU8hYmgbxYZM= X-Google-Smtp-Source: ABdhPJxaBJb70G7DeqB81ysy5XQQ9Pm9hMjFseKmA6J84b8fTnsH+nfEq4S39YAKcoK4oa4T7YRR2g== X-Received: by 2002:aca:230e:: with SMTP id e14mr7050831oie.58.1621743541567; Sat, 22 May 2021 21:19:01 -0700 (PDT) Received: from [192.168.2.42] (adsl-70-133-144-190.dsl.ablntx.sbcglobal.net. [70.133.144.190]) by smtp.gmail.com with ESMTPSA id r189sm2031256oif.8.2021.05.22.21.19.00 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 22 May 2021 21:19:00 -0700 (PDT) Message-ID: <60A9D7B3.9080405@gmail.com> Date: Sat, 22 May 2021 23:18:59 -0500 From: Jacob Bachmeyer Reply-To: jcb62281@gmail.com User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.8.1.22) Gecko/20090807 MultiZilla/1.8.3.4e SeaMonkey/1.1.17 Mnenhy/0.7.6.0 MIME-Version: 1.0 To: Zack Weinberg CC: Jacob Bachmeyer , config-patches@gnu.org Subject: Re: [PATCH 0/6] restore compatibility with pre-POSIX shells in config.guess References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2607:f8b0:4864:20::233; envelope-from=jcb62281@gmail.com; helo=mail-oi1-x233.google.com X-Spam_score_int: -15 X-Spam_score: -1.6 X-Spam_bar: - X-Spam_report: (-1.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, FREEMAIL_REPLYTO_END_DIGIT=0.25, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Sun, 23 May 2021 01:38:42 -0400 X-BeenThere: config-patches@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Patches for the config.guess and config.sub scripts" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 May 2021 04:19:07 -0000 Zack Weinberg wrote: > On Sat, May 22, 2021 at 9:06 PM Jacob Bachmeyer > wrote: > > This patch series tidies config.guess and reverts to classic backtick > command substitutions. > > > I fully endorse reverting config.{sub,guess} to classic backtick > command substitutions. Thank you for your support. > However, Autoconf proper (in 2.70+) will continue to look for $(...) > support in its “better shell” logic. This is because, even before the > 2.70 release, a steadily increasing number of configure.ac > ’s and third party macros were casually using > it, having never been tested with shells that don’t support it. That is less of a problem, since modern systems do have such a shell /somewhere/; however, Autoconf should probably mention an old release of bash (that /can/ be built on a system with a pre-POSIX shell) in the "no better shell" found message. > No shell splits the WORD in "case WORD in ... esac", so instances > where WORD was quoted were changed. > > > This change, however, I think is a mistake, because it’s easier to > *read* shell scripts if you don’t make the reader remember this syntax > quirk. On this I disagree; I believe that omitting those quotes is easier to read. This is somewhat a matter of style, and I prefer the way Emacs syntax highlights the unquoted form. Since the script was previously inconsistent and I was writing the patches, I chose to make the script consistent in my preferred style. There is also a technical reason for using the unquoted form, see below for details. > Quotes while forming the output are pointless, since no valid GNU > configuration tuple contains whitespace, therefore no variables > interpolated will be candidates for word splitting. > > [and several other tricks to avoid putting shell variable > interpolation inside double quotes] > > And again, I think you shouldn’t make people remember or deduce that. They do not need to recognize that, which is why I did not add a comment explaining those details in the script. Instead, I moved the interpolations to contexts where quoting is not required. Following the existing patterns in the script will allow future additions to fit in transparently, and "shellcheck" will catch mistakes here. > “*All* shell variable interpolations will be inside double quotes, > except when word splitting of the result is *desired*” puts less > cognitive load on people reading the script than “shell variable > interpolations will only be inside double quotes when word splitting > is both possible and undesirable.“ Thus it is the style rule I’ve been > applying in Autoconf proper, and I think it’s appropriate here as well. I disagree, and I have a very good technical reason: backticks containing double quotes inside double quotes are non-portable due to bugs in various older shells. Many of the command substitutions use echo to pipe a variable's value through sed and need that variable quoted. Therefore, backticks need to be in non-quoted contexts, which the preparatory patches earlier in the series arrange. The rule is very simple: place shell variables inside double quotes unless word-splitting is desired and available, or the expansion is in a context where word-splitting does not occur. You need to remember that variable assignments and case constructs do not do word-splitting because another rule is "do not quote backticks" to maintain portability. This rule need not even be remembered: the "shellcheck" tool will provide reminders about variables not quoted where they should be quoted. -- Jacob From MAILER-DAEMON Mon May 24 07:25:21 2021 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1ll8i1-0006zB-Aq for mharc-config-patches@gnu.org; Mon, 24 May 2021 07:25:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58934) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ll8hz-0006w8-K9 for config-patches@gnu.org; Mon, 24 May 2021 07:25:19 -0400 Received: from vmicros1.altlinux.org ([194.107.17.57]:52670) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ll8hx-0005cG-Ea; Mon, 24 May 2021 07:25:19 -0400 Received: from mua.local.altlinux.org (mua.local.altlinux.org [192.168.1.14]) by vmicros1.altlinux.org (Postfix) with ESMTP id 70EA272C8B8; Mon, 24 May 2021 14:25:10 +0300 (MSK) Received: by mua.local.altlinux.org (Postfix, from userid 508) id 60DA17CC8A8; Mon, 24 May 2021 14:25:10 +0300 (MSK) Date: Mon, 24 May 2021 14:25:10 +0300 From: "Dmitry V. Levin" To: Jacob Bachmeyer Cc: config-patches@gnu.org Subject: Re: [PATCH 2/6] config.guess: use intermediate variable with uname results Message-ID: <20210524112510.GA30814@altlinux.org> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Received-SPF: pass client-ip=194.107.17.57; envelope-from=ldv@altlinux.org; helo=vmicros1.altlinux.org X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: config-patches@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Patches for the config.guess and config.sub scripts" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 May 2021 11:25:19 -0000 On Fri, May 21, 2021 at 10:39:49PM -0500, Jacob Bachmeyer wrote: > This will allow quoting to be significantly simplified in another > pass through the file. > > This was done with some manual cleanup after running this Emacs Lisp: No, please don't do it this way, let it be either a manual or an automatic change, but not a mix of those. > (defun edit-all-exits () > (interactive) > (while > (re-search-forward > "^\\([[:space:]]+\\)echo[[:space:]]+\\([^\n]+\\)\n\\1exit ;;" > nil t) > (replace-match "\\1GUESS=\\2\n\\1;;"))) Sorry, I cannot verify this, please use a sed or an awk script instead. > * config.guess: add GUESS variable to hold results of uname analysis > --- > config.guess | 973 ++++++++++++++++++++++++++------------------------- > 1 file changed, 492 insertions(+), 481 deletions(-) > > diff --git a/config.guess b/config.guess > index 92074bd..6acddd3 100755 > --- a/config.guess > +++ b/config.guess > @@ -84,6 +84,11 @@ if test $# != 0; then > exit 1 > fi > > +# just in case it came from the environment > +if test x${GUESS+set} != xset; then > + GUESS= > +fi This looks too complicated, wouldn't a simple GUESS= suffice? -- ldv From MAILER-DAEMON Mon May 24 09:32:25 2021 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1llAgz-0000EY-65 for mharc-config-patches@gnu.org; Mon, 24 May 2021 09:32:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57690) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1llAgx-0000De-BC for config-patches@gnu.org; Mon, 24 May 2021 09:32:23 -0400 Received: from mailbackend.panix.com ([166.84.1.89]:60535) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1llAgt-0000Ux-D2; Mon, 24 May 2021 09:32:23 -0400 Received: from mail-yb1-f172.google.com (unknown [209.85.219.172]) by mailbackend.panix.com (Postfix) with ESMTPSA id 4FpdRk0Kfbz2jPZ; Mon, 24 May 2021 09:32:18 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=panix.com; s=panix; t=1621863138; bh=xBYrczd3lqqC8sltLCkOws6YzfbAn2gG8RAKCcLMHZs=; h=References:In-Reply-To:From:Date:Subject:To:Cc; b=VRh6LY9gJmS2HhYGbsLQeRqL2TIa1y4dagPWvQpzGUGo5vlQUoDZ97tcoJrOzgg7N J4e8gcGC5PNvV98XnC88f+inaSTKZ9VQcwQx0XdZxxjYcRpwKr5ijdMOyKuO6cHvH+ 26Edpk8c5gBD4+raEK7R+s/UJamTTT3zhIFM6N8k= Received: by mail-yb1-f172.google.com with SMTP id g38so38064174ybi.12; Mon, 24 May 2021 06:32:18 -0700 (PDT) X-Gm-Message-State: AOAM533UTYDjXmjM84ZS/XF482Mv8IFgTP1cpyFpkerehrTyaByjFsoQ CJBkexBEqqHcMZh+rxmt+kBsMfbXC4NjtYx6ynY= X-Google-Smtp-Source: ABdhPJxbg+rstN2aG5FA9QrAGuRQOJpiVZGK2v3V9yKyVgwTQG8enjX6mCUPgM1oBh4TmhM6QQxwL9qJKnQa9DEEIxo= X-Received: by 2002:a25:f50c:: with SMTP id a12mr12657379ybe.509.1621863137631; Mon, 24 May 2021 06:32:17 -0700 (PDT) MIME-Version: 1.0 References: <60A9D7B3.9080405@gmail.com> In-Reply-To: <60A9D7B3.9080405@gmail.com> From: Zack Weinberg Date: Mon, 24 May 2021 09:32:06 -0400 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 0/6] restore compatibility with pre-POSIX shells in config.guess To: jcb62281@gmail.com Cc: Jacob Bachmeyer , config-patches@gnu.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=166.84.1.89; envelope-from=zackw@panix.com; helo=mailbackend.panix.com X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: config-patches@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Patches for the config.guess and config.sub scripts" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 May 2021 13:32:23 -0000 On Sun, May 23, 2021 at 12:19 AM Jacob Bachmeyer wrote= : > Zack Weinberg wrote: > > I fully endorse reverting config.{sub,guess} to classic backtick > > command substitutions. > > Thank you for your support. > > > However, Autoconf proper (in 2.70+) will continue to look for $(...) > > support in its =E2=80=9Cbetter shell=E2=80=9D logic. This is because, e= ven before the > > 2.70 release, a steadily increasing number of configure.ac > > =E2=80=99s and third party macros were casually u= sing > > it, having never been tested with shells that don=E2=80=99t support it. > > That is less of a problem, since modern systems do have such a shell > /somewhere/; however, Autoconf should probably mention an old release of > bash (that /can/ be built on a system with a pre-POSIX shell) in the "no > better shell" found message. Good thought, filed as . (I don't currently have any cycles for autoconf work.) [...] > On this I disagree; I believe that omitting those quotes is easier to rea= d. [...] > > =E2=80=9C*All* shell variable interpolations will be inside double quot= es, > > except when word splitting of the result is *desired*=E2=80=9D puts les= s > > cognitive load on people reading the script than =E2=80=9Cshell variabl= e > > interpolations will only be inside double quotes when word splitting > > is both possible and undesirable.=E2=80=9C Thus it is the style rule I= =E2=80=99ve been > > applying in Autoconf proper, and I think it=E2=80=99s appropriate here = as well. > > I disagree, and I have a very good technical reason: backticks > containing double quotes inside double quotes are non-portable due to > bugs in various older shells. Many of the command substitutions use > echo to pipe a variable's value through sed and need that variable > quoted. Therefore, backticks need to be in non-quoted contexts, which > the preparatory patches earlier in the series arrange. OK, so, I'm willing to accept var=3D`expression` being written without an outer set of double quotes, but I insist on this being the _only_ exception; in particular I insist on case "$var" in ... esac and var=3D"anything that doesn't involve backticks and isn't better written with single quotes" being written _with_ the double quotes. I will bow to additional exceptions only when there are other bugs in older shells that _require_ us not to use double quotes around variable substitutions. These particular scripts, as you know, have extra-strong constraints on what shell constructs they can use. What you might not appreciate is that they also have extra-strong constraints on _how they can be styled_, because they are most frequently edited by people in a hurry, trying to bring up a new operating system, needing to define a new canonical system name for it. They are usually _not_ experts in the dark history of Bourne shell. They cannot be relied on to run shellcheck before submitting a patch, or test on any system or shell but the one most conveniently to hand. They _can_ usually be relied on to make an attempt to match the style of the surrounding code, but they do not, and should not be expected to, infer subtle style rules like the one you are proposing. If we do it my way, I think future submissions will have a much better chance of being correct. (N.B. arguments from the availability of shellcheck would cut rather more ice with me if we had _any form whatsoever_ of CI in this project.) zw From MAILER-DAEMON Mon May 24 21:31:56 2021 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1llLvG-0002XF-En for mharc-config-patches@gnu.org; Mon, 24 May 2021 21:31:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59590) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1llLv8-0002Tn-Vf for config-patches@gnu.org; Mon, 24 May 2021 21:31:47 -0400 Received: from mail-oi1-x231.google.com ([2607:f8b0:4864:20::231]:45030) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1llLv7-00007J-45; Mon, 24 May 2021 21:31:46 -0400 Received: by mail-oi1-x231.google.com with SMTP id d21so28792147oic.11; Mon, 24 May 2021 18:31:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:date:from:reply-to:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-transfer-encoding; bh=IOfIOvpWY5JgCy9Gy9vww4Dg/gh3pbSfvIhXAG5aQ3s=; b=XMgB/4dKDZJWb6eTQw8NEmNThET64Ey7yn7oEoV3mQ8GYlNEEpuXeINBmSiY1pmWF6 gjhRN4jPyhFwqQ8jHNYQRKm6Ke5HdoN0qXxtvLWKAeeDFMeU8oUaDZPXLqnj+wFGtYbE FuChBGy3vvZJNiTjakxucEQgJX4m0YOt6pp+La+7BkHRH6gf7lpVPVdKDl6kCtCP301a m/IwhnZ/H9uJvnDBfv56lBWkX6stOjbrc57B4SJolGTcPfjQKjR9Ur5S2MwKEnhmY2ta cq2Y01CyI2K2TemcpdNcTIipXGybNWjO49weAZygIrH788wMnltHtsqSiUBys+MafSmZ pGCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:date:from:reply-to:user-agent :mime-version:to:cc:subject:references:in-reply-to :content-transfer-encoding; bh=IOfIOvpWY5JgCy9Gy9vww4Dg/gh3pbSfvIhXAG5aQ3s=; b=fmUc2JimW+u3LVn3GcS5JnzNpRBngopAUQqZwhVT7vrhe6GAnN1TxekWY4329LuyES 6WnnjFI+GLKTaTe2EgQo0PxUoDTD9wIRgkBEkmujxeCKsVb+7G9vCDa6hQ4vhgwrc5FU Pda8Z5A1g5bGBG7U4oI6+L/17vW1f4eDG+HOSPIAu6JKorCoFMKA2iEPycJ2r9fPb07U /MAXySdSKSlivUVdr1OkJq0hZ5jgoXPHunPQzAaA+0aTwrmwcZHXKn8a4xlxs4RA5uvo Wpl7KCxgWsdp3bvYPFryqd4Y+0AlKFPjnaRJt8R9klC6tByD0vY16o+F8yuQsvt7FnQB xwvA== X-Gm-Message-State: AOAM5330DTuLsmtLnMo9jfChQCSLXDpTMRa4lNVqixg7KtZ5mRluoOSX pvWTncTshrowjV0IM6pWMC/rWmdsXxYevQ== X-Google-Smtp-Source: ABdhPJxXcKv+W6Cz0lRNWUoKXkBoDB7atycHYng2rAJWe9xhAljqzEkUd4NOxUS9ZYwfowxPYgCBfg== X-Received: by 2002:a54:4809:: with SMTP id j9mr1180894oij.14.1621906302859; Mon, 24 May 2021 18:31:42 -0700 (PDT) Received: from [192.168.2.42] (adsl-70-133-144-190.dsl.ablntx.sbcglobal.net. [70.133.144.190]) by smtp.gmail.com with ESMTPSA id z9sm3520710oti.37.2021.05.24.18.31.41 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 24 May 2021 18:31:42 -0700 (PDT) Message-ID: <60AC537C.30207@gmail.com> Date: Mon, 24 May 2021 20:31:40 -0500 From: Jacob Bachmeyer Reply-To: jcb62281@gmail.com User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.8.1.22) Gecko/20090807 MultiZilla/1.8.3.4e SeaMonkey/1.1.17 Mnenhy/0.7.6.0 MIME-Version: 1.0 To: Zack Weinberg CC: Jacob Bachmeyer , config-patches@gnu.org Subject: Re: [PATCH 0/6] restore compatibility with pre-POSIX shells in config.guess References: <60A9D7B3.9080405@gmail.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2607:f8b0:4864:20::231; envelope-from=jcb62281@gmail.com; helo=mail-oi1-x231.google.com X-Spam_score_int: -15 X-Spam_score: -1.6 X-Spam_bar: - X-Spam_report: (-1.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, FREEMAIL_REPLYTO_END_DIGIT=0.25, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: config-patches@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Patches for the config.guess and config.sub scripts" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 May 2021 01:31:47 -0000 Zack Weinberg wrote: > On Sun, May 23, 2021 at 12:19 AM Jacob Bachmeyer wrote: > >> Zack Weinberg wrote: >> >>> “*All* shell variable interpolations will be inside double quotes, >>> except when word splitting of the result is *desired*” puts less >>> cognitive load on people reading the script than “shell variable >>> interpolations will only be inside double quotes when word splitting >>> is both possible and undesirable.“ Thus it is the style rule I’ve been >>> applying in Autoconf proper, and I think it’s appropriate here as well. >>> >> I disagree, and I have a very good technical reason: backticks >> containing double quotes inside double quotes are non-portable due to >> bugs in various older shells. Many of the command substitutions use >> echo to pipe a variable's value through sed and need that variable >> quoted. Therefore, backticks need to be in non-quoted contexts, which >> the preparatory patches earlier in the series arrange. >> > > OK, so, I'm willing to accept > > var=`expression` > > being written without an outer set of double quotes, but I insist on > this being the _only_ exception; in particular I insist on > > case "$var" in ... esac > There are also uses of "case `command` in ... esac" in config.guess. The same technical reason for omitting quotes in "var=`command`" also apply when `command` is the WORD in a case construct. > and > > var="anything that doesn't involve backticks and isn't better written > with single quotes" > > being written _with_ the double quotes. I will bow to additional > exceptions only when there are other bugs in older shells that > _require_ us not to use double quotes around variable substitutions. > Your example for a variable assignment legitimately requires quotes, since you have multiple literal words on the right-hand side of the assignment, variable assignment is NAME=WORD in the shell, and quotes allow WORDs to contain whitespace or other field separators. However, there is no need to use quotes when expanding variables in an assignment that is a single literal word, since the shell does not perform word-splitting in contexts where only one word is permitted. Concerning matters of readability, there is less concern with Autoconf since Autoconf builds up shell scripts using m4 macros and about no one is expected to read or edit a configure script produced by Autoconf. Autoconf also has more complex quoting rules in input, since there is both m4 and shell quoting to manage. As such, your style works well with Autoconf, but I do not believe that it works as well with scripts that are intended to be hand-edited. Using double quotes is never a problem in POSIX shells, particularly with the $( ) command substitution syntax, but config.guess must be both hand-edited and runnable under pre-POSIX shells, since it purports to identify a variety of pre-POSIX systems. Lastly, Emacs produces better syntax highlighting, clearly showing the actual variables being substituted, if the expression is unquoted. Again, this is less of a concern for Autoconf for other reasons, but is more relevant when the shell script is intended to be hand-edited. > These particular scripts, as you know, have extra-strong constraints > on what shell constructs they can use. What you might not appreciate > is that they also have extra-strong constraints on _how they can be > styled_, because they are most frequently edited by people in a hurry, > trying to bring up a new operating system, needing to define a new > canonical system name for it. They are usually _not_ experts in the > dark history of Bourne shell. They cannot be relied on to run > shellcheck before submitting a patch, or test on any system or shell > but the one most conveniently to hand. They _can_ usually be relied > on to make an attempt to match the style of the surrounding code, but > they do not, and should not be expected to, infer subtle style rules > like the one you are proposing. If we do it my way, I think future > submissions will have a much better chance of being correct. > I can add a brief style guide in a comment block easily enough. > (N.B. arguments from the availability of shellcheck would cut rather > more ice with me if we had _any form whatsoever_ of CI in this > project.) There is a testsuite that can be easily run with "make check-guess", although some tests will fail on non-GNU systems, as the code paths for identifying GNU variants tend to assume that GNU tools are available. -- Jacob From MAILER-DAEMON Mon May 24 22:04:59 2021 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1llMRG-0005Wm-G8 for mharc-config-patches@gnu.org; Mon, 24 May 2021 22:04:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35998) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1llMRD-0005Qo-GG for config-patches@gnu.org; Mon, 24 May 2021 22:04:55 -0400 Received: from mail-oi1-x22e.google.com ([2607:f8b0:4864:20::22e]:41633) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1llMRB-0002Dp-VQ; Mon, 24 May 2021 22:04:55 -0400 Received: by mail-oi1-x22e.google.com with SMTP id c3so28866426oic.8; Mon, 24 May 2021 19:04:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:date:from:reply-to:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-transfer-encoding; bh=3NV+PBPYLhoIImE93C3AIlmkH2kY0d1uomSKYLKQ61U=; b=hSRFNa2jEOGtbcO2i1hDqKAAjzhMb8a8rrp2R0zq6MAj/B9hC04nA3lfh9PMIg63Fg ND8dL5Hq5LAbCBD2oqXVo4VXICMKUrGB3UeGoXB7NtNdbZtMF+75ttPbL/nACrki74ZR AcOYTupelpY4IWzlIVi638a/cXGHzF0P2yUhjWikMNgUQ63BwDS8otS3oVcpD/vAaiCy MQnwLdoryid2+YDXye9iCYkfXjQoQlHauS6DOwudLx99og7QuR8G4OeVORibT4tcRRIe qQ1ko/9YjhnEJBY3wzeJCY7vOsm0LArc15D+byM9m5+r1bcITkX+jN6kiNfK8sm6vkgZ +qiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:date:from:reply-to:user-agent :mime-version:to:cc:subject:references:in-reply-to :content-transfer-encoding; bh=3NV+PBPYLhoIImE93C3AIlmkH2kY0d1uomSKYLKQ61U=; b=BMBLI2xbUWJMqgOhLoyd8rS+TIE9S/f9OmfFNU0rcgdxQzZZE/vtu5+ZtjZgFHQKc9 GP92cRAiQAT3o57jbi9LQ4kmrNfW1ajCEyRQsD6VV/l3ZVs3NZlPMxnco4qU6o8pzHay fbgK9/9MFCe2asPzGMDFPDntluBYmHdDhcvWTcnXuVDEkRIPsKU04r6cxAeFZ3s/ahfd Z7nWEIL+gDQfGksD1DuSbXSPJnz/9FjfnNMfUVccnV7IgP3ZjIaNRYv2rhEEuUc6O1bd 74p3l2Yzj/rewzY1jaOyc3ems2q8CHo2AWR0Sfgq50ob1ePATK1+Zzgr2PRr+Iot6PD4 wM+Q== X-Gm-Message-State: AOAM532IuZU4qVKpXo3uZ27teyPGNi2vOR611KQnPNPTrE4zUBsLNrc2 uAto+K5jo6dmPlQz3ErLV3pDA3Ck1WMaog== X-Google-Smtp-Source: ABdhPJxBTK44Yrs61glxwdQyp+fneHYUmThSp59mLU6n1PFg9AJLAHUcrv+NSmOBe5trrECvCVPCKQ== X-Received: by 2002:aca:b605:: with SMTP id g5mr12764489oif.127.1621908292049; Mon, 24 May 2021 19:04:52 -0700 (PDT) Received: from [192.168.2.42] (adsl-70-133-144-190.dsl.ablntx.sbcglobal.net. [70.133.144.190]) by smtp.gmail.com with ESMTPSA id s6sm3424129otk.71.2021.05.24.19.04.51 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 24 May 2021 19:04:51 -0700 (PDT) Message-ID: <60AC5B42.2040405@gmail.com> Date: Mon, 24 May 2021 21:04:50 -0500 From: Jacob Bachmeyer Reply-To: jcb62281@gmail.com User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.8.1.22) Gecko/20090807 MultiZilla/1.8.3.4e SeaMonkey/1.1.17 Mnenhy/0.7.6.0 MIME-Version: 1.0 To: "Dmitry V. Levin" CC: Jacob Bachmeyer , config-patches@gnu.org Subject: Re: [PATCH 2/6] config.guess: use intermediate variable with uname results References: <20210524112510.GA30814@altlinux.org> In-Reply-To: <20210524112510.GA30814@altlinux.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Received-SPF: pass client-ip=2607:f8b0:4864:20::22e; envelope-from=jcb62281@gmail.com; helo=mail-oi1-x22e.google.com X-Spam_score_int: -15 X-Spam_score: -1.6 X-Spam_bar: - X-Spam_report: (-1.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, FREEMAIL_REPLYTO_END_DIGIT=0.25, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: config-patches@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Patches for the config.guess and config.sub scripts" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 May 2021 02:04:55 -0000 Dmitry V. Levin wrote: > On Fri, May 21, 2021 at 10:39:49PM -0500, Jacob Bachmeyer wrote: > >> This will allow quoting to be significantly simplified in another >> pass through the file. >> >> This was done with some manual cleanup after running this Emacs Lisp: >> > > No, please don't do it this way, let it be either a manual or an automatic > change, but not a mix of those. > Fair enough; there may be a small manual cleanup patch after a larger automatic patch in v2. >> (defun edit-all-exits () >> (interactive) >> (while >> (re-search-forward >> "^\\([[:space:]]+\\)echo[[:space:]]+\\([^\n]+\\)\n\\1exit ;;" >> nil t) >> (replace-match "\\1GUESS=\\2\n\\1;;"))) >> > > Sorry, I cannot verify this, please use a sed or an awk script instead. > I am writing a GNU Awk program that will combine the automatic parts of patches 2 and 3 for v2; patches 1 and 5 were done manually using Emacs M-x occur and keyboard macros; patches 4 and 6 were produced manually. >> * config.guess: add GUESS variable to hold results of uname analysis >> --- >> config.guess | 973 ++++++++++++++++++++++++++------------------------- >> 1 file changed, 492 insertions(+), 481 deletions(-) >> >> diff --git a/config.guess b/config.guess >> index 92074bd..6acddd3 100755 >> --- a/config.guess >> +++ b/config.guess >> @@ -84,6 +84,11 @@ if test $# != 0; then >> exit 1 >> fi >> >> +# just in case it came from the environment >> +if test x${GUESS+set} != xset; then >> + GUESS= >> +fi >> > > This looks too complicated, wouldn't a simple GUESS= suffice? Now that I think about it... yes. This change will be in v2. -- Jacob From MAILER-DAEMON Wed May 26 21:51:38 2021 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1lm5BQ-0004iX-M1 for mharc-config-patches@gnu.org; Wed, 26 May 2021 21:51:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52498) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lm5BK-0004dt-IH for config-patches@gnu.org; Wed, 26 May 2021 21:51:33 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:55112) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lm5BK-0003qb-Ab for config-patches@gnu.org; Wed, 26 May 2021 21:51:30 -0400 Received: from jcb by fencepost.gnu.org with local (Exim 4.90_1) (envelope-from ) id 1lm5BK-0001CV-68 for config-patches@gnu.org; Wed, 26 May 2021 21:51:30 -0400 Message-Id: In-Reply-To: References: From: Jacob Bachmeyer Date: Tue, 25 May 2021 22:20:24 -0500 Subject: [PATCH v2 4/8] config.guess: automatic fixups after previous automated patch To: config-patches@gnu.org X-BeenThere: config-patches@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Patches for the config.guess and config.sub scripts" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 May 2021 01:51:34 -0000 This patch was generated using the following command: sed -i config.guess \ -e '/="[^"]\+"\(-\|$\)/s/="\([^"([:space:])]\+\)"/=\1/' \ -e '/="[^"]\+"[[:alnum:]]/s/="\$\([^([:space:])]\+\)"/=${\1}/' \ -e \ '/\$(echo[^|]\+|/s/\([^[:space:]]\)[[:space:]]*|[[:space:]]*sed/\1 | sed/g' * config.guess: remove unneeded quotes in other variable assignments * config.guess: standardize spacing for "echo ... | sed" substitutions --- config.guess | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/config.guess b/config.guess index eeda94e..d2bdee7 100755 --- a/config.guess +++ b/config.guess @@ -115,7 +115,7 @@ set_cc_for_build() { ,,) echo "int x;" > "$dummy.c" for driver in cc gcc c89 c99 ; do if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then - CC_FOR_BUILD="$driver" + CC_FOR_BUILD=$driver break fi done @@ -205,9 +205,9 @@ case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in earmv*) arch=$(echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,') endian=$(echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p') - machine="${arch}${endian}"-unknown + machine=${arch}${endian}-unknown ;; - *) machine="$UNAME_MACHINE_ARCH"-unknown ;; + *) machine=$UNAME_MACHINE_ARCH-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently (or will in the future) and ABI. @@ -608,7 +608,7 @@ EOF if test -x /usr/bin/oslevel ; then IBM_REV=$(/usr/bin/oslevel) else - IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" + IBM_REV=$UNAME_VERSION.$UNAME_RELEASE fi GUESS=$UNAME_MACHINE-ibm-aix$IBM_REV ;; @@ -649,7 +649,7 @@ EOF IBM_REV=$(/usr/bin/lslpp -Lqc bos.rte.libc | awk -F: '{ print $3 }' | sed s/[0-9]*$/0/) else - IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" + IBM_REV=$UNAME_VERSION.$UNAME_RELEASE fi GUESS=$IBM_ARCH-ibm-aix$IBM_REV ;; @@ -675,7 +675,7 @@ EOF GUESS=m68k-hp-bsd4.4 ;; 9000/[34678]??:HP-UX:*:*) - HPUX_REV=$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//') + HPUX_REV=$(echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//') case $UNAME_MACHINE in 9000/31?) HP_ARCH=m68000 ;; 9000/[34]??) HP_ARCH=m68k ;; @@ -757,7 +757,7 @@ EOF GUESS=$HP_ARCH-hp-hpux$HPUX_REV ;; ia64:HP-UX:*:*) - HPUX_REV=$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//') + HPUX_REV=$(echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//') GUESS=ia64-hp-hpux$HPUX_REV ;; 3050*:HI-UX:*:*) @@ -943,11 +943,11 @@ EOF ;; *:GNU:*:*) # the GNU system - GUESS="$(echo "$UNAME_MACHINE"|sed -e 's,[-/].*$,,')-unknown-$LIBC$(echo "$UNAME_RELEASE"|sed -e 's,/.*$,,')" + GUESS="$(echo "$UNAME_MACHINE" | sed -e 's,[-/].*$,,')-unknown-$LIBC$(echo "$UNAME_RELEASE" | sed -e 's,/.*$,,')" ;; *:GNU/*:*:*) # other systems with GNU libc and userland - GUESS="$UNAME_MACHINE-unknown-$(echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]")$(echo "$UNAME_RELEASE"|sed -e 's/[-(].*//')-$LIBC" + GUESS="$UNAME_MACHINE-unknown-$(echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]")$(echo "$UNAME_RELEASE" | sed -e 's/[-(].*//')-$LIBC" ;; *:Minix:*:*) GUESS=$UNAME_MACHINE-unknown-minix @@ -1139,7 +1139,7 @@ EOF (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_X32 >/dev/null then - LIBCABI="$LIBC"x32 + LIBCABI=${LIBC}x32 fi fi GUESS=$UNAME_MACHINE-pc-linux-$LIBCABI @@ -1461,7 +1461,7 @@ EOF if test "${cputype-}" = 386; then UNAME_MACHINE=i386 elif test "x${cputype-}" != x; then - UNAME_MACHINE="$cputype" + UNAME_MACHINE=$cputype fi GUESS=$UNAME_MACHINE-unknown-plan9 ;; -- 2.17.1 From MAILER-DAEMON Wed May 26 21:51:39 2021 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1lm5BT-0004nq-Ki for mharc-config-patches@gnu.org; Wed, 26 May 2021 21:51:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52496) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lm5BK-0004ds-Dz for config-patches@gnu.org; Wed, 26 May 2021 21:51:33 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:55110) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lm5BK-0003qW-6f for config-patches@gnu.org; Wed, 26 May 2021 21:51:30 -0400 Received: from jcb by fencepost.gnu.org with local (Exim 4.90_1) (envelope-from ) id 1lm5BI-0001CN-T5 for config-patches@gnu.org; Wed, 26 May 2021 21:51:29 -0400 Message-Id: <0057378d6814280503ebf0f561939b6961411e0a.1622078762.git.jcb@gnu.org> In-Reply-To: References: From: Jacob Bachmeyer Date: Tue, 25 May 2021 22:01:22 -0500 Subject: [PATCH v2 3/8] config.guess: remove unneeded quotes and factor command substitutions To: config-patches@gnu.org X-BeenThere: config-patches@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Patches for the config.guess and config.sub scripts" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 May 2021 01:51:34 -0000 This is further cleanup and simplifies some constructs that can confuse Emacs' syntax highlighting while generally reducing required quoting. This patch was generated using the included GNU Awk program. * config.guess: remove unneeded variable quotes when setting GUESS * config.guess: factor out command substitutions when setting GUESS --- config.guess | 349 +++++++++++++++++++++++++++------------------------ patch-3.gawk | 99 +++++++++++++++ 2 files changed, 283 insertions(+), 165 deletions(-) mode change 100644 => 100755 config.guess create mode 100755 patch-3.gawk diff --git a/config.guess b/config.guess old mode 100644 new mode 100755 index f97d7ff..eeda94e --- a/config.guess +++ b/config.guess @@ -254,50 +254,50 @@ case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. - GUESS="$machine-${os}${release}${abi-}" + GUESS=$machine-${os}${release}${abi-} ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=$(arch | sed 's/Bitrig.//') - GUESS="$UNAME_MACHINE_ARCH"-unknown-bitrig"$UNAME_RELEASE" + GUESS=$UNAME_MACHINE_ARCH-unknown-bitrig$UNAME_RELEASE ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=$(arch | sed 's/OpenBSD.//') - GUESS="$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE" + GUESS=$UNAME_MACHINE_ARCH-unknown-openbsd$UNAME_RELEASE ;; *:SecBSD:*:*) UNAME_MACHINE_ARCH=$(arch | sed 's/SecBSD.//') - GUESS="$UNAME_MACHINE_ARCH"-unknown-secbsd"$UNAME_RELEASE" + GUESS=$UNAME_MACHINE_ARCH-unknown-secbsd$UNAME_RELEASE ;; *:LibertyBSD:*:*) UNAME_MACHINE_ARCH=$(arch | sed 's/^.*BSD\.//') - GUESS="$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE" + GUESS=$UNAME_MACHINE_ARCH-unknown-libertybsd$UNAME_RELEASE ;; *:MidnightBSD:*:*) - GUESS="$UNAME_MACHINE"-unknown-midnightbsd"$UNAME_RELEASE" + GUESS=$UNAME_MACHINE-unknown-midnightbsd$UNAME_RELEASE ;; *:ekkoBSD:*:*) - GUESS="$UNAME_MACHINE"-unknown-ekkobsd"$UNAME_RELEASE" + GUESS=$UNAME_MACHINE-unknown-ekkobsd$UNAME_RELEASE ;; *:SolidBSD:*:*) - GUESS="$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE" + GUESS=$UNAME_MACHINE-unknown-solidbsd$UNAME_RELEASE ;; *:OS108:*:*) - GUESS="$UNAME_MACHINE"-unknown-os108_"$UNAME_RELEASE" + GUESS=$UNAME_MACHINE-unknown-os108_$UNAME_RELEASE ;; macppc:MirBSD:*:*) - GUESS=powerpc-unknown-mirbsd"$UNAME_RELEASE" + GUESS=powerpc-unknown-mirbsd$UNAME_RELEASE ;; *:MirBSD:*:*) - GUESS="$UNAME_MACHINE"-unknown-mirbsd"$UNAME_RELEASE" + GUESS=$UNAME_MACHINE-unknown-mirbsd$UNAME_RELEASE ;; *:Sortix:*:*) - GUESS="$UNAME_MACHINE"-unknown-sortix + GUESS=$UNAME_MACHINE-unknown-sortix ;; *:Twizzler:*:*) - GUESS="$UNAME_MACHINE"-unknown-twizzler + GUESS=$UNAME_MACHINE-unknown-twizzler ;; *:Redox:*:*) - GUESS="$UNAME_MACHINE"-unknown-redox + GUESS=$UNAME_MACHINE-unknown-redox ;; mips:OSF1:*.*) GUESS=mips-dec-osf1 @@ -355,16 +355,17 @@ case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. - GUESS="$UNAME_MACHINE"-dec-osf"$(echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz)" + OSF_REL=$(echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz) + GUESS=$UNAME_MACHINE-dec-osf$OSF_REL ;; Amiga*:UNIX_System_V:4.0:*) GUESS=m68k-unknown-sysv4 ;; *:[Aa]miga[Oo][Ss]:*:*) - GUESS="$UNAME_MACHINE"-unknown-amigaos + GUESS=$UNAME_MACHINE-unknown-amigaos ;; *:[Mm]orph[Oo][Ss]:*:*) - GUESS="$UNAME_MACHINE"-unknown-morphos + GUESS=$UNAME_MACHINE-unknown-morphos ;; *:OS/390:*:*) GUESS=i370-ibm-openedition @@ -376,7 +377,7 @@ case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in GUESS=powerpc-ibm-os400 ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) - GUESS=arm-acorn-riscix"$UNAME_RELEASE" + GUESS=arm-acorn-riscix$UNAME_RELEASE ;; arm*:riscos:*:*|arm*:RISCOS:*:*) GUESS=arm-unknown-riscos @@ -404,16 +405,19 @@ case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in esac ;; s390x:SunOS:*:*) - GUESS="$UNAME_MACHINE"-ibm-solaris2"$(echo "$UNAME_RELEASE" | sed -e 's/[^.]*//')" + SUN_REL=$(echo "$UNAME_RELEASE" | sed -e 's/[^.]*//') + GUESS=$UNAME_MACHINE-ibm-solaris2$SUN_REL ;; sun4H:SunOS:5.*:*) - GUESS=sparc-hal-solaris2"$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*//')" + SUN_REL=$(echo "$UNAME_RELEASE" | sed -e 's/[^.]*//') + GUESS=sparc-hal-solaris2$SUN_REL ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) - GUESS=sparc-sun-solaris2"$(echo "$UNAME_RELEASE" | sed -e 's/[^.]*//')" + SUN_REL=$(echo "$UNAME_RELEASE" | sed -e 's/[^.]*//') + GUESS=sparc-sun-solaris2$SUN_REL ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) - GUESS=i386-pc-auroraux"$UNAME_RELEASE" + GUESS=i386-pc-auroraux$UNAME_RELEASE ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) set_cc_for_build @@ -429,13 +433,15 @@ case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in SUN_ARCH=x86_64 fi fi - GUESS="$SUN_ARCH"-pc-solaris2"$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*//')" + SUN_REL=$(echo "$UNAME_RELEASE" | sed -e 's/[^.]*//') + GUESS=$SUN_ARCH-pc-solaris2$SUN_REL ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. - GUESS=sparc-sun-solaris3"$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*//')" + SUN_REL=$(echo "$UNAME_RELEASE" | sed -e 's/[^.]*//') + GUESS=sparc-sun-solaris3$SUN_REL ;; sun4*:SunOS:*:*) case $(/usr/bin/arch -k) in @@ -444,25 +450,26 @@ case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. - GUESS=sparc-sun-sunos"$(echo "$UNAME_RELEASE"|sed -e 's/-/_/')" + SUN_REL=$(echo "$UNAME_RELEASE" | sed -e 's/-/_/') + GUESS=sparc-sun-sunos$SUN_REL ;; sun3*:SunOS:*:*) - GUESS=m68k-sun-sunos"$UNAME_RELEASE" + GUESS=m68k-sun-sunos$UNAME_RELEASE ;; sun*:*:4.2BSD:*) UNAME_RELEASE=$( (sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null) test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3 case $(/bin/arch) in sun3) - GUESS=m68k-sun-sunos"$UNAME_RELEASE" + GUESS=m68k-sun-sunos$UNAME_RELEASE ;; sun4) - GUESS=sparc-sun-sunos"$UNAME_RELEASE" + GUESS=sparc-sun-sunos$UNAME_RELEASE ;; esac ;; aushp:SunOS:*:*) - GUESS=sparc-auspex-sunos"$UNAME_RELEASE" + GUESS=sparc-auspex-sunos$UNAME_RELEASE ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not @@ -473,40 +480,40 @@ case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) - GUESS=m68k-atari-mint"$UNAME_RELEASE" + GUESS=m68k-atari-mint$UNAME_RELEASE ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) - GUESS=m68k-atari-mint"$UNAME_RELEASE" + GUESS=m68k-atari-mint$UNAME_RELEASE ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) - GUESS=m68k-atari-mint"$UNAME_RELEASE" + GUESS=m68k-atari-mint$UNAME_RELEASE ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) - GUESS=m68k-milan-mint"$UNAME_RELEASE" + GUESS=m68k-milan-mint$UNAME_RELEASE ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) - GUESS=m68k-hades-mint"$UNAME_RELEASE" + GUESS=m68k-hades-mint$UNAME_RELEASE ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) - GUESS=m68k-unknown-mint"$UNAME_RELEASE" + GUESS=m68k-unknown-mint$UNAME_RELEASE ;; m68k:machten:*:*) - GUESS=m68k-apple-machten"$UNAME_RELEASE" + GUESS=m68k-apple-machten$UNAME_RELEASE ;; powerpc:machten:*:*) - GUESS=powerpc-apple-machten"$UNAME_RELEASE" + GUESS=powerpc-apple-machten$UNAME_RELEASE ;; RISC*:Mach:*:*) GUESS=mips-dec-mach_bsd4.3 ;; RISC*:ULTRIX:*:*) - GUESS=mips-dec-ultrix"$UNAME_RELEASE" + GUESS=mips-dec-ultrix$UNAME_RELEASE ;; VAX*:ULTRIX*:*:*) - GUESS=vax-dec-ultrix"$UNAME_RELEASE" + GUESS=vax-dec-ultrix$UNAME_RELEASE ;; 2020:CLIX:*:* | 2430:CLIX:*:*) - GUESS=clipper-intergraph-clix"$UNAME_RELEASE" + GUESS=clipper-intergraph-clix$UNAME_RELEASE ;; mips:*:*:UMIPS | mips:*:*:RISCos) set_cc_for_build @@ -535,7 +542,7 @@ EOF dummyarg=$(echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p') && SYSTEM_NAME=$("$dummy" "$dummyarg") && { echo "$SYSTEM_NAME"; exit; } - GUESS=mips-mips-riscos"$UNAME_RELEASE" + GUESS=mips-mips-riscos$UNAME_RELEASE ;; Motorola:PowerMAX_OS:*:*) GUESS=powerpc-motorola-powermax @@ -566,12 +573,12 @@ EOF if test "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx || \ test "$TARGET_BINARY_INTERFACE"x = x then - GUESS=m88k-dg-dgux"$UNAME_RELEASE" + GUESS=m88k-dg-dgux$UNAME_RELEASE else - GUESS=m88k-dg-dguxbcs"$UNAME_RELEASE" + GUESS=m88k-dg-dguxbcs$UNAME_RELEASE fi else - GUESS=i586-dg-dgux"$UNAME_RELEASE" + GUESS=i586-dg-dgux$UNAME_RELEASE fi ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) @@ -588,7 +595,8 @@ EOF GUESS=m68k-tektronix-bsd ;; *:IRIX*:*:*) - GUESS=mips-sgi-irix"$(echo "$UNAME_RELEASE"|sed -e 's/-/_/g')" + IRIX_REL=$(echo "$UNAME_RELEASE" | sed -e 's/-/_/g') + GUESS=mips-sgi-irix$IRIX_REL ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. GUESS=romp-ibm-aix # uname -m gives an 8 hex-code CPU id @@ -602,7 +610,7 @@ EOF else IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" fi - GUESS="$UNAME_MACHINE"-ibm-aix"$IBM_REV" + GUESS=$UNAME_MACHINE-ibm-aix$IBM_REV ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then @@ -620,7 +628,7 @@ EOF EOF if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=$("$dummy") then - GUESS="$SYSTEM_NAME" + GUESS=$SYSTEM_NAME else GUESS=rs6000-ibm-aix3.2.5 fi @@ -643,7 +651,7 @@ EOF else IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" fi - GUESS="$IBM_ARCH"-ibm-aix"$IBM_REV" + GUESS=$IBM_ARCH-ibm-aix$IBM_REV ;; *:AIX:*:*) GUESS=rs6000-ibm-aix @@ -652,7 +660,7 @@ EOF GUESS=romp-ibm-bsd4.4 ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and - GUESS=romp-ibm-bsd"$UNAME_RELEASE" # 4.3 with uname added to + GUESS=romp-ibm-bsd$UNAME_RELEASE # 4.3 with uname added to ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) GUESS=rs6000-bull-bosx @@ -746,11 +754,11 @@ EOF HP_ARCH=hppa64 fi fi - GUESS="$HP_ARCH"-hp-hpux"$HPUX_REV" + GUESS=$HP_ARCH-hp-hpux$HPUX_REV ;; ia64:HP-UX:*:*) HPUX_REV=$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//') - GUESS=ia64-hp-hpux"$HPUX_REV" + GUESS=ia64-hp-hpux$HPUX_REV ;; 3050*:HI-UX:*:*) set_cc_for_build @@ -800,9 +808,9 @@ EOF ;; i*86:OSF1:*:*) if test -x /usr/sbin/sysversion ; then - GUESS="$UNAME_MACHINE"-unknown-osf1mk + GUESS=$UNAME_MACHINE-unknown-osf1mk else - GUESS="$UNAME_MACHINE"-unknown-osf1 + GUESS=$UNAME_MACHINE-unknown-osf1 fi ;; parisc*:Lites*:*:*) @@ -827,7 +835,8 @@ EOF GUESS=c4-convex-bsd ;; CRAY*Y-MP:*:*:*) - GUESS=ymp-cray-unicos"$(echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/')" + CRAY_REL=$(echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/') + GUESS=ymp-cray-unicos$CRAY_REL ;; CRAY*[A-Z]90:*:*:*) echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \ @@ -836,36 +845,40 @@ EOF -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) - GUESS=t90-cray-unicos"$(echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/')" + CRAY_REL=$(echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/') + GUESS=t90-cray-unicos$CRAY_REL ;; CRAY*T3E:*:*:*) - GUESS=alphaev5-cray-unicosmk"$(echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/')" + CRAY_REL=$(echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/') + GUESS=alphaev5-cray-unicosmk$CRAY_REL ;; CRAY*SV1:*:*:*) - GUESS=sv1-cray-unicos"$(echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/')" + CRAY_REL=$(echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/') + GUESS=sv1-cray-unicos$CRAY_REL ;; *:UNICOS/mp:*:*) - GUESS=craynv-cray-unicosmp"$(echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/')" + CRAY_REL=$(echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/') + GUESS=craynv-cray-unicosmp$CRAY_REL ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=$(uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz) FUJITSU_SYS=$(uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///') FUJITSU_REL=$(echo "$UNAME_RELEASE" | sed -e 's/ /_/') - GUESS="${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + GUESS=${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL} ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=$(uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///') FUJITSU_REL=$(echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/') - GUESS="sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + GUESS=sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL} ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) - GUESS="$UNAME_MACHINE"-pc-bsdi"$UNAME_RELEASE" + GUESS=$UNAME_MACHINE-pc-bsdi$UNAME_RELEASE ;; sparc*:BSD/OS:*:*) - GUESS=sparc-unknown-bsdi"$UNAME_RELEASE" + GUESS=sparc-unknown-bsdi$UNAME_RELEASE ;; *:BSD/OS:*:*) - GUESS="$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE" + GUESS=$UNAME_MACHINE-unknown-bsdi$UNAME_RELEASE ;; arm:FreeBSD:*:*) UNAME_PROCESSOR=$(uname -p) @@ -873,9 +886,11 @@ EOF if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then - GUESS="${UNAME_PROCESSOR}"-unknown-freebsd"$(echo ${UNAME_RELEASE}|sed -e 's/[-(].*//')"-gnueabi + FREEBSD_REL=$(echo "$UNAME_RELEASE" | sed -e 's/[-(].*//') + GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabi else - GUESS="${UNAME_PROCESSOR}"-unknown-freebsd"$(echo ${UNAME_RELEASE}|sed -e 's/[-(].*//')"-gnueabihf + FREEBSD_REL=$(echo "$UNAME_RELEASE" | sed -e 's/[-(].*//') + GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabihf fi ;; *:FreeBSD:*:*) @@ -886,43 +901,45 @@ EOF i386) UNAME_PROCESSOR=i586 ;; esac - GUESS="$UNAME_PROCESSOR"-unknown-freebsd"$(echo "$UNAME_RELEASE"|sed -e 's/[-(].*//')" + FREEBSD_REL=$(echo "$UNAME_RELEASE" | sed -e 's/[-(].*//') + GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL ;; i*:CYGWIN*:*) - GUESS="$UNAME_MACHINE"-pc-cygwin + GUESS=$UNAME_MACHINE-pc-cygwin ;; *:MINGW64*:*) - GUESS="$UNAME_MACHINE"-pc-mingw64 + GUESS=$UNAME_MACHINE-pc-mingw64 ;; *:MINGW*:*) - GUESS="$UNAME_MACHINE"-pc-mingw32 + GUESS=$UNAME_MACHINE-pc-mingw32 ;; *:MSYS*:*) - GUESS="$UNAME_MACHINE"-pc-msys + GUESS=$UNAME_MACHINE-pc-msys ;; i*:PW*:*) - GUESS="$UNAME_MACHINE"-pc-pw32 + GUESS=$UNAME_MACHINE-pc-pw32 ;; *:Interix*:*) case $UNAME_MACHINE in x86) - GUESS=i586-pc-interix"$UNAME_RELEASE" + GUESS=i586-pc-interix$UNAME_RELEASE ;; authenticamd | genuineintel | EM64T) - GUESS=x86_64-unknown-interix"$UNAME_RELEASE" + GUESS=x86_64-unknown-interix$UNAME_RELEASE ;; IA64) - GUESS=ia64-unknown-interix"$UNAME_RELEASE" + GUESS=ia64-unknown-interix$UNAME_RELEASE ;; esac ;; i*:UWIN*:*) - GUESS="$UNAME_MACHINE"-pc-uwin + GUESS=$UNAME_MACHINE-pc-uwin ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) GUESS=x86_64-pc-cygwin ;; prep*:SunOS:5.*:*) - GUESS=powerpcle-unknown-solaris2"$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*//')" + SUN_REL=$(echo "$UNAME_RELEASE" | sed -e 's/[^.]*//') + GUESS=powerpcle-unknown-solaris2$SUN_REL ;; *:GNU:*:*) # the GNU system @@ -933,14 +950,14 @@ EOF GUESS="$UNAME_MACHINE-unknown-$(echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]")$(echo "$UNAME_RELEASE"|sed -e 's/[-(].*//')-$LIBC" ;; *:Minix:*:*) - GUESS="$UNAME_MACHINE"-unknown-minix + GUESS=$UNAME_MACHINE-unknown-minix ;; aarch64:Linux:*:*) - GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC" + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be - GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC" + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; alpha:Linux:*:*) case $(sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null) in @@ -954,62 +971,62 @@ EOF esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC=gnulibc1 ; fi - GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC" + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; arc:Linux:*:* | arceb:Linux:*:* | arc64:Linux:*:*) - GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC" + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; arm*:Linux:*:*) set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then - GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC" + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then - GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC"eabi + GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabi else - GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC"eabihf + GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabihf fi fi ;; avr32*:Linux:*:*) - GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC" + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; cris:Linux:*:*) - GUESS="$UNAME_MACHINE"-axis-linux-"$LIBC" + GUESS=$UNAME_MACHINE-axis-linux-$LIBC ;; crisv32:Linux:*:*) - GUESS="$UNAME_MACHINE"-axis-linux-"$LIBC" + GUESS=$UNAME_MACHINE-axis-linux-$LIBC ;; e2k:Linux:*:*) - GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC" + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; frv:Linux:*:*) - GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC" + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; hexagon:Linux:*:*) - GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC" + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; i*86:Linux:*:*) - GUESS="$UNAME_MACHINE"-pc-linux-"$LIBC" + GUESS=$UNAME_MACHINE-pc-linux-$LIBC ;; ia64:Linux:*:*) - GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC" + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; k1om:Linux:*:*) - GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC" + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; loongarch32:Linux:*:* | loongarch64:Linux:*:* | loongarchx32:Linux:*:*) - GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC" + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; m32r*:Linux:*:*) - GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC" + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; m68*:Linux:*:*) - GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC" + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; mips:Linux:*:* | mips64:Linux:*:*) set_cc_for_build @@ -1059,19 +1076,19 @@ EOF test "x$CPU" != x && { echo "$CPU${MIPS_ENDIAN}-unknown-linux-$LIBCABI"; exit; } ;; mips64el:Linux:*:*) - GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC" + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; openrisc*:Linux:*:*) - GUESS=or1k-unknown-linux-"$LIBC" + GUESS=or1k-unknown-linux-$LIBC ;; or32:Linux:*:* | or1k*:Linux:*:*) - GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC" + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; padre:Linux:*:*) - GUESS=sparc-unknown-linux-"$LIBC" + GUESS=sparc-unknown-linux-$LIBC ;; parisc64:Linux:*:* | hppa64:Linux:*:*) - GUESS=hppa64-unknown-linux-"$LIBC" + GUESS=hppa64-unknown-linux-$LIBC ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level @@ -1082,37 +1099,37 @@ EOF esac ;; ppc64:Linux:*:*) - GUESS=powerpc64-unknown-linux-"$LIBC" + GUESS=powerpc64-unknown-linux-$LIBC ;; ppc:Linux:*:*) - GUESS=powerpc-unknown-linux-"$LIBC" + GUESS=powerpc-unknown-linux-$LIBC ;; ppc64le:Linux:*:*) - GUESS=powerpc64le-unknown-linux-"$LIBC" + GUESS=powerpc64le-unknown-linux-$LIBC ;; ppcle:Linux:*:*) - GUESS=powerpcle-unknown-linux-"$LIBC" + GUESS=powerpcle-unknown-linux-$LIBC ;; riscv32:Linux:*:* | riscv32be:Linux:*:* | riscv64:Linux:*:* | riscv64be:Linux:*:*) - GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC" + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; s390:Linux:*:* | s390x:Linux:*:*) - GUESS="$UNAME_MACHINE"-ibm-linux-"$LIBC" + GUESS=$UNAME_MACHINE-ibm-linux-$LIBC ;; sh64*:Linux:*:*) - GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC" + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; sh*:Linux:*:*) - GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC" + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; sparc:Linux:*:* | sparc64:Linux:*:*) - GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC" + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; tile*:Linux:*:*) - GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC" + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; vax:Linux:*:*) - GUESS="$UNAME_MACHINE"-dec-linux-"$LIBC" + GUESS=$UNAME_MACHINE-dec-linux-$LIBC ;; x86_64:Linux:*:*) set_cc_for_build @@ -1125,10 +1142,10 @@ EOF LIBCABI="$LIBC"x32 fi fi - GUESS="$UNAME_MACHINE"-pc-linux-"$LIBCABI" + GUESS=$UNAME_MACHINE-pc-linux-$LIBCABI ;; xtensa*:Linux:*:*) - GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC" + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. @@ -1142,34 +1159,34 @@ EOF # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. - GUESS="$UNAME_MACHINE"-pc-sysv4.2uw"$UNAME_VERSION" + GUESS=$UNAME_MACHINE-pc-sysv4.2uw$UNAME_VERSION ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. - GUESS="$UNAME_MACHINE"-pc-os2-emx + GUESS=$UNAME_MACHINE-pc-os2-emx ;; i*86:XTS-300:*:STOP) - GUESS="$UNAME_MACHINE"-unknown-stop + GUESS=$UNAME_MACHINE-unknown-stop ;; i*86:atheos:*:*) - GUESS="$UNAME_MACHINE"-unknown-atheos + GUESS=$UNAME_MACHINE-unknown-atheos ;; i*86:syllable:*:*) - GUESS="$UNAME_MACHINE"-pc-syllable + GUESS=$UNAME_MACHINE-pc-syllable ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) - GUESS=i386-unknown-lynxos"$UNAME_RELEASE" + GUESS=i386-unknown-lynxos$UNAME_RELEASE ;; i*86:*DOS:*:*) - GUESS="$UNAME_MACHINE"-pc-msdosdjgpp + GUESS=$UNAME_MACHINE-pc-msdosdjgpp ;; i*86:*:4.*:*) UNAME_REL=$(echo "$UNAME_RELEASE" | sed 's/\/MP$//') if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then - GUESS="$UNAME_MACHINE"-univel-sysv"$UNAME_REL" + GUESS=$UNAME_MACHINE-univel-sysv$UNAME_REL else - GUESS="$UNAME_MACHINE"-pc-sysv"$UNAME_REL" + GUESS=$UNAME_MACHINE-pc-sysv$UNAME_REL fi ;; i*86:*:5:[678]*) @@ -1179,12 +1196,12 @@ EOF *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac - GUESS="$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}" + GUESS=$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=$(sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=$( (/bin/uname -X|grep Release|sed -e 's/.*= //')) (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 @@ -1194,9 +1211,9 @@ EOF && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 - GUESS="$UNAME_MACHINE"-pc-sco"$UNAME_REL" + GUESS=$UNAME_MACHINE-pc-sco$UNAME_REL else - GUESS="$UNAME_MACHINE"-pc-sysv32 + GUESS=$UNAME_MACHINE-pc-sysv32 fi ;; pc:*:*:*) @@ -1216,9 +1233,9 @@ EOF ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then - GUESS=i860-stardent-sysv"$UNAME_RELEASE" # Stardent Vistra i860-SVR4 + GUESS=i860-stardent-sysv$UNAME_RELEASE # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. - GUESS=i860-unknown-sysv"$UNAME_RELEASE" # Unknown i860-SVR4 + GUESS=i860-unknown-sysv$UNAME_RELEASE # Unknown i860-SVR4 fi ;; mini*:CTIX:SYS*5:*) @@ -1255,22 +1272,22 @@ EOF /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) - GUESS=m68k-unknown-lynxos"$UNAME_RELEASE" + GUESS=m68k-unknown-lynxos$UNAME_RELEASE ;; mc68030:UNIX_System_V:4.*:*) GUESS=m68k-atari-sysv4 ;; TSUNAMI:LynxOS:2.*:*) - GUESS=sparc-unknown-lynxos"$UNAME_RELEASE" + GUESS=sparc-unknown-lynxos$UNAME_RELEASE ;; rs6000:LynxOS:2.*:*) - GUESS=rs6000-unknown-lynxos"$UNAME_RELEASE" + GUESS=rs6000-unknown-lynxos$UNAME_RELEASE ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) - GUESS=powerpc-unknown-lynxos"$UNAME_RELEASE" + GUESS=powerpc-unknown-lynxos$UNAME_RELEASE ;; SM[BE]S:UNIX_SV:*:*) - GUESS=mips-dde-sysv"$UNAME_RELEASE" + GUESS=mips-dde-sysv$UNAME_RELEASE ;; RM*:ReliantUNIX-*:*:*) GUESS=mips-sni-sysv4 @@ -1281,7 +1298,7 @@ EOF *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=$( (uname -p) 2>/dev/null) - GUESS="$UNAME_MACHINE"-sni-sysv4 + GUESS=$UNAME_MACHINE-sni-sysv4 else GUESS=ns32k-sni-sysv fi @@ -1301,23 +1318,23 @@ EOF ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. - GUESS="$UNAME_MACHINE"-stratus-vos + GUESS=$UNAME_MACHINE-stratus-vos ;; *:VOS:*:*) # From Paul.Green@stratus.com. GUESS=hppa1.1-stratus-vos ;; mc68*:A/UX:*:*) - GUESS=m68k-apple-aux"$UNAME_RELEASE" + GUESS=m68k-apple-aux$UNAME_RELEASE ;; news*:NEWS-OS:6*:*) GUESS=mips-sony-newsos6 ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if test -d /usr/nec; then - GUESS=mips-nec-sysv"$UNAME_RELEASE" + GUESS=mips-nec-sysv$UNAME_RELEASE else - GUESS=mips-unknown-sysv"$UNAME_RELEASE" + GUESS=mips-unknown-sysv$UNAME_RELEASE fi ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. @@ -1336,34 +1353,34 @@ EOF GUESS=x86_64-unknown-haiku ;; SX-4:SUPER-UX:*:*) - GUESS=sx4-nec-superux"$UNAME_RELEASE" + GUESS=sx4-nec-superux$UNAME_RELEASE ;; SX-5:SUPER-UX:*:*) - GUESS=sx5-nec-superux"$UNAME_RELEASE" + GUESS=sx5-nec-superux$UNAME_RELEASE ;; SX-6:SUPER-UX:*:*) - GUESS=sx6-nec-superux"$UNAME_RELEASE" + GUESS=sx6-nec-superux$UNAME_RELEASE ;; SX-7:SUPER-UX:*:*) - GUESS=sx7-nec-superux"$UNAME_RELEASE" + GUESS=sx7-nec-superux$UNAME_RELEASE ;; SX-8:SUPER-UX:*:*) - GUESS=sx8-nec-superux"$UNAME_RELEASE" + GUESS=sx8-nec-superux$UNAME_RELEASE ;; SX-8R:SUPER-UX:*:*) - GUESS=sx8r-nec-superux"$UNAME_RELEASE" + GUESS=sx8r-nec-superux$UNAME_RELEASE ;; SX-ACE:SUPER-UX:*:*) - GUESS=sxace-nec-superux"$UNAME_RELEASE" + GUESS=sxace-nec-superux$UNAME_RELEASE ;; Power*:Rhapsody:*:*) - GUESS=powerpc-apple-rhapsody"$UNAME_RELEASE" + GUESS=powerpc-apple-rhapsody$UNAME_RELEASE ;; *:Rhapsody:*:*) - GUESS="$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE" + GUESS=$UNAME_MACHINE-apple-rhapsody$UNAME_RELEASE ;; arm64:Darwin:*:*) - GUESS=aarch64-apple-darwin"$UNAME_RELEASE" + GUESS=aarch64-apple-darwin$UNAME_RELEASE ;; *:Darwin:*:*) UNAME_PROCESSOR=$(uname -p) @@ -1400,7 +1417,7 @@ EOF # uname -m returns i386 or x86_64 UNAME_PROCESSOR=$UNAME_MACHINE fi - GUESS="$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE" + GUESS=$UNAME_PROCESSOR-apple-darwin$UNAME_RELEASE ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=$(uname -p) @@ -1408,25 +1425,25 @@ EOF UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi - GUESS="$UNAME_PROCESSOR"-"$UNAME_MACHINE"-nto-qnx"$UNAME_RELEASE" + GUESS=$UNAME_PROCESSOR-$UNAME_MACHINE-nto-qnx$UNAME_RELEASE ;; *:QNX:*:4*) GUESS=i386-pc-qnx ;; NEO-*:NONSTOP_KERNEL:*:*) - GUESS=neo-tandem-nsk"$UNAME_RELEASE" + GUESS=neo-tandem-nsk$UNAME_RELEASE ;; NSE-*:NONSTOP_KERNEL:*:*) - GUESS=nse-tandem-nsk"$UNAME_RELEASE" + GUESS=nse-tandem-nsk$UNAME_RELEASE ;; NSR-*:NONSTOP_KERNEL:*:*) - GUESS=nsr-tandem-nsk"$UNAME_RELEASE" + GUESS=nsr-tandem-nsk$UNAME_RELEASE ;; NSV-*:NONSTOP_KERNEL:*:*) - GUESS=nsv-tandem-nsk"$UNAME_RELEASE" + GUESS=nsv-tandem-nsk$UNAME_RELEASE ;; NSX-*:NONSTOP_KERNEL:*:*) - GUESS=nsx-tandem-nsk"$UNAME_RELEASE" + GUESS=nsx-tandem-nsk$UNAME_RELEASE ;; *:NonStop-UX:*:*) GUESS=mips-compaq-nonstopux @@ -1435,7 +1452,7 @@ EOF GUESS=bs2000-siemens-sysv ;; DS/*:UNIX_System_V:*:*) - GUESS="$UNAME_MACHINE"-"$UNAME_SYSTEM"-"$UNAME_RELEASE" + GUESS=$UNAME_MACHINE-$UNAME_SYSTEM-$UNAME_RELEASE ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 @@ -1446,7 +1463,7 @@ EOF elif test "x${cputype-}" != x; then UNAME_MACHINE="$cputype" fi - GUESS="$UNAME_MACHINE"-unknown-plan9 + GUESS=$UNAME_MACHINE-unknown-plan9 ;; *:TOPS-10:*:*) GUESS=pdp10-unknown-tops10 @@ -1467,10 +1484,11 @@ EOF GUESS=pdp10-unknown-its ;; SEI:*:*:SEIUX) - GUESS=mips-sei-seiux"$UNAME_RELEASE" + GUESS=mips-sei-seiux$UNAME_RELEASE ;; *:DragonFly:*:*) - GUESS="$UNAME_MACHINE"-unknown-dragonfly"$(echo "$UNAME_RELEASE"|sed -e 's/[-(].*//')" + DRAGONFLY_REL=$(echo "$UNAME_RELEASE" | sed -e 's/[-(].*//') + GUESS=$UNAME_MACHINE-unknown-dragonfly$DRAGONFLY_REL ;; *:*VMS:*:*) UNAME_MACHINE=$( (uname -p) 2>/dev/null) @@ -1483,22 +1501,23 @@ EOF GUESS=i386-pc-xenix ;; i*86:skyos:*:*) - GUESS="$UNAME_MACHINE"-pc-skyos"$(echo "$UNAME_RELEASE" | sed -e 's/ .*$//')" + SKYOS_REL=$(echo "$UNAME_RELEASE" | sed -e 's/ .*$//') + GUESS=$UNAME_MACHINE-pc-skyos$SKYOS_REL ;; i*86:rdos:*:*) - GUESS="$UNAME_MACHINE"-pc-rdos + GUESS=$UNAME_MACHINE-pc-rdos ;; *:AROS:*:*) - GUESS="$UNAME_MACHINE"-unknown-aros + GUESS=$UNAME_MACHINE-unknown-aros ;; x86_64:VMkernel:*:*) - GUESS="$UNAME_MACHINE"-unknown-esx + GUESS=$UNAME_MACHINE-unknown-esx ;; amd64:Isilon\ OneFS:*:*) GUESS=x86_64-unknown-onefs ;; *:Unleashed:*:*) - GUESS="$UNAME_MACHINE"-unknown-unleashed"$UNAME_RELEASE" + GUESS=$UNAME_MACHINE-unknown-unleashed$UNAME_RELEASE ;; esac diff --git a/patch-3.gawk b/patch-3.gawk new file mode 100755 index 0000000..7d4540d --- /dev/null +++ b/patch-3.gawk @@ -0,0 +1,99 @@ +#!/usr/bin/gawk -f +# -*- Awk -*- + +# Automate removing unneeded quotes in variable assignments and factoring +# out some command substitutions in config.guess. + +# GPLv3+ + +BEGIN { + if (ARGC < 2) ARGV[ARGC++] = "config.guess" + + Indent = "" + In_here_doc = 0 + Factor = "BOGUS!REL" +} + +# Skip here documents +In_here_doc && $0 ~ /^[[:space:]]*EOF/ { In_here_doc = 0 } +In_here_doc { print; next } +/< 0; count--) ret = ret text + return ret +} -- 2.17.1 From MAILER-DAEMON Wed May 26 21:51:40 2021 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1lm5BT-0004ow-VM for mharc-config-patches@gnu.org; Wed, 26 May 2021 21:51:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52478) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lm5BG-0004cU-Iz for config-patches@gnu.org; Wed, 26 May 2021 21:51:28 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:55104) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lm5BG-0003nl-Ca for config-patches@gnu.org; Wed, 26 May 2021 21:51:26 -0400 Received: from jcb by fencepost.gnu.org with local (Exim 4.90_1) (envelope-from ) id 1lm5BE-0001Bx-Jf for config-patches@gnu.org; Wed, 26 May 2021 21:51:25 -0400 Message-Id: From: Jacob Bachmeyer Date: Wed, 26 May 2021 21:26:02 -0400 Subject: [PATCH v2 0/8] restore compatibility with pre-POSIX shells in config.guess To: config-patches@gnu.org X-BeenThere: config-patches@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Patches for the config.guess and config.sub scripts" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 May 2021 01:51:30 -0000 This patch series tidies config.guess and reverts to classic backtick command substitutions. This is a respin after the earlier series proved difficult to properly review. Quotes while forming the output are pointless, since no valid GNU configuration tuple contains whitespace, therefore no variables interpolated will be candidates for word splitting. However, there are places in the script where unquoted variables could cause legitimate problems, so the script was reworked to store the uname-based guess in a GUESS variable instead of suppressing the shellcheck complaint. Since no shell splits the right hand side of a variable assignment, this form avoids the need to quote variables. Logically, config.guess should remain compatible with pre-POSIX shells; this is not difficult and the script purports to identify a variety of older systems that probably never had POSIX shells. In the interim, a few changes were made upstream and this patch series is based on commit 4550d2f15b3a7ce2451c1f29500b9339430c877f. Patch 1 from the original series was effectively merged upstream and is included in the baseline. Patch 2 in the original series became patches 1 and 2 in this series. Patches 3 and 4 in the original series became patches 3, 4, and 5 in this series, with most of the automatic work being collected into patch 3, a small sed-based fixup in patch 4, and manual fixups in patch 5 to complete preparations for patches 6 and 7. Patches 6 and 7 revert POSIX $( ) command substitutions to the traditional backtick form, with most of the work performed using an automatic tool in patch 6 and a few cases that could not be handled automatically resolved in patch 7. Lastly, patch 8 removes the one-off tools from the working tree, and collects all three of the Awk programs used for convenient review. Jacob Bachmeyer (8): config.guess: use intermediate variable with uname results config.guess: manual fixups after previous automatic patch config.guess: remove unneeded quotes and factor command substitutions config.guess: automatic fixups after previous automated patch config.guess: manual fixup after previous automated patches config.guess: replace POSIX $( ) with classic ` ` throughout config.guess: manual fixups after previous automatic patch remove automatic patch generators config.guess | 1182 ++++++++++++++++++++++++++------------------------ 1 file changed, 614 insertions(+), 568 deletions(-) -- 2.17.1 From MAILER-DAEMON Wed May 26 21:51:40 2021 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1lm5BU-0004pU-5w for mharc-config-patches@gnu.org; Wed, 26 May 2021 21:51:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52506) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lm5BN-0004eA-H5 for config-patches@gnu.org; Wed, 26 May 2021 21:51:33 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:55120) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lm5BN-0003sh-AG for config-patches@gnu.org; Wed, 26 May 2021 21:51:33 -0400 Received: from jcb by fencepost.gnu.org with local (Exim 4.90_1) (envelope-from ) id 1lm5BM-0001D3-OO for config-patches@gnu.org; Wed, 26 May 2021 21:51:32 -0400 Message-Id: In-Reply-To: References: From: Jacob Bachmeyer Date: Wed, 26 May 2021 20:13:22 -0500 Subject: [PATCH v2 8/8] remove automatic patch generators To: config-patches@gnu.org X-BeenThere: config-patches@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Patches for the config.guess and config.sub scripts" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 May 2021 01:51:34 -0000 These tools have served their purposes and need not be kept outside of the repository history any longer. This patch as a diff also collects the contents of the various tools in one convenient place. --- patch-1.gawk | 114 --------------------------------------------------- patch-3.gawk | 99 -------------------------------------------- patch-6.gawk | 21 ---------- 3 files changed, 234 deletions(-) delete mode 100755 patch-1.gawk delete mode 100755 patch-3.gawk delete mode 100755 patch-6.gawk diff --git a/patch-1.gawk b/patch-1.gawk deleted file mode 100755 index af82707..0000000 --- a/patch-1.gawk +++ /dev/null @@ -1,114 +0,0 @@ -#!/usr/bin/gawk -f -# -*- Awk -*- - -# Automate (most of) the refactoring of config.guess to use an intermediate variable -# for uname-based results. - -# GPLv3+ - -BEGIN { - if (ARGC < 2) ARGV[ARGC++] = "config.guess" - - Indent = "" - - In_main_case = 0 - - In_here_doc = 0 - Here_doc_end = "" - - If_depth = 0 - If_rewritten = 0 -} - -# Skip here documents -In_here_doc && $0 ~ /^[[:space:]]*EOF/ { In_here_doc = 0 } -In_here_doc { print; next } -/< 0 && /^[[:space:]]+echo/ { - If_rewritten = 1 - rewrite_echo_line() -} - -In_main_case && /^[[:space:]]+exit ;;$/ && If_rewritten { - If_rewritten = 0 - print Indent";;" - next -} - -In_main_case && /^[[:space:]]+echo/ { - getline next_line - if (next_line !~ /^[[:space:]]+exit ;;/) { - # not the output-and-exit we seek here... - print - print next_line - next - } - - if (/-cray-/ && $3 == "|") { - # several Cray Unicos entries apply sed to the entire output in - # order to edit the UNAME_RELEASE field; fix these up - sub(/"\$UNAME_RELEASE"/, "\"$(echo &", $2) - $NF = $NF")\"" - } - - rewrite_echo_line() - if (next_line ~ /^[[:space:]]+exit ;;.+/) - sub(/^[[:space:]]+exit ;;/, ";; ", next_line) - else - sub(/^[[:space:]]+exit ;;/, ";;", next_line) - print $0 - print Indent next_line - next -} - -In_main_case && /^esac/ { - In_main_case = 0 - - print # "esac" - print "" - print "# Do we have a guess based on uname results?" - print "if test \"x$GUESS\" != x; then" - print " echo \"$GUESS\"" - print " exit" - print "fi" - - # Copy the rest of the input file - while (getline) print - nextfile -} - -{ print } diff --git a/patch-3.gawk b/patch-3.gawk deleted file mode 100755 index 7d4540d..0000000 --- a/patch-3.gawk +++ /dev/null @@ -1,99 +0,0 @@ -#!/usr/bin/gawk -f -# -*- Awk -*- - -# Automate removing unneeded quotes in variable assignments and factoring -# out some command substitutions in config.guess. - -# GPLv3+ - -BEGIN { - if (ARGC < 2) ARGV[ARGC++] = "config.guess" - - Indent = "" - In_here_doc = 0 - Factor = "BOGUS!REL" -} - -# Skip here documents -In_here_doc && $0 ~ /^[[:space:]]*EOF/ { In_here_doc = 0 } -In_here_doc { print; next } -/< 0; count--) ret = ret text - return ret -} diff --git a/patch-6.gawk b/patch-6.gawk deleted file mode 100755 index 19919d9..0000000 --- a/patch-6.gawk +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/gawk -f -# -*- Awk -*- - -# Automate reversion of $( ) substitutions to classic `` form. - -# GPLv3+ - -BEGIN { - if (ARGC < 2) ARGV[ARGC++] = "config.guess" -} - -# fix a special case of forgotten quotes -/\$\(\$dummy\)/ { sub(/\$\(\$dummy\)/, "$(\"$dummy\")") } - -/\$\( \(/ { $0 = gensub(/\$\( (\([^()]+\)[^()]*)\)/, "`\\1`", "g") } -/\$\(/ { $0 = gensub(/\$\(([^()]+)\)/, "`\\1`", "g") } - -/\$\( \(.*'/ { $0 = gensub(/\$\( (\([^()]+'[^']+'[^()]*\)[^()]*)\)/, "`\\1`", "g") } -/\$\(.*'/ { $0 = gensub(/\$\(([^()]+'[^']+'[^()]*)\)/, "`\\1`", "g") } - -{ print } -- 2.17.1 From MAILER-DAEMON Wed May 26 21:51:41 2021 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1lm5BV-0004uf-Hb for mharc-config-patches@gnu.org; Wed, 26 May 2021 21:51:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52484) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lm5BJ-0004cx-95 for config-patches@gnu.org; Wed, 26 May 2021 21:51:30 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:55108) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lm5BI-0003pn-Tc for config-patches@gnu.org; Wed, 26 May 2021 21:51:28 -0400 Received: from jcb by fencepost.gnu.org with local (Exim 4.90_1) (envelope-from ) id 1lm5BH-0001CE-PJ for config-patches@gnu.org; Wed, 26 May 2021 21:51:28 -0400 Message-Id: <9313419ee0802f92d29ceaf510b4dbfe1310040b.1622078762.git.jcb@gnu.org> In-Reply-To: References: From: Jacob Bachmeyer Date: Mon, 24 May 2021 23:27:42 -0500 Subject: [PATCH v2 2/8] config.guess: manual fixups after previous automatic patch To: config-patches@gnu.org X-BeenThere: config-patches@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Patches for the config.guess and config.sub scripts" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 May 2021 01:51:30 -0000 This patch adjusts a few "leftover" cases that the tool could not easily recognize and fixes comment indentation in a few other special cases. --- config.guess | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/config.guess b/config.guess index 00240ae..f97d7ff 100644 --- a/config.guess +++ b/config.guess @@ -400,8 +400,9 @@ case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case $(/usr/bin/uname -p) in - sparc) echo sparc-icl-nx7; exit ;; - esac ;; + sparc) GUESS=sparc-icl-nx7 ;; + esac + ;; s390x:SunOS:*:*) GUESS="$UNAME_MACHINE"-ibm-solaris2"$(echo "$UNAME_RELEASE" | sed -e 's/[^.]*//')" ;; @@ -453,13 +454,13 @@ case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3 case $(/bin/arch) in sun3) - echo m68k-sun-sunos"$UNAME_RELEASE" + GUESS=m68k-sun-sunos"$UNAME_RELEASE" ;; sun4) - echo sparc-sun-sunos"$UNAME_RELEASE" + GUESS=sparc-sun-sunos"$UNAME_RELEASE" ;; esac - exit ;; + ;; aushp:SunOS:*:*) GUESS=sparc-auspex-sunos"$UNAME_RELEASE" ;; @@ -590,7 +591,7 @@ EOF GUESS=mips-sgi-irix"$(echo "$UNAME_RELEASE"|sed -e 's/-/_/g')" ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. - GUESS=romp-ibm-aix # uname -m gives an 8 hex-code CPU id + GUESS=romp-ibm-aix # uname -m gives an 8 hex-code CPU id ;; # Note that: echo "'$(uname -s)'" gives 'AIX ' i*86:AIX:*:*) GUESS=i386-ibm-aix @@ -1075,11 +1076,11 @@ EOF parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case $(grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2) in - PA7*) echo hppa1.1-unknown-linux-"$LIBC" ;; - PA8*) echo hppa2.0-unknown-linux-"$LIBC" ;; - *) echo hppa-unknown-linux-"$LIBC" ;; + PA7*) GUESS=hppa1.1-unknown-linux-$LIBC ;; + PA8*) GUESS=hppa2.0-unknown-linux-$LIBC ;; + *) GUESS=hppa-unknown-linux-$LIBC ;; esac - exit ;; + ;; ppc64:Linux:*:*) GUESS=powerpc64-unknown-linux-"$LIBC" ;; @@ -1217,7 +1218,7 @@ EOF if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then GUESS=i860-stardent-sysv"$UNAME_RELEASE" # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. - GUESS=i860-unknown-sysv"$UNAME_RELEASE" # Unknown i860-SVR4 + GUESS=i860-unknown-sysv"$UNAME_RELEASE" # Unknown i860-SVR4 fi ;; mini*:CTIX:SYS*5:*) @@ -1474,9 +1475,9 @@ EOF *:*VMS:*:*) UNAME_MACHINE=$( (uname -p) 2>/dev/null) case $UNAME_MACHINE in - A*) echo alpha-dec-vms ; exit ;; - I*) echo ia64-dec-vms ; exit ;; - V*) echo vax-dec-vms ; exit ;; + A*) GUESS=alpha-dec-vms ;; + I*) GUESS=ia64-dec-vms ;; + V*) GUESS=vax-dec-vms ;; esac ;; *:XENIX:*:SysV) GUESS=i386-pc-xenix -- 2.17.1 From MAILER-DAEMON Wed May 26 21:51:41 2021 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1lm5BV-0004vU-Ph for mharc-config-patches@gnu.org; Wed, 26 May 2021 21:51:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52500) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lm5BM-0004dx-EL for config-patches@gnu.org; Wed, 26 May 2021 21:51:33 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:55114) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lm5BM-0003rr-7U for config-patches@gnu.org; Wed, 26 May 2021 21:51:32 -0400 Received: from jcb by fencepost.gnu.org with local (Exim 4.90_1) (envelope-from ) id 1lm5BK-0001Cc-A0 for config-patches@gnu.org; Wed, 26 May 2021 21:51:30 -0400 Message-Id: <303441bccd29ae4ec5e13829ea5a0b9488bcf505.1622078762.git.jcb@gnu.org> In-Reply-To: References: From: Jacob Bachmeyer Date: Tue, 25 May 2021 22:43:34 -0500 Subject: [PATCH v2 5/8] config.guess: manual fixup after previous automated patches To: config-patches@gnu.org X-BeenThere: config-patches@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Patches for the config.guess and config.sub scripts" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 May 2021 01:51:34 -0000 This patch provides the special handling for the GNU system. As these were two small and unique edits, they were not included in the scripts. This patch also cleans up other minor issues that must be addressed before reverting to classic command substitutions and updates "shellcheck" directives to account for changes in this script and the change in "shellcheck" towards reporting individual portability issues. --- config.guess | 32 +++++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/config.guess b/config.guess index d2bdee7..4bc8157 100755 --- a/config.guess +++ b/config.guess @@ -2,6 +2,8 @@ # Attempt to guess a canonical system name. # Copyright 1992-2021 Free Software Foundation, Inc. +# shellcheck disable=SC2006,SC2268 # see below for rationale + timestamp='2021-05-24' # This file is free software; you can redistribute it and/or modify it @@ -32,6 +34,14 @@ timestamp='2021-05-24' # Please send patches to . +# The "shellcheck disable" line above the timestamp inhibits complaints +# about features and limitations of the classic Bourne shell that were +# superseded or lifted in POSIX. However, this script identifies a wide +# variety of pre-POSIX systems that do not have POSIX shells at all, and +# even some reasonably current systems (Solaris 10 as case-in-point) still +# have a pre-POSIX /bin/sh. + + me=$(echo "$0" | sed -e 's,.*/,,') usage="\ @@ -105,7 +115,7 @@ set_cc_for_build() { # prevent multiple calls if $tmp is already set test "$tmp" && return 0 : "${TMPDIR=/tmp}" - # shellcheck disable=SC2039 + # shellcheck disable=SC2039,SC3028 { tmp=$( (umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null) && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir "$tmp" 2>/dev/null) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } || @@ -160,7 +170,8 @@ Linux|GNU|GNU/*) #endif #endif EOF - eval "$($CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g')" + cc_set_libc=$($CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g') + eval "$cc_set_libc" # Second heuristic to detect musl libc. if [ "$LIBC" = unknown ] && @@ -943,11 +954,15 @@ EOF ;; *:GNU:*:*) # the GNU system - GUESS="$(echo "$UNAME_MACHINE" | sed -e 's,[-/].*$,,')-unknown-$LIBC$(echo "$UNAME_RELEASE" | sed -e 's,/.*$,,')" + GNU_ARCH=$(echo "$UNAME_MACHINE" | sed -e 's,[-/].*$,,') + GNU_REL=$(echo "$UNAME_RELEASE" | sed -e 's,/.*$,,') + GUESS=$GNU_ARCH-unknown-$LIBC$GNU_REL ;; *:GNU/*:*:*) # other systems with GNU libc and userland - GUESS="$UNAME_MACHINE-unknown-$(echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]")$(echo "$UNAME_RELEASE" | sed -e 's/[-(].*//')-$LIBC" + GNU_SYS=$(echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]") + GNU_REL=$(echo "$UNAME_RELEASE" | sed -e 's/[-(].*//') + GUESS=$UNAME_MACHINE-unknown-$GNU_SYS$GNU_REL-$LIBC ;; *:Minix:*:*) GUESS=$UNAME_MACHINE-unknown-minix @@ -1072,7 +1087,8 @@ EOF #endif #endif EOF - eval "$($CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI')" + cc_set_vars=$($CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI') + eval "$cc_set_vars" test "x$CPU" != x && { echo "$CPU${MIPS_ENDIAN}-unknown-linux-$LIBCABI"; exit; } ;; mips64el:Linux:*:*) @@ -1688,9 +1704,11 @@ and https://git.savannah.gnu.org/cgit/config.git/plain/config.sub EOF -year=$(echo $timestamp | sed 's,-.*,,') +our_year=$(echo $timestamp | sed 's,-.*,,') +thisyear=$(date +%Y) # shellcheck disable=SC2003 -if test "$(expr "$(date +%Y)" - "$year")" -lt 3 ; then +script_age=$(expr "$thisyear" - "$our_year") +if test "$script_age" -lt 3 ; then cat >&2 <) id 1lm5BN-0004dz-1d for config-patches@gnu.org; Wed, 26 May 2021 21:51:33 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:55118) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lm5BM-0003sZ-RA for config-patches@gnu.org; Wed, 26 May 2021 21:51:32 -0400 Received: from jcb by fencepost.gnu.org with local (Exim 4.90_1) (envelope-from ) id 1lm5BM-0001Cu-9y for config-patches@gnu.org; Wed, 26 May 2021 21:51:32 -0400 Message-Id: In-Reply-To: References: From: Jacob Bachmeyer Date: Tue, 25 May 2021 23:59:02 -0500 Subject: [PATCH v2 7/8] config.guess: manual fixups after previous automatic patch To: config-patches@gnu.org X-BeenThere: config-patches@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Patches for the config.guess and config.sub scripts" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 May 2021 01:51:34 -0000 The tool could not handle command substitutions that span lines, but fortunately there were only two such substitutions in the script. The test for which universe is active on Pyramid is rewritten into a case block because it was the only use of a command substitution as an argument to the test command, which would require quoting. * config.guess: rewrite "if" for Pyramid systems to "case" --- config.guess | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/config.guess b/config.guess index 57ac15a..89d2daa 100755 --- a/config.guess +++ b/config.guess @@ -202,10 +202,10 @@ case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". - UNAME_MACHINE_ARCH=$( (uname -p 2>/dev/null || \ + UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ /sbin/sysctl -n hw.machine_arch 2>/dev/null || \ /usr/sbin/sysctl -n hw.machine_arch 2>/dev/null || \ - echo unknown)) + echo unknown)` case $UNAME_MACHINE_ARCH in aarch64eb) machine=aarch64_be-unknown ;; armeb) machine=armeb-unknown ;; @@ -398,11 +398,10 @@ case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. - if test "`(/bin/universe) 2>/dev/null`" = att ; then - GUESS=pyramid-pyramid-sysv3 - else - GUESS=pyramid-pyramid-bsd - fi + case `(/bin/universe) 2>/dev/null` in + att) GUESS=pyramid-pyramid-sysv3 ;; + *) GUESS=pyramid-pyramid-bsd ;; + esac ;; NILE*:*:*:dcosx) GUESS=pyramid-pyramid-svr4 @@ -657,8 +656,8 @@ EOF IBM_ARCH=powerpc fi if test -x /usr/bin/lslpp ; then - IBM_REV=$(/usr/bin/lslpp -Lqc bos.rte.libc | - awk -F: '{ print $3 }' | sed s/[0-9]*$/0/) + IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | \ + awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` else IBM_REV=$UNAME_VERSION.$UNAME_RELEASE fi -- 2.17.1 From MAILER-DAEMON Wed May 26 21:51:44 2021 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1lm5BY-00056d-6Q for mharc-config-patches@gnu.org; Wed, 26 May 2021 21:51:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52502) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lm5BM-0004dy-IR for config-patches@gnu.org; Wed, 26 May 2021 21:51:33 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:55116) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lm5BM-0003rx-Au for config-patches@gnu.org; Wed, 26 May 2021 21:51:32 -0400 Received: from jcb by fencepost.gnu.org with local (Exim 4.90_1) (envelope-from ) id 1lm5BM-0001Cn-6m for config-patches@gnu.org; Wed, 26 May 2021 21:51:32 -0400 Message-Id: <02b08eb32d35a4a7955a410fc483f7f9f18a94e0.1622078762.git.jcb@gnu.org> In-Reply-To: References: From: Jacob Bachmeyer Date: Tue, 25 May 2021 23:47:05 -0500 Subject: [PATCH v2 6/8] config.guess: replace POSIX $( ) with classic ` ` throughout To: config-patches@gnu.org X-BeenThere: config-patches@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Patches for the config.guess and config.sub scripts" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 May 2021 01:51:34 -0000 The previous replacement of backticks with POSIX command substitutions was ill-considered and illogical: this script recognizes many archaic machine types that probably never had POSIX shells, therefore it needs to be able to run successfully under pre-POSIX shells. This patch was generated using the included GNU Awk program. * config.guess: revert POSIX command substitutions to classic form --- config.guess | 194 +++++++++++++++++++++++++-------------------------- patch-6.gawk | 21 ++++++ 2 files changed, 118 insertions(+), 97 deletions(-) create mode 100755 patch-6.gawk diff --git a/config.guess b/config.guess index 4bc8157..57ac15a 100755 --- a/config.guess +++ b/config.guess @@ -42,7 +42,7 @@ timestamp='2021-05-24' # have a pre-POSIX /bin/sh. -me=$(echo "$0" | sed -e 's,.*/,,') +me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] @@ -116,7 +116,7 @@ set_cc_for_build() { test "$tmp" && return 0 : "${TMPDIR=/tmp}" # shellcheck disable=SC2039,SC3028 - { tmp=$( (umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null) && test -n "$tmp" && test -d "$tmp" ; } || + { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir "$tmp" 2>/dev/null) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } @@ -144,10 +144,10 @@ if test -f /.attbin/uname ; then PATH=$PATH:/.attbin ; export PATH fi -UNAME_MACHINE=$( (uname -m) 2>/dev/null) || UNAME_MACHINE=unknown -UNAME_RELEASE=$( (uname -r) 2>/dev/null) || UNAME_RELEASE=unknown -UNAME_SYSTEM=$( (uname -s) 2>/dev/null) || UNAME_SYSTEM=unknown -UNAME_VERSION=$( (uname -v) 2>/dev/null) || UNAME_VERSION=unknown +UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown +UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown +UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown case $UNAME_SYSTEM in Linux|GNU|GNU/*) @@ -170,7 +170,7 @@ Linux|GNU|GNU/*) #endif #endif EOF - cc_set_libc=$($CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g') + cc_set_libc=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` eval "$cc_set_libc" # Second heuristic to detect musl libc. @@ -214,8 +214,8 @@ case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; earmv*) - arch=$(echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,') - endian=$(echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p') + arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'` + endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'` machine=${arch}${endian}-unknown ;; *) machine=$UNAME_MACHINE_ARCH-unknown ;; @@ -246,7 +246,7 @@ case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in case $UNAME_MACHINE_ARCH in earm*) expr='s/^earmv[0-9]/-eabi/;s/eb$//' - abi=$(echo "$UNAME_MACHINE_ARCH" | sed -e "$expr") + abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"` ;; esac # The OS release @@ -259,7 +259,7 @@ case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in release='-gnu' ;; *) - release=$(echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2) + release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: @@ -268,19 +268,19 @@ case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in GUESS=$machine-${os}${release}${abi-} ;; *:Bitrig:*:*) - UNAME_MACHINE_ARCH=$(arch | sed 's/Bitrig.//') + UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` GUESS=$UNAME_MACHINE_ARCH-unknown-bitrig$UNAME_RELEASE ;; *:OpenBSD:*:*) - UNAME_MACHINE_ARCH=$(arch | sed 's/OpenBSD.//') + UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` GUESS=$UNAME_MACHINE_ARCH-unknown-openbsd$UNAME_RELEASE ;; *:SecBSD:*:*) - UNAME_MACHINE_ARCH=$(arch | sed 's/SecBSD.//') + UNAME_MACHINE_ARCH=`arch | sed 's/SecBSD.//'` GUESS=$UNAME_MACHINE_ARCH-unknown-secbsd$UNAME_RELEASE ;; *:LibertyBSD:*:*) - UNAME_MACHINE_ARCH=$(arch | sed 's/^.*BSD\.//') + UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` GUESS=$UNAME_MACHINE_ARCH-unknown-libertybsd$UNAME_RELEASE ;; *:MidnightBSD:*:*) @@ -318,17 +318,17 @@ case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in trap '' 0 case $UNAME_RELEASE in *4.0) - UNAME_RELEASE=$(/usr/sbin/sizer -v | awk '{print $3}') + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) - UNAME_RELEASE=$(/usr/sbin/sizer -v | awk '{print $4}') + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. - ALPHA_CPU_TYPE=$(/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1) + ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case $ALPHA_CPU_TYPE in "EV4 (21064)") UNAME_MACHINE=alpha ;; @@ -366,7 +366,7 @@ case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. - OSF_REL=$(echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz) + OSF_REL=`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` GUESS=$UNAME_MACHINE-dec-osf$OSF_REL ;; Amiga*:UNIX_System_V:4.0:*) @@ -398,7 +398,7 @@ case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. - if test "$( (/bin/universe) 2>/dev/null)" = att ; then + if test "`(/bin/universe) 2>/dev/null`" = att ; then GUESS=pyramid-pyramid-sysv3 else GUESS=pyramid-pyramid-bsd @@ -411,20 +411,20 @@ case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in GUESS=sparc-icl-nx6 ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) - case $(/usr/bin/uname -p) in + case `/usr/bin/uname -p` in sparc) GUESS=sparc-icl-nx7 ;; esac ;; s390x:SunOS:*:*) - SUN_REL=$(echo "$UNAME_RELEASE" | sed -e 's/[^.]*//') + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` GUESS=$UNAME_MACHINE-ibm-solaris2$SUN_REL ;; sun4H:SunOS:5.*:*) - SUN_REL=$(echo "$UNAME_RELEASE" | sed -e 's/[^.]*//') + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` GUESS=sparc-hal-solaris2$SUN_REL ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) - SUN_REL=$(echo "$UNAME_RELEASE" | sed -e 's/[^.]*//') + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` GUESS=sparc-sun-solaris2$SUN_REL ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) @@ -444,33 +444,33 @@ case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in SUN_ARCH=x86_64 fi fi - SUN_REL=$(echo "$UNAME_RELEASE" | sed -e 's/[^.]*//') + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` GUESS=$SUN_ARCH-pc-solaris2$SUN_REL ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. - SUN_REL=$(echo "$UNAME_RELEASE" | sed -e 's/[^.]*//') + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` GUESS=sparc-sun-solaris3$SUN_REL ;; sun4*:SunOS:*:*) - case $(/usr/bin/arch -k) in + case `/usr/bin/arch -k` in Series*|S4*) - UNAME_RELEASE=$(uname -v) + UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. - SUN_REL=$(echo "$UNAME_RELEASE" | sed -e 's/-/_/') + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/'` GUESS=sparc-sun-sunos$SUN_REL ;; sun3*:SunOS:*:*) GUESS=m68k-sun-sunos$UNAME_RELEASE ;; sun*:*:4.2BSD:*) - UNAME_RELEASE=$( (sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null) + UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3 - case $(/bin/arch) in + case `/bin/arch` in sun3) GUESS=m68k-sun-sunos$UNAME_RELEASE ;; @@ -550,8 +550,8 @@ case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in } EOF $CC_FOR_BUILD -o "$dummy" "$dummy.c" && - dummyarg=$(echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p') && - SYSTEM_NAME=$("$dummy" "$dummyarg") && + dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` && + SYSTEM_NAME=`"$dummy" "$dummyarg"` && { echo "$SYSTEM_NAME"; exit; } GUESS=mips-mips-riscos$UNAME_RELEASE ;; @@ -578,7 +578,7 @@ EOF ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures - UNAME_PROCESSOR=$(/usr/bin/uname -p) + UNAME_PROCESSOR=`/usr/bin/uname -p` if test "$UNAME_PROCESSOR" = mc88100 || test "$UNAME_PROCESSOR" = mc88110 then if test "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx || \ @@ -606,18 +606,18 @@ EOF GUESS=m68k-tektronix-bsd ;; *:IRIX*:*:*) - IRIX_REL=$(echo "$UNAME_RELEASE" | sed -e 's/-/_/g') + IRIX_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/g'` GUESS=mips-sgi-irix$IRIX_REL ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. GUESS=romp-ibm-aix # uname -m gives an 8 hex-code CPU id - ;; # Note that: echo "'$(uname -s)'" gives 'AIX ' + ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) GUESS=i386-ibm-aix ;; ia64:AIX:*:*) if test -x /usr/bin/oslevel ; then - IBM_REV=$(/usr/bin/oslevel) + IBM_REV=`/usr/bin/oslevel` else IBM_REV=$UNAME_VERSION.$UNAME_RELEASE fi @@ -637,7 +637,7 @@ EOF exit(0); } EOF - if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=$("$dummy") + if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` then GUESS=$SYSTEM_NAME else @@ -650,7 +650,7 @@ EOF fi ;; *:AIX:*:[4567]) - IBM_CPU_ID=$(/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }') + IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else @@ -686,14 +686,14 @@ EOF GUESS=m68k-hp-bsd4.4 ;; 9000/[34678]??:HP-UX:*:*) - HPUX_REV=$(echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//') + HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'` case $UNAME_MACHINE in 9000/31?) HP_ARCH=m68000 ;; 9000/[34]??) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if test -x /usr/bin/getconf; then - sc_cpu_version=$(/usr/bin/getconf SC_CPU_VERSION 2>/dev/null) - sc_kernel_bits=$(/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null) + sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case $sc_cpu_version in 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1 @@ -740,7 +740,7 @@ EOF exit (0); } EOF - (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=$("$dummy") + (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac @@ -768,7 +768,7 @@ EOF GUESS=$HP_ARCH-hp-hpux$HPUX_REV ;; ia64:HP-UX:*:*) - HPUX_REV=$(echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//') + HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'` GUESS=ia64-hp-hpux$HPUX_REV ;; 3050*:HI-UX:*:*) @@ -798,7 +798,7 @@ EOF exit (0); } EOF - $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=$("$dummy") && + $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` && { echo "$SYSTEM_NAME"; exit; } GUESS=unknown-hitachi-hiuxwe2 ;; @@ -846,7 +846,7 @@ EOF GUESS=c4-convex-bsd ;; CRAY*Y-MP:*:*:*) - CRAY_REL=$(echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/') + CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` GUESS=ymp-cray-unicos$CRAY_REL ;; CRAY*[A-Z]90:*:*:*) @@ -856,30 +856,30 @@ EOF -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) - CRAY_REL=$(echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/') + CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` GUESS=t90-cray-unicos$CRAY_REL ;; CRAY*T3E:*:*:*) - CRAY_REL=$(echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/') + CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` GUESS=alphaev5-cray-unicosmk$CRAY_REL ;; CRAY*SV1:*:*:*) - CRAY_REL=$(echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/') + CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` GUESS=sv1-cray-unicos$CRAY_REL ;; *:UNICOS/mp:*:*) - CRAY_REL=$(echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/') + CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` GUESS=craynv-cray-unicosmp$CRAY_REL ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) - FUJITSU_PROC=$(uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz) - FUJITSU_SYS=$(uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///') - FUJITSU_REL=$(echo "$UNAME_RELEASE" | sed -e 's/ /_/') + FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` + FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` + FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'` GUESS=${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL} ;; 5000:UNIX_System_V:4.*:*) - FUJITSU_SYS=$(uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///') - FUJITSU_REL=$(echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/') + FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` + FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` GUESS=sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL} ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) @@ -892,27 +892,27 @@ EOF GUESS=$UNAME_MACHINE-unknown-bsdi$UNAME_RELEASE ;; arm:FreeBSD:*:*) - UNAME_PROCESSOR=$(uname -p) + UNAME_PROCESSOR=`uname -p` set_cc_for_build if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then - FREEBSD_REL=$(echo "$UNAME_RELEASE" | sed -e 's/[-(].*//') + FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabi else - FREEBSD_REL=$(echo "$UNAME_RELEASE" | sed -e 's/[-(].*//') + FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabihf fi ;; *:FreeBSD:*:*) - UNAME_PROCESSOR=$(/usr/bin/uname -p) + UNAME_PROCESSOR=`/usr/bin/uname -p` case $UNAME_PROCESSOR in amd64) UNAME_PROCESSOR=x86_64 ;; i386) UNAME_PROCESSOR=i586 ;; esac - FREEBSD_REL=$(echo "$UNAME_RELEASE" | sed -e 's/[-(].*//') + FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL ;; i*:CYGWIN*:*) @@ -949,19 +949,19 @@ EOF GUESS=x86_64-pc-cygwin ;; prep*:SunOS:5.*:*) - SUN_REL=$(echo "$UNAME_RELEASE" | sed -e 's/[^.]*//') + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` GUESS=powerpcle-unknown-solaris2$SUN_REL ;; *:GNU:*:*) # the GNU system - GNU_ARCH=$(echo "$UNAME_MACHINE" | sed -e 's,[-/].*$,,') - GNU_REL=$(echo "$UNAME_RELEASE" | sed -e 's,/.*$,,') + GNU_ARCH=`echo "$UNAME_MACHINE" | sed -e 's,[-/].*$,,'` + GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's,/.*$,,'` GUESS=$GNU_ARCH-unknown-$LIBC$GNU_REL ;; *:GNU/*:*:*) # other systems with GNU libc and userland - GNU_SYS=$(echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]") - GNU_REL=$(echo "$UNAME_RELEASE" | sed -e 's/[-(].*//') + GNU_SYS=`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"` + GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` GUESS=$UNAME_MACHINE-unknown-$GNU_SYS$GNU_REL-$LIBC ;; *:Minix:*:*) @@ -975,7 +975,7 @@ EOF GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; alpha:Linux:*:*) - case $(sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null) in + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; @@ -1087,7 +1087,7 @@ EOF #endif #endif EOF - cc_set_vars=$($CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI') + cc_set_vars=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI'` eval "$cc_set_vars" test "x$CPU" != x && { echo "$CPU${MIPS_ENDIAN}-unknown-linux-$LIBCABI"; exit; } ;; @@ -1108,7 +1108,7 @@ EOF ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level - case $(grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2) in + case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) GUESS=hppa1.1-unknown-linux-$LIBC ;; PA8*) GUESS=hppa2.0-unknown-linux-$LIBC ;; *) GUESS=hppa-unknown-linux-$LIBC ;; @@ -1198,7 +1198,7 @@ EOF GUESS=$UNAME_MACHINE-pc-msdosdjgpp ;; i*86:*:4.*:*) - UNAME_REL=$(echo "$UNAME_RELEASE" | sed 's/\/MP$//') + UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then GUESS=$UNAME_MACHINE-univel-sysv$UNAME_REL else @@ -1207,7 +1207,7 @@ EOF ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. - case $(/bin/uname -X | grep "^Machine") in + case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; @@ -1216,10 +1216,10 @@ EOF ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then - UNAME_REL=$(sed -n 's/.*Version //p' /dev/null >/dev/null ; then - UNAME_REL=$( (/bin/uname -X|grep Release|sed -e 's/.*= //')) + UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 @@ -1269,7 +1269,7 @@ EOF 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ - && OS_REL=.$(sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid) + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ @@ -1280,7 +1280,7 @@ EOF NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ - && OS_REL=.$(sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid) + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ @@ -1313,7 +1313,7 @@ EOF ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then - UNAME_MACHINE=$( (uname -p) 2>/dev/null) + UNAME_MACHINE=`(uname -p) 2>/dev/null` GUESS=$UNAME_MACHINE-sni-sysv4 else GUESS=ns32k-sni-sysv @@ -1399,7 +1399,7 @@ EOF GUESS=aarch64-apple-darwin$UNAME_RELEASE ;; *:Darwin:*:*) - UNAME_PROCESSOR=$(uname -p) + UNAME_PROCESSOR=`uname -p` case $UNAME_PROCESSOR in unknown) UNAME_PROCESSOR=powerpc ;; esac @@ -1436,7 +1436,7 @@ EOF GUESS=$UNAME_PROCESSOR-apple-darwin$UNAME_RELEASE ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) - UNAME_PROCESSOR=$(uname -p) + UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = x86; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc @@ -1503,11 +1503,11 @@ EOF GUESS=mips-sei-seiux$UNAME_RELEASE ;; *:DragonFly:*:*) - DRAGONFLY_REL=$(echo "$UNAME_RELEASE" | sed -e 's/[-(].*//') + DRAGONFLY_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` GUESS=$UNAME_MACHINE-unknown-dragonfly$DRAGONFLY_REL ;; *:*VMS:*:*) - UNAME_MACHINE=$( (uname -p) 2>/dev/null) + UNAME_MACHINE=`(uname -p) 2>/dev/null` case $UNAME_MACHINE in A*) GUESS=alpha-dec-vms ;; I*) GUESS=ia64-dec-vms ;; @@ -1517,7 +1517,7 @@ EOF GUESS=i386-pc-xenix ;; i*86:skyos:*:*) - SKYOS_REL=$(echo "$UNAME_RELEASE" | sed -e 's/ .*$//') + SKYOS_REL=`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'` GUESS=$UNAME_MACHINE-pc-skyos$SKYOS_REL ;; i*86:rdos:*:*) @@ -1582,7 +1582,7 @@ main () #define __ARCHITECTURE__ "m68k" #endif int version; - version=$( (hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null); + version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else @@ -1674,7 +1674,7 @@ main () } EOF -$CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null && SYSTEM_NAME=$($dummy) && +$CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null && SYSTEM_NAME=`"$dummy"` && { echo "$SYSTEM_NAME"; exit; } # Apollos put the system type in the environment. @@ -1704,10 +1704,10 @@ and https://git.savannah.gnu.org/cgit/config.git/plain/config.sub EOF -our_year=$(echo $timestamp | sed 's,-.*,,') -thisyear=$(date +%Y) +our_year=`echo $timestamp | sed 's,-.*,,'` +thisyear=`date +%Y` # shellcheck disable=SC2003 -script_age=$(expr "$thisyear" - "$our_year") +script_age=`expr "$thisyear" - "$our_year"` if test "$script_age" -lt 3 ; then cat >&2 </dev/null || echo unknown) -uname -r = $( (uname -r) 2>/dev/null || echo unknown) -uname -s = $( (uname -s) 2>/dev/null || echo unknown) -uname -v = $( (uname -v) 2>/dev/null || echo unknown) +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` -/usr/bin/uname -p = $( (/usr/bin/uname -p) 2>/dev/null) -/bin/uname -X = $( (/bin/uname -X) 2>/dev/null) +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null` -hostinfo = $( (hostinfo) 2>/dev/null) -/bin/universe = $( (/bin/universe) 2>/dev/null) -/usr/bin/arch -k = $( (/usr/bin/arch -k) 2>/dev/null) -/bin/arch = $( (/bin/arch) 2>/dev/null) -/usr/bin/oslevel = $( (/usr/bin/oslevel) 2>/dev/null) -/usr/convex/getsysinfo = $( (/usr/convex/getsysinfo) 2>/dev/null) +hostinfo = `(hostinfo) 2>/dev/null` +/bin/universe = `(/bin/universe) 2>/dev/null` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` +/bin/arch = `(/bin/arch) 2>/dev/null` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = "$UNAME_MACHINE" UNAME_RELEASE = "$UNAME_RELEASE" diff --git a/patch-6.gawk b/patch-6.gawk new file mode 100755 index 0000000..19919d9 --- /dev/null +++ b/patch-6.gawk @@ -0,0 +1,21 @@ +#!/usr/bin/gawk -f +# -*- Awk -*- + +# Automate reversion of $( ) substitutions to classic `` form. + +# GPLv3+ + +BEGIN { + if (ARGC < 2) ARGV[ARGC++] = "config.guess" +} + +# fix a special case of forgotten quotes +/\$\(\$dummy\)/ { sub(/\$\(\$dummy\)/, "$(\"$dummy\")") } + +/\$\( \(/ { $0 = gensub(/\$\( (\([^()]+\)[^()]*)\)/, "`\\1`", "g") } +/\$\(/ { $0 = gensub(/\$\(([^()]+)\)/, "`\\1`", "g") } + +/\$\( \(.*'/ { $0 = gensub(/\$\( (\([^()]+'[^']+'[^()]*\)[^()]*)\)/, "`\\1`", "g") } +/\$\(.*'/ { $0 = gensub(/\$\(([^()]+'[^']+'[^()]*)\)/, "`\\1`", "g") } + +{ print } -- 2.17.1 From MAILER-DAEMON Wed May 26 22:42:53 2021 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1lm5z3-0004vY-9w for mharc-config-patches@gnu.org; Wed, 26 May 2021 22:42:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59754) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lm5z1-0004v3-0T for config-patches@gnu.org; Wed, 26 May 2021 22:42:51 -0400 Received: from mail-ot1-x333.google.com ([2607:f8b0:4864:20::333]:33330) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lm5yz-0002Zz-C7; Wed, 26 May 2021 22:42:50 -0400 Received: by mail-ot1-x333.google.com with SMTP id i23-20020a9d68d70000b02902dc19ed4c15so3082121oto.0; Wed, 26 May 2021 19:42:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:date:from:reply-to:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-transfer-encoding; bh=4LoWX2qXmkPt0GD8P9D3ycL8I6n1ZN6UhcwZ8YzXGZQ=; b=h/jBLU3NJnFXy9656B62jq8m8t4ZpFXVrie23yk8Q1+Q7jg6pjdmLF32jCND3RQsWT ZwMF91Lxa7bYI0hrsfAsmAiu6T99Q5sHr81FUKHjds9WH/tSmPlPaVZCfRevx7Q8Mum5 NMC+5kR2ggTvj0Qm2mFui2aQQrvxu8Icv2jpKJoWhmSukrBrtIjeQmChsjJtGRuMx6WC bF4ZygZ69rMYlxC52GoW0f+Rq31fFE/ayjPHz2XKDzEVfXWgCRhsI2CRyRW+vy3npsmY ECztpS115ZkM5O+qB6GIw6TY5P3k5Z3yrYWCbIq6NCpwADbP1gEdvAbuoEL5cyzVtAdl XSEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:date:from:reply-to:user-agent :mime-version:to:cc:subject:references:in-reply-to :content-transfer-encoding; bh=4LoWX2qXmkPt0GD8P9D3ycL8I6n1ZN6UhcwZ8YzXGZQ=; b=a0qhmPcBgIT6KMBmJNranyIKkAakIfNpsVHtqckrgS7qJvaq9G9l8mTWWSTpA7JI74 sA/2gQemgZkBVPH3Z9tUKmIelRVyYsBEOKgDas9HP7/xS0OIvhcIyJqnihX0bxp0nSSB RGovHZwm0+K4uzIMDBKlRpYFhrXch6wsvPQzcgN5Oq2UcMILawMKHJcHPTT8YabvUBGl fRXDGDzhi4VeNV+gkl63TnACei3PHn4jZZGrf2qIrnS4LAjhuGcVqVW4DCLWlU2b0233 CbcoYldSktrdps73Sqmv28VjaSxNAWTpZv84VOuF/clR1U6Oog9QhbVIKvirIYyg2RmH iNSw== X-Gm-Message-State: AOAM531YXrQn1H+B6pFDmUxHtuEuA1CWtg8MCznnyMlRRBb0NpIhxMTb 27xwpQiNNkSOXAs3fp44S1OJbG58kGFrig== X-Google-Smtp-Source: ABdhPJxqblH7VE5mAa2oGhezUEhA+gvWNudtnDd6/VuwtTeaIElKTXNqAvudNDW8ORVLah3NzRQYhg== X-Received: by 2002:a05:6830:1d64:: with SMTP id l4mr991134oti.95.1622083366750; Wed, 26 May 2021 19:42:46 -0700 (PDT) Received: from [192.168.2.42] (adsl-70-133-144-190.dsl.ablntx.sbcglobal.net. [70.133.144.190]) by smtp.gmail.com with ESMTPSA id l19sm234163otk.65.2021.05.26.19.42.46 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 26 May 2021 19:42:46 -0700 (PDT) Message-ID: <60AF0724.1020006@gmail.com> Date: Wed, 26 May 2021 21:42:44 -0500 From: Jacob Bachmeyer Reply-To: jcb62281@gmail.com User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.8.1.22) Gecko/20090807 MultiZilla/1.8.3.4e SeaMonkey/1.1.17 Mnenhy/0.7.6.0 MIME-Version: 1.0 To: Jacob Bachmeyer CC: config-patches@gnu.org Subject: Re: [PATCH v2 0/8] restore compatibility with pre-POSIX shells in config.guess References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Received-SPF: pass client-ip=2607:f8b0:4864:20::333; envelope-from=jcb62281@gmail.com; helo=mail-ot1-x333.google.com X-Spam_score_int: -15 X-Spam_score: -1.6 X-Spam_bar: - X-Spam_report: (-1.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, FREEMAIL_REPLYTO_END_DIGIT=0.25, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: config-patches@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Patches for the config.guess and config.sub scripts" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 May 2021 02:42:51 -0000 Jacob Bachmeyer wrote: > [...] > Jacob Bachmeyer (8): > config.guess: use intermediate variable with uname results > config.guess: manual fixups after previous automatic patch > config.guess: remove unneeded quotes and factor command substitutions > config.guess: automatic fixups after previous automated patch > config.guess: manual fixup after previous automated patches > config.guess: replace POSIX $( ) with classic ` ` throughout > config.guess: manual fixups after previous automatic patch > remove automatic patch generators > > config.guess | 1182 ++++++++++++++++++++++++++------------------------ > 1 file changed, 614 insertions(+), 568 deletions(-) Inexplicably, patch 1 does not seem to have reached the list, although I have tried sending it twice. Fortunately, patch 1 was an entirely automated patch and the text of the program that produced it can be extracted from patch 8 if it does not turn up after being stuck in a queue somewhere. The only important detail from the commit message on patch 1 was this ChangeLog entry: * config.guess: add GUESS variable to hold results of uname analysis -- Jacob From MAILER-DAEMON Wed May 26 23:06:30 2021 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1lm6Lu-0001XF-C7 for mharc-config-patches@gnu.org; Wed, 26 May 2021 23:06:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52482) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lm5BI-0004cX-0j for config-patches@gnu.org; Wed, 26 May 2021 21:51:30 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:55106) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lm5BH-0003ob-Q0 for config-patches@gnu.org; Wed, 26 May 2021 21:51:27 -0400 Received: from jcb by fencepost.gnu.org with local (Exim 4.90_1) (envelope-from ) id 1lm5BG-0001C1-Bc for config-patches@gnu.org; Wed, 26 May 2021 21:51:26 -0400 Message-Id: <35684fab94a63de541c18aceaaf7dbdc51daf948.1622078762.git.jcb@gnu.org> In-Reply-To: References: From: Jacob Bachmeyer Date: Mon, 24 May 2021 23:05:16 -0500 Subject: [PATCH v2 1/8] config.guess: use intermediate variable with uname results To: config-patches@gnu.org X-Mailman-Approved-At: Wed, 26 May 2021 23:06:26 -0400 X-BeenThere: config-patches@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Patches for the config.guess and config.sub scripts" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 May 2021 01:51:30 -0000 This will allow quoting to be significantly simplified in another pass through the file. This patch was generated using the included GNU Awk program. * config.guess: add GUESS variable to hold results of uname analysis * patch-1.gawk: store tool that produced automated patch --- config.guess | 949 ++++++++++++++++++++++++++------------------------- patch-1.gawk | 114 +++++++ 2 files changed, 593 insertions(+), 470 deletions(-) mode change 100755 => 100644 config.guess create mode 100755 patch-1.gawk diff --git a/config.guess b/config.guess old mode 100755 new mode 100644 index dc0a6b2..00240ae --- a/config.guess +++ b/config.guess @@ -84,6 +84,9 @@ if test $# != 0; then exit 1 fi +# just in case it came from the environment +GUESS= + # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a @@ -251,54 +254,54 @@ case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. - echo "$machine-${os}${release}${abi-}" - exit ;; + GUESS="$machine-${os}${release}${abi-}" + ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=$(arch | sed 's/Bitrig.//') - echo "$UNAME_MACHINE_ARCH"-unknown-bitrig"$UNAME_RELEASE" - exit ;; + GUESS="$UNAME_MACHINE_ARCH"-unknown-bitrig"$UNAME_RELEASE" + ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=$(arch | sed 's/OpenBSD.//') - echo "$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE" - exit ;; + GUESS="$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE" + ;; *:SecBSD:*:*) UNAME_MACHINE_ARCH=$(arch | sed 's/SecBSD.//') - echo "$UNAME_MACHINE_ARCH"-unknown-secbsd"$UNAME_RELEASE" - exit ;; + GUESS="$UNAME_MACHINE_ARCH"-unknown-secbsd"$UNAME_RELEASE" + ;; *:LibertyBSD:*:*) UNAME_MACHINE_ARCH=$(arch | sed 's/^.*BSD\.//') - echo "$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE" - exit ;; + GUESS="$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE" + ;; *:MidnightBSD:*:*) - echo "$UNAME_MACHINE"-unknown-midnightbsd"$UNAME_RELEASE" - exit ;; + GUESS="$UNAME_MACHINE"-unknown-midnightbsd"$UNAME_RELEASE" + ;; *:ekkoBSD:*:*) - echo "$UNAME_MACHINE"-unknown-ekkobsd"$UNAME_RELEASE" - exit ;; + GUESS="$UNAME_MACHINE"-unknown-ekkobsd"$UNAME_RELEASE" + ;; *:SolidBSD:*:*) - echo "$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE" - exit ;; + GUESS="$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE" + ;; *:OS108:*:*) - echo "$UNAME_MACHINE"-unknown-os108_"$UNAME_RELEASE" - exit ;; + GUESS="$UNAME_MACHINE"-unknown-os108_"$UNAME_RELEASE" + ;; macppc:MirBSD:*:*) - echo powerpc-unknown-mirbsd"$UNAME_RELEASE" - exit ;; + GUESS=powerpc-unknown-mirbsd"$UNAME_RELEASE" + ;; *:MirBSD:*:*) - echo "$UNAME_MACHINE"-unknown-mirbsd"$UNAME_RELEASE" - exit ;; + GUESS="$UNAME_MACHINE"-unknown-mirbsd"$UNAME_RELEASE" + ;; *:Sortix:*:*) - echo "$UNAME_MACHINE"-unknown-sortix - exit ;; + GUESS="$UNAME_MACHINE"-unknown-sortix + ;; *:Twizzler:*:*) - echo "$UNAME_MACHINE"-unknown-twizzler - exit ;; + GUESS="$UNAME_MACHINE"-unknown-twizzler + ;; *:Redox:*:*) - echo "$UNAME_MACHINE"-unknown-redox - exit ;; + GUESS="$UNAME_MACHINE"-unknown-redox + ;; mips:OSF1:*.*) - echo mips-dec-osf1 - exit ;; + GUESS=mips-dec-osf1 + ;; alpha:OSF1:*:*) # Reset EXIT trap before exiting to avoid spurious non-zero exit code. trap '' 0 @@ -352,65 +355,65 @@ case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. - echo "$UNAME_MACHINE"-dec-osf"$(echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz)" - exit ;; + GUESS="$UNAME_MACHINE"-dec-osf"$(echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz)" + ;; Amiga*:UNIX_System_V:4.0:*) - echo m68k-unknown-sysv4 - exit ;; + GUESS=m68k-unknown-sysv4 + ;; *:[Aa]miga[Oo][Ss]:*:*) - echo "$UNAME_MACHINE"-unknown-amigaos - exit ;; + GUESS="$UNAME_MACHINE"-unknown-amigaos + ;; *:[Mm]orph[Oo][Ss]:*:*) - echo "$UNAME_MACHINE"-unknown-morphos - exit ;; + GUESS="$UNAME_MACHINE"-unknown-morphos + ;; *:OS/390:*:*) - echo i370-ibm-openedition - exit ;; + GUESS=i370-ibm-openedition + ;; *:z/VM:*:*) - echo s390-ibm-zvmoe - exit ;; + GUESS=s390-ibm-zvmoe + ;; *:OS400:*:*) - echo powerpc-ibm-os400 - exit ;; + GUESS=powerpc-ibm-os400 + ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) - echo arm-acorn-riscix"$UNAME_RELEASE" - exit ;; + GUESS=arm-acorn-riscix"$UNAME_RELEASE" + ;; arm*:riscos:*:*|arm*:RISCOS:*:*) - echo arm-unknown-riscos - exit ;; + GUESS=arm-unknown-riscos + ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) - echo hppa1.1-hitachi-hiuxmpp - exit ;; + GUESS=hppa1.1-hitachi-hiuxmpp + ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "$( (/bin/universe) 2>/dev/null)" = att ; then - echo pyramid-pyramid-sysv3 + GUESS=pyramid-pyramid-sysv3 else - echo pyramid-pyramid-bsd + GUESS=pyramid-pyramid-bsd fi - exit ;; + ;; NILE*:*:*:dcosx) - echo pyramid-pyramid-svr4 - exit ;; + GUESS=pyramid-pyramid-svr4 + ;; DRS?6000:unix:4.0:6*) - echo sparc-icl-nx6 - exit ;; + GUESS=sparc-icl-nx6 + ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case $(/usr/bin/uname -p) in sparc) echo sparc-icl-nx7; exit ;; esac ;; s390x:SunOS:*:*) - echo "$UNAME_MACHINE"-ibm-solaris2"$(echo "$UNAME_RELEASE" | sed -e 's/[^.]*//')" - exit ;; + GUESS="$UNAME_MACHINE"-ibm-solaris2"$(echo "$UNAME_RELEASE" | sed -e 's/[^.]*//')" + ;; sun4H:SunOS:5.*:*) - echo sparc-hal-solaris2"$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*//')" - exit ;; + GUESS=sparc-hal-solaris2"$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*//')" + ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) - echo sparc-sun-solaris2"$(echo "$UNAME_RELEASE" | sed -e 's/[^.]*//')" - exit ;; + GUESS=sparc-sun-solaris2"$(echo "$UNAME_RELEASE" | sed -e 's/[^.]*//')" + ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) - echo i386-pc-auroraux"$UNAME_RELEASE" - exit ;; + GUESS=i386-pc-auroraux"$UNAME_RELEASE" + ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) set_cc_for_build SUN_ARCH=i386 @@ -425,14 +428,14 @@ case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in SUN_ARCH=x86_64 fi fi - echo "$SUN_ARCH"-pc-solaris2"$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*//')" - exit ;; + GUESS="$SUN_ARCH"-pc-solaris2"$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*//')" + ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. - echo sparc-sun-solaris3"$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*//')" - exit ;; + GUESS=sparc-sun-solaris3"$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*//')" + ;; sun4*:SunOS:*:*) case $(/usr/bin/arch -k) in Series*|S4*) @@ -440,11 +443,11 @@ case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. - echo sparc-sun-sunos"$(echo "$UNAME_RELEASE"|sed -e 's/-/_/')" - exit ;; + GUESS=sparc-sun-sunos"$(echo "$UNAME_RELEASE"|sed -e 's/-/_/')" + ;; sun3*:SunOS:*:*) - echo m68k-sun-sunos"$UNAME_RELEASE" - exit ;; + GUESS=m68k-sun-sunos"$UNAME_RELEASE" + ;; sun*:*:4.2BSD:*) UNAME_RELEASE=$( (sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null) test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3 @@ -458,8 +461,8 @@ case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in esac exit ;; aushp:SunOS:*:*) - echo sparc-auspex-sunos"$UNAME_RELEASE" - exit ;; + GUESS=sparc-auspex-sunos"$UNAME_RELEASE" + ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor @@ -469,41 +472,41 @@ case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint"$UNAME_RELEASE" - exit ;; + GUESS=m68k-atari-mint"$UNAME_RELEASE" + ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint"$UNAME_RELEASE" - exit ;; + GUESS=m68k-atari-mint"$UNAME_RELEASE" + ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) - echo m68k-atari-mint"$UNAME_RELEASE" - exit ;; + GUESS=m68k-atari-mint"$UNAME_RELEASE" + ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) - echo m68k-milan-mint"$UNAME_RELEASE" - exit ;; + GUESS=m68k-milan-mint"$UNAME_RELEASE" + ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) - echo m68k-hades-mint"$UNAME_RELEASE" - exit ;; + GUESS=m68k-hades-mint"$UNAME_RELEASE" + ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) - echo m68k-unknown-mint"$UNAME_RELEASE" - exit ;; + GUESS=m68k-unknown-mint"$UNAME_RELEASE" + ;; m68k:machten:*:*) - echo m68k-apple-machten"$UNAME_RELEASE" - exit ;; + GUESS=m68k-apple-machten"$UNAME_RELEASE" + ;; powerpc:machten:*:*) - echo powerpc-apple-machten"$UNAME_RELEASE" - exit ;; + GUESS=powerpc-apple-machten"$UNAME_RELEASE" + ;; RISC*:Mach:*:*) - echo mips-dec-mach_bsd4.3 - exit ;; + GUESS=mips-dec-mach_bsd4.3 + ;; RISC*:ULTRIX:*:*) - echo mips-dec-ultrix"$UNAME_RELEASE" - exit ;; + GUESS=mips-dec-ultrix"$UNAME_RELEASE" + ;; VAX*:ULTRIX*:*:*) - echo vax-dec-ultrix"$UNAME_RELEASE" - exit ;; + GUESS=vax-dec-ultrix"$UNAME_RELEASE" + ;; 2020:CLIX:*:* | 2430:CLIX:*:*) - echo clipper-intergraph-clix"$UNAME_RELEASE" - exit ;; + GUESS=clipper-intergraph-clix"$UNAME_RELEASE" + ;; mips:*:*:UMIPS | mips:*:*:RISCos) set_cc_for_build sed 's/^ //' << EOF > "$dummy.c" @@ -531,29 +534,29 @@ EOF dummyarg=$(echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p') && SYSTEM_NAME=$("$dummy" "$dummyarg") && { echo "$SYSTEM_NAME"; exit; } - echo mips-mips-riscos"$UNAME_RELEASE" - exit ;; + GUESS=mips-mips-riscos"$UNAME_RELEASE" + ;; Motorola:PowerMAX_OS:*:*) - echo powerpc-motorola-powermax - exit ;; + GUESS=powerpc-motorola-powermax + ;; Motorola:*:4.3:PL8-*) - echo powerpc-harris-powermax - exit ;; + GUESS=powerpc-harris-powermax + ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) - echo powerpc-harris-powermax - exit ;; + GUESS=powerpc-harris-powermax + ;; Night_Hawk:Power_UNIX:*:*) - echo powerpc-harris-powerunix - exit ;; + GUESS=powerpc-harris-powerunix + ;; m88k:CX/UX:7*:*) - echo m88k-harris-cxux7 - exit ;; + GUESS=m88k-harris-cxux7 + ;; m88k:*:4*:R4*) - echo m88k-motorola-sysv4 - exit ;; + GUESS=m88k-motorola-sysv4 + ;; m88k:*:3*:R3*) - echo m88k-motorola-sysv3 - exit ;; + GUESS=m88k-motorola-sysv3 + ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=$(/usr/bin/uname -p) @@ -562,44 +565,44 @@ EOF if test "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx || \ test "$TARGET_BINARY_INTERFACE"x = x then - echo m88k-dg-dgux"$UNAME_RELEASE" + GUESS=m88k-dg-dgux"$UNAME_RELEASE" else - echo m88k-dg-dguxbcs"$UNAME_RELEASE" + GUESS=m88k-dg-dguxbcs"$UNAME_RELEASE" fi else - echo i586-dg-dgux"$UNAME_RELEASE" + GUESS=i586-dg-dgux"$UNAME_RELEASE" fi - exit ;; + ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) - echo m88k-dolphin-sysv3 - exit ;; + GUESS=m88k-dolphin-sysv3 + ;; M88*:*:R3*:*) # Delta 88k system running SVR3 - echo m88k-motorola-sysv3 - exit ;; + GUESS=m88k-motorola-sysv3 + ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) - echo m88k-tektronix-sysv3 - exit ;; + GUESS=m88k-tektronix-sysv3 + ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) - echo m68k-tektronix-bsd - exit ;; + GUESS=m68k-tektronix-bsd + ;; *:IRIX*:*:*) - echo mips-sgi-irix"$(echo "$UNAME_RELEASE"|sed -e 's/-/_/g')" - exit ;; + GUESS=mips-sgi-irix"$(echo "$UNAME_RELEASE"|sed -e 's/-/_/g')" + ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. - echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id - exit ;; # Note that: echo "'$(uname -s)'" gives 'AIX ' + GUESS=romp-ibm-aix # uname -m gives an 8 hex-code CPU id + ;; # Note that: echo "'$(uname -s)'" gives 'AIX ' i*86:AIX:*:*) - echo i386-ibm-aix - exit ;; + GUESS=i386-ibm-aix + ;; ia64:AIX:*:*) if test -x /usr/bin/oslevel ; then IBM_REV=$(/usr/bin/oslevel) else IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" fi - echo "$UNAME_MACHINE"-ibm-aix"$IBM_REV" - exit ;; + GUESS="$UNAME_MACHINE"-ibm-aix"$IBM_REV" + ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then set_cc_for_build @@ -616,16 +619,16 @@ EOF EOF if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=$("$dummy") then - echo "$SYSTEM_NAME" + GUESS="$SYSTEM_NAME" else - echo rs6000-ibm-aix3.2.5 + GUESS=rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then - echo rs6000-ibm-aix3.2.4 + GUESS=rs6000-ibm-aix3.2.4 else - echo rs6000-ibm-aix3.2 + GUESS=rs6000-ibm-aix3.2 fi - exit ;; + ;; *:AIX:*:[4567]) IBM_CPU_ID=$(/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }') if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then @@ -639,29 +642,29 @@ EOF else IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" fi - echo "$IBM_ARCH"-ibm-aix"$IBM_REV" - exit ;; + GUESS="$IBM_ARCH"-ibm-aix"$IBM_REV" + ;; *:AIX:*:*) - echo rs6000-ibm-aix - exit ;; + GUESS=rs6000-ibm-aix + ;; ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*) - echo romp-ibm-bsd4.4 - exit ;; + GUESS=romp-ibm-bsd4.4 + ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and - echo romp-ibm-bsd"$UNAME_RELEASE" # 4.3 with uname added to - exit ;; # report: romp-ibm BSD 4.3 + GUESS=romp-ibm-bsd"$UNAME_RELEASE" # 4.3 with uname added to + ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) - echo rs6000-bull-bosx - exit ;; + GUESS=rs6000-bull-bosx + ;; DPX/2?00:B.O.S.:*:*) - echo m68k-bull-sysv3 - exit ;; + GUESS=m68k-bull-sysv3 + ;; 9000/[34]??:4.3bsd:1.*:*) - echo m68k-hp-bsd - exit ;; + GUESS=m68k-hp-bsd + ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) - echo m68k-hp-bsd4.4 - exit ;; + GUESS=m68k-hp-bsd4.4 + ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//') case $UNAME_MACHINE in @@ -742,12 +745,12 @@ EOF HP_ARCH=hppa64 fi fi - echo "$HP_ARCH"-hp-hpux"$HPUX_REV" - exit ;; + GUESS="$HP_ARCH"-hp-hpux"$HPUX_REV" + ;; ia64:HP-UX:*:*) HPUX_REV=$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//') - echo ia64-hp-hpux"$HPUX_REV" - exit ;; + GUESS=ia64-hp-hpux"$HPUX_REV" + ;; 3050*:HI-UX:*:*) set_cc_for_build sed 's/^ //' << EOF > "$dummy.c" @@ -777,36 +780,36 @@ EOF EOF $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=$("$dummy") && { echo "$SYSTEM_NAME"; exit; } - echo unknown-hitachi-hiuxwe2 - exit ;; + GUESS=unknown-hitachi-hiuxwe2 + ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*) - echo hppa1.1-hp-bsd - exit ;; + GUESS=hppa1.1-hp-bsd + ;; 9000/8??:4.3bsd:*:*) - echo hppa1.0-hp-bsd - exit ;; + GUESS=hppa1.0-hp-bsd + ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) - echo hppa1.0-hp-mpeix - exit ;; + GUESS=hppa1.0-hp-mpeix + ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*) - echo hppa1.1-hp-osf - exit ;; + GUESS=hppa1.1-hp-osf + ;; hp8??:OSF1:*:*) - echo hppa1.0-hp-osf - exit ;; + GUESS=hppa1.0-hp-osf + ;; i*86:OSF1:*:*) if test -x /usr/sbin/sysversion ; then - echo "$UNAME_MACHINE"-unknown-osf1mk + GUESS="$UNAME_MACHINE"-unknown-osf1mk else - echo "$UNAME_MACHINE"-unknown-osf1 + GUESS="$UNAME_MACHINE"-unknown-osf1 fi - exit ;; + ;; parisc*:Lites*:*:*) - echo hppa1.1-hp-lites - exit ;; + GUESS=hppa1.1-hp-lites + ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) - echo c1-convex-bsd - exit ;; + GUESS=c1-convex-bsd + ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd @@ -814,17 +817,17 @@ EOF fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) - echo c34-convex-bsd - exit ;; + GUESS=c34-convex-bsd + ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) - echo c38-convex-bsd - exit ;; + GUESS=c38-convex-bsd + ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) - echo c4-convex-bsd - exit ;; + GUESS=c4-convex-bsd + ;; CRAY*Y-MP:*:*:*) - echo ymp-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' - exit ;; + GUESS=ymp-cray-unicos"$(echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/')" + ;; CRAY*[A-Z]90:*:*:*) echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ @@ -832,48 +835,48 @@ EOF -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) - echo t90-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' - exit ;; + GUESS=t90-cray-unicos"$(echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/')" + ;; CRAY*T3E:*:*:*) - echo alphaev5-cray-unicosmk"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' - exit ;; + GUESS=alphaev5-cray-unicosmk"$(echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/')" + ;; CRAY*SV1:*:*:*) - echo sv1-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' - exit ;; + GUESS=sv1-cray-unicos"$(echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/')" + ;; *:UNICOS/mp:*:*) - echo craynv-cray-unicosmp"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' - exit ;; + GUESS=craynv-cray-unicosmp"$(echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/')" + ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=$(uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz) FUJITSU_SYS=$(uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///') FUJITSU_REL=$(echo "$UNAME_RELEASE" | sed -e 's/ /_/') - echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit ;; + GUESS="${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=$(uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///') FUJITSU_REL=$(echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/') - echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit ;; + GUESS="sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) - echo "$UNAME_MACHINE"-pc-bsdi"$UNAME_RELEASE" - exit ;; + GUESS="$UNAME_MACHINE"-pc-bsdi"$UNAME_RELEASE" + ;; sparc*:BSD/OS:*:*) - echo sparc-unknown-bsdi"$UNAME_RELEASE" - exit ;; + GUESS=sparc-unknown-bsdi"$UNAME_RELEASE" + ;; *:BSD/OS:*:*) - echo "$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE" - exit ;; + GUESS="$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE" + ;; arm:FreeBSD:*:*) UNAME_PROCESSOR=$(uname -p) set_cc_for_build if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then - echo "${UNAME_PROCESSOR}"-unknown-freebsd"$(echo ${UNAME_RELEASE}|sed -e 's/[-(].*//')"-gnueabi + GUESS="${UNAME_PROCESSOR}"-unknown-freebsd"$(echo ${UNAME_RELEASE}|sed -e 's/[-(].*//')"-gnueabi else - echo "${UNAME_PROCESSOR}"-unknown-freebsd"$(echo ${UNAME_RELEASE}|sed -e 's/[-(].*//')"-gnueabihf + GUESS="${UNAME_PROCESSOR}"-unknown-freebsd"$(echo ${UNAME_RELEASE}|sed -e 's/[-(].*//')"-gnueabihf fi - exit ;; + ;; *:FreeBSD:*:*) UNAME_PROCESSOR=$(/usr/bin/uname -p) case $UNAME_PROCESSOR in @@ -882,62 +885,62 @@ EOF i386) UNAME_PROCESSOR=i586 ;; esac - echo "$UNAME_PROCESSOR"-unknown-freebsd"$(echo "$UNAME_RELEASE"|sed -e 's/[-(].*//')" - exit ;; + GUESS="$UNAME_PROCESSOR"-unknown-freebsd"$(echo "$UNAME_RELEASE"|sed -e 's/[-(].*//')" + ;; i*:CYGWIN*:*) - echo "$UNAME_MACHINE"-pc-cygwin - exit ;; + GUESS="$UNAME_MACHINE"-pc-cygwin + ;; *:MINGW64*:*) - echo "$UNAME_MACHINE"-pc-mingw64 - exit ;; + GUESS="$UNAME_MACHINE"-pc-mingw64 + ;; *:MINGW*:*) - echo "$UNAME_MACHINE"-pc-mingw32 - exit ;; + GUESS="$UNAME_MACHINE"-pc-mingw32 + ;; *:MSYS*:*) - echo "$UNAME_MACHINE"-pc-msys - exit ;; + GUESS="$UNAME_MACHINE"-pc-msys + ;; i*:PW*:*) - echo "$UNAME_MACHINE"-pc-pw32 - exit ;; + GUESS="$UNAME_MACHINE"-pc-pw32 + ;; *:Interix*:*) case $UNAME_MACHINE in x86) - echo i586-pc-interix"$UNAME_RELEASE" - exit ;; + GUESS=i586-pc-interix"$UNAME_RELEASE" + ;; authenticamd | genuineintel | EM64T) - echo x86_64-unknown-interix"$UNAME_RELEASE" - exit ;; + GUESS=x86_64-unknown-interix"$UNAME_RELEASE" + ;; IA64) - echo ia64-unknown-interix"$UNAME_RELEASE" - exit ;; + GUESS=ia64-unknown-interix"$UNAME_RELEASE" + ;; esac ;; i*:UWIN*:*) - echo "$UNAME_MACHINE"-pc-uwin - exit ;; + GUESS="$UNAME_MACHINE"-pc-uwin + ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) - echo x86_64-pc-cygwin - exit ;; + GUESS=x86_64-pc-cygwin + ;; prep*:SunOS:5.*:*) - echo powerpcle-unknown-solaris2"$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*//')" - exit ;; + GUESS=powerpcle-unknown-solaris2"$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*//')" + ;; *:GNU:*:*) # the GNU system - echo "$(echo "$UNAME_MACHINE"|sed -e 's,[-/].*$,,')-unknown-$LIBC$(echo "$UNAME_RELEASE"|sed -e 's,/.*$,,')" - exit ;; + GUESS="$(echo "$UNAME_MACHINE"|sed -e 's,[-/].*$,,')-unknown-$LIBC$(echo "$UNAME_RELEASE"|sed -e 's,/.*$,,')" + ;; *:GNU/*:*:*) # other systems with GNU libc and userland - echo "$UNAME_MACHINE-unknown-$(echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]")$(echo "$UNAME_RELEASE"|sed -e 's/[-(].*//')-$LIBC" - exit ;; + GUESS="$UNAME_MACHINE-unknown-$(echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]")$(echo "$UNAME_RELEASE"|sed -e 's/[-(].*//')-$LIBC" + ;; *:Minix:*:*) - echo "$UNAME_MACHINE"-unknown-minix - exit ;; + GUESS="$UNAME_MACHINE"-unknown-minix + ;; aarch64:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC" + ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC" + ;; alpha:Linux:*:*) case $(sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null) in EV5) UNAME_MACHINE=alphaev5 ;; @@ -950,63 +953,63 @@ EOF esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC=gnulibc1 ; fi - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC" + ;; arc:Linux:*:* | arceb:Linux:*:* | arc64:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC" + ;; arm*:Linux:*:*) set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC" else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabi + GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC"eabi else - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabihf + GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC"eabihf fi fi - exit ;; + ;; avr32*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC" + ;; cris:Linux:*:*) - echo "$UNAME_MACHINE"-axis-linux-"$LIBC" - exit ;; + GUESS="$UNAME_MACHINE"-axis-linux-"$LIBC" + ;; crisv32:Linux:*:*) - echo "$UNAME_MACHINE"-axis-linux-"$LIBC" - exit ;; + GUESS="$UNAME_MACHINE"-axis-linux-"$LIBC" + ;; e2k:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC" + ;; frv:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC" + ;; hexagon:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC" + ;; i*86:Linux:*:*) - echo "$UNAME_MACHINE"-pc-linux-"$LIBC" - exit ;; + GUESS="$UNAME_MACHINE"-pc-linux-"$LIBC" + ;; ia64:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC" + ;; k1om:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC" + ;; loongarch32:Linux:*:* | loongarch64:Linux:*:* | loongarchx32:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC" + ;; m32r*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC" + ;; m68*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC" + ;; mips:Linux:*:* | mips64:Linux:*:*) set_cc_for_build IS_GLIBC=0 @@ -1055,20 +1058,20 @@ EOF test "x$CPU" != x && { echo "$CPU${MIPS_ENDIAN}-unknown-linux-$LIBCABI"; exit; } ;; mips64el:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC" + ;; openrisc*:Linux:*:*) - echo or1k-unknown-linux-"$LIBC" - exit ;; + GUESS=or1k-unknown-linux-"$LIBC" + ;; or32:Linux:*:* | or1k*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC" + ;; padre:Linux:*:*) - echo sparc-unknown-linux-"$LIBC" - exit ;; + GUESS=sparc-unknown-linux-"$LIBC" + ;; parisc64:Linux:*:* | hppa64:Linux:*:*) - echo hppa64-unknown-linux-"$LIBC" - exit ;; + GUESS=hppa64-unknown-linux-"$LIBC" + ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case $(grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2) in @@ -1078,38 +1081,38 @@ EOF esac exit ;; ppc64:Linux:*:*) - echo powerpc64-unknown-linux-"$LIBC" - exit ;; + GUESS=powerpc64-unknown-linux-"$LIBC" + ;; ppc:Linux:*:*) - echo powerpc-unknown-linux-"$LIBC" - exit ;; + GUESS=powerpc-unknown-linux-"$LIBC" + ;; ppc64le:Linux:*:*) - echo powerpc64le-unknown-linux-"$LIBC" - exit ;; + GUESS=powerpc64le-unknown-linux-"$LIBC" + ;; ppcle:Linux:*:*) - echo powerpcle-unknown-linux-"$LIBC" - exit ;; + GUESS=powerpcle-unknown-linux-"$LIBC" + ;; riscv32:Linux:*:* | riscv32be:Linux:*:* | riscv64:Linux:*:* | riscv64be:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC" + ;; s390:Linux:*:* | s390x:Linux:*:*) - echo "$UNAME_MACHINE"-ibm-linux-"$LIBC" - exit ;; + GUESS="$UNAME_MACHINE"-ibm-linux-"$LIBC" + ;; sh64*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC" + ;; sh*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC" + ;; sparc:Linux:*:* | sparc64:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC" + ;; tile*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC" + ;; vax:Linux:*:*) - echo "$UNAME_MACHINE"-dec-linux-"$LIBC" - exit ;; + GUESS="$UNAME_MACHINE"-dec-linux-"$LIBC" + ;; x86_64:Linux:*:*) set_cc_for_build LIBCABI=$LIBC @@ -1121,53 +1124,53 @@ EOF LIBCABI="$LIBC"x32 fi fi - echo "$UNAME_MACHINE"-pc-linux-"$LIBCABI" - exit ;; + GUESS="$UNAME_MACHINE"-pc-linux-"$LIBCABI" + ;; xtensa*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC" + ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. - echo i386-sequent-sysv4 - exit ;; + GUESS=i386-sequent-sysv4 + ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. - echo "$UNAME_MACHINE"-pc-sysv4.2uw"$UNAME_VERSION" - exit ;; + GUESS="$UNAME_MACHINE"-pc-sysv4.2uw"$UNAME_VERSION" + ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. - echo "$UNAME_MACHINE"-pc-os2-emx - exit ;; + GUESS="$UNAME_MACHINE"-pc-os2-emx + ;; i*86:XTS-300:*:STOP) - echo "$UNAME_MACHINE"-unknown-stop - exit ;; + GUESS="$UNAME_MACHINE"-unknown-stop + ;; i*86:atheos:*:*) - echo "$UNAME_MACHINE"-unknown-atheos - exit ;; + GUESS="$UNAME_MACHINE"-unknown-atheos + ;; i*86:syllable:*:*) - echo "$UNAME_MACHINE"-pc-syllable - exit ;; + GUESS="$UNAME_MACHINE"-pc-syllable + ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) - echo i386-unknown-lynxos"$UNAME_RELEASE" - exit ;; + GUESS=i386-unknown-lynxos"$UNAME_RELEASE" + ;; i*86:*DOS:*:*) - echo "$UNAME_MACHINE"-pc-msdosdjgpp - exit ;; + GUESS="$UNAME_MACHINE"-pc-msdosdjgpp + ;; i*86:*:4.*:*) UNAME_REL=$(echo "$UNAME_RELEASE" | sed 's/\/MP$//') if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then - echo "$UNAME_MACHINE"-univel-sysv"$UNAME_REL" + GUESS="$UNAME_MACHINE"-univel-sysv"$UNAME_REL" else - echo "$UNAME_MACHINE"-pc-sysv"$UNAME_REL" + GUESS="$UNAME_MACHINE"-pc-sysv"$UNAME_REL" fi - exit ;; + ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case $(/bin/uname -X | grep "^Machine") in @@ -1175,12 +1178,12 @@ EOF *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac - echo "$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}" - exit ;; + GUESS="$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}" + ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=$(sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=$( (/bin/uname -X|grep Release|sed -e 's/.*= //')) (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 @@ -1190,11 +1193,11 @@ EOF && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 - echo "$UNAME_MACHINE"-pc-sco"$UNAME_REL" + GUESS="$UNAME_MACHINE"-pc-sco"$UNAME_REL" else - echo "$UNAME_MACHINE"-pc-sysv32 + GUESS="$UNAME_MACHINE"-pc-sysv32 fi - exit ;; + ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about @@ -1202,31 +1205,31 @@ EOF # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configure will decide that # this is a cross-build. - echo i586-pc-msdosdjgpp - exit ;; + GUESS=i586-pc-msdosdjgpp + ;; Intel:Mach:3*:*) - echo i386-pc-mach3 - exit ;; + GUESS=i386-pc-mach3 + ;; paragon:*:*:*) - echo i860-intel-osf1 - exit ;; + GUESS=i860-intel-osf1 + ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then - echo i860-stardent-sysv"$UNAME_RELEASE" # Stardent Vistra i860-SVR4 + GUESS=i860-stardent-sysv"$UNAME_RELEASE" # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. - echo i860-unknown-sysv"$UNAME_RELEASE" # Unknown i860-SVR4 + GUESS=i860-unknown-sysv"$UNAME_RELEASE" # Unknown i860-SVR4 fi - exit ;; + ;; mini*:CTIX:SYS*5:*) # "miniframe" - echo m68010-convergent-sysv - exit ;; + GUESS=m68010-convergent-sysv + ;; mc68k:UNIX:SYSTEM5:3.51m) - echo m68k-convergent-sysv - exit ;; + GUESS=m68k-convergent-sysv + ;; M680?0:D-NIX:5.3:*) - echo m68k-diab-dnix - exit ;; + GUESS=m68k-diab-dnix + ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) @@ -1251,116 +1254,116 @@ EOF /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) - echo m68k-unknown-lynxos"$UNAME_RELEASE" - exit ;; + GUESS=m68k-unknown-lynxos"$UNAME_RELEASE" + ;; mc68030:UNIX_System_V:4.*:*) - echo m68k-atari-sysv4 - exit ;; + GUESS=m68k-atari-sysv4 + ;; TSUNAMI:LynxOS:2.*:*) - echo sparc-unknown-lynxos"$UNAME_RELEASE" - exit ;; + GUESS=sparc-unknown-lynxos"$UNAME_RELEASE" + ;; rs6000:LynxOS:2.*:*) - echo rs6000-unknown-lynxos"$UNAME_RELEASE" - exit ;; + GUESS=rs6000-unknown-lynxos"$UNAME_RELEASE" + ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) - echo powerpc-unknown-lynxos"$UNAME_RELEASE" - exit ;; + GUESS=powerpc-unknown-lynxos"$UNAME_RELEASE" + ;; SM[BE]S:UNIX_SV:*:*) - echo mips-dde-sysv"$UNAME_RELEASE" - exit ;; + GUESS=mips-dde-sysv"$UNAME_RELEASE" + ;; RM*:ReliantUNIX-*:*:*) - echo mips-sni-sysv4 - exit ;; + GUESS=mips-sni-sysv4 + ;; RM*:SINIX-*:*:*) - echo mips-sni-sysv4 - exit ;; + GUESS=mips-sni-sysv4 + ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=$( (uname -p) 2>/dev/null) - echo "$UNAME_MACHINE"-sni-sysv4 + GUESS="$UNAME_MACHINE"-sni-sysv4 else - echo ns32k-sni-sysv + GUESS=ns32k-sni-sysv fi - exit ;; + ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says - echo i586-unisys-sysv4 - exit ;; + GUESS=i586-unisys-sysv4 + ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm - echo hppa1.1-stratus-sysv4 - exit ;; + GUESS=hppa1.1-stratus-sysv4 + ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. - echo i860-stratus-sysv4 - exit ;; + GUESS=i860-stratus-sysv4 + ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. - echo "$UNAME_MACHINE"-stratus-vos - exit ;; + GUESS="$UNAME_MACHINE"-stratus-vos + ;; *:VOS:*:*) # From Paul.Green@stratus.com. - echo hppa1.1-stratus-vos - exit ;; + GUESS=hppa1.1-stratus-vos + ;; mc68*:A/UX:*:*) - echo m68k-apple-aux"$UNAME_RELEASE" - exit ;; + GUESS=m68k-apple-aux"$UNAME_RELEASE" + ;; news*:NEWS-OS:6*:*) - echo mips-sony-newsos6 - exit ;; + GUESS=mips-sony-newsos6 + ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if test -d /usr/nec; then - echo mips-nec-sysv"$UNAME_RELEASE" + GUESS=mips-nec-sysv"$UNAME_RELEASE" else - echo mips-unknown-sysv"$UNAME_RELEASE" + GUESS=mips-unknown-sysv"$UNAME_RELEASE" fi - exit ;; + ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. - echo powerpc-be-beos - exit ;; + GUESS=powerpc-be-beos + ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. - echo powerpc-apple-beos - exit ;; + GUESS=powerpc-apple-beos + ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. - echo i586-pc-beos - exit ;; + GUESS=i586-pc-beos + ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. - echo i586-pc-haiku - exit ;; + GUESS=i586-pc-haiku + ;; x86_64:Haiku:*:*) - echo x86_64-unknown-haiku - exit ;; + GUESS=x86_64-unknown-haiku + ;; SX-4:SUPER-UX:*:*) - echo sx4-nec-superux"$UNAME_RELEASE" - exit ;; + GUESS=sx4-nec-superux"$UNAME_RELEASE" + ;; SX-5:SUPER-UX:*:*) - echo sx5-nec-superux"$UNAME_RELEASE" - exit ;; + GUESS=sx5-nec-superux"$UNAME_RELEASE" + ;; SX-6:SUPER-UX:*:*) - echo sx6-nec-superux"$UNAME_RELEASE" - exit ;; + GUESS=sx6-nec-superux"$UNAME_RELEASE" + ;; SX-7:SUPER-UX:*:*) - echo sx7-nec-superux"$UNAME_RELEASE" - exit ;; + GUESS=sx7-nec-superux"$UNAME_RELEASE" + ;; SX-8:SUPER-UX:*:*) - echo sx8-nec-superux"$UNAME_RELEASE" - exit ;; + GUESS=sx8-nec-superux"$UNAME_RELEASE" + ;; SX-8R:SUPER-UX:*:*) - echo sx8r-nec-superux"$UNAME_RELEASE" - exit ;; + GUESS=sx8r-nec-superux"$UNAME_RELEASE" + ;; SX-ACE:SUPER-UX:*:*) - echo sxace-nec-superux"$UNAME_RELEASE" - exit ;; + GUESS=sxace-nec-superux"$UNAME_RELEASE" + ;; Power*:Rhapsody:*:*) - echo powerpc-apple-rhapsody"$UNAME_RELEASE" - exit ;; + GUESS=powerpc-apple-rhapsody"$UNAME_RELEASE" + ;; *:Rhapsody:*:*) - echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE" - exit ;; + GUESS="$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE" + ;; arm64:Darwin:*:*) - echo aarch64-apple-darwin"$UNAME_RELEASE" - exit ;; + GUESS=aarch64-apple-darwin"$UNAME_RELEASE" + ;; *:Darwin:*:*) UNAME_PROCESSOR=$(uname -p) case $UNAME_PROCESSOR in @@ -1396,43 +1399,43 @@ EOF # uname -m returns i386 or x86_64 UNAME_PROCESSOR=$UNAME_MACHINE fi - echo "$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE" - exit ;; + GUESS="$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE" + ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=$(uname -p) if test "$UNAME_PROCESSOR" = x86; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi - echo "$UNAME_PROCESSOR"-"$UNAME_MACHINE"-nto-qnx"$UNAME_RELEASE" - exit ;; + GUESS="$UNAME_PROCESSOR"-"$UNAME_MACHINE"-nto-qnx"$UNAME_RELEASE" + ;; *:QNX:*:4*) - echo i386-pc-qnx - exit ;; + GUESS=i386-pc-qnx + ;; NEO-*:NONSTOP_KERNEL:*:*) - echo neo-tandem-nsk"$UNAME_RELEASE" - exit ;; + GUESS=neo-tandem-nsk"$UNAME_RELEASE" + ;; NSE-*:NONSTOP_KERNEL:*:*) - echo nse-tandem-nsk"$UNAME_RELEASE" - exit ;; + GUESS=nse-tandem-nsk"$UNAME_RELEASE" + ;; NSR-*:NONSTOP_KERNEL:*:*) - echo nsr-tandem-nsk"$UNAME_RELEASE" - exit ;; + GUESS=nsr-tandem-nsk"$UNAME_RELEASE" + ;; NSV-*:NONSTOP_KERNEL:*:*) - echo nsv-tandem-nsk"$UNAME_RELEASE" - exit ;; + GUESS=nsv-tandem-nsk"$UNAME_RELEASE" + ;; NSX-*:NONSTOP_KERNEL:*:*) - echo nsx-tandem-nsk"$UNAME_RELEASE" - exit ;; + GUESS=nsx-tandem-nsk"$UNAME_RELEASE" + ;; *:NonStop-UX:*:*) - echo mips-compaq-nonstopux - exit ;; + GUESS=mips-compaq-nonstopux + ;; BS2000:POSIX*:*:*) - echo bs2000-siemens-sysv - exit ;; + GUESS=bs2000-siemens-sysv + ;; DS/*:UNIX_System_V:*:*) - echo "$UNAME_MACHINE"-"$UNAME_SYSTEM"-"$UNAME_RELEASE" - exit ;; + GUESS="$UNAME_MACHINE"-"$UNAME_SYSTEM"-"$UNAME_RELEASE" + ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 @@ -1442,32 +1445,32 @@ EOF elif test "x${cputype-}" != x; then UNAME_MACHINE="$cputype" fi - echo "$UNAME_MACHINE"-unknown-plan9 - exit ;; + GUESS="$UNAME_MACHINE"-unknown-plan9 + ;; *:TOPS-10:*:*) - echo pdp10-unknown-tops10 - exit ;; + GUESS=pdp10-unknown-tops10 + ;; *:TENEX:*:*) - echo pdp10-unknown-tenex - exit ;; + GUESS=pdp10-unknown-tenex + ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) - echo pdp10-dec-tops20 - exit ;; + GUESS=pdp10-dec-tops20 + ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) - echo pdp10-xkl-tops20 - exit ;; + GUESS=pdp10-xkl-tops20 + ;; *:TOPS-20:*:*) - echo pdp10-unknown-tops20 - exit ;; + GUESS=pdp10-unknown-tops20 + ;; *:ITS:*:*) - echo pdp10-unknown-its - exit ;; + GUESS=pdp10-unknown-its + ;; SEI:*:*:SEIUX) - echo mips-sei-seiux"$UNAME_RELEASE" - exit ;; + GUESS=mips-sei-seiux"$UNAME_RELEASE" + ;; *:DragonFly:*:*) - echo "$UNAME_MACHINE"-unknown-dragonfly"$(echo "$UNAME_RELEASE"|sed -e 's/[-(].*//')" - exit ;; + GUESS="$UNAME_MACHINE"-unknown-dragonfly"$(echo "$UNAME_RELEASE"|sed -e 's/[-(].*//')" + ;; *:*VMS:*:*) UNAME_MACHINE=$( (uname -p) 2>/dev/null) case $UNAME_MACHINE in @@ -1476,28 +1479,34 @@ EOF V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) - echo i386-pc-xenix - exit ;; + GUESS=i386-pc-xenix + ;; i*86:skyos:*:*) - echo "$UNAME_MACHINE"-pc-skyos"$(echo "$UNAME_RELEASE" | sed -e 's/ .*$//')" - exit ;; + GUESS="$UNAME_MACHINE"-pc-skyos"$(echo "$UNAME_RELEASE" | sed -e 's/ .*$//')" + ;; i*86:rdos:*:*) - echo "$UNAME_MACHINE"-pc-rdos - exit ;; + GUESS="$UNAME_MACHINE"-pc-rdos + ;; *:AROS:*:*) - echo "$UNAME_MACHINE"-unknown-aros - exit ;; + GUESS="$UNAME_MACHINE"-unknown-aros + ;; x86_64:VMkernel:*:*) - echo "$UNAME_MACHINE"-unknown-esx - exit ;; + GUESS="$UNAME_MACHINE"-unknown-esx + ;; amd64:Isilon\ OneFS:*:*) - echo x86_64-unknown-onefs - exit ;; + GUESS=x86_64-unknown-onefs + ;; *:Unleashed:*:*) - echo "$UNAME_MACHINE"-unknown-unleashed"$UNAME_RELEASE" - exit ;; + GUESS="$UNAME_MACHINE"-unknown-unleashed"$UNAME_RELEASE" + ;; esac +# Do we have a guess based on uname results? +if test "x$GUESS" != x; then + echo "$GUESS" + exit +fi + # No uname command or uname output not recognized. set_cc_for_build cat > "$dummy.c" < 0 && /^[[:space:]]+echo/ { + If_rewritten = 1 + rewrite_echo_line() +} + +In_main_case && /^[[:space:]]+exit ;;$/ && If_rewritten { + If_rewritten = 0 + print Indent";;" + next +} + +In_main_case && /^[[:space:]]+echo/ { + getline next_line + if (next_line !~ /^[[:space:]]+exit ;;/) { + # not the output-and-exit we seek here... + print + print next_line + next + } + + if (/-cray-/ && $3 == "|") { + # several Cray Unicos entries apply sed to the entire output in + # order to edit the UNAME_RELEASE field; fix these up + sub(/"\$UNAME_RELEASE"/, "\"$(echo &", $2) + $NF = $NF")\"" + } + + rewrite_echo_line() + if (next_line ~ /^[[:space:]]+exit ;;.+/) + sub(/^[[:space:]]+exit ;;/, ";; ", next_line) + else + sub(/^[[:space:]]+exit ;;/, ";;", next_line) + print $0 + print Indent next_line + next +} + +In_main_case && /^esac/ { + In_main_case = 0 + + print # "esac" + print "" + print "# Do we have a guess based on uname results?" + print "if test \"x$GUESS\" != x; then" + print " echo \"$GUESS\"" + print " exit" + print "fi" + + # Copy the rest of the input file + while (getline) print + nextfile +} + +{ print } -- 2.17.1 From MAILER-DAEMON Wed May 26 23:06:30 2021 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1lm6Lu-0001XY-Ie for mharc-config-patches@gnu.org; Wed, 26 May 2021 23:06:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58694) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lm5qk-0003qL-Qi for config-patches@gnu.org; Wed, 26 May 2021 22:34:18 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:55988) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lm5qk-0004tu-Jp for config-patches@gnu.org; Wed, 26 May 2021 22:34:18 -0400 Received: from jcb by fencepost.gnu.org with local (Exim 4.90_1) (envelope-from ) id 1lm5qk-00045L-5J for config-patches@gnu.org; Wed, 26 May 2021 22:34:18 -0400 Message-Id: <35684fab94a63de541c18aceaaf7dbdc51daf948.1622078762.git.jcb@gnu.org> In-Reply-To: References: From: Jacob Bachmeyer Date: Mon, 24 May 2021 23:05:16 -0500 Subject: [PATCH v2 1/8] config.guess: use intermediate variable with uname results To: config-patches@gnu.org X-Mailman-Approved-At: Wed, 26 May 2021 23:06:28 -0400 X-BeenThere: config-patches@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Patches for the config.guess and config.sub scripts" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 May 2021 02:34:19 -0000 This will allow quoting to be significantly simplified in another pass through the file. This patch was generated using the included GNU Awk program. * config.guess: add GUESS variable to hold results of uname analysis * patch-1.gawk: store tool that produced automated patch --- config.guess | 949 ++++++++++++++++++++++++++------------------------- patch-1.gawk | 114 +++++++ 2 files changed, 593 insertions(+), 470 deletions(-) mode change 100755 => 100644 config.guess create mode 100755 patch-1.gawk diff --git a/config.guess b/config.guess old mode 100755 new mode 100644 index dc0a6b2..00240ae --- a/config.guess +++ b/config.guess @@ -84,6 +84,9 @@ if test $# != 0; then exit 1 fi +# just in case it came from the environment +GUESS= + # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a @@ -251,54 +254,54 @@ case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. - echo "$machine-${os}${release}${abi-}" - exit ;; + GUESS="$machine-${os}${release}${abi-}" + ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=$(arch | sed 's/Bitrig.//') - echo "$UNAME_MACHINE_ARCH"-unknown-bitrig"$UNAME_RELEASE" - exit ;; + GUESS="$UNAME_MACHINE_ARCH"-unknown-bitrig"$UNAME_RELEASE" + ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=$(arch | sed 's/OpenBSD.//') - echo "$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE" - exit ;; + GUESS="$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE" + ;; *:SecBSD:*:*) UNAME_MACHINE_ARCH=$(arch | sed 's/SecBSD.//') - echo "$UNAME_MACHINE_ARCH"-unknown-secbsd"$UNAME_RELEASE" - exit ;; + GUESS="$UNAME_MACHINE_ARCH"-unknown-secbsd"$UNAME_RELEASE" + ;; *:LibertyBSD:*:*) UNAME_MACHINE_ARCH=$(arch | sed 's/^.*BSD\.//') - echo "$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE" - exit ;; + GUESS="$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE" + ;; *:MidnightBSD:*:*) - echo "$UNAME_MACHINE"-unknown-midnightbsd"$UNAME_RELEASE" - exit ;; + GUESS="$UNAME_MACHINE"-unknown-midnightbsd"$UNAME_RELEASE" + ;; *:ekkoBSD:*:*) - echo "$UNAME_MACHINE"-unknown-ekkobsd"$UNAME_RELEASE" - exit ;; + GUESS="$UNAME_MACHINE"-unknown-ekkobsd"$UNAME_RELEASE" + ;; *:SolidBSD:*:*) - echo "$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE" - exit ;; + GUESS="$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE" + ;; *:OS108:*:*) - echo "$UNAME_MACHINE"-unknown-os108_"$UNAME_RELEASE" - exit ;; + GUESS="$UNAME_MACHINE"-unknown-os108_"$UNAME_RELEASE" + ;; macppc:MirBSD:*:*) - echo powerpc-unknown-mirbsd"$UNAME_RELEASE" - exit ;; + GUESS=powerpc-unknown-mirbsd"$UNAME_RELEASE" + ;; *:MirBSD:*:*) - echo "$UNAME_MACHINE"-unknown-mirbsd"$UNAME_RELEASE" - exit ;; + GUESS="$UNAME_MACHINE"-unknown-mirbsd"$UNAME_RELEASE" + ;; *:Sortix:*:*) - echo "$UNAME_MACHINE"-unknown-sortix - exit ;; + GUESS="$UNAME_MACHINE"-unknown-sortix + ;; *:Twizzler:*:*) - echo "$UNAME_MACHINE"-unknown-twizzler - exit ;; + GUESS="$UNAME_MACHINE"-unknown-twizzler + ;; *:Redox:*:*) - echo "$UNAME_MACHINE"-unknown-redox - exit ;; + GUESS="$UNAME_MACHINE"-unknown-redox + ;; mips:OSF1:*.*) - echo mips-dec-osf1 - exit ;; + GUESS=mips-dec-osf1 + ;; alpha:OSF1:*:*) # Reset EXIT trap before exiting to avoid spurious non-zero exit code. trap '' 0 @@ -352,65 +355,65 @@ case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. - echo "$UNAME_MACHINE"-dec-osf"$(echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz)" - exit ;; + GUESS="$UNAME_MACHINE"-dec-osf"$(echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz)" + ;; Amiga*:UNIX_System_V:4.0:*) - echo m68k-unknown-sysv4 - exit ;; + GUESS=m68k-unknown-sysv4 + ;; *:[Aa]miga[Oo][Ss]:*:*) - echo "$UNAME_MACHINE"-unknown-amigaos - exit ;; + GUESS="$UNAME_MACHINE"-unknown-amigaos + ;; *:[Mm]orph[Oo][Ss]:*:*) - echo "$UNAME_MACHINE"-unknown-morphos - exit ;; + GUESS="$UNAME_MACHINE"-unknown-morphos + ;; *:OS/390:*:*) - echo i370-ibm-openedition - exit ;; + GUESS=i370-ibm-openedition + ;; *:z/VM:*:*) - echo s390-ibm-zvmoe - exit ;; + GUESS=s390-ibm-zvmoe + ;; *:OS400:*:*) - echo powerpc-ibm-os400 - exit ;; + GUESS=powerpc-ibm-os400 + ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) - echo arm-acorn-riscix"$UNAME_RELEASE" - exit ;; + GUESS=arm-acorn-riscix"$UNAME_RELEASE" + ;; arm*:riscos:*:*|arm*:RISCOS:*:*) - echo arm-unknown-riscos - exit ;; + GUESS=arm-unknown-riscos + ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) - echo hppa1.1-hitachi-hiuxmpp - exit ;; + GUESS=hppa1.1-hitachi-hiuxmpp + ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "$( (/bin/universe) 2>/dev/null)" = att ; then - echo pyramid-pyramid-sysv3 + GUESS=pyramid-pyramid-sysv3 else - echo pyramid-pyramid-bsd + GUESS=pyramid-pyramid-bsd fi - exit ;; + ;; NILE*:*:*:dcosx) - echo pyramid-pyramid-svr4 - exit ;; + GUESS=pyramid-pyramid-svr4 + ;; DRS?6000:unix:4.0:6*) - echo sparc-icl-nx6 - exit ;; + GUESS=sparc-icl-nx6 + ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case $(/usr/bin/uname -p) in sparc) echo sparc-icl-nx7; exit ;; esac ;; s390x:SunOS:*:*) - echo "$UNAME_MACHINE"-ibm-solaris2"$(echo "$UNAME_RELEASE" | sed -e 's/[^.]*//')" - exit ;; + GUESS="$UNAME_MACHINE"-ibm-solaris2"$(echo "$UNAME_RELEASE" | sed -e 's/[^.]*//')" + ;; sun4H:SunOS:5.*:*) - echo sparc-hal-solaris2"$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*//')" - exit ;; + GUESS=sparc-hal-solaris2"$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*//')" + ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) - echo sparc-sun-solaris2"$(echo "$UNAME_RELEASE" | sed -e 's/[^.]*//')" - exit ;; + GUESS=sparc-sun-solaris2"$(echo "$UNAME_RELEASE" | sed -e 's/[^.]*//')" + ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) - echo i386-pc-auroraux"$UNAME_RELEASE" - exit ;; + GUESS=i386-pc-auroraux"$UNAME_RELEASE" + ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) set_cc_for_build SUN_ARCH=i386 @@ -425,14 +428,14 @@ case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in SUN_ARCH=x86_64 fi fi - echo "$SUN_ARCH"-pc-solaris2"$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*//')" - exit ;; + GUESS="$SUN_ARCH"-pc-solaris2"$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*//')" + ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. - echo sparc-sun-solaris3"$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*//')" - exit ;; + GUESS=sparc-sun-solaris3"$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*//')" + ;; sun4*:SunOS:*:*) case $(/usr/bin/arch -k) in Series*|S4*) @@ -440,11 +443,11 @@ case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. - echo sparc-sun-sunos"$(echo "$UNAME_RELEASE"|sed -e 's/-/_/')" - exit ;; + GUESS=sparc-sun-sunos"$(echo "$UNAME_RELEASE"|sed -e 's/-/_/')" + ;; sun3*:SunOS:*:*) - echo m68k-sun-sunos"$UNAME_RELEASE" - exit ;; + GUESS=m68k-sun-sunos"$UNAME_RELEASE" + ;; sun*:*:4.2BSD:*) UNAME_RELEASE=$( (sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null) test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3 @@ -458,8 +461,8 @@ case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in esac exit ;; aushp:SunOS:*:*) - echo sparc-auspex-sunos"$UNAME_RELEASE" - exit ;; + GUESS=sparc-auspex-sunos"$UNAME_RELEASE" + ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor @@ -469,41 +472,41 @@ case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint"$UNAME_RELEASE" - exit ;; + GUESS=m68k-atari-mint"$UNAME_RELEASE" + ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint"$UNAME_RELEASE" - exit ;; + GUESS=m68k-atari-mint"$UNAME_RELEASE" + ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) - echo m68k-atari-mint"$UNAME_RELEASE" - exit ;; + GUESS=m68k-atari-mint"$UNAME_RELEASE" + ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) - echo m68k-milan-mint"$UNAME_RELEASE" - exit ;; + GUESS=m68k-milan-mint"$UNAME_RELEASE" + ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) - echo m68k-hades-mint"$UNAME_RELEASE" - exit ;; + GUESS=m68k-hades-mint"$UNAME_RELEASE" + ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) - echo m68k-unknown-mint"$UNAME_RELEASE" - exit ;; + GUESS=m68k-unknown-mint"$UNAME_RELEASE" + ;; m68k:machten:*:*) - echo m68k-apple-machten"$UNAME_RELEASE" - exit ;; + GUESS=m68k-apple-machten"$UNAME_RELEASE" + ;; powerpc:machten:*:*) - echo powerpc-apple-machten"$UNAME_RELEASE" - exit ;; + GUESS=powerpc-apple-machten"$UNAME_RELEASE" + ;; RISC*:Mach:*:*) - echo mips-dec-mach_bsd4.3 - exit ;; + GUESS=mips-dec-mach_bsd4.3 + ;; RISC*:ULTRIX:*:*) - echo mips-dec-ultrix"$UNAME_RELEASE" - exit ;; + GUESS=mips-dec-ultrix"$UNAME_RELEASE" + ;; VAX*:ULTRIX*:*:*) - echo vax-dec-ultrix"$UNAME_RELEASE" - exit ;; + GUESS=vax-dec-ultrix"$UNAME_RELEASE" + ;; 2020:CLIX:*:* | 2430:CLIX:*:*) - echo clipper-intergraph-clix"$UNAME_RELEASE" - exit ;; + GUESS=clipper-intergraph-clix"$UNAME_RELEASE" + ;; mips:*:*:UMIPS | mips:*:*:RISCos) set_cc_for_build sed 's/^ //' << EOF > "$dummy.c" @@ -531,29 +534,29 @@ EOF dummyarg=$(echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p') && SYSTEM_NAME=$("$dummy" "$dummyarg") && { echo "$SYSTEM_NAME"; exit; } - echo mips-mips-riscos"$UNAME_RELEASE" - exit ;; + GUESS=mips-mips-riscos"$UNAME_RELEASE" + ;; Motorola:PowerMAX_OS:*:*) - echo powerpc-motorola-powermax - exit ;; + GUESS=powerpc-motorola-powermax + ;; Motorola:*:4.3:PL8-*) - echo powerpc-harris-powermax - exit ;; + GUESS=powerpc-harris-powermax + ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) - echo powerpc-harris-powermax - exit ;; + GUESS=powerpc-harris-powermax + ;; Night_Hawk:Power_UNIX:*:*) - echo powerpc-harris-powerunix - exit ;; + GUESS=powerpc-harris-powerunix + ;; m88k:CX/UX:7*:*) - echo m88k-harris-cxux7 - exit ;; + GUESS=m88k-harris-cxux7 + ;; m88k:*:4*:R4*) - echo m88k-motorola-sysv4 - exit ;; + GUESS=m88k-motorola-sysv4 + ;; m88k:*:3*:R3*) - echo m88k-motorola-sysv3 - exit ;; + GUESS=m88k-motorola-sysv3 + ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=$(/usr/bin/uname -p) @@ -562,44 +565,44 @@ EOF if test "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx || \ test "$TARGET_BINARY_INTERFACE"x = x then - echo m88k-dg-dgux"$UNAME_RELEASE" + GUESS=m88k-dg-dgux"$UNAME_RELEASE" else - echo m88k-dg-dguxbcs"$UNAME_RELEASE" + GUESS=m88k-dg-dguxbcs"$UNAME_RELEASE" fi else - echo i586-dg-dgux"$UNAME_RELEASE" + GUESS=i586-dg-dgux"$UNAME_RELEASE" fi - exit ;; + ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) - echo m88k-dolphin-sysv3 - exit ;; + GUESS=m88k-dolphin-sysv3 + ;; M88*:*:R3*:*) # Delta 88k system running SVR3 - echo m88k-motorola-sysv3 - exit ;; + GUESS=m88k-motorola-sysv3 + ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) - echo m88k-tektronix-sysv3 - exit ;; + GUESS=m88k-tektronix-sysv3 + ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) - echo m68k-tektronix-bsd - exit ;; + GUESS=m68k-tektronix-bsd + ;; *:IRIX*:*:*) - echo mips-sgi-irix"$(echo "$UNAME_RELEASE"|sed -e 's/-/_/g')" - exit ;; + GUESS=mips-sgi-irix"$(echo "$UNAME_RELEASE"|sed -e 's/-/_/g')" + ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. - echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id - exit ;; # Note that: echo "'$(uname -s)'" gives 'AIX ' + GUESS=romp-ibm-aix # uname -m gives an 8 hex-code CPU id + ;; # Note that: echo "'$(uname -s)'" gives 'AIX ' i*86:AIX:*:*) - echo i386-ibm-aix - exit ;; + GUESS=i386-ibm-aix + ;; ia64:AIX:*:*) if test -x /usr/bin/oslevel ; then IBM_REV=$(/usr/bin/oslevel) else IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" fi - echo "$UNAME_MACHINE"-ibm-aix"$IBM_REV" - exit ;; + GUESS="$UNAME_MACHINE"-ibm-aix"$IBM_REV" + ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then set_cc_for_build @@ -616,16 +619,16 @@ EOF EOF if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=$("$dummy") then - echo "$SYSTEM_NAME" + GUESS="$SYSTEM_NAME" else - echo rs6000-ibm-aix3.2.5 + GUESS=rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then - echo rs6000-ibm-aix3.2.4 + GUESS=rs6000-ibm-aix3.2.4 else - echo rs6000-ibm-aix3.2 + GUESS=rs6000-ibm-aix3.2 fi - exit ;; + ;; *:AIX:*:[4567]) IBM_CPU_ID=$(/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }') if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then @@ -639,29 +642,29 @@ EOF else IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" fi - echo "$IBM_ARCH"-ibm-aix"$IBM_REV" - exit ;; + GUESS="$IBM_ARCH"-ibm-aix"$IBM_REV" + ;; *:AIX:*:*) - echo rs6000-ibm-aix - exit ;; + GUESS=rs6000-ibm-aix + ;; ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*) - echo romp-ibm-bsd4.4 - exit ;; + GUESS=romp-ibm-bsd4.4 + ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and - echo romp-ibm-bsd"$UNAME_RELEASE" # 4.3 with uname added to - exit ;; # report: romp-ibm BSD 4.3 + GUESS=romp-ibm-bsd"$UNAME_RELEASE" # 4.3 with uname added to + ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) - echo rs6000-bull-bosx - exit ;; + GUESS=rs6000-bull-bosx + ;; DPX/2?00:B.O.S.:*:*) - echo m68k-bull-sysv3 - exit ;; + GUESS=m68k-bull-sysv3 + ;; 9000/[34]??:4.3bsd:1.*:*) - echo m68k-hp-bsd - exit ;; + GUESS=m68k-hp-bsd + ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) - echo m68k-hp-bsd4.4 - exit ;; + GUESS=m68k-hp-bsd4.4 + ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//') case $UNAME_MACHINE in @@ -742,12 +745,12 @@ EOF HP_ARCH=hppa64 fi fi - echo "$HP_ARCH"-hp-hpux"$HPUX_REV" - exit ;; + GUESS="$HP_ARCH"-hp-hpux"$HPUX_REV" + ;; ia64:HP-UX:*:*) HPUX_REV=$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//') - echo ia64-hp-hpux"$HPUX_REV" - exit ;; + GUESS=ia64-hp-hpux"$HPUX_REV" + ;; 3050*:HI-UX:*:*) set_cc_for_build sed 's/^ //' << EOF > "$dummy.c" @@ -777,36 +780,36 @@ EOF EOF $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=$("$dummy") && { echo "$SYSTEM_NAME"; exit; } - echo unknown-hitachi-hiuxwe2 - exit ;; + GUESS=unknown-hitachi-hiuxwe2 + ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*) - echo hppa1.1-hp-bsd - exit ;; + GUESS=hppa1.1-hp-bsd + ;; 9000/8??:4.3bsd:*:*) - echo hppa1.0-hp-bsd - exit ;; + GUESS=hppa1.0-hp-bsd + ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) - echo hppa1.0-hp-mpeix - exit ;; + GUESS=hppa1.0-hp-mpeix + ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*) - echo hppa1.1-hp-osf - exit ;; + GUESS=hppa1.1-hp-osf + ;; hp8??:OSF1:*:*) - echo hppa1.0-hp-osf - exit ;; + GUESS=hppa1.0-hp-osf + ;; i*86:OSF1:*:*) if test -x /usr/sbin/sysversion ; then - echo "$UNAME_MACHINE"-unknown-osf1mk + GUESS="$UNAME_MACHINE"-unknown-osf1mk else - echo "$UNAME_MACHINE"-unknown-osf1 + GUESS="$UNAME_MACHINE"-unknown-osf1 fi - exit ;; + ;; parisc*:Lites*:*:*) - echo hppa1.1-hp-lites - exit ;; + GUESS=hppa1.1-hp-lites + ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) - echo c1-convex-bsd - exit ;; + GUESS=c1-convex-bsd + ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd @@ -814,17 +817,17 @@ EOF fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) - echo c34-convex-bsd - exit ;; + GUESS=c34-convex-bsd + ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) - echo c38-convex-bsd - exit ;; + GUESS=c38-convex-bsd + ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) - echo c4-convex-bsd - exit ;; + GUESS=c4-convex-bsd + ;; CRAY*Y-MP:*:*:*) - echo ymp-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' - exit ;; + GUESS=ymp-cray-unicos"$(echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/')" + ;; CRAY*[A-Z]90:*:*:*) echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ @@ -832,48 +835,48 @@ EOF -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) - echo t90-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' - exit ;; + GUESS=t90-cray-unicos"$(echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/')" + ;; CRAY*T3E:*:*:*) - echo alphaev5-cray-unicosmk"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' - exit ;; + GUESS=alphaev5-cray-unicosmk"$(echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/')" + ;; CRAY*SV1:*:*:*) - echo sv1-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' - exit ;; + GUESS=sv1-cray-unicos"$(echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/')" + ;; *:UNICOS/mp:*:*) - echo craynv-cray-unicosmp"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' - exit ;; + GUESS=craynv-cray-unicosmp"$(echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/')" + ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=$(uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz) FUJITSU_SYS=$(uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///') FUJITSU_REL=$(echo "$UNAME_RELEASE" | sed -e 's/ /_/') - echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit ;; + GUESS="${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=$(uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///') FUJITSU_REL=$(echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/') - echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit ;; + GUESS="sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) - echo "$UNAME_MACHINE"-pc-bsdi"$UNAME_RELEASE" - exit ;; + GUESS="$UNAME_MACHINE"-pc-bsdi"$UNAME_RELEASE" + ;; sparc*:BSD/OS:*:*) - echo sparc-unknown-bsdi"$UNAME_RELEASE" - exit ;; + GUESS=sparc-unknown-bsdi"$UNAME_RELEASE" + ;; *:BSD/OS:*:*) - echo "$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE" - exit ;; + GUESS="$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE" + ;; arm:FreeBSD:*:*) UNAME_PROCESSOR=$(uname -p) set_cc_for_build if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then - echo "${UNAME_PROCESSOR}"-unknown-freebsd"$(echo ${UNAME_RELEASE}|sed -e 's/[-(].*//')"-gnueabi + GUESS="${UNAME_PROCESSOR}"-unknown-freebsd"$(echo ${UNAME_RELEASE}|sed -e 's/[-(].*//')"-gnueabi else - echo "${UNAME_PROCESSOR}"-unknown-freebsd"$(echo ${UNAME_RELEASE}|sed -e 's/[-(].*//')"-gnueabihf + GUESS="${UNAME_PROCESSOR}"-unknown-freebsd"$(echo ${UNAME_RELEASE}|sed -e 's/[-(].*//')"-gnueabihf fi - exit ;; + ;; *:FreeBSD:*:*) UNAME_PROCESSOR=$(/usr/bin/uname -p) case $UNAME_PROCESSOR in @@ -882,62 +885,62 @@ EOF i386) UNAME_PROCESSOR=i586 ;; esac - echo "$UNAME_PROCESSOR"-unknown-freebsd"$(echo "$UNAME_RELEASE"|sed -e 's/[-(].*//')" - exit ;; + GUESS="$UNAME_PROCESSOR"-unknown-freebsd"$(echo "$UNAME_RELEASE"|sed -e 's/[-(].*//')" + ;; i*:CYGWIN*:*) - echo "$UNAME_MACHINE"-pc-cygwin - exit ;; + GUESS="$UNAME_MACHINE"-pc-cygwin + ;; *:MINGW64*:*) - echo "$UNAME_MACHINE"-pc-mingw64 - exit ;; + GUESS="$UNAME_MACHINE"-pc-mingw64 + ;; *:MINGW*:*) - echo "$UNAME_MACHINE"-pc-mingw32 - exit ;; + GUESS="$UNAME_MACHINE"-pc-mingw32 + ;; *:MSYS*:*) - echo "$UNAME_MACHINE"-pc-msys - exit ;; + GUESS="$UNAME_MACHINE"-pc-msys + ;; i*:PW*:*) - echo "$UNAME_MACHINE"-pc-pw32 - exit ;; + GUESS="$UNAME_MACHINE"-pc-pw32 + ;; *:Interix*:*) case $UNAME_MACHINE in x86) - echo i586-pc-interix"$UNAME_RELEASE" - exit ;; + GUESS=i586-pc-interix"$UNAME_RELEASE" + ;; authenticamd | genuineintel | EM64T) - echo x86_64-unknown-interix"$UNAME_RELEASE" - exit ;; + GUESS=x86_64-unknown-interix"$UNAME_RELEASE" + ;; IA64) - echo ia64-unknown-interix"$UNAME_RELEASE" - exit ;; + GUESS=ia64-unknown-interix"$UNAME_RELEASE" + ;; esac ;; i*:UWIN*:*) - echo "$UNAME_MACHINE"-pc-uwin - exit ;; + GUESS="$UNAME_MACHINE"-pc-uwin + ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) - echo x86_64-pc-cygwin - exit ;; + GUESS=x86_64-pc-cygwin + ;; prep*:SunOS:5.*:*) - echo powerpcle-unknown-solaris2"$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*//')" - exit ;; + GUESS=powerpcle-unknown-solaris2"$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*//')" + ;; *:GNU:*:*) # the GNU system - echo "$(echo "$UNAME_MACHINE"|sed -e 's,[-/].*$,,')-unknown-$LIBC$(echo "$UNAME_RELEASE"|sed -e 's,/.*$,,')" - exit ;; + GUESS="$(echo "$UNAME_MACHINE"|sed -e 's,[-/].*$,,')-unknown-$LIBC$(echo "$UNAME_RELEASE"|sed -e 's,/.*$,,')" + ;; *:GNU/*:*:*) # other systems with GNU libc and userland - echo "$UNAME_MACHINE-unknown-$(echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]")$(echo "$UNAME_RELEASE"|sed -e 's/[-(].*//')-$LIBC" - exit ;; + GUESS="$UNAME_MACHINE-unknown-$(echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]")$(echo "$UNAME_RELEASE"|sed -e 's/[-(].*//')-$LIBC" + ;; *:Minix:*:*) - echo "$UNAME_MACHINE"-unknown-minix - exit ;; + GUESS="$UNAME_MACHINE"-unknown-minix + ;; aarch64:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC" + ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC" + ;; alpha:Linux:*:*) case $(sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null) in EV5) UNAME_MACHINE=alphaev5 ;; @@ -950,63 +953,63 @@ EOF esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC=gnulibc1 ; fi - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC" + ;; arc:Linux:*:* | arceb:Linux:*:* | arc64:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC" + ;; arm*:Linux:*:*) set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC" else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabi + GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC"eabi else - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabihf + GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC"eabihf fi fi - exit ;; + ;; avr32*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC" + ;; cris:Linux:*:*) - echo "$UNAME_MACHINE"-axis-linux-"$LIBC" - exit ;; + GUESS="$UNAME_MACHINE"-axis-linux-"$LIBC" + ;; crisv32:Linux:*:*) - echo "$UNAME_MACHINE"-axis-linux-"$LIBC" - exit ;; + GUESS="$UNAME_MACHINE"-axis-linux-"$LIBC" + ;; e2k:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC" + ;; frv:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC" + ;; hexagon:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC" + ;; i*86:Linux:*:*) - echo "$UNAME_MACHINE"-pc-linux-"$LIBC" - exit ;; + GUESS="$UNAME_MACHINE"-pc-linux-"$LIBC" + ;; ia64:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC" + ;; k1om:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC" + ;; loongarch32:Linux:*:* | loongarch64:Linux:*:* | loongarchx32:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC" + ;; m32r*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC" + ;; m68*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC" + ;; mips:Linux:*:* | mips64:Linux:*:*) set_cc_for_build IS_GLIBC=0 @@ -1055,20 +1058,20 @@ EOF test "x$CPU" != x && { echo "$CPU${MIPS_ENDIAN}-unknown-linux-$LIBCABI"; exit; } ;; mips64el:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC" + ;; openrisc*:Linux:*:*) - echo or1k-unknown-linux-"$LIBC" - exit ;; + GUESS=or1k-unknown-linux-"$LIBC" + ;; or32:Linux:*:* | or1k*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC" + ;; padre:Linux:*:*) - echo sparc-unknown-linux-"$LIBC" - exit ;; + GUESS=sparc-unknown-linux-"$LIBC" + ;; parisc64:Linux:*:* | hppa64:Linux:*:*) - echo hppa64-unknown-linux-"$LIBC" - exit ;; + GUESS=hppa64-unknown-linux-"$LIBC" + ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case $(grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2) in @@ -1078,38 +1081,38 @@ EOF esac exit ;; ppc64:Linux:*:*) - echo powerpc64-unknown-linux-"$LIBC" - exit ;; + GUESS=powerpc64-unknown-linux-"$LIBC" + ;; ppc:Linux:*:*) - echo powerpc-unknown-linux-"$LIBC" - exit ;; + GUESS=powerpc-unknown-linux-"$LIBC" + ;; ppc64le:Linux:*:*) - echo powerpc64le-unknown-linux-"$LIBC" - exit ;; + GUESS=powerpc64le-unknown-linux-"$LIBC" + ;; ppcle:Linux:*:*) - echo powerpcle-unknown-linux-"$LIBC" - exit ;; + GUESS=powerpcle-unknown-linux-"$LIBC" + ;; riscv32:Linux:*:* | riscv32be:Linux:*:* | riscv64:Linux:*:* | riscv64be:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC" + ;; s390:Linux:*:* | s390x:Linux:*:*) - echo "$UNAME_MACHINE"-ibm-linux-"$LIBC" - exit ;; + GUESS="$UNAME_MACHINE"-ibm-linux-"$LIBC" + ;; sh64*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC" + ;; sh*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC" + ;; sparc:Linux:*:* | sparc64:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC" + ;; tile*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC" + ;; vax:Linux:*:*) - echo "$UNAME_MACHINE"-dec-linux-"$LIBC" - exit ;; + GUESS="$UNAME_MACHINE"-dec-linux-"$LIBC" + ;; x86_64:Linux:*:*) set_cc_for_build LIBCABI=$LIBC @@ -1121,53 +1124,53 @@ EOF LIBCABI="$LIBC"x32 fi fi - echo "$UNAME_MACHINE"-pc-linux-"$LIBCABI" - exit ;; + GUESS="$UNAME_MACHINE"-pc-linux-"$LIBCABI" + ;; xtensa*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS="$UNAME_MACHINE"-unknown-linux-"$LIBC" + ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. - echo i386-sequent-sysv4 - exit ;; + GUESS=i386-sequent-sysv4 + ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. - echo "$UNAME_MACHINE"-pc-sysv4.2uw"$UNAME_VERSION" - exit ;; + GUESS="$UNAME_MACHINE"-pc-sysv4.2uw"$UNAME_VERSION" + ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. - echo "$UNAME_MACHINE"-pc-os2-emx - exit ;; + GUESS="$UNAME_MACHINE"-pc-os2-emx + ;; i*86:XTS-300:*:STOP) - echo "$UNAME_MACHINE"-unknown-stop - exit ;; + GUESS="$UNAME_MACHINE"-unknown-stop + ;; i*86:atheos:*:*) - echo "$UNAME_MACHINE"-unknown-atheos - exit ;; + GUESS="$UNAME_MACHINE"-unknown-atheos + ;; i*86:syllable:*:*) - echo "$UNAME_MACHINE"-pc-syllable - exit ;; + GUESS="$UNAME_MACHINE"-pc-syllable + ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) - echo i386-unknown-lynxos"$UNAME_RELEASE" - exit ;; + GUESS=i386-unknown-lynxos"$UNAME_RELEASE" + ;; i*86:*DOS:*:*) - echo "$UNAME_MACHINE"-pc-msdosdjgpp - exit ;; + GUESS="$UNAME_MACHINE"-pc-msdosdjgpp + ;; i*86:*:4.*:*) UNAME_REL=$(echo "$UNAME_RELEASE" | sed 's/\/MP$//') if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then - echo "$UNAME_MACHINE"-univel-sysv"$UNAME_REL" + GUESS="$UNAME_MACHINE"-univel-sysv"$UNAME_REL" else - echo "$UNAME_MACHINE"-pc-sysv"$UNAME_REL" + GUESS="$UNAME_MACHINE"-pc-sysv"$UNAME_REL" fi - exit ;; + ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case $(/bin/uname -X | grep "^Machine") in @@ -1175,12 +1178,12 @@ EOF *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac - echo "$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}" - exit ;; + GUESS="$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}" + ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=$(sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=$( (/bin/uname -X|grep Release|sed -e 's/.*= //')) (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 @@ -1190,11 +1193,11 @@ EOF && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 - echo "$UNAME_MACHINE"-pc-sco"$UNAME_REL" + GUESS="$UNAME_MACHINE"-pc-sco"$UNAME_REL" else - echo "$UNAME_MACHINE"-pc-sysv32 + GUESS="$UNAME_MACHINE"-pc-sysv32 fi - exit ;; + ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about @@ -1202,31 +1205,31 @@ EOF # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configure will decide that # this is a cross-build. - echo i586-pc-msdosdjgpp - exit ;; + GUESS=i586-pc-msdosdjgpp + ;; Intel:Mach:3*:*) - echo i386-pc-mach3 - exit ;; + GUESS=i386-pc-mach3 + ;; paragon:*:*:*) - echo i860-intel-osf1 - exit ;; + GUESS=i860-intel-osf1 + ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then - echo i860-stardent-sysv"$UNAME_RELEASE" # Stardent Vistra i860-SVR4 + GUESS=i860-stardent-sysv"$UNAME_RELEASE" # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. - echo i860-unknown-sysv"$UNAME_RELEASE" # Unknown i860-SVR4 + GUESS=i860-unknown-sysv"$UNAME_RELEASE" # Unknown i860-SVR4 fi - exit ;; + ;; mini*:CTIX:SYS*5:*) # "miniframe" - echo m68010-convergent-sysv - exit ;; + GUESS=m68010-convergent-sysv + ;; mc68k:UNIX:SYSTEM5:3.51m) - echo m68k-convergent-sysv - exit ;; + GUESS=m68k-convergent-sysv + ;; M680?0:D-NIX:5.3:*) - echo m68k-diab-dnix - exit ;; + GUESS=m68k-diab-dnix + ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) @@ -1251,116 +1254,116 @@ EOF /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) - echo m68k-unknown-lynxos"$UNAME_RELEASE" - exit ;; + GUESS=m68k-unknown-lynxos"$UNAME_RELEASE" + ;; mc68030:UNIX_System_V:4.*:*) - echo m68k-atari-sysv4 - exit ;; + GUESS=m68k-atari-sysv4 + ;; TSUNAMI:LynxOS:2.*:*) - echo sparc-unknown-lynxos"$UNAME_RELEASE" - exit ;; + GUESS=sparc-unknown-lynxos"$UNAME_RELEASE" + ;; rs6000:LynxOS:2.*:*) - echo rs6000-unknown-lynxos"$UNAME_RELEASE" - exit ;; + GUESS=rs6000-unknown-lynxos"$UNAME_RELEASE" + ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) - echo powerpc-unknown-lynxos"$UNAME_RELEASE" - exit ;; + GUESS=powerpc-unknown-lynxos"$UNAME_RELEASE" + ;; SM[BE]S:UNIX_SV:*:*) - echo mips-dde-sysv"$UNAME_RELEASE" - exit ;; + GUESS=mips-dde-sysv"$UNAME_RELEASE" + ;; RM*:ReliantUNIX-*:*:*) - echo mips-sni-sysv4 - exit ;; + GUESS=mips-sni-sysv4 + ;; RM*:SINIX-*:*:*) - echo mips-sni-sysv4 - exit ;; + GUESS=mips-sni-sysv4 + ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=$( (uname -p) 2>/dev/null) - echo "$UNAME_MACHINE"-sni-sysv4 + GUESS="$UNAME_MACHINE"-sni-sysv4 else - echo ns32k-sni-sysv + GUESS=ns32k-sni-sysv fi - exit ;; + ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says - echo i586-unisys-sysv4 - exit ;; + GUESS=i586-unisys-sysv4 + ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm - echo hppa1.1-stratus-sysv4 - exit ;; + GUESS=hppa1.1-stratus-sysv4 + ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. - echo i860-stratus-sysv4 - exit ;; + GUESS=i860-stratus-sysv4 + ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. - echo "$UNAME_MACHINE"-stratus-vos - exit ;; + GUESS="$UNAME_MACHINE"-stratus-vos + ;; *:VOS:*:*) # From Paul.Green@stratus.com. - echo hppa1.1-stratus-vos - exit ;; + GUESS=hppa1.1-stratus-vos + ;; mc68*:A/UX:*:*) - echo m68k-apple-aux"$UNAME_RELEASE" - exit ;; + GUESS=m68k-apple-aux"$UNAME_RELEASE" + ;; news*:NEWS-OS:6*:*) - echo mips-sony-newsos6 - exit ;; + GUESS=mips-sony-newsos6 + ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if test -d /usr/nec; then - echo mips-nec-sysv"$UNAME_RELEASE" + GUESS=mips-nec-sysv"$UNAME_RELEASE" else - echo mips-unknown-sysv"$UNAME_RELEASE" + GUESS=mips-unknown-sysv"$UNAME_RELEASE" fi - exit ;; + ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. - echo powerpc-be-beos - exit ;; + GUESS=powerpc-be-beos + ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. - echo powerpc-apple-beos - exit ;; + GUESS=powerpc-apple-beos + ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. - echo i586-pc-beos - exit ;; + GUESS=i586-pc-beos + ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. - echo i586-pc-haiku - exit ;; + GUESS=i586-pc-haiku + ;; x86_64:Haiku:*:*) - echo x86_64-unknown-haiku - exit ;; + GUESS=x86_64-unknown-haiku + ;; SX-4:SUPER-UX:*:*) - echo sx4-nec-superux"$UNAME_RELEASE" - exit ;; + GUESS=sx4-nec-superux"$UNAME_RELEASE" + ;; SX-5:SUPER-UX:*:*) - echo sx5-nec-superux"$UNAME_RELEASE" - exit ;; + GUESS=sx5-nec-superux"$UNAME_RELEASE" + ;; SX-6:SUPER-UX:*:*) - echo sx6-nec-superux"$UNAME_RELEASE" - exit ;; + GUESS=sx6-nec-superux"$UNAME_RELEASE" + ;; SX-7:SUPER-UX:*:*) - echo sx7-nec-superux"$UNAME_RELEASE" - exit ;; + GUESS=sx7-nec-superux"$UNAME_RELEASE" + ;; SX-8:SUPER-UX:*:*) - echo sx8-nec-superux"$UNAME_RELEASE" - exit ;; + GUESS=sx8-nec-superux"$UNAME_RELEASE" + ;; SX-8R:SUPER-UX:*:*) - echo sx8r-nec-superux"$UNAME_RELEASE" - exit ;; + GUESS=sx8r-nec-superux"$UNAME_RELEASE" + ;; SX-ACE:SUPER-UX:*:*) - echo sxace-nec-superux"$UNAME_RELEASE" - exit ;; + GUESS=sxace-nec-superux"$UNAME_RELEASE" + ;; Power*:Rhapsody:*:*) - echo powerpc-apple-rhapsody"$UNAME_RELEASE" - exit ;; + GUESS=powerpc-apple-rhapsody"$UNAME_RELEASE" + ;; *:Rhapsody:*:*) - echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE" - exit ;; + GUESS="$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE" + ;; arm64:Darwin:*:*) - echo aarch64-apple-darwin"$UNAME_RELEASE" - exit ;; + GUESS=aarch64-apple-darwin"$UNAME_RELEASE" + ;; *:Darwin:*:*) UNAME_PROCESSOR=$(uname -p) case $UNAME_PROCESSOR in @@ -1396,43 +1399,43 @@ EOF # uname -m returns i386 or x86_64 UNAME_PROCESSOR=$UNAME_MACHINE fi - echo "$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE" - exit ;; + GUESS="$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE" + ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=$(uname -p) if test "$UNAME_PROCESSOR" = x86; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi - echo "$UNAME_PROCESSOR"-"$UNAME_MACHINE"-nto-qnx"$UNAME_RELEASE" - exit ;; + GUESS="$UNAME_PROCESSOR"-"$UNAME_MACHINE"-nto-qnx"$UNAME_RELEASE" + ;; *:QNX:*:4*) - echo i386-pc-qnx - exit ;; + GUESS=i386-pc-qnx + ;; NEO-*:NONSTOP_KERNEL:*:*) - echo neo-tandem-nsk"$UNAME_RELEASE" - exit ;; + GUESS=neo-tandem-nsk"$UNAME_RELEASE" + ;; NSE-*:NONSTOP_KERNEL:*:*) - echo nse-tandem-nsk"$UNAME_RELEASE" - exit ;; + GUESS=nse-tandem-nsk"$UNAME_RELEASE" + ;; NSR-*:NONSTOP_KERNEL:*:*) - echo nsr-tandem-nsk"$UNAME_RELEASE" - exit ;; + GUESS=nsr-tandem-nsk"$UNAME_RELEASE" + ;; NSV-*:NONSTOP_KERNEL:*:*) - echo nsv-tandem-nsk"$UNAME_RELEASE" - exit ;; + GUESS=nsv-tandem-nsk"$UNAME_RELEASE" + ;; NSX-*:NONSTOP_KERNEL:*:*) - echo nsx-tandem-nsk"$UNAME_RELEASE" - exit ;; + GUESS=nsx-tandem-nsk"$UNAME_RELEASE" + ;; *:NonStop-UX:*:*) - echo mips-compaq-nonstopux - exit ;; + GUESS=mips-compaq-nonstopux + ;; BS2000:POSIX*:*:*) - echo bs2000-siemens-sysv - exit ;; + GUESS=bs2000-siemens-sysv + ;; DS/*:UNIX_System_V:*:*) - echo "$UNAME_MACHINE"-"$UNAME_SYSTEM"-"$UNAME_RELEASE" - exit ;; + GUESS="$UNAME_MACHINE"-"$UNAME_SYSTEM"-"$UNAME_RELEASE" + ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 @@ -1442,32 +1445,32 @@ EOF elif test "x${cputype-}" != x; then UNAME_MACHINE="$cputype" fi - echo "$UNAME_MACHINE"-unknown-plan9 - exit ;; + GUESS="$UNAME_MACHINE"-unknown-plan9 + ;; *:TOPS-10:*:*) - echo pdp10-unknown-tops10 - exit ;; + GUESS=pdp10-unknown-tops10 + ;; *:TENEX:*:*) - echo pdp10-unknown-tenex - exit ;; + GUESS=pdp10-unknown-tenex + ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) - echo pdp10-dec-tops20 - exit ;; + GUESS=pdp10-dec-tops20 + ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) - echo pdp10-xkl-tops20 - exit ;; + GUESS=pdp10-xkl-tops20 + ;; *:TOPS-20:*:*) - echo pdp10-unknown-tops20 - exit ;; + GUESS=pdp10-unknown-tops20 + ;; *:ITS:*:*) - echo pdp10-unknown-its - exit ;; + GUESS=pdp10-unknown-its + ;; SEI:*:*:SEIUX) - echo mips-sei-seiux"$UNAME_RELEASE" - exit ;; + GUESS=mips-sei-seiux"$UNAME_RELEASE" + ;; *:DragonFly:*:*) - echo "$UNAME_MACHINE"-unknown-dragonfly"$(echo "$UNAME_RELEASE"|sed -e 's/[-(].*//')" - exit ;; + GUESS="$UNAME_MACHINE"-unknown-dragonfly"$(echo "$UNAME_RELEASE"|sed -e 's/[-(].*//')" + ;; *:*VMS:*:*) UNAME_MACHINE=$( (uname -p) 2>/dev/null) case $UNAME_MACHINE in @@ -1476,28 +1479,34 @@ EOF V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) - echo i386-pc-xenix - exit ;; + GUESS=i386-pc-xenix + ;; i*86:skyos:*:*) - echo "$UNAME_MACHINE"-pc-skyos"$(echo "$UNAME_RELEASE" | sed -e 's/ .*$//')" - exit ;; + GUESS="$UNAME_MACHINE"-pc-skyos"$(echo "$UNAME_RELEASE" | sed -e 's/ .*$//')" + ;; i*86:rdos:*:*) - echo "$UNAME_MACHINE"-pc-rdos - exit ;; + GUESS="$UNAME_MACHINE"-pc-rdos + ;; *:AROS:*:*) - echo "$UNAME_MACHINE"-unknown-aros - exit ;; + GUESS="$UNAME_MACHINE"-unknown-aros + ;; x86_64:VMkernel:*:*) - echo "$UNAME_MACHINE"-unknown-esx - exit ;; + GUESS="$UNAME_MACHINE"-unknown-esx + ;; amd64:Isilon\ OneFS:*:*) - echo x86_64-unknown-onefs - exit ;; + GUESS=x86_64-unknown-onefs + ;; *:Unleashed:*:*) - echo "$UNAME_MACHINE"-unknown-unleashed"$UNAME_RELEASE" - exit ;; + GUESS="$UNAME_MACHINE"-unknown-unleashed"$UNAME_RELEASE" + ;; esac +# Do we have a guess based on uname results? +if test "x$GUESS" != x; then + echo "$GUESS" + exit +fi + # No uname command or uname output not recognized. set_cc_for_build cat > "$dummy.c" < 0 && /^[[:space:]]+echo/ { + If_rewritten = 1 + rewrite_echo_line() +} + +In_main_case && /^[[:space:]]+exit ;;$/ && If_rewritten { + If_rewritten = 0 + print Indent";;" + next +} + +In_main_case && /^[[:space:]]+echo/ { + getline next_line + if (next_line !~ /^[[:space:]]+exit ;;/) { + # not the output-and-exit we seek here... + print + print next_line + next + } + + if (/-cray-/ && $3 == "|") { + # several Cray Unicos entries apply sed to the entire output in + # order to edit the UNAME_RELEASE field; fix these up + sub(/"\$UNAME_RELEASE"/, "\"$(echo &", $2) + $NF = $NF")\"" + } + + rewrite_echo_line() + if (next_line ~ /^[[:space:]]+exit ;;.+/) + sub(/^[[:space:]]+exit ;;/, ";; ", next_line) + else + sub(/^[[:space:]]+exit ;;/, ";;", next_line) + print $0 + print Indent next_line + next +} + +In_main_case && /^esac/ { + In_main_case = 0 + + print # "esac" + print "" + print "# Do we have a guess based on uname results?" + print "if test \"x$GUESS\" != x; then" + print " echo \"$GUESS\"" + print " exit" + print "fi" + + # Copy the rest of the input file + while (getline) print + nextfile +} + +{ print } -- 2.17.1 From MAILER-DAEMON Thu May 27 14:16:39 2021 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1lmKYh-0002Hs-Jx for mharc-config-patches@gnu.org; Thu, 27 May 2021 14:16:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37740) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lmKYc-0002C3-FJ for config-patches@gnu.org; Thu, 27 May 2021 14:16:36 -0400 Received: from mailbackend.panix.com ([166.84.1.89]:25177) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lmKYY-0007EY-RD; Thu, 27 May 2021 14:16:34 -0400 Received: from mail-yb1-f182.google.com (mail-yb1-f182.google.com [209.85.219.182]) by mailbackend.panix.com (Postfix) with ESMTPSA id 4FrbcD61nYz2qBh; Thu, 27 May 2021 14:16:28 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=panix.com; s=panix; t=1622139388; bh=rL3Ag8TskrIErB9Rlu3B9qjtFuBY58SvgarcbgOH3Dc=; h=References:In-Reply-To:From:Date:Subject:To:Cc; b=lCtQ3vIdzVX4Jr+QmUo8rXzbjE9GtPV+/Fc7Q8A4cohh45xMVFPv33cOB6KC9mnO6 tgbrNMODG1ntaSsxkA2JP3QhOomUnGwqFnQB8NCb4XjC8ZIUj/3D6QQo9afakLuSHa 92YQfA2aL2eSPkNzGN6LlBPsyUsiF87Bk/BhiB/A= Received: by mail-yb1-f182.google.com with SMTP id p184so1913977yba.11; Thu, 27 May 2021 11:16:28 -0700 (PDT) X-Gm-Message-State: AOAM530h1j9TpksQN4tdvb+G9CUPdmhymD94PazQMsvEhg18oPovAEaP PdelQc4jB+TwRac41qh+IAF2yEX4szFvz4d9kT0= X-Google-Smtp-Source: ABdhPJwp1Nx/nJrDCAHR1LvyDLhvl4wnz9trrqxbyqmC5sCaGmMd1Mvszim3amWxw4CaV7tpYE3Ij8d8IejJnWnZH5E= X-Received: by 2002:a25:f50c:: with SMTP id a12mr6296863ybe.509.1622139388455; Thu, 27 May 2021 11:16:28 -0700 (PDT) MIME-Version: 1.0 References: <60A9D7B3.9080405@gmail.com> <60AC537C.30207@gmail.com> In-Reply-To: <60AC537C.30207@gmail.com> From: Zack Weinberg Date: Thu, 27 May 2021 14:16:17 -0400 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 0/6] restore compatibility with pre-POSIX shells in config.guess To: jcb62281@gmail.com Cc: Jacob Bachmeyer , config-patches@gnu.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=166.84.1.89; envelope-from=zackw@panix.com; helo=mailbackend.panix.com X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: config-patches@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Patches for the config.guess and config.sub scripts" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 May 2021 18:16:36 -0000 On Mon, May 24, 2021 at 9:31 PM Jacob Bachmeyer wrote: > Zack Weinberg wrote: > > On Sun, May 23, 2021 at 12:19 AM Jacob Bachmeyer w= rote: > >> Zack Weinberg wrote: > >>> =E2=80=9C*All* shell variable interpolations will be inside double qu= otes, > >>> except when word splitting of the result is *desired*=E2=80=9D is still the overarching principle I am insisting on. > > OK, so, I'm willing to accept > > > > var=3D`expression` > > > > being written without an outer set of double quotes, but I insist on > > this being the _only_ exception; in particular I insist on > > > > case "$var" in ... esac > > There are also uses of "case `command` in ... esac" in config.guess. How about we turn all of those into result=3D`command` case "$result" in ... esac and, generalizing, use command substitution _only_ as the RHS of an assignment to a variable? In addition to eliminating an additional exception to the above principle, this will facilitate future changes to check for errors in all of the `commands`. > > var=3D"anything that doesn't involve backticks and isn't better written > > with single quotes" > > > > being written _with_ the double quotes. I will bow to additional > > exceptions only when there are other bugs in older shells that > > _require_ us not to use double quotes around variable substitutions. > > Your example for a variable assignment legitimately requires quotes, That wasn't meant to be taken as a literal example, it was meant to be taken as a statement of the rule: the right hand side of a variable assignment shall _always_ be quoted, even if the quoting is technically unnecessary. Use single quotes whenever possible, backquotes for command substitution (in which case the RHS of the assignment should be a _single_ command substitution and nothing else), and double quotes for any RHS requiring variable substitution. I _might_ consider allowing the RHS not to be quoted when it is an integer constant. > However, there is no need to use quotes when expanding variables in > an assignment that is a single literal word, since the shell does > not perform word-splitting in contexts where only one word is > permitted. I am saying that I want the quotation to be there _even though_ it's not technically necessary. The only time a shell variable expansion shouldn't be quoted is when that expansion is _intended_ to be word-split. I do not want to have to think about the contextual rules for whether an expansion will, or will not, happen; I only want to have to think about whether an expansion _should_ happen, which is a function of the variable itself, not the context where it's being used. ... > your style works well with Autoconf, but I do not believe that it > works as well with scripts that are intended to be hand-edited. I developed this style rule _for_ hand-edited scripts, long before I ever started hacking on Autoconf; it's entirely about not having to think about whether it is "safe" to leave the quotes off. I prefer it unconditionally. > Emacs produces better syntax highlighting, clearly showing the > actual variables being substituted, if the expression is unquoted. That sounds like something that should be fixed in Emacs. > > (N.B. arguments from the availability of shellcheck would cut rather > > more ice with me if we had _any form whatsoever_ of CI in this > > project.) > > There is a testsuite that can be easily run with "make check-guess", > although some tests will fail on non-GNU systems, as the code paths for > identifying GNU variants tend to assume that GNU tools are available. It's the _automatic_ running of tests on submitted patches that is lacking here. zw From MAILER-DAEMON Thu May 27 14:17:25 2021 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1lmKZQ-0002gJ-SF for mharc-config-patches@gnu.org; Thu, 27 May 2021 14:17:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37992) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lmKZP-0002f9-FM for config-patches@gnu.org; Thu, 27 May 2021 14:17:23 -0400 Received: from mailbackend.panix.com ([166.84.1.89]:25539) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lmKZM-0007j4-S1; Thu, 27 May 2021 14:17:23 -0400 Received: from mail-yb1-f174.google.com (mail-yb1-f174.google.com [209.85.219.174]) by mailbackend.panix.com (Postfix) with ESMTPSA id 4FrbdD0C1dz2qHR; Thu, 27 May 2021 14:17:20 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=panix.com; s=panix; t=1622139440; bh=Kd/sUDyGshUADMudtB1pBsnyHQT/4UbKntrlHm0nzZQ=; h=References:In-Reply-To:From:Date:Subject:To:Cc; b=nDz230jTVR7fNgLOfzOA3an4rQG0VsgQkMpvB0lpR+gVCw8fXWVGxPP7zNcxegvZQ prKf9KoTvXg63mVyl5ty1R/CiuC5D+757g357rwihSkZn6OuhzfVbTTvwwCZu/14XT NZe0Qb1JTd8oQQz2WQFjUN8sl9Q0SbQPtl1Eadqs= Received: by mail-yb1-f174.google.com with SMTP id w1so1977568ybt.1; Thu, 27 May 2021 11:17:19 -0700 (PDT) X-Gm-Message-State: AOAM532biuIkUkxMZdCzdv8dGgOkp9xqZvcC0bhNlro61sAPQQjK2a+m J0cusGUmx/snB5tkLfl050jwwsdL9rWk8/9hwKQ= X-Google-Smtp-Source: ABdhPJzDx6k8bA03P2WPc21iSfQXDwVRQ6aCfMln7ZFiC8QYmzYSmdntqa/6I3rP62U/J32yNiU/YYNjOLtw1ySCpc4= X-Received: by 2002:a25:7ec4:: with SMTP id z187mr6278611ybc.136.1622139439697; Thu, 27 May 2021 11:17:19 -0700 (PDT) MIME-Version: 1.0 References: <60AF0724.1020006@gmail.com> In-Reply-To: <60AF0724.1020006@gmail.com> From: Zack Weinberg Date: Thu, 27 May 2021 14:17:08 -0400 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 0/8] restore compatibility with pre-POSIX shells in config.guess To: jcb62281@gmail.com Cc: Jacob Bachmeyer , config-patches@gnu.org Content-Type: text/plain; charset="UTF-8" Received-SPF: pass client-ip=166.84.1.89; envelope-from=zackw@panix.com; helo=mailbackend.panix.com X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: config-patches@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Patches for the config.guess and config.sub scripts" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 May 2021 18:17:23 -0000 On Wed, May 26, 2021 at 10:42 PM Jacob Bachmeyer wrote: > Jacob Bachmeyer wrote: > > [...] > > Jacob Bachmeyer (8): > > config.guess: use intermediate variable with uname results > > config.guess: manual fixups after previous automatic patch > > config.guess: remove unneeded quotes and factor command substitutions > > config.guess: automatic fixups after previous automated patch > > config.guess: manual fixup after previous automated patches > > config.guess: replace POSIX $( ) with classic ` ` throughout > > config.guess: manual fixups after previous automatic patch > > remove automatic patch generators For the record, I still object to the removal of "unneeded" quotation, as is still being discussed in the previous thread. zw From MAILER-DAEMON Thu May 27 21:56:25 2021 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1lmRjd-0001qg-N7 for mharc-config-patches@gnu.org; Thu, 27 May 2021 21:56:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37172) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lmRjc-0001qX-7T for config-patches@gnu.org; Thu, 27 May 2021 21:56:24 -0400 Received: from mail-oi1-x233.google.com ([2607:f8b0:4864:20::233]:43596) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lmRja-0001bx-Cn; Thu, 27 May 2021 21:56:23 -0400 Received: by mail-oi1-x233.google.com with SMTP id j75so2759573oih.10; Thu, 27 May 2021 18:56:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:date:from:reply-to:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-transfer-encoding; bh=dWIoHc940mvS9XqYrETY7UAEwDxxYKZ2C7NX5jy6knU=; b=ZwEEpAEH2k2/9nJDPzC36E3MpH0zsoqkKUaoOw85uDcBLIhSLP4mR95XSY/wIffLwa hW6h1SNFmp8NfWdt92+Vrcra2qAE1V5TDRDiLGq1U+ypLAmPjxaCDOQu5ecPSLL6UdaC HpNiEbFFYLrMWf2aFWUPXZhFtEEGu2rlVyIAKrJlRyF/pqK+WRlF3dv3o46EUNDvJ4XF WZHQ0yJMSKvXmUS32DrUWyR/Xmc0Jabvs++zCv0wTZ5dQ4fa01FH0fF6BHnYeUc2cdUk YDc2WyRAsOZLjYd6CNNriU9cLTEqwMEU+AYuvV/4dW5qWlbvXCHdODcO6q5XsVlO4a0W TdpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:date:from:reply-to:user-agent :mime-version:to:cc:subject:references:in-reply-to :content-transfer-encoding; bh=dWIoHc940mvS9XqYrETY7UAEwDxxYKZ2C7NX5jy6knU=; b=gLIG6HS9FNEbsmmKcu5b3gpnk7lyJS5cNCVf5s8cw7edHWV4JftGpmv46YOKfrLwtV oExmwG7jTW1KY4W8KJe/1M6z9aMAwEww0bkbsNFFoN/ZRnB5rJdn9lF2ASz0SWEOW1FS OEU/ViU/ynTepB9t875BxZQRZDxhfSeXEzkHDjKToOMC3Ghuf6uPqaa6Htn3PIM9utKd j1Xrjv6qnqSdvD2I1HyJybyjg9oWhv8bS0YCgtrLespSFkPNMs7WwJBCvvLyqA3YqCCQ Hk1R0N+7wmo3rBn3g6T+n1bNhmARj/GtZH2B/V/ofQvRcQxSXQeY+ARmyL16Pk16+6TM /dXg== X-Gm-Message-State: AOAM5318Vm6iD7r52hj9dWCqKh5JFae5DGjf4imRgG/4z8cZ2lEQrYtQ LUqnKO5QdL+0J2wHzLzGwp0= X-Google-Smtp-Source: ABdhPJzlYP9TOtfYc1sLDnJPQcHQ0DUhKyPThFYDOA3ioKqFmhjakKfiC7Zau4DjJMWl+ZP/CkEclA== X-Received: by 2002:a05:6808:8cb:: with SMTP id k11mr7306989oij.103.1622166980074; Thu, 27 May 2021 18:56:20 -0700 (PDT) Received: from [192.168.2.42] (adsl-70-133-144-190.dsl.ablntx.sbcglobal.net. [70.133.144.190]) by smtp.gmail.com with ESMTPSA id n13sm810916oov.30.2021.05.27.18.56.18 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 27 May 2021 18:56:19 -0700 (PDT) Message-ID: <60B04DC2.80600@gmail.com> Date: Thu, 27 May 2021 20:56:18 -0500 From: Jacob Bachmeyer Reply-To: jcb62281@gmail.com User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.8.1.22) Gecko/20090807 MultiZilla/1.8.3.4e SeaMonkey/1.1.17 Mnenhy/0.7.6.0 MIME-Version: 1.0 To: Zack Weinberg CC: Jacob Bachmeyer , config-patches@gnu.org Subject: Re: [PATCH 0/6] restore compatibility with pre-POSIX shells in config.guess References: <60A9D7B3.9080405@gmail.com> <60AC537C.30207@gmail.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2607:f8b0:4864:20::233; envelope-from=jcb62281@gmail.com; helo=mail-oi1-x233.google.com X-Spam_score_int: -15 X-Spam_score: -1.6 X-Spam_bar: - X-Spam_report: (-1.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, FREEMAIL_REPLYTO_END_DIGIT=0.25, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: config-patches@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Patches for the config.guess and config.sub scripts" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 May 2021 01:56:24 -0000 Zack Weinberg wrote: > On Mon, May 24, 2021 at 9:31 PM Jacob Bachmeyer wrote: > >> Zack Weinberg wrote: >> >>> On Sun, May 23, 2021 at 12:19 AM Jacob Bachmeyer wrote: >>> >>>> Zack Weinberg wrote: >>>> >>>>> “*All* shell variable interpolations will be inside double quotes, >>>>> except when word splitting of the result is *desired*” >>>>> > > is still the overarching principle I am insisting on. > I still disagree. >>> OK, so, I'm willing to accept >>> >>> var=`expression` >>> >>> being written without an outer set of double quotes, but I insist on >>> this being the _only_ exception; in particular I insist on >>> >>> case "$var" in ... esac >>> >> There are also uses of "case `command` in ... esac" in config.guess. >> > > How about we turn all of those into > > result=`command` > case "$result" in > ... > esac > > and, generalizing, use command substitution _only_ as the RHS of an > assignment to a variable? In addition to eliminating an additional > exception to the above principle, this will facilitate future changes > to check for errors in all of the `commands`. > Why? The purpose of quotes in the shell is to allow a single WORD to contain whitespace or other field separators. The RHS of an assignment and the data field in "case" are both places that only allow a single WORD, therefore variable expansions and command substitutions are implicitly quoted in those contexts. If nothing else, never quoting these explicitly helps to remind that splitting and glob expansion /are/ /not/ /done/ in those contexts, avoiding "why did this not work?" questions. Nor can you reliably check for error exits from all of the commands run, unless you have an entire retrocomputing museum available to verify that none of the obscure commands used on various obscure systems return a valid result and an error exit code. >>> var="anything that doesn't involve backticks and isn't better written >>> with single quotes" >>> >>> being written _with_ the double quotes. I will bow to additional >>> exceptions only when there are other bugs in older shells that >>> _require_ us not to use double quotes around variable substitutions. >>> >> Your example for a variable assignment legitimately requires quotes, >> > > That wasn't meant to be taken as a literal example, it was meant to be > taken as a statement of the rule: the right hand side of a variable > assignment shall _always_ be quoted, even if the quoting is > technically unnecessary. Use single quotes whenever possible, > backquotes for command substitution (in which case the RHS of the > assignment should be a _single_ command substitution and nothing else), > and double quotes for any RHS requiring variable substitution. > > I _might_ consider allowing the RHS not to be quoted when it is an > integer constant. > > >> However, there is no need to use quotes when expanding variables in >> an assignment that is a single literal word, since the shell does >> not perform word-splitting in contexts where only one word is >> permitted. >> > > I am saying that I want the quotation to be there _even though_ it's > not technically necessary. The only time a shell variable expansion > shouldn't be quoted is when that expansion is _intended_ to be > word-split. > Code style rules that ignore (or work against) underlying language rules are uncomfortably close to cargo cult programming for my tastes. The shell does not recognize that intent, but instead performs word-splitting in certain contexts (such as building argument lists for commands) and not in others (were only one word is allowed anyway). > I do not want to have to think about the contextual rules for whether > an expansion will, or will not, happen; I only want to have to think > about whether an expansion _should_ happen, which is a function of the > variable itself, not the context where it's being used. > Except that splitting is only available in certain contexts, so the contextual rules are still important, even if you prefer to pretend that they do not exist. >> your style works well with Autoconf, but I do not believe that it >> works as well with scripts that are intended to be hand-edited. >> > > I developed this style rule _for_ hand-edited scripts, long before I > ever started hacking on Autoconf; it's entirely about not having to > think about whether it is "safe" to leave the quotes off. I prefer it > unconditionally. > I prefer otherwise unconditionally. I may use your style if I ever contribute code to Autoconf, at least to match the style in existing code, but I consider this rule to be silly. >> Emacs produces better syntax highlighting, clearly showing the >> actual variables being substituted, if the expression is unquoted. >> > > That sounds like something that should be fixed in Emacs. > Quoted strings have higher priority than variable substitutions and I do not understand the Emacs syntax highlighting machinery well enough yet to even attempt to change that. >>> (N.B. arguments from the availability of shellcheck would cut rather >>> more ice with me if we had _any form whatsoever_ of CI in this >>> project.) >>> >> There is a testsuite that can be easily run with "make check-guess", >> although some tests will fail on non-GNU systems, as the code paths for >> identifying GNU variants tend to assume that GNU tools are available. >> > > It's the _automatic_ running of tests on submitted patches that is > lacking here. What need is there for that for something this simple? Can not the maintainer take care of testing submitted patches? -- Jacob From MAILER-DAEMON Thu May 27 21:56:35 2021 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1lmRjn-00026O-JW for mharc-config-patches@gnu.org; Thu, 27 May 2021 21:56:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37202) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lmRjl-00023C-6n for config-patches@gnu.org; Thu, 27 May 2021 21:56:33 -0400 Received: from mail-ot1-x330.google.com ([2607:f8b0:4864:20::330]:41527) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lmRjj-0001iI-Nc; Thu, 27 May 2021 21:56:32 -0400 Received: by mail-ot1-x330.google.com with SMTP id 36-20020a9d0ba70000b02902e0a0a8fe36so2092916oth.8; Thu, 27 May 2021 18:56:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:date:from:reply-to:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-transfer-encoding; bh=o4/ut/SU3kEdOYViDY/xaNpbXzGAGLL/tadRP+9W5Fs=; b=tG+50SMyswVuESg1HGhR4Z0CdjFJzRHJvSGbhevQsMxnsqyIi0+oTmskSpGzDC/I5O I2zJe/VADIL/rZM8eBeabeuP66aWRYqHhAoBuKoaIVl4YVf3XqbBsEVigO76B/7ALnYk o6tTTKoSU8h6yjJI9DP5VUB9p5JkURHcSCOd6vQ9/3NwmazzhvXjSnY8fk9VGn3I5VnI jgfmJp5bidKOGtfWHGB5C+YJauzj3JP3zlSxlJ3NddjPMkP/EI9tiqt/7JwQ7XNQhSvd AnobcWX+rd56Zh58JtDkkUbzIoJNi/uA1xnVtABab8fTfmplqIXdgB0vNIK6rM3eXzZH kUMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:date:from:reply-to:user-agent :mime-version:to:cc:subject:references:in-reply-to :content-transfer-encoding; bh=o4/ut/SU3kEdOYViDY/xaNpbXzGAGLL/tadRP+9W5Fs=; b=kXu+IkcdhHWPo6/tqgM5cAkOjPeK9psP3yt4HYGKLZxhbVpOxe89NH2QuzwpoVe/+a 4N0xm4I/g2opCzPkmY04WRe9/FEGeTawE+npMqqyTKKxfrps8+HgJrSfB/NDNIIhyANI 23l2lea9ie32OvfuFuvDz/M69fXuN/sp0My+dAzgeF/BKaMRVreogEn6cA+U/DI4zcIK hHtV8dOWCfE/ine9fT8hrupeCtT9qAZ0v9CYPiBVpXLFSsaYxkzOW2rEoDM6crGgJa/D 6uKr51PSL4uc716il/YzDpKZT97RcGWwHWbxj8YzVuaIXVNj28mZu7RM+RipDGe4BCMY LdAw== X-Gm-Message-State: AOAM5334tK7XyjXQmJvySAGypYQZw44BcubKc8xM0S4iyrndp8QXosPD e+EEEuqY1lieLfhyg41oago= X-Google-Smtp-Source: ABdhPJxhH2n02ADFGcJdcpcBDZdEUFvLp+r0hlyEJFnpGeTaKgMG1PjME+9vpMDTJ9PfePgMmwzmtQ== X-Received: by 2002:a05:6830:1e70:: with SMTP id m16mr5071046otr.340.1622166990251; Thu, 27 May 2021 18:56:30 -0700 (PDT) Received: from [192.168.2.42] (adsl-70-133-144-190.dsl.ablntx.sbcglobal.net. [70.133.144.190]) by smtp.gmail.com with ESMTPSA id d1sm902317otu.9.2021.05.27.18.56.29 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 27 May 2021 18:56:30 -0700 (PDT) Message-ID: <60B04DCD.60607@gmail.com> Date: Thu, 27 May 2021 20:56:29 -0500 From: Jacob Bachmeyer Reply-To: jcb62281@gmail.com User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.8.1.22) Gecko/20090807 MultiZilla/1.8.3.4e SeaMonkey/1.1.17 Mnenhy/0.7.6.0 MIME-Version: 1.0 To: Zack Weinberg CC: Jacob Bachmeyer , config-patches@gnu.org Subject: Re: [PATCH v2 0/8] restore compatibility with pre-POSIX shells in config.guess References: <60AF0724.1020006@gmail.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Received-SPF: pass client-ip=2607:f8b0:4864:20::330; envelope-from=jcb62281@gmail.com; helo=mail-ot1-x330.google.com X-Spam_score_int: -15 X-Spam_score: -1.6 X-Spam_bar: - X-Spam_report: (-1.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, FREEMAIL_REPLYTO_END_DIGIT=0.25, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: config-patches@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Patches for the config.guess and config.sub scripts" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 May 2021 01:56:33 -0000 Zack Weinberg wrote: > On Wed, May 26, 2021 at 10:42 PM Jacob Bachmeyer wrote: > >> Jacob Bachmeyer wrote: >> >>> [...] >>> Jacob Bachmeyer (8): >>> config.guess: use intermediate variable with uname results >>> config.guess: manual fixups after previous automatic patch >>> config.guess: remove unneeded quotes and factor command substitutions >>> config.guess: automatic fixups after previous automated patch >>> config.guess: manual fixup after previous automated patches >>> config.guess: replace POSIX $( ) with classic ` ` throughout >>> config.guess: manual fixups after previous automatic patch >>> remove automatic patch generators >>> > > For the record, I still object to the removal of "unneeded" quotation, > as is still being discussed in the previous thread. For the record, I still object to useless quotation and stand by my patches to clean them up. Style rules that ignore language rules are asking for trouble. -- Jacob