8145400: ProjectCreator broken after JEP 223 changes
Reviewed-by: lfoltan, mgronlun
--- a/hotspot/make/windows/create.bat Thu Dec 17 08:41:30 2015 -0800
+++ b/hotspot/make/windows/create.bat Thu Dec 17 12:16:03 2015 -0800
@@ -1,6 +1,6 @@
@echo off
REM
-REM Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
+REM Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
REM DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
REM
REM This code is free software; you can redistribute it and/or modify it
@@ -116,61 +116,62 @@
if not "%HOTSPOTMKSHOME%" == "" goto makedir
if exist c:\cygwin\bin set HOTSPOTMKSHOME=c:\cygwin\bin
if not "%HOTSPOTMKSHOME%" == "" goto makedir
+if exist c:\cygwin64\bin set HOTSPOTMKSHOME=c:\cygwin64\bin
+if not "%HOTSPOTMKSHOME%" == "" goto makedir
echo Warning: please set variable HOTSPOTMKSHOME to place where
echo your MKS/Cygwin installation is
echo.
goto usage
+:generatefiles
+if NOT EXIST %HotSpotBuildSpace%\%1\generated mkdir %HotSpotBuildSpace%\%1\generated
+copy %HotSpotWorkSpace%\make\windows\projectfiles\%1\* %HotSpotBuildSpace%\%1\generated > NUL
+
+REM force regneration of ProjectFile
+if exist %ProjectFile% del %ProjectFile%
+
+echo -- %1 --
+echo # Generated file! > %HotSpotBuildSpace%\%1\local.make
+echo # Changing a variable below and then deleting %ProjectFile% will cause >> %HotSpotBuildSpace%\%1\local.make
+echo # %ProjectFile% to be regenerated with the new values. Changing the >> %HotSpotBuildSpace%\%1\local.make
+echo # version requires rerunning create.bat. >> %HotSpotBuildSpace%\%1\local.make
+echo. >> %HotSpotBuildSpace%\%1\local.make
+echo Variant=%1 >> %HotSpotBuildSpace%\%1\local.make
+echo WorkSpace=%HotSpotWorkSpace% >> %HotSpotBuildSpace%\%1\local.make
+echo HOTSPOTWORKSPACE=%HotSpotWorkSpace% >> %HotSpotBuildSpace%\%1\local.make
+echo HOTSPOTBUILDROOT=%HotSpotBuildRoot% >> %HotSpotBuildSpace%\%1\local.make
+echo HOTSPOTBUILDSPACE=%HotSpotBuildSpace% >> %HotSpotBuildSpace%\%1\local.make
+echo HOTSPOTJDKDIST=%HotSpotJDKDist% >> %HotSpotBuildSpace%\%1\local.make
+echo ARCH=%ARCH% >> %HotSpotBuildSpace%\%1\local.make
+echo BUILDARCH=%BUILDARCH% >> %HotSpotBuildSpace%\%1\local.make
+echo Platform_arch=%Platform_arch% >> %HotSpotBuildSpace%\%1\local.make
+echo Platform_arch_model=%Platform_arch_model% >> %HotSpotBuildSpace%\%1\local.make
+echo MSC_VER=%MSC_VER% >> %HotSpotBuildSpace%\%1\local.make
+
+for /D %%j in (debug, fastdebug, product) do (
+ if NOT EXIST %HotSpotBuildSpace%\%1\%%j mkdir %HotSpotBuildSpace%\%1\%%j
+)
+
+pushd %HotSpotBuildSpace%\%1\generated
+nmake /nologo
+popd
+
+goto :eof
+
+
:makedir
echo NOTE: Using the following settings:
echo HotSpotWorkSpace=%HotSpotWorkSpace%
echo HotSpotBuildSpace=%HotSpotBuildSpace%
echo HotSpotJDKDist=%HotSpotJDKDist%
-
-REM This is now safe to do.
-:copyfiles
-for /D %%i in (compiler1, compiler2, tiered ) do (
-if NOT EXIST %HotSpotBuildSpace%\%%i\generated mkdir %HotSpotBuildSpace%\%%i\generated
-copy %HotSpotWorkSpace%\make\windows\projectfiles\%%i\* %HotSpotBuildSpace%\%%i\generated > NUL
-)
-
-REM force regneration of ProjectFile
-if exist %ProjectFile% del %ProjectFile%
-
-for /D %%i in (compiler1, compiler2, tiered ) do (
-echo -- %%i --
-echo # Generated file! > %HotSpotBuildSpace%\%%i\local.make
-echo # Changing a variable below and then deleting %ProjectFile% will cause >> %HotSpotBuildSpace%\%%i\local.make
-echo # %ProjectFile% to be regenerated with the new values. Changing the >> %HotSpotBuildSpace%\%%i\local.make
-echo # version requires rerunning create.bat. >> %HotSpotBuildSpace%\%%i\local.make
-echo. >> %HotSpotBuildSpace%\%%i\local.make
-echo Variant=%%i >> %HotSpotBuildSpace%\%%i\local.make
-echo WorkSpace=%HotSpotWorkSpace% >> %HotSpotBuildSpace%\%%i\local.make
-echo HOTSPOTWORKSPACE=%HotSpotWorkSpace% >> %HotSpotBuildSpace%\%%i\local.make
-echo HOTSPOTBUILDROOT=%HotSpotBuildRoot% >> %HotSpotBuildSpace%\%%i\local.make
-echo HOTSPOTBUILDSPACE=%HotSpotBuildSpace% >> %HotSpotBuildSpace%\%%i\local.make
-echo HOTSPOTJDKDIST=%HotSpotJDKDist% >> %HotSpotBuildSpace%\%%i\local.make
-echo ARCH=%ARCH% >> %HotSpotBuildSpace%\%%i\local.make
-echo BUILDARCH=%BUILDARCH% >> %HotSpotBuildSpace%\%%i\local.make
-echo Platform_arch=%Platform_arch% >> %HotSpotBuildSpace%\%%i\local.make
-echo Platform_arch_model=%Platform_arch_model% >> %HotSpotBuildSpace%\%%i\local.make
-echo MSC_VER=%MSC_VER% >> %HotSpotBuildSpace%\%%i\local.make
-
-for /D %%j in (debug, fastdebug, product) do (
-if NOT EXIST %HotSpotBuildSpace%\%%i\%%j mkdir %HotSpotBuildSpace%\%%i\%%j
-)
-
-pushd %HotSpotBuildSpace%\%%i\generated
-nmake /nologo
-popd
-
-)
+echo COPYFILES %BUILDARCH%
+call :generatefiles compiler1
+call :generatefiles tiered
pushd %HotSpotBuildRoot%
-
-REM It doesn't matter which variant we use here, "compiler1" is as good as any of the others - we need the common variables
-nmake /nologo /F %HotSpotWorkSpace%/make/windows/projectfiles/common/Makefile LOCAL_MAKE=%HotSpotBuildSpace%\compiler1\local.make %ProjectFile%
+REM It doesn't matter which variant we use here, "tiered" is as good as any of the others - we need the common variables
+nmake /nologo /F %HotSpotWorkSpace%/make/windows/projectfiles/common/Makefile LOCAL_MAKE=%HotSpotBuildSpace%\tiered\local.make %ProjectFile%
popd
--- a/hotspot/make/windows/projectfiles/common/Makefile Thu Dec 17 08:41:30 2015 -0800
+++ b/hotspot/make/windows/projectfiles/common/Makefile Thu Dec 17 12:16:03 2015 -0800
@@ -80,21 +80,25 @@
!include $(HOTSPOTWORKSPACE)/make/jdk_version
+VERSION_MAJOR=$(STANDALONE_JDK_MAJOR_VER)
+VERSION_MINOR=$(STANDALONE_JDK_MINOR_VER)
+VERSION_SECURITY=$(STANDALONE_JDK_SECURITY_VER)
+VERSION_PATCH=$(STANDALONE_JDK_PATCH_VER)
+
+!if "$(VERSION_BUILD)" == ""
+VERSION_BUILD=0
+!endif
+
!if "$(VERSION_OPT)" != ""
-HOTSPOT_BUILD_VERSION = internal-$(VERSION_OPT)
-!else
-HOTSPOT_BUILD_VERSION = internal
-!endif
-!if "$(VERSION_STRING)" != ""
-JRE_RELEASE_VERSION="\\\"$(VERSION_STRING)\\\""
+HOTSPOT_PRE = internal-$(VERSION_OPT)
!else
-JRE_RELEASE_VERSION="\\\"$(STANDALONE_JDK_MAJOR_VER).$(STANDALONE_JDK_MINOR_VER).$(STANDALONE_JDK_SECURITY_VER)\\\""
+HOTSPOT_PRE = internal
!endif
-!if "$(HOTSPOT_RELEASE_VERSION)" != ""
-HOTSPOT_RELEASE_VERSION="\\\"$(HOTSPOT_RELEASE_VERSION)\\\""
-!else
-HOTSPOT_RELEASE_VERSION=$(JRE_RELEASE_VERSION)
+!if "$(VERSION_STRING)" == ""
+VERSION_STRING="\\\"$(VERSION_MAJOR)-$(HOTSPOT_PRE)+$(VERSION_BUILD)-$(USERNAME).vsbuild\\\""
!endif
+HOTSPOT_VERSION_STRING=$(VERSION_STRING)
+
# Define HOTSPOT_VM_DISTRO if HOTSPOT_VM_DISTRO is set,
# and if it is not see if we have the src/closed directory
!if "$(HOTSPOT_VM_DISTRO)" != ""
@@ -105,17 +109,12 @@
!else
HOTSPOT_VM_DISTRO="\\\"OpenJDK\\\""
!endif
-!if "$(VERSION_BUILD)" == ""
-VERSION_BUILD=0
-!endif
+
!endif
-VERSION_MAJOR=$(STANDALONE_JDK_MAJOR_VER)
-VERSION_MINOR=$(STANDALONE_JDK_MINOR_VER)
-VERSION_SECURITY=$(STANDALONE_JDK_SECURITY_VER)
-VERSION_PATCH=$(STANDALONE_JDK_PATCH_VER)
+
-ReleaseOptions = -define HOTSPOT_RELEASE_VERSION=$(HOTSPOT_RELEASE_VERSION) -define JRE_RELEASE_VERSION=$(JRE_RELEASE_VERSION) -define HOTSPOT_VM_DISTRO=$(HOTSPOT_VM_DISTRO) -define VERSION_MAJOR=$(VERSION_MAJOR) -define VERSION_MINOR=$(VERSION_MINOR) -define VERSION_SECURITY=$(VERSION_SECURITY) -define VERSION_PATCH=$(VERSION_PATCH) -define DEBUG_LEVEL=$(DEBUG_LEVEL) -define VISUAL_STUDIO_BUILD=true
+ReleaseOptions = -define HOTSPOT_VM_DISTRO=$(HOTSPOT_VM_DISTRO) -define HOTSPOT_VERSION_STRING=$(HOTSPOT_VERSION_STRING) -define VERSION_MAJOR=$(VERSION_MAJOR) -define VERSION_MINOR=$(VERSION_MINOR) -define VERSION_SECURITY=$(VERSION_SECURITY) -define VERSION_PATCH=$(VERSION_PATCH) -define VERSION_BUILD=$(VERSION_BUILD) -define VERSION_STRING=$(VERSION_STRING)
ProjectCreatorIDEOptions = $(ProjectCreatorIDEOptions) $(ReleaseOptions)
$(HOTSPOTBUILDSPACE)/$(ProjectFile): $(HOTSPOTBUILDSPACE)/classes/ProjectCreator.class
--- a/hotspot/src/share/tools/ProjectCreator/BuildConfig.java Thu Dec 17 08:41:30 2015 -0800
+++ b/hotspot/src/share/tools/ProjectCreator/BuildConfig.java Thu Dec 17 12:16:03 2015 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2015, 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
@@ -222,7 +222,7 @@
} else {
sysDefines.add("HOTSPOT_LIB_ARCH=\\\"amd64\\\"");
}
-
+ sysDefines.add("DEBUG_LEVEL=\\\"" + get("Build")+"\\\"");
sysDefines.addAll(defines);
put("Define", sysDefines);
@@ -540,28 +540,6 @@
}
}
-class C2DebugConfig extends GenericDebugNonKernelConfig {
- String getOptFlag() {
- return getCI().getNoOptFlag();
- }
-
- C2DebugConfig() {
- initNames("compiler2", "debug", "jvm.dll");
- init(getIncludes(), getDefines());
- }
-}
-
-class C2FastDebugConfig extends GenericDebugNonKernelConfig {
- String getOptFlag() {
- return getCI().getOptFlag();
- }
-
- C2FastDebugConfig() {
- initNames("compiler2", "fastdebug", "jvm.dll");
- init(getIncludes(), getDefines());
- }
-}
-
class TieredDebugConfig extends GenericDebugNonKernelConfig {
String getOptFlag() {
return getCI().getNoOptFlag();
@@ -603,13 +581,6 @@
}
}
-class C2ProductConfig extends ProductConfig {
- C2ProductConfig() {
- initNames("compiler2", "product", "jvm.dll");
- init(getIncludes(), getDefines());
- }
-}
-
class TieredProductConfig extends ProductConfig {
TieredProductConfig() {
initNames("tiered", "product", "jvm.dll");
--- a/hotspot/src/share/tools/ProjectCreator/WinGammaPlatform.java Thu Dec 17 08:41:30 2015 -0800
+++ b/hotspot/src/share/tools/ProjectCreator/WinGammaPlatform.java Thu Dec 17 12:16:03 2015 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2015, 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
@@ -25,12 +25,9 @@
import java.io.File;
import java.io.IOException;
import java.io.PrintWriter;
-import java.util.Enumeration;
import java.util.Hashtable;
import java.util.Iterator;
-import java.util.List;
import java.util.Stack;
-import java.util.TreeSet;
import java.util.Vector;
abstract class HsArgHandler extends ArgHandler {
@@ -571,10 +568,6 @@
allConfigs.add(new C1FastDebugConfig());
allConfigs.add(new C1ProductConfig());
- allConfigs.add(new C2DebugConfig());
- allConfigs.add(new C2FastDebugConfig());
- allConfigs.add(new C2ProductConfig());
-
allConfigs.add(new TieredDebugConfig());
allConfigs.add(new TieredFastDebugConfig());
allConfigs.add(new TieredProductConfig());
--- a/hotspot/src/share/vm/runtime/vm_version.cpp Thu Dec 17 08:41:30 2015 -0800
+++ b/hotspot/src/share/vm/runtime/vm_version.cpp Thu Dec 17 12:16:03 2015 -0800
@@ -68,16 +68,7 @@
#error DEBUG_LEVEL must be defined
#endif
-// NOTE: Builds within Visual Studio do not define the build target in
-// HOTSPOT_VERSION_STRING, so it must be done here
-#if defined(VISUAL_STUDIO_BUILD) && !defined(PRODUCT)
- #ifndef HOTSPOT_BUILD_TARGET
- #error HOTSPOT_BUILD_TARGET must be defined
- #endif
- #define VM_RELEASE HOTSPOT_VERSION_STRING "-" HOTSPOT_BUILD_TARGET
-#else
- #define VM_RELEASE HOTSPOT_VERSION_STRING
-#endif
+#define VM_RELEASE HOTSPOT_VERSION_STRING
// HOTSPOT_VERSION_STRING equals the JDK VERSION_STRING (unless overridden
// in a standalone build).