summaryrefslogtreecommitdiffstats
path: root/PCbuild
diff options
context:
space:
mode:
authorZachary Ware <zachary.ware@gmail.com>2015-04-13 17:11:40 (GMT)
committerZachary Ware <zachary.ware@gmail.com>2015-04-13 17:11:40 (GMT)
commit774ac377daf0da8eaddc578d883cd2002cb7a6a4 (patch)
tree1f7931b0ce49dd62621846ba61ccf3f4280386bb /PCbuild
parent9c680b07285867844927871ddcbf60c93e786e1f (diff)
parent4c9c848159b63fac440c29ffc2b437e055d355cc (diff)
downloadcpython-774ac377daf0da8eaddc578d883cd2002cb7a6a4.zip
cpython-774ac377daf0da8eaddc578d883cd2002cb7a6a4.tar.gz
cpython-774ac377daf0da8eaddc578d883cd2002cb7a6a4.tar.bz2
Closes #17202: Merge with 3.4
Diffstat (limited to 'PCbuild')
-rw-r--r--PCbuild/build.bat86
-rw-r--r--PCbuild/build_env.bat2
-rw-r--r--PCbuild/build_pgo.bat96
-rw-r--r--PCbuild/clean.bat10
-rw-r--r--PCbuild/env.bat32
-rw-r--r--PCbuild/get_externals.bat206
-rw-r--r--PCbuild/idle.bat30
-rw-r--r--PCbuild/prepare_ssl.bat24
-rw-r--r--PCbuild/rt.bat116
9 files changed, 301 insertions, 301 deletions
diff --git a/PCbuild/build.bat b/PCbuild/build.bat
index 2846144..fa9f403 100644
--- a/PCbuild/build.bat
+++ b/PCbuild/build.bat
@@ -1,43 +1,43 @@
-@echo off
-rem A batch program to build or rebuild a particular configuration,
-rem just for convenience.
-
-rem Arguments:
-rem -c Set the configuration (default: Release)
-rem -p Set the platform (x64 or Win32, default: Win32)
-rem -r Target Rebuild instead of Build
-rem -t Set the target manually (Build, Rebuild, Clean, or CleanAll)
-rem -d Set the configuration to Debug
-rem -e Pull in external libraries using get_externals.bat
-rem -M Disable parallel build
-rem -v Increased output messages
-
-setlocal
-set platf=Win32
-set vs_platf=x86
-set conf=Release
-set target=Build
-set dir=%~dp0
-set parallel=/m
-set verbose=/nologo /v:m
-
-:CheckOpts
-if '%1'=='-c' (set conf=%2) & shift & shift & goto CheckOpts
-if '%1'=='-p' (set platf=%2) & shift & shift & goto CheckOpts
-if '%1'=='-r' (set target=Rebuild) & shift & goto CheckOpts
-if '%1'=='-t' (set target=%2) & shift & shift & goto CheckOpts
-if '%1'=='-d' (set conf=Debug) & shift & goto CheckOpts
-if '%1'=='-e' call "%dir%get_externals.bat" & shift & goto CheckOpts
-if '%1'=='-M' (set parallel=) & shift & goto CheckOpts
-if '%1'=='-v' (set verbose=/v:n) & shift & goto CheckOpts
-
-if '%platf%'=='x64' (set vs_platf=x86_amd64)
-
-rem Setup the environment
-call "%dir%env.bat" %vs_platf% >nul
-
-rem Call on MSBuild to do the work, echo the command.
-rem Passing %1-9 is not the preferred option, but argument parsing in
-rem batch is, shall we say, "lackluster"
-echo on
-msbuild "%dir%pcbuild.proj" /t:%target% %parallel% %verbose% /p:Configuration=%conf% /p:Platform=%platf% %1 %2 %3 %4 %5 %6 %7 %8 %9
+@echo off
+rem A batch program to build or rebuild a particular configuration,
+rem just for convenience.
+
+rem Arguments:
+rem -c Set the configuration (default: Release)
+rem -p Set the platform (x64 or Win32, default: Win32)
+rem -r Target Rebuild instead of Build
+rem -t Set the target manually (Build, Rebuild, Clean, or CleanAll)
+rem -d Set the configuration to Debug
+rem -e Pull in external libraries using get_externals.bat
+rem -M Disable parallel build
+rem -v Increased output messages
+
+setlocal
+set platf=Win32
+set vs_platf=x86
+set conf=Release
+set target=Build
+set dir=%~dp0
+set parallel=/m
+set verbose=/nologo /v:m
+
+:CheckOpts
+if '%1'=='-c' (set conf=%2) & shift & shift & goto CheckOpts
+if '%1'=='-p' (set platf=%2) & shift & shift & goto CheckOpts
+if '%1'=='-r' (set target=Rebuild) & shift & goto CheckOpts
+if '%1'=='-t' (set target=%2) & shift & shift & goto CheckOpts
+if '%1'=='-d' (set conf=Debug) & shift & goto CheckOpts
+if '%1'=='-e' call "%dir%get_externals.bat" & shift & goto CheckOpts
+if '%1'=='-M' (set parallel=) & shift & goto CheckOpts
+if '%1'=='-v' (set verbose=/v:n) & shift & goto CheckOpts
+
+if '%platf%'=='x64' (set vs_platf=x86_amd64)
+
+rem Setup the environment
+call "%dir%env.bat" %vs_platf% >nul
+
+rem Call on MSBuild to do the work, echo the command.
+rem Passing %1-9 is not the preferred option, but argument parsing in
+rem batch is, shall we say, "lackluster"
+echo on
+msbuild "%dir%pcbuild.proj" /t:%target% %parallel% %verbose% /p:Configuration=%conf% /p:Platform=%platf% %1 %2 %3 %4 %5 %6 %7 %8 %9
diff --git a/PCbuild/build_env.bat b/PCbuild/build_env.bat
index 4c67ae3..01024cf 100644
--- a/PCbuild/build_env.bat
+++ b/PCbuild/build_env.bat
@@ -1 +1 @@
-@%comspec% /k env.bat %*
+@%comspec% /k env.bat %*
diff --git a/PCbuild/build_pgo.bat b/PCbuild/build_pgo.bat
index 5988c0a..79ec267 100644
--- a/PCbuild/build_pgo.bat
+++ b/PCbuild/build_pgo.bat
@@ -1,48 +1,48 @@
-@echo off
-rem A batch program to build PGO (Profile guided optimization) by first
-rem building instrumented binaries, then running the testsuite, and
-rem finally building the optimized code.
-rem Note, after the first instrumented run, one can just keep on
-rem building the PGUpdate configuration while developing.
-
-setlocal
-set platf=Win32
-set parallel=/m
-set dir=%~dp0
-
-rem use the performance testsuite. This is quick and simple
-set job1="%dir%..\tools\pybench\pybench.py" -n 1 -C 1 --with-gc
-set path1="%dir%..\tools\pybench"
-
-rem or the whole testsuite for more thorough testing
-set job2="%dir%..\lib\test\regrtest.py"
-set path2="%dir%..\lib"
-
-set job=%job1%
-set clrpath=%path1%
-
-:CheckOpts
-if "%1"=="-p" (set platf=%2) & shift & shift & goto CheckOpts
-if "%1"=="-2" (set job=%job2%) & (set clrpath=%path2%) & shift & goto CheckOpts
-if "%1"=="-M" (set parallel=) & shift & goto CheckOpts
-
-
-rem We cannot cross compile PGO builds, as the optimization needs to be run natively
-set vs_platf=x86
-set PGO=%dir%win32-pgo
-
-if "%platf%"=="x64" (set vs_platf=amd64) & (set PGO=%dir%amd64-pgo)
-rem Setup the environment
-call "%dir%env.bat" %vs_platf%
-
-
-rem build the instrumented version
-msbuild "%dir%pcbuild.proj" %parallel% /t:Build /p:Configuration=PGInstrument /p:Platform=%platf% %1 %2 %3 %4 %5 %6 %7 %8 %9
-
-rem remove .pyc files, .pgc files and execute the job
-"%PGO%\python.exe" "%dir%rmpyc.py" %clrpath%
-del "%PGO%\*.pgc"
-"%PGO%\python.exe" %job%
-
-rem build optimized version
-msbuild "%dir%pcbuild.proj" %parallel% /t:Build /p:Configuration=PGUpdate /p:Platform=%platf% %1 %2 %3 %4 %5 %6 %7 %8 %9
+@echo off
+rem A batch program to build PGO (Profile guided optimization) by first
+rem building instrumented binaries, then running the testsuite, and
+rem finally building the optimized code.
+rem Note, after the first instrumented run, one can just keep on
+rem building the PGUpdate configuration while developing.
+
+setlocal
+set platf=Win32
+set parallel=/m
+set dir=%~dp0
+
+rem use the performance testsuite. This is quick and simple
+set job1="%dir%..\tools\pybench\pybench.py" -n 1 -C 1 --with-gc
+set path1="%dir%..\tools\pybench"
+
+rem or the whole testsuite for more thorough testing
+set job2="%dir%..\lib\test\regrtest.py"
+set path2="%dir%..\lib"
+
+set job=%job1%
+set clrpath=%path1%
+
+:CheckOpts
+if "%1"=="-p" (set platf=%2) & shift & shift & goto CheckOpts
+if "%1"=="-2" (set job=%job2%) & (set clrpath=%path2%) & shift & goto CheckOpts
+if "%1"=="-M" (set parallel=) & shift & goto CheckOpts
+
+
+rem We cannot cross compile PGO builds, as the optimization needs to be run natively
+set vs_platf=x86
+set PGO=%dir%win32-pgo
+
+if "%platf%"=="x64" (set vs_platf=amd64) & (set PGO=%dir%amd64-pgo)
+rem Setup the environment
+call "%dir%env.bat" %vs_platf%
+
+
+rem build the instrumented version
+msbuild "%dir%pcbuild.proj" %parallel% /t:Build /p:Configuration=PGInstrument /p:Platform=%platf% %1 %2 %3 %4 %5 %6 %7 %8 %9
+
+rem remove .pyc files, .pgc files and execute the job
+"%PGO%\python.exe" "%dir%rmpyc.py" %clrpath%
+del "%PGO%\*.pgc"
+"%PGO%\python.exe" %job%
+
+rem build optimized version
+msbuild "%dir%pcbuild.proj" %parallel% /t:Build /p:Configuration=PGUpdate /p:Platform=%platf% %1 %2 %3 %4 %5 %6 %7 %8 %9
diff --git a/PCbuild/clean.bat b/PCbuild/clean.bat
index 6144c71..78517d2 100644
--- a/PCbuild/clean.bat
+++ b/PCbuild/clean.bat
@@ -1,5 +1,5 @@
-@echo off
-rem A batch program to clean a particular configuration,
-rem just for convenience.
-
-call %~dp0build.bat -t Clean %*
+@echo off
+rem A batch program to clean a particular configuration,
+rem just for convenience.
+
+call %~dp0build.bat -t Clean %*
diff --git a/PCbuild/env.bat b/PCbuild/env.bat
index 9d4c9d1..2b2c005 100644
--- a/PCbuild/env.bat
+++ b/PCbuild/env.bat
@@ -1,16 +1,16 @@
-@echo off
-rem This script adds the latest available tools to the path for the current
-rem command window. However, most builds of Python will ignore the version
-rem of the tools on PATH and use PlatformToolset instead. Ideally, both sets of
-rem tools should be the same version to avoid potential conflicts.
-rem
-rem To build Python with an earlier toolset, pass "/p:PlatformToolset=v100" (or
-rem 'v110', 'v120' or 'v140') to the build script.
-
-echo Build environments: x86, amd64, x86_amd64
-echo.
-set VSTOOLS=%VS140COMNTOOLS%
-if "%VSTOOLS%"=="" set VSTOOLS=%VS120COMNTOOLS%
-if "%VSTOOLS%"=="" set VSTOOLS=%VS110COMNTOOLS%
-if "%VSTOOLS%"=="" set VSTOOLS=%VS100COMNTOOLS%
-call "%VSTOOLS%..\..\VC\vcvarsall.bat" %*
+@echo off
+rem This script adds the latest available tools to the path for the current
+rem command window. However, most builds of Python will ignore the version
+rem of the tools on PATH and use PlatformToolset instead. Ideally, both sets of
+rem tools should be the same version to avoid potential conflicts.
+rem
+rem To build Python with an earlier toolset, pass "/p:PlatformToolset=v100" (or
+rem 'v110', 'v120' or 'v140') to the build script.
+
+echo Build environments: x86, amd64, x86_amd64
+echo.
+set VSTOOLS=%VS140COMNTOOLS%
+if "%VSTOOLS%"=="" set VSTOOLS=%VS120COMNTOOLS%
+if "%VSTOOLS%"=="" set VSTOOLS=%VS110COMNTOOLS%
+if "%VSTOOLS%"=="" set VSTOOLS=%VS100COMNTOOLS%
+call "%VSTOOLS%..\..\VC\vcvarsall.bat" %*
diff --git a/PCbuild/get_externals.bat b/PCbuild/get_externals.bat
index a1d5225..f778eaa 100644
--- a/PCbuild/get_externals.bat
+++ b/PCbuild/get_externals.bat
@@ -1,103 +1,103 @@
-@echo off
-setlocal
-rem Simple script to fetch source for external libraries
-
-if not exist "%~dp0..\externals" mkdir "%~dp0..\externals"
-pushd "%~dp0..\externals"
-
-if "%SVNROOT%"=="" set SVNROOT=http://svn.python.org/projects/external/
-
-rem Optionally clean up first. Be warned that this can be very destructive!
-if not "%1"=="" (
- for %%c in (-c --clean --clean-only) do (
- if "%1"=="%%c" goto clean
- )
- goto usage
-)
-goto fetch
-
-:clean
-echo.Cleaning up external libraries.
-for /D %%d in (
- bzip2-*
- db-*
- nasm-*
- openssl-*
- tcl-*
- tcltk*
- tk-*
- tix-*
- sqlite-*
- xz-*
- ) do (
- echo.Removing %%d
- rmdir /s /q %%d
-)
-if "%1"=="--clean-only" (
- goto end
-)
-
-:fetch
-rem Fetch current versions
-
-svn --version > nul 2>&1
-if ERRORLEVEL 9009 (
- echo.svn.exe must be on your PATH.
- echo.Try TortoiseSVN (http://tortoisesvn.net/^) and be sure to check the
- echo.command line tools option.
- popd
- exit /b 1
-)
-
-echo.Fetching external libraries...
-
-for %%e in (
- bzip2-1.0.6
- nasm-2.11.06
- openssl-1.0.2a
- tcl-core-8.6.3.1
- tk-8.6.3.1
- tix-8.4.3.4
- sqlite-3.8.3.1
- xz-5.0.5
- ) do (
- if exist %%e (
- echo.%%e already exists, skipping.
- ) else (
- echo.Fetching %%e...
- svn export %SVNROOT%%%e
- )
-)
-
-goto end
-
-:usage
-echo.invalid argument: %1
-echo.usage: %~n0 [[ -c ^| --clean ] ^| --clean-only ]
-echo.
-echo.Pull all sources necessary for compiling optional extension modules
-echo.that rely on external libraries. Requires svn.exe to be on your PATH
-echo.and pulls sources from %SVNROOT%.
-echo.
-echo.Use the -c or --clean option to clean up all external library sources
-echo.before pulling in the current versions.
-echo.
-echo.Use the --clean-only option to do the same cleaning, without pulling in
-echo.anything new.
-echo.
-echo.Only the first argument is checked, all others are ignored.
-echo.
-echo.**WARNING**: the cleaning options unconditionally remove any directory
-echo.that is a child of
-echo. %CD%
-echo.and matches wildcard patterns beginning with bzip2-, db-, nasm-, openssl-,
-echo.tcl-, tcltk, tk-, tix-, sqlite-, or xz-, and as such has the potential
-echo.to be very destructive if you are not aware of what it is doing. Use with
-echo.caution!
-popd
-exit /b -1
-
-
-:end
-echo Finished.
-popd
+@echo off
+setlocal
+rem Simple script to fetch source for external libraries
+
+if not exist "%~dp0..\externals" mkdir "%~dp0..\externals"
+pushd "%~dp0..\externals"
+
+if "%SVNROOT%"=="" set SVNROOT=http://svn.python.org/projects/external/
+
+rem Optionally clean up first. Be warned that this can be very destructive!
+if not "%1"=="" (
+ for %%c in (-c --clean --clean-only) do (
+ if "%1"=="%%c" goto clean
+ )
+ goto usage
+)
+goto fetch
+
+:clean
+echo.Cleaning up external libraries.
+for /D %%d in (
+ bzip2-*
+ db-*
+ nasm-*
+ openssl-*
+ tcl-*
+ tcltk*
+ tk-*
+ tix-*
+ sqlite-*
+ xz-*
+ ) do (
+ echo.Removing %%d
+ rmdir /s /q %%d
+)
+if "%1"=="--clean-only" (
+ goto end
+)
+
+:fetch
+rem Fetch current versions
+
+svn --version > nul 2>&1
+if ERRORLEVEL 9009 (
+ echo.svn.exe must be on your PATH.
+ echo.Try TortoiseSVN (http://tortoisesvn.net/^) and be sure to check the
+ echo.command line tools option.
+ popd
+ exit /b 1
+)
+
+echo.Fetching external libraries...
+
+for %%e in (
+ bzip2-1.0.6
+ nasm-2.11.06
+ openssl-1.0.2a
+ tcl-core-8.6.3.1
+ tk-8.6.3.1
+ tix-8.4.3.4
+ sqlite-3.8.3.1
+ xz-5.0.5
+ ) do (
+ if exist %%e (
+ echo.%%e already exists, skipping.
+ ) else (
+ echo.Fetching %%e...
+ svn export %SVNROOT%%%e
+ )
+)
+
+goto end
+
+:usage
+echo.invalid argument: %1
+echo.usage: %~n0 [[ -c ^| --clean ] ^| --clean-only ]
+echo.
+echo.Pull all sources necessary for compiling optional extension modules
+echo.that rely on external libraries. Requires svn.exe to be on your PATH
+echo.and pulls sources from %SVNROOT%.
+echo.
+echo.Use the -c or --clean option to clean up all external library sources
+echo.before pulling in the current versions.
+echo.
+echo.Use the --clean-only option to do the same cleaning, without pulling in
+echo.anything new.
+echo.
+echo.Only the first argument is checked, all others are ignored.
+echo.
+echo.**WARNING**: the cleaning options unconditionally remove any directory
+echo.that is a child of
+echo. %CD%
+echo.and matches wildcard patterns beginning with bzip2-, db-, nasm-, openssl-,
+echo.tcl-, tcltk, tk-, tix-, sqlite-, or xz-, and as such has the potential
+echo.to be very destructive if you are not aware of what it is doing. Use with
+echo.caution!
+popd
+exit /b -1
+
+
+:end
+echo Finished.
+popd
diff --git a/PCbuild/idle.bat b/PCbuild/idle.bat
index 1978b99..bacaaa8 100644
--- a/PCbuild/idle.bat
+++ b/PCbuild/idle.bat
@@ -1,15 +1,15 @@
-@echo off
-rem start idle
-rem Usage: idle [-d]
-rem -d Run Debug build (python_d.exe). Else release build.
-
-setlocal
-set exe=win32\python
-PATH %PATH%;..\externals\tcltk\bin
-
-if "%1"=="-d" (set exe=%exe%_d) & shift
-
-set cmd=%exe% ../Lib/idlelib/idle.py %1 %2 %3 %4 %5 %6 %7 %8 %9
-
-echo on
-%cmd%
+@echo off
+rem start idle
+rem Usage: idle [-d]
+rem -d Run Debug build (python_d.exe). Else release build.
+
+setlocal
+set exe=win32\python
+PATH %PATH%;..\externals\tcltk\bin
+
+if "%1"=="-d" (set exe=%exe%_d) & shift
+
+set cmd=%exe% ../Lib/idlelib/idle.py %1 %2 %3 %4 %5 %6 %7 %8 %9
+
+echo on
+%cmd%
diff --git a/PCbuild/prepare_ssl.bat b/PCbuild/prepare_ssl.bat
index cb06500..c08a9f3 100644
--- a/PCbuild/prepare_ssl.bat
+++ b/PCbuild/prepare_ssl.bat
@@ -1,12 +1,12 @@
-@echo off
-if not defined HOST_PYTHON (
- if %1 EQU Debug (
- shift
- set HOST_PYTHON=python_d.exe
- if not exist python35_d.dll exit 1
- ) ELSE (
- set HOST_PYTHON=python.exe
- if not exist python35.dll exit 1
- )
-)
-%HOST_PYTHON% prepare_ssl.py %1
+@echo off
+if not defined HOST_PYTHON (
+ if %1 EQU Debug (
+ shift
+ set HOST_PYTHON=python_d.exe
+ if not exist python35_d.dll exit 1
+ ) ELSE (
+ set HOST_PYTHON=python.exe
+ if not exist python35.dll exit 1
+ )
+)
+%HOST_PYTHON% prepare_ssl.py %1
diff --git a/PCbuild/rt.bat b/PCbuild/rt.bat
index 5041cd3..039c810 100644
--- a/PCbuild/rt.bat
+++ b/PCbuild/rt.bat
@@ -1,58 +1,58 @@
-@echo off
-rem Run Tests. Run the regression test suite.
-rem Usage: rt [-d] [-O] [-q] [-x64] regrtest_args
-rem -d Run Debug build (python_d.exe). Else release build.
-rem -O Run python.exe or python_d.exe (see -d) with -O.
-rem -q "quick" -- normally the tests are run twice, the first time
-rem after deleting all the .py[co] files reachable from Lib/.
-rem -q runs the tests just once, and without deleting .py[co] files.
-rem -x64 Run the 64-bit build of python (or python_d if -d was specified)
-rem from the 'amd64' dir instead of the 32-bit build in this dir.
-rem All leading instances of these switches are shifted off, and
-rem whatever remains (up to 9 arguments) is passed to regrtest.py.
-rem For example,
-rem rt -O -d -x test_thread
-rem runs
-rem python_d -O ../lib/test/regrtest.py -x test_thread
-rem twice, and
-rem rt -q -g test_binascii
-rem runs
-rem python_d ../lib/test/regrtest.py -g test_binascii
-rem to generate the expected-output file for binascii quickly.
-rem
-rem Confusing: if you want to pass a comma-separated list, like
-rem -u network,largefile
-rem then you have to quote it on the rt line, like
-rem rt -u "network,largefile"
-
-setlocal
-
-set pcbuild=%~dp0
-set prefix=%pcbuild%win32\
-set suffix=
-set qmode=
-set dashO=
-
-:CheckOpts
-if "%1"=="-O" (set dashO=-O) & shift & goto CheckOpts
-if "%1"=="-q" (set qmode=yes) & shift & goto CheckOpts
-if "%1"=="-d" (set suffix=_d) & shift & goto CheckOpts
-if "%1"=="-x64" (set prefix=%pcbuild%amd64\) & shift & goto CheckOpts
-
-set exe=%prefix%python%suffix%.exe
-set cmd="%exe%" %dashO% -Wd -E -bb "%pcbuild%..\lib\test\regrtest.py" %1 %2 %3 %4 %5 %6 %7 %8 %9
-if defined qmode goto Qmode
-
-echo Deleting .pyc/.pyo files ...
-"%exe%" "%pcbuild%rmpyc.py"
-
-echo on
-%cmd%
-@echo off
-
-echo About to run again without deleting .pyc/.pyo first:
-pause
-
-:Qmode
-echo on
-%cmd%
+@echo off
+rem Run Tests. Run the regression test suite.
+rem Usage: rt [-d] [-O] [-q] [-x64] regrtest_args
+rem -d Run Debug build (python_d.exe). Else release build.
+rem -O Run python.exe or python_d.exe (see -d) with -O.
+rem -q "quick" -- normally the tests are run twice, the first time
+rem after deleting all the .py[co] files reachable from Lib/.
+rem -q runs the tests just once, and without deleting .py[co] files.
+rem -x64 Run the 64-bit build of python (or python_d if -d was specified)
+rem from the 'amd64' dir instead of the 32-bit build in this dir.
+rem All leading instances of these switches are shifted off, and
+rem whatever remains (up to 9 arguments) is passed to regrtest.py.
+rem For example,
+rem rt -O -d -x test_thread
+rem runs
+rem python_d -O ../lib/test/regrtest.py -x test_thread
+rem twice, and
+rem rt -q -g test_binascii
+rem runs
+rem python_d ../lib/test/regrtest.py -g test_binascii
+rem to generate the expected-output file for binascii quickly.
+rem
+rem Confusing: if you want to pass a comma-separated list, like
+rem -u network,largefile
+rem then you have to quote it on the rt line, like
+rem rt -u "network,largefile"
+
+setlocal
+
+set pcbuild=%~dp0
+set prefix=%pcbuild%win32\
+set suffix=
+set qmode=
+set dashO=
+
+:CheckOpts
+if "%1"=="-O" (set dashO=-O) & shift & goto CheckOpts
+if "%1"=="-q" (set qmode=yes) & shift & goto CheckOpts
+if "%1"=="-d" (set suffix=_d) & shift & goto CheckOpts
+if "%1"=="-x64" (set prefix=%pcbuild%amd64\) & shift & goto CheckOpts
+
+set exe=%prefix%python%suffix%.exe
+set cmd="%exe%" %dashO% -Wd -E -bb "%pcbuild%..\lib\test\regrtest.py" %1 %2 %3 %4 %5 %6 %7 %8 %9
+if defined qmode goto Qmode
+
+echo Deleting .pyc/.pyo files ...
+"%exe%" "%pcbuild%rmpyc.py"
+
+echo on
+%cmd%
+@echo off
+
+echo About to run again without deleting .pyc/.pyo first:
+pause
+
+:Qmode
+echo on
+%cmd%