Mercurial > octave
diff m4/acinclude.m4 @ 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 | 43e484fa7e42 |
children | daf74ce2afdc |
line wrap: on
line diff
--- a/m4/acinclude.m4 Wed Sep 05 09:41:20 2012 -0700 +++ b/m4/acinclude.m4 Wed Sep 05 13:28:54 2012 -0700 @@ -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,