Merge pull request #4791 from jmarshallnz/playlist_settings
[vuplus_xbmc] / lib / ffmpeg / build_xbmc_win32.sh
1 #!/bin/bash
2
3 MAKEFLAGS=""
4 BGPROCESSFILE="$2"
5
6 if [ "$1" == "clean" ]
7 then
8   if [ -d .libs ]
9   then
10     rm -r .libs
11   fi
12   mingw32-make distclean
13 fi
14
15 if [ $NUMBER_OF_PROCESSORS > 1 ]; then
16   MAKEFLAGS=-j$NUMBER_OF_PROCESSORS
17 fi
18
19 if [ ! -d .libs ]; then
20   mkdir .libs
21 fi
22
23 # add --enable-debug (remove --disable-debug ofc) to get ffmpeg log messages in xbmc.log
24 # the resulting debug dll's are twice to fourth time the size of the release binaries
25
26 OPTIONS="
27 --enable-shared \
28 --enable-memalign-hack \
29 --enable-gpl \
30 --enable-w32threads \
31 --enable-postproc \
32 --enable-zlib \
33 --disable-static \
34 --disable-altivec \
35 --disable-muxers \
36 --disable-encoders \
37 --disable-debug \
38 --disable-ffplay \
39 --disable-ffserver \
40 --disable-ffmpeg \
41 --disable-ffprobe \
42 --disable-devices \
43 --disable-crystalhd \
44 --enable-muxer=spdif \
45 --enable-muxer=adts \
46 --enable-encoder=ac3 \
47 --enable-encoder=aac \
48 --enable-runtime-cpudetect \
49 --enable-avfilter \
50 --enable-dxva2 \
51 --enable-gnutls \
52 --disable-doc"
53
54 ./configure --extra-cflags="-fno-common -Iinclude-xbmc-win32/dxva2 -DNDEBUG" --extra-ldflags="-L/xbmc/system/players/dvdplayer" ${OPTIONS} &&
55  
56 mingw32-make $MAKEFLAGS &&
57 cp lib*/*.dll .libs/ &&
58 cp .libs/avcodec-54.dll /xbmc/system/players/dvdplayer/ &&
59 cp .libs/avformat-54.dll /xbmc/system/players/dvdplayer/ &&
60 cp .libs/avutil-52.dll /xbmc/system/players/dvdplayer/ &&
61 cp .libs/avfilter-3.dll /xbmc/system/players/dvdplayer/ &&
62 cp .libs/postproc-52.dll /xbmc/system/players/dvdplayer/ &&
63 cp .libs/swresample-0.dll /xbmc/system/players/dvdplayer/ &&
64 cp .libs/swscale-2.dll /xbmc/system/players/dvdplayer/
65
66 #remove the bgprocessfile for signaling the process end
67 rm $BGPROCESSFILE