annotate native-compiler.sh @ 1228:8a88cae14011

Remove RW_SYSTEM_IMAGE option. The gentoo-stage1 build shows how to setup a writeable chroot, and the FAQ says how to build a writeable system image. I'm not shipping two different system iamges, then I'd have to explain it and it's not worth the confusion.
author Rob Landley <rob@landley.net>
date Tue, 24 Aug 2010 02:53:11 -0500
parents 42bcb67165b4
children b74d36876c0a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
1083
cb4dbdb7f2cd Make BUILD_STATIC take comma separated list of packages, or "all" or "none". Default behavior should remain the same.
Rob Landley <rob@landley.net>
parents: 1034
diff changeset
9 # The new compiler is built --with-shared, with thread support, has uClibc++
cb4dbdb7f2cd Make BUILD_STATIC take comma separated list of packages, or "all" or "none". Default behavior should remain the same.
Rob Landley <rob@landley.net>
parents: 1034
diff changeset
10 # installed, and is linked against uClibc (see BUILD_STATIC in config).
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
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
946
b2cb36998d54 Helps to actually remember to add the new file.
Rob Landley <rob@landley.net>
parents:
diff changeset
15 check_prerequisite "${ARCH}-cc"
1207
4021fb1183d7 Environment sanitizing screwed up the cross-compiler.sh wrapper. Fix it, rename PROGRAM_PREFIX to TOOLCHAIN_PREFIX, and put a guard around sources/include.sh so it's safe to include multiple times.
Rob Landley <rob@landley.net>
parents: 1130
diff changeset
16
4021fb1183d7 Environment sanitizing screwed up the cross-compiler.sh wrapper. Fix it, rename PROGRAM_PREFIX to TOOLCHAIN_PREFIX, and put a guard around sources/include.sh so it's safe to include multiple times.
Rob Landley <rob@landley.net>
parents: 1130
diff changeset
17 [ -z "$HOST_ARCH" ] && HOST_ARCH="$ARCH" || check_prerequisite "${HOST_ARCH}-cc"
946
b2cb36998d54 Helps to actually remember to add the new file.
Rob Landley <rob@landley.net>
parents:
diff changeset
18
b2cb36998d54 Helps to actually remember to add the new file.
Rob Landley <rob@landley.net>
parents:
diff changeset
19 mkdir -p "$STAGE_DIR/bin" || dienow
b2cb36998d54 Helps to actually remember to add the new file.
Rob Landley <rob@landley.net>
parents:
diff changeset
20
b2cb36998d54 Helps to actually remember to add the new file.
Rob Landley <rob@landley.net>
parents:
diff changeset
21 # Build C Library
b2cb36998d54 Helps to actually remember to add the new file.
Rob Landley <rob@landley.net>
parents:
diff changeset
22
b2cb36998d54 Helps to actually remember to add the new file.
Rob Landley <rob@landley.net>
parents:
diff changeset
23 build_section linux-headers
b2cb36998d54 Helps to actually remember to add the new file.
Rob Landley <rob@landley.net>
parents:
diff changeset
24 build_section uClibc
b2cb36998d54 Helps to actually remember to add the new file.
Rob Landley <rob@landley.net>
parents:
diff changeset
25
b2cb36998d54 Helps to actually remember to add the new file.
Rob Landley <rob@landley.net>
parents:
diff changeset
26 # Build binutils, gcc, and ccwrap
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 binutils
b2cb36998d54 Helps to actually remember to add the new file.
Rob Landley <rob@landley.net>
parents:
diff changeset
29 build_section gcc
b2cb36998d54 Helps to actually remember to add the new file.
Rob Landley <rob@landley.net>
parents:
diff changeset
30 build_section ccwrap
b2cb36998d54 Helps to actually remember to add the new file.
Rob Landley <rob@landley.net>
parents:
diff changeset
31
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
32 # 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
33 # 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
34
b2cb36998d54 Helps to actually remember to add the new file.
Rob Landley <rob@landley.net>
parents:
diff changeset
35 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
36
1130
c222ae88733a Add NO_CPLUSPLUS config option, to skip c++ support entirely.
Rob Landley <rob@landley.net>
parents: 1090
diff changeset
37 # Add C++ standard library
c222ae88733a Add NO_CPLUSPLUS config option, to skip c++ support entirely.
Rob Landley <rob@landley.net>
parents: 1090
diff changeset
38
c222ae88733a Add NO_CPLUSPLUS config option, to skip c++ support entirely.
Rob Landley <rob@landley.net>
parents: 1090
diff changeset
39 [ -z "$NO_CPLUSPLUS" ] && build_section uClibc++
946
b2cb36998d54 Helps to actually remember to add the new file.
Rob Landley <rob@landley.net>
parents:
diff changeset
40
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
41 # 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
42 # 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
43
1209
42bcb67165b4 Only make "bash" and "make" and such when toolchain has no prefix.
Rob Landley <rob@landley.net>
parents: 1207
diff changeset
44 if [ -z "$TOOLCHAIN_PREFIX" ]
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
45 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
46 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
47 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
48 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
49 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
50
946
b2cb36998d54 Helps to actually remember to add the new file.
Rob Landley <rob@landley.net>
parents:
diff changeset
51 # Delete some unneeded files
b2cb36998d54 Helps to actually remember to add the new file.
Rob Landley <rob@landley.net>
parents:
diff changeset
52
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
53 [ -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
54 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
55
b2cb36998d54 Helps to actually remember to add the new file.
Rob Landley <rob@landley.net>
parents:
diff changeset
56 create_stage_tarball