- Add a "host" attribute to the project's <include> and <define> tags to make it...
authorColin Finck <colin@reactos.org>
Sun, 26 Oct 2008 18:03:06 +0000 (18:03 +0000)
committerColin Finck <colin@reactos.org>
Sun, 26 Oct 2008 18:03:06 +0000 (18:03 +0000)
- Define TARGET_arm/TARGET_i386 in the ReactOS-arm.rbuild/ReactOS-i386.rbuild files for the host tools to make it possible for them to know about the target to build
- Make use of this define in winebuild to fix the issue of r36927 properly
- Define global includes for host tools to simplify all host tool/library rbuild files
- Remove dead rbuild code

- Remove the include/reactos/config.h file, none of its defines are still used
- Fix components accidentally using that file

svn path=/trunk/; revision=36995

24 files changed:
reactos/ReactOS-arm.rbuild
reactos/ReactOS-generic.rbuild
reactos/ReactOS-i386.rbuild
reactos/base/applications/winhlp32/winhlp32.rbuild
reactos/dll/directx/quartz/quartz.rbuild
reactos/dll/win32/netshell/precomp.h
reactos/dll/win32/user32/misc/dde.c
reactos/include/reactos/config.h [deleted file]
reactos/lib/cmlib/cmlib.rbuild
reactos/lib/host/wcsfuncs/wcsfuncs.rbuild
reactos/lib/inflib/inflib.rbuild
reactos/tools/cabman/cabman.rbuild
reactos/tools/mkhive/mkhive.rbuild
reactos/tools/rbuild/backend/mingw/modulehandler.cpp
reactos/tools/rbuild/backend/mingw/modulehandler.h
reactos/tools/rbuild/project.cpp
reactos/tools/rbuild/rbuild.h
reactos/tools/unicode/unicode.rbuild
reactos/tools/widl/widl.rbuild
reactos/tools/winebuild/main.c
reactos/tools/winebuild/winebuild.rbuild
reactos/tools/wmc/wmc.rbuild
reactos/tools/wpp/wpp.rbuild
reactos/tools/wrc/wrc.rbuild

index 5f6e7b7..2020732 100644 (file)
@@ -12,6 +12,7 @@
        <define name="__REACTOS__" />
        <define name="_ARM_" />
        <define name="__arm__" />
+       <define name="TARGET_arm" host="true" />
 
        <if property="DBG" value="1">
                <define name="DBG">1</define>
index 540bb9a..e1cfc85 100644 (file)
@@ -4,6 +4,8 @@
        <xi:include href="baseaddress.rbuild" />
 
        <define name="__REACTOS__" />
+       <define name="__REACTOS__" host="true" />
+
        <if property="DBG" value="1">
                <define name="DBG">1</define>
                <define name="_SEH_ENABLE_TRACE" />
        <include root="intermediate">include/reactos/mc</include>
        <include>include/reactos/libs</include>
 
+       <include host="true">include</include>
+       <include host="true" root="intermediate">include</include>
+       <include host="true">include/reactos</include>
+       <include host="true">include/reactos/wine</include>
+
        <directory name="base">
                <xi:include href="base/base.rbuild" />
        </directory>
index 8ddfbb5..ae72757 100644 (file)
@@ -12,6 +12,7 @@
        <define name="_M_IX86" />
        <define name="_X86_" />
        <define name="__i386__" />
+       <define name="TARGET_i386" host="true" />
 
        <property name="NTOSKRNL_SHARED" value="-file-alignment=0x1000 -section-alignment=0x1000 -shared"/>
 
index 1730cb5..1ad54f4 100644 (file)
@@ -2,6 +2,7 @@
 <!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd">
 <module name="winhlp32" type="win32gui" installbase="system32" installname="winhlp32.exe" unicode="no" allowwarnings="true">
        <include base="winhlp32">.</include>
+       <include base="ReactOS">include/reactos/wine</include>
        <library>wine</library>
        <library>comdlg32</library>
        <library>comctl32</library>
index 03474d9..c702764 100644 (file)
@@ -5,6 +5,7 @@
        <autoregister infsection="OleControlDlls" type="DllRegisterServer" />
        <importlibrary definition="quartz.spec" />
        <include base="quartz">.</include>
+       <include base="ReactOS">include/reactos/wine</include>
        <define name="_WIN32_WINNT">0x600</define>
        <library>wine</library>
        <library>uuid</library>
index 66613ac..fa75e02 100644 (file)
@@ -1,8 +1,6 @@
 #ifndef _PRECOMP_H__
 #define _PRECOMP_H__
 
-#include "config.h"
-
 #include <stdarg.h>
 #include <stdlib.h>
 #include <string.h>
index a5617e9..37d3e99 100644 (file)
@@ -23,8 +23,6 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
-#include "config.h"
-
 #include <user32.h>
 #include "dde_private.h"
 #include "wine/unicode.h"
diff --git a/reactos/include/reactos/config.h b/reactos/include/reactos/config.h
deleted file mode 100644 (file)
index e11266e..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-#ifndef _INC_REACTOS_CONFIG_H
-#define _INC_REACTOS_CONFIG_H
-/* $Id$ */
-/* ReactOS global configuration options */
-
-#define CONFIG_PROCESSOR_FAMILY_I386   386L
-#define CONFIG_PROCESSOR_FAMILY_I486   486L
-#define CONFIG_PROCESSOR_FAMILY_I586   586L
-#define CONFIG_PROCESSOR_FAMILY_IPII   686L
-
-#define CONFIG_PROCESSOR_FAMILY_ALPHA  0x10000000
-
-#define CONFIG_ARCHITECTURE_IBMPC      0x00000000
-/*
- * Processor and architecture.
- */
-#define CONFIG_PROCESSOR_FAMILY        CONFIG_PROCESSOR_FAMILY_I586
-#define CONFIG_ARCHITECTURE    CONFIG_ARCHITECTURE_IBMPC
-/*
- * Hardware page size
- */
-#define CONFIG_MEMORY_PAGE_SIZE        4096
-/*
- * Use __fastcall calling conventions when needed
- * in system components that require it.
- */
-
-/* #define CONFIG_USE_FASTCALL */
-
-/*
- * Enable debugging output on a per module
- * base.
- */
-#define DBG_NTOSKRNL_KE_MAIN
-#define DBG_NTOSKRNL_MM_MM
-#define DBG_NTOSKRNL_MM_NPOOL
-
-#define DBG_NTDLL_LDR_STARTUP
-#define DBG_NTDLL_LDR_UTILS
-
-#endif /* ndef _INC_REACTOS_CONFIG_H */
index 61392ce..621988f 100644 (file)
@@ -16,8 +16,6 @@
 </module>
 <module name="cmlibhost" type="hoststaticlibrary">
        <include base="cmlibhost">.</include>
-       <include base="ReactOS">include/reactos</include>
-       <include base="ReactOS">include</include>
        <define name="__NO_CTYPE_INLINES" />
        <define name="_NTOSKRNL_" />
        <define name="_NTSYSTEM_" />
index d4c83da..15025ed 100644 (file)
@@ -1,6 +1,5 @@
 <?xml version="1.0"?>
 <!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd">
 <module name="host_wcsfuncs" type="hoststaticlibrary">
-       <include base="ReactOS">include</include>
        <file>wcsfuncs.c</file>
 </module>
index 23de4ac..7004583 100644 (file)
 </module>
 <module name="inflibhost" type="hoststaticlibrary" allowwarnings="true">
        <include base="inflibhost">.</include>
-       <include base="ReactOS">include/reactos</include>
        <define name="__NO_CTYPE_INLINES" />
        <compilerflag>-Wpointer-arith</compilerflag>
        <compilerflag>-Wconversion</compilerflag>
        <compilerflag>-Wstrict-prototypes</compilerflag>
        <compilerflag>-Wmissing-prototypes</compilerflag>
        <define name="INFLIB_HOST" />
-       <include base="ReactOS">include</include>
        <file>infcore.c</file>
        <file>infget.c</file>
        <file>infput.c</file>
index 79f3433..ef058bb 100644 (file)
@@ -1,7 +1,6 @@
 <?xml version="1.0"?>
 <!DOCTYPE module SYSTEM "../../tools/rbuild/project.dtd">
 <module name="cabman" type="buildtool">
-       <include base="ReactOS">include</include>
        <include base="zlibhost">.</include>
        <library>zlibhost</library>
        <file>cabinet.cxx</file>
index 0eed6bf..341d1dc 100644 (file)
@@ -1,8 +1,6 @@
 <?xml version="1.0"?>
 <!DOCTYPE module SYSTEM "../../tools/rbuild/project.dtd">
 <module name="mkhive" type="buildtool" allowwarnings="true">
-       <include base="ReactOS">include</include>
-       <include base="ReactOS">include/reactos</include>
        <include base="inflibhost">.</include>
        <include base="cmlibhost">.</include>
        <include base="zlibhost">.</include>
index a444c18..0e68730 100644 (file)
@@ -590,20 +590,6 @@ MingwModuleHandler::GenerateGccDefineParametersFromVector (
        return parameters;
 }
 
-string
-MingwModuleHandler::GenerateGccDefineParameters () const
-{
-       set<string> used_defs;
-       string parameters = GenerateGccDefineParametersFromVector ( module.project.non_if_data.defines, used_defs );
-       string s = GenerateGccDefineParametersFromVector ( module.non_if_data.defines, used_defs );
-       if ( s.length () > 0 )
-       {
-               parameters += " ";
-               parameters += s;
-       }
-       return parameters;
-}
-
 string
 MingwModuleHandler::ConcatenatePaths (
        const string& path1,
@@ -631,19 +617,6 @@ MingwModuleHandler::GenerateGccIncludeParametersFromVector ( const vector<Includ
        return parameters;
 }
 
-string
-MingwModuleHandler::GenerateGccIncludeParameters () const
-{
-       string parameters = GenerateGccIncludeParametersFromVector ( module.non_if_data.includes );
-       string s = GenerateGccIncludeParametersFromVector ( module.project.non_if_data.includes );
-       if ( s.length () > 0 )
-       {
-               parameters += " ";
-               parameters += s;
-       }
-       return parameters;
-}
-
 string
 MingwModuleHandler::GenerateCompilerParametersFromVector ( const vector<CompilerFlag*>& compilerFlags, const CompilerType type ) const
 {
@@ -1870,7 +1843,11 @@ MingwModuleHandler::GenerateOtherMacros ()
                &module.linkerFlags,
                used_defs );
 
-       if ( ModuleHandlerInformations[module.type].DefaultHost == HostFalse )
+       if ( ModuleHandlerInformations[module.type].DefaultHost == HostTrue )
+       {
+               GenerateMacros("+=", module.project.host_non_if_data, NULL, used_defs);
+       }
+       else
        {
                GenerateMacros (
                        "+=",
@@ -1899,7 +1876,7 @@ MingwModuleHandler::GenerateOtherMacros ()
        if ( ModuleHandlerInformations[module.type].DefaultHost == HostFalse )
                globalCflags += " $(PROJECT_CFLAGS)";
        else
-               globalCflags += " -Wall -Wpointer-arith -D__REACTOS__";
+               globalCflags += " -Wall -Wpointer-arith";
        globalCflags += " -g";
        if ( backend->usePipe )
                globalCflags += " -pipe";
index bf5e4a6..556cf5d 100644 (file)
@@ -116,7 +116,6 @@ protected:
 private:
        std::string ConcatenatePaths ( const std::string& path1,
                                       const std::string& path2 ) const;
-       std::string GenerateGccDefineParameters () const;
        std::string GenerateCompilerParametersFromVector ( const std::vector<CompilerFlag*>& compilerFlags, const CompilerType type ) const;
        std::string GenerateLinkerParametersFromVector ( const std::vector<LinkerFlag*>& linkerFlags ) const;
        std::string GenerateImportLibraryDependenciesFromVector ( const std::vector<Library*>& libraries );
@@ -132,9 +131,6 @@ private:
                              std::set<const Define *>& used_defs );
        void GenerateSourceMacros ( const IfableData& data );
        void GenerateObjectMacros ( const IfableData& data );
-       std::string GenerateGccIncludeParameters () const;
-       std::string GenerateGccParameters () const;
-       std::string GenerateNasmParameters () const;
        const FileLocation* GetPrecompiledHeaderFilename () const;
        void GenerateGccCommand ( const FileLocation* sourceFile,
                                  const Rule *rule,
index deb288c..8660120 100644 (file)
@@ -306,6 +306,7 @@ Project::ProcessXML ( const string& path )
        }
 
        non_if_data.ProcessXML ();
+       host_non_if_data.ProcessXML ();
 
        non_if_data.ExtractModules( modules );
 
@@ -359,14 +360,26 @@ Project::ProcessXMLSubElement ( const XMLElement& e,
        }
        else if ( e.name == "include" )
        {
+               const XMLAttribute* host = e.GetAttribute("host", false);
                Include* include = new Include ( *this, &e );
-               non_if_data.includes.push_back ( include );
+
+               if(host && host->value == "true")
+                       host_non_if_data.includes.push_back(include);
+               else
+                       non_if_data.includes.push_back ( include );
+
                subs_invalid = true;
        }
        else if ( e.name == "define" )
        {
+               const XMLAttribute* host = e.GetAttribute("host", false);
                Define* define = new Define ( *this, e );
-               non_if_data.defines.push_back ( define );
+
+               if(host && host->value == "true")
+                       host_non_if_data.defines.push_back(define);
+               else
+                       non_if_data.defines.push_back ( define );
+
                subs_invalid = true;
        }
        else if ( e.name == "compilerflag" )
index 2e5645c..3d87200 100644 (file)
@@ -236,6 +236,7 @@ public:
        std::vector<InstallFile*> installfiles;
        std::map<std::string, Module*> modules;
        IfableData non_if_data;
+       IfableData host_non_if_data;
 
        Project ( const Configuration& configuration,
                  const std::string& filename,
index f43be12..478e5bc 100644 (file)
@@ -2,9 +2,6 @@
 <!DOCTYPE module SYSTEM "../../tools/rbuild/project.dtd">
 <module name="unicode" type="hoststaticlibrary">
        <define name="WINE_UNICODE_API">" "</define>
-       <include base="ReactOS">include/reactos/wine</include>
-       <include base="ReactOS">include/reactos</include>
-       <include base="ReactOS">include</include>
        <file>casemap.c</file>
        <file>compose.c</file>
        <file>cptable.c</file>
index ddba3f7..7901c19 100644 (file)
@@ -4,10 +4,6 @@
        <define name="INT16">SHORT</define>
        <define name="YYDEBUG">1</define>
        <include base="wpp">.</include>
-       <include base="ReactOS">include/reactos/wine</include>
-       <include base="ReactOS">include/reactos</include>
-       <include base="ReactOS">include</include>
-       <include base="ReactOS" root="intermediate">include</include>
        <library>wpp</library>
        <file>client.c</file>
        <file>hash.c</file>
index 6614680..f588132 100644 (file)
@@ -48,16 +48,10 @@ int verbose = 0;
 int save_temps = 0;
 int link_ext_symbols = 0;
 
-#if defined(__i386__) || defined(__x86_64__)
+#if defined(TARGET_i386)
 enum target_cpu target_cpu = CPU_x86;
-#elif defined(__x86_64__)
+#elif defined(TARGET_amd64)
 enum target_cpu target_cpu = CPU_x86_64;
-#elif defined(__sparc__)
-enum target_cpu target_cpu = CPU_SPARC;
-#elif defined(__ALPHA__)
-enum target_cpu target_cpu = CPU_ALPHA;
-#elif defined(__powerpc__)
-enum target_cpu target_cpu = CPU_POWERPC;
 #else
 #error Unsupported CPU
 #endif
index 5398fc0..4e26e55 100644 (file)
@@ -1,10 +1,6 @@
 <?xml version="1.0"?>
 <!DOCTYPE module SYSTEM "../../tools/rbuild/project.dtd">
 <module name="winebuild" type="buildtool">
-       <include base="ReactOS">include/reactos/wine</include>
-       <include base="ReactOS">include/reactos</include>
-       <include base="ReactOS">include</include>
-       <include base="ReactOS" root="intermediate">include</include>
        <file>import.c</file>
        <file>main.c</file>
        <file>parser.c</file>
index ef89b14..6822c82 100644 (file)
@@ -3,10 +3,6 @@
 <module name="wmc" type="buildtool" allowwarnings="true">
        <define name="WINE_UNICODE_API">" "</define>
        <include base="unicode">.</include>
-       <include base="ReactOS">include/reactos/wine</include>
-       <include base="ReactOS">include/reactos</include>
-       <include base="ReactOS">include</include>
-       <include base="ReactOS" root="intermediate">include</include>
        <library>unicode</library>
        <file>lang.c</file>
        <file>mcl.c</file>
index 8e4ca42..360aae8 100644 (file)
@@ -1,10 +1,6 @@
 <?xml version="1.0"?>
 <!DOCTYPE module SYSTEM "../../tools/rbuild/project.dtd">
 <module name="wpp" type="hoststaticlibrary" allowwarnings="true">
-       <include base="ReactOS">include/reactos/wine</include>
-       <include base="ReactOS">include/reactos</include>
-       <include base="ReactOS">include</include>
-       <include base="ReactOS" root="intermediate">include</include>
        <file>lex.yy.c</file>
        <file>preproc.c</file>
        <file>wpp.c</file>
index c7d4275..4ea83b3 100644 (file)
@@ -4,10 +4,6 @@
        <define name="WINE_UNICODE_API">" "</define>
        <include base="unicode" />
        <include base="wpp" />
-       <include base="ReactOS">include/reactos/wine</include>
-       <include base="ReactOS">include/reactos</include>
-       <include base="ReactOS">include</include>
-       <include base="ReactOS" root="intermediate">include</include>
        <library>unicode</library>
        <library>wpp</library>
        <file>dumpres.c</file>