Mercurial > hg > aboriginal
comparison build.sh @ 1212:19f3be2b4d04
Teach build.sh to build host compiler if necessary for CROSS_HOST_ARCH.
author | Rob Landley <rob@landley.net> |
---|---|
date | Wed, 18 Aug 2010 15:58:02 -0500 |
parents | 3c8d91339f2a |
children | 8a88cae14011 |
comparison
equal
deleted
inserted
replaced
1211:e0c2ba5cc233 | 1212:19f3be2b4d04 |
---|---|
1 #!/bin/bash | 1 #!/bin/bash |
2 | 2 |
3 # Run all the steps needed to build a system image from scratch. | 3 # Run all the steps needed to build a system image from scratch. |
4 | 4 |
5 # The default set of stages run by this script is: | 5 # The default set of stages run by this script is (in order): |
6 # download, host-tools, simple-cross-compiler, simple-root-filesystem, | 6 # download, host-tools, simple-cross-compiler, simple-root-filesystem, |
7 # native-compiler, root-filesystem, system-image. | 7 # native-compiler, root-filesystem, system-image. |
8 | 8 |
9 # That sanitizes the host build environment and builds a cross compiler, | 9 # That sanitizes the host build environment and builds a cross compiler, |
10 # cross compiles a root filesystem and a native toolchain for the target, | 10 # cross compiles a root filesystem and a native toolchain for the target, |
21 # NO_HOST_TOOLS=1 NO_NATIVE_COMPILER=1 ./build.sh $TARGET | 21 # NO_HOST_TOOLS=1 NO_NATIVE_COMPILER=1 ./build.sh $TARGET |
22 | 22 |
23 # The optional cross-compiler stage (after simple-cross-compiler but before | 23 # The optional cross-compiler stage (after simple-cross-compiler but before |
24 # simple-root-filesystem) creates a more powerful and portable cross compiler | 24 # simple-root-filesystem) creates a more powerful and portable cross compiler |
25 # that can be used to cross compile more stuff (if you're into that sort of | 25 # that can be used to cross compile more stuff (if you're into that sort of |
26 # thing). To enable it, "export CROSS_HOST_ARCH=i686" (or whichever target | 26 # thing). To enable that: |
27 # you want the new cross compiler to run on). | 27 |
28 # CROSS_HOST_ARCH=i686 ./build.sh $TARGET | |
29 | |
30 # Where "i686" is whichever target you want the new cross compiler to run on. | |
28 | 31 |
29 # Start with some housekeeping stuff. If this script was run with no | 32 # Start with some housekeeping stuff. If this script was run with no |
30 # arguments, list available architectures out of sources/targets. | 33 # arguments, list available architectures out of sources/targets. |
31 | 34 |
32 if [ $# -ne 1 ] | 35 if [ $# -ne 1 ] |
100 | 103 |
101 if [ ! -z "$CROSS_HOST_ARCH" ] && not_already cross-compiler | 104 if [ ! -z "$CROSS_HOST_ARCH" ] && not_already cross-compiler |
102 then | 105 then |
103 rm -rf "$BUILD/simple-root-filesystem-$ARCH.tar.bz2" | 106 rm -rf "$BUILD/simple-root-filesystem-$ARCH.tar.bz2" |
104 | 107 |
108 # Build the host compiler if necessary | |
109 | |
110 if ARCH="$CROSS_HOST_ARCH" not_already simple-cross-compiler | |
111 then | |
112 time ./simple-cross-compiler.sh "$CROSS_HOST_ARCH" || exit 1 | |
113 fi | |
114 | |
105 time ./cross-compiler.sh "$ARCH" || exit 1 | 115 time ./cross-compiler.sh "$ARCH" || exit 1 |
106 fi | 116 fi |
107 | 117 |
108 # Build the basic root filesystem. | 118 # Build the basic root filesystem. |
109 | 119 |