From 66c85e29573bf82ca53185cfac5a18803827e87a Mon Sep 17 00:00:00 2001 From: Ged Murphy Date: Fri, 27 Apr 2007 15:18:34 +0000 Subject: [PATCH] - add support for .ocx files to rbuild - update project to VS2005 svn path=/trunk/; revision=26541 --- .../rbuild/backend/mingw/modulehandler.cpp | 63 ++ .../rbuild/backend/mingw/modulehandler.h | 13 + reactos/tools/rbuild/bootstrap.cpp | 1 + reactos/tools/rbuild/module.cpp | 9 + reactos/tools/rbuild/rbuild.h | 33 +- reactos/tools/rbuild/rbuild.sln | 26 +- reactos/tools/rbuild/rbuild.vcproj | 861 ++++++++++++------ 7 files changed, 688 insertions(+), 318 deletions(-) diff --git a/reactos/tools/rbuild/backend/mingw/modulehandler.cpp b/reactos/tools/rbuild/backend/mingw/modulehandler.cpp index 546ed9f02b6..5656ff6377b 100644 --- a/reactos/tools/rbuild/backend/mingw/modulehandler.cpp +++ b/reactos/tools/rbuild/backend/mingw/modulehandler.cpp @@ -222,6 +222,9 @@ MingwModuleHandler::InstanciateHandler ( case Win32DLL: handler = new MingwWin32DLLModuleHandler ( module ); break; + case Win32OCX: + handler = new MingwWin32OCXModuleHandler ( module ); + break; case KernelModeDriver: case ExportDriver: // maybe change this later handler = new MingwKernelModeDriverModuleHandler ( module ); @@ -2648,6 +2651,13 @@ MingwWin32DLLModuleHandler::MingwWin32DLLModuleHandler ( { } +MingwWin32OCXModuleHandler::MingwWin32OCXModuleHandler ( + const Module& module_ ) + + : MingwModuleHandler ( module_ ) +{ +} + static void MingwAddImplicitLibraries( Module &module ) { @@ -2731,6 +2741,59 @@ MingwWin32DLLModuleHandler::GenerateWin32DLLModuleTarget () } +void +MingwWin32OCXModuleHandler::AddImplicitLibraries ( Module& module ) +{ + MingwAddImplicitLibraries ( module ); + MingwAddDebugSupportLibraries ( module, DebugUserMode ); +} + +void +MingwWin32OCXModuleHandler::Process () +{ + GenerateWin32OCXModuleTarget (); +} + +void +MingwWin32OCXModuleHandler::GenerateWin32OCXModuleTarget () +{ + string targetMacro ( GetTargetMacro (module) ); + string workingDirectory = GetWorkingDirectory ( ); + string objectsMacro = GetObjectsMacro ( module ); + string linkDepsMacro = GetLinkingDependenciesMacro (); + string libsMacro = GetLibsMacro (); + + GenerateImportLibraryTargetIfNeeded (); + + if ( module.non_if_data.compilationUnits.size () > 0 ) + { + GenerateRules (); + + string dependencies = linkDepsMacro + " " + objectsMacro; + + string linker; + if ( module.cplusplus ) + linker = "${gpp}"; + else + linker = "${gcc}"; + + string linkerParameters = ssprintf ( "-Wl,--subsystem,console -Wl,--entry,%s -Wl,--image-base,%s -Wl,--file-alignment,0x1000 -Wl,--section-alignment,0x1000 -shared", + module.GetEntryPoint(true).c_str (), + module.baseaddress.c_str () ); + GenerateLinkerCommand ( dependencies, + linker, + linkerParameters, + objectsMacro, + libsMacro, + "" ); + } + else + { + GeneratePhonyTarget(); + } +} + + MingwWin32CUIModuleHandler::MingwWin32CUIModuleHandler ( const Module& module_ ) diff --git a/reactos/tools/rbuild/backend/mingw/modulehandler.h b/reactos/tools/rbuild/backend/mingw/modulehandler.h index 6e62ac1683e..118dcc38a69 100644 --- a/reactos/tools/rbuild/backend/mingw/modulehandler.h +++ b/reactos/tools/rbuild/backend/mingw/modulehandler.h @@ -338,6 +338,19 @@ private: }; +class MingwWin32OCXModuleHandler : public MingwModuleHandler +{ +public: + MingwWin32OCXModuleHandler ( const Module& module ); + virtual HostType DefaultHost() { return HostFalse; } + virtual void Process (); + std::string TypeSpecificLinkerFlags() { return module.useHostStdlib ? "-nostartfiles -lgcc" : "-nostartfiles -nostdlib -lgcc"; } + void AddImplicitLibraries ( Module& module ); +private: + void GenerateWin32OCXModuleTarget (); +}; + + class MingwWin32CUIModuleHandler : public MingwModuleHandler { public: diff --git a/reactos/tools/rbuild/bootstrap.cpp b/reactos/tools/rbuild/bootstrap.cpp index 727dde70e94..a6670900d5d 100644 --- a/reactos/tools/rbuild/bootstrap.cpp +++ b/reactos/tools/rbuild/bootstrap.cpp @@ -47,6 +47,7 @@ Bootstrap::IsSupportedModuleType ( ModuleType type ) case NativeDLL: case NativeCUI: case Win32DLL: + case Win32OCX: case Win32CUI: case Win32SCR: case Win32GUI: diff --git a/reactos/tools/rbuild/module.cpp b/reactos/tools/rbuild/module.cpp index efaefac1172..8c1c0256eaf 100644 --- a/reactos/tools/rbuild/module.cpp +++ b/reactos/tools/rbuild/module.cpp @@ -807,6 +807,8 @@ Module::GetModuleType ( const string& location, const XMLAttribute& attribute ) return NativeCUI; if ( attribute.value == "win32dll" ) return Win32DLL; + if ( attribute.value == "win32ocx" ) + return Win32OCX; if ( attribute.value == "win32cui" ) return Win32CUI; if ( attribute.value == "win32gui" ) @@ -865,6 +867,8 @@ Module::GetDefaultModuleExtension () const case NativeDLL: case Win32DLL: return ".dll"; + case Win32OCX: + return ".ocx"; case KernelModeDriver: case BootLoader: case ExportDriver: @@ -907,6 +911,7 @@ Module::GetDefaultModuleEntrypoint () const case NativeCUI: return "NtProcessStartup@4"; case Win32DLL: + case Win32OCX: return "DllMain@12"; case Win32CUI: case Test: @@ -948,6 +953,7 @@ Module::GetDefaultModuleBaseaddress () const case Kernel: return "0x80000000"; case Win32DLL: + case Win32OCX: return "0x10000000"; case NativeDLL: case NativeCUI: @@ -997,6 +1003,7 @@ Module::IsDLL () const case ExportDriver: case NativeDLL: case Win32DLL: + case Win32OCX: return true; case KernelModeDriver: case NativeCUI: @@ -1034,6 +1041,7 @@ Module::GenerateInOutputTree () const case ExportDriver: case NativeDLL: case Win32DLL: + case Win32OCX: case KernelModeDriver: case NativeCUI: case Win32CUI: @@ -1523,6 +1531,7 @@ AutoRegister::IsSupportedModuleType ( ModuleType type ) switch ( type ) { case Win32DLL: + case Win32OCX: return true; case Kernel: case KernelModeDLL: diff --git a/reactos/tools/rbuild/rbuild.h b/reactos/tools/rbuild/rbuild.h index 932749f387a..edac7acacd1 100644 --- a/reactos/tools/rbuild/rbuild.h +++ b/reactos/tools/rbuild/rbuild.h @@ -257,22 +257,23 @@ enum ModuleType NativeDLL = 6, NativeCUI = 7, Win32DLL = 8, - Win32CUI = 9, - Win32GUI = 10, - BootLoader = 11, - BootSector = 12, - Iso = 13, - LiveIso = 14, - Test = 15, - RpcServer = 16, - RpcClient = 17, - Alias = 18, - BootProgram = 19, - Win32SCR = 20, - ExportDriver = 21, - IdlHeader = 22, - IsoRegTest = 23, - LiveIsoRegTest = 24 + Win32OCX = 9, + Win32CUI = 10, + Win32GUI = 11, + BootLoader = 12, + BootSector = 13, + Iso = 14, + LiveIso = 15, + Test = 16, + RpcServer = 17, + RpcClient = 18, + Alias = 19, + BootProgram = 20, + Win32SCR = 21, + ExportDriver = 22, + IdlHeader = 23, + IsoRegTest = 24, + LiveIsoRegTest = 25 }; enum HostType diff --git a/reactos/tools/rbuild/rbuild.sln b/reactos/tools/rbuild/rbuild.sln index 296a3341d44..0f9164398e8 100644 --- a/reactos/tools/rbuild/rbuild.sln +++ b/reactos/tools/rbuild/rbuild.sln @@ -1,21 +1,19 @@ -Microsoft Visual Studio Solution File, Format Version 8.00 +Microsoft Visual Studio Solution File, Format Version 9.00 +# Visual Studio 2005 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "rbuild", "rbuild.vcproj", "{D9305AFB-499E-49F1-A865-99DD7E19E762}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection EndProject Global - GlobalSection(SolutionConfiguration) = preSolution - Debug = Debug - Release = Release + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 EndGlobalSection - GlobalSection(ProjectConfiguration) = postSolution - {D9305AFB-499E-49F1-A865-99DD7E19E762}.Debug.ActiveCfg = Debug|Win32 - {D9305AFB-499E-49F1-A865-99DD7E19E762}.Debug.Build.0 = Debug|Win32 - {D9305AFB-499E-49F1-A865-99DD7E19E762}.Release.ActiveCfg = Release|Win32 - {D9305AFB-499E-49F1-A865-99DD7E19E762}.Release.Build.0 = Release|Win32 + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {D9305AFB-499E-49F1-A865-99DD7E19E762}.Debug|Win32.ActiveCfg = Debug|Win32 + {D9305AFB-499E-49F1-A865-99DD7E19E762}.Debug|Win32.Build.0 = Debug|Win32 + {D9305AFB-499E-49F1-A865-99DD7E19E762}.Release|Win32.ActiveCfg = Release|Win32 + {D9305AFB-499E-49F1-A865-99DD7E19E762}.Release|Win32.Build.0 = Release|Win32 EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - EndGlobalSection - GlobalSection(ExtensibilityAddIns) = postSolution + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE EndGlobalSection EndGlobal diff --git a/reactos/tools/rbuild/rbuild.vcproj b/reactos/tools/rbuild/rbuild.vcproj index 8e485405ea4..8444269e550 100644 --- a/reactos/tools/rbuild/rbuild.vcproj +++ b/reactos/tools/rbuild/rbuild.vcproj @@ -1,132 +1,195 @@ + ProjectGUID="{D9305AFB-499E-49F1-A865-99DD7E19E762}" + > + Name="Win32" + /> + + + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="2" + > + + + + + + SuppressStartupBanner="true" + /> + Name="VCManagedResourceCompilerTool" + /> + + + TargetMachine="1" + /> + Name="VCALinkTool" + /> + Name="VCManifestTool" + /> + Name="VCXDCMakeTool" + /> + Name="VCBscMakeTool" + /> + Name="VCFxCopTool" + /> + Name="VCAppVerifierTool" + /> + Name="VCWebDeploymentTool" + /> - - + Name="VCPostBuildEventTool" + /> + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="2" + > + + + + + + CompileAs="0" + /> + Name="VCManagedResourceCompilerTool" + /> + + + TargetMachine="1" + /> + Name="VCALinkTool" + /> + Name="VCManifestTool" + /> + Name="VCXDCMakeTool" + /> + Name="VCBscMakeTool" + /> + Name="VCFxCopTool" + /> + Name="VCAppVerifierTool" + /> + Name="VCWebDeploymentTool" + /> - - + Name="VCPostBuildEventTool" + /> @@ -134,872 +197,1094 @@ + > + > + RelativePath="backend\devcpp\devcpp.cpp" + > + Name="Release|Win32" + > + PreprocessorDefinitions="" + /> + Name="Debug|Win32" + > + BasicRuntimeChecks="3" + /> + RelativePath="backend\devcpp\devcpp.h" + > + > + RelativePath="backend\msvc\genguid.cpp" + > + Name="Release|Win32" + > + PreprocessorDefinitions="" + /> + Name="Debug|Win32" + > + BasicRuntimeChecks="3" + /> + RelativePath="backend\msvc\msvc.cpp" + > + Name="Release|Win32" + > + PreprocessorDefinitions="" + /> + Name="Debug|Win32" + > + BasicRuntimeChecks="3" + /> + RelativePath="backend\msvc\msvc.h" + > + RelativePath="backend\msvc\msvcmaker.cpp" + > + Name="Release|Win32" + > + PreprocessorDefinitions="" + /> + Name="Debug|Win32" + > + BasicRuntimeChecks="3" + /> + RelativePath="backend\msvc\vcprojmaker.cpp" + > + Name="Release|Win32" + > + PreprocessorDefinitions="" + /> + Name="Debug|Win32" + > + BasicRuntimeChecks="3" + /> + > + RelativePath="backend\mingw\mingw.cpp" + > + Name="Release|Win32" + > + PreprocessorDefinitions="" + /> + Name="Debug|Win32" + > + BasicRuntimeChecks="3" + /> + RelativePath="backend\mingw\mingw.h" + > + RelativePath="backend\mingw\modulehandler.cpp" + > + Name="Release|Win32" + > + PreprocessorDefinitions="" + /> + Name="Debug|Win32" + > + BasicRuntimeChecks="3" + /> + RelativePath="backend\mingw\modulehandler.h" + > + RelativePath="backend\mingw\pch_detection.h" + > + RelativePath="backend\mingw\proxymakefile.cpp" + > + Name="Release|Win32" + > + PreprocessorDefinitions="" + /> + Name="Debug|Win32" + > + BasicRuntimeChecks="3" + /> + > + RelativePath="backend\backend.cpp" + > + Name="Release|Win32" + > + PreprocessorDefinitions="" + /> + Name="Debug|Win32" + > + BasicRuntimeChecks="3" + /> + > + RelativePath="backend\backend.h" + > + > + RelativePath="automaticdependency.cpp" + > + Name="Release|Win32" + > + PreprocessorDefinitions="" + /> + Name="Debug|Win32" + > + BasicRuntimeChecks="3" + /> + RelativePath="bootstrap.cpp" + > + Name="Release|Win32" + > + PreprocessorDefinitions="" + /> + Name="Debug|Win32" + > + BasicRuntimeChecks="3" + /> + RelativePath="cdfile.cpp" + > + Name="Release|Win32" + > + PreprocessorDefinitions="" + /> + Name="Debug|Win32" + > + BasicRuntimeChecks="3" + /> + RelativePath="compilationunit.cpp" + > + Name="Release|Win32" + > + PreprocessorDefinitions="" + /> + Name="Debug|Win32" + > + BasicRuntimeChecks="3" + /> + RelativePath="compilationunitsupportcode.cpp" + > + Name="Release|Win32" + > + PreprocessorDefinitions="" + /> + Name="Debug|Win32" + > + BasicRuntimeChecks="3" + /> + RelativePath="compilerflag.cpp" + > + Name="Release|Win32" + > + PreprocessorDefinitions="" + /> + Name="Debug|Win32" + > + BasicRuntimeChecks="3" + /> + RelativePath="configuration.cpp" + > + Name="Release|Win32" + > + PreprocessorDefinitions="" + /> + Name="Debug|Win32" + > + BasicRuntimeChecks="3" + /> + RelativePath="define.cpp" + > + Name="Release|Win32" + > + PreprocessorDefinitions="" + /> + Name="Debug|Win32" + > + BasicRuntimeChecks="3" + /> + RelativePath="directory.cpp" + > + Name="Release|Win32" + > + PreprocessorDefinitions="" + /> + Name="Debug|Win32" + > + BasicRuntimeChecks="3" + /> + RelativePath="exception.cpp" + > + Name="Release|Win32" + > + PreprocessorDefinitions="" + /> + Name="Debug|Win32" + > + BasicRuntimeChecks="3" + /> + RelativePath="filesupportcode.cpp" + > + Name="Release|Win32" + > + PreprocessorDefinitions="" + /> + Name="Debug|Win32" + > + BasicRuntimeChecks="3" + /> + RelativePath="global.cpp" + > + Name="Release|Win32" + > + PreprocessorDefinitions="" + /> + Name="Debug|Win32" + > + BasicRuntimeChecks="3" + /> + RelativePath="include.cpp" + > + Name="Release|Win32" + > + PreprocessorDefinitions="" + /> + Name="Debug|Win32" + > + BasicRuntimeChecks="3" + /> + RelativePath="installfile.cpp" + > + Name="Release|Win32" + > + PreprocessorDefinitions="" + /> + Name="Debug|Win32" + > + BasicRuntimeChecks="3" + /> + RelativePath="linkerflag.cpp" + > + Name="Release|Win32" + > + PreprocessorDefinitions="" + /> + Name="Debug|Win32" + > + BasicRuntimeChecks="3" + /> + RelativePath="linkerscript.cpp" + > + Name="Release|Win32" + > + PreprocessorDefinitions="" + /> + Name="Debug|Win32" + > + BasicRuntimeChecks="3" + /> + RelativePath="module.cpp" + > + Name="Release|Win32" + > + PreprocessorDefinitions="" + /> + Name="Debug|Win32" + > + BasicRuntimeChecks="3" + /> + RelativePath="project.cpp" + > + Name="Release|Win32" + > + PreprocessorDefinitions="" + /> + Name="Debug|Win32" + > + BasicRuntimeChecks="3" + /> + RelativePath="rbuild.cpp" + > + Name="Release|Win32" + > + PreprocessorDefinitions="" + /> + Name="Debug|Win32" + > + BasicRuntimeChecks="3" + /> + RelativePath="stubbedcomponent.cpp" + > + Name="Release|Win32" + > + PreprocessorDefinitions="" + /> + Name="Debug|Win32" + > + BasicRuntimeChecks="3" + /> + RelativePath="syssetupgenerator.cpp" + > + Name="Release|Win32" + > + PreprocessorDefinitions="" + /> + Name="Debug|Win32" + > + BasicRuntimeChecks="3" + /> + RelativePath="testsupportcode.cpp" + > + Name="Release|Win32" + > + PreprocessorDefinitions="" + /> + Name="Debug|Win32" + > + BasicRuntimeChecks="3" + /> + RelativePath="wineresource.cpp" + > + Name="Release|Win32" + > + PreprocessorDefinitions="" + /> + Name="Debug|Win32" + > + BasicRuntimeChecks="3" + /> + > + RelativePath="exception.h" + > + RelativePath="pch.h" + > + RelativePath="rbuild.h" + > + RelativePath="test.h" + > + > + RelativePath="..\..\lib\inflib\builddep.h" + > + RelativePath="..\..\lib\inflib\infcommon.h" + > + RelativePath="..\..\lib\inflib\infcore.c" + > + Name="Release|Win32" + > + PreprocessorDefinitions="" + /> + Name="Debug|Win32" + > + BasicRuntimeChecks="3" + /> + RelativePath="..\..\lib\inflib\infget.c" + > + Name="Release|Win32" + > + PreprocessorDefinitions="" + /> + Name="Debug|Win32" + > + BasicRuntimeChecks="3" + /> + RelativePath="..\..\lib\inflib\infhost.h" + > + RelativePath="..\..\lib\inflib\infhostgen.c" + > + Name="Release|Win32" + > + PreprocessorDefinitions="" + /> + Name="Debug|Win32" + > + BasicRuntimeChecks="3" + /> + RelativePath="..\..\lib\inflib\infhostget.c" + > + Name="Release|Win32" + > + PreprocessorDefinitions="" + /> + Name="Debug|Win32" + > + BasicRuntimeChecks="3" + /> + RelativePath="..\..\lib\inflib\infhostglue.c" + > + Name="Release|Win32" + > + PreprocessorDefinitions="" + /> + Name="Debug|Win32" + > + BasicRuntimeChecks="3" + /> + RelativePath="..\..\lib\inflib\infhostput.c" + > + Name="Release|Win32" + > + PreprocessorDefinitions="" + /> + Name="Debug|Win32" + > + BasicRuntimeChecks="3" + /> + RelativePath="..\..\lib\inflib\inflib.h" + > + RelativePath="..\..\lib\inflib\infpriv.h" + > + RelativePath="..\..\lib\inflib\infput.c" + > + Name="Release|Win32" + > + PreprocessorDefinitions="" + /> + Name="Debug|Win32" + > + BasicRuntimeChecks="3" + /> + > + RelativePath="..\ssprintf.cpp" + > + Name="Release|Win32" + > + PreprocessorDefinitions="" + /> + Name="Debug|Win32" + > + BasicRuntimeChecks="3" + /> + RelativePath="..\ssprintf.h" + > + RelativePath="..\xml.cpp" + > + Name="Release|Win32" + > + PreprocessorDefinitions="" + /> + Name="Debug|Win32" + > + BasicRuntimeChecks="3" + /> + RelativePath="..\xml.h" + >