stdcxx-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From se...@apache.org
Subject svn commit: r349027 [3/4] - in /incubator/stdcxx/trunk: ./ etc/config/windows/
Date Fri, 25 Nov 2005 22:16:48 GMT
Added: incubator/stdcxx/trunk/etc/config/windows/msvc-config.js
URL: http://svn.apache.org/viewcvs/incubator/stdcxx/trunk/etc/config/windows/msvc-config.js?rev=349027&view=auto
==============================================================================
--- incubator/stdcxx/trunk/etc/config/windows/msvc-config.js (added)
+++ incubator/stdcxx/trunk/etc/config/windows/msvc-config.js Fri Nov 25 14:16:34 2005
@@ -0,0 +1,695 @@
+//
+// $Id$
+//
+// file should be included after config_base and after msvc_config_classes
+
+// MSVC solution configuration
+
+// includes
+var includeFirstParentDir = "../include";
+var includeSecondParentDir = "../../include";
+var includeSecondParentAnsiDir = "../../include/ansi";
+
+var samplesBaseIncludeDir = "..\\include";
+var samplesBaseAnsiIncludeDir = "..\\include\\ansi";
+var samplesIncludeDir = "include";
+
+var testsBaseIncludeDir = "..\\include";
+var testsBaseAnsiIncludeDir = "..\\include\\ansi";
+var testsIncludeDir = "include";
+
+// defines
+var defineRWSHARED = "_RWSHARED";
+var defineRWSTD_TEST_SRC = "_RWSTD_TEST_SRC";
+var defineRWSTDDEBUG = "_RWSTDDEBUG";
+
+var varCmdCopyIn = "$$copy_in";
+var varCmdCopyOut = "$$copy_out";
+var varCmdCopyDll = "$$copy_dll";
+
+//clone generic solution
+var solutionVC71 = solution.clone();
+solutionVC71.name = "VC71";
+configureToolsVC71();
+configurations.add(solutionVC71.name, solutionVC71);
+
+
+function configureToolsVC71Configure(
+            compilerDebug, compilerRelease, 
+            linkerDebug, linkerRelease, 
+            librarianTool, customTool)
+{
+    var compilerDebugConfigure = compilerDebug.clone();
+    var compilerReleaseConfigure = compilerRelease.clone();
+    var linkerDebugConfigure = linkerDebug.clone();
+    var linkerReleaseConfigure = linkerRelease.clone();
+    var librarianConfigure = librarianTool.clone();
+    var customConfigure = customTool.clone();
+    
+    compilerDebugConfigure.pdbName = "MSVC.pdb";
+    compilerReleaseConfigure.pdbName = "MSVC.pdb";
+    
+    var configureProj = solutionVC71.projects.get(projectConfigureName);
+    var platform = configureProj.platforms.get(platformWin32Name);
+    
+    // debug static
+    var compilerDebugStaticConfigure = compilerDebugConfigure.clone();
+    compilerDebugStaticConfigure.runtime = "SINGLEDEBUG";
+    compilerDebugStaticConfigure.defines.add(defineRWSTDDEBUG);
+    
+    var configuration = platform.configurations.get(confDebugStaticName);
+    configuration.tools.add(compilerToolName, 
+        compilerDebugStaticConfigure);
+    configuration.tools.add(linkerToolName, linkerDebugConfigure);  
+    // presence of a librarian here allows configure script to determine
+    // that this is a static configuration
+    configuration.tools.add(librarianToolName, librarianConfigure);
+    configuration.tools.add(customBuildToolName, customConfigure);
+
+    // release static
+    var compilerReleaseStaticConfigure = compilerReleaseConfigure.clone();
+    compilerReleaseStaticConfigure.runtime = "SINGLE";
+    
+    var configuration = platform.configurations.get(confReleaseStaticName);
+    configuration.tools.add(compilerToolName, 
+        compilerReleaseStaticConfigure);
+    configuration.tools.add(linkerToolName, linkerReleaseConfigure);
+    // presence of a librarian here allow configure script to determine
+    // that this is a static configuration
+    configuration.tools.add(librarianToolName, librarianConfigure);
+    configuration.tools.add(customBuildToolName, customConfigure);
+    
+    // debug multi-threaded static
+    var compilerMTDebugStaticConfigure = compilerDebugConfigure.clone();
+    compilerMTDebugStaticConfigure.runtime = "MULTIDEBUG";
+    compilerMTDebugStaticConfigure.defines.add(defineRWSTDDEBUG);
+    
+    var configuration = platform.configurations.get(confMTDebugStaticName);
+    configuration.tools.add(compilerToolName, 
+        compilerMTDebugStaticConfigure);
+    configuration.tools.add(linkerToolName, linkerDebugConfigure);  
+    // presence of a librarian here allows configure script to determine
+    // that this is a static configuration
+    configuration.tools.add(librarianToolName, librarianConfigure);
+    configuration.tools.add(customBuildToolName, customConfigure);
+
+    // release multi-threaded static
+    var compilerMTReleaseStaticConfigure = compilerReleaseConfigure.clone();
+    compilerMTReleaseStaticConfigure.runtime = "MULTI";
+    
+    var configuration = platform.configurations.get(confMTReleaseStaticName);
+    configuration.tools.add(compilerToolName, 
+        compilerMTReleaseStaticConfigure);
+    configuration.tools.add(linkerToolName, linkerReleaseConfigure);
+    // presence of a librarian here allow configure script to determine
+    // that this is a static configuration
+    configuration.tools.add(librarianToolName, librarianConfigure);
+    configuration.tools.add(customBuildToolName, customConfigure);
+        
+    // debug dll
+    var compilerDebugDllConfigure = compilerDebugConfigure.clone();
+    compilerDebugDllConfigure.runtime = "SINGLEDEBUG";
+    compilerDebugDllConfigure.defines.add(defineRWSTDDEBUG);
+    
+    var configuration = platform.configurations.get(confDebugDllName);
+    configuration.tools.add(compilerToolName, compilerDebugDllConfigure);
+    configuration.tools.add(linkerToolName, linkerDebugConfigure);
+    configuration.tools.add(customBuildToolName, customConfigure);
+
+    // release dll
+    var compilerReleaseDllConfigure = compilerReleaseConfigure.clone();
+    compilerReleaseDllConfigure.runtime = "SINGLE";
+    
+    var configuration = platform.configurations.get(confReleaseDllName);
+    configuration.tools.add(compilerToolName, compilerReleaseDllConfigure);
+    configuration.tools.add(linkerToolName, linkerReleaseConfigure);
+    configuration.tools.add(customBuildToolName, customConfigure);
+    
+    // debug multi-threaded dll
+    var compilerMTDebugDllConfigure = compilerDebugConfigure.clone();
+    compilerMTDebugDllConfigure.runtime = "MultiDebugDll";
+    compilerMTDebugDllConfigure.defines.add(defineRWSTDDEBUG);
+    
+    var configuration = platform.configurations.get(confMTDebugDllName);
+    configuration.tools.add(compilerToolName, compilerMTDebugDllConfigure);
+    configuration.tools.add(linkerToolName, linkerDebugConfigure);
+    configuration.tools.add(customBuildToolName, customConfigure);
+
+    // release multi-threaded dll
+    var compilerMTReleaseDllConfigure = compilerReleaseConfigure.clone();
+    compilerMTReleaseDllConfigure.runtime = "MULTIDLL";
+    
+    var configuration = platform.configurations.get(confMTReleaseDllName);
+    configuration.tools.add(compilerToolName, compilerMTReleaseDllConfigure);
+    configuration.tools.add(linkerToolName, linkerReleaseConfigure);
+    configuration.tools.add(customBuildToolName, customConfigure);
+}
+
+function configureToolsVC71Examples(
+            compilerDebug, compilerRelease, 
+            linkerDebug, linkerRelease, 
+            librarianTool, customTool)
+{
+    var compilerDebugExamples = compilerDebug.clone();
+    var compilerReleaseExamples = compilerRelease.clone();
+    var linkerDebugExamples = linkerDebug.clone();
+    var linkerReleaseExamples = linkerRelease.clone();
+    
+    var postExamplesDll = new PostBuildVC();
+    postExamplesDll.commands.add(varCmdCopyDll, varCmdCopyDll);
+    
+    compilerDebugExamples.includeDirectories.add(samplesBaseIncludeDir);
+    compilerDebugExamples.includeDirectories.add(samplesIncludeDir);
+    compilerDebugExamples.includeDirectories.add(samplesBaseAnsiIncludeDir);
+  
+    compilerReleaseExamples.includeDirectories.add(samplesBaseIncludeDir);
+    compilerReleaseExamples.includeDirectories.add(samplesIncludeDir);
+    compilerReleaseExamples.includeDirectories.add(samplesBaseAnsiIncludeDir);
+    
+    var examplesProj = solutionVC71.projects.get(projectExamplesName);
+    var platform = examplesProj.platforms.get(platformWin32Name);
+  
+    // debug static
+    var compilerDebugStaticEx = compilerDebugExamples.clone();
+    compilerDebugStaticEx.runtime = "SINGLEDEBUG";
+    compilerDebugStaticEx.defines.add(defineRWSTDDEBUG);
+    
+    var configuration = platform.configurations.get(confDebugStaticName);
+    compilerDebugStaticEx.includeDirectories.add(
+        varSign + samplesBaseIncludeDir + "/" + configuration.outputDir);
+        
+    configuration.tools.add(compilerToolName, compilerDebugStaticEx);
+    configuration.tools.add(linkerToolName, linkerDebugExamples);   
+
+    // release static
+    var compilerReleaseStaticEx = compilerReleaseExamples.clone();
+    compilerReleaseStaticEx.runtime = "SINGLE";
+    
+    var configuration = platform.configurations.get(confReleaseStaticName);
+    compilerReleaseStaticEx.includeDirectories.add(
+        varSign + samplesBaseIncludeDir + "/" + configuration.outputDir);
+        
+    configuration.tools.add(compilerToolName, compilerReleaseStaticEx);
+    configuration.tools.add(linkerToolName, linkerReleaseExamples);
+    
+    // debug multi-threaded static
+    var compilerMTDebugStaticEx = compilerDebugExamples.clone();
+    compilerMTDebugStaticEx.runtime = "MULTIDEBUG";
+    compilerMTDebugStaticEx.defines.add(defineRWSTDDEBUG);
+    
+    var configuration = platform.configurations.get(confMTDebugStaticName);
+    compilerMTDebugStaticEx.includeDirectories.add(
+        varSign + samplesBaseIncludeDir + "/" + configuration.outputDir);
+        
+    configuration.tools.add(compilerToolName, compilerMTDebugStaticEx);
+    configuration.tools.add(linkerToolName, linkerDebugExamples);   
+
+    // release multi-threaded static
+    var compilerMTReleaseStaticEx = compilerReleaseExamples.clone();
+    compilerMTReleaseStaticEx.runtime = "MULTI";
+    
+    var configuration = platform.configurations.get(confMTReleaseStaticName);
+    compilerMTReleaseStaticEx.includeDirectories.add(
+        varSign + samplesBaseIncludeDir + "/" + configuration.outputDir);
+        
+    configuration.tools.add(compilerToolName, compilerMTReleaseStaticEx);
+    configuration.tools.add(linkerToolName, linkerReleaseExamples);
+        
+    // debug dll
+    var compilerDebugDllEx = compilerDebugExamples.clone();
+    compilerDebugDllEx.runtime = "SINGLEDEBUG";
+    compilerDebugDllEx.defines.add(defineRWSHARED);
+    compilerDebugDllEx.defines.add(defineRWSTDDEBUG);
+    
+    var configuration = platform.configurations.get(confDebugDllName);
+    compilerDebugDllEx.includeDirectories.add(
+        varSign + samplesBaseIncludeDir + "/" + configuration.outputDir);
+        
+    var postExamplesDebugDll = postExamplesDll.clone();
+    
+    configuration.tools.add(compilerToolName, compilerDebugDllEx);
+    configuration.tools.add(linkerToolName, linkerDebugExamples);
+    configuration.tools.add(postBuildToolName, postExamplesDebugDll);   
+
+    // release dll
+    var compilerReleaseDllEx = compilerReleaseExamples.clone();
+    compilerReleaseDllEx.runtime = "SINGLE";
+    compilerReleaseDllEx.defines.add(defineRWSHARED);
+    
+    var configuration = platform.configurations.get(confReleaseDllName);
+    compilerReleaseDllEx.includeDirectories.add(
+        varSign + samplesBaseIncludeDir + "/" + configuration.outputDir);
+        
+    var postExamplesReleaseDll = postExamplesDll.clone();
+    
+    configuration.tools.add(compilerToolName, compilerReleaseDllEx);
+    configuration.tools.add(linkerToolName, linkerReleaseExamples); 
+    configuration.tools.add(postBuildToolName, postExamplesReleaseDll);
+    
+    // debug multi-threaded dll
+    var compilerMTDebugDllEx = compilerDebugExamples.clone();
+    compilerMTDebugDllEx.runtime = "MultiDebugDll";
+    compilerMTDebugDllEx.defines.add(defineRWSHARED);
+    compilerMTDebugDllEx.defines.add(defineRWSTDDEBUG);
+    
+    var configuration = platform.configurations.get(confMTDebugDllName);
+    compilerMTDebugDllEx.includeDirectories.add(
+        varSign + samplesBaseIncludeDir + "/" + configuration.outputDir);
+        
+    var postExamplesMTDebugDll = postExamplesDll.clone();
+    
+    configuration.tools.add(compilerToolName, compilerMTDebugDllEx);
+    configuration.tools.add(linkerToolName, linkerDebugExamples);
+    configuration.tools.add(postBuildToolName, postExamplesMTDebugDll);
+
+    // release multi-threaded dll
+    var compilerMTReleaseDllEx = compilerReleaseExamples.clone();
+    compilerMTReleaseDllEx.runtime = "MULTIDLL";
+    compilerMTReleaseDllEx.defines.add(defineRWSHARED);
+    
+    var configuration = platform.configurations.get(confMTReleaseDllName);
+    compilerMTReleaseDllEx.includeDirectories.add(
+        varSign + samplesBaseIncludeDir + "/" + configuration.outputDir);
+        
+    var postExamplesMTReleaseDll = postExamplesDll.clone();
+        
+    configuration.tools.add(compilerToolName, compilerMTReleaseDllEx);
+    configuration.tools.add(linkerToolName, linkerReleaseExamples); 
+    configuration.tools.add(postBuildToolName, postExamplesMTReleaseDll);
+}
+
+
+function configureToolsVC71Tests(
+            compilerDebug, compilerRelease, 
+            linkerDebug, linkerRelease, 
+            librarianTool, customTool)
+{
+    var compilerDebugTests = compilerDebug.clone();
+    var compilerReleaseTests = compilerRelease.clone();
+    var linkerDebugTests = linkerDebug.clone();
+    var linkerReleaseTests = linkerRelease.clone();
+    
+    var postTestsDll = new PostBuildVC();
+    postTestsDll.commands.add(varCmdCopyDll, varCmdCopyDll);
+    
+    compilerDebugTests.includeDirectories.add(testsBaseIncludeDir);
+    compilerDebugTests.includeDirectories.add(testsIncludeDir);
+    compilerDebugTests.includeDirectories.add(testsBaseAnsiIncludeDir);
+  
+    compilerReleaseTests.includeDirectories.add(testsBaseIncludeDir);
+    compilerReleaseTests.includeDirectories.add(testsIncludeDir);
+    compilerReleaseTests.includeDirectories.add(testsBaseAnsiIncludeDir);
+    
+    var testsProj = solutionVC71.projects.get(projectTestsName);
+    var platform = testsProj.platforms.get(platformWin32Name);
+  
+    // debug static
+    var compilerDebugStaticTst = compilerDebugTests.clone();
+    compilerDebugStaticTst.runtime = "SINGLEDEBUG";
+    compilerDebugStaticTst.defines.add(defineRWSTDDEBUG);
+    
+    var configuration = platform.configurations.get(confDebugStaticName);
+    compilerDebugStaticTst.includeDirectories.add(
+        varSign + testsBaseIncludeDir + "/" + configuration.outputDir);
+        
+    configuration.tools.add(compilerToolName, compilerDebugStaticTst);
+    configuration.tools.add(linkerToolName, linkerDebugTests);  
+
+    // release static
+    var compilerReleaseStaticTst = compilerReleaseTests.clone();
+    compilerReleaseStaticTst.runtime = "SINGLE";
+    
+    var configuration = platform.configurations.get(confReleaseStaticName);
+    compilerReleaseStaticTst.includeDirectories.add(
+        varSign + testsBaseIncludeDir + "/" + configuration.outputDir);
+        
+    configuration.tools.add(compilerToolName, compilerReleaseStaticTst);
+    configuration.tools.add(linkerToolName, linkerReleaseTests);
+    
+    // debug multi-threaded static
+    var compilerMTDebugStaticTst = compilerDebugTests.clone();
+    compilerMTDebugStaticTst.runtime = "MULTIDEBUG";
+    compilerMTDebugStaticTst.defines.add(defineRWSTDDEBUG);
+    
+    var configuration = platform.configurations.get(confMTDebugStaticName);
+    compilerMTDebugStaticTst.includeDirectories.add(
+        varSign + testsBaseIncludeDir + "/" + configuration.outputDir);
+        
+    configuration.tools.add(compilerToolName, compilerMTDebugStaticTst);
+    configuration.tools.add(linkerToolName, linkerDebugTests);  
+
+    // release multi-threaded static
+    var compilerMTReleaseStaticTst = compilerReleaseTests.clone();
+    compilerMTReleaseStaticTst.runtime = "MULTI";
+    
+    var configuration = platform.configurations.get(confMTReleaseStaticName);
+    compilerMTReleaseStaticTst.includeDirectories.add(
+        varSign + testsBaseIncludeDir + "/" + configuration.outputDir);
+        
+    configuration.tools.add(compilerToolName, compilerMTReleaseStaticTst);
+    configuration.tools.add(linkerToolName, linkerReleaseTests);
+        
+    // debug dll
+    var compilerDebugDllTst = compilerDebugTests.clone();
+    compilerDebugDllTst.runtime = "SINGLEDEBUG";
+    compilerDebugDllTst.defines.add(defineRWSHARED);
+    compilerDebugDllTst.defines.add(defineRWSTD_TEST_SRC);
+    compilerDebugDllTst.defines.add(defineRWSTDDEBUG);
+    
+    var configuration = platform.configurations.get(confDebugDllName);
+    compilerDebugDllTst.includeDirectories.add(
+        varSign + testsBaseIncludeDir + "/" + configuration.outputDir);
+        
+    var postTestsDebugDll = postTestsDll.clone();
+        
+    configuration.tools.add(compilerToolName, compilerDebugDllTst);
+    configuration.tools.add(linkerToolName, linkerDebugTests);
+    configuration.tools.add(postBuildToolName, postTestsDebugDll);
+
+    // release dll
+    var compilerReleaseDllTst = compilerReleaseTests.clone();
+    compilerReleaseDllTst.runtime = "SINGLE";
+    compilerReleaseDllTst.defines.add(defineRWSHARED);
+    compilerReleaseDllTst.defines.add(defineRWSTD_TEST_SRC);
+    
+    var configuration = platform.configurations.get(confReleaseDllName);
+    compilerReleaseDllTst.includeDirectories.add(
+        varSign + testsBaseIncludeDir + "/" + configuration.outputDir);
+        
+    var postTestsReleaseDll = postTestsDll.clone();
+        
+    configuration.tools.add(compilerToolName, compilerReleaseDllTst);
+    configuration.tools.add(linkerToolName, linkerReleaseTests);    
+    configuration.tools.add(postBuildToolName, postTestsReleaseDll);
+    
+    // debug multi-threaded dll
+    var compilerMTDebugDllTst = compilerDebugTests.clone();
+    compilerMTDebugDllTst.runtime = "MultiDebugDll";
+    compilerMTDebugDllTst.defines.add(defineRWSHARED);
+    compilerMTDebugDllTst.defines.add(defineRWSTD_TEST_SRC);
+    compilerMTDebugDllTst.defines.add(defineRWSTDDEBUG);
+    
+    var configuration = platform.configurations.get(confMTDebugDllName);
+    compilerMTDebugDllTst.includeDirectories.add(
+        varSign + testsBaseIncludeDir + "/" + configuration.outputDir);
+        
+    var postTestsMTDebugDll = postTestsDll.clone();
+        
+    configuration.tools.add(compilerToolName, compilerMTDebugDllTst);
+    configuration.tools.add(linkerToolName, linkerDebugTests);
+    configuration.tools.add(postBuildToolName, postTestsMTDebugDll);
+
+    // release multi-threaded dll
+    var compilerMTReleaseDllTst = compilerReleaseTests.clone();
+    compilerMTReleaseDllTst.runtime = "MULTIDLL";
+    compilerMTReleaseDllTst.defines.add(defineRWSHARED);
+    compilerMTReleaseDllTst.defines.add(defineRWSTD_TEST_SRC);
+    
+    var configuration = platform.configurations.get(confMTReleaseDllName);
+    compilerMTReleaseDllTst.includeDirectories.add(
+        varSign + testsBaseIncludeDir + "/" + configuration.outputDir);
+        
+    var postTestsMTReleaseDll = postTestsDll.clone();
+        
+    configuration.tools.add(compilerToolName, compilerMTReleaseDllTst);
+    configuration.tools.add(linkerToolName, linkerReleaseTests);
+    configuration.tools.add(postBuildToolName, postTestsMTReleaseDll);
+}
+
+
+function configureToolsVC71RwTest(
+            compilerDebug, compilerRelease, 
+            linkerDebug, linkerRelease, 
+            librarianTool, customTool)
+{
+    var compilerDebugRwTest = compilerDebug.clone();
+    var compilerReleaseRwTest = compilerRelease.clone();
+    var librarianRwTest = librarianTool.clone();
+    
+    compilerDebugRwTest.includeDirectories.add(includeFirstParentDir);
+    compilerDebugRwTest.includeDirectories.add(includeSecondParentDir);
+    compilerDebugRwTest.includeDirectories.add(includeSecondParentAnsiDir);
+  
+    compilerReleaseRwTest.includeDirectories.add(includeFirstParentDir);
+    compilerReleaseRwTest.includeDirectories.add(includeSecondParentDir);
+    compilerReleaseRwTest.includeDirectories.add(includeSecondParentAnsiDir);
+    
+    var rwTestProj = solutionVC71.projects.get(projectRwTestName);
+    var platform = rwTestProj.platforms.get(platformWin32Name);
+    
+    librarianRwTest.outputFile = rwTestProj.name + ".lib";
+  
+    // debug static
+    var compilerDebugStaticRw = compilerDebugRwTest.clone();
+    compilerDebugStaticRw.runtime = "SINGLEDEBUG";
+    compilerDebugStaticRw.defines.add(defineRWSTDDEBUG);
+    
+    var configuration = platform.configurations.get(confDebugStaticName);
+    compilerDebugStaticRw.includeDirectories.add(
+        varSign + includeSecondParentDir + "/" + configuration.outputDir);
+        
+    configuration.tools.add(compilerToolName, compilerDebugStaticRw);
+    configuration.tools.add(librarianToolName, librarianRwTest);    
+
+    // release static
+    var compilerReleaseStaticRw = compilerReleaseRwTest.clone();
+    compilerReleaseStaticRw.runtime = "SINGLE";
+    
+    var configuration = platform.configurations.get(confReleaseStaticName);
+    compilerReleaseStaticRw.includeDirectories.add(
+        varSign + includeSecondParentDir + "/" + configuration.outputDir);
+        
+    configuration.tools.add(compilerToolName, compilerReleaseStaticRw);
+    configuration.tools.add(librarianToolName, librarianRwTest);    
+    
+    // debug multi-threaded static
+    var compilerMTDebugStaticRw = compilerDebugRwTest.clone();
+    compilerMTDebugStaticRw.runtime = "MULTIDEBUG";
+    compilerMTDebugStaticRw.defines.add(defineRWSTDDEBUG);
+    
+    var configuration = platform.configurations.get(confMTDebugStaticName);
+    compilerMTDebugStaticRw.includeDirectories.add(
+        varSign + includeSecondParentDir + "/" + configuration.outputDir);
+        
+    configuration.tools.add(compilerToolName, compilerMTDebugStaticRw);
+    configuration.tools.add(librarianToolName, librarianRwTest);
+
+    // release multi-threaded static
+    var compilerMTReleaseStaticRw = compilerReleaseRwTest.clone();
+    compilerMTReleaseStaticRw.runtime = "MULTI";
+    
+    var configuration = platform.configurations.get(confMTReleaseStaticName);
+    compilerMTReleaseStaticRw.includeDirectories.add(
+        varSign + includeSecondParentDir + "/" + configuration.outputDir);
+        
+    configuration.tools.add(compilerToolName, compilerMTReleaseStaticRw);
+    configuration.tools.add(librarianToolName, librarianRwTest);
+        
+    // debug dll
+    var compilerDebugDllRw = compilerDebugRwTest.clone();
+    compilerDebugDllRw.runtime = "SINGLEDEBUG";
+    compilerDebugDllRw.defines.add(defineRWSHARED);
+    compilerDebugDllRw.defines.add(defineRWSTDDEBUG);
+    
+    var configuration = platform.configurations.get(confDebugDllName);
+    compilerDebugDllRw.includeDirectories.add(
+        varSign + includeSecondParentDir + "/" + configuration.outputDir);
+        
+    configuration.tools.add(compilerToolName, compilerDebugDllRw);
+    configuration.tools.add(librarianToolName, librarianRwTest);
+
+    // release dll
+    var compilerReleaseDllRw = compilerReleaseRwTest.clone();
+    compilerReleaseDllRw.runtime = "SINGLE";
+    compilerReleaseDllRw.defines.add(defineRWSHARED);
+    
+    var configuration = platform.configurations.get(confReleaseDllName);
+    compilerReleaseDllRw.includeDirectories.add(
+        varSign + includeSecondParentDir + "/" + configuration.outputDir);
+        
+    configuration.tools.add(compilerToolName, compilerReleaseDllRw);
+    configuration.tools.add(librarianToolName, librarianRwTest);    
+    
+    // debug multi-threaded dll
+    var compilerMTDebugDllRw = compilerDebugRwTest.clone();
+    compilerMTDebugDllRw.runtime = "MultiDebugDll";
+    compilerMTDebugDllRw.defines.add(defineRWSHARED);
+    compilerMTDebugDllRw.defines.add(defineRWSTDDEBUG);
+    
+    var configuration = platform.configurations.get(confMTDebugDllName);
+    compilerMTDebugDllRw.includeDirectories.add(
+        varSign + includeSecondParentDir + "/" + configuration.outputDir);
+        
+    configuration.tools.add(compilerToolName, compilerMTDebugDllRw);
+    configuration.tools.add(librarianToolName, librarianRwTest);
+
+    // release multi-threaded dll
+    var compilerMTReleaseDllRw = compilerReleaseRwTest.clone();
+    compilerMTReleaseDllRw.runtime = "MULTIDLL";
+    compilerMTReleaseDllRw.defines.add(defineRWSHARED);
+    
+    var configuration = platform.configurations.get(confMTReleaseDllName);
+    compilerMTReleaseDllRw.includeDirectories.add(
+        varSign + includeSecondParentDir + "/" + configuration.outputDir);
+        
+    configuration.tools.add(compilerToolName, compilerMTReleaseDllRw);
+    configuration.tools.add(librarianToolName, librarianRwTest);    
+}
+
+
+function configureToolsVC71RunExamples(
+            compilerDebug, compilerRelease, 
+            linkerDebug, linkerRelease, 
+            librarianTool, customTool)
+{
+    var customRunEx = customTool.clone();
+    
+    var runExProj = solutionVC71.projects.get(projectRunExamplesName);
+    var platform = runExProj.platforms.get(platformWin32Name);
+  
+    // debug static
+    var customDebugStaticRunEx = customRunEx.clone();
+    var configuration = platform.configurations.get(confDebugStaticName);
+    configuration.tools.add(customBuildToolName, customDebugStaticRunEx);   
+
+    // release static
+    var customReleaseStaticRunEx = customRunEx.clone();
+    var configuration = platform.configurations.get(confReleaseStaticName);
+    configuration.tools.add(customBuildToolName, customReleaseStaticRunEx); 
+    
+    // multi-threaded debug static
+    var customMTDebugStaticRunEx = customRunEx.clone();
+    var configuration = platform.configurations.get(confMTDebugStaticName);
+    configuration.tools.add(customBuildToolName, customMTDebugStaticRunEx); 
+    
+    // multi-threaded release static
+    var customMTReleaseStaticRunEx = customRunEx.clone();
+    var configuration = platform.configurations.get(confMTReleaseStaticName);
+    configuration.tools.add(customBuildToolName, customMTReleaseStaticRunEx);   
+    
+    // debug dll
+    var customDebugDllRunEx = customRunEx.clone();
+    var configuration = platform.configurations.get(confDebugDllName);
+    configuration.tools.add(customBuildToolName, customDebugDllRunEx);  
+    
+    // release dll
+    var customReleaseDllRunEx = customRunEx.clone();
+    var configuration = platform.configurations.get(confReleaseDllName);
+    configuration.tools.add(customBuildToolName, customReleaseDllRunEx);    
+    
+    // multi-threaded debug dll
+    var customMTDebugDllRunEx = customRunEx.clone();
+    var configuration = platform.configurations.get(confMTDebugDllName);
+    configuration.tools.add(customBuildToolName, customMTDebugDllRunEx);    
+    
+    // multi-threaded release dll
+    var customMTReleaseDllRunEx = customRunEx.clone();
+    var configuration = platform.configurations.get(confMTReleaseDllName);
+    configuration.tools.add(customBuildToolName, customMTReleaseDllRunEx);  
+}
+
+
+function configureToolsVC71RunTests(
+            compilerDebug, compilerRelease, 
+            linkerDebug, linkerRelease, 
+            librarianTool, customTool)
+{
+    var customRunEx = customTool.clone();
+    
+    var runTestsProj = solutionVC71.projects.get(projectRunTestsName);
+    var platform = runTestsProj.platforms.get(platformWin32Name);
+  
+    // debug static
+    var customDebugStaticRunEx = customRunEx.clone();
+    var configuration = platform.configurations.get(confDebugStaticName);
+    configuration.tools.add(customBuildToolName, customDebugStaticRunEx);   
+
+    // release static
+    var customReleaseStaticRunEx = customRunEx.clone();
+    var configuration = platform.configurations.get(confReleaseStaticName);
+    configuration.tools.add(customBuildToolName, customReleaseStaticRunEx); 
+    
+    // multi-threaded debug static
+    var customMTDebugStaticRunEx = customRunEx.clone();
+    var configuration = platform.configurations.get(confMTDebugStaticName);
+    configuration.tools.add(customBuildToolName, customMTDebugStaticRunEx); 
+    
+    // multi-threaded release static
+    var customMTReleaseStaticRunEx = customRunEx.clone();
+    var configuration = platform.configurations.get(confMTReleaseStaticName);
+    configuration.tools.add(customBuildToolName, customMTReleaseStaticRunEx);   
+    
+    // debug dll
+    var customDebugDllRunEx = customRunEx.clone();
+    var configuration = platform.configurations.get(confDebugDllName);
+    configuration.tools.add(customBuildToolName, customDebugDllRunEx);  
+    
+    // release dll
+    var customReleaseDllRunEx = customRunEx.clone();
+    var configuration = platform.configurations.get(confReleaseDllName);
+    configuration.tools.add(customBuildToolName, customReleaseDllRunEx);    
+    
+    // multi-threaded debug dll
+    var customMTDebugDllRunEx = customRunEx.clone();
+    var configuration = platform.configurations.get(confMTDebugDllName);
+    configuration.tools.add(customBuildToolName, customMTDebugDllRunEx);    
+    
+    // multi-threaded release dll
+    var customMTReleaseDllRunEx = customRunEx.clone();
+    var configuration = platform.configurations.get(confMTReleaseDllName);
+    configuration.tools.add(customBuildToolName, customMTReleaseDllRunEx);  
+}
+
+
+function configureToolsVC71()
+{
+    // VC compilers
+    var compilerVCRelease = new CompilerVC(compilerWin32);
+    
+    var compilerVCDebug = compilerVCRelease.clone();
+    compilerVCDebug.isDebug =true;
+    
+    compilerVCRelease.optimization = "Size";
+    compilerVCRelease.debugInfoFormat = "PDB";
+    
+    compilerVCDebug.debugInfoFormat = "PDB";
+    
+    var compilerVC71Release = new CompilerVC71(compilerVCRelease);
+    var compilerVC71Debug = new CompilerVC71(compilerVCDebug);
+    
+    // VC linkers
+    var linkerVCDebug = new LinkerVC(linker);
+    linkerVCDebug.subsystem = "Console";
+    linkerVCDebug.incremental = "No";
+    var linkerVCRelease = linkerVCDebug.clone();
+    linkerVCRelease.optimizeRefs = "Remove";
+    linkerVCRelease.comdatFolding = "Remove";
+
+    // VC librarian
+    var librarianVC = new LibrarianVC(librarian);
+    
+    // VC custom
+    var customVC = new CustomBuildVC();
+    
+    // configure projects tools
+    configureToolsVC71Configure(compilerVC71Debug, compilerVC71Release,
+        linkerVCDebug, linkerVCRelease, librarianVC, customVC);
+        
+    configureToolsVC71Examples(compilerVC71Debug, compilerVC71Release,
+        linkerVCDebug, linkerVCRelease, librarianVC, customVC);
+
+    configureToolsVC71Tests(compilerVC71Debug, compilerVC71Release,
+        linkerVCDebug, linkerVCRelease, librarianVC, customVC);
+        
+    configureToolsVC71RwTest(compilerVC71Debug, compilerVC71Release,
+        linkerVCDebug, linkerVCRelease, librarianVC, customVC);
+        
+    configureToolsVC71RunExamples(compilerVC71Debug, compilerVC71Release,
+        linkerVCDebug, linkerVCRelease, librarianVC, customVC);
+        
+    configureToolsVC71RunTests(compilerVC71Debug, compilerVC71Release,
+        linkerVCDebug, linkerVCRelease, librarianVC, customVC);
+}
+
+
+

Propchange: incubator/stdcxx/trunk/etc/config/windows/msvc-config.js
------------------------------------------------------------------------------
    svn:keywords = Id

Added: incubator/stdcxx/trunk/etc/config/windows/msvc-config_classes.js
URL: http://svn.apache.org/viewcvs/incubator/stdcxx/trunk/etc/config/windows/msvc-config_classes.js?rev=349027&view=auto
==============================================================================
--- incubator/stdcxx/trunk/etc/config/windows/msvc-config_classes.js (added)
+++ incubator/stdcxx/trunk/etc/config/windows/msvc-config_classes.js Fri Nov 25 14:16:34 2005
@@ -0,0 +1,819 @@
+//
+// $Id$
+//
+// file should be included after base_config_classes
+
+// VC compiler, linker and librarian
+
+var varSign = "$$";
+
+// builds standard string of inputs from a collection
+function buildOptionsVC(collection, prefix)
+{
+    var options = "";
+    for (i in collection)
+    {
+        if (typeof(collection[i]) != "function")
+        {
+            options += " " + prefix + "\"" + i + "\"";
+        }
+    }
+    return options;
+}
+
+// returns outputDirectory with the (back)slash at end
+function getOutputDir()
+{
+    return this.outputDirectory;
+}
+
+// returns intermDirectory with the (back)slash at end
+function getIntermDir()
+{
+    return this.intermDirectory;
+}
+
+//------------------------------------------------
+// CompilerVC class
+//------------------------------------------------
+
+// VC compiler options
+// optimization = Disabled (0, /Od) | Size (1, /O1) | Speed (2, /O2)
+//                  | Full (3, /Ox) (custom is not supported)
+// minimalRebuild = true (TRUE, /Gm)| false (FALSE, "")
+// runtime = 
+//      SingleDebug (5, /MLd) | Single (4, /ML) | MultiDebugDll (3, /MDd)
+//              | MultiDll (2, /MD) | MultiDebug (1, MTd) | Multi (0, /MT)
+// exceptions = true (TRUE, /EHsc) | false (FALSE, "")
+// precompiledHeader = 
+//      Use (3, /Yu) | Auto (2, /YX) | Create (1, /Yc) | No (0, "")
+// pchName = <name of the pchfile>
+// pchBuildFrom = <name of the .h file>
+// warningsLevel = 0 (/W0) | 1 (/W1) | 2 (/W2)| 3 (/W3)| 4 (/W4)
+// debugInfoFormat = Disabled (0, "") | C7 (1, /Z7) | LinesOnly (2, /Zd)
+//                      | PDB (3, /Zi) | EditContinue (4, /ZI)
+// pdbName = <name of pdb file>
+// nologo = true (TRUE, /nologo) | FALSE (FALSE, "")
+
+//.ctor from base compiler
+function CompilerVC(compilerBase)
+{
+    if (!compilerBase)
+    {
+        compilerBase = new Compiler();
+    }
+    compilerBase.cloneTo(this);
+    this.optimization = "Disabled";
+    this.minimalRebuild = true;
+    this.runtime = "MultiDebugDll";
+    this.exceptions = true;
+    this.precompiledHeader = "No";
+    this.pchName = "";
+    this.pchBuildFrom = "";
+    this.warningsLevel = 3;
+    this.debugInfoFormat = "PDB";
+    this.pdbName = "";
+    this.nologo = true;
+
+    this.cloneTo = genericCloneTo;
+    this.clone = genericClone;
+    this.getOutputDir = getOutputDir;
+    this.getIntermDir = getIntermDir;
+    this.getCommandLine = getCommandLineCompilerVC;
+    this.getPreprocessCommandLine = getPreprocessCommandLineCompilerVC;
+}
+
+function getCommandLineCompilerVC()
+{
+    var cmdLine = "cl /c";
+    // nologo
+    if (this.nologo)
+    {
+        cmdLine += " /nologo";
+    }
+    // defines
+    cmdLine += buildOptionsVC(this.defines, "/D ");
+    // includes
+    cmdLine += buildOptionsVC(this.includeDirectories, "/I");
+    // warnings
+    cmdLine += " /W" + this.warningsLevel;
+    // exceptions
+    if (this.exceptions)
+    {
+        cmdLine += " /EHsc";
+    }
+    // runtime
+    switch (this.runtime.toUpperCase())
+    {
+    case "MULTI":
+        cmdLine += " /MT";
+        break;
+    case "MULTIDEBUG":
+        cmdLine += " /MTd";
+        break;
+    case "MULTIDLL":
+        cmdLine += " /MD";
+        break;
+    case "MULTIDEBUGDLL":
+        cmdLine += " /MDd";
+        break;
+    case "SINGLE":
+        cmdLine += " /ML";
+        break;
+    default: // SingleDebug
+        cmdLine += " /MLd";
+    }
+    // minimalRebuild
+    if (this.minimalRebuild)
+    {
+        cmdLine += " /Gm";
+    }
+    switch (this.optimization.toUpperCase())
+    {
+    case "FULL":
+        cmdLine += " /Ox";
+        break;
+    case "SPEED":
+        cmdLine += " /O2";
+        break;
+    case "SIZE":
+        cmdLine += " /O1";
+        break;
+    default: // Diasbled
+        cmdLine += " /Od";
+    }
+    /*
+    // outfolder
+    var outDir = this.getOutputDir() + "\\";
+    if (outDir.length > 0)
+    {
+        cmdLine += " /Fo\"" + outDir + "\\\"";
+    }
+    */
+    // outfolder
+    var outDir = this.getIntermDir() + "\\";
+    if (outDir.length > 0)
+    {
+        cmdLine += " /Fo\"" + outDir + "\\\"";
+    }
+    // pch
+    var usePCH = true;
+    switch (this.precompiledHeader.toUpperCase())
+    {
+    case "USE":
+        cmdLine += " /Yu";
+        break;
+    case "AUTO":
+        cmdLine += " /YX";
+        break;
+    case "CREATE":
+        cmdLine += " /Yc";
+        break;
+    default:
+        usePCH = false;
+    }
+    if (usePCH)
+    {
+        if (this.pchBuildFrom.length > 0)
+        {
+            cmdLine += "\"" + this.pchBuildFrom + "\"";
+        }
+        else
+        {
+            cmdLine += "\"stdafx.h\"";
+        }
+        if (this.pchName.length > 0)
+        {
+            cmdLine += " /Fp\"" + outFir + this.pchName + "\"";
+        }
+    }
+    // pdb
+    var usePDB = true;
+    switch (this.debugInfoFormat.toUpperCase())
+    {
+    case "C7":
+        cmdLine += " /Z7";
+        break;
+    case "LINESONLY":
+        cmdLine += " /Zd";
+        break;
+    case "PDB":
+        cmdLine += " /Zi";
+        break;
+    case "EDITCONTINUE":
+        cmdLine += " /ZI";
+        break;
+    default:
+        usePDB = false;
+    }
+    if (usePDB && this.pdbName.length > 0)
+    {
+        cmdLine += " /Fd\"" + outDir + this.pdbName + "\"";
+    }
+    // output
+    if (this.outputFile.length > 0)
+    {
+        cmdLine += " /Fe\"" + outDir + this.outputFile + "\"";
+    }
+    // inputs
+    cmdLine += buildOptionsVC(this.inputFiles, "");
+    return cmdLine;
+}
+
+function writeSolutionSettingsCompilerVC(vcproj, outDir)
+{
+    vcproj.WriteLine("\t\t\t<Tool")
+    vcproj.WriteLine("\t\t\t\tName=\"VCCLCompilerTool\"");
+    var opt = 0;
+    switch (this.optimization.toUpperCase())
+    {
+    case "SIZE":
+        opt = 1;
+        break;
+    case "SPEED":
+        opt = 2;
+        break;
+    case "FULL":
+        opt = 3;
+        break;
+    default:
+        // leave 0 (Disabled)
+    }
+    vcproj.WriteLine("\t\t\t\tOptimization=\"" + opt + "\"");
+    var includesArray = new Array();
+    for (i in this.includeDirectories)
+    {
+        if (!this.includeDirectories[i])
+        {
+            var findex = i.indexOf(varSign);
+            if (findex == 0)
+                includesArray.push(i.substr(varSign.length));
+            else
+                includesArray.push(outDir + i);
+        }
+    }
+    vcproj.WriteLine("\t\t\t\tAdditionalIncludeDirectories=\""
+                        + xmlencode(includesArray.join(";")) + "\"");
+    
+    var defsArray = new Array();
+    for (i in this.defines)
+    {
+        if (!this.defines[i])
+        {
+            defsArray.push(i);
+        }
+    }
+    vcproj.WriteLine("\t\t\t\tPreprocessorDefinitions=\""
+                    + xmlencode(defsArray.join(";")) + "\"");
+    vcproj.WriteLine("\t\t\t\tMinimalRebuild=\""
+                    + this.minimalRebuild.toString().toUpperCase() + "\"");
+    vcproj.WriteLine("\t\t\t\tExceptionHandling=\""
+                    + this.exceptions.toString().toUpperCase() + "\"");
+                        
+    //TODO: customize following 2 lines later
+    //vcproj.WriteLine("\t\t\t\tBasicRuntimeChecks=\"3\"");
+    vcproj.WriteLine("\t\t\t\tDetect64BitPortabilityProblems=\"FALSE\"");
+    
+    vcproj.WriteLine("\t\t\t\tSuppressStartupBanner=\""
+                        + this.nologo.toString().toUpperCase() + "\"");
+    
+    var runtime = "0";
+    switch (this.runtime.toUpperCase())
+    {
+        case "SINGLEDEBUG":
+            runtime = "5";
+            break;
+        case "SINGLE":
+            runtime = "4";
+            break;
+        case "MULTIDEBUGDLL":
+            runtime = "3";
+            break;
+        case "MULTIDLL":
+            runtime = "2";
+            break;
+        case "MULTIDEBUG":
+            runtime = "1";
+            break;
+        default:
+            // Multi, 0
+    }
+    vcproj.WriteLine("\t\t\t\tRuntimeLibrary=\"" + runtime + "\"");
+    if (this.pchBuildFrom.length > 0)
+    {
+        vcproj.WriteLine("\t\t\t\tPrecompiledHeaderThrough=\""
+                            + xmlencode(this.pchBuildFrom) + "\"");
+    }
+    if (this.pchName.length > 0)
+    {
+        vcproj.WriteLine("\t\t\t\tPrecompiledHeaderFile=\""
+                            + xmlencode(this.pchName) + "\"");
+    }
+    var usePh = "0";
+    switch (this.precompiledHeader.toUpperCase())
+    {
+    case "USE":
+        usePh = "3";
+        break;
+    case "AUTO":
+        usePh = "2";
+        break;
+    case "CREATE":
+        usePh = "1";
+        break;
+    default:
+        // No, 0        
+    }
+    vcproj.WriteLine("\t\t\t\tUsePrecompiledHeader=\"" + usePh + "\"");
+    
+    if (this.pdbName.length > 0)
+    {
+        vcproj.WriteLine("\t\t\t\tProgramDataBaseFileName=\""
+            + xmlencode(this.getIntermDir() + "\\" + this.pdbName) + "\"");
+    }
+    
+    vcproj.WriteLine("\t\t\t\tWarningLevel=\""
+                        + this.warningsLevel + "\"");
+    var diFormat = "0";
+    switch (this.debugInfoFormat.toUpperCase())
+    {
+        case "C7":
+            diFormat = "1";
+            break;
+        case "LINESONLY":
+            diFormat = "2";
+            break;
+        case "PDB":
+            diFormat = "3";
+            break;
+        case "EDITCONTINUE":
+            diFormat = "4";
+            break;
+        default:
+            // Disabled, 0
+    }   
+    vcproj.WriteLine("\t\t\t\tObjectFile=\""
+        + xmlencode(this.getIntermDir() + "\\" + this.outputFile) + "\"");
+
+    vcproj.WriteLine(
+        "\t\t\t\tDebugInformationFormat=\"" + diFormat + "\"/>");   
+}
+
+
+function getPreprocessCommandLineCompilerVC()
+{
+    return this.getCommandLine() + " /E";
+}
+
+// compilerVC class methods
+CompilerVC.prototype.cloneTo = genericCloneTo;
+CompilerVC.prototype.clone = genericClone;
+CompilerVC.prototype.getOutputDir = getOutputDir;
+CompilerVC.prototype.getIntermDir = getIntermDir;
+CompilerVC.prototype.getCommandLine = getCommandLineCompilerVC;
+CompilerVC.prototype.getPreprocessCommandLine =
+                        getPreprocessCommandLineCompilerVC;
+CompilerVC.prototype.writeSolutionSettings =
+                        writeSolutionSettingsCompilerVC;
+
+//------------------------------------------------
+// LinkerVC class
+//------------------------------------------------
+
+// VC linker options
+// incremental = Yes (2, /INCREMENTAL) | 
+//      No (1, /INCREMENTAL:NO) | Default (0, "")
+// debugInfo = true (TRUE, /DEBUG) | false (FALSE, "")
+// pdbFile = <file name w/o directory>
+// subsystem = Default (0, "") | Console (1, /SUBSYSTEM:CONSOLE)
+//              | Windows (2, /SUBSYSTEM:WINDOWS)
+// optimizeRefs = Remove (2, /OPT:REF) | 
+//      Leave (1, /OPT:NOREF) | Default (0, "")
+// comdatFolding = Remove (2, /OPT:ICF) | 
+//      Leave (1, /OPT:NOICF) | Default (0, "")
+// machine = X86 (1, /MACHINE:X86) | Default (0, "")
+// nologo = true (TRUE, /nologo) | FALSE (FALSE, "")
+// isDLL = true (?, /DLL) | false (?, "") 
+//determined by a configuration type in solution!
+
+// .ctor from base linker
+function LinkerVC(linkerBase)
+{
+    if (!linkerBase)
+    {
+        linkerBase = new Linker();
+    }
+    linkerBase.cloneTo(this);
+    this.incremental = "Default";
+    this.debugInfo = true;
+    this.pdbFile = "";
+    this.subsystem = "";
+    this.optimizeRef = "";
+    this.comdatFolding = "";
+    this.machine = "X86";
+    this.nologo = true;
+    this.isDLL = false;
+
+    this.cloneTo = genericCloneTo;
+    this.clone = genericClone;
+    this.getOutputDir = getOutputDir;
+    this.getIntermDir = getIntermDir;
+    this.getCommandLine = getCommandLineLinkerVC;
+}
+
+function getCommandLineLinkerVC()
+{
+    var cmdLine = "link";
+    // nologo
+    if (this.nologo)
+    {
+        cmdLine += " /NOLOGO";
+    }
+    if (this.isDLL)
+    {
+        cmdLine += " /DLL";
+    }
+    // machine
+    switch (this.machine.toUpperCase())
+    {
+    case "X86":
+        cmdLine += " /MACHINE:X86";
+        break;
+    default:
+        // do nothing
+    }
+    // comdatFolding
+    switch (this.comdatFolding.toUpperCase())
+    {
+    case "REMOVE":
+        cmdLine += " /OPT:ICF";
+        break;
+    case "LEAVE":
+        cmdLine += " /OPT:NOICF";
+        break;
+    default:
+        // do nothing
+    }
+    // optimizeRef
+    switch (this.optimizeRef.toUpperCase())
+    {
+    case "REMOVE":
+        cmdLine += " /OPT:REF";
+        break;
+    case "LEAVE":
+        cmdLine += " /OPT:NOREF";
+        break;
+    default:
+        // do nothing
+    }
+    // subsystem
+    switch (this.subsystem.toUpperCase())
+    {
+    case "WINDOWS":
+    case "CONSOLE":
+        cmdLine += " /SUBSYSTEM:" + this.subsystem.toUpperCase();
+        break;
+    default:
+        // do nothing
+    }
+    // debug info
+    if (this.debugInfo)
+    {
+        cmdLine += " /DEBUG";
+    }
+    // incremental
+    switch (this.incremental.toUpperCase())
+    {
+    case "YES":
+        cmdLine += " /INCREMENTAL";
+        break;
+    case "NO":
+        cmdLine += " /INCREMENTAL:NO";
+        break;
+    default:
+        // do nothing
+    }
+    // PDB
+    var intDir = this.getIntermDir() + "\\";
+    if (this.pdbFile.length > 0)
+    {
+        cmdLine += " /PDB:\"" + intDir + this.pdbFile + "\"";
+    }
+    // output
+    var outDir = this.getOutputDir() + "\\";
+    if (this.outputFile.length > 0)
+    {
+        cmdLine += " /OUT:\"" + outDir + this.outputFile + "\"";
+    }
+    // inputs
+    cmdLine += buildOptionsVC(this.inputFiles, "");
+    cmdLine += buildOptionsVC(this.libraries, "");
+    return cmdLine;
+}
+
+function writeSolutionSettingsLinkerVC(vcproj, outDir)
+{
+    vcproj.WriteLine("\t\t\t<Tool")
+    vcproj.WriteLine("\t\t\t\tName=\"VCLinkerTool\"");
+    var inc = "0";
+    switch (this.incremental.toUpperCase())
+    {
+        case "YES":
+            inc = "2";
+            break;
+        case "NO":
+            inc = "1";
+            break;
+        default:        
+            // leave 0
+    }
+    vcproj.WriteLine("\t\t\t\tLinkIncremental=\"" + inc + "\"");
+    vcproj.WriteLine("\t\t\t\tSuppressStartupBanner=\""
+                        + this.nologo.toString().toUpperCase() + "\"");
+    vcproj.WriteLine("\t\t\t\tGenerateDebugInformation=\""
+                        + this.debugInfo.toString().toUpperCase() + "\"");
+    var subsys = "0";
+    switch (this.subsystem.toUpperCase())
+    {
+        case "WINDOWS":
+            subsys = "2";
+            break;
+        case "CONSOLE":
+            subsys = "1";
+            break;
+        default:
+            // leave as it is
+    }
+    vcproj.WriteLine("\t\t\t\tSubSystem=\"" + subsys + "\"");
+    var opt = "0";
+    switch (this.optimizeRef.toUpperCase())
+    {
+        case "REMOVE":
+            opt = "2";
+            break;
+        case "LEAVE":
+            opt = "1";
+            break;
+        default:
+            // leave as it is
+    }   
+    vcproj.WriteLine("\t\t\t\tOptimizeReferences=\"" + opt + "\"");
+    opt = "0";
+    switch (this.comdatFolding.toUpperCase())
+    {
+        case "REMOVE":
+            opt = "2";
+            break;
+        case "LEAVE":
+            opt = "1";
+            break;
+        default:
+            // leave as it is
+    }   
+    vcproj.WriteLine("\t\t\t\tEnableCOMDATFolding=\"" + opt + "\"");
+    vcproj.WriteLine("\t\t\t\tTargetMachine=\""
+                        + (this.machine.toUpperCase() == "X86" ?
+                                "1" : "0") + "\""); 
+    if (this.pdbFile.length > 0)
+    {
+        vcproj.WriteLine("\t\t\t\tProgramDatabaseFile=\""
+                    + xmlencode(this.getOutputDir() + "\\" + this.pdbFile)
+                    + "\"");
+    }
+    
+    vcproj.WriteLine("\t\t\t\tOutputFile=\""
+        + xmlencode(this.getOutputDir() + "\\" + this.outputFile)
+        + "\"/>");
+}
+
+// linkerVC class methods
+LinkerVC.prototype.cloneTo = genericCloneTo;
+LinkerVC.prototype.clone = genericClone;
+LinkerVC.prototype.getOutputDir = getOutputDir;
+LinkerVC.prototype.getIntermDir = getIntermDir;
+LinkerVC.prototype.getCommandLine = getCommandLineLinkerVC;
+LinkerVC.prototype.writeSolutionSettings =
+                    writeSolutionSettingsLinkerVC;
+
+//------------------------------------------------
+// LibrarianVC class
+//------------------------------------------------
+
+// VC librarian options
+// nologo = true (TRUE, /nologo) | FALSE (FALSE, "")
+
+// .ctor from base librarian
+function LibrarianVC(librarianBase)
+{
+    if (!librarianBase)
+    {
+        librarianBase = new Librarian();
+    }
+    librarianBase.cloneTo(this);
+    this.nologo = true;
+
+    this.cloneTo = genericCloneTo;
+    this.clone = genericClone;
+    this.getOutputDir = getOutputDir;
+    this.getCommandLine = getCommandLineLibrarianVC;
+}
+
+function getCommandLineLibrarianVC()
+{
+    var cmdLine = "lib";
+    //nologo
+    if (this.nologo)
+    {
+        cmdLine += " /NOLOGO";
+    }
+    //output
+    if (this.outputFile.length > 0)
+    {
+        cmdLine += " /OUT:\"" + this.getOutputDir() + "\\"
+            + this.outputFile + "\"";
+    }
+    //inputs
+    cmdLine += buildOptionsVC(this.inputFiles, "");
+    return cmdLine;
+}
+
+function writeSolutionSettingsLibrarianVC(vcproj, outDir)
+{
+    vcproj.WriteLine("\t\t\t<Tool")
+    vcproj.WriteLine("\t\t\t\tName=\"VCLibrarianTool\"");
+    vcproj.WriteLine("\t\t\t\tOutputFile=\""
+        + xmlencode(this.getOutputDir() + "\\" + this.outputFile)
+        + "\"/>");
+}
+
+// librarianVC class methods
+LibrarianVC.prototype.cloneTo = genericCloneTo;
+LibrarianVC.prototype.clone = genericClone;
+LibrarianVC.prototype.getOutputDir = getOutputDir;
+LibrarianVC.prototype.getIntermDir = getIntermDir;
+LibrarianVC.prototype.getCommandLine = getCommandLineLibrarianVC;
+LibrarianVC.prototype.writeSolutionSettings =
+                        writeSolutionSettingsLibrarianVC;
+
+
+// CustomBuildVC class
+// .ctor from base CustomBuild
+function CustomBuildVC(customBase)
+{
+    if (!customBase)
+    {
+        customBase = new CustomBuild();
+    }
+    customBase.cloneTo(this);
+
+    this.cloneTo = genericCloneTo;
+    this.clone = genericClone;
+}
+
+function writeSolutionSettingsCustomVC(vcproj, outDir)
+{
+    vcproj.WriteLine("\t\t\t<Tool")
+    vcproj.WriteLine("\t\t\t\tName=\"VCCustomBuildTool\"");
+    vcproj.Write("\t\t\t\tCommandLine=\""
+                    + xmlencode(this.command) + "\"");
+    if (this.output.length > 0)
+    {
+        vcproj.WriteLine("");
+        vcproj.Write("\t\t\t\tOutputs=\"" + this.output + "\"");
+    }
+    var deps = new Array();
+    for (i in this.dependencies)
+    {
+        if (!this.dependencies[i])
+        {
+            deps.push(i);
+        }
+    }
+    if (deps.length > 0)
+    {
+        vcproj.WriteLine("");
+        vcproj.Write("\t\t\t\tAdditionalDependencies=\""
+                        + deps.join(";") + "\"");
+    }
+    vcproj.WriteLine("/>");
+}
+
+CustomBuildVC.prototype.cloneTo = genericCloneTo;
+CustomBuildVC.prototype.clone = genericClone;
+CustomBuildVC.prototype.writeSolutionSettings =
+                            writeSolutionSettingsCustomVC;
+
+// encodes special xml characters
+function xmlencode(str)
+{
+    return str.replace(/\"/g, "&quot;");
+}
+
+//------------------------------------------------
+// FakeLinkerVC class
+// Used in Configure project just to set "Ignore Import library" option
+//------------------------------------------------
+
+// .ctor from base linker
+function FakeLinkerVC()
+{
+    this.base = Tool;
+    this.base(linkerToolName);
+}
+
+function writeSolutionSettingsFakeLinkerVC(vcproj, outDir)
+{
+    vcproj.WriteLine("\t\t\t<Tool")
+    vcproj.WriteLine("\t\t\t\tName=\"VCLinkerTool\"");
+    vcproj.WriteLine("\t\t\t\tIgnoreImportLibrary=\"TRUE\"/>");
+}
+
+// FakeLinkerVC class methods
+FakeLinkerVC.prototype.cloneTo = genericCloneTo;
+FakeLinkerVC.prototype.clone = genericClone;
+FakeLinkerVC.prototype.writeSolutionSettings =
+            writeSolutionSettingsFakeLinkerVC;
+            
+            
+//------------------------------------------------
+// PostBuildVC class
+// Used in Examples projects to copy necessary files
+//------------------------------------------------
+// .ctor from base PostBuild
+function PostBuildVC(postBase)
+{
+    if (!postBase)
+    {
+        postBase = new PostBuild();
+    }
+    postBase.cloneTo(this);
+
+    this.cloneTo = genericCloneTo;
+    this.clone = genericClone;
+}
+
+function writeSolutionSettingsPostBuildVC(vcproj, outDir)
+{
+    vcproj.WriteLine("\t\t\t<Tool")
+    vcproj.WriteLine("\t\t\t\tName=\"VCPostBuildEventTool\"");
+    vcproj.Write("\t\t\t\tCommandLine=\"");
+    for (i in this.commands)
+    {
+        var index = i.indexOf("$");
+        if (index != -1)
+        {
+            vcproj.WriteLine(xmlencode(this.commands[i]));
+        }
+    }
+    vcproj.Write("\"");
+    vcproj.WriteLine("/>");
+}
+
+PostBuildVC.prototype.cloneTo = genericCloneTo;
+PostBuildVC.prototype.clone = genericClone;
+PostBuildVC.prototype.writeSolutionSettings =
+                            writeSolutionSettingsPostBuildVC;
+                            
+                            
+//------------------------------------------------
+// CompilerVC71 class
+//------------------------------------------------
+
+// VC 7.1 compiler options
+// todo: add these options
+// basicRuntimeChecks
+// detect64BitProblems = true | false
+
+// .ctor from base compiler
+function CompilerVC71(compilerVC)
+{
+    if (!compilerVC)
+    {
+        compilerVC = new CompilerVC();
+    }   
+    compilerVC.cloneTo(this);
+    //TODO: add
+    // basicRuntimeChecks
+    // detect64BitProblems = true | false
+    
+    this.cloneTo = genericCloneTo;
+    this.clone = genericClone;  
+    this.getOutputDir = getOutputDir;
+    this.getIntermDir = getIntermDir;
+    //TODO: change this line when new options will be added
+    this.getCommandLine = getCommandLineCompilerVC;
+    this.getPreprocessCommandLine = getPreprocessCommandLineCompilerVC;
+    
+}
+
+//compilerVC class methods
+CompilerVC71.prototype.cloneTo = genericCloneTo;
+CompilerVC71.prototype.clone = genericClone;
+CompilerVC71.prototype.getOutputDir = getOutputDir;
+CompilerVC71.prototype.getIntermDir = getIntermDir;
+//TODO: change this line when new options will be added
+CompilerVC71.prototype.getCommandLine = getCommandLineCompilerVC;
+CompilerVC71.prototype.getPreprocessCommandLine =
+    getPreprocessCommandLineCompilerVC;
+CompilerVC71.prototype.writeSolutionSettings =
+                        writeSolutionSettingsCompilerVC;

Propchange: incubator/stdcxx/trunk/etc/config/windows/msvc-config_classes.js
------------------------------------------------------------------------------
    svn:keywords = Id

Added: incubator/stdcxx/trunk/etc/config/windows/runexamples.wsf
URL: http://svn.apache.org/viewcvs/incubator/stdcxx/trunk/etc/config/windows/runexamples.wsf?rev=349027&view=auto
==============================================================================
--- incubator/stdcxx/trunk/etc/config/windows/runexamples.wsf (added)
+++ incubator/stdcxx/trunk/etc/config/windows/runexamples.wsf Fri Nov 25 14:16:34 2005
@@ -0,0 +1,536 @@
+<?xml version="1.0" ?>
+<package>
+    <comment>
+    PrimalCode wizard generated file.
+    </comment>
+    <job id="runexamples" prompt="no">
+        <?job error="false" debug="false" ?>
+        <runtime>
+            <description>
+runs examples and checks results.
+            </description>
+            <named helpstring="The root directory with executables" 
+                name="EXEDIR" required="true" type="string"/>
+            <named helpstring="The root directory with .in and .out files" 
+                name="INOUTDIR" required="true" type="string"/>
+            <named helpstring="The build type" name="BUILDTYPE" 
+                required="true" type="string"/>
+            <named helpstring="The log file" name="LOGFILE" 
+                required="false" type="string"/>
+            <example>
+            cscript runexamples.wsf /EXEDIR:"C:\stdcxx\build" 
+            /INOUTDIR:"C:\stdcxx\build" /BUILDTYPE:11d
+            </example>
+            <usage>
+Usage: cscript runexamples.wsf /EXEDIR:@EXEDIR /INOUTDIR:@INOUTDIR 
+/BUILDTYPE:@BUILDTYPE [/LOGFILE:@LOGFILE]
+where
+@EXEDIR is the root directory with executables ro be run and checked,
+@TOPDIR is the root directory with .in and .out files 
+required by executables,
+@BUILDTYPE is the build type (11d, 11s, etc).
+@LOGFILE is the log file name.
+            </usage>
+        </runtime>
+        <object id="fso" progid="Scripting.FileSystemObject"/>
+        <object id="WshShell" progid="WScript.Shell"/>
+        <script language="JScript" src="config.js"/>
+        <script language="JScript" src="utilities.js"/>
+        <script language="JScript" src="summary.js"/>
+        <script id="exrunner" language="JScript">
+<![CDATA[
+//
+// Examples running script for stdcxx library
+//
+
+var examplesDir = ""; // path to the root directory containing executables
+var inoutDir = "";    // path to the root directory 
+    // containing the .in and .out files
+var buildType = ""      // the buid type (11d, 11s, etc)
+var logFileName = ""; // the log file name
+var logFileDefault = "runexamples.log"; // the default log file name
+
+var varIn = "in";
+var varOut = "out";
+
+var exRun = 0;
+var exRunSucceeded = 0;
+var exRunFailed = 0;
+var exRunTimedOut = 0;
+var exBadCode = 0;
+
+var runTimeout = 10000; //30000
+var runSleepStep = 100;
+
+var buildlogFile = "BuildLog.htm";
+var summaryFileName = "Summary.htm";
+var htmFolderName = "temphtm";
+    
+var description = new runexamples; // run
+
+function runexamples()
+{
+    readAndCheckArguments();
+    
+    var buildOutDir = examplesDir + "\\" + buildType;
+    if (! fso.FolderExists(buildOutDir))
+        fso.CreateFolder(buildOutDir);
+        
+    var fLog = fso.CreateTextFile(examplesDir + "\\" + logFileName);
+    var fSummary = fso.CreateTextFile(buildOutDir + "\\" + summaryFileName);
+    
+    runAllExamples(examplesDir, inoutDir, fLog, fSummary);
+    
+    WScript.Echo("Total run " + exRun + "; " + exRunSucceeded 
+        + " succeeded, " 
+        +  exRunFailed + " failed, " + exRunTimedOut 
+        + " failed because of timeout, " + exBadCode 
+        + " exited with non-zero code");
+        
+    fLog.WriteLine("Total run " + exRun + "; " + exRunSucceeded 
+        + " succeeded, " 
+        +  exRunFailed + " failed, " + exRunTimedOut 
+        + " failed because of timeout, " + exBadCode
+        + " exited with non-zero code");
+        
+    fLog.Close();
+    fSummary.Close();
+    
+    WScript.Quit(0);
+}
+
+function readAndCheckArguments()
+{
+    if (!WScript.Arguments.Named.Exists("EXEDIR"))
+    {
+        WScript.StdErr.WriteLine(
+            "Generate: Missing required argument EXEDIR.");
+        WScript.Arguments.ShowUsage();
+        WScript.Quit(2);
+    }
+    
+    if (!WScript.Arguments.Named.Exists("INOUTDIR"))
+    {
+        WScript.StdErr.WriteLine(
+            "Generate: Missing required argument INOUTDIR.");
+        WScript.Arguments.ShowUsage();
+        WScript.Quit(2);
+    }
+    
+    if (!WScript.Arguments.Named.Exists("BUILDTYPE"))
+    {
+        WScript.StdErr.WriteLine(
+            "Generate: Missing required argument BUILDTYPE.");
+        WScript.Arguments.ShowUsage();
+        WScript.Quit(2);
+    }
+    
+    examplesDir =  WScript.Arguments.Named("EXEDIR");
+    inoutDir =  WScript.Arguments.Named("INOUTDIR");
+    buildType = WScript.Arguments.Named("BUILDTYPE");
+    
+    if (WScript.Arguments.Named.Exists("LOGFILE"))
+        logFileName = WScript.Arguments.Named("LOGFILE");
+    else
+        logFileName = logFileDefault;
+    
+    if (! fso.FolderExists(examplesDir))
+    {
+        WScript.StdErr.WriteLine(
+            "Generate: Could not find directory " + examplesDir);
+            
+        WScript.Quit(3);
+    }
+    
+    if (! fso.FolderExists(inoutDir))
+    {
+        WScript.StdErr.WriteLine(
+            "Generate: Could not find directory " + inoutDir);
+            
+        WScript.Quit(3);
+    }
+}
+
+function runAllExamples(exeDir, srcDir, fileLog, fileSummary)
+{
+    var exeFolder = fso.GetFolder(exeDir);
+    if (! exeFolder)
+        return;
+        
+    var enumExeSubFolders = new Enumerator(exeFolder.SubFolders);
+    for (; !enumExeSubFolders.atEnd(); enumExeSubFolders.moveNext())
+    {
+        var exeFolderName = enumExeSubFolders.item().Name;
+        
+        var newSrc = srcDir;
+        if (exeFolderName != buildType)
+            newSrc += "\\" + exeFolderName;
+            
+        runAllExamples(exeDir + "\\" + exeFolderName, 
+            newSrc, fileLog, fileSummary);
+    }
+    
+    if (exeFolder.Name != buildType)
+        return;
+    
+    var rx = new RegExp("^.+\\.(?:exe)$", "i");
+    var enumExeFiles = new Enumerator(exeFolder.Files);
+    for (; !enumExeFiles.atEnd(); enumExeFiles.moveNext())
+    {
+        var exeFileName = enumExeFiles.item().Name;
+        if (! rx.test(exeFileName))
+            continue;
+            
+        var htmDir = exeDir + "\\" + htmFolderName;
+        if (! fso.FolderExists(htmDir))
+            fso.CreateFolder(htmDir);
+            
+        var itemInfo = 
+            new ItemBuildInfo(getPureFileName(exeFileName, "exe"));
+            
+        var inData = readInFile(srcDir, exeFileName);
+                
+        var outData = readOutFile(srcDir, exeFileName);
+            
+        // run example
+        var runCmd = exeDir + "\\" + exeFileName;
+        WScript.Echo("running1 " + exeFileName);
+        fileLog.WriteLine("running " + exeFileName);
+            
+        exRun++;
+        
+        if (inData != "" || outData != "")
+            runWithChecks(runCmd, itemInfo, inData, outData, fileLog);
+        else
+            runNoChecks(runCmd, exeFileName, itemInfo, fileLog); 
+            
+        readBuildLog(exeDir, itemInfo);
+        saveBuildInfo(itemInfo, htmDir, "htm"); 
+        saveBuildSummary(itemInfo, fileSummary);
+    }
+}
+
+
+function runNoChecks(cmd, exeFileName, itemInfo, fileLog)
+{
+    var scriptPath = WScript.ScriptFullName;
+    var pathIndex = scriptPath.lastIndexOf(WScript.ScriptName);
+    scriptPath = scriptPath.substr(0, pathIndex);
+        
+    var tempFileName = makeTempFile();
+    var runCmdTimeOut = 7000;
+    
+    var runCmd = "cscript /nologo \"" + scriptPath + "runexe.wsf" + "\"" +
+        " /RUNCMD:\"" + cmd + " < NUL: " + "\"" + 
+        " /OUTFILE:\"" + tempFileName + "\"";
+    
+    var tStartDate = new Date();
+    var tStartTime = tStartDate.getTime();
+    
+    var timeOutOccurred = false;
+    var oExec = WshShell.Exec(runCmd);
+    while (oExec.Status == 0)
+    {   
+        WScript.Sleep(500);
+        
+        var tCurDate = new Date();
+        var tCurTime = tCurDate.getTime();
+        if (tCurTime - tStartTime > runCmdTimeOut)
+        {
+            timeOutOccurred = true;
+            //WScript.Echo("its time to terminate");
+            try
+            {
+                inspectProcesses(exeFileName, true);
+                //WScript.Echo(exeFileName + " terminated");
+                oExec.Terminate();
+                //WScript.Echo("terminated");
+            }
+            catch(e)
+            {
+                WScript.Echo("error during termination");
+            }
+            
+            break;
+        }
+    }
+    
+    if (timeOutOccurred == true)
+        itemInfo.exitCode = 5;
+    else
+        itemInfo.exitCode = oExec.ExitCode;
+        
+    itemInfo.runDiff = "";
+    itemInfo.runOutput = "";
+    
+    //WScript.Echo("run script finished with code " + itemInfo.exitCode);
+    
+    var tFinishDate = new Date();
+    var tFinishTime = tFinishDate.getTime();
+    
+    //WScript.Echo("time difference is " + (tFinishTime - tStartTime));
+    
+    try
+    {   
+        var tempFile = fso.OpenTextFile(tempFileName, 1);
+        
+        var exeOutput = "";
+        if (! tempFile.AtEndOfStream)
+          exeOutput = tempFile.ReadAll();
+            
+        itemInfo.runOutput = exeOutput;
+        //WScript.Echo(itemInfo.runOutput);
+        
+        tempFile.Close();
+        fso.DeleteFile(tempFileName);
+    }
+    catch(e)
+    {
+        WScript.Echo("Could not delete temporary file " + tempFileName);
+    }
+      
+    if (itemInfo.exitCode != 0)
+        exBadCode++;
+  
+    exRunSucceeded++;
+  
+    WScript.Echo("example succeeded! Exit code " + itemInfo.exitCode);
+    fileLog.WriteLine(itemInfo.name + " completed successfully, exit code "
+        + itemInfo.exitCode);
+   
+    WScript.Echo("   ");
+    fileLog.WriteLine(" ");
+}
+
+
+function inspectProcesses(exeName, bKill)
+{
+    var e = new Enumerator(GetObject("winmgmts:").InstancesOf("Win32_process"))
+    
+    for (; !e.atEnd(); e.moveNext())
+    {
+        var Process = e.item();
+        //WScript.echo (Process.Name + "\t" + Process.processid)
+        
+        if (Process.Name == exeName)
+        {
+            if (true == bKill)
+            {
+                //WScript.Echo("find process to be killed: " + exeName);
+                Process.Terminate();
+            }
+        }
+    }
+}
+
+
+/*
+function runNoChecks(cmd, itemInfo, fileLog)
+{
+    // make no input
+    cmd += " < NUL:";
+    
+    var oExec = WshShell.Exec(cmd);
+    if (! oExec)
+    {
+        WScript.Echo(itemInfo.name + " failed to run");
+        return;
+    }
+    
+    var exeOutput = "";
+    var sleeping = 0;
+    while (oExec.Status == 0)
+    {
+        WScript.Sleep(runSleepStep);
+        sleeping += runSleepStep;
+            
+        if (sleeping >= runTimeout)
+        {                       
+            exRunTimedOut++;
+            oExec.Terminate();
+                
+            WScript.Echo("terminated because of timeout");
+            WScript.Echo("   ");
+                
+            fileLog.WriteLine(cmd + " terminated because of timeout");
+            fileLog.WriteLine(" ");
+                
+            itemInfo.exitCode = 5;
+            
+            return;
+        }
+    }
+  
+    var exeOutput = "";
+    if (sleeping < runTimeout)
+        exeOutput += oExec.StdOut.ReadAll();
+        
+    WScript.Echo(exeOutput);
+      
+    if (oExec.ExitCode != 0)
+        exBadCode++;
+      
+    exRunSucceeded++;
+      
+    itemInfo.runOutput = exeOutput;
+    itemInfo.exitCode = oExec.ExitCode;
+    itemInfo.runDiff = "";
+      
+    WScript.Echo("example succeeded! Exit code " + oExec.ExitCode);
+    fileLog.WriteLine(itemInfo.name + " completed successfully, exit code "
+        + oExec.ExitCode);
+       
+    WScript.Echo("   ");
+    fileLog.WriteLine(" ");
+}
+*/
+
+function runWithChecks(cmd, itemInfo, inData, outData, fileLog)
+{
+    if (inData == "")
+        cmd += " < NUL:";
+    
+    var oExec = WshShell.Exec(cmd);
+    if (! oExec)
+    {
+        WScript.Echo(itemInfo.name + " failed to run");
+        return;
+    }
+            
+    if (inData != "")
+    {
+        WScript.Sleep(runSleepStep * 10);
+        oExec.StdIn.Write(inData + "\n" + String.fromCharCode(26) );
+    }
+        
+    var exeOutput = "";
+    var sleeping = 0;
+    while (oExec.Status == 0)
+    {
+        WScript.Sleep(runSleepStep);
+        sleeping += runSleepStep;
+        
+        if (sleeping >= runTimeout)
+        {                       
+            exRunTimedOut++;
+            oExec.Terminate();
+            
+            WScript.Echo("terminated because of timeout");
+            WScript.Echo("   ");
+            
+            fileLog.WriteLine(itemInfo.name + 
+                " terminated because of timeout");
+                
+            fileLog.WriteLine(" ");
+            
+            itemInfo.exitCode = 3;
+        
+            return;
+        }
+    }
+            
+    if (sleeping < runTimeout)
+        exeOutput += oExec.StdOut.ReadAll();
+    
+    var errText = oExec.StdErr.ReadAll();
+    if (errText != "")
+        WScript.Echo(errText);
+    
+    if (oExec.ExitCode != 0)
+        exBadCode++;
+    
+    itemInfo.runOutput = exeOutput;
+    itemInfo.exitCode = oExec.ExitCode;
+    itemInfo.runReqOutput = outData;
+  
+    if (exeOutput == outData)
+    {
+        itemInfo.runDiff = "";
+    
+        exRunSucceeded++;
+        WScript.Echo("example succeeded! Exit code " + oExec.ExitCode);
+        fileLog.WriteLine(itemInfo.name + 
+            " completed successfully, exit code " +
+            oExec.ExitCode);
+    }
+    else
+    {
+        WScript.Echo("example output differs from the expected");
+        getDifferencesInfo(itemInfo);
+    
+        exRunFailed++;
+        WScript.Echo("example failed! Exit code " + oExec.ExitCode);
+        fileLog.WriteLine(itemInfo.name + 
+            " completed with errors, exit code " +
+            oExec.ExitCode);
+    }
+    
+    WScript.Echo("   ");
+    fileLog.WriteLine(" ");
+}
+
+function readAllFromFile(srcDir, exeFileName, nameSuffix)
+{   
+    if (! fso.FolderExists(srcDir))
+        return "";
+        
+    var pureName = getPureFileName(exeFileName, "exe");
+        
+    var someDir = srcDir + "\\" + nameSuffix;
+    if (! fso.FolderExists(someDir))
+        return "";
+        
+    var someFileName = someDir + "\\" + pureName + "." + nameSuffix;
+    if (! fso.FileExists(someFileName))
+        return "";
+        
+    var someFile = fso.OpenTextFile(someFileName);
+    if (! someFile)
+        return "";
+        
+    return (someFile.ReadAll());
+}
+
+function readInFile(srcDir, exeFileName)
+{
+    return readAllFromFile(srcDir, exeFileName, varIn);
+}
+
+function readOutFile(srcDir, exeFileName)
+{
+    var outData = readAllFromFile(srcDir, exeFileName, varOut);
+    
+    var eolStr = String.fromCharCode(13) + String.fromCharCode(10);
+    var idxEOL = outData.indexOf(eolStr);
+    var outBegin = (idxEOL != -1) ? outData.substr(0, idxEOL) : outData;
+    var rgWords = outBegin.split(" ");
+    if (rgWords[0] != "link")
+        return outData;
+    
+    // try to open file using the link
+    var linkedFileName = srcDir + "\\" + varOut + "\\" + rgWords[1];
+    if (! fso.FileExists(linkedFileName))
+        return outData;
+            
+    var linkedFile = fso.OpenTextFile(linkedFileName);
+    if (! linkedFile)
+        return "";
+            
+    return (linkedFile.ReadAll());
+}
+
+function getPureFileName(fileName, fileExtension)
+{   
+    var pureName = fileName;
+    var indexTmp = fileName.lastIndexOf("." + fileExtension);
+    if (indexTmp != -1)
+        pureName = fileName.substr(0, indexTmp);
+        
+    return pureName;
+}
+
+
+]]>
+        </script>
+    </job>
+</package>

Propchange: incubator/stdcxx/trunk/etc/config/windows/runexamples.wsf
------------------------------------------------------------------------------
    svn:keywords = Id

Added: incubator/stdcxx/trunk/etc/config/windows/runexe.wsf
URL: http://svn.apache.org/viewcvs/incubator/stdcxx/trunk/etc/config/windows/runexe.wsf?rev=349027&view=auto
==============================================================================
--- incubator/stdcxx/trunk/etc/config/windows/runexe.wsf (added)
+++ incubator/stdcxx/trunk/etc/config/windows/runexe.wsf Fri Nov 25 14:16:34 2005
@@ -0,0 +1,64 @@
+<?xml version="1.0" ?>
+<package>
+    <comment>
+    PrimalCode wizard generated file.
+    </comment>
+    <job id="doexe" prompt="no">
+        <?job error="false" debug="false" ?>
+        <runtime>
+            <description>
+Helper to run tests.
+            </description>
+            <named helpstring="The cmd to be excuted" 
+                name="RUNCMD" required="true" type="string"/>
+            <named helpstring="The output file name" 
+                name="OUTFILE" required="false" type="string"/>
+            <example>cscript doexe.wsf 
+            </example>
+            <usage>
+cscript doexe.wsf /RUNCMD:@RUNCMD [/OUTFILE:@OUTFILE] where
+@RUNCMD is a command to be executed,
+@OUTFILE is an output file name. If not set, output goes to Stdout
+            </usage>
+        </runtime>
+        <object id="fso" progid="Scripting.FileSystemObject"/>
+        <object id="WshShell" progid="WScript.Shell"/>
+        <script id="doexe" language="JScript">
+<![CDATA[
+//
+// Tests running script
+//
+
+var description = new doexe; // run
+
+function doexe()
+{
+    if (!WScript.Arguments.Named.Exists("RUNCMD"))
+    {
+        WScript.StdErr.WriteLine(
+            "Generate: Missing required argument RUNCMD.");
+        WScript.Arguments.ShowUsage();
+        WScript.Quit(2);
+    }
+    
+    var runCmd = WScript.Arguments.Named("RUNCMD");
+    var outFileName = "";
+    if (WScript.Arguments.Named.Exists("OUTFILE"))
+    {
+        outFileName = WScript.Arguments.Named("OUTFILE");
+    }
+    
+    var cmd = "cmd /C \"" + runCmd;
+    if (outFileName != "")
+        cmd += " > " + outFileName;
+    cmd += "\"";
+    
+    var res = WshShell.Run(cmd, 7, true);
+            
+    WScript.Quit(res);
+}
+
+]]>
+        </script>
+    </job>
+</package>

Propchange: incubator/stdcxx/trunk/etc/config/windows/runexe.wsf
------------------------------------------------------------------------------
    svn:keywords = Id



Mime
View raw message