Fri, 24 Jul 2020 14:31:02 +0200
8250627: Use -XX:+/-UseContainerSupport for enabling/disabling Java container metrics
Reviewed-by: aph, dholmes, bobv, shade
ohair@5224 | 1 | # |
simonis@13511 | 2 | # Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved. |
ohair@5224 | 3 | # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
ohair@5224 | 4 | # |
ohair@5224 | 5 | # This code is free software; you can redistribute it and/or modify it |
ohair@5224 | 6 | # under the terms of the GNU General Public License version 2 only, as |
ohair@5224 | 7 | # published by the Free Software Foundation. Oracle designates this |
ohair@5224 | 8 | # particular file as subject to the "Classpath" exception as provided |
ohair@5224 | 9 | # by Oracle in the LICENSE file that accompanied this code. |
ohair@5224 | 10 | # |
ohair@5224 | 11 | # This code is distributed in the hope that it will be useful, but WITHOUT |
ohair@5224 | 12 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
ohair@5224 | 13 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
ohair@5224 | 14 | # version 2 for more details (a copy is included in the LICENSE file that |
ohair@5224 | 15 | # accompanied this code). |
ohair@5224 | 16 | # |
ohair@5224 | 17 | # You should have received a copy of the GNU General Public License version |
ohair@5224 | 18 | # 2 along with this work; if not, write to the Free Software Foundation, |
ohair@5224 | 19 | # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
ohair@5224 | 20 | # |
ohair@5224 | 21 | # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
ohair@5224 | 22 | # or visit www.oracle.com if you need additional information or have any |
ohair@5224 | 23 | # questions. |
ohair@5224 | 24 | # |
ohair@5224 | 25 | |
robm@12717 | 26 | # Include custom extensions if available. |
robm@12717 | 27 | -include $(CUSTOM_MAKE_DIR)/lib/CoreLibraries.gmk |
robm@12717 | 28 | |
erikj@5599 | 29 | WIN_VERIFY_LIB := $(JDK_OUTPUTDIR)/objs/libverify/verify.lib |
ohair@5822 | 30 | |
erikj@5599 | 31 | ########################################################################################## |
erikj@5599 | 32 | |
gromero@12078 | 33 | BUILD_LIBFDLIBM_OPTIMIZATION := NONE |
erikj@5599 | 34 | |
gromero@12078 | 35 | ifeq ($(OPENJDK_TARGET_OS), solaris) |
gromero@12078 | 36 | BUILD_LIBFDLIBM_OPTIMIZATION := HIGH |
gromero@12078 | 37 | endif |
gromero@12078 | 38 | |
sgehwolf@13565 | 39 | |
sgehwolf@13565 | 40 | # If FDLIBM_CFLAGS is non-empty we know that we can optimize |
sgehwolf@13565 | 41 | # fdlibm when adding those extra C flags. Currently GCC only. |
sgehwolf@13565 | 42 | LIBFDLIBM_CFLAGS := |
sgehwolf@13565 | 43 | ifneq ($(FDLIBM_CFLAGS), ) |
sgehwolf@13565 | 44 | BUILD_LIBFDLIBM_OPTIMIZATION := HIGH |
sgehwolf@13565 | 45 | LIBFDLIBM_CFLAGS := $(FDLIBM_CFLAGS) |
ohair@5224 | 46 | endif |
ohair@5224 | 47 | |
ihse@8333 | 48 | ifneq ($(OPENJDK_TARGET_OS), macosx) |
simonis@12188 | 49 | # Unfortunately, '-ffp-contract' is only available since gcc 4.6. For ppc64le |
simonis@12188 | 50 | # that's no problem since ppc64le support only appeared in gcc 4.8.3. But on |
simonis@12188 | 51 | # ppc64 (big endian) we traditionally compiled with gcc 4.3 which only knows |
simonis@12188 | 52 | # '-mno-fused-madd'. However, that's still not enough to get the float |
simonis@12188 | 53 | # computations right - we additionally have to supply '-fno-strict-aliasing'. |
ihse@8333 | 54 | $(eval $(call SetupNativeCompilation,BUILD_LIBFDLIBM, \ |
ihse@8333 | 55 | STATIC_LIBRARY := fdlibm, \ |
ihse@8333 | 56 | OUTPUT_DIR := $(JDK_OUTPUTDIR)/objs, \ |
ihse@8333 | 57 | SRC := $(JDK_TOPDIR)/src/share/native/java/lang/fdlibm/src, \ |
ihse@8333 | 58 | LANG := C, \ |
ihse@8333 | 59 | OPTIMIZATION := $(BUILD_LIBFDLIBM_OPTIMIZATION), \ |
ihse@8333 | 60 | CFLAGS := $(CFLAGS_JDKLIB) \ |
ihse@8333 | 61 | -I$(JDK_TOPDIR)/src/share/native/java/lang/fdlibm/include, \ |
ihse@8333 | 62 | CFLAGS_windows_debug := -DLOGGING, \ |
kvn@9240 | 63 | CFLAGS_aix := -qfloat=nomaf, \ |
sgehwolf@13565 | 64 | CFLAGS_linux := $(LIBFDLIBM_CFLAGS), \ |
ihse@8333 | 65 | ARFLAGS := $(ARFLAGS), \ |
ihse@8333 | 66 | OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libfdlibm, \ |
ihse@8333 | 67 | DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) |
erikj@5599 | 68 | |
erikj@5510 | 69 | else |
erikj@6266 | 70 | |
ihse@8488 | 71 | # On macosx the old build does partial (incremental) linking of fdlibm instead of |
ihse@8488 | 72 | # a plain static library. |
ihse@8333 | 73 | $(eval $(call SetupNativeCompilation,BUILD_LIBFDLIBM_MAC, \ |
ihse@8333 | 74 | LIBRARY := fdlibm, \ |
ihse@8333 | 75 | OUTPUT_DIR := $(JDK_OUTPUTDIR)/objs/libfdlibm, \ |
ihse@8333 | 76 | SRC := $(JDK_TOPDIR)/src/share/native/java/lang/fdlibm/src, \ |
ihse@8333 | 77 | LANG := C, \ |
ihse@8333 | 78 | CFLAGS := $(CFLAGS_JDKLIB) \ |
ihse@8333 | 79 | -I$(JDK_TOPDIR)/src/share/native/java/lang/fdlibm/include, \ |
ihse@8333 | 80 | LDFLAGS := -nostdlib -r -arch x86_64, \ |
ihse@8333 | 81 | OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libfdlibm, \ |
ihse@8333 | 82 | DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) |
ihse@8333 | 83 | |
ihse@8333 | 84 | BUILD_LIBFDLIBM := $(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)fdlibm$(STATIC_LIBRARY_SUFFIX) |
ihse@8333 | 85 | $(BUILD_LIBFDLIBM): $(BUILD_LIBFDLIBM_MAC) |
erikj@6827 | 86 | $(call install-file) |
erikj@5599 | 87 | |
erikj@5510 | 88 | endif |
ihse@8488 | 89 | |
erikj@6266 | 90 | BUILD_LIBRARIES += $(BUILD_LIBFDLIBM) |
erikj@5510 | 91 | |
ohair@5224 | 92 | ########################################################################################## |
ohair@5224 | 93 | |
ihse@8333 | 94 | BUILD_LIBVERIFY_SRC := check_code.c check_format.c |
erikj@5599 | 95 | |
erikj@5599 | 96 | ifeq ($(OPENJDK_TARGET_OS), solaris) |
ihse@8333 | 97 | ifneq ($(OPENJDK_TARGET_CPU), x86_64) |
ihse@8848 | 98 | BUILD_LIBVERIFY_REORDER := $(JDK_TOPDIR)/make/mapfiles/libverify/reorder-$(OPENJDK_TARGET_CPU) |
ihse@8333 | 99 | endif |
ohair@5224 | 100 | endif |
erikj@5599 | 101 | |
ihse@8333 | 102 | LIBVERIFY_OPTIMIZATION := HIGH |
ihse@8333 | 103 | ifneq ($(findstring $(OPENJDK_TARGET_OS), solaris linux), ) |
ihse@8333 | 104 | ifeq ($(ENABLE_DEBUG_SYMBOLS), true) |
ihse@8333 | 105 | LIBVERIFY_OPTIMIZATION := LOW |
ihse@8333 | 106 | endif |
ohair@5822 | 107 | endif |
ohair@5822 | 108 | |
ihse@8333 | 109 | $(eval $(call SetupNativeCompilation,BUILD_LIBVERIFY, \ |
ihse@8333 | 110 | LIBRARY := verify, \ |
ihse@8333 | 111 | OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \ |
ihse@8333 | 112 | SRC := $(JDK_TOPDIR)/src/share/native/common, \ |
ihse@8333 | 113 | INCLUDE_FILES := $(BUILD_LIBVERIFY_SRC), \ |
ihse@8333 | 114 | LANG := C, \ |
ihse@8333 | 115 | OPTIMIZATION := $(LIBVERIFY_OPTIMIZATION), \ |
ihse@8333 | 116 | CFLAGS := $(CFLAGS_JDKLIB), \ |
ihse@8848 | 117 | MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libverify/mapfile-vers, \ |
ihse@8333 | 118 | LDFLAGS := $(LDFLAGS_JDKLIB) \ |
ihse@8333 | 119 | $(call SET_SHARED_LIBRARY_ORIGIN), \ |
ihse@8333 | 120 | LDFLAGS_SUFFIX_posix := -ljvm -lc, \ |
ihse@8333 | 121 | LDFLAGS_SUFFIX_windows := jvm.lib, \ |
ihse@8333 | 122 | VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \ |
ihse@8333 | 123 | RC_FLAGS := $(RC_FLAGS) \ |
ihse@8333 | 124 | -D "JDK_FNAME=verify.dll" \ |
ihse@8333 | 125 | -D "JDK_INTERNAL_NAME=verify" \ |
ihse@8333 | 126 | -D "JDK_FTYPE=0x2L", \ |
ihse@8333 | 127 | REORDER := $(BUILD_LIBVERIFY_REORDER), \ |
ihse@8333 | 128 | OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libverify, \ |
ihse@8333 | 129 | DEBUG_SYMBOLS := true)) |
erikj@5599 | 130 | |
erikj@5599 | 131 | BUILD_LIBRARIES += $(BUILD_LIBVERIFY) |
erikj@5599 | 132 | |
erikj@5599 | 133 | ########################################################################################## |
erikj@5599 | 134 | |
robm@12717 | 135 | # Allow a custom makefile to add extra src dirs |
robm@12717 | 136 | LIBJAVA_SRC_DIRS += $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/java/lang \ |
ihse@8488 | 137 | $(JDK_TOPDIR)/src/share/native/java/lang \ |
ihse@8488 | 138 | $(JDK_TOPDIR)/src/share/native/java/lang/reflect \ |
ihse@8488 | 139 | $(JDK_TOPDIR)/src/share/native/java/io \ |
ihse@8488 | 140 | $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/java/io \ |
ihse@8488 | 141 | $(JDK_TOPDIR)/src/share/native/java/nio \ |
ihse@8488 | 142 | $(JDK_TOPDIR)/src/share/native/java/security \ |
ihse@8488 | 143 | $(JDK_TOPDIR)/src/share/native/common \ |
ihse@8488 | 144 | $(JDK_TOPDIR)/src/share/native/sun/misc \ |
ihse@8488 | 145 | $(JDK_TOPDIR)/src/share/native/sun/reflect \ |
ihse@8488 | 146 | $(JDK_TOPDIR)/src/share/native/java/util \ |
ihse@8488 | 147 | $(JDK_TOPDIR)/src/share/native/java/util/concurrent/atomic \ |
ihse@8488 | 148 | $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/common \ |
ihse@8488 | 149 | $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/java/util |
ihse@8333 | 150 | |
mchung@10130 | 151 | ifeq ($(OPENJDK_TARGET_OS), windows) |
ihse@8333 | 152 | LIBJAVA_SRC_DIRS += $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/util/locale/provider |
mchung@10130 | 153 | else ifeq ($(OPENJDK_TARGET_OS), macosx) |
ihse@8333 | 154 | LIBJAVA_SRC_DIRS += $(JDK_TOPDIR)/src/macosx/native/sun/util/locale/provider |
ohair@5224 | 155 | endif |
erikj@5599 | 156 | |
sgehwolf@14169 | 157 | ifeq ($(OPENJDK_TARGET_OS), linux) |
sgehwolf@14169 | 158 | LIBJAVA_SRC_DIRS += $(JDK_TOPDIR)/src/linux/native/jdk/internal/platform/cgroupv1 |
sgehwolf@14169 | 159 | endif |
sgehwolf@14169 | 160 | |
ihse@8333 | 161 | ifeq ($(OPENJDK_TARGET_OS), windows) |
ihse@8333 | 162 | LIBJAVA_SRC_DIRS += $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/security/provider \ |
ihse@8333 | 163 | $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/io |
ohair@6028 | 164 | endif |
ohair@6028 | 165 | |
robm@12717 | 166 | # Make it possible to override this variable |
robm@12717 | 167 | LIBJAVA_MAPFILE ?= $(JDK_TOPDIR)/make/mapfiles/libjava/mapfile-vers |
robm@12717 | 168 | |
ihse@8333 | 169 | LIBJAVA_CFLAGS := $(foreach dir, $(LIBJAVA_SRC_DIRS), -I$(dir)) \ |
ihse@8333 | 170 | -I$(JDK_TOPDIR)/src/share/native/java/lang/fdlibm/include \ |
ihse@8333 | 171 | -DARCHPROPNAME='"$(OPENJDK_TARGET_CPU_OSARCH)"' |
erikj@5599 | 172 | |
erikj@5599 | 173 | LIBJAVA_CFLAGS += -DJDK_MAJOR_VERSION='"$(JDK_MAJOR_VERSION)"' \ |
ihse@8333 | 174 | -DJDK_MINOR_VERSION='"$(JDK_MINOR_VERSION)"' \ |
ihse@8333 | 175 | -DJDK_MICRO_VERSION='"$(JDK_MICRO_VERSION)"' \ |
simonis@13511 | 176 | -DJDK_BUILD_NUMBER='"$(JDK_BUILD_NUMBER)"' \ |
simonis@13511 | 177 | $(VERSION_CFLAGS) |
ihse@8333 | 178 | |
ihse@8333 | 179 | ifneq (, $(JDK_UPDATE_VERSION)) |
ihse@8333 | 180 | LIBJAVA_CFLAGS += -DJDK_UPDATE_VERSION='"$(JDK_UPDATE_VERSION)"' |
ohair@5224 | 181 | endif |
ohair@5224 | 182 | |
ihse@8333 | 183 | LIBJAVA_EXCLUDE_FILES := check_code.c check_format.c jspawnhelper.c |
ihse@8333 | 184 | |
ihse@8333 | 185 | ifneq ($(OPENJDK_TARGET_OS), macosx) |
ihse@8333 | 186 | LIBJAVA_EXCLUDE_FILES += java_props_macosx.c |
erikj@5510 | 187 | else |
ihse@8333 | 188 | BUILD_LIBJAVA_java_props_md.c_CFLAGS := -x objective-c |
ihse@8333 | 189 | BUILD_LIBJAVA_java_props_macosx.c_CFLAGS := -x objective-c |
ohair@5224 | 190 | endif |
ohair@5224 | 191 | |
ihse@8333 | 192 | ifeq ($(OPENJDK_TARGET_OS), windows) |
ihse@8333 | 193 | LIBJAVA_EXCLUDE_FILES += \ |
ihse@8333 | 194 | UNIXProcess_md.c \ |
ihse@8333 | 195 | UnixFileSystem_md.c \ |
ihse@8333 | 196 | FileSystemPreferences.c |
ohair@5224 | 197 | else |
ihse@8333 | 198 | LIBJAVA_EXCLUDE_FILES += \ |
ihse@8333 | 199 | ProcessImpl_md.c \ |
ihse@8333 | 200 | WinNTFileSystem_md.c \ |
ihse@8333 | 201 | dirent_md.c \ |
ihse@8333 | 202 | WindowsPreferences.c \ |
ihse@8333 | 203 | sun/security/provider/WinCAPISeedGenerator.c \ |
ihse@8333 | 204 | sun/io/Win32ErrorMode.c |
ohair@5224 | 205 | endif |
ohair@5224 | 206 | |
erikj@5599 | 207 | ifeq ($(OPENJDK_TARGET_OS), solaris) |
ihse@8333 | 208 | ifneq ($(OPENJDK_TARGET_CPU), x86_64) |
ihse@8848 | 209 | LIBJAVA_REORDER := $(JDK_TOPDIR)/make/mapfiles/libjava/reorder-$(OPENJDK_TARGET_CPU) |
ihse@8333 | 210 | endif |
ohair@5224 | 211 | endif |
ohair@5224 | 212 | |
ihse@8333 | 213 | $(eval $(call SetupNativeCompilation,BUILD_LIBJAVA, \ |
ihse@8333 | 214 | LIBRARY := java, \ |
ihse@8333 | 215 | OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \ |
ihse@8333 | 216 | SRC := $(LIBJAVA_SRC_DIRS), \ |
ihse@8333 | 217 | EXCLUDES := fdlibm/src zip, \ |
ihse@8333 | 218 | EXCLUDE_FILES := $(LIBJAVA_EXCLUDE_FILES), \ |
ihse@8333 | 219 | LANG := C, \ |
ihse@8333 | 220 | OPTIMIZATION := HIGH, \ |
ihse@8333 | 221 | CFLAGS := $(CFLAGS_JDKLIB) \ |
ihse@8333 | 222 | $(LIBJAVA_CFLAGS), \ |
robm@12717 | 223 | MAPFILE := $(LIBJAVA_MAPFILE), \ |
ihse@8333 | 224 | LDFLAGS := $(LDFLAGS_JDKLIB) \ |
ihse@8333 | 225 | $(call SET_SHARED_LIBRARY_ORIGIN), \ |
ihse@8333 | 226 | LDFLAGS_SUFFIX_posix := -ljvm -lverify, \ |
ihse@8333 | 227 | LDFLAGS_SUFFIX_solaris := -lsocket -lnsl -lscf $(LIBDL) $(BUILD_LIBFDLIBM) -lc, \ |
ihse@8333 | 228 | LDFLAGS_SUFFIX_linux := $(LIBDL) $(BUILD_LIBFDLIBM), \ |
kvn@9240 | 229 | LDFLAGS_SUFFIX_aix := $(LIBDL) $(BUILD_LIBFDLIBM) -lm,\ |
ihse@8333 | 230 | LDFLAGS_SUFFIX_macosx := -L$(JDK_OUTPUTDIR)/objs/ -lfdlibm \ |
ihse@8333 | 231 | -framework CoreFoundation \ |
ihse@8333 | 232 | -framework Foundation \ |
ihse@8333 | 233 | -framework Security -framework SystemConfiguration, \ |
ihse@8333 | 234 | LDFLAGS_SUFFIX_windows := -export:winFileHandleOpen -export:handleLseek \ |
robm@11095 | 235 | -export:getErrorString \ |
ihse@8333 | 236 | jvm.lib $(BUILD_LIBFDLIBM) $(WIN_VERIFY_LIB) \ |
ihse@8333 | 237 | shell32.lib delayimp.lib -DELAYLOAD:shell32.dll \ |
rriggs@10866 | 238 | advapi32.lib version.lib, \ |
ihse@8333 | 239 | VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \ |
ihse@8333 | 240 | RC_FLAGS := $(RC_FLAGS) \ |
ihse@8333 | 241 | -D "JDK_FNAME=java.dll" \ |
ihse@8333 | 242 | -D "JDK_INTERNAL_NAME=java" \ |
ihse@8333 | 243 | -D "JDK_FTYPE=0x2L", \ |
ihse@8333 | 244 | REORDER := $(LIBJAVA_REORDER), \ |
ihse@8333 | 245 | OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjava, \ |
ihse@8333 | 246 | DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) |
erikj@5599 | 247 | |
erikj@5599 | 248 | BUILD_LIBRARIES += $(BUILD_LIBJAVA) |
erikj@5599 | 249 | |
ihse@8333 | 250 | $(BUILD_LIBJAVA): $(LIBJLI_BINARY) |
ihse@8333 | 251 | |
ihse@8333 | 252 | $(BUILD_LIBJAVA): $(BUILD_LIBVERIFY) |
ihse@8333 | 253 | |
ihse@8333 | 254 | $(BUILD_LIBJAVA): $(BUILD_LIBFDLIBM) |
ohair@5224 | 255 | |
ohair@5224 | 256 | ########################################################################################## |
ohair@5224 | 257 | |
ihse@8333 | 258 | BUILD_LIBZIP_EXCLUDES := |
ihse@8333 | 259 | ifeq ($(USE_EXTERNAL_LIBZ), true) |
ihse@8333 | 260 | LIBZ := -lz |
coffeys@12462 | 261 | LIBZIP_EXCLUDES += zlib |
ihse@8333 | 262 | else |
coffeys@12462 | 263 | ZLIB_CPPFLAGS := -I$(JDK_TOPDIR)/src/share/native/java/util/zip/zlib |
erikj@5510 | 264 | endif |
erikj@5510 | 265 | |
ihse@8333 | 266 | BUILD_LIBZIP_REORDER := |
erikj@5599 | 267 | ifeq ($(OPENJDK_TARGET_OS), solaris) |
ihse@8333 | 268 | ifneq ($(OPENJDK_TARGET_CPU), x86_64) |
ihse@8848 | 269 | BUILD_LIBZIP_REORDER := $(JDK_TOPDIR)/make/mapfiles/libzip/reorder-$(OPENJDK_TARGET_CPU) |
ohair@5822 | 270 | endif |
erikj@5510 | 271 | endif |
erikj@5510 | 272 | |
ihse@8333 | 273 | ifeq ($(LIBZIP_CAN_USE_MMAP), true) |
ihse@8333 | 274 | BUILD_LIBZIP_MMAP := -DUSE_MMAP |
ihse@8333 | 275 | endif |
ihse@8333 | 276 | |
ihse@8333 | 277 | $(eval $(call SetupNativeCompilation,BUILD_LIBZIP, \ |
ihse@8333 | 278 | LIBRARY := zip, \ |
ihse@8333 | 279 | OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \ |
ihse@8333 | 280 | LANG := C, \ |
ihse@8333 | 281 | OPTIMIZATION := LOW, \ |
ihse@8333 | 282 | SRC := $(JDK_TOPDIR)/src/share/native/java/util/zip, \ |
ihse@8333 | 283 | EXCLUDES := $(LIBZIP_EXCLUDES), \ |
ihse@8333 | 284 | CFLAGS := $(CFLAGS_JDKLIB) \ |
ihse@8333 | 285 | $(ZLIB_CPPFLAGS) \ |
ihse@8333 | 286 | -I$(JDK_TOPDIR)/src/share/native/java/io \ |
ihse@8333 | 287 | -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/java/io, \ |
ihse@8333 | 288 | CFLAGS_posix := $(BUILD_LIBZIP_MMAP) -UDEBUG, \ |
ihse@8848 | 289 | MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libzip/mapfile-vers, \ |
ihse@8333 | 290 | REORDER := $(BUILD_LIBZIP_REORDER), \ |
ihse@8333 | 291 | LDFLAGS := $(LDFLAGS_JDKLIB) \ |
ihse@8333 | 292 | $(call SET_SHARED_LIBRARY_ORIGIN) \ |
ihse@8333 | 293 | $(EXPORT_ZIP_FUNCS), \ |
ihse@8333 | 294 | LDFLAGS_windows := -export:ZIP_Open -export:ZIP_Close -export:ZIP_FindEntry \ |
jiangli@9898 | 295 | -export:ZIP_ReadEntry -export:ZIP_GetNextEntry -export:ZIP_CRC32 jvm.lib \ |
ihse@8333 | 296 | $(WIN_JAVA_LIB), \ |
ihse@8333 | 297 | LDFLAGS_SUFFIX_linux := -ljvm -ljava $(LIBZ), \ |
ihse@8333 | 298 | LDFLAGS_SUFFIX_solaris := -ljvm -ljava $(LIBZ) -lc, \ |
simonis@9241 | 299 | LDFLAGS_SUFFIX_aix := -ljvm -ljava $(LIBZ),\ |
ihse@8333 | 300 | LDFLAGS_SUFFIX_macosx := $(LIBZ) -ljava -ljvm, \ |
ihse@8333 | 301 | VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \ |
ihse@8333 | 302 | RC_FLAGS := $(RC_FLAGS) \ |
ihse@8333 | 303 | -D "JDK_FNAME=zip.dll" \ |
ihse@8333 | 304 | -D "JDK_INTERNAL_NAME=zip" \ |
ihse@8333 | 305 | -D "JDK_FTYPE=0x2L", \ |
ihse@8333 | 306 | OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libzip, \ |
ihse@8333 | 307 | DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) |
ihse@8333 | 308 | |
ihse@8333 | 309 | |
ihse@8333 | 310 | $(BUILD_LIBZIP): $(BUILD_LIBJAVA) |
ihse@8333 | 311 | |
ihse@8333 | 312 | BUILD_LIBRARIES += $(BUILD_LIBZIP) |
erikj@5510 | 313 | |
erikj@5510 | 314 | ########################################################################################## |
erikj@5510 | 315 | |
ihse@8333 | 316 | $(eval $(call SetupNativeCompilation,BUILD_LIBUNPACK, \ |
ihse@8333 | 317 | LIBRARY := unpack, \ |
ihse@8333 | 318 | OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \ |
ihse@8333 | 319 | SRC := $(JDK_TOPDIR)/src/share/native/com/sun/java/util/jar/pack, \ |
ihse@8333 | 320 | EXCLUDE_FILES := main.cpp, \ |
ihse@8333 | 321 | LANG := C++, \ |
ihse@8333 | 322 | OPTIMIZATION := LOW, \ |
ihse@8333 | 323 | CFLAGS := $(CXXFLAGS_JDKLIB) \ |
ihse@8333 | 324 | -DNO_ZLIB -DUNPACK_JNI -DFULL, \ |
ihse@8333 | 325 | CFLAGS_release := -DPRODUCT, \ |
ihse@8848 | 326 | MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libunpack/mapfile-vers, \ |
ihse@8333 | 327 | LDFLAGS := $(LDFLAGS_JDKLIB) $(LDFLAGS_CXX_JDK) \ |
ihse@8333 | 328 | $(call SET_SHARED_LIBRARY_ORIGIN), \ |
ihse@8333 | 329 | LDFLAGS_windows := -map:$(JDK_OUTPUTDIR)/objs/unpack.map -debug \ |
ihse@8333 | 330 | jvm.lib $(WIN_JAVA_LIB), \ |
ihse@8333 | 331 | LDFLAGS_SUFFIX_posix := -ljvm $(LIBCXX) -ljava -lc, \ |
ihse@8333 | 332 | OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libunpack, \ |
ihse@8333 | 333 | VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \ |
ihse@8333 | 334 | RC_FLAGS := $(RC_FLAGS) \ |
ihse@8333 | 335 | -D "JDK_FNAME=unpack.dll" \ |
ihse@8333 | 336 | -D "JDK_INTERNAL_NAME=unpack" \ |
ihse@8333 | 337 | -D "JDK_FTYPE=0x2L", \ |
ihse@8333 | 338 | DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) |
ihse@8333 | 339 | |
ihse@8333 | 340 | $(BUILD_LIBUNPACK): $(BUILD_LIBJAVA) |
ihse@8333 | 341 | |
ihse@8333 | 342 | BUILD_LIBRARIES += $(BUILD_LIBUNPACK) |
ihse@8333 | 343 | |
ihse@8333 | 344 | ifeq ($(OPENJDK_TARGET_OS), windows) |
ihse@8333 | 345 | $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)unpack.map: $(BUILD_LIBUNPACK) |
ihse@8333 | 346 | $(ECHO) Copying $(@F) |
ihse@8333 | 347 | $(CP) $(patsubst %$(SHARED_LIBRARY_SUFFIX), %.map, $<) $@ |
ihse@8333 | 348 | |
ihse@8333 | 349 | $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)unpack.pdb: $(BUILD_LIBUNPACK) |
ihse@8333 | 350 | $(ECHO) Copying $(@F) |
ihse@8333 | 351 | $(CP) $(patsubst %$(SHARED_LIBRARY_SUFFIX), %.pdb, $<) $@ |
erikj@5510 | 352 | endif |
erikj@5510 | 353 | |
erikj@5510 | 354 | ########################################################################################## |
erikj@5510 | 355 | |
ihse@8333 | 356 | BUILD_LIBJLI_SRC_DIRS := $(JDK_TOPDIR)/src/share/bin $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/bin |
ihse@8333 | 357 | LIBJLI_CFLAGS := $(CFLAGS_JDKLIB) $(foreach dir, $(BUILD_LIBJLI_SRC_DIRS), -I$(dir)) |
ihse@8333 | 358 | |
ihse@8333 | 359 | BUILD_LIBJLI_FILES := \ |
ihse@8333 | 360 | java.c \ |
ihse@8333 | 361 | splashscreen_stubs.c \ |
ihse@8333 | 362 | parse_manifest.c \ |
ihse@8333 | 363 | version_comp.c \ |
ihse@8333 | 364 | wildcard.c \ |
ihse@8333 | 365 | jli_util.c |
ihse@8333 | 366 | |
ihse@8333 | 367 | ifeq ($(JVM_VARIANT_ZERO), true) |
ihse@8333 | 368 | ERGO_FAMILY := zero |
ihse@8333 | 369 | else |
ihse@8333 | 370 | ifeq ($(OPENJDK_TARGET_CPU_ARCH), x86) |
ihse@8333 | 371 | ERGO_FAMILY := i586 |
ihse@8333 | 372 | else |
ihse@8333 | 373 | ERGO_FAMILY := $(OPENJDK_TARGET_CPU_ARCH) |
ihse@8333 | 374 | endif |
ihse@8333 | 375 | endif |
ihse@8333 | 376 | |
erikj@5599 | 377 | ifeq ($(OPENJDK_TARGET_OS), macosx) |
ihse@8333 | 378 | LIBJLI_CFLAGS += -I$(JDK_TOPDIR)/src/macosx/bin |
ihse@8333 | 379 | BUILD_LIBJLI_SRC_DIRS += $(JDK_TOPDIR)/src/macosx/bin |
ihse@8333 | 380 | BUILD_LIBJLI_FILES += java_md_common.c java_md_macosx.c |
ihse@8333 | 381 | |
ihse@8333 | 382 | BUILD_LIBJLI_java_md_macosx.c_CFLAGS := -x objective-c |
ihse@8333 | 383 | BUILD_LIBJLI_STATIC_java_md_macosx.c_CFLAGS := -x objective-c |
erikj@5510 | 384 | endif |
erikj@5510 | 385 | |
ihse@8333 | 386 | ifeq ($(OPENJDK_TARGET_OS), windows) |
ihse@8333 | 387 | BUILD_LIBJLI_FILES += java_md.c \ |
ihse@8333 | 388 | cmdtoargs.c |
ihse@8333 | 389 | # Staticically link with c runtime on windows. |
ihse@8333 | 390 | LIBJLI_CFLAGS := $(filter-out -MD, $(LIBJLI_CFLAGS)) |
kevinw@13117 | 391 | # Supply the name of the C runtime lib. |
kevinw@13117 | 392 | LIBJLI_CFLAGS += -DMSVCR_DLL_NAME='"$(notdir $(MSVCR_DLL))"' |
kevinw@13117 | 393 | ifneq ($(MSVCP_DLL), ) |
kevinw@13117 | 394 | LIBJLI_CFLAGS += -DMSVCP_DLL_NAME='"$(notdir $(MSVCP_DLL))"' |
kevinw@13117 | 395 | endif |
ihse@8333 | 396 | else ifneq ($(OPENJDK_TARGET_OS), macosx) |
ihse@8333 | 397 | |
ihse@8333 | 398 | BUILD_LIBJLI_FILES += java_md_common.c |
ihse@8333 | 399 | BUILD_LIBJLI_FILES += java_md_solinux.c ergo.c |
ihse@8333 | 400 | |
ihse@8333 | 401 | ERGO_ARCH_FILE = ergo_$(ERGO_FAMILY).c |
ihse@8333 | 402 | |
ihse@8333 | 403 | # if the architecture specific ergo file exists then |
ihse@8333 | 404 | # use it, else use the generic definitions from ergo.c |
ihse@8333 | 405 | ifneq ($(wildcard $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/bin/$(ERGO_ARCH_FILE)), ) |
ihse@8333 | 406 | BUILD_LIBJLI_FILES += $(ERGO_ARCH_FILE) |
ihse@8333 | 407 | else # !ERGO_ARCH_FILE |
ihse@8333 | 408 | LIBJLI_CFLAGS += -DUSE_GENERIC_ERGO |
ihse@8333 | 409 | endif # ERGO_ARCH_FILE |
ihse@8333 | 410 | endif #WINDOWS |
ihse@8333 | 411 | |
ihse@8333 | 412 | # Append defines depending on target platform |
ihse@8333 | 413 | LIBJLI_CFLAGS += $(OPENJDK_TARGET_CPU_JLI_CFLAGS) |
ihse@8333 | 414 | |
ihse@8333 | 415 | ifeq ($(OPENJDK_TARGET_OS), macosx) |
ihse@8333 | 416 | LIBJLI_CFLAGS += -DPACKAGE_PATH=\"$(PACKAGE_PATH)\" |
ihse@8333 | 417 | endif |
ihse@8333 | 418 | |
ihse@8333 | 419 | ifneq ($(USE_EXTERNAL_LIBZ), true) |
coffeys@12462 | 420 | BUILD_LIBJLI_SRC_DIRS += $(JDK_TOPDIR)/src/share/native/java/util/zip/zlib |
ihse@8333 | 421 | LIBJLI_CFLAGS += $(ZLIB_CPPFLAGS) |
ihse@8333 | 422 | BUILD_LIBJLI_FILES += \ |
ihse@8333 | 423 | inflate.c \ |
ihse@8333 | 424 | inftrees.c \ |
ihse@8333 | 425 | inffast.c \ |
ihse@8333 | 426 | zadler32.c \ |
ihse@8333 | 427 | zcrc32.c \ |
ihse@8333 | 428 | zutil.c |
ihse@8333 | 429 | endif |
ihse@8333 | 430 | |
ihse@8333 | 431 | ifeq ($(OPENJDK_TARGET_OS), windows) |
ihse@8333 | 432 | LIBJLI_OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE) |
ihse@8333 | 433 | else |
ihse@8333 | 434 | LIBJLI_OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE)/jli |
ihse@8333 | 435 | endif |
ihse@8333 | 436 | |
ihse@8333 | 437 | $(eval $(call SetupNativeCompilation,BUILD_LIBJLI, \ |
ihse@8333 | 438 | LIBRARY := jli, \ |
ihse@8333 | 439 | OUTPUT_DIR := $(LIBJLI_OUTPUT_DIR), \ |
ihse@8333 | 440 | SRC := $(BUILD_LIBJLI_SRC_DIRS), \ |
ihse@8333 | 441 | INCLUDE_FILES := $(BUILD_LIBJLI_FILES), \ |
ihse@8333 | 442 | LANG := C, \ |
ihse@8333 | 443 | OPTIMIZATION := HIGH, \ |
ihse@8333 | 444 | CFLAGS := $(LIBJLI_CFLAGS), \ |
ihse@8848 | 445 | MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libjli/mapfile-vers, \ |
ihse@8333 | 446 | LDFLAGS := $(LDFLAGS_JDKLIB) \ |
ihse@8333 | 447 | $(call SET_SHARED_LIBRARY_ORIGIN), \ |
ihse@8333 | 448 | LDFLAGS_linux := $(call SET_SHARED_LIBRARY_ORIGIN,/..), \ |
ihse@8333 | 449 | LDFLAGS_solaris := $(call SET_SHARED_LIBRARY_ORIGIN,/..), \ |
ihse@8333 | 450 | LDFLAGS_macosx := -framework Cocoa -framework Security -framework ApplicationServices, \ |
ihse@8333 | 451 | LDFLAGS_SUFFIX_solaris := $(LIBZ) $(LIBDL) -lc, \ |
dholmes@8742 | 452 | LDFLAGS_SUFFIX_linux := $(LIBZ) $(LIBDL) -lc -lpthread, \ |
simonis@9241 | 453 | LDFLAGS_SUFFIX_aix := $(LIBZ) $(LIBDL),\ |
ihse@8333 | 454 | LDFLAGS_SUFFIX_macosx := $(LIBZ), \ |
ihse@8333 | 455 | LDFLAGS_SUFFIX_windows := \ |
ihse@8333 | 456 | -export:JLI_Launch \ |
ihse@8333 | 457 | -export:JLI_ManifestIterate \ |
ihse@8333 | 458 | -export:JLI_SetTraceLauncher \ |
ihse@8333 | 459 | -export:JLI_ReportErrorMessage \ |
ihse@8333 | 460 | -export:JLI_ReportErrorMessageSys \ |
ihse@8333 | 461 | -export:JLI_ReportMessage \ |
ihse@8333 | 462 | -export:JLI_ReportExceptionDescription \ |
ihse@8333 | 463 | -export:JLI_MemAlloc \ |
ihse@8333 | 464 | -export:JLI_CmdToArgs \ |
ihse@8333 | 465 | -export:JLI_GetStdArgc \ |
ihse@8333 | 466 | -export:JLI_GetStdArgs \ |
ihse@8333 | 467 | advapi32.lib \ |
ihse@8333 | 468 | comctl32.lib \ |
ihse@8333 | 469 | user32.lib, \ |
ihse@8333 | 470 | VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \ |
ihse@8333 | 471 | RC_FLAGS := $(RC_FLAGS) \ |
ihse@8333 | 472 | -D "JDK_FNAME=jli.dll" \ |
ihse@8333 | 473 | -D "JDK_INTERNAL_NAME=jli" \ |
ihse@8333 | 474 | -D "JDK_FTYPE=0x2L", \ |
ihse@8333 | 475 | OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjli, \ |
ihse@8333 | 476 | DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) |
ihse@8333 | 477 | |
ihse@8333 | 478 | BUILD_LIBRARIES += $(BUILD_LIBJLI) |
ihse@8333 | 479 | |
ihse@8333 | 480 | # On windows, the static library has the same suffix as the import library created by |
ihse@8333 | 481 | # with the shared library, so the static library is given a different name. No harm |
ihse@8333 | 482 | # in doing it for all platform to reduce complexity. |
ihse@8333 | 483 | ifeq ($(OPENJDK_TARGET_OS), windows) |
ihse@8333 | 484 | $(eval $(call SetupNativeCompilation,BUILD_LIBJLI_STATIC, \ |
ihse@8333 | 485 | STATIC_LIBRARY := jli_static, \ |
ihse@8333 | 486 | OUTPUT_DIR := $(JDK_OUTPUTDIR)/objs, \ |
ihse@8333 | 487 | SRC := $(BUILD_LIBJLI_SRC_DIRS), \ |
ihse@8333 | 488 | INCLUDE_FILES := $(BUILD_LIBJLI_FILES), \ |
ihse@8333 | 489 | LANG := C, \ |
ihse@8333 | 490 | OPTIMIZATION := HIGH, \ |
ihse@8333 | 491 | CFLAGS := $(STATIC_LIBRARY_FLAGS) $(LIBJLI_CFLAGS), \ |
ihse@8333 | 492 | ARFLAGS := $(ARFLAGS), \ |
ihse@8333 | 493 | OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjli_static, \ |
ihse@8333 | 494 | DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) |
ihse@8333 | 495 | |
ihse@8333 | 496 | BUILD_LIBRARIES += $(BUILD_LIBJLI_STATIC) |
ihse@8333 | 497 | |
ihse@8333 | 498 | else ifeq ($(OPENJDK_TARGET_OS), macosx) |
ihse@8333 | 499 | # |
ihse@8333 | 500 | # On macosx they do partial (incremental) linking of libjli_static.a |
ihse@8333 | 501 | # code it here...rather than add support to NativeCompilation |
ihse@8333 | 502 | # as this is first time I see it |
ihse@8333 | 503 | $(eval $(call SetupNativeCompilation,BUILD_LIBJLI_STATIC, \ |
ihse@8333 | 504 | LIBRARY := jli_static, \ |
ihse@8333 | 505 | OUTPUT_DIR := $(JDK_OUTPUTDIR)/objs, \ |
ihse@8333 | 506 | SRC := $(BUILD_LIBJLI_SRC_DIRS), \ |
ihse@8333 | 507 | INCLUDE_FILES := $(BUILD_LIBJLI_FILES), \ |
ihse@8333 | 508 | LANG := C, \ |
ihse@8333 | 509 | OPTIMIZATION := HIGH, \ |
ihse@8333 | 510 | CFLAGS := $(CFLAGS_JDKLIB) $(LIBJLI_CFLAGS), \ |
ihse@8333 | 511 | LDFLAGS := -nostdlib -r, \ |
ihse@8333 | 512 | OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjli_static, \ |
ihse@8333 | 513 | DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES))) |
ihse@8333 | 514 | |
ihse@8333 | 515 | $(JDK_OUTPUTDIR)/objs/libjli_static.a: $(BUILD_LIBJLI_STATIC) |
ihse@8333 | 516 | $(call install-file) |
ihse@8333 | 517 | |
ihse@8333 | 518 | BUILD_LIBRARIES += $(JDK_OUTPUTDIR)/objs/libjli_static.a |
simonis@9241 | 519 | |
simonis@9241 | 520 | else ifeq ($(OPENJDK_TARGET_OS), aix) |
simonis@9241 | 521 | # AIX also requires a static libjli because the compiler doesn't support '-rpath' |
simonis@9241 | 522 | $(eval $(call SetupNativeCompilation,BUILD_LIBJLI_STATIC,\ |
simonis@9241 | 523 | STATIC_LIBRARY:=jli_static,\ |
simonis@9241 | 524 | OUTPUT_DIR:=$(JDK_OUTPUTDIR)/objs,\ |
simonis@9241 | 525 | SRC:=$(BUILD_LIBJLI_SRC_DIRS),\ |
simonis@9241 | 526 | INCLUDE_FILES:=$(BUILD_LIBJLI_FILES),\ |
simonis@9241 | 527 | LANG:=C,\ |
simonis@9241 | 528 | OPTIMIZATION:=HIGH, \ |
simonis@9241 | 529 | CFLAGS:=$(STATIC_LIBRARY_FLAGS) $(LIBJLI_CFLAGS),\ |
simonis@9241 | 530 | ARFLAGS:=$(ARFLAGS),\ |
simonis@9241 | 531 | OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libjli_static)) |
simonis@9241 | 532 | |
simonis@9241 | 533 | BUILD_LIBRARIES += $(JDK_OUTPUTDIR)/objs/libjli_static.a |
simonis@9241 | 534 | |
ihse@8333 | 535 | endif |
ihse@8333 | 536 | |
erikj@5510 | 537 | ########################################################################################## |
erikj@5510 | 538 | |
ihse@8488 | 539 | $(eval $(call SetupNativeCompilation,BUILD_LIBNPT, \ |
ihse@8488 | 540 | LIBRARY := npt, \ |
ihse@8333 | 541 | OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \ |
ihse@8488 | 542 | SRC := $(JDK_TOPDIR)/src/share/npt $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/npt, \ |
ihse@8333 | 543 | LANG := C, \ |
ihse@8333 | 544 | OPTIMIZATION := LOW, \ |
ihse@8333 | 545 | CFLAGS := $(CFLAGS_JDKLIB) \ |
ihse@8488 | 546 | -I$(JDK_TOPDIR)/src/share/npt \ |
ihse@8488 | 547 | -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/npt, \ |
ihse@8848 | 548 | MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libnpt/mapfile-vers, \ |
ihse@8333 | 549 | LDFLAGS := $(LDFLAGS_JDKLIB) \ |
ihse@8333 | 550 | $(call SET_SHARED_LIBRARY_ORIGIN), \ |
ihse@8488 | 551 | LDFLAGS_macosx := -liconv, \ |
ihse@8488 | 552 | LDFLAGS_SUFFIX_windows := -export:nptInitialize -export:nptTerminate, \ |
ihse@8333 | 553 | LDFLAGS_SUFFIX_solaris := -lc, \ |
ihse@8333 | 554 | VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \ |
ihse@8333 | 555 | RC_FLAGS := $(RC_FLAGS) \ |
ihse@8488 | 556 | -D "JDK_FNAME=npt.dll" \ |
ihse@8488 | 557 | -D "JDK_INTERNAL_NAME=npt" \ |
ihse@8333 | 558 | -D "JDK_FTYPE=0x2L", \ |
ihse@8488 | 559 | OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libnpt, \ |
ihse@8488 | 560 | DEBUG_SYMBOLS := true)) |
ihse@8333 | 561 | |
ihse@8488 | 562 | BUILD_LIBRARIES += $(BUILD_LIBNPT) |