about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorRafael Sadowski <rafael@sizeofvoid.org>2015-10-09 00:45:36 +0200
committerMichael Vetter <jubalh@iodoru.org>2018-08-13 17:18:19 +0200
commit8fd77ea19bd7441a110b7d0da5fed10ba9be0a2c (patch)
tree38f6ca02e02971ae4aab4583478f22abea7f9aba
parent811b3ba857f955fe825cba1622779f5e21048fcc (diff)
downloadprofani-tty-8fd77ea19bd7441a110b7d0da5fed10ba9be0a2c.tar.gz
autoconf adjustments for OpenBSD
In OpenBSD we have two readline libs. On the one hand we have an old
version in the base OS and on the other hand we have an new one in the
ports tree. profanity needs the new one and should pick up the right
one. readline from ports tree is prefixed as ereadline.

Note:
Original patch by Rafael Sadowski.
Cleaned up by jubalh with heavy help of pasis.
-rw-r--r--configure.ac15
1 files changed, 12 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac
index 651805cd..5f85c83a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -22,6 +22,7 @@ AC_CANONICAL_HOST
 PLATFORM="unknown"
 AS_CASE([$host_os],
     [freebsd*], [PLATFORM="freebsd"],
+    [openbsd*], [PLATFORM="openbsd"],
     [darwin*], [PLATFORM="osx"],
     [cygwin], [PLATFORM="cygwin"],
     [PLATFORM="nix"])
@@ -172,14 +173,22 @@ AS_IF([test "x$enable_icons" != xno],
             [AC_MSG_ERROR([gtk+-2.0 or higher is required for icons])],
             [AC_MSG_NOTICE([gtk+-2.0 not found, icons not enabled])])])])
 
-AS_IF([test "x$PLATFORM" != xosx],
-    [AC_CHECK_LIB([readline], [main], [],
-        [AC_MSG_ERROR([libreadline is required for profanity])])],
+AS_IF([test "x$PLATFORM" = xosx],
     [AC_CHECK_FILE([/usr/local/opt/readline/lib],
         [LIBS="-lreadline $LIBS"
             AM_CPPFLAGS="-I/usr/local/opt/readline/include $AM_CPPFLAGS"
             AM_LDFLAGS="-L/usr/local/opt/readline/lib $AM_LDFLAGS"
             AC_SUBST(AM_LDFLAGS)],
+        [AC_MSG_ERROR([libreadline is required for profanity])])],
+
+      [test "x$PLATFORM" = xopenbsd],
+      [AC_CHECK_FILE([/usr/local/include/ereadline],
+          [LIBS="-lereadline $LIBS"
+              AM_CPPFLAGS="-I/usr/local/include/ereadline $AM_CPPFLAGS"
+              AM_LDFLAGS="-L/usr/local/lib $AM_LDFLAGS"
+              AC_SUBST(AM_LDFLAGS)])],
+
+    [AC_CHECK_LIB([readline], [main], [],
         [AC_MSG_ERROR([libreadline is required for profanity])])])
 
 ### Check for desktop notification support