annotate cross-compiler.sh @ 88:f56cfecf4621 0.1.1

Again, use $QEMU_TEST instead of $KARCH. (For mipsel, they don't match.)
author Rob Landley <rob@landley.net>
date Sun, 14 Jan 2007 15:45:27 -0500
parents cb4ddcaed8eb
children 153ba1a0b427
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
9add2b1ccdfa First version of new build script. Does nothing, but does it correctly.
landley@driftwood
parents:
diff changeset
1 #!/bin/sh
9add2b1ccdfa First version of new build script. Does nothing, but does it correctly.
landley@driftwood
parents:
diff changeset
2
34
ad1cfcb043c7 Cleaup pass: Break out shell functions and variable definitions into include.sh.
Rob Landley <rob@landley.net>
parents: 33
diff changeset
3 # Get lots of predefined environment variables and shell functions.
3
1b721a51e9c6 Extract headers, build cross-binutils, build cross-gcc. Needs a C library.
landley@driftwood
parents: 1
diff changeset
4
34
ad1cfcb043c7 Cleaup pass: Break out shell functions and variable definitions into include.sh.
Rob Landley <rob@landley.net>
parents: 33
diff changeset
5 source include.sh
1
9add2b1ccdfa First version of new build script. Does nothing, but does it correctly.
landley@driftwood
parents:
diff changeset
6
41
3baa8ab7ee6d Largeish update.
Rob Landley <rob@landley.net>
parents: 39
diff changeset
7 mkdir -p "${CROSS}" || dienow
3baa8ab7ee6d Largeish update.
Rob Landley <rob@landley.net>
parents: 39
diff changeset
8
47
edaa86240321 Turnerize the build script and teach cross-compile.sh to build qemu when
Rob Landley <rob@landley.net>
parents: 41
diff changeset
9 # Orange
edaa86240321 Turnerize the build script and teach cross-compile.sh to build qemu when
Rob Landley <rob@landley.net>
parents: 41
diff changeset
10 echo -e "\e[33m"
edaa86240321 Turnerize the build script and teach cross-compile.sh to build qemu when
Rob Landley <rob@landley.net>
parents: 41
diff changeset
11
18
eaf7a8d5e697 Managed to get a working toolchain, with wrapper script, to build a hello
Rob Landley <rob@landley.net>
parents: 17
diff changeset
12 # Build and install binutils
eaf7a8d5e697 Managed to get a working toolchain, with wrapper script, to build a hello
Rob Landley <rob@landley.net>
parents: 17
diff changeset
13
3
1b721a51e9c6 Extract headers, build cross-binutils, build cross-gcc. Needs a C library.
landley@driftwood
parents: 1
diff changeset
14 setupfor binutils build-binutils
1b721a51e9c6 Extract headers, build cross-binutils, build cross-gcc. Needs a C library.
landley@driftwood
parents: 1
diff changeset
15 "${CURSRC}/configure" --prefix="${CROSS}" --host=${CROSS_HOST} \
1b721a51e9c6 Extract headers, build cross-binutils, build cross-gcc. Needs a C library.
landley@driftwood
parents: 1
diff changeset
16 --target=${CROSS_TARGET} --with-lib-path=lib --disable-nls \
59
18c065749b79 Add i686 and x86_64 config files. (Might or might not work, dunno.)
Rob Landley <rob@landley.net>
parents: 48
diff changeset
17 --disable-shared --disable-multilib --program-prefix="${ARCH}-" \
18c065749b79 Add i686 and x86_64 config files. (Might or might not work, dunno.)
Rob Landley <rob@landley.net>
parents: 48
diff changeset
18 $BINUTILS_FLAGS &&
3
1b721a51e9c6 Extract headers, build cross-binutils, build cross-gcc. Needs a C library.
landley@driftwood
parents: 1
diff changeset
19 make configure-host &&
1b721a51e9c6 Extract headers, build cross-binutils, build cross-gcc. Needs a C library.
landley@driftwood
parents: 1
diff changeset
20 make &&
1b721a51e9c6 Extract headers, build cross-binutils, build cross-gcc. Needs a C library.
landley@driftwood
parents: 1
diff changeset
21 make install &&
1b721a51e9c6 Extract headers, build cross-binutils, build cross-gcc. Needs a C library.
landley@driftwood
parents: 1
diff changeset
22 cd .. &&
33
bf2e771f4ba5 Update build script. Now uses a config file (usage: ./build.sh arch), and
Rob Landley <rob@landley.net>
parents: 27
diff changeset
23 mkdir -p "${CROSS}/include" &&
3
1b721a51e9c6 Extract headers, build cross-binutils, build cross-gcc. Needs a C library.
landley@driftwood
parents: 1
diff changeset
24 cp binutils-*/include/libiberty.h "${CROSS}/include" &&
15
11b76d1cc1cd Trying to build an arm toolchain (so I can test "hello world" with arm
Rob Landley <rob@landley.net>
parents: 9
diff changeset
25 $CLEANUP binutils-* build-binutils
3
1b721a51e9c6 Extract headers, build cross-binutils, build cross-gcc. Needs a C library.
landley@driftwood
parents: 1
diff changeset
26
1b721a51e9c6 Extract headers, build cross-binutils, build cross-gcc. Needs a C library.
landley@driftwood
parents: 1
diff changeset
27 [ $? -ne 0 ] && dienow
1b721a51e9c6 Extract headers, build cross-binutils, build cross-gcc. Needs a C library.
landley@driftwood
parents: 1
diff changeset
28
18
eaf7a8d5e697 Managed to get a working toolchain, with wrapper script, to build a hello
Rob Landley <rob@landley.net>
parents: 17
diff changeset
29 # Build and install gcc
eaf7a8d5e697 Managed to get a working toolchain, with wrapper script, to build a hello
Rob Landley <rob@landley.net>
parents: 17
diff changeset
30
8
0068264ad65a Some work I did back in october but hadn't checked in yet: let setupfor()
Rob Landley <rob@landley.net>
parents: 3
diff changeset
31 setupfor gcc-core build-gcc gcc-
59
18c065749b79 Add i686 and x86_64 config files. (Might or might not work, dunno.)
Rob Landley <rob@landley.net>
parents: 48
diff changeset
32 AR_FOR_TARGET="${ARCH}-ar" "${CURSRC}/configure" $GCC_FLAGS \
18c065749b79 Add i686 and x86_64 config files. (Might or might not work, dunno.)
Rob Landley <rob@landley.net>
parents: 48
diff changeset
33 --prefix="${CROSS}" --host=${CROSS_HOST} --target=${CROSS_TARGET} \
18c065749b79 Add i686 and x86_64 config files. (Might or might not work, dunno.)
Rob Landley <rob@landley.net>
parents: 48
diff changeset
34 --enable-languages=c --disable-threads --disable-multilib \
18c065749b79 Add i686 and x86_64 config files. (Might or might not work, dunno.)
Rob Landley <rob@landley.net>
parents: 48
diff changeset
35 --disable-nls --disable-shared $GCC_FLAGS --program-prefix="${ARCH}-" &&
3
1b721a51e9c6 Extract headers, build cross-binutils, build cross-gcc. Needs a C library.
landley@driftwood
parents: 1
diff changeset
36 make all-gcc &&
1b721a51e9c6 Extract headers, build cross-binutils, build cross-gcc. Needs a C library.
landley@driftwood
parents: 1
diff changeset
37 make install-gcc &&
1b721a51e9c6 Extract headers, build cross-binutils, build cross-gcc. Needs a C library.
landley@driftwood
parents: 1
diff changeset
38 cd .. &&
18
eaf7a8d5e697 Managed to get a working toolchain, with wrapper script, to build a hello
Rob Landley <rob@landley.net>
parents: 17
diff changeset
39
41
3baa8ab7ee6d Largeish update.
Rob Landley <rob@landley.net>
parents: 39
diff changeset
40 echo Fixup toolchain... &&
3baa8ab7ee6d Largeish update.
Rob Landley <rob@landley.net>
parents: 39
diff changeset
41
18
eaf7a8d5e697 Managed to get a working toolchain, with wrapper script, to build a hello
Rob Landley <rob@landley.net>
parents: 17
diff changeset
42 # Move the gcc internal libraries and headers somewhere sane.
eaf7a8d5e697 Managed to get a working toolchain, with wrapper script, to build a hello
Rob Landley <rob@landley.net>
parents: 17
diff changeset
43
21
c4e1bd04035d Build uClibc under the wrapper script. (There's got to be a better way to
Rob Landley <rob@landley.net>
parents: 18
diff changeset
44 mkdir -p "${CROSS}"/gcc &&
c4e1bd04035d Build uClibc under the wrapper script. (There's got to be a better way to
Rob Landley <rob@landley.net>
parents: 18
diff changeset
45 mv "${CROSS}"/lib/gcc/*/*/include "${CROSS}"/gcc/include &&
c4e1bd04035d Build uClibc under the wrapper script. (There's got to be a better way to
Rob Landley <rob@landley.net>
parents: 18
diff changeset
46 mv "${CROSS}"/lib/gcc/*/* "${CROSS}"/gcc/lib &&
c4e1bd04035d Build uClibc under the wrapper script. (There's got to be a better way to
Rob Landley <rob@landley.net>
parents: 18
diff changeset
47 $CLEANUP "${CURSRC}" build-gcc "${CROSS}"/{lib/gcc,gcc/lib/install-tools} &&
c4e1bd04035d Build uClibc under the wrapper script. (There's got to be a better way to
Rob Landley <rob@landley.net>
parents: 18
diff changeset
48
61
eb42ad9e8f81 Shuffle comments around.
Rob Landley <rob@landley.net>
parents: 59
diff changeset
49 # Build and install gcc wrapper script.
41
3baa8ab7ee6d Largeish update.
Rob Landley <rob@landley.net>
parents: 39
diff changeset
50
3baa8ab7ee6d Largeish update.
Rob Landley <rob@landley.net>
parents: 39
diff changeset
51 cd "${CROSS}"/bin &&
3baa8ab7ee6d Largeish update.
Rob Landley <rob@landley.net>
parents: 39
diff changeset
52 mv "${ARCH}-gcc" gcc-unwrapped &&
3baa8ab7ee6d Largeish update.
Rob Landley <rob@landley.net>
parents: 39
diff changeset
53 gcc "${TOP}"/sources/toys/gcc-uClibc.c -Os -s -o "${ARCH}-gcc"
3
1b721a51e9c6 Extract headers, build cross-binutils, build cross-gcc. Needs a C library.
landley@driftwood
parents: 1
diff changeset
54
8
0068264ad65a Some work I did back in october but hadn't checked in yet: let setupfor()
Rob Landley <rob@landley.net>
parents: 3
diff changeset
55 [ $? -ne 0 ] && dienow
0068264ad65a Some work I did back in october but hadn't checked in yet: let setupfor()
Rob Landley <rob@landley.net>
parents: 3
diff changeset
56
85
7c874da5505c Switch config-linux to miniconfig-linux. Adjust the build and config scripts,
Rob Landley <rob@landley.net>
parents: 83
diff changeset
57 # Install kernel headers.
33
bf2e771f4ba5 Update build script. Now uses a config file (usage: ./build.sh arch), and
Rob Landley <rob@landley.net>
parents: 27
diff changeset
58
bf2e771f4ba5 Update build script. Now uses a config file (usage: ./build.sh arch), and
Rob Landley <rob@landley.net>
parents: 27
diff changeset
59 setupfor linux
bf2e771f4ba5 Update build script. Now uses a config file (usage: ./build.sh arch), and
Rob Landley <rob@landley.net>
parents: 27
diff changeset
60 # Install Linux kernel headers (for use by uClibc).
bf2e771f4ba5 Update build script. Now uses a config file (usage: ./build.sh arch), and
Rob Landley <rob@landley.net>
parents: 27
diff changeset
61 make headers_install ARCH="${KARCH}" INSTALL_HDR_PATH="${CROSS}" &&
bf2e771f4ba5 Update build script. Now uses a config file (usage: ./build.sh arch), and
Rob Landley <rob@landley.net>
parents: 27
diff changeset
62 cd .. &&
bf2e771f4ba5 Update build script. Now uses a config file (usage: ./build.sh arch), and
Rob Landley <rob@landley.net>
parents: 27
diff changeset
63 $CLEANUP linux-*
bf2e771f4ba5 Update build script. Now uses a config file (usage: ./build.sh arch), and
Rob Landley <rob@landley.net>
parents: 27
diff changeset
64
bf2e771f4ba5 Update build script. Now uses a config file (usage: ./build.sh arch), and
Rob Landley <rob@landley.net>
parents: 27
diff changeset
65 [ $? -ne 0 ] && dienow
bf2e771f4ba5 Update build script. Now uses a config file (usage: ./build.sh arch), and
Rob Landley <rob@landley.net>
parents: 27
diff changeset
66
18
eaf7a8d5e697 Managed to get a working toolchain, with wrapper script, to build a hello
Rob Landley <rob@landley.net>
parents: 17
diff changeset
67 # Build and install uClibc
eaf7a8d5e697 Managed to get a working toolchain, with wrapper script, to build a hello
Rob Landley <rob@landley.net>
parents: 17
diff changeset
68
8
0068264ad65a Some work I did back in october but hadn't checked in yet: let setupfor()
Rob Landley <rob@landley.net>
parents: 3
diff changeset
69 setupfor uClibc
33
bf2e771f4ba5 Update build script. Now uses a config file (usage: ./build.sh arch), and
Rob Landley <rob@landley.net>
parents: 27
diff changeset
70 cp "${WORK}"/config-uClibc .config &&
41
3baa8ab7ee6d Largeish update.
Rob Landley <rob@landley.net>
parents: 39
diff changeset
71 (yes "" | make CROSS="${ARCH}-" oldconfig) > /dev/null &&
66
57f77c25b39d Hit uClibc build with a large rock so it stops inserting hardwired paths in
Rob Landley <rob@landley.net>
parents: 61
diff changeset
72 make CROSS="${ARCH}-" KERNEL_HEADERS="${CROSS}/include" PREFIX="${CROSS}/" \
57f77c25b39d Hit uClibc build with a large rock so it stops inserting hardwired paths in
Rob Landley <rob@landley.net>
parents: 61
diff changeset
73 RUNTIME_PREFIX=/ DEVEL_PREFIX=/ all install_runtime install_dev &&
47
edaa86240321 Turnerize the build script and teach cross-compile.sh to build qemu when
Rob Landley <rob@landley.net>
parents: 41
diff changeset
74 # This needs to be built with the native compiler. Since uClibc uses $CROSS
edaa86240321 Turnerize the build script and teach cross-compile.sh to build qemu when
Rob Landley <rob@landley.net>
parents: 41
diff changeset
75 # internally, we have to blank it to avoid confusing them.
edaa86240321 Turnerize the build script and teach cross-compile.sh to build qemu when
Rob Landley <rob@landley.net>
parents: 41
diff changeset
76 #CROSS= make KERNEL_HEADERS="${CROSS}/include" \
edaa86240321 Turnerize the build script and teach cross-compile.sh to build qemu when
Rob Landley <rob@landley.net>
parents: 41
diff changeset
77 # RUNTIME_PREFIX="${CROSS}/" DEVEL_PREFIX="${CROSS}/" install_utils &&
8
0068264ad65a Some work I did back in october but hadn't checked in yet: let setupfor()
Rob Landley <rob@landley.net>
parents: 3
diff changeset
78 cd .. &&
33
bf2e771f4ba5 Update build script. Now uses a config file (usage: ./build.sh arch), and
Rob Landley <rob@landley.net>
parents: 27
diff changeset
79 $CLEANUP uClibc*
3
1b721a51e9c6 Extract headers, build cross-binutils, build cross-gcc. Needs a C library.
landley@driftwood
parents: 1
diff changeset
80
18
eaf7a8d5e697 Managed to get a working toolchain, with wrapper script, to build a hello
Rob Landley <rob@landley.net>
parents: 17
diff changeset
81 [ $? -ne 0 ] && dienow
eaf7a8d5e697 Managed to get a working toolchain, with wrapper script, to build a hello
Rob Landley <rob@landley.net>
parents: 17
diff changeset
82
47
edaa86240321 Turnerize the build script and teach cross-compile.sh to build qemu when
Rob Landley <rob@landley.net>
parents: 41
diff changeset
83 # Skip this part if we're doing a short build.
edaa86240321 Turnerize the build script and teach cross-compile.sh to build qemu when
Rob Landley <rob@landley.net>
parents: 41
diff changeset
84
edaa86240321 Turnerize the build script and teach cross-compile.sh to build qemu when
Rob Landley <rob@landley.net>
parents: 41
diff changeset
85 if [ -z "${BUILD_SHORT}" ]
edaa86240321 Turnerize the build script and teach cross-compile.sh to build qemu when
Rob Landley <rob@landley.net>
parents: 41
diff changeset
86 then
edaa86240321 Turnerize the build script and teach cross-compile.sh to build qemu when
Rob Landley <rob@landley.net>
parents: 41
diff changeset
87
75
38e7e0cc3b9f Build mksquashfs in the non-short cross-compiler, and use it at the end of
Rob Landley <rob@landley.net>
parents: 66
diff changeset
88 # Build squashfs
38e7e0cc3b9f Build mksquashfs in the non-short cross-compiler, and use it at the end of
Rob Landley <rob@landley.net>
parents: 66
diff changeset
89 setupfor squashfs
38e7e0cc3b9f Build mksquashfs in the non-short cross-compiler, and use it at the end of
Rob Landley <rob@landley.net>
parents: 66
diff changeset
90 cd squashfs-tools &&
38e7e0cc3b9f Build mksquashfs in the non-short cross-compiler, and use it at the end of
Rob Landley <rob@landley.net>
parents: 66
diff changeset
91 make &&
38e7e0cc3b9f Build mksquashfs in the non-short cross-compiler, and use it at the end of
Rob Landley <rob@landley.net>
parents: 66
diff changeset
92 cp mksquashfs unsquashfs "${CROSS}/bin" &&
78
c06dd9a46957 Be in the right directory to clean up squashfs source.
Rob Landley <rob@landley.net>
parents: 75
diff changeset
93 cd .. &&
75
38e7e0cc3b9f Build mksquashfs in the non-short cross-compiler, and use it at the end of
Rob Landley <rob@landley.net>
parents: 66
diff changeset
94 $CLEANUP squashfs*
38e7e0cc3b9f Build mksquashfs in the non-short cross-compiler, and use it at the end of
Rob Landley <rob@landley.net>
parents: 66
diff changeset
95
80
92dd34025932 Teach the cross compiler to only build the qemu targets currently needed,
Rob Landley <rob@landley.net>
parents: 79
diff changeset
96 [ $? -ne 0 ] && dienow
92dd34025932 Teach the cross compiler to only build the qemu targets currently needed,
Rob Landley <rob@landley.net>
parents: 79
diff changeset
97
47
edaa86240321 Turnerize the build script and teach cross-compile.sh to build qemu when
Rob Landley <rob@landley.net>
parents: 41
diff changeset
98 # Build qemu
80
92dd34025932 Teach the cross compiler to only build the qemu targets currently needed,
Rob Landley <rob@landley.net>
parents: 79
diff changeset
99
87
cb4ddcaed8eb Helps to actually use the right value when building qemu application emulation.
Rob Landley <rob@landley.net>
parents: 85
diff changeset
100 [ -z "$QEMU_TEST" ] || QEMU_BUILD_TARGET="${QEMU_TEST}-user"
80
92dd34025932 Teach the cross compiler to only build the qemu targets currently needed,
Rob Landley <rob@landley.net>
parents: 79
diff changeset
101
47
edaa86240321 Turnerize the build script and teach cross-compile.sh to build qemu when
Rob Landley <rob@landley.net>
parents: 41
diff changeset
102 setupfor qemu &&
80
92dd34025932 Teach the cross compiler to only build the qemu targets currently needed,
Rob Landley <rob@landley.net>
parents: 79
diff changeset
103 ./configure --disable-gcc-check --disable-gfx-check \
92dd34025932 Teach the cross compiler to only build the qemu targets currently needed,
Rob Landley <rob@landley.net>
parents: 79
diff changeset
104 --target-list="${KARCH}-softmmu $QEMU_BUILD_TARGET" --prefix="${CROSS}" &&
47
edaa86240321 Turnerize the build script and teach cross-compile.sh to build qemu when
Rob Landley <rob@landley.net>
parents: 41
diff changeset
105 make &&
edaa86240321 Turnerize the build script and teach cross-compile.sh to build qemu when
Rob Landley <rob@landley.net>
parents: 41
diff changeset
106 make install &&
edaa86240321 Turnerize the build script and teach cross-compile.sh to build qemu when
Rob Landley <rob@landley.net>
parents: 41
diff changeset
107 cd .. &&
edaa86240321 Turnerize the build script and teach cross-compile.sh to build qemu when
Rob Landley <rob@landley.net>
parents: 41
diff changeset
108 $CLEANUP qemu-*
edaa86240321 Turnerize the build script and teach cross-compile.sh to build qemu when
Rob Landley <rob@landley.net>
parents: 41
diff changeset
109
80
92dd34025932 Teach the cross compiler to only build the qemu targets currently needed,
Rob Landley <rob@landley.net>
parents: 79
diff changeset
110 [ $? -ne 0 ] && dienow
92dd34025932 Teach the cross compiler to only build the qemu targets currently needed,
Rob Landley <rob@landley.net>
parents: 79
diff changeset
111
18
eaf7a8d5e697 Managed to get a working toolchain, with wrapper script, to build a hello
Rob Landley <rob@landley.net>
parents: 17
diff changeset
112 # A quick hello world program to test the cross-compiler out.
33
bf2e771f4ba5 Update build script. Now uses a config file (usage: ./build.sh arch), and
Rob Landley <rob@landley.net>
parents: 27
diff changeset
113 # Build hello.c dynamic, then static, to verify header/library paths.
18
eaf7a8d5e697 Managed to get a working toolchain, with wrapper script, to build a hello
Rob Landley <rob@landley.net>
parents: 17
diff changeset
114
83
8fb80545fe84 Move the "hello world" source into sources/toys. Build (in mini-native)
Rob Landley <rob@landley.net>
parents: 80
diff changeset
115 "${ARCH}-gcc" -Os "${SOURCES}/toys/hello.c" -o "$WORK"/hello &&
8fb80545fe84 Move the "hello world" source into sources/toys. Build (in mini-native)
Rob Landley <rob@landley.net>
parents: 80
diff changeset
116 "${ARCH}-gcc" -Os -static "${SOURCES}/toys/hello.c" -o "$WORK"/hello &&
88
f56cfecf4621 Again, use $QEMU_TEST instead of $KARCH. (For mipsel, they don't match.)
Rob Landley <rob@landley.net>
parents: 87
diff changeset
117 ([ -z "${QEMU_TEST}" ] || [ x"$(qemu-"${QEMU_TEST}" "${WORK}"/hello)" == x"Hello world!" ]) &&
18
eaf7a8d5e697 Managed to get a working toolchain, with wrapper script, to build a hello
Rob Landley <rob@landley.net>
parents: 17
diff changeset
118 echo Cross-toolchain seems to work.
17
1202bdb44025 Build for the wrapper script. (Which still doesn't work right.)
Rob Landley <rob@landley.net>
parents: 15
diff changeset
119
3
1b721a51e9c6 Extract headers, build cross-binutils, build cross-gcc. Needs a C library.
landley@driftwood
parents: 1
diff changeset
120 [ $? -ne 0 ] && dienow
18
eaf7a8d5e697 Managed to get a working toolchain, with wrapper script, to build a hello
Rob Landley <rob@landley.net>
parents: 17
diff changeset
121
47
edaa86240321 Turnerize the build script and teach cross-compile.sh to build qemu when
Rob Landley <rob@landley.net>
parents: 41
diff changeset
122 fi
edaa86240321 Turnerize the build script and teach cross-compile.sh to build qemu when
Rob Landley <rob@landley.net>
parents: 41
diff changeset
123
38
297bb57cf74c Apparently "" around EOF also disables variable substitution, not just ''.
Rob Landley <rob@landley.net>
parents: 36
diff changeset
124 cat > "${CROSS}"/README << EOF &&
33
bf2e771f4ba5 Update build script. Now uses a config file (usage: ./build.sh arch), and
Rob Landley <rob@landley.net>
parents: 27
diff changeset
125 Cross compiler for $ARCH
bf2e771f4ba5 Update build script. Now uses a config file (usage: ./build.sh arch), and
Rob Landley <rob@landley.net>
parents: 27
diff changeset
126 From http://landley.net/code/firmware
bf2e771f4ba5 Update build script. Now uses a config file (usage: ./build.sh arch), and
Rob Landley <rob@landley.net>
parents: 27
diff changeset
127
41
3baa8ab7ee6d Largeish update.
Rob Landley <rob@landley.net>
parents: 39
diff changeset
128 To use: Add the "bin" directory to your \$PATH, and use "$ARCH-gcc" as
33
bf2e771f4ba5 Update build script. Now uses a config file (usage: ./build.sh arch), and
Rob Landley <rob@landley.net>
parents: 27
diff changeset
129 your compiler.
bf2e771f4ba5 Update build script. Now uses a config file (usage: ./build.sh arch), and
Rob Landley <rob@landley.net>
parents: 27
diff changeset
130
bf2e771f4ba5 Update build script. Now uses a config file (usage: ./build.sh arch), and
Rob Landley <rob@landley.net>
parents: 27
diff changeset
131 The syntax used to build the Linux kernel is:
bf2e771f4ba5 Update build script. Now uses a config file (usage: ./build.sh arch), and
Rob Landley <rob@landley.net>
parents: 27
diff changeset
132
41
3baa8ab7ee6d Largeish update.
Rob Landley <rob@landley.net>
parents: 39
diff changeset
133 make ARCH=${KARCH} CROSS_COMPILE=${ARCH}-
33
bf2e771f4ba5 Update build script. Now uses a config file (usage: ./build.sh arch), and
Rob Landley <rob@landley.net>
parents: 27
diff changeset
134
bf2e771f4ba5 Update build script. Now uses a config file (usage: ./build.sh arch), and
Rob Landley <rob@landley.net>
parents: 27
diff changeset
135 EOF
bf2e771f4ba5 Update build script. Now uses a config file (usage: ./build.sh arch), and
Rob Landley <rob@landley.net>
parents: 27
diff changeset
136
48
0f77e2472d27 Strip binaries.
Rob Landley <rob@landley.net>
parents: 47
diff changeset
137 # Strip everything
0f77e2472d27 Strip binaries.
Rob Landley <rob@landley.net>
parents: 47
diff changeset
138
0f77e2472d27 Strip binaries.
Rob Landley <rob@landley.net>
parents: 47
diff changeset
139 cd "$CROSS"
0f77e2472d27 Strip binaries.
Rob Landley <rob@landley.net>
parents: 47
diff changeset
140 for i in `find bin -type f` `find "$CROSS_TARGET" -type f`
0f77e2472d27 Strip binaries.
Rob Landley <rob@landley.net>
parents: 47
diff changeset
141 do
0f77e2472d27 Strip binaries.
Rob Landley <rob@landley.net>
parents: 47
diff changeset
142 strip "$i" 2> /dev/null
0f77e2472d27 Strip binaries.
Rob Landley <rob@landley.net>
parents: 47
diff changeset
143 done
0f77e2472d27 Strip binaries.
Rob Landley <rob@landley.net>
parents: 47
diff changeset
144 #for i in `find lib -type f` `find gcc/lib -type f`
0f77e2472d27 Strip binaries.
Rob Landley <rob@landley.net>
parents: 47
diff changeset
145 #do
0f77e2472d27 Strip binaries.
Rob Landley <rob@landley.net>
parents: 47
diff changeset
146 # "${ARCH}-strip" "$i" 2> /dev/null
0f77e2472d27 Strip binaries.
Rob Landley <rob@landley.net>
parents: 47
diff changeset
147 #done
0f77e2472d27 Strip binaries.
Rob Landley <rob@landley.net>
parents: 47
diff changeset
148
75
38e7e0cc3b9f Build mksquashfs in the non-short cross-compiler, and use it at the end of
Rob Landley <rob@landley.net>
parents: 66
diff changeset
149 echo -n creating "build/cross-compiler-${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: 66
diff changeset
150 cd "${BUILD}"
38e7e0cc3b9f Build mksquashfs in the non-short cross-compiler, and use it at the end of
Rob Landley <rob@landley.net>
parents: 66
diff changeset
151 { tar cjvf "cross-compiler-${ARCH}".tar.bz2 cross-compiler-"${ARCH}" || dienow
41
3baa8ab7ee6d Largeish update.
Rob Landley <rob@landley.net>
parents: 39
diff changeset
152 } | dotprogress
33
bf2e771f4ba5 Update build script. Now uses a config file (usage: ./build.sh arch), and
Rob Landley <rob@landley.net>
parents: 27
diff changeset
153
bf2e771f4ba5 Update build script. Now uses a config file (usage: ./build.sh arch), and
Rob Landley <rob@landley.net>
parents: 27
diff changeset
154 [ $? -ne 0 ] && dienow
39
c12b04caa0c1 Apparently, the exit value of a successful build is 1 because [ $? -ne 0 ]
Rob Landley <rob@landley.net>
parents: 38
diff changeset
155
47
edaa86240321 Turnerize the build script and teach cross-compile.sh to build qemu when
Rob Landley <rob@landley.net>
parents: 41
diff changeset
156 echo -e "\e[32mCross compiler toolchain build complete.\e[0m"