From: Zachary Ware Date: Wed, 10 Jun 2015 05:43:20 +0000 (-0500) Subject: Merge forward extras beyond #21907 backport. X-Git-Tag: v3.5.0b3~75 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=785273cd84a81a695a2707c0ef48df4f285f8699;p=python Merge forward extras beyond #21907 backport. --- 785273cd84a81a695a2707c0ef48df4f285f8699 diff --cc PCbuild/build.bat index fa9f403f2f,f3bc1e3b8b..3f8e231df0 --- a/PCbuild/build.bat +++ b/PCbuild/build.bat @@@ -6,11 -6,13 +6,13 @@@ 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, or Clean) +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 Enable parallel build -rem -M Disable parallel build (disabled by default) ++rem -m Enable parallel build (enabled by default) +rem -M Disable parallel build rem -v Increased output messages -rem -k Attempt to kill any running Pythons before building ++rem -k Attempt to kill any running Pythons before building (usually unnecessary) setlocal set platf=Win32 @@@ -18,8 -20,10 +20,9 @@@ set vs_platf=x8 set conf=Release set target=Build set dir=%~dp0 -set parallel= +set parallel=/m set verbose=/nologo /v:m + set kill= -set build_tkinter= :CheckOpts if '%1'=='-c' (set conf=%2) & shift & shift & goto CheckOpts @@@ -27,15 -31,75 +30,21 @@@ if '%1'=='-p' (set platf=%2) & shift & 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" & (set build_tkinter=true) & shift & goto CheckOpts +if '%1'=='-e' call "%dir%get_externals.bat" & shift & goto CheckOpts + if '%1'=='-m' (set parallel=/m) & shift & goto CheckOpts if '%1'=='-M' (set parallel=) & shift & goto CheckOpts if '%1'=='-v' (set verbose=/v:n) & shift & goto CheckOpts + if '%1'=='-k' (set kill=true) & shift & goto CheckOpts -if '%conf%'=='Debug' (set dbg_ext=_d) else (set dbg_ext=) -if '%platf%'=='x64' ( - set vs_platf=x86_amd64 - set builddir=%dir%amd64\ -) else ( - set builddir=%dir% -) +if '%platf%'=='x64' (set vs_platf=x86_amd64) rem Setup the environment -call "%dir%env.bat" %vs_platf% +call "%dir%env.bat" %vs_platf% >nul + if '%kill%'=='true' ( - msbuild "%dir%kill_python.vcxproj" %verbose% /p:Configuration=%conf% /p:Platform=%platf% && "%builddir%kill_python%dbg_ext%.exe" -) - -set externals_dir=%dir%..\externals -if '%build_tkinter%'=='true' ( - if '%platf%'=='x64' ( - set tcltkdir=%externals_dir%\tcltk64 - set machine=AMD64 - ) else ( - set tcltkdir=%externals_dir%\tcltk - set machine=IX86 - ) - if '%conf%'=='Debug' ( - set tcl_dbg_ext=g - set debug_flag=1 - set options=symbols - ) else ( - set tcl_dbg_ext= - set debug_flag=0 - set options= - ) - set tcldir=%externals_dir%\tcl-8.6.1.0 - set tkdir=%externals_dir%\tk-8.6.1.0 - set tixdir=%externals_dir%\tix-8.4.3.4 -) -if '%build_tkinter%'=='true' ( - if not exist "%tcltkdir%\bin\tcl86t%tcl_dbg_ext%.dll" ( - @rem all and install need to be separate invocations, otherwise nmakehlp is not found on install - pushd "%tcldir%\win" - nmake -f makefile.vc MACHINE=%machine% OPTS=%options% INSTALLDIR="%tcltkdir%" clean all - nmake -f makefile.vc MACHINE=%machine% OPTS=%options% INSTALLDIR="%tcltkdir%" install-binaries install-libraries - popd - ) - - if not exist "%tcltkdir%\bin\tk86t%tcl_dbg_ext%.dll" ( - pushd "%tkdir%\win" - nmake -f makefile.vc MACHINE=%machine% OPTS=%options% INSTALLDIR="%tcltkdir%" TCLDIR="%tcldir%" clean - nmake -f makefile.vc MACHINE=%machine% OPTS=%options% INSTALLDIR="%tcltkdir%" TCLDIR="%tcldir%" all - nmake -f makefile.vc MACHINE=%machine% OPTS=%options% INSTALLDIR="%tcltkdir%" TCLDIR="%tcldir%" install-binaries install-libraries - popd - ) - - if not exist "%tcltkdir%\lib\tix8.4.3\tix84%tcl_dbg_ext%.dll" ( - pushd "%tixdir%\win" - nmake -f python.mak DEBUG=%debug_flag% MACHINE=%machine% TCL_DIR="%tcldir%" TK_DIR="%tkdir%" INSTALL_DIR="%tcltkdir%" clean - nmake -f python.mak DEBUG=%debug_flag% MACHINE=%machine% TCL_DIR="%tcldir%" TK_DIR="%tkdir%" INSTALL_DIR="%tcltkdir%" all - nmake -f python.mak DEBUG=%debug_flag% MACHINE=%machine% TCL_DIR="%tcldir%" TK_DIR="%tkdir%" INSTALL_DIR="%tcltkdir%" install - popd - ) ++ msbuild /v:m /nologo /target:KillPython "%pcbuild%\pythoncore.vcxproj" /p:Configuration=%conf% /p:Platform=%platf% /p:KillPython=true + ) + 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"