Author: tkreuzer
Date: Sat Dec 6 03:37:08 2008
New Revision: 37884
URL:
http://svn.reactos.org/svn/reactos?rev=37884&view=rev
Log:
merge rbuild changes 37270-37632 from trunk
Modified:
branches/ros-amd64-bringup/reactos/tools/rbuild/backend/mingw/mingw.cpp
branches/ros-amd64-bringup/reactos/tools/rbuild/backend/mingw/modulehandler.cpp
branches/ros-amd64-bringup/reactos/tools/rbuild/backend/mingw/modulehandler.h
Modified: branches/ros-amd64-bringup/reactos/tools/rbuild/backend/mingw/mingw.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/tools…
==============================================================================
--- branches/ros-amd64-bringup/reactos/tools/rbuild/backend/mingw/mingw.cpp [iso-8859-1]
(original)
+++ branches/ros-amd64-bringup/reactos/tools/rbuild/backend/mingw/mingw.cpp [iso-8859-1]
Sat Dec 6 03:37:08 2008
@@ -392,7 +392,7 @@
if ( data.includes.size () > 0 )
fprintf (
fMakefile,
- "PROJECT_CFLAGS %s %s\n",
+ "PROJECT_CINCLUDES %s %s\n",
assignmentOperation,
MingwModuleHandler::GenerateGccIncludeParametersFromVector ( data.includes ).c_str
());
@@ -529,19 +529,20 @@
GenerateGlobalCFlagsAndProperties ( "=", ProjectNode.non_if_data );
GenerateProjectGccOptions ( "=", ProjectNode.non_if_data );
- fprintf ( fMakefile, "PROJECT_RCFLAGS := $(PROJECT_CFLAGS)
$(PROJECT_CDEFINES)\n" );
- fprintf ( fMakefile, "PROJECT_WIDLFLAGS := $(PROJECT_CFLAGS)
$(PROJECT_CDEFINES)\n" );
+ fprintf ( fMakefile, "PROJECT_RCFLAGS := $(PROJECT_CINCLUDES)
$(PROJECT_CDEFINES)\n" );
+ fprintf ( fMakefile, "PROJECT_WIDLFLAGS := $(PROJECT_CINCLUDES)
$(PROJECT_CDEFINES)\n" );
fprintf ( fMakefile, "PROJECT_LFLAGS := '$(shell ${TARGET_CC}
-print-libgcc-file-name)' %s\n", GenerateProjectLFLAGS ().c_str () );
fprintf ( fMakefile, "PROJECT_LPPFLAGS := '$(shell ${TARGET_CPP}
-print-file-name=libstdc++.a)' '$(shell ${TARGET_CPP}
-print-file-name=libgcc.a)' '$(shell ${TARGET_CPP}
-print-file-name=libmingw32.a)' '$(shell ${TARGET_CPP}
-print-file-name=libmingwex.a)' '$(shell ${TARGET_CPP}
-print-file-name=libcoldname.a)'\n" );
/* hack to get libgcc_eh.a, should check mingw version or something */
fprintf ( fMakefile, "ifeq ($(ARCH),amd64)\n" );
fprintf ( fMakefile, "PROJECT_LPPFLAGS += '$(shell ${TARGET_CPP}
-print-file-name=libgcc_eh.a)'\n" );
fprintf ( fMakefile, "endif\n" );
- fprintf ( fMakefile, "PROJECT_CFLAGS += -Wall\n" );
+ fprintf ( fMakefile, "PROJECT_GCCOPTIONS += -Wall\n" );
fprintf ( fMakefile, "ifneq ($(OARCH),)\n" );
- fprintf ( fMakefile, "PROJECT_CFLAGS += -march=$(OARCH)\n" );
+ fprintf ( fMakefile, "PROJECT_GCCOPTIONS += -march=$(OARCH)\n" );
fprintf ( fMakefile, "endif\n" );
- fprintf ( fMakefile, "PROJECT_CFLAGS += $(PROJECT_GCCOPTIONS)\n" );
+ fprintf ( fMakefile, "PROJECT_CFLAGS = $(PROJECT_GCCOPTIONS)
$(PROJECT_GCC_CFLAGS)\n" );
+ fprintf ( fMakefile, "PROJECT_CXXFLAGS = $(PROJECT_GCCOPTIONS)
$(PROJECT_GCC_CXXFLAGS)\n" );
fprintf ( fMakefile, "\n" );
}
Modified: branches/ros-amd64-bringup/reactos/tools/rbuild/backend/mingw/modulehandler.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/tools…
==============================================================================
--- branches/ros-amd64-bringup/reactos/tools/rbuild/backend/mingw/modulehandler.cpp
[iso-8859-1] (original)
+++ branches/ros-amd64-bringup/reactos/tools/rbuild/backend/mingw/modulehandler.cpp
[iso-8859-1] Sat Dec 6 03:37:08 2008
@@ -752,7 +752,7 @@
{
fprintf ( fMakefile, "# MACROS\n" );
GenerateMacro ( assignmentOperation,
- cflagsMacro,
+ commonflagsMacro,
data,
&used_defs,
true );
@@ -1096,7 +1096,7 @@
"\t$(Q)$(WIDL_TARGET) $($(module_name)_WIDLFLAGS) -h -H
$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext)_s.h -s -S
$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext)_s.c $(source)\n"
"$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext)_s.o:
$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext)_s.c
$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext)_s.h$(dependencies) |
$(INTERMEDIATE)$(SEP)$(source_dir)\n"
"\t$(ECHO_CC)\n"
- "\t${gcc} -o $@ $($(module_name)_CFLAGS)$(compiler_flags) -c
$<\n",
+ "\t${gcc} -o $@ $($(module_name)_CFLAGS)$(compiler_flags)
-fno-unit-at-a-time -c $<\n",
"$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext)_s.h",
"$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext)_s.c",
"$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext)_s.o",
@@ -1107,7 +1107,7 @@
"\t$(Q)$(WIDL_TARGET) $($(module_name)_WIDLFLAGS) -h -H
$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext)_c.h -c -C
$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext)_c.c $(source)\n"
"$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext)_c.o:
$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext)_c.c
$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext)_c.h$(dependencies) |
$(INTERMEDIATE)$(SEP)$(source_dir)\n"
"\t$(ECHO_CC)\n"
- "\t${gcc} -o $@ $($(module_name)_CFLAGS)$(compiler_flags) -c
$<\n",
+ "\t${gcc} -o $@ $($(module_name)_CFLAGS)$(compiler_flags)
-fno-unit-at-a-time -c $<\n",
"$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext)_c.h",
"$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext)_c.c",
"$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext)_c.o",
@@ -1118,7 +1118,7 @@
"\t$(Q)$(WIDL_TARGET) $($(module_name)_WIDLFLAGS) -h -H
$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext)_p.h -p -P
$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext)_p.c $(source)\n"
"$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext)_p.o:
$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext)_p.c
$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext)_p.h$(dependencies) |
$(INTERMEDIATE)$(SEP)$(source_dir)\n"
"\t$(ECHO_CC)\n"
- "\t${gcc} -o $@ $($(module_name)_CFLAGS)$(compiler_flags) -c
$<\n",
+ "\t${gcc} -o $@ $($(module_name)_CFLAGS)$(compiler_flags)
-fno-unit-at-a-time -c $<\n",
"$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext)_p.h",
"$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext)_p.c",
"$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext)_p.o",
@@ -1141,12 +1141,12 @@
Rule gppRule ( "$(source): ${$(module_name)_precondition}\n"
"$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext)_$(module_name).o:
$(source)$(dependencies) | $(INTERMEDIATE)$(SEP)$(source_dir)\n"
"\t$(ECHO_CC)\n"
- "\t${gpp} -o $@ $($(module_name)_CFLAGS)$(compiler_flags) -c
$<\n",
+ "\t${gpp} -o $@ $($(module_name)_CXXFLAGS)$(compiler_flags) -c
$<\n",
"$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext)_$(module_name).o",
NULL );
Rule gppHostRule ( "$(source): ${$(module_name)_precondition}\n"
"$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext)_$(module_name).o:
$(source)$(dependencies) | $(INTERMEDIATE)$(SEP)$(source_dir)\n"
"\t$(ECHO_CC)\n"
- "\t${host_gpp} -o $@ $($(module_name)_CFLAGS)$(compiler_flags) -c
$<\n",
+ "\t${host_gpp} -o $@ $($(module_name)_CXXFLAGS)$(compiler_flags)
-c $<\n",
"$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext)_$(module_name).o",
NULL );
Rule emptyRule ( "", NULL );
@@ -1658,7 +1658,7 @@
"\t%s -o %s %s %s -g %s\n\n",
module.cplusplus ? cppc.c_str() : cc.c_str(),
backend->GetFullName ( *pchFilename ).c_str(),
- cflagsMacro.c_str(),
+ module.cplusplus ? cxxflagsMacro.c_str() : cflagsMacro.c_str(),
GenerateCompilerParametersFromVector ( module.non_if_data.compilerFlags,
module.cplusplus ? CompilerTypeCPP : CompilerTypeCC ).c_str(),
backend->GetFullName ( baseHeaderFile ).c_str() );
delete pchFilename;
@@ -1709,13 +1709,6 @@
fprintf ( fMakefile, "\n" );
return archiveFilename;
-}
-
-string
-MingwModuleHandler::GetCFlagsMacro () const
-{
- return ssprintf ( "$(%s_CFLAGS)",
- module.name.c_str () );
}
/*static*/ string
@@ -1847,7 +1840,9 @@
fprintf ( fMakefile, "# OTHER MACROS\n" );
+ commonflagsMacro = ssprintf ("%s_COMMONFLAGS", module.name.c_str ());
cflagsMacro = ssprintf ("%s_CFLAGS", module.name.c_str ());
+ cxxflagsMacro = ssprintf ("%s_CXXFLAGS", module.name.c_str ());
nasmflagsMacro = ssprintf ("%s_NASMFLAGS", module.name.c_str ());
windresflagsMacro = ssprintf ("%s_RCFLAGS", module.name.c_str ());
widlflagsMacro = ssprintf ("%s_WIDLFLAGS", module.name.c_str ());
@@ -1890,10 +1885,10 @@
fprintf ( fMakefile, "\n" );
}
- string globalCflags = "";
+ string globalCflags = " ";
+ globalCflags += ssprintf ("$(%s)", commonflagsMacro.c_str ());
if ( ModuleHandlerInformations[module.type].DefaultHost == HostFalse )
{
- globalCflags += " $(PROJECT_CFLAGS)";
if ( module.dynamicCRT )
globalCflags += " -D_DLL -D__USE_CRTIMP";
}
@@ -1925,14 +1920,20 @@
// (TODO: Move to version-specific once this bug is fixed in GCC)
globalCflags += " -fno-optimize-sibling-calls";
- fprintf (
- fMakefile,
- "%s +=%s\n",
- cflagsMacro.c_str (),
- globalCflags.c_str () );
-
if ( ModuleHandlerInformations[module.type].DefaultHost == HostFalse )
{
+ fprintf (
+ fMakefile,
+ "%s +=%s\n",
+ cflagsMacro.c_str (),
+ (" $(PROJECT_CFLAGS)" + globalCflags).c_str () );
+
+ fprintf (
+ fMakefile,
+ "%s +=%s\n",
+ cxxflagsMacro.c_str (),
+ (" $(PROJECT_CXXFLAGS)" + globalCflags).c_str () );
+
fprintf (
fMakefile,
"%s += $(PROJECT_RCFLAGS)\n",
@@ -1954,6 +1955,18 @@
{
fprintf (
fMakefile,
+ "%s +=%s\n",
+ cflagsMacro.c_str (),
+ globalCflags.c_str () );
+
+ fprintf (
+ fMakefile,
+ "%s +=%s\n",
+ cxxflagsMacro.c_str (),
+ globalCflags.c_str () );
+
+ fprintf (
+ fMakefile,
"%s_LFLAGS += $(HOST_LFLAGS)\n",
module.name.c_str () );
}
@@ -1971,6 +1984,10 @@
"%s += %s\n\n",
cflagsMacro.c_str (),
cflags );
+ fprintf ( fMakefile,
+ "%s += %s\n\n",
+ cxxflagsMacro.c_str (),
+ cflags );
}
const char* nasmflags = ModuleHandlerInformations[module.type].nasmflags;
@@ -1996,12 +2013,17 @@
fprintf ( fMakefile,
"%s += -Wno-main\n\n",
cflagsMacro.c_str () );
+ fprintf ( fMakefile,
+ "%s += -Wno-main\n\n",
+ cxxflagsMacro.c_str () );
}
fprintf ( fMakefile, "\n\n" );
// future references to the macros will be to get their values
+ commonflagsMacro = ssprintf ("$(%s)", commonflagsMacro.c_str ());
cflagsMacro = ssprintf ("$(%s)", cflagsMacro.c_str ());
+ cxxflagsMacro = ssprintf ("$(%s)", cxxflagsMacro.c_str ());
nasmflagsMacro = ssprintf ("$(%s)", nasmflagsMacro.c_str ());
widlflagsMacro = ssprintf ("$(%s)", widlflagsMacro.c_str ());
}
Modified: branches/ros-amd64-bringup/reactos/tools/rbuild/backend/mingw/modulehandler.h
URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/tools…
==============================================================================
--- branches/ros-amd64-bringup/reactos/tools/rbuild/backend/mingw/modulehandler.h
[iso-8859-1] (original)
+++ branches/ros-amd64-bringup/reactos/tools/rbuild/backend/mingw/modulehandler.h
[iso-8859-1] Sat Dec 6 03:37:08 2008
@@ -98,7 +98,6 @@
const Module& module ) const;
std::string GetPreconditionDependenciesName () const;
- std::string GetCFlagsMacro () const;
static std::string GetObjectsMacro ( const Module& );
std::string GetLinkingDependenciesMacro () const;
std::string GetLibsMacro () const;
@@ -172,7 +171,9 @@
public:
const Module& module;
string_list clean_files;
+ std::string commonflagsMacro;
std::string cflagsMacro;
+ std::string cxxflagsMacro;
std::string nasmflagsMacro;
std::string windresflagsMacro;
std::string widlflagsMacro;