diff options
author | Anton Fedchin <anightik@gmail.com> | 2017-12-06 11:12:01 +0300 |
---|---|---|
committer | Anton Fedchin <anightik@gmail.com> | 2017-12-08 18:12:09 +0300 |
commit | 13869c2f49b38b25d5e85eeec948bfde503118d8 (patch) | |
tree | 93210b15965697d4dad50d59722938a2c05ffa1d /tools/buildsteps | |
parent | 73538606ad95d8853c2c49ce2ffce1c659f78184 (diff) |
[mingwlibs] build ffmpeg with msvc tools
Diffstat (limited to 'tools/buildsteps')
-rw-r--r-- | tools/buildsteps/windows/buildffmpeg.sh | 99 | ||||
-rw-r--r-- | tools/buildsteps/windows/buildhelpers.sh | 6 | ||||
-rw-r--r-- | tools/buildsteps/windows/make-mingwlibs.bat | 7 | ||||
-rw-r--r-- | tools/buildsteps/windows/make-mingwlibs.sh | 5 |
4 files changed, 37 insertions, 80 deletions
diff --git a/tools/buildsteps/windows/buildffmpeg.sh b/tools/buildsteps/windows/buildffmpeg.sh index 4d27aee34c..953e6b692f 100644 --- a/tools/buildsteps/windows/buildffmpeg.sh +++ b/tools/buildsteps/windows/buildffmpeg.sh @@ -78,79 +78,44 @@ do_removeOption() { do_getFFmpegConfig -if [ "$TOOLS" = "msvc" ]; then - do_removeOption "--enable-gnutls" - do_removeOption "--enable-openssl" - do_addOption "--disable-gnutls" - do_addOption "--disable-openssl" - do_addOption "--toolchain=msvc" +do_removeOption "--enable-gnutls" +do_removeOption "--enable-openssl" +do_addOption "--disable-gnutls" +do_addOption "--disable-openssl" +do_addOption "--toolchain=msvc" + +if [ "$ARCH" == "x86_64" ]; then + FFMPEG_TARGET_OS=win64 +elif [ "$ARCH" = "x86" ]; then + FFMPEG_TARGET_OS=win32 +elif [ "$ARCH" = "arm" ]; then + FFMPEG_TARGET_OS=win32 +fi - if [ "$ARCH" == "x86_64" ]; then - FFMPEG_TARGET_OS=win64 - elif [ "$ARCH" = "x86" ]; then - FFMPEG_TARGET_OS=win32 - elif [ "$ARCH" = "arm" ]; then - FFMPEG_TARGET_OS=win32 - fi +export CFLAGS="" +export CXXFLAGS="" +export LDFLAGS="" + +extra_cflags="-I$LOCALDESTDIR/include -I/depends/$TRIPLET/include" +extra_ldflags="-LIBPATH:\"$LOCALDESTDIR/lib\" -LIBPATH:\"$MINGW_PREFIX/lib\" -LIBPATH:\"/depends/$TRIPLET/lib\"" +if [ $win10 == "yes" ]; then + # enable OpenSSL on UWP, because schannel isn't available + do_removeOption "--disable-openssl" + do_addOption "--enable-openssl" + do_addOption "--enable-nonfree" + do_addOption "--enable-cross-compile" + extra_cflags=$extra_cflags" -MD -DWINAPI_FAMILY=WINAPI_FAMILY_APP -D_WIN32_WINNT=0x0A00" + extra_ldflags=$extra_ldflags" -APPCONTAINER WindowsApp.lib" +fi - export CFLAGS="" - export CXXFLAGS="" - export LDFLAGS="" - - extra_cflags="-I$LOCALDESTDIR/include -I/depends/$TRIPLET/include" - extra_ldflags="-LIBPATH:\"$LOCALDESTDIR/lib\" -LIBPATH:\"$MINGW_PREFIX/lib\" -LIBPATH:\"/depends/$TRIPLET/lib\"" - if [ $win10 == "yes" ]; then - # enable OpenSSL on UWP, because schannel isn't available - do_removeOption "--disable-openssl" - do_addOption "--enable-openssl" - do_addOption "--enable-nonfree" - do_addOption "--enable-cross-compile" - extra_cflags=$extra_cflags" -MD -DWINAPI_FAMILY=WINAPI_FAMILY_APP -D_WIN32_WINNT=0x0A00" - extra_ldflags=$extra_ldflags" -APPCONTAINER WindowsApp.lib" - else - # compile ffmpeg with debug symbols - do_removeOption "--disable-debug" - do_addOption "--enable-debug" - extra_cflags=$extra_cflags" -MDd" - extra_ldflags=$extra_ldflags" -NODEFAULTLIB:libcmt" - fi +# compile ffmpeg with debug symbols +if do_checkForOptions "--enable-debug"; then + extra_cflags=$extra_cflags" -MDd" + extra_ldflags=$extra_ldflags" -NODEFAULTLIB:libcmt" fi cd $LOCALBUILDDIR -if do_checkForOptions "--enable-gnutls"; then -if do_pkgConfig "gnutls = $GNUTLS_VER"; then - if [[ ! -f "/downloads/gnutls-${GNUTLS_VER}.tar.xz" ]]; then - do_wget "http://mirrors.xbmc.org/build-deps/sources/gnutls-${GNUTLS_VER}.tar.xz" - fi - tar -xaf "/downloads/gnutls-${GNUTLS_VER}.tar.xz" -C $LOCALBUILDDIR/src - - gnutls_triplet="gnutls-${GNUTLS_VER}-$TRIPLET" - if [[ ! -d "${gnutls_triplet}" ]]; then - mkdir "${gnutls_triplet}" - fi - cd "${gnutls_triplet}" - - do_print_status "gnutls-${GNUTLS_VER}" "$blue_color" "Configuring" - - rm -rf $LOCALDESTDIR/include/gnutls - rm -f $LOCALDESTDIR/lib/{libgnutls*,pkgconfig/gnutls.pc} - rm -f $LOCALDESTDIR/bin-global/{gnutls-*,{psk,cert,srp,ocsp}tool}.exe - - $LOCALBUILDDIR/src/gnutls-${GNUTLS_VER}/configure --prefix=$LOCALDESTDIR --disable-shared \ - --build="$MINGW_CHOST" --disable-cxx --disable-doc --disable-tools --disable-tests \ - --without-p11-kit --disable-rpath --disable-libdane --without-idn --without-tpm \ - --enable-local-libopts --disable-guile - - sed -i 's/-lgnutls *$/-lgnutls -lnettle -lhogweed -lcrypt32 -lws2_32 -lz -lgmp -lintl -liconv/' \ - lib/gnutls.pc - - do_print_status "gnutls-${GNUTLS_VER}" "$blue_color" "Compiling" - do_makeinstall - do_pkgConfig "gnutls = $GNUTLS_VER"; -fi -fi - do_clean_get $1 [ -f config.mak ] && make distclean do_print_status "$LIBNAME-$VERSION (${TRIPLET})" "$blue_color" "Configuring" diff --git a/tools/buildsteps/windows/buildhelpers.sh b/tools/buildsteps/windows/buildhelpers.sh index 8b2463fafb..0a7856f9d4 100644 --- a/tools/buildsteps/windows/buildhelpers.sh +++ b/tools/buildsteps/windows/buildhelpers.sh @@ -2,7 +2,6 @@ MAKEFLAGS="$1" BGPROCESSFILE="$2" -tools="$3" cpuCount=1 if [[ $NUMBER_OF_PROCESSORS > 1 ]]; then @@ -139,7 +138,6 @@ do_loaddeps() { LIBNAME=$(grep "LIBNAME=" $file | sed 's/LIBNAME=//g;s/#.*$//g;/^$/d') BASE_URL=$(grep "BASE_URL=" $file | sed 's/BASE_URL=//g;s/#.*$//g;/^$/d') VERSION=$(grep "VERSION=" $file | sed 's/VERSION=//g;s/#.*$//g;/^$/d') - GNUTLS_VER=$(grep "GNUTLS_VER=" $file | sed 's/GNUTLS_VER=//g;s/#.*$//g;/^$/d') GITREV=$(git ls-remote $BASE_URL $VERSION | awk '{print substr($1, 1, 10)}') if [[ -z "$GITREV" ]]; then ARCHIVE=$LIBNAME-$(echo "${VERSION}" | sed 's/\//-/g').tar.gz @@ -168,7 +166,7 @@ do_clean_get() { PATH_CHANGE_REV_FILENAME=".last_success_revision" -#hash a dir based on the git revision, $TRIPLET and $tools +#hash a dir based on the git revision and $TRIPLET #param1 path to be hashed function getBuildHash () { @@ -177,7 +175,7 @@ function getBuildHash () shift 1 local hashStr hashStr="$(git rev-list HEAD --max-count=1 -- $checkPath $@)" - hashStr="$hashStr $@ $TRIPLET $TOOLS" + hashStr="$hashStr $@ $TRIPLET" echo $hashStr } diff --git a/tools/buildsteps/windows/make-mingwlibs.bat b/tools/buildsteps/windows/make-mingwlibs.bat index 3cb77b1579..8d85c59f0e 100644 --- a/tools/buildsteps/windows/make-mingwlibs.bat +++ b/tools/buildsteps/windows/make-mingwlibs.bat @@ -14,7 +14,6 @@ SET build64=no SET buildArm=no SET vcarch=x86 SET msys2=msys64 -SET tools=mingw SET win10=no SET UWPSDKVer= @@ -35,9 +34,7 @@ FOR %%b in (%1, %2, %3, %4) DO ( SET buildArm=yes SET vcarch=arm ) - IF %%b==msvc SET tools=msvc IF %%b==win10 ( - SET tools=msvc SET win10=yes ) ) @@ -69,7 +66,7 @@ rem compiles a bunch of mingw libs and not more IF %opt%==sh ( IF EXIST %WORKDIR%\project\BuildDependencies\%msys2%\usr\bin\sh.exe ( ECHO starting sh shell - %WORKDIR%\project\BuildDependencies\%msys2%\usr\bin\sh.exe --login -i /xbmc/tools/buildsteps/windows/make-mingwlibs.sh --prompt=%PROMPTLEVEL% --mode=%BUILDMODE% --build32=%build32% --build64=%build64% --buildArm=%buildArm% --tools=%tools% --win10=%win10% + %WORKDIR%\project\BuildDependencies\%msys2%\usr\bin\sh.exe --login -i /xbmc/tools/buildsteps/windows/make-mingwlibs.sh --prompt=%PROMPTLEVEL% --mode=%BUILDMODE% --build32=%build32% --build64=%build64% --buildArm=%buildArm% --win10=%win10% GOTO END ) ELSE ( GOTO ENDWITHERROR @@ -77,7 +74,7 @@ IF %opt%==sh ( ) IF EXIST %WORKDIR%\project\BuildDependencies\%msys2%\usr\bin\mintty.exe ( ECHO starting mintty shell - %WORKDIR%\project\BuildDependencies\%msys2%\usr\bin\mintty.exe -d -i /msys2.ico /usr/bin/bash --login /xbmc/tools/buildsteps/windows/make-mingwlibs.sh --prompt=%PROMPTLEVEL% --mode=%BUILDMODE% --build32=%build32% --build64=%build64% --buildArm=%buildArm% --tools=%tools% --win10=%win10% + %WORKDIR%\project\BuildDependencies\%msys2%\usr\bin\mintty.exe -d -i /msys2.ico /usr/bin/bash --login /xbmc/tools/buildsteps/windows/make-mingwlibs.sh --prompt=%PROMPTLEVEL% --mode=%BUILDMODE% --build32=%build32% --build64=%build64% --buildArm=%buildArm% --win10=%win10% GOTO END ) GOTO ENDWITHERROR diff --git a/tools/buildsteps/windows/make-mingwlibs.sh b/tools/buildsteps/windows/make-mingwlibs.sh index 9fb08df79a..e7d3bd6ac3 100644 --- a/tools/buildsteps/windows/make-mingwlibs.sh +++ b/tools/buildsteps/windows/make-mingwlibs.sh @@ -8,12 +8,10 @@ RM=/bin/rm NOPROMPT=0 MAKECLEAN="" MAKEFLAGS="" -TOOLS="mingw" TRIPLET="" while true; do case $1 in - --tools=* ) TOOLS="${1#*=}"; shift ;; --build32=* ) build32="${1#*=}"; shift ;; --build64=* ) build64="${1#*=}"; shift ;; --buildArm=* ) buildArm="${1#*=}"; shift ;; @@ -54,7 +52,7 @@ elif [[ $win10 = "yes" ]]; then TRIPLET=win10-$TRIPLET fi -export TRIPLET ARCH TOOLS +export TRIPLET ARCH throwerror() { $TOUCH $ERRORFILE @@ -92,7 +90,6 @@ echo echo " NOPROMPT = $NOPROMPT" echo " MAKECLEAN = $MAKECLEAN" echo " WORKSPACE = $WORKSPACE" -echo " TOOLCHAIN = $TOOLS" echo echo "-------------------------------------------------------------------------------" |