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");