Mercurial > hg > aboriginal
annotate root-filesystem.sh @ 794:81cf7ae7afce
Teach make, bash, and distcc to honor BUILD_STATIC=1.
author | Rob Landley <rob@landley.net> |
---|---|
date | Wed, 05 Aug 2009 04:23:51 -0500 |
parents | db06a8c1bfed |
children | d6bf46d17ac5 |
rev | line source |
---|---|
177 | 1 #!/bin/bash |
43
6d16887ec084
Intermediate snapshot. Doesn't work yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
2 |
6d16887ec084
Intermediate snapshot. Doesn't work yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
3 # Get lots of predefined environment variables and shell functions. |
6d16887ec084
Intermediate snapshot. Doesn't work yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
4 |
669 | 5 source sources/include.sh || exit 1 |
96
137ba51ee993
Delete output directories on re-run, teach build to log and build multiple
Rob Landley <rob@landley.net>
parents:
85
diff
changeset
|
6 |
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
|
7 # Parse the sources/targets/$1 directory |
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
|
8 |
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
|
9 read_arch_dir "$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:
737
diff
changeset
|
10 |
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
|
11 # If this target has a base architecture that's already been built, use that. |
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
|
12 |
783
db06a8c1bfed
Lots of changes to move buildall.sh functionality into build.sh.
Rob Landley <rob@landley.net>
parents:
782
diff
changeset
|
13 check_for_base_arch || exit 0 |
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
|
14 |
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
|
15 # Die if our prerequisite isn't there. |
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
|
16 |
782
5c6ebb711b72
Check for both prerequisite compilers of a canadian cross, and use $ARCH-cc instead of $ARCH-gcc more.
Rob Landley <rob@landley.net>
parents:
757
diff
changeset
|
17 for i in "$ARCH" "$FROM_ARCH" |
5c6ebb711b72
Check for both prerequisite compilers of a canadian cross, and use $ARCH-cc instead of $ARCH-gcc more.
Rob Landley <rob@landley.net>
parents:
757
diff
changeset
|
18 do |
5c6ebb711b72
Check for both prerequisite compilers of a canadian cross, and use $ARCH-cc instead of $ARCH-gcc more.
Rob Landley <rob@landley.net>
parents:
757
diff
changeset
|
19 if [ -z "$(which "${i}-cc")" ] |
5c6ebb711b72
Check for both prerequisite compilers of a canadian cross, and use $ARCH-cc instead of $ARCH-gcc more.
Rob Landley <rob@landley.net>
parents:
757
diff
changeset
|
20 then |
5c6ebb711b72
Check for both prerequisite compilers of a canadian cross, and use $ARCH-cc instead of $ARCH-gcc more.
Rob Landley <rob@landley.net>
parents:
757
diff
changeset
|
21 [ -z "$FAIL_QUIET" ] && echo No "${i}-cc" in '$PATH'. >&2 |
5c6ebb711b72
Check for both prerequisite compilers of a canadian cross, and use $ARCH-cc instead of $ARCH-gcc more.
Rob Landley <rob@landley.net>
parents:
757
diff
changeset
|
22 exit 1 |
5c6ebb711b72
Check for both prerequisite compilers of a canadian cross, and use $ARCH-cc instead of $ARCH-gcc more.
Rob Landley <rob@landley.net>
parents:
757
diff
changeset
|
23 fi |
5c6ebb711b72
Check for both prerequisite compilers of a canadian cross, and use $ARCH-cc instead of $ARCH-gcc more.
Rob Landley <rob@landley.net>
parents:
757
diff
changeset
|
24 done |
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
|
25 |
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
|
26 # Announce start of stage. |
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
|
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:
737
diff
changeset
|
28 echo -e "$NATIVE_COLOR" |
783
db06a8c1bfed
Lots of changes to move buildall.sh functionality into build.sh.
Rob Landley <rob@landley.net>
parents:
782
diff
changeset
|
29 echo "=== Building $STAGE_NAME" |
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
|
30 |
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
|
31 blank_tempdir "$WORK" |
783
db06a8c1bfed
Lots of changes to move buildall.sh functionality into build.sh.
Rob Landley <rob@landley.net>
parents:
782
diff
changeset
|
32 blank_tempdir "$STAGE_DIR" |
96
137ba51ee993
Delete output directories on re-run, teach build to log and build multiple
Rob Landley <rob@landley.net>
parents:
85
diff
changeset
|
33 |
658
dc5512d734f0
Actually put MANIFEST into mini-native.
Rob Landley <rob@landley.net>
parents:
633
diff
changeset
|
34 # Determine which directory layout we're using |
dc5512d734f0
Actually put MANIFEST into mini-native.
Rob Landley <rob@landley.net>
parents:
633
diff
changeset
|
35 |
783
db06a8c1bfed
Lots of changes to move buildall.sh functionality into build.sh.
Rob Landley <rob@landley.net>
parents:
782
diff
changeset
|
36 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
|
37 then |
783
db06a8c1bfed
Lots of changes to move buildall.sh functionality into build.sh.
Rob Landley <rob@landley.net>
parents:
782
diff
changeset
|
38 ROOT_TOPDIR="$STAGE_DIR/usr" |
db06a8c1bfed
Lots of changes to move buildall.sh functionality into build.sh.
Rob Landley <rob@landley.net>
parents:
782
diff
changeset
|
39 mkdir -p "$STAGE_DIR"/{tmp,proc,sys,dev,home} || dienow |
735
feec13d32dde
Squashfs needs an /etc/resolv.conf, not just /usr/etc/resolv.conf
Rob Landley <rob@landley.net>
parents:
726
diff
changeset
|
40 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
|
41 do |
783
db06a8c1bfed
Lots of changes to move buildall.sh functionality into build.sh.
Rob Landley <rob@landley.net>
parents:
782
diff
changeset
|
42 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
|
43 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
|
44 done |
783
db06a8c1bfed
Lots of changes to move buildall.sh functionality into build.sh.
Rob Landley <rob@landley.net>
parents:
782
diff
changeset
|
45 else |
db06a8c1bfed
Lots of changes to move buildall.sh functionality into build.sh.
Rob Landley <rob@landley.net>
parents:
782
diff
changeset
|
46 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
|
47 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
|
48 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
|
49 |
553
80f3356577fc
Move kernel building from mini-native to package-mini-native in preparation for initramfs packaging option.
Rob Landley <rob@landley.net>
parents:
546
diff
changeset
|
50 # Install Linux kernel headers. |
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
|
51 |
43
6d16887ec084
Intermediate snapshot. Doesn't work yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
52 setupfor linux |
6d16887ec084
Intermediate snapshot. Doesn't work yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
53 # Install Linux kernel headers (for use by uClibc). |
783
db06a8c1bfed
Lots of changes to move buildall.sh functionality into build.sh.
Rob Landley <rob@landley.net>
parents:
782
diff
changeset
|
54 make headers_install -j "$CPUS" ARCH="${KARCH}" INSTALL_HDR_PATH="$ROOT_TOPDIR" && |
540
d0b059fd91a8
Link include/asm/page.h to include/sys/user.h, in case people try to build old packages.
Rob Landley <rob@landley.net>
parents:
537
diff
changeset
|
55 # This makes some very old package builds happy. |
783
db06a8c1bfed
Lots of changes to move buildall.sh functionality into build.sh.
Rob Landley <rob@landley.net>
parents:
782
diff
changeset
|
56 ln -s ../sys/user.h "$ROOT_TOPDIR/include/asm/page.h" && |
301
309b574a5059
Redo the $CLEANUP logic to a cleanup function in include.sh (meaning if a
Rob Landley <rob@landley.net>
parents:
295
diff
changeset
|
57 cd .. |
43
6d16887ec084
Intermediate snapshot. Doesn't work yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
58 |
301
309b574a5059
Redo the $CLEANUP logic to a cleanup function in include.sh (meaning if a
Rob Landley <rob@landley.net>
parents:
295
diff
changeset
|
59 cleanup linux |
43
6d16887ec084
Intermediate snapshot. Doesn't work yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
60 |
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
|
61 # Build and install uClibc. (We could just copy the one from the compiler |
5aeba79b8f5f
Remove qemu build (it's in cross-compiler.sh now), move uClibc build right
Rob Landley <rob@landley.net>
parents:
46
diff
changeset
|
62 # toolchain, but this is cleaner.) |
5aeba79b8f5f
Remove qemu build (it's in cross-compiler.sh now), move uClibc build right
Rob Landley <rob@landley.net>
parents:
46
diff
changeset
|
63 |
5aeba79b8f5f
Remove qemu build (it's in cross-compiler.sh now), move uClibc build right
Rob Landley <rob@landley.net>
parents:
46
diff
changeset
|
64 setupfor uClibc |
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:
527
diff
changeset
|
65 make CROSS="${ARCH}-" KCONFIG_ALLCONFIG="$(getconfig uClibc)" allnoconfig && |
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
|
66 cp .config "${WORK}"/config-uClibc || dienow |
533
b970ffb2eb4d
Work around problem with the make -j dependencies of uClibc.
Rob Landley <rob@landley.net>
parents:
530
diff
changeset
|
67 |
b970ffb2eb4d
Work around problem with the make -j dependencies of uClibc.
Rob Landley <rob@landley.net>
parents:
530
diff
changeset
|
68 # Alas, if we feed install and install_utils to make at the same time with |
b970ffb2eb4d
Work around problem with the make -j dependencies of uClibc.
Rob Landley <rob@landley.net>
parents:
530
diff
changeset
|
69 # -j > 1, it dies. Not SMP safe. |
b970ffb2eb4d
Work around problem with the make -j dependencies of uClibc.
Rob Landley <rob@landley.net>
parents:
530
diff
changeset
|
70 for i in install install_utils |
b970ffb2eb4d
Work around problem with the make -j dependencies of uClibc.
Rob Landley <rob@landley.net>
parents:
530
diff
changeset
|
71 do |
783
db06a8c1bfed
Lots of changes to move buildall.sh functionality into build.sh.
Rob Landley <rob@landley.net>
parents:
782
diff
changeset
|
72 make CROSS="${ARCH}-" KERNEL_HEADERS="$ROOT_TOPDIR/include" \ |
db06a8c1bfed
Lots of changes to move buildall.sh functionality into build.sh.
Rob Landley <rob@landley.net>
parents:
782
diff
changeset
|
73 PREFIX="$ROOT_TOPDIR/" $VERBOSITY \ |
db06a8c1bfed
Lots of changes to move buildall.sh functionality into build.sh.
Rob Landley <rob@landley.net>
parents:
782
diff
changeset
|
74 RUNTIME_PREFIX="/" DEVEL_PREFIX="/" \ |
533
b970ffb2eb4d
Work around problem with the make -j dependencies of uClibc.
Rob Landley <rob@landley.net>
parents:
530
diff
changeset
|
75 UCLIBC_LDSO_NAME=ld-uClibc -j $CPUS $i || dienow |
b970ffb2eb4d
Work around problem with the make -j dependencies of uClibc.
Rob Landley <rob@landley.net>
parents:
530
diff
changeset
|
76 done |
721
f0ede6d6c952
Do canadian cross static toolchains properly, via buildall.sh.
Rob Landley <rob@landley.net>
parents:
716
diff
changeset
|
77 |
f0ede6d6c952
Do canadian cross static toolchains properly, via buildall.sh.
Rob Landley <rob@landley.net>
parents:
716
diff
changeset
|
78 # There's no way to specify a prefix for the uClibc utils; rename them by hand. |
f0ede6d6c952
Do canadian cross static toolchains properly, via buildall.sh.
Rob Landley <rob@landley.net>
parents:
716
diff
changeset
|
79 |
f0ede6d6c952
Do canadian cross static toolchains properly, via buildall.sh.
Rob Landley <rob@landley.net>
parents:
716
diff
changeset
|
80 if [ ! -z "$PROGRAM_PREFIX" ] |
f0ede6d6c952
Do canadian cross static toolchains properly, via buildall.sh.
Rob Landley <rob@landley.net>
parents:
716
diff
changeset
|
81 then |
f0ede6d6c952
Do canadian cross static toolchains properly, via buildall.sh.
Rob Landley <rob@landley.net>
parents:
716
diff
changeset
|
82 for i in ldd readelf |
f0ede6d6c952
Do canadian cross static toolchains properly, via buildall.sh.
Rob Landley <rob@landley.net>
parents:
716
diff
changeset
|
83 do |
783
db06a8c1bfed
Lots of changes to move buildall.sh functionality into build.sh.
Rob Landley <rob@landley.net>
parents:
782
diff
changeset
|
84 mv "$ROOT_TOPDIR"/bin/{"$i","${PROGRAM_PREFIX}$i"} || dienow |
721
f0ede6d6c952
Do canadian cross static toolchains properly, via buildall.sh.
Rob Landley <rob@landley.net>
parents:
716
diff
changeset
|
85 done |
f0ede6d6c952
Do canadian cross static toolchains properly, via buildall.sh.
Rob Landley <rob@landley.net>
parents:
716
diff
changeset
|
86 fi |
f0ede6d6c952
Do canadian cross static toolchains properly, via buildall.sh.
Rob Landley <rob@landley.net>
parents:
716
diff
changeset
|
87 |
301
309b574a5059
Redo the $CLEANUP logic to a cleanup function in include.sh (meaning if a
Rob Landley <rob@landley.net>
parents:
295
diff
changeset
|
88 cd .. |
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
|
89 |
301
309b574a5059
Redo the $CLEANUP logic to a cleanup function in include.sh (meaning if a
Rob Landley <rob@landley.net>
parents:
295
diff
changeset
|
90 cleanup 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
|
91 |
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
|
92 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
|
93 then |
510
d6182f514567
A system without development headers doesn't need static libraries either.
Rob Landley <rob@landley.net>
parents:
503
diff
changeset
|
94 # 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
|
95 # 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
|
96 |
783
db06a8c1bfed
Lots of changes to move buildall.sh functionality into build.sh.
Rob Landley <rob@landley.net>
parents:
782
diff
changeset
|
97 rm -rf "$ROOT_TOPDIR"/include && |
db06a8c1bfed
Lots of changes to move buildall.sh functionality into build.sh.
Rob Landley <rob@landley.net>
parents:
782
diff
changeset
|
98 rm -rf "$ROOT_TOPDIR"/lib/*.a && |
db06a8c1bfed
Lots of changes to move buildall.sh functionality into build.sh.
Rob Landley <rob@landley.net>
parents:
782
diff
changeset
|
99 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
|
100 |
3cebbc0b0723
Rename (invert) NATIVE_NOTOOLCHAIN and NATIVE_NOTOOLSDIR, and tweak colors again.
Rob Landley <rob@landley.net>
parents:
485
diff
changeset
|
101 elif [ "$NATIVE_TOOLCHAIN" == "headers" ] |
423
8029eb9a4a8c
Split out BUILD_NOTOOLS from BUILD_SHORT.
Rob Landley <rob@landley.net>
parents:
417
diff
changeset
|
102 then |
8029eb9a4a8c
Split out BUILD_NOTOOLS from BUILD_SHORT.
Rob Landley <rob@landley.net>
parents:
417
diff
changeset
|
103 |
496
3cebbc0b0723
Rename (invert) NATIVE_NOTOOLCHAIN and NATIVE_NOTOOLSDIR, and tweak colors again.
Rob Landley <rob@landley.net>
parents:
485
diff
changeset
|
104 # 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
|
105 # 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
|
106 echo |
423
8029eb9a4a8c
Split out BUILD_NOTOOLS from BUILD_SHORT.
Rob Landley <rob@landley.net>
parents:
417
diff
changeset
|
107 |
310
3a1ae92d6f6a
Teach BUILD_SHORT to remove include files (saving ~5 megs), and move the
Rob Landley <rob@landley.net>
parents:
306
diff
changeset
|
108 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
|
109 |
43
6d16887ec084
Intermediate snapshot. Doesn't work yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
110 # Build and install native binutils |
6d16887ec084
Intermediate snapshot. Doesn't work yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
111 |
6d16887ec084
Intermediate snapshot. Doesn't work yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
112 setupfor binutils build-binutils |
783
db06a8c1bfed
Lots of changes to move buildall.sh functionality into build.sh.
Rob Landley <rob@landley.net>
parents:
782
diff
changeset
|
113 CC="${FROM_ARCH}-cc" AR="${FROM_ARCH}-ar" "${CURSRC}/configure" --prefix="$ROOT_TOPDIR" \ |
714
db04bd3c11e0
First pass at canadian cross toolchain build. Result doesn't actually work yet, but it builds.
Rob Landley <rob@landley.net>
parents:
713
diff
changeset
|
114 --build="${CROSS_HOST}" --host="${FROM_HOST}" --target="${CROSS_TARGET}" \ |
db04bd3c11e0
First pass at canadian cross toolchain build. Result doesn't actually work yet, but it builds.
Rob Landley <rob@landley.net>
parents:
713
diff
changeset
|
115 --disable-nls --disable-shared --disable-multilib --disable-werror \ |
db04bd3c11e0
First pass at canadian cross toolchain build. Result doesn't actually work yet, but it builds.
Rob Landley <rob@landley.net>
parents:
713
diff
changeset
|
116 --program-prefix="$PROGRAM_PREFIX" $BINUTILS_FLAGS && |
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
|
117 make -j $CPUS configure-host && |
714
db04bd3c11e0
First pass at canadian cross toolchain build. Result doesn't actually work yet, but it builds.
Rob Landley <rob@landley.net>
parents:
713
diff
changeset
|
118 make -j $CPUS CFLAGS="-O2 $STATIC_FLAGS" && |
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
|
119 make -j $CPUS install && |
43
6d16887ec084
Intermediate snapshot. Doesn't work yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
120 cd .. && |
783
db06a8c1bfed
Lots of changes to move buildall.sh functionality into build.sh.
Rob Landley <rob@landley.net>
parents:
782
diff
changeset
|
121 mkdir -p "$ROOT_TOPDIR/include" && |
db06a8c1bfed
Lots of changes to move buildall.sh functionality into build.sh.
Rob Landley <rob@landley.net>
parents:
782
diff
changeset
|
122 cp binutils/include/libiberty.h "$ROOT_TOPDIR/include" |
43
6d16887ec084
Intermediate snapshot. Doesn't work yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
123 |
301
309b574a5059
Redo the $CLEANUP logic to a cleanup function in include.sh (meaning if a
Rob Landley <rob@landley.net>
parents:
295
diff
changeset
|
124 cleanup binutils build-binutils |
43
6d16887ec084
Intermediate snapshot. Doesn't work yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
125 |
6d16887ec084
Intermediate snapshot. Doesn't work yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
126 # Build and install native gcc, with c++ support this time. |
6d16887ec084
Intermediate snapshot. Doesn't work yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
127 |
223
f6973e090c4f
Update mini-native for the new tarball strategy.
Rob Landley <rob@landley.net>
parents:
221
diff
changeset
|
128 setupfor gcc-core build-gcc |
f6973e090c4f
Update mini-native for the new tarball strategy.
Rob Landley <rob@landley.net>
parents:
221
diff
changeset
|
129 setupfor gcc-g++ build-gcc gcc-core |
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
|
130 # GCC tries to "help out in the kitchen" by screwing up the linux include |
5aeba79b8f5f
Remove qemu build (it's in cross-compiler.sh now), move uClibc build right
Rob Landley <rob@landley.net>
parents:
46
diff
changeset
|
131 # files. Cut out those bits with sed and throw them away. |
295
bbfb6e7bf7e6
Add first pass at Super Hitachi platform.
Rob Landley <rob@landley.net>
parents:
294
diff
changeset
|
132 sed -i 's@^STMP_FIX.*@@' "${CURSRC}/gcc/Makefile.in" && |
46
eeddef87a747
Still doesn't work, but doesn't work better.
Rob Landley <rob@landley.net>
parents:
44
diff
changeset
|
133 # GCC has some deep assumptions about the name of the cross-compiler it should |
eeddef87a747
Still doesn't work, but doesn't work better.
Rob Landley <rob@landley.net>
parents:
44
diff
changeset
|
134 # be using. These assumptions are wrong, and lots of redundant corrections |
294
87df194d555d
Back to gcc 4.1.2 until I find a large enough rock to fix the soft-float thing.
Rob Landley <rob@landley.net>
parents:
293
diff
changeset
|
135 # are required to make it stop. |
737
5f5c3747f475
Use $ARCH-cc instead of $ARCH-gcc where possible. (pcc, llvm, tcc, qcc...)
Rob Landley <rob@landley.net>
parents:
735
diff
changeset
|
136 CC="${FROM_ARCH}-cc" AR="${FROM_ARCH}-ar" AS="${FROM_ARCH}-as" \ |
714
db04bd3c11e0
First pass at canadian cross toolchain build. Result doesn't actually work yet, but it builds.
Rob Landley <rob@landley.net>
parents:
713
diff
changeset
|
137 LD="${FROM_ARCH}-ld" NM="${FROM_ARCH}-nm" \ |
db04bd3c11e0
First pass at canadian cross toolchain build. Result doesn't actually work yet, but it builds.
Rob Landley <rob@landley.net>
parents:
713
diff
changeset
|
138 CC_FOR_TARGET="${ARCH}-cc" AR_FOR_TARGET="${ARCH}-ar" \ |
737
5f5c3747f475
Use $ARCH-cc instead of $ARCH-gcc where possible. (pcc, llvm, tcc, qcc...)
Rob Landley <rob@landley.net>
parents:
735
diff
changeset
|
139 NM_FOR_TARGET="${ARCH}-nm" GCC_FOR_TARGET="${ARCH}-cc" \ |
749
34f9a88336a8
Move stable to gcc-4.2.1, and use an even _bigger_ hammer to make canadian builds work with that. (./configure sucks even _more_ in this version, big shock there.)
Rob Landley <rob@landley.net>
parents:
744
diff
changeset
|
140 AS_FOR_TARGET="${ARCH}-as" LD_FOR_TARGET="${ARCH}-ld" \ |
714
db04bd3c11e0
First pass at canadian cross toolchain build. Result doesn't actually work yet, but it builds.
Rob Landley <rob@landley.net>
parents:
713
diff
changeset
|
141 CXX_FOR_TARGET="${ARCH}-g++" \ |
632
4ab92aee351c
Gcc 4.2 needs three more environment variables set to emit a native compiler.
Rob Landley <rob@landley.net>
parents:
626
diff
changeset
|
142 ac_cv_path_AR_FOR_TARGET="${ARCH}-ar" \ |
4ab92aee351c
Gcc 4.2 needs three more environment variables set to emit a native compiler.
Rob Landley <rob@landley.net>
parents:
626
diff
changeset
|
143 ac_cv_path_RANLIB_FOR_TARGET="${ARCH}-ranlib" \ |
4ab92aee351c
Gcc 4.2 needs three more environment variables set to emit a native compiler.
Rob Landley <rob@landley.net>
parents:
626
diff
changeset
|
144 ac_cv_path_NM_FOR_TARGET="${ARCH}-nm" \ |
749
34f9a88336a8
Move stable to gcc-4.2.1, and use an even _bigger_ hammer to make canadian builds work with that. (./configure sucks even _more_ in this version, big shock there.)
Rob Landley <rob@landley.net>
parents:
744
diff
changeset
|
145 ac_cv_path_AS_FOR_TARGET="${ARCH}-as" \ |
34f9a88336a8
Move stable to gcc-4.2.1, and use an even _bigger_ hammer to make canadian builds work with that. (./configure sucks even _more_ in this version, big shock there.)
Rob Landley <rob@landley.net>
parents:
744
diff
changeset
|
146 ac_cv_path_LD_FOR_TARGET="${ARCH}-ld" \ |
783
db06a8c1bfed
Lots of changes to move buildall.sh functionality into build.sh.
Rob Landley <rob@landley.net>
parents:
782
diff
changeset
|
147 "${CURSRC}/configure" --prefix="$ROOT_TOPDIR" --disable-multilib \ |
43
6d16887ec084
Intermediate snapshot. Doesn't work yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
148 --build="${CROSS_HOST}" --host="${CROSS_TARGET}" --target="${CROSS_TARGET}" \ |
6d16887ec084
Intermediate snapshot. Doesn't work yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
149 --enable-long-long --enable-c99 --enable-shared --enable-threads=posix \ |
6d16887ec084
Intermediate snapshot. Doesn't work yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
150 --enable-__cxa_atexit --disable-nls --enable-languages=c,c++ \ |
714
db04bd3c11e0
First pass at canadian cross toolchain build. Result doesn't actually work yet, but it builds.
Rob Landley <rob@landley.net>
parents:
713
diff
changeset
|
151 --disable-libstdcxx-pch --program-prefix="$PROGRAM_PREFIX" \ |
443
716b7af6d8c3
Build libsupc++.a in preparation for building uClibc++.
Rob Landley <rob@landley.net>
parents:
432
diff
changeset
|
152 $GCC_FLAGS && |
517
89b2e2c55b28
Give mini-native.sh the same xgcc bypass trick cross-compiler.sh uses.
Rob Landley <rob@landley.net>
parents:
516
diff
changeset
|
153 mkdir gcc && |
89b2e2c55b28
Give mini-native.sh the same xgcc bypass trick cross-compiler.sh uses.
Rob Landley <rob@landley.net>
parents:
516
diff
changeset
|
154 ln -s `which "${ARCH}-gcc"` gcc/xgcc && |
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
|
155 make -j $CPUS configure-host && |
714
db04bd3c11e0
First pass at canadian cross toolchain build. Result doesn't actually work yet, but it builds.
Rob Landley <rob@landley.net>
parents:
713
diff
changeset
|
156 make -j $CPUS all-gcc LDFLAGS="$STATIC_FLAGS" && |
456
2a308aa24aec
Make gcc stop putting stuff in a lib64 directory on x86-64 even when we --disable-multilib, and remove spurious uClibc warnings about trying to use the cross compiler to "make allnoconfig".
Rob Landley <rob@landley.net>
parents:
453
diff
changeset
|
157 # Work around gcc bug; we disabled multilib but it doesn't always notice. |
783
db06a8c1bfed
Lots of changes to move buildall.sh functionality into build.sh.
Rob Landley <rob@landley.net>
parents:
782
diff
changeset
|
158 ln -s lib "$ROOT_TOPDIR/lib64" && |
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
|
159 make -j $CPUS install-gcc && |
783
db06a8c1bfed
Lots of changes to move buildall.sh functionality into build.sh.
Rob Landley <rob@landley.net>
parents:
782
diff
changeset
|
160 rm "$ROOT_TOPDIR/lib64" && |
db06a8c1bfed
Lots of changes to move buildall.sh functionality into build.sh.
Rob Landley <rob@landley.net>
parents:
782
diff
changeset
|
161 ln -s "${PROGRAM_PREFIX}gcc" "$ROOT_TOPDIR/bin/${PROGRAM_PREFIX}cc" && |
443
716b7af6d8c3
Build libsupc++.a in preparation for building uClibc++.
Rob Landley <rob@landley.net>
parents:
432
diff
changeset
|
162 # Now we need to beat libsupc++ out of gcc (which uClibc++ needs to build). |
716b7af6d8c3
Build libsupc++.a in preparation for building uClibc++.
Rob Landley <rob@landley.net>
parents:
432
diff
changeset
|
163 # But don't want to build the whole of libstdc++-v3 because |
716b7af6d8c3
Build libsupc++.a in preparation for building uClibc++.
Rob Landley <rob@landley.net>
parents:
432
diff
changeset
|
164 # A) we're using uClibc++ instead, B) the build breaks. |
716b7af6d8c3
Build libsupc++.a in preparation for building uClibc++.
Rob Landley <rob@landley.net>
parents:
432
diff
changeset
|
165 make -j $CPUS configure-target-libstdc++-v3 && |
716b7af6d8c3
Build libsupc++.a in preparation for building uClibc++.
Rob Landley <rob@landley.net>
parents:
432
diff
changeset
|
166 cd "$CROSS_TARGET"/libstdc++-v3/libsupc++ && |
716b7af6d8c3
Build libsupc++.a in preparation for building uClibc++.
Rob Landley <rob@landley.net>
parents:
432
diff
changeset
|
167 make -j $CPUS && |
783
db06a8c1bfed
Lots of changes to move buildall.sh functionality into build.sh.
Rob Landley <rob@landley.net>
parents:
782
diff
changeset
|
168 mv .libs/libsupc++.a "$ROOT_TOPDIR"/lib && |
443
716b7af6d8c3
Build libsupc++.a in preparation for building uClibc++.
Rob Landley <rob@landley.net>
parents:
432
diff
changeset
|
169 cd ../../../.. |
43
6d16887ec084
Intermediate snapshot. Doesn't work yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
170 |
301
309b574a5059
Redo the $CLEANUP logic to a cleanup function in include.sh (meaning if a
Rob Landley <rob@landley.net>
parents:
295
diff
changeset
|
171 cleanup gcc-core build-gcc |
43
6d16887ec084
Intermediate snapshot. Doesn't work yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
172 |
716
ff2cd7c539b2
Make canadian cross work by nailing binutils files to gcc's forehead.
Rob Landley <rob@landley.net>
parents:
714
diff
changeset
|
173 # Move the gcc internal libraries and headers somewhere sane |
43
6d16887ec084
Intermediate snapshot. Doesn't work yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
174 |
783
db06a8c1bfed
Lots of changes to move buildall.sh functionality into build.sh.
Rob Landley <rob@landley.net>
parents:
782
diff
changeset
|
175 mkdir -p "$ROOT_TOPDIR"/gcc && |
db06a8c1bfed
Lots of changes to move buildall.sh functionality into build.sh.
Rob Landley <rob@landley.net>
parents:
782
diff
changeset
|
176 mv "$ROOT_TOPDIR"/lib/gcc/*/*/include "$ROOT_TOPDIR"/gcc/include && |
db06a8c1bfed
Lots of changes to move buildall.sh functionality into build.sh.
Rob Landley <rob@landley.net>
parents:
782
diff
changeset
|
177 mv "$ROOT_TOPDIR"/lib/gcc/*/* "$ROOT_TOPDIR"/gcc/lib && |
716
ff2cd7c539b2
Make canadian cross work by nailing binutils files to gcc's forehead.
Rob Landley <rob@landley.net>
parents:
714
diff
changeset
|
178 |
ff2cd7c539b2
Make canadian cross work by nailing binutils files to gcc's forehead.
Rob Landley <rob@landley.net>
parents:
714
diff
changeset
|
179 # Rub gcc's nose in the binutils output. |
783
db06a8c1bfed
Lots of changes to move buildall.sh functionality into build.sh.
Rob Landley <rob@landley.net>
parents:
782
diff
changeset
|
180 cd "$ROOT_TOPDIR"/libexec/gcc/*/*/ && |
716
ff2cd7c539b2
Make canadian cross work by nailing binutils files to gcc's forehead.
Rob Landley <rob@landley.net>
parents:
714
diff
changeset
|
181 cp -s "../../../../$CROSS_TARGET/bin/"* . && |
ff2cd7c539b2
Make canadian cross work by nailing binutils files to gcc's forehead.
Rob Landley <rob@landley.net>
parents:
714
diff
changeset
|
182 |
ff2cd7c539b2
Make canadian cross work by nailing binutils files to gcc's forehead.
Rob Landley <rob@landley.net>
parents:
714
diff
changeset
|
183 # build and install gcc wrapper script. |
783
db06a8c1bfed
Lots of changes to move buildall.sh functionality into build.sh.
Rob Landley <rob@landley.net>
parents:
782
diff
changeset
|
184 mv "$ROOT_TOPDIR/bin/${PROGRAM_PREFIX}gcc" "$ROOT_TOPDIR/bin/${PROGRAM_PREFIX}rawgcc" && |
782
5c6ebb711b72
Check for both prerequisite compilers of a canadian cross, and use $ARCH-cc instead of $ARCH-gcc more.
Rob Landley <rob@landley.net>
parents:
757
diff
changeset
|
185 "${FROM_ARCH}-cc" "${SOURCES}"/toys/ccwrap.c -Os -s \ |
783
db06a8c1bfed
Lots of changes to move buildall.sh functionality into build.sh.
Rob Landley <rob@landley.net>
parents:
782
diff
changeset
|
186 -o "$ROOT_TOPDIR/bin/${PROGRAM_PREFIX}gcc" -DGIMME_AN_S $STATIC_FLAGS \ |
714
db04bd3c11e0
First pass at canadian cross toolchain build. Result doesn't actually work yet, but it builds.
Rob Landley <rob@landley.net>
parents:
713
diff
changeset
|
187 -DGCC_UNWRAPPED_NAME='"'"${PROGRAM_PREFIX}rawgcc"'"' && |
443
716b7af6d8c3
Build libsupc++.a in preparation for building uClibc++.
Rob Landley <rob@landley.net>
parents:
432
diff
changeset
|
188 |
716b7af6d8c3
Build libsupc++.a in preparation for building uClibc++.
Rob Landley <rob@landley.net>
parents:
432
diff
changeset
|
189 # Wrap C++ |
783
db06a8c1bfed
Lots of changes to move buildall.sh functionality into build.sh.
Rob Landley <rob@landley.net>
parents:
782
diff
changeset
|
190 mv "$ROOT_TOPDIR/bin/${PROGRAM_PREFIX}g++" "$ROOT_TOPDIR/bin/${PROGRAM_PREFIX}rawg++" && |
db06a8c1bfed
Lots of changes to move buildall.sh functionality into build.sh.
Rob Landley <rob@landley.net>
parents:
782
diff
changeset
|
191 ln "$ROOT_TOPDIR/bin/${PROGRAM_PREFIX}gcc" "$ROOT_TOPDIR/bin/${PROGRAM_PREFIX}g++" && |
db06a8c1bfed
Lots of changes to move buildall.sh functionality into build.sh.
Rob Landley <rob@landley.net>
parents:
782
diff
changeset
|
192 rm "$ROOT_TOPDIR/bin/${PROGRAM_PREFIX}c++" && |
db06a8c1bfed
Lots of changes to move buildall.sh functionality into build.sh.
Rob Landley <rob@landley.net>
parents:
782
diff
changeset
|
193 ln -s "${PROGRAM_PREFIX}g++" "$ROOT_TOPDIR/bin/${PROGRAM_PREFIX}c++" |
43
6d16887ec084
Intermediate snapshot. Doesn't work yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
194 |
783
db06a8c1bfed
Lots of changes to move buildall.sh functionality into build.sh.
Rob Landley <rob@landley.net>
parents:
782
diff
changeset
|
195 cleanup "$ROOT_TOPDIR"/{lib/gcc,gcc/lib/install-tools,bin/${ARCH}-unknown-*} |
43
6d16887ec084
Intermediate snapshot. Doesn't work yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
196 |
783
db06a8c1bfed
Lots of changes to move buildall.sh functionality into build.sh.
Rob Landley <rob@landley.net>
parents:
782
diff
changeset
|
197 # 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
|
198 # 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
|
199 |
783
db06a8c1bfed
Lots of changes to move buildall.sh functionality into build.sh.
Rob Landley <rob@landley.net>
parents:
782
diff
changeset
|
200 export WRAPPER_TOPDIR="$ROOT_TOPDIR" |
443
716b7af6d8c3
Build libsupc++.a in preparation for building uClibc++.
Rob Landley <rob@landley.net>
parents:
432
diff
changeset
|
201 |
716b7af6d8c3
Build libsupc++.a in preparation for building uClibc++.
Rob Landley <rob@landley.net>
parents:
432
diff
changeset
|
202 # Build and install uClibc++ |
716b7af6d8c3
Build libsupc++.a in preparation for building uClibc++.
Rob Landley <rob@landley.net>
parents:
432
diff
changeset
|
203 |
447
4ed02d53fc92
Add C++ support to native compiler, based on uClibc++.
Rob Landley <rob@landley.net>
parents:
445
diff
changeset
|
204 setupfor uClibc++ |
4ed02d53fc92
Add C++ support to native compiler, based on uClibc++.
Rob Landley <rob@landley.net>
parents:
445
diff
changeset
|
205 CROSS= make defconfig && |
701
b4a9c0084f2f
Converted ARMV5L from OABI to EABI with VFP support. Added patches for uClibc and uClibc++ to deal with Unwind Exception handling, made uClibc++ pull in libgcc_eh for this as well, and disabled SJLJ exceptions for ARMV5L EABI, which is apparently required, so --enable-sjlj-exceptions was added to the details file for all the other arches. Also correct the GENTOO_CHOST variable for armeb.
Mark Miller <mark@mirell.org>
parents:
693
diff
changeset
|
206 sed -r -i 's/(UCLIBCXX_HAS_(TLS|LONG_DOUBLE))=y/# \1 is not set/' .config && |
447
4ed02d53fc92
Add C++ support to native compiler, based on uClibc++.
Rob Landley <rob@landley.net>
parents:
445
diff
changeset
|
207 sed -r -i '/UCLIBCXX_RUNTIME_PREFIX=/s/".*"/""/' .config && |
4ed02d53fc92
Add C++ support to native compiler, based on uClibc++.
Rob Landley <rob@landley.net>
parents:
445
diff
changeset
|
208 CROSS= make oldconfig && |
4ed02d53fc92
Add C++ support to native compiler, based on uClibc++.
Rob Landley <rob@landley.net>
parents:
445
diff
changeset
|
209 CROSS="$ARCH"- make && |
783
db06a8c1bfed
Lots of changes to move buildall.sh functionality into build.sh.
Rob Landley <rob@landley.net>
parents:
782
diff
changeset
|
210 CROSS= make install PREFIX="$ROOT_TOPDIR/c++" && |
447
4ed02d53fc92
Add C++ support to native compiler, based on uClibc++.
Rob Landley <rob@landley.net>
parents:
445
diff
changeset
|
211 |
4ed02d53fc92
Add C++ support to native compiler, based on uClibc++.
Rob Landley <rob@landley.net>
parents:
445
diff
changeset
|
212 # Move libraries somewhere useful. |
4ed02d53fc92
Add C++ support to native compiler, based on uClibc++.
Rob Landley <rob@landley.net>
parents:
445
diff
changeset
|
213 |
783
db06a8c1bfed
Lots of changes to move buildall.sh functionality into build.sh.
Rob Landley <rob@landley.net>
parents:
782
diff
changeset
|
214 mv "$ROOT_TOPDIR"/c++/lib/* "$ROOT_TOPDIR"/lib && |
db06a8c1bfed
Lots of changes to move buildall.sh functionality into build.sh.
Rob Landley <rob@landley.net>
parents:
782
diff
changeset
|
215 rm -rf "$ROOT_TOPDIR"/c++/{lib,bin} && |
db06a8c1bfed
Lots of changes to move buildall.sh functionality into build.sh.
Rob Landley <rob@landley.net>
parents:
782
diff
changeset
|
216 ln -s libuClibc++.so "$ROOT_TOPDIR"/lib/libstdc++.so && |
db06a8c1bfed
Lots of changes to move buildall.sh functionality into build.sh.
Rob Landley <rob@landley.net>
parents:
782
diff
changeset
|
217 ln -s libuClibc++.a "$ROOT_TOPDIR"/lib/libstdc++.a && |
479 | 218 cd .. |
447
4ed02d53fc92
Add C++ support to native compiler, based on uClibc++.
Rob Landley <rob@landley.net>
parents:
445
diff
changeset
|
219 |
4ed02d53fc92
Add C++ support to native compiler, based on uClibc++.
Rob Landley <rob@landley.net>
parents:
445
diff
changeset
|
220 cleanup uClibc++ |
443
716b7af6d8c3
Build libsupc++.a in preparation for building uClibc++.
Rob Landley <rob@landley.net>
parents:
432
diff
changeset
|
221 |
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
|
222 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
|
223 |
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
|
224 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
|
225 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
|
226 |
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
|
227 # 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
|
228 |
783
db06a8c1bfed
Lots of changes to move buildall.sh functionality into build.sh.
Rob Landley <rob@landley.net>
parents:
782
diff
changeset
|
229 cp -r "${SOURCES}/native/." "$ROOT_TOPDIR/" && |
db06a8c1bfed
Lots of changes to move buildall.sh functionality into build.sh.
Rob Landley <rob@landley.net>
parents:
782
diff
changeset
|
230 cp "$SRCDIR"/MANIFEST "$ROOT_TOPDIR/src" && |
db06a8c1bfed
Lots of changes to move buildall.sh functionality into build.sh.
Rob Landley <rob@landley.net>
parents:
782
diff
changeset
|
231 cp "${WORK}/config-uClibc" "$ROOT_TOPDIR/src/config-uClibc" || 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
|
232 |
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
|
233 # Build and install toybox |
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
|
234 |
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
|
235 setupfor toybox |
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
|
236 make defconfig && |
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
|
237 if [ -z "$USE_TOYBOX" ] |
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
|
238 then |
726
db5cb617339a
Centrialize BUILD_STATIC and make it apply to more of root-filesystem.sh
Rob Landley <rob@landley.net>
parents:
721
diff
changeset
|
239 CFLAGS="$CFLAGS $STATIC_FLAGS" make CROSS="${ARCH}-" && |
783
db06a8c1bfed
Lots of changes to move buildall.sh functionality into build.sh.
Rob Landley <rob@landley.net>
parents:
782
diff
changeset
|
240 cp toybox "$ROOT_TOPDIR/bin" && |
db06a8c1bfed
Lots of changes to move buildall.sh functionality into build.sh.
Rob Landley <rob@landley.net>
parents:
782
diff
changeset
|
241 ln -s toybox "$ROOT_TOPDIR/bin/patch" && |
db06a8c1bfed
Lots of changes to move buildall.sh functionality into build.sh.
Rob Landley <rob@landley.net>
parents:
782
diff
changeset
|
242 ln -s toybox "$ROOT_TOPDIR/bin/oneit" && |
db06a8c1bfed
Lots of changes to move buildall.sh functionality into build.sh.
Rob Landley <rob@landley.net>
parents:
782
diff
changeset
|
243 ln -s toybox "$ROOT_TOPDIR/bin/netcat" && |
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
|
244 cd .. |
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
|
245 else |
726
db5cb617339a
Centrialize BUILD_STATIC and make it apply to more of root-filesystem.sh
Rob Landley <rob@landley.net>
parents:
721
diff
changeset
|
246 CFLAGS="$CFLAGS $STATIC_FLAGS" \ |
783
db06a8c1bfed
Lots of changes to move buildall.sh functionality into build.sh.
Rob Landley <rob@landley.net>
parents:
782
diff
changeset
|
247 make install_flat PREFIX="$ROOT_TOPDIR"/bin CROSS="${ARCH}-" && |
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
|
248 cd .. |
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
|
249 fi |
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
|
250 |
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
|
251 cleanup toybox |
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
|
252 |
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
|
253 # Build and install busybox |
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
|
254 |
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
|
255 setupfor busybox |
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
|
256 make allyesconfig KCONFIG_ALLCONFIG="${SOURCES}/trimconfig-busybox" && |
783
db06a8c1bfed
Lots of changes to move buildall.sh functionality into build.sh.
Rob Landley <rob@landley.net>
parents:
782
diff
changeset
|
257 cp .config "$ROOT_TOPDIR"/src/config-busybox && |
726
db5cb617339a
Centrialize BUILD_STATIC and make it apply to more of root-filesystem.sh
Rob Landley <rob@landley.net>
parents:
721
diff
changeset
|
258 LDFLAGS="$LDFLAGS $STATIC_FLAGS" \ |
db5cb617339a
Centrialize BUILD_STATIC and make it apply to more of root-filesystem.sh
Rob Landley <rob@landley.net>
parents:
721
diff
changeset
|
259 make -j $CPUS CROSS_COMPILE="${ARCH}-" $VERBOSITY && |
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
|
260 make busybox.links && |
783
db06a8c1bfed
Lots of changes to move buildall.sh functionality into build.sh.
Rob Landley <rob@landley.net>
parents:
782
diff
changeset
|
261 cp busybox "$ROOT_TOPDIR/bin" |
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
|
262 |
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
|
263 [ $? -ne 0 ] && dienow |
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
|
264 |
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
|
265 for i in $(sed 's@.*/@@' busybox.links) |
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
|
266 do |
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
|
267 # Allowed to fail. |
783
db06a8c1bfed
Lots of changes to move buildall.sh functionality into build.sh.
Rob Landley <rob@landley.net>
parents:
782
diff
changeset
|
268 ln -s busybox "$ROOT_TOPDIR/bin/$i" 2>/dev/null |
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
|
269 done |
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
|
270 cd .. |
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
|
271 |
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
|
272 cleanup busybox |
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
|
273 |
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
|
274 # 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
|
275 |
6d6551a37687
Add make to mini-native (required one more option switched on in uClibc), add
Rob Landley <rob@landley.net>
parents:
51
diff
changeset
|
276 setupfor make |
794
81cf7ae7afce
Teach make, bash, and distcc to honor BUILD_STATIC=1.
Rob Landley <rob@landley.net>
parents:
783
diff
changeset
|
277 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
|
278 --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
|
279 make -j $CPUS && |
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
|
280 make -j $CPUS install && |
301
309b574a5059
Redo the $CLEANUP logic to a cleanup function in include.sh (meaning if a
Rob Landley <rob@landley.net>
parents:
295
diff
changeset
|
281 cd .. |
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
|
282 |
301
309b574a5059
Redo the $CLEANUP logic to a cleanup function in include.sh (meaning if a
Rob Landley <rob@landley.net>
parents:
295
diff
changeset
|
283 cleanup 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
|
284 |
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
|
285 # 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
|
286 |
6d6551a37687
Add make to mini-native (required one more option switched on in uClibc), add
Rob Landley <rob@landley.net>
parents:
51
diff
changeset
|
287 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
|
288 # 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
|
289 #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
|
290 # 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
|
291 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
|
292 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
|
293 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
|
294 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
|
295 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
|
296 EOF |
794
81cf7ae7afce
Teach make, bash, and distcc to honor BUILD_STATIC=1.
Rob Landley <rob@landley.net>
parents:
783
diff
changeset
|
297 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
|
298 ./configure --prefix="$ROOT_TOPDIR" \ |
153
106f3875f606
The bash build continues to be stupid. Force RANLIB.
Rob Landley <rob@landley.net>
parents:
131
diff
changeset
|
299 --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
|
300 --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
|
301 # 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
|
302 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
|
303 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
|
304 # Make bash the default shell. |
783
db06a8c1bfed
Lots of changes to move buildall.sh functionality into build.sh.
Rob Landley <rob@landley.net>
parents:
782
diff
changeset
|
305 ln -sf bash "$ROOT_TOPDIR/bin/sh" && |
301
309b574a5059
Redo the $CLEANUP logic to a cleanup function in include.sh (meaning if a
Rob Landley <rob@landley.net>
parents:
295
diff
changeset
|
306 cd .. |
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
|
307 |
301
309b574a5059
Redo the $CLEANUP logic to a cleanup function in include.sh (meaning if a
Rob Landley <rob@landley.net>
parents:
295
diff
changeset
|
308 cleanup bash |
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
|
309 |
280
00ee362817e1
Cross-compile a native distcc for target.
Rob Landley <rob@landley.net>
parents:
278
diff
changeset
|
310 setupfor distcc |
794
81cf7ae7afce
Teach make, bash, and distcc to honor BUILD_STATIC=1.
Rob Landley <rob@landley.net>
parents:
783
diff
changeset
|
311 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
|
312 --host="${CROSS_TARGET}" --prefix="$ROOT_TOPDIR" \ |
613
518c8e257b3d
Fixes Mark Miller sent for distcc support.
Rob Landley <rob@landley.net>
parents:
598
diff
changeset
|
313 --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
|
314 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
|
315 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
|
316 mkdir -p "$ROOT_TOPDIR/distcc" || dienow |
484 | 317 |
318 for i in gcc cc g++ c++ | |
319 do | |
783
db06a8c1bfed
Lots of changes to move buildall.sh functionality into build.sh.
Rob Landley <rob@landley.net>
parents:
782
diff
changeset
|
320 ln -s ../bin/distcc "$ROOT_TOPDIR/distcc/$i" || dienow |
484 | 321 done |
301
309b574a5059
Redo the $CLEANUP logic to a cleanup function in include.sh (meaning if a
Rob Landley <rob@landley.net>
parents:
295
diff
changeset
|
322 cd .. |
280
00ee362817e1
Cross-compile a native distcc for target.
Rob Landley <rob@landley.net>
parents:
278
diff
changeset
|
323 |
301
309b574a5059
Redo the $CLEANUP logic to a cleanup function in include.sh (meaning if a
Rob Landley <rob@landley.net>
parents:
295
diff
changeset
|
324 cleanup distcc |
280
00ee362817e1
Cross-compile a native distcc for target.
Rob Landley <rob@landley.net>
parents:
278
diff
changeset
|
325 |
83
8fb80545fe84
Move the "hello world" source into sources/toys. Build (in mini-native)
Rob Landley <rob@landley.net>
parents:
81
diff
changeset
|
326 # 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
|
327 # 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
|
328 |
783
db06a8c1bfed
Lots of changes to move buildall.sh functionality into build.sh.
Rob Landley <rob@landley.net>
parents:
782
diff
changeset
|
329 "${ARCH}-cc" "${SOURCES}/toys/hello.c" -Os -s -o "$ROOT_TOPDIR/bin/hello-dynamic" && |
db06a8c1bfed
Lots of changes to move buildall.sh functionality into build.sh.
Rob Landley <rob@landley.net>
parents:
782
diff
changeset
|
330 "${ARCH}-cc" "${SOURCES}/toys/hello.c" -Os -s -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
|
331 |
8fb80545fe84
Move the "hello world" source into sources/toys. Build (in mini-native)
Rob Landley <rob@landley.net>
parents:
81
diff
changeset
|
332 [ $? -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
|
333 |
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
|
334 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
|
335 |
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
|
336 # Delete some unneeded files |
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
|
337 |
783
db06a8c1bfed
Lots of changes to move buildall.sh functionality into build.sh.
Rob Landley <rob@landley.net>
parents:
782
diff
changeset
|
338 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
|
339 |
75
38e7e0cc3b9f
Build mksquashfs in the non-short cross-compiler, and use it at the end of
Rob Landley <rob@landley.net>
parents:
68
diff
changeset
|
340 # Clean up and package the result |
43
6d16887ec084
Intermediate snapshot. Doesn't work yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
341 |
783
db06a8c1bfed
Lots of changes to move buildall.sh functionality into build.sh.
Rob Landley <rob@landley.net>
parents:
782
diff
changeset
|
342 "${ARCH}-strip" "$ROOT_TOPDIR"/{bin/*,sbin/*,libexec/gcc/*/*/*} |
db06a8c1bfed
Lots of changes to move buildall.sh functionality into build.sh.
Rob Landley <rob@landley.net>
parents:
782
diff
changeset
|
343 "${ARCH}-strip" --strip-unneeded "$ROOT_TOPDIR"/lib/*.so |
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
|
344 |
783
db06a8c1bfed
Lots of changes to move buildall.sh functionality into build.sh.
Rob Landley <rob@landley.net>
parents:
782
diff
changeset
|
345 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
|
346 |
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
|
347 # 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
|
348 echo -e "\e[0mBuild complete" |