author | duke |
Wed, 05 Jul 2017 19:55:15 +0200 | |
changeset 25866 | 82d7101d5cab |
parent 25859 | 3317bb8137f4 |
child 26191 | a0ff4b39d34b |
permissions | -rw-r--r-- |
12317
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
1 |
# |
24967 | 2 |
# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. |
12317
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
3 |
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
4 |
# |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
5 |
# This code is free software; you can redistribute it and/or modify it |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
6 |
# under the terms of the GNU General Public License version 2 only, as |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
7 |
# published by the Free Software Foundation. Oracle designates this |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
8 |
# particular file as subject to the "Classpath" exception as provided |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
9 |
# by Oracle in the LICENSE file that accompanied this code. |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
10 |
# |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
11 |
# This code is distributed in the hope that it will be useful, but WITHOUT |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
12 |
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
13 |
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
14 |
# version 2 for more details (a copy is included in the LICENSE file that |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
15 |
# accompanied this code). |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
16 |
# |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
17 |
# You should have received a copy of the GNU General Public License version |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
18 |
# 2 along with this work; if not, write to the Free Software Foundation, |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
19 |
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
20 |
# |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
21 |
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
22 |
# or visit www.oracle.com if you need additional information or have any |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
23 |
# questions. |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
24 |
# |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
25 |
|
13164 | 26 |
WIN_VERIFY_LIB := $(JDK_OUTPUTDIR)/objs/libverify/verify.lib |
13702 | 27 |
|
12317
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
28 |
########################################################################################## |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
29 |
|
20547 | 30 |
BUILD_LIBFDLIBM_OPTIMIZATION := HIGH |
13164 | 31 |
|
32 |
ifneq ($(OPENJDK_TARGET_OS), solaris) |
|
20547 | 33 |
BUILD_LIBFDLIBM_OPTIMIZATION := NONE |
12892 | 34 |
endif |
35 |
||
25859 | 36 |
LIBFDLIBM_SRC := $(JDK_TOPDIR)/src/java.base/share/native/libfdlibm |
37 |
LIBFDLIBM_CFLAGS := -I$(LIBFDLIBM_SRC) |
|
38 |
||
20547 | 39 |
ifneq ($(OPENJDK_TARGET_OS), macosx) |
40 |
$(eval $(call SetupNativeCompilation,BUILD_LIBFDLIBM, \ |
|
41 |
STATIC_LIBRARY := fdlibm, \ |
|
42 |
OUTPUT_DIR := $(JDK_OUTPUTDIR)/objs, \ |
|
25859 | 43 |
SRC := $(LIBFDLIBM_SRC), \ |
20547 | 44 |
LANG := C, \ |
45 |
OPTIMIZATION := $(BUILD_LIBFDLIBM_OPTIMIZATION), \ |
|
25859 | 46 |
CFLAGS := $(CFLAGS_JDKLIB) $(LIBFDLIBM_CFLAGS), \ |
20547 | 47 |
CFLAGS_windows_debug := -DLOGGING, \ |
22594 | 48 |
CFLAGS_aix := -qfloat=nomaf, \ |
20547 | 49 |
ARFLAGS := $(ARFLAGS), \ |
50 |
OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libfdlibm, \ |
|
51 |
DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) |
|
13164 | 52 |
|
12892 | 53 |
else |
14855
d104ff4d4bb9
8005178: build-infra: Dependency on libfdlibm on mac is broken
erikj
parents:
14789
diff
changeset
|
54 |
|
20890 | 55 |
# On macosx the old build does partial (incremental) linking of fdlibm instead of |
56 |
# a plain static library. |
|
20547 | 57 |
$(eval $(call SetupNativeCompilation,BUILD_LIBFDLIBM_MAC, \ |
58 |
LIBRARY := fdlibm, \ |
|
59 |
OUTPUT_DIR := $(JDK_OUTPUTDIR)/objs/libfdlibm, \ |
|
25859 | 60 |
SRC := $(LIBFDLIBM_SRC), \ |
20547 | 61 |
LANG := C, \ |
25859 | 62 |
CFLAGS := $(CFLAGS_JDKLIB) $(LIBFDLIBM_CFLAGS), \ |
20547 | 63 |
LDFLAGS := -nostdlib -r -arch x86_64, \ |
64 |
OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libfdlibm, \ |
|
65 |
DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) |
|
66 |
||
67 |
BUILD_LIBFDLIBM := $(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)fdlibm$(STATIC_LIBRARY_SUFFIX) |
|
68 |
$(BUILD_LIBFDLIBM): $(BUILD_LIBFDLIBM_MAC) |
|
16636
1cc691bcfe50
8008373: JFR JTReg tests fail with CompilationError on MacOSX; missing '._sunec.jar'
erikj
parents:
16513
diff
changeset
|
69 |
$(call install-file) |
12892 | 70 |
|
12317
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
71 |
endif |
20890 | 72 |
|
12317
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
73 |
########################################################################################## |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
74 |
|
20547 | 75 |
BUILD_LIBVERIFY_SRC := check_code.c check_format.c |
13164 | 76 |
|
77 |
ifeq ($(OPENJDK_TARGET_OS), solaris) |
|
20547 | 78 |
ifneq ($(OPENJDK_TARGET_CPU), x86_64) |
21805 | 79 |
BUILD_LIBVERIFY_REORDER := $(JDK_TOPDIR)/make/mapfiles/libverify/reorder-$(OPENJDK_TARGET_CPU) |
20547 | 80 |
endif |
13164 | 81 |
endif |
82 |
||
20547 | 83 |
LIBVERIFY_OPTIMIZATION := HIGH |
84 |
ifneq ($(findstring $(OPENJDK_TARGET_OS), solaris linux), ) |
|
85 |
ifeq ($(ENABLE_DEBUG_SYMBOLS), true) |
|
86 |
LIBVERIFY_OPTIMIZATION := LOW |
|
87 |
endif |
|
13702 | 88 |
endif |
89 |
||
20547 | 90 |
$(eval $(call SetupNativeCompilation,BUILD_LIBVERIFY, \ |
91 |
LIBRARY := verify, \ |
|
92 |
OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \ |
|
25859 | 93 |
SRC := $(JDK_TOPDIR)/src/java.base/share/native/libverify, \ |
20547 | 94 |
LANG := C, \ |
95 |
OPTIMIZATION := $(LIBVERIFY_OPTIMIZATION), \ |
|
96 |
CFLAGS := $(CFLAGS_JDKLIB), \ |
|
21805 | 97 |
MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libverify/mapfile-vers, \ |
20547 | 98 |
LDFLAGS := $(LDFLAGS_JDKLIB) \ |
99 |
$(call SET_SHARED_LIBRARY_ORIGIN), \ |
|
100 |
LDFLAGS_SUFFIX_posix := -ljvm -lc, \ |
|
101 |
LDFLAGS_SUFFIX_windows := jvm.lib, \ |
|
25859 | 102 |
VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \ |
20547 | 103 |
RC_FLAGS := $(RC_FLAGS) \ |
104 |
-D "JDK_FNAME=verify.dll" \ |
|
105 |
-D "JDK_INTERNAL_NAME=verify" \ |
|
106 |
-D "JDK_FTYPE=0x2L", \ |
|
107 |
REORDER := $(BUILD_LIBVERIFY_REORDER), \ |
|
108 |
OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libverify, \ |
|
109 |
DEBUG_SYMBOLS := true)) |
|
13164 | 110 |
|
25859 | 111 |
BASE_LIBRARIES += $(BUILD_LIBVERIFY) |
12317
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
112 |
|
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
113 |
########################################################################################## |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
114 |
|
25859 | 115 |
LIBJAVA_SRC_DIRS := $(call FindSrcDirsForLib, java.base, java) |
20547 | 116 |
|
25859 | 117 |
ifeq ($(OPENJDK_TARGET_OS), macosx) |
118 |
LIBJAVA_EXCLUDE_FILES += $(JDK_TOPDIR)/src/java.base/unix/native/libjava/HostLocaleProviderAdapter_md.c |
|
13164 | 119 |
endif |
120 |
||
25859 | 121 |
LIBJAVA_CFLAGS := $(addprefix -I, $(LIBJAVA_SRC_DIRS)) \ |
122 |
-I$(JDK_TOPDIR)/src/java.base/share/native/libfdlibm \ |
|
123 |
-I$(JDK_OUTPUTDIR)/gensrc_headers/java.base \ |
|
20547 | 124 |
-DARCHPROPNAME='"$(OPENJDK_TARGET_CPU_OSARCH)"' |
13164 | 125 |
|
126 |
LIBJAVA_CFLAGS += -DJDK_MAJOR_VERSION='"$(JDK_MAJOR_VERSION)"' \ |
|
20547 | 127 |
-DJDK_MINOR_VERSION='"$(JDK_MINOR_VERSION)"' \ |
128 |
-DJDK_MICRO_VERSION='"$(JDK_MICRO_VERSION)"' \ |
|
129 |
-DJDK_BUILD_NUMBER='"$(JDK_BUILD_NUMBER)"' |
|
130 |
||
131 |
ifneq (, $(JDK_UPDATE_VERSION)) |
|
132 |
LIBJAVA_CFLAGS += -DJDK_UPDATE_VERSION='"$(JDK_UPDATE_VERSION)"' |
|
13164 | 133 |
endif |
134 |
||
20547 | 135 |
ifneq ($(OPENJDK_TARGET_OS), macosx) |
136 |
LIBJAVA_EXCLUDE_FILES += java_props_macosx.c |
|
13164 | 137 |
else |
20547 | 138 |
BUILD_LIBJAVA_java_props_md.c_CFLAGS := -x objective-c |
139 |
BUILD_LIBJAVA_java_props_macosx.c_CFLAGS := -x objective-c |
|
13164 | 140 |
endif |
141 |
||
142 |
ifeq ($(OPENJDK_TARGET_OS), solaris) |
|
20547 | 143 |
ifneq ($(OPENJDK_TARGET_CPU), x86_64) |
21805 | 144 |
LIBJAVA_REORDER := $(JDK_TOPDIR)/make/mapfiles/libjava/reorder-$(OPENJDK_TARGET_CPU) |
20547 | 145 |
endif |
13164 | 146 |
endif |
147 |
||
20547 | 148 |
$(eval $(call SetupNativeCompilation,BUILD_LIBJAVA, \ |
149 |
LIBRARY := java, \ |
|
150 |
OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \ |
|
151 |
SRC := $(LIBJAVA_SRC_DIRS), \ |
|
22951
5fd21112b2b6
8034043: Native methods for preferences API should not be in libjava
alanb
parents:
22941
diff
changeset
|
152 |
EXCLUDES := fdlibm/src zip prefs, \ |
20547 | 153 |
EXCLUDE_FILES := $(LIBJAVA_EXCLUDE_FILES), \ |
154 |
LANG := C, \ |
|
155 |
OPTIMIZATION := HIGH, \ |
|
156 |
CFLAGS := $(CFLAGS_JDKLIB) \ |
|
157 |
$(LIBJAVA_CFLAGS), \ |
|
21805 | 158 |
MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libjava/mapfile-vers, \ |
20547 | 159 |
LDFLAGS := $(LDFLAGS_JDKLIB) \ |
160 |
$(call SET_SHARED_LIBRARY_ORIGIN), \ |
|
161 |
LDFLAGS_SUFFIX_posix := -ljvm -lverify, \ |
|
162 |
LDFLAGS_SUFFIX_solaris := -lsocket -lnsl -lscf $(LIBDL) $(BUILD_LIBFDLIBM) -lc, \ |
|
163 |
LDFLAGS_SUFFIX_linux := $(LIBDL) $(BUILD_LIBFDLIBM), \ |
|
22594 | 164 |
LDFLAGS_SUFFIX_aix := $(LIBDL) $(BUILD_LIBFDLIBM) -lm,\ |
20547 | 165 |
LDFLAGS_SUFFIX_macosx := -L$(JDK_OUTPUTDIR)/objs/ -lfdlibm \ |
166 |
-framework CoreFoundation \ |
|
167 |
-framework Foundation \ |
|
168 |
-framework Security -framework SystemConfiguration, \ |
|
169 |
LDFLAGS_SUFFIX_windows := -export:winFileHandleOpen -export:handleLseek \ |
|
170 |
jvm.lib $(BUILD_LIBFDLIBM) $(WIN_VERIFY_LIB) \ |
|
171 |
shell32.lib delayimp.lib -DELAYLOAD:shell32.dll \ |
|
172 |
advapi32.lib, \ |
|
25859 | 173 |
VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \ |
20547 | 174 |
RC_FLAGS := $(RC_FLAGS) \ |
175 |
-D "JDK_FNAME=java.dll" \ |
|
176 |
-D "JDK_INTERNAL_NAME=java" \ |
|
177 |
-D "JDK_FTYPE=0x2L", \ |
|
178 |
REORDER := $(LIBJAVA_REORDER), \ |
|
179 |
OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjava, \ |
|
180 |
DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) |
|
13164 | 181 |
|
25859 | 182 |
BASE_LIBRARIES += $(BUILD_LIBJAVA) |
20547 | 183 |
|
184 |
$(BUILD_LIBJAVA): $(BUILD_LIBVERIFY) |
|
185 |
||
186 |
$(BUILD_LIBJAVA): $(BUILD_LIBFDLIBM) |
|
12317
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
187 |
|
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
188 |
########################################################################################## |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
189 |
|
20547 | 190 |
BUILD_LIBZIP_EXCLUDES := |
191 |
ifeq ($(USE_EXTERNAL_LIBZ), true) |
|
24710
c019dc4104b2
8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
23562
diff
changeset
|
192 |
LIBZIP_EXCLUDES += zlib-1.2.8 |
20547 | 193 |
endif |
194 |
||
195 |
BUILD_LIBZIP_REORDER := |
|
196 |
ifeq ($(OPENJDK_TARGET_OS), solaris) |
|
197 |
ifneq ($(OPENJDK_TARGET_CPU), x86_64) |
|
21805 | 198 |
BUILD_LIBZIP_REORDER := $(JDK_TOPDIR)/make/mapfiles/libzip/reorder-$(OPENJDK_TARGET_CPU) |
20547 | 199 |
endif |
200 |
endif |
|
201 |
||
202 |
ifeq ($(LIBZIP_CAN_USE_MMAP), true) |
|
203 |
BUILD_LIBZIP_MMAP := -DUSE_MMAP |
|
204 |
endif |
|
205 |
||
206 |
$(eval $(call SetupNativeCompilation,BUILD_LIBZIP, \ |
|
207 |
LIBRARY := zip, \ |
|
208 |
OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \ |
|
209 |
LANG := C, \ |
|
210 |
OPTIMIZATION := LOW, \ |
|
25859 | 211 |
SRC := $(JDK_TOPDIR)/src/java.base/share/native/libzip, \ |
20547 | 212 |
EXCLUDES := $(LIBZIP_EXCLUDES), \ |
213 |
CFLAGS := $(CFLAGS_JDKLIB) \ |
|
214 |
$(ZLIB_CPPFLAGS) \ |
|
25859 | 215 |
-I$(JDK_TOPDIR)/src/java.base/share/native/libjava \ |
216 |
-I$(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_API_DIR)/native/libjava \ |
|
217 |
-I$(JDK_OUTPUTDIR)/gensrc_headers/java.base, \ |
|
20547 | 218 |
CFLAGS_posix := $(BUILD_LIBZIP_MMAP) -UDEBUG, \ |
21805 | 219 |
MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libzip/mapfile-vers, \ |
20547 | 220 |
REORDER := $(BUILD_LIBZIP_REORDER), \ |
221 |
LDFLAGS := $(LDFLAGS_JDKLIB) \ |
|
222 |
$(call SET_SHARED_LIBRARY_ORIGIN) \ |
|
223 |
$(EXPORT_ZIP_FUNCS), \ |
|
224 |
LDFLAGS_windows := -export:ZIP_Open -export:ZIP_Close -export:ZIP_FindEntry \ |
|
225 |
-export:ZIP_ReadEntry -export:ZIP_GetNextEntry jvm.lib \ |
|
226 |
$(WIN_JAVA_LIB), \ |
|
227 |
LDFLAGS_SUFFIX_linux := -ljvm -ljava $(LIBZ), \ |
|
228 |
LDFLAGS_SUFFIX_solaris := -ljvm -ljava $(LIBZ) -lc, \ |
|
22595
aaa6b141196c
8028066: PPC64: 8025715 changes broke AIX build after sync
simonis
parents:
22594
diff
changeset
|
229 |
LDFLAGS_SUFFIX_aix := -ljvm -ljava $(LIBZ),\ |
20547 | 230 |
LDFLAGS_SUFFIX_macosx := $(LIBZ) -ljava -ljvm, \ |
25859 | 231 |
VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \ |
20547 | 232 |
RC_FLAGS := $(RC_FLAGS) \ |
233 |
-D "JDK_FNAME=zip.dll" \ |
|
234 |
-D "JDK_INTERNAL_NAME=zip" \ |
|
235 |
-D "JDK_FTYPE=0x2L", \ |
|
236 |
OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libzip, \ |
|
237 |
DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) |
|
238 |
||
239 |
||
240 |
$(BUILD_LIBZIP): $(BUILD_LIBJAVA) |
|
241 |
||
25859 | 242 |
BASE_LIBRARIES += $(BUILD_LIBZIP) |
20547 | 243 |
|
244 |
########################################################################################## |
|
245 |
||
25859 | 246 |
BUILD_LIBJLI_SRC_DIRS := $(JDK_TOPDIR)/src/java.base/share/native/libjli \ |
247 |
$(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_API_DIR)/native/libjli |
|
22951
5fd21112b2b6
8034043: Native methods for preferences API should not be in libjava
alanb
parents:
22941
diff
changeset
|
248 |
|
25859 | 249 |
LIBJLI_CFLAGS := $(CFLAGS_JDKLIB) |
20547 | 250 |
|
251 |
BUILD_LIBJLI_FILES := \ |
|
252 |
java.c \ |
|
253 |
splashscreen_stubs.c \ |
|
254 |
parse_manifest.c \ |
|
255 |
version_comp.c \ |
|
256 |
wildcard.c \ |
|
257 |
jli_util.c |
|
258 |
||
259 |
ifeq ($(JVM_VARIANT_ZERO), true) |
|
260 |
ERGO_FAMILY := zero |
|
261 |
else |
|
262 |
ifeq ($(OPENJDK_TARGET_CPU_ARCH), x86) |
|
263 |
ERGO_FAMILY := i586 |
|
264 |
else |
|
265 |
ERGO_FAMILY := $(OPENJDK_TARGET_CPU_ARCH) |
|
266 |
endif |
|
267 |
endif |
|
268 |
||
269 |
ifeq ($(OPENJDK_TARGET_OS), macosx) |
|
25859 | 270 |
BUILD_LIBJLI_SRC_DIRS += $(JDK_TOPDIR)/src/java.base/macosx/native/libjli |
20547 | 271 |
BUILD_LIBJLI_FILES += java_md_common.c java_md_macosx.c |
272 |
||
273 |
BUILD_LIBJLI_java_md_macosx.c_CFLAGS := -x objective-c |
|
274 |
BUILD_LIBJLI_STATIC_java_md_macosx.c_CFLAGS := -x objective-c |
|
275 |
endif |
|
276 |
||
277 |
ifeq ($(OPENJDK_TARGET_OS), windows) |
|
278 |
BUILD_LIBJLI_FILES += java_md.c \ |
|
279 |
cmdtoargs.c |
|
280 |
# Staticically link with c runtime on windows. |
|
281 |
LIBJLI_CFLAGS := $(filter-out -MD, $(LIBJLI_CFLAGS)) |
|
282 |
else ifneq ($(OPENJDK_TARGET_OS), macosx) |
|
283 |
||
284 |
BUILD_LIBJLI_FILES += java_md_common.c |
|
285 |
BUILD_LIBJLI_FILES += java_md_solinux.c ergo.c |
|
286 |
||
287 |
ERGO_ARCH_FILE = ergo_$(ERGO_FAMILY).c |
|
288 |
||
289 |
# if the architecture specific ergo file exists then |
|
290 |
# use it, else use the generic definitions from ergo.c |
|
25859 | 291 |
ifneq ($(wildcard $(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_API_DIR)/native/libjli/$(ERGO_ARCH_FILE)), ) |
20547 | 292 |
BUILD_LIBJLI_FILES += $(ERGO_ARCH_FILE) |
293 |
else # !ERGO_ARCH_FILE |
|
294 |
LIBJLI_CFLAGS += -DUSE_GENERIC_ERGO |
|
295 |
endif # ERGO_ARCH_FILE |
|
296 |
endif #WINDOWS |
|
297 |
||
25859 | 298 |
LIBJLI_CFLAGS += $(foreach dir, $(BUILD_LIBJLI_SRC_DIRS), -I$(dir)) |
299 |
||
20547 | 300 |
# Append defines depending on target platform |
301 |
LIBJLI_CFLAGS += $(OPENJDK_TARGET_CPU_JLI_CFLAGS) |
|
302 |
||
303 |
ifeq ($(OPENJDK_TARGET_OS), macosx) |
|
304 |
LIBJLI_CFLAGS += -DPACKAGE_PATH=\"$(PACKAGE_PATH)\" |
|
305 |
endif |
|
306 |
||
307 |
ifneq ($(USE_EXTERNAL_LIBZ), true) |
|
25859 | 308 |
BUILD_LIBJLI_SRC_DIRS += $(JDK_TOPDIR)/src/java.base/share/native/libzip/zlib-1.2.8 |
20547 | 309 |
LIBJLI_CFLAGS += $(ZLIB_CPPFLAGS) |
310 |
BUILD_LIBJLI_FILES += \ |
|
311 |
inflate.c \ |
|
312 |
inftrees.c \ |
|
313 |
inffast.c \ |
|
314 |
zadler32.c \ |
|
315 |
zcrc32.c \ |
|
316 |
zutil.c |
|
317 |
endif |
|
318 |
||
319 |
ifeq ($(OPENJDK_TARGET_OS), windows) |
|
320 |
LIBJLI_OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE) |
|
321 |
else |
|
322 |
LIBJLI_OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE)/jli |
|
323 |
endif |
|
324 |
||
325 |
$(eval $(call SetupNativeCompilation,BUILD_LIBJLI, \ |
|
326 |
LIBRARY := jli, \ |
|
327 |
OUTPUT_DIR := $(LIBJLI_OUTPUT_DIR), \ |
|
328 |
SRC := $(BUILD_LIBJLI_SRC_DIRS), \ |
|
329 |
INCLUDE_FILES := $(BUILD_LIBJLI_FILES), \ |
|
330 |
LANG := C, \ |
|
331 |
OPTIMIZATION := HIGH, \ |
|
332 |
CFLAGS := $(LIBJLI_CFLAGS), \ |
|
21805 | 333 |
MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libjli/mapfile-vers, \ |
20547 | 334 |
LDFLAGS := $(LDFLAGS_JDKLIB) \ |
335 |
$(call SET_SHARED_LIBRARY_ORIGIN), \ |
|
336 |
LDFLAGS_linux := $(call SET_SHARED_LIBRARY_ORIGIN,/..), \ |
|
337 |
LDFLAGS_solaris := $(call SET_SHARED_LIBRARY_ORIGIN,/..), \ |
|
338 |
LDFLAGS_macosx := -framework Cocoa -framework Security -framework ApplicationServices, \ |
|
339 |
LDFLAGS_SUFFIX_solaris := $(LIBZ) $(LIBDL) -lc, \ |
|
21606 | 340 |
LDFLAGS_SUFFIX_linux := $(LIBZ) $(LIBDL) -lc -lpthread, \ |
22595
aaa6b141196c
8028066: PPC64: 8025715 changes broke AIX build after sync
simonis
parents:
22594
diff
changeset
|
341 |
LDFLAGS_SUFFIX_aix := $(LIBZ) $(LIBDL),\ |
20547 | 342 |
LDFLAGS_SUFFIX_macosx := $(LIBZ), \ |
343 |
LDFLAGS_SUFFIX_windows := \ |
|
344 |
-export:JLI_Launch \ |
|
345 |
-export:JLI_ManifestIterate \ |
|
346 |
-export:JLI_SetTraceLauncher \ |
|
347 |
-export:JLI_ReportErrorMessage \ |
|
348 |
-export:JLI_ReportErrorMessageSys \ |
|
349 |
-export:JLI_ReportMessage \ |
|
350 |
-export:JLI_ReportExceptionDescription \ |
|
351 |
-export:JLI_MemAlloc \ |
|
352 |
-export:JLI_CmdToArgs \ |
|
353 |
-export:JLI_GetStdArgc \ |
|
354 |
-export:JLI_GetStdArgs \ |
|
355 |
advapi32.lib \ |
|
356 |
comctl32.lib \ |
|
357 |
user32.lib, \ |
|
25859 | 358 |
VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \ |
20547 | 359 |
RC_FLAGS := $(RC_FLAGS) \ |
360 |
-D "JDK_FNAME=jli.dll" \ |
|
361 |
-D "JDK_INTERNAL_NAME=jli" \ |
|
362 |
-D "JDK_FTYPE=0x2L", \ |
|
363 |
OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjli, \ |
|
364 |
DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) |
|
365 |
||
25859 | 366 |
BASE_LIBRARIES += $(BUILD_LIBJLI) |
20547 | 367 |
|
368 |
# On windows, the static library has the same suffix as the import library created by |
|
369 |
# with the shared library, so the static library is given a different name. No harm |
|
370 |
# in doing it for all platform to reduce complexity. |
|
371 |
ifeq ($(OPENJDK_TARGET_OS), windows) |
|
372 |
$(eval $(call SetupNativeCompilation,BUILD_LIBJLI_STATIC, \ |
|
373 |
STATIC_LIBRARY := jli_static, \ |
|
374 |
OUTPUT_DIR := $(JDK_OUTPUTDIR)/objs, \ |
|
375 |
SRC := $(BUILD_LIBJLI_SRC_DIRS), \ |
|
376 |
INCLUDE_FILES := $(BUILD_LIBJLI_FILES), \ |
|
377 |
LANG := C, \ |
|
378 |
OPTIMIZATION := HIGH, \ |
|
379 |
CFLAGS := $(STATIC_LIBRARY_FLAGS) $(LIBJLI_CFLAGS), \ |
|
380 |
ARFLAGS := $(ARFLAGS), \ |
|
381 |
OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjli_static, \ |
|
382 |
DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) |
|
383 |
||
384 |
BUILD_LIBRARIES += $(BUILD_LIBJLI_STATIC) |
|
25859 | 385 |
BASE_STATIC_LIBRARIES += $(BUILD_LIBJLI_STATIC) |
20547 | 386 |
|
387 |
else ifeq ($(OPENJDK_TARGET_OS), macosx) |
|
388 |
# |
|
389 |
# On macosx they do partial (incremental) linking of libjli_static.a |
|
390 |
# code it here...rather than add support to NativeCompilation |
|
391 |
# as this is first time I see it |
|
392 |
$(eval $(call SetupNativeCompilation,BUILD_LIBJLI_STATIC, \ |
|
393 |
LIBRARY := jli_static, \ |
|
394 |
OUTPUT_DIR := $(JDK_OUTPUTDIR)/objs, \ |
|
395 |
SRC := $(BUILD_LIBJLI_SRC_DIRS), \ |
|
396 |
INCLUDE_FILES := $(BUILD_LIBJLI_FILES), \ |
|
397 |
LANG := C, \ |
|
398 |
OPTIMIZATION := HIGH, \ |
|
399 |
CFLAGS := $(CFLAGS_JDKLIB) $(LIBJLI_CFLAGS), \ |
|
400 |
LDFLAGS := -nostdlib -r, \ |
|
401 |
OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjli_static, \ |
|
402 |
DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) |
|
403 |
||
404 |
$(JDK_OUTPUTDIR)/objs/libjli_static.a: $(BUILD_LIBJLI_STATIC) |
|
405 |
$(call install-file) |
|
406 |
||
407 |
BUILD_LIBRARIES += $(JDK_OUTPUTDIR)/objs/libjli_static.a |
|
25859 | 408 |
BASE_STATIC_LIBRARIES += $(JDK_OUTPUTDIR)/objs/libjli_static.a |
22595
aaa6b141196c
8028066: PPC64: 8025715 changes broke AIX build after sync
simonis
parents:
22594
diff
changeset
|
409 |
|
aaa6b141196c
8028066: PPC64: 8025715 changes broke AIX build after sync
simonis
parents:
22594
diff
changeset
|
410 |
else ifeq ($(OPENJDK_TARGET_OS), aix) |
aaa6b141196c
8028066: PPC64: 8025715 changes broke AIX build after sync
simonis
parents:
22594
diff
changeset
|
411 |
# AIX also requires a static libjli because the compiler doesn't support '-rpath' |
aaa6b141196c
8028066: PPC64: 8025715 changes broke AIX build after sync
simonis
parents:
22594
diff
changeset
|
412 |
$(eval $(call SetupNativeCompilation,BUILD_LIBJLI_STATIC,\ |
aaa6b141196c
8028066: PPC64: 8025715 changes broke AIX build after sync
simonis
parents:
22594
diff
changeset
|
413 |
STATIC_LIBRARY:=jli_static,\ |
aaa6b141196c
8028066: PPC64: 8025715 changes broke AIX build after sync
simonis
parents:
22594
diff
changeset
|
414 |
OUTPUT_DIR:=$(JDK_OUTPUTDIR)/objs,\ |
aaa6b141196c
8028066: PPC64: 8025715 changes broke AIX build after sync
simonis
parents:
22594
diff
changeset
|
415 |
SRC:=$(BUILD_LIBJLI_SRC_DIRS),\ |
aaa6b141196c
8028066: PPC64: 8025715 changes broke AIX build after sync
simonis
parents:
22594
diff
changeset
|
416 |
INCLUDE_FILES:=$(BUILD_LIBJLI_FILES),\ |
aaa6b141196c
8028066: PPC64: 8025715 changes broke AIX build after sync
simonis
parents:
22594
diff
changeset
|
417 |
LANG:=C,\ |
aaa6b141196c
8028066: PPC64: 8025715 changes broke AIX build after sync
simonis
parents:
22594
diff
changeset
|
418 |
OPTIMIZATION:=HIGH, \ |
aaa6b141196c
8028066: PPC64: 8025715 changes broke AIX build after sync
simonis
parents:
22594
diff
changeset
|
419 |
CFLAGS:=$(STATIC_LIBRARY_FLAGS) $(LIBJLI_CFLAGS),\ |
aaa6b141196c
8028066: PPC64: 8025715 changes broke AIX build after sync
simonis
parents:
22594
diff
changeset
|
420 |
ARFLAGS:=$(ARFLAGS),\ |
aaa6b141196c
8028066: PPC64: 8025715 changes broke AIX build after sync
simonis
parents:
22594
diff
changeset
|
421 |
OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libjli_static)) |
aaa6b141196c
8028066: PPC64: 8025715 changes broke AIX build after sync
simonis
parents:
22594
diff
changeset
|
422 |
|
25859 | 423 |
BUILD_LIBRARIES += $(BUILD_LIBJLI_STATIC) |
424 |
BASE_STATIC_LIBRARIES += $(BUILD_LIBJLI_STATIC) |
|
22595
aaa6b141196c
8028066: PPC64: 8025715 changes broke AIX build after sync
simonis
parents:
22594
diff
changeset
|
425 |
|
20547 | 426 |
endif |
25859 | 427 |