So we can use "--with-readline=no" for situations where that helpful. ie. MacOS X 10.5. By default, we use "--with-readline=check". --- configure.ac | 47 ++++++++++++++++++++++++++++------------------- 1 files changed, 28 insertions(+), 19 deletions(-) diff --git a/configure.ac b/configure.ac index e41f2b5..2831db0 100644 --- a/configure.ac +++ b/configure.ac @@ -240,6 +240,10 @@ AC_ARG_WITH([remote], AC_ARG_WITH([libvirtd], AC_HELP_STRING([--with-libvirtd], [add libvirtd support @<:@default=yes@:>@]),[],[with_libvirtd=yes]) +dnl Add a --help string for the readline usage option +AC_ARG_WITH([readline], + AC_HELP_STRING([--with-readline], [add readline support @<:@default=check@:>@]),[],[with_readline=check]) + dnl dnl in case someone want to build static binaries dnl STATIC_BINARIES="-static" @@ -1338,26 +1342,29 @@ AM_CONDITIONAL([HAVE_CAPNG], [test "$with_capng" != "no"]) AC_SUBST([CAPNG_CFLAGS]) AC_SUBST([CAPNG_LIBS]) +dnl If we've been instructed to not use readline, then don't even check for it +if test "$with_readline" = "no"; then + lv_use_readline="no" +fi +if test "$with_readline" != "no"; then + dnl virsh libraries + AC_CHECK_HEADERS([readline/readline.h]) - -dnl virsh libraries -AC_CHECK_HEADERS([readline/readline.h]) - -# Check for readline. -AC_CHECK_LIB([readline], [readline], + # Check for readline. + AC_CHECK_LIB([readline], [readline], [lv_use_readline=yes; VIRSH_LIBS="$VIRSH_LIBS -lreadline"], [lv_use_readline=no]) -# If the above test failed, it may simply be that -lreadline requires -# some termcap-related code, e.g., from one of the following libraries. -# See if adding one of them to LIBS helps. -if test $lv_use_readline = no; then - lv_saved_libs=$LIBS - LIBS= - AC_SEARCH_LIBS([tgetent], [ncurses curses termcap termlib]) - case $LIBS in - no*) ;; # handle "no" and "none required" - *) # anything else is a -lLIBRARY + # If the above test failed, it may simply be that -lreadline requires + # some termcap-related code, e.g., from one of the following libraries. + # See if adding one of them to LIBS helps. + if test $lv_use_readline = no; then + lv_saved_libs=$LIBS + LIBS= + AC_SEARCH_LIBS([tgetent], [ncurses curses termcap termlib]) + case $LIBS in + no*) ;; # handle "no" and "none required" + *) # anything else is a -lLIBRARY # Now, check for -lreadline again, also using $LIBS. # Note: this time we use a different function, so that # we don't get a cached "no" result. @@ -1366,12 +1373,14 @@ if test $lv_use_readline = no; then VIRSH_LIBS="$VIRSH_LIBS -lreadline $LIBS"],, [$LIBS]) ;; - esac - test $lv_use_readline = no && + esac + test $lv_use_readline = no && AC_MSG_WARN([readline library not found]) - LIBS=$lv_saved_libs + LIBS=$lv_saved_libs + fi fi +dnl We now adjust things to suit the result of our checks for readline if test $lv_use_readline = yes; then AC_DEFINE_UNQUOTED([USE_READLINE], 1, [whether virsh can use readline]) -- 1.7.2.3 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list