Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH: Link with curses if (and even) if it doesn't provide tgetent
- X-seq: zsh-workers 44802
- From: Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: PATCH: Link with curses if (and even) if it doesn't provide tgetent
- Date: Thu, 3 Oct 2019 14:39:25 +0000
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=uxN2K2cQCsbBUAeeVAWn7MaatHvpM/exmo2/f7eSCrg=; b=BVKCzBgs/fv0/CWgC4qanA5PvT0ePXwqRAjyZAXi5Kut8EQ++i7jZT0hknxYTvBl65 JELpjH/PDTiDxqJXj6zuZW7KZrJqsIsY2+Ya+FKiMfgYuq+JL+TvsUai/g954pnnoQi8 P7G2PzxaJaPXqm6aMvjtDWsS8mionfoG8Z3DGXAKTBSJJfz/qgJ4Gswbo4CASwg3sk9R Jcvk2VVZHBeLusO496Xa7Iyhdh9H1UWI5DRKEenBfz0DWVSELJ/rN1ykpm5SGn5yZJA5 T3qCAIiciOW8ehIInEdMbo7poQOXqotfDQeaOqOZpNli+9CbVkKaQvxMj/o/vDFSdcJ4 7MwQ==
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
Hello,
I've noticed that on Gentoo the zsh built doesn't include the curses
module. Closer look revealed the cause: the ncurses libraries
(ncursesw and ncurses) don't provide the call tgetent (nor tigetflag),
only tinfo does provide it. I guess this is the next step in splitting
libtinfo out of ncurses.
But this means that the binary can be linked to both ncurses and
tinfo. I've also checked that linking against such tgetent-lacking
ncurses and termcap works with no problems.
The patch does:
- it allows the normal flow of the checks with no changes,
- in the "if we need to ignore ncurses" check it adds, in case of
positive resolution of the test, an additional check that verifies for
initscr() in any of ncursesw, ncurses, curses and if this check is
positive, it then allows to link against that found curses library,
- it also adds libtinfow (side to libtinfo) to the terminal libraries
searched, as such library exists on the Gentoo system.
This way the zsh/curses module builds OK.
I attach the git-format-patch file.
--
Sebastian Gniazdowski
News: https://twitter.com/ZdharmaI
IRC: https://kiwiirc.com/client/chat.freenode.net:+6697/#zplugin
Blog: http://zdharma.org
From e56bf700acaf4a50143daec16208ab86c8586f9c Mon Sep 17 00:00:00 2001
From: Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx>
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)
---
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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author