From owner-freebsd-hackers Mon Mar 18 9:21:29 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from Daffy.timing.com (daffy.timing.com [206.168.13.218]) by hub.freebsd.org (Postfix) with ESMTP id C377537B400 for ; Mon, 18 Mar 2002 09:21:22 -0800 (PST) Received: from brain.timing.com (brain.timing.com [206.168.13.195]) by Daffy.timing.com (8.11.3/8.11.3) with ESMTP id g2IHLMW40023; Mon, 18 Mar 2002 10:21:22 -0700 (MST) (envelope-from jhein@timing.com) Received: from brain.timing.com (localhost [127.0.0.1]) by brain.timing.com (8.12.2/8.12.2) with ESMTP id g2IHLLM8005983; Mon, 18 Mar 2002 10:21:21 -0700 (MST) (envelope-from jhein@brain.timing.com) Received: (from jhein@localhost) by brain.timing.com (8.12.2/8.12.2/Submit) id g2IHLLdG005980; Mon, 18 Mar 2002 10:21:21 -0700 (MST) (envelope-from jhein) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15510.8721.546546.172867@brain.timing.com> Date: Mon, 18 Mar 2002 10:21:21 -0700 From: John E Hein To: hackers@FreeBSD.ORG Subject: ports & DESTDIR (was: STLPORT and gcc3 (openoffice porting)) In-Reply-To: References: X-Mailer: VM 7.03 under Emacs 21.1.1 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Terry Lambert wrote 20:42:42 -0800 on Mar 17: > Paul Marquis wrote: > > Since the port of STLport is designed as a drop in replacement for > > the system STL, I've always used the -nostdinc++ option in my > > projects so that gcc won't even look at the default header files. > > This option should be used when building the port itself. As the > > STLport maintainer, I should have specified that. :-( > > From bsd.prog.mk: > - ---------------------------------------------------------------- > .if defined(DESTDIR) && !defined(BOOTSTRAPPING) > CFLAGS+= -I${DESTDIR}/usr/include > CXXINCLUDES+= -I${DESTDIR}/usr/include/g++ > .endif > - ---------------------------------------------------------------- > > That option does not good, if you set DESTDIR and use the BSD > .mk file system, which will put it right back in the options > list for the program being built. > > You really do have to hack up the Makefile to list the port > compiler include path first, or this overrides it. > > The typical way I do this for the includes is to redefine > the compiler to have a "-I/usr/local/" as part > of the command itself. It's generally harmless, otherwise. > > Otherwise... don't set "DESTDIR", or explicitly set > "BOOTSTRAPPING". Both of these have side effects that > are harder to control than jamming the include path into > the compiler command. bsd.ports.mk uses DESTDIR differently (wrongly IMO) than FreeBSD's buildworld or the rest of the world as far as I have seen. See (and lobby for) ports/28155. Unfortunately, the fix in 28155 will make DESTDIR behave the "right" way, and thus anyone expecting the "wrong" behavior will be surprised. OTOH, any ports using DESTDIR will do the wrong thing now anyway in many cases (see the How-To-Repeat in PR 28155). The problem with 28155 is that is a sweeping change that requires fixes to all ports that incorrectly use PREFIX & DESTDIR. But, if they don't define DESTDIR by default (the vast majority don't), then the patch is a no-op. If you build with 'make DESTDIR=/some/where', this patch will do the "right" thing. (I don't know if this will fix the STPORT problem since I didn't look that closely at it, but the direction Terry was taking that thread made me think of 28155). Anyway, I've never built the entire ports tree with the patch from 28155, just the few dozen ports we've needed for our products. So I don't know how badly it would break the ports tree (if at all). There may be a less disruptive fix than my patch (although we've been using it successfully in product builds here), but the whole ports/DESTDIR problem has been there for a long time now. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message