Reputation: 16779
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...
Upvotes: 0
Views: 2255
Reputation: 16305
The short answer is no, you can't cleanly do that in automake. If you want something like that you'll have to patch configure.ac
in the bootstrap script (autogen.sh
).
Easier still, just require automake 1.12.
The problem is that the automake version number that you want to compare (written to configure
as am__api_version
) is not provided in the M4sugar layer. Not having that information there makes it hard to fix past versions of automake.
EDIT: I thought of a different way of way of doing the same thing without patching configure.ac
using autogen.sh
, but the end result is the same. The make dist
tarball will still have a "baked in" version of automake options based on the automake version of whoever built the tarball. But really this is no different than just setting an automake version with options.
Upvotes: 2