Mercurial > hg > aboriginal
annotate sources/functions.sh @ 1461:ad5303b6d35a
Switch USE_UNSTABLE to USE_ALT and download.sh's UNSTABLE= to ALT= so naming is consistent with the alt- prefixes on packages and patches.
author | Rob Landley <rob@landley.net> |
---|---|
date | Thu, 20 Oct 2011 02:07:10 -0500 |
parents | f1d2afdf2034 |
children | a246e0b13639 |
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 |
1401
f1d2afdf2034
Add base_architecture, make base architectures and extra targets work, and move i586 virtio stuff to new i686-kvm target.
Rob Landley <rob@landley.net>
parents:
1400
diff
changeset
|
20 base_architecture() |
f1d2afdf2034
Add base_architecture, make base architectures and extra targets work, and move i586 virtio stuff to new i686-kvm target.
Rob Landley <rob@landley.net>
parents:
1400
diff
changeset
|
21 { |
f1d2afdf2034
Add base_architecture, make base architectures and extra targets work, and move i586 virtio stuff to new i686-kvm target.
Rob Landley <rob@landley.net>
parents:
1400
diff
changeset
|
22 ARCH="$1" |
f1d2afdf2034
Add base_architecture, make base architectures and extra targets work, and move i586 virtio stuff to new i686-kvm target.
Rob Landley <rob@landley.net>
parents:
1400
diff
changeset
|
23 source "$CONFIG_DIR/$1" |
f1d2afdf2034
Add base_architecture, make base architectures and extra targets work, and move i586 virtio stuff to new i686-kvm target.
Rob Landley <rob@landley.net>
parents:
1400
diff
changeset
|
24 } |
f1d2afdf2034
Add base_architecture, make base architectures and extra targets work, and move i586 virtio stuff to new i686-kvm target.
Rob Landley <rob@landley.net>
parents:
1400
diff
changeset
|
25 |
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
|
26 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
|
27 { |
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
|
28 # 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
|
29 |
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
|
30 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
|
31 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
|
32 |
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 # 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
|
34 |
1401
f1d2afdf2034
Add base_architecture, make base architectures and extra targets work, and move i586 virtio stuff to new i686-kvm target.
Rob Landley <rob@landley.net>
parents:
1400
diff
changeset
|
35 if [ -f "$CONFIG_DIR/$1" ] |
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
|
36 then |
1401
f1d2afdf2034
Add base_architecture, make base architectures and extra targets work, and move i586 virtio stuff to new i686-kvm target.
Rob Landley <rob@landley.net>
parents:
1400
diff
changeset
|
37 base_architecture "$ARCH_NAME" |
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
|
38 CONFIG_DIR= |
1401
f1d2afdf2034
Add base_architecture, make base architectures and extra targets work, and move i586 virtio stuff to new i686-kvm target.
Rob Landley <rob@landley.net>
parents:
1400
diff
changeset
|
39 elif [ -f "$CONFIG_DIR/$1/settings" ] |
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
|
40 then |
1401
f1d2afdf2034
Add base_architecture, make base architectures and extra targets work, and move i586 virtio stuff to new i686-kvm target.
Rob Landley <rob@landley.net>
parents:
1400
diff
changeset
|
41 source "$CONFIG_DIR/$1/settings" |
f1d2afdf2034
Add base_architecture, make base architectures and extra targets work, and move i586 virtio stuff to new i686-kvm target.
Rob Landley <rob@landley.net>
parents:
1400
diff
changeset
|
42 [ -z "$ARCH" ] && dienow "No base_architecture" |
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
|
43 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
|
44 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
|
45 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
|
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 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
|
48 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
|
49 |
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 # 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
|
51 |
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 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
|
53 |
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 # 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
|
55 # 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
|
56 # 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
|
57 # 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
|
58 # wrong libc.) |
984
9840847885e8
Add export_if_blank and make lots of build paths overrideable.
Rob Landley <rob@landley.net>
parents:
973
diff
changeset
|
59 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
|
60 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
|
61 |
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
|
62 # 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
|
63 |
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
|
64 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
|
65 |
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
|
66 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
|
67 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
|
68 |
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
|
69 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
|
70 [ ! -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
|
71 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
|
72 |
944
fc134a13357e
Largeish refactoring and cleanup of compiler build:
Rob Landley <rob@landley.net>
parents:
942
diff
changeset
|
73 DO_CROSS="CROSS_COMPILE=${ARCH}-" |
798
2c9f22daa8fe
Allow target settings to specify BUILD_STATIC.
Rob Landley <rob@landley.net>
parents:
796
diff
changeset
|
74 |
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
|
75 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
|
76 } |
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
|
77 |
820
d1a88d878e18
Factor out and unify binutils, gcc, and ccwrap builds.
Rob Landley <rob@landley.net>
parents:
818
diff
changeset
|
78 # 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
|
79 # 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
|
80 |
1081
e992bc65b048
Remove unnecessary "function" label from shell functions.
Rob Landley <rob@landley.net>
parents:
1067
diff
changeset
|
81 build_section() |
820
d1a88d878e18
Factor out and unify binutils, gcc, and ccwrap builds.
Rob Landley <rob@landley.net>
parents:
818
diff
changeset
|
82 { |
1084
b52ba5df878d
Don't build anything statically in host-tools.sh, glibc is broken.
Rob Landley <rob@landley.net>
parents:
1083
diff
changeset
|
83 # 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
|
84 # 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
|
85 # 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
|
86 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
|
87 |
1200
8651437b2b44
Add DEBUG_PACKAGE config variable to build just one package with CPUS=1.
Rob Landley <rob@landley.net>
parents:
1184
diff
changeset
|
88 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
|
89 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
|
90 |
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
|
91 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
|
92 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
|
93 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
|
94 . "$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
|
95 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
|
96 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
|
97 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
|
98 . "$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
|
99 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
|
100 CPUS=$OLDCPUS |
820
d1a88d878e18
Factor out and unify binutils, gcc, and ccwrap builds.
Rob Landley <rob@landley.net>
parents:
818
diff
changeset
|
101 } |
d1a88d878e18
Factor out and unify binutils, gcc, and ccwrap builds.
Rob Landley <rob@landley.net>
parents:
818
diff
changeset
|
102 |
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 # 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
|
104 |
1081
e992bc65b048
Remove unnecessary "function" label from shell functions.
Rob Landley <rob@landley.net>
parents:
1067
diff
changeset
|
105 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
|
106 { |
1461
ad5303b6d35a
Switch USE_UNSTABLE to USE_ALT and download.sh's UNSTABLE= to ALT= so naming is consistent with the alt- prefixes on packages and patches.
Rob Landley <rob@landley.net>
parents:
1401
diff
changeset
|
107 for i in $(is_in_list $1 $USE_ALT && 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
|
108 {$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
|
109 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
|
110 [ -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
|
111 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
|
112 |
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
|
113 # 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
|
114 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
|
115 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
|
116 } |
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
|
117 |
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 # 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
|
119 |
1081
e992bc65b048
Remove unnecessary "function" label from shell functions.
Rob Landley <rob@landley.net>
parents:
1067
diff
changeset
|
120 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
|
121 { |
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 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
|
123 (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
|
124 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
|
125 | 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
|
126 ) | 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
|
127 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
|
128 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
|
129 |
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 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
|
131 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
|
132 # 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
|
133 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
|
134 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
|
135 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
|
136 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
|
137 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
|
138 } |
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
|
139 |
1253
d4b251e78fc0
Break out download_functions.sh into their own file.
Rob Landley <rob@landley.net>
parents:
1229
diff
changeset
|
140 # 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
|
141 |
1081
e992bc65b048
Remove unnecessary "function" label from shell functions.
Rob Landley <rob@landley.net>
parents:
1067
diff
changeset
|
142 cleanup() |
428
c88e25996320
Split function definitions out from include.sh.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
143 { |
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
|
144 # 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
|
145 |
c88e25996320
Split function definitions out from include.sh.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
146 [ $? -ne 0 ] && dienow |
c88e25996320
Split function definitions out from include.sh.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
147 |
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
|
148 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
|
149 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
|
150 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
|
151 [ ! -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
|
152 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
|
153 { 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
|
154 "$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
|
155 } | 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
|
156 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
|
157 |
567
5619a7375b74
Add NO_CLEANUP option to config.
Rob Landley <rob@landley.net>
parents:
534
diff
changeset
|
158 if [ ! -z "$NO_CLEANUP" ] |
5619a7375b74
Add NO_CLEANUP option to config.
Rob Landley <rob@landley.net>
parents:
534
diff
changeset
|
159 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
|
160 echo "skip cleanup $PACKAGE $@" |
567
5619a7375b74
Add NO_CLEANUP option to config.
Rob Landley <rob@landley.net>
parents:
534
diff
changeset
|
161 return |
5619a7375b74
Add NO_CLEANUP option to config.
Rob Landley <rob@landley.net>
parents:
534
diff
changeset
|
162 fi |
5619a7375b74
Add NO_CLEANUP option to config.
Rob Landley <rob@landley.net>
parents:
534
diff
changeset
|
163 |
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
|
164 # 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
|
165 |
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
|
166 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
|
167 for i in $WORKDIR_LIST |
428
c88e25996320
Split function definitions out from include.sh.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
168 do |
c88e25996320
Split function definitions out from include.sh.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
169 echo "cleanup $i" |
c88e25996320
Split function definitions out from include.sh.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
170 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
|
171 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
|
172 WORKDIR_LIST= |
428
c88e25996320
Split function definitions out from include.sh.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
173 } |
c88e25996320
Split function definitions out from include.sh.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
174 |
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
|
175 # 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
|
176 # 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
|
177 |
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 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
|
179 { |
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 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
|
181 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
|
182 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
|
183 } |
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
|
184 |
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
|
185 # Extract package $1 |
428
c88e25996320
Split function definitions out from include.sh.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
186 |
1081
e992bc65b048
Remove unnecessary "function" label from shell functions.
Rob Landley <rob@landley.net>
parents:
1067
diff
changeset
|
187 setupfor() |
428
c88e25996320
Split function definitions out from include.sh.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
188 { |
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
|
189 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
|
190 |
c88e25996320
Split function definitions out from include.sh.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
191 # 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
|
192 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
|
193 |
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
|
194 # 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
|
195 # 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
|
196 |
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
|
197 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
|
198 |
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 if [ -z "$REUSE_CURSRC" ] |
428
c88e25996320
Split function definitions out from include.sh.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
200 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
|
201 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
|
202 CURSRC="$(pwd)" |
428
c88e25996320
Split function definitions out from include.sh.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
203 fi |
c88e25996320
Split function definitions out from include.sh.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
204 |
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
|
205 [ -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
|
206 cp -${LINKTYPE}fR "$SRCTREE/$PACKAGE/"* "$CURSRC" |
428
c88e25996320
Split function definitions out from include.sh.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
207 |
1158 | 208 if [ $? -ne 0 ] |
209 then | |
210 echo "$PACKAGE not found. Did you run download.sh?" >&2 | |
211 dienow | |
212 fi | |
428
c88e25996320
Split function definitions out from include.sh.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
213 |
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
|
214 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
|
215 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
|
216 |
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
|
217 # 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
|
218 # 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
|
219 # 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
|
220 |
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 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
|
222 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
|
223 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
|
224 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
|
225 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
|
226 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
|
227 [ $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
|
228 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
|
229 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
|
230 fi |
428
c88e25996320
Split function definitions out from include.sh.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
231 } |
440
59fe5a276991
Add getversion() and wait4background(), useful to build wrappers.
Rob Landley <rob@landley.net>
parents:
436
diff
changeset
|
232 |
1253
d4b251e78fc0
Break out download_functions.sh into their own file.
Rob Landley <rob@landley.net>
parents:
1229
diff
changeset
|
233 # 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
|
234 |
d4b251e78fc0
Break out download_functions.sh into their own file.
Rob Landley <rob@landley.net>
parents:
1229
diff
changeset
|
235 getversion() |
d4b251e78fc0
Break out download_functions.sh into their own file.
Rob Landley <rob@landley.net>
parents:
1229
diff
changeset
|
236 { |
d4b251e78fc0
Break out download_functions.sh into their own file.
Rob Landley <rob@landley.net>
parents:
1229
diff
changeset
|
237 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
|
238 } |
d4b251e78fc0
Break out download_functions.sh into their own file.
Rob Landley <rob@landley.net>
parents:
1229
diff
changeset
|
239 |
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 # 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
|
241 |
1081
e992bc65b048
Remove unnecessary "function" label from shell functions.
Rob Landley <rob@landley.net>
parents:
1067
diff
changeset
|
242 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
|
243 { |
724
3ccce25660f4
Make MANIFEST generation less brittle.
Rob Landley <rob@landley.net>
parents:
720
diff
changeset
|
244 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
|
245 } |
99e039a4b8bc
Move README generation to functions.sh, clean up build-all-target.sh option parsing.
Rob Landley <rob@landley.net>
parents:
461
diff
changeset
|
246 |
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 # 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
|
248 |
1081
e992bc65b048
Remove unnecessary "function" label from shell functions.
Rob Landley <rob@landley.net>
parents:
1067
diff
changeset
|
249 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
|
250 { |
1461
ad5303b6d35a
Switch USE_UNSTABLE to USE_ALT and download.sh's UNSTABLE= to ALT= so naming is consistent with the alt- prefixes on packages and patches.
Rob Landley <rob@landley.net>
parents:
1401
diff
changeset
|
251 if is_in_list "$1" $USE_ALT |
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
|
252 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
|
253 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
|
254 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
|
255 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
|
256 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
|
257 then |
1102
5c9a877f3f32
Suppress error messages from manfiest generation.
Rob Landley <rob@landley.net>
parents:
1099
diff
changeset
|
258 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
|
259 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
|
260 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
|
261 # 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
|
262 |
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 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
|
264 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
|
265 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
|
266 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
|
267 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
|
268 |
1461
ad5303b6d35a
Switch USE_UNSTABLE to USE_ALT and download.sh's UNSTABLE= to ALT= so naming is consistent with the alt- prefixes on packages and patches.
Rob Landley <rob@landley.net>
parents:
1401
diff
changeset
|
269 # Need to extract alt packages to determine source control version. |
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 |
1184
aa8992b35e15
Make extract_package directly callable, and do so where necessary.
Rob Landley <rob@landley.net>
parents:
1183
diff
changeset
|
271 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
|
272 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
|
273 |
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 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
|
275 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
|
276 ( 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
|
277 $(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
|
278 ) |
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 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
|
280 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
|
281 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
|
282 ( 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
|
283 $(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
|
284 ) |
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 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
|
286 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
|
287 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
|
288 |
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
|
289 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
|
290 } |
99e039a4b8bc
Move README generation to functions.sh, clean up build-all-target.sh option parsing.
Rob Landley <rob@landley.net>
parents:
461
diff
changeset
|
291 |
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 # 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
|
293 |
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
|
294 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
|
295 { |
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
|
296 # 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
|
297 |
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
|
298 [ -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
|
299 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
|
300 |
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
|
301 cat << EOF |
662
1fa9eb882e3b
Allow FWL revision number to be overridden in MANIFEST (for releases).
Rob Landley <rob@landley.net>
parents:
647
diff
changeset
|
302 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
|
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 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
|
305 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
|
306 |
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 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
|
308 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
|
309 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
|
310 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
|
311 |
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 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
|
313 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
|
314 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
|
315 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
|
316 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
|
317 |
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 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
|
319 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
|
320 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
|
321 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
|
322 } |
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
|
323 |
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 # 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
|
325 |
1081
e992bc65b048
Remove unnecessary "function" label from shell functions.
Rob Landley <rob@landley.net>
parents:
1067
diff
changeset
|
326 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
|
327 { |
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 [ "$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
|
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 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
|
331 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
|
332 } |
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 |
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
|
334 # 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
|
335 # 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
|
336 |
1081
e992bc65b048
Remove unnecessary "function" label from shell functions.
Rob Landley <rob@landley.net>
parents:
1067
diff
changeset
|
337 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
|
338 { |
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
|
339 # 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
|
340 # 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
|
341 |
898
db0f536aee7c
Fix hw-target builds so prerequisites build if they don't already exist.
Rob Landley <rob@landley.net>
parents:
897
diff
changeset
|
342 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
|
343 then |
783
db06a8c1bfed
Lots of changes to move buildall.sh functionality into build.sh.
Rob Landley <rob@landley.net>
parents:
778
diff
changeset
|
344 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
|
345 [ -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
|
346 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
|
347 |
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 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
|
349 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
|
350 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
|
351 |
db0f536aee7c
Fix hw-target builds so prerequisites build if they don't already exist.
Rob Landley <rob@landley.net>
parents:
897
diff
changeset
|
352 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
|
353 else |
db0f536aee7c
Fix hw-target builds so prerequisites build if they don't already exist.
Rob Landley <rob@landley.net>
parents:
897
diff
changeset
|
354 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
|
355 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
|
356 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
|
357 } |
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
|
358 |
1081
e992bc65b048
Remove unnecessary "function" label from shell functions.
Rob Landley <rob@landley.net>
parents:
1067
diff
changeset
|
359 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
|
360 { |
1033
87b3a69ca71c
Delete empty build/temp-* directories when we're done with them.
Rob Landley <rob@landley.net>
parents:
1012
diff
changeset
|
361 # 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
|
362 |
87b3a69ca71c
Delete empty build/temp-* directories when we're done with them.
Rob Landley <rob@landley.net>
parents:
1012
diff
changeset
|
363 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
|
364 |
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
|
365 # 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
|
366 |
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
|
367 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
|
368 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
|
369 |
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
|
370 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
|
371 then |
783
db06a8c1bfed
Lots of changes to move buildall.sh functionality into build.sh.
Rob Landley <rob@landley.net>
parents:
778
diff
changeset
|
372 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
|
373 |
783
db06a8c1bfed
Lots of changes to move buildall.sh functionality into build.sh.
Rob Landley <rob@landley.net>
parents:
778
diff
changeset
|
374 { 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
|
375 } | 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
|
376 |
783
db06a8c1bfed
Lots of changes to move buildall.sh functionality into build.sh.
Rob Landley <rob@landley.net>
parents:
778
diff
changeset
|
377 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
|
378 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
|
379 } |
776
37c083cca810
Move doforklog to sources/functions.sh.
Rob Landley <rob@landley.net>
parents:
773
diff
changeset
|
380 |
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
|
381 # 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
|
382 # (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
|
383 |
1081
e992bc65b048
Remove unnecessary "function" label from shell functions.
Rob Landley <rob@landley.net>
parents:
1067
diff
changeset
|
384 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
|
385 { |
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 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
|
387 |
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 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
|
389 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
|
390 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
|
391 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
|
392 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
|
393 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
|
394 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
|
395 } |