automake
[Top][All Lists]
Advanced

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

Re: distcheck fails (Inclusion confusion)


From: Alexandre Duret-Lutz
Subject: Re: distcheck fails (Inclusion confusion)
Date: Mon, 08 Sep 2003 01:01:25 +0200
User-agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3 (gnu/linux)

>>> "Christian" == Christian Neumair <address@hidden> writes:

 Christian> I added the following to configure.in:
 Christian> PYTHON_CFLAGS="-I$PYTHON_PREFIX/include/python$PYTHON_VERSION"
 Christian> AC_SUBST(PYTHON_CFLAGS)
[...]
 Christian> What have I done wrong?

You are assuming that Python has been installed where your package
will be installed.  With the same --prefix, I mean.

Automake is only concerned by compilation and installation of
Python scripts.  The variable it supplies are useful during
_installation_, they are not something you should use to read
files from.  Just like nobody would write something like
-I$(includedir) because includedir is the place where headers
_will_ be installed and the user can change it, you should not
even think about writing something that starts with
-I$PYTHON_PREFIX because this is an installation variable that
the user can change (and so does distcheck, as you've seen).

If you need to compile against some Python header and need to
find out the path, write your own check for this.  I've been
using the following macro recently, but there are numerous
packages out there with more complete tests that you can borrow.

AC_DEFUN([adl_CHECK_PYTHON], 
 [AM_PATH_PYTHON([2.0])
  AC_CACHE_CHECK([for $PYTHON includes directory],
    [adl_cv_python_inc],
    [adl_cv_python_inc=`$PYTHON -c "from distutils import sysconfig; print 
sysconfig.get_python_inc()" 2>/dev/null`])
  AC_SUBST([PYTHONINC], [$adl_cv_python_inc])])

-- 
Alexandre Duret-Lutz





reply via email to

[Prev in Thread] Current Thread [Next in Thread]