about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorDmytro Podgornyi <dmytro.podgornyi@seagate.com>2016-05-21 16:07:40 +0300
committerDmytro Podgornyi <dmytro.podgornyi@seagate.com>2016-05-21 16:07:40 +0300
commit7d857fc30e92990e957a7dfdbe96386b1d49d197 (patch)
treeb60f07f1af8a8eb1eb5f91e87f9e37922e76af90
parent458f9edbb0cb2b83f1abc7dcd4d124c73ea0ad0d (diff)
downloadprofani-tty-7d857fc30e92990e957a7dfdbe96386b1d49d197.tar.gz
Fix libcurl check in configure.ac for OS X
OS X contains libcurl without a pkg-config file and ./configure
reports error. Add AC_CHECK_LIB in order to find libcurl properly.

Also remove manual adding -lncurses and -lcurl to LIBS, because
AC_CHECK_LIB does this job.
-rw-r--r--configure.ac6
1 files changed, 2 insertions, 4 deletions
diff --git a/configure.ac b/configure.ac
index 7cc51f2b..8d06ecfe 100644
--- a/configure.ac
+++ b/configure.ac
@@ -139,7 +139,6 @@ PKG_CHECK_MODULES([ncursesw], [ncursesw],
             	[AC_MSG_ERROR([ncurses is required for profanity])])])])])
 AM_CPPFLAGS="$AM_CPPFLAGS $NCURSES_CFLAGS"
 LIBS="$NCURSES_LIBS $LIBS"
-AS_IF([test "x$PLATFORM" = xosx], [LIBS="-lncurses $LIBS"])
 
 ### Check wide characters support in ncurses library
 CFLAGS_RESTORE="$CFLAGS"
@@ -164,7 +163,8 @@ AS_IF([test "x$ncurses_cv_wget_wch" != xyes],
 PKG_CHECK_MODULES([glib], [glib-2.0 >= 2.26], [],
     [AC_MSG_ERROR([glib 2.26 or higher is required for profanity])])
 PKG_CHECK_MODULES([curl], [libcurl], [],
-    [AC_MSG_ERROR([libcurl is required for profanity])])
+    [AC_CHECK_LIB([curl], [main], [],
+        [AC_MSG_ERROR([libcurl is required for profanity])])])
 
 AS_IF([test "x$enable_icons" != xno],
     [PKG_CHECK_MODULES([GTK], [gtk+-2.0 >= 2.24.10],
@@ -183,8 +183,6 @@ AS_IF([test "x$PLATFORM" != xosx],
             AC_SUBST(AM_LDFLAGS)],
         [AC_MSG_ERROR([libreadline is required for profanity])])])
 
-AS_IF([test "x$PLATFORM" = xosx], [LIBS="-lcurl $LIBS"])
-
 ### Check for desktop notification support
 ### Linux/FreeBSD require libnotify
 ### Windows uses native OS calls