Sample distutil setup.py script that uses SWIG and C++?

A. B., Khalid abkhd at earth.co.jp
Mon Sep 13 16:52:36 EDT 2004


kdahlhaus at yahoo.com (Kevin Dahlhausen) wrote in message news:<283adf56.0409130434.2ae0ba73 at posting.google.com>...
> Could anyone post a simple setup.py script that uses a SWIG interface
> to C++ code  and the mingw compiler?
> 
> I followed some online samples, and am using the setup.cfg file to
> specify swig-c++=1.
> 
> Trying to build using mingw out of the cygwin environment but the
> final call to link the extension calls directly to 'cc' which I think
> should really be g++ at that point.
> 
> Did get everything to build with a Makefile, but that's not the right
> way to go.


Maybe my pyMinGW can help you. Though still not 100% done, pyMinGW
includes a patch to distutils so as (among other things) to fix that
which you ask about.

Read about pyMinGW here:
http://jove.prohosting.com/iwave/ipython/pyMinGW.html

There is also a CPP-Swig example found in the Mingw\extensions
directory of both py24a3MinGW-004a.zip, and py234MinGW-015.zip.

Before you do anything, please backup the following files:

    [1] Lib/distutils/ccompiler.py
    [2] Lib/distutils/cygwinccompiler.py
    [3] Lib/distutils/unixccompiler.py
    [4] Lib/distutils/command/build_ext.py


in case you don't like the patch, and would like to restore your
distutils to its original state. Once you've done that then you can
replace those four files with the ones in the patch. Hopefully that'll
do it for you.



--
Q. The purpose of life?

[A]: "I created the jinn and humankind only that they might 
     worship Me." (Translation, Qur'an, 51:56)

[B]: "Let us hear the conclusion of the whole matter: 
     Fear God, and keep his commandments: for this is the 
     whole duty of man." (KJV, Ecclesiastes 12:13)



More information about the Python-list mailing list