Mercurial > hg > aboriginal
annotate native-compiler.sh @ 1049:0e063506fd67
Add a symlink to the www/README file from the top level.
author | Rob Landley <rob@landley.net> |
---|---|
date | Sun, 02 May 2010 16:16:51 -0500 |
parents | 27c38c82401d |
children | cb4dbdb7f2cd |
rev | line source |
---|---|
946
b2cb36998d54
Helps to actually remember to add the new file.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
1 #!/bin/bash |
b2cb36998d54
Helps to actually remember to add the new file.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
2 |
1007
48784ae8533e
Move CROSS_SMOKE_TEST implementation out of simple-cross-compiler.sh and into sources/more/cross-smoke-test.sh, called from build.sh. Clean up comments a bit while we're there.
Rob Landley <rob@landley.net>
parents:
998
diff
changeset
|
3 # Build a compiler for a given target, using one or more existing simple |
48784ae8533e
Move CROSS_SMOKE_TEST implementation out of simple-cross-compiler.sh and into sources/more/cross-smoke-test.sh, called from build.sh. Clean up comments a bit while we're there.
Rob Landley <rob@landley.net>
parents:
998
diff
changeset
|
4 # cross compilers. |
48784ae8533e
Move CROSS_SMOKE_TEST implementation out of simple-cross-compiler.sh and into sources/more/cross-smoke-test.sh, called from build.sh. Clean up comments a bit while we're there.
Rob Landley <rob@landley.net>
parents:
998
diff
changeset
|
5 |
48784ae8533e
Move CROSS_SMOKE_TEST implementation out of simple-cross-compiler.sh and into sources/more/cross-smoke-test.sh, called from build.sh. Clean up comments a bit while we're there.
Rob Landley <rob@landley.net>
parents:
998
diff
changeset
|
6 # This can be used to build a native compiler for an aribitrary target, or to |
48784ae8533e
Move CROSS_SMOKE_TEST implementation out of simple-cross-compiler.sh and into sources/more/cross-smoke-test.sh, called from build.sh. Clean up comments a bit while we're there.
Rob Landley <rob@landley.net>
parents:
998
diff
changeset
|
7 # build a more portable and capable cross compiler for an arbitrary host. |
946
b2cb36998d54
Helps to actually remember to add the new file.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
8 |
1007
48784ae8533e
Move CROSS_SMOKE_TEST implementation out of simple-cross-compiler.sh and into sources/more/cross-smoke-test.sh, called from build.sh. Clean up comments a bit while we're there.
Rob Landley <rob@landley.net>
parents:
998
diff
changeset
|
9 # The new compiler is built --with-shared and has uClibc++ installed, and is |
48784ae8533e
Move CROSS_SMOKE_TEST implementation out of simple-cross-compiler.sh and into sources/more/cross-smoke-test.sh, called from build.sh. Clean up comments a bit while we're there.
Rob Landley <rob@landley.net>
parents:
998
diff
changeset
|
10 # statically linked against uClibc (for portability) unless BUILD_STATIC=none. |
48784ae8533e
Move CROSS_SMOKE_TEST implementation out of simple-cross-compiler.sh and into sources/more/cross-smoke-test.sh, called from build.sh. Clean up comments a bit while we're there.
Rob Landley <rob@landley.net>
parents:
998
diff
changeset
|
11 |
48784ae8533e
Move CROSS_SMOKE_TEST implementation out of simple-cross-compiler.sh and into sources/more/cross-smoke-test.sh, called from build.sh. Clean up comments a bit while we're there.
Rob Landley <rob@landley.net>
parents:
998
diff
changeset
|
12 source sources/include.sh && read_arch_dir "$1" || exit 1 |
946
b2cb36998d54
Helps to actually remember to add the new file.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
13 check_for_base_arch || exit 0 |
1007
48784ae8533e
Move CROSS_SMOKE_TEST implementation out of simple-cross-compiler.sh and into sources/more/cross-smoke-test.sh, called from build.sh. Clean up comments a bit while we're there.
Rob Landley <rob@landley.net>
parents:
998
diff
changeset
|
14 |
48784ae8533e
Move CROSS_SMOKE_TEST implementation out of simple-cross-compiler.sh and into sources/more/cross-smoke-test.sh, called from build.sh. Clean up comments a bit while we're there.
Rob Landley <rob@landley.net>
parents:
998
diff
changeset
|
15 # Building a cross compiler requires _two_ existing simple compilers: one for |
48784ae8533e
Move CROSS_SMOKE_TEST implementation out of simple-cross-compiler.sh and into sources/more/cross-smoke-test.sh, called from build.sh. Clean up comments a bit while we're there.
Rob Landley <rob@landley.net>
parents:
998
diff
changeset
|
16 # the host (to build the executables), and one for the target (to build |
48784ae8533e
Move CROSS_SMOKE_TEST implementation out of simple-cross-compiler.sh and into sources/more/cross-smoke-test.sh, called from build.sh. Clean up comments a bit while we're there.
Rob Landley <rob@landley.net>
parents:
998
diff
changeset
|
17 # the libraries). For native compilers both checks test for the same thing. |
48784ae8533e
Move CROSS_SMOKE_TEST implementation out of simple-cross-compiler.sh and into sources/more/cross-smoke-test.sh, called from build.sh. Clean up comments a bit while we're there.
Rob Landley <rob@landley.net>
parents:
998
diff
changeset
|
18 |
946
b2cb36998d54
Helps to actually remember to add the new file.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
19 check_prerequisite "${ARCH}-cc" |
b2cb36998d54
Helps to actually remember to add the new file.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
20 check_prerequisite "${FROM_ARCH}-cc" |
b2cb36998d54
Helps to actually remember to add the new file.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
21 |
b2cb36998d54
Helps to actually remember to add the new file.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
22 mkdir -p "$STAGE_DIR/bin" || dienow |
b2cb36998d54
Helps to actually remember to add the new file.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
23 |
998
bbcafba8a594
Another bug Wolfgang Denk reported: make BUILD_STATIC=none actually work.
Rob Landley <rob@landley.net>
parents:
987
diff
changeset
|
24 STATIC_FLAGS="$STATIC_DEFAULT_FLAGS" |
bbcafba8a594
Another bug Wolfgang Denk reported: make BUILD_STATIC=none actually work.
Rob Landley <rob@landley.net>
parents:
987
diff
changeset
|
25 |
946
b2cb36998d54
Helps to actually remember to add the new file.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
26 # Build C Library |
b2cb36998d54
Helps to actually remember to add the new file.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
27 |
b2cb36998d54
Helps to actually remember to add the new file.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
28 build_section linux-headers |
b2cb36998d54
Helps to actually remember to add the new file.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
29 build_section uClibc |
b2cb36998d54
Helps to actually remember to add the new file.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
30 |
b2cb36998d54
Helps to actually remember to add the new file.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
31 # Build binutils, gcc, and ccwrap |
b2cb36998d54
Helps to actually remember to add the new file.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
32 |
b2cb36998d54
Helps to actually remember to add the new file.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
33 build_section binutils |
b2cb36998d54
Helps to actually remember to add the new file.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
34 build_section gcc |
b2cb36998d54
Helps to actually remember to add the new file.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
35 build_section ccwrap |
b2cb36998d54
Helps to actually remember to add the new file.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
36 |
1034
27c38c82401d
Move make, bash, and distcc builds into native-compiler.sh. (Break 'em out into sources/sections/*.build.)
Rob Landley <rob@landley.net>
parents:
1007
diff
changeset
|
37 # Tell future packages to link against the libraries in the new compiler, |
27c38c82401d
Move make, bash, and distcc builds into native-compiler.sh. (Break 'em out into sources/sections/*.build.)
Rob Landley <rob@landley.net>
parents:
1007
diff
changeset
|
38 # rather than the ones in the simple compiler. |
946
b2cb36998d54
Helps to actually remember to add the new file.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
39 |
b2cb36998d54
Helps to actually remember to add the new file.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
40 export "$(echo $ARCH | sed 's/-/_/g')"_CCWRAP_TOPDIR="$STAGE_DIR" |
b2cb36998d54
Helps to actually remember to add the new file.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
41 |
b2cb36998d54
Helps to actually remember to add the new file.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
42 build_section uClibc++ |
b2cb36998d54
Helps to actually remember to add the new file.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
43 |
1034
27c38c82401d
Move make, bash, and distcc builds into native-compiler.sh. (Break 'em out into sources/sections/*.build.)
Rob Landley <rob@landley.net>
parents:
1007
diff
changeset
|
44 # For a native compiler, build make, bash, and distcc. (Yes, this is an old |
27c38c82401d
Move make, bash, and distcc builds into native-compiler.sh. (Break 'em out into sources/sections/*.build.)
Rob Landley <rob@landley.net>
parents:
1007
diff
changeset
|
45 # version of Bash. It's intentional.) |
27c38c82401d
Move make, bash, and distcc builds into native-compiler.sh. (Break 'em out into sources/sections/*.build.)
Rob Landley <rob@landley.net>
parents:
1007
diff
changeset
|
46 |
27c38c82401d
Move make, bash, and distcc builds into native-compiler.sh. (Break 'em out into sources/sections/*.build.)
Rob Landley <rob@landley.net>
parents:
1007
diff
changeset
|
47 if [ "$FROM_ARCH" == "$ARCH" ] |
27c38c82401d
Move make, bash, and distcc builds into native-compiler.sh. (Break 'em out into sources/sections/*.build.)
Rob Landley <rob@landley.net>
parents:
1007
diff
changeset
|
48 then |
27c38c82401d
Move make, bash, and distcc builds into native-compiler.sh. (Break 'em out into sources/sections/*.build.)
Rob Landley <rob@landley.net>
parents:
1007
diff
changeset
|
49 build_section make |
27c38c82401d
Move make, bash, and distcc builds into native-compiler.sh. (Break 'em out into sources/sections/*.build.)
Rob Landley <rob@landley.net>
parents:
1007
diff
changeset
|
50 build_section bash |
27c38c82401d
Move make, bash, and distcc builds into native-compiler.sh. (Break 'em out into sources/sections/*.build.)
Rob Landley <rob@landley.net>
parents:
1007
diff
changeset
|
51 build_section distcc |
27c38c82401d
Move make, bash, and distcc builds into native-compiler.sh. (Break 'em out into sources/sections/*.build.)
Rob Landley <rob@landley.net>
parents:
1007
diff
changeset
|
52 fi |
27c38c82401d
Move make, bash, and distcc builds into native-compiler.sh. (Break 'em out into sources/sections/*.build.)
Rob Landley <rob@landley.net>
parents:
1007
diff
changeset
|
53 |
946
b2cb36998d54
Helps to actually remember to add the new file.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
54 # Delete some unneeded files |
b2cb36998d54
Helps to actually remember to add the new file.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
55 |
1034
27c38c82401d
Move make, bash, and distcc builds into native-compiler.sh. (Break 'em out into sources/sections/*.build.)
Rob Landley <rob@landley.net>
parents:
1007
diff
changeset
|
56 [ -z "$SKIP_STRIP" ] && |
27c38c82401d
Move make, bash, and distcc builds into native-compiler.sh. (Break 'em out into sources/sections/*.build.)
Rob Landley <rob@landley.net>
parents:
1007
diff
changeset
|
57 rm -rf "$STAGE_DIR"/{info,man,libexec/gcc/*/*/install-tools} |
946
b2cb36998d54
Helps to actually remember to add the new file.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
58 |
b2cb36998d54
Helps to actually remember to add the new file.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
59 create_stage_tarball |