author | kvn |
Mon, 24 Sep 2018 16:37:28 -0700 | |
changeset 51857 | 9978fea8a371 |
parent 51853 | ec62d6cab037 |
child 53328 | dff86e25073f |
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. |
50471
f0aeede1b855
8204572: SetupJdkLibrary should setup SRC and -I flags automatically
ihse
parents:
49561
diff
changeset
|
32 |
$(eval $(call FillCacheFind, $(wildcard $(TOPDIR)/src/java.base/*/native))) |
26192
33b90e93e3bf
8055095: Improve "do nothing" incremental build performance after modularized source code integration
erikj
parents:
25859
diff
changeset
|
33 |
|
49252 | 34 |
################################################################################ |
35 |
# Create all the core libraries |
|
36 |
||
25859 | 37 |
include CoreLibraries.gmk |
49252 | 38 |
|
39 |
################################################################################ |
|
40 |
# Create the network library |
|
41 |
||
42 |
$(eval $(call SetupJdkLibrary, BUILD_LIBNET, \ |
|
43 |
NAME := net, \ |
|
44 |
OPTIMIZATION := LOW, \ |
|
50471
f0aeede1b855
8204572: SetupJdkLibrary should setup SRC and -I flags automatically
ihse
parents:
49561
diff
changeset
|
45 |
CFLAGS := $(CFLAGS_JDKLIB), \ |
51853
ec62d6cab037
8211029: Have a common set of enabled warnings for all native libraries
ihse
parents:
51849
diff
changeset
|
46 |
DISABLED_WARNINGS_gcc := format-nonliteral unused-function, \ |
ec62d6cab037
8211029: Have a common set of enabled warnings for all native libraries
ihse
parents:
51849
diff
changeset
|
47 |
DISABLED_WARNINGS_clang := parentheses-equality constant-logical-operand \ |
ec62d6cab037
8211029: Have a common set of enabled warnings for all native libraries
ihse
parents:
51849
diff
changeset
|
48 |
format-nonliteral undef, \ |
49252 | 49 |
DISABLED_WARNINGS_microsoft := 4244 4047 4133 4996, \ |
50 |
DISABLED_WARNINGS_solstudio := E_ARG_INCOMPATIBLE_WITH_ARG_L, \ |
|
51 |
LDFLAGS := $(LDFLAGS_JDKLIB) \ |
|
52 |
$(call SET_SHARED_LIBRARY_ORIGIN), \ |
|
53 |
LDFLAGS_windows := -delayload:secur32.dll -delayload:iphlpapi.dll, \ |
|
54 |
LIBS_unix := -ljvm -ljava, \ |
|
55 |
LIBS_linux := $(LIBDL) -lpthread, \ |
|
56 |
LIBS_solaris := -lnsl -lsocket $(LIBDL), \ |
|
57 |
LIBS_aix := $(LIBDL),\ |
|
58 |
LIBS_windows := ws2_32.lib jvm.lib secur32.lib iphlpapi.lib winhttp.lib \ |
|
59 |
delayimp.lib $(WIN_JAVA_LIB) advapi32.lib, \ |
|
60 |
LIBS_macosx := -framework CoreFoundation -framework CoreServices, \ |
|
61 |
)) |
|
62 |
||
63 |
$(BUILD_LIBNET): $(BUILD_LIBJAVA) |
|
64 |
||
65 |
TARGETS += $(BUILD_LIBNET) |
|
66 |
||
67 |
################################################################################ |
|
68 |
# Create the nio library |
|
69 |
||
70 |
$(eval $(call SetupJdkLibrary, BUILD_LIBNIO, \ |
|
71 |
NAME := nio, \ |
|
72 |
OPTIMIZATION := HIGH, \ |
|
73 |
WARNINGS_AS_ERRORS_xlc := false, \ |
|
50471
f0aeede1b855
8204572: SetupJdkLibrary should setup SRC and -I flags automatically
ihse
parents:
49561
diff
changeset
|
74 |
CFLAGS := $(CFLAGS_JDKLIB), \ |
51853
ec62d6cab037
8211029: Have a common set of enabled warnings for all native libraries
ihse
parents:
51849
diff
changeset
|
75 |
DISABLED_WARNINGS_gcc := undef, \ |
ec62d6cab037
8211029: Have a common set of enabled warnings for all native libraries
ihse
parents:
51849
diff
changeset
|
76 |
DISABLED_WARNINGS_clang := undef, \ |
50471
f0aeede1b855
8204572: SetupJdkLibrary should setup SRC and -I flags automatically
ihse
parents:
49561
diff
changeset
|
77 |
EXTRA_HEADER_DIRS := \ |
f0aeede1b855
8204572: SetupJdkLibrary should setup SRC and -I flags automatically
ihse
parents:
49561
diff
changeset
|
78 |
libnio/ch \ |
f0aeede1b855
8204572: SetupJdkLibrary should setup SRC and -I flags automatically
ihse
parents:
49561
diff
changeset
|
79 |
libnio/fs \ |
f0aeede1b855
8204572: SetupJdkLibrary should setup SRC and -I flags automatically
ihse
parents:
49561
diff
changeset
|
80 |
libnet, \ |
49252 | 81 |
LDFLAGS := $(LDFLAGS_JDKLIB) \ |
82 |
$(call SET_SHARED_LIBRARY_ORIGIN), \ |
|
83 |
LIBS_unix := -ljava -lnet, \ |
|
84 |
LIBS_linux := -lpthread $(LIBDL), \ |
|
85 |
LIBS_solaris := -ljvm -lsocket -lposix4 $(LIBDL) \ |
|
86 |
-lsendfile, \ |
|
87 |
LIBS_aix := $(LIBDL), \ |
|
88 |
LIBS_macosx := \ |
|
89 |
-framework CoreFoundation -framework CoreServices, \ |
|
90 |
LIBS_windows := jvm.lib ws2_32.lib $(WIN_JAVA_LIB) \ |
|
91 |
$(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libnet/net.lib \ |
|
92 |
advapi32.lib, \ |
|
93 |
)) |
|
94 |
||
95 |
TARGETS += $(BUILD_LIBNIO) |
|
96 |
||
97 |
$(BUILD_LIBNIO): $(BUILD_LIBNET) |
|
98 |
||
99 |
################################################################################ |
|
100 |
# Create the macosx security library |
|
101 |
||
102 |
ifeq ($(OPENJDK_TARGET_OS), macosx) |
|
103 |
# JavaNativeFoundation framework not supported in static builds |
|
104 |
ifneq ($(STATIC_BUILD), true) |
|
105 |
||
106 |
$(eval $(call SetupJdkLibrary, BUILD_LIBOSXSECURITY, \ |
|
107 |
NAME := osxsecurity, \ |
|
108 |
OPTIMIZATION := LOW, \ |
|
50471
f0aeede1b855
8204572: SetupJdkLibrary should setup SRC and -I flags automatically
ihse
parents:
49561
diff
changeset
|
109 |
CFLAGS := $(CFLAGS_JDKLIB), \ |
51853
ec62d6cab037
8211029: Have a common set of enabled warnings for all native libraries
ihse
parents:
51849
diff
changeset
|
110 |
DISABLED_WARNINGS_clang := deprecated-declarations \ |
ec62d6cab037
8211029: Have a common set of enabled warnings for all native libraries
ihse
parents:
51849
diff
changeset
|
111 |
missing-method-return-type, \ |
49252 | 112 |
LDFLAGS := $(LDFLAGS_JDKLIB) \ |
113 |
-L$(SUPPORT_OUTPUTDIR)/modules_libs/java.base \ |
|
114 |
$(call SET_SHARED_LIBRARY_ORIGIN) \ |
|
115 |
-fobjc-link-runtime, \ |
|
116 |
LIBS := \ |
|
117 |
-framework JavaNativeFoundation \ |
|
118 |
-framework CoreServices \ |
|
119 |
-framework Security \ |
|
120 |
$(JDKLIB_LIBS), \ |
|
121 |
)) |
|
122 |
||
123 |
$(BUILD_LIBOSXSECURITY): $(BUILD_LIBJAVA) |
|
124 |
||
125 |
TARGETS += $(BUILD_LIBOSXSECURITY) |
|
126 |
||
127 |
endif |
|
128 |
endif |
|
129 |
||
130 |
################################################################################ |
|
49423 | 131 |
# Create the jsig library |
132 |
||
49561 | 133 |
ifeq ($(OPENJDK_TARGET_OS_TYPE), unix) |
49423 | 134 |
ifeq ($(STATIC_BUILD), false) |
135 |
$(eval $(call SetupJdkLibrary, BUILD_LIBJSIG, \ |
|
136 |
NAME := jsig, \ |
|
51849
4010c90156d1
8210761: libjsig is being compiled without optimization
sgehwolf
parents:
51825
diff
changeset
|
137 |
OPTIMIZATION := LOW, \ |
49440 | 138 |
CFLAGS := $(CFLAGS_JDKLIB) $(LIBJSIG_CFLAGS), \ |
51853
ec62d6cab037
8211029: Have a common set of enabled warnings for all native libraries
ihse
parents:
51849
diff
changeset
|
139 |
DISABLED_WARNINGS_gcc := undef, \ |
49423 | 140 |
LDFLAGS := $(LDFLAGS_JDKLIB) \ |
141 |
$(call SET_SHARED_LIBRARY_ORIGIN), \ |
|
142 |
LIBS_linux := $(LIBDL), \ |
|
143 |
LIBS_solaris := $(LIBDL), \ |
|
144 |
LIBS_aix := $(LIBDL), \ |
|
145 |
)) |
|
146 |
||
147 |
TARGETS += $(BUILD_LIBJSIG) |
|
148 |
||
149 |
############################################################################ |
|
150 |
# Create symlinks to libjsig in each JVM variant sub dir |
|
151 |
LIB_OUTPUTDIR := $(call FindLibDirForModule, java.base) |
|
152 |
||
153 |
# $1 variant subdir |
|
154 |
define CreateSymlinks |
|
155 |
# Always symlink from libdir/variant/libjsig.so -> ../libjsig.so. |
|
156 |
$(LIB_OUTPUTDIR)/$1/$(call SHARED_LIBRARY,jsig): \ |
|
157 |
$(LIB_OUTPUTDIR)/$(call SHARED_LIBRARY,jsig) |
|
158 |
$$(call MakeDir, $$(@D)) |
|
159 |
$(RM) $$@ |
|
160 |
$(LN) -s ../$$(@F) $$@ |
|
161 |
||
162 |
TARGETS += $(LIB_OUTPUTDIR)/$1/$(call SHARED_LIBRARY,jsig) |
|
163 |
endef |
|
164 |
||
165 |
# The subdir is the same as the variant for client and minimal, for all |
|
166 |
# others it's server. |
|
167 |
VARIANT_SUBDIRS := $(filter client minimal, $(JVM_VARIANTS)) \ |
|
168 |
$(if $(filter-out client minimal, $(JVM_VARIANTS)), server) |
|
169 |
$(foreach v, $(VARIANT_SUBDIRS), $(eval $(call CreateSymlinks,$v))) |
|
170 |
||
171 |
############################################################################ |
|
172 |
||
173 |
endif |
|
174 |
endif |
|
175 |
||
176 |
################################################################################ |
|
49252 | 177 |
# 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
|
178 |
|
c1ee09fe3274
8136556: Add the ability to perform static builds of MacOSX x64 binaries
bobv
parents:
32229
diff
changeset
|
179 |
ifeq ($(STATIC_BUILD), true) |
c1ee09fe3274
8136556: Add the ability to perform static builds of MacOSX x64 binaries
bobv
parents:
32229
diff
changeset
|
180 |
JAVA_BASE_EXPORT_SYMBOLS_SRC := \ |
51825
e3632b4706c4
8210931: JLI and launchers normalization and cleanup
ihse
parents:
51730
diff
changeset
|
181 |
$(SUPPORT_OUTPUTDIR)/modules_libs/java.base/$(LIBRARY_PREFIX)jli.symbols \ |
33653
c1ee09fe3274
8136556: Add the ability to perform static builds of MacOSX x64 binaries
bobv
parents:
32229
diff
changeset
|
182 |
$(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
|
183 |
$(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
|
184 |
$(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
|
185 |
$(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
|
186 |
$(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
|
187 |
$(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
|
188 |
$(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
|
189 |
# |
c1ee09fe3274
8136556: Add the ability to perform static builds of MacOSX x64 binaries
bobv
parents:
32229
diff
changeset
|
190 |
|
c1ee09fe3274
8136556: Add the ability to perform static builds of MacOSX x64 binaries
bobv
parents:
32229
diff
changeset
|
191 |
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
|
192 |
|
c1ee09fe3274
8136556: Add the ability to perform static builds of MacOSX x64 binaries
bobv
parents:
32229
diff
changeset
|
193 |
$(JAVA_BASE_EXPORT_SYMBOL_FILE): $(JAVA_BASE_EXPORT_SYMBOLS_SRC) |
35241 | 194 |
$(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
|
195 |
$(CAT) $^ > $@ |
c1ee09fe3274
8136556: Add the ability to perform static builds of MacOSX x64 binaries
bobv
parents:
32229
diff
changeset
|
196 |
|
c1ee09fe3274
8136556: Add the ability to perform static builds of MacOSX x64 binaries
bobv
parents:
32229
diff
changeset
|
197 |
# 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
|
198 |
$(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
|
199 |
$(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
|
200 |
$(BUILD_LIBJIMAGE) |
33653
c1ee09fe3274
8136556: Add the ability to perform static builds of MacOSX x64 binaries
bobv
parents:
32229
diff
changeset
|
201 |
|
c1ee09fe3274
8136556: Add the ability to perform static builds of MacOSX x64 binaries
bobv
parents:
32229
diff
changeset
|
202 |
TARGETS += $(JAVA_BASE_EXPORT_SYMBOL_FILE) |
c1ee09fe3274
8136556: Add the ability to perform static builds of MacOSX x64 binaries
bobv
parents:
32229
diff
changeset
|
203 |
endif |
51730 | 204 |
|
205 |
################################################################################ |
|
206 |
# Copy tzmappings file for Windows |
|
207 |
||
208 |
ifeq ($(OPENJDK_TARGET_OS), windows) |
|
209 |
$(eval $(call SetupCopyFiles, COPY_TZMAPPINGS, \ |
|
210 |
FILES := $(SUPPORT_OUTPUTDIR)/gensrc/java.base/windows/conf/tzmappings, \ |
|
211 |
DEST := $(call FindLibDirForModule, $(MODULE)), \ |
|
212 |
)) |
|
213 |
TARGETS += $(COPY_TZMAPPINGS) |
|
51825
e3632b4706c4
8210931: JLI and launchers normalization and cleanup
ihse
parents:
51730
diff
changeset
|
214 |
endif |