From owner-freebsd-openoffice@FreeBSD.ORG Thu Aug 12 05:00:30 2004 Return-Path: Delivered-To: freebsd-openoffice@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6424316A4CF for ; Thu, 12 Aug 2004 05:00:30 +0000 (GMT) Received: from gw.catspoiler.org (217-ip-163.nccn.net [209.79.217.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id 06CE143D1F for ; Thu, 12 Aug 2004 05:00:30 +0000 (GMT) (envelope-from truckman@FreeBSD.org) Received: from FreeBSD.org (mousie.catspoiler.org [192.168.101.2]) by gw.catspoiler.org (8.12.11/8.12.11) with ESMTP id i7C50GIK019140; Wed, 11 Aug 2004 22:00:21 -0700 (PDT) (envelope-from truckman@FreeBSD.org) Message-Id: <200408120500.i7C50GIK019140@gw.catspoiler.org> Date: Wed, 11 Aug 2004 22:00:16 -0700 (PDT) From: Don Lewis To: freebsd@chillt.de In-Reply-To: <411AD533.6000406@chillt.de> MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii cc: openoffice@FreeBSD.org Subject: Re: openoffice-1.1 build more broken than usual on 5.2-CURRENT X-BeenThere: freebsd-openoffice@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Porting OpenOffice to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Aug 2004 05:00:30 -0000 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=""