From mboxrd@z Thu Jan 1 00:00:00 1970 From: Leo Famulari 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 Message-ID: <20151214062201.GB10634@jasmine> References: <876102wbyf.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:53795) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a8MWF-00078k-PB for guix-devel@gnu.org; Mon, 14 Dec 2015 01:22:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a8MWC-0006YF-JN for guix-devel@gnu.org; Mon, 14 Dec 2015 01:21:59 -0500 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:35318) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a8MWC-0006Xt-0j for guix-devel@gnu.org; Mon, 14 Dec 2015 01:21:56 -0500 Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 3BAF620862 for ; Mon, 14 Dec 2015 01:21:55 -0500 (EST) Content-Disposition: inline In-Reply-To: <876102wbyf.fsf@gnu.org> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: Ludovic =?iso-8859-1?Q?Court=E8s?= Cc: guix-devel@gnu.org On Sun, Dec 13, 2015 at 05:27:36PM +0100, Ludovic Courtès wrote: > Leo Famulari 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.