Added script that the buildbot will use for cross-compiling to Raspberry Pi.
authorRyan C. Gordon <icculus@icculus.org>
Thu, 10 Oct 2013 01:46:39 -0400
changeset 779740543ce6e842
parent 7796 75c80f36038e
child 7798 795fc221d417
Added script that the buildbot will use for cross-compiling to Raspberry Pi.
build-scripts/raspberrypi-buildbot.sh
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/build-scripts/raspberrypi-buildbot.sh	Thu Oct 10 01:46:39 2013 -0400
     1.3 @@ -0,0 +1,55 @@
     1.4 +#!/bin/bash
     1.5 +
     1.6 +# This is the script buildbot.libsdl.org uses to cross-compile SDL2 from
     1.7 +#  x86 Linux to Raspberry Pi.
     1.8 +
     1.9 +# The final tarball can be unpacked in the root directory of a RPi,
    1.10 +#  so the SDL2 install lands in /usr/local. Run ldconfig, and then
    1.11 +#  you should be able to build and run SDL2-based software on your
    1.12 +#  Pi. Standard configure scripts should be able to find SDL and
    1.13 +#  build against it, and sdl2-config should work correctly on the
    1.14 +#  actual device.
    1.15 +
    1.16 +TARBALL=sdl2-raspberrypi-`hg tip --template '{rev}'`.tar.bz2
    1.17 +
    1.18 +OSTYPE=`uname -s`
    1.19 +if [ "$OSTYPE" != "Linux" ]; then
    1.20 +    # !!! FIXME
    1.21 +    echo "This only works on x86 or x64-64 Linux at the moment." 1>&2
    1.22 +    exit 1
    1.23 +fi
    1.24 +
    1.25 +if [ "x$MAKE" == "x" ]; then
    1.26 +    NCPU=`cat /proc/cpuinfo |grep vendor_id |wc -l`
    1.27 +    let NCPU=$NCPU+1
    1.28 +    MAKE="make -j$NCPU"
    1.29 +fi
    1.30 +
    1.31 +BUILDBOTDIR="raspberrypi-buildbot"
    1.32 +PARENTDIR="$PWD"
    1.33 +
    1.34 +set -e
    1.35 +set -x
    1.36 +rm -f $TARBALL
    1.37 +rm -rf $BUILDBOTDIR
    1.38 +mkdir -p $BUILDBOTDIR
    1.39 +pushd $BUILDBOTDIR
    1.40 +
    1.41 +export CC=/opt/rpi-tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-gcc
    1.42 +# !!! FIXME: shouldn't have to --disable-* things here.
    1.43 +../configure --host=arm-raspberry-linux-gnueabihf --disable-pulseaudio --disable-esd --prefix="$PWD/rpi-sdl2-installed"
    1.44 +$MAKE
    1.45 +$MAKE install
    1.46 +# Fix up a few things to a real install path on a real Raspberry Pi...
    1.47 +perl -w -pi -e "s#$PWD/rpi-sdl2-installed#/usr/local#g;" ./rpi-sdl2-installed/lib/libSDL2.la ./rpi-sdl2-installed/lib/pkgconfig/sdl2.pc ./rpi-sdl2-installed/bin/sdl2-config
    1.48 +mkdir -p ./usr
    1.49 +mv ./rpi-sdl2-installed ./usr/local
    1.50 +
    1.51 +tar -cjvvf $PARENTDIR/$TARBALL usr
    1.52 +popd
    1.53 +rm -rf $BUILDBOTDIR
    1.54 +
    1.55 +set +x
    1.56 +echo "All done. Final installable is in $TARBALL ...";
    1.57 +
    1.58 +