comparison cross-compiler.sh @ 744:759adf5a0fe9

Refactor so include.sh mostly just sets environment variables. Move read_arch_dir to function and call it explicitly (no more need for $NO_ARCH). Make blank_tempdir a function, called explicitly by stages when needed, with some sanity checks. Insert prerequisite tests to later stages so they can detect failure early and provide an explicit erro rmessage, and have those tests happen before blanking $WORK dir, to preserve debugging info. Make buildall.sh depend on prerequisite tests rather than trying to avoid calling later stages (and thus do flow control from asynchronous context). Add FAIL_QUIET option so buildall.sh doesn't spam the log with the new prerequisite error messages.
author Rob Landley <rob@landley.net>
date Thu, 11 Jun 2009 05:42:51 -0500
parents db5cb617339a
children db06a8c1bfed
comparison
equal deleted inserted replaced
743:5e745e03408a 744:759adf5a0fe9
2 2
3 # Get lots of predefined environment variables and shell functions. 3 # Get lots of predefined environment variables and shell functions.
4 4
5 source sources/include.sh || exit 1 5 source sources/include.sh || exit 1
6 6
7 CROSS="${BUILD}/cross-compiler-${ARCH}" 7 # Parse the sources/targets/$1 directory
8
9 read_arch_dir "$1"
10
11 # If this target has a base architecture that's already been built, use that.
8 12
9 check_for_base_arch cross-compiler || exit 0 13 check_for_base_arch cross-compiler || exit 0
14
15 # Ok, we have work to do. Announce start of stage.
10 16
11 echo -e "$CROSS_COLOR" 17 echo -e "$CROSS_COLOR"
12 echo "=== Building cross compiler" 18 echo "=== Building cross compiler"
13 19
14 rm -rf "${CROSS}" 20 CROSS="${BUILD}/cross-compiler-${ARCH}"
15 mkdir -p "${CROSS}" || dienow 21 blank_tempdir "$CROSS"
22 blank_tempdir "$WORK"
16 23
17 # Build and install binutils 24 # Build and install binutils
18 25
19 setupfor binutils build-binutils && 26 setupfor binutils build-binutils &&
20 AR=ar AS=as LD=ld NM=nm OBJDUMP=objdump OBJCOPY=objcopy \ 27 AR=ar AS=as LD=ld NM=nm OBJDUMP=objdump OBJCOPY=objcopy \