Created
October 9, 2019 04:14
-
-
Save psprint/2373494c71cb6d1529344a2ed1a64b03 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From e56bf700acaf4a50143daec16208ab86c8586f9c Mon Sep 17 00:00:00 2001 | |
From: Sebastian Gniazdowski <[email protected]> | |
Date: Thu, 3 Oct 2019 15:54:17 +0200 | |
Subject: [PATCH] configure: Link with ncurses if (and even) it doesn't provide | |
tgetent, to build the module. Also link with tinfow (not only tinfo) | |
The patch is useful on e.g. Gentoo, where the ncurses library doesn't provide the tgetent call. | |
--- | |
configure.ac | 17 ++++++++++++++--- | |
1 file changed, 14 insertions(+), 3 deletions(-) | |
diff --git a/configure.ac b/configure.ac | |
index b31b1d958..c33188561 100644 | |
--- a/configure.ac | |
+++ b/configure.ac | |
@@ -774,7 +774,7 @@ AS_HELP_STRING([--with-term-lib=LIBS],[search space-separated LIBS for terminal | |
termcap_curses_order="$withval" | |
AC_SEARCH_LIBS(tigetstr, [$termcap_curses_order]) | |
else | |
- termcap_curses_order="$ncursesw_test $ncurses_test tinfo termcap curses" | |
+ termcap_curses_order="$ncursesw_test $ncurses_test tinfow tinfo termcap curses" | |
fi], | |
[case "$host_os" in | |
solaris*) | |
@@ -783,7 +783,7 @@ fi], | |
DL_EXT="${DL_EXT=sl}" | |
termcap_curses_order="Hcurses $ncursesw_test $ncurses_test curses termcap" ;; | |
*) | |
- termcap_curses_order="$ncursesw_test $ncurses_test tinfo termcap curses" ;; | |
+ termcap_curses_order="$ncursesw_test $ncurses_test tinfow tinfo termcap curses" ;; | |
esac])dnl | |
AH_TEMPLATE([ZSH_NO_XOPEN], | |
@@ -831,7 +831,18 @@ AC_CACHE_CHECK(if we need to ignore ncurses, zsh_cv_ignore_ncurses, | |
zsh_cv_ignore_ncurses=no | |
;; | |
*) | |
- zsh_cv_ignore_ncurses=yes | |
+ dnl If the tgetent nor tigetflag weren't found in the libncurses*.so, then | |
+ dnl there will be no conflict with the other terminal library selected (e.g. | |
+ dnl libtinfo) and it's possible to link ncurses provided that it is working | |
+ AC_SEARCH_LIBS(initscr, [ncursesw ncurses curses]) | |
+ case $LIBS in | |
+ *-lncurses*|*-lcurses*) | |
+ zsh_cv_ignore_ncurses=no | |
+ ;; | |
+ *) | |
+ zsh_cv_ignore_ncurses=yes | |
+ ;; | |
+ esac | |
;; | |
esac]) | |
-- | |
2.21.0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment