Update build_tc.sh

This commit is contained in:
Daniel Stankewitz 2018-07-01 19:40:44 +02:00 committed by GitHub
parent e6ca33082a
commit 50193d5c1e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -17,7 +17,6 @@ else
fi fi
function compile { function compile {
echo "### Compiling '$1' ...";
cd $SRC/$1 cd $SRC/$1
make clean make clean
CC=cl ./configure --prefix=$BUILD $2 CC=cl ./configure --prefix=$BUILD $2
@ -31,34 +30,23 @@ if [ "$STEP" == "libfdk-aac" ]; then
compile fdk-aac "--disable-static --disable-shared" compile fdk-aac "--disable-static --disable-shared"
elif [ "$STEP" == "lame" ]; then elif [ "$STEP" == "lame" ]; then
compile lame "--enable-nasm --disable-frontend --disable-shared --enable-static" compile lame "--enable-nasm --disable-frontend --disable-shared --enable-static"
else elif [ "$STEP" == "zimg" ]; then
echo "Unknown build step!" cd $SRC/zimg
exit 1 ./autogen.sh
fi ./configure --prefix=$BUILD
cd _msvc/zimg
exit MSBuild.exe /maxcpucount:$CPU_CORES /property:Configuration="$MSBUILD_CONFIG" /property:Platform=x64 /property:WholeProgramOptimization=false zimg.vcxproj
cp x64/$MSBUILD_CONFIG/z.lib $BUILD/lib/zimg.lib
cd ../..
cp src/zimg/api/zimg.h $BUILD/include/zimg.h
cp zimg.pc $BUILD/lib/pkgconfig/zimg.pc
elif [ "$STEP" == "x264" ]; then
# Compile x264 as static lib
function compile_x264 {
cd $SRC/x264 cd $SRC/x264
make clean make clean
CC=cl.exe ./configure --prefix=$BUILD --extra-cflags='-DNO_PREFIX' --disable-cli --enable-static --libdir=$BUILD/lib CC=cl ./configure --prefix=$BUILD --extra-cflags='-DNO_PREFIX' --disable-cli --enable-static --libdir=$BUILD/lib
make -j $CPU_CORES make -j $CPU_CORES
make install-lib-static make install-lib-static
} elif [ "$STEP" == "x265" ]; then
function compile_x265 {
cd $SRC/x265/build/vc15-x86_64 cd $SRC/x265/build/vc15-x86_64
rm -rf work* rm -rf work*
mkdir work work10 work12 mkdir work work10 work12
@ -83,38 +71,23 @@ function compile_x265 {
cp x265.pc $BUILD/lib/pkgconfig/x265.pc cp x265.pc $BUILD/lib/pkgconfig/x265.pc
cp x265_config.h $BUILD/include/ cp x265_config.h $BUILD/include/
cp ../../../source/x265.h $BUILD/include/ cp ../../../source/x265.h $BUILD/include/
} elif [ "$STEP" == "ffmpeg" ]; then
# Install nv-codec-headers
function compile_ffnvcodec {
echo "### Copying NVENC headers ..." echo "### Copying NVENC headers ..."
cd $SRC/ffnvcodec cd $SRC/ffnvcodec
make PREFIX=$BUILD install make PREFIX=$BUILD install
}
# Install amf
function compile_amf {
echo "### Copying AMF headers ..." echo "### Copying AMF headers ..."
cp -a $SRC/amf/amf/public/include $BUILD/include/AMF cp -a $SRC/amf/amf/public/include $BUILD/include/AMF
}
# Install zimg echo "### Applying patches ..."
function compile_zimg { cd $SRC/ffmpeg
cd $SRC/zimg patch -N -p1 --dry-run --silent -i ../../patches/0001-dynamic-loading-of-shared-fdk-aac-library.patch
./autogen.sh if [ $? -eq 0 ];
./configure --prefix=$BUILD then
cd _msvc/zimg patch -N -p1 -i ../../patches/0001-dynamic-loading-of-shared-fdk-aac-library.patch
MSBuild.exe /maxcpucount:$CPU_CORES /property:Configuration="$MSBUILD_CONFIG" /property:Platform=x64 /property:WholeProgramOptimization=false zimg.vcxproj fi
cp x64/$MSBUILD_CONFIG/z.lib $BUILD/lib/zimg.lib
cd ../..
cp src/zimg/api/zimg.h $BUILD/include/zimg.h
cp zimg.pc $BUILD/lib/pkgconfig/zimg.pc
}
echo "### Compiling FFMpeg ..."
# Compile ffmpeg as static lib
function compile_ffmpeg {
cd $SRC/ffmpeg cd $SRC/ffmpeg
make clean make clean
if [ "$MODE" == "debug" ]; then if [ "$MODE" == "debug" ]; then
@ -125,29 +98,12 @@ function compile_ffmpeg {
PKG_CONFIG_PATH=$BUILD/lib/pkgconfig:$PKG_CONFIG_PATH ./configure --toolchain=msvc --extra-cflags="$CFLAGS -I$BUILD/include" --extra-ldflags="-LIBPATH:$BUILD/lib" --prefix=$BUILD --pkg-config-flags="--static" --disable-doc --disable-shared --enable-static --enable-gpl --enable-runtime-cpudetect --disable-devices --disable-network --enable-w32threads --enable-libmp3lame --enable-libzimg --enable-avisynth --enable-libx264 --enable-libx265 --enable-cuda --enable-cuvid --enable-d3d11va --enable-nvenc --enable-amf --enable-libmfx --enable-libfdk-aac PKG_CONFIG_PATH=$BUILD/lib/pkgconfig:$PKG_CONFIG_PATH ./configure --toolchain=msvc --extra-cflags="$CFLAGS -I$BUILD/include" --extra-ldflags="-LIBPATH:$BUILD/lib" --prefix=$BUILD --pkg-config-flags="--static" --disable-doc --disable-shared --enable-static --enable-gpl --enable-runtime-cpudetect --disable-devices --disable-network --enable-w32threads --enable-libmp3lame --enable-libzimg --enable-avisynth --enable-libx264 --enable-libx265 --enable-cuda --enable-cuvid --enable-d3d11va --enable-nvenc --enable-amf --enable-libmfx --enable-libfdk-aac
make -j $CPU_CORES make -j $CPU_CORES
make install make install
} else
echo "Unknown build step!"
exit 1
fi
# apply various patches exit
function apply_patches {
cd $SRC/ffmpeg
patch -N -p1 --dry-run --silent -i ../../patches/0001-dynamic-loading-of-shared-fdk-aac-library.patch
if [ $? -eq 0 ];
then
patch -N -p1 -i ../../patches/0001-dynamic-loading-of-shared-fdk-aac-library.patch
fi
cd -
}
compile_zimg
compile_x264
compile_x265
apply_patches
compile_ffnvcodec
compile_amf
compile_ffmpeg
# Finish # Finish
cd $BUILD/lib cd $BUILD/lib