[4.0] 76dd3b7 Rework autocrap configuration for libedit/libreadline
lkarsten at varnish-software.com
Mon Sep 22 16:38:23 CEST 2014
Author: Nils Goroll <nils.goroll at uplex.de>
Date: Mon Aug 18 21:26:17 2014 +0200
Rework autocrap configuration for libedit/libreadline
As before, libedit is preferred over libreadline.
Fail configure if neither is found or if libedit includes are missing.
Require readline history support (as varnishadm needs it).
Previously, if only libreadline was found, all binaries were linked
against it. Now only binaries getting linked with LIBEDIT_LIBS will
get linked aginst readline if libedit is not found.
If configure succeeds, a build should not fail any longer due to
libedit/libreadline headers missing.
diff --git a/bin/varnishadm/varnishadm.c b/bin/varnishadm/varnishadm.c
index 0c2ecc1..26019a5 100644
@@ -34,15 +34,17 @@
-# include <edit/readline/readline.h>
+# include <editline/readline.h>
# include <readline/readline.h>
# ifdef HAVE_READLINE_HISTORY_H
# include <readline/history.h>
+# error missing history.h - this should have got caught in configure
-# include <editline/readline.h>
+# error missing readline.h - this should have got caught in configure
diff --git a/configure.ac b/configure.ac
index ced8495..c8a36f5 100644
@@ -140,11 +140,25 @@ AC_SUBST(PCRE_CFLAGS)
- [AC_DEFINE([HAVE_LIBEDIT], , [Define we have libedit])],
-if test "$ac_cv_have_readline" = no; then
- AC_MSG_ERROR([libedit or readline not found])
+ # having the module does not imply having the header
+ [AC_DEFINE([HAVE_LIBEDIT], , [Define if we have libedit])],
+ [AC_MSG_ERROR([Found libedit, but header file is missing. Hint: Install dev package?])])],
+ # AX_LIB_READLINE overwrites LIBS which leads to every binary getting
+ # linked against libreadline uselessly. So we re-use LIBEDIT_LIBS which
+ # we have for libedit to add the lib specifically where needed
+ if test "$ax_cv_lib_readline" = "no"; then
+ AC_MSG_ERROR([neither libedit nor another readline compatible library found])
+ if test "x$ax_cv_lib_readline_history" != "xyes"; then
+ AC_MSG_ERROR([need readline history support])
# Checks for header files.
More information about the varnish-commit