aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorAnton Fedchin <afedchin@users.noreply.github.com>2016-09-21 16:33:19 +0300
committerGitHub <noreply@github.com>2016-09-21 16:33:19 +0300
commitd51c29fb4bdbf10393048ea57ba4cc92cccb4e1e (patch)
tree66bdf55d6782e41ad5fe0a48a8a443675f17f22c /tools
parent26c8ac6cac6d5a335e926790d6759c96f898020e (diff)
parent506be167c180d9a7be1aeff499bada661a1d74ca (diff)
Merge pull request #10497 from afedchin/ffmpeg_msvc_fix
[mingwlibs] a set of small fixes for ffmpeg build proc.
Diffstat (limited to 'tools')
-rw-r--r--tools/buildsteps/win32/buildffmpeg.sh28
-rw-r--r--tools/buildsteps/win32/fmpeg_options.txt1
-rw-r--r--tools/buildsteps/win32/make-mingwlibs.bat6
3 files changed, 24 insertions, 11 deletions
diff --git a/tools/buildsteps/win32/buildffmpeg.sh b/tools/buildsteps/win32/buildffmpeg.sh
index 99515fd0a5..3eb683eae6 100644
--- a/tools/buildsteps/win32/buildffmpeg.sh
+++ b/tools/buildsteps/win32/buildffmpeg.sh
@@ -7,6 +7,7 @@ FFMPEG_CONFIG_FILE=/xbmc/tools/buildsteps/win32/fmpeg_options.txt
FFMPEG_VERSION_FILE=/xbmc/tools/depends/target/ffmpeg/FFMPEG-VERSION
FFMPEG_BASE_OPTS="--disable-debug --disable-doc --enable-gpl --enable-gnutls --enable-w32threads"
FFMPEG_DEFAULT_OPTS=""
+FFMPEG_TARGET_OS=mingw32
do_loaddeps $FFMPEG_VERSION_FILE
FFMPEGDESTDIR=/xbmc/lib/win32/$LIBNAME
@@ -20,10 +21,12 @@ do_getFFmpegConfig() {
if [[ $BITS = "64bit" ]]; then
arch=x86_64
+ FFMPEG_TARGET_OS=mingw64
# perhaps it's not optimal
do_addOption "--cpu=core2"
else
arch=x86
+ FFMPEG_TARGET_OS=mingw32
do_addOption "--cpu=i686"
fi
export arch
@@ -85,15 +88,22 @@ if [[ "$tools" = "msvc" ]]; then
do_addOption "--enable-debug"
do_addOption "--toolchain=msvc"
- PATH="/c/Program Files (x86)/Microsoft Visual Studio 12.0/VC/BIN/":$PATH
- CFLAGS=""
- CXXFLAGS=""
- LDFLAGS=""
- export PATH CFLAGS CXXFLAGS LDFLAGS
+ # set path to MS cl.exe and link.exe first
+ if [[ $BITS = "64bit" ]]; then
+ FFMPEG_TARGET_OS=win64
+ VCTOOLSPATH="$VS140COMNTOOLS../../VC/BIN/amd64"
+ else
+ FFMPEG_TARGET_OS=win32
+ VCTOOLSPATH="$VS140COMNTOOLS../../VC/BIN/"
+ fi
+
+ export PATH="$VCTOOLSPATH":$PATH
+ export CFLAGS=""
+ export CXXFLAGS=""
+ export LDFLAGS=""
extra_cflags="-MDd -I$LOCALDESTDIR/include"
- extra_ldflags="-LIBPATH:\"$LOCALDESTDIR/lib\" -LIBPATH:\"/mingw32/lib\" /NODEFAULTLIB:libcmt"
- TARGET_OS=win32
+ extra_ldflags="-LIBPATH:\"$LOCALDESTDIR/lib\" -LIBPATH:\"$MINGW_PREFIX/lib\" /NODEFAULTLIB:libcmt"
fi
cd $LOCALBUILDDIR
@@ -133,12 +143,12 @@ do_print_status "$LIBNAME-$VERSION (${BITS})" "$blue_color" "Configuring"
[[ -z "$extra_cflags" ]] && extra_cflags=-DPTW32_STATIC_LIB
[[ -z "$extra_ldflags" ]] && extra_ldflags=-static-libgcc
-./configure --target-os=mingw32 --prefix=$FFMPEGDESTDIR --arch=$arch \
+./configure --target-os=$FFMPEG_TARGET_OS --prefix=$FFMPEGDESTDIR --arch=$arch \
--disable-static --enable-shared $FFMPEG_OPTS_SHARED \
--extra-cflags="$extra_cflags" --extra-ldflags="$extra_ldflags"
do_makelib &&
-cp $FFMPEGDESTDIR/bin/*.dll /xbmc/system/ &&
+cp $FFMPEGDESTDIR/bin/*.dll /xbmc/system/
#remove the bgprocessfile for signaling the process end
if [ -f $BGPROCESSFILE ]; then
diff --git a/tools/buildsteps/win32/fmpeg_options.txt b/tools/buildsteps/win32/fmpeg_options.txt
index fb9f2954fc..891a79ed4d 100644
--- a/tools/buildsteps/win32/fmpeg_options.txt
+++ b/tools/buildsteps/win32/fmpeg_options.txt
@@ -18,3 +18,4 @@
--enable-encoder=mjpeg
--enable-protocol=http
--enable-runtime-cpudetect
+--disable-dxva2 \ No newline at end of file
diff --git a/tools/buildsteps/win32/make-mingwlibs.bat b/tools/buildsteps/win32/make-mingwlibs.bat
index d1567a0adc..0d94facd05 100644
--- a/tools/buildsteps/win32/make-mingwlibs.bat
+++ b/tools/buildsteps/win32/make-mingwlibs.bat
@@ -3,14 +3,13 @@ SETLOCAL
rem batch file to compile mingw libs via BuildSetup
SET WORKDIR=%base_dir%
-rem set M$ env
-call "%VS140COMNTOOLS%\..\..\VC\bin\vcvars32.bat" || exit /b 1
SET PROMPTLEVEL=prompt
SET BUILDMODE=clean
SET opt=mintty
SET build32=yes
SET build64=no
+SET vcarch=x86
SET msys2=msys64
SET tools=mingw
FOR %%b in (%1, %2, %3) DO (
@@ -21,9 +20,12 @@ FOR %%b in (%1, %2, %3) DO (
IF %%b==build64 (
SET build64=yes
SET build32=no
+ SET vcarch=x64
)
IF %%b==msvc SET tools=msvc
)
+rem set MSVC env
+call "%VS140COMNTOOLS%..\..\VC\vcvarsall.bat" %vcarch% || exit /b 1
IF "%WORKDIR%"=="" (
SET WORKDIR=%~dp0\..\..\..