Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 11 Aug 2004 22:00:16 -0700 (PDT)
From:      Don Lewis <truckman@FreeBSD.org>
To:        freebsd@chillt.de
Cc:        openoffice@FreeBSD.org
Subject:   Re: openoffice-1.1 build more broken than usual on 5.2-CURRENT
Message-ID:  <200408120500.i7C50GIK019140@gw.catspoiler.org>
In-Reply-To: <411AD533.6000406@chillt.de>

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

On 12 Aug, Bartosz Fabianowski wrote:
>  > [...] When CFLAGS (or any other variable) is specified on the command
>  > line, this variable assignment is also stashed in the MAKEFLAGS
>  > environment variable, which gets passed to all the sub makes, [...]
> 
> If this is the root of the problem, then there must be some point in the 
> chain of make invocations where it's called with additional command line 
> arguments that then get passed on to gmake and screw up the build.
> 
> This apparently happens when the main port is trying to build the 
> mozilla subport. It first spawns a make to build the "mozilla" target in 
> /usr/ports/editors/openoffice-1.1/files/Makefile.mozilla - at this 
> point, no additional command line arguments are passed. However, 
> Makefile.mozilla doesn't quite build the subport itself, it delegates 
> the job to yet another make. And it does this by calling:
> 
> @cd ${WRKDIR}/mozilla ; ${MAKE} CXX="${CXX}" CC="${CC}" 
> CFLAGS="${CFLAGS}" USE_GCC=${USE_GCC} build WRKDIRPREFIX=""
> 
> This is the only place where command line arguments get appended. So my 
> guess is that at this point, some variables (most notably CFLAGS) get 
> set and cast in stone while gmake might expect to be able to change them 
> later on.

Yes.  If I remove CFLAGS="${CFLAGS}" from the above statement, the
mozilla portion of the build succeeds.

> For example, look at the following file:
> /usr/ports/editors/openoffice-1.1/work/mozilla/work/mozilla/nsprpub/config/config.mk
> 
> You will find these two lines:
> CFLAGS		= $(CC_ONLY_FLAGS) $(OPTIMIZER) $(OS_CFLAGS)\
> 		  $(XP_DEFINE) $(DEFINES) $(INCLUDES) $(XCFLAGS)
> 
> If this doesn't work, then no wonder heaps of defines, includes and 
> other flags miraculously disappear from the command used to compile now.c.
> 
> The easiest fix would seem to be to force the FreeBSD make that gets 
> called with command line parameters to *not* pass those on in MAKEFLAGS. 
> Unfortunately, I couldn't find any information in the man page on how to 
> do that. In gmake, passing on is default, but can be disabled by 
> "unexporting" certain variables.

Actually, we'd probably want to get them into $(OPTIMIZER), though
that's not really correct for things like -pipe.  I also don't know how
to cancel a variable definition once it finds its way into MAKEFLAGS.

Maybe the thing to do is to change the command in Makefile.mozilla to:

@cd ${WRKDIR}/mozilla ; ${MAKE} CXX="${CXX}" CC="${CC}" OPTIMIZER="${CFLAGS}" USE_GCC=${USE_GCC} build WRKDIRPREFIX=""



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