Fixes ./configure to allow grc to build without an X session
authorJason Abele <jason@ettus.com>
Thu, 29 Jul 2010 21:57:09 +0000 (14:57 -0700)
committerJason Abele <jason@ettus.com>
Thu, 29 Jul 2010 23:07:12 +0000 (16:07 -0700)
    Presently, a ./configure in a terminal with no X $DISPLAY will
    fail to build grc because import gtk fails with RuntimeError
    exception.

    This patch fixes this by catching just the ImportError and
    AssertionErrors we need for python module dependencies.

config/gr_python.m4

index 43ccfc01575f5e0c53cab03a12f603e92c10c64b..7aef1662e0a6fb787eb5ed5f7b1f317498e22413 100644 (file)
@@ -153,14 +153,16 @@ AC_DEFUN([PYTHON_CHECK_MODULE],[
 try:
     import $1
     assert $5
-except: exit(1)'
+except ImportError, AssertionError: exit(1)
+except: pass'
     dnl ########################################
     dnl # import checking only
     dnl ########################################
     else
         python_cmd='
 try: import $1
-except: exit(1)'
+except ImportError: exit(1)
+except: pass'
     fi
     if ! $PYTHON -c "$python_cmd" 2> /dev/null; then
         AC_MSG_RESULT([no])