1 ##### http://autoconf-archive.cryp.to/ac_python_module.html
5 # AC_PYTHON_MODULE(modname[, fatal])
9 # Checks for Python module.
11 # If fatal is non-empty then absence of a module will trigger an
20 # Copyright (c) 2007 Andrew Collier <colliera@ukzn.ac.za>
22 # Copying and distribution of this file, with or without
23 # modification, are permitted in any medium without royalty provided
24 # the copyright notice and this notice are preserved.
26 AC_DEFUN([AC_PYTHON_MODULE],[
31 PYTHON_NAME=`basename $PYTHON`
32 AC_MSG_CHECKING($PYTHON_NAME module: $1)
33 $PYTHON -c "import $1" 2>/dev/null
37 eval AS_TR_CPP(HAVE_PYMOD_$1)=yes
40 eval AS_TR_CPP(HAVE_PYMOD_$1)=no
44 AC_MSG_ERROR(failed to find required module $1)
51 dnl AS_AC_EXPAND(VAR, CONFIGURE_VAR)
54 dnl AS_AC_EXPAND(SYSCONFDIR, $sysconfdir)
55 dnl will set SYSCONFDIR to /usr/local/etc if prefix=/usr/local
57 AC_DEFUN([AS_AC_EXPAND],
62 dnl first expand prefix and exec_prefix if necessary
64 exec_prefix_save=$exec_prefix
66 dnl if no prefix given, then use /usr/local, the default prefix
67 if test "x$prefix" = "xNONE"; then
68 prefix=$ac_default_prefix
70 dnl if no exec_prefix given, then use prefix
71 if test "x$exec_prefix" = "xNONE"; then
76 dnl loop until it doesn't change anymore
78 new_full_var="`eval echo $full_var`"
79 if test "x$new_full_var" = "x$full_var"; then break; fi
80 full_var=$new_full_var
84 full_var=$new_full_var
85 AC_SUBST([$1], "$full_var")
87 dnl restore prefix and exec_prefix
89 exec_prefix=$exec_prefix_save