Debian wheezy swig2.0-examples package missing configure file

This post is esoteric, but in the off-chance someone else needs it, hopefully google brought you here.

I’m looking into using SWIG to wrap up a c++ app in python. How to do this for more than a small one class or one file code-base is far from clear. So I tried installing the swig2.0-examples debian package for Wheezy. My progress went like this:

  1. cd into /usr/share/doc/swig2.0-examples/python/import
  2. sudo make
  3. It doesn’t work

All sorts of compiler / make complaints about undefined symbols such as @CXX@. What’s up with that? It turns out the Makefile depends on a master makefile in /usr/share/doc/swig2.0-examples/, which is missing. There *is* an autoconf generated Makefile.in, but no configure script to define the flags for the given host system. It turns out that downloading the source package and running the configure script that is included therein will generate the Makefiles needed:

$ wget http://ftp.de.debian.org/debian/pool/main/s/swig2.0/swig2.0_2.0.7.orig.tar.gz
$ gunzip swig2.0_2.0.7.orig.tar.gz && tar xvf swig2.0_2.0.7.orig.tar
$ cd swig-2.0.7 && ./configure
$ sudo cp Makefile /usr/share/doc/swig2.0-examples

Et voila, the build now succeeds:

lee@beehive:/usr/share/doc/swig2.0-examples/python/import$ sudo make
make -f ../../Makefile SWIG='swig' SWIGOPT='' \
LIBS='' TARGET='base' INTERFACE='base.i' python_cpp
make[1]: Entering directory `/usr/share/doc/swig2.0-examples/python/import'
swig -python -c++ base.i
g++ -c -fpic base_wrap.cxx -I/usr/include/python2.7 -I/usr/lib/python2.7/config
g++ -shared base_wrap.o -o _base.so
make[1]: Leaving directory `/usr/share/doc/swig2.0-examples/python/import'
make -f ../../Makefile SWIG='swig' SWIGOPT='' \
LIBS='' TARGET='foo' INTERFACE='foo.i' python_cpp
make[1]: Entering directory `/usr/share/doc/swig2.0-examples/python/import'
swig -python -c++ foo.i
g++ -c -fpic foo_wrap.cxx -I/usr/include/python2.7 -I/usr/lib/python2.7/config
g++ -shared foo_wrap.o -o _foo.so
make[1]: Leaving directory `/usr/share/doc/swig2.0-examples/python/import'
make -f ../../Makefile SWIG='swig' SWIGOPT='' \
LIBS='' TARGET='bar' INTERFACE='bar.i' python_cpp
make[1]: Entering directory `/usr/share/doc/swig2.0-examples/python/import'
swig -python -c++ bar.i
g++ -c -fpic bar_wrap.cxx -I/usr/include/python2.7 -I/usr/lib/python2.7/config
g++ -shared bar_wrap.o -o _bar.so
make[1]: Leaving directory `/usr/share/doc/swig2.0-examples/python/import'
make -f ../../Makefile SWIG='swig' SWIGOPT='' \
LIBS='' TARGET='spam' INTERFACE='spam.i' python_cpp
make[1]: Entering directory `/usr/share/doc/swig2.0-examples/python/import'
swig -python -c++ spam.i
g++ -c -fpic spam_wrap.cxx -I/usr/include/python2.7 -I/usr/lib/python2.7/config
g++ -shared spam_wrap.o -o _spam.so
make[1]: Leaving directory `/usr/share/doc/swig2.0-examples/python/import'

Advertisements