Files
UnrealEngineUWP/Engine/Build/BatchFiles/Linux/BuildThirdParty.sh
Josh Adams 660ab7f0c9 Copying //UE4/Dev-Platform to //UE4/Main
==========================
MAJOR FEATURES + CHANGES
==========================

Change 2719147 on 2015/10/07 by Mark.Satterthwaite

	Allow the shader cache to perform some precompilation synchronously on load before falling back to asynchronous compilation to balance load times against total time spent precompiling. Added a stat to the group that reports how long the precompile has been running until it completes so it is easier to track.

Change 2719182 on 2015/10/07 by Mark.Satterthwaite

	Refactor the ShaderCache's internal data structures and change the way we handle recording whether a particular predraw state has been submitted to try and make it more efficient.

Change 2719185 on 2015/10/07 by Mark.Satterthwaite

	Merging CL #2717701: Try and fix random crashes on Mac when manipulating bound-shader-states caused by ShaderCache potentially providing a bogus shader state pointer on exit from predraw.

Change 2719434 on 2015/10/07 by Mark.Satterthwaite

	Make sure that Mac ensures reports have a source context and a sane callstack when sent to the crash-reports server.

Change 2724764 on 2015/10/12 by Josh.Adams

	[Initial AppleTV support]
	Merging	//depot/YakBranch/... to //UE4/Dev-Platform/...

Change 2726266 on 2015/10/13 by Lee.Clark

	PS4 - Calc reserve size required for DMA copy when using unsafe command buffers

Change 2726401 on 2015/10/13 by Mark.Satterthwaite

	Merging CL #2716418: Fix UE-15228 'Crash Report Client doesn't restart into project editor on Mac' by reporting the original command line supplied by LaunchMac, not the modified one that strips the project name. The CRC can then relaunch as expected.
	#jira UE-15228

Change 2726421 on 2015/10/13 by Lee.Clark

	PS4 - Don't try to clear invalid targets

Change 2727040 on 2015/10/13 by Michael.Trepka

	Merging CL 2724777 - Fixed splash screen rendering for images with DPI different than 72

Change 2729783 on 2015/10/15 by Keith.Judge

	Fix huge memory leak in Test/Shipping configurations, caused because I am a numpty.

Change 2729847 on 2015/10/15 by Mark.Satterthwaite

	Merging CL #2729846: On OS X unconstrain windows from the dimension of the parent display when in Windowed mode - it is OK for them to be larger in this case. They do need to be repositioned if on the Primary display so that they don't creep under the menu bar and become unmovable/unclosable and Fullscreen windows still need to be constrained to a single display. We can now take screenshots of windows that are larger than the display & not get grey bars beyond the cutoff.
	#jira UE-21992

Change 2729865 on 2015/10/15 by Keith.Judge

	Fast semantics - Finish up resource transitions, adding resource decompression where appropriate and using non-fast clears where we can't determine the resource transition.

Change 2729897 on 2015/10/15 by Keith.Judge

	Fast Semantics - Make sure all GetData() calls are made safe with GPU fences.

Change 2729972 on 2015/10/15 by Keith.Judge

	Removed the last vestiges of ID3D11DeviceContext/ID3D11DeviceContext1 from the Xbox RHI. Everything now uses ID3D11DeviceContextX directly.

	This should be marginally quicker as it stops a double call to ClearState().

Change 2731503 on 2015/10/16 by Keith.Judge

	Added _XDK_VERSION to the DDC key for textures, which should solve the issue of the tiling mode changing in August XDK (and future changes Microsoft may inflict).

Change 2731596 on 2015/10/16 by Keith.Judge

	Fast Semantics - Add deferred resource deletion queue to make deleted resources be actually deleted a number of frames later so that the GPU is definitely finished with them. Hooked up the temporary SRVs for dynamic VBs as a first step.

Change 2731928 on 2015/10/16 by Michael.Trepka

	PR #1659: Mac/Build.sh handles additional arguments (Contributed by judgeaxl)

Change 2731934 on 2015/10/16 by Michael.Trepka

	PR #1618: added clang 3.7.0 -Wshift-negative-value ignore in JpegImageWrapper.cpp (Contributed by bsekura)

Change 2732018 on 2015/10/16 by Mark.Satterthwaite

	Emit a shader code cache for each platforms requested shader formats, this is separate to the targeted formats as not all can or need to be cached.
	- The implementation extends the ShaderCache's hooks in FShaderResource's serialisation function to capture the required shaders.
	- Each target platform has its own list of cached shader formats, analogous to the list of targeted RHIs. Presently only the Mac implements this.
	- Code cached shaders are now compressed (for size) to reduce the overhead associated with keeping all the shader code around - this works esp. well for text-based formats like GLSL.

Change 2732365 on 2015/10/16 by Josh.Adams

	- Packaging a TVOS .ipa now works (still haven't tried any of the Editor integration like Launch On)

Change 2733170 on 2015/10/18 by Terence.Burns

	Fix for Android IAP query not returning entire inventory.

Change 2733174 on 2015/10/18 by Terence.Burns

	Fix Movie player issue where wait for movie to finish isnt being respected.

	Seems a stray bUserCanceled event flag was causing this not to be observed.

	Added some verbose logging to apple movie player.

Change 2733488 on 2015/10/19 by Mark.Satterthwaite

	Added the ability to merge the .ushadercache files used by the ShaderCache to store shader & draw state information.
	- Fixed a bug that would cause invalid shader membership and draw state information to be logged.
	- Added a separate command-line tool to merge shader cache files, currently Mac-only but in theory should work on other platforms too.

Change 2735226 on 2015/10/20 by Mark.Satterthwaite

	Fix temporal AA rendering on GL/Mac OS X - you can't rely on EyeAdaptation values unless SM5 is available so only perform that code on SM5 & we must correctly clamp saturate(NaN) to 0 as the current hlslcc won't do that for us (& is required by the HLSL spec). The latter used to be clamped in the AA_ALPHA && AA_VELOCITY_WEIGHTING code block that was removed recently.
	#jira UE-21214
	#jira UE-19913

Change 2736722 on 2015/10/21 by Daniel.Lamb

	Improved performance of cooking stats system.

Change 2737172 on 2015/10/21 by Daniel.Lamb

	Improved cooking stats performance for ddc stats.
2015-12-10 16:56:55 -05:00

528 lines
13 KiB
Bash
Executable File

#!/bin/bash
# Script for building ThirdParty modules for linux.
# You must run UpdateDeps.sh to download and patch the sources before running
# this script.
SCRIPT_DIR=$(cd "$(dirname "$BASH_SOURCE")" ; pwd)
TOP_DIR=$(cd $SCRIPT_DIR/../../.. ; pwd)
cd ${TOP_DIR}
mkdir -p Binaries/Linux/
set -e
MAKE_ARGS=-j4
TARGET_ARCH=x86_64-unknown-linux-gnu
#TARGET_ARCH=arm-unknown-linux-gnueabihf
export TARGET_ARCH
SDL_DIR=SDL-gui-backend
SDL_BUILD_DIR=build-$SDL_DIR
# Open files for edit using p4 command line.
# Does nothing if the file is already writable (which is case for external
# github developers).
P4Open()
{
for file in $@; do
# If the file does not exist do nothing
if [ ! -e $file ]; then
return
fi
# If the file is already writable do nothing
if [ -w $file ]; then
return
fi
# If the file is already writable do nothing
if ! which p4 > /dev/null; then
echo "File is not writable and 'p4' command not found."
exit 1
fi
set +x
p4 open "$file"
set -x
done
}
BuildZ()
{
echo "building zlib"
set -x
cd Source/ThirdParty/zlib/zlib-1.2.5/build
tar xf zlib-1.2.5.tar.gz
cd zlib-1.2.5
CFLAGS=-fPIC ./configure
make $MAKE_ARGS
local LIB_DIR=../../Lib/Linux/$TARGET_ARCH
P4Open $LIB_DIR/libz.a
P4Open $LIB_DIR/libz_fPIC.a
mkdir -p $LIB_DIR
cp libz.a $LIB_DIR/libz_fPIC.a
set +x
}
BuildJemalloc()
{
echo "building jemalloc"
set -x
cd Source/ThirdParty/jemalloc/build
tar xf jemalloc-3.6.0.tar.bz2
cd jemalloc-3.6.0
./configure --with-mangling --with-jemalloc-prefix=je_
make $MAKE_ARGS
local LIB_DIR=../../lib/Linux/$TARGET_ARCH
local INC_DIR=../../include/Linux/$TARGET_ARCH
P4Open $LIB_DIR/libjemalloc.a
P4Open $LIB_DIR/libjemalloc_pic.a
mkdir -p $LIB_DIR
cp lib/libjemalloc.a $LIB_DIR
cp lib/libjemalloc_pic.a $LIB_DIR
mkdir -p $INC_DIR
P4Open $INC_DIR/jemalloc_defs.h
P4Open $INC_DIR/jemalloc.h
cp -rp include/jemalloc/* $INC_DIR
set +x
}
BuildOpus()
{
echo "building libOpus"
set -x
cd Source/ThirdParty/libOpus/opus-1.1/
P4Open configure
chmod +x configure
./configure --with-pic
make $MAKE_ARGS
local LIB_DIR=Linux/$TARGET_ARCH
mkdir -p $LIB_DIR
P4Open $LIB_DIR/libopus_fPIC.a
cp .libs/libopus.a $LIB_DIR/libopus_fPIC.a
set +x
}
BuildOgg()
{
echo "building Ogg"
set -x
cd Source/ThirdParty/Ogg/libogg-1.2.2/
P4Open configure
chmod +x configure
./configure --with-pic
make $MAKE_ARGS
local LIB_DIR=lib/Linux/$TARGET_ARCH
P4Open $LIB_DIR/libogg.a
P4Open $LIB_DIR/libogg_fPIC.a
mkdir -p $LIB_DIR
cp src/.libs/libogg.a $LIB_DIR
cp $LIB_DIR/libogg.a $LIB_DIR/libogg_fPIC.a
set +x
}
BuildVorbis()
{
echo "building Vorbis"
set -x
cd Source/ThirdParty/Vorbis/libvorbis-1.3.2/
P4Open configure
chmod +x configure
OGG_LIBS=../../Ogg/libogg-1.2.2/lib/Linux \
OGG_CFLAGS=-I../../../Ogg/libogg-1.2.2/include \
./configure --with-pic --disable-oggtest
make $MAKE_ARGS
local LIB_DIR=lib/Linux/$TARGET_ARCH
P4Open $LIB_DIR/libvorbis.a $LIB_DIR/libvorbisfile.a $LIB_DIR/libvorbis_fPIC.a $LIB_DIR/libvorbisfile_fPIC.a
P4Open $LIB_DIR/libvorbisenc.a $LIB_DIR/libvorbisenc_fPIC.a
mkdir -p $LIB_DIR
cp lib/.libs/libvorbis*.a $LIB_DIR/
cp $LIB_DIR/libvorbis.a libvorbis_fPIC.a
cp $LIB_DIR/libvorbisfile.a libvorbisfile_fPIC.a
cp $LIB_DIR/libvorbisenc.a libvorbisenc_fPIC.a
set +x
cd -
}
BuildHLSLCC()
{
echo "building hlslcc"
set -x
cd Source/ThirdParty/hlslcc
# not building anymore P4Open hlslcc/bin/Linux/hlslcc_64
P4Open hlslcc/lib/Linux/$TARGET_ARCH/libhlslcc.a
cd hlslcc/projects/Linux
set +e
CLANG_TO_USE=`which clang`
set -e
if [ ! -f "$CLANG_TO_USE" ]; then
CLANG_TO_USE=clang-3.5 # this version should be installed by Setup.sh
fi
set +e
CLANGXX_TO_USE=`which clang++`
set -e
if [ ! -f "$CLANGXX_TO_USE" ]; then
CLANGXX_TO_USE=clang++-3.5 # this version should be installed by Setup.sh
fi
make $MAKE_ARGS CC=$CLANG_TO_USE CXX=$CLANGXX_TO_USE clean
make $MAKE_ARGS CC=$CLANG_TO_USE CXX=$CLANGXX_TO_USE
set +x
}
BuildMcpp()
{
echo "building MCPP"
set -x
cd Source/ThirdParty/MCPP/mcpp-2.7.2
P4Open configure
chmod +x configure
./configure --enable-shared --enable-shared --enable-mcpplib
make $MAKE_ARGS
local LIB_DIR=lib/Linux/$TARGET_ARCH
P4Open $LIB_DIR/libmcpp.a
P4Open $LIB_DIR/libmcpp.so
P4Open ${TOP_DIR}/Binaries/Linux/libmcpp.so.0
mkdir -p $LIB_DIR
cp --remove-destination ./src/.libs/libmcpp.a $LIB_DIR/
cp --remove-destination ./src/.libs/libmcpp.so $LIB_DIR/
cp --remove-destination ./src/.libs/libmcpp.so ${TOP_DIR}/Binaries/Linux/libmcpp.so.0
set +x
}
BuildFreeType()
{
echo "building freetype"
set -x
cd Source/ThirdParty/FreeType2/FreeType2-2.4.12/src
pwd
make $MAKE_ARGS -f ../Builds/Linux/makefile $*
local LIB_DIR=../Lib/Linux/$TARGET_ARCH
P4Open $LIB_DIR/libfreetype2412.a
P4Open $LIB_DIR/libfreetype2412_fPIC.a
cp --remove-destination libfreetype2412.a $LIB_DIR/libfreetype2412.a
cp $LIB_DIR/libfreetype2412.a $LIB_DIR/libfreetype2412_fPIC.a
set +x
}
BuildICU()
{
echo "building libICU"
set -x
cd Source/ThirdParty/ICU/icu4c-53_1/source
P4Open configure
chmod +x configure
CPPFLAGS=-fPIC ./configure --enable-static
pwd
make $MAKE_ARGS $*
local LIB_DIR=../Linux/$TARGET_ARCH
mkdir -p $LIB_DIR
mkdir -p ${TOP_DIR}/Binaries/ThirdParty/ICU/icu4c-53_1/Linux/$TARGET_ARCH/
P4Open $LIB_DIR/libicudata.a $LIB_DIR/libicudatad.a $LIB_DIR/libicui18n.a $LIB_DIR/libicui18nd.a
P4Open $LIB_DIR/libicuio.a $LIB_DIR/libicuiod.a $LIB_DIR/libicule.a $LIB_DIR/libiculed.a
P4Open $LIB_DIR/libiculx.a $LIB_DIR/libiculxd.a $LIB_DIR/libicutu.a $LIB_DIR/libicutud.a
P4Open $LIB_DIR/libicuuc.a $LIB_DIR/libicuucd.a
cp --remove-destination lib/*.a $LIB_DIR
cp -P --remove-destination lib/*.so* ${TOP_DIR}/Binaries/ThirdParty/ICU/icu4c-53_1/Linux/$TARGET_ARCH/
set +x
}
BuildLND()
{
echo "building LinuxNativeDialogs"
set -x
cd Source/ThirdParty/LinuxNativeDialogs/UELinuxNativeDialogs
rm -rf build
mkdir build
cd build
cmake ..
make $MAKE_ARGS
local LIB_DIR=../lib/Linux/$TARGET_ARCH/
mv *.so $LIB_DIR
cp -P --remove-destination $LIB_DIR/*.so ${TOP_DIR}/Binaries/ThirdParty/LinuxNativeDialogs/Linux/$TARGET_ARCH/
set +x
}
BuildForsythTriOO()
{
echo "building ForsythTriOO"
set -x
cd Source/ThirdParty/ForsythTriOO
rm -rf Build/Linux
mkdir -p Build/Linux
mkdir -p Lib/Linux/$TARGET_ARCH
cd Build/Linux
cmake -DCMAKE_BUILD_TYPE=Debug ../../
make
cmake -DCMAKE_BUILD_TYPE=Release ../../
make
P4Open ../../Lib/Linux/$TARGET_ARCH/libForsythTriOptimizer*
cp --remove-destination libForsythTriOptimizer* ../../Lib/Linux/$TARGET_ARCH/
set +x
}
BuildnvTriStrip()
{
echo "building nvTriStrip"
set -x
cd Source/ThirdParty/nvTriStrip/nvTriStrip-1.0.0
rm -rf Build/Linux
mkdir -p Build/Linux
mkdir -p Lib/Linux/$TARGET_ARCH
cd Build/Linux
cmake -DCMAKE_BUILD_TYPE=Debug ../../
make
cmake -DCMAKE_BUILD_TYPE=Release ../../
make
P4Open ../../Lib/Linux/$TARGET_ARCH/libnvtristrip*
cp --remove-destination libnvtristrip* ../../Lib/Linux/$TARGET_ARCH/
set +x
}
BuildnvTextureTools()
{
echo "building nvTextureTools"
set -x
cd Source/ThirdParty/nvTextureTools/nvTextureTools-2.0.8
mkdir -p lib/Linux/$TARGET_ARCH
cd src
rm -rf build
P4Open configure
chmod +x ./configure
CXXFLAGS=-fPIC ./configure --release
make
local LIB_DIR=../lib/Linux/$TARGET_ARCH
P4Open $LIB_DIR/libnvcore.so
cp --remove-destination build/src/nvcore/libnvcore.so $LIB_DIR/
P4Open $LIB_DIR/libnvimage.so
cp --remove-destination build/src/nvimage/libnvimage.so $LIB_DIR/
P4Open $LIB_DIR/libnvmath.so
cp --remove-destination build/src/nvmath/libnvmath.so $LIB_DIR/
P4Open $LIB_DIR/libnvtt.so
cp --remove-destination build/src/nvtt/libnvtt.so $LIB_DIR/
P4Open $LIB_DIR/libsquish.so
cp --remove-destination build/src/nvtt/squish/libsquish.a $LIB_DIR/
cp --remove-destination $LIB_DIR/*.so ${TOP_DIR}/Binaries/Linux/
set +x
}
BuildSDL2()
{
echo "building SDL2"
set -x
cd Source/ThirdParty/SDL2/
rm -rf $SDL_BUILD_DIR
mkdir -p $SDL_BUILD_DIR
cd $SDL_BUILD_DIR
cmake ../$SDL_DIR
make ${MAKE_ARGS}
P4Open ../$SDL_DIR/lib/Linux/x86_64-unknown-linux-gnu/libSDL2.a
P4Open ../$SDL_DIR/lib/Linux/x86_64-unknown-linux-gnu/libSDL2_fPIC.a
cp --remove-destination libSDL2.a ../$SDL_DIR/lib/Linux/x86_64-unknown-linux-gnu/libSDL2.a
cp --remove-destination libSDL2_fPIC.a ../$SDL_DIR/lib/Linux/x86_64-unknown-linux-gnu/libSDL2_fPIC.a
set +x
}
Buildcoremod()
{
echo "building coremod"
set -x
cd Source/ThirdParty/coremod/coremod-4.2.6
pwd
autoconf
CFLAGS=-fPIC ./configure --enable-static
make $MAKE_ARGS
local LIB_DIR=lib/Linux/$TARGET_ARCH
mkdir -p $LIB_DIR
P4Open $LIB_DIR/libcoremodLinux.a
cp lib/libxmp-coremod.a $LIB_DIR/libcoremodLinux.a
set +x
}
FixICU()
{
echo "setting symlinks for ICU libraries (possibly temporary)"
set -x
cd Binaries/ThirdParty/ICU/icu4c-53_1/Linux/x86_64-unknown-linux-gnu
pwd
ln -sf libicudata.so libicudata.so.53
ln -sf libicudata.so libicudata.53.1.so
ln -sf libicui18n.so libicui18n.so.53
ln -sf libicui18n.so libicui18n.53.1.so
ln -sf libicuio.so libicuio.so.53
ln -sf libicuio.so libicuio.53.1.so
ln -sf libicule.so libicule.so.53
ln -sf libicule.so libicule.53.1.so
ln -sf libiculx.so libiculx.so.53
ln -sf libiculx.so libiculx.53.1.so
ln -sf libicutu.so libicutu.so.53
ln -sf libicutu.so libicutu.53.1.so
ln -sf libicuuc.so libicuuc.so.53
ln -sf libicuuc.so libicuuc.53.1.so
set +x
}
Run()
{
cd ${TOP_DIR}
echo "==> $1"
if [[ $VERBOSE -eq 1 ]]; then
$1
else
$1 >> ${SCRIPT_DIR}/BuildThirdParty.log 2>&1
fi
}
Success() {
if [ -z $1 ]; then
echo "********** SUCCESS ****************"
else
echo "********** SUCCESS $1 ****************"
fi
}
build_all() {
Run BuildJemalloc
Run BuildZ
Run BuildOpus
Run BuildOgg
Run BuildVorbis
Run BuildHLSLCC
Run BuildMcpp
Run BuildFreeType
Run BuildLND
Run BuildForsythTriOO
Run BuildnvTriStrip
Run BuildnvTextureTools
Run BuildSDL2
Run Buildcoremod
Run FixICU
}
print_help() {
echo "-a|--all Rebuild all ThirdParty libs"
echo "-v|--verbose Print full output, otherwise output is logged to BuildThirdParty.log"
echo "-b|--build BUILD_ME|--build=BUILD_ME Rebuild a specific library"
print_valid_build_opts
echo "-h|--help Print this help and exit"
}
print_valid_build_opts() {
echo " Valid build choices are"
echo " Jemalloc"
echo " Z"
echo " Opus"
echo " Ogg"
echo " Vorbis"
echo " HLSLCC"
echo " Mcpp"
echo " FreeType"
echo " LND"
echo " ForsythTriOO"
echo " nvTriStrip"
echo " nvTextureTools"
echo " SDL2"
echo " coremod"
echo " ICU"
}
BuildList=()
# Parse command line parameters
while :; do
case $1 in
-h|--help)
print_help
exit
;;
-v|--verbose)
VERBOSE=1
shift
continue
;;
-a|--all)
ALL=1
shift
continue
;;
-b|--build) # Add to the list of packages to build
if [ "$2" ]; then
BuildList+=("$2")
BUILD_LIST=1
shift 2
continue
else
echo 'ERROR: Must specify non empty "--build=BUILD" argument.' >&2
print_valid_build_opts
exit 1
fi
;;
--build=?*) # Add to the list of packages to build
BuildList+=("${1#*=}")
BUILD_LIST=1
shift
continue
;;
--build=)
echo 'ERROR: Must specify non empty "--build=BUILD" argument.' >&2
exit 1
;;
--)
shift
break
;;
-?*)
printf "WARN: Unknown Option (ignored): %s\n' "$1" >&2"
;;
*)
break
esac
shift
done
echo "Building ThirdParty libraries"
echo
echo "If you don't see SUCCESS message in the end, then building did not finish properly."
echo "In that case, take a look into ${SCRIPT_DIR}/BuildThirdParty.log for details."
echo
rm -f ${SCRIPT_DIR}/BuildThirdParty.log
# if -b --build or --build=?* is used, build the list
# instead of the default or all
if [[ ${#BuildList[@]} -ne 0 && $ALL -eq 0 ]]; then
for var in "${BuildList[@]}"
do
if [[ "${var}" -ne "ICU" ]]; then
Run Fix"${var}"
Success "${var}"
else
Run Build"${var}"
Success "${var}"
fi
done
exit
elif [[ ${#BuildList[@]} -ne 0 ]] && [[ $ALL -eq 1 ]]; then
echo "ERROR: Can not build all and individual packages at the same time"
exit
fi
if [[ $ALL -eq 1 ]]; then
build_all
else
# we need ot build hlslcc locally because using a different STL results in badness
Run BuildHLSLCC
fi
echo
Success