Build

Version 7 (Matthew Iselin, 11/09/2010 04:14 am)

1 1
h1. Build
2 1
3 5 Matthew Iselin
h2. "Easy Build"
4 1
5 5 Matthew Iselin
There is an easy way to build Pedigree out of the box on the following systems:
6 5 Matthew Iselin
* Debian-based systems with apt-get (Ubuntu and Mint included)
7 6 Eduard Burtescu
* OpenSuSE with zypper
8 5 Matthew Iselin
* Cygwin (albeit without automatic installation)
9 7 Matthew Iselin
* OSX with macports
10 5 Matthew Iselin
11 5 Matthew Iselin
If you can provide patches to the easy build scripts to support alternative systems, please contact the developers.
12 5 Matthew Iselin
13 5 Matthew Iselin
The "Easy Build" script automatically obtains required dependencies for a full Pedigree build, creates a cross-compiler for you if one does not exist, and then builds Pedigree. Note that this script can take anyware from a few minutes to 2 or 3 hours, depending on your system specifications. If you have a Pentium 4, don't expect the cross-compiler step to run quickly.
14 5 Matthew Iselin
15 5 Matthew Iselin
To use the "Easy Build" system run the scripts in the root of the source tree, like so:
16 5 Matthew Iselin
<pre>
17 5 Matthew Iselin
user@shell $ pwd
18 5 Matthew Iselin
/home/user/pedigree
19 5 Matthew Iselin
user@shell $ ./easy_build_x86.sh
20 5 Matthew Iselin
</pre>
21 5 Matthew Iselin
22 5 Matthew Iselin
The script will ask a few questions and then begin checking dependencies and preparing to compile Pedigree.
23 5 Matthew Iselin
24 5 Matthew Iselin
When the script completes it will give you the command you should run in future to build Pedigree. Of course, if you want, you can continue to use the easy build script, but it is quite verbose.
25 5 Matthew Iselin
26 5 Matthew Iselin
Note: if you make a typo on the operating system, just "rm .easy_os" and run the script again.
27 5 Matthew Iselin
28 5 Matthew Iselin
h2. Prerequisites (if not using "Easy Build")
29 5 Matthew Iselin
30 4 Matthew Iselin
You will need to make sure you have the following packages (Debian names):
31 4 Matthew Iselin
* libmpfr-dev
32 4 Matthew Iselin
* libgmp3-dev
33 7 Matthew Iselin
* libmpc-dev
34 4 Matthew Iselin
* sqlite3
35 4 Matthew Iselin
* texinfo
36 4 Matthew Iselin
* scons
37 4 Matthew Iselin
* genisoimage
38 4 Matthew Iselin
* mtools on Windows
39 1
* uboot-mkimage for ARM targets that use uboot
40 1
41 5 Matthew Iselin
h2. Building the Toolchain (if not using "Easy Build")
42 3 Eduard Burtescu
43 1
In order to build Pedigree, you have to build the toolchain.
44 1
To build a toolchain for ia32 target, you can use the following:
45 1
<pre>
46 1
./scripts/checkBuildSystem.pl i686-pedigree
47 1
</pre>
48 1
When asked, you have to provide an absolute path, where the toolchain will be installed.
49 1
It can take even a few hours, depending on your system, so better do something useful meanwhile.
50 1
51 5 Matthew Iselin
h2. Building Pedigree (if not using "Easy Build")
52 1
53 4 Matthew Iselin
The first time you build Pedigree, you should use:
54 2 James Molloy
<pre>
55 2 James Molloy
scons CROSS=/path/to/toolchain/bin/i686-pedigree-
56 1
</pre>
57 1
58 4 Matthew Iselin
Note that you need to run scons once more after the first compile to ensure applications are injected correctly into the output image.
59 1
60 4 Matthew Iselin
Once these first two compiles are complete, running scons *once* gives you a proper build without needing any repeated builds for applications to be injected.
61 4 Matthew Iselin
62 4 Matthew Iselin
Note that the CROSS variable contains a string to which "gcc", "g++" etc can be added to create a valid compiler path. You shouldn't need any variables on the command line after the first successful compile, as it caches options across runs.
63 4 Matthew Iselin
64 4 Matthew Iselin
Run scons --help to view additional options that can be set.
65 4 Matthew Iselin
66 4 Matthew Iselin
h2. Switching Build Targets
67 4 Matthew Iselin
68 4 Matthew Iselin
To switch build targets, you need to do the following:
69 2 James Molloy
<pre>
70 4 Matthew Iselin
scons -c
71 4 Matthew Iselin
rm options.cache
72 4 Matthew Iselin
rm .sconsign.dblite
73 1
</pre>
74 4 Matthew Iselin
75 4 Matthew Iselin
Once this is complete (latter rm commands may fail, that's okay), you can use a new cross-compiler in the CROSS parameter to build a new target.