mirror of
https://github.com/python/cpython.git
synced 2026-01-09 08:52:34 +00:00
number of tests, all because of the codecs/_multibytecodecs issue described here (it's not a Py3K issue, just something Py3K discovers): http://mail.python.org/pipermail/python-dev/2006-April/064051.html Hye-Shik Chang promised to look for a fix, so no need to fix it here. The tests that are expected to break are: test_codecencodings_cn test_codecencodings_hk test_codecencodings_jp test_codecencodings_kr test_codecencodings_tw test_codecs test_multibytecodec This merge fixes an actual test failure (test_weakref) in this branch, though, so I believe merging is the right thing to do anyway.
50 lines
1.2 KiB
Python
50 lines
1.2 KiB
Python
#!@BINDIR@/python
|
|
|
|
import sys
|
|
import os
|
|
import getopt
|
|
from distutils import sysconfig
|
|
|
|
valid_opts = ['prefix', 'exec-prefix', 'includes', 'libs', 'cflags',
|
|
'ldflags', 'help']
|
|
|
|
def exit_with_usage(code=1):
|
|
print >>sys.stderr, "Usage: %s [%s]" % (sys.argv[0],
|
|
'|'.join('--'+opt for opt in valid_opts))
|
|
sys.exit(code)
|
|
|
|
try:
|
|
opts, args = getopt.getopt(sys.argv[1:], '', valid_opts)
|
|
except getopt.error:
|
|
exit_with_usage()
|
|
|
|
if not opts:
|
|
exit_with_usage()
|
|
|
|
opt = opts[0][0]
|
|
|
|
pyver = sysconfig.get_config_var('VERSION')
|
|
getvar = sysconfig.get_config_var
|
|
|
|
if opt == '--help':
|
|
exit_with_usage(0)
|
|
|
|
elif opt == '--prefix':
|
|
print sysconfig.PREFIX
|
|
|
|
elif opt == '--exec-prefix':
|
|
print sysconfig.EXEC_PREFIX
|
|
|
|
elif opt in ('--includes', '--cflags'):
|
|
flags = ['-I'+dir for dir in getvar('INCLDIRSTOMAKE').split()]
|
|
if opt == '--cflags':
|
|
flags.extend(getvar('CFLAGS').split())
|
|
print ' '.join(flags)
|
|
|
|
elif opt in ('--libs', '--ldflags'):
|
|
libs = sysconfig.get_config_var('LIBS').split()
|
|
libs.append('-lpython'+pyver)
|
|
if opt == '--ldflags':
|
|
libs.insert(0, '-L' + getvar('LIBPL'))
|
|
print ' '.join(libs)
|
|
|