Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 12 Aug 2004 04:25:55 +0200
From:      Bartosz Fabianowski <freebsd@chillt.de>
To:        Don Lewis <truckman@FreeBSD.org>
Cc:        openoffice@FreeBSD.org
Subject:   Re: openoffice-1.1 build more broken than usual on 5.2-CURRENT
Message-ID:  <411AD533.6000406@chillt.de>
In-Reply-To: <200408120119.i7C1JRbC018760@gw.catspoiler.org>
References:  <200408120119.i7C1JRbC018760@gw.catspoiler.org>

next in thread | previous in thread | raw e-mail | index | archive | help
 > [...] 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.

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.

- Bartosz



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