Mercurial > hg > aboriginal
comparison mini-native.sh @ 423:8029eb9a4a8c
Split out BUILD_NOTOOLS from BUILD_SHORT.
author | Rob Landley <rob@landley.net> |
---|---|
date | Tue, 28 Oct 2008 02:34:22 -0500 |
parents | 6dd7e870b1d4 |
children | e39509d8d925 |
comparison
equal
deleted
inserted
replaced
422:372ab2afa692 | 423:8029eb9a4a8c |
---|---|
7 # Purple. And why not? | 7 # Purple. And why not? |
8 echo -e "\e[35m" | 8 echo -e "\e[35m" |
9 | 9 |
10 rm -rf "${NATIVE}" | 10 rm -rf "${NATIVE}" |
11 | 11 |
12 if [ -z "${BUILD_SHORT}" ] | 12 if [ -z "${BUILD_NOTOOLS}" ] |
13 then | 13 then |
14 TOOLS="${NATIVE}/tools" | 14 TOOLS="${NATIVE}/tools" |
15 mkdir -p "${TOOLS}/bin" || dienow | |
15 | 16 |
16 # Tell the wrapper script where to find the dynamic linker. | 17 # Tell the wrapper script where to find the dynamic linker. |
17 export UCLIBC_DYNAMIC_LINKER=/tools/lib/ld-uClibc.so.0 | 18 export UCLIBC_DYNAMIC_LINKER=/tools/lib/ld-uClibc.so.0 |
18 export UCLIBC_RPATH=/tools/lib | 19 export UCLIBC_RPATH=/tools/lib |
19 else | 20 else |
20 TOOLS="${NATIVE}/usr" && | 21 mkdir "${NATIVE}"/{tmp,proc,sys,dev,etc} || dienow |
21 mkdir -p "$TOOLS" && | 22 TOOLS="${NATIVE}/usr" |
22 mkdir "${NATIVE}"/{tmp,proc,sys,dev,etc} && | 23 for i in bin sbin lib |
23 ln -s usr/bin "${NATIVE}/bin" && | 24 do |
24 ln -s usr/sbin "${NATIVE}/sbin" && | 25 mkdir -p "$TOOLS/$i" || dienow |
25 ln -s usr/lib "${NATIVE}/lib" || dienow | 26 ln -s "usr/$i" "${NATIVE}/$i" || dienow |
26 fi | 27 done |
27 | 28 fi |
28 mkdir -p "${TOOLS}/bin" || dienow | |
29 | 29 |
30 # Build and install Linux kernel. | 30 # Build and install Linux kernel. |
31 | 31 |
32 setupfor linux | 32 setupfor linux |
33 # Install Linux kernel headers (for use by uClibc). | 33 # Install Linux kernel headers (for use by uClibc). |
102 | 102 |
103 # Copy qemu setup script and so on. | 103 # Copy qemu setup script and so on. |
104 | 104 |
105 cp -r "${SOURCES}/native/." "${TOOLS}/" || dienow | 105 cp -r "${SOURCES}/native/." "${TOOLS}/" || dienow |
106 | 106 |
107 if [ ! -z "${BUILD_SHORT}" ] | 107 if [ ! -z "${BUILD_NOTOOLS}" ] |
108 then | 108 then |
109 | 109 |
110 sed -i -e 's@/tools/@/usr/@g' -e 's@/bin/bash@/bin/ash@' \ | 110 sed -i -e 's@/tools/@/usr/@g' -e 's@/bin/bash@/bin/ash@' \ |
111 "${TOOLS}/bin/qemu-setup.sh" || dienow | 111 "${TOOLS}/bin/qemu-setup.sh" || dienow |
112 | 112 fi |
113 # If you want to use tinycc, you need to keep the headers but don't need gcc. | 113 |
114 # If you want to use tinycc, you need to keep the headers but don't need gcc. | |
115 if [ ! -z "$BUILD_SHORT" ] | |
116 then | |
117 | |
114 if [ "$BUILD_SHORT" != "headers" ] | 118 if [ "$BUILD_SHORT" != "headers" ] |
115 then | 119 then |
116 rm -rf "${TOOLS}"/include && | 120 rm -rf "${TOOLS}"/include && |
117 rm -rf "${TOOLS}/src" || dienow | 121 rm -rf "${TOOLS}/src" || dienow |
118 fi | 122 fi |
123 | |
119 else | 124 else |
120 | 125 |
121 # Build and install native binutils | 126 # Build and install native binutils |
122 | 127 |
123 setupfor binutils build-binutils | 128 setupfor binutils build-binutils |
223 "${ARCH}-gcc" "${SOURCES}/toys/hello.c" -Os -s -o "${TOOLS}/bin/hello-dynamic" && | 228 "${ARCH}-gcc" "${SOURCES}/toys/hello.c" -Os -s -o "${TOOLS}/bin/hello-dynamic" && |
224 "${ARCH}-gcc" "${SOURCES}/toys/hello.c" -Os -s -static -o "${TOOLS}/bin/hello-static" | 229 "${ARCH}-gcc" "${SOURCES}/toys/hello.c" -Os -s -static -o "${TOOLS}/bin/hello-static" |
225 | 230 |
226 [ $? -ne 0 ] && dienow | 231 [ $? -ne 0 ] && dienow |
227 | 232 |
233 # End of BUILD_SHORT | |
234 | |
228 fi | 235 fi |
229 | 236 |
230 # Clean up and package the result | 237 # Clean up and package the result |
231 | 238 |
232 "${ARCH}-strip" "${TOOLS}"/{bin/*,sbin/*,libexec/gcc/*/*/*} | 239 "${ARCH}-strip" "${TOOLS}"/{bin/*,sbin/*,libexec/gcc/*/*/*} |