All of
 help / color / mirror / Atom feed
From: Ahmad Fatoum <>
To: Avri Altman <>, Ulf Hansson <>
	Ahmad Fatoum <>
Subject: [PATCH] mmc-utils: support overriding CFLAGS without setting -DVERSION
Date: Fri, 26 May 2023 10:11:01 +0200	[thread overview]
Message-ID: <> (raw)

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 <>
 Makefile | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index d8d59a4047fd..10b78ab5d7dd 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,8 @@
 CC ?= gcc
 GIT_VERSION := "$(shell git describe --abbrev=6 --always --tags)"
+CFLAGS ?= -g -O2
 objects = \
 	mmc.o \
 	mmc_cmds.o \

             reply	other threads:[~2023-05-26  8:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-26  8:11 Ahmad Fatoum [this message]
2023-05-26 13:07 ` [PATCH] mmc-utils: support overriding CFLAGS without setting -DVERSION Ulf Hansson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.