Title: distutils support for swig is under par
Type: behavior Stage:
Components: Distutils Versions: Python 3.1, Python 3.2, Python 2.7
Status: open Resolution:
Dependencies: Superseder:
Assigned To: tarek Nosy List: Jeff.Laughlin, akitada, sjoerd, tarek, theller
Priority: normal Keywords:

Created on 2004-08-26 09:11 by sjoerd, last changed 2010-12-03 21:04 by Jeff.Laughlin.

Messages (7)
msg60555 - (view) Author: Sjoerd Mullender (sjoerd) * (Python committer) Date: 2004-08-26 09:11
To my delight there is support for swig built into
distutils.  However a few problems exist with the support.

- there is no way to specify any extra flags to the
swig command (I need -I/usr/include -DHAVE_LONG_LONG);
- swig generates two files, the XXX_wrap.c file which
is turned into a file, and a file. 
distutils only deals with the XXX_wrap.c file.

I have no suggested fix for these problems, but
problems they are.

(Python from CVS HEAD on Fedora Core 2).
msg60556 - (view) Author: Sjoerd Mullender (sjoerd) * (Python committer) Date: 2004-10-15 14:27
Logged In: YES 

Part of the problem described here (the extra options that
need to be given to swig) is solved by [ 1046644 ] improving
distutils swig support (2).  However, the other part is
still a problem.
msg60557 - (view) Author: Sjoerd Mullender (sjoerd) * (Python committer) Date: 2004-10-15 14:37
Logged In: YES 

I just came up with a possible solution:

In command/ change the order of the
build.sub_commands list and put the entry for build_ext
before build_py.

The question is, does this cause a problem for anybody?
msg60558 - (view) Author: Thomas Heller (theller) * (Python committer) Date: 2004-10-15 15:34
Logged In: YES 

Haven't read the original problem (I don't use swig myself),
but if changing the order of the sub_commands list than it
can as well be done in the setup script by installing a
custom build command.
msg60559 - (view) Author: Sjoerd Mullender (sjoerd) * (Python committer) Date: 2004-10-15 18:07
Logged In: YES 

Hmm, you can't really call that "decent swig support" then,
can you?
If this "solution" were properly documented (in a place one
would notice when trying to create a to do swig!)
then it wouldn't be too much of a problem, but I wouldn't
know where that would be.

So, if my change doesn't cause any detrimental effects I'd
much rather see it fixed that way.
msg60560 - (view) Author: Thomas Heller (theller) * (Python committer) Date: 2004-10-15 18:19
Logged In: YES 

> Hmm, you can't really call that "decent swig support"
then, can you?

Of course not ;-)

And I have setup scripts myself which would be more happy
with this change, anyway, because they need the extensions
built with build_ext to generate python modules.

So, personally, I'm +1 on this change (but what does this
msg81410 - (view) Author: Akira Kitada (akitada) * Date: 2009-02-08 19:08
Same with issue2624?
Date User Action Args
2010-12-03 21:04:01Jeff.Laughlinsetnosy: + Jeff.Laughlin
2010-08-19 16:07:58BreamoreBoysetversions: + Python 3.2
2009-02-08 19:34:47tareksetassignee: tarek
type: behavior
versions: + Python 3.1, Python 2.7
2009-02-08 19:08:51akitadasetnosy: + tarek, akitada
messages: + msg81410
2004-08-26 09:11:49sjoerdcreate