1 # ===========================================================================
2 # http://www.gnu.org/software/autoconf-archive/ax_python_module.html
3 # ===========================================================================
7 # AX_PYTHON_MODULE(modname[, fatal])
11 # Checks for Python module.
13 # If fatal is non-empty then absence of a module will trigger an error.
17 # Copyright (c) 2008 Andrew Collier
19 # Copying and distribution of this file, with or without modification, are
20 # permitted in any medium without royalty provided the copyright notice
21 # and this notice are preserved. This file is offered as-is, without any
26 AU_ALIAS([AC_PYTHON_MODULE], [AX_PYTHON_MODULE])
27 AC_DEFUN([AX_PYTHON_MODULE],[
32 PYTHON_NAME=`basename $PYTHON2`
33 AC_MSG_CHECKING($PYTHON_NAME module: $1)
34 $PYTHON2 -c "import $1" 2>/dev/null
38 eval AS_TR_CPP(HAVE_PYMOD_$1)=yes
41 eval AS_TR_CPP(HAVE_PYMOD_$1)=no
45 AC_MSG_ERROR(failed to find required module $1)