2011-10-31 14:34:06 +04:00
|
|
|
Building Haiku from source
|
|
|
|
==========================
|
2002-07-09 16:24:59 +04:00
|
|
|
|
2011-10-31 14:34:06 +04:00
|
|
|
This is a overview into the process of building HAIKU from source.
|
|
|
|
An online version is available at http://www.haiku-os.org/guides/building/
|
2002-07-09 16:24:59 +04:00
|
|
|
|
2011-10-31 14:34:06 +04:00
|
|
|
Official releases of Haiku are at http://www.haiku-os.org/get-haiku
|
|
|
|
The (unstable) nightly builds are available at http://www.haiku-files.org
|
2002-07-09 16:24:59 +04:00
|
|
|
|
2011-10-31 14:34:06 +04:00
|
|
|
To build Haiku, you will need to
|
|
|
|
* ensure pre-requisite software is installed
|
|
|
|
* download sources
|
|
|
|
* configure your build
|
|
|
|
* run jam to initiate the build process
|
2002-07-09 16:24:59 +04:00
|
|
|
|
2011-10-31 14:34:06 +04:00
|
|
|
We currently support these platforms:
|
|
|
|
* Haiku
|
|
|
|
* Linux
|
|
|
|
* FreeBSD
|
|
|
|
* Mac OS X Intel
|
2005-12-07 01:47:56 +03:00
|
|
|
|
2011-10-31 14:34:06 +04:00
|
|
|
Pre-requisite software
|
|
|
|
======================
|
2002-07-09 16:24:59 +04:00
|
|
|
|
2011-10-31 14:34:06 +04:00
|
|
|
Tools provided within Haiku's repositories
|
2005-12-07 01:47:56 +03:00
|
|
|
|
2011-12-27 01:15:03 +04:00
|
|
|
* Jam (Jam 2.5-haiku-20111222)
|
2011-10-31 14:34:06 +04:00
|
|
|
* Haiku's cross-compiler (needed only for non-Haiku platforms)
|
2002-07-09 16:24:59 +04:00
|
|
|
|
2011-10-31 14:34:06 +04:00
|
|
|
The tools to compile Haiku will vary, depending on the platform that you are
|
|
|
|
using to build Haiku. When building from Haiku, all of the necessary
|
|
|
|
development tools are included in official releases (e.g. R1 alpha 1) and in the
|
|
|
|
(unstable) nightly builds.
|
|
|
|
|
2011-11-12 18:02:42 +04:00
|
|
|
* Git client
|
2011-10-31 14:34:06 +04:00
|
|
|
* SSH client (for developers with commit access)
|
|
|
|
* gcc and the binutils (as, ld, etc., required by gcc)
|
|
|
|
* make (GNU make)
|
|
|
|
* bison
|
|
|
|
* flex and lex (usually a mini shell script invoking flex)
|
|
|
|
* makeinfo (part of texinfo, needed for building gcc 4 only)
|
|
|
|
* autoheader (part of autoconf, needed for building gcc)
|
|
|
|
* automake
|
|
|
|
* gawk
|
|
|
|
* yasm (http://www.tortall.net/projects/yasm/wiki/Download)
|
|
|
|
* wget
|
|
|
|
* (un)zip
|
|
|
|
* cdrtools (not genisoimage!)
|
|
|
|
* case-sensitive file system
|
|
|
|
|
|
|
|
Whether they are installed can be tested for instance by running them in the
|
|
|
|
shell with the "--version" parameter.
|
|
|
|
|
|
|
|
Specific: Haiku for the ARM platform
|
|
|
|
------------------------------------
|
|
|
|
|
|
|
|
The following tools are needed to compile Haiku for the ARM platform
|
|
|
|
|
|
|
|
* mkimage (http://www.denx.de/wiki/UBoot)
|
|
|
|
* Mtools (http://www.gnu.org/software/mtools/intro.html)
|
|
|
|
* sfdisk
|
|
|
|
|
2012-05-05 00:16:12 +04:00
|
|
|
Specific: Linux
|
|
|
|
---------------
|
|
|
|
* zlib1g-dev (for building GCC4 buildtools on Linux hosts)
|
|
|
|
|
2011-10-31 14:34:06 +04:00
|
|
|
Specific: Mac OS X
|
|
|
|
------------------
|
|
|
|
|
|
|
|
Disk Utility can create a case-sensitive disk image of at least 3 GiB in size.
|
|
|
|
The following darwin ports need to be installed:
|
|
|
|
* expat
|
|
|
|
* gawk
|
|
|
|
* gettext
|
|
|
|
* libiconv
|
|
|
|
* gnuregex
|
2011-11-01 12:58:16 +04:00
|
|
|
* gsed
|
2011-10-31 14:34:06 +04:00
|
|
|
|
|
|
|
More information about individual distributions of Linux and BSD can be found
|
|
|
|
at http://haiku-os.org/guides/building/pre-reqs
|
|
|
|
|
|
|
|
|
|
|
|
Download Haiku's sources
|
|
|
|
========================
|
|
|
|
|
|
|
|
There are two parts to Haiku's sources -- the code for Haiku itself and a set
|
|
|
|
of build tools for compiling Haiku on an operating system other than Haiku.
|
|
|
|
The buildtools are needed only for non-Haiku platform.
|
|
|
|
|
|
|
|
Anonymous checkout:
|
2011-11-12 18:02:42 +04:00
|
|
|
git clone git://git.haiku-os.org/haiku
|
|
|
|
git clone git://git.haiku-os.org/buildtools
|
2011-10-31 14:34:06 +04:00
|
|
|
|
|
|
|
Developer with commit access:
|
2011-11-12 18:02:42 +04:00
|
|
|
git clone ssh://git.haiku-os.org/haiku
|
|
|
|
git clone ssh://git.haiku-os.org/buildtools
|
2011-10-31 14:34:06 +04:00
|
|
|
|
|
|
|
|
|
|
|
Building the Jam executable
|
|
|
|
===========================
|
|
|
|
|
|
|
|
This step applies only to non-Haiku platforms.
|
|
|
|
|
|
|
|
Change to the buildtools folder and we will start to build 'jam' which is a
|
|
|
|
requirement for building Haiku. Run the following commands to generate and
|
|
|
|
install the tool:
|
|
|
|
|
|
|
|
cd buildtools/jam
|
|
|
|
make
|
|
|
|
sudo ./jam0 install
|
|
|
|
-- or --
|
|
|
|
./jam0 -sBINDIR=$HOME/bin install
|
|
|
|
|
|
|
|
|
|
|
|
Configuring your build
|
|
|
|
======================
|
2005-07-07 18:56:36 +04:00
|
|
|
|
2009-06-27 21:07:13 +04:00
|
|
|
The configure script generates a file named "BuildConfig" in the
|
|
|
|
"generated/build" directory. As long as configure is not modified (!), there
|
|
|
|
is no need to call it again. That is for re-building you only need to invoke
|
|
|
|
jam (see below). If you don't update the source tree very frequently, you may
|
|
|
|
want to execute 'configure' after each update just to be on the safe side.
|
2005-12-07 01:47:56 +03:00
|
|
|
|
2011-10-31 14:34:06 +04:00
|
|
|
Depending on your goal, there are several different ways to configure Haiku.
|
|
|
|
You can either call configure from within your Haiku trunk folder. That will
|
|
|
|
prepare a folder named 'generated', which will contain the compiled objects.
|
|
|
|
Another option is to manually created one or more 'generated.*' folders and run
|
|
|
|
configure from within them. For example imagine the following directory setup
|
|
|
|
|
|
|
|
buildtools-trunk/
|
|
|
|
haiku-trunk/
|
|
|
|
haiku-trunk/generated.x86gcc2
|
|
|
|
haiku-trunk/generated.x86gcc4
|
|
|
|
|
|
|
|
Configure a GCC 2.95 Hybrid, from non-Haiku platform
|
|
|
|
----------------------------------------------------
|
|
|
|
|
|
|
|
cd haiku-trunk/generated.x86gcc4
|
|
|
|
../configure --use-gcc-pipe --use-xattr \
|
|
|
|
--build-cross-tools-gcc4 x86 ../../buildtools/ \
|
|
|
|
--alternative-gcc-output-dir ../generated.x86gcc2
|
|
|
|
cd ../generated.x86gcc2
|
|
|
|
../configure --use-gcc-pipe --use-xattr \
|
|
|
|
--build-cross-tools ../../buildtools/ \
|
|
|
|
--alternative-gcc-output-dir ../generated.x86gcc4
|
|
|
|
|
|
|
|
Configure a GCC 2.95 Hybrid, from within Haiku
|
|
|
|
----------------------------------------------
|
|
|
|
|
|
|
|
cd haiku-trunk/generated.x86gcc4
|
|
|
|
../configure --use-gcc-pipe \
|
|
|
|
--alternative-gcc-output-dir ../generated.x86gcc2 \
|
|
|
|
--cross-tools-prefix /boot/develop/abi/x86/gcc4/tools/current/bin/
|
|
|
|
cd ../generated.x86gcc2
|
|
|
|
../configure --use-gcc-pipe \
|
|
|
|
--alternative-gcc-output-dir ../generated.x86gcc4 \
|
|
|
|
--cross-tools-prefix /boot/develop/abi/x86/gcc2/tools/current/bin/
|
|
|
|
|
|
|
|
Additional information about GCC Hybrids can be found on the website,
|
|
|
|
http://www.haiku-os.org/guides/building/gcc-hybrid
|
|
|
|
|
|
|
|
Configure options
|
|
|
|
-----------------
|
|
|
|
|
2011-12-18 15:09:20 +04:00
|
|
|
The various runtime options for configure are documented in its onscreen help
|
2011-10-31 14:34:06 +04:00
|
|
|
|
|
|
|
./configure --help
|
|
|
|
|
2005-12-07 01:47:56 +03:00
|
|
|
|
2011-10-31 14:34:06 +04:00
|
|
|
Building via Jam
|
|
|
|
================
|
2005-12-07 01:47:56 +03:00
|
|
|
|
2007-01-30 22:53:23 +03:00
|
|
|
Haiku can be built in either of two ways, as disk image file (e.g. for use
|
2011-10-31 14:34:06 +04:00
|
|
|
with emulators, to be written directly to a usb stick, burned as a compact
|
|
|
|
disc) or as installation in a directory.
|
2005-12-07 01:47:56 +03:00
|
|
|
|
2011-10-31 14:34:06 +04:00
|
|
|
Running Jam
|
|
|
|
-----------
|
2005-12-07 01:47:56 +03:00
|
|
|
|
2011-10-31 14:34:06 +04:00
|
|
|
There are various ways in which you can run jam.
|
2005-12-07 01:47:56 +03:00
|
|
|
|
2011-10-31 14:34:06 +04:00
|
|
|
* If you have a single generated folder,
|
|
|
|
you can run 'jam' from the top level of Haiku's trunk.
|
|
|
|
* If you have one or more generated folders,
|
|
|
|
(e.g. generated.x86gcc2), you can cd into that directory and run 'jam'
|
|
|
|
* In either case, you can cd into a certain folder in the source tree (e.g.
|
|
|
|
src/apps/debugger) and run jam -sHAIKU_OUTPUT_DIR=<path to generated folder>
|
2002-07-09 16:24:59 +04:00
|
|
|
|
2011-10-31 14:34:06 +04:00
|
|
|
Be sure to read build/jam/UserBuildConfig.ReadMe and UserBuildConfig.sample,
|
|
|
|
as they contain information on customizing your build of Haiku.
|
|
|
|
|
|
|
|
Building a Haiku anyboot file
|
|
|
|
---------------------------
|
|
|
|
|
|
|
|
jam -q haiku-anyboot-image
|
|
|
|
|
|
|
|
This generates an image file named 'haiku-anyboot.image' in your output
|
|
|
|
directory under 'generated/'.
|
|
|
|
|
|
|
|
Building a VMware image file
|
|
|
|
----------------------------
|
2002-07-09 16:24:59 +04:00
|
|
|
|
2007-01-30 22:53:23 +03:00
|
|
|
jam -q haiku-vmware-image
|
2002-07-09 16:24:59 +04:00
|
|
|
|
2007-01-30 22:53:23 +03:00
|
|
|
This generates an image file named 'haiku.vmdk' in your output
|
|
|
|
directory under 'generated/'.
|
2002-07-09 16:24:59 +04:00
|
|
|
|
2007-01-30 22:53:23 +03:00
|
|
|
Directory Installation
|
|
|
|
----------------------
|
2002-07-09 16:24:59 +04:00
|
|
|
|
2007-01-30 22:53:23 +03:00
|
|
|
HAIKU_INSTALL_DIR=/Haiku jam -q install-haiku
|
2002-07-09 16:24:59 +04:00
|
|
|
|
2007-01-30 22:53:23 +03:00
|
|
|
Installs all Haiku components into the volume mounted at "/Haiku" and
|
|
|
|
automatically marks it as bootable. To create a partition in the first place
|
|
|
|
use DriveSetup and initialize it to BFS.
|
2005-07-07 18:56:36 +04:00
|
|
|
|
2011-10-31 14:34:06 +04:00
|
|
|
Note that installing Haiku in a directory only works as expected under Haiku,
|
|
|
|
but it is not yet supported under Linux and other non-Haiku platforms.
|
2008-03-04 02:20:26 +03:00
|
|
|
|
2011-10-31 14:34:06 +04:00
|
|
|
Building individual components
|
|
|
|
------------------------------
|
2005-07-07 18:56:36 +04:00
|
|
|
|
2007-01-30 22:53:23 +03:00
|
|
|
If you don't want to build the complete Haiku, but only a certain
|
|
|
|
app/driver/etc. you can specify it as argument to jam, e.g.:
|
2005-12-07 01:47:56 +03:00
|
|
|
|
2011-10-31 14:34:06 +04:00
|
|
|
jam Debugger
|
2005-12-07 01:47:56 +03:00
|
|
|
|
2007-01-30 22:53:23 +03:00
|
|
|
Alternatively, you can 'cd' to the directory of the component you want to
|
2011-10-31 14:34:06 +04:00
|
|
|
build and run 'jam' from there. Note: if your generated directory named
|
|
|
|
something other than "generated/", you will need to tell jam where it is.
|
|
|
|
|
|
|
|
jam -sHAIKU_OUTPUT_DIR=<path to generated folder>
|
2005-12-07 01:47:56 +03:00
|
|
|
|
2007-01-30 22:53:23 +03:00
|
|
|
You can also force rebuilding of a component by using the "-a" parameter:
|
2005-12-07 01:47:56 +03:00
|
|
|
|
2011-10-31 14:34:06 +04:00
|
|
|
jam -a Debugger
|
2002-07-09 16:24:59 +04:00
|
|
|
|
|
|
|
|
2005-07-07 18:56:36 +04:00
|
|
|
Running
|
2007-01-30 22:53:23 +03:00
|
|
|
=======
|
2002-07-15 02:10:54 +04:00
|
|
|
|
2007-01-30 22:53:23 +03:00
|
|
|
Generally there are two ways of running Haiku. On real hardware using a
|
2011-10-31 14:34:06 +04:00
|
|
|
partition and on emulated hardware using an emulator like Bochs or QEMU.
|
2002-07-15 02:10:54 +04:00
|
|
|
|
2007-01-30 22:53:23 +03:00
|
|
|
On Real Hardware
|
|
|
|
----------------
|
2002-07-15 02:10:54 +04:00
|
|
|
|
2007-01-30 22:53:23 +03:00
|
|
|
If you have installed Haiku to its own partition you can include this
|
|
|
|
partition in your bootmanager and try to boot Haiku like any other OS you
|
2011-10-31 14:34:06 +04:00
|
|
|
have installed. To include a new partition in the Haiku bootmanager run this
|
2007-01-30 22:53:23 +03:00
|
|
|
in a Terminal:
|
2002-07-15 02:10:54 +04:00
|
|
|
|
2011-12-18 15:09:20 +04:00
|
|
|
BootManager
|
2002-07-15 02:10:54 +04:00
|
|
|
|
2007-01-30 22:53:23 +03:00
|
|
|
On Emulated Hardware
|
|
|
|
--------------------
|
2002-07-09 16:24:59 +04:00
|
|
|
|
2007-01-30 22:53:23 +03:00
|
|
|
For emulated hardware you should build disk image (see above). How to setup
|
2011-10-31 14:34:06 +04:00
|
|
|
this image depends on your emulater. If you use QEMU, you can usually just
|
|
|
|
provide the path to the image as command line argument to the "qemu"
|
|
|
|
executable.
|
2005-05-16 14:03:16 +04:00
|
|
|
|
|
|
|
|
|
|
|
Docbook documentation
|
2007-01-30 22:53:23 +03:00
|
|
|
=====================
|
|
|
|
|
|
|
|
Our documentation can be found in 'src/documentation/'. You can build it by
|
|
|
|
running 'jam' in that folder. The results will be stored in the 'generated/'
|
|
|
|
folder.
|