This is an old revision of the document!


Cross Compiling FreeBSD for Fun and Profit

* Obtain FreeBSD sources * setup build environment * Build

See http://www.freebsd.org for details. This article will assume that you've obtained the sources, placed them in /home/bob/src and wish to build into /home/bob/obj. We'll assume the user is familiar with csh commands, and will be able to translate them into whatever shell that they use.

For architectures that are supported by FreeBSD, cross building is relatively easy. For those that FreeBSD doesn't support, there's a lot more work.

The FreeBSD build system uses three environment variables to control which platform to build for, and where to put the results. By default, FreeBSD will build natively for the current architecture and place the results in /usr/obj.

Most people will want to change the location of the build. /usr/obj is far too generic a place for developers to build into. The environment variable MAKEOBJDIRPREFIX controls where the files are placed.

setenv MAKEOBJDIRPREFIX /home/bob/obj

To control which architecture to build for, set TARGET and TARGET_ARCH

setenv TARGET arm setenv TARGET_ARCH

TARGET matches MACHINE while TARGET_ARCH matches MACHINE_ARCH.

  • warnerlosh/a_brief_guide_to_cross_compiling_freebsd.1153434176.txt.gz
  • Last modified: 2006/07/20 22:22
  • by WarnerLosh