Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [PATCH] configure.ac: check for has_colors symbol in curses lib



Daniel Shahaf wrote on Sat, 25 Apr 2020 09:49 +0000:
> Lars Wendler wrote on Wed, 11 Dec 2019 16:55 +0100:
> > Otherwise zsh/curses module won't get built if ncurses was built with
> > separate tinfo lib.
> > One could still force-build the module but loading it later yields the
> > following error message:
> > 
> >   failed to load module `zsh/curses': /usr/lib64/zsh/5.7.1/zsh/curses.so:
> >   undefined symbol: COLORS
> > 
> > That is because the final linker call requires -lncurses(w) but it only
> > contains -ltinfo(w).
> >   
> 
> I can't reproduce the problem.
> 
> I'm on Debian buster.  The ncurses package is built with «--with-termlib=tinfo».
> On my system libncursesw.so.6 and libtinfo.so.6 are both installed, and
> the function «has_colors» is provided by libncursesw.so.6.  However, on
> my machine the zsh/curses module is built successfully and the
> tetriscurses function (in the zsh distribution) works — in plain
> master, without your patch.
> 
> I build with:
> 
>     CONFIG_SHELL=/bin/dash /path/to/zsh/configure -q --enable-zsh-debug --with-term-lib="tinfo" --prefix=…
>     perl -pi -e 's/link=dynamic/link=static/g; if (/link=static/) { s/auto=yes/auto=no/ }' config.modules

Relevant config.log excerpt:

[[[
configure:6182: checking for clock_gettime in -lrt
configure:6207: cc -o conftest  -Wall -Wmissing-prototypes -ggdb  -g conftest.c -lrt  -lm  -lc >&5
configure:6207: $? = 0
configure:6216: result: yes
configure:6241: checking for library containing tigetstr
configure:6272: cc -o conftest  -Wall -Wmissing-prototypes -ggdb  -g conftest.c -lrt -lm  -lc >&5
/usr/bin/ld: /tmp/conftest-e1b3ec.o: in function `main':
/tmp/zsh/conftest.c:91: undefined reference to `tigetstr'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
configure:6272: $? = 1
configure: failed program was:
configure:6272: cc -o conftest  -Wall -Wmissing-prototypes -ggdb  -g conftest.c -ltinfo  -lrt -lm  -lc >&5
configure:6272: $? = 0
configure:6289: result: -ltinfo
configure:6313: checking if _XOPEN_SOURCE_EXTENDED should not be defined
configure:6327: result: no
configure:6335: checking for library containing tigetstr
configure:6383: result: -ltinfo
configure:6391: checking for library containing tigetflag
configure:6422: cc -o conftest  -Wall -Wmissing-prototypes -ggdb  -g conftest.c -ltinfo -ltinfo -lrt -lm  -lc >&5
configure:6422: $? = 0
configure:6439: result: none required
configure:6447: checking for library containing tgetent
configure:6478: cc -o conftest  -Wall -Wmissing-prototypes -ggdb  -g conftest.c -ltinfo -ltinfo -lrt -lm  -lc >&5
configure:6478: $? = 0
configure:6495: result: none required
configure:6513: checking curses.h usability
configure:6513: cc -c  -Wall -Wmissing-prototypes -ggdb  conftest.c >&5
configure:6513: $? = 0
configure:6513: result: yes
configure:6513: checking curses.h presence
configure:6513: cc -E  conftest.c
configure:6513: $? = 0
configure:6513: result: yes
configure:6513: checking for curses.h
configure:6513: result: yes
configure:6556: checking if we need to ignore ncurses
configure:6574: checking for library containing tigetstr
configure:6605: cc -o conftest  -Wall -Wmissing-prototypes -ggdb  -g conftest.c -ltinfo -lrt -lm  -lc >&5
configure:6605: $? = 0
configure:6622: result: none required
configure:6630: checking for library containing tigetnum
configure:6661: cc -o conftest  -Wall -Wmissing-prototypes -ggdb  -g conftest.c -ltinfo -lrt -lm  -lc >&5
configure:6661: $? = 0
configure:6678: result: none required
configure:6686: checking for library containing tigetflag
configure:6717: cc -o conftest  -Wall -Wmissing-prototypes -ggdb  -g conftest.c -ltinfo -lrt -lm  -lc >&5
configure:6717: $? = 0
configure:6734: result: none required
configure:6742: checking for library containing tgetent
configure:6773: cc -o conftest  -Wall -Wmissing-prototypes -ggdb  -g conftest.c -ltinfo -lrt -lm  -lc >&5
configure:6773: $? = 0
configure:6790: result: none required
configure:6811: checking for library containing initscr
configure:6842: cc -o conftest  -Wall -Wmissing-prototypes -ggdb  -g conftest.c -ltinfo -ltinfo -lrt -lm  -lc >&5
/usr/bin/ld: /tmp/conftest-b582c6.o: in function `main':
/tmp/zsh/conftest.c:92: undefined reference to `initscr'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
configure:6842: $? = 1
configure:6842: cc -o conftest  -Wall -Wmissing-prototypes -ggdb  -g conftest.c -lncursesw  -ltinfo -ltinfo -lrt -lm  -lc >&5
configure:6842: $? = 0
configure:6859: result: -lncursesw
configure:6879: result: no
configure:6882: checking for library containing getpwnam
]]]



Messages sorted by: Reverse Date, Date, Thread, Author