Mercurial > hg > aboriginal
annotate sources/functions.sh @ 1398:b74d36876c0a
Replace read_arch_dir with load_target, which understands that sources/targets/$TARGET can be a file or a directory.
author | Rob Landley <rob@landley.net> |
---|---|
date | Sun, 26 Jun 2011 17:44:02 -0500 |
parents | 42ec661e3916 |
children | 0b1022dc9a36 |
rev | line source |
---|---|
840 | 1 #!/bin/echo "This file is sourced, not run" |
2 | |
428
c88e25996320
Split function definitions out from include.sh.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
3 # Lots of reusable functions. This file is sourced, not run. |
c88e25996320
Split function definitions out from include.sh.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
4 |
1090
affef1edbdba
Cleanup "FROM_ARCH" mess. Rename FROM_ARCH->HOST_ARCH, make stage script responsible for setting HOST_ARCH (not includes.sh). Also, remove HOST_UTILS variable, only build uClibc utils for non-simple compilers and bypass uClibc's (weird) makefile for the utils directory.
Rob Landley <rob@landley.net>
parents:
1084
diff
changeset
|
5 # Output path to cross compiler. |
915
a541c5a96ff3
Don't actually replace cross-compiler with cross-static, when you build both use $PATH to select which one to use.
Rob Landley <rob@landley.net>
parents:
904
diff
changeset
|
6 |
a541c5a96ff3
Don't actually replace cross-compiler with cross-static, when you build both use $PATH to select which one to use.
Rob Landley <rob@landley.net>
parents:
904
diff
changeset
|
7 cc_path() |
a541c5a96ff3
Don't actually replace cross-compiler with cross-static, when you build both use $PATH to select which one to use.
Rob Landley <rob@landley.net>
parents:
904
diff
changeset
|
8 { |
a541c5a96ff3
Don't actually replace cross-compiler with cross-static, when you build both use $PATH to select which one to use.
Rob Landley <rob@landley.net>
parents:
904
diff
changeset
|
9 local i |
a541c5a96ff3
Don't actually replace cross-compiler with cross-static, when you build both use $PATH to select which one to use.
Rob Landley <rob@landley.net>
parents:
904
diff
changeset
|
10 |
1090
affef1edbdba
Cleanup "FROM_ARCH" mess. Rename FROM_ARCH->HOST_ARCH, make stage script responsible for setting HOST_ARCH (not includes.sh). Also, remove HOST_UTILS variable, only build uClibc utils for non-simple compilers and bypass uClibc's (weird) makefile for the utils directory.
Rob Landley <rob@landley.net>
parents:
1084
diff
changeset
|
11 # Output cross it if exists, else simple. If neither exists, output simple. |
affef1edbdba
Cleanup "FROM_ARCH" mess. Rename FROM_ARCH->HOST_ARCH, make stage script responsible for setting HOST_ARCH (not includes.sh). Also, remove HOST_UTILS variable, only build uClibc utils for non-simple compilers and bypass uClibc's (weird) makefile for the utils directory.
Rob Landley <rob@landley.net>
parents:
1084
diff
changeset
|
12 |
944
fc134a13357e
Largeish refactoring and cleanup of compiler build:
Rob Landley <rob@landley.net>
parents:
942
diff
changeset
|
13 for i in "$BUILD"/{,simple-}cross-compiler-"$1/bin" |
915
a541c5a96ff3
Don't actually replace cross-compiler with cross-static, when you build both use $PATH to select which one to use.
Rob Landley <rob@landley.net>
parents:
904
diff
changeset
|
14 do |
a541c5a96ff3
Don't actually replace cross-compiler with cross-static, when you build both use $PATH to select which one to use.
Rob Landley <rob@landley.net>
parents:
904
diff
changeset
|
15 [ -e "$i/$1-cc" ] && break |
a541c5a96ff3
Don't actually replace cross-compiler with cross-static, when you build both use $PATH to select which one to use.
Rob Landley <rob@landley.net>
parents:
904
diff
changeset
|
16 done |
a541c5a96ff3
Don't actually replace cross-compiler with cross-static, when you build both use $PATH to select which one to use.
Rob Landley <rob@landley.net>
parents:
904
diff
changeset
|
17 echo -n "$i:" |
a541c5a96ff3
Don't actually replace cross-compiler with cross-static, when you build both use $PATH to select which one to use.
Rob Landley <rob@landley.net>
parents:
904
diff
changeset
|
18 } |
a541c5a96ff3
Don't actually replace cross-compiler with cross-static, when you build both use $PATH to select which one to use.
Rob Landley <rob@landley.net>
parents:
904
diff
changeset
|
19 |
1398
b74d36876c0a
Replace read_arch_dir with load_target, which understands that sources/targets/$TARGET can be a file or a directory.
Rob Landley <rob@landley.net>
parents:
1391
diff
changeset
|
20 load_target() |
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.
Rob Landley <rob@landley.net>
parents:
727
diff
changeset
|
21 { |
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.
Rob Landley <rob@landley.net>
parents:
727
diff
changeset
|
22 # Get target platform from first command line argument. |
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.
Rob Landley <rob@landley.net>
parents:
727
diff
changeset
|
23 |
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.
Rob Landley <rob@landley.net>
parents:
727
diff
changeset
|
24 ARCH_NAME="$1" |
1398
b74d36876c0a
Replace read_arch_dir with load_target, which understands that sources/targets/$TARGET can be a file or a directory.
Rob Landley <rob@landley.net>
parents:
1391
diff
changeset
|
25 ARCH="$ARCH_NAME" |
b74d36876c0a
Replace read_arch_dir with load_target, which understands that sources/targets/$TARGET can be a file or a directory.
Rob Landley <rob@landley.net>
parents:
1391
diff
changeset
|
26 CONFIG_DIR="$SOURCES/targets" |
b74d36876c0a
Replace read_arch_dir with load_target, which understands that sources/targets/$TARGET can be a file or a directory.
Rob Landley <rob@landley.net>
parents:
1391
diff
changeset
|
27 |
b74d36876c0a
Replace read_arch_dir with load_target, which understands that sources/targets/$TARGET can be a file or a directory.
Rob Landley <rob@landley.net>
parents:
1391
diff
changeset
|
28 # Read the relevant config file. |
b74d36876c0a
Replace read_arch_dir with load_target, which understands that sources/targets/$TARGET can be a file or a directory.
Rob Landley <rob@landley.net>
parents:
1391
diff
changeset
|
29 |
b74d36876c0a
Replace read_arch_dir with load_target, which understands that sources/targets/$TARGET can be a file or a directory.
Rob Landley <rob@landley.net>
parents:
1391
diff
changeset
|
30 if [ -f "$CONFIG_DIR/$ARCH" ] |
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.
Rob Landley <rob@landley.net>
parents:
727
diff
changeset
|
31 then |
1398
b74d36876c0a
Replace read_arch_dir with load_target, which understands that sources/targets/$TARGET can be a file or a directory.
Rob Landley <rob@landley.net>
parents:
1391
diff
changeset
|
32 source "$CONFIG_DIR/$ARCH" |
b74d36876c0a
Replace read_arch_dir with load_target, which understands that sources/targets/$TARGET can be a file or a directory.
Rob Landley <rob@landley.net>
parents:
1391
diff
changeset
|
33 CONFIG_DIR= |
b74d36876c0a
Replace read_arch_dir with load_target, which understands that sources/targets/$TARGET can be a file or a directory.
Rob Landley <rob@landley.net>
parents:
1391
diff
changeset
|
34 elif [ -f "$CONFIG_DIR/$ARCH/settings" ] |
b74d36876c0a
Replace read_arch_dir with load_target, which understands that sources/targets/$TARGET can be a file or a directory.
Rob Landley <rob@landley.net>
parents:
1391
diff
changeset
|
35 then |
b74d36876c0a
Replace read_arch_dir with load_target, which understands that sources/targets/$TARGET can be a file or a directory.
Rob Landley <rob@landley.net>
parents:
1391
diff
changeset
|
36 source "$CONFIG_DIR/$ARCH/settings" ] |
b74d36876c0a
Replace read_arch_dir with load_target, which understands that sources/targets/$TARGET can be a file or a directory.
Rob Landley <rob@landley.net>
parents:
1391
diff
changeset
|
37 else |
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.
Rob Landley <rob@landley.net>
parents:
727
diff
changeset
|
38 echo "Supported architectures: " |
1398
b74d36876c0a
Replace read_arch_dir with load_target, which understands that sources/targets/$TARGET can be a file or a directory.
Rob Landley <rob@landley.net>
parents:
1391
diff
changeset
|
39 ls "$CONFIG_DIR" |
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.
Rob Landley <rob@landley.net>
parents:
727
diff
changeset
|
40 |
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.
Rob Landley <rob@landley.net>
parents:
727
diff
changeset
|
41 exit 1 |
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.
Rob Landley <rob@landley.net>
parents:
727
diff
changeset
|
42 fi |
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.
Rob Landley <rob@landley.net>
parents:
727
diff
changeset
|
43 |
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.
Rob Landley <rob@landley.net>
parents:
727
diff
changeset
|
44 |
1398
b74d36876c0a
Replace read_arch_dir with load_target, which understands that sources/targets/$TARGET can be a file or a directory.
Rob Landley <rob@landley.net>
parents:
1391
diff
changeset
|
45 source "$CONFIG_DIR/$ARCH/settings" |
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.
Rob Landley <rob@landley.net>
parents:
727
diff
changeset
|
46 |
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.
Rob Landley <rob@landley.net>
parents:
727
diff
changeset
|
47 # Which platform are we building for? |
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.
Rob Landley <rob@landley.net>
parents:
727
diff
changeset
|
48 |
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.
Rob Landley <rob@landley.net>
parents:
727
diff
changeset
|
49 export WORK="${BUILD}/temp-$ARCH_NAME" |
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.
Rob Landley <rob@landley.net>
parents:
727
diff
changeset
|
50 |
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.
Rob Landley <rob@landley.net>
parents:
727
diff
changeset
|
51 # Say "unknown" in two different ways so it doesn't assume we're NOT |
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.
Rob Landley <rob@landley.net>
parents:
727
diff
changeset
|
52 # cross compiling when the host and target are the same processor. (If host |
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.
Rob Landley <rob@landley.net>
parents:
727
diff
changeset
|
53 # and target match, the binutils/gcc/make builds won't use the cross compiler |
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.
Rob Landley <rob@landley.net>
parents:
727
diff
changeset
|
54 # during root-filesystem.sh, and the host compiler links binaries against the |
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.
Rob Landley <rob@landley.net>
parents:
727
diff
changeset
|
55 # wrong libc.) |
984
9840847885e8
Add export_if_blank and make lots of build paths overrideable.
Rob Landley <rob@landley.net>
parents:
973
diff
changeset
|
56 export_if_blank CROSS_HOST=`uname -m`-walrus-linux |
1090
affef1edbdba
Cleanup "FROM_ARCH" mess. Rename FROM_ARCH->HOST_ARCH, make stage script responsible for setting HOST_ARCH (not includes.sh). Also, remove HOST_UTILS variable, only build uClibc utils for non-simple compilers and bypass uClibc's (weird) makefile for the utils directory.
Rob Landley <rob@landley.net>
parents:
1084
diff
changeset
|
57 export_if_blank CROSS_TARGET=${ARCH}-unknown-linux |
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.
Rob Landley <rob@landley.net>
parents:
727
diff
changeset
|
58 |
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.
Rob Landley <rob@landley.net>
parents:
727
diff
changeset
|
59 # Setup directories and add the cross compiler to the start of the path. |
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.
Rob Landley <rob@landley.net>
parents:
727
diff
changeset
|
60 |
844
ea9af6c73dbf
Use the ARCH_NAME rather than ARCH when making stage directories. The only place we don't run check_for_base_arch is system-image, and here we want this to differ because of the kernels.
Mark Miller <mark@mirell.org>
parents:
840
diff
changeset
|
61 STAGE_DIR="$BUILD/${STAGE_NAME}-${ARCH_NAME}" |
783
db06a8c1bfed
Lots of changes to move buildall.sh functionality into build.sh.
Rob Landley <rob@landley.net>
parents:
778
diff
changeset
|
62 |
1099
3c6263354ca9
Blank $STAGE_DIR before adjusting $PATH so building the cross-compiler stage doesn't get confused if it dies during the uClibc++ build and gets re-run (adjusting the path to point to the cross compiler we're about to delete and rebuild). Make NO_CLEANUP explicit in system-image.sh so it can rebuild zImage and squashfs independently by default.
Rob Landley <rob@landley.net>
parents:
1098
diff
changeset
|
63 blank_tempdir "$STAGE_DIR" |
3c6263354ca9
Blank $STAGE_DIR before adjusting $PATH so building the cross-compiler stage doesn't get confused if it dies during the uClibc++ build and gets re-run (adjusting the path to point to the cross compiler we're about to delete and rebuild). Make NO_CLEANUP explicit in system-image.sh so it can rebuild zImage and squashfs independently by default.
Rob Landley <rob@landley.net>
parents:
1098
diff
changeset
|
64 blank_tempdir "$WORK" |
3c6263354ca9
Blank $STAGE_DIR before adjusting $PATH so building the cross-compiler stage doesn't get confused if it dies during the uClibc++ build and gets re-run (adjusting the path to point to the cross compiler we're about to delete and rebuild). Make NO_CLEANUP explicit in system-image.sh so it can rebuild zImage and squashfs independently by default.
Rob Landley <rob@landley.net>
parents:
1098
diff
changeset
|
65 |
915
a541c5a96ff3
Don't actually replace cross-compiler with cross-static, when you build both use $PATH to select which one to use.
Rob Landley <rob@landley.net>
parents:
904
diff
changeset
|
66 export PATH="$(cc_path "$ARCH")$PATH" |
1090
affef1edbdba
Cleanup "FROM_ARCH" mess. Rename FROM_ARCH->HOST_ARCH, make stage script responsible for setting HOST_ARCH (not includes.sh). Also, remove HOST_UTILS variable, only build uClibc utils for non-simple compilers and bypass uClibc's (weird) makefile for the utils directory.
Rob Landley <rob@landley.net>
parents:
1084
diff
changeset
|
67 [ ! -z "$HOST_ARCH" ] && [ "$HOST_ARCH" != "$ARCH" ] && |
affef1edbdba
Cleanup "FROM_ARCH" mess. Rename FROM_ARCH->HOST_ARCH, make stage script responsible for setting HOST_ARCH (not includes.sh). Also, remove HOST_UTILS variable, only build uClibc utils for non-simple compilers and bypass uClibc's (weird) makefile for the utils directory.
Rob Landley <rob@landley.net>
parents:
1084
diff
changeset
|
68 PATH="$(cc_path "$HOST_ARCH")$PATH" |
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.
Rob Landley <rob@landley.net>
parents:
727
diff
changeset
|
69 |
944
fc134a13357e
Largeish refactoring and cleanup of compiler build:
Rob Landley <rob@landley.net>
parents:
942
diff
changeset
|
70 DO_CROSS="CROSS_COMPILE=${ARCH}-" |
798
2c9f22daa8fe
Allow target settings to specify BUILD_STATIC.
Rob Landley <rob@landley.net>
parents:
796
diff
changeset
|
71 |
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.
Rob Landley <rob@landley.net>
parents:
727
diff
changeset
|
72 return 0 |
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.
Rob Landley <rob@landley.net>
parents:
727
diff
changeset
|
73 } |
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.
Rob Landley <rob@landley.net>
parents:
727
diff
changeset
|
74 |
820
d1a88d878e18
Factor out and unify binutils, gcc, and ccwrap builds.
Rob Landley <rob@landley.net>
parents:
818
diff
changeset
|
75 # Note that this sources the file, rather than calling it as a separate |
d1a88d878e18
Factor out and unify binutils, gcc, and ccwrap builds.
Rob Landley <rob@landley.net>
parents:
818
diff
changeset
|
76 # process. That way it can set environment variables if it wants to. |
d1a88d878e18
Factor out and unify binutils, gcc, and ccwrap builds.
Rob Landley <rob@landley.net>
parents:
818
diff
changeset
|
77 |
1081
e992bc65b048
Remove unnecessary "function" label from shell functions.
Rob Landley <rob@landley.net>
parents:
1067
diff
changeset
|
78 build_section() |
820
d1a88d878e18
Factor out and unify binutils, gcc, and ccwrap builds.
Rob Landley <rob@landley.net>
parents:
818
diff
changeset
|
79 { |
1084
b52ba5df878d
Don't build anything statically in host-tools.sh, glibc is broken.
Rob Landley <rob@landley.net>
parents:
1083
diff
changeset
|
80 # Don't build anything statically in host-tools, glibc is broken. |
b52ba5df878d
Don't build anything statically in host-tools.sh, glibc is broken.
Rob Landley <rob@landley.net>
parents:
1083
diff
changeset
|
81 # See http://people.redhat.com/drepper/no_static_linking.html for |
b52ba5df878d
Don't build anything statically in host-tools.sh, glibc is broken.
Rob Landley <rob@landley.net>
parents:
1083
diff
changeset
|
82 # insane rant from the glibc maintainer about why he doesn't care. |
b52ba5df878d
Don't build anything statically in host-tools.sh, glibc is broken.
Rob Landley <rob@landley.net>
parents:
1083
diff
changeset
|
83 is_in_list $1 $BUILD_STATIC && [ ! -z "$ARCH" ] && STATIC_FLAGS="--static" |
b52ba5df878d
Don't build anything statically in host-tools.sh, glibc is broken.
Rob Landley <rob@landley.net>
parents:
1083
diff
changeset
|
84 |
1200
8651437b2b44
Add DEBUG_PACKAGE config variable to build just one package with CPUS=1.
Rob Landley <rob@landley.net>
parents:
1184
diff
changeset
|
85 OLDCPUS=$CPUS |
8651437b2b44
Add DEBUG_PACKAGE config variable to build just one package with CPUS=1.
Rob Landley <rob@landley.net>
parents:
1184
diff
changeset
|
86 is_in_list $1 $DEBUG_PACKAGE && CPUS=1 |
8651437b2b44
Add DEBUG_PACKAGE config variable to build just one package with CPUS=1.
Rob Landley <rob@landley.net>
parents:
1184
diff
changeset
|
87 |
938
609bc05b0d6a
Teach build_section to run "*.build" sections (with setupfor/cleanup called for them) as well as "*.sh" sections which do their own setup/cleanup.
Rob Landley <rob@landley.net>
parents:
936
diff
changeset
|
88 if [ -e "$SOURCES/sections/$1".build ] |
609bc05b0d6a
Teach build_section to run "*.build" sections (with setupfor/cleanup called for them) as well as "*.sh" sections which do their own setup/cleanup.
Rob Landley <rob@landley.net>
parents:
936
diff
changeset
|
89 then |
609bc05b0d6a
Teach build_section to run "*.build" sections (with setupfor/cleanup called for them) as well as "*.sh" sections which do their own setup/cleanup.
Rob Landley <rob@landley.net>
parents:
936
diff
changeset
|
90 setupfor "$1" |
609bc05b0d6a
Teach build_section to run "*.build" sections (with setupfor/cleanup called for them) as well as "*.sh" sections which do their own setup/cleanup.
Rob Landley <rob@landley.net>
parents:
936
diff
changeset
|
91 . "$SOURCES/sections/$1".build |
609bc05b0d6a
Teach build_section to run "*.build" sections (with setupfor/cleanup called for them) as well as "*.sh" sections which do their own setup/cleanup.
Rob Landley <rob@landley.net>
parents:
936
diff
changeset
|
92 cleanup |
609bc05b0d6a
Teach build_section to run "*.build" sections (with setupfor/cleanup called for them) as well as "*.sh" sections which do their own setup/cleanup.
Rob Landley <rob@landley.net>
parents:
936
diff
changeset
|
93 else |
1358
9252453c40d0
Combine set_titlebar and "echo ===" stuff into announce() function. Consistently output target/stage info, and yank redundant instances.
Rob Landley <rob@landley.net>
parents:
1253
diff
changeset
|
94 announce "$1" |
938
609bc05b0d6a
Teach build_section to run "*.build" sections (with setupfor/cleanup called for them) as well as "*.sh" sections which do their own setup/cleanup.
Rob Landley <rob@landley.net>
parents:
936
diff
changeset
|
95 . "$SOURCES"/sections/"$1".sh |
609bc05b0d6a
Teach build_section to run "*.build" sections (with setupfor/cleanup called for them) as well as "*.sh" sections which do their own setup/cleanup.
Rob Landley <rob@landley.net>
parents:
936
diff
changeset
|
96 fi |
1200
8651437b2b44
Add DEBUG_PACKAGE config variable to build just one package with CPUS=1.
Rob Landley <rob@landley.net>
parents:
1184
diff
changeset
|
97 CPUS=$OLDCPUS |
820
d1a88d878e18
Factor out and unify binutils, gcc, and ccwrap builds.
Rob Landley <rob@landley.net>
parents:
818
diff
changeset
|
98 } |
d1a88d878e18
Factor out and unify binutils, gcc, and ccwrap builds.
Rob Landley <rob@landley.net>
parents:
818
diff
changeset
|
99 |
530
ea7a010e5c47
Add ldd/readelf/ldconfig to cross and native toolchains, and teach build to fallback to stable miniconfig when miniconfig-alt is absent.
Rob Landley <rob@landley.net>
parents:
494
diff
changeset
|
100 # Find appropriate miniconfig file |
ea7a010e5c47
Add ldd/readelf/ldconfig to cross and native toolchains, and teach build to fallback to stable miniconfig when miniconfig-alt is absent.
Rob Landley <rob@landley.net>
parents:
494
diff
changeset
|
101 |
1081
e992bc65b048
Remove unnecessary "function" label from shell functions.
Rob Landley <rob@landley.net>
parents:
1067
diff
changeset
|
102 getconfig() |
530
ea7a010e5c47
Add ldd/readelf/ldconfig to cross and native toolchains, and teach build to fallback to stable miniconfig when miniconfig-alt is absent.
Rob Landley <rob@landley.net>
parents:
494
diff
changeset
|
103 { |
1082
255488af0bbb
Convert unstable() to is_in_list() taking the list to check as the second argument.
Rob Landley <rob@landley.net>
parents:
1081
diff
changeset
|
104 for i in $(is_in_list $1 $USE_UNSTABLE && echo {$ARCH_NAME,$ARCH}/miniconfig-alt-$1) \ |
581
9dffdd74c186
More changes for initramfs and hw- targets with a base architecture.
Rob Landley <rob@landley.net>
parents:
567
diff
changeset
|
105 {$ARCH_NAME,$ARCH}/miniconfig-$1 |
9dffdd74c186
More changes for initramfs and hw- targets with a base architecture.
Rob Landley <rob@landley.net>
parents:
567
diff
changeset
|
106 do |
1152
2f39d1bfb2fd
Add baseconfig-linux, the infrastructure to use it, and move over the arm targets. (You can override with a miniconfig-linux or miniconfig-uClibc in the appropriate target directory.)
Rob Landley <rob@landley.net>
parents:
1107
diff
changeset
|
107 [ -f "$CONFIG_DIR/$i" ] && cat "$CONFIG_DIR/$i" && return |
581
9dffdd74c186
More changes for initramfs and hw- targets with a base architecture.
Rob Landley <rob@landley.net>
parents:
567
diff
changeset
|
108 done |
530
ea7a010e5c47
Add ldd/readelf/ldconfig to cross and native toolchains, and teach build to fallback to stable miniconfig when miniconfig-alt is absent.
Rob Landley <rob@landley.net>
parents:
494
diff
changeset
|
109 |
1152
2f39d1bfb2fd
Add baseconfig-linux, the infrastructure to use it, and move over the arm targets. (You can override with a miniconfig-linux or miniconfig-uClibc in the appropriate target directory.)
Rob Landley <rob@landley.net>
parents:
1107
diff
changeset
|
110 # Output baseconfig, then append $1_CONFIG (converting $1 to uppercase) |
2f39d1bfb2fd
Add baseconfig-linux, the infrastructure to use it, and move over the arm targets. (You can override with a miniconfig-linux or miniconfig-uClibc in the appropriate target directory.)
Rob Landley <rob@landley.net>
parents:
1107
diff
changeset
|
111 cat "$SOURCES/baseconfig-$1" |
2f39d1bfb2fd
Add baseconfig-linux, the infrastructure to use it, and move over the arm targets. (You can override with a miniconfig-linux or miniconfig-uClibc in the appropriate target directory.)
Rob Landley <rob@landley.net>
parents:
1107
diff
changeset
|
112 eval "echo \"\${$(echo $1 | tr a-z A-Z)_CONFIG}\"" |
530
ea7a010e5c47
Add ldd/readelf/ldconfig to cross and native toolchains, and teach build to fallback to stable miniconfig when miniconfig-alt is absent.
Rob Landley <rob@landley.net>
parents:
494
diff
changeset
|
113 } |
ea7a010e5c47
Add ldd/readelf/ldconfig to cross and native toolchains, and teach build to fallback to stable miniconfig when miniconfig-alt is absent.
Rob Landley <rob@landley.net>
parents:
494
diff
changeset
|
114 |
815
8129df56091b
Extended setupfor/cleanup to create binary package tarballs if the configure option BINARY_PACKAGE_TARBALLS is set. These tarballs extract into the current directory and add all the changed files installed by this package build, so you can pick and choose when assembling your own filesystem.
Rob Landley <rob@landley.net>
parents:
798
diff
changeset
|
115 # Find all files in $STAGE_DIR newer than $CURSRC. |
8129df56091b
Extended setupfor/cleanup to create binary package tarballs if the configure option BINARY_PACKAGE_TARBALLS is set. These tarballs extract into the current directory and add all the changed files installed by this package build, so you can pick and choose when assembling your own filesystem.
Rob Landley <rob@landley.net>
parents:
798
diff
changeset
|
116 |
1081
e992bc65b048
Remove unnecessary "function" label from shell functions.
Rob Landley <rob@landley.net>
parents:
1067
diff
changeset
|
117 recent_binary_files() |
815
8129df56091b
Extended setupfor/cleanup to create binary package tarballs if the configure option BINARY_PACKAGE_TARBALLS is set. These tarballs extract into the current directory and add all the changed files installed by this package build, so you can pick and choose when assembling your own filesystem.
Rob Landley <rob@landley.net>
parents:
798
diff
changeset
|
118 { |
8129df56091b
Extended setupfor/cleanup to create binary package tarballs if the configure option BINARY_PACKAGE_TARBALLS is set. These tarballs extract into the current directory and add all the changed files installed by this package build, so you can pick and choose when assembling your own filesystem.
Rob Landley <rob@landley.net>
parents:
798
diff
changeset
|
119 PREVIOUS= |
8129df56091b
Extended setupfor/cleanup to create binary package tarballs if the configure option BINARY_PACKAGE_TARBALLS is set. These tarballs extract into the current directory and add all the changed files installed by this package build, so you can pick and choose when assembling your own filesystem.
Rob Landley <rob@landley.net>
parents:
798
diff
changeset
|
120 (cd "$STAGE_DIR" || dienow |
1390
ac60cab45463
Remove FWL debris and rename do_rename to do_manifest while we're at it. (Based on prompting from Alessio Bogani).
Rob Landley <rob@landley.net>
parents:
1389
diff
changeset
|
121 find . -depth -newer "$CURSRC/BUILD-TIMESTAMP" \ |
815
8129df56091b
Extended setupfor/cleanup to create binary package tarballs if the configure option BINARY_PACKAGE_TARBALLS is set. These tarballs extract into the current directory and add all the changed files installed by this package build, so you can pick and choose when assembling your own filesystem.
Rob Landley <rob@landley.net>
parents:
798
diff
changeset
|
122 | sed -e 's/^.//' -e 's/^.//' -e '/^$/d' |
8129df56091b
Extended setupfor/cleanup to create binary package tarballs if the configure option BINARY_PACKAGE_TARBALLS is set. These tarballs extract into the current directory and add all the changed files installed by this package build, so you can pick and choose when assembling your own filesystem.
Rob Landley <rob@landley.net>
parents:
798
diff
changeset
|
123 ) | while read i |
8129df56091b
Extended setupfor/cleanup to create binary package tarballs if the configure option BINARY_PACKAGE_TARBALLS is set. These tarballs extract into the current directory and add all the changed files installed by this package build, so you can pick and choose when assembling your own filesystem.
Rob Landley <rob@landley.net>
parents:
798
diff
changeset
|
124 do |
8129df56091b
Extended setupfor/cleanup to create binary package tarballs if the configure option BINARY_PACKAGE_TARBALLS is set. These tarballs extract into the current directory and add all the changed files installed by this package build, so you can pick and choose when assembling your own filesystem.
Rob Landley <rob@landley.net>
parents:
798
diff
changeset
|
125 TEMP="${PREVIOUS##"$i"/}" |
8129df56091b
Extended setupfor/cleanup to create binary package tarballs if the configure option BINARY_PACKAGE_TARBALLS is set. These tarballs extract into the current directory and add all the changed files installed by this package build, so you can pick and choose when assembling your own filesystem.
Rob Landley <rob@landley.net>
parents:
798
diff
changeset
|
126 |
8129df56091b
Extended setupfor/cleanup to create binary package tarballs if the configure option BINARY_PACKAGE_TARBALLS is set. These tarballs extract into the current directory and add all the changed files installed by this package build, so you can pick and choose when assembling your own filesystem.
Rob Landley <rob@landley.net>
parents:
798
diff
changeset
|
127 if [ $[${#PREVIOUS}-${#TEMP}] -ne $[${#i}+1] ] |
8129df56091b
Extended setupfor/cleanup to create binary package tarballs if the configure option BINARY_PACKAGE_TARBALLS is set. These tarballs extract into the current directory and add all the changed files installed by this package build, so you can pick and choose when assembling your own filesystem.
Rob Landley <rob@landley.net>
parents:
798
diff
changeset
|
128 then |
8129df56091b
Extended setupfor/cleanup to create binary package tarballs if the configure option BINARY_PACKAGE_TARBALLS is set. These tarballs extract into the current directory and add all the changed files installed by this package build, so you can pick and choose when assembling your own filesystem.
Rob Landley <rob@landley.net>
parents:
798
diff
changeset
|
129 # Because the expanded $i might have \ chars in it, that's why. |
8129df56091b
Extended setupfor/cleanup to create binary package tarballs if the configure option BINARY_PACKAGE_TARBALLS is set. These tarballs extract into the current directory and add all the changed files installed by this package build, so you can pick and choose when assembling your own filesystem.
Rob Landley <rob@landley.net>
parents:
798
diff
changeset
|
130 echo -n "$i" |
8129df56091b
Extended setupfor/cleanup to create binary package tarballs if the configure option BINARY_PACKAGE_TARBALLS is set. These tarballs extract into the current directory and add all the changed files installed by this package build, so you can pick and choose when assembling your own filesystem.
Rob Landley <rob@landley.net>
parents:
798
diff
changeset
|
131 echo -ne '\0' |
8129df56091b
Extended setupfor/cleanup to create binary package tarballs if the configure option BINARY_PACKAGE_TARBALLS is set. These tarballs extract into the current directory and add all the changed files installed by this package build, so you can pick and choose when assembling your own filesystem.
Rob Landley <rob@landley.net>
parents:
798
diff
changeset
|
132 fi |
8129df56091b
Extended setupfor/cleanup to create binary package tarballs if the configure option BINARY_PACKAGE_TARBALLS is set. These tarballs extract into the current directory and add all the changed files installed by this package build, so you can pick and choose when assembling your own filesystem.
Rob Landley <rob@landley.net>
parents:
798
diff
changeset
|
133 PREVIOUS="$i" |
8129df56091b
Extended setupfor/cleanup to create binary package tarballs if the configure option BINARY_PACKAGE_TARBALLS is set. These tarballs extract into the current directory and add all the changed files installed by this package build, so you can pick and choose when assembling your own filesystem.
Rob Landley <rob@landley.net>
parents:
798
diff
changeset
|
134 done |
8129df56091b
Extended setupfor/cleanup to create binary package tarballs if the configure option BINARY_PACKAGE_TARBALLS is set. These tarballs extract into the current directory and add all the changed files installed by this package build, so you can pick and choose when assembling your own filesystem.
Rob Landley <rob@landley.net>
parents:
798
diff
changeset
|
135 } |
8129df56091b
Extended setupfor/cleanup to create binary package tarballs if the configure option BINARY_PACKAGE_TARBALLS is set. These tarballs extract into the current directory and add all the changed files installed by this package build, so you can pick and choose when assembling your own filesystem.
Rob Landley <rob@landley.net>
parents:
798
diff
changeset
|
136 |
1253
d4b251e78fc0
Break out download_functions.sh into their own file.
Rob Landley <rob@landley.net>
parents:
1229
diff
changeset
|
137 # Delete a working copy of source code once the build's done. |
428
c88e25996320
Split function definitions out from include.sh.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
138 |
1081
e992bc65b048
Remove unnecessary "function" label from shell functions.
Rob Landley <rob@landley.net>
parents:
1067
diff
changeset
|
139 cleanup() |
428
c88e25996320
Split function definitions out from include.sh.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
140 { |
815
8129df56091b
Extended setupfor/cleanup to create binary package tarballs if the configure option BINARY_PACKAGE_TARBALLS is set. These tarballs extract into the current directory and add all the changed files installed by this package build, so you can pick and choose when assembling your own filesystem.
Rob Landley <rob@landley.net>
parents:
798
diff
changeset
|
141 # If package build exited with an error, do not continue. |
428
c88e25996320
Split function definitions out from include.sh.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
142 |
c88e25996320
Split function definitions out from include.sh.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
143 [ $? -ne 0 ] && dienow |
c88e25996320
Split function definitions out from include.sh.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
144 |
815
8129df56091b
Extended setupfor/cleanup to create binary package tarballs if the configure option BINARY_PACKAGE_TARBALLS is set. These tarballs extract into the current directory and add all the changed files installed by this package build, so you can pick and choose when assembling your own filesystem.
Rob Landley <rob@landley.net>
parents:
798
diff
changeset
|
145 if [ ! -z "$BINARY_PACKAGE_TARBALLS" ] |
8129df56091b
Extended setupfor/cleanup to create binary package tarballs if the configure option BINARY_PACKAGE_TARBALLS is set. These tarballs extract into the current directory and add all the changed files installed by this package build, so you can pick and choose when assembling your own filesystem.
Rob Landley <rob@landley.net>
parents:
798
diff
changeset
|
146 then |
8129df56091b
Extended setupfor/cleanup to create binary package tarballs if the configure option BINARY_PACKAGE_TARBALLS is set. These tarballs extract into the current directory and add all the changed files installed by this package build, so you can pick and choose when assembling your own filesystem.
Rob Landley <rob@landley.net>
parents:
798
diff
changeset
|
147 TARNAME="$PACKAGE-$STAGE_NAME-${ARCH_NAME}".tar.bz2 |
1391
42ec661e3916
Fix BINARY_PACKAGE_TARBALLS generation: some packages produce no output (zlib used to build dropbear for example), and thus check for an empty list before trying to make a tarball.
Rob Landley <rob@landley.net>
parents:
1390
diff
changeset
|
148 [ ! -z "$(recent_binary_files)" ] && |
42ec661e3916
Fix BINARY_PACKAGE_TARBALLS generation: some packages produce no output (zlib used to build dropbear for example), and thus check for an empty list before trying to make a tarball.
Rob Landley <rob@landley.net>
parents:
1390
diff
changeset
|
149 echo -n Creating "$TARNAME" && |
42ec661e3916
Fix BINARY_PACKAGE_TARBALLS generation: some packages produce no output (zlib used to build dropbear for example), and thus check for an empty list before trying to make a tarball.
Rob Landley <rob@landley.net>
parents:
1390
diff
changeset
|
150 { recent_binary_files | xargs -0 tar -cjvf \ |
42ec661e3916
Fix BINARY_PACKAGE_TARBALLS generation: some packages produce no output (zlib used to build dropbear for example), and thus check for an empty list before trying to make a tarball.
Rob Landley <rob@landley.net>
parents:
1390
diff
changeset
|
151 "$BUILD/${TARNAME}" -C "$STAGE_DIR" || dienow |
42ec661e3916
Fix BINARY_PACKAGE_TARBALLS generation: some packages produce no output (zlib used to build dropbear for example), and thus check for an empty list before trying to make a tarball.
Rob Landley <rob@landley.net>
parents:
1390
diff
changeset
|
152 } | dotprogress |
815
8129df56091b
Extended setupfor/cleanup to create binary package tarballs if the configure option BINARY_PACKAGE_TARBALLS is set. These tarballs extract into the current directory and add all the changed files installed by this package build, so you can pick and choose when assembling your own filesystem.
Rob Landley <rob@landley.net>
parents:
798
diff
changeset
|
153 fi |
8129df56091b
Extended setupfor/cleanup to create binary package tarballs if the configure option BINARY_PACKAGE_TARBALLS is set. These tarballs extract into the current directory and add all the changed files installed by this package build, so you can pick and choose when assembling your own filesystem.
Rob Landley <rob@landley.net>
parents:
798
diff
changeset
|
154 |
567
5619a7375b74
Add NO_CLEANUP option to config.
Rob Landley <rob@landley.net>
parents:
534
diff
changeset
|
155 if [ ! -z "$NO_CLEANUP" ] |
5619a7375b74
Add NO_CLEANUP option to config.
Rob Landley <rob@landley.net>
parents:
534
diff
changeset
|
156 then |
815
8129df56091b
Extended setupfor/cleanup to create binary package tarballs if the configure option BINARY_PACKAGE_TARBALLS is set. These tarballs extract into the current directory and add all the changed files installed by this package build, so you can pick and choose when assembling your own filesystem.
Rob Landley <rob@landley.net>
parents:
798
diff
changeset
|
157 echo "skip cleanup $PACKAGE $@" |
567
5619a7375b74
Add NO_CLEANUP option to config.
Rob Landley <rob@landley.net>
parents:
534
diff
changeset
|
158 return |
5619a7375b74
Add NO_CLEANUP option to config.
Rob Landley <rob@landley.net>
parents:
534
diff
changeset
|
159 fi |
5619a7375b74
Add NO_CLEANUP option to config.
Rob Landley <rob@landley.net>
parents:
534
diff
changeset
|
160 |
815
8129df56091b
Extended setupfor/cleanup to create binary package tarballs if the configure option BINARY_PACKAGE_TARBALLS is set. These tarballs extract into the current directory and add all the changed files installed by this package build, so you can pick and choose when assembling your own filesystem.
Rob Landley <rob@landley.net>
parents:
798
diff
changeset
|
161 # Loop deleting directories |
8129df56091b
Extended setupfor/cleanup to create binary package tarballs if the configure option BINARY_PACKAGE_TARBALLS is set. These tarballs extract into the current directory and add all the changed files installed by this package build, so you can pick and choose when assembling your own filesystem.
Rob Landley <rob@landley.net>
parents:
798
diff
changeset
|
162 |
8129df56091b
Extended setupfor/cleanup to create binary package tarballs if the configure option BINARY_PACKAGE_TARBALLS is set. These tarballs extract into the current directory and add all the changed files installed by this package build, so you can pick and choose when assembling your own filesystem.
Rob Landley <rob@landley.net>
parents:
798
diff
changeset
|
163 cd "$WORK" || dienow |
1183
61e7e9be8eb4
Add blank_workdir and make setupfor and cleanup use it. This means you can run an entire build.sh with NO_CLEANUP=1 on.
Rob Landley <rob@landley.net>
parents:
1162
diff
changeset
|
164 for i in $WORKDIR_LIST |
428
c88e25996320
Split function definitions out from include.sh.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
165 do |
c88e25996320
Split function definitions out from include.sh.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
166 echo "cleanup $i" |
c88e25996320
Split function definitions out from include.sh.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
167 rm -rf "$i" || dienow |
1183
61e7e9be8eb4
Add blank_workdir and make setupfor and cleanup use it. This means you can run an entire build.sh with NO_CLEANUP=1 on.
Rob Landley <rob@landley.net>
parents:
1162
diff
changeset
|
168 done |
61e7e9be8eb4
Add blank_workdir and make setupfor and cleanup use it. This means you can run an entire build.sh with NO_CLEANUP=1 on.
Rob Landley <rob@landley.net>
parents:
1162
diff
changeset
|
169 WORKDIR_LIST= |
428
c88e25996320
Split function definitions out from include.sh.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
170 } |
c88e25996320
Split function definitions out from include.sh.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
171 |
1183
61e7e9be8eb4
Add blank_workdir and make setupfor and cleanup use it. This means you can run an entire build.sh with NO_CLEANUP=1 on.
Rob Landley <rob@landley.net>
parents:
1162
diff
changeset
|
172 # Create a working directory under TMPDIR, deleting existing contents (if any), |
61e7e9be8eb4
Add blank_workdir and make setupfor and cleanup use it. This means you can run an entire build.sh with NO_CLEANUP=1 on.
Rob Landley <rob@landley.net>
parents:
1162
diff
changeset
|
173 # and tracking created directories so cleanup can delete them automatically. |
61e7e9be8eb4
Add blank_workdir and make setupfor and cleanup use it. This means you can run an entire build.sh with NO_CLEANUP=1 on.
Rob Landley <rob@landley.net>
parents:
1162
diff
changeset
|
174 |
61e7e9be8eb4
Add blank_workdir and make setupfor and cleanup use it. This means you can run an entire build.sh with NO_CLEANUP=1 on.
Rob Landley <rob@landley.net>
parents:
1162
diff
changeset
|
175 blank_workdir() |
61e7e9be8eb4
Add blank_workdir and make setupfor and cleanup use it. This means you can run an entire build.sh with NO_CLEANUP=1 on.
Rob Landley <rob@landley.net>
parents:
1162
diff
changeset
|
176 { |
61e7e9be8eb4
Add blank_workdir and make setupfor and cleanup use it. This means you can run an entire build.sh with NO_CLEANUP=1 on.
Rob Landley <rob@landley.net>
parents:
1162
diff
changeset
|
177 WORKDIR_LIST="$1 $WORKDIR_LIST" |
61e7e9be8eb4
Add blank_workdir and make setupfor and cleanup use it. This means you can run an entire build.sh with NO_CLEANUP=1 on.
Rob Landley <rob@landley.net>
parents:
1162
diff
changeset
|
178 NO_CLEANUP= blank_tempdir "$WORK/$1" |
61e7e9be8eb4
Add blank_workdir and make setupfor and cleanup use it. This means you can run an entire build.sh with NO_CLEANUP=1 on.
Rob Landley <rob@landley.net>
parents:
1162
diff
changeset
|
179 cd "$WORK/$1" || dienow |
61e7e9be8eb4
Add blank_workdir and make setupfor and cleanup use it. This means you can run an entire build.sh with NO_CLEANUP=1 on.
Rob Landley <rob@landley.net>
parents:
1162
diff
changeset
|
180 } |
61e7e9be8eb4
Add blank_workdir and make setupfor and cleanup use it. This means you can run an entire build.sh with NO_CLEANUP=1 on.
Rob Landley <rob@landley.net>
parents:
1162
diff
changeset
|
181 |
61e7e9be8eb4
Add blank_workdir and make setupfor and cleanup use it. This means you can run an entire build.sh with NO_CLEANUP=1 on.
Rob Landley <rob@landley.net>
parents:
1162
diff
changeset
|
182 # Extract package $1 |
428
c88e25996320
Split function definitions out from include.sh.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
183 |
1081
e992bc65b048
Remove unnecessary "function" label from shell functions.
Rob Landley <rob@landley.net>
parents:
1067
diff
changeset
|
184 setupfor() |
428
c88e25996320
Split function definitions out from include.sh.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
185 { |
897
850da666acc6
Redo command recording: no longer RECORD_COMMMANDS config entry, now sources/more/record-commands.sh run to set up the wrapper (either before or after host-tools.sh). General cleanup and simplification of code this interacted with, plus clean up bit rot in the reporting.
Rob Landley <rob@landley.net>
parents:
844
diff
changeset
|
186 export WRAPPY_LOGPATH="$BUILD/logs/cmdlines.${ARCH_NAME}.${STAGE_NAME}.setupfor" |
428
c88e25996320
Split function definitions out from include.sh.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
187 |
c88e25996320
Split function definitions out from include.sh.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
188 # Make sure the source is already extracted and up-to-date. |
1184
aa8992b35e15
Make extract_package directly callable, and do so where necessary.
Rob Landley <rob@landley.net>
parents:
1183
diff
changeset
|
189 extract_package "$1" || exit 1 |
760
2537f30c2397
Improve version detection for MANIFEST file. Still doesn't detect version for git archive output because git hasn't got any equivalent of mercurial's .hg_archive.txt file.
Rob Landley <rob@landley.net>
parents:
744
diff
changeset
|
190 |
1183
61e7e9be8eb4
Add blank_workdir and make setupfor and cleanup use it. This means you can run an entire build.sh with NO_CLEANUP=1 on.
Rob Landley <rob@landley.net>
parents:
1162
diff
changeset
|
191 # Delete old working copy (even in the NO_CLEANUP case) then make a new |
61e7e9be8eb4
Add blank_workdir and make setupfor and cleanup use it. This means you can run an entire build.sh with NO_CLEANUP=1 on.
Rob Landley <rob@landley.net>
parents:
1162
diff
changeset
|
192 # tree of links to the package cache. |
61e7e9be8eb4
Add blank_workdir and make setupfor and cleanup use it. This means you can run an entire build.sh with NO_CLEANUP=1 on.
Rob Landley <rob@landley.net>
parents:
1162
diff
changeset
|
193 |
61e7e9be8eb4
Add blank_workdir and make setupfor and cleanup use it. This means you can run an entire build.sh with NO_CLEANUP=1 on.
Rob Landley <rob@landley.net>
parents:
1162
diff
changeset
|
194 echo "Snapshot '$PACKAGE'..." |
61e7e9be8eb4
Add blank_workdir and make setupfor and cleanup use it. This means you can run an entire build.sh with NO_CLEANUP=1 on.
Rob Landley <rob@landley.net>
parents:
1162
diff
changeset
|
195 |
61e7e9be8eb4
Add blank_workdir and make setupfor and cleanup use it. This means you can run an entire build.sh with NO_CLEANUP=1 on.
Rob Landley <rob@landley.net>
parents:
1162
diff
changeset
|
196 if [ -z "$REUSE_CURSRC" ] |
428
c88e25996320
Split function definitions out from include.sh.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
197 then |
1183
61e7e9be8eb4
Add blank_workdir and make setupfor and cleanup use it. This means you can run an entire build.sh with NO_CLEANUP=1 on.
Rob Landley <rob@landley.net>
parents:
1162
diff
changeset
|
198 blank_workdir "$PACKAGE" |
61e7e9be8eb4
Add blank_workdir and make setupfor and cleanup use it. This means you can run an entire build.sh with NO_CLEANUP=1 on.
Rob Landley <rob@landley.net>
parents:
1162
diff
changeset
|
199 CURSRC="$(pwd)" |
428
c88e25996320
Split function definitions out from include.sh.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
200 fi |
c88e25996320
Split function definitions out from include.sh.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
201 |
623
6f7f4d9011af
Add SNAPSHOT_SYMLINK option so extracted source packages can live in a different filesystem than the build directory.
Rob Landley <rob@landley.net>
parents:
595
diff
changeset
|
202 [ -z "$SNAPSHOT_SYMLINK" ] && LINKTYPE="l" || LINKTYPE="s" |
1183
61e7e9be8eb4
Add blank_workdir and make setupfor and cleanup use it. This means you can run an entire build.sh with NO_CLEANUP=1 on.
Rob Landley <rob@landley.net>
parents:
1162
diff
changeset
|
203 cp -${LINKTYPE}fR "$SRCTREE/$PACKAGE/"* "$CURSRC" |
428
c88e25996320
Split function definitions out from include.sh.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
204 |
1158 | 205 if [ $? -ne 0 ] |
206 then | |
207 echo "$PACKAGE not found. Did you run download.sh?" >&2 | |
208 dienow | |
209 fi | |
428
c88e25996320
Split function definitions out from include.sh.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
210 |
1183
61e7e9be8eb4
Add blank_workdir and make setupfor and cleanup use it. This means you can run an entire build.sh with NO_CLEANUP=1 on.
Rob Landley <rob@landley.net>
parents:
1162
diff
changeset
|
211 cd "$CURSRC" || dienow |
897
850da666acc6
Redo command recording: no longer RECORD_COMMMANDS config entry, now sources/more/record-commands.sh run to set up the wrapper (either before or after host-tools.sh). General cleanup and simplification of code this interacted with, plus clean up bit rot in the reporting.
Rob Landley <rob@landley.net>
parents:
844
diff
changeset
|
212 export WRAPPY_LOGPATH="$BUILD/logs/cmdlines.${ARCH_NAME}.${STAGE_NAME}.$1" |
428
c88e25996320
Split function definitions out from include.sh.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
213 |
815
8129df56091b
Extended setupfor/cleanup to create binary package tarballs if the configure option BINARY_PACKAGE_TARBALLS is set. These tarballs extract into the current directory and add all the changed files installed by this package build, so you can pick and choose when assembling your own filesystem.
Rob Landley <rob@landley.net>
parents:
798
diff
changeset
|
214 # Ugly bug workaround: timestamp granularity in a lot of filesystems is only |
8129df56091b
Extended setupfor/cleanup to create binary package tarballs if the configure option BINARY_PACKAGE_TARBALLS is set. These tarballs extract into the current directory and add all the changed files installed by this package build, so you can pick and choose when assembling your own filesystem.
Rob Landley <rob@landley.net>
parents:
798
diff
changeset
|
215 # 1 second, so find -newer misses things installed in the same second, so we |
8129df56091b
Extended setupfor/cleanup to create binary package tarballs if the configure option BINARY_PACKAGE_TARBALLS is set. These tarballs extract into the current directory and add all the changed files installed by this package build, so you can pick and choose when assembling your own filesystem.
Rob Landley <rob@landley.net>
parents:
798
diff
changeset
|
216 # make sure it's a new second before we start actually doing anything. |
8129df56091b
Extended setupfor/cleanup to create binary package tarballs if the configure option BINARY_PACKAGE_TARBALLS is set. These tarballs extract into the current directory and add all the changed files installed by this package build, so you can pick and choose when assembling your own filesystem.
Rob Landley <rob@landley.net>
parents:
798
diff
changeset
|
217 |
8129df56091b
Extended setupfor/cleanup to create binary package tarballs if the configure option BINARY_PACKAGE_TARBALLS is set. These tarballs extract into the current directory and add all the changed files installed by this package build, so you can pick and choose when assembling your own filesystem.
Rob Landley <rob@landley.net>
parents:
798
diff
changeset
|
218 if [ ! -z "$BINARY_PACKAGE_TARBALLS" ] |
8129df56091b
Extended setupfor/cleanup to create binary package tarballs if the configure option BINARY_PACKAGE_TARBALLS is set. These tarballs extract into the current directory and add all the changed files installed by this package build, so you can pick and choose when assembling your own filesystem.
Rob Landley <rob@landley.net>
parents:
798
diff
changeset
|
219 then |
1390
ac60cab45463
Remove FWL debris and rename do_rename to do_manifest while we're at it. (Based on prompting from Alessio Bogani).
Rob Landley <rob@landley.net>
parents:
1389
diff
changeset
|
220 touch "$CURSRC/BUILD-TIMESTAMP" || dienow |
815
8129df56091b
Extended setupfor/cleanup to create binary package tarballs if the configure option BINARY_PACKAGE_TARBALLS is set. These tarballs extract into the current directory and add all the changed files installed by this package build, so you can pick and choose when assembling your own filesystem.
Rob Landley <rob@landley.net>
parents:
798
diff
changeset
|
221 TIME=$(date +%s) |
8129df56091b
Extended setupfor/cleanup to create binary package tarballs if the configure option BINARY_PACKAGE_TARBALLS is set. These tarballs extract into the current directory and add all the changed files installed by this package build, so you can pick and choose when assembling your own filesystem.
Rob Landley <rob@landley.net>
parents:
798
diff
changeset
|
222 while true |
8129df56091b
Extended setupfor/cleanup to create binary package tarballs if the configure option BINARY_PACKAGE_TARBALLS is set. These tarballs extract into the current directory and add all the changed files installed by this package build, so you can pick and choose when assembling your own filesystem.
Rob Landley <rob@landley.net>
parents:
798
diff
changeset
|
223 do |
8129df56091b
Extended setupfor/cleanup to create binary package tarballs if the configure option BINARY_PACKAGE_TARBALLS is set. These tarballs extract into the current directory and add all the changed files installed by this package build, so you can pick and choose when assembling your own filesystem.
Rob Landley <rob@landley.net>
parents:
798
diff
changeset
|
224 [ $TIME != "$(date +%s)" ] && break |
8129df56091b
Extended setupfor/cleanup to create binary package tarballs if the configure option BINARY_PACKAGE_TARBALLS is set. These tarballs extract into the current directory and add all the changed files installed by this package build, so you can pick and choose when assembling your own filesystem.
Rob Landley <rob@landley.net>
parents:
798
diff
changeset
|
225 sleep .1 |
8129df56091b
Extended setupfor/cleanup to create binary package tarballs if the configure option BINARY_PACKAGE_TARBALLS is set. These tarballs extract into the current directory and add all the changed files installed by this package build, so you can pick and choose when assembling your own filesystem.
Rob Landley <rob@landley.net>
parents:
798
diff
changeset
|
226 done |
8129df56091b
Extended setupfor/cleanup to create binary package tarballs if the configure option BINARY_PACKAGE_TARBALLS is set. These tarballs extract into the current directory and add all the changed files installed by this package build, so you can pick and choose when assembling your own filesystem.
Rob Landley <rob@landley.net>
parents:
798
diff
changeset
|
227 fi |
428
c88e25996320
Split function definitions out from include.sh.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
228 } |
440
59fe5a276991
Add getversion() and wait4background(), useful to build wrappers.
Rob Landley <rob@landley.net>
parents:
436
diff
changeset
|
229 |
1253
d4b251e78fc0
Break out download_functions.sh into their own file.
Rob Landley <rob@landley.net>
parents:
1229
diff
changeset
|
230 # Given a filename.tar.ext, return the version number. |
d4b251e78fc0
Break out download_functions.sh into their own file.
Rob Landley <rob@landley.net>
parents:
1229
diff
changeset
|
231 |
d4b251e78fc0
Break out download_functions.sh into their own file.
Rob Landley <rob@landley.net>
parents:
1229
diff
changeset
|
232 getversion() |
d4b251e78fc0
Break out download_functions.sh into their own file.
Rob Landley <rob@landley.net>
parents:
1229
diff
changeset
|
233 { |
d4b251e78fc0
Break out download_functions.sh into their own file.
Rob Landley <rob@landley.net>
parents:
1229
diff
changeset
|
234 echo "$1" | sed -e 's/.*-\(\([0-9\.]\)*\([_-]rc\)*\(-pre\)*\([0-9][a-zA-Z]\)*\)*\(\.tar\..z2*\)$/'"$2"'\1/' |
d4b251e78fc0
Break out download_functions.sh into their own file.
Rob Landley <rob@landley.net>
parents:
1229
diff
changeset
|
235 } |
d4b251e78fc0
Break out download_functions.sh into their own file.
Rob Landley <rob@landley.net>
parents:
1229
diff
changeset
|
236 |
464
99e039a4b8bc
Move README generation to functions.sh, clean up build-all-target.sh option parsing.
Rob Landley <rob@landley.net>
parents:
461
diff
changeset
|
237 # Figure out what version of a package we last built |
99e039a4b8bc
Move README generation to functions.sh, clean up build-all-target.sh option parsing.
Rob Landley <rob@landley.net>
parents:
461
diff
changeset
|
238 |
1081
e992bc65b048
Remove unnecessary "function" label from shell functions.
Rob Landley <rob@landley.net>
parents:
1067
diff
changeset
|
239 get_download_version() |
464
99e039a4b8bc
Move README generation to functions.sh, clean up build-all-target.sh option parsing.
Rob Landley <rob@landley.net>
parents:
461
diff
changeset
|
240 { |
724
3ccce25660f4
Make MANIFEST generation less brittle.
Rob Landley <rob@landley.net>
parents:
720
diff
changeset
|
241 getversion $(sed -n 's@URL=.*/\(.[^ ]*\).*@\1@p' "$TOP/download.sh" | grep ${1}-) |
464
99e039a4b8bc
Move README generation to functions.sh, clean up build-all-target.sh option parsing.
Rob Landley <rob@landley.net>
parents:
461
diff
changeset
|
242 } |
99e039a4b8bc
Move README generation to functions.sh, clean up build-all-target.sh option parsing.
Rob Landley <rob@landley.net>
parents:
461
diff
changeset
|
243 |
99e039a4b8bc
Move README generation to functions.sh, clean up build-all-target.sh option parsing.
Rob Landley <rob@landley.net>
parents:
461
diff
changeset
|
244 # Identify subversion or mercurial revision, or release number |
99e039a4b8bc
Move README generation to functions.sh, clean up build-all-target.sh option parsing.
Rob Landley <rob@landley.net>
parents:
461
diff
changeset
|
245 |
1081
e992bc65b048
Remove unnecessary "function" label from shell functions.
Rob Landley <rob@landley.net>
parents:
1067
diff
changeset
|
246 identify_release() |
464
99e039a4b8bc
Move README generation to functions.sh, clean up build-all-target.sh option parsing.
Rob Landley <rob@landley.net>
parents:
461
diff
changeset
|
247 { |
1082
255488af0bbb
Convert unstable() to is_in_list() taking the list to check as the second argument.
Rob Landley <rob@landley.net>
parents:
1081
diff
changeset
|
248 if is_in_list "$1" $USE_UNSTABLE |
464
99e039a4b8bc
Move README generation to functions.sh, clean up build-all-target.sh option parsing.
Rob Landley <rob@landley.net>
parents:
461
diff
changeset
|
249 then |
767
dc19e20734ca
Use the git magic tarball comment field to get the version number of unstable git packages for MANIFEST.
Rob Landley <rob@landley.net>
parents:
762
diff
changeset
|
250 for i in "b" "" |
dc19e20734ca
Use the git magic tarball comment field to get the version number of unstable git packages for MANIFEST.
Rob Landley <rob@landley.net>
parents:
762
diff
changeset
|
251 do |
dc19e20734ca
Use the git magic tarball comment field to get the version number of unstable git packages for MANIFEST.
Rob Landley <rob@landley.net>
parents:
762
diff
changeset
|
252 FILE="$(echo "$SRCDIR/alt-$1-"*.tar.$i*)" |
dc19e20734ca
Use the git magic tarball comment field to get the version number of unstable git packages for MANIFEST.
Rob Landley <rob@landley.net>
parents:
762
diff
changeset
|
253 if [ -f "$FILE" ] |
dc19e20734ca
Use the git magic tarball comment field to get the version number of unstable git packages for MANIFEST.
Rob Landley <rob@landley.net>
parents:
762
diff
changeset
|
254 then |
1102
5c9a877f3f32
Suppress error messages from manfiest generation.
Rob Landley <rob@landley.net>
parents:
1099
diff
changeset
|
255 GITID="$(${i}zcat "$FILE" 2> /dev/null | git get-tar-commit-id 2>/dev/null)" |
767
dc19e20734ca
Use the git magic tarball comment field to get the version number of unstable git packages for MANIFEST.
Rob Landley <rob@landley.net>
parents:
762
diff
changeset
|
256 if [ ! -z "$GITID" ] |
dc19e20734ca
Use the git magic tarball comment field to get the version number of unstable git packages for MANIFEST.
Rob Landley <rob@landley.net>
parents:
762
diff
changeset
|
257 then |
dc19e20734ca
Use the git magic tarball comment field to get the version number of unstable git packages for MANIFEST.
Rob Landley <rob@landley.net>
parents:
762
diff
changeset
|
258 # The first dozen chars should form a unique id. |
dc19e20734ca
Use the git magic tarball comment field to get the version number of unstable git packages for MANIFEST.
Rob Landley <rob@landley.net>
parents:
762
diff
changeset
|
259 |
dc19e20734ca
Use the git magic tarball comment field to get the version number of unstable git packages for MANIFEST.
Rob Landley <rob@landley.net>
parents:
762
diff
changeset
|
260 echo $GITID | sed 's/^\(................\).*/git \1/' |
dc19e20734ca
Use the git magic tarball comment field to get the version number of unstable git packages for MANIFEST.
Rob Landley <rob@landley.net>
parents:
762
diff
changeset
|
261 return |
dc19e20734ca
Use the git magic tarball comment field to get the version number of unstable git packages for MANIFEST.
Rob Landley <rob@landley.net>
parents:
762
diff
changeset
|
262 fi |
dc19e20734ca
Use the git magic tarball comment field to get the version number of unstable git packages for MANIFEST.
Rob Landley <rob@landley.net>
parents:
762
diff
changeset
|
263 fi |
dc19e20734ca
Use the git magic tarball comment field to get the version number of unstable git packages for MANIFEST.
Rob Landley <rob@landley.net>
parents:
762
diff
changeset
|
264 done |
dc19e20734ca
Use the git magic tarball comment field to get the version number of unstable git packages for MANIFEST.
Rob Landley <rob@landley.net>
parents:
762
diff
changeset
|
265 |
760
2537f30c2397
Improve version detection for MANIFEST file. Still doesn't detect version for git archive output because git hasn't got any equivalent of mercurial's .hg_archive.txt file.
Rob Landley <rob@landley.net>
parents:
744
diff
changeset
|
266 # Need to extract unstable packages to determine source control version. |
2537f30c2397
Improve version detection for MANIFEST file. Still doesn't detect version for git archive output because git hasn't got any equivalent of mercurial's .hg_archive.txt file.
Rob Landley <rob@landley.net>
parents:
744
diff
changeset
|
267 |
1184
aa8992b35e15
Make extract_package directly callable, and do so where necessary.
Rob Landley <rob@landley.net>
parents:
1183
diff
changeset
|
268 extract_package "$1" >&2 |
817
a6cb42614a1d
Rename build/sources to build/packages to reduce confusion (since sources/packages got moved up to just packages, and this contains the extracted contents of that). And use $SOURCES instead of $TOP/sources in a few places.
Rob Landley <rob@landley.net>
parents:
815
diff
changeset
|
269 DIR="${BUILD}/packages/alt-$1" |
760
2537f30c2397
Improve version detection for MANIFEST file. Still doesn't detect version for git archive output because git hasn't got any equivalent of mercurial's .hg_archive.txt file.
Rob Landley <rob@landley.net>
parents:
744
diff
changeset
|
270 |
2537f30c2397
Improve version detection for MANIFEST file. Still doesn't detect version for git archive output because git hasn't got any equivalent of mercurial's .hg_archive.txt file.
Rob Landley <rob@landley.net>
parents:
744
diff
changeset
|
271 if [ -d "$DIR/.svn" ] |
2537f30c2397
Improve version detection for MANIFEST file. Still doesn't detect version for git archive output because git hasn't got any equivalent of mercurial's .hg_archive.txt file.
Rob Landley <rob@landley.net>
parents:
744
diff
changeset
|
272 then |
2537f30c2397
Improve version detection for MANIFEST file. Still doesn't detect version for git archive output because git hasn't got any equivalent of mercurial's .hg_archive.txt file.
Rob Landley <rob@landley.net>
parents:
744
diff
changeset
|
273 ( cd "$DIR"; echo subversion rev \ |
2537f30c2397
Improve version detection for MANIFEST file. Still doesn't detect version for git archive output because git hasn't got any equivalent of mercurial's .hg_archive.txt file.
Rob Landley <rob@landley.net>
parents:
744
diff
changeset
|
274 $(svn info | sed -n "s/^Revision: //p") |
2537f30c2397
Improve version detection for MANIFEST file. Still doesn't detect version for git archive output because git hasn't got any equivalent of mercurial's .hg_archive.txt file.
Rob Landley <rob@landley.net>
parents:
744
diff
changeset
|
275 ) |
2537f30c2397
Improve version detection for MANIFEST file. Still doesn't detect version for git archive output because git hasn't got any equivalent of mercurial's .hg_archive.txt file.
Rob Landley <rob@landley.net>
parents:
744
diff
changeset
|
276 return 0 |
2537f30c2397
Improve version detection for MANIFEST file. Still doesn't detect version for git archive output because git hasn't got any equivalent of mercurial's .hg_archive.txt file.
Rob Landley <rob@landley.net>
parents:
744
diff
changeset
|
277 elif [ -d "$DIR/.hg" ] |
2537f30c2397
Improve version detection for MANIFEST file. Still doesn't detect version for git archive output because git hasn't got any equivalent of mercurial's .hg_archive.txt file.
Rob Landley <rob@landley.net>
parents:
744
diff
changeset
|
278 then |
2537f30c2397
Improve version detection for MANIFEST file. Still doesn't detect version for git archive output because git hasn't got any equivalent of mercurial's .hg_archive.txt file.
Rob Landley <rob@landley.net>
parents:
744
diff
changeset
|
279 ( echo mercurial rev \ |
2537f30c2397
Improve version detection for MANIFEST file. Still doesn't detect version for git archive output because git hasn't got any equivalent of mercurial's .hg_archive.txt file.
Rob Landley <rob@landley.net>
parents:
744
diff
changeset
|
280 $(hg tip | sed -n 's/changeset: *\([0-9]*\).*/\1/p') |
2537f30c2397
Improve version detection for MANIFEST file. Still doesn't detect version for git archive output because git hasn't got any equivalent of mercurial's .hg_archive.txt file.
Rob Landley <rob@landley.net>
parents:
744
diff
changeset
|
281 ) |
2537f30c2397
Improve version detection for MANIFEST file. Still doesn't detect version for git archive output because git hasn't got any equivalent of mercurial's .hg_archive.txt file.
Rob Landley <rob@landley.net>
parents:
744
diff
changeset
|
282 return 0 |
2537f30c2397
Improve version detection for MANIFEST file. Still doesn't detect version for git archive output because git hasn't got any equivalent of mercurial's .hg_archive.txt file.
Rob Landley <rob@landley.net>
parents:
744
diff
changeset
|
283 fi |
464
99e039a4b8bc
Move README generation to functions.sh, clean up build-all-target.sh option parsing.
Rob Landley <rob@landley.net>
parents:
461
diff
changeset
|
284 fi |
760
2537f30c2397
Improve version detection for MANIFEST file. Still doesn't detect version for git archive output because git hasn't got any equivalent of mercurial's .hg_archive.txt file.
Rob Landley <rob@landley.net>
parents:
744
diff
changeset
|
285 |
2537f30c2397
Improve version detection for MANIFEST file. Still doesn't detect version for git archive output because git hasn't got any equivalent of mercurial's .hg_archive.txt file.
Rob Landley <rob@landley.net>
parents:
744
diff
changeset
|
286 echo release version $(get_download_version $1) |
464
99e039a4b8bc
Move README generation to functions.sh, clean up build-all-target.sh option parsing.
Rob Landley <rob@landley.net>
parents:
461
diff
changeset
|
287 } |
99e039a4b8bc
Move README generation to functions.sh, clean up build-all-target.sh option parsing.
Rob Landley <rob@landley.net>
parents:
461
diff
changeset
|
288 |
99e039a4b8bc
Move README generation to functions.sh, clean up build-all-target.sh option parsing.
Rob Landley <rob@landley.net>
parents:
461
diff
changeset
|
289 # Create a README identifying package versions in current build. |
99e039a4b8bc
Move README generation to functions.sh, clean up build-all-target.sh option parsing.
Rob Landley <rob@landley.net>
parents:
461
diff
changeset
|
290 |
1390
ac60cab45463
Remove FWL debris and rename do_rename to do_manifest while we're at it. (Based on prompting from Alessio Bogani).
Rob Landley <rob@landley.net>
parents:
1389
diff
changeset
|
291 do_manifest() |
464
99e039a4b8bc
Move README generation to functions.sh, clean up build-all-target.sh option parsing.
Rob Landley <rob@landley.net>
parents:
461
diff
changeset
|
292 { |
1390
ac60cab45463
Remove FWL debris and rename do_rename to do_manifest while we're at it. (Based on prompting from Alessio Bogani).
Rob Landley <rob@landley.net>
parents:
1389
diff
changeset
|
293 # Grab build script version number |
464
99e039a4b8bc
Move README generation to functions.sh, clean up build-all-target.sh option parsing.
Rob Landley <rob@landley.net>
parents:
461
diff
changeset
|
294 |
1390
ac60cab45463
Remove FWL debris and rename do_rename to do_manifest while we're at it. (Based on prompting from Alessio Bogani).
Rob Landley <rob@landley.net>
parents:
1389
diff
changeset
|
295 [ -z "$SCRIPT_VERS" ] && |
ac60cab45463
Remove FWL debris and rename do_rename to do_manifest while we're at it. (Based on prompting from Alessio Bogani).
Rob Landley <rob@landley.net>
parents:
1389
diff
changeset
|
296 SCRIPT_VERS="mercurial rev $(cd "$TOP"; hg tip 2>/dev/null | sed -n 's/changeset: *\([0-9]*\).*/\1/p')" |
662
1fa9eb882e3b
Allow FWL revision number to be overridden in MANIFEST (for releases).
Rob Landley <rob@landley.net>
parents:
647
diff
changeset
|
297 |
464
99e039a4b8bc
Move README generation to functions.sh, clean up build-all-target.sh option parsing.
Rob Landley <rob@landley.net>
parents:
461
diff
changeset
|
298 cat << EOF |
662
1fa9eb882e3b
Allow FWL revision number to be overridden in MANIFEST (for releases).
Rob Landley <rob@landley.net>
parents:
647
diff
changeset
|
299 Built on $(date +%F) from: |
464
99e039a4b8bc
Move README generation to functions.sh, clean up build-all-target.sh option parsing.
Rob Landley <rob@landley.net>
parents:
461
diff
changeset
|
300 |
99e039a4b8bc
Move README generation to functions.sh, clean up build-all-target.sh option parsing.
Rob Landley <rob@landley.net>
parents:
461
diff
changeset
|
301 Build script: |
1390
ac60cab45463
Remove FWL debris and rename do_rename to do_manifest while we're at it. (Based on prompting from Alessio Bogani).
Rob Landley <rob@landley.net>
parents:
1389
diff
changeset
|
302 Aboriginal Linux (http://landley.net/aboriginal) $SCRIPT_VERS |
464
99e039a4b8bc
Move README generation to functions.sh, clean up build-all-target.sh option parsing.
Rob Landley <rob@landley.net>
parents:
461
diff
changeset
|
303 |
99e039a4b8bc
Move README generation to functions.sh, clean up build-all-target.sh option parsing.
Rob Landley <rob@landley.net>
parents:
461
diff
changeset
|
304 Base packages: |
99e039a4b8bc
Move README generation to functions.sh, clean up build-all-target.sh option parsing.
Rob Landley <rob@landley.net>
parents:
461
diff
changeset
|
305 uClibc (http://uclibc.org) $(identify_release uClibc) |
99e039a4b8bc
Move README generation to functions.sh, clean up build-all-target.sh option parsing.
Rob Landley <rob@landley.net>
parents:
461
diff
changeset
|
306 BusyBox (http://busybox.net) $(identify_release busybox) |
99e039a4b8bc
Move README generation to functions.sh, clean up build-all-target.sh option parsing.
Rob Landley <rob@landley.net>
parents:
461
diff
changeset
|
307 Linux (http://kernel.org/pub/linux/kernel) $(identify_release linux) |
99e039a4b8bc
Move README generation to functions.sh, clean up build-all-target.sh option parsing.
Rob Landley <rob@landley.net>
parents:
461
diff
changeset
|
308 |
99e039a4b8bc
Move README generation to functions.sh, clean up build-all-target.sh option parsing.
Rob Landley <rob@landley.net>
parents:
461
diff
changeset
|
309 Toolchain packages: |
915
a541c5a96ff3
Don't actually replace cross-compiler with cross-static, when you build both use $PATH to select which one to use.
Rob Landley <rob@landley.net>
parents:
904
diff
changeset
|
310 Binutils (http://www.gnu.org/software/binutils/) $(identify_release binutils) |
464
99e039a4b8bc
Move README generation to functions.sh, clean up build-all-target.sh option parsing.
Rob Landley <rob@landley.net>
parents:
461
diff
changeset
|
311 GCC (http://gcc.gnu.org) $(identify_release gcc-core) |
99e039a4b8bc
Move README generation to functions.sh, clean up build-all-target.sh option parsing.
Rob Landley <rob@landley.net>
parents:
461
diff
changeset
|
312 gmake (http://www.gnu.org/software/make) $(identify_release make) |
99e039a4b8bc
Move README generation to functions.sh, clean up build-all-target.sh option parsing.
Rob Landley <rob@landley.net>
parents:
461
diff
changeset
|
313 bash (ftp://ftp.gnu.org/gnu/bash) $(identify_release bash) |
99e039a4b8bc
Move README generation to functions.sh, clean up build-all-target.sh option parsing.
Rob Landley <rob@landley.net>
parents:
461
diff
changeset
|
314 |
99e039a4b8bc
Move README generation to functions.sh, clean up build-all-target.sh option parsing.
Rob Landley <rob@landley.net>
parents:
461
diff
changeset
|
315 Optional packages: |
99e039a4b8bc
Move README generation to functions.sh, clean up build-all-target.sh option parsing.
Rob Landley <rob@landley.net>
parents:
461
diff
changeset
|
316 distcc (http://distcc.samba.org) $(identify_release distcc) |
99e039a4b8bc
Move README generation to functions.sh, clean up build-all-target.sh option parsing.
Rob Landley <rob@landley.net>
parents:
461
diff
changeset
|
317 uClibc++ (http://cxx.uclibc.org) $(identify_release uClibc++) |
99e039a4b8bc
Move README generation to functions.sh, clean up build-all-target.sh option parsing.
Rob Landley <rob@landley.net>
parents:
461
diff
changeset
|
318 EOF |
99e039a4b8bc
Move README generation to functions.sh, clean up build-all-target.sh option parsing.
Rob Landley <rob@landley.net>
parents:
461
diff
changeset
|
319 } |
685
90ab1a1f4db5
Teach build not to rebuild base architecture toolchains. Factor out some common code while there.
Rob Landley <rob@landley.net>
parents:
683
diff
changeset
|
320 |
90ab1a1f4db5
Teach build not to rebuild base architecture toolchains. Factor out some common code while there.
Rob Landley <rob@landley.net>
parents:
683
diff
changeset
|
321 # When building with a base architecture, symlink to the base arch name. |
90ab1a1f4db5
Teach build not to rebuild base architecture toolchains. Factor out some common code while there.
Rob Landley <rob@landley.net>
parents:
683
diff
changeset
|
322 |
1081
e992bc65b048
Remove unnecessary "function" label from shell functions.
Rob Landley <rob@landley.net>
parents:
1067
diff
changeset
|
323 link_arch_name() |
685
90ab1a1f4db5
Teach build not to rebuild base architecture toolchains. Factor out some common code while there.
Rob Landley <rob@landley.net>
parents:
683
diff
changeset
|
324 { |
90ab1a1f4db5
Teach build not to rebuild base architecture toolchains. Factor out some common code while there.
Rob Landley <rob@landley.net>
parents:
683
diff
changeset
|
325 [ "$ARCH" == "$ARCH_NAME" ] && return 0 |
90ab1a1f4db5
Teach build not to rebuild base architecture toolchains. Factor out some common code while there.
Rob Landley <rob@landley.net>
parents:
683
diff
changeset
|
326 |
90ab1a1f4db5
Teach build not to rebuild base architecture toolchains. Factor out some common code while there.
Rob Landley <rob@landley.net>
parents:
683
diff
changeset
|
327 rm -rf "$BUILD/$2" && |
90ab1a1f4db5
Teach build not to rebuild base architecture toolchains. Factor out some common code while there.
Rob Landley <rob@landley.net>
parents:
683
diff
changeset
|
328 ln -s "$1" "$BUILD/$2" || dienow |
90ab1a1f4db5
Teach build not to rebuild base architecture toolchains. Factor out some common code while there.
Rob Landley <rob@landley.net>
parents:
683
diff
changeset
|
329 } |
90ab1a1f4db5
Teach build not to rebuild base architecture toolchains. Factor out some common code while there.
Rob Landley <rob@landley.net>
parents:
683
diff
changeset
|
330 |
90ab1a1f4db5
Teach build not to rebuild base architecture toolchains. Factor out some common code while there.
Rob Landley <rob@landley.net>
parents:
683
diff
changeset
|
331 # Check if this target has a base architecture that's already been built. |
915
a541c5a96ff3
Don't actually replace cross-compiler with cross-static, when you build both use $PATH to select which one to use.
Rob Landley <rob@landley.net>
parents:
904
diff
changeset
|
332 # If so, link to it and exit now. |
685
90ab1a1f4db5
Teach build not to rebuild base architecture toolchains. Factor out some common code while there.
Rob Landley <rob@landley.net>
parents:
683
diff
changeset
|
333 |
1081
e992bc65b048
Remove unnecessary "function" label from shell functions.
Rob Landley <rob@landley.net>
parents:
1067
diff
changeset
|
334 check_for_base_arch() |
685
90ab1a1f4db5
Teach build not to rebuild base architecture toolchains. Factor out some common code while there.
Rob Landley <rob@landley.net>
parents:
683
diff
changeset
|
335 { |
90ab1a1f4db5
Teach build not to rebuild base architecture toolchains. Factor out some common code while there.
Rob Landley <rob@landley.net>
parents:
683
diff
changeset
|
336 # If we're building something with a base architecture, symlink to actual |
90ab1a1f4db5
Teach build not to rebuild base architecture toolchains. Factor out some common code while there.
Rob Landley <rob@landley.net>
parents:
683
diff
changeset
|
337 # target. |
90ab1a1f4db5
Teach build not to rebuild base architecture toolchains. Factor out some common code while there.
Rob Landley <rob@landley.net>
parents:
683
diff
changeset
|
338 |
898
db0f536aee7c
Fix hw-target builds so prerequisites build if they don't already exist.
Rob Landley <rob@landley.net>
parents:
897
diff
changeset
|
339 if [ "$ARCH" != "$ARCH_NAME" ] |
685
90ab1a1f4db5
Teach build not to rebuild base architecture toolchains. Factor out some common code while there.
Rob Landley <rob@landley.net>
parents:
683
diff
changeset
|
340 then |
783
db06a8c1bfed
Lots of changes to move buildall.sh functionality into build.sh.
Rob Landley <rob@landley.net>
parents:
778
diff
changeset
|
341 link_arch_name $STAGE_NAME-{"$ARCH","$ARCH_NAME"} |
db06a8c1bfed
Lots of changes to move buildall.sh functionality into build.sh.
Rob Landley <rob@landley.net>
parents:
778
diff
changeset
|
342 [ -e $STAGE_NAME-"$ARCH".tar.bz2 ] && |
db06a8c1bfed
Lots of changes to move buildall.sh functionality into build.sh.
Rob Landley <rob@landley.net>
parents:
778
diff
changeset
|
343 link_arch_name $STAGE_NAME-{"$ARCH","$ARCH_NAME"}.tar.bz2 |
685
90ab1a1f4db5
Teach build not to rebuild base architecture toolchains. Factor out some common code while there.
Rob Landley <rob@landley.net>
parents:
683
diff
changeset
|
344 |
898
db0f536aee7c
Fix hw-target builds so prerequisites build if they don't already exist.
Rob Landley <rob@landley.net>
parents:
897
diff
changeset
|
345 if [ -e "$BUILD/$STAGE_NAME-$ARCH" ] |
db0f536aee7c
Fix hw-target builds so prerequisites build if they don't already exist.
Rob Landley <rob@landley.net>
parents:
897
diff
changeset
|
346 then |
1358
9252453c40d0
Combine set_titlebar and "echo ===" stuff into announce() function. Consistently output target/stage info, and yank redundant instances.
Rob Landley <rob@landley.net>
parents:
1253
diff
changeset
|
347 announce "Using existing ${STAGE_NAME}-$ARCH" |
898
db0f536aee7c
Fix hw-target builds so prerequisites build if they don't already exist.
Rob Landley <rob@landley.net>
parents:
897
diff
changeset
|
348 |
db0f536aee7c
Fix hw-target builds so prerequisites build if they don't already exist.
Rob Landley <rob@landley.net>
parents:
897
diff
changeset
|
349 return 1 |
db0f536aee7c
Fix hw-target builds so prerequisites build if they don't already exist.
Rob Landley <rob@landley.net>
parents:
897
diff
changeset
|
350 else |
db0f536aee7c
Fix hw-target builds so prerequisites build if they don't already exist.
Rob Landley <rob@landley.net>
parents:
897
diff
changeset
|
351 mkdir -p "$BUILD/$STAGE_NAME-$ARCH" || dienow |
db0f536aee7c
Fix hw-target builds so prerequisites build if they don't already exist.
Rob Landley <rob@landley.net>
parents:
897
diff
changeset
|
352 fi |
685
90ab1a1f4db5
Teach build not to rebuild base architecture toolchains. Factor out some common code while there.
Rob Landley <rob@landley.net>
parents:
683
diff
changeset
|
353 fi |
90ab1a1f4db5
Teach build not to rebuild base architecture toolchains. Factor out some common code while there.
Rob Landley <rob@landley.net>
parents:
683
diff
changeset
|
354 } |
90ab1a1f4db5
Teach build not to rebuild base architecture toolchains. Factor out some common code while there.
Rob Landley <rob@landley.net>
parents:
683
diff
changeset
|
355 |
1081
e992bc65b048
Remove unnecessary "function" label from shell functions.
Rob Landley <rob@landley.net>
parents:
1067
diff
changeset
|
356 create_stage_tarball() |
685
90ab1a1f4db5
Teach build not to rebuild base architecture toolchains. Factor out some common code while there.
Rob Landley <rob@landley.net>
parents:
683
diff
changeset
|
357 { |
1033
87b3a69ca71c
Delete empty build/temp-* directories when we're done with them.
Rob Landley <rob@landley.net>
parents:
1012
diff
changeset
|
358 # Remove the temporary directory, if empty |
87b3a69ca71c
Delete empty build/temp-* directories when we're done with them.
Rob Landley <rob@landley.net>
parents:
1012
diff
changeset
|
359 |
87b3a69ca71c
Delete empty build/temp-* directories when we're done with them.
Rob Landley <rob@landley.net>
parents:
1012
diff
changeset
|
360 rmdir "$WORK" 2>/dev/null |
87b3a69ca71c
Delete empty build/temp-* directories when we're done with them.
Rob Landley <rob@landley.net>
parents:
1012
diff
changeset
|
361 |
685
90ab1a1f4db5
Teach build not to rebuild base architecture toolchains. Factor out some common code while there.
Rob Landley <rob@landley.net>
parents:
683
diff
changeset
|
362 # Handle linking to base architecture if we just built a derivative target. |
90ab1a1f4db5
Teach build not to rebuild base architecture toolchains. Factor out some common code while there.
Rob Landley <rob@landley.net>
parents:
683
diff
changeset
|
363 |
90ab1a1f4db5
Teach build not to rebuild base architecture toolchains. Factor out some common code while there.
Rob Landley <rob@landley.net>
parents:
683
diff
changeset
|
364 cd "$BUILD" || dienow |
783
db06a8c1bfed
Lots of changes to move buildall.sh functionality into build.sh.
Rob Landley <rob@landley.net>
parents:
778
diff
changeset
|
365 link_arch_name $STAGE_NAME-{$ARCH,$ARCH_NAME} |
685
90ab1a1f4db5
Teach build not to rebuild base architecture toolchains. Factor out some common code while there.
Rob Landley <rob@landley.net>
parents:
683
diff
changeset
|
366 |
988
30e4bab11f9e
Rename SKIP_STAGE_TARBALLS to NO_STAGE_TARBALLS (for consistency), and make system-image.sh use it instead of doing it by hand.
Rob Landley <rob@landley.net>
parents:
984
diff
changeset
|
367 if [ -z "$NO_STAGE_TARBALLS" ] |
685
90ab1a1f4db5
Teach build not to rebuild base architecture toolchains. Factor out some common code while there.
Rob Landley <rob@landley.net>
parents:
683
diff
changeset
|
368 then |
783
db06a8c1bfed
Lots of changes to move buildall.sh functionality into build.sh.
Rob Landley <rob@landley.net>
parents:
778
diff
changeset
|
369 echo -n creating "$STAGE_NAME-${ARCH}".tar.bz2 |
685
90ab1a1f4db5
Teach build not to rebuild base architecture toolchains. Factor out some common code while there.
Rob Landley <rob@landley.net>
parents:
683
diff
changeset
|
370 |
783
db06a8c1bfed
Lots of changes to move buildall.sh functionality into build.sh.
Rob Landley <rob@landley.net>
parents:
778
diff
changeset
|
371 { tar cjvf "$STAGE_NAME-${ARCH}".tar.bz2 "$STAGE_NAME-${ARCH}" || dienow |
685
90ab1a1f4db5
Teach build not to rebuild base architecture toolchains. Factor out some common code while there.
Rob Landley <rob@landley.net>
parents:
683
diff
changeset
|
372 } | dotprogress |
90ab1a1f4db5
Teach build not to rebuild base architecture toolchains. Factor out some common code while there.
Rob Landley <rob@landley.net>
parents:
683
diff
changeset
|
373 |
783
db06a8c1bfed
Lots of changes to move buildall.sh functionality into build.sh.
Rob Landley <rob@landley.net>
parents:
778
diff
changeset
|
374 link_arch_name $STAGE_NAME-{$ARCH,$ARCH_NAME}.tar.bz2 |
685
90ab1a1f4db5
Teach build not to rebuild base architecture toolchains. Factor out some common code while there.
Rob Landley <rob@landley.net>
parents:
683
diff
changeset
|
375 fi |
90ab1a1f4db5
Teach build not to rebuild base architecture toolchains. Factor out some common code while there.
Rob Landley <rob@landley.net>
parents:
683
diff
changeset
|
376 } |
776
37c083cca810
Move doforklog to sources/functions.sh.
Rob Landley <rob@landley.net>
parents:
773
diff
changeset
|
377 |
796
5f793a1ca658
Teach host-tools.sh to create multiple symlinks in fallback directories for ccache and distcc.
Rob Landley <rob@landley.net>
parents:
787
diff
changeset
|
378 # Create colon-separated path for $HOSTTOOLS and all fallback directories |
5f793a1ca658
Teach host-tools.sh to create multiple symlinks in fallback directories for ccache and distcc.
Rob Landley <rob@landley.net>
parents:
787
diff
changeset
|
379 # (Fallback directories are to support ccache and distcc on the host.) |
5f793a1ca658
Teach host-tools.sh to create multiple symlinks in fallback directories for ccache and distcc.
Rob Landley <rob@landley.net>
parents:
787
diff
changeset
|
380 |
1081
e992bc65b048
Remove unnecessary "function" label from shell functions.
Rob Landley <rob@landley.net>
parents:
1067
diff
changeset
|
381 hosttools_path() |
796
5f793a1ca658
Teach host-tools.sh to create multiple symlinks in fallback directories for ccache and distcc.
Rob Landley <rob@landley.net>
parents:
787
diff
changeset
|
382 { |
5f793a1ca658
Teach host-tools.sh to create multiple symlinks in fallback directories for ccache and distcc.
Rob Landley <rob@landley.net>
parents:
787
diff
changeset
|
383 local X |
5f793a1ca658
Teach host-tools.sh to create multiple symlinks in fallback directories for ccache and distcc.
Rob Landley <rob@landley.net>
parents:
787
diff
changeset
|
384 |
5f793a1ca658
Teach host-tools.sh to create multiple symlinks in fallback directories for ccache and distcc.
Rob Landley <rob@landley.net>
parents:
787
diff
changeset
|
385 echo -n "$HOSTTOOLS" |
5f793a1ca658
Teach host-tools.sh to create multiple symlinks in fallback directories for ccache and distcc.
Rob Landley <rob@landley.net>
parents:
787
diff
changeset
|
386 X=1 |
5f793a1ca658
Teach host-tools.sh to create multiple symlinks in fallback directories for ccache and distcc.
Rob Landley <rob@landley.net>
parents:
787
diff
changeset
|
387 while [ -e "$HOSTTOOLS/fallback-$X" ] |
5f793a1ca658
Teach host-tools.sh to create multiple symlinks in fallback directories for ccache and distcc.
Rob Landley <rob@landley.net>
parents:
787
diff
changeset
|
388 do |
5f793a1ca658
Teach host-tools.sh to create multiple symlinks in fallback directories for ccache and distcc.
Rob Landley <rob@landley.net>
parents:
787
diff
changeset
|
389 echo -n ":$HOSTTOOLS/fallback-$X" |
5f793a1ca658
Teach host-tools.sh to create multiple symlinks in fallback directories for ccache and distcc.
Rob Landley <rob@landley.net>
parents:
787
diff
changeset
|
390 X=$[$X+1] |
5f793a1ca658
Teach host-tools.sh to create multiple symlinks in fallback directories for ccache and distcc.
Rob Landley <rob@landley.net>
parents:
787
diff
changeset
|
391 done |
5f793a1ca658
Teach host-tools.sh to create multiple symlinks in fallback directories for ccache and distcc.
Rob Landley <rob@landley.net>
parents:
787
diff
changeset
|
392 } |