* [PATCH] unbreak macOS w/homebrew --with-native-compilation build
@ 2022-08-18 20:31 Alexander Adolf
0 siblings, 0 replies; only message in thread
From: Alexander Adolf @ 2022-08-18 20:31 UTC (permalink / raw)
To: emacs-devel
[-- Attachment #1: Type: text/plain, Size: 775 bytes --]
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
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Fix-finding-libgccjit.dylib-on-homebrew-macOS.patch --]
[-- Type: text/x-patch, Size: 1142 bytes --]
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
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2022-08-18 20:31 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-18 20:31 [PATCH] unbreak macOS w/homebrew --with-native-compilation build Alexander Adolf
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).