Skip to content

Commit

Permalink
optimized
Browse files Browse the repository at this point in the history
  • Loading branch information
leleliu008 committed Jan 25, 2025
1 parent ea6a2e1 commit bebd330
Showing 1 changed file with 19 additions and 24 deletions.
43 changes: 19 additions & 24 deletions ndk-pkg
Original file line number Diff line number Diff line change
Expand Up @@ -5318,32 +5318,27 @@ EOF
#########################################################################################

unset PACKAGE_CREATE_FULLY_STATICALLY_LINKED_EXECUTABLE
unset PACKAGE_CREATE_MOSTLY_STATICALLY_LINKED_EXECUTABLE

if [ "$REQUEST_TO_CREATE_FULLY_STATICALLY_LINKED_EXECUTABLE" = 1 ] ; then
if [ "$PACKAGE_USE_BSYSTEM_GO" = 1 ] ; then
note "You are requesting to create fully statically linked executables, but package '$PACKAGE_NAME' is a golang project and not supposed to create fully statically linked executables, so we will downgrade to create mostly statically linked executables. For more details, please read /~https://github.com/golang/go/issues/59942\n"
else
case $PACKAGE_PKGTYPE in
exe)
PACKAGE_CREATE_FULLY_STATICALLY_LINKED_EXECUTABLE=1

if [ "$TARGET_PLATFORM_VERS" -ne "$ANDROID_NDK_SUPPORTED_MAX_SDK_API_LEVEL" ] ; then
abort 1 "You are requesting to create fully statically linked executables, but NDK only provide the libc.a for the latest Android API level $ANDROID_NDK_SUPPORTED_MAX_SDK_API_LEVEL. That's to say you're supposed to use Android API level $ANDROID_NDK_SUPPORTED_MAX_SDK_API_LEVEL to compile with this package. For more details, please read /~https://github.com/android/ndk/issues/2017"
fi
;;
pie)
note "You are requesting to create fully statically linked executables, but package '$PACKAGE_NAME' is supposed to create dynamically linked executables, so we will downgrade to create mostly statically linked executables."
esac
fi
fi
case $PACKAGE_PKGTYPE in
exe)
if [ "$REQUEST_TO_CREATE_FULLY_STATICALLY_LINKED_EXECUTABLE" = 1 ] ; then
PACKAGE_CREATE_FULLY_STATICALLY_LINKED_EXECUTABLE=1

#########################################################################################
if [ "$TARGET_PLATFORM_VERS" -ne "$ANDROID_NDK_SUPPORTED_MAX_SDK_API_LEVEL" ] ; then
abort 1 "You are requesting to create fully statically linked executables, but NDK only provide the libc.a for the latest Android API level $ANDROID_NDK_SUPPORTED_MAX_SDK_API_LEVEL. That's to say you're supposed to use Android API level $ANDROID_NDK_SUPPORTED_MAX_SDK_API_LEVEL to compile with this package. For more details, please read /~https://github.com/android/ndk/issues/2017"
fi
else
export PACKAGE_CREATE_MOSTLY_STATICALLY_LINKED_EXECUTABLE=1
fi
;;
pie)
export PACKAGE_CREATE_MOSTLY_STATICALLY_LINKED_EXECUTABLE=1

if [ "$PACKAGE_PKGTYPE" != lib ] ; then
export PACKAGE_CREATE_MOSTLY_STATICALLY_LINKED_EXECUTABLE=1
else
unset PACKAGE_CREATE_MOSTLY_STATICALLY_LINKED_EXECUTABLE
fi
if [ "$REQUEST_TO_CREATE_FULLY_STATICALLY_LINKED_EXECUTABLE" = 1 ] ; then
note "You are requesting to create fully statically linked executables, but package '$PACKAGE_NAME' is supposed to create dynamically linked executables, so we will downgrade to create mostly statically linked executables."
fi
esac

#########################################################################################

Expand Down Expand Up @@ -9892,7 +9887,7 @@ fi
fi
}

NDKPKG_VERSION=0.20.7
NDKPKG_VERSION=0.20.8

NDKPKG_ARG0="$0"
NDKPKG_ARG1="$1"
Expand Down

0 comments on commit bebd330

Please sign in to comment.