Comments on pmake diffs for building on Linux
David O'Brien
obrien at FreeBSD.org
Tue Mar 4 17:52:45 UTC 2008
On Tue, Mar 04, 2008 at 03:15:32PM +0000, Robert Watson wrote:
> In most ports of FreeBSD parts to Linux that I've seen, the preferred
> solution has to been to bring the entire FreeBSD queue.h with you
> rather than relying on the native Linux queue.h. This is what we do
> for OpenBSM, for example; this also helps out when you get to Mac OS X,
We should stand back and divide the goal of building FreeBSD on MacOS X,
Solaris, and Linux this into two topics:
1. How to get a suitable set of build tools. This is everything
FreeBSD's src/Makefile.inc calls bootstrap, build, and cross tools.
This will 90% require scripts and duplicated (but portable) sources
in the projects CVS repository, with distfiles on ftp.freebsd.org.
These scripts and bootstrap tools should be able to depend on a
checked out FreeBSD src/ tree to reach over into. We would probably
need to trim less of our GNU tools in src/contrib when we import them.
2. Given a suitable set of tools (probably in the number of 20), built
and installed on your MacOS X, Solaris, or Linux hosts - how do we
now build FreeBSD. This is not the 'buildworld' or 'buildkernel'
targets. Those targets are explicitly designed to build FreeBSD
on a FreeBSD system. Those builds create bootstrap, build, and
cross tools that we've covered in #1.
I'm not sure how many folks know that this works (on FreeBSD):
cd /usr/src
make buildworld installworld
make clean
make
that is, a simple 'make' does build everything. Why was the
buildworld target created? Because if your installed system
does not 100% match your sources, you're doing a "cross build".
Presumably we'd have to create a suitable target (say
'nonhosted-cross') that sets up CC, AR, etc... macros to use
the tools from #1. DISTDIR would also need to be set. This
target would do something like:
make includes # this builds and installs
make libaries # I don't recall if this includes installing
make installlibaries
make all
make install
--
-- David (obrien at FreeBSD.org)
Q: Because it reverses the logical flow of conversation.
A: Why is top-posting (putting a reply at the top of the message) frowned upon?
Let's not play "Jeopardy-style quoting"
More information about the freebsd-hackers
mailing list