Author: cwittich
Date: Fri Dec 8 21:41:20 2006
New Revision: 25092
URL:
http://svn.reactos.org/svn/reactos?rev=25092&view=rev
Log:
-display version information for compiler, binutils and nasm
Modified:
trunk/reactos/tools/rbuild/backend/mingw/mingw.cpp
trunk/reactos/tools/rbuild/backend/mingw/mingw.h
Modified: trunk/reactos/tools/rbuild/backend/mingw/mingw.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/backend/mingw…
==============================================================================
--- trunk/reactos/tools/rbuild/backend/mingw/mingw.cpp (original)
+++ trunk/reactos/tools/rbuild/backend/mingw/mingw.cpp Fri Dec 8 21:41:20 2006
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2005 Casper S. Hornstrup
+ * 2006 Christoph von Wittich
*
* 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
@@ -717,16 +718,12 @@
}
string
-MingwBackend::GetCompilerVersion ( const string& compilerCommand )
+MingwBackend::GetVersionString ( const string& versionCommand )
{
FILE *fp;
int ch, i;
char buffer[81];
- string versionCommand = ssprintf ( "%s --version gcc",
- compilerCommand.c_str (),
- NUL,
- NUL );
fp = popen ( versionCommand.c_str () , "r" );
for( i = 0;
( i < 80 ) &&
@@ -755,6 +752,36 @@
token = strtok ( NULL, separators );
}
return version;
+}
+
+string
+MingwBackend::GetNetwideAssemblerVersion ( const string& nasmCommand )
+{
+ string versionCommand = ssprintf ( "%s -v",
+ nasmCommand.c_str (),
+ NUL,
+ NUL );
+ return GetVersionString( versionCommand );
+}
+
+string
+MingwBackend::GetCompilerVersion ( const string& compilerCommand )
+{
+ string versionCommand = ssprintf ( "%s --version gcc",
+ compilerCommand.c_str (),
+ NUL,
+ NUL );
+ return GetVersionString( versionCommand );
+}
+
+string
+MingwBackend::GetBinutilsVersion ( const string& binutilsCommand )
+{
+ string versionCommand = ssprintf ( "%s -v",
+ binutilsCommand.c_str (),
+ NUL,
+ NUL );
+ return GetVersionString( versionCommand );
}
bool
@@ -779,7 +806,7 @@
}
string
-MingwBackend::GetBinutilsVersion ( const string& binutilsCommand )
+MingwBackend::GetBinutilsVersionDate ( const string& binutilsCommand )
{
FILE *fp;
int ch, i;
@@ -870,9 +897,9 @@
}
if ( detectedBinutils )
{
- string binutilsVersion = GetBinutilsVersion ( binutilsCommand );
+ string binutilsVersion = GetBinutilsVersionDate ( binutilsCommand );
if ( IsSupportedBinutilsVersion ( binutilsVersion ) )
- printf ( "detected (%s)\n", binutilsCommand.c_str () );
+ printf ( "detected (%s %s)\n", binutilsCommand.c_str (), GetBinutilsVersion(
binutilsCommand ).c_str() );
else
{
printf ( "detected (%s), but with unsupported version (%s)\n",
@@ -906,7 +933,7 @@
detectedNasm = TryToDetectThisNetwideAssembler ( nasmCommand );
}
if ( detectedNasm )
- printf ( "detected (%s)\n", nasmCommand.c_str () );
+ printf ( "detected (%s %s)\n", nasmCommand.c_str (),
GetNetwideAssemblerVersion( nasmCommand ).c_str() );
else
printf ( "not detected\n" );
}
Modified: trunk/reactos/tools/rbuild/backend/mingw/mingw.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/backend/mingw…
==============================================================================
--- trunk/reactos/tools/rbuild/backend/mingw/mingw.h (original)
+++ trunk/reactos/tools/rbuild/backend/mingw/mingw.h Fri Dec 8 21:41:20 2006
@@ -90,7 +90,10 @@
bool TryToDetectThisNetwideAssembler ( const std::string& assembler );
bool TryToDetectThisBinutils ( const std::string& binutils );
std::string GetBinutilsVersion ( const std::string& binutilsCommand );
+ std::string GetBinutilsVersionDate ( const std::string& binutilsCommand );
bool IsSupportedBinutilsVersion ( const std::string& binutilsVersion );
+ std::string GetVersionString ( const std::string& versionCommand );
+ std::string GetNetwideAssemblerVersion ( const std::string& nasmCommand );
void DetectBinutils ();
void DetectNetwideAssembler ();
void DetectPipeSupport ();