From nobody Mon Apr 29 16:39:56 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1507890567637650.2882679298369; Fri, 13 Oct 2017 03:29:27 -0700 (PDT) Received: from localhost ([::1]:49444 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e2xDO-0001c4-9w for importer@patchew.org; Fri, 13 Oct 2017 06:29:14 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58595) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e2xCZ-0001Ka-Cw for qemu-devel@nongnu.org; Fri, 13 Oct 2017 06:28:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e2xCV-00029B-EG for qemu-devel@nongnu.org; Fri, 13 Oct 2017 06:28:23 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58558) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e2xCV-00028K-8Y for qemu-devel@nongnu.org; Fri, 13 Oct 2017 06:28:19 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2908BC047B99; Fri, 13 Oct 2017 10:28:18 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.42.22.189]) by smtp.corp.redhat.com (Postfix) with ESMTP id 56C2B51895; Fri, 13 Oct 2017 10:28:17 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 2908BC047B99 Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=berrange@redhat.com From: "Daniel P. Berrange" To: qemu-devel@nongnu.org Date: Fri, 13 Oct 2017 11:28:12 +0100 Message-Id: <20171013102812.29648-1-berrange@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Fri, 13 Oct 2017 10:28:18 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH] configure: pick the right compiler for OpenBSD by default X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Paolo Bonzini Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" The system compiler in OpenBSD is gcc 4.2.1 which is too old for our needs. If doing 'pkg_add gcc' you can get a much newer version (4.9.4 in OpenBSD 6.1) which works with QEMU. This installs binaries with two naming schemes: $ pkg_info -L gcc | grep bin /usr/local/bin/ecpp /usr/local/bin/egcc /usr/local/bin/egcc-ar /usr/local/bin/egcc-nm /usr/local/bin/egcc-ranlib /usr/local/bin/egcov /usr/local/bin/x86_64-unknown-openbsd6.0-egcc /usr/local/bin/x86_64-unknown-openbsd6.0-egcc-ar /usr/local/bin/x86_64-unknown-openbsd6.0-egcc-nm /usr/local/bin/x86_64-unknown-openbsd6.0-egcc-ranlib /usr/local/bin/x86_64-unknown-openbsd6.0-gcc-4.9.3 We pick the short name this it won't change across OpenBSD releases. This means users don't need to manually pass custom --cc and --cxx args to configure to avoid immediate failure. Signed-off-by: Daniel P. Berrange --- configure | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 06f18ea9af..fcb7523933 100755 --- a/configure +++ b/configure @@ -255,7 +255,21 @@ cross_prefix=3D"" audio_drv_list=3D"" block_drv_rw_whitelist=3D"" block_drv_ro_whitelist=3D"" -host_cc=3D"cc" + +case `uname -s` in + OpenBSD) + # Default system cc in OpenBSD is unsufficient + # we need the 'gcc' pkg added, whch provides + # these modified binary names + host_cc=3D"egcc" + host_cxx=3D"eg++" + ;; + *) + host_cc=3D"cc" + host_cxx=3D"c++" + ;; +esac + libs_softmmu=3D"" libs_tools=3D"" audio_pt_int=3D"" @@ -466,7 +480,7 @@ else fi =20 if test -z "${CXX}${cross_prefix}"; then - cxx=3D"c++" + cxx=3D"$host_cxx" else cxx=3D"${CXX-${cross_prefix}g++}" fi --=20 2.13.5