openoffice-1.1 build more broken than usual on 5.2-CURRENT
Don Lewis
truckman at FreeBSD.org
Wed Aug 11 22:00:30 PDT 2004
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=""
More information about the freebsd-openoffice
mailing list