]> granicus.if.org Git - python/commitdiff
I've created three bat files based on the howto http://wiki.python.org/moin/Building_...
authorChristian Heimes <christian@cheimes.de>
Thu, 8 Nov 2007 23:55:45 +0000 (23:55 +0000)
committerChristian Heimes <christian@cheimes.de>
Thu, 8 Nov 2007 23:55:45 +0000 (23:55 +0000)
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.

PCbuild/build.bat [new file with mode: 0644]
PCbuild/build_env.bat [new file with mode: 0644]
PCbuild/env.bat [new file with mode: 0644]

diff --git a/PCbuild/build.bat b/PCbuild/build.bat
new file mode 100644 (file)
index 0000000..fe78892
--- /dev/null
@@ -0,0 +1,50 @@
+@echo off
+setlocal
+
+set target=end
+
+if "%1"=="makeinfo" goto makeinfo
+if "%1"=="clean" goto clean
+if "%1"=="build" goto build
+if "%1"=="setargv" goto setargv
+if "%1"=="" goto build
+
+echo Usage: build.bat build
+echo        build.bat clean
+echo        build.bat setargv
+goto end
+
+:clean
+del *.pyd *.exe *.dll *.exp *.lib *.pdb *.o
+rmdir /S /Q temp
+rmdir /S /Q x86-temp-release 
+goto %target%
+
+:setargv
+cl /c /I"%SDK%\src\crt" /MD /D_CRTBLD "%SDK%\src\crt\setargv.c"
+if not exist setargv.obj echo An error occured & goto end
+echo copy setargv.obj "%SDK%\Lib"
+copy setargv.obj "%SDK%\Lib"
+del setargv.obj
+goto %target%
+
+:makeinfo
+nant -buildfile:python.build all
+lib /def: x86-temp-release\make_buildinfo\make_buildinfo.obj
+lib /def: x86-temp-release\make_versioninfo\make_versioninfo.obj
+goto %target%
+
+:build
+if not exist make_buildinfo.lib set target=realbuild & goto makeinfo
+if not exist make_versioninfo.lib set target=realbuild & goto makeinfo
+if exist "%SDK%\Lib\setargv.obj" goto realbuild
+echo !!!!!!!!
+echo setargv.obj is missing. Please call build setargv
+echo !!!!!!!!
+
+:realbuild
+if not exist sqlite3.dll copy ..\..\sqlite-source-3.3.4\sqlite3.dll .
+nant -buildfile:python.build all
+goto end
+
+:end
\ No newline at end of file
diff --git a/PCbuild/build_env.bat b/PCbuild/build_env.bat
new file mode 100644 (file)
index 0000000..ad3b609
--- /dev/null
@@ -0,0 +1 @@
+@%comspec% /k env.bat
\ No newline at end of file
diff --git a/PCbuild/env.bat b/PCbuild/env.bat
new file mode 100644 (file)
index 0000000..05152fe
--- /dev/null
@@ -0,0 +1,22 @@
+@echo off
+rem Set these values according to where you installed the software
+rem You need to install the necessary bits mentioned in:
+rem http://wiki.python.org/moin/Building_Python_with_the_free_MS_C_Toolkit
+
+set TOOLKIT=%ProgramFiles%\Microsoft Visual C++ Toolkit 2003
+set SDK=%ProgramFiles%\Microsoft Platform SDK for Windows Server 2003 R2
+set NET=%ProgramFiles%\Microsoft Visual Studio .NET 2003
+set NANT=%ProgramFiles%\Nant
+
+set PATH=%TOOLKIT%\bin;%PATH%;%SDK%\Bin\Win64;%NANT%\bin;%SDK%\bin
+set INCLUDE=%TOOLKIT%\include;%SDK%\Include;%INCLUDE%
+set LIB=%TOOLKIT%\lib;%NET%\VC7\lib;%SDK%\lib;%LIB%
+
+echo Build environment for Python
+echo TOOLKIT=%TOOLKIT%
+echo SDK=%SDK%
+echo NET=%NET%
+echo NANT=%NANT%
+echo Commands:
+echo * build 
+echo * rt