Subject: bug#57029: macos cannot build emacs after updated gcc and libgccjit to 12.1

From: Gerd Möllmann <[email-masked]>
Date: Mon, 08 Aug 2022 08:03:45 +0200

Eli Zaretskii <[email-masked]> writes:

>> -          MAC_LIBS="-L$(dirname $($BREW ls -v libgccjit| \
>> -                                            grep -E 'libgccjit\.(so|dylib)$'))"
>> +          MAC_LIBS="-L$(dirname $($BREW ls -v libgccjit | \
>> +                                  grep -E 'current/libgccjit\.(so|dylib)$' | \
>> +                                  head -1))"
>> +          if test "x${MAC_LIBS}" = "x-L"; then

The 'x' is kind of confusing here because MAC_LIBS can't be empty at
this point.

> Is 'dirname' guaranteed to be available?

Yes (POSIX).  And it was used already.