From 61fa4d45b68ffbfb751471730518651b78b195aa Mon Sep 17 00:00:00 2001 From: Magnus Ihse Bursie Date: Tue, 16 Apr 2024 13:51:14 +0000 Subject: [PATCH] 8330351: Remove the SHARED_LIBRARY and STATIC_LIBRARY macros Reviewed-by: erikj --- make/RunTestsPrebuiltSpec.gmk | 6 +----- make/autoconf/spec.gmk.template | 7 ------- make/autoconf/toolchain.m4 | 12 ++---------- make/hotspot/test/GtestImage.gmk | 4 ++-- make/modules/java.base/Lib.gmk | 7 ++++--- 5 files changed, 9 insertions(+), 27 deletions(-) diff --git a/make/RunTestsPrebuiltSpec.gmk b/make/RunTestsPrebuiltSpec.gmk index 16a14fbd2a0..170a2c25553 100644 --- a/make/RunTestsPrebuiltSpec.gmk +++ b/make/RunTestsPrebuiltSpec.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -176,7 +176,3 @@ ULIMIT := ulimit ifeq ($(OPENJDK_BUILD_OS), windows) PATHTOOL := cygpath endif - -################################################################################ -# Simple macros from spec.gmk.in -SHARED_LIBRARY=$(LIBRARY_PREFIX)$1$(SHARED_LIBRARY_SUFFIX) diff --git a/make/autoconf/spec.gmk.template b/make/autoconf/spec.gmk.template index 2f2525a662a..616999f2736 100644 --- a/make/autoconf/spec.gmk.template +++ b/make/autoconf/spec.gmk.template @@ -625,13 +625,6 @@ SHARED_LIBRARY_FLAGS := @SHARED_LIBRARY_FLAGS@ SET_SHARED_LIBRARY_ORIGIN = @SET_SHARED_LIBRARY_ORIGIN@ SET_EXECUTABLE_ORIGIN = @SET_EXECUTABLE_ORIGIN@ -# Different OS:es have different ways of naming shared libraries. -# The SHARED_LIBRARY and STATIC_LIBRARY macros takes "verify" as and argument and returns: -# "libverify.so" or "libverify.dylib" or "verify.dll" depending on platform. -# (Note absence of := assignment, because we do not want to evaluate the macro body here) -SHARED_LIBRARY = @SHARED_LIBRARY@ -STATIC_LIBRARY = @STATIC_LIBRARY@ - LIBRARY_PREFIX := @LIBRARY_PREFIX@ SHARED_LIBRARY_SUFFIX := @SHARED_LIBRARY_SUFFIX@ STATIC_LIBRARY_SUFFIX := @STATIC_LIBRARY_SUFFIX@ diff --git a/make/autoconf/toolchain.m4 b/make/autoconf/toolchain.m4 index aceb6edb79d..15f4247b274 100644 --- a/make/autoconf/toolchain.m4 +++ b/make/autoconf/toolchain.m4 @@ -174,30 +174,24 @@ AC_DEFUN([TOOLCHAIN_SETUP_FILENAME_PATTERNS], LIBRARY_PREFIX= SHARED_LIBRARY_SUFFIX='.dll' STATIC_LIBRARY_SUFFIX='.lib' - SHARED_LIBRARY='[$]1.dll' - STATIC_LIBRARY='[$]1.lib' OBJ_SUFFIX='.obj' EXECUTABLE_SUFFIX='.exe' else LIBRARY_PREFIX=lib SHARED_LIBRARY_SUFFIX='.so' STATIC_LIBRARY_SUFFIX='.a' - SHARED_LIBRARY='lib[$]1.so' - STATIC_LIBRARY='lib[$]1.a' OBJ_SUFFIX='.o' EXECUTABLE_SUFFIX='' if test "x$OPENJDK_TARGET_OS" = xmacosx; then - # For full static builds, we're overloading the SHARED_LIBRARY - # variables in order to limit the amount of changes required. + # For full static builds, we're overloading the shared library suffix + # in order to limit the amount of changes required. # It would be better to remove SHARED and just use LIBRARY and # LIBRARY_SUFFIX for libraries that can be built either # shared or static and use STATIC_* for libraries that are # always built statically. if test "x$STATIC_BUILD" = xtrue; then - SHARED_LIBRARY='lib[$]1.a' SHARED_LIBRARY_SUFFIX='.a' else - SHARED_LIBRARY='lib[$]1.dylib' SHARED_LIBRARY_SUFFIX='.dylib' fi fi @@ -206,8 +200,6 @@ AC_DEFUN([TOOLCHAIN_SETUP_FILENAME_PATTERNS], AC_SUBST(LIBRARY_PREFIX) AC_SUBST(SHARED_LIBRARY_SUFFIX) AC_SUBST(STATIC_LIBRARY_SUFFIX) - AC_SUBST(SHARED_LIBRARY) - AC_SUBST(STATIC_LIBRARY) AC_SUBST(OBJ_SUFFIX) AC_SUBST(EXECUTABLE_SUFFIX) ]) diff --git a/make/hotspot/test/GtestImage.gmk b/make/hotspot/test/GtestImage.gmk index b6256cd575b..3d6290837ee 100644 --- a/make/hotspot/test/GtestImage.gmk +++ b/make/hotspot/test/GtestImage.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -34,7 +34,7 @@ $(foreach v, $(JVM_VARIANTS), \ $(eval $(call SetupCopyFiles, COPY_GTEST_$v, \ SRC := $(HOTSPOT_OUTPUTDIR)/variant-$v/libjvm/gtest, \ DEST := $(TEST_IMAGE_DIR)/hotspot/gtest/$v, \ - FILES := $(call SHARED_LIBRARY,jvm) gtestLauncher$(EXECUTABLE_SUFFIX), \ + FILES := $(LIBRARY_PREFIX)jvm$(SHARED_LIBRARY_SUFFIX) gtestLauncher$(EXECUTABLE_SUFFIX), \ )) \ $(eval TARGETS += $$(COPY_GTEST_$v)) \ ) diff --git a/make/modules/java.base/Lib.gmk b/make/modules/java.base/Lib.gmk index 3a24c5e4550..cb7c2ed84ae 100644 --- a/make/modules/java.base/Lib.gmk +++ b/make/modules/java.base/Lib.gmk @@ -126,17 +126,18 @@ ifeq ($(call isTargetOsType, unix)+$(STATIC_BUILD), true+false) # Create symlinks to libjsig in each JVM variant sub dir ifneq ($(STATIC_LIBS), true) LIB_OUTPUTDIR := $(call FindLibDirForModule, java.base) + LIBJSIG_NAME := $(LIBRARY_PREFIX)jsig$(SHARED_LIBRARY_SUFFIX) # $1 variant subdir define CreateSymlinks # Always symlink from libdir/variant/libjsig.so -> ../libjsig.so. - $(LIB_OUTPUTDIR)/$1/$(call SHARED_LIBRARY,jsig): \ - $(LIB_OUTPUTDIR)/$(call SHARED_LIBRARY,jsig) + $(LIB_OUTPUTDIR)/$1/$(LIBJSIG_NAME): \ + $(LIB_OUTPUTDIR)/$(LIBJSIG_NAME) $$(call MakeDir, $$(@D)) $(RM) $$@ $(LN) -s ../$$(@F) $$@ - TARGETS += $(LIB_OUTPUTDIR)/$1/$(call SHARED_LIBRARY,jsig) + TARGETS += $(LIB_OUTPUTDIR)/$1/$(LIBJSIG_NAME) endef # The subdir is the same as the variant