Skip to content

Commit

Permalink
change shell script and makefile for mac aarch64
Browse files Browse the repository at this point in the history
  • Loading branch information
JinhangZhang committed Nov 1, 2024
1 parent 335c82c commit 39fa373
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
1 change: 1 addition & 0 deletions closed/make/modules/openjceplus/Lib.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ else ifeq ($(call isTargetOs, windows), true)
else ifeq ($(call isTargetOs, macosx), true)
$(info OPENJDK_TARGET_OS is: $(OPENJDK_TARGET_OS))
$(info OPENJDK_TARGET_CPU is: $(OPENJDK_TARGET_CPU))
OPENJCEPLUS_GSKIT_HOME := $(OPENJCEPLUS_TOPDIR)/ock/jgsk_crypto_sdk/jgsk_sdk
$(info OPENJCEPLUS_GSKIT_HOME is: $(OPENJCEPLUS_GSKIT_HOME))
OPENJCEPLUS_JGSKIT_MAKE := jgskit.mac.mak
$(info OPENJCEPLUS_JGSKIT_MAKE is: $(OPENJCEPLUS_JGSKIT_MAKE))
Expand Down
20 changes: 18 additions & 2 deletions get_source.sh
Original file line number Diff line number Diff line change
Expand Up @@ -259,13 +259,29 @@ clone_or_update_repos() {
# binaries and create Java module folder.
#
maybe_get_gskit() {
DEFAULT_TARGET_DIR="ock/jgsk_sdk/lib64"
MAC_AARCH64_TARGET_DIR="ock/jgsk_crypto_sdk/jgsk_sdk/lib64"

if [ -d OpenJCEPlus ] && [ ! -d OpenJCEPlus/ock ] && [ -n "$gskit_bin" ] && [ -n "$gskit_sdk_bin" ] ; then
echo
echo "Downloading OCK binaries for OpenJCEPlus"
echo

cd OpenJCEPlus
mkdir -p ock/jgsk_sdk/lib64
# check if the OS is Mac
if [ "$(uname)" = "Darwin" ]; then
# check if the arch is aarch64
if [ "$(arch)" = "arm64" ]; then
echo "This system is macOS on AArch64 (Apple Silicon)."
mkdir -p ock/jgsk_crypto_sdk/jgsk_sdk/lib64
TARGET_DIR=$MAC_AARCH64_TARGET_DIR
else
echo "This system is macOS, but not on AArch64."
fi
else
mkdir -p ock/jgsk_sdk/lib64
TARGET_DIR=$DEFAULT_TARGET_DIR
fi

if [ -n "$gskit_credential" ] ; then
curl -u "$gskit_credential" "$gskit_bin" > ock/jgsk_crypto.tar
Expand All @@ -276,7 +292,7 @@ maybe_get_gskit() {
fi

tar -xf ock/jgsk_crypto_sdk.tar -C ock
tar -xf ock/jgsk_crypto.tar -C ock/jgsk_sdk/lib64
tar -xf ock/jgsk_crypto.tar -C "$TARGET_DIR"

# Create OpenJCEPlus Java module folder.
mkdir -p src/main/openjceplus/share/classes
Expand Down

0 comments on commit 39fa373

Please sign in to comment.