diff options
| author | Paul Eggert | 2012-03-04 10:07:33 -0800 |
|---|---|---|
| committer | Paul Eggert | 2012-03-04 10:07:33 -0800 |
| commit | f20f95c65cb948ce2b7ff667831dc64471d001fa (patch) | |
| tree | 51824ee9b73e4e457271540bf1e6f000220633f2 | |
| parent | 5dd11cfee60be557274ea95289d2d39972c37a9b (diff) | |
| download | emacs-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-- | ChangeLog | 9 | ||||
| -rw-r--r-- | configure.in | 43 |
2 files changed, 44 insertions, 8 deletions
| @@ -1,3 +1,12 @@ | |||
| 1 | 2012-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 | |||
| 1 | 2012-02-05 Christoph Scholtes <cschol2112@googlemail.com> | 10 | 2012-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. |
| 2787 | have_tputs_et_al=true | 2787 | AC_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. | ||
| 2793 | AC_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 |
| 2790 | AC_SEARCH_LIBS(tputs, [ncurses terminfo termcap curses], , have_tputs_et_al=false) | 2805 | for tputs_library in '' ncurses terminfo termcap curses; do |
| 2791 | if 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 | ||
| 2821 | done | ||
| 2822 | AC_MSG_RESULT([$msg]) | ||
| 2823 | if 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. |
| 2793 | These libraries were tried: libncurses, libterminfo, libtermcap, libcurses. | 2825 | These libraries were tried: libncurses, libterminfo, libtermcap, libcurses. |
| 2794 | Please try installing whichever of these libraries is most appropriate | 2826 | Please 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. |
| 2809 | TERMINFO=no | 2841 | TERMINFO=no |
| 2810 | LIBS_TERMCAP= | ||
| 2811 | case "$opsys" in | 2842 | case "$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 | |||
| 2872 | TERMCAP_OBJ=tparam.o | 2903 | TERMCAP_OBJ=tparam.o |
| 2873 | if test $TERMINFO = yes; then | 2904 | if 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 |
| 2880 | fi | 2907 | fi |
| 2881 | AC_SUBST(LIBS_TERMCAP) | 2908 | AC_SUBST(LIBS_TERMCAP) |