31 # Prepare the find cache. |
31 # Prepare the find cache. |
32 LIB_java.base_SRC_DIRS += $(TOPDIR)/src/java.base/*/native |
32 LIB_java.base_SRC_DIRS += $(TOPDIR)/src/java.base/*/native |
33 |
33 |
34 $(eval $(call FillCacheFind, $(wildcard $(LIB_java.base_SRC_DIRS)))) |
34 $(eval $(call FillCacheFind, $(wildcard $(LIB_java.base_SRC_DIRS)))) |
35 |
35 |
|
36 ################################################################################ |
|
37 # Create all the core libraries |
|
38 |
36 include CoreLibraries.gmk |
39 include CoreLibraries.gmk |
37 include NetworkingLibraries.gmk |
40 |
38 include NioLibraries.gmk |
41 ################################################################################ |
39 include SecurityLibraries.gmk |
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 MAPFILE := $(TOPDIR)/make/mapfiles/libnet/mapfile-vers, \ |
|
57 LDFLAGS := $(LDFLAGS_JDKLIB) \ |
|
58 $(call SET_SHARED_LIBRARY_ORIGIN), \ |
|
59 LDFLAGS_windows := -delayload:secur32.dll -delayload:iphlpapi.dll, \ |
|
60 LIBS_unix := -ljvm -ljava, \ |
|
61 LIBS_linux := $(LIBDL) -lpthread, \ |
|
62 LIBS_solaris := -lnsl -lsocket $(LIBDL), \ |
|
63 LIBS_aix := $(LIBDL),\ |
|
64 LIBS_windows := ws2_32.lib jvm.lib secur32.lib iphlpapi.lib winhttp.lib \ |
|
65 delayimp.lib $(WIN_JAVA_LIB) advapi32.lib, \ |
|
66 LIBS_macosx := -framework CoreFoundation -framework CoreServices, \ |
|
67 )) |
|
68 |
|
69 $(BUILD_LIBNET): $(BUILD_LIBJAVA) |
|
70 |
|
71 TARGETS += $(BUILD_LIBNET) |
|
72 |
|
73 ################################################################################ |
|
74 # Create the nio library |
|
75 |
|
76 BUILD_LIBNIO_SRC := \ |
|
77 $(TOPDIR)/src/java.base/share/native/libnio \ |
|
78 $(TOPDIR)/src/java.base/share/native/libnio/ch \ |
|
79 $(TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libnio \ |
|
80 $(sort $(wildcard \ |
|
81 $(TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libnio/ch \ |
|
82 $(TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libnio/fs \ |
|
83 $(TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS)/native/libnio/ch \ |
|
84 $(TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS)/native/libnio/fs)) \ |
|
85 # |
|
86 |
|
87 BUILD_LIBNIO_CFLAGS := \ |
|
88 $(addprefix -I, $(BUILD_LIBNIO_SRC)) \ |
|
89 -I$(SUPPORT_OUTPUTDIR)/headers/java.base \ |
|
90 $(LIBJAVA_HEADER_FLAGS) \ |
|
91 $(addprefix -I, $(BUILD_LIBNET_SRC)) |
|
92 |
|
93 ifeq ($(OPENJDK_TARGET_OS), linux) |
|
94 BUILD_LIBNIO_MAPFILE := $(TOPDIR)/make/mapfiles/libnio/mapfile-$(OPENJDK_TARGET_OS) |
|
95 endif |
|
96 |
|
97 ifeq ($(OPENJDK_TARGET_OS), macosx) |
|
98 BUILD_LIBNIO_MAPFILE := $(TOPDIR)/make/mapfiles/libnio/mapfile-$(OPENJDK_TARGET_OS) |
|
99 endif |
|
100 |
|
101 ifeq ($(OPENJDK_TARGET_OS), solaris) |
|
102 BUILD_LIBNIO_MAPFILE := $(TOPDIR)/make/mapfiles/libnio/mapfile-$(OPENJDK_TARGET_OS) |
|
103 endif |
|
104 |
|
105 ifeq ($(OPENJDK_TARGET_OS), aix) |
|
106 BUILD_LIBNIO_MAPFILE := $(TOPDIR)/make/mapfiles/libnio/mapfile-$(OPENJDK_TARGET_OS) |
|
107 endif |
|
108 |
|
109 $(eval $(call SetupJdkLibrary, BUILD_LIBNIO, \ |
|
110 NAME := nio, \ |
|
111 SRC := $(BUILD_LIBNIO_SRC), \ |
|
112 EXCLUDE_FILES := $(BUILD_LIBNIO_EXFILES), \ |
|
113 OPTIMIZATION := HIGH, \ |
|
114 WARNINGS_AS_ERRORS_xlc := false, \ |
|
115 CFLAGS := $(CFLAGS_JDKLIB) \ |
|
116 $(BUILD_LIBNIO_CFLAGS), \ |
|
117 MAPFILE := $(BUILD_LIBNIO_MAPFILE), \ |
|
118 LDFLAGS := $(LDFLAGS_JDKLIB) \ |
|
119 $(call SET_SHARED_LIBRARY_ORIGIN), \ |
|
120 LIBS_unix := -ljava -lnet, \ |
|
121 LIBS_linux := -lpthread $(LIBDL), \ |
|
122 LIBS_solaris := -ljvm -lsocket -lposix4 $(LIBDL) \ |
|
123 -lsendfile, \ |
|
124 LIBS_aix := $(LIBDL), \ |
|
125 LIBS_macosx := \ |
|
126 -framework CoreFoundation -framework CoreServices, \ |
|
127 LIBS_windows := jvm.lib ws2_32.lib $(WIN_JAVA_LIB) \ |
|
128 $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libnet/net.lib \ |
|
129 advapi32.lib, \ |
|
130 )) |
|
131 |
|
132 TARGETS += $(BUILD_LIBNIO) |
|
133 |
|
134 $(BUILD_LIBNIO): $(BUILD_LIBNET) |
|
135 |
|
136 ################################################################################ |
|
137 # Create the macosx security library |
|
138 |
|
139 ifeq ($(OPENJDK_TARGET_OS), macosx) |
|
140 # JavaNativeFoundation framework not supported in static builds |
|
141 ifneq ($(STATIC_BUILD), true) |
|
142 |
|
143 LIBOSXSECURITY_DIRS := $(TOPDIR)/src/java.base/macosx/native/libosxsecurity |
|
144 LIBOSXSECURITY_CFLAGS := -I$(LIBOSXSECURITY_DIRS) \ |
|
145 $(LIBJAVA_HEADER_FLAGS) \ |
|
146 -I$(SUPPORT_OUTPUTDIR)/headers/java.base \ |
|
147 |
|
148 $(eval $(call SetupJdkLibrary, BUILD_LIBOSXSECURITY, \ |
|
149 NAME := osxsecurity, \ |
|
150 SRC := $(LIBOSXSECURITY_DIRS), \ |
|
151 OPTIMIZATION := LOW, \ |
|
152 CFLAGS := $(CFLAGS_JDKLIB) \ |
|
153 $(LIBOSXSECURITY_CFLAGS), \ |
|
154 DISABLED_WARNINGS_clang := deprecated-declarations, \ |
|
155 LDFLAGS := $(LDFLAGS_JDKLIB) \ |
|
156 -L$(SUPPORT_OUTPUTDIR)/modules_libs/java.base \ |
|
157 $(call SET_SHARED_LIBRARY_ORIGIN) \ |
|
158 -fobjc-link-runtime, \ |
|
159 LIBS := \ |
|
160 -framework JavaNativeFoundation \ |
|
161 -framework CoreServices \ |
|
162 -framework Security \ |
|
163 $(JDKLIB_LIBS), \ |
|
164 )) |
|
165 |
|
166 $(BUILD_LIBOSXSECURITY): $(BUILD_LIBJAVA) |
|
167 |
|
168 TARGETS += $(BUILD_LIBOSXSECURITY) |
|
169 |
|
170 endif |
|
171 endif |
|
172 |
|
173 ################################################################################ |
|
174 # Create the symbols file for static builds. |
40 |
175 |
41 ifeq ($(STATIC_BUILD), true) |
176 ifeq ($(STATIC_BUILD), true) |
42 JAVA_BASE_EXPORT_SYMBOLS_SRC := \ |
177 JAVA_BASE_EXPORT_SYMBOLS_SRC := \ |
43 $(SUPPORT_OUTPUTDIR)/modules_libs/java.base/jli/$(LIBRARY_PREFIX)jli.symbols \ |
178 $(SUPPORT_OUTPUTDIR)/modules_libs/java.base/jli/$(LIBRARY_PREFIX)jli.symbols \ |
44 $(SUPPORT_OUTPUTDIR)/modules_libs/java.base/$(LIBRARY_PREFIX)java.symbols \ |
179 $(SUPPORT_OUTPUTDIR)/modules_libs/java.base/$(LIBRARY_PREFIX)java.symbols \ |