changeset 1025:ec5b62d300c0

Add zlib support to static-tools.sh so dropbear supports -C. Build dropbear -Os and strip the binaries to try to get some of the resulting size increase back.
author Rob Landley <rob@landley.net>
date Thu, 01 Apr 2010 15:59:15 -0500
parents 0fd90ff771dc
children f3b242456ff7
files sources/native-builds/static-tools.sh
diffstat 1 files changed, 25 insertions(+), 27 deletions(-) [+]
line wrap: on
line diff
--- a/sources/native-builds/static-tools.sh	Thu Apr 01 02:39:54 2010 -0500
+++ b/sources/native-builds/static-tools.sh	Thu Apr 01 15:59:15 2010 -0500
@@ -7,20 +7,11 @@
 
 source sources/include.sh || exit 1
 
-if [ $# -ne 1 ]
-then
-  echo "usage: $0 FILENAME" >&2
-  exit 1
-fi
+[ $# -ne 1 ] && echo "usage: $0 FILENAME" >&2 && exit 1
+[ -e "$1" ] && echo "$1" exists && exit 0
 
-if [ -e "$1" ]
-then
-  echo "$1" exists
-  exit 0
-fi
-
-SRCDIR="$SRCDIR/native"
-mkdir -p "$SRCDIR" || dienow
+SRCDIR="$SRCDIR/native" && mkdir -p "$SRCDIR" || dienow
+WORK="$WORK"/sub && blank_tempdir "$WORK"
 
 echo "=== Download source code."
 
@@ -29,25 +20,22 @@
 URL=http://downloads.sf.net/sourceforge/strace/strace-4.5.19.tar.bz2 \
 SHA1=5554c2fd8ffae5c1e2b289b2024aa85a0889c989 \
 download || dienow
+setupfor strace
+
+URL=http://zlib.net/zlib-1.2.4.tar.bz2 \
+SHA1=8cf10521c1927daa5e12efc5e1725a0d70e579f3 \
+maybe_fork "download || dienow"
+setupfor zlib
 
 URL=http://matt.ucc.asn.au/dropbear/releases/dropbear-0.52.tar.bz2 \
 SHA1=8c1745a9b64ffae79f28e25c6fe9a8b96cac86d8 \
 download || dienow
+setupfor dropbear
 
 echo === Got all source.
 
 cleanup_oldfiles
 
-# Set up working directories
-
-WORK="$WORK"/sub
-blank_tempdir "$WORK"
-
-# Extract source code into new image directory
-
-setupfor dropbear
-setupfor strace
-
 cat > "$WORK"/init << 'EOF' || dienow
 #!/bin/bash
 
@@ -58,22 +46,32 @@
 
 echo Started second stage init
 
-echo === Native build static dropbear
+echo === Native build static zlib
+
+cp -sfR /mnt/zlib zlib &&
+cd zlib &&
+./configure &&
+make -j $CPUS &&
+cd .. || exit 1
+
+echo === $ARCH Native build static dropbear
 
 cp -sfR /mnt/dropbear dropbear &&
 cd dropbear &&
-LDFLAGS="--static" ./configure --disable-zlib &&
+CFLAGS="-I ../zlib -Os" LDFLAGS="--static -L ../zlib" ./configure &&
 make -j $CPUS PROGRAMS="dropbear dbclient dropbearkey dropbearconvert scp" MULTI=1 SCPPROGRESS=1 &&
+strip dropbearmulti &&
 upload_result dropbearmulti &&
 cd .. &&
 rm -rf dropbear || exit 1
 
-echo === Native build static strace
+echo === $ARCH Native build static strace
 
 cp -sfR /mnt/strace strace &&
 cd strace &&
-CFLAGS="--static" ./configure &&
+CFLAGS="--static -Os" ./configure &&
 make -j $CPUS &&
+strip strace &&
 upload_result strace &&
 cd .. &&
 rm -rf strace || dienow