- PKG_CHECK_MODULES([PCRE], [libpcre >= 7.2], [HAVE_PCRE=yes], [HAVE_PCRE=no])
- AM_CONDITIONAL([HAVE_PCRE], [test "$HAVE_PCRE" = yes])
- if test "$HAVE_PCRE" = yes; then
- AC_DEFINE([HAVE_PCRE], [1], [Define to 1 if libpcre is installed.])
- fi])
+ PKG_CHECK_MODULES([PCRE],
+ [libpcre >= 7.2],
+ [HAVE_PCRE_PARTIAL=yes],
+ [HAVE_PCRE_PARTIAL=no])
+ AM_CONDITIONAL([HAVE_PCRE_PARTIAL], [test "$HAVE_PCRE_PARTIAL" = yes])
+ AC_SUBST([HAVE_PCRE_PARTIAL])
+])
+
+dnl Checks for Python 2.x, x >= 4.
+AC_DEFUN([OVS_CHECK_PYTHON],
+ [AC_CACHE_CHECK(
+ [for Python 2.x for x >= 4],
+ [ovs_cv_python],
+ [if test -n "$PYTHON"; then
+ ovs_cv_python=$PYTHON
+ else
+ ovs_cv_python=no
+ for binary in python python2.4 python2.5; do
+ ovs_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+ for dir in $PATH; do
+ IFS=$ovs_save_IFS
+ test -z "$dir" && dir=.
+ if test -x $dir/$binary && $dir/$binary -c 'import sys
+if sys.hexversion >= 0x02040000 and sys.hexversion < 0x03000000:
+ sys.exit(0)
+else:
+ sys.exit(1)'; then
+ ovs_cv_python=$dir/$binary
+ break 2
+ fi
+ done
+ done
+ fi])
+ AC_SUBST([HAVE_PYTHON])
+ AM_MISSING_PROG([PYTHON], [python])
+ if test $ovs_cv_python != no; then
+ PYTHON=$ovs_cv_python
+ HAVE_PYTHON=yes
+ else
+ HAVE_PYTHON=no
+ fi
+ AM_CONDITIONAL([HAVE_PYTHON], [test "$HAVE_PYTHON" = yes])])