Staging
v0.5.1
https://github.com/python/cpython
Revision c5df56304172d2d825fab27db97e6e90660cf7ef authored by Ned Deily on 19 February 2012, 01:19:12 UTC, committed by Ned Deily on 19 February 2012, 01:19:12 UTC
OS X framework builds already created versioned symlinks for all
executables and scripts installed in the framework bin directory,
of the general form ${cmd} - ${cmd}2.7.  The changes here add a
hierarchy of ${cmd} -> ${cmd}2 -> ${cmd}2.7.  Per previous
practice, all of the links are created in the framework bin
directory for both the install and altinstall targets.  This is
consistent with the long-standing recommendation to manage multiple
framework versions by adding and ordering framework bin directories
on $PATH.  Also, per past practice, symlinks to all framework bin
entries are created in $prefix/bin (by default, /usr/local/bin)
for the install target and only versioned links are created for
altinstall, although the use of these links is not recommended
for framework builds and their installation is optional with
the standard OS X installers.
1 parent 8d38fcf
Raw File
Tip revision: c5df56304172d2d825fab27db97e6e90660cf7ef authored by Ned Deily on 19 February 2012, 01:19:12 UTC
Issue #12627: Implement PEP 394 for OS X framework builds.
Tip revision: c5df563
field3.py
# An absurd workaround for the lack of arithmetic in MS's resource compiler.
# After building Python, run this, then paste the output into the appropriate
# part of PC\python_nt.rc.
# Example output:
#
# * For 2.3a0,
# * PY_MICRO_VERSION = 0
# * PY_RELEASE_LEVEL = 'alpha' = 0xA
# * PY_RELEASE_SERIAL = 1
# *
# * and 0*1000 + 10*10 + 1 = 101.
# */
# #define FIELD3 101

import sys

major, minor, micro, level, serial = sys.version_info
levelnum = {'alpha': 0xA,
            'beta': 0xB,
            'candidate': 0xC,
            'final': 0xF,
           }[level]
string = sys.version.split()[0] # like '2.3a0'

print(" * For %s," % string)
print(" * PY_MICRO_VERSION = %d" % micro)
print(" * PY_RELEASE_LEVEL = %r = %s" % (level, hex(levelnum)))
print(" * PY_RELEASE_SERIAL = %d" % serial)
print(" *")

field3 = micro * 1000 + levelnum * 10 + serial

print(" * and %d*1000 + %d*10 + %d = %d" % (micro, levelnum, serial, field3))
print(" */")
print("#define FIELD3", field3)
back to top