[PATCH]: lang/python26+ must not set OPT
Marcus von Appen
mva at FreeBSD.org
Wed Jun 6 21:50:21 UTC 2012
On, Wed Jun 06, 2012, Marcus von Appen wrote:
[OPT cleanup]
The patch actually is wrong. It should be the other way around, since
OPT gets included by the CFLAGS of the python build as well as for every
python package depending on distutils:
distutils/sysconfig.py,
def customize_compiler(compiler):
[...]
if compiler.compiler_type == "unix":
(cc, cxx, opt, cflags, ccshared, ldshared, so_ext, ar, ar_flags) = \
get_config_vars('CC', 'CXX', 'OPT', 'CFLAGS',
'CCSHARED', 'LDSHARED', 'SO', 'AR',
'ARFLAGS')
[...]
if 'CFLAGS' in os.environ:
cflags = opt + ' ' + os.environ['CFLAGS']
ldshared = ldshared + ' ' + os.environ['CFLAGS']
As shown above, opt is always appended to distutils's CFLAGS settings
for the C compiler, hence every additional flags we usually would pass
to CFLAGS or CPPFLAGS in a port's Makefile, would need to go into OPTS
instead, to be consistent and guaranteed to be applied (since CFLAGS
from config/Makefile is not necessarily used).
A slight issue with the LDFLAGS remains for the python-config script,
which does not pick up Python's LDFLAGS, but uses LIBS, SYSLIBS and
LIBPL install, omitting any additional LDFLAGS specified elsewhere.
Both, the OPT assignment and python-config LDFLAGS behaviour need to be
fixed in that aspect (patches will follow).
Cheers
Marcus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-python/attachments/20120606/b114e462/attachment.pgp
More information about the freebsd-python
mailing list