]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
Fix detection of libedit on BSD
authorJames Le Cuirot <chewi@aura-online.co.uk>
Fri, 28 Mar 2014 22:20:40 +0000 (22:20 +0000)
committerTravis Cross <tc@traviscross.com>
Mon, 31 Mar 2014 21:59:42 +0000 (21:59 +0000)
Since libedit originates from NetBSD, this and other BSDs use the
official version while Linux distributions tend to use the
autotoolized fork. The official version does not install a .pc file so
we cannot rely exclusively on pkg-config for detection.

FS-6408

Signed-off-by: Travis Cross <tc@traviscross.com>
configure.ac

index b95d4155ea263a3450d93eb4ba0f06b177d66159..e611dd90bace1e77bbd974e7df171116a189697c 100644 (file)
@@ -1131,13 +1131,14 @@ PKG_CHECK_MODULES([YAML], [yaml-0.1 >= 0.1.4],[
 AC_ARG_ENABLE(core-libedit-support,     
   [AS_HELP_STRING([--disable-core-libedit-support], [Compile without libedit Support])])
 
-case x$enable_core_libedit_support in
-  xno) ;;
-  xyes|*)
-    PKG_CHECK_MODULES([LIBEDIT], [libedit >= 2.11],,
-      [AC_MSG_ERROR([You need to either install libedit-dev (>= 2.11) or configure with --disable-core-libedit-support])])
-    ;;
-esac
+AS_IF([test "x$enable_core_libedit_support" != "xno"],[
+  PKG_CHECK_MODULES([LIBEDIT], [libedit >= 2.11],,[
+    AC_MSG_RESULT([no])
+    AC_CHECK_LIB([edit], [el_line], [LIBEDIT_LIBS=-ledit])
+    AC_CHECK_HEADER([histedit.h], [], [unset LIBEDIT_LIBS])
+    AS_IF([test "x$LIBEDIT_LIBS" = "x"], [
+      AC_MSG_ERROR([You need to either install libedit-dev (>= 2.11) or configure with --disable-core-libedit-support])
+      ])])])
 
 AS_IF([test "x$enable_core_libedit_support" != "xno"], [
   # If making changes here, don't forget to run autoheader and