Modified: trunk/reactos/hal/hal/hal.xml
Modified: trunk/reactos/hal/halx86/mp/halmp.xml
Modified: trunk/reactos/hal/halx86/up/halup.xml
Modified: trunk/reactos/tools/rbuild/backend/mingw/mingw.cpp
Modified: trunk/reactos/tools/rbuild/backend/mingw/mingw.h
Modified: trunk/reactos/tools/rbuild/backend/mingw/modulehandler.cpp
Modified: trunk/reactos/tools/rbuild/backend/mingw/modulehandler.h
Modified: trunk/reactos/tools/rbuild/bootstrap.cpp
Modified: trunk/reactos/tools/rbuild/module.cpp
Modified: trunk/reactos/tools/rbuild/rbuild.h
Modified: trunk/reactos/tools/rbuild/rbuild.txt
--- trunk/reactos/hal/hal/hal.xml 2005-07-27 18:46:52 UTC (rev 16809)
+++ trunk/reactos/hal/hal/hal.xml 2005-07-27 19:10:57 UTC (rev 16810)
@@ -7,3 +7,9 @@
<file>hal.c</file>
<file>hal.rc</file>
</module>
+
+<module ifnot="${MP}" name="halupalias" type="alias" installbase="system32" installname="hal.dll" aliasof="halup">
+</module>
+
+<module if="${MP}" name="halmpalias" type="alias" installbase="system32" installname="hal.dll" aliasof="halmp">
+</module>
--- trunk/reactos/hal/halx86/mp/halmp.xml 2005-07-27 18:46:52 UTC (rev 16809)
+++ trunk/reactos/hal/halx86/mp/halmp.xml 2005-07-27 19:10:57 UTC (rev 16810)
@@ -1,5 +1,6 @@
-<module if="${MP}" name="halmp" type="kernelmodedll" installbase="system32" installname="hal.dll">
+<module name="halmp" type="kernelmodedll">
<importlibrary definition="../../hal/hal.def" />
+ <bootstrap base="reactos" />
<include base="hal_generic">../include</include>
<include base="ntoskrnl">include</include>
<define name="_DISABLE_TIDENTS" />
--- trunk/reactos/hal/halx86/up/halup.xml 2005-07-27 18:46:52 UTC (rev 16809)
+++ trunk/reactos/hal/halx86/up/halup.xml 2005-07-27 19:10:57 UTC (rev 16810)
@@ -1,4 +1,4 @@
-<module ifnot="${MP}" name="halup" type="kernelmodedll" installbase="system32" installname="hal.dll">
+<module name="halup" type="kernelmodedll">
<importlibrary definition="../../hal/hal.def" />
<bootstrap base="reactos" nameoncd="hal.dll" />
<include base="hal_generic">../include</include>
--- trunk/reactos/tools/rbuild/backend/mingw/mingw.cpp 2005-07-27 18:46:52 UTC (rev 16809)
+++ trunk/reactos/tools/rbuild/backend/mingw/mingw.cpp 2005-07-27 19:10:57 UTC (rev 16810)
@@ -566,6 +566,8 @@
return false;
if ( module.type == Test )
return false;
+ if ( module.type == Alias )
+ return false;
return true;
}
@@ -977,6 +979,19 @@
}
}
+const Module&
+MingwBackend::GetAliasedModuleOrModule ( const Module& module ) const
+{
+ if ( module.aliasedModuleName.size () > 0 )
+ {
+ const Module* aliasedModule = ProjectNode.LocateModule ( module.aliasedModuleName );
+ assert ( aliasedModule );
+ return *aliasedModule;
+ }
+ else
+ return module;
+}
+
void
MingwBackend::OutputModuleInstallTargets ()
{
@@ -987,8 +1002,9 @@
continue;
if ( module.installName.length () > 0 )
{
+ const Module& aliasedModule = GetAliasedModuleOrModule ( module );
string sourceFilename = MingwModuleHandler::PassThruCacheDirectory (
- NormalizeFilename ( module.GetPath () ),
+ NormalizeFilename ( aliasedModule.GetPath () ),
outputDirectory );
OutputInstallTarget ( sourceFilename,
module.installName,
--- trunk/reactos/tools/rbuild/backend/mingw/mingw.h 2005-07-27 18:46:52 UTC (rev 16809)
+++ trunk/reactos/tools/rbuild/backend/mingw/mingw.h 2005-07-27 19:10:57 UTC (rev 16810)
@@ -68,6 +68,7 @@
virtual void Process ();
std::string AddDirectoryTarget ( const std::string& directory,
Directory* directoryTree );
+ const Module& GetAliasedModuleOrModule ( const Module& module ) const;
std::string compilerPrefix;
std::string compilerCommand;
std::string nasmCommand;
--- trunk/reactos/tools/rbuild/backend/mingw/modulehandler.cpp 2005-07-27 18:46:52 UTC (rev 16809)
+++ trunk/reactos/tools/rbuild/backend/mingw/modulehandler.cpp 2005-07-27 19:10:57 UTC (rev 16810)
@@ -237,6 +237,9 @@
case RpcClient:
handler = new MingwRpcClientModuleHandler ( module );
break;
+ case Alias:
+ handler = new MingwAliasModuleHandler ( module );
+ break;
default:
throw UnknownModuleTypeException (
module.node.location,
@@ -2877,12 +2880,13 @@
continue;
if ( m.installName.length () > 0 )
{
+ const Module& aliasedModule = backend->GetAliasedModuleOrModule ( m );
string sourceFilename = MingwModuleHandler::PassThruCacheDirectory (
- NormalizeFilename ( m.GetPath () ),
+ NormalizeFilename ( aliasedModule.GetPath () ),
backend->outputDirectory );
OutputCopyCommand ( sourceFilename,
- m.installName,
- livecdDirectory + SSEP + reactosDirectory + SSEP + m.installBase );
+ m.installName,
+ livecdDirectory + SSEP + reactosDirectory + SSEP + m.installBase );
}
}
}
@@ -3057,6 +3061,7 @@
GenerateRules ();
}
+
MingwRpcClientModuleHandler::MingwRpcClientModuleHandler (
const Module& module_ )
@@ -3069,3 +3074,16 @@
{
GenerateRules ();
}
+
+
+MingwAliasModuleHandler::MingwAliasModuleHandler (
+ const Module& module_ )
+
+ : MingwModuleHandler ( module_ )
+{
+}
+
+void
+MingwAliasModuleHandler::Process ()
+{
+}
--- trunk/reactos/tools/rbuild/backend/mingw/modulehandler.h 2005-07-27 18:46:52 UTC (rev 16809)
+++ trunk/reactos/tools/rbuild/backend/mingw/modulehandler.h 2005-07-27 19:10:57 UTC (rev 16810)
@@ -442,4 +442,12 @@
virtual void Process ();
};
+class MingwAliasModuleHandler : public MingwModuleHandler
+{
+public:
+ MingwAliasModuleHandler ( const Module& module );
+ virtual HostType DefaultHost() { return HostFalse; }
+ virtual void Process ();
+};
+
#endif /* MINGW_MODULEHANDLER_H */
--- trunk/reactos/tools/rbuild/bootstrap.cpp 2005-07-27 18:46:52 UTC (rev 16809)
+++ trunk/reactos/tools/rbuild/bootstrap.cpp 2005-07-27 19:10:57 UTC (rev 16810)
@@ -23,8 +23,8 @@
using std::string;
Bootstrap::Bootstrap ( const Project& project_,
- const Module* module_,
- const XMLElement& bootstrapNode )
+ const Module* module_,
+ const XMLElement& bootstrapNode )
: project(project_),
module(module_),
node(bootstrapNode)
@@ -60,6 +60,7 @@
case Test:
case RpcServer:
case RpcClient:
+ case Alias:
return false;
}
throw InvalidOperationException ( __FILE__,
--- trunk/reactos/tools/rbuild/module.cpp 2005-07-27 18:46:52 UTC (rev 16809)
+++ trunk/reactos/tools/rbuild/module.cpp 2005-07-27 19:10:57 UTC (rev 16810)
@@ -282,6 +282,12 @@
enableWarnings = att->value == "true";
else
enableWarnings = false;
+
+ att = moduleNode.GetAttribute ( "aliasof", false );
+ if ( type == Alias && att != NULL )
+ aliasedModuleName = att->value;
+ else
+ aliasedModuleName = "";
}
Module::~Module ()
@@ -304,6 +310,22 @@
void
Module::ProcessXML()
{
+ if ( type == Alias )
+ {
+ if ( aliasedModuleName == name )
+ throw InvalidBuildFileException (
+ node.location,
+ "module '%s' cannot link against itself",
+ name.c_str() );
+ const Module* m = project.LocateModule ( aliasedModuleName );
+ if ( !m )
+ throw InvalidBuildFileException (
+ node.location,
+ "module '%s' trying to alias non-existant module '%s'",
+ name.c_str(),
+ aliasedModuleName.c_str() );
+ }
+
size_t i;
for ( i = 0; i < node.subElements.size(); i++ )
ProcessXMLSubElement ( *node.subElements[i], path );
@@ -543,6 +565,8 @@
return RpcServer;
if ( attribute.value == "rpcclient" )
return RpcClient;
+ if ( attribute.value == "alias" )
+ return Alias;
throw InvalidAttributeValueException ( location,
attribute.name,
attribute.value );
@@ -582,6 +606,8 @@
return ".o";
case RpcClient:
return ".o";
+ case Alias:
+ return "";
}
throw InvalidOperationException ( __FILE__,
__LINE__ );
@@ -618,6 +644,7 @@
case LiveIso:
case RpcServer:
case RpcClient:
+ case Alias:
return "";
}
throw InvalidOperationException ( __FILE__,
@@ -652,6 +679,7 @@
case LiveIso:
case RpcServer:
case RpcClient:
+ case Alias:
return "";
}
throw InvalidOperationException ( __FILE__,
@@ -688,6 +716,7 @@
case LiveIso:
case RpcServer:
case RpcClient:
+ case Alias:
return false;
}
throw InvalidOperationException ( __FILE__,
@@ -718,6 +747,7 @@
case ObjectLibrary:
case RpcServer:
case RpcClient:
+ case Alias:
return false;
}
throw InvalidOperationException ( __FILE__,
--- trunk/reactos/tools/rbuild/rbuild.h 2005-07-27 18:46:52 UTC (rev 16809)
+++ trunk/reactos/tools/rbuild/rbuild.h 2005-07-27 19:10:57 UTC (rev 16810)
@@ -193,7 +193,8 @@
LiveIso = 14,
Test = 15,
RpcServer = 16,
- RpcClient = 17
+ RpcClient = 17,
+ Alias = 18
};
enum HostType
@@ -230,6 +231,7 @@
HostType host;
std::string installBase;
std::string installName;
+ std::string aliasedModuleName;
bool useWRC;
bool enableWarnings;
bool enabled;
@@ -737,6 +739,7 @@
std::string StripSymbol ( std::string symbol );
};
+
extern std::string
FixSeparator ( const std::string& s );
--- trunk/reactos/tools/rbuild/rbuild.txt 2005-07-27 18:46:52 UTC (rev 16809)
+++ trunk/reactos/tools/rbuild/rbuild.txt 2005-07-27 19:10:57 UTC (rev 16810)
@@ -107,7 +107,7 @@
There can be zero or more modules per xml build file.
Syntax:
- <module if="${MP}" ifnot="${MP}" name="msvcrt" type="win32dll" extension=".dll" entrypoint="_DllMain@12" baseaddress="0x70000000" mangledsymbols="true" installbase="system32" installname="msvcrt.dll" usewrc="false" warnings="true">
+ <module if="${MP}" ifnot="${MP}" name="msvcrt" type="win32dll" extension=".dll" entrypoint="_DllMain@12" baseaddress="0x70000000" mangledsymbols="true" installbase="system32" installname="msvcrt.dll" usewrc="false" warnings="true" aliasof="module1">
...
</module>
@@ -124,7 +124,7 @@
installname - Name of generated file in the installation directory. This attribute is optional, but if not specified, the generated file is not copied to the installation directory.
usewrc - Use WRC to compile resources if true. If false, windres is used. This attribute is optional. If not specified, WRC will be used.
warnings - Error out if false and at least one warning is emitted during building of this module. This attribute is optional. If not specified, it is assumed to be false.
-
+ aliasof - Name of module that is aliased.
Value:
None.
@@ -151,6 +151,7 @@
test - Builds a testsuite. Default extension is .exe. Default entrypoint is _mainCRTStartup. The baseaddress module attribute is not applicable for this module type.
rpcserver - Generates and builds server code for an RPC interface. Default extension is .o. The entrypoint, baseaddress, and mangledsymbols module attributes are not applicable for this module type.
rpcclient - Generates and builds client code for an RPC interface. Default extension is .o. The entrypoint, baseaddress, and mangledsymbols module attributes are not applicable for this module type.
+ alias - Module is an alias for another module. This module type is the only module type for which the aliasof attribute is applicable. Only the module install functionality is aliased.
Bootstrap element