Commit c7db38c0 authored by Tim Peters's avatar Tim Peters

Untested first stab at moving to Python 2.4.2.

parent dec7e2b5
# The Python and pywin32 versions. For Python, both the source tarball
# and the Windows installer must be in tmp/. For pywin32 (previously known
# as win32all), the Windows installer must be in tmp/. Nothing beyond those
# is required to build Python, and you don't even need a compiler.
PYVERSION_MAJOR=2
PYVERSION_MINOR=4
PYVERSION_PATCH=2
PYVERSION=$(PYVERSION_MAJOR).$(PYVERSION_MINOR).$(PYVERSION_PATCH)
W32ALLVERSION=205
# CAUTION: Extracting files from Wise installers doesn't really do what
# you expect. While a Wise installer is a zip file, the zip file
# structure is flat (Wise reconstructs the intended directory structure
# from metadata stored in proprietary FILEnnnn.DAT files also in the
# zip file). Consequently, the package structure of Python packages is
# lost, and if there's more than one file with the same name, you only
# get "the last one" to be extracted (all files are extracted to the
# same directory).
# The Python and pywin32 versions.
#
# For Python, this doesn't matter, because we're only sucking out the
# precompiled .pyd and .exe files from the Python installer -- there
# are no name clashes in that set, and it's a pretty safe bet there never
# will be (else Python wouldn't be able to decide which to use!). We
# use the Python source tarball to get all the non-executable parts we
# need.
# For Python, the source tarball must be in tmp/. You must also install the
# appropriate Python on Windows, and set WIN_PYINSTALLEDDIR here to its root
# directory. A copy of the main Python DLL must also be in the root (you
# may need to copy it from your Windows system directory). Earlier versions
# of this extracted .dll, .exe, and .pyd files from Python's Wise installer,
# but Python 2.4 uses an .msi installer, and there doesn't appear to be a
# way to _just_ extract files from one of those.
#
# pywin32 doesn't have this problem as it now uses
# a standard distutils 'bdist_wininst' installation .exe. These executables are
# valid .zip files with a "PLATLIB" directory being the complete directory
# structure as installed into "site-packages". These recent pywin32 builds have
# no dependencies on registry settings etc so will work directly as copied out of
# the .exe. The only concerns are the pywintypes/pythoncom dlls, which is
# handled by the Inno installer
PYDIRNAME=Python-$(PYVERSION)
# Standard bdist_wininst name - eg: pywin32-203.win32-py2.3[.exe]
W32ALLDIRNAME=pywin32-$(W32ALLVERSION).win32-py$(PYVERSION_MAJOR).$(PYVERSION_MINOR)
W32EXCLUDE=*.chm
# For pywin32 (previously known as win32all), the Windows installer must be
# in tmp/.
#
# Nothing beyond those is required to build Python, and you don't even need
# a compiler.
PYVERSION_MAJOR := 2
PYVERSION_MINOR := 4
PYVERSION_PATCH := 2
W32ALLVERSION := 205
PYVERSION := $(PYVERSION_MAJOR).$(PYVERSION_MINOR).$(PYVERSION_PATCH)
PYMAJORMINOR := python$(PYVERSION_MAJOR)$(PYVERSION_MINOR)
# This is the default directory into which a Python installs.
WIN_PYINSTALLEDDIR := \$(PYMAJORMINOR)
# pywin32 now uses a standard distutils 'bdist_wininst' installation .exe.
# These executables are valid .zip files with a "PLATLIB" directory being
# the complete directory structure as installed into "site-packages". These
# recent pywin32 builds have no dependencies on registry settings etc so
# will work directly as copied out of the .exe. The only concerns are the
# pywintypes/pythoncom dlls, which are handled by the Inno installer.
PYDIRNAME := Python-$(PYVERSION)
# Standard bdist_wininst name - eg: pywin32-203.win32-py2.3
W32ALLDIRNAME := pywin32-$(W32ALLVERSION).win32-py$(PYVERSION_MAJOR).$(PYVERSION_MINOR)
W32EXCLUDE := *.chm
# The Python tarball is extracted to PYSRCDIR.
# The contents of the Python installer get extracted to PYEXTRACTDIR.
# The " " " win32all " " " " W32EXTRACTDIR.
PYSRCDIR=$(BASE_DIR)/src/$(PYDIRNAME)
PYEXTRACTDIR=$(BASE_DIR)/src/$(PYDIRNAME)-extract
W32EXTRACTDIR=$(BASE_DIR)/src/$(W32ALLDIRNAME)
# pywin32 is extracted to W32EXTRACTDIR.
PYSRCDIR := $(BASE_DIR)/src/$(PYDIRNAME)
W32EXTRACTDIR := $(BASE_DIR)/src/$(W32ALLDIRNAME)
WIN_PYSRCDIR=$(shell cygpath -w $(PYSRCDIR))
WIN_PYEXTRACTDIR=$(shell cygpath -w $(PYEXTRACTDIR))
WIN_W32EXTRACTDIR=$(shell cygpath -w $(W32EXTRACTDIR))
WIN_PYSRCDIR := $(shell cygpath -w $(PYSRCDIR))
WIN_W32EXTRACTDIR := $(shell cygpath -w $(W32EXTRACTDIR))
PYTHON_REQUIRED_FILES=tmp/$(W32ALLDIRNAME).exe \
tmp/$(PYDIRNAME).tgz \
tmp/$(PYDIRNAME).exe
PYTHON_REQUIRED_FILES := tmp/$(W32ALLDIRNAME).exe \
tmp/$(PYDIRNAME).tgz
# Arbitrary files from each of the installers and tarballs, to use as
# targets to force them to get unpacked.
ARB_PYSRCDIR=$(PYSRCDIR)/PCbuild/pcbuild.dsw
ARB_PYEXTRACTDIR=$(PYEXTRACTDIR)/zlib.pyd
ARB_W32EXTRACTDIR=$(W32EXTRACTDIR)/PLATLIB
ARB_PYSRCDIR := $(PYSRCDIR)/PCbuild/pcbuild.dsw
ARB_W32EXTRACTDIR := $(W32EXTRACTDIR)/PLATLIB
# Building Python just consists of extracting files.
build_python: $(ARB_PYSRCDIR) $(ARB_PYEXTRACTDIR) $(ARB_W32EXTRACTDIR)
build_python: $(ARB_PYSRCDIR) $(ARB_W32EXTRACTDIR)
# Installing Python consists of copying oodles of files into
# $(BUILD_DIR).
......@@ -67,7 +62,6 @@ install_python: $(BUILD_DIR)/bin/python.exe
clean_python:
$(RMRF) $(PYSRCDIR)
$(RMRF) $(PYEXTRACTDIR)
clean_libs:
$(RMRF) $(W32EXTRACTDIR)
......@@ -77,11 +71,6 @@ $(ARB_PYSRCDIR): tmp/$(PYDIRNAME).tgz
$(CD) "$(SRC_DIR)" && $(TAR) xvzf ../tmp/$(PYDIRNAME).tgz
$(TOUCH) "$(ARB_PYSRCDIR)"
$(ARB_PYEXTRACTDIR): tmp/$(PYDIRNAME).exe
$(MKDIR) "$(PYEXTRACTDIR)"
"tmp/$(PYDIRNAME).exe" /S /X "$(WIN_PYEXTRACTDIR)"
$(TOUCH) "$(ARB_PYEXTRACTDIR)"
# unzip warns about .exe not being exactly a .zip, then succeeds in
# extracting the files, then returns with exit != 0 - ignore exit code
$(ARB_W32EXTRACTDIR): tmp/$(W32ALLDIRNAME).exe
......@@ -96,9 +85,8 @@ $(BUILD_DIR)/bin/python.exe:
$(CP) "$(MAKEFILEDIR)/doc/ZC_PY_DIST_README.txt" "$(BUILD_DIR)/doc"
$(CP) "$(PYSRCDIR)/LICENSE" "$(BUILD_DIR)/doc/PYTHON_LICENSE.txt"
unix2dos "$(BUILD_DIR)/doc/PYTHON_LICENSE.txt"
$(MKDIR) "$(BUILD_DIR)/bin/DLLs"
$(XCOPY) "$(WIN_PYEXTRACTDIR)\*.pyd" "$(WIN_BUILD_DIR)\bin\DLLs"
$(CP) "$(SRC_DIR)/$(W32ALLDIRNAME)/PLATLIB/pythonwin/License.txt" \
"$(BUILD_DIR)/doc/PYWIN32_LICENSE.txt"
$(MKDIR) "$(BUILD_DIR)/bin/Lib"
$(XCOPY) "$(WIN_PYSRCDIR)\Lib\*.py" "$(WIN_BUILD_DIR)\bin\Lib"
......@@ -115,13 +103,18 @@ $(BUILD_DIR)/bin/python.exe:
$(XCOPY) "$(WIN_PYSRCDIR)\Include\*.h" "$(WIN_BUILD_DIR)\bin\Include"
$(XCOPY) "$(WIN_PYSRCDIR)\PC\*.h" "$(WIN_BUILD_DIR)\bin\Include"
$(MKDIR) "$(BUILD_DIR)/bin"
$(MKDIR) "$(BUILD_DIR)/bin/libs"
$(CP) "$(PYEXTRACTDIR)/python23.lib" "$(BUILD_DIR)/bin/libs"
$(MKDIR) "$(BUILD_DIR)/bin/DLLs"
$(XCOPY) "$(WIN_PYINSTALLEDDIR)\python.exe" "$(WIN_BUILD_DIR)\bin"
$(XCOPY) "$(WIN_PYINSTALLEDDIR)\pythonw.exe" "$(WIN_BUILD_DIR)\bin"
$(XCOPY) "$(WIN_PYINSTALLEDDIR)\w9xpopen.exe" "$(WIN_BUILD_DIR)\bin"
$(XCOPY) "$(WIN_PYINSTALLEDDIR)\$(PYMAJORMINOR).dll" \
"$(WIN_BUILD_DIR)\bin"
$(XCOPY) "$(WIN_MAKEFILEDIR)\bin\msvcr71.dll" "$(WIN_BUILD_DIR)\bin"
$(XCOPY) "$(WIN_PYINSTALLEDDIR)\libs\$(PYMAJORMINOR).lib" \
"$(WIN_BUILD_DIR)\bin\libs"
$(XCOPY) "$(WIN_PYINSTALLEDDIR)\DLLs\*.pyd" \
"$(WIN_BUILD_DIR)\bin\DLLs"
$(MKDIR) "$(BUILD_DIR)/bin"
$(CP) "$(PYEXTRACTDIR)/pythonw.exe" "$(BUILD_DIR)/bin"
$(CP) "$(PYEXTRACTDIR)/w9xpopen.exe" "$(BUILD_DIR)/bin"
$(CP) "$(PYEXTRACTDIR)/python23.dll" "$(BUILD_DIR)/bin"
$(CP) "$(PYEXTRACTDIR)/python.exe" "$(BUILD_DIR)/bin"
$(TOUCH) "$(BUILD_DIR)/bin/python.exe"
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment