fix to not link liblua and luac against libreadline #4
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There is no need to link liblua and luac against libreadline and friends.
It makes only sense to link the lua interpreter itself against readline
as it is the only one which can be run interactively.
Please note that by setting setting use_readline=yes as action-if-found
within the AC_CHECK_LIB macro, is a kind of workaround for not leaking
in -lreadline via the LIBS variable which is used globaly within Makefiles
when linking is done.
see: http://www.gnu.org/software/autoconf/manual/autoconf.html#Libraries
Note for the Fedora package maintainers:
Most probably you can omit following hackery within the lua.spec file by
using this patch.
http://pkgs.fedoraproject.org/gitweb/?p=lua.git;a=blob;f=lua.spec;h=8629717abaf46dbbe3497c26e39baaaf4dfa51e2;hb=HEAD#l61
-------------------snip--------------------------------------------------
make %{?_smp_mflags} LIBS="-lm -ldl" luac_LDADD="liblua.la -lm -ldl"
sed -i 's/-lreadline -lncurses //g' etc/lua.pc
-------------------snip--------------------------------------------------
Most probably there will be no need anymore for passing the make options
LIBS="-lm -ldl" luac_LDADD="liblua.la -lm -ldl".
Same applies to the mangling of the lua.pc file via sed, as the resulting
lua.pc file won't include '-lreadline -lncurses' anymore.