diff options
-rw-r--r-- | config/gr_python.m4 | 32 | ||||
-rw-r--r-- | config/grc_grc.m4 | 35 | ||||
-rw-r--r-- | usrp/host/lib/legacy/db_xcvr2450.cc | 2 |
3 files changed, 28 insertions, 41 deletions
diff --git a/config/gr_python.m4 b/config/gr_python.m4 index ea6df49c4..7479f0533 100644 --- a/config/gr_python.m4 +++ b/config/gr_python.m4 @@ -135,20 +135,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 ]) diff --git a/config/grc_grc.m4 b/config/grc_grc.m4 index d1e343988..2bb80a3d5 100644 --- a/config/grc_grc.m4 +++ b/config/grc_grc.m4 @@ -26,38 +26,13 @@ AC_DEFUN([GRC_GRC],[ AM_CONDITIONAL(XDG_UTILS, $XDG_UTILS) dnl ######################################## - dnl # test python version - dnl ######################################## - AC_MSG_CHECKING([for Python version >= 2.5]) - result=`${PYTHON} -c "import sys; print sys.version.split()[[0]] >= '2.5'"` - if test "$result" = "True"; then - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) - passed=no - fi - - dnl ######################################## - dnl # test python dependencies - dnl ######################################## - if test $passed = yes; then - PYTHON_CHECK_MODULE([Cheetah],[Python Cheetah templates],[],[passed=no]) - PYTHON_CHECK_MODULE([lxml],[Python XML wrappers],[],[passed=no]) - PYTHON_CHECK_MODULE([pygtk],[Python GTK wrappers],[],[passed=no]) - fi - - dnl ######################################## - dnl # test gtk version + dnl # test python modules and versions dnl ######################################## if test $passed = yes; then - AC_MSG_CHECKING([for Python GTK version >= 2.10.0]) - result=`${PYTHON} -c "import gtk; print gtk.pygtk_version >= (2, 10, 0)" 2> /dev/null` - if test "$result" = "True"; then - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) - passed=no - fi + PYTHON_CHECK_MODULE([sys],[Python >= 2.5],[],[passed=no],[sys.version.split()[[0]] >= "2.5"]) + PYTHON_CHECK_MODULE([Cheetah],[Python Cheetah templates >= 2.0.1],[],[passed=no],[Cheetah.Version >= "2.0.0"]) + PYTHON_CHECK_MODULE([lxml.etree],[Python lxml wrappers >= 2.0.0],[],[passed=no],[lxml.etree.LXML_VERSION >= (2, 0, 0, 0)]) + PYTHON_CHECK_MODULE([gtk],[Python gtk wrappers >= 2.10.0],[],[passed=no],[gtk.pygtk_version >= (2, 10, 0)]) fi dnl ######################################## diff --git a/usrp/host/lib/legacy/db_xcvr2450.cc b/usrp/host/lib/legacy/db_xcvr2450.cc index fe9e4ff28..ed8d70a7f 100644 --- a/usrp/host/lib/legacy/db_xcvr2450.cc +++ b/usrp/host/lib/legacy/db_xcvr2450.cc @@ -271,7 +271,7 @@ xcvr2450::send_reg(int v) std::string s(c, 3); usrp()->_write_spi(0, d_spi_enable, d_spi_format, s); - //printf("xcvr2450: Setting reg %d to %06X\n", (v&15), v); + printf("xcvr2450: Setting reg %d to %X\n", (v&15), v); } // -------------------------------------------------------------------- |