Author: pschweitzer Date: Sun Aug 9 20:19:42 2009 New Revision: 42570
URL: http://svn.reactos.org/svn/reactos?rev=42570&view=rev Log: Fixed rbuild build
Modified: branches/pierre-fsd/tools/rbuild/backend/codeblocks/codeblocks.cpp branches/pierre-fsd/tools/rbuild/backend/mingw/mingw.cpp branches/pierre-fsd/tools/rbuild/backend/mingw/modulehandler.cpp branches/pierre-fsd/tools/rbuild/backend/mingw/modulehandler.h branches/pierre-fsd/tools/rbuild/backend/msbuild/msbuild.cpp branches/pierre-fsd/tools/rbuild/backend/msvc/msvcmaker.cpp branches/pierre-fsd/tools/rbuild/backend/msvc/vcprojmaker.cpp branches/pierre-fsd/tools/rbuild/module.cpp branches/pierre-fsd/tools/rbuild/project.cpp branches/pierre-fsd/tools/rbuild/rbuild.h branches/pierre-fsd/tools/rbuild/testsupportcode.cpp
Modified: branches/pierre-fsd/tools/rbuild/backend/codeblocks/codeblocks.cpp URL: http://svn.reactos.org/svn/reactos/branches/pierre-fsd/tools/rbuild/backend/... ============================================================================== --- branches/pierre-fsd/tools/rbuild/backend/codeblocks/codeblocks.cpp [iso-8859-1] (original) +++ branches/pierre-fsd/tools/rbuild/backend/codeblocks/codeblocks.cpp [iso-8859-1] Sun Aug 9 20:19:42 2009 @@ -423,16 +423,6 @@ { const IfableData& data = *ifs_list.back(); ifs_list.pop_back(); - for ( i = 0; i < data.ifs.size(); i++ ) - { - const Property* property = _lookup_property( module, data.ifs[i]->property ); - if ( property != NULL ) - { - if ( data.ifs[i]->value == property->value && data.ifs[i]->negated == false || - data.ifs[i]->value != property->value && data.ifs[i]->negated) - ifs_list.push_back ( &data.ifs[i]->data ); - } - } const vector<File*>& files = data.files; for ( i = 0; i < files.size(); i++ ) {
Modified: branches/pierre-fsd/tools/rbuild/backend/mingw/mingw.cpp URL: http://svn.reactos.org/svn/reactos/branches/pierre-fsd/tools/rbuild/backend/... ============================================================================== --- branches/pierre-fsd/tools/rbuild/backend/mingw/mingw.cpp [iso-8859-1] (original) +++ branches/pierre-fsd/tools/rbuild/backend/mingw/mingw.cpp [iso-8859-1] Sun Aug 9 20:19:42 2009 @@ -245,25 +245,6 @@ if ( compilationUnit.GetFiles ().size () != 1 ) return false; } - // intentionally make a copy so that we can append more work in - // the middle of processing without having to go recursive - vector<If*> v = module.non_if_data.ifs; - for ( i = 0; i < v.size (); i++ ) - { - size_t j; - If& rIf = *v[i]; - // check for sub-ifs to add to list - const vector<If*>& ifs = rIf.data.ifs; - for ( j = 0; j < ifs.size (); j++ ) - v.push_back ( ifs[j] ); - const vector<CompilationUnit*>& compilationUnits = rIf.data.compilationUnits; - for ( j = 0; j < compilationUnits.size (); j++ ) - { - CompilationUnit& compilationUnit = *compilationUnits[j]; - if ( compilationUnit.GetFiles ().size () != 1 ) - return false; - } - } return true; }
@@ -446,27 +427,6 @@ GenerateProjectCFlagsMacro ( assignmentOperation, data ); } - - for ( i = 0; i < data.ifs.size(); i++ ) - { - const If& rIf = *data.ifs[i]; - if ( rIf.data.defines.size() - || rIf.data.includes.size() - || rIf.data.ifs.size() ) - { - fprintf ( - fMakefile, - "ifeq ("$(%s)","%s")\n", - rIf.property.c_str(), - rIf.value.c_str() ); - GenerateGlobalCFlagsAndProperties ( - "+=", - rIf.data ); - fprintf ( - fMakefile, - "endif\n\n" ); - } - } }
void @@ -536,32 +496,10 @@ const char* assignmentOperation, IfableData& data ) const { - size_t i; - if ( data.compilerFlags.size() ) { GenerateProjectGccOptionsMacro ( assignmentOperation, data ); - } - - for ( i = 0; i < data.ifs.size(); i++ ) - { - If& rIf = *data.ifs[i]; - if ( rIf.data.compilerFlags.size() - || rIf.data.ifs.size() ) - { - fprintf ( - fMakefile, - "ifeq ("$(%s)","%s")\n", - rIf.property.c_str(), - rIf.value.c_str() ); - GenerateProjectGccOptions ( - "+=", - rIf.data ); - fprintf ( - fMakefile, - "endif\n\n" ); - } } }
@@ -1329,7 +1267,7 @@ fprintf ( fMakefile, "\t$(ECHO_MKHIVE)\n" ); fprintf ( fMakefile, - "\t$(MKHIVE_TARGET) boot%cbootdata %s $(ROS_ARCH) boot%cbootdata%chiveinst_$(ROS_ARCH).inf\n", + "\t$(MKHIVE_TARGET) boot%cbootdata %s $(ARCH) boot%cbootdata%chiveinst_$(ARCH).inf\n", cSep, GetFullPath ( system32 ).c_str (), cSep, cSep ); fprintf ( fMakefile,
Modified: branches/pierre-fsd/tools/rbuild/backend/mingw/modulehandler.cpp URL: http://svn.reactos.org/svn/reactos/branches/pierre-fsd/tools/rbuild/backend/... ============================================================================== --- branches/pierre-fsd/tools/rbuild/backend/mingw/modulehandler.cpp [iso-8859-1] (original) +++ branches/pierre-fsd/tools/rbuild/backend/mingw/modulehandler.cpp [iso-8859-1] Sun Aug 9 20:19:42 2009 @@ -165,15 +165,8 @@ MingwModuleHandler* handler; switch ( module.type ) { - case BuildTool: - handler = new MingwBuildToolModuleHandler ( module ); - break; case StaticLibrary: - handler = new MingwStaticLibraryModuleHandler ( module ); - break; case HostStaticLibrary: - handler = new MingwHostStaticLibraryModuleHandler ( module ); - break; case ObjectLibrary: case RpcServer: case RpcClient: @@ -184,6 +177,9 @@ case EmbeddedTypeLib: case BootSector: handler = new MingwModuleHandler( module ); + break; + case BuildTool: + handler = new MingwBuildToolModuleHandler ( module ); break; case Kernel: handler = new MingwKernelModuleHandler ( module ); @@ -233,29 +229,11 @@ case Test: handler = new MingwTestModuleHandler ( module ); break; - case RpcServer: - handler = new MingwRpcServerModuleHandler ( module ); - break; - case RpcClient: - handler = new MingwRpcClientModuleHandler ( module ); - break; - case RpcProxy: - handler = new MingwRpcProxyModuleHandler ( module ); - break; case Alias: handler = new MingwAliasModuleHandler ( module ); break; - case MessageHeader: - handler = new MingwMessageHeaderModuleHandler (module); - break; - case IdlHeader: - handler = new MingwIdlHeaderModuleHandler ( module ); - break; case Cabinet: handler = new MingwCabinetModuleHandler ( module ); - break; - case EmbeddedTypeLib: - handler = new MingwEmbeddedTypeLibModuleHandler ( module ); break; case ElfExecutable: handler = new MingwElfExecutableModuleHandler ( module ); @@ -308,13 +286,6 @@ return new FileLocation ( IntermediateDirectory, module.output->relative_path, ReplaceExtension ( module.name, ".temp.a" ) ); -} - -bool -MingwModuleHandler::IsGeneratedFile ( const File& file ) const -{ - string extension = GetExtension ( file.file ); - return ( extension == ".spec" || extension == ".SPEC" ); }
/*static*/ bool @@ -839,34 +810,6 @@ deps.c_str() ); } } - - const vector<If*>& ifs = data.ifs; - for ( i = 0; i < ifs.size(); i++ ) - { - If& rIf = *ifs[i]; - if ( rIf.data.defines.size() - || rIf.data.includes.size() - || rIf.data.libraries.size() - || rIf.data.compilationUnits.size() - || rIf.data.compilerFlags.size() - || rIf.data.ifs.size() ) - { - fprintf ( - fMakefile, - "%s ("$(%s)","%s")\n", - rIf.negated ? "ifneq" : "ifeq", - rIf.property.c_str(), - rIf.value.c_str() ); - GenerateMacros ( - "+=", - rIf.data, - NULL, - used_defs ); - fprintf ( - fMakefile, - "endif\n\n" ); - } - } }
void @@ -883,7 +826,6 @@
void MingwModuleHandler::GenerateSourceMacros ( - const char* assignmentOperation, const IfableData& data ) { size_t i; @@ -895,9 +837,8 @@ { fprintf ( fMakefile, - "%s %s", - sourcesMacro.c_str (), - assignmentOperation ); + "%s =", + sourcesMacro.c_str () ); for ( i = 0; i < compilationUnits.size(); i++ ) { CompilationUnit& compilationUnit = *compilationUnits[i]; @@ -911,32 +852,6 @@ fprintf ( fMakefile, "\n" ); }
- const vector<If*>& ifs = data.ifs; - for ( i = 0; i < ifs.size(); i++ ) - { - If& rIf = *ifs[i]; - if ( rIf.data.defines.size() - || rIf.data.includes.size() - || rIf.data.libraries.size() - || rIf.data.compilationUnits.size() - || rIf.data.compilerFlags.size() - || rIf.data.ifs.size() ) - { - fprintf ( - fMakefile, - "%s ("$(%s)","%s")\n", - rIf.negated ? "ifneq" : "ifeq", - rIf.property.c_str(), - rIf.value.c_str() ); - GenerateSourceMacros ( - "+=", - rIf.data ); - fprintf ( - fMakefile, - "endif\n\n" ); - } - } - vector<CompilationUnit*> sourceCompilationUnits; GetModuleSpecificCompilationUnits ( sourceCompilationUnits ); for ( i = 0; i < sourceCompilationUnits.size (); i++ ) @@ -953,10 +868,10 @@
void MingwModuleHandler::GenerateObjectMacros ( - const char* assignmentOperation, const IfableData& data ) { size_t i; + const char* assignmentOperation = "=";
const vector<CompilationUnit*>& compilationUnits = data.compilationUnits; vector<const FileLocation *> headers; @@ -973,11 +888,12 @@ const FileLocation& compilationName = compilationUnit.GetFilename (); const FileLocation *object_file = GetObjectFilename ( &compilationName, module ); fprintf ( fMakefile, - "%s := %s $(%s)\n", + "%s := %s\n", objectsMacro.c_str(), - backend->GetFullName ( *object_file ).c_str (), - objectsMacro.c_str() ); + backend->GetFullName ( *object_file ).c_str () ); delete object_file; + assignmentOperation = "+="; + break; } } fprintf ( @@ -1068,32 +984,6 @@ delete mcresources[i]; } fprintf ( fMakefile, "\n" ); - } - - const vector<If*>& ifs = data.ifs; - for ( i = 0; i < ifs.size(); i++ ) - { - If& rIf = *ifs[i]; - if ( rIf.data.defines.size() - || rIf.data.includes.size() - || rIf.data.libraries.size() - || rIf.data.compilationUnits.size() - || rIf.data.compilerFlags.size() - || rIf.data.ifs.size() ) - { - fprintf ( - fMakefile, - "%s ("$(%s)","%s")\n", - rIf.negated ? "ifneq" : "ifeq", - rIf.property.c_str(), - rIf.value.c_str() ); - GenerateObjectMacros ( - "+=", - rIf.data ); - fprintf ( - fMakefile, - "endif\n\n" ); - } }
vector<CompilationUnit*> sourceCompilationUnits; @@ -1849,12 +1739,6 @@ "\n" ); }
- const vector<If*>& ifs = data.ifs; - for ( i = 0; i < ifs.size(); i++ ) - { - GenerateObjectFileTargets ( ifs[i]->data ); - } - vector<CompilationUnit*> sourceCompilationUnits; GetModuleSpecificCompilationUnits ( sourceCompilationUnits ); for ( i = 0; i < sourceCompilationUnits.size (); i++ ) @@ -2035,9 +1919,7 @@ { sourcesMacro = ssprintf ( "%s_SOURCES", module.name.c_str ());
- GenerateSourceMacros ( - "=", - module.non_if_data ); + GenerateSourceMacros ( module.non_if_data );
// future references to the macro will be to get its values sourcesMacro = ssprintf ("$(%s)", sourcesMacro.c_str ()); @@ -2048,9 +1930,7 @@ { objectsMacro = ssprintf ("%s_OBJS", module.name.c_str ());
- GenerateObjectMacros ( - "=", - module.non_if_data ); + GenerateObjectMacros ( module.non_if_data );
// future references to the macro will be to get its values objectsMacro = ssprintf ("$(%s)", objectsMacro.c_str ()); @@ -2798,84 +2678,11 @@ }
-MingwStaticLibraryModuleHandler::MingwStaticLibraryModuleHandler ( - const Module& module_ ) - - : MingwModuleHandler ( module_ ) -{ -} - -void -MingwStaticLibraryModuleHandler::Process () -{ - GenerateStaticLibraryModuleTarget (); -} - -void -MingwStaticLibraryModuleHandler::GenerateStaticLibraryModuleTarget () -{ - GenerateRules (); -} - - -MingwHostStaticLibraryModuleHandler::MingwHostStaticLibraryModuleHandler ( - const Module& module_ ) - - : MingwModuleHandler ( module_ ) -{ -} - -void -MingwHostStaticLibraryModuleHandler::Process () -{ - GenerateHostStaticLibraryModuleTarget (); -} - -void -MingwHostStaticLibraryModuleHandler::GenerateHostStaticLibraryModuleTarget () -{ - GenerateRules (); -} - - -MingwObjectLibraryModuleHandler::MingwObjectLibraryModuleHandler ( - const Module& module_ ) - - : MingwModuleHandler ( module_ ) -{ -} - -void -MingwObjectLibraryModuleHandler::Process () -{ - GenerateObjectLibraryModuleTarget (); -} - -void -MingwObjectLibraryModuleHandler::GenerateObjectLibraryModuleTarget () -{ - GenerateRules (); -} - - MingwKernelModeDLLModuleHandler::MingwKernelModeDLLModuleHandler ( const Module& module_ )
: MingwModuleHandler ( module_ ) { -} - -MingwEmbeddedTypeLibModuleHandler::MingwEmbeddedTypeLibModuleHandler ( - const Module& module_ ) - - : MingwModuleHandler ( module_ ) -{ -} - -void -MingwEmbeddedTypeLibModuleHandler::Process () -{ - GenerateRules (); }
@@ -3728,7 +3535,7 @@ fprintf ( fMakefile, "\t$(ECHO_MKHIVE)\n" ); fprintf ( fMakefile, - "\t$(MKHIVE_TARGET) boot%cbootdata %s boot%cbootdata%clivecd.inf boot%cbootdata%chiveinst.inf\n", + "\t$(MKHIVE_TARGET) boot%cbootdata %s $(ARCH) boot%cbootdata%clivecd.inf boot%cbootdata%chiveinst_$(ARCH).inf\n", cSep, backend->GetFullPath ( reactosSystem32ConfigDirectory ).c_str (), cSep, cSep, cSep, cSep ); } @@ -3844,48 +3651,6 @@ }
-MingwRpcServerModuleHandler::MingwRpcServerModuleHandler ( - const Module& module_ ) - - : MingwModuleHandler ( module_ ) -{ -} - -void -MingwRpcServerModuleHandler::Process () -{ - GenerateRules (); -} - - -MingwRpcClientModuleHandler::MingwRpcClientModuleHandler ( - const Module& module_ ) - - : MingwModuleHandler ( module_ ) -{ -} - -void -MingwRpcClientModuleHandler::Process () -{ - GenerateRules (); -} - - -MingwRpcProxyModuleHandler::MingwRpcProxyModuleHandler ( - const Module& module_ ) - - : MingwModuleHandler ( module_ ) -{ -} - -void -MingwRpcProxyModuleHandler::Process () -{ - GenerateRules (); -} - - MingwAliasModuleHandler::MingwAliasModuleHandler ( const Module& module_ )
@@ -3898,31 +3663,6 @@ { }
-MingwMessageHeaderModuleHandler::MingwMessageHeaderModuleHandler ( - const Module& module_ ) - - : MingwModuleHandler ( module_ ) -{ -} - -void -MingwMessageHeaderModuleHandler::Process () -{ - GenerateRules (); -} - -MingwIdlHeaderModuleHandler::MingwIdlHeaderModuleHandler ( - const Module& module_ ) - - : MingwModuleHandler ( module_ ) -{ -} - -void -MingwIdlHeaderModuleHandler::Process () -{ - GenerateRules (); -}
MingwCabinetModuleHandler::MingwCabinetModuleHandler ( const Module& module_ )
Modified: branches/pierre-fsd/tools/rbuild/backend/mingw/modulehandler.h URL: http://svn.reactos.org/svn/reactos/branches/pierre-fsd/tools/rbuild/backend/... ============================================================================== --- branches/pierre-fsd/tools/rbuild/backend/mingw/modulehandler.h [iso-8859-1] (original) +++ branches/pierre-fsd/tools/rbuild/backend/mingw/modulehandler.h [iso-8859-1] Sun Aug 9 20:19:42 2009 @@ -72,9 +72,8 @@
static MingwModuleHandler* InstanciateHandler ( const Module& module_, MingwBackend* backend_ ); - virtual HostType DefaultHost() = 0; void GeneratePreconditionDependencies (); - virtual void Process () = 0; + virtual void Process () { GenerateRules (); } void GenerateInvocations () const; void GenerateCleanTarget () const; void GenerateInstallTarget () const; @@ -90,7 +89,6 @@ std::string GetBasename ( const std::string& filename ) const; std::string GetCompilationUnitDependencies ( const CompilationUnit& compilationUnit ) const; const FileLocation* GetModuleArchiveFilename () const; - bool IsGeneratedFile ( const File& file ) const; std::string GetImportLibraryDependency ( const Module& importedModule ); void GetTargets ( const Module& dependencyModule, string_list& targets ); @@ -136,10 +134,8 @@ const IfableData& data, const std::vector<LinkerFlag*>* linkerFlags, std::set<const Define *>& used_defs ); - void GenerateSourceMacros ( const char* assignmentOperation, - const IfableData& data ); - void GenerateObjectMacros ( const char* assignmentOperation, - const IfableData& data ); + void GenerateSourceMacros ( const IfableData& data ); + void GenerateObjectMacros ( const IfableData& data ); const FileLocation* GetPrecompiledHeaderFilename () const; const FileLocation* GetDlldataFilename () const; void GenerateGccCommand ( const FileLocation* sourceFile, @@ -195,7 +191,6 @@ { public: MingwBuildToolModuleHandler ( const Module& module ); - virtual HostType DefaultHost() { return HostTrue; } virtual void Process (); private: void GenerateBuildToolModuleTarget (); @@ -206,51 +201,16 @@ { public: MingwKernelModuleHandler ( const Module& module ); - virtual HostType DefaultHost() { return HostFalse; } virtual void Process (); private: void GenerateKernelModuleTarget (); };
-class MingwStaticLibraryModuleHandler : public MingwModuleHandler -{ -public: - MingwStaticLibraryModuleHandler ( const Module& module ); - virtual HostType DefaultHost() { return HostFalse; } - virtual void Process (); -private: - void GenerateStaticLibraryModuleTarget (); -}; - - -class MingwHostStaticLibraryModuleHandler : public MingwModuleHandler -{ -public: - MingwHostStaticLibraryModuleHandler ( const Module& module ); - virtual HostType DefaultHost() { return HostTrue; } - virtual void Process (); -private: - void GenerateHostStaticLibraryModuleTarget (); -}; - - -class MingwObjectLibraryModuleHandler : public MingwModuleHandler -{ -public: - MingwObjectLibraryModuleHandler ( const Module& module ); - virtual HostType DefaultHost() { return HostFalse; } - virtual void Process (); -private: - void GenerateObjectLibraryModuleTarget (); -}; - - class MingwKernelModeDLLModuleHandler : public MingwModuleHandler { public: MingwKernelModeDLLModuleHandler ( const Module& module ); - virtual HostType DefaultHost() { return HostFalse; } virtual void Process (); void AddImplicitLibraries ( Module& module ); private: @@ -262,7 +222,6 @@ { public: MingwNativeDLLModuleHandler ( const Module& module ); - virtual HostType DefaultHost() { return HostFalse; } virtual void Process (); void AddImplicitLibraries ( Module& module ); private: @@ -274,7 +233,6 @@ { public: MingwNativeCUIModuleHandler ( const Module& module ); - virtual HostType DefaultHost() { return HostFalse; } virtual void Process (); void AddImplicitLibraries ( Module& module ); private: @@ -286,7 +244,6 @@ { public: MingwWin32DLLModuleHandler ( const Module& module ); - virtual HostType DefaultHost() { return HostFalse; } virtual void Process (); void AddImplicitLibraries ( Module& module ); private: @@ -298,7 +255,6 @@ { public: MingwWin32OCXModuleHandler ( const Module& module ); - virtual HostType DefaultHost() { return HostFalse; } virtual void Process (); void AddImplicitLibraries ( Module& module ); private: @@ -310,7 +266,6 @@ { public: MingwWin32CUIModuleHandler ( const Module& module ); - virtual HostType DefaultHost() { return HostFalse; } virtual void Process (); void AddImplicitLibraries ( Module& module ); private: @@ -322,7 +277,6 @@ { public: MingwWin32GUIModuleHandler ( const Module& module ); - virtual HostType DefaultHost() { return HostFalse; } virtual void Process (); void AddImplicitLibraries ( Module& module ); private: @@ -334,7 +288,6 @@ { public: MingwBootLoaderModuleHandler ( const Module& module ); - virtual HostType DefaultHost() { return HostFalse; } virtual void Process (); private: void GenerateBootLoaderModuleTarget (); @@ -345,7 +298,6 @@ { public: MingwBootProgramModuleHandler ( const Module& module ); - virtual HostType DefaultHost() { return HostFalse; } virtual void Process (); std::string GetProgTextAddrMacro (); private: @@ -357,7 +309,6 @@ { public: MingwIsoModuleHandler ( const Module& module ); - virtual HostType DefaultHost() { return HostFalse; } virtual void Process (); private: void GenerateIsoModuleTarget (); @@ -376,7 +327,6 @@ { public: MingwLiveIsoModuleHandler ( const Module& module ); - virtual HostType DefaultHost() { return HostFalse; } virtual void Process (); private: void GenerateLiveIsoModuleTarget (); @@ -395,7 +345,6 @@ { public: MingwTestModuleHandler ( const Module& module ); - virtual HostType DefaultHost() { return HostFalse; } virtual void Process (); protected: virtual void GetModuleSpecificCompilationUnits ( std::vector<CompilationUnit*>& compilationUnits ); @@ -403,54 +352,10 @@ void GenerateTestModuleTarget (); };
- -class MingwRpcServerModuleHandler : public MingwModuleHandler -{ -public: - MingwRpcServerModuleHandler ( const Module& module ); - virtual HostType DefaultHost() { return HostFalse; } - virtual void Process (); -}; - - -class MingwRpcClientModuleHandler : public MingwModuleHandler -{ -public: - MingwRpcClientModuleHandler ( const Module& module ); - virtual HostType DefaultHost() { return HostFalse; } - virtual void Process (); -}; - - -class MingwRpcProxyModuleHandler : public MingwModuleHandler -{ -public: - MingwRpcProxyModuleHandler ( const Module& module ); - virtual HostType DefaultHost() { return HostFalse; } - virtual void Process (); -}; - -class MingwMessageHeaderModuleHandler : public MingwModuleHandler -{ -public: - MingwMessageHeaderModuleHandler ( const Module& module ); - virtual HostType DefaultHost() { return HostFalse; } - virtual void Process (); -}; - class MingwAliasModuleHandler : public MingwModuleHandler { public: MingwAliasModuleHandler ( const Module& module ); - virtual HostType DefaultHost() { return HostFalse; } - virtual void Process (); -}; - -class MingwIdlHeaderModuleHandler : public MingwModuleHandler -{ -public: - MingwIdlHeaderModuleHandler ( const Module& module ); - virtual HostType DefaultHost() { return HostFalse; } virtual void Process (); };
@@ -458,15 +363,6 @@ { public: MingwCabinetModuleHandler ( const Module& module ); - virtual HostType DefaultHost() { return HostFalse; } - virtual void Process (); -}; - -class MingwEmbeddedTypeLibModuleHandler : public MingwModuleHandler -{ -public: - MingwEmbeddedTypeLibModuleHandler ( const Module& module ); - virtual HostType DefaultHost() { return HostFalse; } virtual void Process (); };
@@ -474,7 +370,6 @@ { public: MingwElfExecutableModuleHandler ( const Module& module ); - virtual HostType DefaultHost() { return HostFalse; } virtual void Process (); };
Modified: branches/pierre-fsd/tools/rbuild/backend/msbuild/msbuild.cpp URL: http://svn.reactos.org/svn/reactos/branches/pierre-fsd/tools/rbuild/backend/... ============================================================================== --- branches/pierre-fsd/tools/rbuild/backend/msbuild/msbuild.cpp [iso-8859-1] (original) +++ branches/pierre-fsd/tools/rbuild/backend/msbuild/msbuild.cpp [iso-8859-1] Sun Aug 9 20:19:42 2009 @@ -100,16 +100,6 @@ { const IfableData& data = *ifs_list.back(); ifs_list.pop_back(); - for ( i = 0; i < data.ifs.size(); i++ ) - { - const Property* property = _lookup_property( module, data.ifs[i]->property ); - if ( property != NULL ) - { - if ( data.ifs[i]->value == property->value && data.ifs[i]->negated == false || - data.ifs[i]->value != property->value && data.ifs[i]->negated) - ifs_list.push_back ( &data.ifs[i]->data ); - } - } const vector<File*>& files = data.files; for ( i = 0; i < files.size(); i++ ) {
Modified: branches/pierre-fsd/tools/rbuild/backend/msvc/msvcmaker.cpp URL: http://svn.reactos.org/svn/reactos/branches/pierre-fsd/tools/rbuild/backend/... ============================================================================== --- branches/pierre-fsd/tools/rbuild/backend/msvc/msvcmaker.cpp [iso-8859-1] (original) +++ branches/pierre-fsd/tools/rbuild/backend/msvc/msvcmaker.cpp [iso-8859-1] Sun Aug 9 20:19:42 2009 @@ -95,9 +95,6 @@ { const IfableData& data = *ifs_list.back(); ifs_list.pop_back(); - // TODO FIXME - refactor needed - we're discarding if conditions - for ( i = 0; i < data.ifs.size(); i++ ) - ifs_list.push_back ( &data.ifs[i]->data ); const vector<File*>& files = data.files; for ( i = 0; i < files.size(); i++ ) {
Modified: branches/pierre-fsd/tools/rbuild/backend/msvc/vcprojmaker.cpp URL: http://svn.reactos.org/svn/reactos/branches/pierre-fsd/tools/rbuild/backend/... ============================================================================== --- branches/pierre-fsd/tools/rbuild/backend/msvc/vcprojmaker.cpp [iso-8859-1] (original) +++ branches/pierre-fsd/tools/rbuild/backend/msvc/vcprojmaker.cpp [iso-8859-1] Sun Aug 9 20:19:42 2009 @@ -147,16 +147,6 @@ { const IfableData& data = *ifs_list.back(); ifs_list.pop_back(); - for ( i = 0; i < data.ifs.size(); i++ ) - { - const Property* property = _lookup_property( module, data.ifs[i]->property ); - if ( property != NULL ) - { - if ( data.ifs[i]->value == property->value && data.ifs[i]->negated == false || - data.ifs[i]->value != property->value && data.ifs[i]->negated) - ifs_list.push_back ( &data.ifs[i]->data ); - } - } const vector<File*>& files = data.files; for ( i = 0; i < files.size(); i++ ) {
Modified: branches/pierre-fsd/tools/rbuild/module.cpp URL: http://svn.reactos.org/svn/reactos/branches/pierre-fsd/tools/rbuild/module.c... ============================================================================== --- branches/pierre-fsd/tools/rbuild/module.cpp [iso-8859-1] (original) +++ branches/pierre-fsd/tools/rbuild/module.cpp [iso-8859-1] Sun Aug 9 20:19:42 2009 @@ -1,5 +1,6 @@ /* * Copyright (C) 2005 Casper S. Hornstrup + * Copyright (C) 2008 Hervé Poussineau * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -210,8 +211,6 @@ delete compilerFlags[i]; for ( i = 0; i < modules.size(); i++ ) delete modules[i]; - for ( i = 0; i < ifs.size (); i++ ) - delete ifs[i]; for ( i = 0; i < compilationUnits.size (); i++ ) delete compilationUnits[i]; } @@ -229,8 +228,6 @@ p->second->ProcessXML (); for ( i = 0; i < compilerFlags.size(); i++ ) compilerFlags[i]->ProcessXML (); - for ( i = 0; i < ifs.size (); i++ ) - ifs[i]->ProcessXML (); for ( i = 0; i < compilationUnits.size (); i++ ) compilationUnits[i]->ProcessXML (); } @@ -604,7 +601,6 @@ const string& relative_path, ParseContext& parseContext ) { - If* pOldIf = parseContext.ifData; CompilationUnit* pOldCompilationUnit = parseContext.compilationUnit; bool subs_invalid = false; string subpath ( relative_path ); @@ -650,46 +646,35 @@ else { CompilationUnit* pCompilationUnit = new CompilationUnit ( pFile ); - if ( parseContext.ifData ) - parseContext.ifData->data.compilationUnits.push_back ( pCompilationUnit ); + string ext = ToLower ( GetExtension ( e.value ) ); + if ( ext == ".idl" ) + { + // put .idl files at the start of the module + non_if_data.compilationUnits.insert ( + non_if_data.compilationUnits.begin(), + pCompilationUnit ); + } + else if ( ext == ".asm" || ext == ".s" ) + { + // put .asm files at the end of the module + non_if_data.compilationUnits.push_back ( pCompilationUnit ); + non_if_data.asmFiles++; + } else { - string ext = ToLower ( GetExtension ( e.value ) ); - if ( ext == ".idl" ) - { - // put .idl files at the start of the module - non_if_data.compilationUnits.insert ( - non_if_data.compilationUnits.begin(), - pCompilationUnit ); - } - else if ( ext == ".asm" || ext == ".s" ) - { - // put .asm files at the end of the module - non_if_data.compilationUnits.push_back ( pCompilationUnit ); - non_if_data.asmFiles++; - } - else - { - // put other files in the middle - non_if_data.compilationUnits.insert ( - non_if_data.compilationUnits.end() - non_if_data.asmFiles, - pCompilationUnit ); - } + // put other files in the middle + non_if_data.compilationUnits.insert ( + non_if_data.compilationUnits.end() - non_if_data.asmFiles, + pCompilationUnit ); } } - if ( parseContext.ifData ) - parseContext.ifData->data.files.push_back ( pFile ); - else - non_if_data.files.push_back ( pFile ); + non_if_data.files.push_back ( pFile ); subs_invalid = true; } else if ( e.name == "library" && e.value.size () ) { Library* pLibrary = new Library ( e, *this, e.value ); - if ( parseContext.ifData ) - parseContext.ifData->data.libraries.push_back ( pLibrary ); - else - non_if_data.libraries.push_back ( pLibrary ); + non_if_data.libraries.push_back ( pLibrary ); subs_invalid = true; } else if ( e.name == "directory" ) @@ -716,73 +701,37 @@ else if ( e.name == "include" ) { Include* include = new Include ( project, &e, this ); - if ( parseContext.ifData ) - parseContext.ifData->data.includes.push_back ( include ); - else - non_if_data.includes.push_back ( include ); + non_if_data.includes.push_back ( include ); subs_invalid = true; } else if ( e.name == "define" ) { Define* pDefine = new Define ( project, this, e ); - if ( parseContext.ifData ) - parseContext.ifData->data.defines.push_back ( pDefine ); - else - non_if_data.defines.push_back ( pDefine ); + non_if_data.defines.push_back ( pDefine ); subs_invalid = true; } else if ( e.name == "metadata" ) { - if ( parseContext.ifData ) - { - throw XMLInvalidBuildFileException ( - e.location, - "<metadata> is not a valid sub-element of <if>" ); - } metadata = new Metadata ( e, *this ); subs_invalid = false; } else if ( e.name == "invoke" ) { - if ( parseContext.ifData ) - { - throw XMLInvalidBuildFileException ( - e.location, - "<invoke> is not a valid sub-element of <if>" ); - } invocations.push_back ( new Invoke ( e, *this ) ); subs_invalid = false; } else if ( e.name == "dependency" ) { - if ( parseContext.ifData ) - { - throw XMLInvalidBuildFileException ( - e.location, - "<dependency> is not a valid sub-element of <if>" ); - } dependencies.push_back ( new Dependency ( e, *this ) ); subs_invalid = true; } else if ( e.name == "bootsector" ) { - if ( parseContext.ifData ) - { - throw XMLInvalidBuildFileException ( - e.location, - "<bootsector> is not a valid sub-element of <if>" ); - } bootSector = new Bootsector ( e, this ); subs_invalid = true; } else if ( e.name == "importlibrary" ) { - if ( parseContext.ifData ) - { - throw XMLInvalidBuildFileException ( - e.location, - "<importlibrary> is not a valid sub-element of <if>" ); - } if ( importLibrary ) { throw XMLInvalidBuildFileException ( @@ -792,7 +741,7 @@ SetImportLibrary ( new ImportLibrary ( project, e, this ) ); subs_invalid = true; } - else if ( e.name == "if" ) + else if ( e.name == "if" || e.name == "ifnot" ) { const XMLAttribute* name; name = e.GetAttribute ( "property", true ); @@ -826,22 +775,10 @@ } subs_invalid = false; } - else if ( e.name == "ifnot" ) - { - parseContext.ifData = new If ( e, project, this, true ); - if ( pOldIf ) - pOldIf->data.ifs.push_back ( parseContext.ifData ); - else - non_if_data.ifs.push_back ( parseContext.ifData ); - subs_invalid = false; - } else if ( e.name == "compilerflag" ) { CompilerFlag* pCompilerFlag = new CompilerFlag ( project, this, e ); - if ( parseContext.ifData ) - parseContext.ifData->data.compilerFlags.push_back ( pCompilerFlag ); - else - non_if_data.compilerFlags.push_back ( pCompilerFlag ); + non_if_data.compilerFlags.push_back ( pCompilerFlag ); subs_invalid = true; } else if ( e.name == "linkerflag" ) @@ -851,12 +788,6 @@ } else if ( e.name == "linkerscript" ) { - if ( parseContext.ifData ) - { - throw XMLInvalidBuildFileException ( - e.location, - "<linkerscript> is not a valid sub-element of <if>" ); - } if ( linkerScript ) { throw XMLInvalidBuildFileException ( @@ -896,12 +827,6 @@ } else if ( e.name == "pch" ) { - if ( parseContext.ifData ) - { - throw XMLInvalidBuildFileException ( - e.location, - "<pch> is not a valid sub-element of <if>" ); - } if ( pch ) { throw XMLInvalidBuildFileException ( @@ -928,10 +853,7 @@ if ( project.configuration.CompilationUnitsEnabled ) { CompilationUnit* pCompilationUnit = new CompilationUnit ( &project, this, &e ); - if ( parseContext.ifData ) - parseContext.ifData->data.compilationUnits.push_back ( pCompilationUnit ); - else - non_if_data.compilationUnits.push_back ( pCompilationUnit ); + non_if_data.compilationUnits.push_back ( pCompilationUnit ); parseContext.compilationUnit = pCompilationUnit; } subs_invalid = false; @@ -957,7 +879,6 @@ } for ( size_t i = 0; i < e.subElements.size (); i++ ) ProcessXMLSubElement ( *e.subElements[i], subdirectory, subpath, parseContext ); - parseContext.ifData = pOldIf; parseContext.compilationUnit = pOldCompilationUnit; }
@@ -1155,14 +1076,17 @@ case KeyboardLayout: case KernelModeDLL: case KernelModeDriver: + if (Environment::GetArch() == "arm") return "DriverEntry"; return "DriverEntry@8"; case NativeDLL: - return "DllMainCRTStartup@12"; + if (Environment::GetArch() == "arm") return "DllMainCRTStartup"; + return "DllMainCRTStartup@12"; case NativeCUI: if (Environment::GetArch() == "arm") return "NtProcessStartup"; return "NtProcessStartup@4"; case Win32DLL: case Win32OCX: + if (Environment::GetArch() == "arm") return "DllMain"; return "DllMain@12"; case Win32CUI: case Test: @@ -1432,11 +1356,6 @@ if ( compilationUnit->HasFileWithExtension ( extension ) ) return true; } - for ( i = 0; i < data.ifs.size (); i++ ) - { - if ( HasFileWithExtension ( data.ifs[i]->data, extension ) ) - return true; - } return false; }
@@ -1937,34 +1856,6 @@ }
-If::If ( const XMLElement& node_, - const Project& project_, - const Module* module_, - const bool negated_ ) - : node(node_), project(project_), module(module_), negated(negated_) -{ - const XMLAttribute* att; - - att = node.GetAttribute ( "property", true ); - assert(att); - property = att->value; - - att = node.GetAttribute ( "value", true ); - assert(att); - value = att->value; -} - -If::~If () -{ -} - -void -If::ProcessXML() -{ - -} - - Property::Property ( const XMLElement& node_, const Project& project_, const Module* module_ )
Modified: branches/pierre-fsd/tools/rbuild/project.cpp URL: http://svn.reactos.org/svn/reactos/branches/pierre-fsd/tools/rbuild/project.... ============================================================================== --- branches/pierre-fsd/tools/rbuild/project.cpp [iso-8859-1] (original) +++ branches/pierre-fsd/tools/rbuild/project.cpp [iso-8859-1] Sun Aug 9 20:19:42 2009 @@ -1,5 +1,6 @@ /* * Copyright (C) 2005 Casper S. Hornstrup + * Copyright (C) 2008 Hervé Poussineau * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -93,8 +94,7 @@ }
ParseContext::ParseContext () - : ifData (NULL), - compilationUnit (NULL) + : compilationUnit (NULL) { }
@@ -315,27 +315,6 @@
non_if_data.ExtractModules( modules );
- for ( i = 0; i < non_if_data.ifs.size (); i++ ) - { - const Property *property = - LookupProperty( non_if_data.ifs[i]->property ); - - if( !property ) continue; - - bool conditionTrue = - (non_if_data.ifs[i]->negated && - (property->value != non_if_data.ifs[i]->value)) || - (property->value == non_if_data.ifs[i]->value); - if ( conditionTrue ) - non_if_data.ifs[i]->data.ExtractModules( modules ); - else - { - If * if_data = non_if_data.ifs[i]; - non_if_data.ifs.erase ( non_if_data.ifs.begin () + i ); - delete if_data; - i--; - } - } for ( i = 0; i < linkerFlags.size (); i++ ) linkerFlags[i]->ProcessXML (); for( std::map<std::string, Module*>::const_iterator p = modules.begin(); p != modules.end(); ++ p ) @@ -352,7 +331,6 @@ ParseContext& parseContext ) { bool subs_invalid = false; - If* pOldIf = parseContext.ifData;
string subpath(path); if ( e.name == "module" ) @@ -364,10 +342,7 @@ "module name conflict: '%s' (originally defined at %s)", module->name.c_str(), module->node.location.c_str() ); - if ( parseContext.ifData ) - parseContext.ifData->data.modules.push_back( module ); - else - non_if_data.modules.push_back ( module ); + non_if_data.modules.push_back ( module ); return; // defer processing until later } else if ( e.name == "cdfile" ) @@ -415,10 +390,7 @@ else if ( e.name == "compilerflag" ) { CompilerFlag* pCompilerFlag = new CompilerFlag ( *this, e ); - if ( parseContext.ifData ) - parseContext.ifData->data.compilerFlags.push_back ( pCompilerFlag ); - else - non_if_data.compilerFlags.push_back ( pCompilerFlag ); + non_if_data.compilerFlags.push_back ( pCompilerFlag ); subs_invalid = true; } else if ( e.name == "linkerflag" ) @@ -426,7 +398,7 @@ linkerFlags.push_back ( new LinkerFlag ( *this, e ) ); subs_invalid = true; } - else if ( e.name == "if" ) + else if ( e.name == "if" || e.name == "ifnot" ) { const XMLAttribute* name; name = e.GetAttribute ( "property", true ); @@ -460,15 +432,6 @@ } subs_invalid = false; } - else if ( e.name == "ifnot" ) - { - parseContext.ifData = new If ( e, *this, NULL, true ); - if ( pOldIf ) - pOldIf->data.ifs.push_back ( parseContext.ifData ); - else - non_if_data.ifs.push_back ( parseContext.ifData ); - subs_invalid = false; - } else if ( e.name == "property" ) { Property* property = new Property ( e, *this, NULL ); @@ -483,8 +446,6 @@ } for ( size_t i = 0; i < e.subElements.size (); i++ ) ProcessXMLSubElement ( *e.subElements[i], subpath, parseContext ); - - parseContext.ifData = pOldIf; }
Module*
Modified: branches/pierre-fsd/tools/rbuild/rbuild.h URL: http://svn.reactos.org/svn/reactos/branches/pierre-fsd/tools/rbuild/rbuild.h... ============================================================================== --- branches/pierre-fsd/tools/rbuild/rbuild.h [iso-8859-1] (original) +++ branches/pierre-fsd/tools/rbuild/rbuild.h [iso-8859-1] Sun Aug 9 20:19:42 2009 @@ -83,7 +83,6 @@ class InvokeFile; class Dependency; class ImportLibrary; -class If; class CompilerFlag; class LinkerFlag; class LinkerScript; @@ -204,7 +203,6 @@ class ParseContext { public: - If* ifData; CompilationUnit* compilationUnit; ParseContext (); }; @@ -221,7 +219,6 @@ std::map<std::string, Property*> properties; std::vector<Module*> modules; std::vector<CompilerFlag*> compilerFlags; - std::vector<If*> ifs; int asmFiles; // number of .asm files in compilationUnits
IfableData(); @@ -262,6 +259,7 @@ const Module* LocateModule ( const std::string& name ) const; const std::string& GetProjectFilename () const; std::string ResolveProperties ( const std::string& s ) const; + const Property* LookupProperty ( const std::string& name ) const; private: std::string ResolveNextProperty ( const std::string& s ) const; void ReadXml (); @@ -307,10 +305,10 @@ ElfExecutable, RpcProxy, HostStaticLibrary, - TypeDontCare, Cabinet, KeyboardLayout, - MessageHeader + MessageHeader, + TypeDontCare, // always at the end };
enum HostType @@ -611,26 +609,6 @@ };
-class If -{ -public: - const XMLElement& node; - const Project& project; - const Module* module; - const bool negated; - std::string property, value; - IfableData data; - - If ( const XMLElement& node_, - const Project& project_, - const Module* module_, - const bool negated_ = false ); - ~If(); - - void ProcessXML(); -}; - - class CompilerFlag { public:
Modified: branches/pierre-fsd/tools/rbuild/testsupportcode.cpp URL: http://svn.reactos.org/svn/reactos/branches/pierre-fsd/tools/rbuild/testsupp... ============================================================================== --- branches/pierre-fsd/tools/rbuild/testsupportcode.cpp [iso-8859-1] (original) +++ branches/pierre-fsd/tools/rbuild/testsupportcode.cpp [iso-8859-1] Sun Aug 9 20:19:42 2009 @@ -312,27 +312,6 @@ if ( !compilationUnits[i]->IsGeneratedFile () && IsTestFile ( filename ) ) list.push_back ( filename ); } - // intentionally make a copy so that we can append more work in - // the middle of processing without having to go recursive - vector<If*> v = module.non_if_data.ifs; - for ( i = 0; i < v.size (); i++ ) - { - size_t j; - If& rIf = *v[i]; - // check for sub-ifs to add to list - const vector<If*>& ifs = rIf.data.ifs; - for ( j = 0; j < ifs.size (); j++ ) - v.push_back ( ifs[j] ); - const vector<CompilationUnit*>& compilationUnits = rIf.data.compilationUnits; - for ( j = 0; j < compilationUnits.size (); j++ ) - { - CompilationUnit& compilationUnit = *compilationUnits[j]; - const FileLocation& sourceFileLocation = compilationUnits[j]->GetFilename (); - string filename = sourceFileLocation.relative_path + sSep + sourceFileLocation.name; - if ( !compilationUnit.IsGeneratedFile () && IsTestFile ( filename ) ) - list.push_back ( filename ); - } - } }
char*