[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Python module macro check
From: |
Dave Fancella |
Subject: |
Re: Python module macro check |
Date: |
Mon, 27 Jun 2005 03:50:26 -0500 |
User-agent: |
KMail/1.7.2 |
On Monday 27 June 2005 02:09 am, Ralf Wildenhues wrote:
> 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).
Hmmm, it was my first ever m4 macro. I'll be happy to fix it to be like that,
I was trying to imitate other autoconf macros. :) I could use a pointer to
some documentation on the subject, though. I think I need to learn another
macro language just to understand the m4 manual. Or I need a nap, one of the
two.
> 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.
Which one? Turns out those links are purple in my browser, so I guess I
visited there looking for python macros already. :) The only one I found,
while very useful, only checks the python version. There is one that ships
with (I forget which) either autoconf or automake that sets a bunch of
variables with things like Python's package directory and so forth. What I
didn't find was a macro to check for specific python modules installed and
available for use by python programs. Heck, not even distutils will let you
check for that stuff. Hmmm, there is a way, but it's a hack on top of
distutils (or at least, I think it is, possible others disagree with me *and*
are right).
Dave
> 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)
> > ])