2007-12-01 00:00:00 +00:00
|
|
|
#
|
2024-02-27 11:14:11 +00:00
|
|
|
# Copyright (c) 2011, 2024, 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
|
|
|
#
|
|
|
|
|
2024-04-11 14:15:34 +00:00
|
|
|
include CopyFiles.gmk
|
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
|
|
|
|
|
|
|
################################################################################
|
2024-03-25 15:04:38 +00:00
|
|
|
## Build libnet
|
|
|
|
################################################################################
|
2018-03-15 18:30:58 +00:00
|
|
|
|
|
|
|
$(eval $(call SetupJdkLibrary, BUILD_LIBNET, \
|
|
|
|
NAME := net, \
|
|
|
|
OPTIMIZATION := LOW, \
|
2024-08-29 07:29:12 +00:00
|
|
|
DISABLED_WARNINGS_gcc_net_util_md.c := format-nonliteral unused-variable, \
|
2022-10-05 05:56:44 +00:00
|
|
|
DISABLED_WARNINGS_gcc_NetworkInterface.c := unused-function, \
|
2024-08-30 16:43:16 +00:00
|
|
|
DISABLED_WARNINGS_clang_net_util_md.c := format-nonliteral \
|
|
|
|
unused-variable, \
|
|
|
|
DISABLED_WARNINGS_clang_NetworkInterface.c := unused-function, \
|
2024-03-25 15:04:38 +00:00
|
|
|
DISABLED_WARNINGS_clang_aix_DefaultProxySelector.c := \
|
|
|
|
deprecated-non-prototype, \
|
2023-06-07 13:42:03 +00:00
|
|
|
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, \
|
2024-03-25 15:04:38 +00:00
|
|
|
LDFLAGS_windows := -delayload:iphlpapi.dll -delayload:secur32.dll \
|
2023-09-21 15:43:05 +00:00
|
|
|
-delayload:winhttp.dll, \
|
2024-04-11 09:40:12 +00:00
|
|
|
JDK_LIBS := libjava libjvm, \
|
2022-10-24 15:25:48 +00:00
|
|
|
LIBS_linux := $(LIBDL), \
|
2024-09-03 15:31:09 +00:00
|
|
|
LIBS_aix := $(LIBDL), \
|
2024-03-25 15:04:38 +00:00
|
|
|
LIBS_windows := advapi32.lib delayimp.lib iphlpapi.lib secur32.lib \
|
|
|
|
winhttp.lib ws2_32.lib, \
|
|
|
|
LIBS_macosx := \
|
|
|
|
-framework CoreFoundation \
|
|
|
|
-framework CoreServices, \
|
2018-03-15 18:30:58 +00:00
|
|
|
))
|
|
|
|
|
|
|
|
TARGETS += $(BUILD_LIBNET)
|
|
|
|
|
|
|
|
################################################################################
|
2024-03-25 15:04:38 +00:00
|
|
|
## Build libnio
|
|
|
|
################################################################################
|
2018-03-15 18:30:58 +00:00
|
|
|
|
|
|
|
$(eval $(call SetupJdkLibrary, BUILD_LIBNIO, \
|
|
|
|
NAME := nio, \
|
|
|
|
OPTIMIZATION := HIGH, \
|
2018-06-08 16:11:32 +00:00
|
|
|
EXTRA_HEADER_DIRS := \
|
|
|
|
libnio/ch \
|
|
|
|
libnio/fs \
|
2024-04-11 09:40:12 +00:00
|
|
|
libjvm, \
|
2024-08-30 16:43:16 +00:00
|
|
|
DISABLED_WARNINGS_clang_Net.c := unused-function unused-variable, \
|
|
|
|
DISABLED_WARNINGS_clang_UnixNativeDispatcher.c := unused-variable, \
|
2024-04-11 09:40:12 +00:00
|
|
|
JDK_LIBS := libjava libnet, \
|
2024-03-25 15:04:38 +00:00
|
|
|
LIBS_linux := $(LIBDL) -lpthread, \
|
2018-03-15 18:30:58 +00:00
|
|
|
LIBS_aix := $(LIBDL), \
|
|
|
|
LIBS_macosx := \
|
2024-03-25 15:04:38 +00:00
|
|
|
-framework CoreFoundation \
|
|
|
|
-framework CoreServices, \
|
|
|
|
LIBS_windows := advapi32.lib mswsock.lib ws2_32.lib, \
|
2018-03-15 18:30:58 +00:00
|
|
|
))
|
|
|
|
|
|
|
|
TARGETS += $(BUILD_LIBNIO)
|
|
|
|
|
2019-02-07 11:35:45 +00:00
|
|
|
ifeq ($(call isTargetOs, macosx), true)
|
2024-03-25 15:04:38 +00:00
|
|
|
##############################################################################
|
|
|
|
## Build libosxsecurity
|
|
|
|
##############################################################################
|
2018-03-15 18:30:58 +00:00
|
|
|
|
2024-04-05 08:37:41 +00:00
|
|
|
$(eval $(call SetupJdkLibrary, BUILD_LIBOSXSECURITY, \
|
|
|
|
NAME := osxsecurity, \
|
|
|
|
OPTIMIZATION := LOW, \
|
2024-08-30 16:43:16 +00:00
|
|
|
DISABLED_WARNINGS_clang_KeystoreImpl.m := deprecated-declarations \
|
|
|
|
unused-but-set-variable unused-variable, \
|
2024-04-11 09:40:12 +00:00
|
|
|
JDK_LIBS := libjava, \
|
2024-04-05 08:37:41 +00:00
|
|
|
LIBS_macosx := -lobjc \
|
|
|
|
-framework CoreServices \
|
|
|
|
-framework Foundation \
|
|
|
|
-framework Security, \
|
|
|
|
))
|
|
|
|
|
|
|
|
TARGETS += $(BUILD_LIBOSXSECURITY)
|
2018-03-15 18:30:58 +00:00
|
|
|
endif
|
|
|
|
|
2024-06-03 10:03:42 +00:00
|
|
|
ifeq ($(call isTargetOsType, unix), true)
|
2024-03-25 15:04:38 +00:00
|
|
|
##############################################################################
|
|
|
|
## Build libjsig
|
|
|
|
##############################################################################
|
|
|
|
|
|
|
|
$(eval $(call SetupJdkLibrary, BUILD_LIBJSIG, \
|
|
|
|
NAME := jsig, \
|
|
|
|
OPTIMIZATION := LOW, \
|
|
|
|
jsig.c_CFLAGS := -DHOTSPOT_VM_DISTRO='"$(HOTSPOT_VM_DISTRO)"', \
|
2024-08-29 07:29:12 +00:00
|
|
|
DISABLED_WARNINGS_gcc_jsig.c := unused-but-set-variable, \
|
2024-08-30 16:43:16 +00:00
|
|
|
DISABLED_WARNINGS_clang_jsig.c := unused-but-set-variable, \
|
2024-03-25 15:04:38 +00:00
|
|
|
LIBS_linux := $(LIBDL), \
|
|
|
|
LIBS_aix := $(LIBDL), \
|
|
|
|
))
|
2018-03-26 18:44:32 +00:00
|
|
|
|
2024-03-25 15:04:38 +00:00
|
|
|
TARGETS += $(BUILD_LIBJSIG)
|
2018-03-26 18:44:32 +00:00
|
|
|
|
2024-03-25 15:04:38 +00:00
|
|
|
##############################################################################
|
|
|
|
# Create symlinks to libjsig in each JVM variant sub dir
|
|
|
|
ifneq ($(STATIC_LIBS), true)
|
|
|
|
LIB_OUTPUTDIR := $(call FindLibDirForModule, java.base)
|
2024-04-16 13:51:14 +00:00
|
|
|
LIBJSIG_NAME := $(LIBRARY_PREFIX)jsig$(SHARED_LIBRARY_SUFFIX)
|
2019-10-29 19:01:14 +00:00
|
|
|
|
2024-03-25 15:04:38 +00:00
|
|
|
# $1 variant subdir
|
|
|
|
define CreateSymlinks
|
|
|
|
# Always symlink from libdir/variant/libjsig.so -> ../libjsig.so.
|
2024-04-16 13:51:14 +00:00
|
|
|
$(LIB_OUTPUTDIR)/$1/$(LIBJSIG_NAME): \
|
|
|
|
$(LIB_OUTPUTDIR)/$(LIBJSIG_NAME)
|
2018-03-26 18:44:32 +00:00
|
|
|
$$(call MakeDir, $$(@D))
|
|
|
|
$(RM) $$@
|
|
|
|
$(LN) -s ../$$(@F) $$@
|
|
|
|
|
2024-04-16 13:51:14 +00:00
|
|
|
TARGETS += $(LIB_OUTPUTDIR)/$1/$(LIBJSIG_NAME)
|
2024-03-25 15:04:38 +00:00
|
|
|
endef
|
2018-03-26 18:44:32 +00:00
|
|
|
|
2024-03-25 15:04:38 +00:00
|
|
|
# The subdir is the same as the variant
|
|
|
|
$(foreach v, $(JVM_VARIANTS), $(eval $(call CreateSymlinks,$v)))
|
2018-03-26 18:44:32 +00:00
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2018-09-13 20:41:17 +00:00
|
|
|
################################################################################
|
2024-03-25 15:04:38 +00:00
|
|
|
## Build libsyslookup
|
2022-05-12 16:17:45 +00:00
|
|
|
################################################################################
|
|
|
|
|
2024-03-25 15:04:38 +00:00
|
|
|
$(eval $(call SetupJdkLibrary, BUILD_LIBSYSLOOKUP, \
|
2022-05-12 16:17:45 +00:00
|
|
|
NAME := syslookup, \
|
2024-03-18 14:41:51 +00:00
|
|
|
LD_SET_ORIGIN := false, \
|
2022-05-12 16:17:45 +00:00
|
|
|
LDFLAGS_linux := -Wl$(COMMA)--no-as-needed, \
|
2023-11-22 15:43:34 +00:00
|
|
|
LDFLAGS_aix := -brtl -bexpfull, \
|
2024-03-25 15:04:38 +00:00
|
|
|
LIBS_linux := $(LIBDL) $(LIBM), \
|
|
|
|
LIBS_aix := -ldecNumber $(LIBM), \
|
2022-05-12 16:17:45 +00:00
|
|
|
))
|
|
|
|
|
2024-03-25 15:04:38 +00:00
|
|
|
TARGETS += $(BUILD_LIBSYSLOOKUP)
|
2023-04-27 09:00:58 +00:00
|
|
|
|
|
|
|
ifeq ($(ENABLE_FALLBACK_LINKER), true)
|
2024-03-25 15:04:38 +00:00
|
|
|
##############################################################################
|
|
|
|
## Build libfallbackLinker
|
|
|
|
##############################################################################
|
|
|
|
|
2023-04-27 09:00:58 +00:00
|
|
|
$(eval $(call SetupJdkLibrary, BUILD_LIBFALLBACKLINKER, \
|
|
|
|
NAME := fallbackLinker, \
|
2024-04-11 09:40:12 +00:00
|
|
|
EXTRA_HEADER_DIRS := java.base:libjava, \
|
2024-03-15 14:36:57 +00:00
|
|
|
CFLAGS := $(LIBFFI_CFLAGS), \
|
2024-08-29 07:29:12 +00:00
|
|
|
DISABLED_WARNINGS_gcc := implicit-function-declaration unused-variable, \
|
2023-04-27 09:00:58 +00:00
|
|
|
LIBS := $(LIBFFI_LIBS), \
|
2024-03-25 15:04:38 +00:00
|
|
|
LIBS_windows := ws2_32.lib, \
|
2023-04-27 09:00:58 +00:00
|
|
|
))
|
|
|
|
|
|
|
|
TARGETS += $(BUILD_LIBFALLBACKLINKER)
|
|
|
|
endif
|
2023-10-06 20:15:30 +00:00
|
|
|
|
|
|
|
ifeq ($(call isTargetOs, linux)+$(call isTargetCpu, x86_64)+$(INCLUDE_COMPILER2)+$(filter $(TOOLCHAIN_TYPE), gcc), true+true+true+gcc)
|
2024-03-25 15:04:38 +00:00
|
|
|
##############################################################################
|
|
|
|
## Build libsimdsort
|
|
|
|
##############################################################################
|
|
|
|
|
|
|
|
$(eval $(call SetupJdkLibrary, BUILD_LIBSIMD_SORT, \
|
2023-10-06 20:15:30 +00:00
|
|
|
NAME := simdsort, \
|
2024-02-27 11:14:11 +00:00
|
|
|
LINK_TYPE := C++, \
|
2023-10-06 20:15:30 +00:00
|
|
|
OPTIMIZATION := HIGH, \
|
2024-03-15 14:36:57 +00:00
|
|
|
CXXFLAGS := -std=c++17, \
|
2024-08-29 07:29:12 +00:00
|
|
|
DISABLED_WARNINGS_gcc := unused-variable, \
|
2024-03-25 15:04:38 +00:00
|
|
|
LIBS_linux := $(LIBDL) $(LIBM), \
|
2023-10-06 20:15:30 +00:00
|
|
|
))
|
|
|
|
|
2024-03-25 15:04:38 +00:00
|
|
|
TARGETS += $(BUILD_LIBSIMD_SORT)
|
2023-10-06 20:15:30 +00:00
|
|
|
endif
|