Message131357
python-config has the following non-trivial code for discovery of cflags/ldflags, which should be callable as a sysconfig API instead:
elif opt in ('--includes', '--cflags'):
flags = ['-I' + sysconfig.get_path('include'),
'-I' + sysconfig.get_path('platinclude')]
if opt == '--cflags':
flags.extend(getvar('CFLAGS').split())
print(' '.join(flags))
elif opt in ('--libs', '--ldflags'):
libs = getvar('LIBS').split() + getvar('SYSLIBS').split()
libs.append('-lpython' + pyver + sys.abiflags)
# add the prefix/lib/pythonX.Y/config dir, but only if there is no
# shared library in prefix/lib/.
if opt == '--ldflags':
if not getvar('Py_ENABLE_SHARED'):
libs.insert(0, '-L' + getvar('LIBPL'))
libs.extend(getvar('LINKFORSHARED').split())
print(' '.join(libs))
Also, it begs the question why distutils doesn't use the same code in its compiler class, or even in customize_compiler()... |
|
Date |
User |
Action |
Args |
2011-03-18 19:11:18 | pitrou | set | recipients:
+ pitrou, tarek, eric.araujo |
2011-03-18 19:11:18 | pitrou | set | messageid: <1300475478.49.0.935411639754.issue11602@psf.upfronthosting.co.za> |
2011-03-18 19:11:17 | pitrou | link | issue11602 messages |
2011-03-18 19:11:17 | pitrou | create | |
|