initial thumb ISA support
authorDennis Groenen <tj.groenen@gmail.com>
Mon, 25 Jun 2012 20:19:00 +0000 (22:19 +0200)
committerDennis Groenen <tj.groenen@gmail.com>
Mon, 25 Jun 2012 20:19:00 +0000 (22:19 +0200)
build.sh [changed mode: 0755->0644]
debian/config/config.busybox

old mode 100755 (executable)
new mode 100644 (file)
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
index 164fd38..14fcd65 100644 (file)
@@ -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=""