claenups for previous commit
[oweals/busybox.git] / qemu_multiarch_testing / hdc.dir / build
1 #!/bin/sh
2
3 umount /mnt # optional
4
5 test -x "bin/busybox-$HOST" && {
6         echo "Found bin/busybox-$HOST, using it"
7         cp -a "bin/busybox-$HOST" bin/busybox
8         bin/busybox --install -s bin/
9         # Supply missing stuff (e.g. bzip2):
10         PATH="$PATH:$PWD/bin"
11         # Override known-buggy host binaries:
12         cp -af bin/od `which od`
13 }
14
15 (
16         #set -e -x
17         cd busybox
18
19         make defconfig
20         # Want static build
21         sed 's/^.*CONFIG_STATIC.*$/CONFIG_STATIC=y/' -i .config
22         bzip2 </dev/null >/dev/null || {
23                 # Drats, newer Aboriginal Linux has no bzip2
24                 sed 's/^.*CONFIG_FEATURE_COMPRESS_USAGE.*$/# CONFIG_FEATURE_COMPRESS_USAGE is not set/' -i .config
25         }
26         test x"`uname -m`" = x"mips" && {
27                 # Without this, I get MIPS-I binary instead of MIPS32.
28                 # No idea what's the difference, but my router wants MIPS32.
29                 sed 's/^.*CONFIG_EXTRA_CFLAGS.*$/CONFIG_EXTRA_CFLAGS="-mips32"/' -i .config
30         }
31         # These won't build because of toolchain/libc breakage:
32         sed 's/^.*CONFIG_FEATURE_SYNC_FANCY.*$/# CONFIG_FEATURE_SYNC_FANCY is not set/' -i .config # no syncfs() on armv4l, sparc
33         sed 's/^.*CONFIG_FEATURE_WTMP.*$/# CONFIG_FEATURE_WTMP is not set/' -i .config
34         sed 's/^.*CONFIG_FEATURE_UTMP.*$/# CONFIG_FEATURE_UTMP is not set/' -i .config
35         sed 's/^.*CONFIG_FEATURE_INETD_RPC.*$/# CONFIG_FEATURE_INETD_RPC is not set/' -i .config
36
37         make #V=1 || sh
38         test -f busybox || exit 1
39         size busybox
40         ./busybox || echo "Exit code: $?"
41         if uuencode TEST </dev/null >/dev/null && bzip2 </dev/null >/dev/null; then
42                 bzip2 <busybox | uuencode busybox.bz2
43         else
44                 od -v -tx1 <busybox
45         fi
46         #test "x$FTP_PORT" = x ||
47         #       ftpput -P "$FTP_PORT" "$FTP_SERVER" strace
48 ) 2>&1 | tee build.log
49 mount -o remount,ro /home
50 sync
51 sleep 1