From 8fd77ea19bd7441a110b7d0da5fed10ba9be0a2c Mon Sep 17 00:00:00 2001 From: Rafael Sadowski Date: Fri, 9 Oct 2015 00:45:36 +0200 Subject: 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. --- configure.ac | 15 ++++++++++++--- 1 file 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 -- cgit 1.4.1-2-gfad0