Date: Tue, 02 Mar 2010 08:33:38 -0700 (MST) From: "M. Warner Losh" <imp@bsdimp.com> To: uqs@spoerlein.net Cc: ports@FreeBSD.org Subject: Re: Best way to have a port... Message-ID: <20100302.083338.769051484029247401.imp@bsdimp.com> In-Reply-To: <20100302120308.GA53683@elmar.spoerlein.net> References: <20100301.235125.431102609672430399.imp@bsdimp.com> <20100302120308.GA53683@elmar.spoerlein.net>
next in thread | previous in thread | raw e-mail | index | archive | help
In message: <20100302120308.GA53683@elmar.spoerlein.net> Ulrich Sp=F6rlein <uqs@spoerlein.net> writes: : On Mon, 01.03.2010 at 23:51:25 -0700, M. Warner Losh wrote: : > ... that builds part of FreeBSD? : > = : > Let me back up... : > = : > I'm trying to create a port for gcc and binutils that is configured= : > for FreeBSD for a given machine. FreeBSD mips, say. binutils was : > relatively easy (once I ported our mips support forward). However,= : > gcc vexes me. It requires, to build libgcc and friends, a fully : > populated include tree. And it wants to use : > /usr/local/freebsd-mips/include instead of /usr/include (which is : > good). However, the former doesn't exist. I'd like to create a po= rt : > for it, but I'm unclear how to even start. This port should consis= t : > of all files from make includes TARGET_ARCH=3Dmips. : > = : > So, some questions: First, how do I know where the FreeBSD source t= ree : > is? Is there some standard define like SYSDIR that contains this : > infomration? : = : Simply take a look at ports that required /src or /sys to compile, eg= .= : lsof or fusefs-kmod: : = : lsof has: FREEBSD_SYS?=3D /usr/src/sys : fusefs-kmod has: SRC_BASE?=3D /usr/src : = : So neither of them use a predefined var. There's a lot more ports that use SYSDIR for /usr/src/sys :). lsof and fusefs-kmod are odd-men here. I think that most of the ports that rely on this feature do so because they include kmod.mk, for example. : > Second, I need to invoke make includes (and a few other things), wi= th : > some slightly non-standard args. is there a stylied way to do this= ? : > I'd like to avoid extracting everything into myport/work/FreeBSD :)= : = : Not quite sure on *when* you want to run make includes and if you wan= t : to run it for the port or for /usr/src? : = : You could override the "pre-build:" target with stuff necessary pre : build :) I want it to be a port that my gcc port depends on. So, to make that port, I need to know where /usr/src for the system lives. That's only half the battle, since I don't want to "extract" it to work/freebsd-mips-headers/blah, but just do the includes target there (with a combination of MAKEOBJDIRPREFIX and DESTDIR tricks, I think). Warner
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20100302.083338.769051484029247401.imp>