🛠️🐜 Antkeeper superbuild with dependencies included https://antkeeper.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

61 lines
1.7 KiB

  1. #!/bin/bash
  2. # This is the script buildbot.libsdl.org uses to cross-compile SDL2 from
  3. # amd64 Linux to NaCl.
  4. # PLEASE NOTE that we have reports that SDL built with pepper_49 (current
  5. # stable release as of November 10th, 2016) is broken. Please retest
  6. # when something newer becomes stable and then decide if this was SDL's
  7. # bug or NaCl's bug. --ryan.
  8. export NACL_SDK_ROOT="/nacl_sdk/pepper_47"
  9. TARBALL="$1"
  10. if [ -z $1 ]; then
  11. TARBALL=sdl-nacl.tar.xz
  12. fi
  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. if [ "x$MAKE" == "x" ]; then
  20. NCPU=`cat /proc/cpuinfo |grep vendor_id |wc -l`
  21. let NCPU=$NCPU+1
  22. MAKE="make -j$NCPU"
  23. fi
  24. BUILDBOTDIR="nacl-buildbot"
  25. PARENTDIR="$PWD"
  26. set -e
  27. set -x
  28. rm -f $TARBALL
  29. rm -rf $BUILDBOTDIR
  30. mkdir -p $BUILDBOTDIR
  31. pushd $BUILDBOTDIR
  32. # !!! FIXME: ccache?
  33. export CC="$NACL_SDK_ROOT/toolchain/linux_pnacl/bin/pnacl-clang"
  34. export CFLAGS="$CFLAGS -I$NACL_SDK_ROOT/include -I$NACL_SDK_ROOT/include/pnacl"
  35. export AR="$NACL_SDK_ROOT/toolchain/linux_pnacl/bin/pnacl-ar"
  36. export LD="$NACL_SDK_ROOT/toolchain/linux_pnacl/bin/pnacl-ar"
  37. export RANLIB="$NACL_SDK_ROOT/toolchain/linux_pnacl/bin/pnacl-ranlib"
  38. ../configure --host=pnacl --prefix=$PWD/nacl-sdl2-installed
  39. $MAKE
  40. $MAKE install
  41. # Fix up a few things to a real install path
  42. 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
  43. mkdir -p ./usr
  44. mv ./nacl-sdl2-installed ./usr/local
  45. popd
  46. tar -cJvvf $TARBALL -C $BUILDBOTDIR usr
  47. rm -rf $BUILDBOTDIR
  48. set +x
  49. echo "All done. Final installable is in $TARBALL ...";