Embedding and makefile stuff
greg andruk
meowing at banet.net
Mon May 17 15:52:03 EDT 1999
So I was hacking Python support into an ancient, bloated product
that's in dire need of a third embedded language. It works fine, but
now it's time to hammer autoconfig into submission so it won't only
run on one machine.
Is there a decent way under U*X to find out what libraries libpython
depends on, that's less icky than doing something like this? Grepping
a makefile seems Wrong, and it would be oh-so-cool if it turns out
there's a super secret sys.something entry I've overlooked.
The ugly configure.in snippet:
=-=-=
py_prefix=`$_PATH_PYTHON -c 'import sys; print sys.prefix'`
py_vers=`$_PATH_PYTHON -c 'import sys; print sys.version[[:3]]'`
py_libdir="$py_prefix/lib/python$py_vers"
PYTHON_INC="-I$py_prefix/include/python$py_vers"
dnl FIXME: I wish there was a less icky way to get this.
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/^.*=//'`
PYTHON_LIB="-L$py_libdir $py_libs $py_libc $py_libm -lpython$py_vers"
PYTHON_LIB=`echo $PYTHON_LIB | sed -e 's/[ \\t]*/ /g'`
AC_MSG_RESULT($py_libdir)
=-=-=
I have a feeling I'm doomed, but it can't hurt to ask. I hope.
--
Misc. Meowing: <URL:http://members.xoom.com/meowing/> **meow**
More information about the Python-list
mailing list