Skip site navigation (1)Skip section navigation (2)
Date:      Sun,  8 Apr 2012 15:15:42 +0200 (CEST)
From:      Pierre Guinoiseau <pierre@guinoiseau.eu>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/166753: [patch] lang/lua: missing Lua features because of CFLAGS override by port
Message-ID:  <20120408131542.DCC11970@alderaan.home.poildetroll.net>
Resent-Message-ID: <201204081320.q38DK8b2094623@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         166753
>Category:       ports
>Synopsis:       [patch] lang/lua: missing Lua features because of CFLAGS override by port
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Apr 08 13:20:08 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator:     Pierre Guinoiseau <pierre@guinoiseau.eu>
>Release:        FreeBSD 9.0-STABLE amd64
>Organization:
>Environment:
System: FreeBSD alderaan.home.poildetroll.net 9.0-STABLE FreeBSD 9.0-STABLE #0 r233766M: Mon Apr 2 02:55:14 CEST 2012 root@alderaan.home.poildetroll.net:/usr/obj/usr/src/sys/ALDERAAN amd64


	
>Description:
	
Hi,

I have had a strange problem after updating lang/lua (and even rebuilding the
previous version): some functionalities like popen() and dynamic libraries were
not enabled. I've found out after rebuilding it by hand that -DLUA_USE_LINUX
(which enables popen, dlopen, etc. according to luaconf.h) was not defined when
compiling with the port:

by hand:
    cd src && make freebsd
    make all MYCFLAGS="-DLUA_USE_LINUX" MYLIBS="-Wl,-E -lreadline"
    cc -O2 -pipe -march=nocona -fPIC -march=core2 -Wall -DLUA_USE_LINUX -c lapi.c
    cc -O2 -pipe -march=nocona -fPIC -march=core2 -Wall -DLUA_USE_LINUX -c lcode.c
    cc -O2 -pipe -march=nocona -fPIC -march=core2 -Wall -DLUA_USE_LINUX -c ldebug.c
    cc -O2 -pipe -march=nocona -fPIC -march=core2 -Wall -DLUA_USE_LINUX -c ldo.c
    ...

by port:
    cd src && make freebsd
    make all MYCFLAGS="-DLUA_USE_LINUX" MYLIBS="-Wl,-E -lreadline"
    cc -O2 -pipe -march=nocona -fPIC -march=core2 -c lapi.c
    cc -O2 -pipe -march=nocona -fPIC -march=core2 -c lcode.c
    cc -O2 -pipe -march=nocona -fPIC -march=core2 -c ldebug.c
    cc -O2 -pipe -march=nocona -fPIC -march=core2 -c ldo.c
    ...

If you look into src/Makefile, you can see that:
    CFLAGS+=  -Wall $(MYCFLAGS)

    [...]

    freebsd:
            $(MAKE) all MYCFLAGS="-DLUA_USE_LINUX" MYLIBS="-Wl,-E -lreadline"

Apparently, this CFLAGS is not taken into account when building with the port.
So, I tried to remove 'MAKE_ARGS=CFLAGS="${CFLAGS}"' from the port's Makefile
(see attached patch), and it worked! And custom CFLAGS from make.conf are still
used.

Revision 1.48 of the port seems to be the origin of this problem:
http://www.freebsd.org/cgi/cvsweb.cgi/ports/lang/lua/Makefile.diff?r1=1.47;r2=1.48

Regards,


>How-To-Repeat:
	
>Fix:

	

--- lua-make-args-cflags.diff begins here ---
diff -ruN --exclude=CVS ../lua.orig/Makefile ./Makefile
--- ../lua.orig/Makefile	2012-04-08 14:46:22.441455000 +0200
+++ ./Makefile	2012-04-08 14:47:46.687479850 +0200
@@ -24,7 +24,6 @@
 USE_LDCONFIG=	yes
 MAKE_JOBS_SAFE=	yes
 MAKE_ENV=	LUA_SONAME="liblua-${LUA_VER}.so.${LUA_VER_SH}"
-MAKE_ARGS=	CFLAGS="${CFLAGS}"
 
 MAN1=		lua-${LUA_VER}.1 luac-${LUA_VER}.1
 DOCSDIR=	${PREFIX}/share/doc/${LUA_SUBDIR}
--- lua-make-args-cflags.diff ends here ---


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120408131542.DCC11970>