Author: hpoussin
Date: Tue Jan 15 21:08:25 2008
New Revision: 31812
URL:
http://svn.reactos.org/svn/reactos?rev=31812&view=rev
Log:
Add RPC proxy support
Modified:
trunk/reactos/tools/rbuild/backend/codeblocks/codeblocks.cpp
trunk/reactos/tools/rbuild/backend/mingw/modulehandler.cpp
trunk/reactos/tools/rbuild/backend/mingw/modulehandler.h
trunk/reactos/tools/rbuild/bootstrap.cpp
trunk/reactos/tools/rbuild/include.cpp
trunk/reactos/tools/rbuild/module.cpp
trunk/reactos/tools/rbuild/rbuild.h
Modified: trunk/reactos/tools/rbuild/backend/codeblocks/codeblocks.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/backend/codeb…
==============================================================================
--- trunk/reactos/tools/rbuild/backend/codeblocks/codeblocks.cpp (original)
+++ trunk/reactos/tools/rbuild/backend/codeblocks/codeblocks.cpp Tue Jan 15 21:08:25 2008
@@ -363,7 +363,12 @@
string project_linker_flags = "-Wl,--enable-stdcall-fixup ";
project_linker_flags += GenerateProjectLinkerFlags();
- bool lib = (module.type == ObjectLibrary) || (module.type == RpcClient) ||(module.type
== RpcServer) || (module_type == ".lib") || (module_type == ".a");
+ bool lib = (module.type == ObjectLibrary) ||
+ (module.type == RpcClient) ||
+ (module.type == RpcServer) ||
+ (module.type == RpcProxy) ||
+ (module_type == ".lib") ||
+ (module_type == ".a");
bool dll = (module_type == ".dll") || (module_type == ".cpl");
bool exe = (module_type == ".exe") || (module_type == ".scr");
bool sys = (module_type == ".sys");
Modified: trunk/reactos/tools/rbuild/backend/mingw/modulehandler.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/backend/mingw…
==============================================================================
--- trunk/reactos/tools/rbuild/backend/mingw/modulehandler.cpp (original)
+++ trunk/reactos/tools/rbuild/backend/mingw/modulehandler.cpp Tue Jan 15 21:08:25 2008
@@ -229,6 +229,9 @@
case RpcClient:
handler = new MingwRpcClientModuleHandler ( module );
break;
+ case RpcProxy:
+ handler = new MingwRpcProxyModuleHandler ( module );
+ break;
case Alias:
handler = new MingwAliasModuleHandler ( module );
break;
@@ -284,7 +287,7 @@
return sourceFile;
}
else if ( ( extension == ".idl" || extension == ".IDL" ) &&
- ( module.type == RpcServer || module.type == RpcClient ) )
+ ( module.type == RpcServer || module.type == RpcClient || module.type ==
RpcProxy ) )
{
const FileLocation *objectFile = GetObjectFilename ( file, module, NULL );
FileLocation *sourceFile = new FileLocation (
@@ -315,25 +318,21 @@
string extension = GetExtension ( *file );
if ( extension == ".idl" || extension == ".IDL" )
{
- if ( (module.type == RpcServer) || (module.type == RpcClient) )
+ const FileLocation *header;
+ switch ( module.type )
{
- const FileLocation *server_header = GetRpcServerHeaderFilename ( file );
- const FileLocation *client_header = GetRpcClientHeaderFilename ( file );
- string dependencies = backend->GetFullName ( *server_header ) + " " +
- backend->GetFullName ( *client_header );
- delete server_header;
- delete client_header;
- return dependencies;
+ case RpcServer: header = GetRpcServerHeaderFilename ( file ); break;
+ case RpcClient: header = GetRpcClientHeaderFilename ( file ); break;
+ case RpcProxy: header = GetRpcProxyHeaderFilename ( file ); break;
+ case IdlHeader: header = GetIdlHeaderFilename ( file ); break;
+ default: header = NULL; break;
}
- else if ( module.type == IdlHeader )
- {
- const FileLocation *idl_header = GetIdlHeaderFilename ( file );
- string dependencies = backend->GetFullName ( *idl_header );
- delete idl_header;
- return dependencies;
- }
- else
+ if ( !header )
return "";
+
+ string dependencies = backend->GetFullName ( *header );
+ delete header;
+ return dependencies;
}
else
return "";
@@ -381,6 +380,8 @@
if ( module.type == RpcServer )
return true;
if ( module.type == RpcClient )
+ return true;
+ if ( module.type == RpcProxy )
return true;
if ( module.type == IdlHeader )
return true;
@@ -547,6 +548,8 @@
newExtension = "_s.o";
else if ( module.type == RpcClient )
newExtension = "_c.o";
+ else if ( module.type == RpcProxy )
+ newExtension = "_p.o";
else
newExtension = ".h";
}
@@ -1522,6 +1525,14 @@
/* caller needs to delete the returned object */
const FileLocation*
+MingwModuleHandler::GetRpcProxyHeaderFilename ( const FileLocation *base ) const
+{
+ string newname = GetBasename ( base->name ) + "_p.h";
+ return new FileLocation ( IntermediateDirectory, base->relative_path, newname );
+}
+
+/* caller needs to delete the returned object */
+const FileLocation*
MingwModuleHandler::GetIdlHeaderFilename ( const FileLocation *base ) const
{
string newname = GetBasename ( base->name ) + ".h";
@@ -1605,6 +1616,44 @@
}
void
+MingwModuleHandler::GenerateWidlCommandsProxy (
+ const CompilationUnit& compilationUnit,
+ const string& widlflagsMacro )
+{
+ const FileLocation& sourceFile = compilationUnit.GetFilename ();
+ string dependencies = backend->GetFullName ( sourceFile );
+ dependencies += " " + NormalizeFilename ( module.xmlbuildFile );
+
+ string basename = GetBasename ( sourceFile.name );
+
+ const FileLocation *generatedHeaderFilename = GetRpcProxyHeaderFilename (
&sourceFile );
+ CLEAN_FILE ( *generatedHeaderFilename );
+
+ FileLocation generatedProxyFilename ( IntermediateDirectory,
+ sourceFile.relative_path,
+ basename + "_p.c" );
+ CLEAN_FILE ( generatedProxyFilename );
+
+ fprintf ( fMakefile,
+ "%s %s: %s $(WIDL_TARGET) | %s\n",
+ backend->GetFullName ( generatedProxyFilename ).c_str (),
+ backend->GetFullName ( *generatedHeaderFilename ).c_str (),
+ dependencies.c_str (),
+ backend->GetFullPath ( generatedProxyFilename ).c_str () );
+ fprintf ( fMakefile, "\t$(ECHO_WIDL)\n" );
+ fprintf ( fMakefile,
+ "\t%s %s %s -h -H %s -p -P %s %s\n",
+ "$(Q)$(WIDL_TARGET)",
+ GetWidlFlags ( compilationUnit ).c_str (),
+ widlflagsMacro.c_str (),
+ backend->GetFullName ( *generatedHeaderFilename ).c_str (),
+ backend->GetFullName ( generatedProxyFilename ).c_str (),
+ backend->GetFullName ( sourceFile ).c_str () );
+
+ delete generatedHeaderFilename;
+}
+
+void
MingwModuleHandler::GenerateWidlCommandsIdlHeader (
const CompilationUnit& compilationUnit,
const string& widlflagsMacro )
@@ -1646,6 +1695,9 @@
else if ( module.type == RpcClient )
GenerateWidlCommandsClient ( compilationUnit,
widlflagsMacro );
+ else if ( module.type == RpcProxy )
+ GenerateWidlCommandsProxy ( compilationUnit,
+ widlflagsMacro );
else if ( module.type == EmbeddedTypeLib )
GenerateWidlCommandsEmbeddedTypeLib ( compilationUnit,
widlflagsMacro );
@@ -1715,7 +1767,7 @@
{
GenerateWidlCommands ( compilationUnit,
widlflagsMacro );
- if ( (module.type == RpcServer) || (module.type == RpcClient) )
+ if ( (module.type == RpcServer) || (module.type == RpcClient) || (module.type ==
RpcProxy) )
{
GenerateGccCommand ( &sourceFile,
GetExtraDependencies ( &sourceFile ),
@@ -2235,6 +2287,7 @@
Library& library = *module.non_if_data.libraries[i];
if ( library.importedModule->type == RpcServer ||
library.importedModule->type == RpcClient ||
+ library.importedModule->type == RpcProxy ||
library.importedModule->type == IdlHeader )
{
for ( size_t j = 0; j <
library.importedModule->non_if_data.compilationUnits.size (); j++ )
@@ -2254,6 +2307,12 @@
if ( library.importedModule->type == RpcClient )
{
const FileLocation *header = GetRpcClientHeaderFilename ( &sourceFile );
+ dependencies.push_back ( *header );
+ delete header;
+ }
+ if ( library.importedModule->type == RpcProxy )
+ {
+ const FileLocation *header = GetRpcProxyHeaderFilename ( &sourceFile );
dependencies.push_back ( *header );
delete header;
}
@@ -2736,7 +2795,7 @@
GetSpecObjectDependencies ( dependencies, &sourceFile );
if ( extension == ".idl" || extension == ".IDL" )
{
- if ( ( module.type == RpcServer ) || ( module.type == RpcClient ) )
+ if ( ( module.type == RpcServer ) || ( module.type == RpcClient ) || ( module.type ==
RpcProxy ) )
GetWidlObjectDependencies ( dependencies, &sourceFile );
}
}
@@ -4074,6 +4133,20 @@
}
+MingwRpcProxyModuleHandler::MingwRpcProxyModuleHandler (
+ const Module& module_ )
+
+ : MingwModuleHandler ( module_ )
+{
+}
+
+void
+MingwRpcProxyModuleHandler::Process ()
+{
+ GenerateRules ();
+}
+
+
MingwAliasModuleHandler::MingwAliasModuleHandler (
const Module& module_ )
Modified: trunk/reactos/tools/rbuild/backend/mingw/modulehandler.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/backend/mingw…
==============================================================================
--- trunk/reactos/tools/rbuild/backend/mingw/modulehandler.h (original)
+++ trunk/reactos/tools/rbuild/backend/mingw/modulehandler.h Tue Jan 15 21:08:25 2008
@@ -169,6 +169,9 @@
const CompilationUnit& compilationUnit,
const std::string& widlflagsMacro );
void GenerateWidlCommandsClient (
+ const CompilationUnit& compilationUnit,
+ const std::string& widlflagsMacro );
+ void GenerateWidlCommandsProxy (
const CompilationUnit& compilationUnit,
const std::string& widlflagsMacro );
void GenerateWidlCommandsIdlHeader (
@@ -215,12 +218,13 @@
void GenerateBuildNonSymbolStrippedCode ();
void CleanupCompilationUnitVector ( std::vector<CompilationUnit*>&
compilationUnits );
void GetRpcHeaderDependencies ( std::vector<FileLocation>& dependencies )
const;
- void GetMcHeaderDependencies ( std::vector<FileLocation>& dependencies )
const;
+ void GetMcHeaderDependencies ( std::vector<FileLocation>& dependencies )
const;
static std::string GetPropertyValue ( const Module& module, const std::string&
name );
const FileLocation* GetRpcServerHeaderFilename ( const FileLocation *base ) const;
const FileLocation* GetRpcClientHeaderFilename ( const FileLocation *base ) const;
+ const FileLocation* GetRpcProxyHeaderFilename ( const FileLocation *base ) const;
const FileLocation* GetIdlHeaderFilename ( const FileLocation *base ) const;
- const FileLocation* GetMcHeaderFilename ( const FileLocation *base ) const;
+ const FileLocation* GetMcHeaderFilename ( const FileLocation *base ) const;
std::string GetModuleCleanTarget ( const Module& module ) const;
void GetReferencedObjectLibraryModuleCleanTargets ( std::vector<std::string>&
moduleNames ) const;
public:
@@ -494,6 +498,16 @@
virtual void Process ();
};
+
+class MingwRpcProxyModuleHandler : public MingwModuleHandler
+{
+public:
+ MingwRpcProxyModuleHandler ( const Module& module );
+ virtual HostType DefaultHost() { return HostFalse; }
+ virtual void Process ();
+};
+
+
class MingwAliasModuleHandler : public MingwModuleHandler
{
public:
Modified: trunk/reactos/tools/rbuild/bootstrap.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/bootstrap.cpp…
==============================================================================
--- trunk/reactos/tools/rbuild/bootstrap.cpp (original)
+++ trunk/reactos/tools/rbuild/bootstrap.cpp Tue Jan 15 21:08:25 2008
@@ -65,6 +65,7 @@
case Test:
case RpcServer:
case RpcClient:
+ case RpcProxy:
case Alias:
case IdlHeader:
case EmbeddedTypeLib:
Modified: trunk/reactos/tools/rbuild/include.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/include.cpp?r…
==============================================================================
--- trunk/reactos/tools/rbuild/include.cpp (original)
+++ trunk/reactos/tools/rbuild/include.cpp Tue Jan 15 21:08:25 2008
@@ -118,6 +118,7 @@
if ( module != NULL &&
( module->type == RpcServer ||
module->type == RpcClient ||
+ module->type == RpcProxy ||
module->type == IdlHeader) )
return IntermediateDirectory;
else
Modified: trunk/reactos/tools/rbuild/module.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/module.cpp?re…
==============================================================================
--- trunk/reactos/tools/rbuild/module.cpp (original)
+++ trunk/reactos/tools/rbuild/module.cpp Tue Jan 15 21:08:25 2008
@@ -913,6 +913,8 @@
return RpcServer;
if ( attribute.value == "rpcclient" )
return RpcClient;
+ if ( attribute.value == "rpcproxy" )
+ return RpcProxy;
if ( attribute.value == "alias" )
return Alias;
if ( attribute.value == "idlheader" )
@@ -957,6 +959,7 @@
case ObjectLibrary:
case RpcServer:
case RpcClient:
+ case RpcProxy:
case Alias:
case IdlHeader:
return IntermediateDirectory;
@@ -1006,8 +1009,8 @@
case Test:
return ".exe";
case RpcServer:
- return ".o";
case RpcClient:
+ case RpcProxy:
return ".o";
case Alias:
case ElfExecutable:
@@ -1060,6 +1063,7 @@
case LiveIsoRegTest:
case RpcServer:
case RpcClient:
+ case RpcProxy:
case Alias:
case BootProgram:
case IdlHeader:
@@ -1105,6 +1109,7 @@
case LiveIsoRegTest:
case RpcServer:
case RpcClient:
+ case RpcProxy:
case Alias:
case BootProgram:
case IdlHeader:
@@ -1150,6 +1155,7 @@
case LiveIsoRegTest:
case RpcServer:
case RpcClient:
+ case RpcProxy:
case Alias:
case IdlHeader:
case EmbeddedTypeLib:
Modified: trunk/reactos/tools/rbuild/rbuild.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/rbuild.h?rev=…
==============================================================================
--- trunk/reactos/tools/rbuild/rbuild.h (original)
+++ trunk/reactos/tools/rbuild/rbuild.h Tue Jan 15 21:08:25 2008
@@ -299,7 +299,8 @@
IsoRegTest = 24,
LiveIsoRegTest = 25,
EmbeddedTypeLib = 26,
- ElfExecutable = 27
+ ElfExecutable = 27,
+ RpcProxy,
};
enum HostType