X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=config%2Fgr_python.m4;h=43ccfc01575f5e0c53cab03a12f603e92c10c64b;hb=27ada0c49b62a8b1151089cae976228b41575c3c;hp=ea6df49c44c3be821118d91aad7dd23e70a3a394;hpb=7ea75f891baabf0612f09e14353552bd33413dc8;p=debian%2Fgnuradio diff --git a/config/gr_python.m4 b/config/gr_python.m4 index ea6df49c..43ccfc01 100644 --- a/config/gr_python.m4 +++ b/config/gr_python.m4 @@ -123,6 +123,12 @@ 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 ]) @@ -135,20 +141,32 @@ print path # $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]) - python_cmd='import sys + AC_MSG_CHECKING([for $2]) + dnl ######################################## + dnl # import and test checking + dnl ######################################## + if test "$5"; then + python_cmd=' try: import $1 -except: - sys.exit(1)' - - if ! $PYTHON -c "$python_cmd" ; then - AC_MSG_RESULT([no]) - $4 + assert $5 +except: exit(1)' + dnl ######################################## + dnl # import checking only + dnl ######################################## + else + python_cmd=' +try: import $1 +except: exit(1)' + fi + if ! $PYTHON -c "$python_cmd" 2> /dev/null; then + AC_MSG_RESULT([no]) + $4 else - AC_MSG_RESULT([yes]) - $3 + AC_MSG_RESULT([yes]) + $3 fi ])