This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author pitrou
Recipients eric.araujo, pitrou, tarek
Date 2011-03-18.19:11:17
SpamBayes Score 0.0020443462
Marked as misclassified No
Message-id <1300475478.49.0.935411639754.issue11602@psf.upfronthosting.co.za>
In-reply-to
Content
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()...
History
Date User Action Args
2011-03-18 19:11:18pitrousetrecipients: + pitrou, tarek, eric.araujo
2011-03-18 19:11:18pitrousetmessageid: <1300475478.49.0.935411639754.issue11602@psf.upfronthosting.co.za>
2011-03-18 19:11:17pitroulinkissue11602 messages
2011-03-18 19:11:17pitroucreate