Mercurial > hg > aboriginal
annotate root-filesystem.sh @ 941:7dd3fb4dd333
Minor cleanups and comments, introduce check_prerequisite function.
author | Rob Landley <rob@landley.net> |
---|---|
date | Tue, 22 Dec 2009 11:51:52 -0600 |
parents | f2b4d7297c9d |
children | fc134a13357e |
rev | line source |
---|---|
177 | 1 #!/bin/bash |
43
6d16887ec084
Intermediate snapshot. Doesn't work yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
2 |
888 | 3 # Build a root filesystem for a given target. |
4 | |
669 | 5 source sources/include.sh || exit 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:
737
diff
changeset
|
6 read_arch_dir "$1" |
783
db06a8c1bfed
Lots of changes to move buildall.sh functionality into build.sh.
Rob Landley <rob@landley.net>
parents:
782
diff
changeset
|
7 check_for_base_arch || exit 0 |
941
7dd3fb4dd333
Minor cleanups and comments, introduce check_prerequisite function.
Rob Landley <rob@landley.net>
parents:
937
diff
changeset
|
8 check_prerequisite "${ARCH}-cc" |
7dd3fb4dd333
Minor cleanups and comments, introduce check_prerequisite function.
Rob Landley <rob@landley.net>
parents:
937
diff
changeset
|
9 check_prerequisite "${FROM_ARCH}-cc" |
685
90ab1a1f4db5
Teach build not to rebuild base architecture toolchains. Factor out some common code while there.
Rob Landley <rob@landley.net>
parents:
675
diff
changeset
|
10 |
907
890aa372ee30
Remove old USE_COLOR code, superceded by set_titlebar.
Rob Landley <rob@landley.net>
parents:
906
diff
changeset
|
11 # Announce start of stage. |
890aa372ee30
Remove old USE_COLOR code, superceded by set_titlebar.
Rob Landley <rob@landley.net>
parents:
906
diff
changeset
|
12 |
890aa372ee30
Remove old USE_COLOR code, superceded by set_titlebar.
Rob Landley <rob@landley.net>
parents:
906
diff
changeset
|
13 echo "=== Building $STAGE_NAME" |
890aa372ee30
Remove old USE_COLOR code, superceded by set_titlebar.
Rob Landley <rob@landley.net>
parents:
906
diff
changeset
|
14 |
658
dc5512d734f0
Actually put MANIFEST into mini-native.
Rob Landley <rob@landley.net>
parents:
633
diff
changeset
|
15 # Determine which directory layout we're using |
dc5512d734f0
Actually put MANIFEST into mini-native.
Rob Landley <rob@landley.net>
parents:
633
diff
changeset
|
16 |
783
db06a8c1bfed
Lots of changes to move buildall.sh functionality into build.sh.
Rob Landley <rob@landley.net>
parents:
782
diff
changeset
|
17 if [ -z "$ROOT_NODIRS" ] |
331
d2820523ee06
When doing BUILD_SHORT (without development tools), use / instead of /tools.
Rob Landley <rob@landley.net>
parents:
326
diff
changeset
|
18 then |
783
db06a8c1bfed
Lots of changes to move buildall.sh functionality into build.sh.
Rob Landley <rob@landley.net>
parents:
782
diff
changeset
|
19 ROOT_TOPDIR="$STAGE_DIR/usr" |
882
d81382a8bb66
More stuff to make running a guest user potentially useful.
Rob Landley <rob@landley.net>
parents:
876
diff
changeset
|
20 mkdir -p "$STAGE_DIR"/{tmp,proc,sys,dev,home,mnt} && |
d81382a8bb66
More stuff to make running a guest user potentially useful.
Rob Landley <rob@landley.net>
parents:
876
diff
changeset
|
21 chmod a+rwxt "$STAGE_DIR/tmp" || dienow |
735
feec13d32dde
Squashfs needs an /etc/resolv.conf, not just /usr/etc/resolv.conf
Rob Landley <rob@landley.net>
parents:
726
diff
changeset
|
22 for i in bin sbin lib etc |
423
8029eb9a4a8c
Split out BUILD_NOTOOLS from BUILD_SHORT.
Rob Landley <rob@landley.net>
parents:
417
diff
changeset
|
23 do |
783
db06a8c1bfed
Lots of changes to move buildall.sh functionality into build.sh.
Rob Landley <rob@landley.net>
parents:
782
diff
changeset
|
24 mkdir -p "$ROOT_TOPDIR/$i" || dienow |
db06a8c1bfed
Lots of changes to move buildall.sh functionality into build.sh.
Rob Landley <rob@landley.net>
parents:
782
diff
changeset
|
25 ln -s "usr/$i" "$STAGE_DIR/$i" || dienow |
423
8029eb9a4a8c
Split out BUILD_NOTOOLS from BUILD_SHORT.
Rob Landley <rob@landley.net>
parents:
417
diff
changeset
|
26 done |
783
db06a8c1bfed
Lots of changes to move buildall.sh functionality into build.sh.
Rob Landley <rob@landley.net>
parents:
782
diff
changeset
|
27 else |
db06a8c1bfed
Lots of changes to move buildall.sh functionality into build.sh.
Rob Landley <rob@landley.net>
parents:
782
diff
changeset
|
28 ROOT_TOPDIR="$STAGE_DIR" |
db06a8c1bfed
Lots of changes to move buildall.sh functionality into build.sh.
Rob Landley <rob@landley.net>
parents:
782
diff
changeset
|
29 mkdir -p "$STAGE_DIR/bin" || dienow |
331
d2820523ee06
When doing BUILD_SHORT (without development tools), use / instead of /tools.
Rob Landley <rob@landley.net>
parents:
326
diff
changeset
|
30 fi |
395
c2b290c1df40
Upgrade BUILD_SHORT to make a small busybox+uClibc system in /usr, with top level symlinks (/bin, /lib, etc) and adjustments to boot script and run-emulator.
Rob Landley <rob@landley.net>
parents:
390
diff
changeset
|
31 |
837
f80c47e8991d
Abstract the C library away from uClibc, so when more build sections are added potentially (For glibc, eglibc, et cetera), nothing needs to be changed in the other files
Mark Miller <mark@mirell.org>
parents:
820
diff
changeset
|
32 # Build C Library |
533
b970ffb2eb4d
Work around problem with the make -j dependencies of uClibc.
Rob Landley <rob@landley.net>
parents:
530
diff
changeset
|
33 |
906
5e0cbc73da55
Split out linux-headers, uClibc, and uClibc++ as their own sections.
Rob Landley <rob@landley.net>
parents:
905
diff
changeset
|
34 STAGE_DIR="$ROOT_TOPDIR" build_section linux-headers |
5e0cbc73da55
Split out linux-headers, uClibc, and uClibc++ as their own sections.
Rob Landley <rob@landley.net>
parents:
905
diff
changeset
|
35 STAGE_DIR="$ROOT_TOPDIR" build_section uClibc |
50
5aeba79b8f5f
Remove qemu build (it's in cross-compiler.sh now), move uClibc build right
Rob Landley <rob@landley.net>
parents:
46
diff
changeset
|
36 |
598
5fa326c07bc4
Change NATIVE_TOOLCHAIN to work like all the other config variables: unset gives the default behavior.
Rob Landley <rob@landley.net>
parents:
597
diff
changeset
|
37 if [ "$NATIVE_TOOLCHAIN" == "none" ] |
496
3cebbc0b0723
Rename (invert) NATIVE_NOTOOLCHAIN and NATIVE_NOTOOLSDIR, and tweak colors again.
Rob Landley <rob@landley.net>
parents:
485
diff
changeset
|
38 then |
510
d6182f514567
A system without development headers doesn't need static libraries either.
Rob Landley <rob@landley.net>
parents:
503
diff
changeset
|
39 # If we're not installing a compiler, delete the headers, static libs, |
d6182f514567
A system without development headers doesn't need static libraries either.
Rob Landley <rob@landley.net>
parents:
503
diff
changeset
|
40 # and example source code. |
d6182f514567
A system without development headers doesn't need static libraries either.
Rob Landley <rob@landley.net>
parents:
503
diff
changeset
|
41 |
783
db06a8c1bfed
Lots of changes to move buildall.sh functionality into build.sh.
Rob Landley <rob@landley.net>
parents:
782
diff
changeset
|
42 rm -rf "$ROOT_TOPDIR"/include && |
941
7dd3fb4dd333
Minor cleanups and comments, introduce check_prerequisite function.
Rob Landley <rob@landley.net>
parents:
937
diff
changeset
|
43 rm -rf "$ROOT_TOPDIR"/lib/*.[ao] && |
783
db06a8c1bfed
Lots of changes to move buildall.sh functionality into build.sh.
Rob Landley <rob@landley.net>
parents:
782
diff
changeset
|
44 rm -rf "$ROOT_TOPDIR/src" || dienow |
496
3cebbc0b0723
Rename (invert) NATIVE_NOTOOLCHAIN and NATIVE_NOTOOLSDIR, and tweak colors again.
Rob Landley <rob@landley.net>
parents:
485
diff
changeset
|
45 |
3cebbc0b0723
Rename (invert) NATIVE_NOTOOLCHAIN and NATIVE_NOTOOLSDIR, and tweak colors again.
Rob Landley <rob@landley.net>
parents:
485
diff
changeset
|
46 elif [ "$NATIVE_TOOLCHAIN" == "headers" ] |
423
8029eb9a4a8c
Split out BUILD_NOTOOLS from BUILD_SHORT.
Rob Landley <rob@landley.net>
parents:
417
diff
changeset
|
47 then |
8029eb9a4a8c
Split out BUILD_NOTOOLS from BUILD_SHORT.
Rob Landley <rob@landley.net>
parents:
417
diff
changeset
|
48 |
496
3cebbc0b0723
Rename (invert) NATIVE_NOTOOLCHAIN and NATIVE_NOTOOLSDIR, and tweak colors again.
Rob Landley <rob@landley.net>
parents:
485
diff
changeset
|
49 # If you want to use a compiler other than gcc, you need to keep the headers, |
3cebbc0b0723
Rename (invert) NATIVE_NOTOOLCHAIN and NATIVE_NOTOOLSDIR, and tweak colors again.
Rob Landley <rob@landley.net>
parents:
485
diff
changeset
|
50 # so do nothing here. |
3cebbc0b0723
Rename (invert) NATIVE_NOTOOLCHAIN and NATIVE_NOTOOLSDIR, and tweak colors again.
Rob Landley <rob@landley.net>
parents:
485
diff
changeset
|
51 echo |
423
8029eb9a4a8c
Split out BUILD_NOTOOLS from BUILD_SHORT.
Rob Landley <rob@landley.net>
parents:
417
diff
changeset
|
52 |
310
3a1ae92d6f6a
Teach BUILD_SHORT to remove include files (saving ~5 megs), and move the
Rob Landley <rob@landley.net>
parents:
306
diff
changeset
|
53 else |
50
5aeba79b8f5f
Remove qemu build (it's in cross-compiler.sh now), move uClibc build right
Rob Landley <rob@landley.net>
parents:
46
diff
changeset
|
54 |
820
d1a88d878e18
Factor out and unify binutils, gcc, and ccwrap builds.
Rob Landley <rob@landley.net>
parents:
819
diff
changeset
|
55 # Build binutils, gcc, and ccwrap |
43
6d16887ec084
Intermediate snapshot. Doesn't work yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
56 |
905
023b577fb865
Break up sources/sections/binutils-gcc.sh into binutils, gcc, and ccwrap, plus more gcc->cc cleanup.
Rob Landley <rob@landley.net>
parents:
898
diff
changeset
|
57 STAGE_DIR="$ROOT_TOPDIR" build_section binutils |
023b577fb865
Break up sources/sections/binutils-gcc.sh into binutils, gcc, and ccwrap, plus more gcc->cc cleanup.
Rob Landley <rob@landley.net>
parents:
898
diff
changeset
|
58 STAGE_DIR="$ROOT_TOPDIR" build_section gcc |
023b577fb865
Break up sources/sections/binutils-gcc.sh into binutils, gcc, and ccwrap, plus more gcc->cc cleanup.
Rob Landley <rob@landley.net>
parents:
898
diff
changeset
|
59 STAGE_DIR="$ROOT_TOPDIR" build_section ccwrap |
43
6d16887ec084
Intermediate snapshot. Doesn't work yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
60 |
783
db06a8c1bfed
Lots of changes to move buildall.sh functionality into build.sh.
Rob Landley <rob@landley.net>
parents:
782
diff
changeset
|
61 # Tell future packages to link against the libraries in the new root filesystem, |
443
716b7af6d8c3
Build libsupc++.a in preparation for building uClibc++.
Rob Landley <rob@landley.net>
parents:
432
diff
changeset
|
62 # rather than the ones in the cross compiler directory. |
716b7af6d8c3
Build libsupc++.a in preparation for building uClibc++.
Rob Landley <rob@landley.net>
parents:
432
diff
changeset
|
63 |
937
f2b4d7297c9d
Largeish cleanup of ccwrap.c. Remove lots of uclibc-isms, put rawcc in tools/bin.
Rob Landley <rob@landley.net>
parents:
920
diff
changeset
|
64 export "$(echo $ARCH | sed 's/-/_/g')"_CCWRAP_TOPDIR="$ROOT_TOPDIR" |
443
716b7af6d8c3
Build libsupc++.a in preparation for building uClibc++.
Rob Landley <rob@landley.net>
parents:
432
diff
changeset
|
65 |
906
5e0cbc73da55
Split out linux-headers, uClibc, and uClibc++ as their own sections.
Rob Landley <rob@landley.net>
parents:
905
diff
changeset
|
66 STAGE_DIR="$ROOT_TOPDIR" build_section uClibc++ |
443
716b7af6d8c3
Build libsupc++.a in preparation for building uClibc++.
Rob Landley <rob@landley.net>
parents:
432
diff
changeset
|
67 |
713
9282f84b31a1
Add NATIVE_TOOLCHAIN=only, to build _just_ the native toolchain (sae set of packages as the cross compiler, only --enable-shared and with uClibc++).
Rob Landley <rob@landley.net>
parents:
711
diff
changeset
|
68 fi # End of NATIVE_TOOLCHAIN build |
9282f84b31a1
Add NATIVE_TOOLCHAIN=only, to build _just_ the native toolchain (sae set of packages as the cross compiler, only --enable-shared and with uClibc++).
Rob Landley <rob@landley.net>
parents:
711
diff
changeset
|
69 |
9282f84b31a1
Add NATIVE_TOOLCHAIN=only, to build _just_ the native toolchain (sae set of packages as the cross compiler, only --enable-shared and with uClibc++).
Rob Landley <rob@landley.net>
parents:
711
diff
changeset
|
70 if [ "$NATIVE_TOOLCHAIN" != "only" ] |
9282f84b31a1
Add NATIVE_TOOLCHAIN=only, to build _just_ the native toolchain (sae set of packages as the cross compiler, only --enable-shared and with uClibc++).
Rob Landley <rob@landley.net>
parents:
711
diff
changeset
|
71 then |
9282f84b31a1
Add NATIVE_TOOLCHAIN=only, to build _just_ the native toolchain (sae set of packages as the cross compiler, only --enable-shared and with uClibc++).
Rob Landley <rob@landley.net>
parents:
711
diff
changeset
|
72 |
9282f84b31a1
Add NATIVE_TOOLCHAIN=only, to build _just_ the native toolchain (sae set of packages as the cross compiler, only --enable-shared and with uClibc++).
Rob Landley <rob@landley.net>
parents:
711
diff
changeset
|
73 # Copy qemu setup script and so on. |
9282f84b31a1
Add NATIVE_TOOLCHAIN=only, to build _just_ the native toolchain (sae set of packages as the cross compiler, only --enable-shared and with uClibc++).
Rob Landley <rob@landley.net>
parents:
711
diff
changeset
|
74 |
783
db06a8c1bfed
Lots of changes to move buildall.sh functionality into build.sh.
Rob Landley <rob@landley.net>
parents:
782
diff
changeset
|
75 cp -r "${SOURCES}/native/." "$ROOT_TOPDIR/" && |
906
5e0cbc73da55
Split out linux-headers, uClibc, and uClibc++ as their own sections.
Rob Landley <rob@landley.net>
parents:
905
diff
changeset
|
76 cp "$SRCDIR"/MANIFEST "$ROOT_TOPDIR/src" || dienow |
713
9282f84b31a1
Add NATIVE_TOOLCHAIN=only, to build _just_ the native toolchain (sae set of packages as the cross compiler, only --enable-shared and with uClibc++).
Rob Landley <rob@landley.net>
parents:
711
diff
changeset
|
77 |
849
5dd1a99a0737
Factor out more common code: busybox and toybox builds.
Rob Landley <rob@landley.net>
parents:
838
diff
changeset
|
78 STAGE_DIR="$ROOT_TOPDIR"/bin build_section busybox |
5dd1a99a0737
Factor out more common code: busybox and toybox builds.
Rob Landley <rob@landley.net>
parents:
838
diff
changeset
|
79 cp "$WORK"/config-busybox "$ROOT_TOPDIR"/src || dienow |
713
9282f84b31a1
Add NATIVE_TOOLCHAIN=only, to build _just_ the native toolchain (sae set of packages as the cross compiler, only --enable-shared and with uClibc++).
Rob Landley <rob@landley.net>
parents:
711
diff
changeset
|
80 |
910
f1671488c740
Split busybox and toybox builds, update toybox and linux package versions.
Rob Landley <rob@landley.net>
parents:
907
diff
changeset
|
81 STAGE_DIR="$ROOT_TOPDIR"/bin build_section toybox |
f1671488c740
Split busybox and toybox builds, update toybox and linux package versions.
Rob Landley <rob@landley.net>
parents:
907
diff
changeset
|
82 |
52
6d6551a37687
Add make to mini-native (required one more option switched on in uClibc), add
Rob Landley <rob@landley.net>
parents:
51
diff
changeset
|
83 # Build and install make |
6d6551a37687
Add make to mini-native (required one more option switched on in uClibc), add
Rob Landley <rob@landley.net>
parents:
51
diff
changeset
|
84 |
6d6551a37687
Add make to mini-native (required one more option switched on in uClibc), add
Rob Landley <rob@landley.net>
parents:
51
diff
changeset
|
85 setupfor make |
794
81cf7ae7afce
Teach make, bash, and distcc to honor BUILD_STATIC=1.
Rob Landley <rob@landley.net>
parents:
783
diff
changeset
|
86 LDFLAGS="$STATIC_FLAGS $LDFLAGS" CC="${ARCH}-cc" ./configure \ |
81cf7ae7afce
Teach make, bash, and distcc to honor BUILD_STATIC=1.
Rob Landley <rob@landley.net>
parents:
783
diff
changeset
|
87 --prefix="$ROOT_TOPDIR" --build="${CROSS_HOST}" --host="${CROSS_TARGET}" && |
182
fc827ab6166f
Autodetect number of processors and feed appropriate -j to make.
Rob Landley <rob@landley.net>
parents:
177
diff
changeset
|
88 make -j $CPUS && |
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:
807
diff
changeset
|
89 make -j $CPUS install |
52
6d6551a37687
Add make to mini-native (required one more option switched on in uClibc), add
Rob Landley <rob@landley.net>
parents:
51
diff
changeset
|
90 |
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:
807
diff
changeset
|
91 cleanup |
52
6d6551a37687
Add make to mini-native (required one more option switched on in uClibc), add
Rob Landley <rob@landley.net>
parents:
51
diff
changeset
|
92 |
713
9282f84b31a1
Add NATIVE_TOOLCHAIN=only, to build _just_ the native toolchain (sae set of packages as the cross compiler, only --enable-shared and with uClibc++).
Rob Landley <rob@landley.net>
parents:
711
diff
changeset
|
93 # Build and install bash. (Yes, this is an old version. It's intentional.) |
52
6d6551a37687
Add make to mini-native (required one more option switched on in uClibc), add
Rob Landley <rob@landley.net>
parents:
51
diff
changeset
|
94 |
6d6551a37687
Add make to mini-native (required one more option switched on in uClibc), add
Rob Landley <rob@landley.net>
parents:
51
diff
changeset
|
95 setupfor bash |
713
9282f84b31a1
Add NATIVE_TOOLCHAIN=only, to build _just_ the native toolchain (sae set of packages as the cross compiler, only --enable-shared and with uClibc++).
Rob Landley <rob@landley.net>
parents:
711
diff
changeset
|
96 # Remove existing /bin/sh link (busybox) so the bash install doesn't get upset. |
783
db06a8c1bfed
Lots of changes to move buildall.sh functionality into build.sh.
Rob Landley <rob@landley.net>
parents:
782
diff
changeset
|
97 #rm "$ROOT_TOPDIR"/bin/sh |
52
6d6551a37687
Add make to mini-native (required one more option switched on in uClibc), add
Rob Landley <rob@landley.net>
parents:
51
diff
changeset
|
98 # wire around some tests ./configure can't run when cross-compiling. |
6d6551a37687
Add make to mini-native (required one more option switched on in uClibc), add
Rob Landley <rob@landley.net>
parents:
51
diff
changeset
|
99 cat > config.cache << EOF && |
6d6551a37687
Add make to mini-native (required one more option switched on in uClibc), add
Rob Landley <rob@landley.net>
parents:
51
diff
changeset
|
100 ac_cv_func_setvbuf_reversed=no |
6d6551a37687
Add make to mini-native (required one more option switched on in uClibc), add
Rob Landley <rob@landley.net>
parents:
51
diff
changeset
|
101 bash_cv_sys_named_pipes=yes |
6d6551a37687
Add make to mini-native (required one more option switched on in uClibc), add
Rob Landley <rob@landley.net>
parents:
51
diff
changeset
|
102 bash_cv_have_mbstate_t=yes |
66
57f77c25b39d
Hit uClibc build with a large rock so it stops inserting hardwired paths in
Rob Landley <rob@landley.net>
parents:
63
diff
changeset
|
103 bash_cv_getenv_redef=no |
52
6d6551a37687
Add make to mini-native (required one more option switched on in uClibc), add
Rob Landley <rob@landley.net>
parents:
51
diff
changeset
|
104 EOF |
794
81cf7ae7afce
Teach make, bash, and distcc to honor BUILD_STATIC=1.
Rob Landley <rob@landley.net>
parents:
783
diff
changeset
|
105 LDFLAGS="$STATIC_FLAGS $LDFLAGS" CC="${ARCH}-cc" RANLIB="${ARCH}-ranlib" \ |
81cf7ae7afce
Teach make, bash, and distcc to honor BUILD_STATIC=1.
Rob Landley <rob@landley.net>
parents:
783
diff
changeset
|
106 ./configure --prefix="$ROOT_TOPDIR" \ |
153
106f3875f606
The bash build continues to be stupid. Force RANLIB.
Rob Landley <rob@landley.net>
parents:
131
diff
changeset
|
107 --build="${CROSS_HOST}" --host="${CROSS_TARGET}" --cache-file=config.cache \ |
106f3875f606
The bash build continues to be stupid. Force RANLIB.
Rob Landley <rob@landley.net>
parents:
131
diff
changeset
|
108 --without-bash-malloc --disable-readline && |
183
d2a27709d3b6
Fixup the -j stuff to actually work. (typo in gcc, and uClibc can't use it.)
Rob Landley <rob@landley.net>
parents:
182
diff
changeset
|
109 # note: doesn't work with -j |
d2a27709d3b6
Fixup the -j stuff to actually work. (typo in gcc, and uClibc can't use it.)
Rob Landley <rob@landley.net>
parents:
182
diff
changeset
|
110 make && |
52
6d6551a37687
Add make to mini-native (required one more option switched on in uClibc), add
Rob Landley <rob@landley.net>
parents:
51
diff
changeset
|
111 make install && |
6d6551a37687
Add make to mini-native (required one more option switched on in uClibc), add
Rob Landley <rob@landley.net>
parents:
51
diff
changeset
|
112 # Make bash the default shell. |
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:
807
diff
changeset
|
113 ln -sf bash "$ROOT_TOPDIR/bin/sh" |
52
6d6551a37687
Add make to mini-native (required one more option switched on in uClibc), add
Rob Landley <rob@landley.net>
parents:
51
diff
changeset
|
114 |
815
8129df56091b
Extended setupfor/cleanup to create binary package tarballs if the configure option BINARY_PACKAGE_TARBALLS is set. These tarballs extract into the current directory and add all the changed files installed by this package build, so you can pick and choose when assembling your own filesystem.
Rob Landley <rob@landley.net>
parents:
807
diff
changeset
|
115 cleanup |
52
6d6551a37687
Add make to mini-native (required one more option switched on in uClibc), add
Rob Landley <rob@landley.net>
parents:
51
diff
changeset
|
116 |
280
00ee362817e1
Cross-compile a native distcc for target.
Rob Landley <rob@landley.net>
parents:
278
diff
changeset
|
117 setupfor distcc |
805
d6bf46d17ac5
Make sparc build a static version. (Yes, this involves rubbing the distcc ./configure's nose in something to avoid a gratuitous build break.) The result bots to a shell prompt! Which then has a bus error if you try to do an "ls -l" and freezes if you "echo *". Still, that's progress...
Rob Landley <rob@landley.net>
parents:
794
diff
changeset
|
118 rsync_cv_HAVE_C99_VSNPRINTF=yes \ |
794
81cf7ae7afce
Teach make, bash, and distcc to honor BUILD_STATIC=1.
Rob Landley <rob@landley.net>
parents:
783
diff
changeset
|
119 LDFLAGS="$STATIC_FLAGS $LDFLAGS" CC="${ARCH}-cc" ./configure \ |
81cf7ae7afce
Teach make, bash, and distcc to honor BUILD_STATIC=1.
Rob Landley <rob@landley.net>
parents:
783
diff
changeset
|
120 --host="${CROSS_TARGET}" --prefix="$ROOT_TOPDIR" \ |
613
518c8e257b3d
Fixes Mark Miller sent for distcc support.
Rob Landley <rob@landley.net>
parents:
598
diff
changeset
|
121 --with-included-popt --disable-Werror && |
293
cdd26f8acc35
Update to gcc 4.1.2->4.2.2. Still doesn't fix the internal compiler error
Rob Landley <rob@landley.net>
parents:
284
diff
changeset
|
122 make -j $CPUS && |
cdd26f8acc35
Update to gcc 4.1.2->4.2.2. Still doesn't fix the internal compiler error
Rob Landley <rob@landley.net>
parents:
284
diff
changeset
|
123 make -j $CPUS install && |
783
db06a8c1bfed
Lots of changes to move buildall.sh functionality into build.sh.
Rob Landley <rob@landley.net>
parents:
782
diff
changeset
|
124 mkdir -p "$ROOT_TOPDIR/distcc" || dienow |
484 | 125 |
126 for i in gcc cc g++ c++ | |
127 do | |
783
db06a8c1bfed
Lots of changes to move buildall.sh functionality into build.sh.
Rob Landley <rob@landley.net>
parents:
782
diff
changeset
|
128 ln -s ../bin/distcc "$ROOT_TOPDIR/distcc/$i" || dienow |
484 | 129 done |
280
00ee362817e1
Cross-compile a native distcc for target.
Rob Landley <rob@landley.net>
parents:
278
diff
changeset
|
130 |
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:
807
diff
changeset
|
131 cleanup |
280
00ee362817e1
Cross-compile a native distcc for target.
Rob Landley <rob@landley.net>
parents:
278
diff
changeset
|
132 |
83
8fb80545fe84
Move the "hello world" source into sources/toys. Build (in mini-native)
Rob Landley <rob@landley.net>
parents:
81
diff
changeset
|
133 # Put statically and dynamically linked hello world programs on there for |
315
7fe514d773b9
Install setup script even for BUILD_SHORT.
Rob Landley <rob@landley.net>
parents:
311
diff
changeset
|
134 # test purposes. |
83
8fb80545fe84
Move the "hello world" source into sources/toys. Build (in mini-native)
Rob Landley <rob@landley.net>
parents:
81
diff
changeset
|
135 |
920
a69213462fbe
If "$CCWRAP" is quoted it gets passed in as a blank argument when empty, confusing the compiler.
Rob Landley <rob@landley.net>
parents:
918
diff
changeset
|
136 "${ARCH}-cc" "${SOURCES}/toys/hello.c" -Os $CFLAGS -o "$ROOT_TOPDIR/bin/hello-dynamic" && |
a69213462fbe
If "$CCWRAP" is quoted it gets passed in as a blank argument when empty, confusing the compiler.
Rob Landley <rob@landley.net>
parents:
918
diff
changeset
|
137 "${ARCH}-cc" "${SOURCES}/toys/hello.c" -Os $CFLAGS -static -o "$ROOT_TOPDIR/bin/hello-static" |
83
8fb80545fe84
Move the "hello world" source into sources/toys. Build (in mini-native)
Rob Landley <rob@landley.net>
parents:
81
diff
changeset
|
138 |
8fb80545fe84
Move the "hello world" source into sources/toys. Build (in mini-native)
Rob Landley <rob@landley.net>
parents:
81
diff
changeset
|
139 [ $? -ne 0 ] && dienow |
8fb80545fe84
Move the "hello world" source into sources/toys. Build (in mini-native)
Rob Landley <rob@landley.net>
parents:
81
diff
changeset
|
140 |
713
9282f84b31a1
Add NATIVE_TOOLCHAIN=only, to build _just_ the native toolchain (sae set of packages as the cross compiler, only --enable-shared and with uClibc++).
Rob Landley <rob@landley.net>
parents:
711
diff
changeset
|
141 fi # End of NATIVE_TOOLCHAIN != only |
9282f84b31a1
Add NATIVE_TOOLCHAIN=only, to build _just_ the native toolchain (sae set of packages as the cross compiler, only --enable-shared and with uClibc++).
Rob Landley <rob@landley.net>
parents:
711
diff
changeset
|
142 |
854
3794d9a0be4c
Add SKIP_STRIP configuration option to do what it says on the tin, and stop blanking CFLAGS and CFLAGSXX so "export CFLAGS=-g" can pass through to package builds.
Rob Landley <rob@landley.net>
parents:
849
diff
changeset
|
143 if [ -z "$SKIP_STRIP" ] |
3794d9a0be4c
Add SKIP_STRIP configuration option to do what it says on the tin, and stop blanking CFLAGS and CFLAGSXX so "export CFLAGS=-g" can pass through to package builds.
Rob Landley <rob@landley.net>
parents:
849
diff
changeset
|
144 then |
3794d9a0be4c
Add SKIP_STRIP configuration option to do what it says on the tin, and stop blanking CFLAGS and CFLAGSXX so "export CFLAGS=-g" can pass through to package builds.
Rob Landley <rob@landley.net>
parents:
849
diff
changeset
|
145 # Delete some unneeded files |
516
f846099333ac
I can see the man pages being potentially useful, but info pages are a complete waste of space.
Rob Landley <rob@landley.net>
parents:
510
diff
changeset
|
146 |
854
3794d9a0be4c
Add SKIP_STRIP configuration option to do what it says on the tin, and stop blanking CFLAGS and CFLAGSXX so "export CFLAGS=-g" can pass through to package builds.
Rob Landley <rob@landley.net>
parents:
849
diff
changeset
|
147 rm -rf "$ROOT_TOPDIR"/{info,man,libexec/gcc/*/*/install-tools} |
516
f846099333ac
I can see the man pages being potentially useful, but info pages are a complete waste of space.
Rob Landley <rob@landley.net>
parents:
510
diff
changeset
|
148 |
854
3794d9a0be4c
Add SKIP_STRIP configuration option to do what it says on the tin, and stop blanking CFLAGS and CFLAGSXX so "export CFLAGS=-g" can pass through to package builds.
Rob Landley <rob@landley.net>
parents:
849
diff
changeset
|
149 # Clean up and package the result |
43
6d16887ec084
Intermediate snapshot. Doesn't work yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
150 |
854
3794d9a0be4c
Add SKIP_STRIP configuration option to do what it says on the tin, and stop blanking CFLAGS and CFLAGSXX so "export CFLAGS=-g" can pass through to package builds.
Rob Landley <rob@landley.net>
parents:
849
diff
changeset
|
151 "${ARCH}-strip" "$ROOT_TOPDIR"/{bin/*,sbin/*,libexec/gcc/*/*/*} |
3794d9a0be4c
Add SKIP_STRIP configuration option to do what it says on the tin, and stop blanking CFLAGS and CFLAGSXX so "export CFLAGS=-g" can pass through to package builds.
Rob Landley <rob@landley.net>
parents:
849
diff
changeset
|
152 "${ARCH}-strip" --strip-unneeded "$ROOT_TOPDIR"/lib/*.so |
3794d9a0be4c
Add SKIP_STRIP configuration option to do what it says on the tin, and stop blanking CFLAGS and CFLAGSXX so "export CFLAGS=-g" can pass through to package builds.
Rob Landley <rob@landley.net>
parents:
849
diff
changeset
|
153 fi |
53
3fd961e31444
Build a gcc wrapper for _target_, and add a "strip" command to halve the
Rob Landley <rob@landley.net>
parents:
52
diff
changeset
|
154 |
783
db06a8c1bfed
Lots of changes to move buildall.sh functionality into build.sh.
Rob Landley <rob@landley.net>
parents:
782
diff
changeset
|
155 create_stage_tarball |
576
036dbe218036
Add BASE_ARCH support, so a hardware architecture can specify a base architecture and just provide a different kernel.
Rob Landley <rob@landley.net>
parents:
572
diff
changeset
|
156 |
50
5aeba79b8f5f
Remove qemu build (it's in cross-compiler.sh now), move uClibc build right
Rob Landley <rob@landley.net>
parents:
46
diff
changeset
|
157 # Color back to normal |
52
6d6551a37687
Add make to mini-native (required one more option switched on in uClibc), add
Rob Landley <rob@landley.net>
parents:
51
diff
changeset
|
158 echo -e "\e[0mBuild complete" |