mmc-utils: support overriding CFLAGS without setting -DVERSION

Build tools like OpenEmbedded set the CFLAGS environment variable to be
in line with distro-wide decisions. Updating OpenEmbedded-core to point
at the new mmc-utils breaks, because VERSION would then be undefined.

Instead of having users workaround this by feeding in -DVERSION from
the outside, let's just move it out of environment-overridable CFLAGS
and into AM_CFLAGS instead.

This will inconvenience users that set their own VERSION a bit: The
Makefile sets -Werror and specifying -DVERSION twice will trigger it
because of the duplicate definition. This can be resolved by specifying
-UVERSION first. Given that the VERSION macro has only been there for a
month, this is deemed acceptable.

Fixes: 145c74ab6f2e ("mmc-utils: Change version string to git hash")
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.kernel.org/r/20230526081100.1741293-1-a.fatoum@pengutronix.de
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
1 file changed