-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-ffms2.sh
executable file
·91 lines (68 loc) · 2.07 KB
/
build-ffms2.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
if [ ! $# -le 6 ]; then
echo "Usage: $0 ffms2-dir ffmpeg-name 32/64 shared/static release/debug name"
exit
fi
FFMS2DIR=$1
FFMPEGDIR=$2
BUILDBITS=$3
LINKTYPE=$4
BUILDTYPE=$5
NAME=$6
if [ "$BUILDBITS" -eq "32" ]; then
TARGET=i686-w64-mingw32.shared
ARCH=x86
elif [ "$BUILDBITS" -eq "64" ]; then
TARGET=x86_64-w64-mingw32.shared
ARCH=x86_64
export WINEPREFIX=/home/swingcatalyst/wine_64
export WINEARCH=x64
fi
if [ "$LINKTYPE" = "" ]; then
LINKTYPE="shared"
echo "Defaulting to shared build"
fi
if [ "$BUILDTYPE" = "" ]; then
BUILDTYPE="release"
fi
if [ "$LINKTYPE" = "static" ]; then
LINKTYPEPARAMS="--disable-shared --enable-static"
elif [ "$LINKTYPE" = "shared" ]; then
LINKTYPEPARAMS="--disable-static --enable-shared"
fi
if [ "$BUILDTYPE" = "release" ]; then
BUILDTYPEPARAMS="--disable-debug --enable-stripping"
elif [ "$LINKTYPE" = "shared" ]; then
BUILDTYPEPARAMS="--disable-stripping --enable-debug"
fi
BASEDIR=$(dirname $(pwd -P $0)/${0#\.\/})
BUILDNAME=$NAME-$TARGET-$LINKTYPE-$BUILDTYPE
BUILDDIR=$BASEDIR/build/$BUILDNAME
INSTALLDIR=$BASEDIR/install/$BUILDNAME
FFMPEGBUILDNAME=$FFMPEGDIR-$TARGET-$LINKTYPE-$BUILDTYPE
FFMPEGINSTALLDIR=$BASEDIR/install/$FFMPEGBUILDNAME
echo $FFMPEGINSTALLDIR
MXEROOT=$BASEDIR/mxe
echo "Building $BUILDNAME against $FFMPEGDIR ($FFMPEGINSTALLDIR)"
export PATH=$PATH:$MXEROOT/usr/bin
export PKG_CONFIG_PATH=$BASEDIR/$FFMPEGINSTALLDIR/lib/pkgconfig:$MXEROOT/usr/$ARCH-static-mingw32/lib/pkgconfig
rm -rf $BUILDDIR
mkdir $BUILDDIR
cd $BUILDDIR
export LIBAV_CFLAGS="-I$FFMPEGINSTALLDIR/include"
echo $FFMPEGINSTALLDIR/lib
export LIBAV_LIBS="-L$FFMPEGINSTALLDIR/lib -lswscale-if -lavformat-if -lavcodec-if -lavutil-if -lavdevice-if -lavfilter-if"
export CPPFLAGS="-D_WIN32_WINNT=0x0502 -DWINVER=0x0502"
$BASEDIR/$1/configure \
$LINKTYPEPARAMS \
$BUILDTYPEPARAMS \
--enable-fast-install \
--prefix=$INSTALLDIR \
--host="$TARGET" \
--build="$TARGET"
#--with-zlib=$MXEROOT/usr/$ARCH-static-mingw32/ \
#LIBAV_LIBS="
#$BASEDIR/$1/configure \
#--cross-prefix=$TARGET-static-mingw32- \
#--prefix=$INSTALLDIR
make install
cd ..