Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix to not link liblua and luac against libreadline #4

Merged

Conversation

morfoh
Copy link
Contributor

@morfoh morfoh commented Feb 25, 2012

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.

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.
akheron added a commit that referenced this pull request Feb 27, 2012
…c8fed

fix to not link liblua and luac against libreadline
@akheron akheron merged commit 0d4ec39 into djerius:lua-5.1.4 Feb 27, 2012
@akheron
Copy link
Collaborator

akheron commented Feb 27, 2012

Merged, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants