author | ihse |
Mon, 16 Apr 2018 11:48:41 +0200 | |
branch | ihse-jdk-library-branch |
changeset 56433 | c3cf838aa2da |
parent 49561 | a0f22265e29c |
child 56454 | 82c3ae69914f |
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 |
OPTIMIZATION := LOW, \ |
|
56433
c3cf838aa2da
Initial fix for setting SRC automatically + HEADER_FLAGS.
ihse
parents:
49561
diff
changeset
|
49 |
CFLAGS := $(CFLAGS_JDKLIB), \ |
c3cf838aa2da
Initial fix for setting SRC automatically + HEADER_FLAGS.
ihse
parents:
49561
diff
changeset
|
50 |
HEADER_FLAGS := -I$(SUPPORT_OUTPUTDIR)/headers/java.base \ |
c3cf838aa2da
Initial fix for setting SRC automatically + HEADER_FLAGS.
ihse
parents:
49561
diff
changeset
|
51 |
$(LIBJAVA_HEADER_FLAGS), \ |
49252 | 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 |
||
56433
c3cf838aa2da
Initial fix for setting SRC automatically + HEADER_FLAGS.
ihse
parents:
49561
diff
changeset
|
75 |
BUILD_LIBNIO_EXTRA_HEADERS := \ |
c3cf838aa2da
Initial fix for setting SRC automatically + HEADER_FLAGS.
ihse
parents:
49561
diff
changeset
|
76 |
$(call FindSrcDirsForComponent, java.base, libnio/ch) \ |
c3cf838aa2da
Initial fix for setting SRC automatically + HEADER_FLAGS.
ihse
parents:
49561
diff
changeset
|
77 |
$(call FindSrcDirsForComponent, java.base, libnio/fs) \ |
49252 | 78 |
# |
79 |
||
80 |
$(eval $(call SetupJdkLibrary, BUILD_LIBNIO, \ |
|
81 |
NAME := nio, \ |
|
82 |
OPTIMIZATION := HIGH, \ |
|
83 |
WARNINGS_AS_ERRORS_xlc := false, \ |
|
56433
c3cf838aa2da
Initial fix for setting SRC automatically + HEADER_FLAGS.
ihse
parents:
49561
diff
changeset
|
84 |
CFLAGS := $(CFLAGS_JDKLIB), \ |
c3cf838aa2da
Initial fix for setting SRC automatically + HEADER_FLAGS.
ihse
parents:
49561
diff
changeset
|
85 |
HEADER_FLAGS := \ |
c3cf838aa2da
Initial fix for setting SRC automatically + HEADER_FLAGS.
ihse
parents:
49561
diff
changeset
|
86 |
-I$(SUPPORT_OUTPUTDIR)/headers/java.base \ |
c3cf838aa2da
Initial fix for setting SRC automatically + HEADER_FLAGS.
ihse
parents:
49561
diff
changeset
|
87 |
$(LIBJAVA_HEADER_FLAGS) \ |
c3cf838aa2da
Initial fix for setting SRC automatically + HEADER_FLAGS.
ihse
parents:
49561
diff
changeset
|
88 |
$(addprefix -I, $(BUILD_LIBNET_SRC)) \ |
c3cf838aa2da
Initial fix for setting SRC automatically + HEADER_FLAGS.
ihse
parents:
49561
diff
changeset
|
89 |
$(addprefix -I, $(BUILD_LIBNIO_EXTRA_HEADERS)), \ |
49252 | 90 |
LDFLAGS := $(LDFLAGS_JDKLIB) \ |
91 |
$(call SET_SHARED_LIBRARY_ORIGIN), \ |
|
92 |
LIBS_unix := -ljava -lnet, \ |
|
93 |
LIBS_linux := -lpthread $(LIBDL), \ |
|
94 |
LIBS_solaris := -ljvm -lsocket -lposix4 $(LIBDL) \ |
|
95 |
-lsendfile, \ |
|
96 |
LIBS_aix := $(LIBDL), \ |
|
97 |
LIBS_macosx := \ |
|
98 |
-framework CoreFoundation -framework CoreServices, \ |
|
99 |
LIBS_windows := jvm.lib ws2_32.lib $(WIN_JAVA_LIB) \ |
|
100 |
$(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libnet/net.lib \ |
|
101 |
advapi32.lib, \ |
|
102 |
)) |
|
103 |
||
104 |
TARGETS += $(BUILD_LIBNIO) |
|
105 |
||
106 |
$(BUILD_LIBNIO): $(BUILD_LIBNET) |
|
107 |
||
108 |
################################################################################ |
|
109 |
# Create the macosx security library |
|
110 |
||
111 |
ifeq ($(OPENJDK_TARGET_OS), macosx) |
|
112 |
# JavaNativeFoundation framework not supported in static builds |
|
113 |
ifneq ($(STATIC_BUILD), true) |
|
114 |
||
115 |
$(eval $(call SetupJdkLibrary, BUILD_LIBOSXSECURITY, \ |
|
116 |
NAME := osxsecurity, \ |
|
117 |
OPTIMIZATION := LOW, \ |
|
56433
c3cf838aa2da
Initial fix for setting SRC automatically + HEADER_FLAGS.
ihse
parents:
49561
diff
changeset
|
118 |
CFLAGS := $(CFLAGS_JDKLIB), \ |
c3cf838aa2da
Initial fix for setting SRC automatically + HEADER_FLAGS.
ihse
parents:
49561
diff
changeset
|
119 |
HEADER_FLAGS := $(LIBJAVA_HEADER_FLAGS) \ |
c3cf838aa2da
Initial fix for setting SRC automatically + HEADER_FLAGS.
ihse
parents:
49561
diff
changeset
|
120 |
-I$(SUPPORT_OUTPUTDIR)/headers/java.base, \ |
49252 | 121 |
DISABLED_WARNINGS_clang := deprecated-declarations, \ |
122 |
LDFLAGS := $(LDFLAGS_JDKLIB) \ |
|
123 |
-L$(SUPPORT_OUTPUTDIR)/modules_libs/java.base \ |
|
124 |
$(call SET_SHARED_LIBRARY_ORIGIN) \ |
|
125 |
-fobjc-link-runtime, \ |
|
126 |
LIBS := \ |
|
127 |
-framework JavaNativeFoundation \ |
|
128 |
-framework CoreServices \ |
|
129 |
-framework Security \ |
|
130 |
$(JDKLIB_LIBS), \ |
|
131 |
)) |
|
132 |
||
133 |
$(BUILD_LIBOSXSECURITY): $(BUILD_LIBJAVA) |
|
134 |
||
135 |
TARGETS += $(BUILD_LIBOSXSECURITY) |
|
136 |
||
137 |
endif |
|
138 |
endif |
|
139 |
||
140 |
################################################################################ |
|
49423 | 141 |
# Create the jsig library |
142 |
||
49561 | 143 |
ifeq ($(OPENJDK_TARGET_OS_TYPE), unix) |
49423 | 144 |
ifeq ($(STATIC_BUILD), false) |
145 |
||
49445 | 146 |
LIBJSIG_MAPFILE := $(wildcard $(TOPDIR)/make/mapfiles/libjsig/mapfile-vers-$(OPENJDK_TARGET_OS)) |
49440 | 147 |
|
148 |
ifeq ($(OPENJDK_TARGET_OS), linux) |
|
149 |
# FIXME: This is probably not what we want to do, but keep it now for compatibility. |
|
150 |
LIBJSIG_CFLAGS := $(EXPORT_ALL_SYMBOLS) |
|
151 |
endif |
|
49423 | 152 |
|
153 |
$(eval $(call SetupJdkLibrary, BUILD_LIBJSIG, \ |
|
154 |
NAME := jsig, \ |
|
49440 | 155 |
CFLAGS := $(CFLAGS_JDKLIB) $(LIBJSIG_CFLAGS), \ |
49423 | 156 |
LDFLAGS := $(LDFLAGS_JDKLIB) \ |
157 |
$(call SET_SHARED_LIBRARY_ORIGIN), \ |
|
158 |
LIBS_linux := $(LIBDL), \ |
|
159 |
LIBS_solaris := $(LIBDL), \ |
|
160 |
LIBS_aix := $(LIBDL), \ |
|
49445 | 161 |
MAPFILE := $(LIBJSIG_MAPFILE), \ |
49423 | 162 |
)) |
163 |
||
164 |
TARGETS += $(BUILD_LIBJSIG) |
|
165 |
||
166 |
############################################################################ |
|
167 |
# Create symlinks to libjsig in each JVM variant sub dir |
|
168 |
LIB_OUTPUTDIR := $(call FindLibDirForModule, java.base) |
|
169 |
||
170 |
# $1 variant subdir |
|
171 |
define CreateSymlinks |
|
172 |
# Always symlink from libdir/variant/libjsig.so -> ../libjsig.so. |
|
173 |
$(LIB_OUTPUTDIR)/$1/$(call SHARED_LIBRARY,jsig): \ |
|
174 |
$(LIB_OUTPUTDIR)/$(call SHARED_LIBRARY,jsig) |
|
175 |
$$(call MakeDir, $$(@D)) |
|
176 |
$(RM) $$@ |
|
177 |
$(LN) -s ../$$(@F) $$@ |
|
178 |
||
179 |
TARGETS += $(LIB_OUTPUTDIR)/$1/$(call SHARED_LIBRARY,jsig) |
|
180 |
endef |
|
181 |
||
182 |
# The subdir is the same as the variant for client and minimal, for all |
|
183 |
# others it's server. |
|
184 |
VARIANT_SUBDIRS := $(filter client minimal, $(JVM_VARIANTS)) \ |
|
185 |
$(if $(filter-out client minimal, $(JVM_VARIANTS)), server) |
|
186 |
$(foreach v, $(VARIANT_SUBDIRS), $(eval $(call CreateSymlinks,$v))) |
|
187 |
||
188 |
############################################################################ |
|
189 |
||
190 |
endif |
|
191 |
endif |
|
192 |
||
193 |
################################################################################ |
|
49252 | 194 |
# 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
|
195 |
|
c1ee09fe3274
8136556: Add the ability to perform static builds of MacOSX x64 binaries
bobv
parents:
32229
diff
changeset
|
196 |
ifeq ($(STATIC_BUILD), true) |
c1ee09fe3274
8136556: Add the ability to perform static builds of MacOSX x64 binaries
bobv
parents:
32229
diff
changeset
|
197 |
JAVA_BASE_EXPORT_SYMBOLS_SRC := \ |
c1ee09fe3274
8136556: Add the ability to perform static builds of MacOSX x64 binaries
bobv
parents:
32229
diff
changeset
|
198 |
$(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
|
199 |
$(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
|
200 |
$(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
|
201 |
$(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
|
202 |
$(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
|
203 |
$(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
|
204 |
$(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
|
205 |
$(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
|
206 |
# |
c1ee09fe3274
8136556: Add the ability to perform static builds of MacOSX x64 binaries
bobv
parents:
32229
diff
changeset
|
207 |
|
c1ee09fe3274
8136556: Add the ability to perform static builds of MacOSX x64 binaries
bobv
parents:
32229
diff
changeset
|
208 |
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
|
209 |
|
c1ee09fe3274
8136556: Add the ability to perform static builds of MacOSX x64 binaries
bobv
parents:
32229
diff
changeset
|
210 |
$(JAVA_BASE_EXPORT_SYMBOL_FILE): $(JAVA_BASE_EXPORT_SYMBOLS_SRC) |
35241 | 211 |
$(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
|
212 |
$(CAT) $^ > $@ |
c1ee09fe3274
8136556: Add the ability to perform static builds of MacOSX x64 binaries
bobv
parents:
32229
diff
changeset
|
213 |
|
c1ee09fe3274
8136556: Add the ability to perform static builds of MacOSX x64 binaries
bobv
parents:
32229
diff
changeset
|
214 |
# 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
|
215 |
$(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
|
216 |
$(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
|
217 |
$(BUILD_LIBJIMAGE) |
33653
c1ee09fe3274
8136556: Add the ability to perform static builds of MacOSX x64 binaries
bobv
parents:
32229
diff
changeset
|
218 |
|
c1ee09fe3274
8136556: Add the ability to perform static builds of MacOSX x64 binaries
bobv
parents:
32229
diff
changeset
|
219 |
TARGETS += $(JAVA_BASE_EXPORT_SYMBOL_FILE) |
c1ee09fe3274
8136556: Add the ability to perform static builds of MacOSX x64 binaries
bobv
parents:
32229
diff
changeset
|
220 |
endif |