[PATCH util-macros 0/1] Add XORG_PROJECT_ALL_CFLAGS for X.Org project compiler options
memsize at videotron.ca
Fri Mar 5 07:38:21 PST 2010
Following the review http://lists.x.org/archives/xorg-devel/2010-February/005894.html
here is the proposed patch after a few prototyping iterations.
- Provides a hook for an emergency system fix due to compiler behavior change
- Allow for an easy way to experiment various compiler options on the system
on a private local build
- Implement project wide policies such as warning and optimization flags
The word "system" here refers to all modules shipped as part of a release.
XORG_PROJECT_WARN_CFLAGS: defines Automake variable $(PROJECT_WARN_CFLAGS)
$(PROJECT_WARN_CFLAGS): contains -Wall and friends plus $(STRICT_CFLAGS)
(but no -fno-strict-aliasing)
XORG_PROJECT_OPTIMIZE_CFLAGS: defines Automake variable $(PROJECT_OPTIMIZE_CFLAGS)
$(PROJECT_OPTIMIZE_CFLAGS): contains -fno-strict-aliasing
XORG_PROJECT_ALL_CFLAGS: defines Automake variable $(PROJECT_ALL_CFLAGS)
$(PROJECT_ALL_CFLAGS): ="$PROJECT_WARN_CFLAGS $PROJECT_OPTIMIZE_CFLAGS"
The existing STRICT_CFLAGS had to be integrated in the new macro to preserve
backward compatibility (--enable-strict-compilation)
Usage in Makefile.am
AM_CFLAGS = [...] $(PROJECT_ALL_CFLAGS) [...] (replacing CWARNFLAGS in all modules)
$(PROJECT_ALL_CFLAGS) will be added to modules which never had CWARNFLAGS before.
CWARNFLAGS is left intact and is available to all modules, past, present and future.
The util-macros package versioning
For those unfamiliar with the util-macros package, the versioning strategy is
to "add & modify", e.g. add new features and fix bugs in existing features.
This does not allow to "remove" or "change" a functionality upon which current
and past modules depend.
The concept of "minimum version" is used, meaning the oldest macros package
against which a module can function correctly, even if it missing some features
or bug fixes.
This patch follows the macros package versioning, so the CWARNFLAGS macro cannot be
removed. It will therefore be available for future module versions. It will always
be defined in the Makefile in addition to PROJECT_ALL_CFLAGS.
If in the future we ever need to "remove" or "change" one of the new *_CFLAGS,
we will be in the same situation as we are today. Rather than creating a new set
of variable names, we can modify the macros package versioning strategy (for
compiler options only) whereby older modules will receive older versions
of the compiler options and newer modules get newer ones.
A design is in place with commented out code to illustrate how this would work.
We can, if we want, use this strategy to make unavailable CWARNFLAGS for new
versions of modules.
Gaetan Nadon (1):
Add XORG_PROJECT_ALL_CFLAGS for X.Org project compiler options
xorg-macros.m4.in | 171 +++++++++++++++++++++++++++++++++++++++++++++++++++--
1 files changed, 165 insertions(+), 6 deletions(-)
More information about the xorg-devel