On Thu, 2012-02-23 at 14:44 +0000, Roger Pau Monne wrote:
Is your clock a bit screwed up?
> # HG changeset patch
> # User Roger Pau Monne <roger.pau@entel.upc.edu>
> # Date 1330008154 -3600
> # Node ID 5b9591013560903e04c1e294819857748ff75f01
> # Parent 1b68427875f7ffe3025ea13c7f6e8cf71ce54769
> autoconf: improve python-dev checking
>
> Avoid printing a warning if a ldflag different than -L* or -l* is
> found, and temporary append all ldflags returned from python-config to
> LDFLAGS to perform the python tests.
>
> Also use --cflags instead of --includes, and append all returned
> options to CPPFLAGS temporary to perform the python tests.
>
> In case anyone is curious, we are using CPPFLAGS instead of CFLAGS
> because the AC_CHECK_HEADER preprocessor check ignores CFLAGS.
>
> Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu>
Acked-by:Ian Campbell <ian.campbell@citrix.com>
I''m not 100% convinced we shouldn''t filter $python_lib from
what we add
the LDFLAGS but I presume it works for you as is so we can let it be and
fix if it turns out top be a problem.
>
> diff -r 1b68427875f7 -r 5b9591013560 tools/configure
> --- a/tools/configure Thu Mar 15 15:20:37 2012 +0000
> +++ b/tools/configure Thu Feb 23 15:42:34 2012 +0100
> @@ -6144,23 +6144,16 @@ else
> fi
>
> ac_previous_cppflags=$CPPFLAGS
> -CPPFLAGS="$CFLAGS `$PYTHON-config --includes`"
> +CPPFLAGS="$CFLAGS `$PYTHON-config --cflags`"
> ac_previous_ldflags=$LDFLAGS
> for flag in `$PYTHON-config --ldflags`
> do
> case $flag in
> - -L*)
> - LDFLAGS="$LDLFAGS $flag"
> - ;;
> -lpython*)
> python_lib=`echo $flag | sed ''s/^-l//''`
> ;;
> - -l*)
> - # Ignore other libraries, we are only interested in testing
python-dev
> - ;;
> *)
> - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Strange
ldflag found in $PYTHON-config output: $flag" >&5
> -$as_echo "$as_me: WARNING: Strange ldflag found in $PYTHON-config
output: $flag" >&2;}
> + LDFLAGS="$LDLFAGS $flag"
> ;;
> esac
> done
> diff -r 1b68427875f7 -r 5b9591013560 tools/m4/python_devel.m4
> --- a/tools/m4/python_devel.m4 Thu Mar 15 15:20:37 2012 +0000
> +++ b/tools/m4/python_devel.m4 Thu Feb 23 15:42:34 2012 +0100
> @@ -1,21 +1,15 @@
> AC_DEFUN([AX_CHECK_PYTHON_DEVEL], [
> ac_previous_cppflags=$CPPFLAGS
> -CPPFLAGS="$CFLAGS `$PYTHON-config --includes`"
> +CPPFLAGS="$CFLAGS `$PYTHON-config --cflags`"
> ac_previous_ldflags=$LDFLAGS
> for flag in `$PYTHON-config --ldflags`
> do
> case $flag in
> - -L*)
> - LDFLAGS="$LDLFAGS $flag"
> - ;;
> -lpython*)
> python_lib=`echo $flag | sed ''s/^-l//''`
> ;;
> - -l*)
> - # Ignore other libraries, we are only interested in testing
python-dev
> - ;;
> *)
> - AC_MSG_WARN([Strange ldflag found in $PYTHON-config output:
$flag])
> + LDFLAGS="$LDLFAGS $flag"
> ;;
> esac
> done