8077847: Better handling of Windows executable manifest version
Reviewed-by: erikj, tbell
This commit is contained in:
parent
7f3a8ab26c
commit
35e5e5eaa8
@ -182,6 +182,7 @@ else
|
|||||||
FULL_VERSION=$(RELEASE)-$(JDK_BUILD_NUMBER)
|
FULL_VERSION=$(RELEASE)-$(JDK_BUILD_NUMBER)
|
||||||
endif
|
endif
|
||||||
JRE_RELEASE_VERSION:=$(FULL_VERSION)
|
JRE_RELEASE_VERSION:=$(FULL_VERSION)
|
||||||
|
JDK_VERSION_FOR_MANIFEST := $(JDK_MINOR_VERSION).$(JDK_MICRO_VERSION).$(if $(JDK_UPDATE_VERSION),$(JDK_UPDATE_VERSION),0).$(COOKED_BUILD_NUMBER)
|
||||||
|
|
||||||
# How to compile the code: release, fastdebug or slowdebug
|
# How to compile the code: release, fastdebug or slowdebug
|
||||||
DEBUG_LEVEL:=@DEBUG_LEVEL@
|
DEBUG_LEVEL:=@DEBUG_LEVEL@
|
||||||
|
@ -319,6 +319,12 @@ define SetupNativeCompilationBody
|
|||||||
$1_CXX:=$(CXX)
|
$1_CXX:=$(CXX)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifneq ($$($1_MANIFEST), )
|
||||||
|
ifeq ($$($1_MANIFEST_VERSION), )
|
||||||
|
$$(error If MANIFEST is provided, then MANIFEST_VERSION is required in $1)
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
# Make sure the dirs exist.
|
# Make sure the dirs exist.
|
||||||
$$(call MakeDir,$$($1_OBJECT_DIR) $$($1_OUTPUT_DIR))
|
$$(call MakeDir,$$($1_OBJECT_DIR) $$($1_OUTPUT_DIR))
|
||||||
$$(foreach d,$$($1_SRC), $$(if $$(wildcard $$d),,$$(error SRC specified to SetupNativeCompilation $1 contains missing directory $$d)))
|
$$(foreach d,$$($1_SRC), $$(if $$(wildcard $$d),,$$(error SRC specified to SetupNativeCompilation $1 contains missing directory $$d)))
|
||||||
@ -505,14 +511,6 @@ define SetupNativeCompilationBody
|
|||||||
&& $(SED) $(WINDOWS_SHOWINCLUDE_SED_PATTERN) $$($1_RES_DEP).raw) > $$($1_RES_DEP)
|
&& $(SED) $(WINDOWS_SHOWINCLUDE_SED_PATTERN) $$($1_RES_DEP).raw) > $$($1_RES_DEP)
|
||||||
$(SED) $(DEPENDENCY_TARGET_SED_PATTERN) $$($1_RES_DEP) > $$($1_RES_DEP_TARGETS)
|
$(SED) $(DEPENDENCY_TARGET_SED_PATTERN) $$($1_RES_DEP) > $$($1_RES_DEP_TARGETS)
|
||||||
endif
|
endif
|
||||||
ifneq (,$$($1_MANIFEST))
|
|
||||||
$1_GEN_MANIFEST:=$$($1_OBJECT_DIR)/$$($1_PROGRAM).manifest
|
|
||||||
IMVERSIONVALUE:=$(JDK_MINOR_VERSION).$(JDK_MICRO_VERSION).$(JDK_UPDATE_VERSION).$(COOKED_BUILD_NUMBER)
|
|
||||||
$1_MANIFEST_VARDEPS_FILE := $$(call DependOnVariable, IMVERSIONVALUE, \
|
|
||||||
$$($1_GEN_MANIFEST).vardeps)
|
|
||||||
$$($1_GEN_MANIFEST): $$($1_MANIFEST) $$($1_MANIFEST_VARDEPS_FILE)
|
|
||||||
$(SED) 's%IMVERSION%$$(IMVERSIONVALUE)%g;s%PROGRAM%$$($1_PROGRAM)%g' $$< > $$@
|
|
||||||
endif
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# mapfile doesnt seem to be implemented on macosx (yet??)
|
# mapfile doesnt seem to be implemented on macosx (yet??)
|
||||||
@ -661,19 +659,21 @@ define SetupNativeCompilationBody
|
|||||||
$1_EXTRA_LDFLAGS_SUFFIX += $(GLOBAL_LDFLAGS_SUFFIX)
|
$1_EXTRA_LDFLAGS_SUFFIX += $(GLOBAL_LDFLAGS_SUFFIX)
|
||||||
|
|
||||||
$1_VARDEPS := $$($1_LDEXE) $(SYSROOT_LDFLAGS) $$($1_LDFLAGS) $$($1_EXTRA_LDFLAGS) \
|
$1_VARDEPS := $$($1_LDEXE) $(SYSROOT_LDFLAGS) $$($1_LDFLAGS) $$($1_EXTRA_LDFLAGS) \
|
||||||
$$($1_LDFLAGS_SUFFIX) $$($1_EXTRA_LDFLAGS_SUFFIX)
|
$$($1_LDFLAGS_SUFFIX) $$($1_EXTRA_LDFLAGS_SUFFIX) $$($1_MANIFEST_VERSION)
|
||||||
$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_EXPECTED_OBJS) $$($1_RES) $$($1_GEN_MANIFEST) \
|
$$($1_TARGET): $$($1_EXPECTED_OBJS) $$($1_RES) $$($1_MANIFEST) \
|
||||||
$$($1_DEBUGINFO_EXTRA_DEPS) $$($1_VARDEPS_FILE)
|
$$($1_DEBUGINFO_EXTRA_DEPS) $$($1_VARDEPS_FILE)
|
||||||
$(ECHO) $(LOG_INFO) "Linking executable $$($1_BASENAME)"
|
$(ECHO) $(LOG_INFO) "Linking executable $$($1_BASENAME)"
|
||||||
$$($1_LDEXE) $$($1_LDFLAGS) $$($1_EXTRA_LDFLAGS) $(SYSROOT_LDFLAGS) \
|
$$($1_LDEXE) $$($1_LDFLAGS) $$($1_EXTRA_LDFLAGS) $(SYSROOT_LDFLAGS) \
|
||||||
$(EXE_OUT_OPTION)$$($1_TARGET) \
|
$(EXE_OUT_OPTION)$$($1_TARGET) \
|
||||||
$$($1_EXPECTED_OBJS) $$($1_RES) \
|
$$($1_EXPECTED_OBJS) $$($1_RES) \
|
||||||
$$($1_LDFLAGS_SUFFIX) $$($1_EXTRA_LDFLAGS_SUFFIX)
|
$$($1_LDFLAGS_SUFFIX) $$($1_EXTRA_LDFLAGS_SUFFIX)
|
||||||
ifneq (,$$($1_GEN_MANIFEST))
|
ifeq ($(OPENJDK_TARGET_OS), windows)
|
||||||
$(MT) -nologo -manifest $$($1_GEN_MANIFEST) -outputresource:$$@;#1
|
ifneq ($$($1_MANIFEST), )
|
||||||
|
$(MT) -nologo -manifest $$($1_MANIFEST) -identity:"$$($1_PROGRAM).exe, version=$$($1_MANIFEST_VERSION)" -outputresource:$$@;#1
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
# This only works if the openjdk_codesign identity is present on the system. Let
|
# This only works if the openjdk_codesign identity is present on the system. Let
|
||||||
# silently fail otherwise.
|
# silently fail otherwise.
|
||||||
|
Loading…
Reference in New Issue
Block a user