Skip to content

Commit

Permalink
8245832: JDK build make-static-libs should build all JDK libraries
Browse files Browse the repository at this point in the history
Reviewed-by: erikj
  • Loading branch information
Bob Vandette committed May 29, 2020
1 parent 5314d28 commit f79801b
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 20 deletions.
6 changes: 5 additions & 1 deletion make/Main.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ $(eval $(call DeclareRecipesForPhase, STATIC_LIBS, \
TARGET_SUFFIX := static-libs, \
FILE_PREFIX := Lib, \
MAKE_SUBDIR := lib, \
CHECK_MODULES := $(STATIC_LIBS_MODULES), \
CHECK_MODULES := $(ALL_MODULES), \
EXTRA_ARGS := STATIC_LIBS=true, \
))

Expand Down Expand Up @@ -798,10 +798,14 @@ else

# If not already set, set the JVM variant target so that the JVM will be built.
JVM_MAIN_LIB_TARGETS ?= hotspot-$(JVM_VARIANT_MAIN)-libs
JVM_MAIN_GENSRC_TARGETS ?= hotspot-$(JVM_VARIANT_MAIN)-gensrc

# Building one JVM variant is enough to start building the other libs
$(LIBS_TARGETS): $(JVM_MAIN_LIB_TARGETS)

# Static libs depend on hotspot gensrc
$(STATIC_LIBS_TARGETS): $(JVM_MAIN_GENSRC_TARGETS)

$(LAUNCHER_TARGETS): java.base-libs

ifeq ($(STATIC_BUILD), true)
Expand Down
4 changes: 3 additions & 1 deletion make/StaticLibsImage.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,13 @@ include $(SPEC)
include MakeBase.gmk
include Modules.gmk

ALL_MODULES = $(call FindAllModules)

################################################################################

TARGETS :=

$(foreach m, $(STATIC_LIBS_MODULES), \
$(foreach m, $(ALL_MODULES), \
$(eval $(call SetupCopyFiles, COPY_STATIC_LIBS_$m, \
FLATTEN := true, \
SRC := $(SUPPORT_OUTPUTDIR)/native/$m, \
Expand Down
15 changes: 0 additions & 15 deletions make/common/Modules.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -193,21 +193,6 @@ HOTSPOT_MODULES := \
jdk.internal.vm.compiler.management \
#

# The native dynamic libraries in these modules will also get built into static
# libraries for consumption by downstream projects that need to statically link
# the JDK libraries. Those static libraries are not part of the main JDK
# distribution.
STATIC_LIBS_MODULES := \
java.base \
jdk.crypto.ec \
jdk.security.auth \
java.prefs \
java.security.jgss \
java.smartcardio \
jdk.crypto.cryptoki \
jdk.net \
#

################################################################################
# Some platforms don't have the serviceability agent

Expand Down
2 changes: 1 addition & 1 deletion src/java.desktop/macosx/native/libjawt/jawt.m
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
* Get the AWT native structure.
* This function returns JNI_FALSE if an error occurs.
*/
JNIEXPORT jboolean JNICALL JAWT_GetAWT
_JNI_IMPORT_OR_EXPORT_ jboolean JNICALL JAWT_GetAWT
(JNIEnv* env, JAWT* awt)
{
if (awt == NULL) {
Expand Down
2 changes: 1 addition & 1 deletion src/java.desktop/unix/native/libjawt/jawt.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ DEF_STATIC_JNI_OnLoad
* Get the AWT native structure. This function returns JNI_FALSE if
* an error occurs.
*/
JNIEXPORT jboolean JNICALL JAWT_GetAWT(JNIEnv* env, JAWT* awt)
_JNI_IMPORT_OR_EXPORT_ jboolean JNICALL JAWT_GetAWT(JNIEnv* env, JAWT* awt)
{
#if defined(HEADLESS)
/* there are no AWT libs available at all */
Expand Down
2 changes: 1 addition & 1 deletion src/java.desktop/windows/native/libjawt/jawt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ DEF_STATIC_JNI_OnLoad
* Get the AWT native structure. This function returns JNI_FALSE if
* an error occurs.
*/
extern "C" JNIEXPORT jboolean JNICALL JAWT_GetAWT(JNIEnv* env, JAWT* awt)
extern "C" _JNI_IMPORT_OR_EXPORT_ jboolean JNICALL JAWT_GetAWT(JNIEnv* env, JAWT* awt)
{
if (awt == NULL) {
return JNI_FALSE;
Expand Down

0 comments on commit f79801b

Please sign in to comment.