New submission from Antoine Pitrou <pit...@free.fr>: 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()... ---------- assignee: tarek components: Distutils messages: 131357 nosy: eric.araujo, pitrou, tarek priority: normal severity: normal stage: needs patch status: open title: python-config code should be in sysconfig type: behavior versions: Python 3.2, Python 3.3 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue11602> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com