unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Dan Ports <dan@drkp.net>
To: 50649@debbugs.gnu.org
Subject: bug#50649: [patch] configure: fix libgccjit detection on MacPorts
Date: Fri, 17 Sep 2021 16:19:21 -0700	[thread overview]
Message-ID: <YUUieQa598Y6o4mK@geoduck.ambulatoryclam.net> (raw)

[-- Attachment #1: Type: text/plain, Size: 427 bytes --]

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/

[-- Attachment #2: patch-libgccjit-macports.diff --]
[-- Type: text/x-diff, Size: 806 bytes --]

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))"

             reply	other threads:[~2021-09-17 23:19 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-17 23:19 Dan Ports [this message]
2021-09-18 14:04 ` bug#50649: [patch] configure: fix libgccjit detection on MacPorts Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YUUieQa598Y6o4mK@geoduck.ambulatoryclam.net \
    --to=dan@drkp.net \
    --cc=50649@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).