[master] 9dc28b2 Fix libedit detection on *BSD OS's

Tollef Fog Heen tfheen at varnish-cache.org
Tue Apr 10 15:12:30 CEST 2012


commit 9dc28b2ce920274432da72f78419562d9365bc2b
Author: Brad <brad at comstyle.com>
Date:   Mon Jan 2 14:03:46 2012 -0500

    Fix libedit detection on *BSD OS's
    
    The following patch allows the autoconf script to detect the presence of
    libedit when there isn't a pkg-config file present and thus allowing
    Varnish to detect libedit on OpenBSD/FreeBSD/NetBSD/DragonFly.
    
    Fixes: #1003

diff --git a/configure.ac b/configure.ac
index 7e5e57e..33b0a60 100644
--- a/configure.ac
+++ b/configure.ac
@@ -144,7 +144,14 @@ AC_SUBST(PCRE_LIBS)
 
 PKG_CHECK_MODULES([LIBEDIT], [libedit], 
 	[AC_DEFINE([HAVE_LIBEDIT], [1], [Define we have libedit])],
-	[AC_MSG_WARN([libedit not found, disabling libedit support])])
+	[AC_CHECK_HEADERS([readline/readline.h])
+	 AC_CHECK_LIB(edit, el_init,
+	        [ AC_DEFINE([HAVE_LIBEDIT], [1], [Define we have libedit])
+		  LIBEDIT_CFLAGS=""
+		  LIBEDIT_LIBS="-ledit ${CURSES_LIBS}"
+		],
+               [AC_MSG_WARN([libedit not found, disabling libedit support])],
+               [${CURSES_LIBS}])])
 
 # Checks for header files.
 AC_HEADER_STDC



More information about the varnish-commit mailing list