Mercurial > hg > aboriginal
comparison mini-native.sh @ 182:fc827ab6166f
Autodetect number of processors and feed appropriate -j to make.
author | Rob Landley <rob@landley.net> |
---|---|
date | Tue, 26 Jun 2007 17:51:14 -0400 |
parents | 6b4844b708b9 |
children | d2a27709d3b6 |
comparison
equal
deleted
inserted
replaced
181:3398664933af | 182:fc827ab6166f |
---|---|
21 setupfor linux | 21 setupfor linux |
22 # Install Linux kernel headers (for use by uClibc). | 22 # Install Linux kernel headers (for use by uClibc). |
23 make headers_install ARCH="${KARCH}" INSTALL_HDR_PATH="${TOOLS}" && | 23 make headers_install ARCH="${KARCH}" INSTALL_HDR_PATH="${TOOLS}" && |
24 # build bootable kernel for target | 24 # build bootable kernel for target |
25 make ARCH="${KARCH}" allnoconfig KCONFIG_ALLCONFIG="${WORK}/miniconfig-linux" && | 25 make ARCH="${KARCH}" allnoconfig KCONFIG_ALLCONFIG="${WORK}/miniconfig-linux" && |
26 make ARCH="${KARCH}" CROSS_COMPILE="${ARCH}-" && | 26 make -j $CPUS ARCH="${KARCH}" CROSS_COMPILE="${ARCH}-" && |
27 cp "${KERNEL_PATH}" "${BUILD}/zImage-${ARCH}" && | 27 cp "${KERNEL_PATH}" "${BUILD}/zImage-${ARCH}" && |
28 cd .. && | 28 cd .. && |
29 $CLEANUP linux-* | 29 $CLEANUP linux-* |
30 | 30 |
31 [ $? -ne 0 ] && dienow | 31 [ $? -ne 0 ] && dienow |
35 | 35 |
36 setupfor uClibc | 36 setupfor uClibc |
37 make allnoconfig KCONFIG_ALLCONFIG="${WORK}/miniconfig-uClibc" && | 37 make allnoconfig KCONFIG_ALLCONFIG="${WORK}/miniconfig-uClibc" && |
38 make CROSS="${ARCH}-" KERNEL_HEADERS="${TOOLS}/include" PREFIX="${TOOLS}/" \ | 38 make CROSS="${ARCH}-" KERNEL_HEADERS="${TOOLS}/include" PREFIX="${TOOLS}/" \ |
39 RUNTIME_PREFIX=/ DEVEL_PREFIX=/ UCLIBC_LDSO_NAME=ld-uClibc \ | 39 RUNTIME_PREFIX=/ DEVEL_PREFIX=/ UCLIBC_LDSO_NAME=ld-uClibc \ |
40 all install_runtime install_dev utils && | 40 -j $CPUS all install_runtime install_dev utils && |
41 # utils_install wants to put stuff in usr/bin instead of bin. | 41 # utils_install wants to put stuff in usr/bin instead of bin. |
42 install -m 755 utils/{readelf,ldd,ldconfig} "${TOOLS}/bin" && | 42 install -m 755 utils/{readelf,ldd,ldconfig} "${TOOLS}/bin" && |
43 cd .. && | 43 cd .. && |
44 $CLEANUP uClibc* | 44 $CLEANUP uClibc* |
45 | 45 |
47 | 47 |
48 # Build and install busybox | 48 # Build and install busybox |
49 | 49 |
50 setupfor busybox | 50 setupfor busybox |
51 make defconfig && | 51 make defconfig && |
52 make CROSS="${ARCH}-" && | 52 make -j $CPUS CROSS="${ARCH}-" && |
53 cp busybox "${TOOLS}/bin" | 53 cp busybox "${TOOLS}/bin" |
54 [ $? -ne 0 ] && dienow | 54 [ $? -ne 0 ] && dienow |
55 for i in $(sed 's@.*/@@' busybox.links) | 55 for i in $(sed 's@.*/@@' busybox.links) |
56 do | 56 do |
57 ln -s busybox "${TOOLS}/bin/$i" || dienow | 57 ln -s busybox "${TOOLS}/bin/$i" || dienow |
70 CC="${ARCH}-gcc" AR="${ARCH}-ar" "${CURSRC}/configure" --prefix="${TOOLS}" \ | 70 CC="${ARCH}-gcc" AR="${ARCH}-ar" "${CURSRC}/configure" --prefix="${TOOLS}" \ |
71 --build="${CROSS_HOST}" --host="${CROSS_TARGET}" --target="${CROSS_TARGET}" \ | 71 --build="${CROSS_HOST}" --host="${CROSS_TARGET}" --target="${CROSS_TARGET}" \ |
72 --disable-nls --disable-shared --disable-multilib --program-prefix= \ | 72 --disable-nls --disable-shared --disable-multilib --program-prefix= \ |
73 $BINUTILS_FLAGS && | 73 $BINUTILS_FLAGS && |
74 make configure-host && | 74 make configure-host && |
75 make && | 75 make -j $CPUS && |
76 make install && | 76 make install && |
77 cd .. && | 77 cd .. && |
78 mkdir -p "${TOOLS}/include" && | 78 mkdir -p "${TOOLS}/include" && |
79 cp binutils-*/include/libiberty.h "${TOOLS}/include" && | 79 cp binutils-*/include/libiberty.h "${TOOLS}/include" && |
80 $CLEANUP binutils-* build-binutils | 80 $CLEANUP binutils-* build-binutils |
98 "${CURSRC}/configure" --prefix="${TOOLS}" --disable-multilib $GCC_FLAGS \ | 98 "${CURSRC}/configure" --prefix="${TOOLS}" --disable-multilib $GCC_FLAGS \ |
99 --build="${CROSS_HOST}" --host="${CROSS_TARGET}" --target="${CROSS_TARGET}" \ | 99 --build="${CROSS_HOST}" --host="${CROSS_TARGET}" --target="${CROSS_TARGET}" \ |
100 --enable-long-long --enable-c99 --enable-shared --enable-threads=posix \ | 100 --enable-long-long --enable-c99 --enable-shared --enable-threads=posix \ |
101 --enable-__cxa_atexit --disable-nls --enable-languages=c,c++ \ | 101 --enable-__cxa_atexit --disable-nls --enable-languages=c,c++ \ |
102 --disable-libstdcxx-pch --program-prefix="" && | 102 --disable-libstdcxx-pch --program-prefix="" && |
103 make all-gcc && | 103 make -j $CPUS all-gcc && |
104 make install-gcc && | 104 make install-gcc && |
105 ln -s gcc "${TOOLS}/bin/cc" && | 105 ln -s gcc "${TOOLS}/bin/cc" && |
106 cd .. && | 106 cd .. && |
107 $CLEANUP gcc-* build-gcc | 107 $CLEANUP gcc-* build-gcc |
108 | 108 |
125 # Build and install make | 125 # Build and install make |
126 | 126 |
127 setupfor make | 127 setupfor make |
128 CC="${ARCH}-gcc" ./configure --prefix="${TOOLS}" --build="${CROSS_HOST}" \ | 128 CC="${ARCH}-gcc" ./configure --prefix="${TOOLS}" --build="${CROSS_HOST}" \ |
129 --host="${CROSS_TARGET}" && | 129 --host="${CROSS_TARGET}" && |
130 make && | 130 make -j $CPUS && |
131 make install && | 131 make install && |
132 cd .. && | 132 cd .. && |
133 $CLEANUP make-* | 133 $CLEANUP make-* |
134 | 134 |
135 [ $? -ne 0 ] && dienow | 135 [ $? -ne 0 ] && dienow |
146 bash_cv_getenv_redef=no | 146 bash_cv_getenv_redef=no |
147 EOF | 147 EOF |
148 CC="${ARCH}-gcc" RANLIB="${ARCH}-ranlib" ./configure --prefix="${TOOLS}" \ | 148 CC="${ARCH}-gcc" RANLIB="${ARCH}-ranlib" ./configure --prefix="${TOOLS}" \ |
149 --build="${CROSS_HOST}" --host="${CROSS_TARGET}" --cache-file=config.cache \ | 149 --build="${CROSS_HOST}" --host="${CROSS_TARGET}" --cache-file=config.cache \ |
150 --without-bash-malloc --disable-readline && | 150 --without-bash-malloc --disable-readline && |
151 make && | 151 make -j $CPUS && |
152 make install && | 152 make install && |
153 # Make bash the default shell. | 153 # Make bash the default shell. |
154 ln -s bash "${TOOLS}/bin/sh" && | 154 ln -s bash "${TOOLS}/bin/sh" && |
155 cd .. && | 155 cd .. && |
156 $CLEANUP bash-* | 156 $CLEANUP bash-* |