From 9d7c31b12dfabbcccdbd5b37b088e39423dc1422 Mon Sep 17 00:00:00 2001 From: Dennis Groenen Date: Mon, 25 Jun 2012 22:19:00 +0200 Subject: [PATCH] initial thumb ISA support --- build.sh | 26 ++++++++++++++++++++++---- debian/config/config.busybox | 2 +- 2 files changed, 23 insertions(+), 5 deletions(-) mode change 100755 => 100644 build.sh diff --git a/build.sh b/build.sh old mode 100755 new mode 100644 index 3e91881..fe71cb3 --- a/build.sh +++ b/build.sh @@ -1,11 +1,23 @@ #!/bin/sh # Helper script to build busybox-power # Please run me from within Scratchbox +# +# Run `sh build.sh thumb` to enable the thumb ISA. Make sure your Scratchbox +# target is properly set up to compile thumb binaries. +# Instructions to set up a Fremantle thumb target in Scratchbox: +# http://talk.maemo.org/showpost.php?p=1223814&postcount=164 BBVERSION="1.20.1" MAKETHREADS="8" SCRIPTDIR=`dirname $(readlink -f $0)` BUILDDIR="$SCRIPTDIR/../busybox-power-build" +VERSION_DEBIAN=`cat $SCRIPTDIR/debian/changelog | awk -F'[()]' '{if(NR==1) print $2}'` + +BUILD_OPTIONS="parallel=$MAKETHREADS" +THUMB=false + +if [ "$1" == "thumb" ]; then + THUMB=true; fi hash wget 2>&- || { echo >&2 "this script requires wget, exiting now" @@ -16,8 +28,7 @@ mkdir -p $BUILDDIR cd $BUILDDIR if ! test -e busybox-$BBVERSION.tar.bz2; then - wget http://busybox.net/downloads/busybox-$BBVERSION.tar.bz2 -fi; + wget http://busybox.net/downloads/busybox-$BBVERSION.tar.bz2; fi if test -d busybox-$BBVERSION/; then echo "`pwd`/busybox-$BBVERSION already exists," @@ -25,8 +36,15 @@ if test -d busybox-$BBVERSION/; then exit 1 fi -tar -jxvf busybox-$BBVERSION.tar.bz2 +tar -jxf busybox-$BBVERSION.tar.bz2 cp -af $SCRIPTDIR/debian/ busybox-$BBVERSION/ +if $THUMB; then + # Append "~thumb" to the package's Debian version string + # NB: we feed sed directly with $VERSION_DEBIAN, it is not escaped in any way + sed -i "s/$VERSION_DEBIAN/$VERSION_DEBIAN~thumb/" busybox-$BBVERSION/debian/changelog + BUILD_OPTIONS="$BUILD_OPTIONS,thumb,vfp" +fi + # Build -cd busybox-$BBVERSION/ && DEB_BUILD_OPTIONS="parallel=$MAKETHREADS" dpkg-buildpackage -r"fakeroot -u" -uc -us -nc +cd busybox-$BBVERSION/ && DEB_BUILD_OPTIONS="$BUILD_OPTIONS" dpkg-buildpackage -r"fakeroot -u" -uc -us -nc diff --git a/debian/config/config.busybox b/debian/config/config.busybox index 164fd38..14fcd65 100644 --- a/debian/config/config.busybox +++ b/debian/config/config.busybox @@ -63,7 +63,7 @@ CONFIG_FEATURE_HAVE_RPC=y CONFIG_LFS=y CONFIG_CROSS_COMPILER_PREFIX="" CONFIG_SYSROOT="" -CONFIG_EXTRA_CFLAGS="" +CONFIG_EXTRA_CFLAGS="-fgnu89-inline" CONFIG_EXTRA_LDFLAGS="" CONFIG_EXTRA_LDLIBS="" -- 1.7.9.5