From a7bec955214a140cc2d05dd907e8fd835556c5f6 Mon Sep 17 00:00:00 2001 From: khanhduytran0 Date: Wed, 17 Aug 2022 12:38:25 +0700 Subject: [PATCH] Skip building freetype for iOS (use bundled) --- buildjdk.sh | 3 ++- buildlibs.sh | 24 ++---------------------- 2 files changed, 4 insertions(+), 23 deletions(-) diff --git a/buildjdk.sh b/buildjdk.sh index ea8a0d2..7b097bc 100755 --- a/buildjdk.sh +++ b/buildjdk.sh @@ -46,6 +46,7 @@ if [ "$BUILD_IOS" != "1" ]; then ar cru dummy_libs/libthread_db.a else ln -s -f /opt/X11/include/X11 $ANDROID_INCLUDE/ + ln -s -f /usr/local/include/fontconfig $ANDROID_INCLUDE/ platform_args="--with-toolchain-type=clang --with-sysroot=$(xcrun --sdk iphoneos --show-sdk-path) \ --with-boot-jdk=$(/usr/libexec/java_home -v 17) \ --with-freetype=bundled \ @@ -56,7 +57,7 @@ else export LDFLAGS+="-arch arm64" export BUILD_SYSROOT_CFLAGS="-isysroot ${themacsysroot}" - HOMEBREW_NO_AUTO_UPDATE=1 brew install ldid xquartz autoconf + HOMEBREW_NO_AUTO_UPDATE=1 brew install fontconfig ldid xquartz autoconf fi # fix building libjawt diff --git a/buildlibs.sh b/buildlibs.sh index 007c4d6..134d66c 100755 --- a/buildlibs.sh +++ b/buildlibs.sh @@ -5,25 +5,7 @@ cd freetype-$BUILD_FREETYPE_VERSION echo "Building Freetype" -if [ "$BUILD_IOS" == "1" ]; then - LDFLAGS=-"arch arm64 -isysroot $thesysroot -miphoneos-version-min=12.0" - - export CC=$thecc - export CXX=$thecxx - ./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 +if [ "$BUILD_IOS" != "1" ]; then export PATH=$TOOLCHAIN/bin:$PATH ./configure \ --host=$TARGET \ @@ -32,7 +14,7 @@ else --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 ${PWD}/builds/unix/config.log @@ -42,6 +24,4 @@ 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