Subject: Re: Bug#644728: libncurses5-dev: static linking with -lncurses is broken

From: Sven Joachim <[email-masked]>
Date: Wed, 12 Oct 2011 18:42:33 +0200

clone 644728 -1
reassign -1 zsh 4.3.12-1
retitle -1 zsh: FTBFS: configure: error: "No terminal handling library was found on your system."
clone 644728 -2
reassign -2 bash 4.1-3
retitle -2 bash: FTBFS with libncurses5-dev 5.9-3
severity -2 important
tags -2 wheezy sid
retitle 644728 libncurses5-dev: static linking with -lncurses requires -ltinfo as well
severity 644728 normal
thanks

On 2011-10-08 16:14 +0200, Sven Joachim wrote:

> Package: libncurses5-dev
> Version: 5.9-2
> Severity: serious
> X-Debbugs-CC: Matthias Klose <[email-masked]>
>
> Static linking with -lncurses fails if you need symbols from libtinfo:
>
> ,----
> | $ cat foo.c
> | #include <term.h>
> | #include <stdlib.h>
> | 
> | int main(void)
> | {
> |   return tgetent(NULL, "");
> | }
> | $ LANG=C gcc foo.c -lncurses -static
> | /tmp/ccRe0RW2.o: In function `main':
> | foo.c:(.text+0x19): undefined reference to `tgetent'
> | collect2: ld returned 1 exit status
> `----

The general opinion seems to be that this is acceptable, and that people
wishing statically linking with ncurses need to specify -ltinfo
themselves, e.g. by using "pkg-config --static --libs ncurses" (only
possible in wheezy and later, though).

> This makes zsh and possibly a few other packages FTBFS.

The only other affected package I know of is bash which does not FTBFS
right now, but will with libncurses5-dev 5.9-3 due to the changes for
#644426.  I will followup on the cloned bugs individually once I have
their numbers.

Cheers,
       Sven