{ HostFalse, "", "", "" }, // Win32SCR
{ HostFalse, "", "", "" }, // IdlHeader
{ HostFalse, "", "", "" }, // IdlInterface
- { HostFalse, "", "", "" }, // IsoRegTest
- { HostFalse, "", "", "" }, // LiveIsoRegTest
{ HostFalse, "", "", "" }, // EmbeddedTypeLib
{ HostFalse, "", "", "" }, // ElfExecutable
{ HostFalse, "", "", "" }, // RpcProxy
{ HostFalse, "", "", "" }, // MessageHeader
};
+static std::string mscPath;
+static std::string mslinkPath;
+
string
MingwBackend::GetFullPath ( const FileLocation& file ) const
{
{
const FileLocation& file = files[i];
if ( wrap_at > 0 && wrap_count++ == wrap_at )
+ {
s += " \\\n\t\t";
+ wrap_count = 1;
+ }
else if ( s.size() )
s += " ";
s += backend->GetFullName ( file );
if ( !v[i].size() )
continue;
if ( wrap_at > 0 && wrap_count++ == wrap_at )
+ {
s += " \\\n\t\t";
+ wrap_count = 1;
+ }
else if ( s.size() )
s += " ";
s += v[i];
fprintf ( fMakefile, "include tools$(SEP)rbuild$(SEP)backend$(SEP)mingw$(SEP)linkers$(SEP)%s.mak\n", ProjectNode.GetLinkerSet ().c_str () );
fprintf ( fMakefile, "include tools$(SEP)rbuild$(SEP)backend$(SEP)mingw$(SEP)compilers$(SEP)%s.mak\n", ProjectNode.GetCompilerSet ().c_str () );
+ if ( mscPath.length() )
+ fprintf ( fMakefile, "export RBUILD_CL_PATH=%s\n", mscPath.c_str () );
+
+ if ( mslinkPath.length() )
+ fprintf ( fMakefile, "export RBUILD_LINK_PATH=%s\n", mslinkPath.c_str () );
+
if ( configuration.Dependencies == FullDependencies )
{
fprintf ( fMakefile,
GenerateGlobalProperties ( "=", ProjectNode.non_if_data );
- fprintf ( fMakefile, "PROJECT_CFLAGS += -Wall\n" );
- fprintf ( fMakefile, "PROJECT_CXXFLAGS += -Wall\n" );
- fprintf ( fMakefile, "ifneq ($(OARCH),)\n" );
- fprintf ( fMakefile, "PROJECT_CFLAGS += -march=$(OARCH)\n" );
- fprintf ( fMakefile, "PROJECT_CXXFLAGS += -march=$(OARCH)\n" );
- fprintf ( fMakefile, "endif\n" );
- fprintf ( fMakefile, "ifneq ($(TUNE),)\n" );
- fprintf ( fMakefile, "PROJECT_CFLAGS += -mtune=$(TUNE)\n" );
- fprintf ( fMakefile, "PROJECT_CXXFLAGS += -mtune=$(TUNE)\n" );
- fprintf ( fMakefile, "endif\n" );
-
- fprintf ( fMakefile, "PROJECT_CFLAGS += -g%s\n", Environment::GetArch() == "amd64" ? "dwarf-2" : "stabs+" );
- fprintf ( fMakefile, "PROJECT_CXXFLAGS += -g%s\n", Environment::GetArch() == "amd64" ? "dwarf-2" : "stabs+" );
- fprintf ( fMakefile, "PROJECT_ASFLAGS += -g%s\n", Environment::GetArch() == "amd64" ? "dwarf-2" : "stabs+" );
+ if ( ProjectNode.configuration.Compiler == GnuGcc )
+ {
+ fprintf ( fMakefile, "ifneq ($(OARCH),)\n" );
+ fprintf ( fMakefile, "PROJECT_ASFLAGS += -march=$(OARCH)\n" );
+ fprintf ( fMakefile, "PROJECT_CFLAGS += -march=$(OARCH)\n" );
+ fprintf ( fMakefile, "PROJECT_CXXFLAGS += -march=$(OARCH)\n" );
+ fprintf ( fMakefile, "endif\n" );
+ fprintf ( fMakefile, "ifneq ($(TUNE),)\n" );
+ fprintf ( fMakefile, "PROJECT_CFLAGS += -mtune=$(TUNE)\n" );
+ fprintf ( fMakefile, "PROJECT_CXXFLAGS += -mtune=$(TUNE)\n" );
+ fprintf ( fMakefile, "endif\n" );
- MingwModuleHandler::GenerateParameters ( "PROJECT", "+=", ProjectNode.non_if_data );
- MingwModuleHandler::GenerateParameters ( "PROJECT_HOST", "+=", ProjectNode.host_non_if_data );
+ if ( usePipe )
+ {
+ fprintf ( fMakefile, "PROJECT_CFLAGS += -pipe\n" );
+ fprintf ( fMakefile, "PROJECT_CXXFLAGS += -pipe\n" );
+ fprintf ( fMakefile, "PROJECT_ASFLAGS += -pipe\n" );
+ }
- if ( usePipe )
- {
- fprintf ( fMakefile, "PROJECT_CFLAGS += -pipe\n" );
- fprintf ( fMakefile, "PROJECT_CXXFLAGS += -pipe\n" );
- fprintf ( fMakefile, "PROJECT_ASFLAGS += -pipe\n" );
+ // Would be nice to have our own C++ runtime
+ fputs ( "BUILTIN_CXXINCLUDES+= $(TARGET_CPPFLAGS)\n", fMakefile );
}
// Because RosBE gcc is built to suck
fputs ( "BUILTIN_HOST_CPPINCLUDES+= $(HOST_CFLAGS)\n", fMakefile );
fputs ( "BUILTIN_HOST_CXXINCLUDES+= $(HOST_CPPFLAGS)\n", fMakefile );
- // Would be nice to have our own C++ runtime
- fputs ( "BUILTIN_CXXINCLUDES+= $(TARGET_CPPFLAGS)\n", fMakefile );
+ MingwModuleHandler::GenerateParameters ( "PROJECT", "+=", ProjectNode.non_if_data );
+ MingwModuleHandler::GenerateParameters ( "PROJECT_HOST", "+=", ProjectNode.host_non_if_data );
// TODO: linker flags
fprintf ( fMakefile, "PROJECT_LFLAGS := '$(shell ${TARGET_CC} -print-libgcc-file-name)' %s\n", GenerateProjectLFLAGS ().c_str () );
{
fprintf ( fMakefile,
"MODULETYPE%d_%sFLAGS:=%s\n",
- i,
+ (int)i,
"C",
ModuleHandlerInformations[i].cflags );
}
{
fprintf ( fMakefile,
"MODULETYPE%d_%sFLAGS:=%s\n",
- i,
+ (int)i,
"CXX",
ModuleHandlerInformations[i].cflags );
}
{
fprintf ( fMakefile,
"MODULETYPE%d_%sFLAGS:=%s\n",
- i,
+ (int)i,
"NASM",
ModuleHandlerInformations[i].nasmflags );
}
return false;
if ( module.type == LiveIso )
return false;
- if ( module.type == IsoRegTest )
- return false;
- if ( module.type == LiveIsoRegTest )
- return false;
if ( module.type == Test )
return false;
if ( module.type == Alias )
if ( ProjectNode.configuration.Compiler == GnuGcc )
{
+ const string& TARGET_CCValue = Environment::GetVariable ( "TARGET_CC" );
const string& ROS_PREFIXValue = Environment::GetVariable ( "ROS_PREFIX" );
+
if ( ROS_PREFIXValue.length () > 0 )
{
- compilerPrefix = ROS_PREFIXValue;
- compilerCommand = compilerPrefix + "-gcc";
+ compilerPrefix = "";
+ compilerCommand = TARGET_CCValue;
detectedCompiler = TryToDetectThisCompiler ( compilerCommand );
}
+
+ if ( !detectedCompiler )
+ {
+ if ( ROS_PREFIXValue.length () > 0 )
+ {
+ compilerPrefix = ROS_PREFIXValue;
+ compilerCommand = compilerPrefix + "-gcc";
+ detectedCompiler = TryToDetectThisCompiler ( compilerCommand );
+ }
+ }
#if defined(WIN32)
if ( !detectedCompiler )
{
}
else if ( ProjectNode.configuration.Compiler == MicrosoftC )
{
- detectedCompiler = DetectMicrosoftCompiler ( compilerVersion );
+ compilerCommand = "cl";
+ detectedCompiler = DetectMicrosoftCompiler ( compilerVersion, mscPath );
supportedCompiler = true; // TODO
}
}
else if ( ProjectNode.configuration.Linker == MicrosoftLink )
{
- detectedBinutils = DetectMicrosoftLinker ( binutilsVersion );
+ compilerCommand = "link";
+ detectedBinutils = DetectMicrosoftLinker ( binutilsVersion, mslinkPath );
supportedBinutils = true; // TODO
}
else
printf ( "not detected\n" );
}
+ else
+ usePipe = false;
}
void