Skip to content

Commit 709166d

Browse files
committed
added deployment target
fixed build problem with Xcode 5.0.2 and newer FFmpeg source
1 parent 7b838de commit 709166d

File tree

1 file changed

+31
-25
lines changed

1 file changed

+31
-25
lines changed

build-ffmpeg.sh

Lines changed: 31 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,5 @@
11
#!/bin/sh
22

3-
CONFIGURE_FLAGS="--enable-cross-compile --disable-debug --disable-ffmpeg \
4-
--disable-ffplay --disable-ffprobe --disable-ffserver \
5-
--disable-doc --disable-encoders --disable-muxers \
6-
--disable-bsfs --disable-devices --disable-filters --enable-pic"
7-
8-
LIBS="libavcodec libavformat libavutil libswscale libavdevice libavfilter \
9-
libswresample"
10-
11-
ARCHS="armv7 armv7s i386 arm64 x86_64"
12-
133
# directories
144
SOURCE="ffmpeg"
155
FAT="fat"
@@ -18,9 +8,29 @@ SCRATCH="scratch"
188
# must be an absolute path
199
THIN=`pwd`/"thin"
2010

11+
# absolute path to x264 library
12+
#X264=`pwd`/fat_x264
13+
14+
CONFIGURE_FLAGS="--enable-cross-compile --disable-debug --disable-ffmpeg \
15+
--disable-ffplay --disable-ffprobe --disable-ffserver \
16+
--disable-doc --disable-encoders --disable-muxers \
17+
--disable-bsfs --disable-devices --disable-filters --enable-pic"
18+
19+
if [ "$X264" ]
20+
then
21+
CONFIGURE_FLAGS="$CONFIGURE_FLAGS --enable-gpl --enable-libx264"
22+
fi
23+
24+
# avresample
25+
#CONFIGURE_FLAGS="$CONFIGURE_FLAGS --enable-avresample"
26+
27+
ARCHS="arm64 armv7s x86_64 i386 armv7"
28+
2129
COMPILE="y"
2230
LIPO="y"
2331

32+
DEPLOYMENT_TARGET="6.0"
33+
2434
if [ "$*" ]
2535
then
2636
if [ "$*" = "lipo" ]
@@ -46,32 +56,29 @@ then
4656
mkdir -p "$SCRATCH/$ARCH"
4757
cd "$SCRATCH/$ARCH"
4858

59+
CFLAGS="-arch $ARCH"
4960
if [ "$ARCH" = "i386" -o "$ARCH" = "x86_64" ]
5061
then
5162
PLATFORM="iPhoneSimulator"
52-
CPU=
53-
if [ "$ARCH" = "x86_64" ]
54-
then
55-
SIMULATOR="-mios-simulator-version-min=7.0"
56-
else
57-
SIMULATOR="-mios-simulator-version-min=5.0"
58-
fi
63+
CFLAGS="$CFLAGS -mios-simulator-version-min=$DEPLOYMENT_TARGET"
5964
else
6065
PLATFORM="iPhoneOS"
61-
if [ $ARCH = "armv7s" ]
66+
CFLAGS="$CFLAGS -mios-version-min=$DEPLOYMENT_TARGET"
67+
if [ "$ARCH" = "arm64" ]
6268
then
63-
CPU="--cpu=swift"
64-
else
65-
CPU=
69+
EXPORT="GASPP_FIX_XCODE5=1"
6670
fi
67-
SIMULATOR=
6871
fi
6972

7073
XCRUN_SDK=`echo $PLATFORM | tr '[:upper:]' '[:lower:]'`
7174
CC="xcrun -sdk $XCRUN_SDK clang"
72-
CFLAGS="-arch $ARCH $SIMULATOR"
7375
CXXFLAGS="$CFLAGS"
7476
LDFLAGS="$CFLAGS"
77+
if [ "$X264" ]
78+
then
79+
CFLAGS="$CFLAGS -I$X264/include"
80+
LDFLAGS="$LDFLAGS -L$X264/lib"
81+
fi
7582

7683
$CWD/$SOURCE/configure \
7784
--target-os=darwin \
@@ -81,10 +88,9 @@ then
8188
--extra-cflags="$CFLAGS" \
8289
--extra-cxxflags="$CXXFLAGS" \
8390
--extra-ldflags="$LDFLAGS" \
84-
$CPU \
8591
--prefix="$THIN/$ARCH"
8692

87-
make -j3 install
93+
make -j3 install $EXPORT
8894
cd $CWD
8995
done
9096
fi

0 commit comments

Comments
 (0)