Skip to content

Commit

Permalink
8189761: COMPANY_NAME, IMPLEMENTOR, BUNDLE_VENDOR, VENDOR, but no con…
Browse files Browse the repository at this point in the history
…figure flag

Reviewed-by: erikj, dholmes
  • Loading branch information
simonis committed Jan 18, 2018
1 parent 9038534 commit fa95a1f
Show file tree
Hide file tree
Showing 5 changed files with 156 additions and 18 deletions.
73 changes: 69 additions & 4 deletions make/autoconf/generated-configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -900,6 +900,9 @@ VERSION_PATCH
VERSION_UPDATE
VERSION_INTERIM
VERSION_FEATURE
VENDOR_URL_VM_BUG
VENDOR_URL_BUG
VENDOR_URL
COMPANY_NAME
MACOSX_BUNDLE_ID_BASE
MACOSX_BUNDLE_NAME_BASE
Expand Down Expand Up @@ -1146,6 +1149,9 @@ with_version_major
with_version_minor
with_version_security
with_vendor_name
with_vendor_url
with_vendor_bug_url
with_vendor_vm_bug_url
with_version_string
with_version_pre
with_version_opt
Expand Down Expand Up @@ -2070,7 +2076,16 @@ Optional Packages:
compatibility and is ignored
--with-version-security Deprecated. Option is kept for backwards
compatibility and is ignored
--with-vendor-name Set vendor name [not specified]
--with-vendor-name Set vendor name. Among others, used to set the
'java.vendor' and 'java.vm.vendor' system
properties. [not specified]
--with-vendor-url Set the 'java.vendor.url' system property [not
specified]
--with-vendor-bug-url Set the 'java.vendor.url.bug' system property [not
specified]
--with-vendor-vm-bug-url
Sets the bug URL which will be displayed when the VM
crashes [not specified]
--with-version-string Set version string [calculated]
--with-version-pre Set the base part of the version 'PRE' field
(pre-release identifier) ['internal']
Expand Down Expand Up @@ -5172,7 +5187,7 @@ VS_SDK_PLATFORM_NAME_2013=
#CUSTOM_AUTOCONF_INCLUDE

# Do not change or remove the following line, it is needed for consistency checks:
DATE_WHEN_GENERATED=1513805283
DATE_WHEN_GENERATED=1516225089

###############################################################################
#
Expand Down Expand Up @@ -25052,12 +25067,62 @@ fi
if test "x$with_vendor_name" = xyes; then
as_fn_error $? "--with-vendor-name must have a value" "$LINENO" 5
elif ! [[ $with_vendor_name =~ ^[[:print:]]*$ ]] ; then
as_fn_error $? "--with--vendor-name contains non-printing characters: $with_vendor_name" "$LINENO" 5
else
as_fn_error $? "--with-vendor-name contains non-printing characters: $with_vendor_name" "$LINENO" 5
elif test "x$with_vendor_name" != x; then
# Only set COMPANY_NAME if '--with-vendor-name' was used and is not empty.
# Otherwise we will use the value from "version-numbers" included above.
COMPANY_NAME="$with_vendor_name"
fi


# The vendor URL, if any

# Check whether --with-vendor-url was given.
if test "${with_vendor_url+set}" = set; then :
withval=$with_vendor_url;
fi

if test "x$with_vendor_url" = xyes; then
as_fn_error $? "--with-vendor-url must have a value" "$LINENO" 5
elif ! [[ $with_vendor_url =~ ^[[:print:]]*$ ]] ; then
as_fn_error $? "--with-vendor-url contains non-printing characters: $with_vendor_url" "$LINENO" 5
else
VENDOR_URL="$with_vendor_url"
fi


# The vendor bug URL, if any

# Check whether --with-vendor-bug-url was given.
if test "${with_vendor_bug_url+set}" = set; then :
withval=$with_vendor_bug_url;
fi

if test "x$with_vendor_bug_url" = xyes; then
as_fn_error $? "--with-vendor-bug-url must have a value" "$LINENO" 5
elif ! [[ $with_vendor_bug_url =~ ^[[:print:]]*$ ]] ; then
as_fn_error $? "--with-vendor-bug-url contains non-printing characters: $with_vendor_bug_url" "$LINENO" 5
else
VENDOR_URL_BUG="$with_vendor_bug_url"
fi


# The vendor VM bug URL, if any

# Check whether --with-vendor-vm-bug-url was given.
if test "${with_vendor_vm_bug_url+set}" = set; then :
withval=$with_vendor_vm_bug_url;
fi

if test "x$with_vendor_vm_bug_url" = xyes; then
as_fn_error $? "--with-vendor-vm-bug-url must have a value" "$LINENO" 5
elif ! [[ $with_vendor_vm_bug_url =~ ^[[:print:]]*$ ]] ; then
as_fn_error $? "--with-vendor-vm-bug-url contains non-printing characters: $with_vendor_vm_bug_url" "$LINENO" 5
else
VENDOR_URL_VM_BUG="$with_vendor_vm_bug_url"
fi


# Override version from arguments

# If --with-version-string is set, process it first. It is possible to
Expand Down
45 changes: 42 additions & 3 deletions make/autoconf/jdk-version.m4
Original file line number Diff line number Diff line change
Expand Up @@ -80,16 +80,55 @@ AC_DEFUN_ONCE([JDKVER_SETUP_JDK_VERSION_NUMBERS],
# The vendor name, if any
AC_ARG_WITH(vendor-name, [AS_HELP_STRING([--with-vendor-name],
[Set vendor name @<:@not specified@:>@])])
[Set vendor name. Among others, used to set the 'java.vendor'
and 'java.vm.vendor' system properties. @<:@not specified@:>@])])
if test "x$with_vendor_name" = xyes; then
AC_MSG_ERROR([--with-vendor-name must have a value])
elif [ ! [[ $with_vendor_name =~ ^[[:print:]]*$ ]] ]; then
AC_MSG_ERROR([--with--vendor-name contains non-printing characters: $with_vendor_name])
else
AC_MSG_ERROR([--with-vendor-name contains non-printing characters: $with_vendor_name])
elif test "x$with_vendor_name" != x; then
# Only set COMPANY_NAME if '--with-vendor-name' was used and is not empty.
# Otherwise we will use the value from "version-numbers" included above.
COMPANY_NAME="$with_vendor_name"
fi
AC_SUBST(COMPANY_NAME)
# The vendor URL, if any
AC_ARG_WITH(vendor-url, [AS_HELP_STRING([--with-vendor-url],
[Set the 'java.vendor.url' system property @<:@not specified@:>@])])
if test "x$with_vendor_url" = xyes; then
AC_MSG_ERROR([--with-vendor-url must have a value])
elif [ ! [[ $with_vendor_url =~ ^[[:print:]]*$ ]] ]; then
AC_MSG_ERROR([--with-vendor-url contains non-printing characters: $with_vendor_url])
else
VENDOR_URL="$with_vendor_url"
fi
AC_SUBST(VENDOR_URL)
# The vendor bug URL, if any
AC_ARG_WITH(vendor-bug-url, [AS_HELP_STRING([--with-vendor-bug-url],
[Set the 'java.vendor.url.bug' system property @<:@not specified@:>@])])
if test "x$with_vendor_bug_url" = xyes; then
AC_MSG_ERROR([--with-vendor-bug-url must have a value])
elif [ ! [[ $with_vendor_bug_url =~ ^[[:print:]]*$ ]] ]; then
AC_MSG_ERROR([--with-vendor-bug-url contains non-printing characters: $with_vendor_bug_url])
else
VENDOR_URL_BUG="$with_vendor_bug_url"
fi
AC_SUBST(VENDOR_URL_BUG)
# The vendor VM bug URL, if any
AC_ARG_WITH(vendor-vm-bug-url, [AS_HELP_STRING([--with-vendor-vm-bug-url],
[Sets the bug URL which will be displayed when the VM crashes @<:@not specified@:>@])])
if test "x$with_vendor_vm_bug_url" = xyes; then
AC_MSG_ERROR([--with-vendor-vm-bug-url must have a value])
elif [ ! [[ $with_vendor_vm_bug_url =~ ^[[:print:]]*$ ]] ]; then
AC_MSG_ERROR([--with-vendor-vm-bug-url contains non-printing characters: $with_vendor_vm_bug_url])
else
VENDOR_URL_VM_BUG="$with_vendor_vm_bug_url"
fi
AC_SUBST(VENDOR_URL_VM_BUG)
# Override version from arguments
# If --with-version-string is set, process it first. It is possible to
Expand Down
48 changes: 38 additions & 10 deletions make/autoconf/spec.gmk.in
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,20 @@ IMPORT_MODULES_MAKE:=@IMPORT_MODULES_MAKE@

COPYRIGHT_YEAR:=@COPYRIGHT_YEAR@

# Platform naming variables
LAUNCHER_NAME:=@LAUNCHER_NAME@
PRODUCT_NAME:=@PRODUCT_NAME@
PRODUCT_SUFFIX:=@PRODUCT_SUFFIX@
JDK_RC_PLATFORM_NAME:=@JDK_RC_PLATFORM_NAME@
COMPANY_NAME:=@COMPANY_NAME@
HOTSPOT_VM_DISTRO:=@HOTSPOT_VM_DISTRO@
MACOSX_BUNDLE_NAME_BASE=@MACOSX_BUNDLE_NAME_BASE@
MACOSX_BUNDLE_ID_BASE=@MACOSX_BUNDLE_ID_BASE@
USERNAME:=@USERNAME@
VENDOR_URL:=@VENDOR_URL@
VENDOR_URL_BUG:=@VENDOR_URL_BUG@
VENDOR_URL_VM_BUG:=@VENDOR_URL_VM_BUG@

# New (JEP-223) version information

## Building blocks of the version string
Expand Down Expand Up @@ -192,16 +206,30 @@ VERSION_CFLAGS := \
-DVENDOR_VERSION_STRING='"$(VENDOR_VERSION_STRING)"' \
#

# Platform naming variables
LAUNCHER_NAME:=@LAUNCHER_NAME@
PRODUCT_NAME:=@PRODUCT_NAME@
PRODUCT_SUFFIX:=@PRODUCT_SUFFIX@
JDK_RC_PLATFORM_NAME:=@JDK_RC_PLATFORM_NAME@
COMPANY_NAME:=@COMPANY_NAME@
HOTSPOT_VM_DISTRO:=@HOTSPOT_VM_DISTRO@
MACOSX_BUNDLE_NAME_BASE=@MACOSX_BUNDLE_NAME_BASE@
MACOSX_BUNDLE_ID_BASE=@MACOSX_BUNDLE_ID_BASE@
USERNAME:=@USERNAME@
ifneq ($(COMPANY_NAME),)
# COMPANY_NAME is set to "N/A" in $AUTOCONF_DIR/version-numbers by default,
# but can be customized with the '--with-vendor-name' configure option.
# Only export "VENDOR" to the build if COMPANY_NAME contains a real value.
# Otherwise the default value for VENDOR, which is used to set the "java.vendor"
# and "java.vm.vendor" properties is hard-coded into the source code (i.e. in
# System.c in the jdk for "vm.vendor" and vm_version.cpp in the VM for "java.vm.vendor")
ifneq ($(COMPANY_NAME), N/A)
VERSION_CFLAGS += -DVENDOR='"$(COMPANY_NAME)"'
endif
endif

# Only export VENDOR_URL, VENDOR_URL_BUG and VENDOR_VM_URL_BUG to the build if
# they are not empty. Otherwise, default values which are defined in the sources
# will be used.
ifneq ($(VENDOR_URL),)
VERSION_CFLAGS += -DVENDOR_URL='"$(VENDOR_URL)"'
endif
ifneq ($(VENDOR_URL_BUG),)
VERSION_CFLAGS += -DVENDOR_URL_BUG='"$(VENDOR_URL_BUG)"'
endif
ifneq ($(VENDOR_URL_VM_BUG),)
VERSION_CFLAGS += -DVENDOR_URL_VM_BUG='"$(VENDOR_URL_VM_BUG)"'
endif

# Different naming strings generated from the above information.
RUNTIME_NAME=$(PRODUCT_NAME) $(PRODUCT_SUFFIX)
Expand Down
1 change: 1 addition & 0 deletions make/hotspot/lib/CompileJvm.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ $(eval $(call SetupNativeCompilation, BUILD_LIBJVM, \
CFLAGS_DEBUG_SYMBOLS := $(JVM_CFLAGS_SYMBOLS), \
CXXFLAGS_DEBUG_SYMBOLS := $(JVM_CFLAGS_SYMBOLS), \
vm_version.cpp_CXXFLAGS := $(CFLAGS_VM_VERSION), \
arguments.cpp_CXXFLAGS := $(CFLAGS_VM_VERSION), \
DISABLED_WARNINGS_clang := tautological-compare, \
DISABLED_WARNINGS_xlc := 1540-0216 1540-0198 1540-1090 1540-1639 \
1540-1088 1500-010, \
Expand Down
7 changes: 6 additions & 1 deletion src/java.base/share/native/libjava/System.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,14 @@ Java_java_lang_System_identityHashCode(JNIEnv *env, jobject this, jobject x)
(*env)->DeleteLocalRef(env, jkey); \
} else ((void) 0)

#ifndef VENDOR /* Third party may overwrite this. */
/* Third party may overwrite these values. */
#ifndef VENDOR
#define VENDOR "Oracle Corporation"
#endif
#ifndef VENDOR_URL
#define VENDOR_URL "http://java.oracle.com/"
#endif
#ifndef VENDOR_URL_BUG
#define VENDOR_URL_BUG "http://bugreport.java.com/bugreport/"
#endif

Expand Down

0 comments on commit fa95a1f

Please sign in to comment.