author | gziemski |
Tue, 29 May 2018 11:04:56 -0500 | |
changeset 50289 | 0195ee80e530 |
parent 49561 | a0f22265e29c |
child 50471 | f0aeede1b855 |
child 56433 | c3cf838aa2da |
permissions | -rw-r--r-- |
25859 | 1 |
# |
49252 | 2 |
# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved. |
25859 | 3 |
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
# |
|
5 |
# This code is free software; you can redistribute it and/or modify it |
|
6 |
# under the terms of the GNU General Public License version 2 only, as |
|
7 |
# published by the Free Software Foundation. Oracle designates this |
|
8 |
# particular file as subject to the "Classpath" exception as provided |
|
9 |
# by Oracle in the LICENSE file that accompanied this code. |
|
10 |
# |
|
11 |
# This code is distributed in the hope that it will be useful, but WITHOUT |
|
12 |
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 |
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
14 |
# version 2 for more details (a copy is included in the LICENSE file that |
|
15 |
# accompanied this code). |
|
16 |
# |
|
17 |
# You should have received a copy of the GNU General Public License version |
|
18 |
# 2 along with this work; if not, write to the Free Software Foundation, |
|
19 |
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
20 |
# |
|
21 |
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
|
22 |
# or visit www.oracle.com if you need additional information or have any |
|
23 |
# questions. |
|
24 |
# |
|
25 |
||
26 |
include LibCommon.gmk |
|
27 |
||
47336
6694369ed3f9
8189229: Remove references to $(TOPDIR)/src/*/$(MODULE)
ihse
parents:
47217
diff
changeset
|
28 |
# Hook to include the corresponding custom file, if present. |
6694369ed3f9
8189229: Remove references to $(TOPDIR)/src/*/$(MODULE)
ihse
parents:
47217
diff
changeset
|
29 |
$(eval $(call IncludeCustomExtension, lib/Lib-java.base.gmk)) |
6694369ed3f9
8189229: Remove references to $(TOPDIR)/src/*/$(MODULE)
ihse
parents:
47217
diff
changeset
|
30 |
|
26192
33b90e93e3bf
8055095: Improve "do nothing" incremental build performance after modularized source code integration
erikj
parents:
25859
diff
changeset
|
31 |
# Prepare the find cache. |
47336
6694369ed3f9
8189229: Remove references to $(TOPDIR)/src/*/$(MODULE)
ihse
parents:
47217
diff
changeset
|
32 |
LIB_java.base_SRC_DIRS += $(TOPDIR)/src/java.base/*/native |
6694369ed3f9
8189229: Remove references to $(TOPDIR)/src/*/$(MODULE)
ihse
parents:
47217
diff
changeset
|
33 |
|
6694369ed3f9
8189229: Remove references to $(TOPDIR)/src/*/$(MODULE)
ihse
parents:
47217
diff
changeset
|
34 |
$(eval $(call FillCacheFind, $(wildcard $(LIB_java.base_SRC_DIRS)))) |
26192
33b90e93e3bf
8055095: Improve "do nothing" incremental build performance after modularized source code integration
erikj
parents:
25859
diff
changeset
|
35 |
|
49252 | 36 |
################################################################################ |
37 |
# Create all the core libraries |
|
38 |
||
25859 | 39 |
include CoreLibraries.gmk |
49252 | 40 |
|
41 |
################################################################################ |
|
42 |
# Create the network library |
|
43 |
||
44 |
LIBNET_SRC_DIRS := $(call FindSrcDirsForLib, java.base, net) |
|
45 |
||
46 |
$(eval $(call SetupJdkLibrary, BUILD_LIBNET, \ |
|
47 |
NAME := net, \ |
|
48 |
SRC := $(LIBNET_SRC_DIRS), \ |
|
49 |
OPTIMIZATION := LOW, \ |
|
50 |
CFLAGS := $(CFLAGS_JDKLIB) -I$(SUPPORT_OUTPUTDIR)/headers/java.base \ |
|
51 |
$(LIBJAVA_HEADER_FLAGS) $(addprefix -I, $(LIBNET_SRC_DIRS)), \ |
|
52 |
DISABLED_WARNINGS_gcc := format-nonliteral, \ |
|
53 |
DISABLED_WARNINGS_clang := parentheses-equality constant-logical-operand, \ |
|
54 |
DISABLED_WARNINGS_microsoft := 4244 4047 4133 4996, \ |
|
55 |
DISABLED_WARNINGS_solstudio := E_ARG_INCOMPATIBLE_WITH_ARG_L, \ |
|
56 |
LDFLAGS := $(LDFLAGS_JDKLIB) \ |
|
57 |
$(call SET_SHARED_LIBRARY_ORIGIN), \ |
|
58 |
LDFLAGS_windows := -delayload:secur32.dll -delayload:iphlpapi.dll, \ |
|
59 |
LIBS_unix := -ljvm -ljava, \ |
|
60 |
LIBS_linux := $(LIBDL) -lpthread, \ |
|
61 |
LIBS_solaris := -lnsl -lsocket $(LIBDL), \ |
|
62 |
LIBS_aix := $(LIBDL),\ |
|
63 |
LIBS_windows := ws2_32.lib jvm.lib secur32.lib iphlpapi.lib winhttp.lib \ |
|
64 |
delayimp.lib $(WIN_JAVA_LIB) advapi32.lib, \ |
|
65 |
LIBS_macosx := -framework CoreFoundation -framework CoreServices, \ |
|
66 |
)) |
|
67 |
||
68 |
$(BUILD_LIBNET): $(BUILD_LIBJAVA) |
|
69 |
||
70 |
TARGETS += $(BUILD_LIBNET) |
|
71 |
||
72 |
################################################################################ |
|
73 |
# Create the nio library |
|
74 |
||
75 |
BUILD_LIBNIO_SRC := \ |
|
76 |
$(TOPDIR)/src/java.base/share/native/libnio \ |
|
77 |
$(TOPDIR)/src/java.base/share/native/libnio/ch \ |
|
78 |
$(TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libnio \ |
|
79 |
$(sort $(wildcard \ |
|
80 |
$(TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libnio/ch \ |
|
81 |
$(TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libnio/fs \ |
|
82 |
$(TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS)/native/libnio/ch \ |
|
83 |
$(TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS)/native/libnio/fs)) \ |
|
84 |
# |
|
85 |
||
86 |
BUILD_LIBNIO_CFLAGS := \ |
|
87 |
$(addprefix -I, $(BUILD_LIBNIO_SRC)) \ |
|
88 |
-I$(SUPPORT_OUTPUTDIR)/headers/java.base \ |
|
89 |
$(LIBJAVA_HEADER_FLAGS) \ |
|
90 |
$(addprefix -I, $(BUILD_LIBNET_SRC)) |
|
91 |
||
92 |
$(eval $(call SetupJdkLibrary, BUILD_LIBNIO, \ |
|
93 |
NAME := nio, \ |
|
94 |
SRC := $(BUILD_LIBNIO_SRC), \ |
|
95 |
EXCLUDE_FILES := $(BUILD_LIBNIO_EXFILES), \ |
|
96 |
OPTIMIZATION := HIGH, \ |
|
97 |
WARNINGS_AS_ERRORS_xlc := false, \ |
|
98 |
CFLAGS := $(CFLAGS_JDKLIB) \ |
|
99 |
$(BUILD_LIBNIO_CFLAGS), \ |
|
100 |
LDFLAGS := $(LDFLAGS_JDKLIB) \ |
|
101 |
$(call SET_SHARED_LIBRARY_ORIGIN), \ |
|
102 |
LIBS_unix := -ljava -lnet, \ |
|
103 |
LIBS_linux := -lpthread $(LIBDL), \ |
|
104 |
LIBS_solaris := -ljvm -lsocket -lposix4 $(LIBDL) \ |
|
105 |
-lsendfile, \ |
|
106 |
LIBS_aix := $(LIBDL), \ |
|
107 |
LIBS_macosx := \ |
|
108 |
-framework CoreFoundation -framework CoreServices, \ |
|
109 |
LIBS_windows := jvm.lib ws2_32.lib $(WIN_JAVA_LIB) \ |
|
110 |
$(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libnet/net.lib \ |
|
111 |
advapi32.lib, \ |
|
112 |
)) |
|
113 |
||
114 |
TARGETS += $(BUILD_LIBNIO) |
|
115 |
||
116 |
$(BUILD_LIBNIO): $(BUILD_LIBNET) |
|
117 |
||
118 |
################################################################################ |
|
119 |
# Create the macosx security library |
|
120 |
||
121 |
ifeq ($(OPENJDK_TARGET_OS), macosx) |
|
122 |
# JavaNativeFoundation framework not supported in static builds |
|
123 |
ifneq ($(STATIC_BUILD), true) |
|
124 |
||
125 |
LIBOSXSECURITY_DIRS := $(TOPDIR)/src/java.base/macosx/native/libosxsecurity |
|
126 |
LIBOSXSECURITY_CFLAGS := -I$(LIBOSXSECURITY_DIRS) \ |
|
127 |
$(LIBJAVA_HEADER_FLAGS) \ |
|
128 |
-I$(SUPPORT_OUTPUTDIR)/headers/java.base \ |
|
129 |
||
130 |
$(eval $(call SetupJdkLibrary, BUILD_LIBOSXSECURITY, \ |
|
131 |
NAME := osxsecurity, \ |
|
132 |
SRC := $(LIBOSXSECURITY_DIRS), \ |
|
133 |
OPTIMIZATION := LOW, \ |
|
134 |
CFLAGS := $(CFLAGS_JDKLIB) \ |
|
135 |
$(LIBOSXSECURITY_CFLAGS), \ |
|
136 |
DISABLED_WARNINGS_clang := deprecated-declarations, \ |
|
137 |
LDFLAGS := $(LDFLAGS_JDKLIB) \ |
|
138 |
-L$(SUPPORT_OUTPUTDIR)/modules_libs/java.base \ |
|
139 |
$(call SET_SHARED_LIBRARY_ORIGIN) \ |
|
140 |
-fobjc-link-runtime, \ |
|
141 |
LIBS := \ |
|
142 |
-framework JavaNativeFoundation \ |
|
143 |
-framework CoreServices \ |
|
144 |
-framework Security \ |
|
145 |
$(JDKLIB_LIBS), \ |
|
146 |
)) |
|
147 |
||
148 |
$(BUILD_LIBOSXSECURITY): $(BUILD_LIBJAVA) |
|
149 |
||
150 |
TARGETS += $(BUILD_LIBOSXSECURITY) |
|
151 |
||
152 |
endif |
|
153 |
endif |
|
154 |
||
155 |
################################################################################ |
|
49423 | 156 |
# Create the jsig library |
157 |
||
49561 | 158 |
ifeq ($(OPENJDK_TARGET_OS_TYPE), unix) |
49423 | 159 |
ifeq ($(STATIC_BUILD), false) |
160 |
||
49561 | 161 |
LIBJSIG_SRC_DIR := $(TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libjsig |
49445 | 162 |
LIBJSIG_MAPFILE := $(wildcard $(TOPDIR)/make/mapfiles/libjsig/mapfile-vers-$(OPENJDK_TARGET_OS)) |
49440 | 163 |
|
164 |
ifeq ($(OPENJDK_TARGET_OS), linux) |
|
165 |
# FIXME: This is probably not what we want to do, but keep it now for compatibility. |
|
166 |
LIBJSIG_CFLAGS := $(EXPORT_ALL_SYMBOLS) |
|
167 |
endif |
|
49423 | 168 |
|
169 |
$(eval $(call SetupJdkLibrary, BUILD_LIBJSIG, \ |
|
170 |
NAME := jsig, \ |
|
171 |
SRC := $(LIBJSIG_SRC_DIR), \ |
|
49440 | 172 |
CFLAGS := $(CFLAGS_JDKLIB) $(LIBJSIG_CFLAGS), \ |
49423 | 173 |
LDFLAGS := $(LDFLAGS_JDKLIB) \ |
174 |
$(call SET_SHARED_LIBRARY_ORIGIN), \ |
|
175 |
LIBS_linux := $(LIBDL), \ |
|
176 |
LIBS_solaris := $(LIBDL), \ |
|
177 |
LIBS_aix := $(LIBDL), \ |
|
49445 | 178 |
MAPFILE := $(LIBJSIG_MAPFILE), \ |
49423 | 179 |
)) |
180 |
||
181 |
TARGETS += $(BUILD_LIBJSIG) |
|
182 |
||
183 |
############################################################################ |
|
184 |
# Create symlinks to libjsig in each JVM variant sub dir |
|
185 |
LIB_OUTPUTDIR := $(call FindLibDirForModule, java.base) |
|
186 |
||
187 |
# $1 variant subdir |
|
188 |
define CreateSymlinks |
|
189 |
# Always symlink from libdir/variant/libjsig.so -> ../libjsig.so. |
|
190 |
$(LIB_OUTPUTDIR)/$1/$(call SHARED_LIBRARY,jsig): \ |
|
191 |
$(LIB_OUTPUTDIR)/$(call SHARED_LIBRARY,jsig) |
|
192 |
$$(call MakeDir, $$(@D)) |
|
193 |
$(RM) $$@ |
|
194 |
$(LN) -s ../$$(@F) $$@ |
|
195 |
||
196 |
TARGETS += $(LIB_OUTPUTDIR)/$1/$(call SHARED_LIBRARY,jsig) |
|
197 |
endef |
|
198 |
||
199 |
# The subdir is the same as the variant for client and minimal, for all |
|
200 |
# others it's server. |
|
201 |
VARIANT_SUBDIRS := $(filter client minimal, $(JVM_VARIANTS)) \ |
|
202 |
$(if $(filter-out client minimal, $(JVM_VARIANTS)), server) |
|
203 |
$(foreach v, $(VARIANT_SUBDIRS), $(eval $(call CreateSymlinks,$v))) |
|
204 |
||
205 |
############################################################################ |
|
206 |
||
207 |
endif |
|
208 |
endif |
|
209 |
||
210 |
################################################################################ |
|
49252 | 211 |
# Create the symbols file for static builds. |
33653
c1ee09fe3274
8136556: Add the ability to perform static builds of MacOSX x64 binaries
bobv
parents:
32229
diff
changeset
|
212 |
|
c1ee09fe3274
8136556: Add the ability to perform static builds of MacOSX x64 binaries
bobv
parents:
32229
diff
changeset
|
213 |
ifeq ($(STATIC_BUILD), true) |
c1ee09fe3274
8136556: Add the ability to perform static builds of MacOSX x64 binaries
bobv
parents:
32229
diff
changeset
|
214 |
JAVA_BASE_EXPORT_SYMBOLS_SRC := \ |
c1ee09fe3274
8136556: Add the ability to perform static builds of MacOSX x64 binaries
bobv
parents:
32229
diff
changeset
|
215 |
$(SUPPORT_OUTPUTDIR)/modules_libs/java.base/jli/$(LIBRARY_PREFIX)jli.symbols \ |
c1ee09fe3274
8136556: Add the ability to perform static builds of MacOSX x64 binaries
bobv
parents:
32229
diff
changeset
|
216 |
$(SUPPORT_OUTPUTDIR)/modules_libs/java.base/$(LIBRARY_PREFIX)java.symbols \ |
c1ee09fe3274
8136556: Add the ability to perform static builds of MacOSX x64 binaries
bobv
parents:
32229
diff
changeset
|
217 |
$(SUPPORT_OUTPUTDIR)/modules_libs/java.base/$(LIBRARY_PREFIX)net.symbols \ |
c1ee09fe3274
8136556: Add the ability to perform static builds of MacOSX x64 binaries
bobv
parents:
32229
diff
changeset
|
218 |
$(SUPPORT_OUTPUTDIR)/modules_libs/java.base/$(LIBRARY_PREFIX)nio.symbols \ |
c1ee09fe3274
8136556: Add the ability to perform static builds of MacOSX x64 binaries
bobv
parents:
32229
diff
changeset
|
219 |
$(SUPPORT_OUTPUTDIR)/modules_libs/java.base/$(LIBRARY_PREFIX)verify.symbols \ |
c1ee09fe3274
8136556: Add the ability to perform static builds of MacOSX x64 binaries
bobv
parents:
32229
diff
changeset
|
220 |
$(SUPPORT_OUTPUTDIR)/modules_libs/java.base/$(LIBRARY_PREFIX)zip.symbols \ |
c1ee09fe3274
8136556: Add the ability to perform static builds of MacOSX x64 binaries
bobv
parents:
32229
diff
changeset
|
221 |
$(SUPPORT_OUTPUTDIR)/modules_libs/java.base/$(LIBRARY_PREFIX)jimage.symbols \ |
c1ee09fe3274
8136556: Add the ability to perform static builds of MacOSX x64 binaries
bobv
parents:
32229
diff
changeset
|
222 |
$(SUPPORT_OUTPUTDIR)/modules_libs/java.base/server/$(LIBRARY_PREFIX)jvm.symbols \ |
c1ee09fe3274
8136556: Add the ability to perform static builds of MacOSX x64 binaries
bobv
parents:
32229
diff
changeset
|
223 |
# |
c1ee09fe3274
8136556: Add the ability to perform static builds of MacOSX x64 binaries
bobv
parents:
32229
diff
changeset
|
224 |
|
c1ee09fe3274
8136556: Add the ability to perform static builds of MacOSX x64 binaries
bobv
parents:
32229
diff
changeset
|
225 |
JAVA_BASE_EXPORT_SYMBOL_FILE := $(SUPPORT_OUTPUTDIR)/modules_libs/java.base/java.base.symbols |
c1ee09fe3274
8136556: Add the ability to perform static builds of MacOSX x64 binaries
bobv
parents:
32229
diff
changeset
|
226 |
|
c1ee09fe3274
8136556: Add the ability to perform static builds of MacOSX x64 binaries
bobv
parents:
32229
diff
changeset
|
227 |
$(JAVA_BASE_EXPORT_SYMBOL_FILE): $(JAVA_BASE_EXPORT_SYMBOLS_SRC) |
35241 | 228 |
$(call LogInfo, Generating java.base.symbols file) |
33653
c1ee09fe3274
8136556: Add the ability to perform static builds of MacOSX x64 binaries
bobv
parents:
32229
diff
changeset
|
229 |
$(CAT) $^ > $@ |
c1ee09fe3274
8136556: Add the ability to perform static builds of MacOSX x64 binaries
bobv
parents:
32229
diff
changeset
|
230 |
|
c1ee09fe3274
8136556: Add the ability to perform static builds of MacOSX x64 binaries
bobv
parents:
32229
diff
changeset
|
231 |
# The individual symbol files is generated when the respective lib is built |
c1ee09fe3274
8136556: Add the ability to perform static builds of MacOSX x64 binaries
bobv
parents:
32229
diff
changeset
|
232 |
$(JAVA_BASE_EXPORT_SYMBOLS_SRC): $(BUILD_LIBJLI) $(BUILD_LIBJAVA) \ |
33657
71caffb7dba4
8140396: BUILD_LIBJIMAGE missing as a dependency to JAVA_BASE_EXPORT_SYMBOLS_SRC
bobv
parents:
33653
diff
changeset
|
233 |
$(BUILD_LIBNET) $(BUILD_LIBNIO) $(BUILD_LIBVERIFY) $(BUILD_LIBZIP) \ |
71caffb7dba4
8140396: BUILD_LIBJIMAGE missing as a dependency to JAVA_BASE_EXPORT_SYMBOLS_SRC
bobv
parents:
33653
diff
changeset
|
234 |
$(BUILD_LIBJIMAGE) |
33653
c1ee09fe3274
8136556: Add the ability to perform static builds of MacOSX x64 binaries
bobv
parents:
32229
diff
changeset
|
235 |
|
c1ee09fe3274
8136556: Add the ability to perform static builds of MacOSX x64 binaries
bobv
parents:
32229
diff
changeset
|
236 |
TARGETS += $(JAVA_BASE_EXPORT_SYMBOL_FILE) |
c1ee09fe3274
8136556: Add the ability to perform static builds of MacOSX x64 binaries
bobv
parents:
32229
diff
changeset
|
237 |
endif |