Advertisement
Guest User

Untitled

a guest
Mar 22nd, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.16 KB | None | 0 0
  1. #!/bin/sh
  2. MAC="Mac OS X"
  3. WIN="Windows"
  4. LIN="Linux"
  5.  
  6. if [ `uname` = "Darwin" ]; then
  7.   OS=$MAC
  8. elif [ `uname` = "Linux" ]; then
  9.   OS=$LIN
  10. else
  11.   OS=$WIN
  12. fi
  13.  
  14. if [ ! "$OS" = "$LIN" ]; then
  15.   echo "Library compilation not supported. Use the supplied sgsdl2 static or dynamic library."
  16.   exit 1
  17. fi
  18.  
  19. INSTALL=false
  20.  
  21. #
  22. # Read and process command line arguments
  23. #
  24. while getopts i o
  25. do
  26.   case "$o" in
  27.   i)  INSTALL=true;;
  28.   [?]) print >&2 "Usage: $0 [-i]"
  29.      exit -1;;
  30.   esac
  31. done
  32.  
  33. shift $((${OPTIND}-1))
  34.  
  35. # Move to src dir
  36. APP_PATH=`echo $0 | awk '{split($0,patharr,"/"); idx=1; while(patharr[idx+1] != "") { if (patharr[idx] != "/") {printf("%s/", patharr[idx]); idx++ }} }'`
  37. APP_PATH=`cd "$APP_PATH"; pwd`
  38. cd "$APP_PATH"
  39.  
  40. if [ ! -d "sgsdk_source" ]; then
  41.   echo "  ... Extracting sgsdk source"
  42.   unzip sgsdk_source.zip > /dev/null
  43. fi
  44.  
  45. cd sgsdk_source
  46. ./build.sh
  47. if [ $? != 0 ]; then echo "Library compilation failed!"; exit 1; fi
  48.  
  49. if [ ! -d "$APP_PATH/linux" ]; then
  50.   mkdir "$APP_PATH/linux"
  51. fi
  52.  
  53. cp bin/linux/libSGSDK.so.4.0 "$APP_PATH/linux/libsgsdk.so"
  54. cp "$APP_PATH/sgsdk_source/sgsdl2/libsgsdl2.so" "$APP_PATH/linux/libsgsdl2.so"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement