8329704: Implement framework for proper handling of JDK_LIBS

Reviewed-by: erikj, jwaters
This commit is contained in:
Magnus Ihse Bursie 2024-04-11 09:40:12 +00:00
parent 8817ba450c
commit f0cd866a37
38 changed files with 312 additions and 367 deletions

View File

@ -476,15 +476,6 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_HELPER],
# Always enable optional macros for VM. # Always enable optional macros for VM.
ALWAYS_CFLAGS_JVM="-D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS" ALWAYS_CFLAGS_JVM="-D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS"
# Setup some hard coded includes
ALWAYS_CFLAGS_JDK=" \
-I\$(SUPPORT_OUTPUTDIR)/modules_include/java.base \
-I\$(SUPPORT_OUTPUTDIR)/modules_include/java.base/\$(OPENJDK_TARGET_OS_INCLUDE_SUBDIR) \
-I${TOPDIR}/src/java.base/share/native/libjava \
-I${TOPDIR}/src/java.base/$OPENJDK_TARGET_OS_TYPE/native/libjava \
-I${TOPDIR}/src/hotspot/share/include \
-I${TOPDIR}/src/hotspot/os/${HOTSPOT_TARGET_OS_TYPE}/include"
############################################################################### ###############################################################################
# Adjust flags according to debug level. # Adjust flags according to debug level.
@ -871,7 +862,7 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_CPU_DEP],
$WARNING_CFLAGS $WARNING_CFLAGS_JVM $JVM_PICFLAG $FILE_MACRO_CFLAGS \ $WARNING_CFLAGS $WARNING_CFLAGS_JVM $JVM_PICFLAG $FILE_MACRO_CFLAGS \
$REPRODUCIBLE_CFLAGS $BRANCH_PROTECTION_CFLAGS" $REPRODUCIBLE_CFLAGS $BRANCH_PROTECTION_CFLAGS"
CFLAGS_JDK_COMMON="$ALWAYS_CFLAGS_JDK $ALWAYS_DEFINES_JDK $TOOLCHAIN_CFLAGS_JDK \ CFLAGS_JDK_COMMON="$ALWAYS_DEFINES_JDK $TOOLCHAIN_CFLAGS_JDK \
$OS_CFLAGS $CFLAGS_OS_DEF_JDK $DEBUG_CFLAGS_JDK $DEBUG_OPTIONS_FLAGS_JDK \ $OS_CFLAGS $CFLAGS_OS_DEF_JDK $DEBUG_CFLAGS_JDK $DEBUG_OPTIONS_FLAGS_JDK \
$WARNING_CFLAGS $WARNING_CFLAGS_JDK $DEBUG_SYMBOLS_CFLAGS_JDK \ $WARNING_CFLAGS $WARNING_CFLAGS_JDK $DEBUG_SYMBOLS_CFLAGS_JDK \
$FILE_MACRO_CFLAGS $REPRODUCIBLE_CFLAGS $BRANCH_PROTECTION_CFLAGS" $FILE_MACRO_CFLAGS $REPRODUCIBLE_CFLAGS $BRANCH_PROTECTION_CFLAGS"

View File

@ -31,22 +31,11 @@ AC_DEFUN([FLAGS_SETUP_LDFLAGS],
FLAGS_SETUP_LDFLAGS_HELPER FLAGS_SETUP_LDFLAGS_HELPER
# Setup the target toolchain # Setup the target toolchain
# The target dir matches the name of VM variant
TARGET_JVM_VARIANT_PATH=$JVM_VARIANT_MAIN
# On some platforms (mac) the linker warns about non existing -L dirs.
FLAGS_SETUP_LDFLAGS_CPU_DEP([TARGET]) FLAGS_SETUP_LDFLAGS_CPU_DEP([TARGET])
# Setup the build toolchain # Setup the build toolchain
# When building a buildjdk, it's always only the server variant
BUILD_JVM_VARIANT_PATH=server
FLAGS_SETUP_LDFLAGS_CPU_DEP([BUILD], [OPENJDK_BUILD_]) FLAGS_SETUP_LDFLAGS_CPU_DEP([BUILD], [OPENJDK_BUILD_])
LDFLAGS_TESTEXE="${TARGET_LDFLAGS_JDK_LIBPATH}"
AC_SUBST(LDFLAGS_TESTEXE)
AC_SUBST(ADLC_LDFLAGS) AC_SUBST(ADLC_LDFLAGS)
]) ])
@ -155,7 +144,7 @@ AC_DEFUN([FLAGS_SETUP_LDFLAGS_HELPER],
fi fi
# Export some intermediate variables for compatibility # Export some intermediate variables for compatibility
LDFLAGS_CXX_JDK="$BASIC_LDFLAGS_ONLYCXX $BASIC_LDFLAGS_ONLYCXX_JDK_ONLY $DEBUGLEVEL_LDFLAGS_JDK_ONLY" LDFLAGS_CXX_JDK="$DEBUGLEVEL_LDFLAGS_JDK_ONLY"
AC_SUBST(LDFLAGS_CXX_JDK) AC_SUBST(LDFLAGS_CXX_JDK)
AC_SUBST(LDFLAGS_CXX_PARTIAL_LINKING) AC_SUBST(LDFLAGS_CXX_PARTIAL_LINKING)
]) ])
@ -197,20 +186,11 @@ AC_DEFUN([FLAGS_SETUP_LDFLAGS_CPU_DEP],
fi fi
fi fi
# JVM_VARIANT_PATH depends on if this is build or target...
if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
$1_LDFLAGS_JDK_LIBPATH="-libpath:\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base"
else
$1_LDFLAGS_JDK_LIBPATH="-L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base \
-L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base/${$1_JVM_VARIANT_PATH}"
fi
# Export variables according to old definitions, prefix with $2 if present. # Export variables according to old definitions, prefix with $2 if present.
LDFLAGS_JDK_COMMON="$BASIC_LDFLAGS $BASIC_LDFLAGS_JDK_ONLY \ LDFLAGS_JDK_COMMON="$BASIC_LDFLAGS $BASIC_LDFLAGS_JDK_ONLY \
$OS_LDFLAGS $DEBUGLEVEL_LDFLAGS_JDK_ONLY ${$2EXTRA_LDFLAGS}" $OS_LDFLAGS $DEBUGLEVEL_LDFLAGS_JDK_ONLY ${$2EXTRA_LDFLAGS}"
$2LDFLAGS_JDKLIB="$LDFLAGS_JDK_COMMON $BASIC_LDFLAGS_JDK_LIB_ONLY \ $2LDFLAGS_JDKLIB="$LDFLAGS_JDK_COMMON $BASIC_LDFLAGS_JDK_LIB_ONLY \
${$1_LDFLAGS_JDK_LIBPATH} $SHARED_LIBRARY_FLAGS \ $SHARED_LIBRARY_FLAGS $REPRODUCIBLE_LDFLAGS $FILE_MACRO_LDFLAGS"
$REPRODUCIBLE_LDFLAGS $FILE_MACRO_LDFLAGS"
$2LDFLAGS_JDKEXE="$LDFLAGS_JDK_COMMON $EXECUTABLE_LDFLAGS \ $2LDFLAGS_JDKEXE="$LDFLAGS_JDK_COMMON $EXECUTABLE_LDFLAGS \
${$1_CPU_EXECUTABLE_LDFLAGS} $REPRODUCIBLE_LDFLAGS $FILE_MACRO_LDFLAGS" ${$1_CPU_EXECUTABLE_LDFLAGS} $REPRODUCIBLE_LDFLAGS $FILE_MACRO_LDFLAGS"

View File

@ -129,12 +129,6 @@ AC_DEFUN_ONCE([LIB_SETUP_LIBRARIES],
LIB_TESTS_SETUP_GTEST LIB_TESTS_SETUP_GTEST
BASIC_JDKLIB_LIBS=""
BASIC_JDKLIB_LIBS_TARGET=""
if test "x$TOOLCHAIN_TYPE" != xmicrosoft; then
BASIC_JDKLIB_LIBS="-ljava -ljvm"
fi
# Math library # Math library
BASIC_JVM_LIBS="$LIBM" BASIC_JVM_LIBS="$LIBM"
@ -170,12 +164,10 @@ AC_DEFUN_ONCE([LIB_SETUP_LIBRARIES],
LIB_SETUP_JVM_LIBS(BUILD) LIB_SETUP_JVM_LIBS(BUILD)
LIB_SETUP_JVM_LIBS(TARGET) LIB_SETUP_JVM_LIBS(TARGET)
JDKLIB_LIBS="$BASIC_JDKLIB_LIBS"
JVM_LIBS="$BASIC_JVM_LIBS $BASIC_JVM_LIBS_TARGET" JVM_LIBS="$BASIC_JVM_LIBS $BASIC_JVM_LIBS_TARGET"
OPENJDK_BUILD_JDKLIB_LIBS="$BASIC_JDKLIB_LIBS" OPENJDK_BUILD_JDKLIB_LIBS=""
OPENJDK_BUILD_JVM_LIBS="$BASIC_JVM_LIBS $BASIC_JVM_LIBS_BUILD" OPENJDK_BUILD_JVM_LIBS="$BASIC_JVM_LIBS $BASIC_JVM_LIBS_BUILD"
AC_SUBST(JDKLIB_LIBS)
AC_SUBST(JVM_LIBS) AC_SUBST(JVM_LIBS)
AC_SUBST(OPENJDK_BUILD_JDKLIB_LIBS) AC_SUBST(OPENJDK_BUILD_JDKLIB_LIBS)
AC_SUBST(OPENJDK_BUILD_JVM_LIBS) AC_SUBST(OPENJDK_BUILD_JVM_LIBS)

View File

@ -555,7 +555,6 @@ SYSROOT := @SYSROOT@
# LDFLAGS used to link the jdk native libraries (C-code) # LDFLAGS used to link the jdk native libraries (C-code)
LDFLAGS_JDKLIB := @LDFLAGS_JDKLIB@ LDFLAGS_JDKLIB := @LDFLAGS_JDKLIB@
JDKLIB_LIBS := @JDKLIB_LIBS@
# LDFLAGS used to link the jdk native launchers (C-code) # LDFLAGS used to link the jdk native launchers (C-code)
LDFLAGS_JDKEXE := @LDFLAGS_JDKEXE@ LDFLAGS_JDKEXE := @LDFLAGS_JDKEXE@
@ -571,9 +570,6 @@ LDCXX := @LDCXX@
# The flags for linking libstdc++ linker. # The flags for linking libstdc++ linker.
LIBCXX := @LIBCXX@ LIBCXX := @LIBCXX@
# Compiler and linker flags used when building native tests
LDFLAGS_TESTEXE := @LDFLAGS_TESTEXE@
# BUILD_CC/BUILD_LD is a compiler/linker that generates code that is runnable on the # BUILD_CC/BUILD_LD is a compiler/linker that generates code that is runnable on the
# build platform. # build platform.
BUILD_CC := @BUILD_ICECC@ @BUILD_CC@ BUILD_CC := @BUILD_ICECC@ @BUILD_CC@

View File

@ -76,18 +76,161 @@ endif
GetJavaHeaderDir = \ GetJavaHeaderDir = \
$(if $(strip $1),$(wildcard $(SUPPORT_OUTPUTDIR)/headers/$(strip $1))) $(if $(strip $1),$(wildcard $(SUPPORT_OUTPUTDIR)/headers/$(strip $1)))
# Process a dir description such as "java.base:headers" into a set of proper absolute paths. HOTSPOT_INCLUDE_DIR := $(TOPDIR)/src/hotspot/share/include \
ProcessDir = \ $(TOPDIR)/src/hotspot/os/$(HOTSPOT_TARGET_OS_TYPE)/include
# Preprocess a source dir destination. Pass on absolute paths unchanged. Expand
# description such as "java.base:headers" into a set of proper absolute paths,
# by looking in $MODULE/[shared|$OS|$OSTYPE]/native.
# Treat *:libjvm as a special case, and replace it with the proper hotspot
# include directories.
ProcessSrcDir = \
$(if $(findstring :, $1), \ $(if $(findstring :, $1), \
$(call FindSrcDirsForComponent, $(firstword $(subst :, , $1)), $(lastword $(subst :, , $1))) \ $(if $(filter %:libjvm, $1), \
$(HOTSPOT_INCLUDE_DIR) \
, \
$(call FindSrcDirsForComponent, $(firstword $(subst :, , $1)), \
$(lastword $(subst :, , $1))) \
) \
, \ , \
$(if $(filter /%, $1), \ $(if $(filter /%, $1), \
$1 \ $1 \
, \ , \
$(call FindSrcDirsForComponent, $(MODULE), $1) \ $(if $(filter libjvm, $1), \
$(HOTSPOT_INCLUDE_DIR) \
, \
$(call FindSrcDirsForComponent, $(MODULE), $1) \
) \
) \ ) \
) )
# Create a proper LIBPATH for the given library. Sets result in $1_$2_LIBPATH.
# $1: The name of the rule (namespace)
# $2: The safe namespace of the library
define ResolveLibPath
# Determine proper LIBPATH. This is quite messy due to historical reasons,
# and because we need to have special treatment for "gtest:" and ":jvm".
ifneq ($$($1_$2_MODULE), gtest)
ifneq ($$($1_$2_NAME), jvm)
# This is the common case
ifeq ($$(call isTargetOs, windows), true)
$1_$2_LIBPATH := $$(SUPPORT_OUTPUTDIR)/native/$$($1_$2_MODULE)/lib$$($1_$2_NAME)
else
ifeq ($(STATIC_LIBS), true)
$1_$2_LIBPATH := $$(SUPPORT_OUTPUTDIR)/native/$$($1_$2_MODULE)/lib$$($1_$2_NAME)/static
else
$1_$2_LIBPATH := $$(SUPPORT_OUTPUTDIR)/modules_libs/$$($1_$2_MODULE)
endif
endif
else
# Special treatment for hotspot
ifeq ($(CREATING_BUILDJDK), true)
# When building a buildjdk, it's always only the server variant
$1_$2_JVM_VARIANT_PATH := server
else
$1_$2_JVM_VARIANT_PATH := $(JVM_VARIANT_MAIN)
endif
ifeq ($$(call isTargetOs, windows), true)
ifeq ($(STATIC_LIBS), true)
$1_$2_LIBPATH := $$(HOTSPOT_OUTPUTDIR)/variant-$$($1_$2_JVM_VARIANT_PATH)/libjvm/objs/static
else
$1_$2_LIBPATH := $$(SUPPORT_OUTPUTDIR)/modules_libs/$$($1_$2_MODULE)
endif
else
ifeq ($(STATIC_LIBS), true)
$1_$2_LIBPATH := $$(HOTSPOT_OUTPUTDIR)/variant-$$($1_$2_JVM_VARIANT_PATH)/libjvm/objs/static
else
$1_$2_LIBPATH := $$(SUPPORT_OUTPUTDIR)/modules_libs/$$($1_$2_MODULE)/$$($1_$2_JVM_VARIANT_PATH)
endif
endif
endif
else
# Special treatment for virtual module "gtest"
ifeq ($$($1_$2_NAME), jvm)
ifeq ($$(call isTargetOs, windows), true)
ifeq ($(STATIC_LIBS), true)
$1_$2_LIBPATH := $$(JVM_OUTPUTDIR)/gtest/objs/static
else
$1_$2_LIBPATH := $$(JVM_OUTPUTDIR)/gtest/objs
endif
else
ifeq ($(STATIC_LIBS), true)
$1_$2_LIBPATH := $$(JVM_OUTPUTDIR)/gtest/objs/static
else
$1_$2_LIBPATH := $$(JVM_OUTPUTDIR)/gtest
endif
endif
else ifeq ($$($1_$2_NAME), gtest)
$1_$2_LIBPATH := $$(JVM_OUTPUTDIR)/libgtest
ifeq ($(STATIC_LIBS), true)
$1_$2_LIBPATH := $$(JVM_OUTPUTDIR)/libgtest/objs/static
else
$1_$2_LIBPATH := $$(JVM_OUTPUTDIR)/libgtest
endif
endif
endif
endef
# Process a JDK library designation such as "java.desktop:jawt" into the needed
# additions to EXTRA_LINK_DEPS, LDFLAGS, LIBS and EXTRA_HEADER_DIRS.
# $1: The name of the rule (namespace)
# $2: The safe namespace of the library
# $3: The actual string given to represent the library
define AddJdkLibrary
$1_$2_NAME := $$(strip $$(lastword $$(subst :, , $3)))
$1_$2_MODULE := $$(strip $$(patsubst %$$($1_$2_NAME), %, $3))
ifeq ($$(filter lib%, $$($1_$2_NAME)),)
$$(error Library name $$($1_$2_NAME) missing lib prefix in $1)
endif
$1_$2_NAME := $$(strip $$(patsubst lib%, %, $$($1_$2_NAME)))
ifeq ($$($1_$2_MODULE),)
$1_$2_MODULE := $$(MODULE)
else
$1_$2_MODULE := $$(strip $$(patsubst %:, %, $$($1_$2_MODULE)))
endif
# Determine if the library in question is static.
ifeq ($(STATIC_BUILD), true)
$1_$2_STATIC_LIBRARY := true
endif
# Ideally, we should not hardcode these
ifeq ($(call isTargetOs, aix)+$$($1_$2_MODULE):$$($1_$2_NAME), true+java.base:jli)
$1_$2_STATIC_LIBRARY := true
endif
ifeq ($$($1_$2_MODULE):$$($1_$2_NAME), gtest:gtest)
$1_$2_STATIC_LIBRARY := true
endif
# Setup $1_$2_LIBPATH.
$$(eval $$(call ResolveLibPath,$1,$2))
$1_EXTRA_HEADER_DIRS += $$($1_$2_MODULE):lib$$($1_$2_NAME)
ifneq ($(STATIC_LIBS), true)
ifeq ($$(call isTargetOs, windows), true)
ifeq ($$(filter -libpath:$$($1_$2_LIBPATH), $$($1_LDFLAGS)), )
$1_LDFLAGS += -libpath:$$($1_$2_LIBPATH)
endif
$1_LIBS += $$($1_$2_NAME)$(STATIC_LIBRARY_SUFFIX)
$1_$2_LIBFILE := $(LIBRARY_PREFIX)$$($1_$2_NAME)$(STATIC_LIBRARY_SUFFIX)
else
ifeq ($$(filter -L$$($1_$2_LIBPATH), $$($1_LDFLAGS)), )
$1_LDFLAGS += -L$$($1_$2_LIBPATH)
endif
$1_LIBS += -l$$($1_$2_NAME)
ifeq ($$($1_$2_STATIC_LIBRARY), true)
$1_$2_LIBFILE := $(LIBRARY_PREFIX)$$($1_$2_NAME)$(STATIC_LIBRARY_SUFFIX)
else
$1_$2_LIBFILE := $(LIBRARY_PREFIX)$$($1_$2_NAME)$(SHARED_LIBRARY_SUFFIX)
endif
endif
$1_EXTRA_LINK_DEPS += $$($1_$2_LIBPATH)/$$($1_$2_LIBFILE)
endif
endef
GLOBAL_VERSION_INFO_RESOURCE := $(TOPDIR)/src/java.base/windows/native/common/version.rc GLOBAL_VERSION_INFO_RESOURCE := $(TOPDIR)/src/java.base/windows/native/common/version.rc
JDK_RCFLAGS=$(RCFLAGS) \ JDK_RCFLAGS=$(RCFLAGS) \
@ -109,19 +252,32 @@ JDK_RCFLAGS=$(RCFLAGS) \
# SetupNativeCompilation. This macro also adds the following additional # SetupNativeCompilation. This macro also adds the following additional
# arguments: # arguments:
# #
# EXTRA_RCFLAGS -- additional RCFLAGS to append. # SRC -- this is passed on after preprocessing. The preprocessing will pass on
# EXTRA_HEADER_DIRS -- additional directories to look for headers in # absolute paths unchanged, but relative paths will be expanded to include
# EXTRA_SRC -- additional directories to look for source in # all directories with this name in $MODULE/[shared|$OS|$OSTYPE]/native.
# EXTRA_SRC -- additional directories to look for source in. This is processed
# like SRC.
# EXCLUDE_SRC_PATTERNS -- exclude source dirs matching these patterns from # EXCLUDE_SRC_PATTERNS -- exclude source dirs matching these patterns from
# appearing in SRC. # appearing in SRC.
# EXTRA_HEADER_DIRS -- additional directories to look for headers in. This can
# be specified either as an absolute path, or relative directory names which
# are preprocessed like SRC, or in the format <module>:<directory>, which
# will be processed like SRC but for the given module. The names
# "java.base:libjvm" and "gtest:libjvm" symbolise virtual libraries that
# will be replaced with proper values for hotspot.
# HEADERS_FROM_SRC -- if false, does not add source dirs automatically as # HEADERS_FROM_SRC -- if false, does not add source dirs automatically as
# header include dirs. (Defaults to true.) # header include dirs. (Defaults to true.)
# SRC -- this is passed on, but preprocessed to accept source dir designations # JDK_LIBS -- libraries generated by the JDK build system to link against.
# RC_FILEDESC -- override the default FILEDESC for Windows version.rc # These take the form <module>:<basename>. For the current module, the
# such as "java.base:headers". # module name and colon can be omitted. The basename should be specified
# JDK_LIBS -- libraries generated by the JDK build system to link against # as the source directory, e.g. "libjava". The gtest module is a virtual
# module that will be replaced with correct values for gtest. When
# specifying JDK_LIBS, suitable values for EXTRA_LINK_DEPS, LDFLAGS, LIBS
# and EXTRA_HEADER_DIRS will be added.
# JDK_LIBS_<os> or JDK_LIBS_<osType> -- additional JDK_LIBS for the given OS # JDK_LIBS_<os> or JDK_LIBS_<osType> -- additional JDK_LIBS for the given OS
# or OS type only # or OS type only
# EXTRA_RCFLAGS -- additional RCFLAGS to append.
# RC_FILEDESC -- override the default FILEDESC for Windows version.rc
# DEFAULT_LIBCXX -- if false, do not add LIBCXX to LIBS for C++ compilations # DEFAULT_LIBCXX -- if false, do not add LIBCXX to LIBS for C++ compilations
# DEFAULT_CFLAGS -- if false, do not add default CFLAGS and CXXFLAGS # DEFAULT_CFLAGS -- if false, do not add default CFLAGS and CXXFLAGS
# DEFAULT_LDFLAGS -- if false, do not add default LDFLAGS # DEFAULT_LDFLAGS -- if false, do not add default LDFLAGS
@ -183,10 +339,10 @@ define SetupJdkNativeCompilationBody
endif endif
endif endif
else else
$1_SRC := $$(foreach dir, $$($1_SRC), $$(call ProcessDir, $$(dir))) $1_SRC := $$(foreach dir, $$($1_SRC), $$(call ProcessSrcDir, $$(dir)))
endif endif
ifneq ($$($1_EXTRA_SRC), ) ifneq ($$($1_EXTRA_SRC), )
$1_SRC += $$(foreach dir, $$($1_EXTRA_SRC), $$(call ProcessDir, $$(dir))) $1_SRC += $$(foreach dir, $$($1_EXTRA_SRC), $$(call ProcessSrcDir, $$(dir)))
endif endif
ifneq ($$($1_EXCLUDE_SRC_PATTERNS), ) ifneq ($$($1_EXCLUDE_SRC_PATTERNS), )
@ -224,14 +380,19 @@ define SetupJdkNativeCompilationBody
$1_JDK_LIBS += $$($1_JDK_LIBS_$$(OPENJDK_TARGET_OS)) $1_JDK_LIBS += $$($1_JDK_LIBS_$$(OPENJDK_TARGET_OS))
$1_JDK_LIBS += $$($1_JDK_LIBS_$$(OPENJDK_TARGET_OS_TYPE)) $1_JDK_LIBS += $$($1_JDK_LIBS_$$(OPENJDK_TARGET_OS_TYPE))
# Prepend JDK libs before external libs $$(foreach lib, $$($1_JDK_LIBS), \
$1_LIBS := $$($1_JDK_LIBS) $$($1_LIBS) $$(eval $$(call AddJdkLibrary,$1,$$(subst :,_,$$(lib)),$$(lib))) \
)
ifneq ($$($1_EXTRA_HEADER_DIRS), ) # Add the include path for jni.h to all native compilations
$1_PROCESSED_EXTRA_HEADER_DIRS := $$(foreach dir, $$($1_EXTRA_HEADER_DIRS), \ $1_EXTRA_HEADER_DIRS += \
$$(call ProcessDir, $$(dir))) $(SUPPORT_OUTPUTDIR)/modules_include/java.base \
$1_EXTRA_HEADER_FLAGS := $$(addprefix -I, $$($1_PROCESSED_EXTRA_HEADER_DIRS)) java.base:include \
endif #
$1_PROCESSED_EXTRA_HEADER_DIRS := $$(foreach dir, $$($1_EXTRA_HEADER_DIRS), \
$$(call ProcessSrcDir, $$(dir)))
$1_EXTRA_HEADER_FLAGS := $$(addprefix -I, $$($1_PROCESSED_EXTRA_HEADER_DIRS))
ifneq ($$($1_DEFAULT_CFLAGS), false) ifneq ($$($1_DEFAULT_CFLAGS), false)
ifeq ($$($1_TYPE), EXECUTABLE) ifeq ($$($1_TYPE), EXECUTABLE)

View File

@ -84,6 +84,7 @@ include native/Paths.gmk
# EXTRA_FILES List of extra files not in any of the SRC dirs # EXTRA_FILES List of extra files not in any of the SRC dirs
# EXTRA_OBJECT_FILES List of extra object files to include when linking # EXTRA_OBJECT_FILES List of extra object files to include when linking
# EXTRA_DEPS List of extra dependencies to be added to each compiled file # EXTRA_DEPS List of extra dependencies to be added to each compiled file
# EXTRA_LINK_DEPS List of extra dependencies to be added to the link stage
# VERSIONINFO_RESOURCE Input file for RC. Setting this implies that RC will be run # VERSIONINFO_RESOURCE Input file for RC. Setting this implies that RC will be run
# RCFLAGS flags for RC. # RCFLAGS flags for RC.
# EMBED_MANIFEST if true, embed manifest on Windows. # EMBED_MANIFEST if true, embed manifest on Windows.

View File

@ -69,7 +69,6 @@ define SetupTestFilesCompilationBody
$1_COMPILATION_TYPE := EXECUTABLE $1_COMPILATION_TYPE := EXECUTABLE
$1_LOG_TYPE := executable $1_LOG_TYPE := executable
$1_LD_SET_ORIGIN := false $1_LD_SET_ORIGIN := false
$1_LDFLAGS := $(LDFLAGS_TESTEXE)
else else
$$(error Unknown type: $$($1_TYPE)) $$(error Unknown type: $$($1_TYPE))
endif endif
@ -103,17 +102,21 @@ define SetupTestFilesCompilationBody
NAME := $$(unprefixed_name), \ NAME := $$(unprefixed_name), \
TYPE := $$($1_COMPILATION_TYPE), \ TYPE := $$($1_COMPILATION_TYPE), \
LINK_TYPE := $(if $$(filter %.cpp, $$(file)), C++, C), \ LINK_TYPE := $(if $$(filter %.cpp, $$(file)), C++, C), \
EXTRA_HEADER_DIRS := \
java.base:libjava \
java.base:libjvm, \
EXTRA_FILES := $$(file) $$($1_EXTRA_FILES), \ EXTRA_FILES := $$(file) $$($1_EXTRA_FILES), \
OBJECT_DIR := $$($1_OUTPUT_DIR)/support/$$(name), \ OBJECT_DIR := $$($1_OUTPUT_DIR)/support/$$(name), \
OUTPUT_DIR := $$($1_OUTPUT_DIR)/$$($1_OUTPUT_SUBDIR), \ OUTPUT_DIR := $$($1_OUTPUT_DIR)/$$($1_OUTPUT_SUBDIR), \
CFLAGS := $$(TEST_CFLAGS) $$($1_CFLAGS) $$($1_CFLAGS_$$(name)), \ CFLAGS := $$(TEST_CFLAGS) $$($1_CFLAGS) $$($1_CFLAGS_$$(name)), \
CXXFLAGS := $$(TEST_CFLAGS) $$($1_CFLAGS) $$($1_CFLAGS_$$(name)), \ CXXFLAGS := $$(TEST_CFLAGS) $$($1_CFLAGS) $$($1_CFLAGS_$$(name)), \
LD_SET_ORIGIN := $$($1_LD_SET_ORIGIN), \ LD_SET_ORIGIN := $$($1_LD_SET_ORIGIN), \
LDFLAGS := $$($1_LDFLAGS) $$($1_LDFLAGS_$$(name)), \ LDFLAGS := $$($1_LDFLAGS_$$(name)), \
DISABLED_WARNINGS_gcc := format undef unused-function unused-value, \ DISABLED_WARNINGS_gcc := format undef unused-function unused-value, \
DISABLED_WARNINGS_clang := undef format-nonliteral \ DISABLED_WARNINGS_clang := undef format-nonliteral \
missing-field-initializers sometimes-uninitialized, \ missing-field-initializers sometimes-uninitialized, \
DEFAULT_LIBCXX := false, \ DEFAULT_LIBCXX := false, \
JDK_LIBS := $$($1_JDK_LIBS_$$(name)), \
LIBS := $$($1_LIBS_$$(name)), \ LIBS := $$($1_LIBS_$$(name)), \
DEFAULT_VERSIONINFO_RESOURCE := false, \ DEFAULT_VERSIONINFO_RESOURCE := false, \
OPTIMIZATION := $$(if $$($1_OPTIMIZATION_$$(name)),$$($1_OPTIMIZATION_$$(name)),LOW), \ OPTIMIZATION := $$(if $$($1_OPTIMIZATION_$$(name)),$$($1_OPTIMIZATION_$$(name)),LOW), \

View File

@ -122,8 +122,6 @@ define SetupBuildLauncherBody
endif endif
endif endif
$1_WINDOWS_JLI_LIB := $(call FindStaticLib, java.base, jli, /libjli)
$1_EXTRA_FILES := $(LAUNCHER_SRC)/main.c $1_EXTRA_FILES := $(LAUNCHER_SRC)/main.c
ifeq ($(ASAN_ENABLED), true) ifeq ($(ASAN_ENABLED), true)
@ -148,17 +146,13 @@ define SetupBuildLauncherBody
-DPROGNAME='"$1"' \ -DPROGNAME='"$1"' \
$$($1_CFLAGS), \ $$($1_CFLAGS), \
CFLAGS_windows := $$($1_CFLAGS_windows), \ CFLAGS_windows := $$($1_CFLAGS_windows), \
EXTRA_HEADER_DIRS := java.base:libjvm, \
DISABLED_WARNINGS_gcc := unused-function, \ DISABLED_WARNINGS_gcc := unused-function, \
LDFLAGS := $$($1_LDFLAGS), \ LDFLAGS := $$($1_LDFLAGS), \
LDFLAGS_linux := $$(call SET_EXECUTABLE_ORIGIN,/../lib) \ LDFLAGS_linux := $$(call SET_EXECUTABLE_ORIGIN,/../lib), \
-L$(call FindLibDirForModule, java.base), \ LDFLAGS_macosx := $$(call SET_EXECUTABLE_ORIGIN,/../lib), \
LDFLAGS_macosx := $$(call SET_EXECUTABLE_ORIGIN,/../lib) \ JDK_LIBS := java.base:libjli, \
-L$(call FindLibDirForModule, java.base), \ JDK_LIBS_windows := java.base:libjava, \
LDFLAGS_aix := -L$(SUPPORT_OUTPUTDIR)/native/java.base, \
JDK_LIBS_unix := -ljli, \
JDK_LIBS_windows := \
$(SUPPORT_OUTPUTDIR)/native/java.base/libjava/java.lib \
$$($1_WINDOWS_JLI_LIB), \
LIBS := $$($1_LIBS), \ LIBS := $$($1_LIBS), \
LIBS_unix := $(LIBZ_LIBS), \ LIBS_unix := $(LIBZ_LIBS), \
LIBS_linux := $(LIBDL) -lpthread, \ LIBS_linux := $(LIBDL) -lpthread, \
@ -178,15 +172,6 @@ define SetupBuildLauncherBody
$$(BUILD_LAUNCHER_$1): $$(BUILD_PLIST_$1) $$(BUILD_LAUNCHER_$1): $$(BUILD_PLIST_$1)
ifeq ($(call isTargetOs, aix), true)
$$(BUILD_LAUNCHER_$1): $(call FindStaticLib, java.base, jli)
endif
ifeq ($(call isTargetOs, windows), true)
$$(BUILD_LAUNCHER_$1): $(call FindStaticLib, java.base, java, /libjava) \
$$($1_WINDOWS_JLI_LIB)
endif
ifeq ($(call isTargetOs, macosx), true) ifeq ($(call isTargetOs, macosx), true)
$$(BUILD_LAUNCHER_$1): $$($1_PLIST_FILE) $$(BUILD_LAUNCHER_$1): $$($1_PLIST_FILE)
endif endif

View File

@ -24,14 +24,3 @@
# #
include JdkNativeCompilation.gmk include JdkNativeCompilation.gmk
################################################################################
# Absolute paths to lib files on windows for use in LIBS. Should figure out a more
# elegant solution to this.
WIN_JAVA_LIB := $(SUPPORT_OUTPUTDIR)/native/java.base/libjava/java.lib
# Put the libraries here.
INSTALL_LIBRARIES_HERE := $(call FindLibDirForModule, $(MODULE))
################################################################################

View File

@ -86,7 +86,7 @@ define CreateStaticLibrary
$1_VARDEPS_FILE := $$(call DependOnVariable, $1_VARDEPS, \ $1_VARDEPS_FILE := $$(call DependOnVariable, $1_VARDEPS, \
$$($1_OBJECT_DIR)/$$($1_NOSUFFIX).vardeps) $$($1_OBJECT_DIR)/$$($1_NOSUFFIX).vardeps)
$1_TARGET_DEPS := $$($1_ALL_OBJS) $$($1_VARDEPS_FILE) $1_TARGET_DEPS := $$($1_ALL_OBJS) $$($1_EXTRA_LINK_DEPS) $$($1_VARDEPS_FILE)
$1_AR_OBJ_ARG := $$($1_LD_OBJ_ARG) $1_AR_OBJ_ARG := $$($1_LD_OBJ_ARG)
# With clang on linux, partial linking is enabled and 'AR' takes the output # With clang on linux, partial linking is enabled and 'AR' takes the output
@ -141,7 +141,7 @@ define CreateDynamicLibraryOrExecutable
$1_VARDEPS_FILE := $$(call DependOnVariable, $1_VARDEPS, \ $1_VARDEPS_FILE := $$(call DependOnVariable, $1_VARDEPS, \
$$($1_OBJECT_DIR)/$$($1_NOSUFFIX).vardeps) $$($1_OBJECT_DIR)/$$($1_NOSUFFIX).vardeps)
$1_TARGET_DEPS := $$($1_ALL_OBJS) $$($1_VARDEPS_FILE) $1_TARGET_DEPS := $$($1_ALL_OBJS) $$($1_EXTRA_LINK_DEPS) $$($1_VARDEPS_FILE)
$$($1_TARGET): $$($1_TARGET_DEPS) $$($1_TARGET): $$($1_TARGET_DEPS)
ifneq ($$($1_OBJ_FILE_LIST), ) ifneq ($$($1_OBJ_FILE_LIST), )

View File

@ -43,7 +43,10 @@ define CreateStaticLibraryMicrosoft
$1_VARDEPS_FILE := $$(call DependOnVariable, $1_VARDEPS, \ $1_VARDEPS_FILE := $$(call DependOnVariable, $1_VARDEPS, \
$$($1_OBJECT_DIR)/$$($1_NOSUFFIX).vardeps) $$($1_OBJECT_DIR)/$$($1_NOSUFFIX).vardeps)
$$($1_TARGET): $$($1_ALL_OBJS) $$($1_RES) $$($1_VARDEPS_FILE) $1_TARGET_DEPS := $$($1_ALL_OBJS) $$($1_RES) $$($1_EXTRA_LINK_DEPS) \
$$($1_VARDEPS_FILE)
$$($1_TARGET): $$($1_TARGET_DEPS)
ifneq ($$($1_OBJ_FILE_LIST), ) ifneq ($$($1_OBJ_FILE_LIST), )
$$(eval $$(call ListPathsSafely, $1_ALL_OBJS, $$($1_OBJ_FILE_LIST))) $$(eval $$(call ListPathsSafely, $1_ALL_OBJS, $$($1_OBJ_FILE_LIST)))
endif endif
@ -87,7 +90,7 @@ define CreateDynamicLibraryOrExecutableMicrosoft
$$($1_OBJECT_DIR)/$$($1_NOSUFFIX).vardeps) $$($1_OBJECT_DIR)/$$($1_NOSUFFIX).vardeps)
$1_TARGET_DEPS := $$($1_ALL_OBJS) $$($1_RES) $$($1_MANIFEST) \ $1_TARGET_DEPS := $$($1_ALL_OBJS) $$($1_RES) $$($1_MANIFEST) \
$$($1_VARDEPS_FILE) $$($1_EXTRA_LINK_DEPS) $$($1_VARDEPS_FILE)
$$($1_TARGET): $$($1_TARGET_DEPS) $$($1_TARGET): $$($1_TARGET_DEPS)
ifneq ($$($1_OBJ_FILE_LIST), ) ifneq ($$($1_OBJ_FILE_LIST), )

View File

@ -110,9 +110,7 @@ $(eval $(call SetupJdkLibrary, BUILD_GTEST_LIBJVM, \
LD_SET_ORIGIN := false, \ LD_SET_ORIGIN := false, \
DEFAULT_LDFLAGS := false, \ DEFAULT_LDFLAGS := false, \
LDFLAGS := $(JVM_LDFLAGS), \ LDFLAGS := $(JVM_LDFLAGS), \
LDFLAGS_unix := -L$(JVM_OUTPUTDIR)/libgtest, \ JDK_LIBS := gtest:libgtest, \
JDK_LIBS_unix := -lgtest, \
JDK_LIBS_windows := $(JVM_OUTPUTDIR)/libgtest/gtest.lib, \
LIBS := $(JVM_LIBS), \ LIBS := $(JVM_LIBS), \
OPTIMIZATION := $(JVM_OPTIMIZATION), \ OPTIMIZATION := $(JVM_OPTIMIZATION), \
COPY_DEBUG_SYMBOLS := $(GTEST_COPY_DEBUG_SYMBOLS), \ COPY_DEBUG_SYMBOLS := $(GTEST_COPY_DEBUG_SYMBOLS), \
@ -151,15 +149,12 @@ $(eval $(call SetupJdkExecutable, BUILD_GTEST_LAUNCHER, \
-I$(GTEST_FRAMEWORK_SRC)/googlemock \ -I$(GTEST_FRAMEWORK_SRC)/googlemock \
-I$(GTEST_FRAMEWORK_SRC)/googlemock/include, \ -I$(GTEST_FRAMEWORK_SRC)/googlemock/include, \
LD_SET_ORIGIN := false, \ LD_SET_ORIGIN := false, \
LDFLAGS_unix := -L$(JVM_OUTPUTDIR)/gtest $(call SET_SHARED_LIBRARY_ORIGIN), \ LDFLAGS_unix := $(call SET_SHARED_LIBRARY_ORIGIN), \
JDK_LIBS_unix := -ljvm, \ JDK_LIBS := gtest:libjvm, \
JDK_LIBS_windows := $(JVM_OUTPUTDIR)/gtest/objs/jvm.lib, \
COPY_DEBUG_SYMBOLS := $(GTEST_COPY_DEBUG_SYMBOLS), \ COPY_DEBUG_SYMBOLS := $(GTEST_COPY_DEBUG_SYMBOLS), \
ZIP_EXTERNAL_DEBUG_SYMBOLS := false, \ ZIP_EXTERNAL_DEBUG_SYMBOLS := false, \
)) ))
$(BUILD_GTEST_LAUNCHER): $(BUILD_GTEST_LIBJVM)
TARGETS += $(BUILD_GTEST_LAUNCHER) TARGETS += $(BUILD_GTEST_LAUNCHER)
################################################################################ ################################################################################

View File

@ -53,8 +53,7 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBNET, \
DISABLED_WARNINGS_microsoft_ResolverConfigurationImpl.c := 4996, \ DISABLED_WARNINGS_microsoft_ResolverConfigurationImpl.c := 4996, \
LDFLAGS_windows := -delayload:iphlpapi.dll -delayload:secur32.dll \ LDFLAGS_windows := -delayload:iphlpapi.dll -delayload:secur32.dll \
-delayload:winhttp.dll, \ -delayload:winhttp.dll, \
JDK_LIBS_unix := -ljava -ljvm, \ JDK_LIBS := libjava libjvm, \
JDK_LIBS_windows := $(WIN_JAVA_LIB) jvm.lib, \
LIBS_linux := $(LIBDL), \ LIBS_linux := $(LIBDL), \
LIBS_aix := $(LIBDL),\ LIBS_aix := $(LIBDL),\
LIBS_windows := advapi32.lib delayimp.lib iphlpapi.lib secur32.lib \ LIBS_windows := advapi32.lib delayimp.lib iphlpapi.lib secur32.lib \
@ -64,8 +63,6 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBNET, \
-framework CoreServices, \ -framework CoreServices, \
)) ))
$(BUILD_LIBNET): $(BUILD_LIBJAVA)
TARGETS += $(BUILD_LIBNET) TARGETS += $(BUILD_LIBNET)
################################################################################ ################################################################################
@ -78,10 +75,8 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBNIO, \
EXTRA_HEADER_DIRS := \ EXTRA_HEADER_DIRS := \
libnio/ch \ libnio/ch \
libnio/fs \ libnio/fs \
libnet, \ libjvm, \
JDK_LIBS_unix := -ljava -lnet, \ JDK_LIBS := libjava libnet, \
JDK_LIBS_windows := $(WIN_JAVA_LIB) jvm.lib \
$(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libnet/net.lib, \
LIBS_linux := $(LIBDL) -lpthread, \ LIBS_linux := $(LIBDL) -lpthread, \
LIBS_aix := $(LIBDL), \ LIBS_aix := $(LIBDL), \
LIBS_macosx := \ LIBS_macosx := \
@ -92,8 +87,6 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBNIO, \
TARGETS += $(BUILD_LIBNIO) TARGETS += $(BUILD_LIBNIO)
$(BUILD_LIBNIO): $(BUILD_LIBNET)
ifeq ($(call isTargetOs, macosx), true) ifeq ($(call isTargetOs, macosx), true)
############################################################################## ##############################################################################
## Build libosxsecurity ## Build libosxsecurity
@ -103,16 +96,13 @@ ifeq ($(call isTargetOs, macosx), true)
NAME := osxsecurity, \ NAME := osxsecurity, \
OPTIMIZATION := LOW, \ OPTIMIZATION := LOW, \
DISABLED_WARNINGS_clang_KeystoreImpl.m := deprecated-declarations, \ DISABLED_WARNINGS_clang_KeystoreImpl.m := deprecated-declarations, \
LDFLAGS := -L$(SUPPORT_OUTPUTDIR)/modules_libs/java.base,\ JDK_LIBS := libjava, \
JDK_LIBS := $(JDKLIB_LIBS), \
LIBS_macosx := -lobjc \ LIBS_macosx := -lobjc \
-framework CoreServices \ -framework CoreServices \
-framework Foundation \ -framework Foundation \
-framework Security, \ -framework Security, \
)) ))
$(BUILD_LIBOSXSECURITY): $(BUILD_LIBJAVA)
TARGETS += $(BUILD_LIBOSXSECURITY) TARGETS += $(BUILD_LIBOSXSECURITY)
endif endif
@ -204,6 +194,7 @@ ifeq ($(ENABLE_FALLBACK_LINKER), true)
$(eval $(call SetupJdkLibrary, BUILD_LIBFALLBACKLINKER, \ $(eval $(call SetupJdkLibrary, BUILD_LIBFALLBACKLINKER, \
NAME := fallbackLinker, \ NAME := fallbackLinker, \
EXTRA_HEADER_DIRS := java.base:libjava, \
CFLAGS := $(LIBFFI_CFLAGS), \ CFLAGS := $(LIBFFI_CFLAGS), \
LIBS := $(LIBFFI_LIBS), \ LIBS := $(LIBFFI_LIBS), \
LIBS_windows := ws2_32.lib, \ LIBS_windows := ws2_32.lib, \

View File

@ -35,8 +35,8 @@ endif
$(eval $(call SetupJdkLibrary, BUILD_LIBVERIFY, \ $(eval $(call SetupJdkLibrary, BUILD_LIBVERIFY, \
NAME := verify, \ NAME := verify, \
OPTIMIZATION := $(LIBVERIFY_OPTIMIZATION), \ OPTIMIZATION := $(LIBVERIFY_OPTIMIZATION), \
JDK_LIBS_unix := -ljvm, \ EXTRA_HEADER_DIRS := libjava, \
JDK_LIBS_windows := jvm.lib, \ JDK_LIBS := libjvm, \
)) ))
TARGETS += $(BUILD_LIBVERIFY) TARGETS += $(BUILD_LIBVERIFY)
@ -58,9 +58,7 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBJAVA, \
java_props_md.c_CFLAGS := \ java_props_md.c_CFLAGS := \
-DARCHPROPNAME='"$(OPENJDK_TARGET_CPU_OSARCH)"', \ -DARCHPROPNAME='"$(OPENJDK_TARGET_CPU_OSARCH)"', \
DISABLED_WARNINGS_gcc_ProcessImpl_md.c := unused-result, \ DISABLED_WARNINGS_gcc_ProcessImpl_md.c := unused-result, \
LDFLAGS_macosx := -L$(SUPPORT_OUTPUTDIR)/native/$(MODULE)/, \ JDK_LIBS := libjvm, \
JDK_LIBS_unix := -ljvm, \
JDK_LIBS_windows := jvm.lib, \
LIBS_linux := $(LIBDL), \ LIBS_linux := $(LIBDL), \
LIBS_aix := $(LIBDL) $(LIBM),\ LIBS_aix := $(LIBDL) $(LIBM),\
LIBS_macosx := \ LIBS_macosx := \
@ -72,8 +70,6 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBJAVA, \
TARGETS += $(BUILD_LIBJAVA) TARGETS += $(BUILD_LIBJAVA)
$(BUILD_LIBJAVA): $(BUILD_LIBVERIFY)
################################################################################ ################################################################################
## Build libzip ## Build libzip
################################################################################ ################################################################################
@ -96,13 +92,10 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBZIP, \
DISABLED_WARNINGS_gcc_zip_util.c := unused-function, \ DISABLED_WARNINGS_gcc_zip_util.c := unused-function, \
DISABLED_WARNINGS_clang := deprecated-non-prototype, \ DISABLED_WARNINGS_clang := deprecated-non-prototype, \
DISABLED_WARNINGS_clang_gzwrite.c := format-nonliteral, \ DISABLED_WARNINGS_clang_gzwrite.c := format-nonliteral, \
JDK_LIBS_unix := -ljava -ljvm, \ JDK_LIBS := libjava libjvm, \
JDK_LIBS_windows := $(WIN_JAVA_LIB) jvm.lib, \
LIBS_unix := $(LIBZ_LIBS), \ LIBS_unix := $(LIBZ_LIBS), \
)) ))
$(BUILD_LIBZIP): $(BUILD_LIBJAVA)
TARGETS += $(BUILD_LIBZIP) TARGETS += $(BUILD_LIBZIP)
################################################################################ ################################################################################
@ -113,15 +106,13 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBJIMAGE, \
NAME := jimage, \ NAME := jimage, \
LINK_TYPE := C++, \ LINK_TYPE := C++, \
OPTIMIZATION := LOW, \ OPTIMIZATION := LOW, \
EXTRA_HEADER_DIRS := libjava, \
CFLAGS_unix := -UDEBUG, \ CFLAGS_unix := -UDEBUG, \
LDFLAGS := $(LDFLAGS_CXX_JDK), \ LDFLAGS := $(LDFLAGS_CXX_JDK), \
JDK_LIBS_unix := -ljvm, \ JDK_LIBS := libjvm, \
JDK_LIBS_windows := jvm.lib, \
LIBS_unix := $(LIBDL), \ LIBS_unix := $(LIBDL), \
)) ))
$(BUILD_LIBJIMAGE): $(BUILD_LIBJAVA)
TARGETS += $(BUILD_LIBJIMAGE) TARGETS += $(BUILD_LIBJIMAGE)
################################################################################ ################################################################################
@ -173,6 +164,7 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBJLI, \
TYPE := $(BUILD_LIBJLI_TYPE), \ TYPE := $(BUILD_LIBJLI_TYPE), \
EXCLUDE_FILES := $(LIBJLI_EXCLUDE_FILES), \ EXCLUDE_FILES := $(LIBJLI_EXCLUDE_FILES), \
EXTRA_FILES := $(LIBJLI_EXTRA_FILES), \ EXTRA_FILES := $(LIBJLI_EXTRA_FILES), \
EXTRA_HEADER_DIRS := libjvm, \
OPTIMIZATION := HIGH, \ OPTIMIZATION := HIGH, \
CFLAGS := $(LIBJLI_CFLAGS) $(LIBZ_CFLAGS), \ CFLAGS := $(LIBJLI_CFLAGS) $(LIBZ_CFLAGS), \
DISABLED_WARNINGS_gcc := unused-function, \ DISABLED_WARNINGS_gcc := unused-function, \

View File

@ -60,12 +60,11 @@ ifeq ($(call isTargetOs, aix), false)
NAME := jsound, \ NAME := jsound, \
LINK_TYPE := $(LIBJSOUND_LINK_TYPE), \ LINK_TYPE := $(LIBJSOUND_LINK_TYPE), \
OPTIMIZATION := LOW, \ OPTIMIZATION := LOW, \
EXTRA_HEADER_DIRS := java.base:libjava, \
CFLAGS := $(LIBJSOUND_CFLAGS), \ CFLAGS := $(LIBJSOUND_CFLAGS), \
CXXFLAGS := $(LIBJSOUND_CFLAGS), \ CXXFLAGS := $(LIBJSOUND_CFLAGS), \
DISABLED_WARNINGS_gcc := undef, \ DISABLED_WARNINGS_gcc := undef, \
DISABLED_WARNINGS_clang := undef, \ DISABLED_WARNINGS_clang := undef, \
JDK_LIBS_unix := -ljava -ljvm, \
JDK_LIBS_windows := $(WIN_JAVA_LIB), \
LIBS_linux := $(ALSA_LIBS), \ LIBS_linux := $(ALSA_LIBS), \
LIBS_macosx := \ LIBS_macosx := \
-framework AudioToolbox \ -framework AudioToolbox \
@ -77,8 +76,6 @@ ifeq ($(call isTargetOs, aix), false)
LIBS_windows := advapi32.lib dsound.lib ole32.lib user32.lib winmm.lib, \ LIBS_windows := advapi32.lib dsound.lib ole32.lib user32.lib winmm.lib, \
)) ))
$(BUILD_LIBJSOUND): $(call FindLib, java.base, java)
TARGETS += $(BUILD_LIBJSOUND) TARGETS += $(BUILD_LIBJSOUND)
endif endif
@ -94,7 +91,7 @@ ifeq ($(call isTargetOs, macosx), true)
format-nonliteral, \ format-nonliteral, \
DISABLED_WARNINGS_clang_QueuingApplicationDelegate.m := \ DISABLED_WARNINGS_clang_QueuingApplicationDelegate.m := \
objc-method-access, \ objc-method-access, \
JDK_LIBS_macosx := -ljava, \ JDK_LIBS := java.base:libjava, \
LIBS_macosx := \ LIBS_macosx := \
-framework Accelerate \ -framework Accelerate \
-framework ApplicationServices \ -framework ApplicationServices \
@ -109,8 +106,6 @@ ifeq ($(call isTargetOs, macosx), true)
-framework Security, \ -framework Security, \
)) ))
$(BUILD_LIBOSXAPP): $(call FindLib, java.base, java)
TARGETS += $(BUILD_LIBOSXAPP) TARGETS += $(BUILD_LIBOSXAPP)
############################################################################## ##############################################################################
@ -120,10 +115,9 @@ ifeq ($(call isTargetOs, macosx), true)
$(eval $(call SetupJdkLibrary, BUILD_LIBOSX, \ $(eval $(call SetupJdkLibrary, BUILD_LIBOSX, \
NAME := osx, \ NAME := osx, \
OPTIMIZATION := LOW, \ OPTIMIZATION := LOW, \
EXTRA_HEADER_DIRS := libosxapp, \ EXTRA_HEADER_DIRS := java.base:libjava, \
DISABLED_WARNINGS_clang_CFileManager.m := deprecated-declarations, \ DISABLED_WARNINGS_clang_CFileManager.m := deprecated-declarations, \
LDFLAGS := -L$(SUPPORT_OUTPUTDIR)/modules_libs/java.desktop, \ JDK_LIBS := libosxapp, \
JDK_LIBS_macosx := $(JDKLIB_LIBS) -losxapp, \
LIBS_macosx := \ LIBS_macosx := \
-framework ApplicationServices \ -framework ApplicationServices \
-framework Cocoa \ -framework Cocoa \
@ -132,8 +126,4 @@ ifeq ($(call isTargetOs, macosx), true)
)) ))
TARGETS += $(BUILD_LIBOSX) TARGETS += $(BUILD_LIBOSX)
$(BUILD_LIBOSX): $(call FindLib, java.desktop, osxapp)
$(BUILD_LIBOSX): $(call FindLib, java.base, java)
endif endif

View File

@ -23,8 +23,6 @@
# questions. # questions.
# #
WIN_AWT_LIB := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libawt/awt.lib
LIBAWT_DEFAULT_HEADER_DIRS := \ LIBAWT_DEFAULT_HEADER_DIRS := \
common/awt/utility \ common/awt/utility \
libawt/awt/image \ libawt/awt/image \
@ -45,17 +43,15 @@ endif
$(eval $(call SetupJdkLibrary, BUILD_LIBMLIB_IMAGE, \ $(eval $(call SetupJdkLibrary, BUILD_LIBMLIB_IMAGE, \
NAME := mlib_image, \ NAME := mlib_image, \
EXTRA_SRC := common/awt/medialib, \ EXTRA_SRC := common/awt/medialib, \
EXTRA_HEADER_DIRS := java.base:libjava, \
EXCLUDE_FILES := mlib_c_ImageBlendTable.c, \ EXCLUDE_FILES := mlib_c_ImageBlendTable.c, \
OPTIMIZATION := HIGHEST, \ OPTIMIZATION := HIGHEST, \
CFLAGS := -D__USE_J2D_NAMES -D__MEDIALIB_OLD_NAMES -DMLIB_NO_LIBSUNMATH \ CFLAGS := -D__USE_J2D_NAMES -D__MEDIALIB_OLD_NAMES -DMLIB_NO_LIBSUNMATH \
$(LIBMLIB_IMAGE_CFLAGS), \ $(LIBMLIB_IMAGE_CFLAGS), \
DISABLED_WARNINGS_gcc := unused-function, \ DISABLED_WARNINGS_gcc := unused-function, \
JDK_LIBS := $(JDKLIB_LIBS), \
LIBS_unix := $(LIBDL) $(LIBM), \ LIBS_unix := $(LIBDL) $(LIBM), \
)) ))
$(BUILD_LIBMLIB_IMAGE): $(call FindLib, java.base, java)
TARGETS += $(BUILD_LIBMLIB_IMAGE) TARGETS += $(BUILD_LIBMLIB_IMAGE)
################################################################################ ################################################################################
@ -99,7 +95,6 @@ LIBAWT_EXTRA_HEADER_DIRS := \
common/awt/medialib \ common/awt/medialib \
libmlib_image \ libmlib_image \
include \ include \
java.base:libjava \
# #
LIBAWT_CFLAGS := -D__MEDIALIB_OLD_NAMES -D__USE_J2D_NAMES -DMLIB_NO_LIBSUNMATH LIBAWT_CFLAGS := -D__MEDIALIB_OLD_NAMES -D__USE_J2D_NAMES -DMLIB_NO_LIBSUNMATH
@ -138,14 +133,11 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBAWT, \
DISABLED_WARNINGS_clang_TransformHelper.c := sign-compare, \ DISABLED_WARNINGS_clang_TransformHelper.c := sign-compare, \
DISABLED_WARNINGS_microsoft := 4244 4996, \ DISABLED_WARNINGS_microsoft := 4244 4996, \
DISABLED_WARNINGS_microsoft_awt_Toolkit.cpp := 4267, \ DISABLED_WARNINGS_microsoft_awt_Toolkit.cpp := 4267, \
LDFLAGS_macosx := -L$(INSTALL_LIBRARIES_HERE), \
LDFLAGS_windows := -delayload:comctl32.dll -delayload:comdlg32.dll \ LDFLAGS_windows := -delayload:comctl32.dll -delayload:comdlg32.dll \
-delayload:gdi32.dll -delayload:imm32.dll -delayload:ole32.dll \ -delayload:gdi32.dll -delayload:imm32.dll -delayload:ole32.dll \
-delayload:shell32.dll -delayload:shlwapi.dll -delayload:user32.dll \ -delayload:shell32.dll -delayload:shlwapi.dll -delayload:user32.dll \
-delayload:winmm.dll -delayload:winspool.drv, \ -delayload:winmm.dll -delayload:winspool.drv, \
JDK_LIBS_unix := -ljava -ljvm, \ JDK_LIBS := java.base:libjava java.base:libjvm, \
JDK_LIBS_macosx := -lmlib_image, \
JDK_LIBS_windows := $(WIN_JAVA_LIB) jvm.lib, \
LIBS_unix := $(LIBM), \ LIBS_unix := $(LIBM), \
LIBS_linux := $(LIBDL), \ LIBS_linux := $(LIBDL), \
LIBS_aix := $(LIBDL),\ LIBS_aix := $(LIBDL),\
@ -163,12 +155,6 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBAWT, \
EXTRA_RCFLAGS := $(LIBAWT_RCFLAGS), \ EXTRA_RCFLAGS := $(LIBAWT_RCFLAGS), \
)) ))
$(BUILD_LIBAWT): $(call FindLib, java.base, java)
ifeq ($(call isTargetOs, macosx), true)
$(BUILD_LIBAWT): $(BUILD_LIBMLIB_IMAGE)
endif
TARGETS += $(BUILD_LIBAWT) TARGETS += $(BUILD_LIBAWT)
ifeq ($(call isTargetOs, windows macosx)+$(ENABLE_HEADLESS_ONLY), false+false) ifeq ($(call isTargetOs, windows macosx)+$(ENABLE_HEADLESS_ONLY), false+false)
@ -192,6 +178,7 @@ ifeq ($(call isTargetOs, windows macosx)+$(ENABLE_HEADLESS_ONLY), false+false)
common/java2d/opengl \ common/java2d/opengl \
common/java2d/x11 \ common/java2d/x11 \
libpipewire/include \ libpipewire/include \
java.base:libjvm \
# #
ifeq ($(call isTargetOs, linux), true) ifeq ($(call isTargetOs, linux), true)
@ -251,18 +238,13 @@ ifeq ($(call isTargetOs, windows macosx)+$(ENABLE_HEADLESS_ONLY), false+false)
DISABLED_WARNINGS_clang_aix_sun_awt_X11_GtkFileDialogPeer.c := \ DISABLED_WARNINGS_clang_aix_sun_awt_X11_GtkFileDialogPeer.c := \
parentheses, \ parentheses, \
DISABLED_WARNINGS_clang_aix_awt_InputMethod.c := sign-compare, \ DISABLED_WARNINGS_clang_aix_awt_InputMethod.c := sign-compare, \
LDFLAGS := -L$(INSTALL_LIBRARIES_HERE), \ JDK_LIBS := libawt java.base:libjava, \
JDK_LIBS_unix := -lawt -ljava -ljvm, \
LIBS_unix := $(LIBDL) $(LIBM) $(X_LIBS) -lX11 -lXext -lXi -lXrender \ LIBS_unix := $(LIBDL) $(LIBM) $(X_LIBS) -lX11 -lXext -lXi -lXrender \
-lXtst, \ -lXtst, \
LIBS_linux := -lpthread, \ LIBS_linux := -lpthread, \
STATIC_LIB_EXCLUDE_OBJS := $(LIBAWT_XAWT_STATIC_EXCLUDE_OBJS), \ STATIC_LIB_EXCLUDE_OBJS := $(LIBAWT_XAWT_STATIC_EXCLUDE_OBJS), \
)) ))
$(BUILD_LIBAWT_XAWT): $(call FindLib, java.base, java)
$(BUILD_LIBAWT_XAWT): $(BUILD_LIBAWT)
TARGETS += $(BUILD_LIBAWT_XAWT) TARGETS += $(BUILD_LIBAWT_XAWT)
endif endif
@ -296,21 +278,18 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBLCMS, \
CFLAGS_windows := -DCMS_IS_WINDOWS_, \ CFLAGS_windows := -DCMS_IS_WINDOWS_, \
EXTRA_HEADER_DIRS := \ EXTRA_HEADER_DIRS := \
common/awt/debug \ common/awt/debug \
libawt/java2d, \ libawt/java2d \
java.base:libjvm, \
HEADERS_FROM_SRC := $(LIBLCMS_HEADERS_FROM_SRC), \ HEADERS_FROM_SRC := $(LIBLCMS_HEADERS_FROM_SRC), \
DISABLED_WARNINGS_gcc := format-nonliteral type-limits \ DISABLED_WARNINGS_gcc := format-nonliteral type-limits \
stringop-truncation, \ stringop-truncation, \
DISABLED_WARNINGS_clang := format-nonliteral, \ DISABLED_WARNINGS_clang := format-nonliteral, \
LDFLAGS_unix := -L$(INSTALL_LIBRARIES_HERE), \ JDK_LIBS := libawt java.base:libjava, \
JDK_LIBS_unix := -lawt -ljava -ljvm, \
JDK_LIBS_windows := $(WIN_AWT_LIB) $(WIN_JAVA_LIB), \
LIBS_unix := $(LCMS_LIBS) $(LIBM), \ LIBS_unix := $(LCMS_LIBS) $(LIBM), \
)) ))
TARGETS += $(BUILD_LIBLCMS) TARGETS += $(BUILD_LIBLCMS)
$(BUILD_LIBLCMS): $(BUILD_LIBAWT)
################################################################################ ################################################################################
## Build libjavajpeg ## Build libjavajpeg
################################################################################ ################################################################################
@ -339,13 +318,10 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBJAVAJPEG, \
DISABLED_WARNINGS_gcc_imageioJPEG.c := clobbered array-bounds, \ DISABLED_WARNINGS_gcc_imageioJPEG.c := clobbered array-bounds, \
DISABLED_WARNINGS_gcc_jcmaster.c := implicit-fallthrough, \ DISABLED_WARNINGS_gcc_jcmaster.c := implicit-fallthrough, \
DISABLED_WARNINGS_gcc_jdphuff.c := shift-negative-value, \ DISABLED_WARNINGS_gcc_jdphuff.c := shift-negative-value, \
JDK_LIBS := $(JDKLIB_LIBS), \ JDK_LIBS := java.base:libjava, \
JDK_LIBS_windows := $(WIN_JAVA_LIB) jvm.lib, \
LIBS := $(LIBJPEG_LIBS), \ LIBS := $(LIBJPEG_LIBS), \
)) ))
$(BUILD_LIBJAVAJPEG): $(call FindLib, java.base, java)
TARGETS += $(BUILD_LIBJAVAJPEG) TARGETS += $(BUILD_LIBJAVAJPEG)
@ -366,6 +342,7 @@ ifeq ($(call isTargetOs, windows macosx), false)
common/awt/debug \ common/awt/debug \
common/font \ common/font \
common/java2d/opengl \ common/java2d/opengl \
java.base:libjvm \
# #
# These are the object files provided by the awt native # These are the object files provided by the awt native
@ -386,14 +363,11 @@ ifeq ($(call isTargetOs, windows macosx), false)
EXTRA_HEADER_DIRS := $(LIBAWT_HEADLESS_EXTRA_HEADER_DIRS), \ EXTRA_HEADER_DIRS := $(LIBAWT_HEADLESS_EXTRA_HEADER_DIRS), \
DISABLED_WARNINGS_gcc_X11Renderer.c := unused-function, \ DISABLED_WARNINGS_gcc_X11Renderer.c := unused-function, \
DISABLED_WARNINGS_gcc_X11SurfaceData.c := unused-function, \ DISABLED_WARNINGS_gcc_X11SurfaceData.c := unused-function, \
LDFLAGS_unix := -L$(INSTALL_LIBRARIES_HERE), \ JDK_LIBS := libawt java.base:libjava, \
JDK_LIBS_unix := -lawt -ljava -ljvm, \
LIBS_linux := $(LIBDL) $(LIBM), \ LIBS_linux := $(LIBDL) $(LIBM), \
STATIC_LIB_EXCLUDE_OBJS := $(LIBAWT_HEADLESS_STATIC_EXCLUDE_OBJS), \ STATIC_LIB_EXCLUDE_OBJS := $(LIBAWT_HEADLESS_STATIC_EXCLUDE_OBJS), \
)) ))
$(BUILD_LIBAWT_HEADLESS): $(BUILD_LIBAWT)
TARGETS += $(BUILD_LIBAWT_HEADLESS) TARGETS += $(BUILD_LIBAWT_HEADLESS)
endif endif
@ -467,7 +441,6 @@ else
endif endif
LIBFONTMANAGER_EXTRA_HEADER_DIRS := \ LIBFONTMANAGER_EXTRA_HEADER_DIRS := \
libharfbuzz \
common/awt \ common/awt \
common/awt/utility \ common/awt/utility \
common/font \ common/font \
@ -481,13 +454,7 @@ ifeq ($(FREETYPE_TO_USE), system)
LIBFONTMANAGER_LIBS += $(FREETYPE_LIBS) LIBFONTMANAGER_LIBS += $(FREETYPE_LIBS)
else else
LIBFONTMANAGER_EXTRA_HEADER_DIRS += libfreetype/include LIBFONTMANAGER_EXTRA_HEADER_DIRS += libfreetype/include
LIBFONTMANAGER_JDK_LIBS += libfreetype
ifeq ($(call isTargetOs, windows), true)
LIBFONTMANAGER_JDK_LIBS += \
$(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libfreetype/freetype.lib
else
LIBFONTMANAGER_JDK_LIBS += -lfreetype
endif
endif endif
LIBFONTMANAGER_OPTIMIZATION := HIGHEST LIBFONTMANAGER_OPTIMIZATION := HIGHEST
@ -533,12 +500,9 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBFONTMANAGER, \
DISABLED_WARNINGS_microsoft := $(HARFBUZZ_DISABLED_WARNINGS_microsoft), \ DISABLED_WARNINGS_microsoft := $(HARFBUZZ_DISABLED_WARNINGS_microsoft), \
LDFLAGS := $(LDFLAGS_CXX_JDK), \ LDFLAGS := $(LDFLAGS_CXX_JDK), \
LDFLAGS_FILTER_OUT :=-Wl$(COMMA)-z$(COMMA)defs, \ LDFLAGS_FILTER_OUT :=-Wl$(COMMA)-z$(COMMA)defs, \
LDFLAGS_unix := -L$(INSTALL_LIBRARIES_HERE), \
LDFLAGS_aix := -Wl$(COMMA)-berok, \ LDFLAGS_aix := -Wl$(COMMA)-berok, \
JDK_LIBS := $(LIBFONTMANAGER_JDK_LIBS), \ JDK_LIBS := libawt java.base:libjava $(LIBFONTMANAGER_JDK_LIBS), \
JDK_LIBS_unix := -lawt -ljava -ljvm, \ JDK_LIBS_macosx := libawt_lwawt, \
JDK_LIBS_macosx := -lawt_lwawt, \
JDK_LIBS_windows := $(WIN_AWT_LIB) $(WIN_JAVA_LIB), \
LIBS := $(LIBFONTMANAGER_LIBS), \ LIBS := $(LIBFONTMANAGER_LIBS), \
LIBS_unix := $(LIBM), \ LIBS_unix := $(LIBM), \
LIBS_macosx := \ LIBS_macosx := \
@ -548,16 +512,6 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBFONTMANAGER, \
LIBS_windows := advapi32.lib gdi32.lib user32.lib, \ LIBS_windows := advapi32.lib gdi32.lib user32.lib, \
)) ))
$(BUILD_LIBFONTMANAGER): $(BUILD_LIBAWT)
ifeq ($(call isTargetOs, macosx), true)
$(BUILD_LIBFONTMANAGER): $(call FindLib, $(MODULE), awt_lwawt)
endif
ifeq ($(FREETYPE_TO_USE), bundled)
$(BUILD_LIBFONTMANAGER): $(BUILD_LIBFREETYPE)
endif
TARGETS += $(BUILD_LIBFONTMANAGER) TARGETS += $(BUILD_LIBFONTMANAGER)
################################################################################ ################################################################################
@ -566,6 +520,7 @@ TARGETS += $(BUILD_LIBFONTMANAGER)
LIBJAWT_EXTRA_HEADER_DIRS := \ LIBJAWT_EXTRA_HEADER_DIRS := \
include \ include \
java.base:libjava \
# #
ifeq ($(call isTargetOs, windows), true) ifeq ($(call isTargetOs, windows), true)
@ -576,7 +531,7 @@ ifeq ($(call isTargetOs, windows), true)
libawt/java2d \ libawt/java2d \
libawt/java2d/windows \ libawt/java2d/windows \
libawt/windows \ libawt/windows \
java.base:libjava \ java.base:libjvm \
# #
else else
LIBJAWT_EXTRA_HEADER_DIRS += \ LIBJAWT_EXTRA_HEADER_DIRS += \
@ -598,11 +553,11 @@ ifeq ($(call isTargetOs, windows)+$(call isTargetCpu, x86), true+true)
endif endif
ifeq ($(call isTargetOsType, unix)+$(call isTargetOs, macosx), true+false) ifeq ($(call isTargetOsType, unix)+$(call isTargetOs, macosx), true+false)
LIBJAWT_JDK_LIBS_unix := -lawt LIBJAWT_JDK_LIBS_unix := libawt
ifeq ($(ENABLE_HEADLESS_ONLY), false) ifeq ($(ENABLE_HEADLESS_ONLY), false)
LIBJAWT_JDK_LIBS_unix += -lawt_xawt LIBJAWT_JDK_LIBS_unix += libawt_xawt
else else
LIBJAWT_JDK_LIBS_unix += -lawt_headless LIBJAWT_JDK_LIBS_unix += libawt_headless
endif endif
endif endif
@ -616,27 +571,14 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBJAWT, \
DISABLED_WARNINGS_clang_jawt.m := sign-compare, \ DISABLED_WARNINGS_clang_jawt.m := sign-compare, \
EXTRA_HEADER_DIRS := $(LIBJAWT_EXTRA_HEADER_DIRS), \ EXTRA_HEADER_DIRS := $(LIBJAWT_EXTRA_HEADER_DIRS), \
LDFLAGS_windows := $(LDFLAGS_CXX_JDK), \ LDFLAGS_windows := $(LDFLAGS_CXX_JDK), \
LDFLAGS_unix := -L$(INSTALL_LIBRARIES_HERE), \
LDFLAGS_macosx := -Wl$(COMMA)-rpath$(COMMA)@loader_path, \ LDFLAGS_macosx := -Wl$(COMMA)-rpath$(COMMA)@loader_path, \
JDK_LIBS_unix := $(LIBJAWT_JDK_LIBS_unix) $(JDKLIB_LIBS), \ JDK_LIBS_unix := $(LIBJAWT_JDK_LIBS_unix), \
JDK_LIBS_macosx := -lawt_lwawt, \ JDK_LIBS_windows := libawt, \
JDK_LIBS_windows := $(WIN_AWT_LIB), \ JDK_LIBS_macosx := libawt_lwawt, \
LIBS_macosx := -framework Cocoa, \ LIBS_macosx := -framework Cocoa, \
LIBS_windows := advapi32.lib $(LIBJAWT_LIBS_windows), \ LIBS_windows := advapi32.lib $(LIBJAWT_LIBS_windows), \
)) ))
ifeq ($(call isTargetOs, windows), true)
$(BUILD_LIBJAWT): $(BUILD_LIBAWT)
else ifeq ($(call isTargetOs, macosx), true)
$(BUILD_LIBJAWT): $(call FindLib, $(MODULE), awt_lwawt)
else
ifeq ($(ENABLE_HEADLESS_ONLY), false)
$(BUILD_LIBJAWT): $(BUILD_LIBAWT_XAWT)
else
$(BUILD_LIBJAWT): $(call FindLib, $(MODULE), awt_headless)
endif
endif
TARGETS += $(BUILD_LIBJAWT) TARGETS += $(BUILD_LIBJAWT)
ifeq ($(call isTargetOs, windows), true) ifeq ($(call isTargetOs, windows), true)
@ -663,6 +605,7 @@ ifeq ($(ENABLE_HEADLESS_ONLY), false)
common/awt/utility \ common/awt/utility \
libosxapp \ libosxapp \
java.base:libjava \ java.base:libjava \
java.base:libjvm \
# #
ifeq ($(USE_EXTERNAL_LIBGIF), false) ifeq ($(USE_EXTERNAL_LIBGIF), false)
@ -758,11 +701,9 @@ ifeq ($(ENABLE_HEADLESS_ONLY), false)
DISABLED_WARNINGS_microsoft_splashscreen_impl.c := 4018 4267 4244, \ DISABLED_WARNINGS_microsoft_splashscreen_impl.c := 4018 4267 4244, \
DISABLED_WARNINGS_microsoft_splashscreen_png.c := 4267, \ DISABLED_WARNINGS_microsoft_splashscreen_png.c := 4267, \
DISABLED_WARNINGS_microsoft_splashscreen_sys.c := 4267 4244, \ DISABLED_WARNINGS_microsoft_splashscreen_sys.c := 4267 4244, \
LDFLAGS_macosx := -L$(INSTALL_LIBRARIES_HERE), \
LDFLAGS_windows := -delayload:user32.dll, \ LDFLAGS_windows := -delayload:user32.dll, \
JDK_LIBS := $(JDKLIB_LIBS), \ JDK_LIBS_windows := java.base:libjava, \
JDK_LIBS_macosx := -losxapp, \ JDK_LIBS_macosx := libosxapp, \
JDK_LIBS_windows := $(WIN_JAVA_LIB) jvm.lib, \
LIBS := $(GIFLIB_LIBS) $(LIBJPEG_LIBS) $(LIBZ_LIBS) $(PNG_LIBS), \ LIBS := $(GIFLIB_LIBS) $(LIBJPEG_LIBS) $(LIBZ_LIBS) $(PNG_LIBS), \
LIBS_unix := $(LIBM) -lpthread, \ LIBS_unix := $(LIBM) -lpthread, \
LIBS_linux := $(LIBDL) $(X_LIBS) -lX11 -lXext, \ LIBS_linux := $(LIBDL) $(X_LIBS) -lX11 -lXext, \
@ -777,10 +718,6 @@ ifeq ($(ENABLE_HEADLESS_ONLY), false)
)) ))
TARGETS += $(BUILD_LIBSPLASHSCREEN) TARGETS += $(BUILD_LIBSPLASHSCREEN)
ifeq ($(call isTargetOs, macosx), true)
$(BUILD_LIBSPLASHSCREEN): $(call FindLib, $(MODULE), osxapp)
endif
endif endif
ifeq ($(call isTargetOs, macosx), true) ifeq ($(call isTargetOs, macosx), true)
@ -803,7 +740,7 @@ ifeq ($(call isTargetOs, macosx), true)
include \ include \
common/awt/debug \ common/awt/debug \
common/java2d/opengl \ common/java2d/opengl \
libosxapp \ java.base:libjvm \
# #
LIBAWT_LWAWT_EXCLUDE_FILES := fontpath.c awt_Font.c X11Color.c LIBAWT_LWAWT_EXCLUDE_FILES := fontpath.c awt_Font.c X11Color.c
@ -833,8 +770,7 @@ ifeq ($(call isTargetOs, macosx), true)
DISABLED_WARNINGS_clang_OGLBufImgOps.c := format-nonliteral, \ DISABLED_WARNINGS_clang_OGLBufImgOps.c := format-nonliteral, \
DISABLED_WARNINGS_clang_OGLPaints.c := format-nonliteral, \ DISABLED_WARNINGS_clang_OGLPaints.c := format-nonliteral, \
DISABLED_WARNINGS_clang_PrinterView.m := enum-conversion, \ DISABLED_WARNINGS_clang_PrinterView.m := enum-conversion, \
LDFLAGS := -L$(INSTALL_LIBRARIES_HERE), \ JDK_LIBS := libawt java.base:libjava libosxapp, \
JDK_LIBS_macosx := -lawt -ljava -ljvm -lmlib_image -losxapp, \
LIBS_macosx := $(LIBM) \ LIBS_macosx := $(LIBM) \
-framework Accelerate \ -framework Accelerate \
-framework ApplicationServices \ -framework ApplicationServices \
@ -851,14 +787,6 @@ ifeq ($(call isTargetOs, macosx), true)
TARGETS += $(BUILD_LIBAWT_LWAWT) TARGETS += $(BUILD_LIBAWT_LWAWT)
$(BUILD_LIBAWT_LWAWT): $(BUILD_LIBAWT)
$(BUILD_LIBAWT_LWAWT): $(BUILD_LIBMLIB_IMAGE)
$(BUILD_LIBAWT_LWAWT): $(call FindLib, $(MODULE), osxapp)
$(BUILD_LIBAWT_LWAWT): $(call FindLib, java.base, java)
############################################################################## ##############################################################################
## Build libosxui ## Build libosxui
############################################################################## ##############################################################################
@ -867,7 +795,7 @@ ifeq ($(call isTargetOs, macosx), true)
$(TOPDIR)/src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/shaders.metal $(TOPDIR)/src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/shaders.metal
SHADERS_SUPPORT_DIR := $(SUPPORT_OUTPUTDIR)/native/java.desktop/libosxui SHADERS_SUPPORT_DIR := $(SUPPORT_OUTPUTDIR)/native/java.desktop/libosxui
SHADERS_AIR := $(SHADERS_SUPPORT_DIR)/shaders.air SHADERS_AIR := $(SHADERS_SUPPORT_DIR)/shaders.air
SHADERS_LIB := $(INSTALL_LIBRARIES_HERE)/shaders.metallib SHADERS_LIB := $(call FindLibDirForModule, $(MODULE))/shaders.metallib
$(eval $(call SetupExecute, metal_shaders, \ $(eval $(call SetupExecute, metal_shaders, \
INFO := Running metal on $(notdir $(SHADERS_SRC)) (for libosxui.dylib), \ INFO := Running metal on $(notdir $(SHADERS_SRC)) (for libosxui.dylib), \
@ -893,14 +821,12 @@ ifeq ($(call isTargetOs, macosx), true)
NAME := osxui, \ NAME := osxui, \
OPTIMIZATION := LOW, \ OPTIMIZATION := LOW, \
EXTRA_HEADER_DIRS := \ EXTRA_HEADER_DIRS := \
libawt_lwawt/awt \ libawt_lwawt/awt, \
libosxapp, \
DISABLED_WARNINGS_clang_AquaFileView.m := deprecated-declarations \ DISABLED_WARNINGS_clang_AquaFileView.m := deprecated-declarations \
sign-compare, \ sign-compare, \
DISABLED_WARNINGS_clang_ScreenMenu.m := deprecated-declarations, \ DISABLED_WARNINGS_clang_ScreenMenu.m := deprecated-declarations, \
APPEND_LDFLAGS := -Wl$(COMMA)-rpath$(COMMA)@loader_path, \ APPEND_LDFLAGS := -Wl$(COMMA)-rpath$(COMMA)@loader_path, \
LDFLAGS := -L$(INSTALL_LIBRARIES_HERE), \ JDK_LIBS := java.base:libjava libosxapp, \
JDK_LIBS_macosx := -lawt -lawt_lwawt -ljava -ljvm -losxapp, \
LIBS_macosx := \ LIBS_macosx := \
-framework ApplicationServices \ -framework ApplicationServices \
-framework Carbon \ -framework Carbon \
@ -912,10 +838,4 @@ ifeq ($(call isTargetOs, macosx), true)
TARGETS += $(BUILD_LIBOSXUI) TARGETS += $(BUILD_LIBOSXUI)
$(BUILD_LIBOSXUI): $(SHADERS_LIB) $(BUILD_LIBOSXUI): $(SHADERS_LIB)
$(BUILD_LIBOSXUI): $(BUILD_LIBAWT)
$(BUILD_LIBOSXUI): $(call FindLib, $(MODULE), osxapp)
$(BUILD_LIBOSXUI): $(BUILD_LIBAWT_LWAWT)
endif endif

View File

@ -36,14 +36,7 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBINSTRUMENT, \
CFLAGS_windows := -Dstrcasecmp=stricmp, \ CFLAGS_windows := -Dstrcasecmp=stricmp, \
CFLAGS_debug := -DJPLIS_LOGGING, \ CFLAGS_debug := -DJPLIS_LOGGING, \
CFLAGS_release := -DNO_JPLIS_LOGGING, \ CFLAGS_release := -DNO_JPLIS_LOGGING, \
EXTRA_HEADER_DIRS := java.base:libjli, \ JDK_LIBS := java.base:libjava java.base:libjli java.base:libjvm, \
LDFLAGS_linux := -L$(call FindLibDirForModule, java.base), \
LDFLAGS_macosx := -L$(call FindLibDirForModule, java.base), \
LDFLAGS_aix := -L$(SUPPORT_OUTPUTDIR)/native/java.base, \
JDK_LIBS := $(JDKLIB_LIBS), \
JDK_LIBS_unix := -ljli, \
JDK_LIBS_windows := $(WIN_JAVA_LIB) \
$(SUPPORT_OUTPUTDIR)/native/java.base/libjli/jli.lib jvm.lib, \
LIBS_unix := $(LIBZ_LIBS), \ LIBS_unix := $(LIBZ_LIBS), \
LIBS_linux := $(LIBDL), \ LIBS_linux := $(LIBDL), \
LIBS_aix := $(LIBDL) -liconv, \ LIBS_aix := $(LIBDL) -liconv, \
@ -54,11 +47,4 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBINSTRUMENT, \
LIBS_windows := advapi32.lib, \ LIBS_windows := advapi32.lib, \
)) ))
ifeq ($(call isTargetOs, aix), true)
$(BUILD_LIBINSTRUMENT): $(call FindStaticLib, java.base, jli)
else
$(BUILD_LIBINSTRUMENT): $(call FindLib, java.base, jli)
endif
$(BUILD_LIBINSTRUMENT): $(call FindLib, java.base, java)
TARGETS += $(BUILD_LIBINSTRUMENT) TARGETS += $(BUILD_LIBINSTRUMENT)

View File

@ -37,12 +37,9 @@ endif
$(eval $(call SetupJdkLibrary, BUILD_LIBMANAGEMENT, \ $(eval $(call SetupJdkLibrary, BUILD_LIBMANAGEMENT, \
NAME := management, \ NAME := management, \
OPTIMIZATION := $(LIBMANAGEMENT_OPTIMIZATION), \ OPTIMIZATION := $(LIBMANAGEMENT_OPTIMIZATION), \
JDK_LIBS := $(JDKLIB_LIBS), \ JDK_LIBS := java.base:libjava java.base:libjvm, \
JDK_LIBS_windows := $(WIN_JAVA_LIB) jvm.lib, \
LIBS_aix := -lperfstat,\ LIBS_aix := -lperfstat,\
LIBS_windows := advapi32.lib psapi.lib, \ LIBS_windows := advapi32.lib psapi.lib, \
)) ))
$(BUILD_LIBMANAGEMENT): $(call FindLib, java.base, java)
TARGETS += $(BUILD_LIBMANAGEMENT) TARGETS += $(BUILD_LIBMANAGEMENT)

View File

@ -38,16 +38,11 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBPREFS, \
NAME := prefs, \ NAME := prefs, \
EXCLUDE_SRC_PATTERNS := $(LIBPREFS_EXCLUDE_SRC_PATTERNS), \ EXCLUDE_SRC_PATTERNS := $(LIBPREFS_EXCLUDE_SRC_PATTERNS), \
OPTIMIZATION := HIGH, \ OPTIMIZATION := HIGH, \
JDK_LIBS_unix := -ljvm, \ JDK_LIBS := java.base:libjava java.base:libjvm, \
JDK_LIBS_linux := -ljava, \
JDK_LIBS_aix := -ljava, \
JDK_LIBS_windows := $(WIN_JAVA_LIB) jvm.lib, \
LIBS_macosx := \ LIBS_macosx := \
-framework CoreFoundation \ -framework CoreFoundation \
-framework Foundation, \ -framework Foundation, \
LIBS_windows := advapi32.lib, \ LIBS_windows := advapi32.lib, \
)) ))
$(BUILD_LIBPREFS): $(call FindLib, java.base, java)
TARGETS += $(BUILD_LIBPREFS) TARGETS += $(BUILD_LIBPREFS)

View File

@ -31,11 +31,9 @@ include LibCommon.gmk
$(eval $(call SetupJdkLibrary, BUILD_LIBRMI, \ $(eval $(call SetupJdkLibrary, BUILD_LIBRMI, \
NAME := rmi, \ NAME := rmi, \
EXTRA_HEADER_DIRS := java.base:libjava, \
OPTIMIZATION := LOW, \ OPTIMIZATION := LOW, \
JDK_LIBS_unix := -ljvm, \ JDK_LIBS := java.base:libjvm, \
JDK_LIBS_windows := jvm.lib, \
)) ))
$(BUILD_LIBRMI): $(call FindLib, java.base, java)
TARGETS += $(BUILD_LIBRMI) TARGETS += $(BUILD_LIBRMI)

View File

@ -32,6 +32,7 @@ include LibCommon.gmk
$(eval $(call SetupJdkLibrary, BUILD_LIBJ2GSS, \ $(eval $(call SetupJdkLibrary, BUILD_LIBJ2GSS, \
NAME := j2gss, \ NAME := j2gss, \
OPTIMIZATION := LOW, \ OPTIMIZATION := LOW, \
EXTRA_HEADER_DIRS := java.base:libjava, \
DISABLED_WARNINGS_gcc := undef, \ DISABLED_WARNINGS_gcc := undef, \
DISABLED_WARNINGS_clang := undef, \ DISABLED_WARNINGS_clang := undef, \
LIBS_unix := $(LIBDL), \ LIBS_unix := $(LIBDL), \
@ -47,7 +48,9 @@ ifeq ($(call isTargetOs, windows), true)
$(eval $(call SetupJdkLibrary, BUILD_LIBSSPI_BRIDGE, \ $(eval $(call SetupJdkLibrary, BUILD_LIBSSPI_BRIDGE, \
NAME := sspi_bridge, \ NAME := sspi_bridge, \
OPTIMIZATION := LOW, \ OPTIMIZATION := LOW, \
EXTRA_HEADER_DIRS := libj2gss, \ EXTRA_HEADER_DIRS := \
libj2gss \
java.base:libjava, \
LIBS_windows := secur32.lib, \ LIBS_windows := secur32.lib, \
)) ))
@ -63,6 +66,7 @@ ifneq ($(BUILD_CRYPTO), false)
$(eval $(call SetupJdkLibrary, BUILD_LIBW2K_LSA_AUTH, \ $(eval $(call SetupJdkLibrary, BUILD_LIBW2K_LSA_AUTH, \
NAME := w2k_lsa_auth, \ NAME := w2k_lsa_auth, \
OPTIMIZATION := LOW, \ OPTIMIZATION := LOW, \
EXTRA_HEADER_DIRS := java.base:libjava, \
LIBS_windows := advapi32.lib kernel32.lib secur32.lib ws2_32.lib, \ LIBS_windows := advapi32.lib kernel32.lib secur32.lib ws2_32.lib, \
)) ))
@ -79,6 +83,7 @@ ifneq ($(BUILD_CRYPTO), false)
$(eval $(call SetupJdkLibrary, BUILD_LIBOSXKRB5, \ $(eval $(call SetupJdkLibrary, BUILD_LIBOSXKRB5, \
NAME := osxkrb5, \ NAME := osxkrb5, \
OPTIMIZATION := LOW, \ OPTIMIZATION := LOW, \
EXTRA_HEADER_DIRS := java.base:libjava, \
DISABLED_WARNINGS_clang_nativeccache.c := deprecated-declarations, \ DISABLED_WARNINGS_clang_nativeccache.c := deprecated-declarations, \
LIBS_macosx := \ LIBS_macosx := \
-framework Cocoa \ -framework Cocoa \

View File

@ -32,7 +32,9 @@ include LibCommon.gmk
$(eval $(call SetupJdkLibrary, BUILD_LIBJ2PCSC, \ $(eval $(call SetupJdkLibrary, BUILD_LIBJ2PCSC, \
NAME := j2pcsc, \ NAME := j2pcsc, \
CFLAGS_unix := -D__sun_jdk, \ CFLAGS_unix := -D__sun_jdk, \
EXTRA_HEADER_DIRS := libj2pcsc/MUSCLE, \ EXTRA_HEADER_DIRS := \
libj2pcsc/MUSCLE \
java.base:libjava, \
OPTIMIZATION := LOW, \ OPTIMIZATION := LOW, \
LIBS_unix := $(LIBDL), \ LIBS_unix := $(LIBDL), \
LIBS_windows := winscard.lib, \ LIBS_windows := winscard.lib, \

View File

@ -48,7 +48,7 @@ ifeq ($(call isTargetOs, windows), true)
EXTRA_HEADER_DIRS := \ EXTRA_HEADER_DIRS := \
include/bridge \ include/bridge \
java.desktop:include, \ java.desktop:include, \
JDK_LIBS_windows := $(SUPPORT_OUTPUTDIR)/native/java.desktop/libjawt/jawt.lib, \ JDK_LIBS := java.desktop:libjawt, \
LIBS_windows := advapi32.lib comdlg32.lib gdi32.lib kernel32.lib \ LIBS_windows := advapi32.lib comdlg32.lib gdi32.lib kernel32.lib \
odbc32.lib odbccp32.lib ole32.lib oleaut32.lib shell32.lib \ odbc32.lib odbccp32.lib ole32.lib oleaut32.lib shell32.lib \
user32.lib uuid.lib winspool.lib, \ user32.lib uuid.lib winspool.lib, \
@ -56,8 +56,6 @@ ifeq ($(call isTargetOs, windows), true)
$(ACCESSIBILITY_SRCDIR)/common/AccessBridgeStatusWindow.rc, \ $(ACCESSIBILITY_SRCDIR)/common/AccessBridgeStatusWindow.rc, \
) )
$$(BUILD_LIBJAVAACCESSBRIDGE$1): $(call FindStaticLib, java.desktop, jawt, /libjawt)
TARGETS += $$(BUILD_LIBJAVAACCESSBRIDGE$1) TARGETS += $$(BUILD_LIBJAVAACCESSBRIDGE$1)
endef endef

View File

@ -41,11 +41,8 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBATTACH, \
OPTIMIZATION := LOW, \ OPTIMIZATION := LOW, \
CFLAGS := $(LIBATTACH_CFLAGS), \ CFLAGS := $(LIBATTACH_CFLAGS), \
CFLAGS_windows := -Gy, \ CFLAGS_windows := -Gy, \
JDK_LIBS := $(JDKLIB_LIBS), \ JDK_LIBS := java.base:libjava, \
JDK_LIBS_windows := $(WIN_JAVA_LIB), \
LIBS_windows := advapi32.lib psapi.lib, \ LIBS_windows := advapi32.lib psapi.lib, \
)) ))
$(BUILD_LIBATTACH): $(call FindLib, java.base, java)
TARGETS += $(BUILD_LIBATTACH) TARGETS += $(BUILD_LIBATTACH)

View File

@ -32,6 +32,7 @@ include LibCommon.gmk
$(eval $(call SetupJdkLibrary, BUILD_LIBJ2PKCS11, \ $(eval $(call SetupJdkLibrary, BUILD_LIBJ2PKCS11, \
NAME := j2pkcs11, \ NAME := j2pkcs11, \
OPTIMIZATION := LOW, \ OPTIMIZATION := LOW, \
EXTRA_HEADER_DIRS := java.base:libjava, \
DISABLED_WARNINGS_clang_p11_util.c := format-nonliteral, \ DISABLED_WARNINGS_clang_p11_util.c := format-nonliteral, \
LIBS_unix := $(LIBDL), \ LIBS_unix := $(LIBDL), \
)) ))

View File

@ -33,6 +33,7 @@ ifeq ($(call isTargetOs, windows), true)
$(eval $(call SetupJdkLibrary, BUILD_LIBSUNMSCAPI, \ $(eval $(call SetupJdkLibrary, BUILD_LIBSUNMSCAPI, \
NAME := sunmscapi, \ NAME := sunmscapi, \
OPTIMIZATION := LOW, \ OPTIMIZATION := LOW, \
EXTRA_HEADER_DIRS := java.base:libjava, \
LDFLAGS := $(LDFLAGS_CXX_JDK), \ LDFLAGS := $(LDFLAGS_CXX_JDK), \
LIBS_windows := advapi32.lib crypt32.lib ncrypt.lib, \ LIBS_windows := advapi32.lib crypt32.lib ncrypt.lib, \
)) ))

View File

@ -57,6 +57,7 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBSAPROC, \
NAME := saproc, \ NAME := saproc, \
LINK_TYPE := $(LIBSAPROC_LINK_TYPE), \ LINK_TYPE := $(LIBSAPROC_LINK_TYPE), \
OPTIMIZATION := HIGH, \ OPTIMIZATION := HIGH, \
EXTRA_HEADER_DIRS := java.base:libjvm, \
DISABLED_WARNINGS_gcc := sign-compare, \ DISABLED_WARNINGS_gcc := sign-compare, \
DISABLED_WARNINGS_gcc_ps_core.c := pointer-arith, \ DISABLED_WARNINGS_gcc_ps_core.c := pointer-arith, \
DISABLED_WARNINGS_clang_ps_core.c := pointer-arith, \ DISABLED_WARNINGS_clang_ps_core.c := pointer-arith, \
@ -66,8 +67,7 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBSAPROC, \
CFLAGS := $(LIBSAPROC_CFLAGS), \ CFLAGS := $(LIBSAPROC_CFLAGS), \
CXXFLAGS := $(LIBSAPROC_CFLAGS) $(LIBSAPROC_CXXFLAGS), \ CXXFLAGS := $(LIBSAPROC_CFLAGS) $(LIBSAPROC_CXXFLAGS), \
EXTRA_SRC := $(LIBSAPROC_EXTRA_SRC), \ EXTRA_SRC := $(LIBSAPROC_EXTRA_SRC), \
JDK_LIBS_unix := -ljava, \ JDK_LIBS := java.base:libjava, \
JDK_LIBS_windows := $(WIN_JAVA_LIB), \
LIBS_linux := $(LIBDL), \ LIBS_linux := $(LIBDL), \
LIBS_macosx := \ LIBS_macosx := \
-framework CoreFoundation \ -framework CoreFoundation \

View File

@ -34,8 +34,10 @@ ifeq ($(call isTargetOs, aix), false)
NAME := le, \ NAME := le, \
LINK_TYPE := C++, \ LINK_TYPE := C++, \
OPTIMIZATION := LOW, \ OPTIMIZATION := LOW, \
EXTRA_HEADER_DIRS := \
java.base:libjava \
java.base:libjvm, \
LD_SET_ORIGIN := false, \ LD_SET_ORIGIN := false, \
JDK_LIBS := $(JDKLIB_LIBS), \
LIBS_windows := user32.lib, \ LIBS_windows := user32.lib, \
)) ))

View File

@ -36,7 +36,6 @@ ifeq ($(call isTargetOs, windows), true)
EXTRA_HEADER_DIRS := \ EXTRA_HEADER_DIRS := \
jdk.jdwp.agent:include \ jdk.jdwp.agent:include \
jdk.jdwp.agent:libjdwp/export, \ jdk.jdwp.agent:libjdwp/export, \
JDK_LIBS := $(JDKLIB_LIBS), \
)) ))
TARGETS += $(BUILD_LIBDT_SHMEM) TARGETS += $(BUILD_LIBDT_SHMEM)

View File

@ -40,8 +40,6 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBDT_SOCKET, \
LIBS_windows := iphlpapi.lib ws2_32.lib, \ LIBS_windows := iphlpapi.lib ws2_32.lib, \
)) ))
$(BUILD_LIBDT_SOCKET): $(call FindLib, java.base, java)
# Include socket transport with JDWP agent to allow for remote debugging # Include socket transport with JDWP agent to allow for remote debugging
TARGETS += $(BUILD_LIBDT_SOCKET) TARGETS += $(BUILD_LIBDT_SOCKET)
@ -61,15 +59,14 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBJDWP, \
DISABLED_WARNINGS_clang_log_messages.c := format-nonliteral, \ DISABLED_WARNINGS_clang_log_messages.c := format-nonliteral, \
EXTRA_HEADER_DIRS := \ EXTRA_HEADER_DIRS := \
include \ include \
libjdwp/export, \ libjdwp/export \
JDK_LIBS := $(JDKLIB_LIBS), \ java.base:libjava \
java.base:libjvm, \
LIBS_linux := $(LIBDL), \ LIBS_linux := $(LIBDL), \
LIBS_macosx := -liconv, \ LIBS_macosx := -liconv, \
LIBS_aix := -liconv, \ LIBS_aix := -liconv, \
)) ))
$(BUILD_LIBJDWP): $(call FindLib, java.base, java)
TARGETS += $(BUILD_LIBJDWP) TARGETS += $(BUILD_LIBJDWP)
################################################################################ ################################################################################

View File

@ -32,11 +32,8 @@ include LibCommon.gmk
$(eval $(call SetupJdkLibrary, BUILD_LIBMANAGEMENT_AGENT, \ $(eval $(call SetupJdkLibrary, BUILD_LIBMANAGEMENT_AGENT, \
NAME := management_agent, \ NAME := management_agent, \
OPTIMIZATION := LOW, \ OPTIMIZATION := LOW, \
JDK_LIBS := $(JDKLIB_LIBS), \ JDK_LIBS := java.base:libjava, \
JDK_LIBS_windows := $(WIN_JAVA_LIB), \
LIBS_windows := advapi32.lib, \ LIBS_windows := advapi32.lib, \
)) ))
$(BUILD_LIBMANAGEMENT_AGENT): $(call FindLib, java.base, java)
TARGETS += $(BUILD_LIBMANAGEMENT_AGENT) TARGETS += $(BUILD_LIBMANAGEMENT_AGENT)

View File

@ -46,12 +46,9 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBMANAGEMENT_EXT, \
OPTIMIZATION := $(LIBMANAGEMENT_EXT_OPTIMIZATION), \ OPTIMIZATION := $(LIBMANAGEMENT_EXT_OPTIMIZATION), \
DISABLED_WARNINGS_clang_UnixOperatingSystem.c := format-nonliteral, \ DISABLED_WARNINGS_clang_UnixOperatingSystem.c := format-nonliteral, \
CFLAGS := $(LIBMANAGEMENT_EXT_CFLAGS), \ CFLAGS := $(LIBMANAGEMENT_EXT_CFLAGS), \
JDK_LIBS := $(JDKLIB_LIBS), \ JDK_LIBS := java.base:libjava java.base:libjvm, \
JDK_LIBS_windows := $(WIN_JAVA_LIB) jvm.lib, \
LIBS_aix := -lperfstat,\ LIBS_aix := -lperfstat,\
LIBS_windows := advapi32.lib psapi.lib, \ LIBS_windows := advapi32.lib psapi.lib, \
)) ))
$(BUILD_LIBMANAGEMENT_EXT): $(call FindLib, java.base, java)
TARGETS += $(BUILD_LIBMANAGEMENT_EXT) TARGETS += $(BUILD_LIBMANAGEMENT_EXT)

View File

@ -32,12 +32,9 @@ include LibCommon.gmk
$(eval $(call SetupJdkLibrary, BUILD_LIBEXTNET, \ $(eval $(call SetupJdkLibrary, BUILD_LIBEXTNET, \
NAME := extnet, \ NAME := extnet, \
OPTIMIZATION := LOW, \ OPTIMIZATION := LOW, \
JDK_LIBS_unix := -ljava, \ EXTRA_HEADER_DIRS := java.base:libjvm, \
JDK_LIBS_linux := -ljvm, \ JDK_LIBS := java.base:libjava, \
JDK_LIBS_windows := $(WIN_JAVA_LIB) jvm.lib, \
LIBS_windows := ws2_32.lib, \ LIBS_windows := ws2_32.lib, \
)) ))
$(BUILD_LIBEXTNET): $(call FindLib, java.base, java)
TARGETS += $(BUILD_LIBEXTNET) TARGETS += $(BUILD_LIBEXTNET)

View File

@ -35,13 +35,12 @@ ifeq ($(call isTargetOs, linux), true)
OPTIMIZATION := LOW, \ OPTIMIZATION := LOW, \
EXTRA_HEADER_DIRS := \ EXTRA_HEADER_DIRS := \
$(call GetJavaHeaderDir, java.base) \ $(call GetJavaHeaderDir, java.base) \
java.base:libnet \ java.base:libjvm \
java.base:libnio \
java.base:libnio/ch, \ java.base:libnio/ch, \
JDK_LIBS_unix := -ljava -ljvm -lnet -lnio, \ JDK_LIBS := java.base:libjava java.base:libnet, \
LIBS_linux := $(LIBDL) -lpthread, \ LIBS_linux := $(LIBDL) -lpthread, \
)) ))
TARGETS += $(BUILD_LIBSCTP) TARGETS += $(BUILD_LIBSCTP)
$(BUILD_LIBSCTP): $(call FindLib, java.base, nio)
endif endif

View File

@ -32,9 +32,8 @@ include LibCommon.gmk
$(eval $(call SetupJdkLibrary, BUILD_LIBJAAS, \ $(eval $(call SetupJdkLibrary, BUILD_LIBJAAS, \
NAME := jaas, \ NAME := jaas, \
OPTIMIZATION := LOW, \ OPTIMIZATION := LOW, \
EXTRA_HEADER_DIRS := java.base:libjava, \
LIBS_windows := advapi32.lib mpr.lib netapi32.lib user32.lib, \ LIBS_windows := advapi32.lib mpr.lib netapi32.lib user32.lib, \
)) ))
$(BUILD_LIBJAAS): $(call FindLib, java.base, java)
TARGETS += $(BUILD_LIBJAAS) TARGETS += $(BUILD_LIBJAAS)

View File

@ -842,9 +842,11 @@ ifeq ($(call isTargetOs, linux), true)
BUILD_HOTSPOT_JTREG_LIBRARIES_LIBS_libstepBreakPopReturn := -lpthread BUILD_HOTSPOT_JTREG_LIBRARIES_LIBS_libstepBreakPopReturn := -lpthread
BUILD_HOTSPOT_JTREG_LIBRARIES_LIBS_libIndyRedefineClass := -lpthread BUILD_HOTSPOT_JTREG_LIBRARIES_LIBS_libIndyRedefineClass := -lpthread
BUILD_HOTSPOT_JTREG_LIBRARIES_LIBS_libredefineClasses := -lpthread BUILD_HOTSPOT_JTREG_LIBRARIES_LIBS_libredefineClasses := -lpthread
BUILD_HOTSPOT_JTREG_EXECUTABLES_LIBS_exeinvoke := -ljvm -lpthread BUILD_HOTSPOT_JTREG_EXECUTABLES_JDK_LIBS_exeinvoke := java.base:libjvm
BUILD_HOTSPOT_JTREG_EXECUTABLES_LIBS_exestack-gap := -ljvm -lpthread BUILD_HOTSPOT_JTREG_EXECUTABLES_JDK_LIBS_exestack-gap := java.base:libjvm
BUILD_HOTSPOT_JTREG_EXECUTABLES_LIBS_exestack-tls := -ljvm BUILD_HOTSPOT_JTREG_EXECUTABLES_JDK_LIBS_exestack-tls := java.base:libjvm
BUILD_HOTSPOT_JTREG_EXECUTABLES_LIBS_exeinvoke := -lpthread
BUILD_HOTSPOT_JTREG_EXECUTABLES_LIBS_exestack-gap := -lpthread
BUILD_TEST_exeinvoke_exeinvoke.c_OPTIMIZATION := NONE BUILD_TEST_exeinvoke_exeinvoke.c_OPTIMIZATION := NONE
BUILD_HOTSPOT_JTREG_EXECUTABLES_LIBS_exeFPRegs := -ldl BUILD_HOTSPOT_JTREG_EXECUTABLES_LIBS_exeFPRegs := -ldl
BUILD_HOTSPOT_JTREG_LIBRARIES_LIBS_libAsyncGetCallTraceTest := -ldl BUILD_HOTSPOT_JTREG_LIBRARIES_LIBS_libAsyncGetCallTraceTest := -ldl
@ -859,16 +861,15 @@ ifeq ($(call And, $(call isTargetOs, linux) $(call isTargetCpu, aarch64)), false
endif endif
BUILD_HOTSPOT_JTREG_EXECUTABLES_LIBS_exesigtest := -ljvm BUILD_HOTSPOT_JTREG_EXECUTABLES_JDK_LIBS_exesigtest := java.base:libjvm
BUILD_HOTSPOT_JTREG_LIBRARIES_JDK_LIBS_libatExit := java.base:libjvm
BUILD_HOTSPOT_JTREG_EXECUTABLES_JDK_LIBS_exedaemonDestroy := java.base:libjvm
ifeq ($(call isTargetOs, windows), true) ifeq ($(call isTargetOs, windows), true)
BUILD_HOTSPOT_JTREG_EXECUTABLES_CFLAGS_exeFPRegs := -MT BUILD_HOTSPOT_JTREG_EXECUTABLES_CFLAGS_exeFPRegs := -MT
BUILD_HOTSPOT_JTREG_EXCLUDE += exesigtest.c libterminatedThread.c libTestJNI.c libCompleteExit.c libMonitorWithDeadObjectTest.c libTestPsig.c exeGetCreatedJavaVMs.c BUILD_HOTSPOT_JTREG_EXCLUDE += exesigtest.c libterminatedThread.c libTestJNI.c libCompleteExit.c libMonitorWithDeadObjectTest.c libTestPsig.c exeGetCreatedJavaVMs.c
BUILD_HOTSPOT_JTREG_LIBRARIES_LIBS_libatExit := jvm.lib BUILD_HOTSPOT_JTREG_LIBRARIES_JDK_LIBS_libnativeStack := java.base:libjvm
BUILD_HOTSPOT_JTREG_LIBRARIES_LIBS_libnativeStack := jvm.lib
BUILD_HOTSPOT_JTREG_EXECUTABLES_LIBS_exedaemonDestroy := jvm.lib
else else
BUILD_HOTSPOT_JTREG_EXECUTABLES_LIBS_exedaemonDestroy := -ljvm
BUILD_HOTSPOT_JTREG_LIBRARIES_LIBS_libbootclssearch_agent += -lpthread BUILD_HOTSPOT_JTREG_LIBRARIES_LIBS_libbootclssearch_agent += -lpthread
BUILD_HOTSPOT_JTREG_LIBRARIES_LIBS_libsystemclssearch_agent += -lpthread BUILD_HOTSPOT_JTREG_LIBRARIES_LIBS_libsystemclssearch_agent += -lpthread
BUILD_HOTSPOT_JTREG_LIBRARIES_LIBS_libgetsysprop001 += -lpthread BUILD_HOTSPOT_JTREG_LIBRARIES_LIBS_libgetsysprop001 += -lpthread
@ -1503,11 +1504,11 @@ else
BUILD_HOTSPOT_JTREG_LIBRARIES_LIBS_libgetphase001 += -lpthread BUILD_HOTSPOT_JTREG_LIBRARIES_LIBS_libgetphase001 += -lpthread
BUILD_HOTSPOT_JTREG_LIBRARIES_LIBS_libgetphase002 += -lpthread BUILD_HOTSPOT_JTREG_LIBRARIES_LIBS_libgetphase002 += -lpthread
BUILD_HOTSPOT_JTREG_LIBRARIES_LIBS_libterminatedThread += -lpthread BUILD_HOTSPOT_JTREG_LIBRARIES_LIBS_libterminatedThread += -lpthread
BUILD_HOTSPOT_JTREG_LIBRARIES_LIBS_libatExit += -ljvm
BUILD_HOTSPOT_JTREG_LIBRARIES_LIBS_libCompleteExit += -lpthread BUILD_HOTSPOT_JTREG_LIBRARIES_LIBS_libCompleteExit += -lpthread
BUILD_HOTSPOT_JTREG_LIBRARIES_LIBS_libMonitorWithDeadObjectTest += -lpthread BUILD_HOTSPOT_JTREG_LIBRARIES_LIBS_libMonitorWithDeadObjectTest += -lpthread
BUILD_HOTSPOT_JTREG_LIBRARIES_LIBS_libnativeStack += -lpthread BUILD_HOTSPOT_JTREG_LIBRARIES_LIBS_libnativeStack += -lpthread
BUILD_HOTSPOT_JTREG_EXECUTABLES_LIBS_exeGetCreatedJavaVMs := -ljvm -lpthread BUILD_HOTSPOT_JTREG_EXECUTABLES_LIBS_exeGetCreatedJavaVMs := -lpthread
BUILD_HOTSPOT_JTREG_EXECUTABLES_JDK_LIBS_exeGetCreatedJavaVMs := java.base:libjvm
BUILD_HOTSPOT_JTREG_EXCLUDE += libNativeException.c BUILD_HOTSPOT_JTREG_EXCLUDE += libNativeException.c
endif endif

View File

@ -53,28 +53,26 @@ BUILD_JDK_JTREG_EXECUTABLES_CFLAGS_exeJliLaunchTest := \
-I$(TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libjli \ -I$(TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libjli \
-I$(TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS)/native/libjli -I$(TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS)/native/libjli
BUILD_JDK_JTREG_EXECUTABLES_JDK_LIBS_exeJliLaunchTest := java.base:libjli
BUILD_JDK_JTREG_EXECUTABLES_JDK_LIBS_exeCallerAccessTest := java.base:libjvm
BUILD_JDK_JTREG_EXECUTABLES_JDK_LIBS_exeNullCallerTest := java.base:libjvm
BUILD_JDK_JTREG_LIBRARIES_JDK_LIBS_libstringPlatformChars := java.base:libjava
BUILD_JDK_JTREG_LIBRARIES_JDK_LIBS_libTracePinnedThreads := java.base:libjvm
BUILD_JDK_JTREG_LIBRARIES_JDK_LIBS_libNewDirectByteBuffer := java.base:libjava
BUILD_JDK_JTREG_LIBRARIES_JDK_LIBS_libGetXSpace := java.base:libjava
# Platform specific setup # Platform specific setup
ifeq ($(call isTargetOs, windows), true) ifeq ($(call isTargetOs, windows), true)
BUILD_JDK_JTREG_EXCLUDE += libDirectIO.c libInheritedChannel.c \ BUILD_JDK_JTREG_EXCLUDE += libDirectIO.c libInheritedChannel.c \
libExplicitAttach.c libImplicitAttach.c \ libExplicitAttach.c libImplicitAttach.c \
exelauncher.c exelauncher.c
WIN_LIB_JAVA := $(SUPPORT_OUTPUTDIR)/native/java.base/libjava/java.lib BUILD_JDK_JTREG_EXECUTABLES_LIBS_exeNullCallerTest := $(LIBCXX)
BUILD_JDK_JTREG_LIBRARIES_LIBS_libstringPlatformChars := $(WIN_LIB_JAVA)
WIN_LIB_JLI := $(SUPPORT_OUTPUTDIR)/native/java.base/libjli/jli.lib
BUILD_JDK_JTREG_EXECUTABLES_LIBS_exeJliLaunchTest := $(WIN_LIB_JLI)
BUILD_JDK_JTREG_EXECUTABLES_LIBS_exeCallerAccessTest := jvm.lib
BUILD_JDK_JTREG_EXECUTABLES_LIBS_exeNullCallerTest := $(LIBCXX) jvm.lib
BUILD_JDK_JTREG_EXECUTABLES_LIBS_exerevokeall := advapi32.lib BUILD_JDK_JTREG_EXECUTABLES_LIBS_exerevokeall := advapi32.lib
BUILD_JDK_JTREG_EXECUTABLES_CFLAGS_exeNullCallerTest := /EHsc BUILD_JDK_JTREG_EXECUTABLES_CFLAGS_exeNullCallerTest := /EHsc
BUILD_JDK_JTREG_LIBRARIES_LIBS_libTracePinnedThreads := jvm.lib
BUILD_JDK_JTREG_LIBRARIES_LIBS_libNewDirectByteBuffer := $(WIN_LIB_JAVA)
BUILD_JDK_JTREG_LIBRARIES_LIBS_libGetXSpace := $(WIN_LIB_JAVA)
else else
BUILD_JDK_JTREG_LIBRARIES_LIBS_libstringPlatformChars := -ljava BUILD_JDK_JTREG_LIBRARIES_JDK_LIBS_libDirectIO := java.base:libjava
BUILD_JDK_JTREG_LIBRARIES_LIBS_libDirectIO := -ljava
BUILD_JDK_JTREG_LIBRARIES_LIBS_libNewDirectByteBuffer := -ljava
BUILD_JDK_JTREG_LIBRARIES_LIBS_libGetXSpace := -ljava
BUILD_JDK_JTREG_LIBRARIES_LDFLAGS_libNativeThread := -pthread BUILD_JDK_JTREG_LIBRARIES_LDFLAGS_libNativeThread := -pthread
# java.lang.foreign tests # java.lang.foreign tests
@ -84,28 +82,22 @@ else
BUILD_JDK_JTREG_LIBRARIES_LDFLAGS_libLinkerInvokerModule := -pthread BUILD_JDK_JTREG_LIBRARIES_LDFLAGS_libLinkerInvokerModule := -pthread
BUILD_JDK_JTREG_LIBRARIES_LDFLAGS_libLoaderLookupInvoker := -pthread BUILD_JDK_JTREG_LIBRARIES_LDFLAGS_libLoaderLookupInvoker := -pthread
BUILD_JDK_JTREG_LIBRARIES_LIBS_libExplicitAttach := -ljvm BUILD_JDK_JTREG_LIBRARIES_JDK_LIBS_libExplicitAttach := java.base:libjvm
BUILD_JDK_JTREG_LIBRARIES_LDFLAGS_libExplicitAttach := -pthread BUILD_JDK_JTREG_LIBRARIES_LDFLAGS_libExplicitAttach := -pthread
BUILD_JDK_JTREG_LIBRARIES_LDFLAGS_libImplicitAttach := -pthread BUILD_JDK_JTREG_LIBRARIES_LDFLAGS_libImplicitAttach := -pthread
BUILD_JDK_JTREG_LIBRARIES_LIBS_libTracePinnedThreads := -ljvm
BUILD_JDK_JTREG_EXCLUDE += exerevokeall.c BUILD_JDK_JTREG_EXCLUDE += exerevokeall.c
ifeq ($(call isTargetOs, linux), true) ifeq ($(call isTargetOs, linux), true)
BUILD_JDK_JTREG_LIBRARIES_LIBS_libInheritedChannel := -ljava BUILD_JDK_JTREG_LIBRARIES_JDK_LIBS_libInheritedChannel := java.base:libjava
BUILD_JDK_JTREG_EXECUTABLES_LIBS_exelauncher := -ldl BUILD_JDK_JTREG_EXECUTABLES_LIBS_exelauncher := -ldl
endif endif
BUILD_JDK_JTREG_EXECUTABLES_LIBS_exeJliLaunchTest := -ljli BUILD_JDK_JTREG_EXECUTABLES_LIBS_exeNullCallerTest := $(LIBCXX)
ifeq ($(call isTargetOs, aix), true)
BUILD_JDK_JTREG_EXECUTABLES_LDFLAGS_exeJliLaunchTest := -L$(SUPPORT_OUTPUTDIR)/native/java.base
endif
BUILD_JDK_JTREG_EXECUTABLES_LIBS_exeCallerAccessTest := -ljvm
BUILD_JDK_JTREG_EXECUTABLES_LIBS_exeNullCallerTest := $(LIBCXX) -ljvm
endif endif
ifeq ($(call isTargetOs, macosx), true) ifeq ($(call isTargetOs, macosx), true)
BUILD_JDK_JTREG_EXCLUDE += exelauncher.c BUILD_JDK_JTREG_EXCLUDE += exelauncher.c
BUILD_JDK_JTREG_LIBRARIES_LIBS_libTestMainKeyWindow := \ BUILD_JDK_JTREG_LIBRARIES_LIBS_libTestMainKeyWindow := \
-framework Cocoa -framework Cocoa
BUILD_JDK_JTREG_EXECUTABLES_LIBS_exeJniInvocationTest := -ljli BUILD_JDK_JTREG_EXECUTABLES_JDK_LIBS_exeJniInvocationTest := java.base:libjli
BUILD_JDK_JTREG_LIBRARIES_LIBS_libTestDynamicStore := \ BUILD_JDK_JTREG_LIBRARIES_LIBS_libTestDynamicStore := \
-framework Cocoa -framework SystemConfiguration -framework Cocoa -framework SystemConfiguration
else else

View File

@ -48,11 +48,7 @@ BUILD_LIBTEST_JTREG_OUTPUT_DIR := $(OUTPUTDIR)/support/test/lib-test/jtreg/nativ
BUILD_LIBTEST_JTREG_IMAGE_DIR := $(TEST_IMAGE_DIR)/lib-test/jtreg BUILD_LIBTEST_JTREG_IMAGE_DIR := $(TEST_IMAGE_DIR)/lib-test/jtreg
ifeq ($(call isTargetOs, windows), true) BUILD_LIBTEST_JTREG_EXECUTABLES_JDK_LIBS_exejvm-test-launcher := java.base:libjvm
BUILD_LIBTEST_JTREG_EXECUTABLES_LIBS_exejvm-test-launcher := jvm.lib
else
BUILD_LIBTEST_JTREG_EXECUTABLES_LIBS_exejvm-test-launcher := -ljvm
endif
# This evaluation is expensive and should only be done if this target was # This evaluation is expensive and should only be done if this target was
# explicitly called. # explicitly called.