[Goodies-commits] r1842 - xfce4-rss-plugin/trunk

Adriano Bess adriano at xfce.org
Thu Aug 3 03:47:34 CEST 2006


Author: adriano
Date: 2006-08-03 01:47:29 +0000 (Thu, 03 Aug 2006)
New Revision: 1842

Modified:
   xfce4-rss-plugin/trunk/acinclude.m4
   xfce4-rss-plugin/trunk/configure.ac.in
Log:
Fixed checking for the xfce4 python module in the autogenerated configure script
thanks to Jannis' hint.


Modified: xfce4-rss-plugin/trunk/acinclude.m4
===================================================================
--- xfce4-rss-plugin/trunk/acinclude.m4	2006-08-02 21:43:13 UTC (rev 1841)
+++ xfce4-rss-plugin/trunk/acinclude.m4	2006-08-03 01:47:29 UTC (rev 1842)
@@ -1,5 +1,5 @@
 ## this one is commonly used with AM_PATH_PYTHONDIR ...
-dnl AM_CHECK_PYMOD(MODNAME [,SYMBOL [,ACTION-IF-FOUND [,ACTION-IF-NOT-FOUND]]])
+dnl AM_CHECK_PYMOD(MODNAME [,SYMBOL [,ACTION-IF-FOUND [,ACTION-IF-NOT-FOUND [,PYGTK_ABI]]]])
 dnl Check if a module containing a given symbol is visible to python.
 AC_DEFUN([AM_CHECK_PYMOD],
 [AC_REQUIRE([AM_PATH_PYTHON])
@@ -9,11 +9,12 @@
 ifelse([$2],[], [prog="
 import sys
 try:
+	ifelse([$5], [],, [import pygtk; pygtk.require('$5')])
         import $1
 except ImportError:
         sys.exit(1)
 except:
-        sys.exit(0)
+        sys.exit(1)
 sys.exit(0)"], [prog="
 import $1
 $1.$2"])
@@ -35,3 +36,76 @@
 ])dnl
 fi
 ])
+
+dnl AM_CHECK_PYGTK(ABI_VERSION, VERSION[, ACTION-IF-FOUND [,ACTION-IF-NOT-FOUND]])
+dnl Check if pygtk with the givin ABI/Version is installed
+dnl VERSION should be a tuple of 3 integers, not a string!
+AC_DEFUN([AM_CHECK_PYGTK],
+[AC_REQUIRE([AM_PATH_PYTHON])
+AC_MSG_CHECKING([for pygtk-$1 version $2])
+prog="
+import sys
+try:
+	import pygtk; pygtk.require('$1')
+	import gtk
+except:
+        sys.exit(1)
+if gtk.pygtkversion >= $2:
+        sys.exit(0)
+else:
+	sys.exit(1)
+"
+if $PYTHON -c "$prog" 1>&AC_FD_CC 2>&AC_FD_CC ; then
+  AC_MSG_RESULT(yes)
+  ifelse([$3], [],, [$3
+])dnl
+else
+  AC_MSG_RESULT(no)
+  ifelse([$4], [],, [$4
+])dnl
+fi
+])
+
+dnl a macro to check for ability to create python extensions
+dnl  AM_CHECK_PYTHON_HEADERS([ACTION-IF-POSSIBLE], [ACTION-IF-NOT-POSSIBLE])
+dnl function also defines PYTHON_INCLUDES
+AC_DEFUN([AM_CHECK_PYTHON_HEADERS],
+[AC_REQUIRE([AM_PATH_PYTHON])
+AC_MSG_CHECKING(for headers required to compile python extensions)
+dnl deduce PYTHON_INCLUDES
+py_prefix=`$PYTHON -c "import sys; print sys.prefix"`
+py_exec_prefix=`$PYTHON -c "import sys; print sys.exec_prefix"`
+PYTHON_INCLUDES="-I${py_prefix}/include/python${PYTHON_VERSION}"
+if test "$py_prefix" != "$py_exec_prefix"; then
+  PYTHON_INCLUDES="$PYTHON_INCLUDES -I${py_exec_prefix}/include/python${PYTHON_VERSION}"
+fi
+AC_SUBST(PYTHON_INCLUDES)
+dnl check if the headers exist:
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="$CPPFLAGS $PYTHON_INCLUDES"
+AC_TRY_CPP([#include <Python.h>],dnl
+[AC_MSG_RESULT(found)
+$1],dnl
+[AC_MSG_RESULT(not found)
+$2])
+CPPFLAGS="$save_CPPFLAGS"
+])
+
+dnl Check for XML catalog definitions
+dnl AM_CHECK_XML_CATALOG(type, identifier, action-if-found, action-if-not-found)
+AC_DEFUN([AM_CHECK_XML_CATALOG],
+[
+type=$1
+ident=$2
+AC_MSG_CHECKING([for ${type} "${ident}"])
+xxx=$(echo "${type} '${ident}'" | xmlcatalog --shell)
+if echo $xxx | grep '^> No entry' > /dev/null; then
+   AC_MSG_RESULT([not found!])
+   $4
+else
+   AC_MSG_RESULT([found.])
+   $3
+fi
+unset type ident xxx
+])
+

Modified: xfce4-rss-plugin/trunk/configure.ac.in
===================================================================
--- xfce4-rss-plugin/trunk/configure.ac.in	2006-08-02 21:43:13 UTC (rev 1841)
+++ xfce4-rss-plugin/trunk/configure.ac.in	2006-08-03 01:47:29 UTC (rev 1842)
@@ -20,10 +20,9 @@
 XDT_I18N([@LINGUAS@])
 
 dnl Required packages
-AM_CHECK_PYMOD(pygtk,,,[AC_MSG_ERROR([not found])])
-AM_CHECK_PYMOD(gtk,,,[AC_MSG_ERROR([not found])])
-AM_CHECK_PYMOD(xfce4,,,[AC_MSG_ERROR([not found])])
-AM_CHECK_PYMOD(pyexo,,,[AC_MSG_ERROR([not found])])
+AM_CHECK_PYMOD(gtk,,,[AC_MSG_ERROR([not found])],2.0)
+AM_CHECK_PYMOD(xfce4,,,[AC_MSG_ERROR([not found])],2.0)
+AM_CHECK_PYMOD(pyexo,,,[AC_MSG_ERROR([not found])],2.0)
 AM_CHECK_PYMOD(feedparser,,,[AC_MSG_ERROR([not found])])
 
 AC_OUTPUT([




More information about the Goodies-commits mailing list