[PATCH] configure: add option to enable/disable readline
Ross Burton
ross.burton@arm.com
Mon Apr 13 10:19:04 GMT 2026
Add an option to control explicitly whether systemtap will look for and
use readline, for reproducible builds.
If not specified the behaviour is as before: look for readline and if it
is found, use it. However if --with-readline is passed then readline
must be present, and if --without-readline is passed then readline will
not be used.
---
configure.ac | 65 ++++++++++++++++++++++++++++++----------------------
1 file changed, 37 insertions(+), 28 deletions(-)
diff --git a/configure.ac b/configure.ac
index 6fb99da40..2ec72e85a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -525,38 +525,47 @@ AC_CHECK_HEADERS([rpm/rpmcrypto.h], [
have_rpmcrypto_h=yes
AC_MSG_NOTICE([separate rpm/rpmcrypto.h])])
-dnl Look for readline.
-dnl
-dnl First save the orignal value of LIBS.
-LIBS_no_readline=$LIBS
-dnl Check how for readline presence and how to link with it. On some
-dnl systems you need to add a termcap compatible library.
-have_libreadline="no"
-AC_MSG_CHECKING([how to link readline libs])
-for libtermcap in "" tinfo ncursesw ncurses curses termcap; do
- if test -z "$libtermcap"; then
- READLINE_LIBS="-lreadline"
+AC_ARG_WITH([readline],
+ AS_HELP_STRING([--without-readline],[disable use of readline]), [], [with_readline="check"])
+
+if test "$with_readline" != no; then
+ dnl Look for readline.
+ dnl
+ dnl First save the orignal value of LIBS.
+ LIBS_no_readline=$LIBS
+
+ have_libreadline="no"
+ dnl Check how for readline presence and how to link with it. On some
+ dnl systems you need to add a termcap compatible library.
+ AC_MSG_CHECKING([how to link readline libs])
+ for libtermcap in "" tinfo ncursesw ncurses curses termcap; do
+ if test -z "$libtermcap"; then
+ READLINE_LIBS="-lreadline"
+ else
+ READLINE_LIBS="-lreadline -l$libtermcap"
+ fi
+ LIBS="$READLINE_LIBS $LIBS_no_readline"
+ AC_LINK_IFELSE(
+ [AC_LANG_CALL([],[readline])],
+ [have_libreadline="yes"])
+ if test "$have_libreadline" = "yes"; then
+ break
+ fi
+ done
+
+ if test "$have_libreadline" = "no" -a "$with_readline" = "yes"; then
+ AC_MSG_ERROR([cannot find libreadline])
+ elif test "$have_libreadline" = "no" -a "$with_readline" = "check"; then
+ AC_MSG_RESULT([libreadline not found])
+ READLINE_LIBS=""
else
- READLINE_LIBS="-lreadline -l$libtermcap"
+ AC_MSG_RESULT([$READLINE_LIBS])
+ AC_DEFINE(HAVE_LIBREADLINE, [1],
+ [Define if you have the readline library (-lreadline).])
fi
- LIBS="$READLINE_LIBS $LIBS_no_readline"
- AC_LINK_IFELSE(
- [AC_LANG_CALL([],[readline])],
- [have_libreadline="yes"])
- if test "$have_libreadline" = "yes"; then
- break
- fi
-done
-if test "$have_libreadline" = "no"; then
- AC_MSG_RESULT([none])
- READLINE_LIBS=""
-else
- AC_MSG_RESULT([$READLINE_LIBS])
- AC_DEFINE(HAVE_LIBREADLINE, [1],
- [Define if you have the readline library (-lreadline).])
+ AC_SUBST([READLINE_LIBS])
fi
-AC_SUBST([READLINE_LIBS])
AM_CONDITIONAL([HAVE_LIBREADLINE], [test "$have_libreadline" = "yes"])
dnl End of readline checks: restore LIBS
--
2.43.0
More information about the Systemtap
mailing list