🛠️🐜 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.

72 lines
1.9 KiB

  1. #!/bin/bash
  2. # This is the script physfs-buildbot.icculus.org uses to cross-compile
  3. # PhysicsFS from x86 Linux to Raspberry Pi. This script was originally from
  4. # Simple Directmedia Layer ( https://www.libsdl.org/ ).
  5. # The final tarball can be unpacked in the root directory of a RPi,
  6. # so the PhysicsFS install lands in /usr/local. Run ldconfig, and then
  7. # you should be able to build and run PhysicsFS-based software on your
  8. # Pi. Standard configure scripts should be able to find PhysicsFS and
  9. # build against it.
  10. TARBALL="$1"
  11. if [ -z $1 ]; then
  12. TARBALL=physfs-raspberrypi.tar.xz
  13. fi
  14. OSTYPE=`uname -s`
  15. if [ "$OSTYPE" != "Linux" ]; then
  16. # !!! FIXME
  17. echo "This only works on x86 or x64-64 Linux at the moment." 1>&2
  18. exit 1
  19. fi
  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. echo "\$MAKE is '$MAKE'"
  26. MAKECMD="$MAKE"
  27. unset MAKE # prevent warnings about jobserver mode.
  28. BUILDBOTDIR="raspberrypi-buildbot"
  29. PARENTDIR="$PWD"
  30. set -e
  31. set -x
  32. rm -f $TARBALL
  33. rm -rf $BUILDBOTDIR
  34. mkdir -p $BUILDBOTDIR
  35. pushd $BUILDBOTDIR
  36. SYSROOT="/opt/rpi-sysroot"
  37. cmake -G "Unix Makefiles" \
  38. -DCMAKE_C_COMPILER="/opt/rpi-tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-gcc" \
  39. -DCMAKE_BUILD_TYPE=MinSizeRel \
  40. -DCMAKE_SYSROOT="$SYSROOT" \
  41. -DCMAKE_FIND_ROOT_PATH="$SYSROOT" \
  42. -DCMAKE_SYSTEM_NAME="Linux" \
  43. -DCMAKE_SYSTEM_VERSION=1 \
  44. -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER \
  45. -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY \
  46. -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY \
  47. ..
  48. $MAKECMD
  49. rm -rf "$TARBALL" physfs-raspberrypi
  50. mkdir -p physfs-raspberrypi
  51. echo "Archiving to '$TARBALL' ..."
  52. cp -a ../src/physfs.h libphysfs.a libphysfs.so* physfs-raspberrypi
  53. chmod -R a+r physfs-raspberrypi
  54. chmod a+x physfs-raspberrypi physfs-raspberrypi/*.so*
  55. chmod -R go-w physfs-raspberrypi
  56. tar -cJvvf "$TARBALL" physfs-raspberrypi
  57. set +x
  58. echo "Done."