Mercurial > hg > aboriginal
comparison cross-compiler.sh @ 93:153ba1a0b427
Break out the qemu build (and squashfs) into something easy to comment out,
at least until qemu-0.9.0 ships. (If you skip the host-tools.sh build, it'll
expect qemu to already be installed on the host system.)
author | Rob Landley <rob@landley.net> |
---|---|
date | Mon, 29 Jan 2007 11:50:49 -0500 |
parents | f56cfecf4621 |
children | 137ba51ee993 |
comparison
equal
deleted
inserted
replaced
92:f46f4cda9d81 | 93:153ba1a0b427 |
---|---|
78 cd .. && | 78 cd .. && |
79 $CLEANUP uClibc* | 79 $CLEANUP uClibc* |
80 | 80 |
81 [ $? -ne 0 ] && dienow | 81 [ $? -ne 0 ] && dienow |
82 | 82 |
83 # Skip this part if we're doing a short build. | |
84 | |
85 if [ -z "${BUILD_SHORT}" ] | |
86 then | |
87 | |
88 # Build squashfs | |
89 setupfor squashfs | |
90 cd squashfs-tools && | |
91 make && | |
92 cp mksquashfs unsquashfs "${CROSS}/bin" && | |
93 cd .. && | |
94 $CLEANUP squashfs* | |
95 | |
96 [ $? -ne 0 ] && dienow | |
97 | |
98 # Build qemu | |
99 | |
100 [ -z "$QEMU_TEST" ] || QEMU_BUILD_TARGET="${QEMU_TEST}-user" | |
101 | |
102 setupfor qemu && | |
103 ./configure --disable-gcc-check --disable-gfx-check \ | |
104 --target-list="${KARCH}-softmmu $QEMU_BUILD_TARGET" --prefix="${CROSS}" && | |
105 make && | |
106 make install && | |
107 cd .. && | |
108 $CLEANUP qemu-* | |
109 | |
110 [ $? -ne 0 ] && dienow | |
111 | |
112 # A quick hello world program to test the cross-compiler out. | |
113 # Build hello.c dynamic, then static, to verify header/library paths. | |
114 | |
115 "${ARCH}-gcc" -Os "${SOURCES}/toys/hello.c" -o "$WORK"/hello && | |
116 "${ARCH}-gcc" -Os -static "${SOURCES}/toys/hello.c" -o "$WORK"/hello && | |
117 ([ -z "${QEMU_TEST}" ] || [ x"$(qemu-"${QEMU_TEST}" "${WORK}"/hello)" == x"Hello world!" ]) && | |
118 echo Cross-toolchain seems to work. | |
119 | |
120 [ $? -ne 0 ] && dienow | |
121 | |
122 fi | |
123 | |
124 cat > "${CROSS}"/README << EOF && | 83 cat > "${CROSS}"/README << EOF && |
125 Cross compiler for $ARCH | 84 Cross compiler for $ARCH |
126 From http://landley.net/code/firmware | 85 From http://landley.net/code/firmware |
127 | 86 |
128 To use: Add the "bin" directory to your \$PATH, and use "$ARCH-gcc" as | 87 To use: Add the "bin" directory to your \$PATH, and use "$ARCH-gcc" as |
151 { tar cjvf "cross-compiler-${ARCH}".tar.bz2 cross-compiler-"${ARCH}" || dienow | 110 { tar cjvf "cross-compiler-${ARCH}".tar.bz2 cross-compiler-"${ARCH}" || dienow |
152 } | dotprogress | 111 } | dotprogress |
153 | 112 |
154 [ $? -ne 0 ] && dienow | 113 [ $? -ne 0 ] && dienow |
155 | 114 |
115 # A quick hello world program to test the cross-compiler out. | |
116 # Build hello.c dynamic, then static, to verify header/library paths. | |
117 | |
118 "${ARCH}-gcc" -Os "${SOURCES}/toys/hello.c" -o "$WORK"/hello && | |
119 "${ARCH}-gcc" -Os -static "${SOURCES}/toys/hello.c" -o "$WORK"/hello && | |
120 ([ -z "${QEMU_TEST}" ] || [ x"$(qemu-"${QEMU_TEST}" "${WORK}"/hello)" == x"Hello world!" ]) && | |
121 echo Cross-toolchain seems to work. | |
122 | |
123 [ $? -ne 0 ] && dienow | |
124 | |
156 echo -e "\e[32mCross compiler toolchain build complete.\e[0m" | 125 echo -e "\e[32mCross compiler toolchain build complete.\e[0m" |