[accerciser] Fix for bug #596758 - Configure does not check for IPython



commit 09e750c1b7563646812a92ad3cb9bf93fd4ddef0
Author: Aline Bessa <alibezz gmail com>
Date:   Thu Mar 1 19:04:53 2012 +0100

    Fix for bug #596758 - Configure does not check for IPython

 acinclude.m4 | 38 ++++++++++++++++++++++++++++++++++++++
 configure.ac | 11 +++++++++++
 2 files changed, 49 insertions(+)
---
diff --git a/acinclude.m4 b/acinclude.m4
index 547e3ec..e1f27da 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -12,3 +12,41 @@ if $PYTHON $1
     ifelse([$3], [], , [$3])
 fi
 ])
+
+
+dnl AM_CHECK_PYMOD(MODNAME [,SYMBOL [,ACTION-IF-FOUND [,ACTION-IF-NOT-FOUND]]])
+dnl Check if a module containing a given symbol is visible to python.
+AC_DEFUN([AM_CHECK_PYMOD],
+[AC_REQUIRE([AM_PATH_PYTHON])
+py_mod_var=`echo $1['_']$2 | sed 'y%./+-%__p_%'`
+AC_MSG_CHECKING(for ifelse([$2],[],,[$2 in ])python module $1)
+AC_CACHE_VAL(py_cv_mod_$py_mod_var, [
+ifelse([$2],[], [prog="
+import sys
+try:
+       import $1
+except ImportError:
+       sys.exit(1)
+except:
+       sys.exit(0)
+sys.exit(0)"], [prog="
+import $1
+import $1.$2"])
+if $PYTHON -c "$prog" 1>&AC_FD_CC 2>&AC_FD_CC
+  then
+    eval "py_cv_mod_$py_mod_var=yes"
+  else
+    eval "py_cv_mod_$py_mod_var=no"
+  fi
+])
+py_val=`eval "echo \`echo '$py_cv_mod_'$py_mod_var\`"`
+if test "x$py_val" != xno; then
+  AC_MSG_RESULT(yes)
+  ifelse([$3], [],, [$3
+])dnl
+else
+  AC_MSG_RESULT(no)
+  ifelse([$4], [],, [$4
+])dnl
+fi
+])
diff --git a/configure.ac b/configure.ac
index 940f7c1..3277118 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,6 +23,9 @@ PKG_CHECK_MODULES([GTK], [gtk+-3.0 >= $GTK_REQUIRED])
 PKG_CHECK_MODULES([PYGOBJECT], [pygobject-3.0 >= $PYGOBJECT_REQUIRED])
 PKG_CHECK_MODULES([ATSPI2], [atspi-2 >= $ATSPI_REQUIRED])
 
+dnl == check for python modules
+AM_CHECK_PYMOD(IPython,,[ipython_support="yes"],[AC_MSG_WARN(Could not find python module: 
IPython);ipython_support="no"])
+
 dnl == i18n ==
 # FIXME: Remove AM_GNU_GETTEXT_VERSION once autoreconf supports REQUIRE_VERSION
 AM_GNU_GETTEXT_VERSION([0.19.8])
@@ -54,3 +57,11 @@ src/lib/accerciser/Makefile
 src/lib/accerciser/plugin/Makefile
 ])
 
+dnl =============================================================================================
+echo "
+Accerciser $VERSION
+
+        Installation prefix:     ${prefix}
+        IPython support:         ${ipython_support}
+
+"


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]