[SSSD] [PATCH] CONFIGURE: Prefer python2

Lukas Slebodnik lslebodn at redhat.com
Mon Jun 9 07:15:50 UTC 2014


ehlo,

The configure script failed with python3

checking for python... /usr/bin/python
checking for python version... 3.3
checking for python platform... linux
checking for python script directory... ${prefix}/lib/python3.3/site-packages
checking for python extension module directory... ${exec_prefix}/lib64/python3.3/site-packages
checking for headers required to compile python extensions...   File "<string>", line 1
    import sys; print sys.prefix
                        ^
SyntaxError: invalid syntax
  File "<string>", line 1
    import sys; print sys.exec_prefix
                        ^
SyntaxError: invalid syntax
not found
configure: error: Could not find python headers


checking for python... /usr/bin/python
checking for working python...   File "<string>", line 1
    from distutils import sysconfig;             print '-I' + sysconfig.get_python_inc() +             ' -I' + sysconfig.get_python_inc(plat_specific=True) + ' ' +             sysconfig.get_config_var('BASECFLAGS')
                                                          ^
SyntaxError: invalid syntax
  File "<string>", line 1
    from distutils import sysconfig;             print " ".join(sysconfig.get_config_var('LIBS').split() +             sysconfig.get_config_var('SYSLIBS').split()) +             ' -lpython' + sysconfig.get_config_var('VERSION') +             ' -L' + sysconfig.get_config_var('LIBDIR')
                                                         ^
SyntaxError: invalid syntax
yes
checking for Py_ssize_t... yes
checking for PySet_New... no
checking for PySet_Add... no


How to test?
    * use distribution with default python >=3
    * test on fedora 20
        - python, python3 packages should be installed
        - cd /usr/bin/
        - unlink python
        - ln -s python3 python

Do not forget to change symling after testing :-)

Patch is attached.

LS
-------------- next part --------------
>From f8e3ab865c317b5c7f2290e498f59c1413978fd6 Mon Sep 17 00:00:00 2001
From: Lukas Slebodnik <lslebodn at redhat.com>
Date: Mon, 9 Jun 2014 09:01:13 +0200
Subject: [PATCH] CONFIGURE: Prefer python2

The configure script failed with python3

checking for python... /usr/bin/python
checking for python version... 3.3
checking for python platform... linux
checking for python script directory... ${prefix}/lib/python3.3/site-packages
checking for python extension module directory... ${exec_prefix}/lib64/python3.3/site-packages
checking for headers required to compile python extensions...   File "<string>", line 1
    import sys; print sys.prefix
                        ^
SyntaxError: invalid syntax
  File "<string>", line 1
    import sys; print sys.exec_prefix
                        ^
SyntaxError: invalid syntax
not found
configure: error: Could not find python headers
---
 configure.ac           | 1 +
 src/external/python.m4 | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index d603cda1ab7e18933bb51d3e69a8d434351c08ad..dcf2494de62be08af2d0ebb25d1ed9f83b4517d5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -230,6 +230,7 @@ AM_CONDITIONAL([HAVE_MANPAGES], [test "x$HAVE_MANPAGES" != "x"])
 AM_CONDITIONAL([HAVE_PO4A], [test "x$PO4A" != "xno"])
 
 if test x$HAVE_PYTHON_BINDINGS != x; then
+    PYTHON=python2
     AM_PATH_PYTHON([2.4])
     AM_CHECK_PYTHON_HEADERS([],
                             AC_MSG_ERROR([Could not find python headers]))
diff --git a/src/external/python.m4 b/src/external/python.m4
index cfe9961c75bbd191b78c8cdc21008b11b179548f..b5d05e49e94a2364531d0014ab68a6526540d29a 100644
--- a/src/external/python.m4
+++ b/src/external/python.m4
@@ -9,7 +9,7 @@ AC_DEFUN([AM_PYTHON_CONFIG],
 dnl We need to check for python build flags using distutils.sysconfig
 dnl We cannot use python-config, as it was not available on older
 dnl versions of python
-    AC_PATH_PROG(PYTHON, python)
+    AC_PATH_PROG(PYTHON, python2)
     AC_MSG_CHECKING([for working python])
     if test -x "$PYTHON"; then
         PYTHON_CFLAGS="`$PYTHON -c \"from distutils import sysconfig; \
-- 
1.9.3



More information about the sssd-devel mailing list