[issue291] Possible enhancement to smart setup.py

Herton Ronaldo Krzesinski at Labix Tracker tracker at labix.org
Mon Mar 5 19:12:01 PST 2007


New submission from Herton Ronaldo Krzesinski <herton at gmail.com>:

Here in my system (x86_64), build of smart fails because my
/usr/include/python2.5/pyconfig.h has the following content:

#include <bits/wordsize.h>

#if __WORDSIZE == 32
#include "pyconfig_32.h"
#elif __WORDSIZE == 64
#include "pyconfig_64.h"
#endif

If I remember correctly this is because I have my python to accept
setup/compiling of modules also on 32 bits, so if I'm compiling a python package
that has #include <pyconfig.h> gcc will pick the right pyconfig header with the
right defines. But this made by hand pyconfig is breaking smart build (tested
with latest 0.50), because setup.py from the package reads the header without
preprocessing it:

config_h = sysconfig.get_config_h_filename()
config_h_vars = sysconfig.parse_config_h(open(config_h))

so config_h_vars only gets the contents of the "meta" pyconfig.h above, doesn't
gets any define, and build breaks (as there will not be any defines that are
required like the HAVE_MEMMOVE etc.)

replacing the above config_h_vars assignment with this resolves the issue:

pipe = os.popen3("gcc -E -dD %s" % config_h)
config_h_vars = sysconfig.parse_config_h(pipe[1])
for p in pipe:
    p.close()

I'm not sure if this is the best patch as my python knowledge is very limited,
and if it's useful out of my python version, but can help someone or be useful.
I'm also attaching the full patch.

----------
files: smart-0.50-preprocess_pyconfig.patch
messages: 1112
nosy: herton
priority: feature
project: smart
status: unread
title: Possible enhancement to smart setup.py

_______________________________________
Labix issue tracker <tracker at labix.org>
<http://tracker.labix.org/issue291>
_______________________________________
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smart-0.50-preprocess_pyconfig.patch
Type: application/octet-stream
Size: 471 bytes
Desc: not available
URL: <http://lists.labix.org/pipermail/smart-labix.org/attachments/20070306/41617e90/attachment-0002.obj>


More information about the Smart mailing list