diff --git a/compile_macos.sh b/compile_macos.sh index a1067315b..45bb2d1d2 100644 --- a/compile_macos.sh +++ b/compile_macos.sh @@ -51,14 +51,14 @@ if test "$1" = "d"; then echo # You may add --enable-adms to the following command for adding adms generated devices # builtin readline not compatible (Big Sur), readline via Homebrew required (in /usr/local/opt) - ../configure --with-x --enable-xspice --enable-cider --with-readline=/usr/local/opt --enable-openmp CFLAGS="-m64 -O0 -g -Wall -I/opt/X11/include/freetype2" LDFLAGS="-m64 -lomp -g" + ../configure --with-x --enable-xspice --enable-cider --with-readline=/usr/local/opt/readline --enable-openmp CFLAGS="-m64 -O0 -g -Wall -I/opt/X11/include/freetype2 -I/usr/local/opt/readline/include" LDFLAGS="-m64 -lomp -g -L/usr/local/opt/readline/lib" else cd release if [ $? -ne 0 ]; then echo "cd release failed"; exit 1 ; fi echo "configuring for 64 bit release" echo # You may add --enable-adms to the following command for adding adms generated devices - ../configure --with-x --enable-xspice --enable-cider --with-readline=/usr/local/opt --enable-openmp --disable-debug CFLAGS="-m64 -O2 -I/opt/X11/include/freetype2" LDFLAGS="-m64 -lomp" + ../configure --with-x --enable-xspice --enable-cider --with-readline=/usr/local/opt/readline --enable-openmp --disable-debug CFLAGS="-m64 -O2 -I/opt/X11/include/freetype2 -I/usr/local/opt/readline/include" LDFLAGS="-m64 -lomp -L/usr/local/opt/readline/lib" fi if [ $? -ne 0 ]; then echo "../configure failed"; exit 1 ; fi diff --git a/configure.ac b/configure.ac index 22bc887b6..e20f2fd25 100644 --- a/configure.ac +++ b/configure.ac @@ -1161,24 +1161,43 @@ fi # ---- Default: disabled. ---- # ---- Hope to see in the future readline replacement. ---- -if test "x$with_readline" != xyes; then +if test "x$with_readline" = x || test "x$with_readline" = xno ; then AC_MSG_RESULT([GNU readline disabled.]) else - 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.])]) + if 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. ----