lang/lua: It does need gmake.

b. f. bf1783 at
Sat Mar 17 04:23:53 UTC 2012

On 3/16/12, Jeremy Messenger <mezz.freebsd at> wrote:
> On Fri, Mar 16, 2012 at 5:49 AM, b. f. <bf1783 at> wrote:
>> Jeremy Messenger wrote:
>>> On Thu, Mar 15, 2012 at 6:23 PM, Chuck Swiger <cswiger at> wrote:
>>> > On Mar 15, 2012, at 4:18 PM, Jeremy Messenger wrote:
>>> >> Figured out. Add custom CFLAGS in the make.conf and you will get a
>>> >> build failure with make but not gmake. Here's what I have in my
>>> >> make.conf:
>>> >>
>>> >> CFLAGS= -O2 -fno-strict-aliasing -pipe -g
>>> >> STRIP=
>>> >
>>> > Does it work properly if you use "CFLAGS+=" instead?
>>> It will, but you do not need to put '+' in make.conf. I have same
>>> CFLAGS for years and years, btw.
>> If you have been making these assignments unconditionally, then for
>> years and years you have been in danger of breaking or damaging the
>> builds for many ports that explicitly invoke make(1) more than once
>> (and thus read make.conf more than once), by clobbering prior changes
>> to CFLAGS or STRIP that are made in port makefiles.  Despite the
>> misleading examples in the base-system example make.conf, this kind of
>> customization is not supported for Ports, and not encouraged.  You
>> should take steps to ensure that your custom values are set only once,
>> before any top-level port Makefile is parsed.  You can define them
>> conditionally, or move them to another makefile that is included only
>> once, or disable multiple inclusions of make.conf for Ports by using
>> something like "__MAKE_CONF=/dev/null" in the right place.
> Any ports have to respect the CFLAGS, see the porter handbook. If it
> fails to do then it needs to be fixed. Add '+' in the make.conf is not
> right way to do it as it's merely add in exists CFLAGS.

What we actually require is that if you pass a reasonable set of
CFLAGS to the top-level of a port build, in the environment or an
included makefile, then the port uses those flags, *with as few
additions or changes as may be necessary to successfully build the
port*.  It does *not* necessarily mean that the port will only use the
user-defined CFLAGS, and very few ports do so -- most ports make
reasonable and necessary changes to the flags for parts of the port,
either in the port Makefile, the included makefiles in ports/Mk, or
the distribution makefiles.  These changes may be contained in CFLAGS
or another variable, or they may be explicit.  They typically include
aliasing switches, rpath instructions, changes to the search
directories for headers and libraries, parameter definitions,
PIC-related flags, etc.  The fact that ports can alter CFLAGS itself
is explicitly mentioned in the Porter's Handbook, and is evident in
the ports infrastructure: ports/Mk makefiles routinely alter CFLAGS;
CFLAGS are typically passed to distribution makefiles in MAKE_ENV, not
in MAKE_ARGS, so that they will be mutable in those makefiles; etc.  I
think that this should be clear to a committer of your experience.

As I wrote before, your unconditional assignment of CFLAGS in
make.conf can break or damage many ports, and you should not ask or
expect port maintainers to add unnecessary patches to ports in order
to support this unsafe practice.  I already mentioned several ways in
which you can safely customize the CFLAGS (without "+=") in my
previous message.

> mandree, thanks for took care of it!

On the contrary, the port is now damaged.  This is a good example of
the harmful consequences of make.conf abuse.  lang/lua now confusingly
and unnecessarily passes CFLAGS to the distribution makefiles both in
the environment and on the command-line.  More importantly, the


in ${WRKSRC}/src/Makefile no longer works, because adding CFLAGS to
MAKE_ARGS has made CFLAGS immutable in the distribution makefiles.
This means that the components are built without -DLUA_USE_LINUX, so
functionality has been removed from the port.  This change should be


More information about the freebsd-ports mailing list