comparison 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
comparison
equal deleted inserted replaced
15301:3d05b55c91c7 15302:a8cfbc1911e4
671 if test "$octave_cv_lib_qhull_ok" = "yes"; then 671 if test "$octave_cv_lib_qhull_ok" = "yes"; then
672 $1 672 $1
673 else 673 else
674 $2 674 $2
675 fi 675 fi
676 ])
677 dnl
678 dnl Find a suitable termlib to use.
679 dnl
680 AC_DEFUN([OCTAVE_CHECK_LIB_TERMLIB], [
681 TERM_LIBS=
682 octave_found_termlib=no
683 for termlib in ncurses curses termcap terminfo termlib; do
684 AC_CHECK_LIB([${termlib}], [tputs], [
685 TERM_LIBS="-l${termlib}"
686 octave_found_termlib=yes
687 break])
688 done
689
690 if test "$octave_found_termlib" = no; then
691 warn_termlibs="I couldn't find -ltermcap, -lterminfo, -lncurses, -lcurses, or -ltermlib!"
692 AC_MSG_WARN([$warn_termlibs])
693 fi
694 AC_SUBST(TERM_LIBS)
676 ]) 695 ])
677 dnl 696 dnl
678 dnl Check for support of OpenMP with a given compiler flag. 697 dnl Check for support of OpenMP with a given compiler flag.
679 dnl If found define HAVE_OPENMP and add the compile flag 698 dnl If found define HAVE_OPENMP and add the compile flag
680 dnl to CFLAGS and CXXFLAGS. 699 dnl to CFLAGS and CXXFLAGS.
1080 [if test "$enableval" = no; then 1099 [if test "$enableval" = no; then
1081 USE_READLINE=false 1100 USE_READLINE=false
1082 warn_readline="command editing and history features require GNU Readline" 1101 warn_readline="command editing and history features require GNU Readline"
1083 fi]) 1102 fi])
1084 if $USE_READLINE; then 1103 if $USE_READLINE; then
1104 dnl RHEL 5 and older systems require termlib set before enabling readline
1105 AC_REQUIRE([OCTAVE_CHECK_LIB_TERMLIB])
1085 save_LIBS="$LIBS" 1106 save_LIBS="$LIBS"
1086 LIBS="$TERM_LIBS" 1107 LIBS="$TERM_LIBS"
1087 AC_CHECK_LIB(readline, rl_set_keyboard_input_timeout, 1108 AC_CHECK_LIB(readline, rl_set_keyboard_input_timeout,
1088 [READLINE_LIBS="-lreadline" 1109 [READLINE_LIBS="-lreadline"
1089 AC_DEFINE(USE_READLINE, 1, [Define to 1 to use the readline library.]) 1110 AC_DEFINE(USE_READLINE, 1, [Define to 1 to use the readline library.])