Author: mpiulachs Date: Tue Dec 11 20:09:34 2007 New Revision: 31154
URL: http://svn.reactos.org/svn/reactos?rev=31154&view=rev Log: * Introduced a new element "PlatformLanguage" to build and include only part of the resource localizations available on languages.rbuild * removed NTOSKRNL_SHARED and move it back to the mingw backend, no reason to be a property * cleanup obsolete code * create more correct auto-generated include/manifest files
Modified: branches/rbuild/reactos/ReactOS-generic.rbuild branches/rbuild/reactos/ReactOS-i386.rbuild branches/rbuild/reactos/dll/cpl/desk/desk.rbuild branches/rbuild/reactos/tools/rbuild/backend/mingw/modulehandler.cpp branches/rbuild/reactos/tools/rbuild/bootstrap.cpp branches/rbuild/reactos/tools/rbuild/cdfile.cpp branches/rbuild/reactos/tools/rbuild/creditsgenerator.cpp branches/rbuild/reactos/tools/rbuild/module.cpp branches/rbuild/reactos/tools/rbuild/modulesmanifestgenerator.cpp branches/rbuild/reactos/tools/rbuild/modulesresourcegenerator.cpp branches/rbuild/reactos/tools/rbuild/project.cpp branches/rbuild/reactos/tools/rbuild/rbuild.h
Modified: branches/rbuild/reactos/ReactOS-generic.rbuild URL: http://svn.reactos.org/svn/reactos/branches/rbuild/reactos/ReactOS-generic.r... ============================================================================== --- branches/rbuild/reactos/ReactOS-generic.rbuild (original) +++ branches/rbuild/reactos/ReactOS-generic.rbuild Tue Dec 11 20:09:34 2007 @@ -70,4 +70,9 @@ <xi:include href="subsystems/subsystems.rbuild" /> </directory>
+ <!-- The languages to be included in to the platform being build. see languages.rbuild for additional languages --> + <platformlanguage isoname="en-US" /> + <platformlanguage isoname="es-ES" /> + <platformlanguage isoname="de-DE" /> + </group>
Modified: branches/rbuild/reactos/ReactOS-i386.rbuild URL: http://svn.reactos.org/svn/reactos/branches/rbuild/reactos/ReactOS-i386.rbui... ============================================================================== --- branches/rbuild/reactos/ReactOS-i386.rbuild (original) +++ branches/rbuild/reactos/ReactOS-i386.rbuild Tue Dec 11 20:09:34 2007 @@ -8,8 +8,6 @@ </xi:include>
<xi:include href="ReactOS-generic.rbuild" /> - - <property name="NTOSKRNL_SHARED" value="-Wl,--file-alignment,0x1000 -Wl,--section-alignment,0x1000 -nostartfiles -shared"/>
<if property="GDB" value="0"> <if property="OPTIMIZE" value="1"> @@ -40,4 +38,9 @@ <compilerflag>-Wpointer-arith</compilerflag> <linkerflag>-enable-stdcall-fixup</linkerflag>
+ + <overridemodule name="ntoskrnl" allowwarnings="true"> + <define name="SILLY_DEFINE" /> + </overridemodule> + </project>
Modified: branches/rbuild/reactos/dll/cpl/desk/desk.rbuild URL: http://svn.reactos.org/svn/reactos/branches/rbuild/reactos/dll/cpl/desk/desk... ============================================================================== --- branches/rbuild/reactos/dll/cpl/desk/desk.rbuild (original) +++ branches/rbuild/reactos/dll/cpl/desk/desk.rbuild Tue Dec 11 20:09:34 2007 @@ -46,6 +46,7 @@
<metadata description="ReactOS Display ControlPanel Applet" />
+ <!-- Module localizations --> <localization isoname="bg-BG">lang/bg-BG.rc</localization> <localization isoname="cs-CZ">lang/cs-CZ.rc</localization> <localization isoname="de-DE">lang/de-DE.rc</localization>
Modified: branches/rbuild/reactos/tools/rbuild/backend/mingw/modulehandler.cpp URL: http://svn.reactos.org/svn/reactos/branches/rbuild/reactos/tools/rbuild/back... ============================================================================== --- branches/rbuild/reactos/tools/rbuild/backend/mingw/modulehandler.cpp (original) +++ branches/rbuild/reactos/tools/rbuild/backend/mingw/modulehandler.cpp Tue Dec 11 20:09:34 2007 @@ -2612,7 +2612,7 @@ module.baseaddress.c_str () ); GenerateLinkerCommand ( dependencies, "${gcc}", - linkerParameters + " $(NTOSKRNL_SHARED)", + linkerParameters + " -Wl,--file-alignment,0x1000 -Wl,--section-alignment,0x1000 -nostartfiles -shared", objectsMacro, libsMacro, "-sections" );
Modified: branches/rbuild/reactos/tools/rbuild/bootstrap.cpp URL: http://svn.reactos.org/svn/reactos/branches/rbuild/reactos/tools/rbuild/boot... ============================================================================== --- branches/rbuild/reactos/tools/rbuild/bootstrap.cpp (original) +++ branches/rbuild/reactos/tools/rbuild/bootstrap.cpp Tue Dec 11 20:09:34 2007 @@ -17,7 +17,6 @@ */ #include "pch.h" #include <assert.h> - #include "rbuild.h"
using std::string; @@ -75,18 +74,6 @@ __LINE__ ); }
-//string -//Bootstrap::ReplaceVariable ( const string& name, -// const string& value, -// string path ) -//{ -// size_t i = path.find ( name ); -// if ( i != string::npos ) -// return path.replace ( i, name.length (), value ); -// else -// return path; -//} - void Bootstrap::Initialize () {
Modified: branches/rbuild/reactos/tools/rbuild/cdfile.cpp URL: http://svn.reactos.org/svn/reactos/branches/rbuild/reactos/tools/rbuild/cdfi... ============================================================================== --- branches/rbuild/reactos/tools/rbuild/cdfile.cpp (original) +++ branches/rbuild/reactos/tools/rbuild/cdfile.cpp Tue Dec 11 20:09:34 2007 @@ -17,34 +17,10 @@ */ #include "pch.h" #include <assert.h> - #include "rbuild.h"
using std::string;
-//string -//CDFile::ReplaceVariable ( const string& name, -// const string& value, -// string path ) -//{ -// size_t i = path.find ( name ); -// if ( i != string::npos ) -// return path.replace ( i, name.length (), value ); -// else -// return path; -//} -// -//string -//BootstrapFile::ReplaceVariable ( const string& name, -// const string& value, -// string path ) -//{ -// size_t i = path.find ( name ); -// if ( i != string::npos ) -// return path.replace ( i, name.length (), value ); -// else -// return path; -//}
CDFile::CDFile ( const Project& project, const XMLElement& cdfileNode,
Modified: branches/rbuild/reactos/tools/rbuild/creditsgenerator.cpp URL: http://svn.reactos.org/svn/reactos/branches/rbuild/reactos/tools/rbuild/cred... ============================================================================== --- branches/rbuild/reactos/tools/rbuild/creditsgenerator.cpp (original) +++ branches/rbuild/reactos/tools/rbuild/creditsgenerator.cpp Tue Dec 11 20:09:34 2007 @@ -103,6 +103,10 @@
s = buf; s = s + sprintf ( s, "/* Auto generated */\n"); + s = s + sprintf ( s, "/* Edit contributors.rbuild to add or remove developers */\n" ); + s = s + sprintf ( s, "\n" ); + s = s + sprintf ( s, "#ifndef __INCLUDE_AUTOCONTRIBUTORS_H\n" ); + s = s + sprintf ( s, "#define __INCLUDE_AUTOCONTRIBUTORS_H\n" ); s = s + sprintf ( s, "\n" ); s = s + sprintf ( s, "const char* szAutoContributors[]= \n" ); s = s + sprintf ( s, "{\n" ); @@ -118,6 +122,8 @@
s = s + sprintf ( s, "\t0\n"); s = s + sprintf ( s, "};\n" ); + s = s + sprintf ( s, "\n" ); + s = s + sprintf ( s, "#endif /* __INCLUDE_AUTOCONTRIBUTORS_H */\n" );
FileSupportCode::WriteIfChanged ( buf, NormalizeFilename ( Environment::GetIntermediatePath () + sSep + "include" + sSep + "reactos" + sSep + "autocontributors.h" ) );
Modified: branches/rbuild/reactos/tools/rbuild/module.cpp URL: http://svn.reactos.org/svn/reactos/branches/rbuild/reactos/tools/rbuild/modu... ============================================================================== --- branches/rbuild/reactos/tools/rbuild/module.cpp (original) +++ branches/rbuild/reactos/tools/rbuild/module.cpp Tue Dec 11 20:09:34 2007 @@ -1674,6 +1674,28 @@ { }
+PlatformLanguage::PlatformLanguage ( const Project& _project , const XMLElement& _node) + : project(_project) , node (_node) +{ + const XMLAttribute* att = node.GetAttribute ( "isoname", true ); + assert(att); + isoname = att->value; + + const Language* language = project.LocateLanguage ( isoname ); + if ( language == NULL ) + { + throw XMLInvalidBuildFileException ( + node.location, + "<PlatformLanguage> references a no existant language '%s'", + isoname.c_str() ); + } +} + +void +PlatformLanguage::ProcessXML() +{ +} + Family::Family ( const XMLElement& _node, const Module& _module ) : node (_node),
Modified: branches/rbuild/reactos/tools/rbuild/modulesmanifestgenerator.cpp URL: http://svn.reactos.org/svn/reactos/branches/rbuild/reactos/tools/rbuild/modu... ============================================================================== --- branches/rbuild/reactos/tools/rbuild/modulesmanifestgenerator.cpp (original) +++ branches/rbuild/reactos/tools/rbuild/modulesmanifestgenerator.cpp Tue Dec 11 20:09:34 2007 @@ -60,7 +60,7 @@ s = s + sprintf ( s, " <assemblyIdentity"); s = s + sprintf ( s, " version="1.0.0.0""); s = s + sprintf ( s, " processorArchitecture="x86""); - s = s + sprintf ( s, " name="ReactOS.System.ControlPanel.System""); + s = s + sprintf ( s, " name="ReactOS.System.Module""); s = s + sprintf ( s, " type="win32""); s = s + sprintf ( s, " />");
Modified: branches/rbuild/reactos/tools/rbuild/modulesresourcegenerator.cpp URL: http://svn.reactos.org/svn/reactos/branches/rbuild/reactos/tools/rbuild/modu... ============================================================================== --- branches/rbuild/reactos/tools/rbuild/modulesresourcegenerator.cpp (original) +++ branches/rbuild/reactos/tools/rbuild/modulesresourcegenerator.cpp Tue Dec 11 20:09:34 2007 @@ -84,14 +84,20 @@ s = s + sprintf ( s, "\n" ); }
+ /* Include resources for module localizations */ for ( size_t i = 0; i < module.localizations.size (); i++ ) { Localization& localization = *module.localizations[i];
- std::string langFile = NormalizeFilename(localization.file.relative_path + sSep + localization.file.name); + /* If this locale is included in our platform ... */ + const PlatformLanguage* platformLanguage = module.project.LocatePlatformLanguage (localization.isoname); + if (platformLanguage != NULL) + { + std::string langFile = NormalizeFilename(localization.file.relative_path + sSep + localization.file.name);
- s = s + sprintf ( s, "#include "%s"" , langFile.c_str() ); - s = s + sprintf ( s, "\n" ); + s = s + sprintf ( s, "#include "%s"" , langFile.c_str() ); + s = s + sprintf ( s, "\n" ); + } }
FileSupportCode::WriteIfChanged ( buf, NormalizeFilename ( Environment::GetIntermediatePath () + sSep + module.output->relative_path + sSep + "auto.rc" ) );
Modified: branches/rbuild/reactos/tools/rbuild/project.cpp URL: http://svn.reactos.org/svn/reactos/branches/rbuild/reactos/tools/rbuild/proj... ============================================================================== --- branches/rbuild/reactos/tools/rbuild/project.cpp (original) +++ branches/rbuild/reactos/tools/rbuild/project.cpp Tue Dec 11 20:09:34 2007 @@ -524,6 +524,12 @@ languages.push_back ( language ); subs_invalid = false; } + else if ( e.name == "platformlanguage" ) + { + PlatformLanguage* platformLanguage = new PlatformLanguage ( *this, e ); + platformLanguages.push_back ( platformLanguage ); + subs_invalid = false; + } else if ( e.name == "contributor" ) { Contributor* contributor = new Contributor ( e ); @@ -669,6 +675,30 @@ return NULL; }
+const Language* +Project::LocateLanguage ( const std::string& name ) const +{ + for ( size_t i = 0; i < languages.size (); i++ ) + { + if ( languages[i]->isoname == name ) + return languages[i]; + } + + return NULL; +} + +const PlatformLanguage* +Project::LocatePlatformLanguage ( const std::string& name ) const +{ + for ( size_t i = 0; i < platformLanguages.size (); i++ ) + { + if ( platformLanguages[i]->isoname == name ) + return platformLanguages[i]; + } + + return NULL; +} + const std::string& Project::GetProjectFilename () const {
Modified: branches/rbuild/reactos/tools/rbuild/rbuild.h URL: http://svn.reactos.org/svn/reactos/branches/rbuild/reactos/tools/rbuild/rbui... ============================================================================== --- branches/rbuild/reactos/tools/rbuild/rbuild.h (original) +++ branches/rbuild/reactos/tools/rbuild/rbuild.h Tue Dec 11 20:09:34 2007 @@ -122,6 +122,7 @@ class BaseAdress; class BuildFamily; class Family; +class PlatformLanguage;
typedef std::mapstd::string,Directory* directory_map;
@@ -276,6 +277,7 @@ std::vector<BuildFamily*> buildfamilies; std::vector<Module*> modules; std::vector<Language*> languages; + std::vector<PlatformLanguage*> platformLanguages; std::vector<Contributor*> contributors; std::vector<InstallFolder*> installFolders; IfableData non_if_data; @@ -292,6 +294,8 @@ ArchitectureType architectureType; void ProcessXML ( const std::string& path ); Module* LocateModule ( const std::string& name ); + const Language* LocateLanguage ( const std::string& name ) const; + const PlatformLanguage* LocatePlatformLanguage ( const std::string& name ) const; const BuildFamily* LocateFamily ( const std::string& name ) const; const Contributor* LocateContributor ( const std::string& alias ) const; const Module* LocateModule ( const std::string& name ) const; @@ -691,6 +695,19 @@ void ProcessXML (); };
+class PlatformLanguage +{ +public: + const Project& project; + const XMLElement& node; + std::string isoname; + + PlatformLanguage ( const Project& _project, + const XMLElement& _node ); + + void ProcessXML (); +}; + class Contributor { public: