1
0
Fork 0

Improve macOS Readline checks

Instead of checking for `lib` directories, let's make sure `libreadline`
exists.

Also, let's improve the error message if we can't find it. Finally,
since we're only looking for `brew` on macOS, we don't need to use
`$PATH_SEPARATOR` since we know what the path separator is.
This commit is contained in:
Carlo Cabrera 2021-11-24 00:10:05 +08:00
parent 315d862e22
commit 1194a9b85e
No known key found for this signature in database
GPG Key ID: C74D447FC549A1D0
1 changed files with 4 additions and 4 deletions

View File

@ -211,20 +211,20 @@ AS_IF([test "x$enable_icons_and_clipboard" != xno],
AS_IF([test "x$PLATFORM" = xosx],
[AC_PATH_PROG([BREW], [brew], ["failed"],
[$PATH$PATH_SEPARATOR/opt/homebrew/bin$PATH_SEPARATOR/usr/local/bin])
[$PATH:/opt/homebrew/bin:/usr/local/bin])
AS_IF([test "x$BREW" = xfailed],
[AC_CHECK_FILE([/opt/local/lib],
[AC_CHECK_FILE([/opt/local/lib/libreadline.dylib],
[READLINE_PREFIX="/opt/local"],
[READLINE_PREFIX="/usr/local"])],
[READLINE_PREFIX="`$BREW --prefix readline`"])])
AS_IF([test "x$PLATFORM" = xosx],
[AC_CHECK_FILE([$READLINE_PREFIX/lib],
[AC_CHECK_FILE([$READLINE_PREFIX/lib/libreadline.dylib],
[LIBS="-lreadline $LIBS"
AM_CPPFLAGS="-I$READLINE_PREFIX/include $AM_CPPFLAGS"
AM_LDFLAGS="-L$READLINE_PREFIX/lib $AM_LDFLAGS"
AC_SUBST(AM_LDFLAGS)],
[AC_MSG_ERROR([libreadline is required for profanity])])],
[AC_MSG_ERROR([libreadline is required for profanity. Install it with Homebrew, MacPorts, or manually into /usr/local])])],
[test "x$PLATFORM" = xopenbsd],
[AC_CHECK_FILE([/usr/local/include/ereadline],