| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,18 +1,107 @@ | |||
| 1 | 1 | @echo off | |
| 2 | - rem A batch program to build or rebuild a particular configuration. | ||
| 2 | + rem A batch program to build or rebuild a particular configuration, | ||
| 3 | 3 | rem just for convenience. | |
| 4 | 4 | ||
| 5 | + rem Arguments: | ||
| 6 | + rem -c Set the configuration (default: Release) | ||
| 7 | + rem -p Set the platform (x64 or Win32, default: Win32) | ||
| 8 | + rem -r Target Rebuild instead of Build | ||
| 9 | + rem -t Set the target manually (Build, Rebuild, or Clean) | ||
| 10 | + rem -d Set the configuration to Debug | ||
| 11 | + rem -e Pull in external libraries using get_externals.bat | ||
| 12 | + rem -k Attempt to kill any running Pythons before building | ||
| 13 | + | ||
| 5 | 14 | setlocal | |
| 6 | 15 | set platf=Win32 | |
| 16 | + set vs_platf=x86 | ||
| 7 | 17 | set conf=Release | |
| 8 | - set build= | ||
| 18 | + set target= | ||
| 19 | + set dir=%~dp0 | ||
| 20 | + set kill= | ||
| 21 | + set build_tkinter= | ||
| 9 | 22 | ||
| 10 | 23 | :CheckOpts | |
| 11 | - if "%1"=="-c" (set conf=%2) & shift & shift & goto CheckOpts | ||
| 12 | - if "%1"=="-p" (set platf=%2) & shift & shift & goto CheckOpts | ||
| 13 | - if "%1"=="-r" (set build=/rebuild) & shift & goto CheckOpts | ||
| 14 | - if "%1"=="-d" (set conf=Debug) & shift & goto CheckOpts | ||
| 15 | - | ||
| 16 | - set cmd=vcbuild /useenv pcbuild.sln %build% "%conf%|%platf%" | ||
| 17 | - echo %cmd% | ||
| 18 | - %cmd% | ||
| 24 | + if '%1'=='-c' (set conf=%2) & shift & shift & goto CheckOpts | ||
| 25 | + if '%1'=='-p' (set platf=%2) & shift & shift & goto CheckOpts | ||
| 26 | + if '%1'=='-r' (set target=/rebuild) & shift & goto CheckOpts | ||
| 27 | + if '%1'=='-t' ( | ||
| 28 | + if '%2'=='Clean' (set target=/clean) & shift & shift & goto CheckOpts | ||
| 29 | + if '%2'=='Rebuild' (set target=/rebuild) & shift & shift & goto CheckOpts | ||
| 30 | + if '%2'=='Build' (set target=) & shift & shift & goto CheckOpts | ||
| 31 | + echo.Unknown target: %2 & goto :eof | ||
| 32 | + ) | ||
| 33 | + if '%1'=='-d' (set conf=Debug) & shift & goto CheckOpts | ||
| 34 | + if '%1'=='-e' call "%dir%get_externals.bat" & (set build_tkinter=true) & shift & goto CheckOpts | ||
| 35 | + if '%1'=='-k' (set kill=true) & shift & goto CheckOpts | ||
| 36 | + | ||
| 37 | + if '%conf%'=='Debug' (set dbg_ext=_d) else (set dbg_ext=) | ||
| 38 | + if '%platf%'=='x64' ( | ||
| 39 | + set vs_platf=x86_amd64 | ||
| 40 | + set builddir=%dir%amd64\ | ||
| 41 | + ) else ( | ||
| 42 | + set builddir=%dir% | ||
| 43 | + ) | ||
| 44 | + rem Can't use builddir until we're in a new command... | ||
| 45 | + if '%platf%'=='x64' ( | ||
| 46 | + rem Needed for buliding OpenSSL | ||
| 47 | + set HOST_PYTHON=%builddir%python%dbg_ext%.exe | ||
| 48 | + ) | ||
| 49 | + | ||
| 50 | + rem Setup the environment | ||
| 51 | + call "%dir%env.bat" %vs_platf% | ||
| 52 | + | ||
| 53 | + if '%kill%'=='true' ( | ||
| 54 | + vcbuild "%dir%kill_python.vcproj" "%conf%|%platf%" && "%builddir%kill_python%dbg_ext%.exe" | ||
| 55 | + ) | ||
| 56 | + | ||
| 57 | + set externals_dir=%dir%..\externals | ||
| 58 | + if '%build_tkinter%'=='true' ( | ||
| 59 | + if '%platf%'=='x64' ( | ||
| 60 | + set tcltkdir=%externals_dir%\tcltk64 | ||
| 61 | + set machine=AMD64 | ||
| 62 | + ) else ( | ||
| 63 | + set tcltkdir=%externals_dir%\tcltk | ||
| 64 | + set machine=IX86 | ||
| 65 | + ) | ||
| 66 | + if '%conf%'=='Debug' ( | ||
| 67 | + set tcl_dbg_ext=g | ||
| 68 | + set debug_flag=1 | ||
| 69 | + ) else ( | ||
| 70 | + set tcl_dbg_ext= | ||
| 71 | + set debug_flag=0 | ||
| 72 | + ) | ||
| 73 | + set tcldir=%externals_dir%\tcl-8.5.15.0 | ||
| 74 | + set tkdir=%externals_dir%\tk-8.5.15.0 | ||
| 75 | + set tixdir=%externals_dir%\tix-8.4.3.5 | ||
| 76 | + ) | ||
| 77 | + if '%build_tkinter%'=='true' ( | ||
| 78 | + if not exist "%tcltkdir%\bin\tcl85%tcl_dbg_ext%.dll" ( | ||
| 79 | + @rem all and install need to be separate invocations, otherwise nmakehlp is not found on install | ||
| 80 | + pushd "%tcldir%\win" | ||
| 81 | + nmake -f makefile.vc MACHINE=%machine% DEBUG=%debug_flag% INSTALLDIR="%tcltkdir%" clean all | ||
| 82 | + nmake -f makefile.vc MACHINE=%machine% DEBUG=%debug_flag% INSTALLDIR="%tcltkdir%" install | ||
| 83 | + popd | ||
| 84 | + ) | ||
| 85 | + | ||
| 86 | + if not exist "%tcltkdir%\bin\tk85%tcl_dbg_ext%.dll" ( | ||
| 87 | + pushd "%tkdir%\win" | ||
| 88 | + nmake -f makefile.vc MACHINE=%machine% DEBUG=%debug_flag% INSTALLDIR="%tcltkdir%" TCLDIR="%tcldir%" clean | ||
| 89 | + nmake -f makefile.vc MACHINE=%machine% DEBUG=%debug_flag% INSTALLDIR="%tcltkdir%" TCLDIR="%tcldir%" all | ||
| 90 | + nmake -f makefile.vc MACHINE=%machine% DEBUG=%debug_flag% INSTALLDIR="%tcltkdir%" TCLDIR="%tcldir%" install | ||
| 91 | + popd | ||
| 92 | + ) | ||
| 93 | + | ||
| 94 | + if not exist "%tcltkdir%\lib\tix8.4.3\tix84%tcl_dbg_ext%.dll" ( | ||
| 95 | + pushd "%tixdir%\win" | ||
| 96 | + nmake -f python.mak DEBUG=%debug_flag% MACHINE=%machine% TCL_DIR="%tcldir%" TK_DIR="%tkdir%" INSTALL_DIR="%tcltkdir%" clean | ||
| 97 | + nmake -f python.mak DEBUG=%debug_flag% MACHINE=%machine% TCL_DIR="%tcldir%" TK_DIR="%tkdir%" INSTALL_DIR="%tcltkdir%" all | ||
| 98 | + nmake -f python.mak DEBUG=%debug_flag% MACHINE=%machine% TCL_DIR="%tcldir%" TK_DIR="%tkdir%" INSTALL_DIR="%tcltkdir%" install | ||
| 99 | + popd | ||
| 100 | + ) | ||
| 101 | + ) | ||
| 102 | + | ||
| 103 | + rem Call on VCBuild to do the work, echo the command. | ||
| 104 | + rem Passing %1-9 is not the preferred option, but argument parsing in | ||
| 105 | + rem batch is, shall we say, "lackluster" | ||
| 106 | + echo on | ||
| 107 | + vcbuild "%dir%pcbuild.sln" %target% "%conf%|%platf%" %1 %2 %3 %4 %5 %6 %7 %8 %9 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,5 +1,4 @@ | |||
| 1 | 1 | @echo off | |
| 2 | - set VS9=%ProgramFiles%\Microsoft Visual Studio 9.0 | ||
| 3 | 2 | echo Build environments: x86, ia64, amd64, x86_amd64, x86_ia64 | |
| 4 | 3 | echo. | |
| 5 | - call "%VS9%\VC\vcvarsall.bat" %1 | ||
| 4 | + call "%VS90COMNTOOLS%..\..\VC\vcvarsall.bat" %* | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,103 @@ | |||
| 1 | + @echo off | ||
| 2 | + setlocal | ||
| 3 | + rem Simple script to fetch source for external libraries | ||
| 4 | + | ||
| 5 | + if not exist "%~dp0..\externals" mkdir "%~dp0..\externals" | ||
| 6 | + pushd "%~dp0..\externals" | ||
| 7 | + | ||
| 8 | + if "%SVNROOT%"=="" set SVNROOT=http://svn.python.org/projects/external/ | ||
| 9 | + | ||
| 10 | + rem Optionally clean up first. Be warned that this can be very destructive! | ||
| 11 | + if not "%1"=="" ( | ||
| 12 | + for %%c in (-c --clean --clean-only) do ( | ||
| 13 | + if "%1"=="%%c" goto clean | ||
| 14 | + ) | ||
| 15 | + goto usage | ||
| 16 | + ) | ||
| 17 | + goto fetch | ||
| 18 | + | ||
| 19 | + :clean | ||
| 20 | + echo.Cleaning up external libraries. | ||
| 21 | + for /D %%d in ( | ||
| 22 | + bzip2-* | ||
| 23 | + db-* | ||
| 24 | + nasm-* | ||
| 25 | + openssl-* | ||
| 26 | + tcl-* | ||
| 27 | + tcltk* | ||
| 28 | + tk-* | ||
| 29 | + tix-* | ||
| 30 | + sqlite-* | ||
| 31 | + xz-* | ||
| 32 | + ) do ( | ||
| 33 | + echo.Removing %%d | ||
| 34 | + rmdir /s /q %%d | ||
| 35 | + ) | ||
| 36 | + if "%1"=="--clean-only" ( | ||
| 37 | + goto end | ||
| 38 | + ) | ||
| 39 | + | ||
| 40 | + :fetch | ||
| 41 | + rem Fetch current versions | ||
| 42 | + | ||
| 43 | + svn --version > nul 2>&1 | ||
| 44 | + if ERRORLEVEL 9009 ( | ||
| 45 | + echo.svn.exe must be on your PATH. | ||
| 46 | + echo.Try TortoiseSVN (http://tortoisesvn.net/^) and be sure to check the | ||
| 47 | + echo.command line tools option. | ||
| 48 | + popd | ||
| 49 | + exit /b 1 | ||
| 50 | + ) | ||
| 51 | + | ||
| 52 | + echo.Fetching external libraries... | ||
| 53 | + | ||
| 54 | + for %%e in ( | ||
| 55 | + bzip2-1.0.6 | ||
| 56 | + db-4.7.25.0 | ||
| 57 | + nasm-2.11.06 | ||
| 58 | + openssl-1.0.2a | ||
| 59 | + tcl-8.5.15.0 | ||
| 60 | + tk-8.5.15.0 | ||
| 61 | + tix-8.4.3.5 | ||
| 62 | + sqlite-3.6.21 | ||
| 63 | + ) do ( | ||
| 64 | + if exist %%e ( | ||
| 65 | + echo.%%e already exists, skipping. | ||
| 66 | + ) else ( | ||
| 67 | + echo.Fetching %%e... | ||
| 68 | + svn export %SVNROOT%%%e | ||
| 69 | + ) | ||
| 70 | + ) | ||
| 71 | + | ||
| 72 | + goto end | ||
| 73 | + | ||
| 74 | + :usage | ||
| 75 | + echo.invalid argument: %1 | ||
| 76 | + echo.usage: %~n0 [[ -c ^| --clean ] ^| --clean-only ] | ||
| 77 | + echo. | ||
| 78 | + echo.Pull all sources necessary for compiling optional extension modules | ||
| 79 | + echo.that rely on external libraries. Requires svn.exe to be on your PATH | ||
| 80 | + echo.and pulls sources from %SVNROOT%. | ||
| 81 | + echo. | ||
| 82 | + echo.Use the -c or --clean option to clean up all external library sources | ||
| 83 | + echo.before pulling in the current versions. | ||
| 84 | + echo. | ||
| 85 | + echo.Use the --clean-only option to do the same cleaning, without pulling in | ||
| 86 | + echo.anything new. | ||
| 87 | + echo. | ||
| 88 | + echo.Only the first argument is checked, all others are ignored. | ||
| 89 | + echo. | ||
| 90 | + echo.**WARNING**: the cleaning options unconditionally remove any directory | ||
| 91 | + echo.that is a child of | ||
| 92 | + echo. %CD% | ||
| 93 | + echo.and matches wildcard patterns beginning with bzip2-, db-, nasm-, openssl-, | ||
| 94 | + echo.tcl-, tcltk, tk-, tix-, sqlite-, or xz-, and as such has the potential | ||
| 95 | + echo.to be very destructive if you are not aware of what it is doing. Use with | ||
| 96 | + echo.caution! | ||
| 97 | + popd | ||
| 98 | + exit /b -1 | ||
| 99 | + | ||
| 100 | + | ||
| 101 | + :end | ||
| 102 | + echo Finished. | ||
| 103 | + popd | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -9,7 +9,8 @@ rem -q runs the tests just once, and without deleting .py[co] files. | |||
| 9 | 9 | rem -x64 Run the 64-bit build of python (or python_d if -d was specified) | |
| 10 | 10 | rem from the 'amd64' dir instead of the 32-bit build in this dir. | |
| 11 | 11 | rem All leading instances of these switches are shifted off, and | |
| 12 | - rem whatever remains is passed to regrtest.py. For example, | ||
| 12 | + rem whatever remains (up to 9 arguments) is passed to regrtest.py. | ||
| 13 | + rem For example, | ||
| 13 | 14 | rem rt -O -d -x test_thread | |
| 14 | 15 | rem runs | |
| 15 | 16 | rem python_d -O ../lib/test/regrtest.py -x test_thread | |
@@ -26,7 +27,8 @@ rem rt -u "network,largefile" | |||
| 26 | 27 | ||
| 27 | 28 | setlocal | |
| 28 | 29 | ||
| 29 | - set prefix=.\ | ||
| 30 | + set pcbuild=%~dp0 | ||
| 31 | + set prefix=%pcbuild% | ||
| 30 | 32 | set suffix= | |
| 31 | 33 | set qmode= | |
| 32 | 34 | set dashO= | |
@@ -36,15 +38,15 @@ set tcltk=tcltk | |||
| 36 | 38 | if "%1"=="-O" (set dashO=-O) & shift & goto CheckOpts | |
| 37 | 39 | if "%1"=="-q" (set qmode=yes) & shift & goto CheckOpts | |
| 38 | 40 | if "%1"=="-d" (set suffix=_d) & shift & goto CheckOpts | |
| 39 | - if "%1"=="-x64" (set prefix=amd64) & (set tcltk=tcltk64) & shift & goto CheckOpts | ||
| 41 | + if "%1"=="-x64" (set prefix=%prefix%amd64) & (set tcltk=tcltk64) & shift & goto CheckOpts | ||
| 40 | 42 | ||
| 41 | - PATH %PATH%;%~dp0..\externals\%tcltk%\bin | ||
| 42 | - set exe=%prefix%\python%suffix% | ||
| 43 | - set cmd=%exe% %dashO% -Wd -3 -E -tt ../lib/test/regrtest.py %1 %2 %3 %4 %5 %6 %7 %8 %9 | ||
| 43 | + PATH %PATH%;%pcbuild%..\externals\%tcltk%\bin | ||
| 44 | + set exe="%prefix%\python%suffix%" | ||
| 45 | + set cmd=%exe% %dashO% -Wd -3 -E -tt "%pcbuild%\..\Lib\test\regrtest.py" %1 %2 %3 %4 %5 %6 %7 %8 %9 | ||
| 44 | 46 | if defined qmode goto Qmode | |
| 45 | 47 | ||
| 46 | 48 | echo Deleting .pyc/.pyo files ... | |
| 47 | - %exe% rmpyc.py | ||
| 49 | + %exe% "%pcbuild%\rmpyc.py" | ||
| 48 | 50 | ||
| 49 | 51 | echo on | |
| 50 | 52 | %cmd% | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,7 +1,2 @@ | |||
| 1 | 1 | @rem Used by the buildbot "compile" step. | |
| 2 | - set HOST_PYTHON="%CD%\PCbuild\amd64\python_d.exe" | ||
| 3 | - cmd /c Tools\buildbot\external-amd64.bat | ||
| 4 | - call "%VS90COMNTOOLS%\..\..\VC\vcvarsall.bat" x86_amd64 | ||
| 5 | - cmd /c Tools\buildbot\clean-amd64.bat | ||
| 6 | - vcbuild /useenv PCbuild\kill_python.vcproj "Debug|x64" && PCbuild\amd64\kill_python_d.exe | ||
| 7 | - vcbuild PCbuild\pcbuild.sln "Debug|x64" | ||
| 2 | + call "%~dp0build.bat" -p x64 %* | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,7 +1,18 @@ | |||
| 1 | 1 | @rem Used by the buildbot "compile" step. | |
| 2 | - cmd /c Tools\buildbot\external.bat | ||
| 3 | - call "%VS90COMNTOOLS%vsvars32.bat" | ||
| 4 | - cmd /c Tools\buildbot\clean.bat | ||
| 5 | - vcbuild /useenv PCbuild\kill_python.vcproj "Debug|Win32" && PCbuild\kill_python_d.exe | ||
| 6 | - vcbuild /useenv PCbuild\pcbuild.sln "Debug|Win32" | ||
| 2 | + @setlocal | ||
| 7 | 3 | ||
| 4 | + @rem Clean up | ||
| 5 | + call "%~dp0clean.bat" %* | ||
| 6 | + | ||
| 7 | + @rem If you need the buildbots to start fresh (such as when upgrading to | ||
| 8 | + @rem a new version of an external library, especially Tcl/Tk): | ||
| 9 | + @rem 1) uncomment the following line: | ||
| 10 | + | ||
| 11 | + @rem call "%~dp0..\..\PCbuild\get_externals.bat" --clean-only | ||
| 12 | + | ||
| 13 | + @rem 2) commit and push | ||
| 14 | + @rem 3) wait for all Windows bots to start a build with that changeset | ||
| 15 | + @rem 4) re-comment, commit and push again | ||
| 16 | + | ||
| 17 | + @rem Do the build | ||
| 18 | + call "%~dp0..\..\PCbuild\build.bat" -e -d -k %* | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,10 +1,2 @@ | |||
| 1 | 1 | @rem Used by the buildbot "clean" step. | |
| 2 | - call "%VS90COMNTOOLS%\..\..\VC\vcvarsall.bat" x86_amd64 | ||
| 3 | - @echo Deleting .pyc/.pyo files ... | ||
| 4 | - del /s Lib\*.pyc Lib\*.pyo | ||
| 5 | - @echo Deleting test leftovers ... | ||
| 6 | - rmdir /s /q build | ||
| 7 | - cd PCbuild | ||
| 8 | - vcbuild /clean pcbuild.sln "Release|x64" | ||
| 9 | - vcbuild /clean pcbuild.sln "Debug|x64" | ||
| 10 | - cd .. | ||
| 2 | + call "%~dp0clean.bat" -p x64 %* | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,10 +1,16 @@ | |||
| 1 | - @rem Used by the buildbot "clean" step. | ||
| 2 | - call "%VS90COMNTOOLS%vsvars32.bat" | ||
| 3 | - @echo Deleting .pyc/.pyo files ... | ||
| 4 | - del /s Lib\*.pyc Lib\*.pyo | ||
| 5 | - @echo Deleting test leftovers ... | ||
| 6 | - rmdir /s /q build | ||
| 7 | - cd PCbuild | ||
| 8 | - vcbuild /clean pcbuild.sln "Release|Win32" | ||
| 9 | - vcbuild /clean pcbuild.sln "Debug|Win32" | ||
| 10 | - cd .. | ||
| 1 | + @echo off | ||
| 2 | + rem Used by the buildbot "clean" step. | ||
| 3 | + | ||
| 4 | + setlocal | ||
| 5 | + set root=%~dp0..\.. | ||
| 6 | + set pcbuild=%root%\PCbuild | ||
| 7 | + | ||
| 8 | + echo Deleting build | ||
| 9 | + call "%pcbuild%\build.bat" -t Clean -k %* | ||
| 10 | + call "%pcbuild%\build.bat" -t Clean -k -d %* | ||
| 11 | + | ||
| 12 | + echo Deleting .pyc/.pyo files ... | ||
| 13 | + del /s "%root%\Lib\*.pyc" "%root%\Lib\*.pyo" | ||
| 14 | + | ||
| 15 | + echo Deleting test leftovers ... | ||
| 16 | + rmdir /s /q "%root%\build" | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments