2
0
mirror of https://gitlab.com/ita1024/waf.git synced 2024-11-22 18:07:12 +01:00

Added crutches for python-config detection on Python 2.5

This commit is contained in:
Thomas Nagy 2014-09-28 23:07:02 +02:00
parent c422a1c647
commit 9a0a7ca562
No known key found for this signature in database
GPG Key ID: 67A565EDFDF90E64
3 changed files with 13 additions and 6 deletions

View File

@ -12,6 +12,7 @@ NEW IN WAF 1.8.0
* Generic configuration tests
* Better unicode handlig in scripts and in file names
* Shorter build outputs
* Python 2.5 is now required for all functionality (compatibility with Python 2.4 is limited)
NEW IN WAF 1.7.11
-----------------

View File

@ -269,17 +269,23 @@ def check_python_headers(conf):
num = '.'.join(env['PYTHON_VERSION'].split('.')[:2])
conf.find_program([''.join(pybin) + '-config', 'python%s-config' % num, 'python-config-%s' % num, 'python%sm-config' % num], var='PYTHON_CONFIG', msg="python-config")
flags = ['--cflags', '--libs', '--ldflags']
# oh great, python2.5-config requires 3 runs
all_flags = [['--cflags', '--libs', '--ldflags']]
if sys.hexversion < 0x2060000:
all_flags = [[x] for x in all_flags[0]]
xx = conf.env.CXX_NAME and 'cxx' or 'c'
conf.check_cfg(msg='Asking python-config for pyembed %r flags' % ' '.join(flags),
path=conf.env.PYTHON_CONFIG, package='', uselib_store='PYEMBED', args=flags)
for flags in all_flags:
conf.check_cfg(msg='Asking python-config for pyembed %r flags' % ' '.join(flags), path=conf.env.PYTHON_CONFIG, package='', uselib_store='PYEMBED', args=flags)
conf.check(header_name='Python.h', define_name='HAVE_PYEMBED', msg='Getting pyembed flags from python-config',
fragment=FRAG, errmsg='Could not build a python embedded interpreter',
features='%s %sprogram pyembed' % (xx, xx))
conf.check_cfg(msg='Asking python-config for pyext %r flags' % ' '.join(flags),
path=conf.env.PYTHON_CONFIG, package='', uselib_store='PYEXT', args=flags)
for flags in all_flags:
conf.check_cfg(msg='Asking python-config for pyext %r flags' % ' '.join(flags), path=conf.env.PYTHON_CONFIG, package='', uselib_store='PYEXT', args=flags)
conf.check(header_name='Python.h', define_name='HAVE_PYEXT', msg='Getting pyext flags from python-config',
features='%s %sshlib pyext' % (xx, xx), fragment=FRAG, errmsg='Could not build python extensions')

View File

@ -58,7 +58,7 @@ def subst(*k):
@subst('*')
def r3(code):
if sys.hexversion < 0x2500000:
if sys.hexversion < 0x2050000:
code = code.replace(',extra={', ') #extra={')
return code