2007-12-01 00:00:00 +00:00
|
|
|
#
|
2023-04-27 09:00:58 +00:00
|
|
|
# Copyright (c) 2011, 2023, Oracle and/or its affiliates. All rights reserved.
|
2007-12-01 00:00:00 +00:00
|
|
|
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
|
|
#
|
|
|
|
# This code is free software; you can redistribute it and/or modify it
|
|
|
|
# under the terms of the GNU General Public License version 2 only, as
|
2010-05-25 22:58:33 +00:00
|
|
|
# published by the Free Software Foundation. Oracle designates this
|
2007-12-01 00:00:00 +00:00
|
|
|
# particular file as subject to the "Classpath" exception as provided
|
2010-05-25 22:58:33 +00:00
|
|
|
# by Oracle in the LICENSE file that accompanied this code.
|
2007-12-01 00:00:00 +00:00
|
|
|
#
|
|
|
|
# This code is distributed in the hope that it will be useful, but WITHOUT
|
|
|
|
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
|
|
# version 2 for more details (a copy is included in the LICENSE file that
|
|
|
|
# accompanied this code).
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License version
|
|
|
|
# 2 along with this work; if not, write to the Free Software Foundation,
|
|
|
|
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
#
|
2010-05-25 22:58:33 +00:00
|
|
|
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
|
|
# or visit www.oracle.com if you need additional information or have any
|
|
|
|
# questions.
|
2007-12-01 00:00:00 +00:00
|
|
|
#
|
|
|
|
|
2014-08-17 14:54:13 +00:00
|
|
|
include LibCommon.gmk
|
|
|
|
|
2017-10-13 13:22:02 +00:00
|
|
|
# Hook to include the corresponding custom file, if present.
|
2020-04-29 06:55:01 +00:00
|
|
|
$(eval $(call IncludeCustomExtension, modules/java.base/Lib.gmk))
|
2017-10-13 13:22:02 +00:00
|
|
|
|
2014-08-21 10:23:20 +00:00
|
|
|
# Prepare the find cache.
|
2017-10-24 08:41:45 +00:00
|
|
|
$(call FillFindCache, $(wildcard $(TOPDIR)/src/java.base/*/native))
|
2014-08-21 10:23:20 +00:00
|
|
|
|
2018-03-15 18:30:58 +00:00
|
|
|
################################################################################
|
|
|
|
# Create all the core libraries
|
|
|
|
|
2020-04-29 06:55:01 +00:00
|
|
|
include lib/CoreLibraries.gmk
|
2018-03-15 18:30:58 +00:00
|
|
|
|
|
|
|
################################################################################
|
|
|
|
# Create the network library
|
|
|
|
|
|
|
|
$(eval $(call SetupJdkLibrary, BUILD_LIBNET, \
|
|
|
|
NAME := net, \
|
|
|
|
OPTIMIZATION := LOW, \
|
2018-06-08 16:11:32 +00:00
|
|
|
CFLAGS := $(CFLAGS_JDKLIB), \
|
2022-10-05 05:56:44 +00:00
|
|
|
DISABLED_WARNINGS_gcc_net_util_md.c := format-nonliteral, \
|
|
|
|
DISABLED_WARNINGS_gcc_NetworkInterface.c := unused-function, \
|
|
|
|
DISABLED_WARNINGS_clang_net_util_md.c := format-nonliteral, \
|
2023-06-07 13:42:03 +00:00
|
|
|
DISABLED_WARNINGS_clang_aix_DefaultProxySelector.c := deprecated-non-prototype, \
|
|
|
|
DISABLED_WARNINGS_clang_aix_NetworkInterface.c := gnu-pointer-arith, \
|
2022-10-05 05:56:44 +00:00
|
|
|
DISABLED_WARNINGS_microsoft_InetAddress.c := 4244, \
|
|
|
|
DISABLED_WARNINGS_microsoft_ResolverConfigurationImpl.c := 4996, \
|
2018-03-15 18:30:58 +00:00
|
|
|
LDFLAGS := $(LDFLAGS_JDKLIB) \
|
|
|
|
$(call SET_SHARED_LIBRARY_ORIGIN), \
|
2023-09-21 15:43:05 +00:00
|
|
|
LDFLAGS_windows := -delayload:secur32.dll -delayload:iphlpapi.dll \
|
|
|
|
-delayload:winhttp.dll, \
|
2018-03-15 18:30:58 +00:00
|
|
|
LIBS_unix := -ljvm -ljava, \
|
2022-10-24 15:25:48 +00:00
|
|
|
LIBS_linux := $(LIBDL), \
|
2018-03-15 18:30:58 +00:00
|
|
|
LIBS_aix := $(LIBDL),\
|
|
|
|
LIBS_windows := ws2_32.lib jvm.lib secur32.lib iphlpapi.lib winhttp.lib \
|
2019-08-19 13:28:43 +00:00
|
|
|
delayimp.lib $(WIN_JAVA_LIB) advapi32.lib, \
|
2018-03-15 18:30:58 +00:00
|
|
|
LIBS_macosx := -framework CoreFoundation -framework CoreServices, \
|
|
|
|
))
|
|
|
|
|
|
|
|
$(BUILD_LIBNET): $(BUILD_LIBJAVA)
|
|
|
|
|
|
|
|
TARGETS += $(BUILD_LIBNET)
|
|
|
|
|
|
|
|
################################################################################
|
|
|
|
# Create the nio library
|
|
|
|
|
|
|
|
$(eval $(call SetupJdkLibrary, BUILD_LIBNIO, \
|
|
|
|
NAME := nio, \
|
|
|
|
OPTIMIZATION := HIGH, \
|
|
|
|
WARNINGS_AS_ERRORS_xlc := false, \
|
2018-06-08 16:11:32 +00:00
|
|
|
CFLAGS := $(CFLAGS_JDKLIB), \
|
|
|
|
EXTRA_HEADER_DIRS := \
|
|
|
|
libnio/ch \
|
|
|
|
libnio/fs \
|
|
|
|
libnet, \
|
2018-03-15 18:30:58 +00:00
|
|
|
LDFLAGS := $(LDFLAGS_JDKLIB) \
|
|
|
|
$(call SET_SHARED_LIBRARY_ORIGIN), \
|
|
|
|
LIBS_unix := -ljava -lnet, \
|
|
|
|
LIBS_linux := -lpthread $(LIBDL), \
|
|
|
|
LIBS_aix := $(LIBDL), \
|
|
|
|
LIBS_macosx := \
|
|
|
|
-framework CoreFoundation -framework CoreServices, \
|
2022-10-17 20:57:26 +00:00
|
|
|
LIBS_windows := jvm.lib Mswsock.lib ws2_32.lib $(WIN_JAVA_LIB) \
|
2018-03-15 18:30:58 +00:00
|
|
|
$(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libnet/net.lib \
|
|
|
|
advapi32.lib, \
|
|
|
|
))
|
|
|
|
|
|
|
|
TARGETS += $(BUILD_LIBNIO)
|
|
|
|
|
|
|
|
$(BUILD_LIBNIO): $(BUILD_LIBNET)
|
|
|
|
|
|
|
|
################################################################################
|
|
|
|
# Create the macosx security library
|
|
|
|
|
2019-02-07 11:35:45 +00:00
|
|
|
ifeq ($(call isTargetOs, macosx), true)
|
2018-03-15 18:30:58 +00:00
|
|
|
|
|
|
|
$(eval $(call SetupJdkLibrary, BUILD_LIBOSXSECURITY, \
|
|
|
|
NAME := osxsecurity, \
|
|
|
|
OPTIMIZATION := LOW, \
|
2018-06-08 16:11:32 +00:00
|
|
|
CFLAGS := $(CFLAGS_JDKLIB), \
|
2022-10-05 05:56:44 +00:00
|
|
|
DISABLED_WARNINGS_clang_KeystoreImpl.m := deprecated-declarations, \
|
2018-03-15 18:30:58 +00:00
|
|
|
LDFLAGS := $(LDFLAGS_JDKLIB) \
|
|
|
|
-L$(SUPPORT_OUTPUTDIR)/modules_libs/java.base \
|
2020-04-14 12:58:24 +00:00
|
|
|
$(call SET_SHARED_LIBRARY_ORIGIN), \
|
2018-03-15 18:30:58 +00:00
|
|
|
LIBS := \
|
2020-04-14 12:58:24 +00:00
|
|
|
-lobjc \
|
2018-03-15 18:30:58 +00:00
|
|
|
-framework CoreServices \
|
|
|
|
-framework Security \
|
2021-02-03 16:20:16 +00:00
|
|
|
-framework Foundation \
|
2018-03-15 18:30:58 +00:00
|
|
|
$(JDKLIB_LIBS), \
|
|
|
|
))
|
|
|
|
|
|
|
|
$(BUILD_LIBOSXSECURITY): $(BUILD_LIBJAVA)
|
|
|
|
|
|
|
|
TARGETS += $(BUILD_LIBOSXSECURITY)
|
|
|
|
|
|
|
|
endif
|
|
|
|
|
2018-03-26 18:44:32 +00:00
|
|
|
################################################################################
|
|
|
|
# Create the jsig library
|
|
|
|
|
2019-02-07 11:35:45 +00:00
|
|
|
ifeq ($(call isTargetOsType, unix), true)
|
2018-03-26 18:44:32 +00:00
|
|
|
ifeq ($(STATIC_BUILD), false)
|
2020-12-07 21:56:05 +00:00
|
|
|
LIBJSIG_CFLAGS += -DHOTSPOT_VM_DISTRO='"$(HOTSPOT_VM_DISTRO)"'
|
2018-03-26 18:44:32 +00:00
|
|
|
$(eval $(call SetupJdkLibrary, BUILD_LIBJSIG, \
|
|
|
|
NAME := jsig, \
|
2018-09-21 14:58:36 +00:00
|
|
|
OPTIMIZATION := LOW, \
|
2018-03-28 21:56:08 +00:00
|
|
|
CFLAGS := $(CFLAGS_JDKLIB) $(LIBJSIG_CFLAGS), \
|
2018-03-26 18:44:32 +00:00
|
|
|
LDFLAGS := $(LDFLAGS_JDKLIB) \
|
|
|
|
$(call SET_SHARED_LIBRARY_ORIGIN), \
|
|
|
|
LIBS_linux := $(LIBDL), \
|
|
|
|
LIBS_aix := $(LIBDL), \
|
|
|
|
))
|
|
|
|
|
|
|
|
TARGETS += $(BUILD_LIBJSIG)
|
|
|
|
|
|
|
|
############################################################################
|
|
|
|
# Create symlinks to libjsig in each JVM variant sub dir
|
2019-10-29 19:01:14 +00:00
|
|
|
ifneq ($(STATIC_LIBS), true)
|
|
|
|
LIB_OUTPUTDIR := $(call FindLibDirForModule, java.base)
|
|
|
|
|
|
|
|
# $1 variant subdir
|
|
|
|
define CreateSymlinks
|
|
|
|
# Always symlink from libdir/variant/libjsig.so -> ../libjsig.so.
|
|
|
|
$(LIB_OUTPUTDIR)/$1/$(call SHARED_LIBRARY,jsig): \
|
|
|
|
$(LIB_OUTPUTDIR)/$(call SHARED_LIBRARY,jsig)
|
2018-03-26 18:44:32 +00:00
|
|
|
$$(call MakeDir, $$(@D))
|
|
|
|
$(RM) $$@
|
|
|
|
$(LN) -s ../$$(@F) $$@
|
|
|
|
|
2019-10-29 19:01:14 +00:00
|
|
|
TARGETS += $(LIB_OUTPUTDIR)/$1/$(call SHARED_LIBRARY,jsig)
|
|
|
|
endef
|
2018-03-26 18:44:32 +00:00
|
|
|
|
2021-09-21 06:00:06 +00:00
|
|
|
# The subdir is the same as the variant
|
|
|
|
$(foreach v, $(JVM_VARIANTS), $(eval $(call CreateSymlinks,$v)))
|
2019-10-29 19:01:14 +00:00
|
|
|
endif
|
2018-03-26 18:44:32 +00:00
|
|
|
############################################################################
|
|
|
|
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2018-03-15 18:30:58 +00:00
|
|
|
################################################################################
|
|
|
|
# Create the symbols file for static builds.
|
2015-10-19 17:41:09 +00:00
|
|
|
|
|
|
|
ifeq ($(STATIC_BUILD), true)
|
|
|
|
JAVA_BASE_EXPORT_SYMBOLS_SRC := \
|
2018-09-20 19:05:00 +00:00
|
|
|
$(SUPPORT_OUTPUTDIR)/modules_libs/java.base/$(LIBRARY_PREFIX)jli.symbols \
|
2015-10-19 17:41:09 +00:00
|
|
|
$(SUPPORT_OUTPUTDIR)/modules_libs/java.base/$(LIBRARY_PREFIX)java.symbols \
|
|
|
|
$(SUPPORT_OUTPUTDIR)/modules_libs/java.base/$(LIBRARY_PREFIX)net.symbols \
|
|
|
|
$(SUPPORT_OUTPUTDIR)/modules_libs/java.base/$(LIBRARY_PREFIX)nio.symbols \
|
|
|
|
$(SUPPORT_OUTPUTDIR)/modules_libs/java.base/$(LIBRARY_PREFIX)verify.symbols \
|
|
|
|
$(SUPPORT_OUTPUTDIR)/modules_libs/java.base/$(LIBRARY_PREFIX)zip.symbols \
|
|
|
|
$(SUPPORT_OUTPUTDIR)/modules_libs/java.base/$(LIBRARY_PREFIX)jimage.symbols \
|
|
|
|
$(SUPPORT_OUTPUTDIR)/modules_libs/java.base/server/$(LIBRARY_PREFIX)jvm.symbols \
|
|
|
|
#
|
|
|
|
|
|
|
|
JAVA_BASE_EXPORT_SYMBOL_FILE := $(SUPPORT_OUTPUTDIR)/modules_libs/java.base/java.base.symbols
|
|
|
|
|
|
|
|
$(JAVA_BASE_EXPORT_SYMBOL_FILE): $(JAVA_BASE_EXPORT_SYMBOLS_SRC)
|
2016-01-16 12:01:44 +00:00
|
|
|
$(call LogInfo, Generating java.base.symbols file)
|
2015-10-19 17:41:09 +00:00
|
|
|
$(CAT) $^ > $@
|
|
|
|
|
|
|
|
# The individual symbol files is generated when the respective lib is built
|
|
|
|
$(JAVA_BASE_EXPORT_SYMBOLS_SRC): $(BUILD_LIBJLI) $(BUILD_LIBJAVA) \
|
2015-10-28 14:00:24 +00:00
|
|
|
$(BUILD_LIBNET) $(BUILD_LIBNIO) $(BUILD_LIBVERIFY) $(BUILD_LIBZIP) \
|
|
|
|
$(BUILD_LIBJIMAGE)
|
2015-10-19 17:41:09 +00:00
|
|
|
|
|
|
|
TARGETS += $(JAVA_BASE_EXPORT_SYMBOL_FILE)
|
|
|
|
endif
|
2018-09-13 20:41:17 +00:00
|
|
|
|
|
|
|
################################################################################
|
|
|
|
# Copy tzmappings file for Windows
|
|
|
|
|
2019-02-07 11:35:45 +00:00
|
|
|
ifeq ($(call isTargetOs, windows), true)
|
2018-09-13 20:41:17 +00:00
|
|
|
$(eval $(call SetupCopyFiles, COPY_TZMAPPINGS, \
|
|
|
|
FILES := $(SUPPORT_OUTPUTDIR)/gensrc/java.base/windows/conf/tzmappings, \
|
|
|
|
DEST := $(call FindLibDirForModule, $(MODULE)), \
|
|
|
|
))
|
|
|
|
TARGETS += $(COPY_TZMAPPINGS)
|
2018-09-20 19:05:00 +00:00
|
|
|
endif
|
2022-05-12 16:17:45 +00:00
|
|
|
|
|
|
|
################################################################################
|
|
|
|
# Create system lookup
|
|
|
|
|
|
|
|
$(eval $(call SetupJdkLibrary, BUILD_SYSLOOKUPLIB, \
|
|
|
|
NAME := syslookup, \
|
|
|
|
CFLAGS := $(CFLAGS_JDKLIB), \
|
|
|
|
CXXFLAGS := $(CXXFLAGS_JDKLIB), \
|
|
|
|
LDFLAGS := $(LDFLAGS_JDKLIB), \
|
|
|
|
LDFLAGS_linux := -Wl$(COMMA)--no-as-needed, \
|
|
|
|
LIBS := $(LIBCXX), \
|
|
|
|
LIBS_linux := -lc -lm -ldl, \
|
|
|
|
))
|
|
|
|
|
|
|
|
TARGETS += $(BUILD_SYSLOOKUPLIB)
|
2023-04-27 09:00:58 +00:00
|
|
|
|
|
|
|
################################################################################
|
|
|
|
# Create fallback linker lib
|
|
|
|
|
|
|
|
ifeq ($(ENABLE_FALLBACK_LINKER), true)
|
|
|
|
$(eval $(call SetupJdkLibrary, BUILD_LIBFALLBACKLINKER, \
|
|
|
|
NAME := fallbackLinker, \
|
|
|
|
CFLAGS := $(CFLAGS_JDKLIB) $(LIBFFI_CFLAGS), \
|
|
|
|
LDFLAGS := $(LDFLAGS_JDKLIB) \
|
|
|
|
$(call SET_SHARED_LIBRARY_ORIGIN), \
|
|
|
|
LIBS := $(LIBFFI_LIBS), \
|
2023-06-14 12:03:42 +00:00
|
|
|
LIBS_windows := $(LIBFFI_LIBS) ws2_32.lib, \
|
2023-04-27 09:00:58 +00:00
|
|
|
))
|
|
|
|
|
|
|
|
TARGETS += $(BUILD_LIBFALLBACKLINKER)
|
|
|
|
endif
|