mirror of https://github.com/profanity-im/profanity.git synced 2024-06-16 21:35:24 +00:00

Make readline check more portable

Currently, `configure.ac` assumes Readline is installed via Homebrew in
`/usr/local`. This doesn't work for Homebrew on Apple Silicon, or

Let's fix this by checking for a `brew` installation, and querying that
for Readline's prefix if available. If not, it checks for an existing
MacPorts prefix, and finally falls back to checking `/usr/local` in case
a user installed Readline for themselves there.
This commit is contained in:
Carlo Cabrera 2021-11-23 21:57:02 +08:00
parent 9a9122c148
commit 315d862e22
No known key found for this signature in database
GPG Key ID: C74D447FC549A1D0

View File

@ -210,10 +210,19 @@ AS_IF([test "x$enable_icons_and_clipboard" != xno],
[AC_MSG_NOTICE([gtk+-3.0/gtk+2.0 not found, icons and clipboard not enabled])])])])])
AS_IF([test "x$PLATFORM" = xosx],
[AC_PATH_PROG([BREW], [brew], ["failed"],
AS_IF([test "x$BREW" = xfailed],
[READLINE_PREFIX="`$BREW --prefix readline`"])])
AS_IF([test "x$PLATFORM" = xosx],
[LIBS="-lreadline $LIBS"
AM_CPPFLAGS="-I/usr/local/opt/readline/include $AM_CPPFLAGS"
AM_LDFLAGS="-L/usr/local/opt/readline/lib $AM_LDFLAGS"
[AC_MSG_ERROR([libreadline is required for profanity])])],