From 3691027ca95d7d954d857d763f0f4ae9fc5bd6a8 Mon Sep 17 00:00:00 2001 From: Tao Liu Date: Wed, 18 Oct 2023 10:39:22 -0400 Subject: [PATCH] Update multi platform support --- closed/custom/Main.gmk | 37 +++++++++++++++++++++++++++++++++---- 1 file changed, 33 insertions(+), 4 deletions(-) diff --git a/closed/custom/Main.gmk b/closed/custom/Main.gmk index a098c2f7621..bda6818a9d3 100644 --- a/closed/custom/Main.gmk +++ b/closed/custom/Main.gmk @@ -122,21 +122,50 @@ endif # HEALTHCENTER_JAR ifeq (true,$(BUILD_JGSKIT)) +# Identify the desired JGSKIT target platform. +JGSKIT_TARGET := +JGSKIT_MAKE := jgskit.mak +JGSKIT_MAKE_PATH := $(OPENJCEPLUS_TOPDIR)/src/main/native/ +JCE_CLASSPATH := $(OPENJCEPLUS_TOPDIR)/src/main/java:$(TOPDIR)/src/java.base/share/classes +JCE_CLASSPATH_WIN64 := "$(call MixedPath,$(OPENJCEPLUS_TOPDIR)/src/main/java)\;$(call MixedPath,$(TOPDIR)/src/java.base/share/classes)" + +ifeq ($(OPENJDK_TARGET_OS), aix) + JGSKIT_TARGET := ppc-aix64 +else ifeq ($(OPENJDK_TARGET_OS), linux) + ifeq ($(OPENJDK_TARGET_CPU), x86_64) + JGSKIT_TARGET := x86-linux64 + else ifeq ($(OPENJDK_TARGET_CPU), ppc64le) + JGSKIT_TARGET := ppcle-linux64 + endif +else ifeq ($(OPENJDK_TARGET_OS), windows) + ifeq ($(OPENJDK_TARGET_CPU), x86_64) + JGSKIT_TARGET := win64 + JGSKIT_MAKE := jgskit.win64.mak + JCE_CLASSPATH := $(JCE_CLASSPATH_WIN64) + GSKIT_HOME := $(call MixedPath,$(GSKIT_HOME)) + BOOT_JDK := $(call MixedPath,$(BOOT_JDK)) + endif +endif # OPENJDK_TARGET_OS + +ifeq (,$(JGSKIT_TARGET)) + $(error Unsupported platform $(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU)) +endif # JGSKIT_TARGET + .PHONY : clean-openjceplus openjceplus-libs clean : clean-openjceplus clean-openjceplus : @$(ECHO) Cleaning OpenJCEPlus native - @$(RM) -f $(addprefix $(OPENJCEPLUS_TOPDIR)/src/main/native/, com_ibm_crypto_plus_provider_icc_NativeInterface.h com_ibm_crypto_plus_provider_icc_FastJNIBuffer.h libjgskit.x) - $(MAKE) -C $(OPENJCEPLUS_TOPDIR)/src/main/native/ -f jgskit.mak cleanAll + @$(RM) -f $(addprefix $(JGSKIT_MAKE_PATH), com_ibm_crypto_plus_provider_icc_NativeInterface.h com_ibm_crypto_plus_provider_icc_FastJNIBuffer.h libjgskit.x) + $(MAKE) -C $(JGSKIT_MAKE_PATH) -f $(JGSKIT_MAKE) cleanAll openjceplus-copy : openjceplus-libs openjceplus-libs : @$(ECHO) Compiling OpenJCEPlus native - export PLATFORM=x86-linux64 JAVA_HOME=$(BOOT_JDK) GSKIT_HOME=$(GSKIT_HOME) JCE_CLASSPATH=$(OPENJCEPLUS_TOPDIR)/src/main/java/:$(TOPDIR)/src/java.base/share/classes/ \ - && $(MAKE) -j1 -C $(OPENJCEPLUS_TOPDIR)/src/main/native/ -f jgskit.mak all + export PLATFORM=$(JGSKIT_TARGET) JAVA_HOME=$(BOOT_JDK) GSKIT_HOME=$(GSKIT_HOME) JCE_CLASSPATH=$(JCE_CLASSPATH) \ + && $(MAKE) -j1 -C $(JGSKIT_MAKE_PATH) -f $(JGSKIT_MAKE) all @$(ECHO) OpenJCEplus compile complete endif # BUILD_JGSKIT