diff options
author | agronholm <none@none> | 2009-09-25 22:01:27 +0300 |
---|---|---|
committer | agronholm <none@none> | 2009-09-25 22:01:27 +0300 |
commit | efa78ba0a0e1f89b92da4fa0fa6e5e029efecf3f (patch) | |
tree | b42d2975e30e286ef9ebe2e46596ce347d89acd7 | |
parent | 758eba50d92348b0f1ba43a2e6ee3a842f49ffed (diff) | |
download | external_python_setuptools-efa78ba0a0e1f89b92da4fa0fa6e5e029efecf3f.tar.gz external_python_setuptools-efa78ba0a0e1f89b92da4fa0fa6e5e029efecf3f.tar.bz2 external_python_setuptools-efa78ba0a0e1f89b92da4fa0fa6e5e029efecf3f.zip |
Fix script launcher creation on 64-bit Windows, patch by Jason R. Coombs (http://bugs.python.org/setuptools/issue2)
--HG--
branch : distribute
extra : rebase_source : 60c07b0639b77a3e8ff13eb12161ebe03ab47430
-rwxr-xr-x | launcher.c | 14 | ||||
-rw-r--r-- | msvc-build-launcher.cmd | 15 | ||||
-rw-r--r-- | setuptools/cli-32.exe | bin | 0 -> 65536 bytes | |||
-rw-r--r-- | setuptools/cli-64.exe | bin | 0 -> 74240 bytes | |||
-rwxr-xr-x | setuptools/cli.exe | bin | 6656 -> 0 bytes | |||
-rwxr-xr-x | setuptools/command/easy_install.py | 5 | ||||
-rw-r--r-- | setuptools/gui-32.exe | bin | 0 -> 65536 bytes | |||
-rw-r--r-- | setuptools/gui-64.exe | bin | 0 -> 74240 bytes | |||
-rwxr-xr-x | setuptools/gui.exe | bin | 7168 -> 0 bytes |
9 files changed, 29 insertions, 5 deletions
@@ -25,8 +25,9 @@ #include <stdlib.h> #include <stdio.h> -#include <unistd.h> +#include <process.h> #include <fcntl.h> +#include "tchar.h" #include "windows.h" int fail(char *format, char *data) { @@ -236,11 +237,18 @@ int run(int argc, char **argv, int is_gui) { } /* We *do* need to wait for a CLI to finish, so use spawn */ - return spawnv(P_WAIT, ptr, (const char * const *)(newargs)); + return _spawnv(_P_WAIT, ptr, (const char * const *)(newargs)); } - +/* int WINAPI WinMain(HINSTANCE hI, HINSTANCE hP, LPSTR lpCmd, int nShow) { return run(__argc, __argv, GUI); } +*/ + +int _tmain(int argc, _TCHAR* argv[]) +{ + return run(argc, argv, GUI); +} + diff --git a/msvc-build-launcher.cmd b/msvc-build-launcher.cmd new file mode 100644 index 00000000..3666d723 --- /dev/null +++ b/msvc-build-launcher.cmd @@ -0,0 +1,15 @@ +@echo off
+
+REM VCVARSALL may be in Program Files or Program Files (x86)
+PATH=C:\Program Files\Microsoft Visual Studio 9.0\VC;%PATH%
+PATH=C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC;%PATH%
+
+REM set up the environment to compile to x86
+call VCVARSALL x86
+cl /D "GUI=0" /D "WIN32_LEAN_AND_MEAN" launcher.c /O2 /link /MACHINE:x86 /out:setuptools/cli-32.exe
+cl /D "GUI=1" /D "WIN32_LEAN_AND_MEAN" launcher.c /O2 /link /MACHINE:x86 /out:setuptools/gui-32.exe
+
+REM now for 64-bit
+call VCVARSALL x86_amd64
+cl /D "GUI=0" /D "WIN32_LEAN_AND_MEAN" launcher.c /O2 /link /MACHINE:x64 /out:setuptools/cli-64.exe
+cl /D "GUI=1" /D "WIN32_LEAN_AND_MEAN" launcher.c /O2 /link /MACHINE:x64 /out:setuptools/gui-64.exe
\ No newline at end of file diff --git a/setuptools/cli-32.exe b/setuptools/cli-32.exe Binary files differnew file mode 100644 index 00000000..dd63bbfc --- /dev/null +++ b/setuptools/cli-32.exe diff --git a/setuptools/cli-64.exe b/setuptools/cli-64.exe Binary files differnew file mode 100644 index 00000000..cc7ced50 --- /dev/null +++ b/setuptools/cli-64.exe diff --git a/setuptools/cli.exe b/setuptools/cli.exe Binary files differdeleted file mode 100755 index 3173b2b2..00000000 --- a/setuptools/cli.exe +++ /dev/null diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py index 195139c7..4b03e185 100755 --- a/setuptools/command/easy_install.py +++ b/setuptools/command/easy_install.py @@ -1603,13 +1603,14 @@ def get_script_args(dist, executable=sys_executable, wininst=False): ")\n" ) % locals() if sys.platform=='win32' or wininst: + word_size = [32, 64]['amd64' in sys.version.lower()] # On Windows/wininst, add a .py extension and an .exe launcher if group=='gui_scripts': - ext, launcher = '-script.pyw', 'gui.exe' + ext, launcher = '-script.pyw', 'gui-%d.exe' % word_size old = ['.pyw'] new_header = re.sub('(?i)python.exe','pythonw.exe',header) else: - ext, launcher = '-script.py', 'cli.exe' + ext, launcher = '-script.py', 'cli-%d.exe' % word_size old = ['.py','.pyc','.pyo'] new_header = re.sub('(?i)pythonw.exe','python.exe',header) diff --git a/setuptools/gui-32.exe b/setuptools/gui-32.exe Binary files differnew file mode 100644 index 00000000..71838207 --- /dev/null +++ b/setuptools/gui-32.exe diff --git a/setuptools/gui-64.exe b/setuptools/gui-64.exe Binary files differnew file mode 100644 index 00000000..7fbfb889 --- /dev/null +++ b/setuptools/gui-64.exe diff --git a/setuptools/gui.exe b/setuptools/gui.exe Binary files differdeleted file mode 100755 index 53d4ff81..00000000 --- a/setuptools/gui.exe +++ /dev/null |