Skip to content

Commit 61fa4d4

Browse files
committed
8330351: Remove the SHARED_LIBRARY and STATIC_LIBRARY macros
Reviewed-by: erikj
1 parent 56ff87a commit 61fa4d4

File tree

5 files changed

+9
-27
lines changed

5 files changed

+9
-27
lines changed

make/RunTestsPrebuiltSpec.gmk

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved.
33
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
#
55
# This code is free software; you can redistribute it and/or modify it
@@ -176,7 +176,3 @@ ULIMIT := ulimit
176176
ifeq ($(OPENJDK_BUILD_OS), windows)
177177
PATHTOOL := cygpath
178178
endif
179-
180-
################################################################################
181-
# Simple macros from spec.gmk.in
182-
SHARED_LIBRARY=$(LIBRARY_PREFIX)$1$(SHARED_LIBRARY_SUFFIX)

make/autoconf/spec.gmk.template

-7
Original file line numberDiff line numberDiff line change
@@ -625,13 +625,6 @@ SHARED_LIBRARY_FLAGS := @SHARED_LIBRARY_FLAGS@
625625
SET_SHARED_LIBRARY_ORIGIN = @SET_SHARED_LIBRARY_ORIGIN@
626626
SET_EXECUTABLE_ORIGIN = @SET_EXECUTABLE_ORIGIN@
627627

628-
# Different OS:es have different ways of naming shared libraries.
629-
# The SHARED_LIBRARY and STATIC_LIBRARY macros takes "verify" as and argument and returns:
630-
# "libverify.so" or "libverify.dylib" or "verify.dll" depending on platform.
631-
# (Note absence of := assignment, because we do not want to evaluate the macro body here)
632-
SHARED_LIBRARY = @SHARED_LIBRARY@
633-
STATIC_LIBRARY = @STATIC_LIBRARY@
634-
635628
LIBRARY_PREFIX := @LIBRARY_PREFIX@
636629
SHARED_LIBRARY_SUFFIX := @SHARED_LIBRARY_SUFFIX@
637630
STATIC_LIBRARY_SUFFIX := @STATIC_LIBRARY_SUFFIX@

make/autoconf/toolchain.m4

+2-10
Original file line numberDiff line numberDiff line change
@@ -174,30 +174,24 @@ AC_DEFUN([TOOLCHAIN_SETUP_FILENAME_PATTERNS],
174174
LIBRARY_PREFIX=
175175
SHARED_LIBRARY_SUFFIX='.dll'
176176
STATIC_LIBRARY_SUFFIX='.lib'
177-
SHARED_LIBRARY='[$]1.dll'
178-
STATIC_LIBRARY='[$]1.lib'
179177
OBJ_SUFFIX='.obj'
180178
EXECUTABLE_SUFFIX='.exe'
181179
else
182180
LIBRARY_PREFIX=lib
183181
SHARED_LIBRARY_SUFFIX='.so'
184182
STATIC_LIBRARY_SUFFIX='.a'
185-
SHARED_LIBRARY='lib[$]1.so'
186-
STATIC_LIBRARY='lib[$]1.a'
187183
OBJ_SUFFIX='.o'
188184
EXECUTABLE_SUFFIX=''
189185
if test "x$OPENJDK_TARGET_OS" = xmacosx; then
190-
# For full static builds, we're overloading the SHARED_LIBRARY
191-
# variables in order to limit the amount of changes required.
186+
# For full static builds, we're overloading the shared library suffix
187+
# in order to limit the amount of changes required.
192188
# It would be better to remove SHARED and just use LIBRARY and
193189
# LIBRARY_SUFFIX for libraries that can be built either
194190
# shared or static and use STATIC_* for libraries that are
195191
# always built statically.
196192
if test "x$STATIC_BUILD" = xtrue; then
197-
SHARED_LIBRARY='lib[$]1.a'
198193
SHARED_LIBRARY_SUFFIX='.a'
199194
else
200-
SHARED_LIBRARY='lib[$]1.dylib'
201195
SHARED_LIBRARY_SUFFIX='.dylib'
202196
fi
203197
fi
@@ -206,8 +200,6 @@ AC_DEFUN([TOOLCHAIN_SETUP_FILENAME_PATTERNS],
206200
AC_SUBST(LIBRARY_PREFIX)
207201
AC_SUBST(SHARED_LIBRARY_SUFFIX)
208202
AC_SUBST(STATIC_LIBRARY_SUFFIX)
209-
AC_SUBST(SHARED_LIBRARY)
210-
AC_SUBST(STATIC_LIBRARY)
211203
AC_SUBST(OBJ_SUFFIX)
212204
AC_SUBST(EXECUTABLE_SUFFIX)
213205
])

make/hotspot/test/GtestImage.gmk

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved.
33
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
#
55
# This code is free software; you can redistribute it and/or modify it
@@ -34,7 +34,7 @@ $(foreach v, $(JVM_VARIANTS), \
3434
$(eval $(call SetupCopyFiles, COPY_GTEST_$v, \
3535
SRC := $(HOTSPOT_OUTPUTDIR)/variant-$v/libjvm/gtest, \
3636
DEST := $(TEST_IMAGE_DIR)/hotspot/gtest/$v, \
37-
FILES := $(call SHARED_LIBRARY,jvm) gtestLauncher$(EXECUTABLE_SUFFIX), \
37+
FILES := $(LIBRARY_PREFIX)jvm$(SHARED_LIBRARY_SUFFIX) gtestLauncher$(EXECUTABLE_SUFFIX), \
3838
)) \
3939
$(eval TARGETS += $$(COPY_GTEST_$v)) \
4040
)

make/modules/java.base/Lib.gmk

+4-3
Original file line numberDiff line numberDiff line change
@@ -126,17 +126,18 @@ ifeq ($(call isTargetOsType, unix)+$(STATIC_BUILD), true+false)
126126
# Create symlinks to libjsig in each JVM variant sub dir
127127
ifneq ($(STATIC_LIBS), true)
128128
LIB_OUTPUTDIR := $(call FindLibDirForModule, java.base)
129+
LIBJSIG_NAME := $(LIBRARY_PREFIX)jsig$(SHARED_LIBRARY_SUFFIX)
129130

130131
# $1 variant subdir
131132
define CreateSymlinks
132133
# Always symlink from libdir/variant/libjsig.so -> ../libjsig.so.
133-
$(LIB_OUTPUTDIR)/$1/$(call SHARED_LIBRARY,jsig): \
134-
$(LIB_OUTPUTDIR)/$(call SHARED_LIBRARY,jsig)
134+
$(LIB_OUTPUTDIR)/$1/$(LIBJSIG_NAME): \
135+
$(LIB_OUTPUTDIR)/$(LIBJSIG_NAME)
135136
$$(call MakeDir, $$(@D))
136137
$(RM) $$@
137138
$(LN) -s ../$$(@F) $$@
138139

139-
TARGETS += $(LIB_OUTPUTDIR)/$1/$(call SHARED_LIBRARY,jsig)
140+
TARGETS += $(LIB_OUTPUTDIR)/$1/$(LIBJSIG_NAME)
140141
endef
141142

142143
# The subdir is the same as the variant

0 commit comments

Comments
 (0)