[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Python module macro check
From: |
Ralf Wildenhues |
Subject: |
Re: Python module macro check |
Date: |
Mon, 27 Jun 2005 09:09:40 +0200 |
User-agent: |
Mutt/1.4.1i |
Hi Dave,
* Dave Fancella wrote on Mon, Jun 27, 2005 at 12:49:27AM CEST:
>
> 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.
Small suggestion for your macro: users might want to be able to react
differently to that fact that a macro may not be available. Overridable
optional arguments [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND] would make
this easy. (This situation is common for, say, macros in new versions).
> 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.
I can't speak for the Autoconf developers, but you might just have more
chances of acceptance in the autoconf macro archives[1]. Speaking of,
there seems to be a macro with similar functionality already listed
there, which you may be able to make use of.
Regards,
Ralf
[1] http://autoconf-archive.cryp.to/
http://ac-archive.sourceforge.net/
> 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)
> ])