I would like to selectively omit certain flags in my call to AM_INIT_AUTOMAKE
in my configure.ac
depending on the Automake version. Is there a way to do that?
The specific problem I'm dealing with is that Automake 1.12 introduced some portability-related warnings (-Wextra-portability
and -Wportability
) that I'd like to disable (since I use -Wall
and -Werror
so I can't just ignore the irrelevant warnings):
AM_INIT_AUTOMAKE([-Wall -Werror -Wno-extra-portability -Wno-portability gnu foreign])
This works fine for Automake 1.12, but earlier versions of Automake error out because they don't know about those flags. Is there a way to only include those flags if we're running with Automake >= 1.12?
I tried using m4_version_compare
but that didn't work (plus I don't think it really even makes sense to use that since it checks the Autoconf version, not the Automake version...)
Here's a solution to a similar problem that involves patching configure.ac
in autogen.sh
, which I would like to avoid...