From 4f3724b2481b6ec6fb20af7d1bd21e6320b0211f 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 +++++++++++++++++++++--- closed/make/modules/openjceplus/Copy.gmk | 2 +- 2 files changed, 34 insertions(+), 5 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 diff --git a/closed/make/modules/openjceplus/Copy.gmk b/closed/make/modules/openjceplus/Copy.gmk index db6361a87a9..f9561b2ad8a 100644 --- a/closed/make/modules/openjceplus/Copy.gmk +++ b/closed/make/modules/openjceplus/Copy.gmk @@ -24,7 +24,7 @@ ifeq (true,$(BUILD_JGSKIT)) # Copy OpenJCEPlus native libraries $(eval $(call SetupCopyFiles, COPY_JGSKIT_LIBS, \ SRC := $(OPENJCEPLUS_TOPDIR), \ - FILES := $(filter %.so %.x,$(call FindFiles, $(OPENJCEPLUS_TOPDIR))), \ + FILES := $(filter %.so %.dll,$(call FindFiles, $(OPENJCEPLUS_TOPDIR))), \ FLATTEN := true, \ DEST := $(LIB_DST_DIR), \ ))