Glen Starchman <[EMAIL PROTECTED]> writes:

> Anyone have any more Python-specific autoconf macros? 

Not wrapped into a nice macro yet, but INN currently uses the following in
order to get the paths needed to embed Python.  Python 2 has a nicer way
of handling this, but the following works with both 1.5.1 and 2.

dnl Libraries and flags for embedded Python.
dnl FIXME: I wish there was a less icky way to get this.
if test x"$DO_PYTHON" = xdefine ; then
    AC_MSG_CHECKING(for Python linkage)
    py_prefix=`$_PATH_PYTHON -c 'import sys; print sys.prefix'`
    py_ver=`$_PATH_PYTHON -c 'import sys; print sys.version[[:3]]'`
    py_libdir="${py_prefix}/lib/python${py_ver}"
    PYTHON_INC="-I${py_prefix}/include/python${py_ver}"
    py_libs=`grep '^LIBS=' $py_libdir/config/Makefile | sed -e 's/^.*=//'`
    py_libc=`grep '^LIBC=' $py_libdir/config/Makefile | sed -e 's/^.*=//'`
    py_libm=`grep '^LIBM=' $py_libdir/config/Makefile | sed -e 's/^.*=//'`
    py_liblocalmod=`grep '^LOCALMODLIBS=' $py_libdir/config/Makefile | sed -e 's
/^.*=//'`
    py_libbasemod=`grep '^BASEMODLIBS=' $py_libdir/config/Makefile | sed -e 's/^
.*=//'`
    PYTHON_LIB="-L$py_libdir/config $py_libs $py_libc $py_libm -lpython$py_ver $
py_liblocalmod $py_libbasemod"
    PYTHON_LIB=`echo $PYTHON_LIB | sed -e 's/[ \\t]*/ /g'`
    AC_MSG_RESULT($py_libdir)
else
    PYTHON_LIB=""
    PYTHON_INC=""
fi
AC_SUBST(PYTHON_LIB)
AC_SUBST(PYTHON_INC)

-- 
Russ Allbery ([EMAIL PROTECTED])             <http://www.eyrie.org/~eagle/>

Reply via email to