Author: dreimer Date: Mon May 11 04:40:11 2009 New Revision: 40882
URL: http://svn.reactos.org/svn/reactos?rev=40882&view=rev Log: First run through the PS1 Scripts to get them in sync to Colin's fixes again. Not tested yet.
Removed: trunk/tools/RosBE/RosBE-Windows/Powershell/MinGW.ps1 Modified: trunk/tools/RosBE/RosBE-Windows/Powershell/Build.ps1 trunk/tools/RosBE/RosBE-Windows/Powershell/Clean.ps1 trunk/tools/RosBE/RosBE-Windows/Powershell/Config.ps1 trunk/tools/RosBE/RosBE-Windows/Powershell/Help.ps1 trunk/tools/RosBE/RosBE-Windows/Powershell/RosBE.ps1 trunk/tools/RosBE/RosBE-Windows/Powershell/charch.ps1 trunk/tools/RosBE/RosBE-Windows/Powershell/chdefdir.ps1 trunk/tools/RosBE/RosBE-Windows/Powershell/chdefgcc.ps1 trunk/tools/RosBE/RosBE-Windows/Powershell/options.ps1 trunk/tools/RosBE/RosBE-Windows/Powershell/reladdr2line.ps1 trunk/tools/RosBE/RosBE-Windows/Powershell/rosbe-gcc-env.ps1 trunk/tools/RosBE/RosBE-Windows/Powershell/sSVN.ps1 trunk/tools/RosBE/RosBE-Windows/Powershell/scut.ps1 trunk/tools/RosBE/RosBE-Windows/Powershell/update.ps1 trunk/tools/RosBE/RosBE-Windows/Powershell/version.ps1
Modified: trunk/tools/RosBE/RosBE-Windows/Powershell/Build.ps1 URL: http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/RosBE-Windows/Powershel... ============================================================================== --- trunk/tools/RosBE/RosBE-Windows/Powershell/Build.ps1 [iso-8859-1] (original) +++ trunk/tools/RosBE/RosBE-Windows/Powershell/Build.ps1 [iso-8859-1] Mon May 11 04:40:11 2009 @@ -7,10 +7,8 @@ # #
-# # Check if config.template.rbuild is newer than config.rbuild, if it is then # abort the build and inform the user. -# if (Test-Path ".\config.rbuild") { if ((gi .\config.template.rbuild).LastWriteTime -gt (gi .\config.rbuild).LastWriteTime) { "" @@ -22,9 +20,7 @@ } }
-# # Check if strip, no Debug Symbols or ccache are being used and set the appropriate options. -# if ($_ROSBE_NOSTRIP -ne $null) { if ($_ROSBE_NOSTRIP -eq 1) { $ENV:ROS_BUILDNOSTRIP = "yes" @@ -39,162 +35,73 @@ $ENV:ROS_LEAN_AND_MEAN = "no" } } -# Small Security Check to prevent useless apps. -if ($ENV:ROS_LEAN_AND_MEAN -eq "yes") { - if ($ENV:ROS_BUILDNOSTRIP -eq "yes") { - clear-host - "Selecting Stripping and removing Debug Symbols together will most likely cause useless apps. Please deselect one of them." - exit - } -}
-if ($_ROSBE_USECCACHE -ne $null) { - if ($_ROSBE_USECCACHE -eq 1) { - $ENV:CCACHE_DIR = "$APPDATA\RosBE.ccache" - $_ROSBE_CCACHE = "ccache " - } - $ENV:HOST_CC = "$_ROSBE_CCACHE" + "gcc" - $ENV:HOST_CPP = "$_ROSBE_CCACHE" + "g++" - - # - #Target defaults to host(i386) - # - - $ENV:TARGET_CC = "$_ROSBE_CCACHE" + "gcc" - $ENV:TARGET_CPP = "$_ROSBE_CCACHE" + "g++" - if ($ENV:ROS_ARCH -ne $null) { - $ENV:TARGET_CC = "$_ROSBE_CCACHE" + "$ROS_ARCH-pc-mingw32-gcc" - $ENV:TARGET_CPP = "$_ROSBE_CCACHE" + "$ROS_ARCH-pc-mingw32-g++" - } -} - -# # Check if the user has chosen to use a different object or output path and set # it accordingly. -# if ($_ROSBE_OBJPATH -ne $null) { if (Test-Path "$_ROSBE_OBJPATH") { "WARNING: The Object-Path specified doesn't seem to exist. Creating..." - if (Test-Path "makefile*.auto") { - "WARNING: makefile.auto exists. Deleting..." - clean - } } $ENV:ROS_INTERMEDIATE = "$_ROSBE_OBJPATH" + $ENV:ROS_TEMPORARY = "$_ROSBE_OBJPATH" } if ($_ROSBE_OUTPATH -ne $null) { if (Test-Path "$_ROSBE_OUTPATH") { "WARNING: The Output-Path specified doesn't seem to exist. Creating..." - if (Test-Path "makefile*.auto") { - "WARNING: makefile.auto exists. Deleting..." - clean - } } $ENV:ROS_OUTPUT = "$_ROSBE_OUTPATH" - $ENV:ROS_TEMPORARY = "$_ROSBE_OUTPATH" }
-# +if ($_ROSBE_USECCACHE -eq 1) { + $_ROSBE_CCACHE = "ccache " +} else { + $_ROSBE_CCACHE = $null +} + $ENV:HOST_CC = "$_ROSBE_CCACHE" + "gcc" + $ENV:HOST_CPP = "$_ROSBE_CCACHE" + "g++" + $ENV:TARGET_CC = "$_ROSBE_CCACHE" + "gcc" + $ENV:TARGET_CPP = "$_ROSBE_CCACHE" + "g++" + $ENV:TARGET_CC = "$_ROSBE_CCACHE" + "$ROS_PREFIX" + "gcc" + $ENV:TARGET_CPP = "$_ROSBE_CCACHE" + "$ROS_PREFIX" + "g++" +} + # Get the current date and time for use in in our build log's file name. -# $TIMERAW = get-date -f t $DATENAME = get-date -f dyMMyyyy $TIMENAME = get-date -f HHmm
-# -# Check if writing logs is enabled, if so check if our log directory exists, if -# it doesn't, create it. -# -if ($_ROSBE_WRITELOG -eq 1) { - if (!(Test-Path "$_ROSBE_LOGDIR")) { - $null = (New-Item -path "$_ROSBE_ROSSOURCEDIR" -name "RosBE-Logs" -type directory) - } +# Check whether we were called as "makex" or "make" +if ($args[0] -eq "multi") { + $args.setvalue($null, 0) + $MAKE_JOBS = "$_ROSBE_MAKEX_JOBS" + $TITLE_COMMAND = "makex $args[2]" +} else { + $MAKE_JOBS = 1 + $TITLE_COMMAND = "make $args[1]" }
-function BUILD { - if ($_ROSBE_SHOWTIME -eq 1) { - [System.Diagnostics.Stopwatch] $sw; - $sw = New-Object System.Diagnostics.StopWatch - if ($_ROSBE_WRITELOG -eq 1) { - if (!(Test-Path "$_ROSBE_LOGDIR\BuildLog-$_ROSBE_GCCVERSION-$DATENAME-$TIMENAME.txt")) { - $null = (New-Item -path "$_ROSBE_LOGDIR" -name "BuildLog-$_ROSBE_GCCVERSION-$DATENAME-$TIMENAME.txt" -type file) - } - $sw.Start() - IEX "&'$_ROSBE_MINGWMAKE' $($args)" 2>&1 | tee-object -filepath "$_ROSBE_LOGDIR\BuildLog-$_ROSBE_GCCVERSION-$DATENAME-$TIMENAME.txt" - $sw.Stop() - write-host "Total Build Time:" $sw.Elapsed.ToString() - } else { - $sw.Start() - IEX "&'$_ROSBE_MINGWMAKE' $($args)" - $sw.Stop() - write-host "Total Build Time:" $sw.Elapsed.ToString() - } - } else { - if ($_ROSBE_WRITELOG -eq 1) { - if (!(Test-Path "$_ROSBE_LOGDIR\BuildLog-$_ROSBE_GCCVERSION-$DATENAME-$TIMENAME.txt")) { - $null = (New-Item -path "$_ROSBE_LOGDIR" -name "BuildLog-$_ROSBE_GCCVERSION-$DATENAME-$TIMENAME.txt" -type file) - } - IEX "&'$_ROSBE_MINGWMAKE' $($args)" 2>&1 | tee-object -filepath "$_ROSBE_LOGDIR\BuildLog-$_ROSBE_GCCVERSION-$DATENAME-$TIMENAME.txt" - } else { - IEX "&'$_ROSBE_MINGWMAKE' $($args)" - } - } +$host.ui.RawUI.WindowTitle = "'$TITLE_COMMAND' build started: $TIMERAW ($ENV:ROS_ARCH)" + +# Do the actual building +if ($_ROSBE_SHOWTIME -eq 1) { + [System.Diagnostics.Stopwatch] $sw; + $sw = New-Object System.Diagnostics.StopWatch }
-function BUILDMULTI { - # - # Get the number of CPUs in the system so we know how many jobs to execute. - $CPUCOUNT = (gwmi win32_processor).numberofcores + 1 +if ($_ROSBE_WRITELOG -eq 1) { + $sw.Start() + IEX "&'$_ROSBE_MINGWMAKE' -j $MAKE_JOBS $($args)" 2>&1 | tee-object -filepath "$_ROSBE_LOGDIR\BuildLog-$_ROSBE_TARGET_GCCVERSION-$DATENAME-$TIMENAME.txt" + $sw.Stop() +} else { + $sw.Start() + IEX "&'$_ROSBE_MINGWMAKE' -j $MAKE_JOBS $($args)" + $sw.Stop() +} +write-host "Total Build Time:" $sw.Elapsed.ToString()
- if ($_ROSBE_SHOWTIME -eq 1) { - [System.Diagnostics.Stopwatch] $sw; - $sw = New-Object System.Diagnostics.StopWatch - if ($_ROSBE_WRITELOG -eq 1) { - if (!(Test-Path "$_ROSBE_LOGDIR\BuildLog-$_ROSBE_GCCVERSION-$DATENAME-$TIMENAME.txt")) { - $null = (New-Item -path "$_ROSBE_LOGDIR" -name "BuildLog-$_ROSBE_GCCVERSION-$DATENAME-$TIMENAME.txt" -type file) - } - $sw.Start() - IEX "&'$_ROSBE_MINGWMAKE' -j $CPUCOUNT $($args)" 2>&1 | tee-object -filepath "$_ROSBE_LOGDIR\BuildLog-$_ROSBE_GCCVERSION-$DATENAME-$TIMENAME.txt" - $sw.Stop() - write-host "Total Build Time:" $sw.Elapsed.ToString() - } else { - $sw.Start() - IEX "&'$_ROSBE_MINGWMAKE' -j $CPUCOUNT $($args)" - $sw.Stop() - write-host "Total Build Time:" $sw.Elapsed.ToString() - } - } else { - if ($_ROSBE_WRITELOG -eq 1) { - if (!(Test-Path "$_ROSBE_LOGDIR\BuildLog-$_ROSBE_GCCVERSION-$DATENAME-$TIMENAME.txt")) { - $null = (New-Item -path "$_ROSBE_LOGDIR" -name "BuildLog-$_ROSBE_GCCVERSION-$DATENAME-$TIMENAME.txt" -type file) - } - IEX "&'$_ROSBE_MINGWMAKE' -j $CPUCOUNT $($args)" 2>&1 | tee-object -filepath "$_ROSBE_LOGDIR\BuildLog-$_ROSBE_GCCVERSION-$DATENAME-$TIMENAME.txt" - } else { - IEX "&'$_ROSBE_MINGWMAKE' -j $CPUCOUNT $($args)" - } - } -} - -# -# Check if we are using -j or not. -# -if ($args[0] -eq "multi") { - $args.setvalue($null, 0) - $host.ui.RawUI.WindowTitle = "''makex $($args)'' parallel build started: $TIMERAW $ENV:ROS_ARCH" - BUILDMULTI $args -} else { - $host.ui.RawUI.WindowTitle = "''make $($args)'' build started: $TIMERAW $ENV:ROS_ARCH" - BUILD $args -} - -# # Highlight the fact that building has ended. -# "$_ROSBE_BASEDIR\Tools\flash.exe" - -if ($_ROSBE_VERSION -ne $null) { - $host.ui.RawUI.WindowTitle = "ReactOS Build Environment $_ROSBE_VERSION" -} +$host.ui.RawUI.WindowTitle = "ReactOS Build Environment $_ROSBE_VERSION"
# # Unload all used Vars.
Modified: trunk/tools/RosBE/RosBE-Windows/Powershell/Clean.ps1 URL: http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/RosBE-Windows/Powershel... ============================================================================== --- trunk/tools/RosBE/RosBE-Windows/Powershell/Clean.ps1 [iso-8859-1] (original) +++ trunk/tools/RosBE/RosBE-Windows/Powershell/Clean.ps1 [iso-8859-1] Mon May 11 04:40:11 2009 @@ -10,9 +10,7 @@ $host.ui.RawUI.WindowTitle = "Cleaning..."
function remlog { - # # Check if we have any logs to clean, if so, clean them. - # if (Test-Path "$_ROSBE_LOGDIR") { "Cleaning build logs..." $null = (Remove-Item -path "$_ROSBE_LOGDIR*.txt" -force) @@ -23,55 +21,43 @@ }
function rembin { - # # Check if we have something to clean, if so, clean it. - #
- # # Apply modified obj and out paths for deletion. - # - - if ($ENV:ROS_ARCH -eq $null) { - $ENV:ROS_ARCH = "i386" - }
if ($_ROSBE_OBJPATH -eq $null) { - $_ROSBE_OBJCLEANPATH = "$_ROSBE_ROSSOURCEDIR\obj-$ENV:ROS_ARCH" + $OBJCLEANPATH = "$_ROSBE_ROSSOURCEDIR\obj-$ENV:ROS_ARCH" } else { - $_ROSBE_OBJCLEANPATH = "$_ROSBE_OBJPATH" + $OBJCLEANPATH = "$_ROSBE_OBJPATH" }
if ($_ROSBE_OUTPATH -eq $null) { - $_ROSBE_OUTCLEANPATH = "$_ROSBE_ROSSOURCEDIR\output-$ENV:ROS_ARCH" + $OUTCLEANPATH = "$_ROSBE_ROSSOURCEDIR\output-$ENV:ROS_ARCH" } else { - $_ROSBE_OUTCLEANPATH = "$_ROSBE_OUTPATH" + $OUTCLEANPATH = "$_ROSBE_OUTPATH" }
if ($ENV:ROS_ARCH -eq "i386") { - $_ROSBE_MAKEFILE = "$_ROSBE_ROSSOURCEDIR\makefile-$ENV:ROS_ARCH.auto" + $MAKEFILE = "$_ROSBE_ROSSOURCEDIR\makefile-$ENV:ROS_ARCH.auto" } else { - $_ROSBE_MAKEFILE = "$_ROSBE_ROSSOURCEDIR\makefile.auto" + $MAKEFILE = "$_ROSBE_ROSSOURCEDIR\makefile.auto" }
- if (Test-Path "$_ROSBE_MAKEFILE") { - $null = (Remove-Item "$_ROSBE_MAKEFILE" -force) + if (Test-Path "$MAKEFILE") { + $null = (Remove-Item "$MAKEFILE" -force) }
- if (Test-Path "$_ROSBE_OBJCLEANPATH.") { + if (Test-Path "$OBJCLEANPATH.") { "Cleaning ReactOS $ENV:ROS_ARCH source directory..." - if (Test-Path "$_ROSBE_OBJCLEANPATH.") { - $null = (Remove-Item "$_ROSBE_OBJCLEANPATH" -recurse -force) + if (Test-Path "$OBJCLEANPATH.") { + $null = (Remove-Item "$OBJCLEANPATH" -recurse -force) } - if (Test-Path "$_ROSBE_OUTCLEANPATH.") { - $null = (Remove-Item "$_ROSBE_OUTCLEANPATH" -recurse -force) + if (Test-Path "$OUTCLEANPATH.") { + $null = (Remove-Item "$OUTCLEANPATH" -recurse -force) } "Done cleaning ReactOS $ENV:ROS_ARCH source directory." } else { "ERROR: There is no $ENV:ROS_ARCH compiler output to clean." - } - - if ($ENV:ROS_ARCH -eq "i386") { - $ENV:ROS_ARCH = $null }
if (Test-Path "$_ROSBE_ROSSOURCEDIR\reactos") { @@ -85,9 +71,9 @@ # # Unload all used Vars. # - $_ROSBE_OBJCLEANPATH = $null - $_ROSBE_OUTCLEANPATH = $null - $_ROSBE_MAKEFILE = $null + $OBJCLEANPATH = $null + $OUTCLEANPATH = $null + $MAKEFILE = $null
exit }
Modified: trunk/tools/RosBE/RosBE-Windows/Powershell/Config.ps1 URL: http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/RosBE-Windows/Powershel... ============================================================================== --- trunk/tools/RosBE/RosBE-Windows/Powershell/Config.ps1 [iso-8859-1] (original) +++ trunk/tools/RosBE/RosBE-Windows/Powershell/Config.ps1 [iso-8859-1] Mon May 11 04:40:11 2009 @@ -10,15 +10,11 @@ $host.ui.RawUI.WindowTitle = "ReactOS Build Configurator"
function settitle { - if ($_ROSBE_VERSION -ne $null) { - $host.ui.RawUI.WindowTitle = "ReactOS Build Environment $_ROSBE_VERSION" - } + $host.ui.RawUI.WindowTitle = "ReactOS Build Environment $_ROSBE_VERSION" exit }
-# # Receive the first Parameter and decide what to do. -# if ($args[0] -eq "delete") { "config.rbuild will be permanently deleted. All your settings will be gone." "Continue?" @@ -57,16 +53,12 @@ settitle }
-# # Check if config.rbuild already exists. If not, get a working copy. -# if (!(Test-Path "$ENV:APPDATA\RosBE\config.rbuild")) { copy-item ".\config.template.rbuild" "$ENV:APPDATA\RosBE\config.rbuild" }
-# # Help prevent non-useful bug reports/questions. -# "" "*** Configurations other than release/debug are not useful for ***" "*** posting bug reports, and generally not very useful for ***" @@ -77,10 +69,8 @@ $YESNO = Read-Host "(yes), (no)" if (($YESNO -ne "yes") -and ($YESNO -ne "y")) {settitle}
-# # Check if config.template.rbuild is newer than config.rbuild, if it is then # inform the user and offer an update. -# if (Test-Path ".\config.rbuild") { if ((gi .\config.template.rbuild).LastWriteTime -gt (gi .\config.rbuild).LastWriteTime) { "" @@ -95,14 +85,10 @@ } }
-# # Prepare XML Parser. -# [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." "Default is: none" "" @@ -246,9 +232,7 @@ } clear-host
-# # Generate a config.rbuild, copy it to the Source Tree and delete temp files. -# $xml.group.property | ? { $_.Name -eq "SARCH" } | % { $_.Value = "$SARCH_CH"} $xml.group.property | ? { $_.Name -eq "OARCH" } | % { $_.Value = "$OARCH_CH"} $xml.group.property | ? { $_.Name -eq "TUNE" } | % { $_.Value = "$TUNE_CH"} @@ -263,9 +247,7 @@ $xml.save("$ENV:APPDATA\RosBE\config.rbuild") copy-item "$ENV:APPDATA\RosBE\config.rbuild" ".\config.rbuild"
-if ($_ROSBE_VERSION -ne $null) { - $host.ui.RawUI.WindowTitle = "ReactOS Build Environment $_ROSBE_VERSION" -} +$host.ui.RawUI.WindowTitle = "ReactOS Build Environment $_ROSBE_VERSION"
# # Unload all used Vars.
Modified: trunk/tools/RosBE/RosBE-Windows/Powershell/Help.ps1 URL: http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/RosBE-Windows/Powershel... ============================================================================== --- trunk/tools/RosBE/RosBE-Windows/Powershell/Help.ps1 [iso-8859-1] (original) +++ trunk/tools/RosBE/RosBE-Windows/Powershell/Help.ps1 [iso-8859-1] Mon May 11 04:40:11 2009 @@ -7,9 +7,9 @@ # #
-# # Check if we are displaying help on all commands, if so, display it. -# +# Otherwise check if we are displaying help on individual commands, if so, +# display the help for that command. if ("$args" -eq "") { "" "Available Commands:" @@ -73,13 +73,7 @@
"" exit -} - -# -# Now check if we are displaying help on individual commands, if so, -# display the help for that command. -# -if ("$args" -eq "make") { +} elseif ("$args" -eq "make") { " Usage: make [OPTIONS]" " Make does a standard build of ReactOS. OPTIONS are the standard ReactOS build" " options:" @@ -100,9 +94,7 @@ " and generates a new makefile. This will take a while." " ""module""-depends - Does a dependency check for one module with the" " appropiate name." - exit -} -if ("$args" -eq "makex") { +} elseif ("$args" -eq "makex") { " Usage: makex [OPTIONS]" " Same as 'make' but automatically determines the number of CPU Cores in the" " system and uses ""make -j x"" with the appropriate number. OPTIONS are the" @@ -127,42 +119,32 @@ " NOTE: The number makex uses can be modified by editing Build.cmd" " located in the RosBE directory, instructions for doing so are" " contained within the file." - exit -} -if ("$args" -eq "basedir") { +} elseif ("$args" -eq "basedir") { " Usage: basedir" " Switches back to the ReactOS source directory." - exit -} -if (Test-Path "$_ROSBE_BASEDIR\charch.ps1") { - if ("$args" -eq "charch") { +} elseif ("$args" -eq "charch") { + if (Test-Path "$_ROSBE_BASEDIR\charch.ps1") { " Usage: charch [OPTIONS]" " Change the Architecture to build ReactOS for, for the current RosBE session." " Possible Architectures are: i386, ppc, arm, amd64." "" - exit - } -} -if (Test-Path "$_ROSBE_BASEDIR\chdefdir.ps1") { - if ("$args" -eq "chdefdir") { + } +} elseif ("$args" -eq "chdefdir") { + if (Test-Path "$_ROSBE_BASEDIR\chdefdir.ps1") { " Usage: chdefdir [OPTIONS]" " Change the ReactOS source directory for the current RosBE session." "" " previous - Switch to the previous ReactOS source directory." - exit - } -} -if (Test-Path "$_ROSBE_BASEDIR\chdefgcc.ps1") { - if ("$args" -eq "chdefgcc") { + } +} elseif ("$args" -eq "chdefgcc") { + if (Test-Path "$_ROSBE_BASEDIR\chdefgcc.ps1") { " Usage: chdefgcc [PATH]" " Change the MinGW/GCC directory for the current RosBE session." "" " ""Path"" - Path to set the Host or Target GCC to." " ""Type"" - Set it to ""target"" or ""host""" - exit - } -} -if ("$args" -eq "clean") { + } +} elseif ("$args" -eq "clean") { " Usage: clean [logs]" " Fully clean the ReactOS source directory." "" @@ -170,10 +152,8 @@ " logs - Removes all build logs in the RosBE-Logs directory." " All other commands will be parsed as ""make COMMAND_clean"" and cleans the" " specific command." - exit -} -if (Test-Path "$_ROSBE_BASEDIR\Config.ps1") { - if ("$args" -eq "config") { +} elseif ("$args" -eq "config") { + if (Test-Path "$_ROSBE_BASEDIR\Config.ps1") { " Usage: config [OPTIONS]" " Creates a configuration file, which tells RosBE how to build the tree." "" @@ -181,16 +161,12 @@ " default settings." " update - Deletes the old created configuration file and updates it with a" " new, default one." - exit - } -} -if ("$args" -eq "help") { + } +} elseif ("$args" -eq "help") { " Usage: help [COMMAND]" " Shows help for the specified command or lists all available commands." - exit -} -if (Test-Path "$_ROSBE_BASEDIR\reladdr2line.ps1") { - if ("$args" -eq "raddr2line") { +} elseif ("$args" -eq "raddr2line") { + if (Test-Path "$_ROSBE_BASEDIR\reladdr2line.ps1") { " Usage: raddr2line [FILE] [ADDRESS]" " Translates program addresses into file names and line numbers to assist" " developers with finding specific bugs in ReactOS. If either of the options" @@ -202,17 +178,13 @@ " sub-directories are searched." " ADDRESS - The address to be translated." "" - exit - } -} -if (Test-Path "$_ROSBE_BASEDIR\scut.ps1") { - if ("$args" -eq "scut") { + } +} elseif ("$args" -eq "scut") { + if (Test-Path "$_ROSBE_BASEDIR\scut.ps1") { IEX "&'$_ROSBE_BASEDIR\Tools\scut.exe' --help" - exit - } -} -if (Test-Path "$_ROSBE_BASEDIR\sSVN.ps1") { - if ("$args" -eq "ssvn") { + } +} elseif ("$args" -eq "ssvn") { + if (Test-Path "$_ROSBE_BASEDIR\sSVN.ps1") { " Usage: ssvn [OPTIONS]" " Creates, updates or cleans up your ReactOS source tree or shows the revision" " number of the local and online trees." @@ -222,19 +194,15 @@ " create - Creates a new ReactOS source tree." " cleanup - Cleans up and fixes errors in the source tree." " status - Show the current local and online revision numbers." - exit - } -} -if (Test-Path "$_ROSBE_BASEDIR\options.ps1") { - if ("$args" -eq "options") { + } +} elseif ("$args" -eq "options") { + if (Test-Path "$_ROSBE_BASEDIR\options.ps1") { " Usage: options" " Starts the RosBE configurator and sets the changes active in the current." " RosBE session." - exit - } -} -if (Test-Path "$_ROSBE_BASEDIR\update.ps1") { - if ("$args" -eq "update") { + } +} elseif ("$args" -eq "update") { + if (Test-Path "$_ROSBE_BASEDIR\update.ps1") { " Usage: update [OPTIONS]" " Updates all files of RosBE to the most recent files." "" @@ -243,10 +211,7 @@ " nr X - Re/Installs Update Nr X." " reset - Removes the Updates Cache. Not recommended." " status - Shows the recent status of available, non installed updates." - exit - } + } +} else { + " Unknown command specified. No help available for $args." } -if ("$args" -ne $null) { - " Unknown command specified. No help available for $args." - exit -}
Removed: trunk/tools/RosBE/RosBE-Windows/Powershell/MinGW.ps1 URL: http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/RosBE-Windows/Powershel... ============================================================================== --- trunk/tools/RosBE/RosBE-Windows/Powershell/MinGW.ps1 [iso-8859-1] (original) +++ trunk/tools/RosBE/RosBE-Windows/Powershell/MinGW.ps1 (removed) @@ -1,41 +1,0 @@ -# -# PROJECT: RosBE - ReactOS Build Environment for Windows -# LICENSE: GNU General Public License v2. (see LICENSE.txt) -# FILE: Root/MinGW.ps1 -# PURPOSE: This script provides/sets up a standard MinGW build environment. -# COPYRIGHT: Copyright 2009 Daniel Reimer reimer.daniel@freenet.de -# -# - -if ($args -ne "") { - cls - "Unknown parameter specified. Exiting." - exit -} - -(Get-Host).UI.RawUI.ForegroundColor = "Green" -(Get-Host).UI.RawUI.BackgroundColor = "Black" -clear-host -$ENV:PATH = "$ENV:SystemRoot\system32;$ENV:SystemRoot" -$global:0 = $myInvocation.MyCommand.Definition -$global:_ROSBE_BASEDIR = [System.IO.Path]::GetDirectoryName($0) -$global:_ROSBE_MODE = "MinGW" -$global:_ROSBE_ORIGINALPATH = "$ENV:PATH" -$global:_ROSBE_HOST_MINGWPATH = "$_ROSBE_BASEDIR\i386" -$global:_ROSBE_TARGET_MINGWPATH = "$_ROSBE_BASEDIR\i386" - -& "$_ROSBE_BASEDIR\rosbe-gcc-env.ps1" -& "$_ROSBE_BASEDIR\version.ps1" - -# -# Get the number of CPUs in the system so we know how many jobs to execute. -$CPUCOUNT = (gwmi win32_processor).numberofcores + 1 - -if (Test-Path "$_ROSBE_BASEDIR\chdefgcc.ps1") { - set-alias CHDEFGCC "$_ROSBE_BASEDIR\chdefgcc.ps1" -scope Global -} -set-alias MAKE "$_ROSBE_BASEDIR\Build.ps1" -scope Global -function global:MAKEX {IEX "&'$_ROSBE_BASEDIR\Build.ps1' multi"} -if (Test-Path "$_ROSBE_BASEDIR\scut.ps1") { - set-alias SCUT "$_ROSBE_BASEDIR\scut.ps1" -scope Global -}
Modified: trunk/tools/RosBE/RosBE-Windows/Powershell/RosBE.ps1 URL: http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/RosBE-Windows/Powershel... ============================================================================== --- trunk/tools/RosBE/RosBE-Windows/Powershell/RosBE.ps1 [iso-8859-1] (original) +++ trunk/tools/RosBE/RosBE-Windows/Powershell/RosBE.ps1 [iso-8859-1] Mon May 11 04:40:11 2009 @@ -8,32 +8,51 @@ # #
-# +$host.ui.RawUI.WindowTitle = "ReactOS Build Environment $_ROSBE_VERSION" + # Set defaults to work with and override them if edited by the options utility. -# (Get-Host).UI.RawUI.ForegroundColor = "Green" (Get-Host).UI.RawUI.BackgroundColor = "Black" clear-host
+# For NT4 compatibility if ($ENV:APPDATA.Length -lt 1) { $ENV:APPDATA = $ENV:USERPROFILE } -$global:_ROSBE_VERSION = "1.4.2" + +# Set defaults to work with and override them if edited by +# the options utility. +if ("$ENV:ROS_ARCH" -eq "") { + set $ENV:ROS_ARCH = "i386" +} else { + set $ENV:ROS_ARCH = "$args[1]" +} + $global:0 = $myInvocation.MyCommand.Definition $global:_ROSBE_BASEDIR = [System.IO.Path]::GetDirectoryName($0) -$global:_ROSBE_MODE = "RosBE" +$global:_ROSBE_VERSION = "1.4.2" $global:_ROSBE_ROSSOURCEDIR = "$pwd" -$global:_ROSBE_ORIGINALPATH = "$ENV:PATH" $global:_ROSBE_SHOWTIME = 1 $global:_ROSBE_WRITELOG = 1 $global:_ROSBE_USECCACHE = 0 $global:_ROSBE_STRIP = 0 $global:_ROSBE_NOSTRIP = 0 +$global:_ROSBE_LOGDIR = "$pwd\RosBE-Logs" +$global:_ROSBE_OBJPATH = $null +$global:_ROSBE_OUTPATH = $null $global:_ROSBE_HOST_MINGWPATH = "$_ROSBE_BASEDIR\i386" $global:_ROSBE_TARGET_MINGWPATH = "$_ROSBE_BASEDIR\i386" -$global:_ROSBE_LOGDIR = "$_ROSBE_ROSSOURCEDIR\RosBE-Logs" -$global:_ROSBE_OBJPATH = $null -$global:_ROSBE_OUTPATH = $null +$global:_ROSBE_ORIGINALPATH = "$ENV:PATH" +$global:_ROSBE_MINGWMAKE = "$_ROSBE_HOST_MINGWPATH\bin\mingw32-make.exe" + +# Get the number of CPUs in the system so we know how many jobs to execute. +# To modify the number used, see the cpucount usage for getting to know about the possible options +$_ROSBE_MAKEX_JOBS = (gwmi win32_processor).numberofcores + 1 + +$ENV:CCACHE_DIR = "$ENV:APPDATA\RosBE.ccache" +$ENV:C_INCLUDE_PATH = $null +$ENV:CPLUS_INCLUDE_PATH = $null +$ENV:LIBRARY_PATH = $null
function global:Get-WebFile { param( @@ -46,28 +65,8 @@ $local:ErrorActionPreference = "Continue" }
-# -# Display the banner and set up the environment for the GCC 4.x.x build -# environment. -# -function RosBE { - "*******************************************************************************" - "* *" - "* ReactOS Build Environment $_ROSBE_VERSION *" - "* *" - "*******************************************************************************" - "" - # - # Set the correct path for the build tools and set the MinGW make. - # - & "$_ROSBE_BASEDIR\rosbe-gcc-env.ps1" -} - -# # Load the doskey macros and delete any macros for components # that are not actually present. -# - function LoadAliases { function global:BASEDIR { set-location "$_ROSBE_ROSSOURCEDIR" @@ -118,68 +117,55 @@ } }
-# # Check if RosBE data directory exists, if not, create it. -# if (!(Test-Path "$ENV:APPDATA\RosBE")) { New-Item -path "$ENV:APPDATA" -name "RosBE" -type directory }
-# -# Check if the user has used the options utility and if so, load their options. -# +# Load the user's options if any if (Test-Path "$ENV:APPDATA\RosBE\rosbe-options.ps1") { & "$ENV:APPDATA\RosBE\rosbe-options.ps1" }
-# arch specific settings. if (Test-Path "$ENV:APPDATA\RosBE\rosbe-options-$args.ps1") { & "$ENV:APPDATA\RosBE\rosbe-options-$args.ps1" }
-$host.ui.RawUI.WindowTitle = "ReactOS Build Environment $_ROSBE_VERSION" - -# -# Check if we are using oldmode or if any unknown parameters were specified. -# -if ($args.count -gt 0) { - if ($args -eq "oldmode") { - clear-host - $_ROSBE_MODE = "MinGW" - } else { - clear-host - $_ROSBE_ARCH = $args +# Check if writing logs is enabled, if so check if our log directory +# exists, if it doesn't, create it. +if ($_ROSBE_WRITELOG -eq 1) { + if (!(Test-Path "$_ROSBE_LOGDIR")) { + New-Item -path "$_ROSBE_LOGDIR" -type directory } } -RosBE
-# -# Load the base directory from srclist.txt and set it as the new source -# directory. -# +# Load the doskey macros that serve as our commands. +LoadAliases + +& "$_ROSBE_BASEDIR\rosbe-gcc-env.ps1" + +clear-screen +"*******************************************************************************" +"* *" +"* ReactOS Build Environment $_ROSBE_VERSION *" +"* *" +"*******************************************************************************" +"" + +# Load the base directory from srclist.txt and set it as the +# new source directory. if (Test-Path "$_ROSBE_BASEDIR\scut.ps1") { & "$_ROSBE_BASEDIR\scut.ps1" }
-# # Tell how to display the available commands. -# "" "For a list of all included commands, type: ""help""" "-------------------------------------------------" "" -# IEX "'$_ROSBE_BASEDIR\sSVN.ps1' status" -# ""
-# -# Load the doskey macros that serve as our commands. -# -LoadAliases - -# -# Look if the ReactOS source directory is empty. If so, inform the user and -# mention 'ssvn create' (only if ssvn is installed). -# +# Look if the ReactOS source directory is empty. If so, +# inform the user and mention 'ssvn create' (only if ssvn is installed). if (!(Test-Path "$_ROSBE_BASEDIR\sSVN.ps1")) { if ((get-childitem $_ROSBE_ROSSOURCEDIR).Count -le 0) { "No ReactOS source detected. Please use ""ssvn create"" to download it."
Modified: trunk/tools/RosBE/RosBE-Windows/Powershell/charch.ps1 URL: http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/RosBE-Windows/Powershel... ============================================================================== --- trunk/tools/RosBE/RosBE-Windows/Powershell/charch.ps1 [iso-8859-1] (original) +++ trunk/tools/RosBE/RosBE-Windows/Powershell/charch.ps1 [iso-8859-1] Mon May 11 04:40:11 2009 @@ -8,47 +8,29 @@
$host.ui.RawUI.WindowTitle = "Change the Architecture to build for..."
-# -# Parse the command line arguments. -# ROSBE_ARCH: Default is i386, can be set to amd64, ppc or arm. -# - -# -# Refresh all needed Params by recalling the main Path setting CMD File. -# -function SYSPARAM { - - # arch specific settings. - if (Test-Path "$ENV:APPDATA\RosBE\rosbe-options-$_ROSBE_ARCH.ps1") { - IEX "& '$ENV:APPDATA\RosBE\rosbe-options-$_ROSBE_ARCH.ps1'" - } - - IEX "& '$_ROSBE_BASEDIR\rosbe-gcc-env.ps1'" - version -} if ($args.count -eq 0) { - # - # If Parameters were set, parse them, if not, ask the user to add them. - # - $_1 = Read-Host "Please enter a Architecture you want to build ReactOS for: " - if ($_1.length -eq 0) { + # Parse the command line arguments. + $ARCH = Read-Host "Please enter a Architecture you want to build ReactOS for: " + if ($ARCH.length -eq 0) { "ERROR: You must enter a Architecture." } } else { - $_1 = $args + $ARCH = $args } -if ($_1 -eq "i386") { - $_ROSBE_ARCH = $null -} else { - $_ROSBE_ARCH = $_1 + +# Modify ROS_ARCH for the current environment +$ENV:ROS_ARCH = $ARCH + +# Refresh all needed Params by recalling the main Path setting CMD File. +if (Test-Path "$ENV:APPDATA\RosBE\rosbe-options-$_ROSBE_ARCH.ps1") { + IEX "& '$ENV:APPDATA\RosBE\rosbe-options-$_ROSBE_ARCH.ps1'" } -SYSPARAM
-if ($_ROSBE_VERSION -ne $null) { - $host.ui.RawUI.WindowTitle = "ReactOS Build Environment $_ROSBE_VERSION" -} +chdefgcc $ENV:ROS_ARCH target + +$host.ui.RawUI.WindowTitle = "ReactOS Build Environment $_ROSBE_VERSION"
# # Unload all used Vars. # -$_1 = $null +$ARCH = $null
Modified: trunk/tools/RosBE/RosBE-Windows/Powershell/chdefdir.ps1 URL: http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/RosBE-Windows/Powershel... ============================================================================== --- trunk/tools/RosBE/RosBE-Windows/Powershell/chdefdir.ps1 [iso-8859-1] (original) +++ trunk/tools/RosBE/RosBE-Windows/Powershell/chdefdir.ps1 [iso-8859-1] Mon May 11 04:40:11 2009 @@ -10,36 +10,28 @@
$host.ui.RawUI.WindowTitle = "Change the current working ReactOS source directory..."
-# # Parse the command line arguments. -# if ($args.count -eq 0) { - # - # If Parameters were set, parse them, if not, ask the user to add them. - # - $_1 = Read-Host "Please enter a ReactOS source directory, or 'previous': " - if ($_1.length -eq 0) { + $SOURCEDIR = Read-Host "Please enter a ReactOS source directory, or 'previous': " + if ($SOURCEDIR.length -eq 0) { "ERROR: You must enter a ReactOS source directory, or 'previous'." } } else { - $_1 = $args + $SOURCEDIR = $args } -if ($_1 -eq "previous") { +if ($SOURCEDIR -eq "previous") { pop-location } else { - if (!(Test-Path "$_1.")) { + if (!(Test-Path "$SOURCEDIR.")) { "ERROR: The path specified doesn't seem to exist." - } - push-location "$_1" + push-location "$SOURCEDIR" } + $global:_ROSBE_ROSSOURCEDIR = "$pwd" - -if ($_ROSBE_VERSION -ne $null) { - $host.ui.RawUI.WindowTitle = "ReactOS Build Environment $_ROSBE_VERSION" -} +$host.ui.RawUI.WindowTitle = "ReactOS Build Environment $_ROSBE_VERSION"
# # Unload all used Vars. # -$_1 = $null +$SOURCEDIR = $null
Modified: trunk/tools/RosBE/RosBE-Windows/Powershell/chdefgcc.ps1 URL: http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/RosBE-Windows/Powershel... ============================================================================== --- trunk/tools/RosBE/RosBE-Windows/Powershell/chdefgcc.ps1 [iso-8859-1] (original) +++ trunk/tools/RosBE/RosBE-Windows/Powershell/chdefgcc.ps1 [iso-8859-1] Mon May 11 04:40:11 2009 @@ -6,61 +6,57 @@ # COPYRIGHT: Copyright 2009 Daniel Reimer reimer.daniel@freenet.de #
-if ($_ROSBE_MODE -eq "RosBE") { - $host.ui.RawUI.WindowTitle = "Change the current MinGW/GCC Host/Target directory..." -} +$host.ui.RawUI.WindowTitle = "Change the current MinGW/GCC Host/Target directory..."
function settitle { - if ($_ROSBE_VERSION -ne $null) { - $host.ui.RawUI.WindowTitle = "ReactOS Build Environment $_ROSBE_VERSION" - } + $host.ui.RawUI.WindowTitle = "ReactOS Build Environment $_ROSBE_VERSION" exit }
function EOA { - IEX "&'$_ROSBE_BASEDIR\rosbe-gcc-env.cmd' chdefgcc" + IEX "&'$_ROSBE_BASEDIR\rosbe-gcc-env.cmd'" + version settitle - version }
-# -# Parse the command line arguments. -# -$_1 = $args[0] -$_2 = $args[1] -if ($_1 -eq $null) { - $_1 = Read-Host "Please enter a MinGW/GCC directory (don't use quotes): " - if ($_1.length -eq 0) { +# Parse the command line arguments. Ask the user if certain parameters are missing. +$TOOLPATH = $args[0] +$TOOLMODE = $args[1] +if ($TOOLPATH -eq $null) { + $TOOLPATH = Read-Host "Please enter a MinGW/GCC directory (don't use quotes): " + if ($TOOLPATH.length -eq 0) { "ERROR: You must enter a MinGW/GCC directory." settitle } } -if ($_2 -eq $null) { - $_2 = Read-Host "Please specify, if this will be the Target or Host GCC: " - if ($_2.length -eq 0) { +if ($TOOLMODE -eq $null) { + $TOOLMODE = Read-Host "Please specify, if this will be the Target or Host GCC: " + if ($TOOLMODE.length -eq 0) { "ERROR: You must enter ""target"" or ""host""." settitle } } -if (Test-Path "$_ROSBE_BASEDIR$_1.") { - $_1 = "$_ROSBE_BASEDIR$_1" -} elseif (!(Test-Path "$_1.")) { + +# Verify the entered values +if (Test-Path "$_ROSBE_BASEDIR$TOOLPATH.") { + $TOOLPATH = "$_ROSBE_BASEDIR$TOOLPATH" +} elseif (!(Test-Path "$TOOLPATH.")) { "ERROR: The path specified doesn't seem to exist." settitle }
-if (!(Test-Path "$_1\bin*gcc.exe")) { +if (!(Test-Path "$TOOLPATH\bin*gcc.exe")) { "ERROR: No MinGW/GCC found in the specified path." settitle }
-if ($_2 -eq "target") { - $_ROSBE_TARGET_MINGWPATH = $_1 +# Set the values +if ($TOOLMODE -eq "target") { + $_ROSBE_TARGET_MINGWPATH = $TOOLPATH "Target Location: $_ROSBE_TARGET_MINGWPATH" EOA -} -if ($_2 -eq "host") { - $_ROSBE_HOST_MINGWPATH = $_1 +} elseif ($TOOLMODE -eq "host") { + $_ROSBE_HOST_MINGWPATH = $TOOLPATH "Host Location: $_ROSBE_HOST_MINGWPATH" EOA } else { @@ -71,5 +67,5 @@ # # Unload all used Vars. # -$_1 = $null -$_2 = $null +$TOOLPATH = $null +$TOOLMODE = $null
Modified: trunk/tools/RosBE/RosBE-Windows/Powershell/options.ps1 URL: http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/RosBE-Windows/Powershel... ============================================================================== --- trunk/tools/RosBE/RosBE-Windows/Powershell/options.ps1 [iso-8859-1] (original) +++ trunk/tools/RosBE/RosBE-Windows/Powershell/options.ps1 [iso-8859-1] Mon May 11 04:40:11 2009 @@ -18,9 +18,7 @@ $cfgfile="$ENV:APPDATA\RosBE\rosbe-options.cmd" }
-# # Run options.exe -#
if (Test-Path "$options") { Push-Location "$_ROSBE_BASEDIR" @@ -33,9 +31,7 @@ "ERROR: options executable was not found." }
-if ($_ROSBE_VERSION -ne $null) { - $host.ui.RawUI.WindowTitle = "ReactOS Build Environment $_ROSBE_VERSION" -} +$host.ui.RawUI.WindowTitle = "ReactOS Build Environment $_ROSBE_VERSION"
$options = $null $cfgfile = $null
Modified: trunk/tools/RosBE/RosBE-Windows/Powershell/reladdr2line.ps1 URL: http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/RosBE-Windows/Powershel... ============================================================================== --- trunk/tools/RosBE/RosBE-Windows/Powershell/reladdr2line.ps1 [iso-8859-1] (original) +++ trunk/tools/RosBE/RosBE-Windows/Powershell/reladdr2line.ps1 [iso-8859-1] Mon May 11 04:40:11 2009 @@ -9,69 +9,48 @@
$host.ui.RawUI.WindowTitle = "reladdr2line..."
-# -# Check if the user supplied a path, if they didn't look for -# the specified file in the current directory and any -# sub-directories. -# -function CHECKPATH { - if ($_1.Contains("")) { - $_1 = get-childitem "$_1*" -name -recurse 2>NUL | select-string "$_1" +# Receive all parameters. +$FILEPATH = $args[0] +$ADDRESS = $args[1] +if ($args.length -lt 1) { + if ($FILEPATH -eq $null) { + $FILEPATH = Read-Host "Please enter the path/file to be examined: " + if ($FILEPATH.Contains("")) { + $FILEPATH = get-childitem "$FILEPATH*" -name -recurse 2>NUL | select-string "$FILEPATH" + } + } +} +elseif ($args.length -lt 2) { + if ($ADDRESS -eq $null) { + $ADDRESS = Read-Host "Please enter the address you would like to analyze: " } }
-# -# Receive the Parameters and decide what to do. -# -$_1 = $args[0] -$_2 = $args[1] -if ($args.length -gt 2) { - "ERROR: Too many parameters specified." -} -elseif ($args.length -lt 1) { - if ($_1 -eq $null) { - $_1 = Read-Host "Please enter the path/file to be examined: " - CHECKPATH - } -} -elseif ($args.length -lt 2) { - if ($_2 -eq $null) { - $_2 = Read-Host "Please enter the address you would like to analyze: " - } -} - -# -# First get the ImageBase of the File. If its smaller than the given -# Parameter, everything is ok, because it was already added onto the -# adress and can be given directly to raddr2line. If not, add it and -# give the result to raddr2line. -# -if ($_1 -eq $null) { +# Check if parameters were really given +if ($FILEPATH -eq $null) { "ERROR: You must specify a path/file to examine." } -if ($_2 -eq $null) { +if ($ADDRESS -eq $null) { "ERROR: You must specify a address to analyze." }
-$baseaddr = (objdump -p $_1 | select-string "ImageBase").tostring().split() +$baseaddr = (objdump -p $FILEPATH | select-string "ImageBase").tostring().split() $baseaddr = "0x" + ($baseaddr.get($baseaddr.length - 1))
-if ($baseaddr -lt $_2) { - IEX "& '$_ROSBE_BASEDIR\Tools\raddr2line.exe' '$_1' '$_2'" +if ($baseaddr -lt $ADDRESS) { + IEX "& '$_ROSBE_BASEDIR\Tools\raddr2line.exe' '$FILEPATH' '$ADDRESS'" } else { - $baseaddr = ($baseaddr | % {[Convert]::ToInt32($_,16)}) + ($_2 | % {[Convert]::ToInt32($_,16)}) + $baseaddr = ($baseaddr | % {[Convert]::ToInt32($_,16)}) + ($ADDRESS | % {[Convert]::ToInt32($_,16)}) $relbase = "0x" + ("{0:X}" -f $baseaddr) - IEX "& '$_ROSBE_BASEDIR\Tools\raddr2line.exe' '$_1' '$relbase'" + IEX "& '$_ROSBE_BASEDIR\Tools\raddr2line.exe' '$FILEPATH' '$relbase'" }
-if ($_ROSBE_VERSION -ne $null) { - $host.ui.RawUI.WindowTitle = "ReactOS Build Environment $_ROSBE_VERSION" -} +$host.ui.RawUI.WindowTitle = "ReactOS Build Environment $_ROSBE_VERSION"
# # Unload all used Vars. # -$_1 = $null -$_2 = $null +$FILEPATH = $null +$ADDRESS = $null $baseaddr = $null $relbase = $null
Modified: trunk/tools/RosBE/RosBE-Windows/Powershell/rosbe-gcc-env.ps1 URL: http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/RosBE-Windows/Powershel... ============================================================================== --- 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] Mon May 11 04:40:11 2009 @@ -7,105 +7,24 @@ # #
-# -# Check if we are running within the RosBE, and if not initialize GCC for the -# current directory. -# -if ($_ROSBE_HOST_MINGWPATH -eq $null) { - $_ROSBE_MODE = "MinGW" - $_ROSBE_HOST_MINGWPATH = "$pwd" - $_ROSBE_ORIGINALPATH = "$ENV:PATH" +# Check if we're switching to the AMD64 architecture +if ("$ENV:ROS_ARCH" -eq "amd64") { + $ENV:ROS_PREFIX = "x86_64-pc-mingw32-" +} else { + $ENV:ROS_PREFIX = $null }
+$ENV:PATH = "$_ROSBE_TARGET_MINGWPATH\bin;$_ROSBE_ORIGINALPATH"
-# -# Set the Arch Variables -# - -$ENV:ROS_ARCH = $null -$ENV:ROS_PREFIX = $null -$_ROSBE_OBJPATH = "$_ROSBE_i386_OBJPATH" -$_ROSBE_OUTPATH = "$_ROSBE_i386_OUTPATH" - - -if ($_ROSBE_ARCH -ne $null) { - $ENV:ROS_ARCH = $_ROSBE_ARCH - $ENV:ROS_PREFIX = "$_ROSBE_ARCH-pc-mingw32" - $_ROSBE_TARGET_MINGWPATH = "$_ROSBE_BASEDIR$_ROSBE_ARCH" - - # HAXX - if ($_ROSBE_ARCH -eq "arm") { - $_ROSBE_OBJPATH = "$_ROSBE_ARM_OBJPATH" - $_ROSBE_OUTPATH = "$_ROSBE_ARM_OUTPATH" - } - if ($_ROSBE_ARCH -eq "ppc") { - $_ROSBE_OBJPATH = "$_ROSBE_PPC_OBJPATH" - $_ROSBE_OUTPATH = "$_ROSBE_PPC_OUTPATH" - } - if ($_ROSBE_ARCH -eq "amd64") { - $_ROSBE_OBJPATH = "$_ROSBE_AMD64_OBJPATH" - $_ROSBE_OUTPATH = "$_ROSBE_AMD64_OUTPATH" - $ENV:ROS_PREFIX = "x86_64-pc-mingw32" - $_ROSBE_TARGET_MINGWPATH = "$_ROSBE_BASEDIR\x86_64" - } - - # Check if existant arch - - if (Test-Path "$_ROSBE_TARGET_MINGWPATH.") { - "Unsupported arch specified. Fallback to Default." - pause - $_ROSBE_OBJPATH = "$_ROSBE_i386_OBJPATH" - $_ROSBE_OUTPATH = "$_ROSBE_i386_OUTPATH" - $ENV:ROS_ARCH = $null - $ENV:ROS_PREFIX = $null - $_ROSBE_TARGET_MINGWPATH = $null - } -} - -# -# Set up the GCC 4.x.x build environment. -# -$ENV:PATH = "$_ROSBE_HOST_MINGWPATH\bin;$_ROSBE_TARGET_MINGWPATH\bin;$_ROSBE_ORIGINALPATH" -$global:_ROSBE_MINGWMAKE = "$_ROSBE_HOST_MINGWPATH\bin\mingw32-make.exe" - -if ($ENV:ROS_ARCH -ne $null) { - & "$ENV:ROS_PREFIX-gcc" -v 2> gcctvers.tmp - $global:_ROSBE_GCCVERSION = (select-string -path .\gcctvers.tmp "gcc version") -replace ".*version ((\d|.)+).*",'$1' - $global:_ROSBE_GCCTARGET = (select-string -path .\gcctvers.tmp "target=") -replace ".*--target=(.+?)\b.*",'$1' -} else { - gcc -v 2> gcctvers.tmp - $global:_ROSBE_GCCVERSION = (select-string -path .\gcctvers.tmp "gcc version") -replace ".*version ((\d|.)+).*",'$1' - $global:_ROSBE_GCCTARGET = (select-string -path .\gcctvers.tmp "target=") -replace ".*--target=(.+?)\b.*",'$1' -} +& "$ENV:ROS_PREFIXgcc" -v 2> gcctvers.tmp +$global:_ROSBE_TARGET_GCCVERSION = (select-string -path .\gcctvers.tmp "gcc version") -replace ".*version ((\d|.)+).*",'$1' +$global:_ROSBE_TARGET_GCCTARGET = (select-string -path .\gcctvers.tmp "target=") -replace ".*--target=(.+?)\b.*",'$1' gcc -v 2> gcchvers.tmp $global:_ROSBE_HOST_GCCVERSION = (select-string -path .\gcchvers.tmp "gcc version") -replace ".*version ((\d|.)+).*",'$1' $global:_ROSBE_HOST_GCCTARGET = (select-string -path .\gcchvers.tmp "target=") -replace ".*--target=(.+?)\b.*",'$1' remove-item gcchvers.tmp
-if ($_ROSBE_MODE -eq "MinGW") { - $ENV:C_INCLUDE_PATH = "$_ROSBE_HOST_MINGWPATH\include;$_ROSBE_HOST_MINGWPATH\lib\gcc$_ROSBE_GCCTARGET$_ROSBE_GCCVERSION\include" - $ENV: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" - $ENV:ROSBE_HOST_CFLAGS = $null - $ENV:ROSBE_HOST_CXXFLAGS = $null - $ENV:ROSBE_TARGET_CFLAGS = $null - $ENV:ROSBE_TARGET_CXXFLAGS = $null -} else { - $ENV:C_INCLUDE_PATH = $null - $ENV:CPLUS_INCLUDE_PATH = $null - $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""" -} -if ($_ROSBE_HOST_GCCVERSION -eq "3.4.5") { - $ENV:PATH = "$_ROSBE_BASEDIR\3.4.5\bin;$_ROSBE_BASEDIR\3.4.5\libexec\gcc\mingw32\3.4.5;$ENV:PATH" - $_ROSBE_MINGWMAKE = "$_ROSBE_BASEDIR\3.4.5\bin\mingw32-make.exe" - # Set all paths (needed by Windows Vista) - $ENV:C_INCLUDE_PATH = "$_ROSBE_BASEDIR\3.4.5\include;$_ROSBE_BASEDIR\3.4.5\lib\gcc\mingw32\3.4.5\include" - $ENV:CPLUS_INCLUDE_PATH = "$_ROSBE_BASEDIR\3.4.5\include;$_ROSBE_BASEDIR\3.4.5\include\c++\3.4.5;$_ROSBE_BASEDIR\3.4.5\include\c++\3.4.5\mingw32;$_ROSBE_BASEDIR\3.4.5\lib\gcc\mingw32\3.4.5\include" - $ENV:LIBRARY_PATH = "$_ROSBE_BASEDIR\3.4.5\lib;$_ROSBE_BASEDIR\3.4.5\lib\gcc\mingw32\3.4.5" - $ENV:ROSBE_HOST_CFLAGS = $null - $ENV:ROSBE_HOST_CXXFLAGS = $null - $ENV:ROSBE_TARGET_CFLAGS = $null - $ENV:ROSBE_TARGET_CXXFLAGS = $null -} +$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"""
Modified: trunk/tools/RosBE/RosBE-Windows/Powershell/sSVN.ps1 URL: http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/RosBE-Windows/Powershel... ============================================================================== --- trunk/tools/RosBE/RosBE-Windows/Powershell/sSVN.ps1 [iso-8859-1] (original) +++ trunk/tools/RosBE/RosBE-Windows/Powershell/sSVN.ps1 [iso-8859-1] Mon May 11 04:40:11 2009 @@ -47,16 +47,12 @@ } }
-# # Receive the first parameter and decide what to do. -# if ($args[0] -eq $null) { "No parameter specified. Try 'help [COMMAND]'." }
-# # These two are directly parsed to svn. -# elseif ($args[0] -eq "update") { $host.ui.RawUI.WindowTitle = "SVN Updating..." "This might take a while, so please be patient." @@ -71,9 +67,7 @@ IEX "&'$_ROSBE_BASEDIR\Tools\svn.exe' cleanup" }
-# # Check if the folder is empty. If not, output an error. -# elseif ($args[0] -eq "create") { $host.ui.RawUI.WindowTitle = "SVN Creating..." if (Test-Path ".svn.") { @@ -88,10 +82,8 @@ } }
-# # Output the revision of the local and online trees and tell the user if # its up to date or not. -# elseif ($args[0] -eq "status") { $host.ui.RawUI.WindowTitle = "SVN Status" "This might take a while, so please be patient." @@ -104,9 +96,7 @@ "Unknown parameter specified. Try 'help ssvn'." }
-if ($_ROSBE_VERSION -ne $null) { - $host.ui.RawUI.WindowTitle = "ReactOS Build Environment $_ROSBE_VERSION" -} +$host.ui.RawUI.WindowTitle = "ReactOS Build Environment $_ROSBE_VERSION"
# # Unload all used Vars.
Modified: trunk/tools/RosBE/RosBE-Windows/Powershell/scut.ps1 URL: http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/RosBE-Windows/Powershel... ============================================================================== --- trunk/tools/RosBE/RosBE-Windows/Powershell/scut.ps1 [iso-8859-1] (original) +++ trunk/tools/RosBE/RosBE-Windows/Powershell/scut.ps1 [iso-8859-1] Mon May 11 04:40:11 2009 @@ -33,9 +33,7 @@ elseif ($args[0] -eq "--help") {paramcall($args)} else {parse($args)}
-if ($_ROSBE_VERSION -ne $null) { - $host.ui.RawUI.WindowTitle = "ReactOS Build Environment $_ROSBE_VERSION" -} +$host.ui.RawUI.WindowTitle = "ReactOS Build Environment $_ROSBE_VERSION"
# # Unload all used Vars.
Modified: trunk/tools/RosBE/RosBE-Windows/Powershell/update.ps1 URL: http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/RosBE-Windows/Powershel... ============================================================================== --- trunk/tools/RosBE/RosBE-Windows/Powershell/update.ps1 [iso-8859-1] (original) +++ trunk/tools/RosBE/RosBE-Windows/Powershell/update.ps1 [iso-8859-1] Mon May 11 04:40:11 2009 @@ -7,16 +7,11 @@ # #
-# -# Set Title -# $host.ui.RawUI.WindowTitle = "Updating..."
function EOC { set-location "$_ROSBE_OPATH" - if ($_ROSBE_VERSION -ne $null) { - $host.ui.RawUI.WindowTitle = "ReactOS Build Environment $_ROSBE_VERSION" - } + $host.ui.RawUI.WindowTitle = "ReactOS Build Environment $_ROSBE_VERSION" exit }
@@ -64,14 +59,10 @@ } }
-# # The Update Server. -# -$_ROSBE_URL = "http://danielreimer.5x.to/rosbe" +$_ROSBE_URL = "http://dreimer.dr.funpic.org/rosbe"
-# # Save the recent dir to cd back there at the end. -# $_ROSBE_OPATH = "$pwd"
if (!(Test-Path "$_ROSBE_BASEDIR\Tools\7z.exe")) { @@ -82,9 +73,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) { @@ -96,15 +85,15 @@ remove-item update.ps1 -force rename-item update2.ps1 update.ps1 } -# # Get to the Updates Subfolder. -# if (!(Test-Path "$ENV:APPDATA\RosBE\Updates")) {New-Item -path "$ENV:APPDATA\RosBE" -name "Updates" -type directory} set-location "$ENV:APPDATA\RosBE\Updates"
-# # Parse the args. -# + +$arg1 = $args[0] +$arg2 = $args[1] + if ("$args" -eq "") { $_ROSBE_MULTIUPD = 1 $_ROSBE_STATCOUNT = 1 @@ -112,27 +101,17 @@ UPDCHECK $_ROSBE_STATCOUNT += 1 } - EOC -} -if ("$args" -eq "reset") { +} elseif ("$args" -eq "reset") { remove-item "$ENV:APPDATA\RosBE\Updates*.*" -force -recurse -EA SilentlyContinue remove-item "$ENV:APPDATA\RosBE\Updates\tmp*.*" -force -recurse -EA SilentlyContinue - EOC -} -$arg1 = $args[0] -$arg2 = $args[1] -if ("$arg1" -eq "nr") { +} elseif ("$arg1" -eq "nr") { $_ROSBE_STATCOUNT = $arg2 UPDCHECK - EOC -} -if ("$arg1" -eq "delete") { +} elseif ("$arg1" -eq "delete") { $_ROSBE_STATCOUNT = $arg2 remove-item "$ENV:APPDATA\RosBE\Updates$_ROSBE_VERSION-$_ROSBE_STATCOUNT.*" -force -recurse -EA SilentlyContinue remove-item "$ENV:APPDATA\RosBE\Updates\tmp$_ROSBE_VERSION-$_ROSBE_STATCOUNT.*" -force -recurse -EA SilentlyContinue - EOC -} -if ("$arg1" -eq "info") { +} elseif ("$arg1" -eq "info") { $_ROSBE_STATCOUNT = $arg2 set-location tmp if (!(Test-path "$_ROSBE_VERSION-$_ROSBE_STATCOUNT.txt")) { @@ -145,11 +124,7 @@ } set-location .. remove-item "tmp*.*" -force -EA SilentlyContinue - EOC -} -$arg1 = $null -$arg2 = $null -if ("$args" -eq "status") { +} elseif ("$args" -eq "status") { $_ROSBE_STATCOUNT = 1 if (!(test-path "tmp")) {New-Item -name "tmp" -type directory} copy-item *.txt .\tmp. @@ -170,13 +145,12 @@ } else { "RosBE is up to Date." } - EOC -} -if ("$args" -ne "") { +} else { "Unknown parameter specified. Try 'help update'." - EOC }
+$arg1 = $null +$arg2 = $null $_ROSBE_UPDFINISH = $null $_ROSBE_OPATH = $null $_ROSBE_UPDDATE = $null @@ -184,3 +158,4 @@ $_ROSBE_UPDDATE2 = $null $_ROSBE_MULTIUPD = $null $_ROSBE_STATCOUNT = $null +EOC
Modified: trunk/tools/RosBE/RosBE-Windows/Powershell/version.ps1 URL: http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/RosBE-Windows/Powershel... ============================================================================== --- trunk/tools/RosBE/RosBE-Windows/Powershell/version.ps1 [iso-8859-1] (original) +++ trunk/tools/RosBE/RosBE-Windows/Powershell/version.ps1 [iso-8859-1] Mon May 11 04:40:11 2009 @@ -8,40 +8,24 @@
(get-WmiObject Win32_OperatingSystem).caption
+# GCC (select-string -path .\gcctvers.tmp "gcc version") -replace ".*: (.+?)\b",'$1' | % { $str = $_ -replace '^.*14:',''} $str "gcc target - $_ROSBE_GCCTARGET" remove-item gcctvers.tmp
-if ($ENV:ROS_ARCH -ne $null) { - & "$_ROSBE_TARGET_MINGWPATH\bin$ENV:ROS_PREFIX-ld" -v -} else { - & ld -v -} +# LD +& "$_ROSBE_TARGET_MINGWPATH\bin$ENV:ROS_PREFIXld" -v + +# NASM or YASM if (Test-Path "$_ROSBE_HOST_MINGWPATH\bin\nasm.exe") { & nasm -v } else { - if (Test-Path "$_ROSBE_HOST_MINGWPATH\bin\yasm.exe") { - & yasm --version | select-string "yasm 0" - } else { - if ($_ROSBE_MODE -eq "RosBE") { - "ERROR: NASM or YASM is required to build ReactOS, none was found in the current MinGW/GCC." - } - } + & yasm --version | select-string "yasm 0" } -if (Test-Path "$_ROSBE_HOST_MINGWPATH\bin\bison.exe") { - & bison '--version' | select-string "GNU Bison" -} else { - if ($_ROSBE_MODE -eq "RosBE") { - "WARNING: Bison will soon be required to build ReactOS, none was found in the current MinGW/GCC." - } -} -if (Test-Path "$_ROSBE_HOST_MINGWPATH\bin\flex.exe") { - $fver = (& flex '--version') -replace ".*version ((\d|.)+).*",'$1' - "flex $fver" -} else { - if ($_ROSBE_MODE -eq "RosBE") { - "WARNING: Flex will soon be required to build ReactOS, none was found in the current MinGW/GCC." - } -} + +# Bison, Flex and Make +& bison '--version' | select-string "GNU Bison" +$fver = (& flex '--version') -replace ".*version ((\d|.)+).*",'$1' +"flex $fver" & mingw32-make -v | & find "GNU Make"