Advertisement
Guest User

UE4 Linux No Makefiles

a guest
Oct 31st, 2014
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.90 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. SCRIPT_DIR=$(cd "$(dirname "$BASH_SOURCE")" ; pwd)
  4. # these need to be passed to children scripts
  5. export ARCHIVE_ROOT=$HOME/Downloads
  6. export GITHUB_TAG=4.5.0-release
  7.  
  8. IS_GITHUB_BUILD=true
  9. FORCE_UPDATEDEPS=false
  10.  
  11. CheckArgs()
  12. {
  13. # if p4 is installed, assume building out of perforce repo (no need to download and fix dependencies)
  14. if which p4 > /dev/null; then
  15. IS_GITHUB_BUILD=false # perforce
  16. fi
  17.  
  18. # Override this with -git
  19. for Arg in $@; do
  20. if [ "$Arg" == "-git" ]; then
  21. IS_GITHUB_BUILD=true
  22. elif [ "$Arg" == "-updatedeps" ]; then
  23. FORCE_UPDATEDEPS=true
  24. fi
  25. done
  26. }
  27.  
  28.  
  29. set -e
  30.  
  31. TOP_DIR=$(cd $SCRIPT_DIR/../../.. ; pwd)
  32. cd ${TOP_DIR}
  33.  
  34. if [ ! -d Source ]; then
  35. echo "GenerateProjectFiles ERROR: This script file does not appear to be \
  36. located inside the Engine/Build/BatchFiles/Linux directory."
  37. exit 1
  38. fi
  39.  
  40. CheckArgs $@
  41.  
  42. if [ "$(lsb_release --id)" = "Distributor ID: Ubuntu" -o "$(lsb_release --id)" = "Distributor ID: Debian" -o "$(lsb_release --id)" = "Distributor ID: Linux Mint" ]; then
  43. # Install all necessary dependencies
  44. DEPS="mono-xbuild \
  45. mono-dmcs \
  46. libmono-microsoft-build-tasks-v4.0-4.0-cil \
  47. libmono-system-data-datasetextensions4.0-cil
  48. libmono-system-web-extensions4.0-cil
  49. libmono-system-management4.0-cil
  50. libmono-system-xml-linq4.0-cil
  51. libmono-corlib4.0-cil
  52. libqt4-dev
  53. dos2unix
  54. cmake
  55. "
  56.  
  57. for DEP in $DEPS; do
  58. if ! dpkg -s $DEP > /dev/null 2>&1; then
  59. echo "Attempting installation of missing package: $DEP"
  60. set -x
  61. sudo apt-get install -y $DEP
  62. set +x
  63. fi
  64. done
  65. fi
  66.  
  67. echo
  68. if [ "$IS_GITHUB_BUILD" = true ]; then
  69. echo
  70. echo Github build
  71. echo Checking / downloading the latest archives
  72. echo
  73. set +e
  74. chmod +x Build/BatchFiles/Linux/GetAssets.py
  75. Build/BatchFiles/Linux/GetAssets.py EpicGames/UnrealEngine $GITHUB_TAG
  76. UpdateResult=$?
  77. set -e
  78.  
  79. if [ $UpdateResult -eq 1 ]; then
  80. echo
  81. echo Could not check/download binary dependencies!
  82. exit 1
  83. fi
  84.  
  85. # check if it had to download anything
  86. if [ $UpdateResult -eq 2 -o "$FORCE_UPDATEDEPS" = true ]; then
  87. echo
  88. echo Downloaded new binaries!
  89. echo Unpacking and massaging the files
  90. pushd Build/BatchFiles/Linux > /dev/null
  91. ./UpdateDeps.sh
  92. popd > /dev/null
  93. else
  94. echo
  95. echo All assets are up to date, not unpacking zip files again.
  96. fi
  97.  
  98. else
  99. echo Perforce build
  100. echo Assuming availability of up to date third-party libraries
  101. fi
  102.  
  103. echo
  104. pushd Build/BatchFiles/Linux > /dev/null
  105. ./BuildThirdParty.sh
  106. popd > /dev/null
  107.  
  108. echo
  109. echo Setting up Unreal Engine 4 project files...
  110. echo
  111.  
  112. # args: wrong filename, correct filename
  113. # expects to be in Engine folder
  114. CreateLinkIfNoneExists()
  115. {
  116. WrongName=$1
  117. CorrectName=$2
  118.  
  119. pushd `dirname $CorrectName` > /dev/null
  120. if [ ! -f `basename $CorrectName` ] && [ -f $WrongName ]; then
  121. echo "$WrongName -> $CorrectName"
  122. ln -sf $WrongName `basename $CorrectName`
  123. fi
  124. popd > /dev/null
  125. }
  126.  
  127.  
  128.  
  129. # Fixes for case sensitive filesystem.
  130. for BASE in Content/Editor/Slate Content/Slate Documentation/Source/Shared/Icons; do
  131. find $BASE -name "*.PNG" | while read PNG_UPPER; do
  132. png_lower="$(echo "$PNG_UPPER" | sed 's/.PNG$/.png/')"
  133. if [ ! -f $png_lower ]; then
  134. PNG_UPPER=$(basename $PNG_UPPER)
  135. echo "$png_lower -> $PNG_UPPER"
  136. # link, and not move, to make it usable with Perforce workspaces
  137. ln -sf `basename "$PNG_UPPER"` "$png_lower"
  138. fi
  139. done
  140. done
  141.  
  142. CreateLinkIfNoneExists ../../engine/shaders/Fxaa3_11.usf ../Engine/Shaders/Fxaa3_11.usf
  143. CreateLinkIfNoneExists ../../Engine/shaders/Fxaa3_11.usf ../Engine/Shaders/Fxaa3_11.usf
  144.  
  145. set -x
  146. xbuild Source/Programs/UnrealBuildTool/UnrealBuildTool_Mono.csproj \
  147. /verbosity:quiet /nologo \
  148. /p:TargetFrameworkVersion=v4.0 \
  149. /p:Configuration="Development"
  150.  
  151. xbuild Source/Programs/AutomationTool/AutomationTool_Mono.csproj \
  152. /verbosity:quiet /nologo \
  153. /p:TargetFrameworkVersion=v4.0 \
  154. /p:Platform="AnyCPU" \
  155. /p:Configuration="Development"
  156.  
  157. xbuild Source/Programs/AutomationTool/Scripts/AutomationScripts.Automation.csproj \
  158. /verbosity:quiet /nologo \
  159. /p:TargetFrameworkVersion=v4.0 \
  160. /p:Configuration="Development"
  161.  
  162. xbuild Source/Programs/AutomationTool/Linux/Linux.Automation.csproj \
  163. /verbosity:quiet /nologo \
  164. /p:TargetFrameworkVersion=v4.0 \
  165. /p:Configuration="Development"
  166.  
  167. xbuild Source/Programs/AutomationTool/Android/Android.Automation.csproj \
  168. /verbosity:quiet /nologo \
  169. /p:TargetFrameworkVersion=v4.0 \
  170. /p:Configuration="Development"
  171.  
  172. xbuild Source/Programs/AutomationTool/HTML5/HTML5.Automation.csproj \
  173. /verbosity:quiet /nologo \
  174. /p:TargetFrameworkVersion=v4.0 \
  175. /p:Configuration="Development"
  176.  
  177. # pass all parameters to UBT
  178. mono Binaries/DotNET/UnrealBuildTool.exe -makefile "$@"
  179. set +x
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement