I want to add documentation for this change, and found this proposal
self-contradictory.
== Summary ==
Create a corresponding macro for each compiler flag in the
redhat-rpm-config macro file and create "extra flag" macros to make it
easier for packages to add and remove compiler flags.
== Benefit to Fedora ==
* It will provide a standard way to disable existing compiler flags or
enable new ones that is more simple and robust than the existing echo
+ sed solution.
(I believe this is no longer relevant to the second version of the
proposal.)
* It will make it easier to determine which packages disable or add
compiler flags by doing a simple grep of the spec files.
* It will make it easier for toolchain developers to experiment with
adding new flags to the distribution as this can be done with a simple
macro definition instead of patching redhat-rpm-config.
The main problem are these two goals. I don't think you can have it
both ways.
Here's a concrete example. The proposal mentions compiler-rt.spec as a
potential use case. Say it changes
%global optflags %(echo %{optflags} -D_DEFAULT_SOURCE)
to:
%global _pkg_extra_cflags -D_DEFAULT_SOURCE
While this is arguably useful (second use case), after this change, it
is no longer possible to inject additional build flags via
_pkg_extra_cflags from the outside (third use case).
Do we actually need two sets of macros, with distinct use cases?
Thanks,
Florian