Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Fussy, pedantic issue with ncurses libraries
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
lars_the_bear
Guru
Guru


Joined: 05 Jun 2024
Posts: 451

PostPosted: Sun Sep 22, 2024 11:19 am    Post subject: Fussy, pedantic issue with ncurses libraries Reply with quote

Hi folks

It seems that the way I installed Gentoo, I ended up with libnursesw.so separated from libtinfow.so. I understand that ncurses can be built this way, or with these libraries combined. So far as I can see, most other Linux distributions have them combined.

My applications that use ncursesw have a single set of Makefiles that work on many Linux platforms -- Fedora, Ubuntu, Raspberry Pi at least -- but they don't work on Gentoo, because they don't explicitly link libtinfow.so, because they don't need to.

The solution is simple, in principle -- just modify all the Makefiles to have '-lncursesw -ltinfow', rather than just '-lnursesw'. But this means that I can no longer maintain a single set of Makefiles for all Linux platforms.

I'm curious whether this split between libncurses and libtinfo is peculiar to the way I set up Gentoo, or whether it will always be like that on a Gentoo system.

And if it will always be like that, I'm wondering if there's some non-ugly way I can modify my makefiles so that the link includes -ltinfow only on Gentoo. Or, perhaps, only on systems where this library exists. I can think of some ugly ways to do this, but surely there is some elegant way?

Incidentally, there seems to have been a fair bit of discussion of this point about ten years ago, and I don't think the Gentoo way of handling libncursesw is accidental. But it does seem to be out of line with other Linux variants.

BR, Lars.
Back to top
View user's profile Send private message
sam_
Developer
Developer


Joined: 14 Aug 2020
Posts: 1884

PostPosted: Sun Sep 22, 2024 11:24 am    Post subject: Reply with quote

You should use pkg-config instead, not hardcoding libraries: LIBS = $(pkg-config --libs ncursesw).

Anyway, see https://bugs.gentoo.org/457530. There's some more detailed discussion somewhere but I can't dig it up right now.

If you look at the Fedora packaging, they use a linker script hack to try to hide the issue.

Mod edit: Trailing period exorcised from the above URL. — JRG
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum