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