author | ihse |
Thu, 20 Sep 2018 22:01:12 +0200 | |
branch | ihse-cflags-rewrite-branch |
changeset 56900 | d5d542d50e3c |
parent 56732 | 298e0b8056a3 |
parent 51825 | e3632b4706c4 |
child 58665 | 30a5049a36bb |
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), \ |
56726 | 46 |
DISABLED_WARNINGS_gcc := format-nonliteral logical-op, \ |
49252 | 47 |
DISABLED_WARNINGS_clang := parentheses-equality constant-logical-operand, \ |
48 |
DISABLED_WARNINGS_microsoft := 4244 4047 4133 4996, \ |
|
49 |
DISABLED_WARNINGS_solstudio := E_ARG_INCOMPATIBLE_WITH_ARG_L, \ |
|
50 |
LDFLAGS := $(LDFLAGS_JDKLIB) \ |
|
51 |
$(call SET_SHARED_LIBRARY_ORIGIN), \ |
|
52 |
LDFLAGS_windows := -delayload:secur32.dll -delayload:iphlpapi.dll, \ |
|
53 |
LIBS_unix := -ljvm -ljava, \ |
|
54 |
LIBS_linux := $(LIBDL) -lpthread, \ |
|
55 |
LIBS_solaris := -lnsl -lsocket $(LIBDL), \ |
|
56 |
LIBS_aix := $(LIBDL),\ |
|
57 |
LIBS_windows := ws2_32.lib jvm.lib secur32.lib iphlpapi.lib winhttp.lib \ |
|
58 |
delayimp.lib $(WIN_JAVA_LIB) advapi32.lib, \ |
|
59 |
LIBS_macosx := -framework CoreFoundation -framework CoreServices, \ |
|
60 |
)) |
|
61 |
||
62 |
$(BUILD_LIBNET): $(BUILD_LIBJAVA) |
|
63 |
||
64 |
TARGETS += $(BUILD_LIBNET) |
|
65 |
||
66 |
################################################################################ |
|
67 |
# Create the nio library |
|
68 |
||
69 |
$(eval $(call SetupJdkLibrary, BUILD_LIBNIO, \ |
|
70 |
NAME := nio, \ |
|
71 |
OPTIMIZATION := HIGH, \ |
|
72 |
WARNINGS_AS_ERRORS_xlc := false, \ |
|
50471
f0aeede1b855
8204572: SetupJdkLibrary should setup SRC and -I flags automatically
ihse
parents:
49561
diff
changeset
|
73 |
CFLAGS := $(CFLAGS_JDKLIB), \ |
56732 | 74 |
DISABLED_WARNINGS_gcc := format-nonliteral logical-op, \ |
50471
f0aeede1b855
8204572: SetupJdkLibrary should setup SRC and -I flags automatically
ihse
parents:
49561
diff
changeset
|
75 |
EXTRA_HEADER_DIRS := \ |
f0aeede1b855
8204572: SetupJdkLibrary should setup SRC and -I flags automatically
ihse
parents:
49561
diff
changeset
|
76 |
libnio/ch \ |
f0aeede1b855
8204572: SetupJdkLibrary should setup SRC and -I flags automatically
ihse
parents:
49561
diff
changeset
|
77 |
libnio/fs \ |
f0aeede1b855
8204572: SetupJdkLibrary should setup SRC and -I flags automatically
ihse
parents:
49561
diff
changeset
|
78 |
libnet, \ |
49252 | 79 |
LDFLAGS := $(LDFLAGS_JDKLIB) \ |
80 |
$(call SET_SHARED_LIBRARY_ORIGIN), \ |
|
81 |
LIBS_unix := -ljava -lnet, \ |
|
82 |
LIBS_linux := -lpthread $(LIBDL), \ |
|
83 |
LIBS_solaris := -ljvm -lsocket -lposix4 $(LIBDL) \ |
|
84 |
-lsendfile, \ |
|
85 |
LIBS_aix := $(LIBDL), \ |
|
86 |
LIBS_macosx := \ |
|
87 |
-framework CoreFoundation -framework CoreServices, \ |
|
88 |
LIBS_windows := jvm.lib ws2_32.lib $(WIN_JAVA_LIB) \ |
|
89 |
$(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libnet/net.lib \ |
|
90 |
advapi32.lib, \ |
|
91 |
)) |
|
92 |
||
93 |
TARGETS += $(BUILD_LIBNIO) |
|
94 |
||
95 |
$(BUILD_LIBNIO): $(BUILD_LIBNET) |
|
96 |
||
97 |
################################################################################ |
|
98 |
# Create the macosx security library |
|
99 |
||
100 |
ifeq ($(OPENJDK_TARGET_OS), macosx) |
|
101 |
# JavaNativeFoundation framework not supported in static builds |
|
102 |
ifneq ($(STATIC_BUILD), true) |
|
103 |
||
104 |
$(eval $(call SetupJdkLibrary, BUILD_LIBOSXSECURITY, \ |
|
105 |
NAME := osxsecurity, \ |
|
106 |
OPTIMIZATION := LOW, \ |
|
50471
f0aeede1b855
8204572: SetupJdkLibrary should setup SRC and -I flags automatically
ihse
parents:
49561
diff
changeset
|
107 |
CFLAGS := $(CFLAGS_JDKLIB), \ |
49252 | 108 |
DISABLED_WARNINGS_clang := deprecated-declarations, \ |
109 |
LDFLAGS := $(LDFLAGS_JDKLIB) \ |
|
110 |
-L$(SUPPORT_OUTPUTDIR)/modules_libs/java.base \ |
|
111 |
$(call SET_SHARED_LIBRARY_ORIGIN) \ |
|
112 |
-fobjc-link-runtime, \ |
|
113 |
LIBS := \ |
|
114 |
-framework JavaNativeFoundation \ |
|
115 |
-framework CoreServices \ |
|
116 |
-framework Security \ |
|
117 |
$(JDKLIB_LIBS), \ |
|
118 |
)) |
|
119 |
||
120 |
$(BUILD_LIBOSXSECURITY): $(BUILD_LIBJAVA) |
|
121 |
||
122 |
TARGETS += $(BUILD_LIBOSXSECURITY) |
|
123 |
||
124 |
endif |
|
125 |
endif |
|
126 |
||
127 |
################################################################################ |
|
49423 | 128 |
# Create the jsig library |
129 |
||
49561 | 130 |
ifeq ($(OPENJDK_TARGET_OS_TYPE), unix) |
49423 | 131 |
ifeq ($(STATIC_BUILD), false) |
132 |
$(eval $(call SetupJdkLibrary, BUILD_LIBJSIG, \ |
|
133 |
NAME := jsig, \ |
|
49440 | 134 |
CFLAGS := $(CFLAGS_JDKLIB) $(LIBJSIG_CFLAGS), \ |
49423 | 135 |
LDFLAGS := $(LDFLAGS_JDKLIB) \ |
136 |
$(call SET_SHARED_LIBRARY_ORIGIN), \ |
|
137 |
LIBS_linux := $(LIBDL), \ |
|
138 |
LIBS_solaris := $(LIBDL), \ |
|
139 |
LIBS_aix := $(LIBDL), \ |
|
140 |
)) |
|
141 |
||
142 |
TARGETS += $(BUILD_LIBJSIG) |
|
143 |
||
144 |
############################################################################ |
|
145 |
# Create symlinks to libjsig in each JVM variant sub dir |
|
146 |
LIB_OUTPUTDIR := $(call FindLibDirForModule, java.base) |
|
147 |
||
148 |
# $1 variant subdir |
|
149 |
define CreateSymlinks |
|
150 |
# Always symlink from libdir/variant/libjsig.so -> ../libjsig.so. |
|
151 |
$(LIB_OUTPUTDIR)/$1/$(call SHARED_LIBRARY,jsig): \ |
|
152 |
$(LIB_OUTPUTDIR)/$(call SHARED_LIBRARY,jsig) |
|
153 |
$$(call MakeDir, $$(@D)) |
|
154 |
$(RM) $$@ |
|
155 |
$(LN) -s ../$$(@F) $$@ |
|
156 |
||
157 |
TARGETS += $(LIB_OUTPUTDIR)/$1/$(call SHARED_LIBRARY,jsig) |
|
158 |
endef |
|
159 |
||
160 |
# The subdir is the same as the variant for client and minimal, for all |
|
161 |
# others it's server. |
|
162 |
VARIANT_SUBDIRS := $(filter client minimal, $(JVM_VARIANTS)) \ |
|
163 |
$(if $(filter-out client minimal, $(JVM_VARIANTS)), server) |
|
164 |
$(foreach v, $(VARIANT_SUBDIRS), $(eval $(call CreateSymlinks,$v))) |
|
165 |
||
166 |
############################################################################ |
|
167 |
||
168 |
endif |
|
169 |
endif |
|
170 |
||
171 |
################################################################################ |
|
49252 | 172 |
# 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
|
173 |
|
c1ee09fe3274
8136556: Add the ability to perform static builds of MacOSX x64 binaries
bobv
parents:
32229
diff
changeset
|
174 |
ifeq ($(STATIC_BUILD), true) |
c1ee09fe3274
8136556: Add the ability to perform static builds of MacOSX x64 binaries
bobv
parents:
32229
diff
changeset
|
175 |
JAVA_BASE_EXPORT_SYMBOLS_SRC := \ |
51825
e3632b4706c4
8210931: JLI and launchers normalization and cleanup
ihse
parents:
51730
diff
changeset
|
176 |
$(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
|
177 |
$(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
|
178 |
$(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
|
179 |
$(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
|
180 |
$(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
|
181 |
$(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
|
182 |
$(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
|
183 |
$(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
|
184 |
# |
c1ee09fe3274
8136556: Add the ability to perform static builds of MacOSX x64 binaries
bobv
parents:
32229
diff
changeset
|
185 |
|
c1ee09fe3274
8136556: Add the ability to perform static builds of MacOSX x64 binaries
bobv
parents:
32229
diff
changeset
|
186 |
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
|
187 |
|
c1ee09fe3274
8136556: Add the ability to perform static builds of MacOSX x64 binaries
bobv
parents:
32229
diff
changeset
|
188 |
$(JAVA_BASE_EXPORT_SYMBOL_FILE): $(JAVA_BASE_EXPORT_SYMBOLS_SRC) |
35241 | 189 |
$(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
|
190 |
$(CAT) $^ > $@ |
c1ee09fe3274
8136556: Add the ability to perform static builds of MacOSX x64 binaries
bobv
parents:
32229
diff
changeset
|
191 |
|
c1ee09fe3274
8136556: Add the ability to perform static builds of MacOSX x64 binaries
bobv
parents:
32229
diff
changeset
|
192 |
# 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
|
193 |
$(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
|
194 |
$(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
|
195 |
$(BUILD_LIBJIMAGE) |
33653
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 |
TARGETS += $(JAVA_BASE_EXPORT_SYMBOL_FILE) |
c1ee09fe3274
8136556: Add the ability to perform static builds of MacOSX x64 binaries
bobv
parents:
32229
diff
changeset
|
198 |
endif |
51730 | 199 |
|
200 |
################################################################################ |
|
201 |
# Copy tzmappings file for Windows |
|
202 |
||
203 |
ifeq ($(OPENJDK_TARGET_OS), windows) |
|
204 |
$(eval $(call SetupCopyFiles, COPY_TZMAPPINGS, \ |
|
205 |
FILES := $(SUPPORT_OUTPUTDIR)/gensrc/java.base/windows/conf/tzmappings, \ |
|
206 |
DEST := $(call FindLibDirForModule, $(MODULE)), \ |
|
207 |
)) |
|
208 |
TARGETS += $(COPY_TZMAPPINGS) |
|
51825
e3632b4706c4
8210931: JLI and launchers normalization and cleanup
ihse
parents:
51730
diff
changeset
|
209 |
endif |