Skip to content

Commit

Permalink
Update according to code review
Browse files Browse the repository at this point in the history
  • Loading branch information
taoliult committed Dec 7, 2023
1 parent e808a32 commit 0b2df2e
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 33 deletions.
8 changes: 4 additions & 4 deletions closed/JPP.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ ifeq (true,$(OPENJ9_ENABLE_CRIU_SUPPORT))
JPP_TAGS += CRIU_SUPPORT
endif # OPENJ9_ENABLE_CRIU_SUPPORT

ifeq (true,$(BUILD_OPENJCEPLUS))
JPP_TAGS += OPENJCEPLUS_SUPPORT
endif # BUILD_OPENJCEPLUS

ifeq (true,$(OPENJ9_ENABLE_INLINE_TYPES))
JPP_TAGS += INLINE-TYPES
endif # OPENJ9_ENABLE_INLINE_TYPES

ifeq (true,$(BUILD_OPENJCEPLUS))
JPP_TAGS += OPENJCEPLUS_SUPPORT
endif # BUILD_OPENJCEPLUS

# invoke JPP to preprocess java source files
# $1 - configuration
# $2 - source directory
Expand Down
23 changes: 23 additions & 0 deletions closed/custom/Main.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -120,4 +120,27 @@ ifneq (,$(HEALTHCENTER_JAR))
ibm.healthcenter-java : ibm.healthcenter-copy
endif # HEALTHCENTER_JAR

ifeq (true,$(BUILD_OPENJCEPLUS))

JGSKIT_MAKE := jgskit.mak
ifeq ($(call isTargetOs, windows), true)
ifeq ($(call isTargetCpu, x86_64), true)
JGSKIT_MAKE := jgskit.win64.mak
endif
endif

openjceplus-copy : openjceplus-libs

.PHONY : openjceplus-clean

openjceplus-clean :
@$(ECHO) Cleaning OpenJCEPlus native
@$(RM) -f \
$(addprefix $(OPENJCEPLUS_TOPDIR)/src/main/native/, \
com_ibm_crypto_plus_provider_icc_FastJNIBuffer.h \
com_ibm_crypto_plus_provider_icc_NativeInterface.h)
$(MAKE) -C $(OPENJCEPLUS_TOPDIR)/src/main/native -f $(JGSKIT_MAKE) cleanAll

clean : openjceplus-clean

endif # BUILD_OPENJCEPLUS
8 changes: 4 additions & 4 deletions closed/get_j9_source.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ usage() {
echo " -openjceplus-branch the OpenJCEPlus git branch"
echo " -openjceplus-sha a commit SHA for the OpenJCEPlus repository"
echo " -openjceplus-reference a local repo to use as a clone reference"
echo " -with-gskit-bin the GSKit binary url"
echo " -with-gskit-sdk-bin the GSKIT SDK binary url"
echo " -with-gskit-bin-credential the credential for downloading the GSKit binaries"
echo " -gskit-bin the GSKit binary url"
echo " -gskit-sdk-bin the GSKIT SDK binary url"
echo " -gskit-credential the credential for downloading the GSKit binaries"
echo " -parallel (boolean) if 'true' then the clone j9 repository commands run in parallel, default is false"
echo ""
exit 1
Expand Down Expand Up @@ -226,7 +226,7 @@ if [ -n "${git_urls[$openjceplus_source]}" ] ; then
else
echo
echo "GSKit binaries are needed for compiling $openjceplus_source"
echo "Please set -with-gskit-bin, -with-gskit-sdk-bin, and -with-gskit-bin-credential"
echo "Please set -gskit-bin, -gskit-sdk-bin, and -gskit-credential"
exit 1
fi

Expand Down
24 changes: 12 additions & 12 deletions closed/make/modules/openjceplus/Copy.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -21,29 +21,29 @@
include $(TOPDIR)/closed/CopySupport.gmk

ifeq (true,$(BUILD_OPENJCEPLUS))
# Copy OpenJCEPlus native libraries
$(eval $(call SetupCopyFiles, COPY_JGSKIT_LIBS, \
# Copy OpenJCEPlus native libraries.
$(eval $(call SetupCopyFiles, OPENJCEPLUS_JGSKIT_LIBS_COPY, \
SRC := $(OPENJCEPLUS_TOPDIR)/target, \
FILES := $(filter %.dll %.so %.x, $(call FindFiles, $(OPENJCEPLUS_TOPDIR)/target)), \
FLATTEN := true, \
DEST := $(LIB_DST_DIR), \
))

TARGETS += $(COPY_JGSKIT_LIBS)
TARGETS += $(OPENJCEPLUS_JGSKIT_LIBS_COPY)

# Bundle GSKIT library
OCK_DIR := $(TOPDIR)/OpenJCEPlus/ock/jgsk_sdk/lib64
# Bundle GSKIT library.
OPENJCEPLUS_OCK_DIR := $(TOPDIR)/OpenJCEPlus/ock/jgsk_sdk/lib64
ifeq ($(call isTargetOs, windows), true)
OCK_SUB_DIR := modules_cmds
OPENJCEPLUS_OCK_SUB_DIR := modules_cmds
else
OCK_SUB_DIR := modules_libs
OPENJCEPLUS_OCK_SUB_DIR := modules_libs
endif

$(eval $(call SetupCopyFiles, COPY_OCK, \
SRC := $(OCK_DIR), \
DEST := $(SUPPORT_OUTPUTDIR)/$(OCK_SUB_DIR)/$(MODULE), \
FILES := $(call FindFiles, $(OCK_DIR)), \
$(eval $(call SetupCopyFiles, OPENJCEPLUS_OCK_COPY, \
SRC := $(OPENJCEPLUS_OCK_DIR), \
DEST := $(SUPPORT_OUTPUTDIR)/$(OPENJCEPLUS_OCK_SUB_DIR)/$(MODULE), \
FILES := $(call FindFiles, $(OPENJCEPLUS_OCK_DIR)), \
))

TARGETS += $(COPY_OCK)
TARGETS += $(OPENJCEPLUS_OCK_COPY)
endif # BUILD_OPENJCEPLUS
30 changes: 17 additions & 13 deletions closed/make/modules/openjceplus/Lib.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -23,39 +23,43 @@ include LibCommon.gmk
ifeq (true,$(BUILD_OPENJCEPLUS))

# Identify the desired JGSKIT target platform.
GSKIT_HOME := $(TOPDIR)/OpenJCEPlus/ock/jgsk_sdk
JGSKIT_TARGET :=
GSKIT_HOME := $(OPENJCEPLUS_TOPDIR)/ock/jgsk_sdk
JGSKIT_PLATFORM :=
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
JGSKIT_MAKE_PATH := $(OPENJCEPLUS_TOPDIR)/src/main/native
JCE_CLASSPATH := $(JDK_OUTPUTDIR)/modules/openjceplus:$(JDK_OUTPUTDIR)/modules/java.base

ifeq ($(call isTargetOs, aix), true)
JGSKIT_TARGET := ppc-aix64
JGSKIT_PLATFORM := ppc-aix64
else ifeq ($(call isTargetOs, linux), true)
ifeq ($(call isTargetCpu, x86_64), true)
JGSKIT_TARGET := x86-linux64
else ifeq ($(call isTargetCpu, ppc64le), true)
JGSKIT_TARGET := ppcle-linux64
ifeq ($(call isTargetCpu, ppc64le), true)
JGSKIT_PLATFORM := ppcle-linux64
else ifeq ($(call isTargetCpu, x86_64), true)
JGSKIT_PLATFORM := x86-linux64
endif
else ifeq ($(call isTargetOs, windows), true)
ifeq ($(call isTargetCpu, x86_64), true)
JGSKIT_TARGET := win64
JGSKIT_PLATFORM := win64
JGSKIT_MAKE := jgskit.win64.mak
JCE_CLASSPATH := "$(call MixedPath,$(OPENJCEPLUS_TOPDIR)/src/main/java)\;$(call MixedPath,$(TOPDIR)/src/java.base/share/classes)"
GSKIT_HOME := $(call MixedPath,$(GSKIT_HOME))
BOOT_JDK := $(call MixedPath,$(BOOT_JDK))
endif
endif

ifeq (,$(JGSKIT_TARGET))
ifeq (,$(JGSKIT_PLATFORM))
$(error Unsupported platform $(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU))
endif # JGSKIT_TARGET
endif # JGSKIT_PLATFORM

.PHONY : compile-libs

compile-libs :
@$(ECHO) Compiling OpenJCEPlus native
export PLATFORM=$(JGSKIT_TARGET) JAVA_HOME=$(BOOT_JDK) GSKIT_HOME=$(GSKIT_HOME) JCE_CLASSPATH=$(JCE_CLASSPATH) \
export \
GSKIT_HOME=$(GSKIT_HOME) \
JAVA_HOME=$(BOOT_JDK) \
JCE_CLASSPATH=$(JCE_CLASSPATH) \
PLATFORM=$(JGSKIT_PLATFORM) \
&& $(MAKE) -j1 -C $(JGSKIT_MAKE_PATH) -f $(JGSKIT_MAKE) all
@$(ECHO) OpenJCEplus compile complete

Expand Down

0 comments on commit 0b2df2e

Please sign in to comment.