From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Valtteri Vuorikoski Newsgroups: gmane.emacs.bugs Subject: bug#64577: 29.0.92; configure on NetBSD forces unstable terminfo library Date: Thu, 13 Jul 2023 12:35:51 +0300 Message-ID: <6ootbbstpbikcsxwcb2ek6lg3jbyxzgkdd25fwj2vmjpa77oiw@o5uqewt3upum> References: <87v8eqrxq8.fsf@notcom.org> <837cr572jt.fsf@gnu.org> <83zg415k7c.fsf@gnu.org> <83wmz55d2l.fsf@gnu.org> <83jzv45qxy.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14405"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: NeoMutt/20230517-193-0143df-dirty Cc: 64577@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jul 13 11:37:16 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qJsl9-0003Xc-7X for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 13 Jul 2023 11:37:15 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qJskz-0004Ur-HH; Thu, 13 Jul 2023 05:37:05 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qJskw-0004UZ-RQ for bug-gnu-emacs@gnu.org; Thu, 13 Jul 2023 05:37:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qJskw-000898-K1 for bug-gnu-emacs@gnu.org; Thu, 13 Jul 2023 05:37:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qJskw-0004vh-Fk for bug-gnu-emacs@gnu.org; Thu, 13 Jul 2023 05:37:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Valtteri Vuorikoski Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 13 Jul 2023 09:37:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64577 X-GNU-PR-Package: emacs Original-Received: via spool by 64577-submit@debbugs.gnu.org id=B64577.168924096618846 (code B ref 64577); Thu, 13 Jul 2023 09:37:02 +0000 Original-Received: (at 64577) by debbugs.gnu.org; 13 Jul 2023 09:36:06 +0000 Original-Received: from localhost ([127.0.0.1]:53418 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qJsk2-0004tt-DD for submit@debbugs.gnu.org; Thu, 13 Jul 2023 05:36:06 -0400 Original-Received: from jkusti.notcom.org ([118.27.113.153]:43666) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qJsk0-0004tf-18 for 64577@debbugs.gnu.org; Thu, 13 Jul 2023 05:36:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=notcom.org; s=jk; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject: Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=09jGVrzjPyQE/OJ+Hf4tim1covumaEBTSyPBi3uxM/M=; t=1689240964; x=1690104964; b=fXG7HrXcAVRezYuJJfsaNyjZO6X6IYndOjZpYn3NLNH1wRXc9wjNrFxZbbBJKagYMrDHGrOqBaQ MAqN3rLzc/GniVoBiG3pF2xj9DcRrGNQUO1t2r3ljUNGKB5kPAB/lMm0jsjGtJz8C9L2BC3qVFk/Z KvgtZ9UKTsgYqwW1fFsL4PEaxSy8JRHDSKwFdENwmziPpE8PWzKD3+3uyakng76q7LtqMwwcAzZC1 obeMZJAIdGXOx1imuUF6PgQF9/IRSnfiXw0ZbsWs8Vzn/1hRlDCtFQ8NCd0W+FuwhVAqNzle67w5E H9HG2SOJGdudmwr0BqHmLwNIhGkdYKt0rFeg==; Original-Received: from submission.internal (id=9cdceae8c7b5bf2d4c2c643b5341fa4197f0c084) by jkusti.notcom.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.x) (envelope-from ) id 1qJsjw-0033YA-0B; Thu, 13 Jul 2023 09:36:00 +0000 Original-Received: from a10d750d756b015054aa81d63d047a232e64e839 by sendhost.internal with local (Exim 4.x) (envelope-from ) id 1qJsjn-005CCj-RE; Thu, 13 Jul 2023 12:35:51 +0300 Content-Disposition: inline In-Reply-To: <83jzv45qxy.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:265011 Archived-At: On Thu, Jul 13, 2023 at 08:19:21AM +0300, Eli Zaretskii wrote: > > The reason not much has been heard about this is probably that most > > users likely use packaged emacs, and the pkgsrc build system forcibly sets > > TERMINFO=yes if it determines that this is a NetBSD with the relevant > > headers available. See this package build makefile: > > http://cvsweb.netbsd.org/bsdweb.cgi/pkgsrc/editors/emacs21/Makefile.common?rev=1.21&content-type=text/x-cvsweb-markup > > "CPPFLAGS+=-DTERMINFO" (similarly check exists for emacsen up to 28). > > If you could find out since when did the NetBSD pkgsrc system start > using this override, it could be a data point that we could consider > in making these decisions. Looks like the TERMINFO override was installed in CVS version 1.7 in May 2010 for emacs21: http://cvsweb.netbsd.org/bsdweb.cgi/pkgsrc/editors/emacs21/Makefile.common?rev=1.7&content-type=text/x-cvsweb-markup According to the comments, NetBSD 6.0 released the same year was the first version to ship with libterminfo. From looking at the platform repo, the old termcap library was completely removed in this release and got replaced by the current libterminfo. > > How about this then, this way should preserve the intent of the > > original special casing while honoring the library selection configure > > ended up with: > > > > --- a/configure.ac > > +++ b/configure.ac > > @@ -5212,9 +5212,8 @@ AC_DEFUN > > ;; > > > > netbsd) > > - if test "x$LIBS_TERMCAP" != "x-lterminfo"; then > > + if test "x$LIBS_TERMCAP" = "x-ltermcap"; then > > TERMINFO=no > > - LIBS_TERMCAP="-ltermcap" > > fi > > ;; > > > > On ancient NetBSD (without ncurses) LIBS_TERMCAP should be detected as > > -ltermcap, and this will ensure that TERMINFO stays undefined > > (probably a no-op). On a newer system where someone actually wants to use > > termcap and forces LIBS_TERMCAP, this will make sure that TERMINFO is > > "no" even though libtermcap is a symlink to libterminfo (= only > > the termcap compatibility functions will be used and terminfo stuff > > will be ignored even though configure sees tputs() and friends). > > > > The end result should be the same binary as pkgsrc packaging has > > provided for years, except that on a system with ncurses installed > > it will be used. > > I don't mind installing the above instead of my proposal, thanks. Great. I looked at NetBSD 5.1 sources and expanded the check somewhat: --- a/configure.ac +++ b/configure.ac @@ -5212,7 +5212,11 @@ AC_DEFUN ;; netbsd) - if test "x$LIBS_TERMCAP" != "x-lterminfo"; then + # NetBSD versions prior to 6.0 lack native terminfo, but have a + # tputs() built on top of termcap in these libraries. Use native + # termcap instead in this case. NetBSD >= 6.0 has native terminfo + # implementation in -lterminfo. + if test "x$LIBS_TERMCAP" = "x-ltermcap" -o "x$LIBS_TERMCAP" = "x-lcurses"; then TERMINFO=no LIBS_TERMCAP="-ltermcap" fi On 5.1 and older (no ncurses installed), configure's scan through tputs_libraries matches either -ltermcap or -lcurses (both seem to include tputs() in 5.1, but situation may differ in older versions), but this will be termcap under the hood. Therefore force TERMINFO=no and also force -ltermcap (as before) to avoid pulling in curses unnecessarily. On 6.0 and newer (again no ncurses) the order of tputs_libraries should always cause -lterminfo to match first, so the branch will not be taken and TERMINFO stays enabled. Installing ncurses should now enable full terminfo support on any version. Tested on 9.3 with and without ncurses installed and the result is full functionality with TERM=xterm-256color. -Valtteri