autoconf
[Top][All Lists]
Advanced

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

Python module macro check


From: Dave Fancella
Subject: Python module macro check
Date: Sun, 26 Jun 2005 17:49:27 -0500
User-agent: KMail/1.7.2

All,

This is a drive-by submission, so I didn't subscribe to the list.

I've written a python module check macro for autoconf.  It's pretty short, 
I'll stick it at the end of this email.

Use it like this:

AC_PYTHON_MODULE(wx)
(checks for wxPython)

As you'll see in the macro, it just fires up Python and tries to import the 
module you pass.

If you guys take it, I'd appreciate a response just so I'll know when the next 
version comes out to start using it from there instead of using my own 
acinclude file.

Otherwise, hope this helps somebody.  :)

Dave

dnl macro that checks for specific modules in python
AC_DEFUN([AC_PYTHON_MODULE],
[AC_MSG_CHECKING(for module $1 in python)
echo "import $1" | python -
if test $? -ne 0 ; then
AC_MSG_RESULT(not found)
AC_MSG_ERROR(You need the module $1 available to python for this package)
fi
AC_MSG_RESULT(found)
])





reply via email to

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