- Finally the one and only splitup of GCC Host and Target in different folders and a fix for the Header Usage Problem in one. This cures the MESS in our GCC Folder and simplifies the inclusion of new Arches, too. Great work, done By Samuel Serapion

- Updated charch and chdefgcc to support the new way of accessing the different GCCs and some cleanup by me. chdefgcc got a new Param to choose if the Host of Target GCC will be edited.
- Fixed MingW.cmd to use Host GCC again.
- Sorta updated the install script for the 64 bit GCC Addon.

svn path=/trunk/tools/RosBE/; revision=858
This commit is contained in:
Daniel Reimer 2008-10-07 01:14:09 +00:00
parent 1daca3f664
commit 444c8091e2
8 changed files with 101 additions and 47 deletions

View File

@ -111,6 +111,11 @@ if .%_ROSBE_USECCACHE%. == .1. (
set CCACHE_DIR=%APPDATA%\RosBE\.ccache
set HOST_CC=ccache gcc
set HOST_CPP=ccache g++
::
::Target defaults to host(i386)
::
set TARGET_CC=ccache gcc
set TARGET_CPP=ccache g++
if .%ROS_ARCH%. == .arm. (
@ -128,6 +133,11 @@ if .%_ROSBE_USECCACHE%. == .1. (
) else (
set HOST_CC=gcc
set HOST_CPP=g++
::
::Target defaults to host(i386)
::
set TARGET_CC=gcc
set TARGET_CPP=g++
if .%ROS_ARCH%. == .arm. (

View File

@ -38,7 +38,7 @@ if "%1" == "" (
)
if exist "%_ROSBE_BASEDIR%\chdefgcc.cmd" (
echo chdefgcc [PATH] - Change the MinGW/GCC directory for the
echo chdefgcc [OPTIONS] - Change the MinGW/GCC directory for the
echo current RosBE session.
)
@ -125,9 +125,11 @@ if exist "%_ROSBE_BASEDIR%\chdefdir.cmd" (
)
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 Usage: chdefgcc [OPTIONS]
echo Change the MinGW/GCC Target/Host directory for the current RosBE session.
echo.
echo Path - Path to set the Host of Target GCC to.
echo Type - Set it to "target" or "host"
goto :EOC
)
)

View File

@ -25,7 +25,8 @@ set _ROSBE_BASEDIR=%~dp0
set _ROSBE_BASEDIR=%_ROSBE_BASEDIR:~0,-1%
set _ROSBE_MODE=MinGW
set _ROSBE_ORIGINALPATH=%PATH%
set _ROSBE_MINGWPATH=%_ROSBE_BASEDIR%\4.1.3
set _ROSBE_HOST_MINGWPATH=%_ROSBE_BASEDIR%\4.1.3
set _ROSBE_TARGET_MINGWPATH=%_ROSBE_BASEDIR%\4.1.3
echo.
echo.

View File

@ -33,7 +33,8 @@ set _ROSBE_USECCACHE=0
set _ROSBE_STRIP=0
set _ROSBE_NOSTRIP=0
set _ROSBE_MODULES=0
set _ROSBE_MINGWPATH=%_ROSBE_BASEDIR%\4.1.3
set _ROSBE_HOST_MINGWPATH=%_ROSBE_BASEDIR%\4.1.3
set _ROSBE_TARGET_MINGWPATH=%_ROSBE_BASEDIR%\4.1.3
set _ROSBE_LOGDIR=%CD%\RosBE-Logs
set _ROSBE_OBJPATH=
set _ROSBE_OUTPATH=

View File

@ -15,9 +15,7 @@ title Change the Architecture to build for...
::
:: Parse the command line arguments.
:: ROS_ARCH: Default is i386, can be set to amd64, ppc or arm.
:: ROS_PREFIX: Default is mingw32. ppc could be ppc-pc-mingw32,
:: arm arm-pc-mingw32, x64 x86_64-pc-mingw32.
:: ROSBE_ARCH: Default is i386, can be set to amd64, ppc or arm.
::
if "%1" == "" (
@ -26,29 +24,32 @@ if "%1" == "" (
set _1=%1
)
if /i "%_1%" == "i386" (
set ROS_ARCH=
set ROS_PREFIX=
goto :EOC
set _ROSBE_ARCH=
goto :EOA
)
if /i "%_1%" == "arm" (
set ROS_ARCH=arm
set ROS_PREFIX=arm-pc-mingw32
goto :EOC
set _ROSBE_ARCH=1
goto :EOA
)
if /i "%_1%" == "ppc" (
set ROS_ARCH=ppc
set ROS_PREFIX=ppc-pc-mingw32
goto :EOC
set _ROSBE_ARCH=2
goto :EOA
)
if /i "%_1%" == "amd64" (
set ROS_ARCH=amd64
set ROS_PREFIX=x86_64-pc-mingw32
goto :EOC
set _ROSBE_ARCH=3
goto :EOA
)
if not "%_1%" == "" (
echo Unknown parameter specified. Try 'help [COMMAND]'.
goto :EOC
)
:EOA
::
:: Refresh all needed Params by recalling the main Path setting CMD File.
::
call "%_ROSBE_BASEDIR%\rosbe-gcc-env.cmd"
goto :EOC
::

View File

@ -13,16 +13,20 @@ if %_ROSBE_DEBUG% == 1 (
)
if "%_ROSBE_MODE%" == "RosBE" (
title Change the current MinGW/GCC directory...
title Change the current MinGW/GCC Host/Target directory...
)
::
:: Parse the command line arguments.
::
for /f "usebackq tokens=*" %%i in (`""%_ROSBE_BASEDIR%\Tools\rquote.exe" %1"`) do set _1=%%i
set _2=%2
if "%_1%" == "" (
call :INTERACTIVE
)
if "%_2%" == "" (
call :INTERACTIVE
)
if exist "%_ROSBE_BASEDIR%\%_1%\." (
set _1="%_ROSBE_BASEDIR%\%_1%"
@ -31,15 +35,27 @@ if exist "%_ROSBE_BASEDIR%\%_1%\." (
goto :EOC
)
if not exist "%_1%\bin\gcc.exe" (
if not exist "%_1%\bin\*gcc.exe" (
echo ERROR: No MinGW/GCC found in the specified path.
goto :EOC
)
set _ROSBE_MINGWPATH=%_1%
echo Location: %_ROSBE_MINGWPATH%
call "%_ROSBE_BASEDIR%\rosbe-gcc-env.cmd"
if /i "%_2%" == "target" (
set _ROSBE_TARGET_MINGWPATH=%_1%
echo Target Location: %_ROSBE_TARGET_MINGWPATH%
goto :EOA
)
if /i "%_2%" == "host" (
set _ROSBE_HOST_MINGWPATH=%_1%
echo Host Location: %_ROSBE_HOST_MINGWPATH%
goto :EOA
) else (
echo ERROR: You specified wrong parameters.
goto :EOC
)
:EOA
call "%_ROSBE_BASEDIR%\rosbe-gcc-env.cmd" chdefgcc
goto :EOC
:INTERACTIVE
@ -48,6 +64,11 @@ goto :EOC
echo ERROR: You must enter a MinGW/GCC directory.
goto :EOC
)
set /p _2="Please specify, if this will be the Target or Host GCC: "
if "%_2%" == "" (
echo ERROR: You must enter "target" or "host".
goto :EOC
)
goto :EOF
:EOC
@ -59,3 +80,4 @@ if defined _ROSBE_VERSION (
:: Unload all used Vars.
::
set _1=
set _2=

View File

@ -17,9 +17,9 @@ if %_ROSBE_DEBUG% == 1 (
:: Check if we are running within the RosBE, and if not
:: initialize GCC for the current directory.
::
if not defined _ROSBE_MINGWPATH (
if not defined _ROSBE_HOST_MINGWPATH (
set _ROSBE_MODE=MinGW
set _ROSBE_MINGWPATH=%CD%
set _ROSBE_HOST_MINGWPATH=%CD%
set _ROSBE_ORIGINALPATH=%PATH%
)
@ -30,49 +30,66 @@ if not defined _ROSBE_MINGWPATH (
set ROS_ARCH=
set ROS_PREFIX=
if "%1" == "chdefgcc" (
goto :main
)
if .%_ROSBE_ARCH%. == .1. (
set ROS_ARCH=arm
set ROS_PREFIX=arm-pc-mingw32
REM set _ROSBE_TARGET_MINGWPATH=%_ROSBE_BASEDIR%\4.4.0
)
if .%_ROSBE_ARCH%. == .2. (
set ROS_ARCH=ppc
set ROS_PREFIX=ppc-pc-mingw32
REM set _ROSBE_TARGET_MINGWPATH=%_ROSBE_BASEDIR%\4.4.0
)
if .%_ROSBE_ARCH%. == .3. (
set ROS_ARCH=amd64
set ROS_PREFIX=x86_64-pc-mingw32
set _ROSBE_TARGET_MINGWPATH=%_ROSBE_BASEDIR%\4.4.0
)
:main
::
:: Set up the GCC 4.x.x build environment.
::
set PATH=%_ROSBE_MINGWPATH%\bin;%_ROSBE_ORIGINALPATH%
set _ROSBE_GCCVERSION=
set _ROSBE_GCCTARGET=
set PATH=%_ROSBE_HOST_MINGWPATH%\bin;%_ROSBE_TARGET_MINGWPATH%\bin;%_ROSBE_ORIGINALPATH%
set _ROSBE_MINGWMAKE=%_ROSBE_HOST_MINGWPATH%\bin\mingw32-make.exe
if not .%ROS_ARCH%. == .. (
for /f "usebackq tokens=3" %%i in (`"%ROS_PREFIX%-gcc -v 2>&1 | find "gcc version""`) do set _ROSBE_GCCVERSION=%%i
for /f "usebackq tokens=2" %%i in (`"%ROS_PREFIX%-gcc -v 2>&1 | find "Target""`) do set _ROSBE_GCCTARGET=%%i
) else (
for /f "usebackq tokens=3" %%i in (`"gcc -v 2>&1 | find "gcc version""`) do set _ROSBE_GCCVERSION=%%i
for /f "usebackq tokens=2" %%i in (`"gcc -v 2>&1 | find "Target""`) do set _ROSBE_GCCTARGET=%%i
set PATH=%_ROSBE_MINGWPATH%\bin;%_ROSBE_MINGWPATH%\libexec\gcc\%_ROSBE_GCCTARGET%\%_ROSBE_GCCVERSION%;%_ROSBE_ORIGINALPATH%
set _ROSBE_MINGWMAKE=%_ROSBE_MINGWPATH%\bin\mingw32-make.exe
if "%_ROSBE_MODE%" == "MinGW" (
set C_INCLUDE_PATH=%_ROSBE_MINGWPATH%\include;%_ROSBE_MINGWPATH%\lib\gcc\%_ROSBE_GCCTARGET%\%_ROSBE_GCCVERSION%\include
set CPLUS_INCLUDE_PATH=%_ROSBE_MINGWPATH%\include;%_ROSBE_MINGWPATH%\include\c++\%_ROSBE_GCCVERSION%;%_ROSBE_MINGWPATH%\include\c++\%_ROSBE_GCCVERSION%\%_ROSBE_GCCTARGET%;%_ROSBE_MINGWPATH%\lib\gcc\%_ROSBE_GCCTARGET%\%_ROSBE_GCCVERSION%\include
) else (
set HOST_CFLAGS=-I"%_ROSBE_MINGWPATH%\include" -I"%_ROSBE_MINGWPATH%\lib\gcc\%_ROSBE_GCCTARGET%\%_ROSBE_GCCVERSION%\include"
set HOST_CPPFLAGS=-I"%_ROSBE_MINGWPATH%\include" -I"%_ROSBE_MINGWPATH%\include\c++\%_ROSBE_GCCVERSION%" -I"%_ROSBE_MINGWPATH%\include\c++\%_ROSBE_GCCVERSION%\%_ROSBE_GCCTARGET%" -I"%_ROSBE_MINGWPATH%\lib\gcc\%_ROSBE_GCCTARGET%\%_ROSBE_GCCVERSION%\include"
)
set LIBRARY_PATH=%_ROSBE_MINGWPATH%\lib;%_ROSBE_MINGWPATH%\lib\gcc\%_ROSBE_GCCTARGET%\%_ROSBE_GCCVERSION%
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
if "%_ROSBE_MODE%" == "MinGW" (
set C_INCLUDE_PATH=%_ROSBE_HOST_MINGWPATH%\include;%_ROSBE_HOST_MINGWPATH%\lib\gcc\%_ROSBE_GCCTARGET%\%_ROSBE_GCCVERSION%\include
set CPLUS_INCLUDE_PATH=%_ROSBE_HOST_MINGWPATH%\include;%_ROSBE_HOST_MINGWPATH%\include\c++\%_ROSBE_GCCVERSION%;%_ROSBE_HOST_MINGWPATH%\include\c++\%_ROSBE_GCCVERSION%\%_ROSBE_GCCTARGET%;%_ROSBE_HOST_MINGWPATH%\lib\gcc\%_ROSBE_GCCTARGET%\%_ROSBE_GCCVERSION%\include
) else (
set HOST_CFLAGS=-I"%_ROSBE_HOST_MINGWPATH%\include" -I"%_ROSBE_HOST_MINGWPATH%\lib\gcc\%_ROSBE_HOST_GCCTARGET%\%_ROSBE_HOST_GCCVERSION%\include"
set HOST_CPPFLAGS=-I"%_ROSBE_HOST_MINGWPATH%\include" -I"%_ROSBE_HOST_MINGWPATH%\include\c++\%_ROSBE_HOST_GCCVERSION%" -I"%_ROSBE_HOST_MINGWPATH%\include\c++\%_ROSBE_HOST_GCCVERSION%\%_ROSBE_HOST_GCCTARGET%" -I"%_ROSBE_HOST_MINGWPATH%\lib\gcc\%_ROSBE_HOST_GCCTARGET%\%_ROSBE_HOST_GCCVERSION%\include"
set TARGET_CFLAGS=-I"%_ROSBE_TARGET_MINGWPATH%\include" -I"%_ROSBE_TARGET_MINGWPATH%\lib\gcc\%_ROSBE_GCCTARGET%\%_ROSBE_GCCVERSION%\include"
set TARGET_CPPFLAGS=-I"%_ROSBE_TARGET_MINGWPATH%\include" -I"%_ROSBE_TARGET_MINGWPATH%\include\c++\%_ROSBE_GCCVERSION%" -I"%_ROSBE_TARGET_MINGWPATH%\include\c++\%_ROSBE_GCCVERSION%\%_ROSBE_GCCTARGET%" -I"%_ROSBE_TARGET_MINGWPATH%\lib\gcc\%_ROSBE_GCCTARGET%\%_ROSBE_GCCVERSION%\include"
)
::
:: Display the current version of GCC, NASM, ld and make.
::
if not .%ROS_ARCH%. == .. (
%ROS_PREFIX%-gcc -v 2>&1 | find "gcc version"
"%_ROSBE_TARGET_MINGWPATH%\bin\%ROS_PREFIX%-gcc" -v 2>&1 | find "gcc version"
if .%ROS_PREFIX%. == .. (
echo gcc target^: %_ROSBE_GCCTARGET%
) else (
echo gcc target^: %ROS_PREFIX:~0,-11%
)
%ROS_PREFIX%-ld -v
"%_ROSBE_TARGET_MINGWPATH%\bin\%ROS_PREFIX%-ld" -v
) else (
gcc -v 2>&1 | find "gcc version"
if .%ROS_PREFIX%. == .. (
@ -83,10 +100,10 @@ if not .%ROS_ARCH%. == .. (
ld -v
)
if exist "%_ROSBE_MINGWPATH%\bin\nasm.exe" (
if exist "%_ROSBE_HOST_MINGWPATH%\bin\nasm.exe" (
nasm -v
) else (
if exist "%_ROSBE_MINGWPATH%\bin\yasm.exe" (
if exist "%_ROSBE_HOST_MINGWPATH%\bin\yasm.exe" (
yasm --version | find "yasm 0"
) else (
if "%_ROSBE_MODE%" == "RosBE" (
@ -94,14 +111,14 @@ if exist "%_ROSBE_MINGWPATH%\bin\nasm.exe" (
)
)
)
if exist "%_ROSBE_MINGWPATH%\bin\bison.exe" (
if exist "%_ROSBE_HOST_MINGWPATH%\bin\bison.exe" (
bison --version | find "GNU Bison"
) else (
if "%_ROSBE_MODE%" == "RosBE" (
echo WARNING: Bison will soon be required to build ReactOS, none found in the current MinGW/GCC.
)
)
if exist "%_ROSBE_MINGWPATH%\bin\flex.exe" (
if exist "%_ROSBE_HOST_MINGWPATH%\bin\flex.exe" (
flex --version
) else (
if "%_ROSBE_MODE%" == "RosBE" (

View File

@ -116,7 +116,7 @@ Section -BaseFiles SEC01
SectionEnd
Section -MinGWGCCNASM SEC02
SetOutPath "$INSTDIR\4.1.3"
SetOutPath "$INSTDIR\4.4.0"
SetOverwrite try
File /r Components\4.4.0\*.*
SectionEnd
@ -185,7 +185,7 @@ Section Uninstall
;;
;; Clean up installed files.
;;
RMDir /r /REBOOTOK "$INSTDIR\4.1.3"
RMDir /r /REBOOTOK "$INSTDIR\4.4.0"
Delete /REBOOTOK "$INSTDIR\charch.cmd"
Delete /REBOOTOK "$INSTDIR\Uninstall-${PRODUCT_VERSION}.exe"
;; Whoever dares to change this back into: RMDir /r /REBOOTOK "$INSTDIR" will be KILLED!!!