# HG changeset patch # User Rik # Date 1346876934 25200 # Node ID a8cfbc1911e4ece166ea48750845a5f2cfba6daa # Parent 3d05b55c91c73d7ff9f299015361fc4989d70d18 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. diff -r 3d05b55c91c7 -r a8cfbc1911e4 configure.ac --- a/configure.ac Wed Sep 05 09:41:20 2012 -0700 +++ b/configure.ac Wed Sep 05 13:28:54 2012 -0700 @@ -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. diff -r 3d05b55c91c7 -r a8cfbc1911e4 m4/acinclude.m4 --- 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,