Author: cwittich
Date: Tue Jul 3 19:27:43 2007
New Revision: 27368
URL:
http://svn.reactos.org/svn/reactos?rev=27368&view=rev
Log:
-added support for TypeLibs
Modified:
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/module.cpp
trunk/reactos/tools/rbuild/rbuild.h
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 Jul 3 19:27:43 2007
@@ -265,6 +265,9 @@
case IdlHeader:
handler = new MingwIdlHeaderModuleHandler ( module );
break;
+ case TypeLib:
+ handler = new MingwTypeLibModuleHandler ( module );
+ break;
default:
throw UnknownModuleTypeException (
module.node.location,
@@ -320,13 +323,17 @@
backend->intermediateDirectory );
return new FileLocation ( backend->intermediateDirectory, NormalizeFilename (
newname ) );
}
- else //if ( module.type == IdlHeader )
+ else if ( module.type == IdlHeader )
{
newname = basename + ".h";
PassThruCacheDirectory ( NormalizeFilename ( newname ),
backend->intermediateDirectory );
return new FileLocation ( fileLocation->directory, filename );
}
+ else
+ {
+ return new FileLocation ( fileLocation->directory, filename );
+ }
}
else
return new FileLocation ( fileLocation->directory, filename );
@@ -342,8 +349,10 @@
string basename = GetBasename ( filename );
if ( (module.type == RpcServer) || (module.type == RpcClient) )
return GetRpcServerHeaderFilename ( basename ) + " " +
GetRpcClientHeaderFilename ( basename );
+ else if ( module.type == IdlHeader )
+ return GetIdlHeaderFilename ( basename );
else
- return GetIdlHeaderFilename ( basename );
+ return "";
}
else
return "";
@@ -1254,6 +1263,32 @@
}
void
+MingwModuleHandler::GenerateWidlCommandsTypeLib (
+ const CompilationUnit& compilationUnit,
+ const string& widlflagsMacro )
+{
+ FileLocation* sourceFileLocation = compilationUnit.GetFilename (
backend->intermediateDirectory );
+ string filename = sourceFileLocation->filename;
+ string dependencies = filename;
+ dependencies += " " + NormalizeFilename ( module.xmlbuildFile );
+
+ string TypeLibFilename = module.GetTargetName ();
+
+ fprintf ( fMakefile,
+ "%s: %s $(WIDL_TARGET) | %s\n",
+ GetTargetMacro ( module ).c_str (),
+ dependencies.c_str (),
+ GetDirectory ( TypeLibFilename ).c_str () );
+ fprintf ( fMakefile, "\t$(ECHO_WIDL)\n" );
+ fprintf ( fMakefile,
+ "\t%s %s %s -t -T $@ %s\n",
+ "$(Q)$(WIDL_TARGET)",
+ GetWidlFlags ( compilationUnit ).c_str (),
+ widlflagsMacro.c_str (),
+ filename.c_str () );
+}
+
+void
MingwModuleHandler::GenerateWidlCommandsClient (
const CompilationUnit& compilationUnit,
const string& widlflagsMacro )
@@ -1331,7 +1366,10 @@
else if ( module.type == RpcClient )
GenerateWidlCommandsClient ( compilationUnit,
widlflagsMacro );
- else
+ else if ( module.type == TypeLib )
+ GenerateWidlCommandsTypeLib ( compilationUnit,
+ widlflagsMacro );
+ else // applies also for other module.types which include idl files
GenerateWidlCommandsIdlHeader ( compilationUnit,
widlflagsMacro );
}
@@ -2454,6 +2492,20 @@
{
}
+MingwTypeLibModuleHandler::MingwTypeLibModuleHandler (
+ const Module& module_ )
+
+ : MingwModuleHandler ( module_ )
+{
+}
+
+void
+MingwTypeLibModuleHandler::Process ()
+{
+ GenerateRules ();
+}
+
+
void
MingwKernelModeDLLModuleHandler::AddImplicitLibraries ( 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 Jul 3 19:27:43 2007
@@ -170,6 +170,9 @@
const CompilationUnit& compilationUnit,
const std::string& widlflagsMacro );
void GenerateWidlCommandsIdlHeader (
+ const CompilationUnit& compilationUnit,
+ const std::string& widlflagsMacro );
+ void GenerateWidlCommandsTypeLib (
const CompilationUnit& compilationUnit,
const std::string& widlflagsMacro );
void GenerateWidlCommands ( const CompilationUnit& compilationUnit,
@@ -502,4 +505,12 @@
virtual void Process ();
};
+class MingwTypeLibModuleHandler : public MingwModuleHandler
+{
+public:
+ MingwTypeLibModuleHandler ( const Module& module );
+ virtual HostType DefaultHost() { return HostFalse; }
+ virtual void Process ();
+};
+
#endif /* MINGW_MODULEHANDLER_H */
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 Jul 3 19:27:43 2007
@@ -68,6 +68,7 @@
case RpcClient:
case Alias:
case IdlHeader:
+ case TypeLib:
return false;
}
throw InvalidOperationException ( __FILE__,
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 Jul 3 19:27:43 2007
@@ -839,6 +839,8 @@
return Alias;
if ( attribute.value == "idlheader" )
return IdlHeader;
+ if ( attribute.value == "typelib" )
+ return TypeLib;
throw InvalidAttributeValueException ( location,
attribute.name,
attribute.value );
@@ -890,6 +892,8 @@
case BootProgram:
case IdlHeader:
return "";
+ case TypeLib:
+ return ".tlb";
}
throw InvalidOperationException ( __FILE__,
__LINE__ );
@@ -939,6 +943,7 @@
case Alias:
case BootProgram:
case IdlHeader:
+ case TypeLib:
return "";
}
throw InvalidOperationException ( __FILE__,
@@ -981,6 +986,7 @@
case Alias:
case BootProgram:
case IdlHeader:
+ case TypeLib:
return "";
}
throw InvalidOperationException ( __FILE__,
@@ -1025,6 +1031,7 @@
case RpcClient:
case Alias:
case IdlHeader:
+ case TypeLib:
return false;
}
throw InvalidOperationException ( __FILE__,
@@ -1056,6 +1063,7 @@
case LiveIso:
case IsoRegTest:
case LiveIsoRegTest:
+ case TypeLib:
return true;
case StaticLibrary:
case ObjectLibrary:
@@ -1557,6 +1565,7 @@
case RpcClient:
case Alias:
case IdlHeader:
+ case TypeLib:
return false;
}
throw InvalidOperationException ( __FILE__,
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 Jul 3 19:27:43 2007
@@ -273,7 +273,8 @@
ExportDriver = 22,
IdlHeader = 23,
IsoRegTest = 24,
- LiveIsoRegTest = 25
+ LiveIsoRegTest = 25,
+ TypeLib = 26
};
enum HostType