Mercurial > pidgin
diff finch/libgnt/configure.ac @ 21800:73aab5bdd830
Allow loading python scripts at runtime.
Things can go wrong if a script starts its own mainloop, or blocks on something.
For now, a script can check for a positive return value from 'gobject.main_depth()'
to determine that it's being loaded at runtime, and not start its own mainloop.
author | Sadrul Habib Chowdhury <imadil@gmail.com> |
---|---|
date | Sun, 09 Dec 2007 00:56:29 +0000 |
parents | ca3271a66314 |
children | a0b0d20ba15a |
line wrap: on
line diff
--- a/finch/libgnt/configure.ac Fri Dec 07 22:14:23 2007 +0000 +++ b/finch/libgnt/configure.ac Sun Dec 09 00:56:29 2007 +0000 @@ -302,6 +302,34 @@ *** You need ncursesw or ncurses and its header files.]) fi +dnl Check for Python headers (currently useful only for libgnt) +dnl (Thanks to XChat) +AC_PATH_PROG(pythonpath, python) +if test "_$pythonpath" != _ ; then + AC_MSG_CHECKING(for Python compile flags) + PY_PREFIX=`$pythonpath -c 'import sys ; print sys.prefix'` + PY_EXEC_PREFIX=`$pythonpath -c 'import sys ; print sys.exec_prefix'` + changequote(<<, >>)dnl + PY_VERSION=`$pythonpath -c 'import sys ; print sys.version[0:3]'` + PY_MAJOR=`$pythonpath -c 'import sys ; print sys.version[0:2]'` + changequote([, ])dnl + if test -f $PY_PREFIX/include/python$PY_VERSION/Python.h -a "$PY_MAJOR" = "2."; then + AC_CHECK_LIB(pthread, pthread_create, ) + AC_CHECK_LIB(util, openpty, ) + AC_CHECK_LIB(db, dbopen, ) + PY_LIBS="-lpython$PY_VERSION -L$PY_EXEC_PREFIX/lib/python$PY_VERSION/config" + PY_CFLAGS="-I$PY_PREFIX/include/python$PY_VERSION" + AC_DEFINE(USE_PYTHON, [1], [Define if python headers are available.]) + AC_MSG_RESULT(ok) + else + AC_MSG_RESULT([Can't find Python.h]) + PY_LIBS="" + PY_CFLAGS="" + fi +fi +AC_SUBST(PY_CFLAGS) +AC_SUBST(PY_LIBS) + dnl Check for libxml have_libxml=yes PKG_CHECK_MODULES(LIBXML, [libxml-2.0], , [