Author: dreimer
Date: Mon Feb 8 16:13:50 2010
New Revision: 45498
URL: http://svn.reactos.org/svn/reactos?rev=45498&view=rev
Log:
Nice regex solution to get GCC's Version from the Target GCC Paths. This fixes the last evil hack to get information from GCC in PS. Biig thx to niski for coming up with that niice solution.
Modified:
trunk/tools/RosBE/RosBE-Windows/Powershell/version.ps1
trunk/tools/RosBE/RosBE-Windows/Root/ChangeLog.txt
Modified: trunk/tools/RosBE/RosBE-Windows/Powershell/version.ps1
URL: http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/RosBE-Windows/Powershe…
==============================================================================
--- trunk/tools/RosBE/RosBE-Windows/Powershell/version.ps1 [iso-8859-1] (original)
+++ trunk/tools/RosBE/RosBE-Windows/Powershell/version.ps1 [iso-8859-1] Mon Feb 8 16:13:50 2010
@@ -3,17 +3,16 @@
# LICENSE: GNU General Public License v2. (see LICENSE.txt)
# FILE: Root/version.ps1
# PURPOSE: Display the current version of GCC, NASM, ld and make.
-# COPYRIGHT: Copyright 2010 Daniel Reimer <reimer.daniel(a)freenet.de>
+# COPYRIGHT: Copyright 2009 Daniel Reimer <reimer.daniel(a)freenet.de>
#
(get-WmiObject Win32_OperatingSystem).caption
# GCC
-$TARGETGCC = "$global:_ROSBE_PREFIX" + "gcc"
-& $TARGETGCC -v 2> gcctvers.tmp
-(select-string -path .\gcctvers.tmp "gcc version") -replace ".*:(.*?)\b",'$1'
+[regex]$GCCVer = "4.[0-9].[0-9]"
+$_ROSBE_GCC_TARGET_VERSION = $GCCVer.matches($ENV:ROSBE_TARGET_CXXFLAGS)[0].value
+"gcc version - $_ROSBE_GCC_TARGET_VERSION"
"gcc target - $ENV:ROS_ARCH"
-remove-item gcctvers.tmp
# LD
$run = "$_ROSBE_TARGET_MINGWPATH\bin\$_ROSBE_PREFIX" + "ld"
Modified: trunk/tools/RosBE/RosBE-Windows/Root/ChangeLog.txt
URL: http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/RosBE-Windows/Root/Cha…
==============================================================================
--- trunk/tools/RosBE/RosBE-Windows/Root/ChangeLog.txt [iso-8859-1] (original)
+++ trunk/tools/RosBE/RosBE-Windows/Root/ChangeLog.txt [iso-8859-1] Mon Feb 8 16:13:50 2010
@@ -32,8 +32,9 @@
- Removed the address translation from the raddr2line script. Its done in the tools now (Daniel Reimer)
- Fixed the Core detection in makex for PS. Added a global setting to the variable
containing the number of cores. (Daniel Reimer)
-- Added getincludes from RosBE Unix. This makes the schripts way more logical and fixes a PS Bug
+- Added getincludes from RosBE Unix. This makes the scripts way more logical and fixes a PS Bug
when you open several Windows at once (Colin Finck, Daniel Reimer)
+- Fix for GCC Version showup together with Colin's new Tool in PS. (Maciej Bialas)
*** Oct 26th, 2009 - RosBE 1.4.5 Released
Author: cfinck
Date: Sun Feb 7 23:18:32 2010
New Revision: 45493
URL: http://svn.reactos.org/svn/reactos?rev=45493&view=rev
Log:
- Make "getincludes" a shared tool and also use it for setting the ROSBE_HOST/TARGET_CFLAGS/CXXFLAGS variables in RosBE-Windows.
- Modify it to put quotes around the pathes it outputs. (for pathes containing spaces)
Added:
trunk/tools/RosBE/Tools/getincludes.c
- copied, changed from r45295, trunk/tools/RosBE/RosBE-Unix/Base-i386/tools/getincludes.c
Removed:
trunk/tools/RosBE/RosBE-Unix/Base-i386/tools/getincludes.c
Modified:
trunk/tools/RosBE/RosBE-Unix/makepackage.sh
trunk/tools/RosBE/RosBE-Windows/Root/rosbe-gcc-env.cmd
Removed: trunk/tools/RosBE/RosBE-Unix/Base-i386/tools/getincludes.c
URL: http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/RosBE-Unix/Base-i386/t…
==============================================================================
--- trunk/tools/RosBE/RosBE-Unix/Base-i386/tools/getincludes.c [iso-8859-1] (original)
+++ trunk/tools/RosBE/RosBE-Unix/Base-i386/tools/getincludes.c (removed)
@@ -1,38 +1,0 @@
-/*
- * PROJECT: ReactOS Build Environment Tools
- * LICENSE: GNU GPLv2 or any later version as published by the Free Software Foundation
- * PURPOSE: Parse the search directory output of 'cpp -v' to compiler flags
- * COPYRIGHT: Copyright 2009 Colin Finck <colin(a)reactos.org>
- */
-
-#include <stdio.h>
-#include <string.h>
-
-int main()
-{
- char Line[1024];
-
- /* Skip all lines up to the second #include */
- for(;;)
- {
- if(!fgets(Line, sizeof(Line), stdin))
- return 1;
-
- if(strstr(Line, "#include <...> "))
- break;
- }
-
- /* The pathes should now follow prefixed by a single space */
- for(;;)
- {
- if(!fgets(Line, sizeof(Line), stdin) || *Line != ' ')
- break;
-
- /* This is an include directory, remove the newline character and output it */
- Line[strlen(Line) - 1] = 0;
- printf("-I%s ", &Line[1]);
- }
-
- printf("\n");
- return 0;
-}
Modified: trunk/tools/RosBE/RosBE-Unix/makepackage.sh
URL: http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/RosBE-Unix/makepackage…
==============================================================================
--- trunk/tools/RosBE/RosBE-Unix/makepackage.sh [iso-8859-1] (original)
+++ trunk/tools/RosBE/RosBE-Unix/makepackage.sh [iso-8859-1] Sun Feb 7 23:18:32 2010
@@ -62,7 +62,7 @@
case "$package_name" in
"Base-i386")
sources+="gmp make mingw_runtime_dev mpfr nasm w32api"
- tools+="cpucount scut"
+ tools+="cpucount getincludes scut"
esac
# Check if all required files exist
Modified: trunk/tools/RosBE/RosBE-Windows/Root/rosbe-gcc-env.cmd
URL: http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/RosBE-Windows/Root/ros…
==============================================================================
--- trunk/tools/RosBE/RosBE-Windows/Root/rosbe-gcc-env.cmd [iso-8859-1] (original)
+++ trunk/tools/RosBE/RosBE-Windows/Root/rosbe-gcc-env.cmd [iso-8859-1] Sun Feb 7 23:18:32 2010
@@ -3,7 +3,7 @@
:: LICENSE: GNU General Public License v2. (see LICENSE.txt)
:: FILE: Root/rosbe-gcc-env.cmd
:: PURPOSE: Set up toolchain-specific settings when initializing RosBE and when using "charch" or "chdefgcc"
-:: COPYRIGHT: Copyright 2009 Daniel Reimer <reimer.daniel(a)freenet.de>
+:: COPYRIGHT: Copyright 2010 Daniel Reimer <reimer.daniel(a)freenet.de>
:: Peter Ward <dralnix(a)gmail.com>
:: Colin Finck <colin(a)reactos.org>
::
@@ -31,12 +31,7 @@
set PATH=%_ROSBE_HOST_MINGWPATH%\bin;%_ROSBE_TARGET_MINGWPATH%\bin;%_ROSBE_ORIGINALPATH%
-for /f "usebackq tokens=3" %%i in (`"%_ROSBE_PREFIX%gcc -v 2>&1 | find "gcc version""`) do set _ROSBE_TARGET_GCCVERSION=%%i
-for /f "usebackq tokens=2" %%i in (`"%_ROSBE_PREFIX%gcc -v 2>&1 | find "Target""`) do set _ROSBE_TARGET_GCCTARGET=%%i
-for /f "usebackq tokens=3" %%i in (`"gcc -v 2>&1 | find "gcc version""`) do set _ROSBE_HOST_GCCVERSION=%%i
-for /f "usebackq tokens=2" %%i in (`"gcc -v 2>&1 | find "Target""`) do set _ROSBE_HOST_GCCTARGET=%%i
-
-set ROSBE_HOST_CFLAGS=-I"%_ROSBE_HOST_MINGWPATH%\%_ROSBE_HOST_GCCTARGET%\include" -I"%_ROSBE_HOST_MINGWPATH%\lib\gcc\%_ROSBE_HOST_GCCTARGET%\%_ROSBE_HOST_GCCVERSION%\include"
-set ROSBE_HOST_CXXFLAGS=-I"%_ROSBE_HOST_MINGWPATH%\%_ROSBE_HOST_GCCTARGET%\include" -I"%_ROSBE_HOST_MINGWPATH%\lib\gcc\%_ROSBE_HOST_GCCTARGET%\%_ROSBE_HOST_GCCVERSION%\include\c++" -I"%_ROSBE_HOST_MINGWPATH%\lib\gcc\%_ROSBE_HOST_GCCTARGET%\%_ROSBE_HOST_GCCVERSION%\include"
-set ROSBE_TARGET_CFLAGS=-I"%_ROSBE_TARGET_MINGWPATH%\%_ROSBE_TARGET_GCCTARGET%\include" -I"%_ROSBE_TARGET_MINGWPATH%\lib\gcc\%_ROSBE_TARGET_GCCTARGET%\%_ROSBE_TARGET_GCCVERSION%\include"
-set ROSBE_TARGET_CXXFLAGS=-I"%_ROSBE_TARGET_MINGWPATH%\%_ROSBE_TARGET_GCCTARGET%\include" -I"%_ROSBE_TARGET_MINGWPATH%\include\c++\%_ROSBE_TARGET_GCCVERSION%" -I"%_ROSBE_TARGET_MINGWPATH%\include\c++\%_ROSBE_TARGET_GCCVERSION%\%_ROSBE_TARGET_GCCTARGET%" -I"%_ROSBE_TARGET_MINGWPATH%\lib\gcc\%_ROSBE_TARGET_GCCTARGET%\%_ROSBE_TARGET_GCCVERSION%\include" -I"%_ROSBE_TARGET_MINGWPATH%\lib\gcc\%_ROSBE_TARGET_GCCTARGET%\%_ROSBE_TARGET_GCCVERSION%\include\c++" -I"%_ROSBE_TARGET_MINGWPATH%\%_ROSBE_TARGET_GCCTARGET%\include\c++\%_ROSBE_TARGET_GCCVERSION%" -I"%_ROSBE_TARGET_MINGWPATH%\%_ROSBE_TARGET_GCCTARGET%\include\c++\%_ROSBE_TARGET_GCCVERSION%\%_ROSBE_TARGET_GCCTARGET%"
+for /f "usebackq tokens=*" %%i in (`"cpp -x c -v <NUL 2>&1 | getincludes"`) do set ROSBE_HOST_CFLAGS=%%i
+for /f "usebackq tokens=*" %%i in (`"cpp -x c++ -v <NUL 2>&1 | getincludes"`) do set ROSBE_HOST_CXXFLAGS=%%i
+for /f "usebackq tokens=*" %%i in (`"%_ROSBE_PREFIX%cpp -x c -v <NUL 2>&1 | getincludes"`) do set ROSBE_TARGET_CFLAGS=%%i
+for /f "usebackq tokens=*" %%i in (`"%_ROSBE_PREFIX%cpp -x c++ -v <NUL 2>&1 | getincludes"`) do set ROSBE_TARGET_CXXFLAGS=%%i
Copied: trunk/tools/RosBE/Tools/getincludes.c (from r45295, trunk/tools/RosBE/RosBE-Unix/Base-i386/tools/getincludes.c)
URL: http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/Tools/getincludes.c?p2…
==============================================================================
--- trunk/tools/RosBE/RosBE-Unix/Base-i386/tools/getincludes.c [iso-8859-1] (original)
+++ trunk/tools/RosBE/Tools/getincludes.c [iso-8859-1] Sun Feb 7 23:18:32 2010
@@ -2,7 +2,7 @@
* PROJECT: ReactOS Build Environment Tools
* LICENSE: GNU GPLv2 or any later version as published by the Free Software Foundation
* PURPOSE: Parse the search directory output of 'cpp -v' to compiler flags
- * COPYRIGHT: Copyright 2009 Colin Finck <colin(a)reactos.org>
+ * COPYRIGHT: Copyright 2009-2010 Colin Finck <colin(a)reactos.org>
*/
#include <stdio.h>
@@ -30,7 +30,7 @@
/* This is an include directory, remove the newline character and output it */
Line[strlen(Line) - 1] = 0;
- printf("-I%s ", &Line[1]);
+ printf("-I\"%s\" ", &Line[1]);
}
printf("\n");