<html>
<head>
<style>
<!--
body { background-color:#ffffff }
.file { border:1px solid #eeeeee; margin-top:1em; margin-bottom:1em }
.pathname { font-family:monospace; float:right }
.fileheader { margin-bottom:.5em }
.diff { margin:0 }
.tasklist { padding:4px; border:1px dashed #000000; margin-top:1em }
.tasklist ul { margin-top:0; margin-bottom:0 }
tr.alt { background-color:#eeeeee }
#added { background-color:#ddffdd }
#addedchars { background-color:#99ff99; font-weight:bolder }
tr.alt #added { background-color:#ccf7cc }
#removed { background-color:#ffdddd }
#removedchars { background-color:#ff9999; font-weight:bolder }
tr.alt #removed { background-color:#f7cccc }
#info { color:#888888 }
#context { background-color:#eeeeee }
td {padding-left:.3em; padding-right:.3em }
tr.head { border-bottom-width:1px; border-bottom-style:solid }
tr.head td { padding:0; padding-top:.2em }
.task { background-color:#ffff00 }
.comment { padding:4px; border:1px dashed #000000; background-color:#ffffdd }
.error { color:red }
hr { border-width:0px; height:2px; background:black }
-->
</style>
</head>
<body>
<pre class="comment">Added support for ROS_AUTOMAKE variable.
Added support for &lt;if&gt; &lt;module ...&gt; &lt;/if&gt;
Added BootProgram target type
Added simple initial ReactOS-ppc.xml, using my egcs compiler
More work required, but getting there</pre><pre class="diff" id="added">Added: trunk/reactos/ReactOS-ppc.xml
</pre><pre class="diff" id="context">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/define.cpp
Modified: trunk/reactos/tools/rbuild/module.cpp
Modified: trunk/reactos/tools/rbuild/project.cpp
Modified: trunk/reactos/tools/rbuild/rbuild.h
Modified: trunk/reactos/tools/rbuild/rbuild.mak
</pre><hr /><div class="file">
<div class="fileheader"><big><b>Added: trunk/reactos/ReactOS-ppc.xml</b></big></div>
<pre class="diff"><small id="info">--- trunk/reactos/ReactOS-ppc.xml        2005-12-04 12:02:21 UTC (rev 19853)
+++ trunk/reactos/ReactOS-ppc.xml        2005-12-04 12:02:45 UTC (rev 19854)
@@ -0,0 +1,91 @@
</small></pre><pre class="diff" id="added">+&lt;?xml version=&quot;1.0&quot;?&gt;
+&lt;!DOCTYPE project SYSTEM &quot;tools/rbuild/project.dtd&quot;&gt;
+&lt;project name=&quot;ReactOS&quot; makefile=&quot;makefile.ppc&quot; xmlns:xi=&quot;http://www.w3.org/2001/XInclude&quot;&gt;
+        &lt;xi:include href=&quot;config-ppc.xml&quot;&gt;
+                &lt;xi:fallback&gt;
+                        &lt;xi:include href=&quot;config.template.xml&quot; /&gt;
+                &lt;/xi:fallback&gt;
+        &lt;/xi:include&gt;
+
+        &lt;xi:include href=&quot;baseaddress.xml&quot; /&gt;
+
+        &lt;property name=&quot;BOOTPROG_PREPARE&quot; value=&quot;ppc-le2be&quot; /&gt;
+        &lt;property name=&quot;BOOTPROG_FLATFORMAT&quot; value=&quot;-O elf32-powerpc -B powerpc:common&quot; /&gt;
+        &lt;property name=&quot;BOOTPROG_LINKFORMAT&quot; value=&quot;-melf32ppc --no-omagic -Ttext 0xe00000 -Tdata 0xe10000&quot; /&gt;
+        &lt;property name=&quot;BOOTPROG_COPYFORMAT&quot; value=&quot;--only-section=.text --only-section=.data --only-section=.bss -O aixcoff-rs6000&quot; /&gt;
+
+        &lt;define name=&quot;_M_PPC&quot; /&gt;
+        &lt;define name=&quot;_PPC_&quot; /&gt;
+        &lt;define name=&quot;__PowerPC__&quot; /&gt;
+        &lt;define name=&quot;_REACTOS_&quot; /&gt;
+        &lt;define name=&quot;__MINGW_IMPORT&quot; empty=&quot;true&quot; /&gt;
+        &lt;define name=&quot;__restrict__&quot; empty=&quot;true&quot; /&gt;
+        &lt;compilerflag&gt;-v&lt;/compilerflag&gt;
+        &lt;if property=&quot;MP&quot; value=&quot;1&quot;&gt;
+                &lt;define name=&quot;CONFIG_SMP&quot; value=&quot;1&quot; /&gt;
+        &lt;/if&gt;
+        &lt;if property=&quot;DBG&quot; value=&quot;1&quot;&gt;
+                &lt;define name=&quot;DBG&quot; value=&quot;1&quot; /&gt;
+                &lt;property name=&quot;DBG_OR_KDBG&quot; value=&quot;true&quot; /&gt;
+        &lt;/if&gt;
+        &lt;if property=&quot;DBG&quot; value=&quot;0&quot;&gt;
+                &lt;compilerflag&gt;-Os&lt;/compilerflag&gt;
+                &lt;compilerflag&gt;-Wno-strict-aliasing&lt;/compilerflag&gt;
+        &lt;/if&gt;
+        &lt;if property=&quot;KDBG&quot; value=&quot;1&quot;&gt;
+                &lt;define name=&quot;KDBG&quot; value=&quot;1&quot; /&gt;
+                &lt;property name=&quot;DBG_OR_KDBG&quot; value=&quot;true&quot; /&gt;
+        &lt;/if&gt;
+        &lt;compilerflag&gt;-Wpointer-arith&lt;/compilerflag&gt;
+
+        &lt;include&gt;.&lt;/include&gt;
+        &lt;include&gt;include&lt;/include&gt;
+        &lt;include&gt;include/reactos&lt;/include&gt;
+        &lt;include&gt;include/libs&lt;/include&gt;
+        &lt;include&gt;include/drivers&lt;/include&gt;
+        &lt;include&gt;include/subsys&lt;/include&gt;
+        &lt;include&gt;include/ndk&lt;/include&gt;
+        &lt;include&gt;w32api/include&lt;/include&gt;
+        &lt;include&gt;w32api/include/crt&lt;/include&gt;
+        &lt;include&gt;w32api/include/ddk&lt;/include&gt;
+
+        &lt;directory name=&quot;apps&quot;&gt;
+                &lt;xi:include href=&quot;apps/directory.xml&quot; /&gt;
+        &lt;/directory&gt;
+        &lt;directory name=&quot;boot&quot;&gt;
+                &lt;xi:include href=&quot;boot/boot.xml&quot; /&gt;
+        &lt;/directory&gt;
+        &lt;directory name=&quot;bootdata&quot;&gt;
+                &lt;xi:include href=&quot;bootdata/bootdata.xml&quot; /&gt;
+        &lt;/directory&gt;
+        &lt;directory name=&quot;drivers&quot;&gt;
+                &lt;xi:include href=&quot;drivers/directory.xml&quot; /&gt;
+        &lt;/directory&gt;
+        &lt;directory name=&quot;hal&quot;&gt;
+                &lt;xi:include href=&quot;hal/directory.xml&quot; /&gt;
+        &lt;/directory&gt;
+        &lt;directory name=&quot;include&quot;&gt;
+                &lt;xi:include href=&quot;include/directory.xml&quot; /&gt;
+        &lt;/directory&gt;
+        &lt;directory name=&quot;lib&quot;&gt;
+                &lt;xi:include href=&quot;lib/directory.xml&quot; /&gt;
+        &lt;/directory&gt;
+        &lt;directory name=&quot;media&quot;&gt;
+                &lt;xi:include href=&quot;media/directory.xml&quot; /&gt;
+        &lt;/directory&gt;
+        &lt;directory name=&quot;modules&quot;&gt;
+                &lt;xi:include href=&quot;modules/directory.xml&quot; /&gt;
+        &lt;/directory&gt;
+        &lt;directory name=&quot;ntoskrnl&quot;&gt;
+                &lt;xi:include href=&quot;ntoskrnl/ntoskrnl.xml&quot; /&gt;
+        &lt;/directory&gt;
+        &lt;directory name=&quot;regtests&quot;&gt;
+                &lt;xi:include href=&quot;regtests/directory.xml&quot; /&gt;
+        &lt;/directory&gt;
+        &lt;directory name=&quot;services&quot;&gt;
+                &lt;xi:include href=&quot;services/directory.xml&quot; /&gt;
+        &lt;/directory&gt;
+        &lt;directory name=&quot;subsys&quot;&gt;
+                &lt;xi:include href=&quot;subsys/directory.xml&quot; /&gt;
+        &lt;/directory&gt;
+&lt;/project&gt;
</pre></div>
<hr /><div class="file">
<div class="fileheader"><big><b>Modified: trunk/reactos/tools/rbuild/backend/mingw/mingw.cpp</b></big></div>
<pre class="diff"><small id="info">--- trunk/reactos/tools/rbuild/backend/mingw/mingw.cpp        2005-12-04 12:02:21 UTC (rev 19853)
+++ trunk/reactos/tools/rbuild/backend/mingw/mingw.cpp        2005-12-04 12:02:45 UTC (rev 19854)
@@ -71,6 +71,7 @@
</small></pre><pre class="diff" id="context"> MingwBackend::MingwBackend ( Project&amp; project,
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Configuration&amp; configuration )
         : Backend ( project, configuration ),
</pre><pre class="diff" id="added">+         &nbsp;manualBinutilsSetting( false ),
</pre><pre class="diff" id="context">          &nbsp;intermediateDirectory ( new Directory (&quot;$(INTERMEDIATE)&quot; ) ),
          &nbsp;outputDirectory ( new Directory ( &quot;$(OUTPUT)&quot; ) ),
          &nbsp;installDirectory ( new Directory ( &quot;$(INSTALL)&quot; ) )
@@ -137,6 +138,7 @@
</pre><pre class="diff" id="context"> 
         vector&lt;MingwModuleHandler*&gt; v;
         size_t i;
</pre><pre class="diff" id="added">+
</pre><pre class="diff" id="context">         for ( i = 0; i &lt; ProjectNode.modules.size (); i++ )
         {
                 Module&amp; module = *ProjectNode.modules[i];
@@ -752,6 +754,7 @@
</pre><pre class="diff" id="context"> bool
 MingwBackend::IsSupportedBinutilsVersion ( const string&amp; binutilsVersion )
 {
</pre><pre class="diff" id="added">+        if ( manualBinutilsSetting ) return true;
</pre><pre class="diff" id="context">         if ( ( ( strcmp ( binutilsVersion.c_str (), &quot;20040902&quot;) &gt;= 0 ) &amp;&amp;
          &nbsp; &nbsp; &nbsp; ( strcmp ( binutilsVersion.c_str (), &quot;20041008&quot;) &lt;= 0 ) ) ||
 &nbsp; &nbsp;          &nbsp; &nbsp; &nbsp; ( strcmp ( binutilsVersion.c_str (), &quot;20031001&quot;) &lt; 0 ) )
@@ -767,11 +770,13 @@
</pre><pre class="diff" id="context"> 
         bool detectedBinutils = false;
         const string&amp; ROS_PREFIXValue = Environment::GetVariable ( &quot;ROS_PREFIX&quot; );
</pre><pre class="diff" id="added">+
</pre><pre class="diff" id="context">         if ( ROS_PREFIXValue.length () &gt; 0 )
         {
                 binutilsPrefix = ROS_PREFIXValue;
                 binutilsCommand = binutilsPrefix + &quot;-ld&quot;;
</pre><pre class="diff" id="removed">-                <span id="removedchars">detectedBinutils = TryToDetectThisBinutils ( binutilsCommand )</span>;
</pre><pre class="diff" id="added">+                <span id="addedchars">manualBinutilsSetting = true</span>;
+                detectedBinutils = true;
</pre><pre class="diff" id="context">         }
 #if defined(WIN32)
         if ( !detectedBinutils )
@@ -802,6 +807,7 @@
</pre><pre class="diff" id="context">         }
         else
                 printf ( &quot;not detected\n&quot; );
</pre><pre class="diff" id="added">+
</pre><pre class="diff" id="context"> }
 
 void
</pre></div>
<hr /><div class="file">
<div class="fileheader"><big><b>Modified: trunk/reactos/tools/rbuild/backend/mingw/mingw.h</b></big></div>
<pre class="diff"><small id="info">--- trunk/reactos/tools/rbuild/backend/mingw/mingw.h        2005-12-04 12:02:21 UTC (rev 19853)
+++ trunk/reactos/tools/rbuild/backend/mingw/mingw.h        2005-12-04 12:02:45 UTC (rev 19854)
@@ -48,7 +48,7 @@
</small></pre><pre class="diff" id="context">         std::string nasmCommand;
         std::string binutilsPrefix;
         std::string binutilsCommand;
</pre><pre class="diff" id="removed">-        bool usePipe;
</pre><pre class="diff" id="added">+        bool usePipe<span id="addedchars">, manualBinutilsSetting</span>;
</pre><pre class="diff" id="context">         Directory* intermediateDirectory;
         Directory* outputDirectory;
         Directory* installDirectory;
</pre></div>
<hr /><div class="file">
<div class="fileheader"><big><b>Modified: trunk/reactos/tools/rbuild/backend/mingw/modulehandler.cpp</b></big></div>
<pre class="diff"><small id="info">--- trunk/reactos/tools/rbuild/backend/mingw/modulehandler.cpp        2005-12-04 12:02:21 UTC (rev 19853)
+++ trunk/reactos/tools/rbuild/backend/mingw/modulehandler.cpp        2005-12-04 12:02:45 UTC (rev 19854)
@@ -230,6 +230,9 @@
</small></pre><pre class="diff" id="context">                 case BootSector:
                         handler = new MingwBootSectorModuleHandler ( module );
                         break;
</pre><pre class="diff" id="added">+                case BootProgram:
+                        handler = new MingwBootProgramModuleHandler ( module );
+                        break;
</pre><pre class="diff" id="context">                 case Iso:
                         handler = new MingwIsoModuleHandler ( module );
                         break;
@@ -2704,6 +2707,69 @@
</pre><pre class="diff" id="context"> }
 
 
</pre><pre class="diff" id="added">+MingwBootProgramModuleHandler::MingwBootProgramModuleHandler (
+        const Module&amp; module_ )
+        : MingwModuleHandler ( module_ )
+{
+}
+
+void
+MingwBootProgramModuleHandler::Process ()
+{
+        GenerateBootProgramModuleTarget ();
+}
+
+void
+MingwBootProgramModuleHandler::GenerateBootProgramModuleTarget ()
+{
+        string targetName ( module.GetTargetName () );
+        string targetMacro ( GetTargetMacro (module) );
+        string workingDirectory = GetWorkingDirectory ();
+        string junk_tmp = ros_temp + module.name + &quot;.junk.tmp&quot;;
+        string junk_elf = ros_temp + module.name + &quot;.junk.elf&quot;;
+        string junk_cpy = ros_temp + module.name + &quot;.junk.cpy&quot;;
+        CLEAN_FILE ( junk_tmp );
+        CLEAN_FILE ( junk_elf );
+        CLEAN_FILE ( junk_cpy );
+        string objectsMacro = GetObjectsMacro ( module );
+        string linkDepsMacro = GetLinkingDependenciesMacro ();
+        string libsMacro = GetLibsMacro ();
+        const Module *payload = module.project.LocateModule ( module.payload );
+
+        GenerateRules ();
+
+        fprintf ( fMakefile, &quot;%s: %s %s %s | %s\n&quot;,
+         &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;targetMacro.c_str (),
+         &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;objectsMacro.c_str (),
+         &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;linkDepsMacro.c_str (),
+                 &nbsp;payload-&gt;name.c_str (),
+         &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;GetDirectory(GetTargetFilename(module,NULL)).c_str () );
+        
+        fprintf ( fMakefile, &quot;\t$(ECHO_BOOTPROG)\n&quot; );
+
+        fprintf ( fMakefile, &quot;\t$(BOOTPROG_PREPARE) $(OUTPUT)$(SEP)%s %s\n&quot;,
+                 &nbsp;NormalizeFilename( payload-&gt;GetPath() ).c_str (),
+                junk_cpy.c_str () );
+
+        fprintf ( fMakefile, &quot;\t${objcopy} $(BOOTPROG_FLATFORMAT) %s %s\n&quot;,
+                junk_cpy.c_str (),
+                junk_tmp.c_str () );
+
+        fprintf ( fMakefile, &quot;\t${ld} $(BOOTPROG_LINKFORMAT) %s %s -g -o %s\n&quot;,
+                linkDepsMacro.c_str (),
+                junk_tmp.c_str (),
+                junk_elf.c_str () );
+
+        fprintf ( fMakefile, &quot;\t${objcopy} $(BOOTPROG_COPYFORMAT) %s %s\n&quot;,
+                junk_elf.c_str (),
+                module.GetPath().c_str () );
+
+        fprintf ( fMakefile,
+         &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&quot;\t-@${rm} %s %s %s 2&gt;$(NUL)\n&quot;,
+         &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;junk_tmp.c_str (), junk_elf.c_str (), junk_cpy.c_str () );
+}
+
+
</pre><pre class="diff" id="context"> MingwIsoModuleHandler::MingwIsoModuleHandler (
         const Module&amp; module_ )
 
</pre></div>
<hr /><div class="file">
<div class="fileheader"><big><b>Modified: trunk/reactos/tools/rbuild/backend/mingw/modulehandler.h</b></big></div>
<pre class="diff"><small id="info">--- trunk/reactos/tools/rbuild/backend/mingw/modulehandler.h        2005-12-04 12:02:21 UTC (rev 19853)
+++ trunk/reactos/tools/rbuild/backend/mingw/modulehandler.h        2005-12-04 12:02:45 UTC (rev 19854)
@@ -375,6 +375,19 @@
</small></pre><pre class="diff" id="context"> };
 
 
</pre><pre class="diff" id="added">+class MingwBootProgramModuleHandler : public MingwModuleHandler
+{
+public:
+        MingwBootProgramModuleHandler ( const Module&amp; module );
+        virtual HostType DefaultHost() { return HostFalse; }
+        virtual void Process ();
+        std::string GetProgTextAddrMacro ();
+        std::string TypeSpecificLinkerFlags() { return &quot;-nostartfiles -nostdlib&quot;; }
+private:
+        void GenerateBootProgramModuleTarget ();
+};
+
+
</pre><pre class="diff" id="context"> class MingwIsoModuleHandler : public MingwModuleHandler
 {
 public:
</pre></div>
<hr /><div class="file">
<div class="fileheader"><big><b>Modified: trunk/reactos/tools/rbuild/bootstrap.cpp</b></big></div>
<pre class="diff"><small id="info">--- trunk/reactos/tools/rbuild/bootstrap.cpp        2005-12-04 12:02:21 UTC (rev 19853)
+++ trunk/reactos/tools/rbuild/bootstrap.cpp        2005-12-04 12:02:45 UTC (rev 19854)
@@ -51,6 +51,7 @@
</small></pre><pre class="diff" id="context">                 case KernelModeDriver:
                 case BootSector:
                 case BootLoader:
</pre><pre class="diff" id="added">+                case BootProgram:
</pre><pre class="diff" id="context">                         return true;
                 case BuildTool:
                 case StaticLibrary:
</pre></div>
<hr /><div class="file">
<div class="fileheader"><big><b>Modified: trunk/reactos/tools/rbuild/define.cpp</b></big></div>
<pre class="diff"><small id="info">--- trunk/reactos/tools/rbuild/define.cpp        2005-12-04 12:02:21 UTC (rev 19853)
+++ trunk/reactos/tools/rbuild/define.cpp        2005-12-04 12:02:45 UTC (rev 19854)
@@ -50,9 +50,11 @@
</small></pre><pre class="diff" id="context"> Define::Initialize()
 {
         const XMLAttribute* att = node.GetAttribute ( &quot;name&quot;, true );
</pre><pre class="diff" id="added">+        const XMLAttribute* empty = node.GetAttribute ( &quot;empty&quot;, false );
</pre><pre class="diff" id="context">         assert(att);
         name = att-&gt;value;
         value = node.value;
</pre><pre class="diff" id="added">+        if( empty ) value = &quot; &quot;;
</pre><pre class="diff" id="context"> }
 
 void
</pre></div>
<hr /><div class="file">
<div class="fileheader"><big><b>Modified: trunk/reactos/tools/rbuild/module.cpp</b></big></div>
<pre class="diff"><small id="info">--- trunk/reactos/tools/rbuild/module.cpp        2005-12-04 12:02:21 UTC (rev 19853)
+++ trunk/reactos/tools/rbuild/module.cpp        2005-12-04 12:02:45 UTC (rev 19854)
@@ -195,6 +195,13 @@
</small></pre><pre class="diff" id="context">         return filename;
 }
 
</pre><pre class="diff" id="added">+void IfableData::ExtractModules( std::vector&lt;Module*&gt; &amp;modules )
+{
+        size_t i;
+        for ( i = 0; i &lt; this-&gt;modules.size (); i++ )
+                modules.push_back(this-&gt;modules[i]);
+}
+
</pre><pre class="diff" id="context"> IfableData::~IfableData()
 {
         size_t i;
@@ -208,6 +215,8 @@
</pre><pre class="diff" id="context">                 delete properties[i];
         for ( i = 0; i &lt; compilerFlags.size (); i++ )
                 delete compilerFlags[i];
</pre><pre class="diff" id="added">+        for ( i = 0; i &lt; modules.size(); i++ )
+                delete modules[i];
</pre><pre class="diff" id="context">         for ( i = 0; i &lt; ifs.size (); i++ )
                 delete ifs[i];
         for ( i = 0; i &lt; compilationUnits.size (); i++ )
@@ -388,6 +397,12 @@
</pre><pre class="diff" id="context">                 aliasedModuleName = att-&gt;value;
         else
                 aliasedModuleName = &quot;&quot;;
</pre><pre class="diff" id="added">+
+        if ( type == BootProgram )
+        {
+                att = moduleNode.GetAttribute ( &quot;payload&quot;, true );
+                payload = att-&gt;value;
+        }
</pre><pre class="diff" id="context"> }
 
 Module::~Module ()
@@ -732,6 +747,8 @@
</pre><pre class="diff" id="context">                 return BootLoader;
         if ( attribute.value == &quot;bootsector&quot; )
                 return BootSector;
</pre><pre class="diff" id="added">+        if ( attribute.value == &quot;bootprogram&quot; )
+                return BootProgram;
</pre><pre class="diff" id="context">         if ( attribute.value == &quot;iso&quot; )
                 return Iso;
         if ( attribute.value == &quot;liveiso&quot; )
@@ -785,6 +802,8 @@
</pre><pre class="diff" id="context">                         return &quot;.o&quot;;
                 case Alias:
                         return &quot;&quot;;
</pre><pre class="diff" id="added">+                case BootProgram:
+                        return &quot;&quot;;
</pre><pre class="diff" id="context">         }
         throw InvalidOperationException ( __FILE__,
          &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;__LINE__ );
@@ -828,6 +847,7 @@
</pre><pre class="diff" id="context">                 case RpcServer:
                 case RpcClient:
                 case Alias:
</pre><pre class="diff" id="added">+                case BootProgram:
</pre><pre class="diff" id="context">                         return &quot;&quot;;
         }
         throw InvalidOperationException ( __FILE__,
@@ -863,6 +883,7 @@
</pre><pre class="diff" id="context">                 case RpcServer:
                 case RpcClient:
                 case Alias:
</pre><pre class="diff" id="added">+                case BootProgram:
</pre><pre class="diff" id="context">                         return &quot;&quot;;
         }
         throw InvalidOperationException ( __FILE__,
@@ -895,6 +916,7 @@
</pre><pre class="diff" id="context">                 case ObjectLibrary:
                 case BootLoader:
                 case BootSector:
</pre><pre class="diff" id="added">+                case BootProgram:
</pre><pre class="diff" id="context">                 case Iso:
                 case LiveIso:
                 case RpcServer:
@@ -923,6 +945,7 @@
</pre><pre class="diff" id="context">                 case BuildTool:
                 case BootLoader:
                 case BootSector:
</pre><pre class="diff" id="added">+                case BootProgram:
</pre><pre class="diff" id="context">                 case Iso:
                 case LiveIso:
                         return true;
@@ -1289,6 +1312,7 @@
</pre><pre class="diff" id="context"> void
 If::ProcessXML()
 {
</pre><pre class="diff" id="added">+        
</pre><pre class="diff" id="context"> }
 
 
@@ -1358,6 +1382,7 @@
</pre><pre class="diff" id="context">                 case KernelModeDriver:
                 case BootSector:
                 case BootLoader:
</pre><pre class="diff" id="added">+                case BootProgram:
</pre><pre class="diff" id="context">                 case BuildTool:
                 case StaticLibrary:
                 case ObjectLibrary:
</pre></div>
<hr /><div class="file">
<div class="fileheader"><big><b>Modified: trunk/reactos/tools/rbuild/project.cpp</b></big></div>
<pre class="diff"><small id="info">--- trunk/reactos/tools/rbuild/project.cpp        2005-12-04 12:02:21 UTC (rev 19853)
+++ trunk/reactos/tools/rbuild/project.cpp        2005-12-04 12:02:45 UTC (rev 19854)
@@ -97,8 +97,10 @@
</small></pre><pre class="diff" id="context">         size_t i;
         if ( _backend )
                 delete _backend;
</pre><pre class="diff" id="added">+#ifdef NOT_NEEDED_SINCE_THESE_ARE_CLEANED_BY_IFABLE_DATA
</pre><pre class="diff" id="context">         for ( i = 0; i &lt; modules.size (); i++ )
                 delete modules[i];
</pre><pre class="diff" id="added">+#endif
</pre><pre class="diff" id="context">         for ( i = 0; i &lt; linkerFlags.size (); i++ )
                 delete linkerFlags[i];
         for ( i = 0; i &lt; cdfiles.size (); i++ )
@@ -225,6 +227,7 @@
</pre><pre class="diff" id="context"> void
 Project::ExecuteInvocations ()
 {
</pre><pre class="diff" id="added">+        fprintf( stderr, &quot;ExecuteInvocations\n&quot; );
</pre><pre class="diff" id="context">         for ( size_t i = 0; i &lt; modules.size (); i++ )
                 modules[i]-&gt;InvokeModule ();
 }
@@ -277,11 +280,29 @@
</pre><pre class="diff" id="context">                 ParseContext parseContext;
                 ProcessXMLSubElement ( *node-&gt;subElements[i], path, parseContext );
         }
</pre><pre class="diff" id="added">+        
+        non_if_data.ProcessXML ();
+
+        non_if_data.ExtractModules( modules );
+
+        for ( i = 0; i &lt; non_if_data.ifs.size (); i++ )
+        {
+                const Property *property = 
+                 &nbsp; &nbsp;LookupProperty( non_if_data.ifs[i]-&gt;property );
+
+                if( !property ) continue;
+
+                bool conditionTrue = 
+                        (non_if_data.ifs[i]-&gt;negated &amp;&amp; 
+                         (property-&gt;value != non_if_data.ifs[i]-&gt;value)) ||
+                        (property-&gt;value == non_if_data.ifs[i]-&gt;value);
+                if ( conditionTrue )
+                        non_if_data.ifs[i]-&gt;data.ExtractModules( modules );
+        }
+        for ( i = 0; i &lt; linkerFlags.size (); i++ )
+                linkerFlags[i]-&gt;ProcessXML ();
</pre><pre class="diff" id="context">         for ( i = 0; i &lt; modules.size (); i++ )
                 modules[i]-&gt;ProcessXML ();
</pre><pre class="diff" id="removed">-        for ( i = 0; i &lt; linkerFlags.size (); i++ )
-                linkerFlags[i]-&gt;ProcessXML ();
-        non_if_data.ProcessXML ();
</pre><pre class="diff" id="context">         for ( i = 0; i &lt; cdfiles.size (); i++ )
                 cdfiles[i]-&gt;ProcessXML ();
         for ( i = 0; i &lt; installfiles.size (); i++ )
@@ -294,13 +315,11 @@
</pre><pre class="diff" id="context"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ParseContext&amp; parseContext )
 {
         bool subs_invalid = false;
</pre><pre class="diff" id="added">+        If* pOldIf = parseContext.ifData;
+        
</pre><pre class="diff" id="context">         string subpath(path);
         if ( e.name == &quot;module&quot; )
         {
</pre><pre class="diff" id="removed">-                if ( parseContext.ifData )
-                        throw XMLInvalidBuildFileException (
-                                e.location,
-                                &quot;&lt;module&gt; is not a valid sub-element of &lt;if&gt;&quot; );
</pre><pre class="diff" id="context">                 Module* module = new Module ( *this, e, path );
                 if ( LocateModule ( module-&gt;name ) )
                         throw XMLInvalidBuildFileException (
@@ -308,7 +327,10 @@
</pre><pre class="diff" id="context">                                 &quot;module name conflict: '%s' (originally defined at %s)&quot;,
                                 module-&gt;name.c_str(),
                                 module-&gt;node.location.c_str() );
</pre><pre class="diff" id="removed">-                <span id="removedchars">modules.push_back ( module );</span>
</pre><pre class="diff" id="added">+                <span id="addedchars">if ( parseContext.ifData )</span>
+                 &nbsp; &nbsp;parseContext.ifData-&gt;data.modules.push_back( module );
+                else
+                 &nbsp; &nbsp;non_if_data.modules.push_back ( module );
</pre><pre class="diff" id="context">                 return; // defer processing until later
         }
         else if ( e.name == &quot;cdfile&quot; )
@@ -363,7 +385,6 @@
</pre><pre class="diff" id="context">         }
         else if ( e.name == &quot;if&quot; )
         {
</pre><pre class="diff" id="removed">-                If* pOldIf = parseContext.ifData;
</pre><pre class="diff" id="context">                 parseContext.ifData = new If ( e, *this, NULL );
                 if ( pOldIf )
                         pOldIf-&gt;data.ifs.push_back ( parseContext.ifData );
@@ -373,7 +394,6 @@
</pre><pre class="diff" id="context">         }
         else if ( e.name == &quot;ifnot&quot; )
         {
</pre><pre class="diff" id="removed">-                If* pOldIf = parseContext.ifData;
</pre><pre class="diff" id="context">                 parseContext.ifData = new If ( e, *this, NULL, true );
                 if ( pOldIf )
                         pOldIf-&gt;data.ifs.push_back ( parseContext.ifData );
@@ -398,6 +418,8 @@
</pre><pre class="diff" id="context">         }
         for ( size_t i = 0; i &lt; e.subElements.size (); i++ )
                 ProcessXMLSubElement ( *e.subElements[i], subpath, parseContext );
</pre><pre class="diff" id="added">+
+        parseContext.ifData = pOldIf;
</pre><pre class="diff" id="context"> }
 
 Module*
</pre></div>
<hr /><div class="file">
<div class="fileheader"><big><b>Modified: trunk/reactos/tools/rbuild/rbuild.h</b></big></div>
<pre class="diff"><small id="info">--- trunk/reactos/tools/rbuild/rbuild.h        2005-12-04 12:02:21 UTC (rev 19853)
+++ trunk/reactos/tools/rbuild/rbuild.h        2005-12-04 12:02:45 UTC (rev 19854)
@@ -183,11 +183,13 @@
</small></pre><pre class="diff" id="context">         std::vector&lt;Define*&gt; defines;
         std::vector&lt;Library*&gt; libraries;
         std::vector&lt;Property*&gt; properties;
</pre><pre class="diff" id="added">+        std::vector&lt;Module*&gt; modules;
</pre><pre class="diff" id="context">         std::vector&lt;CompilerFlag*&gt; compilerFlags;
         std::vector&lt;If*&gt; ifs;
 
         ~IfableData();
         void ProcessXML();
</pre><pre class="diff" id="added">+        void ExtractModules( std::vector&lt;Module*&gt; &amp;modules );
</pre><pre class="diff" id="context"> };
 
 class Project
@@ -200,10 +202,10 @@
</pre><pre class="diff" id="context">         std::string name;
         std::string makefile;
         XMLIncludes xmlbuildfiles;
</pre><pre class="diff" id="removed">-        std::vector&lt;Module*&gt; modules;
</pre><pre class="diff" id="context">         std::vector&lt;LinkerFlag*&gt; linkerFlags;
         std::vector&lt;CDFile*&gt; cdfiles;
         std::vector&lt;InstallFile*&gt; installfiles;
</pre><pre class="diff" id="added">+        std::vector&lt;Module*&gt; modules;
</pre><pre class="diff" id="context">         IfableData non_if_data;
 
         Project ( const Configuration&amp; configuration,
@@ -258,7 +260,8 @@
</pre><pre class="diff" id="context">         Test = 15,
         RpcServer = 16,
         RpcClient = 17,
</pre><pre class="diff" id="removed">-        Alias = 18
</pre><pre class="diff" id="added">+        Alias = 18<span id="addedchars">,</span>
+        BootProgram = 19
</pre><pre class="diff" id="context"> };
 
 enum HostType
@@ -279,6 +282,7 @@
</pre><pre class="diff" id="context">         std::string extension;
         std::string entrypoint;
         std::string baseaddress;
</pre><pre class="diff" id="added">+        std::string payload;
</pre><pre class="diff" id="context">         std::string path;
         ModuleType type;
         ImportLibrary* importLibrary;
</pre></div>
<hr /><div class="file">
<div class="fileheader"><big><b>Modified: trunk/reactos/tools/rbuild/rbuild.mak</b></big></div>
<pre class="diff"><small id="info">--- trunk/reactos/tools/rbuild/rbuild.mak        2005-12-04 12:02:21 UTC (rev 19853)
+++ trunk/reactos/tools/rbuild/rbuild.mak        2005-12-04 12:02:45 UTC (rev 19854)
@@ -254,6 +254,7 @@
</small></pre><pre class="diff" id="context"> 
 .PHONY: rbuild
 rbuild: $(RBUILD_TARGET)
</pre><pre class="diff" id="added">+host_gpp += -g
</pre><pre class="diff" id="context"> 
 $(RBUILD_TARGET): $(RBUILD_OBJECTS) $(XML_SSPRINTF_OBJECTS) $(INFLIB_HOST_OBJECTS) | $(RBUILD_OUT)
         $(ECHO_LD)
</pre>
</div>

</body>
</html>