Thomas Schwinge <tschwi...@baylibre.com> writes:

> In particular, 'GLIBCXX_ENABLE_CXX_FLAGS' shouldn't overwrite 
> 'EXTRA_CXX_FLAGS'
> (and prepend any additional '--enable-cxx-flags=[...]').

Why 'CXX_FLAGS' spelling (which is unusual) rather than 'CXXFLAG-- ah, I
see we have a load of EXTRA_CXXFLAGS, and then a lot of EXTRA_CXX_FLAGS
in libstdc++. I feel like this is a typo waiting to happen but maybe
it's like this for a reason?

(If the intention is to avoid whatever is normally in EXTRA_CXXFLAGS, we
should consider a namespaced var name instead - but I think not given
EXTRA_CFLAGS is used elsewhere & within libstdc++.)

>
>       libstdc++-v3/
>       * acinclude.m4 (GLIBCXX_ENABLE_CXX_FLAGS): Prepend any additional
>       flags to 'EXTRA_CXX_FLAGS'.
>       * configure: Regenerate.
>       * configure.host: Document 'EXTRA_CFLAGS', 'EXTRA_CXX_FLAGS'.
> ---
>  libstdc++-v3/acinclude.m4   | 3 ++-
>  libstdc++-v3/configure      | 3 ++-
>  libstdc++-v3/configure.host | 4 ++++
>  3 files changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4
> index b3423d7957a..3287dab3b89 100644
> --- a/libstdc++-v3/acinclude.m4
> +++ b/libstdc++-v3/acinclude.m4
> @@ -3269,7 +3269,8 @@ AC_DEFUN([GLIBCXX_ENABLE_CXX_FLAGS], [dnl
>      done
>    fi
>  
> -  EXTRA_CXX_FLAGS="$enable_cxx_flags"
> +  # Prepend the additional flags.
> +  EXTRA_CXX_FLAGS="$enable_cxx_flags $EXTRA_CXX_FLAGS"
>    AC_MSG_RESULT($EXTRA_CXX_FLAGS)
>    AC_SUBST(EXTRA_CXX_FLAGS)
>  ])
> diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure
> index e115ee55739..ba908577a66 100755
> --- a/libstdc++-v3/configure
> +++ b/libstdc++-v3/configure
> @@ -19452,7 +19452,8 @@ fi
>      done
>    fi
>  
> -  EXTRA_CXX_FLAGS="$enable_cxx_flags"
> +  # Prepend the additional flags.
> +  EXTRA_CXX_FLAGS="$enable_cxx_flags $EXTRA_CXX_FLAGS"
>    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $EXTRA_CXX_FLAGS" >&5
>  $as_echo "$EXTRA_CXX_FLAGS" >&6; }
>  
> diff --git a/libstdc++-v3/configure.host b/libstdc++-v3/configure.host
> index 45f55b250ce..1e84c78af30 100644
> --- a/libstdc++-v3/configure.host
> +++ b/libstdc++-v3/configure.host
> @@ -61,6 +61,10 @@
>  #
>  # It possibly modifies the following variables:
>  #
> +#   EXTRA_CFLAGS           extra flags to pass when compiling C code
> +#
> +#   EXTRA_CXX_FLAGS        extra flags to pass when compiling C++ code
> +#
>  #   OPT_LDFLAGS            extra flags to pass when linking the library, of
>  #                          the form '-Wl,blah'
>  #                          (defaults to empty in acinclude.m4)

Reply via email to