Pre-requisite Software

The tools you need to compile software for Haiku, or to compile Haiku itself, depend on the platform that is used for building. Currently, Haiku is arguably the most convenient development environment. A nightly image (or stable release) of Haiku should contain all of the software needed to build its sources for x86. So while Haiku is not the fastest, being able to immediately test the freshly compiled binaries and having the tool chain pre-installed certainly reduces the chances of headaches. On occasion, building Haiku on Haiku can be problematic if the host version is significantly out of date compared to the version being built. In this case, cross-compiling from another OS, or updating to a newer Haiku may be required to get things working again. Haiku currently supports building itself, or having itself cross compiled on another platform.

Build platform support matrix

Below are common build platforms and their statuses. This is not meant as a complete list, and the build specifics might change with new versions of those platforms. Further below you'll find more specific help on how to set up the build.

PlatformPackage ManagerSupportedSkill LevelNotes
HaikupkgmanYesBeginnerEasiest (with caveats)
Arch LinuxpacmanYesAdvanced-
BeOSpkgNo-Once upon a time..
CentOSrpm/yumYesIntermediate-
Debian LinuxaptYesIntermediateMissing mkisofs
Elementary OSaptYesBeginnerMissing mkisofs
Fedorarpm/yumYesBeginner-
FreeBSDpackagesYesAdvancedWorks very well
Linux MintaptYesBeginnerWorks very well
Mac OS XMacPortsYesIntermediateWorks
NetBSDpackagesYesAdvancedUntested
OpenSUSErpm/zypperYesIntermediate-
RedHat Linuxrpm/yumYesIntermediate-
Solarissolaris pkgNo--
UbuntuaptYesBeginnerWorks very well
WindowsCygwinNo--
ZetapkgNo-Once upon a time..

Generalized List

Requirements for compiling the build tools

Requirements for compiling Haiku

Requirements to compile Haiku for the ARM platform

Linux remarks

Building Haiku correctly currently requires proper xattr support on the file system you compile it with. Currently, your options are unfortunately rather limited, as for example, ext4 does not sufficiently support this feature. Recommended file systems to use under Linux are XFS, and ReiserFS at this time.

There is a fallback mechanism that is used otherwise, but this is known to be problematic sometimes.

Below you find further instructions for several distributions.

APT-based GNU/Linux Distribution (Debian, Ubuntu, Mint...)

Here are the packages to install on Debian/Ubuntu/Mint, which uses APT and sudo.

sudo apt-get install git nasm autoconf automake texinfo flex bison gawk build-essential unzip wget zip less zlib1g-dev libcurl4-openssl-dev

For the ARM port you will also need these packages:

sudo apt-get install uboot-mkimage util-linux mtools device-tree-compiler

pacman (Arch Linux)

Here are the packages to install on Arch Linux which uses pacman

pacman -S base-devel bison git texinfo nasm openssh unzip curl wget flex cdrtools bc

RPM-based GNU/Linux Distributions using yum(Fedora, CentOS...)

Here are the packages to install on Fedora/CentOS, which uses Yum (this section is WIP, please report issues).

sudo yum install git nasm autoconf automake texinfo flex bison gcc gcc-c++ make glibc-devel zlib-devel

With Fedora, you will also need to install the libstc++-static package if the build fails because of a missing libsupc++:

sudo yum install libstdc++-static

In order to use xattr support, some distributions may need "attr" and "attr-dev" installed. See Configure Option : --use-xattr

RPM-based GNU/Linux Distribution using zypper (OpenSUSE, SLES)

Here are the packages to install on OpenSUSE/SUSE Enterprise which uses zypper (this section is WIP, please report issues).

sudo zypper install git nasm autoconf automake texinfo flex bison gcc-c++ make glibc-devel zlib-devel

In order to use xattr support, some distributions may need "attr" and "attr-dev" installed. See Configure Option : --use-xattr

BSD Based Distribution

Package based (FreeBSD < 10):

sudo pkg_add -r bison git nasm gawk texinfo cdrtools-devel wget u-boot mtools linuxfdisk curl
Package based (FreeBSD >= 10):
sudo pkg install bison git nasm gawk texinfo cdrtools-devel wget u-boot mtools linuxfdisk curl
Ports based:
sudo portinstall devel/bison devel/git devel/nasm lang/gawk print/texinfo sysutils/cdrtools-devel ftp/curl ftp/wget devel/u-boot emulators/mtools sysutils/linuxfdisk

Mac OS X

A case-sensitive file system is required to build Haiku. You can use Disk Utility to create a case-sensitive disk image and store the Haiku source tree on that.

First, install MacPorts (A standard Installer package is provided). Close your Terminal, and enter in a new one:

sudo port install cdrtools gawk gnuregex wget nasm less mpfr gmp libmpc libiconv
(You will be prompted for the administrator password of the current account)

If you get an error “port: command not found”, the MacPorts shell configuration, stored in ~/.profile, is probably not taken into account. If you’re using Bash, you probably have a ~/.bash_profile or ~/.bash_login file, preventing bash to read ~/.profile. Check the file used by Bash (in the mentioned order) and add these lines to the used file:

export PATH=/opt/local/bin:$PATH
export MANPATH=$MANPATH:/opt/local/share/man
export INFOPATH=$INFOPATH:/opt/local/share/info
If you are using another shell, take a look a the shell documentation to see which file is parsed at login, and add the required commands. You can now retry the port install... command in a new Terminal.

Note: the ARM port is not yet supported for OSX, MacPorts has mtools but is missing sfdisk at least.

BeOS & Zeta

BeOS and Zeta are no longer maintained as active development environments. One day in the future, it is very likely that these tools will need to be updated by an individual.

Cygwin

Cygwin is not maintained as a development environment. These instructions are dependent on community contributions. /community/forum/cygwin_nt_build_support /community/forum/how_to_get_haiku_running_in_virtualbox MauriceK's instructions

Solaris

Solaris is not maintained as a development environment. These instructions are dependent on community contributions. [openbeos] Building Haiku on Solaris... mailing list thread.