Sync to trunk r39350.
[reactos.git] / reactos / tools / rbuild / backend / mingw / mingw.cpp
index 12b88e3..58dc044 100644 (file)
@@ -313,7 +313,7 @@ MingwBackend::Process ()
 void
 MingwBackend::CheckAutomaticDependenciesForModuleOnly ()
 {
-       if ( configuration.AutomaticDependencies )
+       if ( configuration.Dependencies == AutomaticDependencies )
        {
                Module* module = ProjectNode.LocateModule ( configuration.CheckDependenciesForModuleOnlyModule );
                if ( module == NULL )
@@ -519,6 +519,17 @@ MingwBackend::GenerateProjectLFLAGS () const
 void
 MingwBackend::GenerateGlobalVariables () const
 {
+       fputs ( "include tools$(SEP)rbuild$(SEP)backend$(SEP)mingw$(SEP)rules.mak\n", fMakefile );
+
+       if ( configuration.Dependencies == FullDependencies )
+       {
+               fprintf ( fMakefile,
+                                 "ifeq ($(ROS_BUILDDEPS),)\n"
+                                 "ROS_BUILDDEPS:=%s\n"
+                                 "endif\n",
+                                 "full" );
+       }
+
        fprintf ( fMakefile,
                  "PREFIX := %s\n",
                  compilerPrefix.c_str () );
@@ -532,7 +543,11 @@ MingwBackend::GenerateGlobalVariables () const
        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" );
+       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)'\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_GCCOPTIONS += -Wall\n" );
        fprintf ( fMakefile, "ifneq ($(OARCH),)\n" );
        fprintf ( fMakefile, "PROJECT_GCCOPTIONS += -march=$(OARCH)\n" );
@@ -715,7 +730,7 @@ MingwBackend::GenerateProxyMakefiles ()
 void
 MingwBackend::CheckAutomaticDependencies ()
 {
-       if ( configuration.AutomaticDependencies )
+       if ( configuration.Dependencies == AutomaticDependencies )
        {
                printf ( "Checking automatic dependencies..." );
                AutomaticDependency automaticDependency ( ProjectNode );