|
1 | 1 | #!/usr/bin/python |
2 | 2 | """ |
3 | | -This script is used to build the "official unofficial" universal build on |
4 | | -Mac OS X. It requires Mac OS X 10.4, Xcode 2.2 and the 10.4u SDK to do its |
5 | | -work. 64-bit or four-way universal builds require at least OS X 10.5 and |
6 | | -the 10.5 SDK. |
| 3 | +This script is used to build "official" universal installers on Mac OS X. |
| 4 | +It requires at least Mac OS X 10.4, Xcode 2.2 and the 10.4u SDK for |
| 5 | +32-bit builds. 64-bit or four-way universal builds require at least |
| 6 | +OS X 10.5 and the 10.5 SDK. |
7 | 7 |
|
8 | | -Please ensure that this script keeps working with Python 2.3, to avoid |
9 | | -bootstrap issues (/usr/bin/python is Python 2.3 on OSX 10.4) |
| 8 | +Please ensure that this script keeps working with Python 2.5, to avoid |
| 9 | +bootstrap issues (/usr/bin/python is Python 2.5 on OSX 10.5). Sphinx, |
| 10 | +which is used to build the documentation, currently requires at least |
| 11 | +Python 2.4. |
10 | 12 |
|
11 | 13 | Usage: see USAGE variable in the script. |
12 | 14 | """ |
@@ -405,6 +407,9 @@ def checkEnvironment(): |
405 | 407 | Check that we're running on a supported system. |
406 | 408 | """ |
407 | 409 |
|
| 410 | + if sys.version_info[0:2] < (2, 4): |
| 411 | + fatal("This script must be run with Python 2.4 or later") |
| 412 | + |
408 | 413 | if platform.system() != 'Darwin': |
409 | 414 | fatal("This script should be run on a Mac OS X 10.4 (or later) system") |
410 | 415 |
|
@@ -835,29 +840,33 @@ def buildPython(): |
835 | 840 | os.chmod(p, stat.S_IMODE(st.st_mode) | stat.S_IWGRP) |
836 | 841 | os.chown(p, -1, gid) |
837 | 842 |
|
838 | | - LDVERSION=None |
839 | | - VERSION=None |
840 | | - ABIFLAGS=None |
| 843 | + if PYTHON_3: |
| 844 | + LDVERSION=None |
| 845 | + VERSION=None |
| 846 | + ABIFLAGS=None |
841 | 847 |
|
842 | | - with open(os.path.join(buildDir, 'Makefile')) as fp: |
| 848 | + fp = open(os.path.join(buildDir, 'Makefile'), 'r') |
843 | 849 | for ln in fp: |
844 | 850 | if ln.startswith('VERSION='): |
845 | 851 | VERSION=ln.split()[1] |
846 | 852 | if ln.startswith('ABIFLAGS='): |
847 | 853 | ABIFLAGS=ln.split()[1] |
848 | | - |
849 | 854 | if ln.startswith('LDVERSION='): |
850 | 855 | LDVERSION=ln.split()[1] |
| 856 | + fp.close() |
851 | 857 |
|
852 | | - LDVERSION = LDVERSION.replace('$(VERSION)', VERSION) |
853 | | - LDVERSION = LDVERSION.replace('$(ABIFLAGS)', ABIFLAGS) |
| 858 | + LDVERSION = LDVERSION.replace('$(VERSION)', VERSION) |
| 859 | + LDVERSION = LDVERSION.replace('$(ABIFLAGS)', ABIFLAGS) |
| 860 | + config_suffix = '-' + LDVERSION |
| 861 | + else: |
| 862 | + config_suffix = '' # Python 2.x |
854 | 863 |
|
855 | 864 | # We added some directories to the search path during the configure |
856 | 865 | # phase. Remove those because those directories won't be there on |
857 | 866 | # the end-users system. |
858 | 867 | path =os.path.join(rootDir, 'Library', 'Frameworks', 'Python.framework', |
859 | 868 | 'Versions', version, 'lib', 'python%s'%(version,), |
860 | | - 'config-' + LDVERSION, 'Makefile') |
| 869 | + 'config' + config_suffix, 'Makefile') |
861 | 870 | fp = open(path, 'r') |
862 | 871 | data = fp.read() |
863 | 872 | fp.close() |
|
0 commit comments