[xml] Re: libxml2-2.6.11 -- detection of Python in configure

Peter Breitenlohner wrote:

I just noticed a peculiarity in the way configure detects the presence of
Python (pyhon2.3 is installed under /usr/local):

with "configure" I get
    checking for python... /usr/local/bin/python
    Found Python version 2.3
    could not find python2.3/Python.h
whereas with "configure --prefix=/usr/local" python2.3/Python.h is found in
/usr/local/include and consequently the python bindings are built and
installed (not that I really need them).

Why this different behaviour when prefix defaults to /usr/local or is
explicitly specified as such?

I don't know the answer to that question, but in general it would be optimal to ask the Python in question wheere its include files were, rather than trying to guess the location. The apposite function is 'distutils.sysconfig.get_python_inc':

  def get_python_inc(plat_specific=0, prefix=None):
      """Return the directory containing installed Python header files.

      If 'plat_specific' is false (the default), this is the path to the
      non-platform-specific header files, i.e. Python.h and so on;
      otherwise, this is the path to platform-specific header files
      (namely pyconfig.h).

      If 'prefix' is supplied, use it instead of sys.prefix or
      sys.exec_prefix -- i.e., ignore 'plat_specific'.

Tres Seaver                                tseaver zope com
Zope Corporation      "Zope Dealers"       http://www.zope.com

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]