Mercurial > hg > octave-lyh
changeset 15302:a8cfbc1911e4
build: Set TERM_LIBS before checking for READLINE.
Enables building on older systems such as RHEL 5.
* configure.ac: New macro OCTAVE_CHECK_LIB_TERMLIB.
* m4/acinclude.m4 (OCTAVE_CHECK_LIB_TERMLIB): New macro to set TERM_LIBS
variable.
* (OCTAVE_ENABLE_READLINE): AC_REQUIRE that OCTAVE_CHECK_LIB_TERMLIB be
executed before running checks for READLINE.
author | Rik <rik@octave.org> |
---|---|
date | Wed, 05 Sep 2012 13:28:54 -0700 |
parents | 3d05b55c91c7 |
children | df7ab06ff541 |
files | configure.ac m4/acinclude.m4 |
diffstat | 2 files changed, 22 insertions(+), 14 deletions(-) [+] |
line wrap: on
line diff
--- a/configure.ac +++ b/configure.ac @@ -1743,20 +1743,7 @@ esac ## Find a termlib to use. -octave_found_termlib=no -for termlib in ncurses curses termcap terminfo termlib; do - AC_CHECK_LIB(${termlib}, tputs, [ - TERM_LIBS="-l${termlib}" - octave_found_termlib=yes - break]) -done - -if test "$octave_found_termlib" = no; then - warn_termlibs="I couldn't find -ltermcap, -lterminfo, -lncurses, -lcurses, o\ -r -ltermlib!" - AC_MSG_WARN([$warn_termlibs]) -fi -AC_SUBST(TERM_LIBS) +OCTAVE_CHECK_LIB_TERMLIB ### Checks for header files.
--- a/m4/acinclude.m4 +++ b/m4/acinclude.m4 @@ -675,6 +675,25 @@ fi ]) dnl +dnl Find a suitable termlib to use. +dnl +AC_DEFUN([OCTAVE_CHECK_LIB_TERMLIB], [ + TERM_LIBS= + octave_found_termlib=no + for termlib in ncurses curses termcap terminfo termlib; do + AC_CHECK_LIB([${termlib}], [tputs], [ + TERM_LIBS="-l${termlib}" + octave_found_termlib=yes + break]) + done + + if test "$octave_found_termlib" = no; then + warn_termlibs="I couldn't find -ltermcap, -lterminfo, -lncurses, -lcurses, or -ltermlib!" + AC_MSG_WARN([$warn_termlibs]) + fi + AC_SUBST(TERM_LIBS) +]) +dnl dnl Check for support of OpenMP with a given compiler flag. dnl If found define HAVE_OPENMP and add the compile flag dnl to CFLAGS and CXXFLAGS. @@ -1082,6 +1101,8 @@ warn_readline="command editing and history features require GNU Readline" fi]) if $USE_READLINE; then + dnl RHEL 5 and older systems require termlib set before enabling readline + AC_REQUIRE([OCTAVE_CHECK_LIB_TERMLIB]) save_LIBS="$LIBS" LIBS="$TERM_LIBS" AC_CHECK_LIB(readline, rl_set_keyboard_input_timeout,