aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggert2012-03-04 10:07:33 -0800
committerPaul Eggert2012-03-04 10:07:33 -0800
commitf20f95c65cb948ce2b7ff667831dc64471d001fa (patch)
tree51824ee9b73e4e457271540bf1e6f000220633f2
parent5dd11cfee60be557274ea95289d2d39972c37a9b (diff)
downloademacs-f20f95c65cb948ce2b7ff667831dc64471d001fa.tar.gz
emacs-f20f95c65cb948ce2b7ff667831dc64471d001fa.zip
configure: fix ncurses 'configure' issue on Solaris 10 (Bug#10677)
* configure.in (LIBS_TERMCAP): Default this to the result of the tputs library search. Do a run-time test for the linkability of tputs unless cross-compiling, as that's more reliable if the link flags and libraries are messed up. Don't change LIBS as a result of the test, as that may mess up later tests.
-rw-r--r--ChangeLog9
-rw-r--r--configure.in43
2 files changed, 44 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index 8710ea58954..8aee7b2ce40 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
12012-03-04 Paul Eggert <eggert@cs.ucla.edu>
2
3 configure: fix ncurses 'configure' issue on Solaris 10 (Bug#10677)
4 * configure.in (LIBS_TERMCAP): Default this to the result of
5 the tputs library search. Do a run-time test for the linkability
6 of tputs unless cross-compiling, as that's more reliable if the
7 link flags and libraries are messed up. Don't change LIBS as
8 a result of the test, as that may mess up later tests.
9
12012-02-05 Christoph Scholtes <cschol2112@googlemail.com> 102012-02-05 Christoph Scholtes <cschol2112@googlemail.com>
2 11
3 * make-dist (README.W32): Include file in source tarball. (Bug#9750) 12 * make-dist (README.W32): Include file in source tarball. (Bug#9750)
diff --git a/configure.in b/configure.in
index b7e54f86f24..e3bd45dee06 100644
--- a/configure.in
+++ b/configure.in
@@ -2784,11 +2784,43 @@ AC_CHECK_FUNCS(getpt)
2784# It's better to believe a function is not available 2784# It's better to believe a function is not available
2785# than to expect to find it in ncurses. 2785# than to expect to find it in ncurses.
2786# Also we need tputs and friends to be able to build at all. 2786# Also we need tputs and friends to be able to build at all.
2787have_tputs_et_al=true 2787AC_MSG_CHECKING([for library containing tputs])
2788# Run a test program that contains a call to tputs, a call that is
2789# never executed. This tests whether a pre-'main' dynamic linker
2790# works with the library. It's too much trouble to actually call
2791# tputs in the test program, due to portability hassles. When
2792# cross-compiling, assume the test program will run if it links.
2793AC_DEFUN([tputs_link_source], [
2794 AC_LANG_SOURCE(
2795 [[extern void tputs (const char *, int, int (*)(int));
2796 int main (int argc, char **argv)
2797 {
2798 if (argc == 10000)
2799 tputs (argv[0], 0, 0);
2800 return 0;
2801 }]])
2802])
2788# Maybe curses should be tried earlier? 2803# Maybe curses should be tried earlier?
2789# See http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9736#35 2804# See http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9736#35
2790AC_SEARCH_LIBS(tputs, [ncurses terminfo termcap curses], , have_tputs_et_al=false) 2805for tputs_library in '' ncurses terminfo termcap curses; do
2791if test "$have_tputs_et_al" != true; then 2806 OLIBS=$LIBS
2807 if test -z "$tputs_library"; then
2808 LIBS_TERMCAP=
2809 msg='none required'
2810 else
2811 LIBS_TERMCAP=-l$tputs_library
2812 msg=$LIBS_TERMCAP
2813 LIBS="$LIBS_TERMCAP $LIBS"
2814 fi
2815 AC_RUN_IFELSE([tputs_link_source], [], [msg=no],
2816 [AC_LINK_IFELSE([tputs_link_source], [], [msg=no])])
2817 LIBS=$OLIBS
2818 if test "X$msg" != Xno; then
2819 break
2820 fi
2821done
2822AC_MSG_RESULT([$msg])
2823if test "X$msg" = Xno; then
2792 AC_MSG_ERROR([The required function `tputs' was not found in any library. 2824 AC_MSG_ERROR([The required function `tputs' was not found in any library.
2793These libraries were tried: libncurses, libterminfo, libtermcap, libcurses. 2825These libraries were tried: libncurses, libterminfo, libtermcap, libcurses.
2794Please try installing whichever of these libraries is most appropriate 2826Please try installing whichever of these libraries is most appropriate
@@ -2807,7 +2839,6 @@ HAVE_LIBNCURSES=yes
2807## freebsd < 40000, ms-w32, msdos, netbsd < 599002500, and 2839## freebsd < 40000, ms-w32, msdos, netbsd < 599002500, and
2808## darwin|gnu without ncurses. 2840## darwin|gnu without ncurses.
2809TERMINFO=no 2841TERMINFO=no
2810LIBS_TERMCAP=
2811case "$opsys" in 2842case "$opsys" in
2812 ## cygwin: Fewer environment variables to go wrong, more terminal types. 2843 ## cygwin: Fewer environment variables to go wrong, more terminal types.
2813 ## hpux10-20: Use the system provided termcap(3) library. 2844 ## hpux10-20: Use the system provided termcap(3) library.
@@ -2872,10 +2903,6 @@ esac
2872TERMCAP_OBJ=tparam.o 2903TERMCAP_OBJ=tparam.o
2873if test $TERMINFO = yes; then 2904if test $TERMINFO = yes; then
2874 AC_DEFINE(TERMINFO, 1, [Define to 1 if you use terminfo instead of termcap.]) 2905 AC_DEFINE(TERMINFO, 1, [Define to 1 if you use terminfo instead of termcap.])
2875
2876 ## Default used to be -ltermcap. Add a case above if need something else.
2877 test "x$LIBS_TERMCAP" = "x" && LIBS_TERMCAP="-lcurses"
2878
2879 TERMCAP_OBJ=terminfo.o 2906 TERMCAP_OBJ=terminfo.o
2880fi 2907fi
2881AC_SUBST(LIBS_TERMCAP) 2908AC_SUBST(LIBS_TERMCAP)