On 09/22/2009 04:32 AM, Sumit Bose wrote:
> On Tue, Sep 22, 2009 at 09:40:34AM +0200, Sumit Bose wrote:
>> On Tue, Sep 22, 2009 at 09:32:22AM +0200, Sumit Bose wrote:
>>> On Mon, Sep 21, 2009 at 04:47:14PM -0400, Stephen Gallagher wrote:
>>>> On 09/21/2009 04:35 PM, Stephen Gallagher wrote:
>>>>> Older python versions (such as that used in RHEL5) do not have a
>>>>> python-config executable to report CFLAGS and LIBS. In order to
>>>>> support such versions of python, we will duplicate the logic that
>>>>> python-config would have performed directly in our configure
>>>>> script
>>>>>
>>>>>
>>>>> The original patch that enabled the python support broke the RHEL5
>>>>> builds. This patch will fix it. Please review promptly.
>>>>>
>>>>
>>>> It would be easier to review promptly if I'd actually attached the patch...
>>>
>>> yes, it was easier this way :-)
>>>
>>> ACK
>>>
>>> Btw. I have seen a couple for compiler warnings not related to this
>>> patch but to the python bindings in general.
>>>
>>
>> ah, sorry, I have forgotten a minor comment. Please consider adding a
>> comment to python.m4 why python-config is not used here. Because in a
>> couple of month someone who does not read the commit logs carefully
>> might be tempted to 'optimize' this section with the help of
>> python-config.
>>
>
> after a discussion with Jakub it turns out that some of the warnings I
> see are related to this patch, so I revoke my ACK and say
>
> NACK
>
> Please change sysconfig.get_config_var('CFLAGS') to
> sysconfig.get_config_var('BASECFLAGS') because it fits much better to
> the original python-config --includes. CFLAGS corresponds to
> python-config --cflags which includes all the compiler options used to
> compile python.
>
> bye,
> Sumit
> _______________________________________________
> sssd-devel mailing list
> [email protected]
> https://fedorahosted.org/mailman/listinfo/sssd-develNew patch attached. I have added the requested comment and changed to using BASECFLAGS instead of CFLAGS. -- Stephen Gallagher RHCE 804006346421761 Looking to carve out IT costs? www.redhat.com/carveoutcosts/
From 54a1e417d916eb8dd37526439821bbdbd0d05463 Mon Sep 17 00:00:00 2001 From: Stephen Gallagher <[email protected]> Date: Mon, 21 Sep 2009 16:33:03 -0400 Subject: [PATCH] Make configure script compatible with older python versions Older python versions (such as that used in RHEL5) do not have a python-config executable to report CFLAGS and LIBS. In order to support such versions of python, we will duplicate the logic that python-config would have performed directly in our configure script --- server/external/python.m4 | 23 ++++++++++++++++------- 1 files changed, 16 insertions(+), 7 deletions(-) diff --git a/server/external/python.m4 b/server/external/python.m4 index 37eeac2..db59863 100644 --- a/server/external/python.m4 +++ b/server/external/python.m4 @@ -1,17 +1,26 @@ dnl Check for python-config and substitute needed CFLAGS and LDFLAGS dnl Usage: dnl AM_PYTHON_CONFIG + AC_DEFUN([AM_PYTHON_CONFIG], [ AC_SUBST(PYTHON_CFLAGS) AC_SUBST(PYTHON_LIBS) - AC_PATH_PROG(PYTHON_CONFIG, python-config) - AC_MSG_CHECKING(for working python-config) - if test -x "$PYTHON_CONFIG"; then - PYTHON_CFLAGS="`$PYTHON_CONFIG --includes`" - PYTHON_CFLAGS=$PYTHON_CFLAGS" -fno-strict-aliasing" - PYTHON_LIBS="`$PYTHON_CONFIG --libs`" - AC_MSG_RESULT([yes]) +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_MSG_CHECKING([for working python]) + if test -x "$PYTHON"; then + PYTHON_CFLAGS="`$PYTHON -c \"from distutils import sysconfig; \ + print '-I' + sysconfig.get_python_inc() + \ + ' -I' + sysconfig.get_python_inc(plat_specific=True) + ' ' + \ + sysconfig.get_config_var('BASECFLAGS')\"`" + PYTHON_LIBS="`$PYTHON -c \"from distutils import sysconfig; \ + print \\\" \\\".join(sysconfig.get_config_var('LIBS').split() + \ + sysconfig.get_config_var('SYSLIBS').split()) + \ + ' -lpython' + sysconfig.get_config_var('VERSION')\"`" + AC_MSG_RESULT([yes]) else AC_MSG_ERROR([no. Please install python devel package]) fi -- 1.6.2.5
signature.asc
Description: OpenPGP digital signature
_______________________________________________ sssd-devel mailing list [email protected] https://fedorahosted.org/mailman/listinfo/sssd-devel
