You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@stdcxx.apache.org by Farid Zaripov <Fa...@kyiv.vdiweb.com> on 2006/08/09 19:08:03 UTC

[PATCH] Windows infrastructure for generating VisualStudio projects and solution(s)

   Attached is the update of the script files for generating
VisualStudio projects and solution(s). Added generation of the
exec, locale and localedef projects.

   ChangeLog:
   * generate.wsf: Added code to create the %BUILDDIR%/util directory.
   * generate.js: Added code for generating the exec, locale and
   localedef projects.
   * data.js: Ditto.
   * msvc-config.js: Ditto.
   * icc-config.js: Ditto.


   GNUmakefile.bin, in addition to compile the exec, locale and
localedef executables, also builds the locales:

GNUmakefile.bin:
-----
# build all locales with the localedef utility
locales: localedef $(LOCALE_LIST)

   Should we have the similar functionality on the Windows platform?

Farid.

Re: [PATCH] Windows infrastructure for generating VisualStudio projects and solution(s)

Posted by Martin Sebor <se...@roguewave.com>.
Andrew Black wrote:
[...]
> The first observation is that %BUILDDIR%\bin might be a better place to 
> place the utilities than %BUILDDIR%\util.  The reason I feel this would 
> be a better location is so that it would mirror the file system 
> structure generated by the GNU makefiles.

Agreed.

> 
> The second observation is that it might make sense to have a .utils or 
> .stdlib_utils project, similar to how there are a .stdlib_examples 
> project for the examples and a .stdlib_tests project for the tests. This 
> project likely wouldn't do anything when run, but it would provide a 
> convenient way to build all the utilities (and possibly the locales) in 
> one shot.

Also agreed (noting that the names should be stdcxx_xxx rather
than stdlib_xxx).

> 
> The final observation is that the exec utility is written as a C 
> program, although one masquerading as a C++ program, and it has no 
> reliance on the C++ headers or the standard library.  I suspect removing 
> the dependencies from the project would be something of a hassle, but it 
> probably should be considered.

Yes, I would like that. The one dependency that we might want to
keep is on the generated config.h header since we might need to
make use of some of the config macros. (And as I mentioned
previously I'd still like to rename config.h so as to include
the the build type (and perhaps also the name of the compiler)
so we can have more than one configuration exist in the same
directory.

> 
> With regards to the GNU makefile infrastructure, there actually are two 
> different ways to build locales inside the infrastructure.
> One way is by specifying a target similar to 'en_US.ISO-8859-1' or 
> 'sr_YU.ISO-8859-5@cyrillic'.  This will build the locale specified with 
> the localedef utility, placing the results in the nls subdirectory of 
> the build directory.

Correct. We should have an nls/ subdirectory on Windows as well
and have localedef build the locales there. Users will then be
able to take the nls/ directory and move it to their preferred
location for their locales.

> The second method is through the locale shell scripts (named like 
> 'en_US.ISO-8859-1.sh' or 'sr_YU.ISO-8859-5@cyrillic.sh').  These scripts 
> are generated by the GNU makefile infrastructure.  They are used to 
> check that the locales build correctly, producing output with a summary 
> section similar to that of the test suite.
> For end users, it would likely be more useful to have the former 
> ability, while developers would likely find the later to be of more use.

This is just for testing. These locales should be built in the
TMP (or TEMP) directory and deleted when the tests are done.

Martin

Re: [PATCH] Windows infrastructure for generating VisualStudio projects and solution(s)

Posted by Andrew Black <ab...@roguewave.com>.
Greetings Farid

I have tried using your patch along with my port of the exec utility, 
and the generated project is a near match to the one I had been using 
for my development.  I have a few observations about the patch.

The first observation is that %BUILDDIR%\bin might be a better place to 
place the utilities than %BUILDDIR%\util.  The reason I feel this would 
be a better location is so that it would mirror the file system 
structure generated by the GNU makefiles.

The second observation is that it might make sense to have a .utils or 
.stdlib_utils project, similar to how there are a .stdlib_examples 
project for the examples and a .stdlib_tests project for the tests. 
This project likely wouldn't do anything when run, but it would provide 
a convenient way to build all the utilities (and possibly the locales) 
in one shot.

The final observation is that the exec utility is written as a C 
program, although one masquerading as a C++ program, and it has no 
reliance on the C++ headers or the standard library.  I suspect removing 
the dependencies from the project would be something of a hassle, but it 
probably should be considered.

With regards to the GNU makefile infrastructure, there actually are two 
different ways to build locales inside the infrastructure.
One way is by specifying a target similar to 'en_US.ISO-8859-1' or 
'sr_YU.ISO-8859-5@cyrillic'.  This will build the locale specified with 
the localedef utility, placing the results in the nls subdirectory of 
the build directory.
The second method is through the locale shell scripts (named like 
'en_US.ISO-8859-1.sh' or 'sr_YU.ISO-8859-5@cyrillic.sh').  These scripts 
are generated by the GNU makefile infrastructure.  They are used to 
check that the locales build correctly, producing output with a summary 
section similar to that of the test suite.
For end users, it would likely be more useful to have the former 
ability, while developers would likely find the later to be of more use.

--Andrew Black

Farid Zaripov wrote:
>   Attached is the update of the script files for generating
> VisualStudio projects and solution(s). Added generation of the
> exec, locale and localedef projects.
> 
>   ChangeLog:
>   * generate.wsf: Added code to create the %BUILDDIR%/util directory.
>   * generate.js: Added code for generating the exec, locale and
>   localedef projects.
>   * data.js: Ditto.
>   * msvc-config.js: Ditto.
>   * icc-config.js: Ditto.
> 
> 
>   GNUmakefile.bin, in addition to compile the exec, locale and
> localedef executables, also builds the locales:
> 
> GNUmakefile.bin:
> -----
> # build all locales with the localedef utility
> locales: localedef $(LOCALE_LIST)
> 
>   Should we have the similar functionality on the Windows platform?
> 
> Farid.

Re: [PATCH] Windows infrastructure for generating VisualStudio projects and solution(s)

Posted by Martin Sebor <se...@roguewave.com>.
Farid Zaripov wrote:
>   Attached is the update of the script files for generating
> VisualStudio projects and solution(s). Added generation of the
> exec, locale and localedef projects.

Wow! That's some speed! :) Just a few comments/questions below...

> 
>   ChangeLog:
>   * generate.wsf: Added code to create the %BUILDDIR%/util directory.

Like Andrew, I would also suggest to stick to the same names
as in the UNIX case (we have TOPDIR/util but BUILDDIR/bin).

As I might have already mentioned, we should probably reorg
the directory structure a bit so as not to have all the utils
in the same directory. Sooner or later we'd run into name
clashes, and even if not, having each utility sources live
in its own directory (except locale and localedef where there
is a lot of overlap) will make it easier to manage each of
them. (This is just a heads up on changes to come; we need
to first decide on the exact structure we want.)


>   * generate.js: Added code for generating the exec, locale and
>   localedef projects.

I see you added a new function, addProjects. Please make sure
you document each new function or important variable in your
ChangeLog.

>   * data.js: Ditto.

Would it make sense to make projectConfUtilsDebugStatic and all
the other variables a single array?

Thanks
Martin

>   * msvc-config.js: Ditto.
>   * icc-config.js: Ditto.
> 
> 
>   GNUmakefile.bin, in addition to compile the exec, locale and
> localedef executables, also builds the locales:
> 
> GNUmakefile.bin:
> -----
> # build all locales with the localedef utility
> locales: localedef $(LOCALE_LIST)
> 
>   Should we have the similar functionality on the Windows platform?

As Andrew already mentioned, locales get built in two ways. One
is when testing them (using the generated locale.sh scripts) and
the other via the locales target above. I assume we'll have
a VisualStudio project to build each locale from the locale list
(just as we do for each example and test). To test our ability
to build the locales I would suggest to provide a separate
project along the lines of stdlib_examples or stdlib_tests.

Incidentally, while you are making changes in this area, could
you please change "stdlib_" to "stdcxx_" in all these (if they're
still there -- I haven't actually looked yet).

Thanks
Martin

> 
> Farid.
> 
> 
> ------------------------------------------------------------------------
> 
> Index: data.js
> ===================================================================
> --- data.js	(revision 429988)
> +++ data.js	(working copy)
> @@ -156,6 +156,42 @@
>                              , confMTReleaseDllName);
>                              
>  ///////////////////////////////////////////////////////////////////
> +// Utils template project
> +var projectUtilsName = "Utils";
> +
> +var projectConfUtilsDebugStatic =
> +    new ProjectConfiguration(projectUtilsName, platformWin32Name
> +                            , confDebugStaticName);
> +                            
> +var projectConfUtilsReleaseStatic =
> +    new ProjectConfiguration(projectUtilsName, platformWin32Name
> +                            , confReleaseStaticName);
> +                            
> +var projectConfUtilsMTDebugStatic =
> +    new ProjectConfiguration(projectUtilsName, platformWin32Name
> +                            , confMTDebugStaticName);
> +                            
> +var projectConfUtilsMTReleaseStatic =
> +    new ProjectConfiguration(projectUtilsName, platformWin32Name
> +                            , confMTReleaseStaticName);
> +                            
> +var projectConfUtilsDebugDll =
> +    new ProjectConfiguration(projectUtilsName, platformWin32Name
> +                            , confDebugDllName);
> +
> +var projectConfUtilsReleaseDll =
> +    new ProjectConfiguration(projectUtilsName, platformWin32Name
> +                            , confReleaseDllName);
> +                            
> +var projectConfUtilsMTDebugDll =
> +    new ProjectConfiguration(projectUtilsName, platformWin32Name
> +                            , confMTDebugDllName);
> +
> +var projectConfUtilsMTReleaseDll =
> +    new ProjectConfiguration(projectUtilsName, platformWin32Name
> +                            , confMTReleaseDllName);
> +
> +///////////////////////////////////////////////////////////////////
>  // rwtest project
>  var projectRwTestName = ".rwtest";
>  
> @@ -288,6 +324,10 @@
>      projectConfTestsDebugStatic);
>      
>  solutionConfDebugStatic.projectConfigurations.add(
> +    projectConfUtilsDebugStatic.projectName, 
> +    projectConfUtilsDebugStatic);
> +    
> +solutionConfDebugStatic.projectConfigurations.add(
>      projectConfRunExamplesDebugStatic.projectName, 
>      projectConfRunExamplesDebugStatic);
>      
> @@ -317,6 +357,10 @@
>      projectConfTestsReleaseStatic);
>      
>  solutionConfReleaseStatic.projectConfigurations.add(
> +    projectConfUtilsReleaseStatic.projectName, 
> +    projectConfUtilsReleaseStatic);
> +    
> +solutionConfReleaseStatic.projectConfigurations.add(
>      projectConfRunExamplesReleaseStatic.projectName, 
>      projectConfRunExamplesReleaseStatic);
>      
> @@ -345,6 +389,10 @@
>      projectConfTestsMTDebugStatic);
>      
>  solutionConfMTDebugStatic.projectConfigurations.add(
> +    projectConfUtilsMTDebugStatic.projectName, 
> +    projectConfUtilsMTDebugStatic);
> +    
> +solutionConfMTDebugStatic.projectConfigurations.add(
>      projectConfRunExamplesMTDebugStatic.projectName, 
>      projectConfRunExamplesMTDebugStatic);
>      
> @@ -373,6 +421,10 @@
>      projectConfTestsMTReleaseStatic);
>      
>  solutionConfMTReleaseStatic.projectConfigurations.add(
> +    projectConfUtilsMTReleaseStatic.projectName, 
> +    projectConfUtilsMTReleaseStatic);
> +    
> +solutionConfMTReleaseStatic.projectConfigurations.add(
>      projectConfRunExamplesMTReleaseStatic.projectName, 
>      projectConfRunExamplesMTReleaseStatic);
>      
> @@ -401,6 +453,10 @@
>      projectConfTestsDebugDll);
>      
>  solutionConfDebugDll.projectConfigurations.add(
> +    projectConfUtilsDebugDll.projectName, 
> +    projectConfUtilsDebugDll);
> +    
> +solutionConfDebugDll.projectConfigurations.add(
>      projectConfRunExamplesDebugDll.projectName, 
>      projectConfRunExamplesDebugDll);
>      
> @@ -429,6 +485,10 @@
>      projectConfTestsReleaseDll);
>      
>  solutionConfReleaseDll.projectConfigurations.add(
> +    projectConfUtilsReleaseDll.projectName, 
> +    projectConfUtilsReleaseDll);
> +    
> +solutionConfReleaseDll.projectConfigurations.add(
>      projectConfRunExamplesReleaseDll.projectName, 
>      projectConfRunExamplesReleaseDll);
>      
> @@ -458,6 +518,10 @@
>      projectConfTestsMTDebugDll);
>      
>  solutionConfMTDebugDll.projectConfigurations.add(
> +    projectConfUtilsMTDebugDll.projectName, 
> +    projectConfUtilsMTDebugDll);
> +    
> +solutionConfMTDebugDll.projectConfigurations.add(
>      projectConfRunExamplesMTDebugDll.projectName, 
>      projectConfRunExamplesMTDebugDll);
>      
> @@ -486,6 +550,10 @@
>      projectConfTestsMTReleaseDll);
>      
>  solutionConfMTReleaseDll.projectConfigurations.add(
> +    projectConfUtilsMTReleaseDll.projectName, 
> +    projectConfUtilsMTReleaseDll);
> +    
> +solutionConfMTReleaseDll.projectConfigurations.add(
>      projectConfRunExamplesMTReleaseDll.projectName, 
>      projectConfRunExamplesMTReleaseDll);
>      
> @@ -537,6 +605,9 @@
>  projectTests.dependencies.add(projectRwTestName, projectRwTest);
>  solution.projects.add(projectTests.name, projectTests);
>  
> +var projectUtils = new Project(projectUtilsName);
> +solution.projects.add(projectUtils.name, projectUtils);
> +
>  var projectRunExamples = new Project(projectRunExamplesName);
>  solution.projects.add(projectRunExamples.name, projectRunExamples);
>  
> @@ -735,6 +806,66 @@
>      confTstMTReleaseDll.name, confTstMTReleaseDll);
>  
>  
> +// for utils
> +projectUtils.platforms.add(platformWin32Ex.name, platformWin32Ex);
> +
> +var confUtlDebugStatic = 
> +    new Configuration(
> +        confDebugStaticName, configTypeExe,
> +        confDebugStaticOut, confDebugStaticOut);
> +platformWin32Ex.configurations.add(
> +    confUtlDebugStatic.name, confUtlDebugStatic);
> +
> +var confUtlReleaseStatic = 
> +    new Configuration(
> +        confReleaseStaticName, configTypeExe,
> +        confReleaseStaticOut, confReleaseStaticOut);
> +platformWin32Ex.configurations.add(
> +    confUtlReleaseStatic.name, confUtlReleaseStatic);
> +
> +var confUtlMTDebugStatic = 
> +    new Configuration(
> +        confMTDebugStaticName, configTypeExe,
> +        confMTDebugStaticOut, confMTDebugStaticOut);
> +platformWin32Ex.configurations.add(
> +    confUtlMTDebugStatic.name, confUtlMTDebugStatic);
> +
> +var confUtlMTReleaseStatic = 
> +    new Configuration(
> +        confMTReleaseStaticName, configTypeExe,
> +        confMTReleaseStaticOut, confMTReleaseStaticOut);
> +platformWin32Ex.configurations.add(
> +    confUtlMTReleaseStatic.name, confUtlMTReleaseStatic);
> +
> +var confUtlDebugDll = 
> +    new Configuration(
> +        confDebugDllName, configTypeExe,
> +        confDebugDllOut, confDebugDllOut);
> +platformWin32Ex.configurations.add(
> +    confUtlDebugDll.name, confUtlDebugDll);
> +
> +var confUtlReleaseDll = 
> +    new Configuration(
> +        confReleaseDllName, configTypeExe,
> +        confReleaseDllOut, confReleaseDllOut);
> +platformWin32Ex.configurations.add(
> +    confUtlReleaseDll.name, confUtlReleaseDll);
> +    
> +var confUtlMTDebugDll = 
> +    new Configuration(
> +        confMTDebugDllName, configTypeExe,
> +        confMTDebugDllOut, confMTDebugDllOut);
> +platformWin32Ex.configurations.add(
> +    confUtlMTDebugDll.name, confUtlMTDebugDll);
> +
> +var confUtlMTReleaseDll = 
> +    new Configuration(
> +        confMTReleaseDllName, configTypeExe,
> +        confMTReleaseDllOut, confMTReleaseDllOut);
> +platformWin32Ex.configurations.add(
> +    confUtlMTReleaseDll.name, confUtlMTReleaseDll);
> +
> +
>  // for rwtest
>  projectRwTest.platforms.add(platformWin32Rw.name, platformWin32Rw);
>  
> 
> 
> ------------------------------------------------------------------------
> 
> Index: generate.js
> ===================================================================
> --- generate.js	(revision 429988)
> +++ generate.js	(working copy)
> @@ -24,10 +24,14 @@
>  var testsProjectsPrefix = "test_";
>  var testsProjectFolder = "tests";
>  
> +var utilsProjectsPrefix = "utils_";
> +var utilsProjectFolder = "util";
> +
>  var defineRWSHARED = "_RWSHARED";
>  
>  var samplesDir = "examples";
>  var testsDir = "tests";
> +var utilsDir = "util";
>  var libOutputDir = "..\\lib";
>  
>  var logFile = null;
> @@ -36,6 +40,163 @@
>  
>  var iccConversionUtility = "ICProjConvert90.exe";
>  
> +var srcFilterUUID = "{4FC737F1-C7A5-4376-A066-2A32D752A2FF}";
> +var incFilterUUID = "{93995380-89BD-4b04-88EB-625FBE52EBFB}";
> +
> +function addProject(result, solution, srcDir, 
> +                    projectTemplateName, projectNamePrefix, projectFolder,
> +                    projectName, projectSrcFiles, projectIncFiles,
> +                    includeOffset, oldProjects)
> +{
> +    var justUpdate = false;
> +    if (oldProjects != null)
> +    {
> +        var prjOldTmp = oldProjects[projectName];
> +        if (prjOldTmp != null)
> +            justUpdate = true;
> +    }
> +            
> +    if (justUpdate)
> +    {
> +        logFile.WriteLine("Checking " + projectName);
> +        WScript.Echo("  Checking " + projectName + "...");
> +    }
> +    else
> +    {
> +        logFile.WriteLine("Creating " + projectName);
> +        WScript.Echo("  Creating " + projectName + "...");
> +    }
> +
> +    var project = 
> +        solution.projects[projectTemplateName].shallowClone();
> +            
> +    project.name = projectNamePrefix + projectName;
> +    project.folder = projectFolder;
> +    
> +    if (justUpdate)
> +        project.id = oldProjects[projectName].id;
> +    else
> +        project.id = createUUID();
> +
> +    project.dependencies.add(projectStdLibName);
> +    project.platforms = 
> +        solution.projects[projectTemplateName].platforms.clone();
> +    
> +    if (justUpdate)
> +    {
> +        result.projects.add(projectName, project); 
> +        return;
> +    }
> +
> +    if (projectSrcFiles && 0 < projectSrcFiles.length)
> +    {
> +        var filter = new Filter("Source Files");
> +        filter.filter = "cpp;c;cxx;s;cc";
> +        filter.id = srcFilterUUID;
> +
> +        for (i = 0; i < projectSrcFiles.length; ++i)
> +        {
> +            var fileName = projectSrcFiles[i];
> +            filter.sourceFiles.add(fileName, false);
> +        }
> +
> +        project.sourceFiles.add(filter.name, filter);
> +    }
> +
> +    if (projectIncFiles && 0 < projectIncFiles.length)
> +    {
> +        var filter = new Filter("Header Files");
> +        filter.filter = "h;hpp;hxx";
> +        filter.id = incFilterUUID;
> +
> +        for (i = 0; i < projectIncFiles.length; ++i)
> +        {
> +            var fileName = projectIncFiles[i];
> +            filter.sourceFiles.add(fileName, false);
> +        }
> +
> +        project.sourceFiles.add(filter.name, filter);
> +    }
> +
> +    for (i in project.platforms)
> +    {
> +        var platform = project.platforms[i];
> +        if (! platform || ! platform.configurations)
> +        {
> +            continue;
> +        }
> +        
> +        for (j in platform.configurations)
> +        {
> +            var config = platform.configurations[j];
> +            if (! config || ! config.tools)
> +            {
> +                continue;
> +            }
> +            
> +            var oldCompiler = config.tools[compilerToolName];
> +            var newCompiler = oldCompiler.clone();
> +            for (k in oldCompiler.includeDirectories)
> +            {
> +                if (!oldCompiler.includeDirectories[k])
> +                {
> +                    newCompiler.includeDirectories.func_remove(k);
> +                }
> +            }
> +            
> +            for (m in oldCompiler.includeDirectories)
> +            {
> +                if (!oldCompiler.includeDirectories[m])
> +                {
> +                    var findex = m.indexOf(varSign);
> +                    if (findex == 0)
> +                    {
> +                        newCompiler.includeDirectories.add(
> +                            varSign + includeOffset + 
> +                            m.substr(varSign.length));
> +                    }
> +                    else
> +                    {
> +                        newCompiler.includeDirectories.add(
> +                            includeOffset + m);
> +                    }
> +                }
> +            }
> +            
> +            var postBuildTool = config.tools[postBuildToolName];
> +            if (postBuildTool)
> +            {
> +                if (true == copyDll)
> +                {
> +                    var libPrj = result.projects[projectStdLibName];
> +                    var libPlatform = libPrj.platforms[platform.name];
> +                    var libConfig = 
> +                        libPlatform.configurations[config.name];
> +                    var dllName = 
> +                        libConfig.tools[linkerToolName].outputFile;
> +                    var cmdCopyDll = "copy /Y " + includeOffset + 
> +                        "..\\lib" + "\\" + dllName + " $(OutDir)\\" + 
> +                        dllName;
> +                        
> +                    postBuildTool.commands.func_remove(varCmdCopyDll);
> +                    postBuildTool.commands.add(
> +                        varCmdCopyDll, cmdCopyDll);
> +                }
> +                else
> +                {
> +                    config.tools.func_remove(postBuildToolName);
> +                }
> +            }
> +            
> +            config.tools.func_remove(compilerToolName);
> +            config.tools.add(compilerToolName, newCompiler);
> +        }
> +    }
> +
> +    result.projects.add(projectName, project);     
> +    logFile.WriteLine(projectName + " created");   
> +}
> +
>  function fillProjectsFromFolders(result, solution, srcDir, 
>                      projectTemplateName, projectNamePrefix, projectFolder, 
>                      includeOffset, excludedFolders, excludedFiles,
> @@ -62,8 +223,6 @@
>              oldProjects);
>      }
>      
> -    var libPrj = result.projects[projectStdLibName];
> -    
>      var rx = new RegExp("^.+\\.(?:cpp)$", "i");
>      var enumFiles = new Enumerator(folder.Files);
>      for (; !enumFiles.atEnd(); enumFiles.moveNext())
> @@ -77,126 +236,12 @@
>              }
>              
>              var lastPoint = fileName.lastIndexOf(".");
> -            var prjName = projectNamePrefix + fileName.substr(0, lastPoint);
>              var pureName = fileName.substr(0, lastPoint);
> -            
> -            var justUpdate = false;
> -            if (oldProjects != null)
> -            {
> -                var prjOldTmp = oldProjects[pureName];
> -                if (prjOldTmp != null)
> -                    justUpdate = true;
> -            }
> -            
> -            if (justUpdate)
> -            {
> -                logFile.WriteLine("Checking " + pureName);
> -                WScript.Echo("  Checking " + pureName + "...");
> -            }
> -            else
> -            {
> -                logFile.WriteLine("Creating " + pureName);
> -                WScript.Echo("  Creating " + pureName + "...");
> -            }
> -            
> -            var project = 
> -                solution.projects[projectTemplateName].shallowClone();
> -            project.name = prjName;
> -            project.folder = projectFolder;
> -            
> -            if (justUpdate)
> -                project.id = oldProjects[pureName].id;
> -            else
> -                project.id = createUUID();
> -
> -            project.dependencies.add(projectStdLibName);
> -            project.platforms = 
> -                solution.projects[projectTemplateName].platforms.clone();
> -            
> -            if (justUpdate)
> -            {
> -                result.projects.add(pureName, project); 
> -                continue;
> -            }
> -            
> -            project.sourceFiles.add(fileName, false);
> -            
> -            for (i in project.platforms)
> -            {
> -                var platform = project.platforms[i];
> -                if (! platform || ! platform.configurations)
> -                {
> -                    continue;
> -                }
> -                
> -                for (j in platform.configurations)
> -                {
> -                    var config = platform.configurations[j];
> -                    if (! config || ! config.tools)
> -                    {
> -                        continue;
> -                    }
> -                    
> -                    var oldCompiler = config.tools[compilerToolName];
> -                    var newCompiler = oldCompiler.clone();
> -                    for (k in oldCompiler.includeDirectories)
> -                    {
> -                        if (!oldCompiler.includeDirectories[k])
> -                        {
> -                            newCompiler.includeDirectories.func_remove(k);
> -                        }
> -                    }
> -                    
> -                    for (m in oldCompiler.includeDirectories)
> -                    {
> -                        if (!oldCompiler.includeDirectories[m])
> -                        {
> -                            var findex = m.indexOf(varSign);
> -                            if (findex == 0)
> -                            {
> -                                newCompiler.includeDirectories.add(
> -                                    varSign + includeOffset + 
> -                                    m.substr(varSign.length));
> -                            }
> -                            else
> -                            {
> -                                newCompiler.includeDirectories.add(
> -                                    includeOffset + m);
> -                            }
> -                        }
> -                    }
> -                    
> -                    var postBuildTool = config.tools[postBuildToolName];
> -                    if (postBuildTool)
> -                    {
> -                        if (true == copyDll)
> -                        {
> -                            var libPlatform = libPrj.platforms[platform.name];
> -                            var libConfig = 
> -                                libPlatform.configurations[config.name];
> -                            var dllName = 
> -                                libConfig.tools[linkerToolName].outputFile;
> -                            var cmdCopyDll = "copy /Y " + includeOffset + 
> -                                "..\\lib" + "\\" + dllName + " $(OutDir)\\" + 
> -                                dllName;
> -                                
> -                            postBuildTool.commands.func_remove(varCmdCopyDll);
> -                            postBuildTool.commands.add(
> -                                varCmdCopyDll, cmdCopyDll);
> -                        }
> -                        else
> -                        {
> -                            config.tools.func_remove(postBuildToolName);
> -                        }
> -                    }
> -                    
> -                    config.tools.func_remove(compilerToolName);
> -                    config.tools.add(compilerToolName, newCompiler);
> -                }
> -            }
> -            
> -            result.projects.add(pureName, project);     
> -            logFile.WriteLine(pureName + " created");   
> +            var srcFiles = new Array(fileName);
> +            var incFiles = new Array;
> +            addProject(result, solution, srcDir, 
> +                projectTemplateName, projectNamePrefix, projectFolder,
> +                pureName, srcFiles, incFiles, includeOffset, oldProjects);
>          }   
>      }
>  }
> @@ -235,6 +280,104 @@
>  }
>  
>  
> +// checks if all files in files array are exists in folder srcDir
> +function CheckFiles(srcDir, files, projectName)
> +{
> +    if (!files || 0 >= files.length)
> +        return;
> +
> +    for (i = 0; i < files.length; ++i)
> +    {
> +        var fileName = srcDir + "\\" + files[i];
> +        if (!fso.FileExists(fileName))
> +        {
> +            WScript.StdErr.WriteLine("Generate: Fatal error: "
> +                + "File "+ fileName + " of project "
> +                + projectName + " does not exist");
> +            WScript.Quit(3);
> +        }
> +    }
> +}
> +
> +
> +// creates utils projects in a real solution
> +function fillSolutionWithUtils(result, solution, srcDir, oldProjects)
> +{
> +    var utlDir = srcDir + utilsDir;
> +
> +    var includeOffset = "";
> +
> +    // generate exec.vcproj
> +    {
> +        var projectName = "exec";
> +
> +        var srcFiles = new Array("cmdopt.cpp", "exec.cpp",
> +            "output.cpp", "runall.cpp", "util.cpp");
> +
> +        CheckFiles(utlDir, srcFiles, projectName);
> +    
> +        var incFiles = new Array("exec.h", "cmdopt.h",
> +            "output.h", "util.h");
> +    
> +        CheckFiles(utlDir, incFiles, projectName);
> +
> +        addProject(result, solution, utlDir, 
> +            projectUtilsName, utilsProjectsPrefix, utilsDir,
> +            projectName, srcFiles, incFiles,
> +            includeOffset, oldProjects);
> +    }
> +
> +    // iconv.cpp
> +    // generate localedef.vcproj
> +    {
> +        var projectName = "localedef";
> +
> +        var srcFiles = new Array("aliases.cpp", "charmap.cpp",
> +            "codecvt.cpp", "collate.cpp", "ctype.cpp", "def.cpp",
> +            "diagnostic.cpp", "localedef.cpp", "messages.cpp",
> +            "monetary.cpp", "numeric.cpp", "path.cpp", "scanner.cpp",
> +            "time.cpp");
> +    
> +        CheckFiles(utlDir, srcFiles, projectName);
> +
> +        var incFiles = new Array("aliases.h", "charmap.h",
> +            "def.h", "diagnostic.h", "loc_exception.h",
> +            "localedef.h", "path.h", "scanner.h");
> +    
> +        CheckFiles(utlDir, incFiles, projectName);
> +
> +        addProject(result, solution, utlDir, 
> +            projectUtilsName, utilsProjectsPrefix, utilsDir,
> +            projectName, srcFiles, incFiles,
> +            includeOffset, oldProjects);
> +    }
> +
> +    // generate locale.vcproj
> +    {
> +        var projectName = "locale";
> +
> +        var srcFiles = new Array("aliases.cpp", "charmap.cpp",
> +            "codecvt.cpp", "collate.cpp", "ctype.cpp", "def.cpp",
> +            "diagnostic.cpp", "locale.cpp", "memchk.cpp",
> +            "messages.cpp", "monetary.cpp", "numeric.cpp",
> +            "path.cpp", "scanner.cpp", "time.cpp");
> +
> +        CheckFiles(utlDir, srcFiles, projectName);
> +
> +        var incFiles = new Array("aliases.h", "charmap.h",
> +            "def.h", "diagnostic.h", "loc_exception.h",
> +            "memchk.h", "path.h", "scanner.h");
> +
> +        CheckFiles(utlDir, incFiles, projectName);
> +
> +        addProject(result, solution, utlDir, 
> +            projectUtilsName, utilsProjectsPrefix, utilsDir,
> +            projectName, srcFiles, incFiles,
> +            includeOffset, oldProjects);
> +    }
> +}
> +
> +
>  function updateSolutionProjectConfiguration(result, 
>      projectTemplateName, projectNamePrefix) 
>  {
> @@ -382,7 +525,8 @@
>              }
>              
>              if (projName == projectExamplesName || 
> -                projName == projectTestsName)
> +                projName == projectTestsName    ||
> +                projName == projectUtilsName)
>              {
>                  continue;
>              }
> @@ -663,7 +807,7 @@
>      
>      WScript.Echo("Library and configure projects are created");
>      logFile.WriteLine("Library and configure projects are created");
> -    
> +
>      logFile.WriteLine("Creating examples");
>      WScript.Echo("Creating examples...");
>      fillSolutionWithSamples(result, solution, srcDir, null);
> @@ -681,11 +825,21 @@
>      logFile.WriteLine("Configuring tests");
>      updateSolutionProjectConfiguration(result, 
>          projectTestsName, testsProjectsPrefix);
> +
> +    logFile.WriteLine("Creating utils");
> +    WScript.Echo("Creating utils...");
> +    fillSolutionWithUtils(result, solution, srcDir, null);
>      
> +    WScript.Echo("Configuring utils...");
> +    logFile.WriteLine("Configuring utils");
> +    updateSolutionProjectConfiguration(result, 
> +        projectUtilsName, utilsProjectsPrefix);
> +    
>      logFile.WriteLine("Clearing temporary data");
>      WScript.Echo("Clearing temporary data...");
>      removeProjectTemplates(result, projectExamplesName);
>      removeProjectTemplates(result, projectTestsName);
> +    removeProjectTemplates(result, projectUtilsName);
>      
>      return result;
>  }
> @@ -694,7 +848,7 @@
>  {
>      var filter = createFilter(projectDir, offsetDir, 
>          "Source Files", "cpp;c;cxx;s;cc", /^.+\.cc|.+\.c$/i);
> -    filter.id = "{4FC737F1-C7A5-4376-A066-2A32D752A2FF}";
> +    filter.id = srcFilterUUID;
>      return filter;
>  }
>  
> @@ -702,7 +856,7 @@
>  {
>      var filter = createFilter(projectDir, offsetDir, 
>          "Source Files", "cpp;cxx;s", /^.+\.cc|.+\.c$/i);
> -    filter.id = "{4FC737F1-C7A5-4376-A066-2A32D752A2FF}";
> +    filter.id = srcFilterUUID;
>      return filter;
>  }
>  
> @@ -710,7 +864,7 @@
>  {
>      var filter = createFilter(projectDir, offsetDir, 
>          "Header Files", "h;hpp;hxx;c;cc", /^.+\.cc?/i);
> -    filter.id = "{93995380-89BD-4b04-88EB-625FBE52EBFB}";
> +    filter.id = incFilterUUID;
>      return filter;  
>  }
>  
> @@ -723,7 +877,7 @@
>  {
>      var filter = createFilter(projectDir, offsetDir, 
>          "Source Files", "cpp;c;cxx;s;cc", /^.+\.cc|.+\.c|.+\.cpp|.+\.cxx$/i);
> -    filter.id = "{4FC737F1-C7A5-4376-A066-2A32D752A2FF}";
> +    filter.id = srcFilterUUID;
>      return filter;
>  }
>  
> @@ -731,7 +885,7 @@
>  {
>      var filter = createFilter(projectDir, offsetDir, 
>          "Header Files", "h;hpp;hxx", /^.+\.cc|.+\.c|.+\.hpp|.+\.hxx$/i);
> -    filter.id = "{93995380-89BD-4b04-88EB-625FBE52EBFB}";
> +    filter.id = incFilterUUID;
>      return filter;
>  }
>  
> @@ -962,7 +1116,8 @@
>              }
>              
>              if (projName == projectExamplesName || 
> -                projName == projectTestsName)
> +                projName == projectTestsName    ||
> +                projName == projectUtilsName)
>              {
>                  continue;
>              }
> @@ -1079,10 +1234,20 @@
>      updateSolutionProjectConfiguration(result, 
>          projectTestsName, testsProjectsPrefix);
>      
> +    logFile.WriteLine("Checking utils");
> +    WScript.Echo("Checking utils...");
> +    fillSolutionWithUtils(result, solution, srcDir, oldProjects);
> +    
> +    WScript.Echo("Configuring utils...");
> +    logFile.WriteLine("Configuring utils");
> +    updateSolutionProjectConfiguration(result, 
> +        projectUtilsName, utilsProjectsPrefix);
> +    
>      logFile.WriteLine("Clearing temporary data");
>      WScript.Echo("Clearing temporary data...");
>      removeProjectTemplates(result, projectExamplesName);
>      removeProjectTemplates(result, projectTestsName);
> +    removeProjectTemplates(result, projectUtilsName);
>      
>      return result;
>  }
> 
> 
> ------------------------------------------------------------------------
> 
> Index: generate.wsf
> ===================================================================
> --- generate.wsf	(revision 429988)
> +++ generate.wsf	(working copy)
> @@ -66,6 +66,7 @@
>  var libsrcDir = "\\src";
>  var libDir = "\\lib";
>  var testsDir = "\\tests";
> +var utilsDir = "\\util";
>  var winconfigDir = "\\etc\\config\\windows";
>  var etcDir = "\\etc";
>  var configDir = "\\etc\\config";
> @@ -272,6 +273,9 @@
>          if (! fso.FolderExists(builddir + testsDir))
>              fso.CreateFolder(builddir + testsDir);
>              
> +        if (! fso.FolderExists(builddir + utilsDir))
> +            fso.CreateFolder(builddir + utilsDir);
> +            
>          if (! fso.FolderExists(builddir + libsrcDir))
>              fso.CreateFolder(builddir + libsrcDir);
>              
> 
> 
> ------------------------------------------------------------------------
> 
> Index: icc-config.js
> ===================================================================
> --- icc-config.js	(revision 429988)
> +++ icc-config.js	(working copy)
> @@ -54,6 +54,10 @@
>          compilerICC90Release, linkerICCDebug, linkerICCRelease, 
>          librarianICC, customICC, postICC);
>          
> +    configureToolsUtils(icc90SolutionName, compilerICC90Debug, 
> +        compilerICC90Release, linkerICCDebug, linkerICCRelease, 
> +        librarianICC, customICC, postICC);
> +        
>      configureToolsRwTest(icc90SolutionName, compilerICC90Debug, 
>          compilerICC90Release, linkerICCDebug, linkerICCRelease, 
>          librarianICC, customICC, postICC);
> 
> 
> ------------------------------------------------------------------------
> 
> Index: msvc-config.js
> ===================================================================
> --- msvc-config.js	(revision 429988)
> +++ msvc-config.js	(working copy)
> @@ -18,6 +18,9 @@
>  var testsBaseAnsiIncludeDir = "..\\include\\ansi";
>  var testsIncludeDir = "include";
>  
> +var utilsBaseIncludeDir = "..\\include";
> +var utilsBaseAnsiIncludeDir = "..\\include\\ansi";
> +
>  // defines
>  var defineRWSHARED = "_RWSHARED";
>  var defineRWSTD_TEST_SRC = "_RWSTD_TEST_SRC";
> @@ -459,6 +462,140 @@
>  }
>  
>  
> +function configureToolsUtils( solutionName,
> +            compilerDebug, compilerRelease, 
> +            linkerDebug, linkerRelease, 
> +            librarianTool, customTool,
> +            postBuildTool)
> +{
> +    var compilerDebugUtils = compilerDebug.clone();
> +    var compilerReleaseUtils = compilerRelease.clone();
> +    var linkerDebugUtils = linkerDebug.clone();
> +    var linkerReleaseUtils = linkerRelease.clone();
> +    
> +    var postUtilsDll = postBuildTool.clone();
> +    postUtilsDll.commands.add(varCmdCopyDll, varCmdCopyDll);
> +    
> +    compilerDebugUtils.includeDirectories.add(utilsBaseIncludeDir);
> +    compilerDebugUtils.includeDirectories.add(utilsBaseAnsiIncludeDir);
> +  
> +    compilerReleaseUtils.includeDirectories.add(utilsBaseIncludeDir);
> +    compilerReleaseUtils.includeDirectories.add(utilsBaseAnsiIncludeDir);
> +    
> +    var solutionCfg = getSolution(solutionName);
> +    var utilsProj = solutionCfg.projects.get(projectUtilsName);
> +    var platform = utilsProj.platforms.get(platformWin32Name);
> +  
> +    // debug static
> +    var compilerDebugStaticUtl = compilerDebugUtils.clone();
> +    compilerDebugStaticUtl.runtime = "SINGLEDEBUG";
> +    compilerDebugStaticUtl.defines.add(defineRWSTDDEBUG);
> +    
> +    var configuration = platform.configurations.get(confDebugStaticName);
> +    compilerDebugStaticUtl.includeDirectories.add(
> +        varSign + utilsBaseIncludeDir + "/" + configuration.outputDir);
> +        
> +    configuration.tools.add(compilerToolName, compilerDebugStaticUtl);
> +    configuration.tools.add(linkerToolName, linkerDebugUtils);   
> +
> +    // release static
> +    var compilerReleaseStaticUtl = compilerReleaseUtils.clone();
> +    compilerReleaseStaticUtl.runtime = "SINGLE";
> +    
> +    var configuration = platform.configurations.get(confReleaseStaticName);
> +    compilerReleaseStaticUtl.includeDirectories.add(
> +        varSign + utilsBaseIncludeDir + "/" + configuration.outputDir);
> +        
> +    configuration.tools.add(compilerToolName, compilerReleaseStaticUtl);
> +    configuration.tools.add(linkerToolName, linkerReleaseUtils);
> +    
> +    // debug multi-threaded static
> +    var compilerMTDebugStaticUtl = compilerDebugUtils.clone();
> +    compilerMTDebugStaticUtl.runtime = "MULTIDEBUG";
> +    compilerMTDebugStaticUtl.defines.add(defineRWSTDDEBUG);
> +    
> +    var configuration = platform.configurations.get(confMTDebugStaticName);
> +    compilerMTDebugStaticUtl.includeDirectories.add(
> +        varSign + utilsBaseIncludeDir + "/" + configuration.outputDir);
> +        
> +    configuration.tools.add(compilerToolName, compilerMTDebugStaticUtl);
> +    configuration.tools.add(linkerToolName, linkerDebugUtils);   
> +
> +    // release multi-threaded static
> +    var compilerMTReleaseStaticUtl = compilerReleaseUtils.clone();
> +    compilerMTReleaseStaticUtl.runtime = "MULTI";
> +    
> +    var configuration = platform.configurations.get(confMTReleaseStaticName);
> +    compilerMTReleaseStaticUtl.includeDirectories.add(
> +        varSign + utilsBaseIncludeDir + "/" + configuration.outputDir);
> +        
> +    configuration.tools.add(compilerToolName, compilerMTReleaseStaticUtl);
> +    configuration.tools.add(linkerToolName, linkerReleaseUtils);
> +        
> +    // debug dll
> +    var compilerDebugDllUtl = compilerDebugUtils.clone();
> +    compilerDebugDllUtl.runtime = "SINGLEDEBUG";
> +    compilerDebugDllUtl.defines.add(defineRWSHARED);
> +    compilerDebugDllUtl.defines.add(defineRWSTDDEBUG);
> +    
> +    var configuration = platform.configurations.get(confDebugDllName);
> +    compilerDebugDllUtl.includeDirectories.add(
> +        varSign + utilsBaseIncludeDir + "/" + configuration.outputDir);
> +        
> +    var postUtilsDebugDll = postUtilsDll.clone();
> +    
> +    configuration.tools.add(compilerToolName, compilerDebugDllUtl);
> +    configuration.tools.add(linkerToolName, linkerDebugUtils);
> +    configuration.tools.add(postBuildToolName, postUtilsDebugDll);   
> +
> +    // release dll
> +    var compilerReleaseDllUtl = compilerReleaseUtils.clone();
> +    compilerReleaseDllUtl.runtime = "SINGLE";
> +    compilerReleaseDllUtl.defines.add(defineRWSHARED);
> +    
> +    var configuration = platform.configurations.get(confReleaseDllName);
> +    compilerReleaseDllUtl.includeDirectories.add(
> +        varSign + utilsBaseIncludeDir + "/" + configuration.outputDir);
> +        
> +    var postUtilsReleaseDll = postUtilsDll.clone();
> +    
> +    configuration.tools.add(compilerToolName, compilerReleaseDllUtl);
> +    configuration.tools.add(linkerToolName, linkerReleaseUtils); 
> +    configuration.tools.add(postBuildToolName, postUtilsReleaseDll);
> +    
> +    // debug multi-threaded dll
> +    var compilerMTDebugDllUtl = compilerDebugUtils.clone();
> +    compilerMTDebugDllUtl.runtime = "MultiDebugDll";
> +    compilerMTDebugDllUtl.defines.add(defineRWSHARED);
> +    compilerMTDebugDllUtl.defines.add(defineRWSTDDEBUG);
> +    
> +    var configuration = platform.configurations.get(confMTDebugDllName);
> +    compilerMTDebugDllUtl.includeDirectories.add(
> +        varSign + utilsBaseIncludeDir + "/" + configuration.outputDir);
> +        
> +    var postUtilsMTDebugDll = postUtilsDll.clone();
> +    
> +    configuration.tools.add(compilerToolName, compilerMTDebugDllUtl);
> +    configuration.tools.add(linkerToolName, linkerDebugUtils);
> +    configuration.tools.add(postBuildToolName, postUtilsMTDebugDll);
> +
> +    // release multi-threaded dll
> +    var compilerMTReleaseDllUtl = compilerReleaseUtils.clone();
> +    compilerMTReleaseDllUtl.runtime = "MULTIDLL";
> +    compilerMTReleaseDllUtl.defines.add(defineRWSHARED);
> +    
> +    var configuration = platform.configurations.get(confMTReleaseDllName);
> +    compilerMTReleaseDllUtl.includeDirectories.add(
> +        varSign + utilsBaseIncludeDir + "/" + configuration.outputDir);
> +        
> +    var postUtilsMTReleaseDll = postUtilsDll.clone();
> +        
> +    configuration.tools.add(compilerToolName, compilerMTReleaseDllUtl);
> +    configuration.tools.add(linkerToolName, linkerReleaseUtils); 
> +    configuration.tools.add(postBuildToolName, postUtilsMTReleaseDll);
> +}
> +
> +
>  function configureToolsRwTest( solutionName,
>              compilerDebug, compilerRelease, 
>              linkerDebug, linkerRelease, 
> @@ -751,6 +888,10 @@
>          compilerVC71Release, linkerVCDebug, linkerVCRelease, 
>          librarianVC, customVC, postVC);
>          
> +    configureToolsUtils(vc71SolutionName, compilerVC71Debug, 
> +        compilerVC71Release, linkerVCDebug, linkerVCRelease, 
> +        librarianVC, customVC, postVC);
> +        
>      configureToolsRwTest(vc71SolutionName, compilerVC71Debug, 
>          compilerVC71Release, linkerVCDebug, linkerVCRelease, 
>          librarianVC, customVC, postVC);
> @@ -815,6 +956,10 @@
>          compilerVC80Release, linkerVCDebug, linkerVCRelease, 
>          librarianVC, customVC, postVC);
>          
> +    configureToolsUtils(vc80SolutionName, compilerVC80Debug, 
> +        compilerVC80Release, linkerVCDebug, linkerVCRelease, 
> +        librarianVC, customVC, postVC);
> +        
>      configureToolsRwTest(vc80SolutionName, compilerVC80Debug, 
>          compilerVC80Release, linkerVCDebug, linkerVCRelease, 
>          librarianVC, customVC, postVC);