X-Git-Url: https://git.gag.com/?a=blobdiff_plain;ds=sidebyside;f=config%2Fgr_python.m4;h=7aef1662e0a6fb787eb5ed5f7b1f317498e22413;hb=57368f1a3f7f2e92190d72328ff54eb452ba58ed;hp=6c862bba397b2516ef92f92c5f8a403ab8a7d2c7;hpb=90e4faa68bbb21a21a459755942756686985ba46;p=debian%2Fgnuradio diff --git a/config/gr_python.m4 b/config/gr_python.m4 index 6c862bba..7aef1662 100644 --- a/config/gr_python.m4 +++ b/config/gr_python.m4 @@ -123,6 +123,52 @@ print path ;; esac + case $host_os in + *mingw* ) + # Python 2.5 requires ".pyd" instead of ".dll" for extensions + PYTHON_LDFLAGS="-shrext .pyd ${PYTHON_LDFLAGS}" + esac + AC_SUBST(PYTHON_LDFLAGS) fi ]) + +# PYTHON_CHECK_MODULE +# +# Determines if a particular Python module can be imported +# +# $1 - module name +# $2 - module description +# $3 - action if found +# $4 - action if not found +# $5 - test command + +AC_DEFUN([PYTHON_CHECK_MODULE],[ + AC_MSG_CHECKING([for $2]) + dnl ######################################## + dnl # import and test checking + dnl ######################################## + if test "$5"; then + python_cmd=' +try: + import $1 + assert $5 +except ImportError, AssertionError: exit(1) +except: pass' + dnl ######################################## + dnl # import checking only + dnl ######################################## + else + python_cmd=' +try: import $1 +except ImportError: exit(1) +except: pass' + fi + if ! $PYTHON -c "$python_cmd" 2> /dev/null; then + AC_MSG_RESULT([no]) + $4 + else + AC_MSG_RESULT([yes]) + $3 + fi +])