View previous topic :: View next topic |
Author |
Message |
lars_the_bear Guru
Joined: 05 Jun 2024 Posts: 451
|
Posted: Sun Sep 22, 2024 11:19 am Post subject: Fussy, pedantic issue with ncurses libraries |
|
|
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 |
|
|
sam_ Developer
Joined: 14 Aug 2020 Posts: 1884
|
Posted: Sun Sep 22, 2024 11:24 am Post subject: |
|
|
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 |
|
|
|
|
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
|
|