1 # ===========================================================================
2 # https://www.gnu.org/software/autoconf-archive/ax_python_module.html
3 # ===========================================================================
7 # AX_PYTHON_MODULE(modname[, fatal, python])
11 # Checks for Python module.
13 # If fatal is non-empty then absence of a module will trigger an error.
14 # The third parameter can either be "python" for Python 2 or "python3" for
15 # Python 3; defaults to Python 3.
19 # Copyright (c) 2008 Andrew Collier
21 # Copying and distribution of this file, with or without modification, are
22 # permitted in any medium without royalty provided the copyright notice
23 # and this notice are preserved. This file is offered as-is, without any
28 AU_ALIAS([AC_PYTHON_MODULE], [AX_PYTHON_MODULE])
29 AC_DEFUN([AX_PYTHON_MODULE],[
39 PYTHON_NAME=`basename $PYTHON`
40 AC_MSG_CHECKING($PYTHON_NAME module: $1)
41 $PYTHON -c "import $1" 2>/dev/null
45 eval AS_TR_CPP(HAVE_PYMOD_$1)=yes
48 eval AS_TR_CPP(HAVE_PYMOD_$1)=no
52 AC_MSG_ERROR(failed to find required module $1)