extending and embedding python without distutils

Benjamin Rutt rutt at bmi.osu.edu
Mon Sep 26 09:35:44 EDT 2005


I have a rather large C++ project which has his own build system
(scons) and I would prefer to stay inside scons in order to build some
python extensions/embeddings (that is, I prefer to avoid using
distutils directly to build my extensions).

Can someone confirm that I'm doing the right thing to pick up the
necessary dependencies to pick up the compilation flags (the first
output line below, once I prefix it with '-I'), location of
libpythonX.X.a (the second output line below, once I prefix it with
'-L'), and dependent linking libraries (the last three output lines
below).  This is the type of thing that pkg-config normally solves on
linux.  (I'd have to add -lpythonX.X to my build commands, which I can
do separately by grabbing the major and minor version and building up
a string).

  >>> import distutils.sysconfig
  >>> for v in 'INCLUDEPY', 'LIBPL', 'LOCALMODLIBS', 'BASEMODLIBS', 'LIBS':
  ...     print distutils.sysconfig.get_config_var(v)
  ... 
  /home/rutt/.upak/installed/python-2.4/include/python2.4
  /home/rutt/.upak/installed/python-2.4/lib/python2.4/config
  -L/home/rutt/.upak/installed/tcltk/lib -L/usr/X11R6/lib -ltk8.4 -ltcl8.4 -lX11
  
  -lpthread -ldl  -lutil

The purpose of this posting is to see if anyone jumps in and says
"hey, you missed a variable called ...".  Thanks,
-- 
Benjamin Rutt



More information about the Python-list mailing list