From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dan Ports Newsgroups: gmane.emacs.bugs Subject: bug#50649: [patch] configure: fix libgccjit detection on MacPorts Date: Fri, 17 Sep 2021 16:19:21 -0700 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="f1s86jY6xkHbrSsi" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18307"; mail-complaints-to="usenet@ciao.gmane.io" To: 50649@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Sep 18 03:05:26 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mROnE-0004Xz-HL for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 18 Sep 2021 03:05:24 +0200 Original-Received: from localhost ([::1]:56602 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mROnC-0003td-LN for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 17 Sep 2021 21:05:22 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48778) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mROmt-0003tS-Ef for bug-gnu-emacs@gnu.org; Fri, 17 Sep 2021 21:05:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:49962) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mROmt-00077t-74 for bug-gnu-emacs@gnu.org; Fri, 17 Sep 2021 21:05:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mROms-0002Pp-K3 for bug-gnu-emacs@gnu.org; Fri, 17 Sep 2021 21:05:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dan Ports Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 18 Sep 2021 01:05:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 50649 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.16319270499215 (code B ref -1); Sat, 18 Sep 2021 01:05:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 18 Sep 2021 01:04:09 +0000 Original-Received: from localhost ([127.0.0.1]:33275 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mROly-0002OW-3o for submit@debbugs.gnu.org; Fri, 17 Sep 2021 21:04:09 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:38166) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mRN8p-0008Fj-7T for submit@debbugs.gnu.org; Fri, 17 Sep 2021 19:19:39 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33024) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mRN8p-0000b7-28 for bug-gnu-emacs@gnu.org; Fri, 17 Sep 2021 19:19:35 -0400 Original-Received: from geoduck.ambulatoryclam.net ([67.40.19.211]:36140) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mRN8i-00014J-67 for bug-gnu-emacs@gnu.org; Fri, 17 Sep 2021 19:19:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ambulatoryclam.net; s=geoduck; t=1631920761; bh=3t0OUDKgtkBu4sNxWUKDi9ZmhFI324JqDGtIQAw4VcQ=; h=Date:From:To:Subject:From; b=le/RbPGogB/SFIRAtrL9jkzY0Jk6cTT7ODKDKDIUa/S5ar13NjC4E5dkj+TOmMHxn AGtSrEhu+9JuLHJ4IxamNwNmeYoUILDLdxhyxgPUl+zXghQ4GcD52PTvX+wdEM/TYO bXw7wgM/Yen4seRHlTNtqCyjCvvoew5tvWxoO/P0= Original-Received: by geoduck.ambulatoryclam.net (Postfix, from userid 1012) id 15550362013F; Fri, 17 Sep 2021 16:19:21 -0700 (PDT) Content-Disposition: inline Received-SPF: pass client-ip=67.40.19.211; envelope-from=dan@drkp.net; helo=geoduck.ambulatoryclam.net 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, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, SPF_PASS=-0.001, T_SPF_HELO_TEMPERROR=0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Fri, 17 Sep 2021 21:04:04 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:214594 Archived-At: --f1s86jY6xkHbrSsi Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Tags: patch The current code in configure checks if a MacPorts gcc port is installed in order to find libgccjit, but it fails if more than one gcc port is installed (e.g., both gcc10 and gcc11). The attached patch fixes it to return only one version -- specifically, the latest version (with a bit of ugliness because gcc4x sorts after gcc11) Dan -- Dan R. K. Ports https://drkp.net/ --f1s86jY6xkHbrSsi Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="patch-libgccjit-macports.diff" diff --git a/configure.ac b/configure.ac index 1146b581cd..2ef78985ef 100644 --- a/configure.ac +++ b/configure.ac @@ -3838,9 +3838,11 @@ AC_DEFUN if test -n "$HAVE_MACPORTS"; then # Determine which gcc version has been installed (gcc11, for - # instance). + # instance). Use the latest version, if more than one is + # available. PORT_PACKAGE=$(port installed active | grep '^ *gcc@<:@0-9@:>@* ' | \ - awk '{ print $1; }') + awk '{ print $1; }' | grep -v 'gcc4@<:@0-9@:>@' | \ + sort -V | tail -n 1) if test -n "$PORT_PACKAGE"; then MAC_CFLAGS="-I$(dirname $(port contents $PORT_PACKAGE | \ grep libgccjit.h))" --f1s86jY6xkHbrSsi--