-
Notifications
You must be signed in to change notification settings - Fork 0
/
buildlibs.sh
executable file
·54 lines (49 loc) · 1.55 KB
/
buildlibs.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
#!/bin/bash
set -e
. setdevkitpath.sh
if [ "$BUILD_IOS" == "1" ]; then
export CC=$thecc
export CXX=$thecxx
LDFLAGS=-"arch arm64 -isysroot $thesysroot -miphoneos-version-min=12.0"
echo "Building libffi"
cd libffi-3.4.2
python3 generate-darwin-source-and-headers.py --only-ios
xcodebuild -arch arm64
cd build_iphoneos-arm64
sudo make prefix=`pwd` install
cd ../..
echo "Building Freetype"
cd freetype-$BUILD_FREETYPE_VERSION
./configure \
--host=$TARGET \
--prefix=${PWD}/build_android-${TARGET_SHORT} \
--enable-shared=no --enable-static=yes \
--without-zlib \
--with-brotli=no \
--with-png=no \
--with-harfbuzz=no \
"CFLAGS=-arch arm64 -pipe -std=c99 -Wno-trigraphs -fpascal-strings -O2 -Wreturn-type -Wunused-variable -fmessage-length=0 -fvisibility=hidden -miphoneos-version-min=12.0 -I$thesysroot/usr/include/libxml2/ -isysroot $thesysroot" \
AR=/usr/bin/ar \
"LDFLAGS=$LDFLAGS" \
|| error_code=$?
namefreetype=build_android-${TARGET_SHORT}/lib/libfreetype
else
export PATH=$TOOLCHAIN/bin:$PATH
./configure \
--host=$TARGET \
--prefix=`pwd`/build_android-${TARGET_SHORT} \
--without-zlib \
--with-png=no \
--with-harfbuzz=no $EXTRA_ARGS \
|| error_code=$?
fi
if [ "$error_code" -ne 0 ]; then
echo "\n\nCONFIGURE ERROR $error_code , config.log:"
cat config.log
exit $error_code
fi
CFLAGS=-fno-rtti CXXFLAGS=-fno-rtti make -j4
make install
if [ -f "${namefreetype}.a" ]; then
clang -fPIC -shared $LDFLAGS -lbz2 -Wl,-all_load ${namefreetype}.a -o ${namefreetype}.dylib
fi