annotate native-compiler.sh @ 999:4bd1bc15a744

Move distcc setup to dev-environment.sh. Fix bug where CPUS wasn't defined if distcc wasn't being used (leading to make -j with no limit, and OOM conditions in the emulated system).
author Rob Landley <rob@landley.net>
date Mon, 15 Mar 2010 06:01:36 -0500
parents bbcafba8a594
children 48784ae8533e
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
b2cb36998d54 Helps to actually remember to add the new file.
Rob Landley <rob@landley.net>
parents:
diff changeset
3 # Build a compiler for a given target
b2cb36998d54 Helps to actually remember to add the new file.
Rob Landley <rob@landley.net>
parents:
diff changeset
4
b2cb36998d54 Helps to actually remember to add the new file.
Rob Landley <rob@landley.net>
parents:
diff changeset
5 source sources/include.sh || exit 1
b2cb36998d54 Helps to actually remember to add the new file.
Rob Landley <rob@landley.net>
parents:
diff changeset
6 read_arch_dir "$1"
b2cb36998d54 Helps to actually remember to add the new file.
Rob Landley <rob@landley.net>
parents:
diff changeset
7 check_for_base_arch || exit 0
b2cb36998d54 Helps to actually remember to add the new file.
Rob Landley <rob@landley.net>
parents:
diff changeset
8 check_prerequisite "${ARCH}-cc"
b2cb36998d54 Helps to actually remember to add the new file.
Rob Landley <rob@landley.net>
parents:
diff changeset
9 check_prerequisite "${FROM_ARCH}-cc"
b2cb36998d54 Helps to actually remember to add the new file.
Rob Landley <rob@landley.net>
parents:
diff changeset
10
b2cb36998d54 Helps to actually remember to add the new file.
Rob Landley <rob@landley.net>
parents:
diff changeset
11 mkdir -p "$STAGE_DIR/bin" || dienow
b2cb36998d54 Helps to actually remember to add the new file.
Rob Landley <rob@landley.net>
parents:
diff changeset
12
998
bbcafba8a594 Another bug Wolfgang Denk reported: make BUILD_STATIC=none actually work.
Rob Landley <rob@landley.net>
parents: 987
diff changeset
13 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
14
946
b2cb36998d54 Helps to actually remember to add the new file.
Rob Landley <rob@landley.net>
parents:
diff changeset
15 # Build C Library
b2cb36998d54 Helps to actually remember to add the new file.
Rob Landley <rob@landley.net>
parents:
diff changeset
16
b2cb36998d54 Helps to actually remember to add the new file.
Rob Landley <rob@landley.net>
parents:
diff changeset
17 build_section linux-headers
b2cb36998d54 Helps to actually remember to add the new file.
Rob Landley <rob@landley.net>
parents:
diff changeset
18 build_section uClibc
b2cb36998d54 Helps to actually remember to add the new file.
Rob Landley <rob@landley.net>
parents:
diff changeset
19
b2cb36998d54 Helps to actually remember to add the new file.
Rob Landley <rob@landley.net>
parents:
diff changeset
20 # Build binutils, gcc, and ccwrap
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 build_section binutils
b2cb36998d54 Helps to actually remember to add the new file.
Rob Landley <rob@landley.net>
parents:
diff changeset
23 build_section gcc
b2cb36998d54 Helps to actually remember to add the new file.
Rob Landley <rob@landley.net>
parents:
diff changeset
24 build_section ccwrap
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 # Tell future packages to link against the libraries in the new root filesystem,
b2cb36998d54 Helps to actually remember to add the new file.
Rob Landley <rob@landley.net>
parents:
diff changeset
27 # rather than the ones in the cross compiler directory.
b2cb36998d54 Helps to actually remember to add the new file.
Rob Landley <rob@landley.net>
parents:
diff changeset
28
b2cb36998d54 Helps to actually remember to add the new file.
Rob Landley <rob@landley.net>
parents:
diff changeset
29 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
30
b2cb36998d54 Helps to actually remember to add the new file.
Rob Landley <rob@landley.net>
parents:
diff changeset
31 build_section uClibc++
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 # Delete some unneeded files
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 [ -z "$SKIP_STRIP" ] && rm -rf "$STAGE_DIR"/{info,man}
b2cb36998d54 Helps to actually remember to add the new file.
Rob Landley <rob@landley.net>
parents:
diff changeset
36
b2cb36998d54 Helps to actually remember to add the new file.
Rob Landley <rob@landley.net>
parents:
diff changeset
37 create_stage_tarball