forked from hrydgard/ppsspp
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtvos-build.sh
executable file
·60 lines (48 loc) · 1.32 KB
/
tvos-build.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
#!/bin/bash
#build ffmpeg for all archs and uses lipo to create fat libraries and deletes the originals
set -e
. shared_options.sh
PATH=$(PWD)/gas-preprocessor:$PATH
ARCHS="arm64 i386 x86_64"
for arch in ${ARCHS}; do
rm -f config.h
ffarch=${arch}
versionmin=9.0
cpu=generic
if [[ ${arch} == "arm64" ]]; then
sdk=appletvos
ffarch=aarch64
elif [[ ${arch} == "i386" ]]; then
sdk=appletvsimulator
ffarch=x86
elif [[ ${arch} == "x86_64" ]]; then
sdk=appletvsimulator
fi
./configure \
--prefix=tvos/${arch} \
--enable-cross-compile \
--arch=${ffarch} \
--cc=$(xcrun -f clang) \
--sysroot="$(xcrun --sdk ${sdk} --show-sdk-path)" \
--extra-cflags="-arch ${arch} -D_DARWIN_FEATURE_CLOCK_GETTIME=0 -mappletvos-version-min=${versionmin} ${cflags}" \
${CONFIGURE_OPTS} \
--extra-ldflags="-arch ${arch} -isysroot $(xcrun --sdk ${sdk} --show-sdk-path) -mappletvos-version-min=${versionmin}" \
--target-os=darwin \
${extraopts} \
--cpu=${cpu} \
--enable-pic
make clean
make -j8 install
done
cd tvos
mkdir -p universal/lib
for i in arm64/lib/*.a; do
libname=$(basename $i)
xcrun lipo -create $(
for a in ${ARCHS}; do
echo -arch ${a} ${a}/lib/${libname}
done
) -output universal/lib/${libname}
done
cp -r arm64/include universal/
rm -rf ${ARCHS}