Updated the ReadMe documentation and combined non-Haiku platform notes
with within-Haiku notes. Feedback and changes welcome. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@43028 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1,28 +1,114 @@
|
|||||||
Building on Haiku
|
Building Haiku from source
|
||||||
=================
|
==========================
|
||||||
|
|
||||||
For building on Haiku, all of the necessary development tools are included in
|
This is a overview into the process of building HAIKU from source.
|
||||||
both official releases (R1 alpha 1 for instance) and the nightly builds.
|
An online version is available at http://www.haiku-os.org/guides/building/
|
||||||
|
|
||||||
Official releases can be obtained from www.haiku-os.org/get-haiku
|
Official releases of Haiku are at http://www.haiku-os.org/get-haiku
|
||||||
The nightly builds are available at http://www.haiku-files.org
|
The (unstable) nightly builds are available at http://www.haiku-files.org
|
||||||
|
|
||||||
Building on a non-Haiku platform
|
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
|
||||||
|
|
||||||
Please read the file 'ReadMe.cross-compile' before continuing. It describes
|
We currently support these platforms:
|
||||||
how to build the cross-compilation tools and configure the build system for
|
* Haiku
|
||||||
building Haiku. After following the instructions you can directly continue
|
* Linux
|
||||||
with the section Building.
|
* FreeBSD
|
||||||
|
* Mac OS X Intel
|
||||||
|
|
||||||
|
Pre-requisite software
|
||||||
|
======================
|
||||||
|
|
||||||
|
Tools provided within Haiku's repositories
|
||||||
|
|
||||||
|
* Jam (Jam 2.5-haiku-20090626)
|
||||||
|
* Haiku's cross-compiler (needed only for non-Haiku platforms)
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
* Subversion client
|
||||||
|
* 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
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
More information about individual distributions of Linux and BSD can be found
|
||||||
|
at http://haiku-os.org/guides/building/pre-reqs
|
||||||
|
|
||||||
|
|
||||||
Configuring on Haiku
|
Download Haiku's sources
|
||||||
====================
|
========================
|
||||||
|
|
||||||
Open a Terminal and change to your Haiku trunk folder. To configure the build
|
There are two parts to Haiku's sources -- the code for Haiku itself and a set
|
||||||
you can run configure like this:
|
of build tools for compiling Haiku on an operating system other than Haiku.
|
||||||
|
The buildtools are needed only for non-Haiku platform.
|
||||||
|
|
||||||
./configure
|
Anonymous checkout:
|
||||||
|
svn co http://svn.haiku-os.org/haiku/haiku/trunk haiku
|
||||||
|
svn co http://svn.haiku-os.org/haiku/buildtools/trunk buildtools
|
||||||
|
|
||||||
|
Developer with commit access:
|
||||||
|
svn co svn+ssh://<developer-account>@svn.haiku-os.org/srv/svn/repos/haiku/haiku/trunk haiku
|
||||||
|
svn co svn+ssh://<developer-account>@svn.haiku-os.org/srv/svn/repos/haiku/buildtools/trunk buildtools
|
||||||
|
|
||||||
|
|
||||||
|
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
|
||||||
|
======================
|
||||||
|
|
||||||
The configure script generates a file named "BuildConfig" in the
|
The configure script generates a file named "BuildConfig" in the
|
||||||
"generated/build" directory. As long as configure is not modified (!), there
|
"generated/build" directory. As long as configure is not modified (!), there
|
||||||
@@ -30,23 +116,84 @@ 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
|
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.
|
want to execute 'configure' after each update just to be on the safe side.
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
Building
|
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
|
||||||
|
-----------------
|
||||||
|
|
||||||
|
The various runtime options for configure are documented in it's onscreen help
|
||||||
|
|
||||||
|
./configure --help
|
||||||
|
|
||||||
|
|
||||||
|
Building via Jam
|
||||||
|
================
|
||||||
|
|
||||||
Haiku can be built in either of two ways, as disk image file (e.g. for use
|
Haiku can be built in either of two ways, as disk image file (e.g. for use
|
||||||
with emulators) or as installation in a directory.
|
with emulators, to be written directly to a usb stick, burned as a compact
|
||||||
|
disc) or as installation in a directory.
|
||||||
|
|
||||||
Image File
|
Running Jam
|
||||||
----------
|
-----------
|
||||||
|
|
||||||
jam -q haiku-image
|
There are various ways in which you can run jam.
|
||||||
|
|
||||||
This generates an image file named 'haiku.image' in your output directory
|
* If you have a single generated folder,
|
||||||
under 'generated/'.
|
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>
|
||||||
|
|
||||||
VMware Image File
|
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
|
||||||
|
----------------------------
|
||||||
|
|
||||||
jam -q haiku-vmware-image
|
jam -q haiku-vmware-image
|
||||||
|
|
||||||
@@ -62,55 +209,40 @@ Installs all Haiku components into the volume mounted at "/Haiku" and
|
|||||||
automatically marks it as bootable. To create a partition in the first place
|
automatically marks it as bootable. To create a partition in the first place
|
||||||
use DriveSetup and initialize it to BFS.
|
use DriveSetup and initialize it to BFS.
|
||||||
|
|
||||||
Note that installing Haiku in a directory only works as expected under BeOS,
|
Note that installing Haiku in a directory only works as expected under Haiku,
|
||||||
but it is not yet supported under Linux and other non-BeOS platforms.
|
but it is not yet supported under Linux and other non-Haiku platforms.
|
||||||
|
|
||||||
Bootable CD-ROM Image
|
Building individual components
|
||||||
---------------------
|
------------------------------
|
||||||
|
|
||||||
This _requires_ having the mkisofs tool installed.
|
|
||||||
On Debian GNU/Linux for example you can install it with:
|
|
||||||
apt-get install mkisofs
|
|
||||||
|
|
||||||
This creates a bootable 'haiku-cd.iso' in your 'generated/' folder:
|
|
||||||
|
|
||||||
jam -q haiku-cd
|
|
||||||
|
|
||||||
Under Unix/Linux, and Haiku you can use cdrecord to create a CD with:
|
|
||||||
|
|
||||||
cdrecord dev=x,y,z -v -eject -dao -data generated/haiku-cd.iso
|
|
||||||
|
|
||||||
Here x,y,z is the device number as found with cdrecord -scanbus, it can also
|
|
||||||
be a device path on Linux.
|
|
||||||
|
|
||||||
Building Components
|
|
||||||
-------------------
|
|
||||||
|
|
||||||
If you don't want to build the complete Haiku, but only a certain
|
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.:
|
app/driver/etc. you can specify it as argument to jam, e.g.:
|
||||||
|
|
||||||
jam Pulse
|
jam Debugger
|
||||||
|
|
||||||
Alternatively, you can 'cd' to the directory of the component you want to
|
Alternatively, you can 'cd' to the directory of the component you want to
|
||||||
build and run 'jam' from there.
|
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>
|
||||||
|
|
||||||
You can also force rebuilding of a component by using the "-a" parameter:
|
You can also force rebuilding of a component by using the "-a" parameter:
|
||||||
|
|
||||||
jam -a Pulse
|
jam -a Debugger
|
||||||
|
|
||||||
|
|
||||||
Running
|
Running
|
||||||
=======
|
=======
|
||||||
|
|
||||||
Generally there are two ways of running Haiku. On real hardware using a
|
Generally there are two ways of running Haiku. On real hardware using a
|
||||||
partition and on emulated hardware using an emulator like Bochs or QEmu.
|
partition and on emulated hardware using an emulator like Bochs or QEMU.
|
||||||
|
|
||||||
On Real Hardware
|
On Real Hardware
|
||||||
----------------
|
----------------
|
||||||
|
|
||||||
If you have installed Haiku to its own partition you can include this
|
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
|
partition in your bootmanager and try to boot Haiku like any other OS you
|
||||||
have installed. To include a new partition in the BeOS bootmanager run this
|
have installed. To include a new partition in the Haiku bootmanager run this
|
||||||
in a Terminal:
|
in a Terminal:
|
||||||
|
|
||||||
bootman
|
bootman
|
||||||
@@ -119,34 +251,9 @@ On Emulated Hardware
|
|||||||
--------------------
|
--------------------
|
||||||
|
|
||||||
For emulated hardware you should build disk image (see above). How to setup
|
For emulated hardware you should build disk image (see above). How to setup
|
||||||
this image depends on your emulater. A tutorial for Bochs on BeOS is below.
|
this image depends on your emulater. If you use QEMU, you can usually just
|
||||||
If you use QEmu, you can usually just provide the path to the image as
|
provide the path to the image as command line argument to the "qemu"
|
||||||
command line argument to the "qemu" executable.
|
executable.
|
||||||
|
|
||||||
Bochs
|
|
||||||
-----
|
|
||||||
|
|
||||||
Version 2.2 of Bochs for BeOS (BeBochs) can be downloaded from BeBits:
|
|
||||||
|
|
||||||
http://www.bebits.com/app/3324
|
|
||||||
|
|
||||||
The package installs to: /boot/apps/BeBochs2.2
|
|
||||||
|
|
||||||
You have to set up a configuration for Bochs. You should edit the ".bochsrc" to
|
|
||||||
include the following:
|
|
||||||
|
|
||||||
ata0-master: type=disk, path="/path/to/haiku.image", cylinders=122, heads=16, spt=63
|
|
||||||
boot: disk
|
|
||||||
|
|
||||||
Now you can start Bochs:
|
|
||||||
|
|
||||||
$ cd /boot/apps/BeBochs2.2
|
|
||||||
$ ./bochs
|
|
||||||
|
|
||||||
Answer with RETURN and with some patience you will see Haiku booting.
|
|
||||||
If booting into the graphical evironment fails you can try to hit "space" at the
|
|
||||||
very beginning of the boot process. The Haiku bootloader should then come up and
|
|
||||||
you can select some safe mode options.
|
|
||||||
|
|
||||||
|
|
||||||
Docbook documentation
|
Docbook documentation
|
||||||
|
|||||||
@@ -1,85 +0,0 @@
|
|||||||
Building on a non-Haiku platform
|
|
||||||
================================
|
|
||||||
|
|
||||||
We currently support these non-Haiku platforms:
|
|
||||||
* Linux
|
|
||||||
* FreeBSD
|
|
||||||
* Mac OS X Intel (gcc 4 builds only)
|
|
||||||
|
|
||||||
To build Haiku on a platform other than Haiku, you must first check out and
|
|
||||||
build the cross-compiler. The easiest method for doing so is to check it out in
|
|
||||||
the parent directory of your Haiku repository:
|
|
||||||
|
|
||||||
svn checkout http://svn.haiku-os.org/haiku/buildtools/trunk buildtools
|
|
||||||
|
|
||||||
You should now have a 'buildtools' folder that contains folders named
|
|
||||||
'binutils', 'gcc', and 'jam' among others.
|
|
||||||
|
|
||||||
Several other tools are required to build these build tools or are used by
|
|
||||||
Haiku's build system itself:
|
|
||||||
* 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)
|
|
||||||
* gawk
|
|
||||||
* yasm (http://www.tortall.net/projects/yasm/wiki/Download)
|
|
||||||
|
|
||||||
Whether they are installed can be tested for instance by running them in the
|
|
||||||
shell with the "--version" parameter.
|
|
||||||
|
|
||||||
On Mac OS X a case-sensitive file system is required for the Haiku tree
|
|
||||||
(Disk Utility can be used to create a case-sensitive disk image of at least
|
|
||||||
3GB size), and the following darwin ports need to be installed:
|
|
||||||
* expat
|
|
||||||
* gawk
|
|
||||||
* gettext
|
|
||||||
* libiconv
|
|
||||||
* gnuregex
|
|
||||||
* cdrtools (for mkisofs used to create the bootable CD-ROM image)
|
|
||||||
|
|
||||||
Building Jam
|
|
||||||
============
|
|
||||||
|
|
||||||
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
|
|
||||||
|
|
||||||
Building binutils
|
|
||||||
=================
|
|
||||||
|
|
||||||
The binutils used by Haiku will be automatically generated according to the
|
|
||||||
initial configuration of the Haiku source and placed in the
|
|
||||||
'generated/cross-tools' directory of Haiku. Before generating the tools you
|
|
||||||
must consider the version required, there are essentially two choices:
|
|
||||||
|
|
||||||
* 2.95: Creates BeOS compatible binaries
|
|
||||||
* 4.x: Incompatible with BeOS, but theoretically more efficient binaries
|
|
||||||
|
|
||||||
Unless there is a pressing need, choose 2.95 as the latter option can cause
|
|
||||||
frequent build issues. The commands for configuration are,
|
|
||||||
|
|
||||||
GCC 2.95
|
|
||||||
--------
|
|
||||||
|
|
||||||
cd haiku
|
|
||||||
./configure --build-cross-tools ../buildtools/
|
|
||||||
|
|
||||||
GCC 4.x
|
|
||||||
-------
|
|
||||||
|
|
||||||
cd haiku
|
|
||||||
./configure --build-cross-tools-gcc4 x86 ../buildtools/
|
|
||||||
|
|
||||||
The process can take quite some time, but when it finishes the build system is
|
|
||||||
fully configured and you are ready to compile your first Haiku image.
|
|
||||||
|
|
||||||
Instructions on how to build Haiku can be found in the section Building in the
|
|
||||||
'ReadMe' document.
|
|
||||||
Reference in New Issue
Block a user