Detect python2.5
authorPaul Nasrat <pnasrat@redhat.com>
Thu, 7 Jun 2007 10:49:48 +0000 (11:49 +0100)
committerPaul Nasrat <pnasrat@redhat.com>
Thu, 7 Jun 2007 10:49:48 +0000 (11:49 +0100)
configure.ac

index 474fac0..3eaaef7 100644 (file)
@@ -912,48 +912,60 @@ AC_ARG_WITH(python, [  --with-python           build rpm python bindings ])
 WITH_PYTHON_VERSION=$withval
 if test $withval = auto ; then
 
-AC_MSG_CHECKING(for python 2.4)
+AC_MSG_CHECKING(for python 2.5)
 AC_RUN_IFELSE([AC_LANG_SOURCE([[
-#include <python2.4/Python.h>
+#include <python2.5/Python.h>
 main() {
-  exit(strncmp("2.4", PY_VERSION, 3));
+  exit(strncmp("2.5", PY_VERSION, 3));
 } ]])],[withval=yes],[withval=no],[withval=yes])
   AC_MSG_RESULT($withval)
   if test $withval = yes ; then
-    WITH_PYTHON_VERSION="2.4"
+    WITH_PYTHON_VERSION="2.5"
   else
-    
-  AC_MSG_CHECKING(for python 2.3)
+
+  AC_MSG_CHECKING(for python 2.4)
   AC_RUN_IFELSE([AC_LANG_SOURCE([[
-  #include <python2.3/Python.h>
+  #include <python2.4/Python.h>
   main() {
-    exit(strncmp("2.3", PY_VERSION, 3));
+    exit(strncmp("2.4", PY_VERSION, 3));
   } ]])],[withval=yes],[withval=no],[withval=yes])
     AC_MSG_RESULT($withval)
     if test $withval = yes ; then
-      WITH_PYTHON_VERSION="2.3"
+      WITH_PYTHON_VERSION="2.4"
     else
     
-      AC_MSG_CHECKING(for python 2.2)
-      AC_RUN_IFELSE([AC_LANG_SOURCE([[
-    #include <python2.2/Python.h>
+    AC_MSG_CHECKING(for python 2.3)
+    AC_RUN_IFELSE([AC_LANG_SOURCE([[
+    #include <python2.3/Python.h>
     main() {
-      exit(strncmp("2.2", PY_VERSION, 3));
+      exit(strncmp("2.3", PY_VERSION, 3));
     } ]])],[withval=yes],[withval=no],[withval=yes])
       AC_MSG_RESULT($withval)
       if test $withval = yes ; then
-        WITH_PYTHON_VERSION="2.2"
+        WITH_PYTHON_VERSION="2.3"
       else
     
-        AC_MSG_CHECKING(for python 1.5.2)
+        AC_MSG_CHECKING(for python 2.2)
         AC_RUN_IFELSE([AC_LANG_SOURCE([[
-    #include <python1.5/Python.h>
-    main() {
-      exit(strcmp("1.5.2", PY_VERSION));
-    } ]])],[withval=yes],[withval=no],[withval=yes])
+      #include <python2.2/Python.h>
+      main() {
+        exit(strncmp("2.2", PY_VERSION, 3));
+      } ]])],[withval=yes],[withval=no],[withval=yes])
         AC_MSG_RESULT($withval)
         if test $withval = yes ; then
-          WITH_PYTHON_VERSION="1.5"
+          WITH_PYTHON_VERSION="2.2"
+        else
+    
+          AC_MSG_CHECKING(for python 1.5.2)
+          AC_RUN_IFELSE([AC_LANG_SOURCE([[
+      #include <python1.5/Python.h>
+      main() {
+        exit(strcmp("1.5.2", PY_VERSION));
+      } ]])],[withval=yes],[withval=no],[withval=yes])
+          AC_MSG_RESULT($withval)
+          if test $withval = yes ; then
+            WITH_PYTHON_VERSION="1.5"
+          fi
         fi
       fi
     fi