Fixed chdefgcc, charch and chdefdir for PS and Batch.

Fixed version showing when using charch and chdefdir under PS.
Fixed endless loop in update under PS.
Fixed variables to TARGET GCC under PS.
Thx to Jaykul from #powershell

svn path=/trunk/tools/RosBE/; revision=994
This commit is contained in:
Daniel Reimer 2009-05-14 21:50:20 +00:00
parent 4f5a2293ce
commit f9da5ec3e2
7 changed files with 26 additions and 16 deletions

View File

@ -86,7 +86,7 @@ if (Test-Path ".\config.rbuild") {
}
# Prepare XML Parser.
[xml] $XML = get-content "$ENV:APPDATA\RosBE\config.rbuild"
[xml]$xml = get-content "$ENV:APPDATA\RosBE\config.rbuild"
# Start with reading settings from config.rbuild and let the user edit them.
"Sub-Architecture to build for."

View File

@ -14,7 +14,7 @@ function settitle {
}
function EOA {
IEX "&'$_ROSBE_BASEDIR\rosbe-gcc-env.cmd'"
IEX "&'$_ROSBE_BASEDIR\rosbe-gcc-env.ps1'"
version
settitle
}
@ -38,13 +38,15 @@ if ($TOOLMODE -eq $null) {
}
# Verify the entered values
$local:ErrorActionPreference = "SilentlyContinue"
if (Test-Path "$_ROSBE_BASEDIR\$TOOLPATH\.") {
$ENV:ROS_ARCH = "$TOOLPATH"
$TOOLPATH = "$_ROSBE_BASEDIR\$TOOLPATH"
} elseif (!(Test-Path "$TOOLPATH\.")) {
"ERROR: The path specified doesn't seem to exist."
settitle
}
$local:ErrorActionPreference = "Continue"
if (!(Test-Path "$TOOLPATH\bin\*gcc.exe")) {
"ERROR: No MinGW/GCC found in the specified path."
settitle
@ -52,6 +54,9 @@ if (!(Test-Path "$TOOLPATH\bin\*gcc.exe")) {
# Set the values
if ($TOOLMODE -eq "target") {
if ($ENV:ROS_ARCH -eq $null) {
$ENV:ROS_ARCH = Read-Host "Please specify the arch: "
}
$_ROSBE_TARGET_MINGWPATH = $TOOLPATH
"Target Location: $_ROSBE_TARGET_MINGWPATH"
EOA

View File

@ -27,5 +27,5 @@ remove-item gcchvers.tmp
$ENV:ROSBE_HOST_CFLAGS = "-I""$_ROSBE_HOST_MINGWPATH\include"" -I""$_ROSBE_HOST_MINGWPATH\lib\gcc\$_ROSBE_HOST_GCCTARGET\$_ROSBE_HOST_GCCVERSION\include"""
$ENV:ROSBE_HOST_CXXFLAGS = "-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"""
$ENV:ROSBE_TARGET_CFLAGS = "-I""$_ROSBE_TARGET_MINGWPATH\include"" -I""$_ROSBE_TARGET_MINGWPATH\lib\gcc\$_ROSBE_GCCTARGET\$_ROSBE_GCCVERSION\include"""
$ENV:ROSBE_TARGET_CXXFLAGS = "-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"""
$ENV:ROSBE_TARGET_CFLAGS = "-I""$_ROSBE_TARGET_MINGWPATH\include"" -I""$_ROSBE_TARGET_MINGWPATH\lib\gcc\$_ROSBE_TARGET_GCCTARGET\$_ROSBE_TARGET_GCCVERSION\include"""
$ENV:ROSBE_TARGET_CXXFLAGS = "-I""$_ROSBE_TARGET_MINGWPATH\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"""

View File

@ -76,7 +76,7 @@ set-location $_ROSBE_BASEDIR
# First check for a new Updater.
rename-item update.ps1 update2.ps1
get-webfile $_ROSBE_URL/update.ps1 $PWD\update.ps1
if ((gi .\update.ps1).LastWriteTime -gt (gi .\update2.ps1).LastWriteTime) {
if ((gi .\update.ps1).length -ne (gi .\update2.ps1).length) {
clear-host
"Updater got updated and needs to be restarted."
remove-item update2.ps1 -force

View File

@ -9,14 +9,15 @@
(get-WmiObject Win32_OperatingSystem).caption
# GCC
$TARGETGCC = "$ENV:ROS_PREFIX" + "gcc"
& $TARGETGCC -v 2> gcctvers.tmp
(select-string -path .\gcctvers.tmp "gcc version") -replace ".*: (.+?)\b",'$1' | % { $str = $_ -replace '^.*14:',''}
$str
"gcc target - $_ROSBE_GCCTARGET"
(select-string -path .\gcctvers.tmp "gcc version") -replace ".*:(.*?)\b",'$1'
"gcc target - $_ROSBE_TARGET_GCCTARGET"
remove-item gcctvers.tmp
# LD
& "$_ROSBE_TARGET_MINGWPATH\bin\$ENV:ROS_PREFIXld" -v
$run = "$_ROSBE_TARGET_MINGWPATH\bin\$ENV:ROS_PREFIX" + "ld.exe"
& "$run" -v
# NASM or YASM
if (Test-Path "$_ROSBE_HOST_MINGWPATH\bin\nasm.exe") {

View File

@ -42,6 +42,6 @@ if /i "%SOURCEDIR%" == "previous" (
)
:EOC
set _ROSBE_ROSSOURCEDIR=%CD%
set SOURCEDIR=%CD%
title ReactOS Build Environment %_ROSBE_VERSION%
endlocal
endlocal & set _ROSBE_ROSSOURCEDIR=%SOURCEDIR%

View File

@ -18,7 +18,7 @@ setlocal enabledelayedexpansion
title Change the current MinGW/GCC Host/Target directory...
:: Parse the command line arguments. Ask the user if certain parameters are missing.
if "%1" == "" (
if .%1. == .. (
set /p TOOLPATH="Please enter a MinGW/GCC directory (don't use quotes): "
if "!TOOLPATH!" == "" (
@ -42,6 +42,7 @@ if "%2" == "" (
:: Verify the entered values
if exist "%_ROSBE_BASEDIR%\%TOOLPATH%\." (
set ROS_ARCH=%TOOLPATH%
set TOOLPATH=%_ROSBE_BASEDIR%\%TOOLPATH%
) else if not exist "%TOOLPATH%\." (
echo ERROR: The path specified doesn't seem to exist.
@ -55,17 +56,20 @@ if not exist "%TOOLPATH%\bin\*gcc.exe" (
:: Set the values
if /i "%TOOLMODE%" == "target" (
if "%ROS_ARCH%" == "i386" (
set /p ROS_ARCH="Please specify the arch: "
)
echo Target Location: %TOOLPATH%
endlocal & set _ROSBE_TARGET_MINGWPATH=%TOOLPATH%
set _ROSBE_TARGET_MINGWPATH=%TOOLPATH%
) else if /i "%TOOLMODE%" == "host" (
echo Host Location: %TOOLPATH%
endlocal & set _ROSBE_HOST_MINGWPATH=%TOOLPATH%
set _ROSBE_HOST_MINGWPATH=%TOOLPATH%
) else (
echo ERROR: You specified wrong parameters.
endlocal
goto :EOC
)
endlocal & set _ROSBE_HOST_MINGWPATH=%_ROSBE_HOST_MINGWPATH%& set _ROSBE_TARGET_MINGWPATH=%_ROSBE_TARGET_MINGWPATH%& set ROS_ARCH=%ROS_ARCH%
call "%_ROSBE_BASEDIR%\rosbe-gcc-env.cmd"
call "%_ROSBE_BASEDIR%\version.cmd"