bug 427750 - Require python >= 2.4 to build Mozilla (and >=2.5 on Windows). r=bsmedberg
☠☠ backed out by 09ec08895dea ☠ ☠
authorTed Mielczarek <ted.mielczarek@gmail.com>
Tue, 02 Dec 2008 06:35:26 -0500
changeset 22149 96956634349c34be4469035052ee2dcfe6b1853b
parent 22148 def8ca28ac75c62451916c3ea0332d098f82fcc1
child 22150 97a05adac5ba7ec4cb21c67a1e72705c6d1f5497
child 22168 09ec08895dea4dfdd86671846bacc89efd1c1114
push idunknown
push userunknown
push dateunknown
reviewersbsmedberg
bugs427750
milestone1.9.2a1pre
bug 427750 - Require python >= 2.4 to build Mozilla (and >=2.5 on Windows). r=bsmedberg
configure.in
--- a/configure.in
+++ b/configure.in
@@ -113,16 +113,17 @@ 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
 LIBIDL_VERSION=0.6.3
 PERL_VERSION=5.006
+PYTHON_VERSION=2.4
 LIBART_VERSION=2.3.4
 CAIRO_VERSION=1.6.0
 PANGO_VERSION=1.14.0
 GTK2_VERSION=2.10.0
 MAKE_VERSION=3.78
 WINDRES_VERSION=2.14.90
 W32API_VERSION=3.8
 GNOMEVFS_VERSION=2.0
@@ -605,16 +606,18 @@ case "$target" in
             AC_MSG_ERROR([windres version $WINDRES_VERSION or higher is required to build.])
         fi
     fi # !GNU_CC
 
     AC_DEFINE_UNQUOTED(WINVER,0x$WINVER)
     AC_DEFINE_UNQUOTED(_WIN32_WINNT,0x$WINVER)
     # Require OS features provided by IE 5.0
     AC_DEFINE_UNQUOTED(_WIN32_IE,0x0500)
+    # we need Python 2.5 on Windows
+    PYTHON_VERSION=2.5
     ;;
 esac
 
 dnl Test breaks icc on OS/2 && MSVC
 if test "$CC" != "icc" -a -z "$_WIN32_MSVC"; then
     AC_PROG_CC_C_O
     if grep "NO_MINUS_C_MINUS_O 1" ./confdefs.h >/dev/null; then
         USING_HCC=1
@@ -672,21 +675,35 @@ AC_MSG_CHECKING([for full perl installat
 _perl_res=$?
 if test "$_perl_res" != 0; then
     AC_MSG_RESULT([no])
     AC_MSG_ERROR([Cannot find Config.pm or \$Config{archlib}.  A full perl installation is required.])
 else
     AC_MSG_RESULT([yes])    
 fi
 
-AC_PATH_PROGS(PYTHON, $PYTHON python)
+dnl Scratchbox ships with "python" == Python 2.3 and "python2.4".
+dnl Check for explicitly-versioned binaries first to save them some pain.
+AC_PATH_PROGS(PYTHON, $PYTHON python2.5 python2.4 python)
 if test -z "$PYTHON"; then
     AC_MSG_ERROR([python was not found in \$PATH])
 fi
 
+dnl We require version 2.4 or newer of Python to build,
+dnl and 2.5 or newer on Windows.
+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])
+
 AC_PATH_PROGS(NSINSTALL_BIN, nsinstall )
 if test -z "$COMPILE_ENVIRONMENT"; then
 if test -z "$NSINSTALL_BIN" || test "$NSINSTALL_BIN" = ":"; then
     NSINSTALL_BIN='$(PYTHON) $(topsrcdir)/config/nsinstall.py'
 fi
 fi
 AC_SUBST(NSINSTALL_BIN)