ANN: xterm-356

Thomas Dickey dickey at his.com
Mon May 11 20:51:02 UTC 2020


On Mon, May 11, 2020 at 05:10:27PM +0000, Dennis Clarke wrote:
> On 5/3/20 12:56 AM, Thomas Dickey wrote:
> <snip>
> >                              Patch #356 - 2020/05/02
> > 
> >       * revise  fix  for  Debian #954730, which interfered with wheel mouse
> >         events (report by Gabriele Balducci).
> > 
> 
> I ran into problems on FreeBSD 12.1 wherein I was surprised to see this
> error during the compile stage :

I did test with FreeBSD 12.1, but didn't run into this problem.
I don't recall making any recent change in this area, either.
 
> misc.o print.o ptydata.o scrollback.o screen.o scrollbar.o tabs.o util.o
> version.o xstrings.o xtermcap.o VTPrsTbl.o TekPrsTbl.o Tekproc.o charclass.o
> precompose.o wcwidth.o html.o svg.o -lutil -lXaw -lXmu -lXt -lSM -lICE
> -lXext -lXpm -lXt -lX11 -lSM -lICE
...

my generated makefile does this:

/bin/sh ./plink.sh gcc -g -O2 -pthread -pthread -pthread -pthread -pthread   -o resize resize.o version.o xstrings.o -lXft -L/usr/local/lib -lfontconfig -lfreetype -lXext -lutil -lXaw7 -L/usr/local/lib -lXmu -lXinerama -lXpm -L/usr/local/lib -lXt -lX11 -lSM -lICE -ltermcap

My configure script said this:

checking if we want full tgetent function... yes
checking for full tgetent function... -ltermcap
checking for termcap.h... yes

> ld: error: undefined symbol: tgetstr
> >>> referenced by xtermcap.c:247 (./xtermcap.c:247)
> >>>               xtermcap.o:(loadTermcapStrings)

I'd suppose that the configure script didn't succeed in the check for
libtermcap -- which is actually a symbolic link to ncurses:

$ ls -l /usr/lib/libtermc*
lrwxr-xr-x  1 root  wheel  12 Dec  6  2018 /usr/lib/libtermcap.a -> libncurses.a
lrwxr-xr-x  1 root  wheel  13 Dec  6  2018 /usr/lib/libtermcap.so -> libncurses.so
lrwxr-xr-x  1 root  wheel  14 Dec  6  2018 /usr/lib/libtermcap_p.a -> libncurses_p.a
lrwxr-xr-x  1 root  wheel  13 Dec  6  2018 /usr/lib/libtermcapw.a -> libncursesw.a
lrwxr-xr-x  1 root  wheel  14 Dec  6  2018 /usr/lib/libtermcapw.so -> libncursesw.so
lrwxr-xr-x  1 root  wheel  15 Dec  6  2018 /usr/lib/libtermcapw_p.a -> libncursesw_p.a


> To be clear I was trying to compile with strict C99 and also with
> XOPEN_SOURCE defined at '600' which should keep me safely within the
> POSIX "IEEE Std 1003.1, 2004 Edition" world.  Usually works fine.

usually :-)
 
> My compiler was the typical system LLVM/Clang version in FreeBSD :
> 
> 
> vesta$ cc --version
> FreeBSD clang version 8.0.1 (tags/RELEASE_801/final 366581) (based on LLVM
> 8.0.1)
> Target: x86_64-unknown-freebsd12.1
> Thread model: posix
> InstalledDir: /usr/bin
> vesta$
> 
> With some rather strict flags and verbose warnings :
> 
> 
> 
> CC=/usr/bin/cc
> CFLAGS=-std=iso9899:1999 -pedantic -pedantic-errors -Weverything
> -Wno-reserved-id-macro -Wno-missing-prototypes -m64 -g -O0 -fno-fast-math
> -fno-builtin
> CPPFLAGS=-D_POSIX_PTHREAD_SEMANTICS -D_LARGEFILE64_SOURCE -D_TS_ERRNO
> -D_XOPEN_SOURCE=600
> CXX=/usr/bin/c++
> CXXFLAGS=-m64 -g -O0 -fno-fast-math -fno-builtin -Wl,-rpath=/opt/bw/lib
> 
> I have also tried various gymnastics with the FreeBSD system ld linker
> which appears to be the LLVM linker ld.lld.
> 
> Configure always runs clean and outputs a strange message as the last
> line but not an error state :

...yes - error-handling is a problem, because (when I can), I just report
the problem in the configure script, and try to produce something that
works.
 
> checking if POSIX saved-ids are supported... yes
> checking if we want full tgetent function... yes
> checking for full tgetent function... no
> checking for partial tgetent function... no

well...,. the problem is this: the last test for tgetent fails
because there's no prototype (cannot compile) rather than the intended
runtime check.

The existence check (for tgetent) succeeds since that just uses "nm".

The original BSD termcap had no headers for declaring prototypes.
That's only done in later stuff.  You'll notice a termcap.h file,
which is from ncurses.  I don't check for that by default because
a real termcap implementation (other than the GNU termcap which
Slackware still uses...) hasn't got that header.

In the more typical case, the script would find the terminfo interface
(and the associated term.h file), but FreeBSD base doesn't _do_ that.

Given all of that, I can improve the configure script by checking for
this case and disabling the tcap-query feature for FreeBSD if the
configure script isn't able to compile/link the tgetent function.

-- 
Thomas E. Dickey <dickey at invisible-island.net>
https://invisible-island.net
ftp://ftp.invisible-island.net
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <https://lists.x.org/archives/xorg/attachments/20200511/eb25c4f0/attachment-0001.sig>


More information about the xorg mailing list