Best way to have a port...

Florent Thoumie flz at xbsd.org
Tue Mar 2 15:11:49 UTC 2010


On Tue, Mar 2, 2010 at 6:51 AM, M. Warner Losh <imp at bsdimp.com> 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 port
> for it, but I'm unclear how to even start.  This port should consist
> of all files from make includes TARGET_ARCH=mips.
>
> So, some questions: First, how do I know where the FreeBSD source tree
> is?  Is there some standard define like SYSDIR that contains this
> infomration?
>
> Second, I need to invoke make includes (and a few other things), with
> some slightly non-standard args.  is there a stylied way to do this?
> I'd like to avoid extracting everything into myport/work/FreeBSD :)
>
> Without solving these problems, the notion that we can use a ports
> compiler to build FreeBSD becomes less viable...

IIUC, you really want one new port that installs all mips headers. The
gcc/binutils port can be modified for ${ARCH} == "mips".

Something like this should work:
http://people.freebsd.org/~flz/local/ports/freebsd-mips.shar

The thing is, it will have to be modified everytime a header is
added/removed. The easy way out is to only support HEAD so you don't
have to use OSVERSION conditionals. The other solution I'm seeing is
to fetch sources from FTP (which is obviously more work).

-- 
Florent Thoumie
flz at FreeBSD.org
FreeBSD Committer


More information about the freebsd-ports mailing list