From 6b3c08503752b475cb78db759beba8e168f31fb5 Mon Sep 17 00:00:00 2001 From: Holger Vogt Date: Wed, 10 Jul 2024 17:21:38 +0200 Subject: [PATCH] Don't check for readline, if shared lib or Windows GUI is selected --- configure.ac | 109 +++++++++++++++++++++++++++------------------------ 1 file changed, 57 insertions(+), 52 deletions(-) diff --git a/configure.ac b/configure.ac index d952d83f7..9e1e5ba5f 100644 --- a/configure.ac +++ b/configure.ac @@ -1252,63 +1252,68 @@ if test "x$enable_expdevices" = xyes; then fi # ---- Option to include GNU readline support in ngspice CLI ---- -# ---- Default: disabled. ---- +# ---- Default: enabled. ---- # ---- Hope to see in the future readline replacement. ---- -if test "x$with_readline" = xno ; then +if test "x$with_wingui" = xyes || test "x$with_ngshared" = xyes; then AC_MSG_RESULT([GNU readline disabled.]) -else - if test "x$with_readline" = x || test "x$with_readline" = xyes ; then - if test "x$with_tcl" = x || test "x$with_tcl" = xno ; then - AC_MSG_RESULT([Checking for readline:]) - AC_CHECK_HEADERS([readline/readline.h readline/history.h], - [AC_DEFINE([HAVE_GNUREADLINE], [], [Define if we have GNU readline])], - [AC_MSG_ERROR([Couldn't find GNU readline headers.])]) - AC_SEARCH_LIBS([tputs], [ncurses tinfo termcap], - [AC_DEFINE([HAVE_TERMCAP], [], [Define if we have ncurses/terminfo or termcap])], - [AC_MSG_ERROR([Found neither ncurses/terminfo or termcap])]) - AC_CHECK_LIB([readline], [readline], - [LIBS="$LIBS -lreadline"], - [AC_MSG_ERROR([Couldn't find readline libraries.])]) - fi - else -# Especially defined for macOS (Big Sur), with readline installed from Brew - for dir in \ - $with_readline - do - if test "x$with_tcl" = x || test "x$with_tcl" = xno ; then - AC_MSG_RESULT([Checking for readline:]) - AC_CHECK_HEADERS([$dir/include/readline/readline.h $dir/include/readline/history.h], - [AC_DEFINE([HAVE_GNUREADLINE], [], [Define if we have GNU readline])], - [AC_MSG_ERROR([Couldn't find GNU readline headers.])]) - AC_SEARCH_LIBS([tputs], [ncurses tinfo termcap], - [AC_DEFINE([HAVE_TERMCAP], [], [Define if we have ncurses/terminfo or termcap])], - [AC_MSG_ERROR([Found neither ncurses/terminfo or termcap])]) - AC_CHECK_LIB([readline], [readline], - [LIBS="$LIBS -lreadline"], - [AC_MSG_ERROR([Couldn't find readline libraries.])]) - fi - done - fi -fi - -# ---- Option to include BSD editline support in ngspice CLI ---- -# ---- Default: disabled. ---- - -if test "x$with_editline" != xyes; then AC_MSG_RESULT([BSD editline disabled.]) else - AC_MSG_RESULT([Checking for editline:]) - AC_CHECK_HEADERS([editline/readline.h], - [AC_DEFINE([HAVE_BSDEDITLINE], [1], [Define to enable BSD editline])], - [AC_MSG_ERROR([Couldn't find BSD editline headers.])]) - AC_SEARCH_LIBS([tputs], [ncurses tinfo termcap], - [AC_DEFINE([HAVE_TERMCAP], [], [Define if we have ncurses/terminfo or termcap])], - [AC_MSG_ERROR([Found neither ncurses/terminfo or termcap])]) - AC_CHECK_LIB([edit], [readline], - [LIBS="$LIBS -ledit"], - [AC_MSG_ERROR([Couldn't find editline libraries.])], - [-lncurses]) + if test "x$with_readline" = xno ; then + AC_MSG_RESULT([GNU readline disabled.]) + else + if test "x$with_readline" = x || test "x$with_readline" = xyes ; then + if test "x$with_tcl" = x || test "x$with_tcl" = xno ; then + AC_MSG_RESULT([Checking for readline:]) + AC_CHECK_HEADERS([readline/readline.h readline/history.h], + [AC_DEFINE([HAVE_GNUREADLINE], [], [Define if we have GNU readline])], + [AC_MSG_ERROR([Couldn't find GNU readline headers.])]) + AC_SEARCH_LIBS([tputs], [ncurses tinfo termcap], + [AC_DEFINE([HAVE_TERMCAP], [], [Define if we have ncurses/terminfo or termcap])], + [AC_MSG_ERROR([Found neither ncurses/terminfo or termcap])]) + AC_CHECK_LIB([readline], [readline], + [LIBS="$LIBS -lreadline"], + [AC_MSG_ERROR([Couldn't find readline libraries.])]) + fi + else + # Especially defined for macOS (Big Sur), with readline installed from Brew + for dir in \ + $with_readline + do + if test "x$with_tcl" = x || test "x$with_tcl" = xno ; then + AC_MSG_RESULT([Checking for readline:]) + AC_CHECK_HEADERS([$dir/include/readline/readline.h $dir/include/readline/history.h], + [AC_DEFINE([HAVE_GNUREADLINE], [], [Define if we have GNU readline])], + [AC_MSG_ERROR([Couldn't find GNU readline headers.])]) + AC_SEARCH_LIBS([tputs], [ncurses tinfo termcap], + [AC_DEFINE([HAVE_TERMCAP], [], [Define if we have ncurses/terminfo or termcap])], + [AC_MSG_ERROR([Found neither ncurses/terminfo or termcap])]) + AC_CHECK_LIB([readline], [readline], + [LIBS="$LIBS -lreadline"], + [AC_MSG_ERROR([Couldn't find readline libraries.])]) + fi + done + fi + fi + + # ---- Option to include BSD editline support in ngspice CLI ---- + # ---- Default: disabled. ---- + + if test "x$with_editline" != xyes; then + AC_MSG_RESULT([BSD editline disabled.]) + else + AC_MSG_RESULT([Checking for editline:]) + AC_CHECK_HEADERS([editline/readline.h], + [AC_DEFINE([HAVE_BSDEDITLINE], [1], [Define to enable BSD editline])], + [AC_MSG_ERROR([Couldn't find BSD editline headers.])]) + AC_SEARCH_LIBS([tputs], [ncurses tinfo termcap], + [AC_DEFINE([HAVE_TERMCAP], [], [Define if we have ncurses/terminfo or termcap])], + [AC_MSG_ERROR([Found neither ncurses/terminfo or termcap])]) + AC_CHECK_LIB([edit], [readline], + [LIBS="$LIBS -ledit"], + [AC_MSG_ERROR([Couldn't find editline libraries.])], + [-lncurses]) + fi fi # Use AC_CHECK_HEADERS so the HAVE_*_H symbol gets defined