Author: dreimer
Date: Fri May 15 01:50:20 2009
New Revision: 40923
URL:
http://svn.reactos.org/svn/reactos?rev=40923&view=rev
Log:
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
Modified:
trunk/tools/RosBE/RosBE-Windows/Powershell/Config.ps1
trunk/tools/RosBE/RosBE-Windows/Powershell/chdefgcc.ps1
trunk/tools/RosBE/RosBE-Windows/Powershell/rosbe-gcc-env.ps1
trunk/tools/RosBE/RosBE-Windows/Powershell/update.ps1
trunk/tools/RosBE/RosBE-Windows/Powershell/version.ps1
trunk/tools/RosBE/RosBE-Windows/Root/chdefdir.cmd
trunk/tools/RosBE/RosBE-Windows/Root/chdefgcc.cmd
Modified: trunk/tools/RosBE/RosBE-Windows/Powershell/Config.ps1
URL:
http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/RosBE-Windows/Powershe…
==============================================================================
--- trunk/tools/RosBE/RosBE-Windows/Powershell/Config.ps1 [iso-8859-1] (original)
+++ trunk/tools/RosBE/RosBE-Windows/Powershell/Config.ps1 [iso-8859-1] Fri May 15 01:50:20
2009
@@ -86,7 +86,7 @@
}
# 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."
Modified: trunk/tools/RosBE/RosBE-Windows/Powershell/chdefgcc.ps1
URL:
http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/RosBE-Windows/Powershe…
==============================================================================
--- trunk/tools/RosBE/RosBE-Windows/Powershell/chdefgcc.ps1 [iso-8859-1] (original)
+++ trunk/tools/RosBE/RosBE-Windows/Powershell/chdefgcc.ps1 [iso-8859-1] Fri May 15
01:50:20 2009
@@ -14,7 +14,7 @@
}
function EOA {
- IEX "&'$_ROSBE_BASEDIR\rosbe-gcc-env.cmd'"
+ IEX "&'$_ROSBE_BASEDIR\rosbe-gcc-env.ps1'"
version
settitle
}
@@ -38,13 +38,15 @@
}
# 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 @@
# 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
Modified: trunk/tools/RosBE/RosBE-Windows/Powershell/rosbe-gcc-env.ps1
URL:
http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/RosBE-Windows/Powershe…
==============================================================================
--- trunk/tools/RosBE/RosBE-Windows/Powershell/rosbe-gcc-env.ps1 [iso-8859-1] (original)
+++ trunk/tools/RosBE/RosBE-Windows/Powershell/rosbe-gcc-env.ps1 [iso-8859-1] Fri May 15
01:50:20 2009
@@ -27,5 +27,5 @@
$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"""
Modified: trunk/tools/RosBE/RosBE-Windows/Powershell/update.ps1
URL:
http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/RosBE-Windows/Powershe…
==============================================================================
--- trunk/tools/RosBE/RosBE-Windows/Powershell/update.ps1 [iso-8859-1] (original)
+++ trunk/tools/RosBE/RosBE-Windows/Powershell/update.ps1 [iso-8859-1] Fri May 15 01:50:20
2009
@@ -76,7 +76,7 @@
# 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
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] Fri May 15
01:50:20 2009
@@ -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") {
Modified: trunk/tools/RosBE/RosBE-Windows/Root/chdefdir.cmd
URL:
http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/RosBE-Windows/Root/chd…
==============================================================================
--- trunk/tools/RosBE/RosBE-Windows/Root/chdefdir.cmd [iso-8859-1] (original)
+++ trunk/tools/RosBE/RosBE-Windows/Root/chdefdir.cmd [iso-8859-1] Fri May 15 01:50:20
2009
@@ -42,6 +42,6 @@
)
:EOC
-set _ROSBE_ROSSOURCEDIR=%CD%
+set SOURCEDIR=%CD%
title ReactOS Build Environment %_ROSBE_VERSION%
-endlocal
+endlocal & set _ROSBE_ROSSOURCEDIR=%SOURCEDIR%
Modified: trunk/tools/RosBE/RosBE-Windows/Root/chdefgcc.cmd
URL:
http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/RosBE-Windows/Root/chd…
==============================================================================
--- trunk/tools/RosBE/RosBE-Windows/Root/chdefgcc.cmd [iso-8859-1] (original)
+++ trunk/tools/RosBE/RosBE-Windows/Root/chdefgcc.cmd [iso-8859-1] Fri May 15 01:50:20
2009
@@ -18,7 +18,7 @@
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 @@
:: 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 @@
:: 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"