SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: slack 7.1 till latest and -current, LFS
Posts: 368
Original Poster
Rep:
GazL,
You are saying yourself that you are compiling with linked-in the curses library.
and yes, the packages that I try to build are the faulty ones here.
* "bash" | with config option: --with-installed-readline
will not work.
* "bluez" 5.x | will error if not supplied by sed -i -e 's|-lreadline|\0 -lncursesw|g' Makefile.{in,tools}
* mozjs17.0.0 | will error on configure itself if supplied with the option --with-system-readline
this is a small selection.
programs these days expect that readline is already build against ncursesw.
The problem here is readline and not the other packages.
even tho, slackwares readline is build with the option --with-curses
it would mean that your supplied option of -lcursesw is not needed.
If upstream intended libreadline.so to be linked to curses when it is built then I would have expected them to have included the option to link it in the library's makefile and no modification would be necessary. Instead what they seem to have done is to include hooks (when --with-curses is used) that will allow the linking to be deferred until the executables that will use the library are built (requiring that both libraries be specified on the linker options). I'm not going to try and guess why they chose to do this, but as it's what they chose to do it seems to me that distros should respect that choice. The fact that other distros have muddied the waters by going against the intent of upstream and modifying the build: setting an expectation that '-lcurses' is not needed anymore on the programs that use it, is beside the point.
However, if I'm wrong on this and you are right that the way it is done now is indeed a bug, then it's a bug in the readline build process that should be addressed in upstream's makefile and should be reported upstream. IMO it's not the distro's job to second guess the intents of upstream: that way leads to fatal mistakes like the debian ssl debacle.
Distribution: slack 7.1 till latest and -current, LFS
Posts: 368
Original Poster
Rep:
I checked the readline Documentation.
And it appears slackware builds it wrong, or it is intended wrong:
The readline `configure' recognizes a single `--with-PACKAGE' option:
`--with-curses'
This tells readline that it can find the termcap library functions
(tgetent, et al.) in the curses library, rather than a separate
termcap library. Readline uses the termcap functions, but does not
link with the termcap or curses library itself, allowing applications
which link with readline the to choose an appropriate library.
This option tells readline to link the example programs with the
curses library rather than libtermcap.
Than the SHLIB_LIBS
In the stanza for your operating system-compiler pair, you will need to
define several variables. They are:
SHLIB_LIBS Any additional libraries that shared libraries should be
linked against when they are created.
And it appears slackware builds it wrong, or it is intended wrong:
The readline `configure' recognizes a single `--with-PACKAGE' option:
`--with-curses'
This tells readline that it can find the termcap library functions
(tgetent, et al.) in the curses library, rather than a separate
termcap library. Readline uses the termcap functions, but does not
link with the termcap or curses library itself, allowing applications
which link with readline the to choose an appropriate library.
This option tells readline to link the example programs with the
curses library rather than libtermcap.
Than the SHLIB_LIBS
In the stanza for your operating system-compiler pair, you will need to
define several variables. They are:
SHLIB_LIBS Any additional libraries that shared libraries should be
linked against when they are created.
Which is exactly what slackware currently does. so I don't see how slackware is doing it wrongly.
Distribution: slack 7.1 till latest and -current, LFS
Posts: 368
Original Poster
Rep:
Thats why I said, maybe it is intended.
readline basically links against either libtermcap (standard) or libncurses
now comes the funny part, libncurses provides the libtermcap API
so thats why most programs expect readline to be built against ncurses.
Debian started building against ncurses in 1997, RedHat built it with their rhel 6.
so I think its becoming standard that programs expect readline to be build against ncurses.
Distribution: slack 7.1 till latest and -current, LFS
Posts: 368
Original Poster
Rep:
The license is not against linking readline with ncurses.
pcretest example: --enable-pcretest-libreadline
If this is done, when pcretest's input is from a terminal, it reads it using
the readline() function. This provides line-editing and history facilities.
Note that libreadline is GPL-licenced, so if you distribute a binary of
pcretest linked in this way, there may be licensing issues.
Setting this option causes the -lreadline option to be added to the pcretest
build. In many operating environments with a sytem-installed readline
library this is sufficient. However, in some environments (e.g. if an
unmodified distribution version of readline is in use), it may be necessary
to specify something like LIBS="-lncurses" as well. This is because, to quote
the readline INSTALL, "Readline uses the termcap functions, but does not link
with the termcap or curses library itself, allowing applications which link
with readline the to choose an appropriate library." If you get error
messages about missing functions tgetstr, tgetent, tputs, tgetflag, or tgoto,
this is the problem, and linking with the ncurses library should fix it.
what is not allowed basically is, that binary programs can not use the below statement.
Summary: readline needs -lcurses if ncurses is installed
if we supply readline with -lcurses it is not a problem.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.