From a3d27d75f43195a824ec51b5cab1d37bbaa024d8 Mon Sep 17 00:00:00 2001 From: khanhduytran0 Date: Sat, 30 Nov 2024 13:44:02 +0000 Subject: [PATCH] Fix(iOS): apply script changes from jre17-21 branch --- buildjdk.sh | 6 +++--- buildlibs.sh | 22 ++-------------------- ios-arm64-clang | 2 +- ios-arm64-clang++ | 2 +- 4 files changed, 7 insertions(+), 25 deletions(-) diff --git a/buildjdk.sh b/buildjdk.sh index c7b2aa3..631d8c9 100755 --- a/buildjdk.sh +++ b/buildjdk.sh @@ -44,10 +44,10 @@ else platform_args="--with-toolchain-type=clang SDKNAME=iphoneos" # --disable-precompiled-headers AUTOCONF_x11arg="--with-x=/opt/X11/include/X11 --prefix=/usr/lib" - sameflags="-arch arm64 -isysroot $thesysroot -miphoneos-version-min=14.0 -DHEADLESS=1 -I$PWD/ios-missing-include -Wno-implicit-function-declaration" + sameflags="-arch arm64 -DHEADLESS=1 -I$PWD/ios-missing-include -Wno-implicit-function-declaration" export CFLAGS+=" $sameflags" - export CXXFLAGS="$sameflags" - export LDFLAGS+=" -miphoneos-version-min=14.0" + export LDFLAGS+=" -arch arm64" + export BUILD_SYSROOT_CFLAGS="-isysroot ${themacsysroot}" HOMEBREW_NO_AUTO_UPDATE=1 brew install ldid xquartz fi diff --git a/buildlibs.sh b/buildlibs.sh index b099b24..ea3eeac 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 -Os -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 \ @@ -33,7 +15,6 @@ 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 config.log @@ -46,3 +27,4 @@ make install if [[ -f "${namefreetype}.a" ]]; then clang -fPIC -shared $LDFLAGS -lbz2 -Wl,-all_load ${namefreetype}.a -o ${namefreetype}.dylib fi +fi diff --git a/ios-arm64-clang b/ios-arm64-clang index 06baae7..985fd89 100755 --- a/ios-arm64-clang +++ b/ios-arm64-clang @@ -1 +1 @@ -exec $thecc -arch arm64 -isysroot $thesysroot "$@" +exec $thecc -arch arm64 -isysroot $thesysroot -miphoneos-version-min=14.0 "$@" diff --git a/ios-arm64-clang++ b/ios-arm64-clang++ index 2117d08..0af7331 100755 --- a/ios-arm64-clang++ +++ b/ios-arm64-clang++ @@ -1 +1 @@ -exec $thecxx -arch arm64 -isysroot $thesysroot "$@" +exec $thecxx -arch arm64 -isysroot $thesysroot -miphoneos-version-min=14.0 "$@"