Author: peterw
Date: Fri Oct 26 16:16:27 2007
New Revision: 29897
URL:
http://svn.reactos.org/svn/reactos?rev=29897&view=rev
Log:
- Make options.exe only write path variables if there is something to write.
- Fix a bug in the way options.cmd was calling options.exe.
- Move GCC environment setup to rosbe-gcc-env.cmd to support the next bullet.
- Added the command 'chdefgcc' to allow easy switching of the
current toolset.
(automatically adjusts all include/lib/binary paths for the new location/GCC version)
Added:
trunk/tools/RosBE-Windows/Root/chdefgcc.cmd (with props)
trunk/tools/RosBE-Windows/Root/rosbe-gcc-env.cmd (with props)
Modified:
trunk/tools/RosBE-Windows/Root/Help.cmd
trunk/tools/RosBE-Windows/Root/RosBE.cmd
trunk/tools/RosBE-Windows/Root/RosBE.mac
trunk/tools/RosBE-Windows/Root/chdefdir.cmd
trunk/tools/RosBE-Windows/Root/options.cmd
trunk/tools/RosBE-Windows/Root/scut.cmd
trunk/tools/RosBE-Windows/Tools/config/options.c
Modified: trunk/tools/RosBE-Windows/Root/Help.cmd
URL:
http://svn.reactos.org/svn/reactos/trunk/tools/RosBE-Windows/Root/Help.cmd?…
==============================================================================
--- trunk/tools/RosBE-Windows/Root/Help.cmd (original)
+++ trunk/tools/RosBE-Windows/Root/Help.cmd Fri Oct 26 16:16:27 2007
@@ -28,6 +28,11 @@
echo current RosBE session.
)
+ if exist "%_ROSBE_BASEDIR%\chdefgcc.cmd" (
+ echo chdefgcc [PATH] - Change the MinGW/GCC directory for the
+ echo current RosBE session.
+ )
+
echo clean [logs] - Fully clean the ReactOS source directory and/or
echo the RosBE build logs.
@@ -95,6 +100,14 @@
echo Change the ReactOS source directory for the current RosBE session.
echo.
echo previous - Switch to the previous ReactOS source directory.
+ goto :EOC
+ )
+)
+if exist "%_ROSBE_BASEDIR%\chdefgcc.cmd" (
+ if /i "%1" == "chdefgcc" (
+ echo Usage: chdefgcc [PATH]
+ echo Change the MinGW/GCC directory for the current RosBE session.
+ echo.
goto :EOC
)
)
Modified: trunk/tools/RosBE-Windows/Root/RosBE.cmd
URL:
http://svn.reactos.org/svn/reactos/trunk/tools/RosBE-Windows/Root/RosBE.cmd…
==============================================================================
--- trunk/tools/RosBE-Windows/Root/RosBE.cmd (original)
+++ trunk/tools/RosBE-Windows/Root/RosBE.cmd Fri Oct 26 16:16:27 2007
@@ -19,7 +19,8 @@
set _ROSBE_BASEDIR=%~dp0
set _ROSBE_BASEDIR=%_ROSBE_BASEDIR:~0,-1%
set _ROSBE_ROSSOURCEDIR=%CD%
-set _ROSBE_PREVIOUSSOURCEDIR=%_ROSBE_ROSSOURCEDIR%
+set PATH=%_ROSBE_BASEDIR%\Tools;%PATH%
+set _ROSBE_ORIGINALPATH=%PATH%
set _ROSBE_SHOWTIME=1
set _ROSBE_WRITELOG=1
set _ROSBE_USECCACHE=0
@@ -28,6 +29,7 @@
set _ROSBE_LOGDIR=%CD%\RosBE-Logs
set _ROSBE_OBJPATH=
set _ROSBE_OUTPATH=
+
::
:: Check if the user has used the options utility and
:: if so, load their options.
@@ -62,16 +64,10 @@
:: Load the Base Directory from the Shortcut-txt and set it as new
:: Source Directory and add PATH for Tools Folder.
::
-set PATH=%_ROSBE_BASEDIR%\Tools;%PATH%
-if exist "%_ROSBE_BASEDIR%\scut.cmd" (call
"%_ROSBE_BASEDIR%\scut.cmd" run)
-
-::
-:: Display the current version of GCC, NASM, ld and make.
-::
-gcc -v 2>&1 | find "gcc version"
-nasm -v
-ld -v
-mingw32-make -v | find "GNU Make"
+if exist "%_ROSBE_BASEDIR%\scut.cmd" (
+ echo.
+ call "%_ROSBE_BASEDIR%\scut.cmd" run
+)
::
:: Tell how to display the available commands.
@@ -101,26 +97,18 @@
:: environment.
::
:RosBE4
- ::
- :: Set the correct path for the build tools and set the MinGW make.
- ::
- set _ROSBE_GCCVERSION=4.1.3
- set PATH=%_ROSBE_MINGWPATH%\bin;%_ROSBE_MINGWPATH%\libexec\gcc\mingw32\4.1.3;%PATH%
- set _ROSBE_MINGWMAKE=%_ROSBE_MINGWPATH%\bin\mingw32-make.exe
- if defined _ROSBE_OLDMODE (
- set
C_INCLUDE_PATH=%_ROSBE_MINGWPATH%\include;%_ROSBE_MINGWPATH%\lib\gcc\mingw32\4.1.3\include
- set
CPLUS_INCLUDE_PATH=%_ROSBE_MINGWPATH%\include;%_ROSBE_MINGWPATH%\include\c++\4.1.3;%_ROSBE_MINGWPATH%\include\c++\4.1.3\mingw32;%_ROSBE_MINGWPATH%\lib\gcc\mingw32\4.1.3\include
- )
- set HOST_CFLAGS=-I"%_ROSBE_MINGWPATH%\include"
-I"%_ROSBE_MINGWPATH%\lib\gcc\mingw32\4.1.3\include"
- set HOST_CPPFLAGS=-I"%_ROSBE_MINGWPATH%\include"
-I"%_ROSBE_MINGWPATH%\include\c++\4.1.3"
-I"%_ROSBE_MINGWPATH%\include\c++\4.1.3\mingw32"
-I"%_ROSBE_MINGWPATH%\lib\gcc\mingw32\4.1.3\include"
- set LIBRARY_PATH=%_ROSBE_MINGWPATH%\lib;%_ROSBE_MINGWPATH%\lib\gcc\mingw32\4.1.3
-
echo *******************************************************************************
echo * *
echo * ReactOS Build Environment %_ROSBE_VERSION%
*
echo * *
echo *******************************************************************************
echo.
+ echo.
+ ver
+ ::
+ :: Set the correct path for the build tools and set the MinGW make.
+ ::
+ call "%_ROSBE_BASEDIR%\rosbe-gcc-env.cmd"
goto :EOF
::
Modified: trunk/tools/RosBE-Windows/Root/RosBE.mac
URL:
http://svn.reactos.org/svn/reactos/trunk/tools/RosBE-Windows/Root/RosBE.mac…
==============================================================================
--- trunk/tools/RosBE-Windows/Root/RosBE.mac (original)
+++ trunk/tools/RosBE-Windows/Root/RosBE.mac Fri Oct 26 16:16:27 2007
@@ -1,11 +1,14 @@
BASEDIR = cd /d "%_ROSBE_ROSSOURCEDIR%"
CHDEFDIR = "%_ROSBE_BASEDIR%\chdefdir.cmd" $*
+CHDEFGCC = "%_ROSBE_BASEDIR%\chdefgcc.cmd" $*
CLEAN = "%_ROSBE_BASEDIR%\Clean.cmd" $*
CONFIG = "%_ROSBE_BASEDIR%\Config.cmd" $*
+ENV = set
HELP = "%_ROSBE_BASEDIR%\Help.cmd" $*
MAKE = "%_ROSBE_BASEDIR%\Build.cmd" $*
MAKEX = "%_ROSBE_BASEDIR%\Build.cmd" multi $*
RADDR2LINE = "%_ROSBE_BASEDIR%\reladdr2line.cmd" $*
+RENV = for /f "usebackq" %i in (`set _ROSBE_`) do @echo %i
SCUT = "%_ROSBE_BASEDIR%\scut.cmd" $*
SSVN = "%_ROSBE_BASEDIR%\sSVN.cmd" $*
OPTIONS = "%_ROSBE_BASEDIR%\options.cmd" $*
Modified: trunk/tools/RosBE-Windows/Root/chdefdir.cmd
URL:
http://svn.reactos.org/svn/reactos/trunk/tools/RosBE-Windows/Root/chdefdir.…
==============================================================================
--- trunk/tools/RosBE-Windows/Root/chdefdir.cmd (original)
+++ trunk/tools/RosBE-Windows/Root/chdefdir.cmd Fri Oct 26 16:16:27 2007
@@ -21,15 +21,15 @@
set _1=%1
)
if /i "%_1%" == "previous" (
- set _ROSBE_ROSSOURCEDIR=%_ROSBE_PREVIOUSSOURCEDIR%
+ popd
) else (
if not exist "%_1%\." (
echo ERROR: The path specified doesn't seem to exist.
goto :EOC
)
- set _ROSBE_PREVIOUSSOURCEDIR=%_ROSBE_ROSSOURCEDIR%
- set _ROSBE_ROSSOURCEDIR=%_1%
+ pushd %_1%
)
+set _ROSBE_ROSSOURCEDIR=%CD%
goto :EOC
::
@@ -37,8 +37,11 @@
::
:INTERACTIVE
set /p _1="Please enter a ReactOS source directory, or 'previous': "
+if "%_1%" == "" (
+ echo ERROR: You must enter a ReactOS source directory, or 'previous'.
+ goto :EOC
+)
goto :EOF
:EOC
title ReactOS Build Environment %_ROSBE_VERSION%
-cd /d "%_ROSBE_ROSSOURCEDIR%"
Added: trunk/tools/RosBE-Windows/Root/chdefgcc.cmd
URL:
http://svn.reactos.org/svn/reactos/trunk/tools/RosBE-Windows/Root/chdefgcc.…
==============================================================================
--- trunk/tools/RosBE-Windows/Root/chdefgcc.cmd (added)
+++ trunk/tools/RosBE-Windows/Root/chdefgcc.cmd Fri Oct 26 16:16:27 2007
@@ -1,0 +1,46 @@
+::
+:: PROJECT: RosBE - ReactOS Build Environment for Windows
+:: LICENSE: GPL - See LICENSE.txt in the top level directory
+:: FILE: Root/chdefgcc.cmd
+:: PURPOSE: Tool to change the current gcc in RosBE.
+:: COPYRIGHT: Copyright 2007 Daniel Reimer <reimer.daniel(a)freenet.de>
+:: Peter Ward <dralnix(a)gmail.com>
+::
+@echo off
+
+title Change the current MinGW/GCC directory...
+
+if not defined _ROSBE_PREVIOUSMINGWPATH (
+ set _ROSBE_PREVIOUSMINGWPATH=%_ROSBE_MINGWPATH%
+)
+
+::
+:: Parse the command line arguments.
+::
+if "%1" == "" (
+ call :INTERACTIVE
+) else (
+ set _1=%1
+)
+
+if not exist "%_1%\." (
+ echo ERROR: The path specified doesn't seem to exist.
+ goto :EOC
+)
+set _ROSBE_PREVIOUSMINGWPATH=%_ROSBE_MINGWPATH%
+set _ROSBE_MINGWPATH=%_1%
+echo Location: %_ROSBE_MINGWPATH%
+call "%_ROSBE_BASEDIR%\rosbe-gcc-env.cmd"
+
+goto :EOC
+
+:INTERACTIVE
+set /p XY="Please enter a MinGW/GCC directory: "
+if "%_1%" == "" (
+ echo ERROR: You must enter a MinGW/GCC directory.
+ goto :EOC
+)
+goto :EOF
+
+:EOC
+title ReactOS Build Environment %_ROSBE_VERSION%
Propchange: trunk/tools/RosBE-Windows/Root/chdefgcc.cmd
------------------------------------------------------------------------------
svn:eol-style = native
Modified: trunk/tools/RosBE-Windows/Root/options.cmd
URL:
http://svn.reactos.org/svn/reactos/trunk/tools/RosBE-Windows/Root/options.c…
==============================================================================
--- trunk/tools/RosBE-Windows/Root/options.cmd (original)
+++ trunk/tools/RosBE-Windows/Root/options.cmd Fri Oct 26 16:16:27 2007
@@ -14,8 +14,12 @@
:: Run options.exe
::
if exist "%_ROSBE_BASEDIR%\options.exe" (
- call "%_ROSBE_BASEDIR%\options.exe"
- "%_ROSBE_BASEDIR%\RosBE.cmd"
+ pushd %_ROSBE_BASEDIR%
+ call options.exe
+ popd
+ if exist "%_ROSBE_BASEDIR%\rosbe-options.cmd" (
+ call "%_ROSBE_BASEDIR%\rosbe-options.cmd"
+ )
) else (
echo ERROR: options.exe was not found.
title ReactOS Build Environment %_ROSBE_VERSION%
Added: trunk/tools/RosBE-Windows/Root/rosbe-gcc-env.cmd
URL:
http://svn.reactos.org/svn/reactos/trunk/tools/RosBE-Windows/Root/rosbe-gcc…
==============================================================================
--- trunk/tools/RosBE-Windows/Root/rosbe-gcc-env.cmd (added)
+++ trunk/tools/RosBE-Windows/Root/rosbe-gcc-env.cmd Fri Oct 26 16:16:27 2007
@@ -1,0 +1,34 @@
+::
+:: PROJECT: RosBE - ReactOS Build Environment for Windows
+:: LICENSE: GPL - See LICENSE.txt in the top level directory.
+:: FILE: Root/rosbe-gcc-env.cmd
+:: PURPOSE: Set up the GCC 4.x.x build environment.
+:: COPYRIGHT: Copyright 2007 Daniel Reimer <reimer.daniel(a)freenet.de>
+:: Peter Ward <dralnix(a)gmail.com>
+::
+::
+@echo off
+
+::
+:: Set up the GCC 4.x.x build environment.
+::
+set PATH=%_ROSBE_MINGWPATH%\bin;%_ROSBE_ORIGINALPATH%
+set _ROSBE_GCCVERSION=
+for /f "usebackq tokens=3" %%i in (`"gcc -v 2>&1 | find "gcc
version""`) do set _ROSBE_GCCVERSION=%%i
+set
PATH=%_ROSBE_MINGWPATH%\bin;%_ROSBE_MINGWPATH%\libexec\gcc\mingw32\%_ROSBE_GCCVERSION%;%_ROSBE_ORIGINALPATH%
+set _ROSBE_MINGWMAKE=%_ROSBE_MINGWPATH%\bin\mingw32-make.exe
+if defined _ROSBE_OLDMODE (
+ set
C_INCLUDE_PATH=%_ROSBE_MINGWPATH%\include;%_ROSBE_MINGWPATH%\lib\gcc\mingw32\%_ROSBE_GCCVERSION%\include
+ set
CPLUS_INCLUDE_PATH=%_ROSBE_MINGWPATH%\include;%_ROSBE_MINGWPATH%\include\c++\%_ROSBE_GCCVERSION%;%_ROSBE_MINGWPATH%\include\c++\%_ROSBE_GCCVERSION%\mingw32;%_ROSBE_MINGWPATH%\lib\gcc\mingw32\%_ROSBE_GCCVERSION%\include
+)
+set HOST_CFLAGS=-I"%_ROSBE_MINGWPATH%\include"
-I"%_ROSBE_MINGWPATH%\lib\gcc\mingw32\%_ROSBE_GCCVERSION%\include"
+set HOST_CPPFLAGS=-I"%_ROSBE_MINGWPATH%\include"
-I"%_ROSBE_MINGWPATH%\include\c++\%_ROSBE_GCCVERSION%"
-I"%_ROSBE_MINGWPATH%\include\c++\%_ROSBE_GCCVERSION%\mingw32"
-I"%_ROSBE_MINGWPATH%\lib\gcc\mingw32\%_ROSBE_GCCVERSION%\include"
+set
LIBRARY_PATH=%_ROSBE_MINGWPATH%\lib;%_ROSBE_MINGWPATH%\lib\gcc\mingw32\%_ROSBE_GCCVERSION%
+
+::
+:: Display the current version of GCC, NASM, ld and make.
+::
+gcc -v 2>&1 | find "gcc version"
+nasm -v
+ld -v
+mingw32-make -v | find "GNU Make"
Propchange: trunk/tools/RosBE-Windows/Root/rosbe-gcc-env.cmd
------------------------------------------------------------------------------
svn:eol-style = native
Modified: trunk/tools/RosBE-Windows/Root/scut.cmd
URL:
http://svn.reactos.org/svn/reactos/trunk/tools/RosBE-Windows/Root/scut.cmd?…
==============================================================================
--- trunk/tools/RosBE-Windows/Root/scut.cmd (original)
+++ trunk/tools/RosBE-Windows/Root/scut.cmd Fri Oct 26 16:16:27 2007
@@ -43,7 +43,6 @@
for /f "usebackq tokens=1-2 delims=," %%i in (`type
"%_ROSBE_BASEDIR%\srclist.txt"`) do (
if %%i == Base (
echo Active Shortcut: %%j
- echo.
::
: Set new source directory, if needed.
::
Modified: trunk/tools/RosBE-Windows/Tools/config/options.c
URL:
http://svn.reactos.org/svn/reactos/trunk/tools/RosBE-Windows/Tools/config/o…
==============================================================================
--- trunk/tools/RosBE-Windows/Tools/config/options.c (original)
+++ trunk/tools/RosBE-Windows/Tools/config/options.c Fri Oct 26 16:16:27 2007
@@ -108,10 +108,10 @@
fprintf(pFile, "set _ROSBE_USECCACHE=%d\n", useccache);
fprintf(pFile, "set _ROSBE_STRIP=%d\n", strip);
fprintf(pFile, "set _ROSBE_WRITELOG=%d\n", writelog);
- fprintf(pFile, "set _ROSBE_LOGDIR=%S\n", logdir);
- fprintf(pFile, "set _ROSBE_MINGWPATH=%S\n", mingwpath);
- fprintf(pFile, "set _ROSBE_OBJPATH=%S\n", objdir);
- fprintf(pFile, "set _ROSBE_OUTPATH=%S\n", outdir);
+ if (wcslen(logdir) > 0) fprintf(pFile, "set _ROSBE_LOGDIR=%S\n",
logdir);
+ if (wcslen(mingwpath) > 0) fprintf(pFile, "set
_ROSBE_MINGWPATH=%S\n", mingwpath);
+ if (wcslen(objdir) > 0) fprintf(pFile, "set _ROSBE_OBJPATH=%S\n",
objdir);
+ if (wcslen(outdir) > 0) fprintf(pFile, "set _ROSBE_OUTPATH=%S\n",
outdir);
fclose(pFile);
return TRUE;
}