Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4a7cae5

Browse files
committed
I've created three bat files based on the howto http://wiki.python.org/moin/Building_Python_with_the_free_MS_C_Toolkit
I figured out that the files may suite other developers. The files take care of most problems and makes building Python on Windows easier. Simply double click on build_env.bat to open a shell and type build.
1 parent f78f12a commit 4a7cae5

3 files changed

Lines changed: 73 additions & 0 deletions

File tree

PCbuild/build.bat

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
@echo off
2+
setlocal
3+
4+
set target=end
5+
6+
if "%1"=="makeinfo" goto makeinfo
7+
if "%1"=="clean" goto clean
8+
if "%1"=="build" goto build
9+
if "%1"=="setargv" goto setargv
10+
if "%1"=="" goto build
11+
12+
echo Usage: build.bat build
13+
echo build.bat clean
14+
echo build.bat setargv
15+
goto end
16+
17+
:clean
18+
del *.pyd *.exe *.dll *.exp *.lib *.pdb *.o
19+
rmdir /S /Q temp
20+
rmdir /S /Q x86-temp-release
21+
goto %target%
22+
23+
:setargv
24+
cl /c /I"%SDK%\src\crt" /MD /D_CRTBLD "%SDK%\src\crt\setargv.c"
25+
if not exist setargv.obj echo An error occured & goto end
26+
echo copy setargv.obj "%SDK%\Lib"
27+
copy setargv.obj "%SDK%\Lib"
28+
del setargv.obj
29+
goto %target%
30+
31+
:makeinfo
32+
nant -buildfile:python.build all
33+
lib /def: x86-temp-release\make_buildinfo\make_buildinfo.obj
34+
lib /def: x86-temp-release\make_versioninfo\make_versioninfo.obj
35+
goto %target%
36+
37+
:build
38+
if not exist make_buildinfo.lib set target=realbuild & goto makeinfo
39+
if not exist make_versioninfo.lib set target=realbuild & goto makeinfo
40+
if exist "%SDK%\Lib\setargv.obj" goto realbuild
41+
echo !!!!!!!!
42+
echo setargv.obj is missing. Please call build setargv
43+
echo !!!!!!!!
44+
45+
:realbuild
46+
if not exist sqlite3.dll copy ..\..\sqlite-source-3.3.4\sqlite3.dll .
47+
nant -buildfile:python.build all
48+
goto end
49+
50+
:end

PCbuild/build_env.bat

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@%comspec% /k env.bat

PCbuild/env.bat

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
@echo off
2+
rem Set these values according to where you installed the software
3+
rem You need to install the necessary bits mentioned in:
4+
rem http://wiki.python.org/moin/Building_Python_with_the_free_MS_C_Toolkit
5+
6+
set TOOLKIT=%ProgramFiles%\Microsoft Visual C++ Toolkit 2003
7+
set SDK=%ProgramFiles%\Microsoft Platform SDK for Windows Server 2003 R2
8+
set NET=%ProgramFiles%\Microsoft Visual Studio .NET 2003
9+
set NANT=%ProgramFiles%\Nant
10+
11+
set PATH=%TOOLKIT%\bin;%PATH%;%SDK%\Bin\Win64;%NANT%\bin;%SDK%\bin
12+
set INCLUDE=%TOOLKIT%\include;%SDK%\Include;%INCLUDE%
13+
set LIB=%TOOLKIT%\lib;%NET%\VC7\lib;%SDK%\lib;%LIB%
14+
15+
echo Build environment for Python
16+
echo TOOLKIT=%TOOLKIT%
17+
echo SDK=%SDK%
18+
echo NET=%NET%
19+
echo NANT=%NANT%
20+
echo Commands:
21+
echo * build
22+
echo * rt

0 commit comments

Comments
 (0)