-
-
Notifications
You must be signed in to change notification settings - Fork 98
/
openj9Settings.mk
175 lines (161 loc) · 7.15 KB
/
openj9Settings.mk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
##############################################################################
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
##############################################################################
#
# This makefile contains openJ9 specific settings
#
#######################################
# Set JAVA_SHARED_LIBRARIES_DIR and VM_SUBDIR for tests which need native library.
# Set ADD_JVM_LIB_DIR_TO_LIBPATH as tests on some platforms need LIBPATH containing VM directory
#######################################
TEST_JRE_BIN:=$(TEST_JDK_HOME)$(D)jre$(D)bin
TEST_JRE_LIB_DIR:=$(TEST_JRE_BIN)$(D)..$(D)lib
TEST_JDK_BIN:=$(TEST_JDK_HOME)$(D)bin
TEST_JDK_LIB_DIR:=$(TEST_JDK_BIN)$(D)..$(D)lib
VM_SUBDIR=default
ifneq (,$(findstring _cmprssptrs,$(SPEC)))
VM_SUBDIR=compressedrefs
endif
ifneq (,$(findstring le,$(SPEC)))
ARCH_DIR=ppc64le
else ifneq (,$(findstring ppc-64,$(SPEC)))
ARCH_DIR=ppc64
else ifneq (,$(findstring ppc,$(SPEC)))
ARCH_DIR=ppc
else ifneq (,$(findstring arm,$(SPEC)))
ARCH_DIR=arm
else ifneq (,$(findstring 390-64,$(SPEC)))
ARCH_DIR=s390x
else ifneq (,$(findstring 390,$(SPEC)))
ARCH_DIR=s390
else ifneq (,$(findstring linux_x86-64,$(SPEC)))
ARCH_DIR=amd64
else ifneq (,$(findstring linux_x86,$(SPEC)))
ARCH_DIR=i386
else ifneq (,$(findstring aarch64,$(SPEC)))
ARCH_DIR=aarch64
endif
ifndef NATIVE_TEST_LIBS
NATIVE_TEST_LIBS=$(TEST_JDK_HOME)$(D)..$(D)native-test-libs$(D)
endif
# if JCL_VERSION is current check for default locations for native test libs
# otherwise, native test libs are under NATIVE_TEST_LIBS
ifneq (, $(findstring current, $(JCL_VERSION)))
ifeq (8, $(JDK_VERSION))
ifneq (,$(findstring win,$(SPEC)))
JAVA_SHARED_LIBRARIES_DIR:=$(TEST_JRE_BIN)$(D)$(VM_SUBDIR)
J9VM_PATH=$(TEST_JRE_BIN)$(D)j9vm
else
JAVA_SHARED_LIBRARIES_DIR:=$(TEST_JRE_LIB_DIR)$(D)$(ARCH_DIR)$(D)$(VM_SUBDIR)
J9VM_PATH=$(TEST_JRE_LIB_DIR)$(D)$(ARCH_DIR)$(D)j9vm
endif
ADD_JVM_LIB_DIR_TO_LIBPATH:=export LIBPATH=$(Q)$(LIBPATH)$(P)$(TEST_JRE_LIB_DIR)$(D)$(VM_SUBDIR)$(P)$(JAVA_SHARED_LIBRARIES_DIR)$(P)$(TEST_JRE_BIN)$(D)j9vm$(Q);
else
ifneq (,$(findstring win,$(SPEC)))
JAVA_SHARED_LIBRARIES_DIR:=$(TEST_JDK_BIN)$(D)$(VM_SUBDIR)
J9VM_PATH=$(TEST_JDK_BIN)$(D)j9vm
else
JAVA_SHARED_LIBRARIES_DIR:=$(TEST_JDK_LIB_DIR)$(D)$(ARCH_DIR)$(D)$(VM_SUBDIR)
J9VM_PATH=$(TEST_JDK_LIB_DIR)$(D)$(ARCH_DIR)$(D)j9vm
endif
ADD_JVM_LIB_DIR_TO_LIBPATH:=export LIBPATH=$(Q)$(LIBPATH)$(P)$(TEST_JDK_LIB_DIR)$(D)$(VM_SUBDIR)$(P)$(JAVA_SHARED_LIBRARIES_DIR)$(P)$(TEST_JDK_BIN)$(D)j9vm$(Q);
endif
else
ifeq (8, $(JDK_VERSION))
ifneq (,$(findstring win,$(SPEC)))
VM_SUBDIR_PATH=$(TEST_JRE_BIN)$(D)$(VM_SUBDIR)
J9VM_PATH=$(TEST_JRE_BIN)$(D)j9vm
else
VM_SUBDIR_PATH=$(TEST_JRE_LIB_DIR)$(D)$(ARCH_DIR)$(D)$(VM_SUBDIR)
J9VM_PATH=$(TEST_JRE_LIB_DIR)$(D)$(ARCH_DIR)$(D)j9vm
LIB_PATH=$(TEST_JRE_LIB_DIR)$(D)$(ARCH_DIR)
endif
else
ifneq (,$(findstring win,$(SPEC)))
VM_SUBDIR_PATH=$(TEST_JDK_BIN)$(D)$(VM_SUBDIR)
J9VM_PATH=$(TEST_JDK_BIN)$(D)j9vm
else
VM_SUBDIR_PATH=$(TEST_JDK_LIB_DIR)$(D)$(VM_SUBDIR)
J9VM_PATH=$(TEST_JDK_LIB_DIR)$(D)j9vm
LIB_PATH=$(TEST_JDK_LIB_DIR)
endif
endif
PS=:
ifneq (,$(findstring win,$(SPEC)))
ifeq ($(CYGWIN),1)
NATIVE_TEST_LIBS := $(shell cygpath -u $(NATIVE_TEST_LIBS))
VM_SUBDIR_PATH := $(shell cygpath -u $(VM_SUBDIR_PATH))
J9VM_PATH := $(shell cygpath -u $(J9VM_PATH))
else
PS=;
endif
endif
TEST_LIB_PATH_VALUE:=$(NATIVE_TEST_LIBS)$(PS)$(VM_SUBDIR_PATH)$(PS)$(J9VM_PATH)
ifneq (,$(findstring win,$(SPEC)))
TEST_LIB_PATH:=PATH=$(Q)$(TEST_LIB_PATH_VALUE)$(PS)$(PATH)$(Q)
else ifneq (,$(findstring aix,$(SPEC)))
TEST_LIB_PATH:=LIBPATH=$(Q)$(TEST_LIB_PATH_VALUE)$(PS)$(LIBPATH)$(Q)
else ifneq (,$(findstring zos,$(SPEC)))
TEST_LIB_PATH:=LIBPATH=$(Q)$(TEST_LIB_PATH_VALUE)$(PS)$(LIB_PATH)$(PS)$(LIBPATH)$(Q)
else ifneq (,$(findstring osx,$(SPEC)))
TEST_LIB_PATH:=DYLD_LIBRARY_PATH=$(Q)$(TEST_LIB_PATH_VALUE)$(PS)$(DYLD_LIBRARY_PATH)$(Q)
else
TEST_LIB_PATH:=LD_LIBRARY_PATH=$(Q)$(TEST_LIB_PATH_VALUE)$(PS)$(LD_LIBRARY_PATH)$(Q)
endif
JAVA_SHARED_LIBRARIES_DIR:=$(NATIVE_TEST_LIBS)
ADD_JVM_LIB_DIR_TO_LIBPATH:=export $(TEST_LIB_PATH);
endif
ifneq ($(DEBUG),)
$(info JAVA_SHARED_LIBRARIES_DIR is set to $(JAVA_SHARED_LIBRARIES_DIR))
$(info VM_SUBDIR is set to $(VM_SUBDIR))
$(info ADD_JVM_LIB_DIR_TO_LIBPATH is set to $(ADD_JVM_LIB_DIR_TO_LIBPATH))
endif
#######################################
# TEST_STATUS
# if TEST_RESULTSTORE is enabled, failed test will uploaded to vmfarm result store
#######################################
ifneq ($(TEST_RESULTSTORE),)
ifndef BUILD_ID
$(error BUILD_ID is needed for uploading files to result store)
endif
ifndef JOB_ID
$(error JOB_ID is needed for uploading files to result store)
endif
ifndef JAVATEST_ROOT
$(error JAVATEST_ROOT is needed for uploading files to result store)
endif
ifneq (,$(findstring aix,$(PLATFORM)))
AXXONRESULTSSERVER=filesystem:/cores/tmp
else
AXXONRESULTSSERVER=vmfarm.rtp.raleigh.ibm.com:31
endif
TEST_STATUS=if [ $$? -eq 0 ] ; then $(ECHO) $(Q)$(Q); $(ECHO) $(Q)$@$(Q)$(Q)_PASSED$(Q); $(ECHO) $(Q)$(Q); $(CD) $(TEST_ROOT); $(RM_REPORTDIR) else perl $(Q)-I$(JAVATEST_ROOT)$(D)lib$(D)perl$(Q) -mResultStore::Uploader -e $(Q)ResultStore::Uploader::upload('.',$(BUILD_ID),$(JOB_ID),'$(AXXONRESULTSSERVER)','results-$(JOB_ID)')$(Q); $(ECHO) $(Q)$(Q); $(ECHO) $(Q)$@$(Q)$(Q)_FAILED$(Q); $(ECHO) $(Q)$(Q); fi
endif
#######################################
# CONVERT_TO_EBCDIC_CMD
# convert ascii to ebcdic on zos
#######################################
TOEBCDIC_CMD= \
$(ECHO) $(Q)converting ascii files to ebcdic$(Q); \
find | grep \\.java$ | while read f; do echo $$f; iconv -f iso8859-1 -t ibm-1047 < $$f > $$f.ebcdic; rm $$f; mv $$f.ebcdic $$f; done; \
find | grep \\.txt$ | while read f; do echo $$f; iconv -f iso8859-1 -t ibm-1047 < $$f > $$f.ebcdic; rm $$f; mv $$f.ebcdic $$f; done; \
find | grep \\.mf$ | while read f; do echo $$f; iconv -f iso8859-1 -t ibm-1047 < $$f > $$f.ebcdic; rm $$f; mv $$f.ebcdic $$f; done; \
find | grep \\.policy$ | while read f; do echo $$f; iconv -f iso8859-1 -t ibm-1047 < $$f > $$f.ebcdic; rm $$f; mv $$f.ebcdic $$f; done; \
find | grep \\.props$ | while read f; do echo $$f; iconv -f iso8859-1 -t ibm-1047 < $$f > $$f.ebcdic; rm $$f; mv $$f.ebcdic $$f; done; \
find | grep \\.sh$ | while read f; do echo $$f; iconv -f iso8859-1 -t ibm-1047 < $$f > $$f.ebcdic; rm $$f; mv $$f.ebcdic $$f; done; \
find | grep \\.pl$ | while read f; do echo $$f; iconv -f iso8859-1 -t ibm-1047 < $$f > $$f.ebcdic; rm $$f; mv $$f.ebcdic $$f; done; \
find | grep \\.xml$ | while read f; do echo $$f; iconv -f iso8859-1 -t ibm-1047 < $$f > $$f.ebcdic; rm $$f; mv $$f.ebcdic $$f; done;
CONVERT_TO_EBCDIC_CMD=
ifneq (,$(findstring zos,$(SPEC)))
CONVERT_TO_EBCDIC_CMD=$(TOEBCDIC_CMD)
endif