[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: AC_*/AM_* macros for options
From: |
Rhys Ulerich |
Subject: |
Re: AC_*/AM_* macros for options |
Date: |
Wed, 30 Oct 2013 00:47:57 -0500 |
> I think there would need to be a higher-level "abstract"
> know (low, medium, high), and then a way to add specific
> compiler-specific options for specific circumstances.
>
> Something like:
> AC_PROG_CC_WARNINGS_ADD([clang],
> [-Wtautological-constant-out-of-range-compare -Wpointer-sign
> -Wformat-extra-args]
As someone mentioned before, the autoconf-archive has several very
nice building blocks. AX_APPEND_COMPILE_FLAGS [1] adds flags to
CFLAGS (or, if you like, CFLAGS_{LOW,MED,HIGH}) if the current
language compiler accepts them. AC_COMPILER_VENDOR [2] permits
detecting compilers, much like the clang example you gave above.
These can be put together in a project-specific macro to slice and
dice warnings however you desire. Following the lead of the FFTW
guys, I have an example of such an "assembly" AC_DEFUN in one of my
projects [3].
It would not be hard to either (a) rewrite your hypothetical
AC_PROG_CC_WARNINGS_ADD in terms of these (along with some
AC_LANG_PUSH and AC_LANG_POP love) or to (b) implement it with these
building blocks.
The autoconf-archive is quite a nice collection of tools. If you've
got suggested low/medium/high flag wishlists that you care to
implement, by all means please open up a feature on Savannah with an
attached patch.
[1] http://www.gnu.org/software/autoconf-archive/ax_append_compile_flags
[2] http://www.gnu.org/software/autoconf-archive/ax_compiler_vendor
[3] https://github.com/RhysU/suzerain/blob/master/m4/ax_warnings_sanitize.m4
- Rhys
Re: AC_*/AM_* macros for options, Jeffrey Walton, 2013/10/29
- Re: AC_*/AM_* macros for options, Russ Allbery, 2013/10/29
- Re: AC_*/AM_* macros for options, Paul Eggert, 2013/10/29
- Re: AC_*/AM_* macros for options, Jeffrey Walton, 2013/10/29
- Re: AC_*/AM_* macros for options, Paul Eggert, 2013/10/29
- Re: AC_*/AM_* macros for options, Jeffrey Walton, 2013/10/29
- Re: AC_*/AM_* macros for options, Paul Eggert, 2013/10/29
- Re: AC_*/AM_* macros for options, Jeffrey Walton, 2013/10/30
- Re: AC_*/AM_* macros for options, Paul Smith, 2013/10/30
- Re: AC_*/AM_* macros for options, Paul Eggert, 2013/10/30