From: Leo Famulari <leo@famulari.name>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: guix-devel@gnu.org
Subject: Re: [PATCH 5/5] gnu: Build lua-5.1 with dynamic library support and a dynamic library.
Date: Mon, 14 Dec 2015 01:22:01 -0500 [thread overview]
Message-ID: <20151214062201.GB10634@jasmine> (raw)
In-Reply-To: <876102wbyf.fsf@gnu.org>
On Sun, Dec 13, 2015 at 05:27:36PM +0100, Ludovic Courtès wrote:
> Leo Famulari <leo@famulari.name> skribis:
>
> > * gnu/packages/lua.scm (lua-5.1)[arguments]: Rewrite make-flags so that
> > Lua is built with platform-specific instructions for shared library
> > loading (dlopen).
> > * gnu/packages/patches/lua51-liblua-so.patch: Install liblua.so with
> > execute bit set. Move "-fPIC" flag from patch to package definition.
>
> [...]
>
> > + #:make-flags (list "PLAT= linux"
> > + "CFLAGS= -O2 -Wall -fPIC $(MYCFLAGS)"
> > + "MYLDFLAGS= -fPIC"
>
> Why not just:
>
> MYCFLAGS=-fPIC
>
> instead of CFLAGS=…? This would be consistent with how MYLDFLAGS is
> used.
Because lua-5.1's Makefile is broken in a tricky way.
When building Lua you are supposed to set PLAT in order to tailor the
build to your platform. The problem is that MYCFLAGS is clobbered and
redefined based on the value of PLAT. So, MYCFLAGS isn't actually
available for customizing the in the way that MYLDFLAGS is. [0]
CFLAGS, on the other hand, never gets redefined, so we can use it to
pass -fPIC. [1] The other CFLAGS options in the patch are default values
in the upstream Makefile that I chose to preserve.
>
> > + (string-append "INSTALL_TOP= "
> > + (assoc-ref %outputs "out"))
> > + (string-append "INSTALL_MAN= "
> > + (assoc-ref %outputs "out")
> > + "/share/man/man1"))))))
>
> I’m under the impression that these two variables aren’t needed since
> things already get installed in the right place, no?
The current lua-5.1 package definition is inheriting from lua-5.2, where
these are set. Since this patch series gives lua-5.1 its own
(arguments), I reproduced these variables.
I've rebased the unmerged parts of the patch series on master, and made
the requested changes. I'll send them shortly.
[0] Actually, MYLDFLAGS gets clobbered as well if you build for the
platforms 'aix' or 'mingw'.
[1] Again, 'aix' clobbers CFLAGS.
prev parent reply other threads:[~2015-12-14 6:22 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-02 17:46 [PATCH 0/5] Lua: enable shared library loading, build liblua.so Leo Famulari
2015-11-02 17:46 ` [PATCH 1/5] gnu: Remove tabulation from luajit Leo Famulari
2015-11-02 17:46 ` [PATCH 2/5] gnu: Build lua-5.2 with dynamic library support Leo Famulari
2015-11-08 21:08 ` Ludovic Courtès
2015-12-14 6:23 ` Leo Famulari
2015-11-02 17:46 ` [PATCH 3/5] gnu: Build lua-5.2 with a dynamic library Leo Famulari
2015-11-08 21:12 ` Ludovic Courtès
2015-11-02 17:46 ` [PATCH 4/5] gnu: Use make-flags and modify-phases for lua-5.2 Leo Famulari
2015-12-13 16:24 ` Ludovic Courtès
2015-12-14 6:22 ` Leo Famulari
2015-11-02 17:46 ` [PATCH 5/5] gnu: Build lua-5.1 with dynamic library support and a dynamic library Leo Famulari
2015-12-13 16:27 ` Ludovic Courtès
2015-12-14 6:22 ` Leo Famulari [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20151214062201.GB10634@jasmine \
--to=leo@famulari.name \
--cc=guix-devel@gnu.org \
--cc=ludo@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).