-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathbuild_x264.sh
executable file
·75 lines (50 loc) · 1.62 KB
/
build_x264.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
#!/bin/sh
#Create by Kingxl
#http://itjoy.org
#Builds versions of the VideoLAN x264 for armv7 ,armv7s and arm64
#Combines the three libraries into a single one
#Make sure you have installed: Xcode/Preferences/Downloads/Components/Command Line Tools
#
#Lib install dir.
DEST=install
#This is decided by your SDK version.
SDK_VERSION="7.1"
#Archs
ARCHS="armv7 armv7s arm64"
DEVPATH=/Applications/XCode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS${SDK_VERSION}.sdk
#DEVPATH=/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS${SDK_VERSION}.sdk
#Clone x264
git clone git://git.videolan.org/x264.git x264
cd x264
export CC=`xcodebuild -find clang`
for ARCH in $ARCHS; do
echo "Building $ARCH ......"
./configure \
--host=arm-apple-darwin \
--sysroot=$DEVPATH \
--prefix=$DEST/$ARCH \
--extra-cflags="-arch $ARCH" \
--extra-ldflags="-L$DEVPATH/usr/lib/system -arch $ARCH" \
--enable-pic \
--enable-static \
--disable-asm
make && make install && make clean
echo "Installed: $DEST/$ARCH"
done
echo "Combining library ......"
BUILD_LIBS="libx264.a"
OUTPUT_DIR="iPhoneOS"
cd install
mkdir $OUTPUT_DIR
mkdir $OUTPUT_DIR/lib
mkdir $OUTPUT_DIR/include
LIPO_CREATE=""
for ARCH in $ARCHS; do
LIPO_CREATE="$LIPO_CREATE $ARCH/lib/$BUILD_LIBS "
done
lipo -create $LIPO_CREATE -output $OUTPUT_DIR/lib/$BUILD_LIBS
cp -f $ARCH/include/*.* $OUTPUT_DIR/include/
echo "************************************************************"
lipo -i $OUTPUT_DIR/lib/$BUILD_LIBS
echo "************************************************************"
echo "OK, merge done!"