Bug 613811 - Port PYTHON_VERSION check to c-c configure.in r=KaiRo
authorJustin Wood <Callek@gmail.com>
Sat, 20 Nov 2010 22:07:37 -0500
changeset 6743 c8adcdc5e20ca48817c9de6535d7545c8e5d0bf1
parent 6742 7a81fdf82d0b6e03e57e2597d826474c68d70f8b
child 6744 7b0f676b4d676a94ef51b6ffc4120e567ec544a6
push idunknown
push userunknown
push dateunknown
reviewersKaiRo
bugs613811
Bug 613811 - Port PYTHON_VERSION check to c-c configure.in r=KaiRo
configure.in
--- a/configure.in
+++ b/configure.in
@@ -124,16 +124,17 @@ MOZPNG=10401
 MOZZLIB=0x1230
 NSPR_VERSION=4
 NSS_VERSION=3
 
 dnl Set the minimum version of toolkit libs used by mozilla
 dnl ========================================================
 GLIB_VERSION=1.2.0
 PERL_VERSION=5.006
+PYTHON_VERSION=2.5
 CAIRO_VERSION=1.10
 PANGO_VERSION=1.14.0
 GTK2_VERSION=2.10.0
 WINDRES_VERSION=2.14.90
 W32API_VERSION=3.8
 GNOMEVFS_VERSION=2.0
 GCONF_VERSION=1.2.1
 GIO_VERSION=2.0
@@ -1792,16 +1793,27 @@ case "$host" in
     ;;
 
 *)
     HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX"
     HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O2}"
     ;;
 esac
 
+dnl We require version 2.5 or newer of Python to build.
+AC_MSG_CHECKING([for minimum required Python version >= $PYTHON_VERSION])
+changequote(,)
+$PYTHON -c "import sys; sys.exit(sys.version[:3] < sys.argv[1])" $PYTHON_VERSION
+_python_res=$?
+changequote([,])
+if test "$_python_res" != 0; then
+    AC_MSG_ERROR([Python $PYTHON_VERSION or higher is required.])
+fi
+AC_MSG_RESULT([yes])
+
 dnl Get mozilla version from central milestone file
 MOZILLA_VERSION=`$PERL $MOZILLA_SRCDIR/config/milestone.pl -topsrcdir $MOZILLA_SRCDIR`
 
 dnl Get version of various core apps from the version files.
 SUNBIRD_VERSION=`cat $topsrcdir/calendar/sunbird/config/version.txt`
 SEAMONKEY_VERSION=`cat $topsrcdir/suite/config/version.txt`
 
 AC_DEFINE_UNQUOTED(MOZILLA_VERSION,"$MOZILLA_VERSION")