提交 a44695b4 编写于 作者: D dcubed

8016601: Unable to build hsx24 on Windows using project creator and Visual Studio

Summary: ProjectCreator tool is modified to support two new options: '-relativeAltSrcInclude' and '-altRelativeInclude' which prevents IDE linker errors. Also fixed some cmd line build linker warnings. Misc cleanups.
Reviewed-by: rdurbin, coleenp
上级 4b2fee10
@echo off @echo off
REM REM
REM Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved. REM Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
REM DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. REM DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
REM REM
REM This code is free software; you can redistribute it and/or modify it REM This code is free software; you can redistribute it and/or modify it
...@@ -148,7 +148,7 @@ echo HotSpotJDKDist=%HotSpotJDKDist% ...@@ -148,7 +148,7 @@ echo HotSpotJDKDist=%HotSpotJDKDist%
REM This is now safe to do. REM This is now safe to do.
:copyfiles :copyfiles
for /D %%i in (compiler1, compiler2, tiered, core) do ( for /D %%i in (compiler1, compiler2, tiered ) do (
if NOT EXIST %HotSpotBuildSpace%\%%i\generated mkdir %HotSpotBuildSpace%\%%i\generated if NOT EXIST %HotSpotBuildSpace%\%%i\generated mkdir %HotSpotBuildSpace%\%%i\generated
copy %HotSpotWorkSpace%\make\windows\projectfiles\%%i\* %HotSpotBuildSpace%\%%i\generated > NUL copy %HotSpotWorkSpace%\make\windows\projectfiles\%%i\* %HotSpotBuildSpace%\%%i\generated > NUL
) )
...@@ -156,7 +156,7 @@ copy %HotSpotWorkSpace%\make\windows\projectfiles\%%i\* %HotSpotBuildSpace%\%%i\ ...@@ -156,7 +156,7 @@ copy %HotSpotWorkSpace%\make\windows\projectfiles\%%i\* %HotSpotBuildSpace%\%%i\
REM force regneration of ProjectFile REM force regneration of ProjectFile
if exist %ProjectFile% del %ProjectFile% if exist %ProjectFile% del %ProjectFile%
for /D %%i in (compiler1, compiler2, tiered, core) do ( for /D %%i in (compiler1, compiler2, tiered ) do (
echo -- %%i -- echo -- %%i --
echo # Generated file! > %HotSpotBuildSpace%\%%i\local.make echo # Generated file! > %HotSpotBuildSpace%\%%i\local.make
echo # Changing a variable below and then deleting %ProjectFile% will cause >> %HotSpotBuildSpace%\%%i\local.make echo # Changing a variable below and then deleting %ProjectFile% will cause >> %HotSpotBuildSpace%\%%i\local.make
......
...@@ -73,19 +73,17 @@ done ...@@ -73,19 +73,17 @@ done
BASE_PATHS="${BASE_PATHS} ${GENERATED}/jvmtifiles ${GENERATED}/tracefiles" BASE_PATHS="${BASE_PATHS} ${GENERATED}/jvmtifiles ${GENERATED}/tracefiles"
if [ -d "${ALTSRC}/share/vm/jfr" ]; then if [ -d "${ALTSRC}/share/vm/jfr/buffers" ]; then
BASE_PATHS="${BASE_PATHS} ${ALTSRC}/share/vm/jfr"
BASE_PATHS="${BASE_PATHS} ${ALTSRC}/share/vm/jfr/buffers" BASE_PATHS="${BASE_PATHS} ${ALTSRC}/share/vm/jfr/buffers"
fi fi
BASE_PATHS="${BASE_PATHS} ${COMMONSRC}/share/vm/prims/wbtestmethods" BASE_PATHS="${BASE_PATHS} ${COMMONSRC}/share/vm/prims/wbtestmethods"
CORE_PATHS="${BASE_PATHS}"
# shared is already in BASE_PATHS. Should add vm/memory but that one is also in BASE_PATHS. # shared is already in BASE_PATHS. Should add vm/memory but that one is also in BASE_PATHS.
if [ -d "${ALTSRC}/share/vm/gc_implementation" ]; then if [ -d "${ALTSRC}/share/vm/gc_implementation" ]; then
CORE_PATHS="${CORE_PATHS} `$FIND ${ALTSRC}/share/vm/gc_implementation ! -name gc_implementation -prune -type d \! -name shared`" BASE_PATHS="${BASE_PATHS} `$FIND ${ALTSRC}/share/vm/gc_implementation ! -name gc_implementation -prune -type d \! -name shared`"
fi fi
CORE_PATHS="${CORE_PATHS} `$FIND ${COMMONSRC}/share/vm/gc_implementation ! -name gc_implementation -prune -type d \! -name shared`" BASE_PATHS="${BASE_PATHS} `$FIND ${COMMONSRC}/share/vm/gc_implementation ! -name gc_implementation -prune -type d \! -name shared`"
if [ -d "${ALTSRC}/share/vm/c1" ]; then if [ -d "${ALTSRC}/share/vm/c1" ]; then
COMPILER1_PATHS="${ALTSRC}/share/vm/c1" COMPILER1_PATHS="${ALTSRC}/share/vm/c1"
...@@ -104,12 +102,11 @@ COMPILER2_PATHS="${COMPILER2_PATHS} ${GENERATED}/adfiles" ...@@ -104,12 +102,11 @@ COMPILER2_PATHS="${COMPILER2_PATHS} ${GENERATED}/adfiles"
# Include dirs per type. # Include dirs per type.
case "${TYPE}" in case "${TYPE}" in
"core") Src_Dirs="${CORE_PATHS}" ;; "compiler1") Src_Dirs="${BASE_PATHS} ${COMPILER1_PATHS}" ;;
"compiler1") Src_Dirs="${CORE_PATHS} ${COMPILER1_PATHS}" ;; "compiler2") Src_Dirs="${BASE_PATHS} ${COMPILER2_PATHS}" ;;
"compiler2") Src_Dirs="${CORE_PATHS} ${COMPILER2_PATHS}" ;; "tiered") Src_Dirs="${BASE_PATHS} ${COMPILER1_PATHS} ${COMPILER2_PATHS}" ;;
"tiered") Src_Dirs="${CORE_PATHS} ${COMPILER1_PATHS} ${COMPILER2_PATHS}" ;; "zero") Src_Dirs="${BASE_PATHS}" ;;
"zero") Src_Dirs="${CORE_PATHS}" ;; "shark") Src_Dirs="${BASE_PATHS}" ;;
"shark") Src_Dirs="${CORE_PATHS}" ;;
esac esac
COMPILER2_SPECIFIC_FILES="opto libadt bcEscapeAnalyzer.cpp c2_* runtime_*" COMPILER2_SPECIFIC_FILES="opto libadt bcEscapeAnalyzer.cpp c2_* runtime_*"
...@@ -122,7 +119,6 @@ Src_Files_EXCLUDE="jsig.c jvmtiEnvRecommended.cpp jvmtiEnvStub.cpp" ...@@ -122,7 +119,6 @@ Src_Files_EXCLUDE="jsig.c jvmtiEnvRecommended.cpp jvmtiEnvStub.cpp"
# Exclude per type. # Exclude per type.
case "${TYPE}" in case "${TYPE}" in
"core") Src_Files_EXCLUDE="${Src_Files_EXCLUDE} ${COMPILER1_SPECIFIC_FILES} ${COMPILER2_SPECIFIC_FILES} ${ZERO_SPECIFIC_FILES} ${SHARK_SPECIFIC_FILES} ciTypeFlow.cpp" ;;
"compiler1") Src_Files_EXCLUDE="${Src_Files_EXCLUDE} ${COMPILER2_SPECIFIC_FILES} ${ZERO_SPECIFIC_FILES} ${SHARK_SPECIFIC_FILES} ciTypeFlow.cpp" ;; "compiler1") Src_Files_EXCLUDE="${Src_Files_EXCLUDE} ${COMPILER2_SPECIFIC_FILES} ${ZERO_SPECIFIC_FILES} ${SHARK_SPECIFIC_FILES} ciTypeFlow.cpp" ;;
"compiler2") Src_Files_EXCLUDE="${Src_Files_EXCLUDE} ${COMPILER1_SPECIFIC_FILES} ${ZERO_SPECIFIC_FILES} ${SHARK_SPECIFIC_FILES}" ;; "compiler2") Src_Files_EXCLUDE="${Src_Files_EXCLUDE} ${COMPILER1_SPECIFIC_FILES} ${ZERO_SPECIFIC_FILES} ${SHARK_SPECIFIC_FILES}" ;;
"tiered") Src_Files_EXCLUDE="${Src_Files_EXCLUDE} ${ZERO_SPECIFIC_FILES} ${SHARK_SPECIFIC_FILES}" ;; "tiered") Src_Files_EXCLUDE="${Src_Files_EXCLUDE} ${ZERO_SPECIFIC_FILES} ${SHARK_SPECIFIC_FILES}" ;;
...@@ -149,9 +145,17 @@ for e in ${Src_Dirs}; do ...@@ -149,9 +145,17 @@ for e in ${Src_Dirs}; do
Src_Files="${Src_Files}`findsrc ${e}` " Src_Files="${Src_Files}`findsrc ${e}` "
done done
Obj_Files= Obj_Files=" "
for e in ${Src_Files}; do for e in ${Src_Files}; do
Obj_Files="${Obj_Files}${e%\.[!.]*}.obj " o="${e%\.[!.]*}.obj"
set +e
chk=`expr "${Obj_Files}" : ".* $o"`
set -e
if [ "$chk" != 0 ]; then
echo "# INFO: skipping duplicate $o"
continue
fi
Obj_Files="${Obj_Files}$o "
done done
echo Obj_Files=${Obj_Files} echo Obj_Files=${Obj_Files}
...@@ -44,10 +44,11 @@ ProjectCreatorSources=\ ...@@ -44,10 +44,11 @@ ProjectCreatorSources=\
# This is only used internally # This is only used internally
ProjectCreatorIncludesPRIVATE=\ ProjectCreatorIncludesPRIVATE=\
-relativeInclude src\closed\share\vm \ -relativeAltSrcInclude src\closed \
-relativeInclude src\closed\os\windows\vm \ -altRelativeInclude share\vm \
-relativeInclude src\closed\os_cpu\windows_$(Platform_arch)\vm \ -altRelativeInclude os\windows\vm \
-relativeInclude src\closed\cpu\$(Platform_arch)\vm \ -altRelativeInclude os_cpu\windows_$(Platform_arch)\vm \
-altRelativeInclude cpu\$(Platform_arch)\vm \
-relativeInclude src\share\vm \ -relativeInclude src\share\vm \
-relativeInclude src\share\vm\precompiled \ -relativeInclude src\share\vm\precompiled \
-relativeInclude src\share\vm\prims\wbtestmethods \ -relativeInclude src\share\vm\prims\wbtestmethods \
...@@ -91,7 +92,7 @@ ProjectCreatorIDEOptions = \ ...@@ -91,7 +92,7 @@ ProjectCreatorIDEOptions = \
-disablePch getThread_windows_$(Platform_arch).cpp \ -disablePch getThread_windows_$(Platform_arch).cpp \
-disablePch_compiler2 opcodes.cpp -disablePch_compiler2 opcodes.cpp
# Common options for the IDE builds for core, c1, and c2 # Common options for the IDE builds for c1, and c2
ProjectCreatorIDEOptions=\ ProjectCreatorIDEOptions=\
$(ProjectCreatorIDEOptions) \ $(ProjectCreatorIDEOptions) \
-sourceBase $(HOTSPOTWORKSPACE) \ -sourceBase $(HOTSPOTWORKSPACE) \
...@@ -157,19 +158,11 @@ ProjectCreatorIDEOptionsIgnoreCompiler2=\ ...@@ -157,19 +158,11 @@ ProjectCreatorIDEOptionsIgnoreCompiler2=\
-ignoreFile_TARGET ciTypeFlow.hpp \ -ignoreFile_TARGET ciTypeFlow.hpp \
-ignoreFile_TARGET $(Platform_arch_model).ad -ignoreFile_TARGET $(Platform_arch_model).ad
##################################################
# Without compiler(core) specific options
##################################################
ProjectCreatorIDEOptions=$(ProjectCreatorIDEOptions) \
$(ProjectCreatorIDEOptionsIgnoreCompiler1:TARGET=core) \
$(ProjectCreatorIDEOptionsIgnoreCompiler2:TARGET=core)
################################################## ##################################################
# Client(C1) compiler specific options # Client(C1) compiler specific options
################################################## ##################################################
ProjectCreatorIDEOptions=$(ProjectCreatorIDEOptions) \ ProjectCreatorIDEOptions=$(ProjectCreatorIDEOptions) \
-define_compiler1 COMPILER1 \ -define_compiler1 COMPILER1 \
-ignorePath_compiler1 core \
$(ProjectCreatorIDEOptionsIgnoreCompiler2:TARGET=compiler1) $(ProjectCreatorIDEOptionsIgnoreCompiler2:TARGET=compiler1)
################################################## ##################################################
...@@ -178,7 +171,6 @@ $(ProjectCreatorIDEOptionsIgnoreCompiler2:TARGET=compiler1) ...@@ -178,7 +171,6 @@ $(ProjectCreatorIDEOptionsIgnoreCompiler2:TARGET=compiler1)
#NOTE! This list must be kept in sync with GENERATED_NAMES in adlc.make. #NOTE! This list must be kept in sync with GENERATED_NAMES in adlc.make.
ProjectCreatorIDEOptions=$(ProjectCreatorIDEOptions) \ ProjectCreatorIDEOptions=$(ProjectCreatorIDEOptions) \
-define_compiler2 COMPILER2 \ -define_compiler2 COMPILER2 \
-ignorePath_compiler2 core \
-additionalFile_compiler2 $(Platform_arch_model).ad \ -additionalFile_compiler2 $(Platform_arch_model).ad \
-additionalFile_compiler2 ad_$(Platform_arch_model).cpp \ -additionalFile_compiler2 ad_$(Platform_arch_model).cpp \
-additionalFile_compiler2 ad_$(Platform_arch_model).hpp \ -additionalFile_compiler2 ad_$(Platform_arch_model).hpp \
......
...@@ -90,25 +90,25 @@ $(TraceOutDir)/traceTypes.hpp: $(TraceSrcDir)/trace.xml $(TraceSrcDir)/traceType ...@@ -90,25 +90,25 @@ $(TraceOutDir)/traceTypes.hpp: $(TraceSrcDir)/trace.xml $(TraceSrcDir)/traceType
!if "$(OPENJDK)" == "true" !if "$(OPENJDK)" == "true"
$(TraceOutDir)/traceEventClasses.hpp: $(TraceSrcDir)/trace.xml $(TraceSrcDir)/traceEventClasses.xsl $(XML_DEPS) $(TraceOutDir)/traceEventClasses.hpp: $(TraceSrcDir)/trace.xml $(TraceSrcDir)/traceEventClasses.xsl $(XML_DEPS)
@echo Generating $@ @echo Generating OpenJDK $@
@$(XSLT) -IN $(TraceSrcDir)/trace.xml -XSL $(TraceSrcDir)/traceEventClasses.xsl -OUT $(TraceOutDir)/traceEventClasses.hpp @$(XSLT) -IN $(TraceSrcDir)/trace.xml -XSL $(TraceSrcDir)/traceEventClasses.xsl -OUT $(TraceOutDir)/traceEventClasses.hpp
!else !else
$(TraceOutDir)/traceEventClasses.hpp: $(TraceSrcDir)/trace.xml $(TraceAltSrcDir)/traceEventClasses.xsl $(XML_DEPS) $(TraceOutDir)/traceEventClasses.hpp: $(TraceSrcDir)/trace.xml $(TraceAltSrcDir)/traceEventClasses.xsl $(XML_DEPS)
@echo Generating $@ @echo Generating AltSrc $@
@$(XSLT) -IN $(TraceSrcDir)/trace.xml -XSL $(TraceAltSrcDir)/traceEventClasses.xsl -OUT $(TraceOutDir)/traceEventClasses.hpp @$(XSLT) -IN $(TraceSrcDir)/trace.xml -XSL $(TraceAltSrcDir)/traceEventClasses.xsl -OUT $(TraceOutDir)/traceEventClasses.hpp
$(TraceOutDir)/traceProducer.cpp: $(TraceSrcDir)/trace.xml $(TraceAltSrcDir)/traceProducer.xsl $(XML_DEPS) $(TraceOutDir)/traceProducer.cpp: $(TraceSrcDir)/trace.xml $(TraceAltSrcDir)/traceProducer.xsl $(XML_DEPS)
@echo Generating $@ @echo Generating AltSrc $@
@$(XSLT) -IN $(TraceSrcDir)/trace.xml -XSL $(TraceAltSrcDir)/traceProducer.xsl -OUT $(TraceOutDir)/traceProducer.cpp @$(XSLT) -IN $(TraceSrcDir)/trace.xml -XSL $(TraceAltSrcDir)/traceProducer.xsl -OUT $(TraceOutDir)/traceProducer.cpp
$(TraceOutDir)/traceRequestables.hpp: $(TraceSrcDir)/trace.xml $(TraceAltSrcDir)/traceRequestables.xsl $(XML_DEPS) $(TraceOutDir)/traceRequestables.hpp: $(TraceSrcDir)/trace.xml $(TraceAltSrcDir)/traceRequestables.xsl $(XML_DEPS)
@echo Generating $@ @echo Generating AltSrc $@
@$(XSLT) -IN $(TraceSrcDir)/trace.xml -XSL $(TraceAltSrcDir)/traceRequestables.xsl -OUT $(TraceOutDir)/traceRequestables.hpp @$(XSLT) -IN $(TraceSrcDir)/trace.xml -XSL $(TraceAltSrcDir)/traceRequestables.xsl -OUT $(TraceOutDir)/traceRequestables.hpp
$(TraceOutDir)/traceEventControl.hpp: $(TraceSrcDir)/trace.xml $(TraceAltSrcDir)/traceEventControl.xsl $(XML_DEPS) $(TraceOutDir)/traceEventControl.hpp: $(TraceSrcDir)/trace.xml $(TraceAltSrcDir)/traceEventControl.xsl $(XML_DEPS)
@echo Generating $@ @echo Generating AltSrc $@
@$(XSLT) -IN $(TraceSrcDir)/trace.xml -XSL $(TraceAltSrcDir)/traceEventControl.xsl -OUT $(TraceOutDir)/traceEventControl.hpp @$(XSLT) -IN $(TraceSrcDir)/trace.xml -XSL $(TraceAltSrcDir)/traceEventControl.xsl -OUT $(TraceOutDir)/traceEventControl.hpp
!endif !endif
......
...@@ -36,10 +36,6 @@ CXX_FLAGS=$(CXX_FLAGS) /D "PRODUCT" ...@@ -36,10 +36,6 @@ CXX_FLAGS=$(CXX_FLAGS) /D "PRODUCT"
CXX_FLAGS=$(CXX_FLAGS) /D "ASSERT" CXX_FLAGS=$(CXX_FLAGS) /D "ASSERT"
!endif !endif
!if "$(Variant)" == "core"
# No need to define anything, CORE is defined as !COMPILER1 && !COMPILER2
!endif
!if "$(Variant)" == "compiler1" !if "$(Variant)" == "compiler1"
CXX_FLAGS=$(CXX_FLAGS) /D "COMPILER1" CXX_FLAGS=$(CXX_FLAGS) /D "COMPILER1"
!endif !endif
......
...@@ -142,6 +142,69 @@ class BuildConfig { ...@@ -142,6 +142,69 @@ class BuildConfig {
return rv; return rv;
} }
// Returns true if the specified path refers to a relative alternate
// source file. RelativeAltSrcInclude is usually "src\closed".
public static boolean matchesRelativeAltSrcInclude(String path) {
String relativeAltSrcInclude =
getFieldString(null, "RelativeAltSrcInclude");
Vector<String> v = getFieldVector(null, "AltRelativeInclude");
for (String pathPart : v) {
if (path.contains(relativeAltSrcInclude + Util.sep + pathPart)) {
return true;
}
}
return false;
}
// Returns the relative alternate source file for the specified path.
// Null is returned if the specified path does not have a matching
// alternate source file.
public static String getMatchingRelativeAltSrcFile(String path) {
Vector<String> v = getFieldVector(null, "RelativeAltSrcFileList");
if (v == null) {
return null;
}
for (String pathPart : v) {
if (path.endsWith(pathPart)) {
String relativeAltSrcInclude =
getFieldString(null, "RelativeAltSrcInclude");
return relativeAltSrcInclude + Util.sep + pathPart;
}
}
return null;
}
// Returns true if the specified path has a matching alternate
// source file.
public static boolean matchesRelativeAltSrcFile(String path) {
return getMatchingRelativeAltSrcFile(path) != null;
}
// Track the specified alternate source file. The source file is
// tracked without the leading .*<sep><RelativeAltSrcFileList><sep>
// part to make matching regular source files easier.
public static void trackRelativeAltSrcFile(String path) {
String pattern = getFieldString(null, "RelativeAltSrcInclude") +
Util.sep;
int altSrcInd = path.indexOf(pattern);
if (altSrcInd == -1) {
// not an AltSrc path
return;
}
altSrcInd += pattern.length();
if (altSrcInd >= path.length()) {
// not a valid AltSrc path
return;
}
String altSrcFile = path.substring(altSrcInd);
Vector v = getFieldVector(null, "RelativeAltSrcFileList");
if (v == null || !v.contains(altSrcFile)) {
addFieldVector(null, "RelativeAltSrcFileList", altSrcFile);
}
}
void addTo(Hashtable ht, String key, String value) { void addTo(Hashtable ht, String key, String value) {
ht.put(expandFormat(key), expandFormat(value)); ht.put(expandFormat(key), expandFormat(value));
} }
...@@ -272,8 +335,19 @@ class BuildConfig { ...@@ -272,8 +335,19 @@ class BuildConfig {
private Vector getSourceIncludes() { private Vector getSourceIncludes() {
Vector<String> rv = new Vector<String>(); Vector<String> rv = new Vector<String>();
Vector<String> ri = new Vector<String>();
String sourceBase = getFieldString(null, "SourceBase"); String sourceBase = getFieldString(null, "SourceBase");
// add relative alternate source include values:
String relativeAltSrcInclude =
getFieldString(null, "RelativeAltSrcInclude");
Vector<String> asri = new Vector<String>();
collectRelevantVectors(asri, "AltRelativeInclude");
for (String f : asri) {
rv.add(sourceBase + Util.sep + relativeAltSrcInclude +
Util.sep + f);
}
Vector<String> ri = new Vector<String>();
collectRelevantVectors(ri, "RelativeInclude"); collectRelevantVectors(ri, "RelativeInclude");
for (String f : ri) { for (String f : ri) {
rv.add(sourceBase + Util.sep + f); rv.add(sourceBase + Util.sep + f);
...@@ -541,35 +615,6 @@ class TieredProductConfig extends ProductConfig { ...@@ -541,35 +615,6 @@ class TieredProductConfig extends ProductConfig {
} }
} }
class CoreDebugConfig extends GenericDebugNonKernelConfig {
String getOptFlag() {
return getCI().getNoOptFlag();
}
CoreDebugConfig() {
initNames("core", "debug", "jvm.dll");
init(getIncludes(), getDefines());
}
}
class CoreFastDebugConfig extends GenericDebugNonKernelConfig {
String getOptFlag() {
return getCI().getOptFlag();
}
CoreFastDebugConfig() {
initNames("core", "fastdebug", "jvm.dll");
init(getIncludes(), getDefines());
}
}
class CoreProductConfig extends ProductConfig {
CoreProductConfig() {
initNames("core", "product", "jvm.dll");
init(getIncludes(), getDefines());
}
}
abstract class CompilerInterface { abstract class CompilerInterface {
abstract Vector getBaseCompilerFlags(Vector defines, Vector includes, String outDir); abstract Vector getBaseCompilerFlags(Vector defines, Vector includes, String outDir);
......
/*
* Copyright (c) 2012, 2013, 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
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
import static java.nio.file.FileVisitResult.CONTINUE; import static java.nio.file.FileVisitResult.CONTINUE;
import java.io.IOException; import java.io.IOException;
...@@ -21,6 +45,8 @@ public class FileTreeCreatorVC10 extends FileTreeCreator { ...@@ -21,6 +45,8 @@ public class FileTreeCreatorVC10 extends FileTreeCreator {
boolean usePch = false; boolean usePch = false;
boolean disablePch = false; boolean disablePch = false;
boolean useIgnore = false; boolean useIgnore = false;
boolean isAltSrc = false; // only needed as a debugging crumb
boolean isReplacedByAltSrc = false;
String fileName = file.getFileName().toString(); String fileName = file.getFileName().toString();
// TODO hideFile // TODO hideFile
...@@ -30,6 +56,26 @@ public class FileTreeCreatorVC10 extends FileTreeCreator { ...@@ -30,6 +56,26 @@ public class FileTreeCreatorVC10 extends FileTreeCreator {
usePch = true; usePch = true;
} }
String fileLoc = vcProjLocation.relativize(file).toString();
// isAltSrc and isReplacedByAltSrc applies to all configs for a file
if (BuildConfig.matchesRelativeAltSrcInclude(
file.toAbsolutePath().toString())) {
// current file is an alternate source file so track it
isAltSrc = true;
BuildConfig.trackRelativeAltSrcFile(
file.toAbsolutePath().toString());
} else if (BuildConfig.matchesRelativeAltSrcFile(
file.toAbsolutePath().toString())) {
// current file is a regular file that matches an alternate
// source file so yack about replacing the regular file
isReplacedByAltSrc = true;
System.out.println("INFO: alternate source file '" +
BuildConfig.getMatchingRelativeAltSrcFile(
file.toAbsolutePath().toString()) +
"' replaces '" + fileLoc + "'");
}
for (BuildConfig cfg : allConfigs) { for (BuildConfig cfg : allConfigs) {
if (cfg.lookupHashFieldInContext("IgnoreFile", fileName) != null) { if (cfg.lookupHashFieldInContext("IgnoreFile", fileName) != null) {
useIgnore = true; useIgnore = true;
...@@ -58,9 +104,8 @@ public class FileTreeCreatorVC10 extends FileTreeCreator { ...@@ -58,9 +104,8 @@ public class FileTreeCreatorVC10 extends FileTreeCreator {
} }
String tagName = wg.getFileTagFromSuffix(fileName); String tagName = wg.getFileTagFromSuffix(fileName);
String fileLoc = vcProjLocation.relativize(file).toString();
if (!useIgnore && !disablePch && !usePch) { if (!useIgnore && !disablePch && !usePch && !isReplacedByAltSrc) {
wg.tag(tagName, new String[] { "Include", fileLoc}); wg.tag(tagName, new String[] { "Include", fileLoc});
} else { } else {
wg.startTag( wg.startTag(
...@@ -78,6 +123,11 @@ public class FileTreeCreatorVC10 extends FileTreeCreator { ...@@ -78,6 +123,11 @@ public class FileTreeCreatorVC10 extends FileTreeCreator {
if (disablePch) { if (disablePch) {
wg.tag("PrecompiledHeader", "Condition", "'$(Configuration)|$(Platform)'=='" + cfg.get("Name") + "'"); wg.tag("PrecompiledHeader", "Condition", "'$(Configuration)|$(Platform)'=='" + cfg.get("Name") + "'");
} }
if (isReplacedByAltSrc) {
wg.tagData("ExcludedFromBuild", "true", "Condition",
"'$(Configuration)|$(Platform)'=='" +
cfg.get("Name") + "'");
}
} }
wg.endTag(); wg.endTag();
} }
...@@ -137,6 +187,4 @@ public class FileTreeCreatorVC10 extends FileTreeCreator { ...@@ -137,6 +187,4 @@ public class FileTreeCreatorVC10 extends FileTreeCreator {
public void writeFileTree() throws IOException { public void writeFileTree() throws IOException {
Files.walkFileTree(this.startDir, this); Files.walkFileTree(this.startDir, this);
} }
}
}
\ No newline at end of file
/* /*
* Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -39,10 +39,15 @@ public class ProjectCreator { ...@@ -39,10 +39,15 @@ public class ProjectCreator {
+ "jvm.dll; no trailing slash>"); + "jvm.dll; no trailing slash>");
System.err.println(" If any of the above are specified, " System.err.println(" If any of the above are specified, "
+ "they must all be."); + "they must all be.");
System.err.println(" Note: if '-altRelativeInclude' option below is "
+ "used, then the '-relativeAltSrcInclude' option must be used "
+ "to specify the alternate source dir, e.g., 'src\\closed'");
System.err.println(" Additional, optional arguments, which can be " System.err.println(" Additional, optional arguments, which can be "
+ "specified multiple times:"); + "specified multiple times:");
System.err.println(" -absoluteInclude <string containing absolute " System.err.println(" -absoluteInclude <string containing absolute "
+ "path to include directory>"); + "path to include directory>");
System.err.println(" -altRelativeInclude <string containing "
+ "alternate include directory relative to -envVar>");
System.err.println(" -relativeInclude <string containing include " System.err.println(" -relativeInclude <string containing include "
+ "directory relative to -envVar>"); + "directory relative to -envVar>");
System.err.println(" -define <preprocessor flag to be #defined " System.err.println(" -define <preprocessor flag to be #defined "
......
/* /*
* Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -140,10 +140,17 @@ public abstract class WinGammaPlatform { ...@@ -140,10 +140,17 @@ public abstract class WinGammaPlatform {
"already exist>"); "already exist>");
System.err.println(" If any of the above are specified, "+ System.err.println(" If any of the above are specified, "+
"they must all be."); "they must all be.");
System.err.println(" Note: if '-altRelativeInclude' option below " +
"is used, then the '-relativeAltSrcInclude' " +
"option must be used to specify the alternate " +
"source dir, e.g., 'src\\closed'");
System.err.println(" Additional, optional arguments, which can be " + System.err.println(" Additional, optional arguments, which can be " +
"specified multiple times:"); "specified multiple times:");
System.err.println(" -absoluteInclude <string containing absolute " + System.err.println(" -absoluteInclude <string containing absolute " +
"path to include directory>"); "path to include directory>");
System.err.println(" -altRelativeInclude <string containing " +
"alternate include directory relative to " +
"-sourceBase>");
System.err.println(" -relativeInclude <string containing include " + System.err.println(" -relativeInclude <string containing include " +
"directory relative to -sourceBase>"); "directory relative to -sourceBase>");
System.err.println(" -define <preprocessor flag to be #defined " + System.err.println(" -define <preprocessor flag to be #defined " +
...@@ -343,6 +350,12 @@ public abstract class WinGammaPlatform { ...@@ -343,6 +350,12 @@ public abstract class WinGammaPlatform {
HsArgHandler.VECTOR HsArgHandler.VECTOR
), ),
new HsArgRule("-altRelativeInclude",
"AltRelativeInclude",
null,
HsArgHandler.VECTOR
),
new HsArgRule("-relativeInclude", new HsArgRule("-relativeInclude",
"RelativeInclude", "RelativeInclude",
null, null,
...@@ -355,6 +368,12 @@ public abstract class WinGammaPlatform { ...@@ -355,6 +368,12 @@ public abstract class WinGammaPlatform {
HsArgHandler.VECTOR HsArgHandler.VECTOR
), ),
new HsArgRule("-relativeAltSrcInclude",
"RelativeAltSrcInclude",
null,
HsArgHandler.STRING
),
new HsArgRule("-relativeSrcInclude", new HsArgRule("-relativeSrcInclude",
"RelativeSrcInclude", "RelativeSrcInclude",
null, null,
...@@ -560,10 +579,6 @@ public abstract class WinGammaPlatform { ...@@ -560,10 +579,6 @@ public abstract class WinGammaPlatform {
allConfigs.add(new TieredFastDebugConfig()); allConfigs.add(new TieredFastDebugConfig());
allConfigs.add(new TieredProductConfig()); allConfigs.add(new TieredProductConfig());
allConfigs.add(new CoreDebugConfig());
allConfigs.add(new CoreFastDebugConfig());
allConfigs.add(new CoreProductConfig());
return allConfigs; return allConfigs;
} }
......
/*
* Copyright (c) 2011, 2013, 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
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
import java.io.File; import java.io.File;
import java.io.FileNotFoundException; import java.io.FileNotFoundException;
import java.io.IOException; import java.io.IOException;
...@@ -24,7 +48,7 @@ public class WinGammaPlatformVC10 extends WinGammaPlatformVC7 { ...@@ -24,7 +48,7 @@ public class WinGammaPlatformVC10 extends WinGammaPlatformVC7 {
public void writeProjectFile(String projectFileName, String projectName, public void writeProjectFile(String projectFileName, String projectName,
Vector<BuildConfig> allConfigs) throws IOException { Vector<BuildConfig> allConfigs) throws IOException {
System.out.println(); System.out.println();
System.out.print(" Writing .vcxproj file: " + projectFileName); System.out.println(" Writing .vcxproj file: " + projectFileName);
String projDir = Util.normalize(new File(projectFileName).getParent()); String projDir = Util.normalize(new File(projectFileName).getParent());
...@@ -114,7 +138,7 @@ public class WinGammaPlatformVC10 extends WinGammaPlatformVC7 { ...@@ -114,7 +138,7 @@ public class WinGammaPlatformVC10 extends WinGammaPlatformVC7 {
endTag(); endTag();
printWriter.close(); printWriter.close();
System.out.println(" Done."); System.out.println(" Done writing .vcxproj file.");
writeFilterFile(projectFileName, projectName, allConfigs, projDir); writeFilterFile(projectFileName, projectName, allConfigs, projDir);
writeUserFile(projectFileName, allConfigs); writeUserFile(projectFileName, allConfigs);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册