[Pacemaker] [patch] low: unset CFLAGS in a dash-friendly way

Andrew Beekhof andrew at beekhof.net
Mon Jul 5 12:34:23 UTC 2010


Applied to both branches. Thanks!

On Mon, Jul 5, 2010 at 10:19 AM, Simon Horman <horms at verge.net.au> wrote:
> # HG changeset patch
> # User Simon Horman <horms at verge.net.au>
> # Date 1278317844 -32400
> # Node ID e823bf55e0d875bcd9dc1668f24547345b9bdf81
> # Parent  7499efa9c2a3f8c5c6396dc6c3631e9f3898547e
> low: unset CFLAGS in a dash-friendly way
>
> According to the dash man page, the only way to unexport a variable
> is to unset it. This also works in bash.
>
> For the record, the reason that CFLAGS is exported from the environment to
> configure and configure appends -Werror to the CFLAGS then it will be
> re-exported by configure and has been observed to cause trouble when
> configure runs a separate configure is the libltdl directory.
>
> See:    Debian Bug #582874 - http://bugs.debian.org/582874
>        Debian Bug #582875 - http://bugs.debian.org/582875
>
> Signed-off-by: Simon Horman <horms at verge.net.au>
>
> diff -r 7499efa9c2a3 -r e823bf55e0d8 configure.in
> --- a/configure.in      Wed Jan 07 15:02:59 2009 +0100
> +++ b/configure.in      Mon Jul 05 17:17:24 2010 +0900
> @@ -1475,11 +1475,12 @@
>  dnl no effect. However if CFLAGS was exported from the user's
>  dnl environment, then the new CFLAGS will also be exported
>  dnl to sub processes. This causes a problem when configure
> -dnl is run in the libltdl directory. Horms 16th July 2002
> -dnl
> -
> +dnl is run in the libltdl directory.
>  if export | fgrep " CFLAGS=" > /dev/null; then
> -       export -n CFLAGS || true # We don't want to bomb out if this fails
> +       SAVED_CFLAGS="$CFLAGS"
> +       unset CFLAGS
> +       CFLAGS="$SAVED_CFLAGS"
> +       unset SAVED_CFLAGS
>  fi
>
>  if test "$GCC" = yes; then
>
>
> _______________________________________________
> Pacemaker mailing list: Pacemaker at oss.clusterlabs.org
> http://oss.clusterlabs.org/mailman/listinfo/pacemaker
>
> Project Home: http://www.clusterlabs.org
> Getting started: http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf
> Bugs: http://developerbugs.linux-foundation.org/enter_bug.cgi?product=Pacemaker
>




More information about the Pacemaker mailing list