build-scripts/nacl-buildbot.sh
author Sam Lantinga <slouken@libsdl.org>
Tue, 19 Aug 2014 21:17:21 -0700
changeset 9094 65a23b7b43c7
parent 8882 4fc9e98413c3
child 10592 a5667285680d
permissions -rwxr-xr-x
Fixed bug 2694 - configure bug __has_feature macro not detected

skaller

using gcc 4.2 (the default) on Mac OSX 10.6.8

CC build/SDL_dynapi.lo
In file included from /Users/johnskaller/SDL/src/dynapi/SDL_dynapi.c:31:
include/SDL_syswm.h:211:39: error: missing binary operator before token "("

The fault appears to be here:

#if defined(__OBJC__) && __has_feature(objc_arc)

that the __has_feature macro is not supported by gcc 4.2.

The code works fine with my clang 3.3svn.
     1 #!/bin/bash
     2 
     3 # This is the script buildbot.libsdl.org uses to cross-compile SDL2 from
     4 #  amd64 Linux to NaCl.
     5 
     6 export NACL_SDK_ROOT="/nacl_sdk/pepper_35"
     7 
     8 TARBALL="$1"
     9 if [ -z $1 ]; then
    10     TARBALL=sdl-nacl.tar.xz
    11 fi
    12 
    13 OSTYPE=`uname -s`
    14 if [ "$OSTYPE" != "Linux" ]; then
    15     # !!! FIXME
    16     echo "This only works on x86 or x64-64 Linux at the moment." 1>&2
    17     exit 1
    18 fi
    19 
    20 if [ "x$MAKE" == "x" ]; then
    21     NCPU=`cat /proc/cpuinfo |grep vendor_id |wc -l`
    22     let NCPU=$NCPU+1
    23     MAKE="make -j$NCPU"
    24 fi
    25 
    26 BUILDBOTDIR="nacl-buildbot"
    27 PARENTDIR="$PWD"
    28 
    29 set -e
    30 set -x
    31 rm -f $TARBALL
    32 rm -rf $BUILDBOTDIR
    33 mkdir -p $BUILDBOTDIR
    34 pushd $BUILDBOTDIR
    35 
    36 # !!! FIXME: ccache?
    37 export CC="$NACL_SDK_ROOT/toolchain/linux_pnacl/bin/pnacl-clang"
    38 export CFLAGS="$CFLAGS -I$NACL_SDK_ROOT/include -I$NACL_SDK_ROOT/include/pnacl"
    39 export AR="$NACL_SDK_ROOT/toolchain/linux_pnacl/bin/pnacl-ar"
    40 export LD="$NACL_SDK_ROOT/toolchain/linux_pnacl/bin/pnacl-ar"
    41 export RANLIB="$NACL_SDK_ROOT/toolchain/linux_pnacl/bin/pnacl-ranlib"
    42 
    43 ../configure --host=pnacl --prefix=$PWD/nacl-sdl2-installed
    44 $MAKE
    45 $MAKE install
    46 # Fix up a few things to a real install path
    47 perl -w -pi -e "s#$PWD/nacl-sdl2-installed#/usr/local#g;" ./nacl-sdl2-installed/lib/libSDL2.la ./nacl-sdl2-installed/lib/pkgconfig/sdl2.pc ./nacl-sdl2-installed/bin/sdl2-config
    48 mkdir -p ./usr
    49 mv ./nacl-sdl2-installed ./usr/local
    50 
    51 popd
    52 tar -cJvvf $TARBALL -C $BUILDBOTDIR usr
    53 rm -rf $BUILDBOTDIR
    54 
    55 set +x
    56 echo "All done. Final installable is in $TARBALL ...";
    57