From owner-freebsd-stable Mon Feb 12 13: 8:16 2001 Delivered-To: freebsd-stable@freebsd.org Received: from hand.dotat.at (sfo-gw.covalent.net [207.44.198.62]) by hub.freebsd.org (Postfix) with ESMTP id D290937B491; Mon, 12 Feb 2001 13:07:59 -0800 (PST) Received: from fanf by hand.dotat.at with local (Exim 3.20 #3) id 14SQCI-000Ag7-00; Mon, 12 Feb 2001 21:07:46 +0000 Date: Mon, 12 Feb 2001 21:07:46 +0000 From: Tony Finch To: Barney Wolff Cc: FUJISHIMA Satsuki , Kenneth W Cochran , ports@FreeBSD.org, stable@FreeBSD.org, Tony Finch , freebsd-gnats-submit@freebsd.org Subject: Re: ports/24711: Mozilla build failure, 4-stable Message-ID: <20010212210746.E35416@hand.dotat.at> References: <200102100231.VAA00143@world.std.com> <20010210010445.A43496@pit.databus.com> <86r914amlv.wl@cheerful.com> <20010211201229.A54579@pit.databus.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20010211201229.A54579@pit.databus.com> Organization: Covalent Technologies, Inc Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Barney Wolff wrote: >FUJISHIMA Satsuki wrote: >> Barney Wolff wrote: >> > >> > Try anything BUT /usr/obj as WRKDIRPREFIX. /usr/obj/ports, for >> > example. I found most or all ports fail to build if that >> > specific directory is used. I have no idea why. >> >> man make and read .OBJDIR section. > >Yes I understand the significance of /usr/obj, but not why, in >detail, the port builds fail. In any case, if there are some specific >directories that cause problems, perhaps bsd.port.mk should check for >them and complain, rather than letting the build fail with baffling >errors. See PR#24711. The reason it doesn't work is that the ports system uses ${MAKEFILE} to name the Makefile in the work directory that should be used to build the port. If the port's Makefile doesn't set MAKEFILE then bsd.port.mk tries to set it to "${BUILD_WRKSRC}/Makefile". However, it fails because ${MAKEFILE} also happens to be a special variable set by make itself. It is set in a slightly complicated way to support separate object trees. If /usr/obj/`pwd` exists then it is used as the object directory, so in order to refer back to the original Makefile make sets MAKEFILE to "`pwd`/Makefile". If the object directory doesn't exist then MAKEFILE is set to just "Makefile". So the MAKEFILE?=${BUILD_WRKSRC}/Makefile line in bsd.port.mk is entirely redundant because MAKEFILE is always set by make. Most of the time you are lucky and things still work, *unless* an object directory exists, in which case make sets MAKEFILE to a value that doesn't work and the build explodes. The problem occurs when bsd.port.mk tries to run make inside the work directory. If the port didn't set MAKEFILE and the object tree exists, then the port ends up trying to use /usr/ports/foo/bar/Makefile to build the port rather than /usr/obj/usr/ports/foo/bar/work/bar-1.2.3/Makefile. Tony. -- f.a.n.finch fanf@covalent.net dot@dotat.at FISHER: NORTHWEST 5 OR 6 DECREASING 3. SHOWERS. GOOD. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message