emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] unbreak macOS w/homebrew --with-native-compilation build


From: Alexander Adolf
Subject: [PATCH] unbreak macOS w/homebrew --with-native-compilation build
Date: Thu, 18 Aug 2022 22:31:44 +0200

Hello,

I upgraded the homebrew packages on my macOS today, and after that could
not build --with-native-compilation any more. It turns out that there is
more than one location for libgccjit.dylib:

---------------------------- Begin Quote -----------------------------
example$ brew ls libgccjit | grep -E 'libgccjit\.(so|dylib)$'
/usr/local/Cellar/libgccjit/12.1.0/lib/gcc/current/libgccjit.dylib
/usr/local/Cellar/libgccjit/12.1.0/lib/gcc/12/libgccjit.dylib
----------------------------- End Quote ------------------------------

This causes MAC_LIBS to end up being set to just '-L' because dirname
throws up an error message when presented with a multi-line string.

The patch below fixes this by simply picking the first line.


Hoping to have helped,

  --alexander


>From 48aa2035094e713cac1f2d9499d7feeba1b9c5dc Mon Sep 17 00:00:00 2001
From: Alexander Adolf <alexander.adolf@condition-alpha.com>
Date: Thu, 18 Aug 2022 22:09:34 +0200
Subject: [PATCH] Fix finding libgccjit.dylib on homebrew macOS

* configure.ac: when more than one path to libgccjit.dylib is
available, use the first one only
---
 configure.ac | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index 1a264275bd..42c5ee6c76 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4240,8 +4240,9 @@ AC_DEFUN
         if test -n "`$BREW --prefix --installed libgccjit 2>/dev/null`"; then
           MAC_CFLAGS="-I$(dirname $($BREW ls -v libgccjit | \
                                                 grep libgccjit.h))"
-          MAC_LIBS="-L$(dirname $($BREW ls -v libgccjit| \
-                                            grep -E 'libgccjit\.(so|dylib)$'))"
+          MAC_LIBS="-L$(dirname $($BREW ls -v libgccjit | \
+                                            grep -E 'libgccjit\.(so|dylib)$' | 
\
+                                            head -n 1))"
         fi
       fi
 
-- 
2.37.2


reply via email to

[Prev in Thread] Current Thread [Next in Thread]