Mercurial > hg > aboriginal
annotate mini-native.sh @ 280:00ee362817e1
Cross-compile a native distcc for target.
author | Rob Landley <rob@landley.net> |
---|---|
date | Wed, 30 Jan 2008 23:15:46 -0600 |
parents | f878f79763c7 |
children | 353d72c420cc |
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 |
6d16887ec084
Intermediate snapshot. Doesn't work yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
5 source include.sh |
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 |
137ba51ee993
Delete output directories on re-run, teach build to log and build multiple
Rob Landley <rob@landley.net>
parents:
85
diff
changeset
|
7 rm -rf "${NATIVE}" |
137ba51ee993
Delete output directories on re-run, teach build to log and build multiple
Rob Landley <rob@landley.net>
parents:
85
diff
changeset
|
8 |
43
6d16887ec084
Intermediate snapshot. Doesn't work yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
9 TOOLS="${NATIVE}/tools" |
6d16887ec084
Intermediate snapshot. Doesn't work yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
10 mkdir -p "${TOOLS}/bin" || dienow |
6d16887ec084
Intermediate snapshot. Doesn't work yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
11 |
63
89cf9497824e
Teach the native build about ld-uClibc.so.0 can living in /tools.
Rob Landley <rob@landley.net>
parents:
62
diff
changeset
|
12 # Tell the wrapper script where to find the dynamic linker. |
89cf9497824e
Teach the native build about ld-uClibc.so.0 can living in /tools.
Rob Landley <rob@landley.net>
parents:
62
diff
changeset
|
13 export UCLIBC_DYNAMIC_LINKER=/tools/lib/ld-uClibc.so.0 |
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
|
14 export UCLIBC_RPATH=/tools/lib |
63
89cf9497824e
Teach the native build about ld-uClibc.so.0 can living in /tools.
Rob Landley <rob@landley.net>
parents:
62
diff
changeset
|
15 |
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
|
16 # Purple. And why not? |
5aeba79b8f5f
Remove qemu build (it's in cross-compiler.sh now), move uClibc build right
Rob Landley <rob@landley.net>
parents:
46
diff
changeset
|
17 echo -e "\e[35m" |
43
6d16887ec084
Intermediate snapshot. Doesn't work yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
18 |
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
|
19 # Build and install Linux kernel. |
5aeba79b8f5f
Remove qemu build (it's in cross-compiler.sh now), move uClibc build right
Rob Landley <rob@landley.net>
parents:
46
diff
changeset
|
20 |
43
6d16887ec084
Intermediate snapshot. Doesn't work yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
21 setupfor linux |
6d16887ec084
Intermediate snapshot. Doesn't work yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
22 # Install Linux kernel headers (for use by uClibc). |
278
f878f79763c7
Use make -j to install kernel headers.
Rob Landley <rob@landley.net>
parents:
223
diff
changeset
|
23 make headers_install -j "$CPUS" ARCH="${KARCH}" INSTALL_HDR_PATH="${TOOLS}" && |
43
6d16887ec084
Intermediate snapshot. Doesn't work yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
24 # build bootable kernel for target |
85
7c874da5505c
Switch config-linux to miniconfig-linux. Adjust the build and config scripts,
Rob Landley <rob@landley.net>
parents:
83
diff
changeset
|
25 make ARCH="${KARCH}" allnoconfig KCONFIG_ALLCONFIG="${WORK}/miniconfig-linux" && |
182
fc827ab6166f
Autodetect number of processors and feed appropriate -j to make.
Rob Landley <rob@landley.net>
parents:
177
diff
changeset
|
26 make -j $CPUS ARCH="${KARCH}" CROSS_COMPILE="${ARCH}-" && |
155
ce1ca3d0f95b
Put zImage-$ARCH in build directory, not mini-native-$ARCH, and eliminate
Rob Landley <rob@landley.net>
parents:
153
diff
changeset
|
27 cp "${KERNEL_PATH}" "${BUILD}/zImage-${ARCH}" && |
43
6d16887ec084
Intermediate snapshot. Doesn't work yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
28 cd .. && |
223
f6973e090c4f
Update mini-native for the new tarball strategy.
Rob Landley <rob@landley.net>
parents:
221
diff
changeset
|
29 $CLEANUP linux |
43
6d16887ec084
Intermediate snapshot. Doesn't work yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
30 |
6d16887ec084
Intermediate snapshot. Doesn't work yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
31 [ $? -ne 0 ] && dienow |
6d16887ec084
Intermediate snapshot. Doesn't work yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
32 |
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
|
33 # 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
|
34 # 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
|
35 |
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 setupfor uClibc |
131 | 37 make allnoconfig KCONFIG_ALLCONFIG="${WORK}/miniconfig-uClibc" && |
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
|
38 # Can't use -j here, build is unstable. |
68
fd2cf40fcd02
Install the uClibc utils install into /tools/bin. (Including readelf.)
Rob Landley <rob@landley.net>
parents:
66
diff
changeset
|
39 make CROSS="${ARCH}-" KERNEL_HEADERS="${TOOLS}/include" PREFIX="${TOOLS}/" \ |
122 | 40 RUNTIME_PREFIX=/ DEVEL_PREFIX=/ UCLIBC_LDSO_NAME=ld-uClibc \ |
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
|
41 all install_runtime install_dev utils && |
68
fd2cf40fcd02
Install the uClibc utils install into /tools/bin. (Including readelf.)
Rob Landley <rob@landley.net>
parents:
66
diff
changeset
|
42 # utils_install wants to put stuff in usr/bin instead of bin. |
fd2cf40fcd02
Install the uClibc utils install into /tools/bin. (Including readelf.)
Rob Landley <rob@landley.net>
parents:
66
diff
changeset
|
43 install -m 755 utils/{readelf,ldd,ldconfig} "${TOOLS}/bin" && |
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
|
44 cd .. && |
223
f6973e090c4f
Update mini-native for the new tarball strategy.
Rob Landley <rob@landley.net>
parents:
221
diff
changeset
|
45 $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
|
46 |
5aeba79b8f5f
Remove qemu build (it's in cross-compiler.sh now), move uClibc build right
Rob Landley <rob@landley.net>
parents:
46
diff
changeset
|
47 [ $? -ne 0 ] && dienow |
5aeba79b8f5f
Remove qemu build (it's in cross-compiler.sh now), move uClibc build right
Rob Landley <rob@landley.net>
parents:
46
diff
changeset
|
48 |
43
6d16887ec084
Intermediate snapshot. Doesn't work yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
49 # Build and install busybox |
6d16887ec084
Intermediate snapshot. Doesn't work yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
50 |
6d16887ec084
Intermediate snapshot. Doesn't work yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
51 setupfor busybox |
280
00ee362817e1
Cross-compile a native distcc for target.
Rob Landley <rob@landley.net>
parents:
278
diff
changeset
|
52 #cp "${SOURCES}/config-busybox" .config && |
00ee362817e1
Cross-compile a native distcc for target.
Rob Landley <rob@landley.net>
parents:
278
diff
changeset
|
53 #yes "" | make oldconfig && |
43
6d16887ec084
Intermediate snapshot. Doesn't work yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
54 make defconfig && |
182
fc827ab6166f
Autodetect number of processors and feed appropriate -j to make.
Rob Landley <rob@landley.net>
parents:
177
diff
changeset
|
55 make -j $CPUS CROSS="${ARCH}-" && |
43
6d16887ec084
Intermediate snapshot. Doesn't work yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
56 cp busybox "${TOOLS}/bin" |
6d16887ec084
Intermediate snapshot. Doesn't work yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
57 [ $? -ne 0 ] && dienow |
6d16887ec084
Intermediate snapshot. Doesn't work yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
58 for i in $(sed 's@.*/@@' busybox.links) |
6d16887ec084
Intermediate snapshot. Doesn't work yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
59 do |
6d16887ec084
Intermediate snapshot. Doesn't work yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
60 ln -s busybox "${TOOLS}/bin/$i" || dienow |
6d16887ec084
Intermediate snapshot. Doesn't work yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
61 done |
6d16887ec084
Intermediate snapshot. Doesn't work yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
62 cd .. && |
223
f6973e090c4f
Update mini-native for the new tarball strategy.
Rob Landley <rob@landley.net>
parents:
221
diff
changeset
|
63 $CLEANUP busybox |
43
6d16887ec084
Intermediate snapshot. Doesn't work yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
64 |
6d16887ec084
Intermediate snapshot. Doesn't work yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
65 [ $? -ne 0 ] && dienow |
6d16887ec084
Intermediate snapshot. Doesn't work yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
66 |
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
|
67 if [ -z "${BUILD_SHORT}" ] |
5aeba79b8f5f
Remove qemu build (it's in cross-compiler.sh now), move uClibc build right
Rob Landley <rob@landley.net>
parents:
46
diff
changeset
|
68 then |
5aeba79b8f5f
Remove qemu build (it's in cross-compiler.sh now), move uClibc build right
Rob Landley <rob@landley.net>
parents:
46
diff
changeset
|
69 |
43
6d16887ec084
Intermediate snapshot. Doesn't work yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
70 # Build and install native binutils |
6d16887ec084
Intermediate snapshot. Doesn't work yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
71 |
6d16887ec084
Intermediate snapshot. Doesn't work yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
72 setupfor binutils build-binutils |
62
4125b672b00c
Get i686 cross-compiling to work like armv4l cross-compiling by lying to
Rob Landley <rob@landley.net>
parents:
53
diff
changeset
|
73 CC="${ARCH}-gcc" AR="${ARCH}-ar" "${CURSRC}/configure" --prefix="${TOOLS}" \ |
4125b672b00c
Get i686 cross-compiling to work like armv4l cross-compiling by lying to
Rob Landley <rob@landley.net>
parents:
53
diff
changeset
|
74 --build="${CROSS_HOST}" --host="${CROSS_TARGET}" --target="${CROSS_TARGET}" \ |
4125b672b00c
Get i686 cross-compiling to work like armv4l cross-compiling by lying to
Rob Landley <rob@landley.net>
parents:
53
diff
changeset
|
75 --disable-nls --disable-shared --disable-multilib --program-prefix= \ |
4125b672b00c
Get i686 cross-compiling to work like armv4l cross-compiling by lying to
Rob Landley <rob@landley.net>
parents:
53
diff
changeset
|
76 $BINUTILS_FLAGS && |
43
6d16887ec084
Intermediate snapshot. Doesn't work yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
77 make configure-host && |
182
fc827ab6166f
Autodetect number of processors and feed appropriate -j to make.
Rob Landley <rob@landley.net>
parents:
177
diff
changeset
|
78 make -j $CPUS && |
43
6d16887ec084
Intermediate snapshot. Doesn't work yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
79 make install && |
6d16887ec084
Intermediate snapshot. Doesn't work yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
80 cd .. && |
6d16887ec084
Intermediate snapshot. Doesn't work yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
81 mkdir -p "${TOOLS}/include" && |
223
f6973e090c4f
Update mini-native for the new tarball strategy.
Rob Landley <rob@landley.net>
parents:
221
diff
changeset
|
82 cp binutils/include/libiberty.h "${TOOLS}/include" && |
f6973e090c4f
Update mini-native for the new tarball strategy.
Rob Landley <rob@landley.net>
parents:
221
diff
changeset
|
83 $CLEANUP binutils build-binutils |
43
6d16887ec084
Intermediate snapshot. Doesn't work yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
84 |
6d16887ec084
Intermediate snapshot. Doesn't work yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
85 [ $? -ne 0 ] && dienow |
6d16887ec084
Intermediate snapshot. Doesn't work yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
86 |
6d16887ec084
Intermediate snapshot. Doesn't work yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
87 # 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
|
88 |
223
f6973e090c4f
Update mini-native for the new tarball strategy.
Rob Landley <rob@landley.net>
parents:
221
diff
changeset
|
89 setupfor gcc-core build-gcc |
f6973e090c4f
Update mini-native for the new tarball strategy.
Rob Landley <rob@landley.net>
parents:
221
diff
changeset
|
90 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
|
91 # 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
|
92 # files. Cut out those bits with sed and throw them away. |
5aeba79b8f5f
Remove qemu build (it's in cross-compiler.sh now), move uClibc build right
Rob Landley <rob@landley.net>
parents:
46
diff
changeset
|
93 sed -i 's@\./fixinc\.sh@-c true@' "${CURSRC}/gcc/Makefile.in" && |
46
eeddef87a747
Still doesn't work, but doesn't work better.
Rob Landley <rob@landley.net>
parents:
44
diff
changeset
|
94 # 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
|
95 # be using. These assumptions are wrong, and lots of redundant corrections |
eeddef87a747
Still doesn't work, but doesn't work better.
Rob Landley <rob@landley.net>
parents:
44
diff
changeset
|
96 # are required to make it stop. |
eeddef87a747
Still doesn't work, but doesn't work better.
Rob Landley <rob@landley.net>
parents:
44
diff
changeset
|
97 CC="${ARCH}-gcc" GCC_FOR_TARGET="${ARCH}-gcc" CC_FOR_TARGET="${ARCH}-gcc" \ |
164
5ff6e721fdbf
as != ar. How did that ever work?
Rob Landley <rob@landley.net>
parents:
157
diff
changeset
|
98 AR="${ARCH}-ar" AR_FOR_TARGET="${ARCH}-ar" AS="${ARCH}-as" LD="${ARCH}-ld" \ |
46
eeddef87a747
Still doesn't work, but doesn't work better.
Rob Landley <rob@landley.net>
parents:
44
diff
changeset
|
99 NM="${ARCH}-nm" NM_FOR_TARGET="${ARCH}-nm" \ |
129
0bfd1ada5183
Make armv4l do soft-float instead of vfp. Thanks to James Newell and
Rob Landley <rob@landley.net>
parents:
122
diff
changeset
|
100 "${CURSRC}/configure" --prefix="${TOOLS}" --disable-multilib $GCC_FLAGS \ |
43
6d16887ec084
Intermediate snapshot. Doesn't work yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
101 --build="${CROSS_HOST}" --host="${CROSS_TARGET}" --target="${CROSS_TARGET}" \ |
6d16887ec084
Intermediate snapshot. Doesn't work yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
102 --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
|
103 --enable-__cxa_atexit --disable-nls --enable-languages=c,c++ \ |
62
4125b672b00c
Get i686 cross-compiling to work like armv4l cross-compiling by lying to
Rob Landley <rob@landley.net>
parents:
53
diff
changeset
|
104 --disable-libstdcxx-pch --program-prefix="" && |
182
fc827ab6166f
Autodetect number of processors and feed appropriate -j to make.
Rob Landley <rob@landley.net>
parents:
177
diff
changeset
|
105 make -j $CPUS all-gcc && |
43
6d16887ec084
Intermediate snapshot. Doesn't work yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
106 make install-gcc && |
6d16887ec084
Intermediate snapshot. Doesn't work yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
107 ln -s gcc "${TOOLS}/bin/cc" && |
6d16887ec084
Intermediate snapshot. Doesn't work yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
108 cd .. && |
223
f6973e090c4f
Update mini-native for the new tarball strategy.
Rob Landley <rob@landley.net>
parents:
221
diff
changeset
|
109 $CLEANUP gcc-core build-gcc |
43
6d16887ec084
Intermediate snapshot. Doesn't work yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
110 |
6d16887ec084
Intermediate snapshot. Doesn't work yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
111 [ $? -ne 0 ] && dienow |
6d16887ec084
Intermediate snapshot. Doesn't work yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
112 |
6d16887ec084
Intermediate snapshot. Doesn't work yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
113 # Move the gcc internal libraries and headers somewhere sane. |
6d16887ec084
Intermediate snapshot. Doesn't work yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
114 |
6d16887ec084
Intermediate snapshot. Doesn't work yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
115 mkdir -p "${TOOLS}"/gcc && |
6d16887ec084
Intermediate snapshot. Doesn't work yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
116 mv "${TOOLS}"/lib/gcc/*/*/include "${TOOLS}"/gcc/include && |
6d16887ec084
Intermediate snapshot. Doesn't work yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
117 mv "${TOOLS}"/lib/gcc/*/* "${TOOLS}"/gcc/lib && |
6d16887ec084
Intermediate snapshot. Doesn't work yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
118 $CLEANUP "${TOOLS}"/{lib/gcc,gcc/lib/install-tools} && |
6d16887ec084
Intermediate snapshot. Doesn't work yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
119 |
6d16887ec084
Intermediate snapshot. Doesn't work yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
120 # Build and install gcc wrapper script. |
6d16887ec084
Intermediate snapshot. Doesn't work yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
121 |
51
f96f7a24642a
A native compiler doesn't have a cross-prefix.
Rob Landley <rob@landley.net>
parents:
50
diff
changeset
|
122 mv "${TOOLS}/bin/gcc" "${TOOLS}/bin/gcc-unwrapped" && |
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
|
123 "${ARCH}-gcc" "${TOP}"/sources/toys/gcc-uClibc.c -Os -s -o "${TOOLS}/bin/gcc" |
43
6d16887ec084
Intermediate snapshot. Doesn't work yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
124 |
6d16887ec084
Intermediate snapshot. Doesn't work yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
125 [ $? -ne 0 ] && dienow |
6d16887ec084
Intermediate snapshot. Doesn't work yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
126 |
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
|
127 # 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
|
128 |
6d6551a37687
Add make to mini-native (required one more option switched on in uClibc), add
Rob Landley <rob@landley.net>
parents:
51
diff
changeset
|
129 setupfor 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
|
130 CC="${ARCH}-gcc" ./configure --prefix="${TOOLS}" --build="${CROSS_HOST}" \ |
6d6551a37687
Add make to mini-native (required one more option switched on in uClibc), add
Rob Landley <rob@landley.net>
parents:
51
diff
changeset
|
131 --host="${CROSS_TARGET}" && |
182
fc827ab6166f
Autodetect number of processors and feed appropriate -j to make.
Rob Landley <rob@landley.net>
parents:
177
diff
changeset
|
132 make -j $CPUS && |
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
|
133 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
|
134 cd .. && |
223
f6973e090c4f
Update mini-native for the new tarball strategy.
Rob Landley <rob@landley.net>
parents:
221
diff
changeset
|
135 $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
|
136 |
6d6551a37687
Add make to mini-native (required one more option switched on in uClibc), add
Rob Landley <rob@landley.net>
parents:
51
diff
changeset
|
137 [ $? -ne 0 ] && dienow |
6d6551a37687
Add make to mini-native (required one more option switched on in uClibc), add
Rob Landley <rob@landley.net>
parents:
51
diff
changeset
|
138 |
6d6551a37687
Add make to mini-native (required one more option switched on in uClibc), add
Rob Landley <rob@landley.net>
parents:
51
diff
changeset
|
139 # Build and install bash. (Yes, this is an old version. I prefer it.) |
6d6551a37687
Add make to mini-native (required one more option switched on in uClibc), add
Rob Landley <rob@landley.net>
parents:
51
diff
changeset
|
140 # I plan to replace it with toysh anyway. |
6d6551a37687
Add make to mini-native (required one more option switched on in uClibc), add
Rob Landley <rob@landley.net>
parents:
51
diff
changeset
|
141 |
6d6551a37687
Add make to mini-native (required one more option switched on in uClibc), add
Rob Landley <rob@landley.net>
parents:
51
diff
changeset
|
142 setupfor bash |
6d6551a37687
Add make to mini-native (required one more option switched on in uClibc), add
Rob Landley <rob@landley.net>
parents:
51
diff
changeset
|
143 # 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
|
144 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
|
145 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
|
146 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
|
147 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
|
148 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
|
149 EOF |
157
dff36fab9e7e
Of course there's a bug. (The ranlib fix was apparently a NOP, this should
Rob Landley <rob@landley.net>
parents:
155
diff
changeset
|
150 CC="${ARCH}-gcc" RANLIB="${ARCH}-ranlib" ./configure --prefix="${TOOLS}" \ |
153
106f3875f606
The bash build continues to be stupid. Force RANLIB.
Rob Landley <rob@landley.net>
parents:
131
diff
changeset
|
151 --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
|
152 --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
|
153 # 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
|
154 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
|
155 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
|
156 # Make bash the default shell. |
6d6551a37687
Add make to mini-native (required one more option switched on in uClibc), add
Rob Landley <rob@landley.net>
parents:
51
diff
changeset
|
157 ln -s bash "${TOOLS}/bin/sh" && |
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 cd .. && |
223
f6973e090c4f
Update mini-native for the new tarball strategy.
Rob Landley <rob@landley.net>
parents:
221
diff
changeset
|
159 $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
|
160 |
6d6551a37687
Add make to mini-native (required one more option switched on in uClibc), add
Rob Landley <rob@landley.net>
parents:
51
diff
changeset
|
161 [ $? -ne 0 ] && dienow |
6d6551a37687
Add make to mini-native (required one more option switched on in uClibc), add
Rob Landley <rob@landley.net>
parents:
51
diff
changeset
|
162 |
280
00ee362817e1
Cross-compile a native distcc for target.
Rob Landley <rob@landley.net>
parents:
278
diff
changeset
|
163 setupfor distcc |
00ee362817e1
Cross-compile a native distcc for target.
Rob Landley <rob@landley.net>
parents:
278
diff
changeset
|
164 ./configure --host="${ARCH}" --prefix="${TOOLS}" --with-included-popt && |
00ee362817e1
Cross-compile a native distcc for target.
Rob Landley <rob@landley.net>
parents:
278
diff
changeset
|
165 make -j "$CPUS" && |
00ee362817e1
Cross-compile a native distcc for target.
Rob Landley <rob@landley.net>
parents:
278
diff
changeset
|
166 make install && |
00ee362817e1
Cross-compile a native distcc for target.
Rob Landley <rob@landley.net>
parents:
278
diff
changeset
|
167 cd .. && |
00ee362817e1
Cross-compile a native distcc for target.
Rob Landley <rob@landley.net>
parents:
278
diff
changeset
|
168 $CLEANUP distcc |
00ee362817e1
Cross-compile a native distcc for target.
Rob Landley <rob@landley.net>
parents:
278
diff
changeset
|
169 |
00ee362817e1
Cross-compile a native distcc for target.
Rob Landley <rob@landley.net>
parents:
278
diff
changeset
|
170 [ $? -ne 0 ] && dienow |
00ee362817e1
Cross-compile a native distcc for target.
Rob Landley <rob@landley.net>
parents:
278
diff
changeset
|
171 |
83
8fb80545fe84
Move the "hello world" source into sources/toys. Build (in mini-native)
Rob Landley <rob@landley.net>
parents:
81
diff
changeset
|
172 # Put statically and dynamically linked hello world programs on there for |
221
a0a17e78c07d
Install the qemu-setup.sh script into the target.
Rob Landley <rob@landley.net>
parents:
183
diff
changeset
|
173 # test purposes, and a qemu setup script. |
83
8fb80545fe84
Move the "hello world" source into sources/toys. Build (in mini-native)
Rob Landley <rob@landley.net>
parents:
81
diff
changeset
|
174 |
8fb80545fe84
Move the "hello world" source into sources/toys. Build (in mini-native)
Rob Landley <rob@landley.net>
parents:
81
diff
changeset
|
175 "${ARCH}-gcc" "${SOURCES}/toys/hello.c" -Os -s -o "${TOOLS}/bin/hello-dynamic" && |
8fb80545fe84
Move the "hello world" source into sources/toys. Build (in mini-native)
Rob Landley <rob@landley.net>
parents:
81
diff
changeset
|
176 "${ARCH}-gcc" "${SOURCES}/toys/hello.c" -Os -s -static -o "${TOOLS}/bin/hello-static" && |
221
a0a17e78c07d
Install the qemu-setup.sh script into the target.
Rob Landley <rob@landley.net>
parents:
183
diff
changeset
|
177 cp "${SOURCES}/native/setup.sh" "${TOOLS}/bin/qemu-setup.sh" |
83
8fb80545fe84
Move the "hello world" source into sources/toys. Build (in mini-native)
Rob Landley <rob@landley.net>
parents:
81
diff
changeset
|
178 |
8fb80545fe84
Move the "hello world" source into sources/toys. Build (in mini-native)
Rob Landley <rob@landley.net>
parents:
81
diff
changeset
|
179 [ $? -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
|
180 |
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
|
181 fi |
43
6d16887ec084
Intermediate snapshot. Doesn't work yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
182 |
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
|
183 # Clean up and package the result |
43
6d16887ec084
Intermediate snapshot. Doesn't work yet.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
184 |
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
|
185 "${ARCH}-strip" "${TOOLS}"/{bin/*,sbin/*,libexec/gcc/*/*/*} |
3fd961e31444
Build a gcc wrapper for _target_, and add a "strip" command to halve the
Rob Landley <rob@landley.net>
parents:
52
diff
changeset
|
186 |
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
|
187 cd "${BUILD}" |
81
6dd38c925bc4
Upgrade some packages, and other cleanups.
Rob Landley <rob@landley.net>
parents:
75
diff
changeset
|
188 #echo -n "Creating tools.sqf" |
6dd38c925bc4
Upgrade some packages, and other cleanups.
Rob Landley <rob@landley.net>
parents:
75
diff
changeset
|
189 #("${WORK}/mksquashfs" "${NATIVE}/tools" "tools-${ARCH}.sqf" \ |
6dd38c925bc4
Upgrade some packages, and other cleanups.
Rob Landley <rob@landley.net>
parents:
75
diff
changeset
|
190 # -noappend -all-root -info || dienow) | dotprogress |
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
|
191 |
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
|
192 echo -n creating mini-native-"${ARCH}".tar.bz2 && |
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
|
193 { tar cjvf "mini-native-${ARCH}.tar.bz2" "mini-native-${ARCH}" || dienow |
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
|
194 } | dotprogress |
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
|
195 |
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
|
196 # 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
|
197 echo -e "\e[0mBuild complete" |