about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorCarlo Cabrera <30379873+carlocab@users.noreply.github.com>2021-11-24 00:10:05 +0800
committerCarlo Cabrera <30379873+carlocab@users.noreply.github.com>2021-11-24 00:10:05 +0800
commit1194a9b85e29dc8d421e6a3a12760de0e7c8ac20 (patch)
tree18bbd8e73ae4f3cd825c2d18fe2acf917b57fb4b
parent315d862e22ee9d41a897d76a0297b67b877a3960 (diff)
downloadprofani-tty-1194a9b85e29dc8d421e6a3a12760de0e7c8ac20.tar.gz
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.
-rw-r--r--configure.ac8
1 files changed, 4 insertions, 4 deletions
diff --git a/configure.ac b/configure.ac
index 709594d3..4a6a8ba2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -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],