Sync tools to 45592
authorSamuel Serapion <samuel.serapion@gmail.com>
Mon, 15 Feb 2010 06:02:48 +0000 (06:02 +0000)
committerSamuel Serapion <samuel.serapion@gmail.com>
Mon, 15 Feb 2010 06:02:48 +0000 (06:02 +0000)
svn path=/branches/ros-amd64-bringup/; revision=45595

1  2 
reactos/tools/rbuild/backend/mingw/compilers/gcc.mak
reactos/tools/rbuild/backend/mingw/linkers/ld.mak
reactos/tools/rbuild/backend/mingw/mingw.cpp
reactos/tools/rbuild/backend/mingw/modulehandler.cpp
reactos/tools/rbuild/backend/msvc/vcprojmaker.cpp
reactos/tools/rbuild/module.cpp
reactos/tools/rbuild/project.cpp
reactos/tools/rbuild/rbuild.h

@@@ -9,13 -9,15 +9,19 @@@ CPPFLAG_UNICODE:=-DUNICODE -D_UNICOD
  
  # FIXME: disabled until RosBE stops sucking
  # BUILTIN_CPPFLAGS+= -nostdinc
 +ifeq ($(ROS_ARCH),i386)
 +BUILTIN_CFLAGS+= -fno-optimize-sibling-calls -fno-set-stack-executable
 +else
  BUILTIN_CFLAGS+= -fno-optimize-sibling-calls
 +endif
  BUILTIN_CXXFLAGS+= -fno-optimize-sibling-calls
  
 -ifneq (,$(filter $(ARCH),amd64 i386))
+ # Add -fno-set-stack-executable required for x86/MinGW
++ifneq (,$(filter $(ARCH), i386))
+       BUILTIN_CFLAGS+= -fno-set-stack-executable
+       BUILTIN_CXXFLAGS+= -fno-set-stack-executable
+ endif
  #(module, source, dependencies, cflags, output)
  define RBUILD_DEPENDS
  
@@@ -161,4 -163,4 +167,3 @@@ ${call RBUILD_intermediate_dir,$(2)}$$(
  endif
  
  endef
--
@@@ -487,16 -480,18 +487,13 @@@ MingwBackend::GenerateGlobalVariables (
                fputs ( "BUILTIN_CXXINCLUDES+= $(TARGET_CPPFLAGS)\n", fMakefile );
  
                fprintf ( fMakefile, "PROJECT_CCLIBS := \"$(shell ${TARGET_CC} -print-libgcc-file-name)\"\n" );
-         fprintf ( fMakefile, "PROJECT_CXXLIBS := \"$(shell ${TARGET_CPP} -print-file-name=libstdc++.a)\" \"$(shell ${TARGET_CPP} -print-libgcc-file-name)\" \"$(shell ${TARGET_CPP} -print-file-name=libmingw32.a)\" \"$(shell ${TARGET_CPP} -print-file-name=libmingwex.a)\" " );
 -              
 -              // We use our proprietary "ofmt_stub.a" to implement a stub for "_get_output_format" required by "libmingwex.a".
 -              // This archive just contains the compiled "ofmt_stub.s" supplied with the MinGW Runtime sources.
 -              fprintf ( fMakefile, "PROJECT_CXXLIBS := \"$(shell ${TARGET_CPP} -print-file-name=libstdc++.a)\" \"$(shell ${TARGET_CPP} -print-libgcc-file-name)\" \"$(shell ${TARGET_CPP} -print-file-name=libmingw32.a)\" \"$(shell ${TARGET_CPP} -print-file-name=libmingwex.a)\" \"$(shell ${TARGET_CPP} -print-file-name=ofmt_stub.a)\" \"$(shell ${TARGET_CPP} -print-file-name=libcoldname.a)\"\n" );
 -              
                /* hack to get libgcc_eh.a, should check mingw version or something */
                if (Environment::GetArch() == "amd64")
-                       fprintf ( fMakefile, " \"$(shell ${TARGET_CPP} -print-file-name=libgcc_eh.a)\"" );
 -              {
 -                      fprintf ( fMakefile, "PROJECT_LPPFLAGS += $(shell ${TARGET_CPP} -print-file-name=libgcc_eh.a)\n" );
 -              }
 +              /* hack to get _get_output_format, needed by libmingwex */
 +              else if (Environment::GetArch() == "i386")
 +                      fprintf ( fMakefile, "\"$(shell ${TARGET_CPP} -print-file-name=ofmt_stub.a)\"");
 +              fprintf ( fMakefile,"\n");
        }
 -
        MingwModuleHandler::GenerateParameters ( "PROJECT", "+=", ProjectNode.non_if_data );
        MingwModuleHandler::GenerateParameters ( "PROJECT_HOST", "+=", ProjectNode.host_non_if_data );
  
@@@ -507,382 -461,285 +461,319 @@@ void VCProjMaker::_generate_standard_co
                vcdir = DEF_SSEP + _get_vc_dir();
        }
  
 -      fprintf ( OUT, "\t\t<Configuration\r\n" );
 -      fprintf ( OUT, "\t\t\tName=\"%s|Win32\"\r\n", cfg.name.c_str() );
 +              fprintf ( OUT, "\t\t<Configuration\r\n" );
 +              fprintf ( OUT, "\t\t\tName=\"%s|Win32\"\r\n", cfg.name.c_str() );
  
-               if ( configuration.UseConfigurationInPath )
-               {
-                       fprintf ( OUT, "\t\t\tOutputDirectory=\"%s\\%s%s\\%s\"\r\n", outdir.c_str (), module.output->relative_path.c_str (), vcdir.c_str (), cfg.name.c_str() );
-                       fprintf ( OUT, "\t\t\tIntermediateDirectory=\"%s\\%s%s\\%s\"\r\n", intdir.c_str (), module.output->relative_path.c_str (), vcdir.c_str (), cfg.name.c_str() );
-               }
-               else
-               {
-                       fprintf ( OUT, "\t\t\tOutputDirectory=\"%s\\%s%s\"\r\n", outdir.c_str (), module.output->relative_path.c_str (), vcdir.c_str () );
-                       fprintf ( OUT, "\t\t\tIntermediateDirectory=\"%s\\%s%s\"\r\n", intdir.c_str (), module.output->relative_path.c_str (), vcdir.c_str () );
-               }
+       if ( configuration.UseConfigurationInPath )
+       {
+               fprintf ( OUT, "\t\t\tOutputDirectory=\"$(out)\\%s%s\\$(ConfigurationName)\"\r\n", module.output->relative_path.c_str (), vcdir.c_str () );
+               fprintf ( OUT, "\t\t\tIntermediateDirectory=\"$(obj)\\%s%s\\$(ConfigurationName)\"\r\n", module.output->relative_path.c_str (), vcdir.c_str () );
+       }
+       else
+       {
+               fprintf ( OUT, "\t\t\tOutputDirectory=\"$(out)\\%s%s\"\r\n", module.output->relative_path.c_str (), vcdir.c_str () );
+               fprintf ( OUT, "\t\t\tIntermediateDirectory=\"$(obj)\\%s%s\"\r\n", module.output->relative_path.c_str (), vcdir.c_str () );
+       }
  
        fprintf ( OUT, "\t\t\tConfigurationType=\"%d\"\r\n", CfgType );
+       fprintf ( OUT, "\t\t\tInheritedPropertySheets=\"%s%s.vsprops\"\r\n", path_basedir.c_str (), cfg.name.c_str ());
        fprintf ( OUT, "\t\t\tCharacterSet=\"2\"\r\n" );
        fprintf ( OUT, "\t\t\t>\r\n" );
  
-               fprintf ( OUT, "\t\t\t<Tool\r\n" );
-               fprintf ( OUT, "\t\t\t\tName=\"VCCLCompilerTool\"\r\n" );
+       fprintf ( OUT, "\t\t\t<Tool\r\n" );
+       fprintf ( OUT, "\t\t\t\tName=\"s_as_mscpp\"\r\n" );
+       fprintf ( OUT, "\t\t\t\tsIncPaths=\"" );
+       fprintf ( OUT, "./;" );
+       for ( i = 0; i < includes.size(); i++ )
+       {
+               const std::string& include = includes[i];
+               if ( strcmp ( include.c_str(), "." ) )
+               {
+                       fprintf ( OUT, "%s", include.c_str() );
+                       fprintf ( OUT, ";" );
+               }
+       }
+       fprintf ( OUT, "$(globalIncludes);\"\r\n");
+       fprintf ( OUT, "\t\t\t\tsPPDefs=\"__ASM__\"\r\n" );
+       fprintf ( OUT, "\t\t\t/>\r\n" );
+       fprintf ( OUT, "\t\t\t<Tool\r\n" );
+       fprintf ( OUT, "\t\t\t\tName=\"Pspec\"\r\n" );
+       fprintf ( OUT, "\t\t\t\tincludes=\"" );
+       fprintf ( OUT, "./;" );
+       for ( i = 0; i < includes.size(); i++ )
+       {
+               const std::string& include = includes[i];
+               if ( strcmp ( include.c_str(), "." ) )
+               {
+                       fprintf ( OUT, "%s", include.c_str() );
+                       fprintf ( OUT, ";" );
+               }
+       }
+       fprintf ( OUT, "$(globalIncludes);\"\r\n");
+       fprintf ( OUT, "\t\t\t\tsPPDefs=\"__ASM__\"\r\n" );
+       fprintf ( OUT, "\t\t\t/>\r\n" );
  
-               fprintf ( OUT, "\t\t\t\tOptimization=\"%d\"\r\n", release ? 2 : 0 );
  
-               fprintf ( OUT, "\t\t\t\tAdditionalIncludeDirectories=\"" );
-               bool multiple_includes = false;
-               fprintf ( OUT, "./;" );
-               for ( i = 0; i < includes.size(); i++ )
+       fprintf ( OUT, "\t\t\t<Tool\r\n" );
+       fprintf ( OUT, "\t\t\t\tName=\"VCCLCompilerTool\"\r\n" );
+       fprintf ( OUT, "\t\t\t\tAdditionalIncludeDirectories=\"" );
+       bool multiple_includes = false;
+       fprintf ( OUT, "./;" );
+       for ( i = 0; i < includes.size(); i++ )
+       {
+               const std::string& include = includes[i];
+               if ( strcmp ( include.c_str(), "." ) )
 +              {
 +                      const std::string& include = includes[i];
 +                      if ( strcmp ( include.c_str(), "." ) )
 +                      {
 +                              if ( multiple_includes )
 +                                      fprintf ( OUT, ";" );
 +                              fprintf ( OUT, "%s", include.c_str() );
 +                              include_string += " /I " + include;
 +                              multiple_includes = true;
 +                      }
 +              }
 +              if ( include_idl )
                {
                        if ( multiple_includes )
                                fprintf ( OUT, ";" );
-                       if ( configuration.UseConfigurationInPath )
-                       {
-                               fprintf ( OUT, "%s\\include\\reactos\\idl%s\\%s\r\n", intdir.c_str (), vcdir.c_str (), cfg.name.c_str() );
-                       }
-                       else
-                       {
-                               fprintf ( OUT, "%s\\include\\reactos\\idl\r\n", intdir.c_str () );
-                       }
+                       fprintf ( OUT, "%s", include.c_str() );
+                       multiple_includes = true;
                }
 -      }
 -      if ( include_idl )
 -      {
 -              if ( multiple_includes )
 -                      fprintf ( OUT, ";" );
 -
 -              if ( configuration.UseConfigurationInPath )
 +              if ( cfg.headers == ReactOSHeaders )
                {
-                       for ( i = 0; i < includes_ros.size(); i++ )
-                       {
-                               const std::string& include = includes_ros[i];
-                               if ( multiple_includes )
-                                       fprintf ( OUT, ";" );
-                               fprintf ( OUT, "%s", include.c_str() );
-                               //include_string += " /I " + include;
-                               multiple_includes = true;
-                       }
+                       fprintf ( OUT, "$(int)\\include\\reactos\\idl%s\\$(ConfigurationName)\r\n", vcdir.c_str ());
                }
                else
                {
-                       // Add WDK or PSDK paths, if user provides them
-                       if (getenv ( "BASEDIR" ) != NULL &&
-                               (module.type == Kernel ||
-                                module.type == KernelModeDLL ||
-                                module.type == KernelModeDriver ||
-                                module.type == KeyboardLayout))
-                       {
-                               string WdkBase, SdkPath, CrtPath, DdkPath;
-                               WdkBase = getenv ( "BASEDIR" );
-                               SdkPath = WdkBase + "\\inc\\api";
-                               CrtPath = WdkBase + "\\inc\\crt";
-                               DdkPath = WdkBase + "\\inc\\ddk";
-                               if ( multiple_includes )
-                                       fprintf ( OUT, ";" );
-                               fprintf ( OUT, "%s;", SdkPath.c_str() );
-                               fprintf ( OUT, "%s;", CrtPath.c_str() );
-                               fprintf ( OUT, "%s", DdkPath.c_str() );
-                               multiple_includes = true;
-                       }
+                       fprintf ( OUT, "$(int)\\include\\reactos\\idl\r\n" );
                }
-               fprintf ( OUT, "\"\r\n" );
-               StringSet defines = common_defines;
-               // Always add _CRT_SECURE_NO_WARNINGS to disable warnings about not
-               // using the safe functions introduced in MSVC8.
-               defines.insert ( "_CRT_SECURE_NO_WARNINGS" );
+       }
  
-               if ( debug )
-               {
-                       defines.insert ( "_DEBUG" );
-               }
+       fprintf ( OUT, "\"\r\n" );
  
-               if ( cfg.headers == MSVCHeaders )
-               {
-                       // this is a define in MinGW w32api, but not Microsoft's headers
-                       defines.insert ( "STDCALL=__stdcall" );
-               }
 -      StringSet defines = common_defines;
++              StringSet defines = common_defines;
  
        if ( binaryType == Lib || binaryType == Exe )
 -      {
 -              defines.insert ( "_LIB" );
 -      }
 -      else
 -      {
 -              defines.insert ( "_WINDOWS" );
 -              defines.insert ( "_USRDLL" );
 -      }
 +              {
 +                      defines.insert ( "_LIB" );
 +              }
 +              else
 +              {
 +                      defines.insert ( "_WINDOWS" );
 +                      defines.insert ( "_USRDLL" );
 +              }
  
-               fprintf ( OUT, "\t\t\t\tPreprocessorDefinitions=\"" );
-               for ( StringSet::iterator it1=defines.begin(); it1!=defines.end(); it1++ )
-               {
-                       if ( i > 0 )
-                               fprintf ( OUT, ";" );
-                       string unescaped = *it1;
-                       fprintf ( OUT, "%s", _replace_str(unescaped, "\"","").c_str() );
-               }
-               fprintf ( OUT, "\"\r\n" );
-               fprintf ( OUT, "\t\t\t\tForcedIncludeFiles=\"%s\"\r\n", "warning.h");
-               fprintf ( OUT, "\t\t\t\tMinimalRebuild=\"%s\"\r\n", speed ? "TRUE" : "FALSE" );
-               fprintf ( OUT, "\t\t\t\tBasicRuntimeChecks=\"0\"\r\n" );
-               fprintf ( OUT, "\t\t\t\tRuntimeLibrary=\"%d\"\r\n", debug ? 3 : 2 );    // 3=/MDd 2=/MD
-               fprintf ( OUT, "\t\t\t\tBufferSecurityCheck=\"FALSE\"\r\n" );
-               fprintf ( OUT, "\t\t\t\tEnableFunctionLevelLinking=\"FALSE\"\r\n" );
-               if ( module.pch != NULL )
-               {
-                       fprintf ( OUT, "\t\t\t\tUsePrecompiledHeader=\"2\"\r\n" );
-                       string pch_path = Path::RelativeFromDirectory (
-                               module.pch->file->name,
-                               module.output->relative_path );
-                       string::size_type pos = pch_path.find_last_of ("/");
-                       if ( pos != string::npos )
-                               pch_path.erase(0, pos+1);
-                       fprintf ( OUT, "\t\t\t\tPrecompiledHeaderThrough=\"%s\"\r\n", pch_path.c_str() );
-                       // Only include from the same module
-                       pos = pch_path.find("../");
-                       if (pos == string::npos && std::find(header_files.begin(), header_files.end(), pch_path) == header_files.end())
-                               header_files.push_back(pch_path);
-               }
-               else
-               {
-                       fprintf ( OUT, "\t\t\t\tUsePrecompiledHeader=\"0\"\r\n" );
-               }
-               fprintf ( OUT, "\t\t\t\tWholeProgramOptimization=\"%s\"\r\n", release ? "FALSE" : "FALSE");
-               if ( release )
-               {
-                       fprintf ( OUT, "\t\t\t\tFavorSizeOrSpeed=\"1\"\r\n" );
-                       fprintf ( OUT, "\t\t\t\tStringPooling=\"true\"\r\n" );
-               }
+       fprintf ( OUT, "\t\t\t\tPreprocessorDefinitions=\"" );
+       for ( StringSet::iterator it1=defines.begin(); it1!=defines.end(); it1++ )
+       {
+               string unescaped = *it1;
+               fprintf ( OUT, "%s ; ", _replace_str(unescaped, "\"","").c_str() );
+       }
+       fprintf ( OUT, "\"\r\n" );
  
-               fprintf ( OUT, "\t\t\t\tWarningLevel=\"%s\"\r\n", speed ? "0" : "3" );
-               fprintf ( OUT, "\t\t\t\tDetect64BitPortabilityProblems=\"%s\"\r\n", "FALSE");
-               if ( !module.cplusplus )
-                       fprintf ( OUT, "\t\t\t\tCompileAs=\"1\"\r\n" );
+       //disable precompiled headers for now
+ #if 0
+       if ( module.pch != NULL )
+       {
+               fprintf ( OUT, "\t\t\t\tUsePrecompiledHeader=\"2\"\r\n" );
+               string pch_path = Path::RelativeFromDirectory (
+                       module.pch->file->name,
+                       module.output->relative_path );
+               string::size_type pos = pch_path.find_last_of ("/");
+               if ( pos != string::npos )
+                       pch_path.erase(0, pos+1);
+               fprintf ( OUT, "\t\t\t\tPrecompiledHeaderThrough=\"%s\"\r\n", pch_path.c_str() );
+               // Only include from the same module
+               pos = pch_path.find("../");
+               if (pos == string::npos && std::find(header_files.begin(), header_files.end(), pch_path) == header_files.end())
+                       header_files.push_back(pch_path);
+       }
+ #endif
  
-               if ( module.type == Win32CUI || module.type == Win32GUI )
-               {
-                       fprintf ( OUT, "\t\t\t\tCallingConvention=\"%d\"\r\n", 0 );     // 0=__cdecl
-               }
-               else
-               {
-                       fprintf ( OUT, "\t\t\t\tCallingConvention=\"%d\"\r\n", 2 );     // 2=__stdcall
-               }
+       if ( module.cplusplus )
+               fprintf ( OUT, "\t\t\t\tCompileAs=\"2\"\r\n" );
  
-               fprintf ( OUT, "\t\t\t\tDebugInformationFormat=\"%s\"/>\r\n", speed ? "0" : release ? "3": "4");        // 3=/Zi 4=ZI
+       fprintf ( OUT, "\t\t\t/>\r\n");
  
 -      fprintf ( OUT, "\t\t\t<Tool\r\n" );
 -      fprintf ( OUT, "\t\t\t\tName=\"VCCustomBuildTool\"/>\r\n" );
 +              fprintf ( OUT, "\t\t\t<Tool\r\n" );
 +              fprintf ( OUT, "\t\t\t\tName=\"VCCustomBuildTool\"/>\r\n" );
  
-       if ( binaryType == Lib )
+       if ( binaryType != Lib )
+       {
+               fprintf ( OUT, "\t\t\t<Tool\r\n" );
+               fprintf ( OUT, "\t\t\t\tName=\"VCLinkerTool\"\r\n" );
+               if (module.GetEntryPoint() == "0" && binaryType != Sys )
+                       fprintf ( OUT, "AdditionalOptions=\"/noentry\"" );
+               if (configuration.VSProjectVersion == "9.00")
                {
 -                      fprintf ( OUT, "\t\t\t\tRandomizedBaseAddress=\"0\"\r\n" );
 -                      fprintf ( OUT, "\t\t\t\tDataExecutionPrevention=\"0\"\r\n" );
 +                      fprintf ( OUT, "\t\t\t<Tool\r\n" );
 +                      fprintf ( OUT, "\t\t\t\tName=\"VCLibrarianTool\"\r\n" );
 +                      fprintf ( OUT, "\t\t\t\tOutputFile=\"$(OutDir)/%s.lib\"/>\r\n", module.name.c_str() );
                }
 +              else
 +              {
 +                      fprintf ( OUT, "\t\t\t<Tool\r\n" );
 +                      fprintf ( OUT, "\t\t\t\tName=\"VCLinkerTool\"\r\n" );
 +              if (module.GetEntryPoint() == "0" && binaryType != Sys )
 +                              fprintf ( OUT, "AdditionalOptions=\"/noentry\"" );
  
 -              if (module.importLibrary != NULL)
 -                      fprintf ( OUT, "\t\t\t\tModuleDefinitionFile=\"%s\"\r\n", importLib.c_str());
 +                      if (configuration.VSProjectVersion == "9.00")
 +                      {
 +                              fprintf ( OUT, "\t\t\t\tRandomizedBaseAddress=\"0\"\r\n" );
 +                              fprintf ( OUT, "\t\t\t\tDataExecutionPrevention=\"0\"\r\n" );
 +                      }
  
 -              fprintf ( OUT, "\t\t\t\tAdditionalDependencies=\"" );
 -              bool use_msvcrt_lib = false;
 -              for ( i = 0; i < libraries.size(); i++ )
 -              {
 -                      if ( i > 0 )
 -                              fprintf ( OUT, " " );
 -                      string libpath = libraries[i].c_str();
 -                      libpath = libpath.erase (0, libpath.find_last_of ("\\") + 1 );
 -                      if ( libpath == "msvcrt.lib" )
 +                      if (module.importLibrary != NULL)
 +                              fprintf ( OUT, "\t\t\t\tModuleDefinitionFile=\"%s\"\r\n", importLib.c_str());
 +
 +                      fprintf ( OUT, "\t\t\t\tAdditionalDependencies=\"" );
 +                      bool use_msvcrt_lib = false;
 +                      for ( i = 0; i < libraries.size(); i++ )
                        {
 -                              use_msvcrt_lib = true;
 +                              if ( i > 0 )
 +                                      fprintf ( OUT, " " );
 +                              string libpath = libraries[i].c_str();
 +                              libpath = libpath.erase (0, libpath.find_last_of ("\\") + 1 );
 +                              if ( libpath == "msvcrt.lib" )
 +                              {
 +                                      use_msvcrt_lib = true;
 +                              }
 +                              fprintf ( OUT, "%s", libpath.c_str() );
                        }
 -                      fprintf ( OUT, "%s", libpath.c_str() );
 -              }
 -              fprintf ( OUT, "\"\r\n" );
 +                      fprintf ( OUT, "\"\r\n" );
  
 -              fprintf ( OUT, "\t\t\t\tAdditionalLibraryDirectories=\"" );
 +                      fprintf ( OUT, "\t\t\t\tAdditionalLibraryDirectories=\"" );
  
-                       // Add WDK libs paths, if needed
-                       if (getenv ( "BASEDIR" ) != NULL &&
-                               (module.type == Kernel ||
-                                module.type == KernelModeDLL ||
-                                module.type == KernelModeDriver ||
-                                module.type == KeyboardLayout))
-                       {
-                               string WdkBase, CrtPath, DdkPath;
-                               WdkBase = getenv ( "BASEDIR" );
-                               CrtPath = WdkBase + "\\lib\\crt\\i386";
-                               DdkPath = WdkBase + "\\lib\\wnet\\i386";
-                               fprintf ( OUT, "%s;", CrtPath.c_str() );
-                               fprintf ( OUT, "%s", DdkPath.c_str() );
-                               if (libraries.size () > 0)
-                                       fprintf ( OUT, ";" );
-                       }
 -              // Add conventional libraries dirs
 -              for (i = 0; i < libraries.size (); i++)
 -              {
 -                      if ( i > 0 )
 -                              fprintf ( OUT, ";" );
 +                      // Add conventional libraries dirs
 +                      for (i = 0; i < libraries.size (); i++)
 +                      {
 +                              if ( i > 0 )
 +                                      fprintf ( OUT, ";" );
  
-                               string libpath = libraries[i].c_str();
-                               libpath.replace (libpath.find("---"), 3, cfg.name);
-                               libpath = libpath.substr (0, libpath.find_last_of ("\\") );
-                               fprintf ( OUT, "%s", libpath.c_str() );
-                       }
+                       string libpath = libraries[i].c_str();
+                       libpath = libpath.substr (0, libpath.find_last_of ("\\") );
+                       fprintf ( OUT, "%s", libpath.c_str() );
+               }
  
 -              fprintf ( OUT, "\"\r\n" );
 +                      fprintf ( OUT, "\"\r\n" );
  
-                       fprintf ( OUT, "\t\t\t\tOutputFile=\"$(OutDir)/%s%s\"\r\n", module.name.c_str(), module_type.c_str() );
-                       fprintf ( OUT, "\t\t\t\tLinkIncremental=\"%d\"\r\n", debug ? 2 : 1 );
-                       fprintf ( OUT, "\t\t\t\tGenerateDebugInformation=\"%s\"\r\n", speed ? "FALSE" : "TRUE" );
-                       fprintf ( OUT, "\t\t\t\tLinkTimeCodeGeneration=\"%d\"\r\n", release? 0 : 0);    // whole program optimization
-                       if ( debug )
-                               fprintf ( OUT, "\t\t\t\tProgramDatabaseFile=\"$(OutDir)/%s.pdb\"\r\n", module.name.c_str() );
+               fprintf ( OUT, "\t\t\t\tOutputFile=\"$(OutDir)/%s%s\"\r\n", module.name.c_str(), module_type.c_str() );
                if ( binaryType == Sys )
 -              {
 -                      if (module.GetEntryPoint() == "0")
 -                              fprintf ( OUT, "\t\t\t\tAdditionalOptions=\" /noentry /ALIGN:0x20 /SECTION:INIT,D /IGNORE:4001,4037,4039,4065,4070,4078,4087,4089,4096\"\r\n" );
 -                      else
 -                              fprintf ( OUT, "\t\t\t\tAdditionalOptions=\" /ALIGN:0x20 /SECTION:INIT,D /IGNORE:4001,4037,4039,4065,4070,4078,4087,4089,4096\"\r\n" );
 -                      fprintf ( OUT, "\t\t\t\tIgnoreAllDefaultLibraries=\"TRUE\"\r\n" );
 -                      fprintf ( OUT, "\t\t\t\tGenerateManifest=\"FALSE\"\r\n" );
 -                      fprintf ( OUT, "\t\t\t\tSubSystem=\"%d\"\r\n", 3 );
 -                      fprintf ( OUT, "\t\t\t\tDriver=\"%d\"\r\n", 1 );
 -                      fprintf ( OUT, "\t\t\t\tEntryPointSymbol=\"%s\"\r\n", module.GetEntryPoint() == "" ? "DriverEntry" : module.GetEntryPoint().c_str ());
 -                      fprintf ( OUT, "\t\t\t\tBaseAddress=\"%s\"\r\n", baseaddr == "" ? "0x10000" : baseaddr.c_str ());
 -              }
 -              else if ( binaryType == Exe )
 -              {
 -                      if ( module.type == Kernel )
                        {
 -                              fprintf ( OUT, "\t\t\t\tAdditionalOptions=\" /SECTION:INIT,D /ALIGN:0x80\"\r\n" );
 +                      if (module.GetEntryPoint() == "0")
 +                                      fprintf ( OUT, "\t\t\t\tAdditionalOptions=\" /noentry /ALIGN:0x20 /SECTION:INIT,D /IGNORE:4001,4037,4039,4065,4070,4078,4087,4089,4096\"\r\n" );
 +                              else
 +                                      fprintf ( OUT, "\t\t\t\tAdditionalOptions=\" /ALIGN:0x20 /SECTION:INIT,D /IGNORE:4001,4037,4039,4065,4070,4078,4087,4089,4096\"\r\n" );
                                fprintf ( OUT, "\t\t\t\tIgnoreAllDefaultLibraries=\"TRUE\"\r\n" );
                                fprintf ( OUT, "\t\t\t\tGenerateManifest=\"FALSE\"\r\n" );
                                fprintf ( OUT, "\t\t\t\tSubSystem=\"%d\"\r\n", 3 );
                                fprintf ( OUT, "\t\t\t\tDriver=\"%d\"\r\n", 1 );
 -                              fprintf ( OUT, "\t\t\t\tEntryPointSymbol=\"KiSystemStartup\"\r\n" );
 -                              fprintf ( OUT, "\t\t\t\tBaseAddress=\"%s\"\r\n", baseaddr.c_str ());
 -                      }
 -                      else if ( module.type == NativeCUI )
 -                      {
 -                              fprintf ( OUT, "\t\t\t\tAdditionalOptions=\" /ALIGN:0x20\"\r\n" );
 -                              fprintf ( OUT, "\t\t\t\tSubSystem=\"%d\"\r\n", 1 );
 -                              fprintf ( OUT, "\t\t\t\tGenerateManifest=\"FALSE\"\r\n" );
 -                              fprintf ( OUT, "\t\t\t\tIgnoreAllDefaultLibraries=\"TRUE\"\r\n" );
 -                              fprintf ( OUT, "\t\t\t\tEntryPointSymbol=\"NtProcessStartup\"\r\n" );
 -                              fprintf ( OUT, "\t\t\t\tBaseAddress=\"%s\"\r\n", baseaddr.c_str ());
 +                      fprintf ( OUT, "\t\t\t\tEntryPointSymbol=\"%s\"\r\n", module.GetEntryPoint() == "" ? "DriverEntry" : module.GetEntryPoint().c_str ());
 +                              fprintf ( OUT, "\t\t\t\tBaseAddress=\"%s\"\r\n", baseaddr == "" ? "0x10000" : baseaddr.c_str ());
                        }
 -                      else if ( module.type == Win32CUI || module.type == Win32GUI || module.type == Win32SCR)
 +              else if ( binaryType == Exe )
                        {
 -                              if ( use_msvcrt_lib )
 +                              if ( module.type == Kernel )
                                {
 +                                      fprintf ( OUT, "\t\t\t\tAdditionalOptions=\" /SECTION:INIT,D /ALIGN:0x80\"\r\n" );
                                        fprintf ( OUT, "\t\t\t\tIgnoreAllDefaultLibraries=\"TRUE\"\r\n" );
 +                                      fprintf ( OUT, "\t\t\t\tGenerateManifest=\"FALSE\"\r\n" );
 +                                      fprintf ( OUT, "\t\t\t\tSubSystem=\"%d\"\r\n", 3 );
 +                                      fprintf ( OUT, "\t\t\t\tDriver=\"%d\"\r\n", 1 );
 +                                      fprintf ( OUT, "\t\t\t\tEntryPointSymbol=\"KiSystemStartup\"\r\n" );
 +                                      fprintf ( OUT, "\t\t\t\tBaseAddress=\"%s\"\r\n", baseaddr.c_str ());
                                }
 +                              else if ( module.type == NativeCUI )
 +                              {
 +                                      fprintf ( OUT, "\t\t\t\tAdditionalOptions=\" /ALIGN:0x20\"\r\n" );
 +                                      fprintf ( OUT, "\t\t\t\tSubSystem=\"%d\"\r\n", 1 );
 +                                      fprintf ( OUT, "\t\t\t\tGenerateManifest=\"FALSE\"\r\n" );
 +                                      fprintf ( OUT, "\t\t\t\tIgnoreAllDefaultLibraries=\"TRUE\"\r\n" );
 +                                      fprintf ( OUT, "\t\t\t\tEntryPointSymbol=\"NtProcessStartup\"\r\n" );
 +                                      fprintf ( OUT, "\t\t\t\tBaseAddress=\"%s\"\r\n", baseaddr.c_str ());
 +                              }
 +                              else if ( module.type == Win32CUI || module.type == Win32GUI || module.type == Win32SCR)
 +                              {
 +                                      if ( use_msvcrt_lib )
 +                                      {
 +                                              fprintf ( OUT, "\t\t\t\tIgnoreAllDefaultLibraries=\"TRUE\"\r\n" );
 +                                      }
                                fprintf ( OUT, "\t\t\t\tSubSystem=\"%d\"\r\n", 2 );
 +                              }
                        }
 -              }
                else if ( binaryType == Dll )
 -              {
 -                      if (module.GetEntryPoint() == "0")
 -                              fprintf ( OUT, "\t\t\t\tEntryPointSymbol=\"\"\r\n" );
 -                      else
                        {
 -                              // get rid of DllMain@12 because MSVC needs to link to _DllMainCRTStartup@12
 -                              // when using CRT
 -                              if (module.GetEntryPoint() == "DllMain@12")
 +                      if (module.GetEntryPoint() == "0")
                                        fprintf ( OUT, "\t\t\t\tEntryPointSymbol=\"\"\r\n" );
                                else
 +                              {
 +                                      // get rid of DllMain@12 because MSVC needs to link to _DllMainCRTStartup@12
 +                                      // when using CRT
 +                              if (module.GetEntryPoint() == "DllMain@12")
 +                                              fprintf ( OUT, "\t\t\t\tEntryPointSymbol=\"\"\r\n" );
 +                                      else
                                        fprintf ( OUT, "\t\t\t\tEntryPointSymbol=\"%s\"\r\n", module.GetEntryPoint().c_str ());
 +                              }
 +                              fprintf ( OUT, "\t\t\t\tBaseAddress=\"%s\"\r\n", baseaddr == "" ? "0x40000" : baseaddr.c_str ());
 +                              if ( use_msvcrt_lib )
 +                              {
 +                                      fprintf ( OUT, "\t\t\t\tIgnoreAllDefaultLibraries=\"TRUE\"\r\n" );
 +                              }
                        }
 -                      fprintf ( OUT, "\t\t\t\tBaseAddress=\"%s\"\r\n", baseaddr == "" ? "0x40000" : baseaddr.c_str ());
 -                      if ( use_msvcrt_lib )
 -                      {
 -                              fprintf ( OUT, "\t\t\t\tIgnoreAllDefaultLibraries=\"TRUE\"\r\n" );
 -                      }
 +                      fprintf ( OUT, "\t\t\t\tTargetMachine=\"%d\"/>\r\n", 1 );
                }
+               fprintf ( OUT, "\t\t\t/>\r\n" );
+       }
  
 -      fprintf ( OUT, "\t\t\t<Tool\r\n" );
 -      fprintf ( OUT, "\t\t\t\tName=\"VCResourceCompilerTool\"\r\n" );
 -      fprintf ( OUT, "\t\t\t\tAdditionalIncludeDirectories=\"" );
 -      multiple_includes = false;
 -      fprintf ( OUT, "./;" );
 -      for ( i = 0; i < includes.size(); i++ )
 -      {
 -              const std::string& include = includes[i];
 -              if ( strcmp ( include.c_str(), "." ) )
 +              fprintf ( OUT, "\t\t\t<Tool\r\n" );
 +              fprintf ( OUT, "\t\t\t\tName=\"VCResourceCompilerTool\"\r\n" );
 +              fprintf ( OUT, "\t\t\t\tAdditionalIncludeDirectories=\"" );
 +              multiple_includes = false;
 +              fprintf ( OUT, "./;" );
 +              for ( i = 0; i < includes.size(); i++ )
                {
 -                      if ( multiple_includes )
 -                              fprintf ( OUT, ";" );
 -                      fprintf ( OUT, "%s", include.c_str() );
 -                      multiple_includes = true;
 +                      const std::string& include = includes[i];
 +                      if ( strcmp ( include.c_str(), "." ) )
 +                      {
 +                              if ( multiple_includes )
 +                                      fprintf ( OUT, ";" );
 +                              fprintf ( OUT, "%s", include.c_str() );
 +                              multiple_includes = true;
 +                      }
                }
-               if ( cfg.headers == ReactOSHeaders )
-               {
-                       for ( i = 0; i < includes_ros.size(); i++ )
-                       {
-                               const std::string& include = includes_ros[i];
-                               if ( multiple_includes )
-                                       fprintf ( OUT, ";" );
-                               fprintf ( OUT, "%s", include.c_str() );
-                               multiple_includes = true;
-                       }
-               }
-               fprintf ( OUT, "\"/>\r\n " );
+       }
+       fprintf ( OUT, "\"/>\r\n " );
  
 -      fprintf ( OUT, "\t\t\t<Tool\r\n" );
 -      fprintf ( OUT, "\t\t\t\tName=\"VCMIDLTool\"/>\r\n" );
 -      if (configuration.VSProjectVersion == "8.00")
 -      {
                fprintf ( OUT, "\t\t\t<Tool\r\n" );
 -              fprintf ( OUT, "\t\t\t\tName=\"VCManifestTool\"\r\n" );
 -              fprintf ( OUT, "\t\t\t\tEmbedManifest=\"false\"/>\r\n" );
 +              fprintf ( OUT, "\t\t\t\tName=\"VCMIDLTool\"/>\r\n" );
 +              if (configuration.VSProjectVersion == "8.00")
 +              {
 +                      fprintf ( OUT, "\t\t\t<Tool\r\n" );
 +                      fprintf ( OUT, "\t\t\t\tName=\"VCManifestTool\"\r\n" );
 +                      fprintf ( OUT, "\t\t\t\tEmbedManifest=\"false\"/>\r\n" );
 +              }
 +              fprintf ( OUT, "\t\t\t<Tool\r\n" );
 +              fprintf ( OUT, "\t\t\t\tName=\"VCPostBuildEventTool\"/>\r\n" );
 +              fprintf ( OUT, "\t\t\t<Tool\r\n" );
 +              fprintf ( OUT, "\t\t\t\tName=\"VCPreBuildEventTool\"/>\r\n" );
 +              fprintf ( OUT, "\t\t\t<Tool\r\n" );
 +              fprintf ( OUT, "\t\t\t\tName=\"VCPreLinkEventTool\"/>\r\n" );
 +              fprintf ( OUT, "\t\t\t<Tool\r\n" );
 +              fprintf ( OUT, "\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"/>\r\n" );
 +              fprintf ( OUT, "\t\t\t<Tool\r\n" );
 +              fprintf ( OUT, "\t\t\t\tName=\"VCWebDeploymentTool\"/>\r\n" );
 +              fprintf ( OUT, "\t\t</Configuration>\r\n" );
        }
+       fprintf ( OUT, "\t\t</Configuration>\r\n" );
+ }
  
  
  void
Simple merge
Simple merge
Simple merge