summaryrefslogtreecommitdiff
path: root/gr-howto-write-a-block/config/gr_python.m4
diff options
context:
space:
mode:
authorJohnathan Corgan2009-11-03 14:24:43 -0800
committerJohnathan Corgan2009-11-03 14:24:43 -0800
commit0bde79ebad973abdcfa23b4d50261fcee39cc28e (patch)
tree1bcc8ed9a899688afe3afdc93e9bcca87a7047b1 /gr-howto-write-a-block/config/gr_python.m4
parent3e366411a75b47eff5f76c76beb1f3a47006f6c7 (diff)
parent26d9beb0b51945915798e75ab24051adaa46d083 (diff)
downloadgnuradio-0bde79ebad973abdcfa23b4d50261fcee39cc28e.tar.gz
gnuradio-0bde79ebad973abdcfa23b4d50261fcee39cc28e.tar.bz2
gnuradio-0bde79ebad973abdcfa23b4d50261fcee39cc28e.zip
Merge branch 'wip/howto' of git@gnuradio.org:jcorgan
* 'wip/howto' of git@gnuradio.org:jcorgan: howto: moved osbsolete docs directory into limbo howto: make swig directory use individual .i files howto: reorganized directory structure howto: implement dynamic versioning howto: update m4 files to match latest master howto: updated INSTALL, fixed mode of config.*
Diffstat (limited to 'gr-howto-write-a-block/config/gr_python.m4')
-rw-r--r--gr-howto-write-a-block/config/gr_python.m444
1 files changed, 44 insertions, 0 deletions
diff --git a/gr-howto-write-a-block/config/gr_python.m4 b/gr-howto-write-a-block/config/gr_python.m4
index 6c862bba3..43ccfc015 100644
--- a/gr-howto-write-a-block/config/gr_python.m4
+++ b/gr-howto-write-a-block/config/gr_python.m4
@@ -123,6 +123,50 @@ 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: 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
+ fi
+])