All of lore.kernel.org
 help / color / mirror / Atom feed
From: Glenn Washburn <development@efficientek.com>
To: Daniel Kiper <dkiper@net-space.pl>, grub-devel@gnu.org
Cc: Glenn Washburn <development@efficientek.com>
Subject: [PATCH v3] configure: Fix default -O2 being added when CFLAGS not set
Date: Sat,  9 Apr 2022 02:29:59 +0000	[thread overview]
Message-ID: <20220409022959.178485-1-development@efficientek.com> (raw)

Autoconf will set a default CFLAGS of "-g -O2" if CFLAGS is not set. CFLAGS
was defaulted to "" early in configure to prevent this. A recent commit
ad9ccf660013c208077b1e983d6c824df25ed1cf ("configure: Fix various new
autotools warnings") added AC_USE_SYSTEM_EXTENSIONS, which pulls in the
autoconf CFLAGS check, before we default CFLAGS and thus setting the
autoconf default for CFLAGS. Move the default setting of CFLAGS to before
AC_USE_SYSTEM_EXTENSIONS so that autoconf will see CFLAGS as set and not
give it a default.

CFLAGS is also moved above AC_CONFIG_AUX_DIR, because CFLAGS should be
defaulted to "" as soon as possible to catch any autoconf macros that try
to use some other default. Regardless, this currently has no effect as that
macro does not consider the CFLAGS variable.

Signed-off-by: Glenn Washburn <development@efficientek.com>
---
 configure.ac | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/configure.ac b/configure.ac
index 94653039c1..57fb709451 100644
--- a/configure.ac
+++ b/configure.ac
@@ -36,12 +36,12 @@ dnl description of the relationships between them.
 
 AC_INIT([GRUB],[2.11],[bug-grub@gnu.org])
 
-AC_USE_SYSTEM_EXTENSIONS
-AC_CONFIG_AUX_DIR([build-aux])
-
 # We don't want -g -O2 by default in CFLAGS
 : ${CFLAGS=""}
 
+AC_USE_SYSTEM_EXTENSIONS
+AC_CONFIG_AUX_DIR([build-aux])
+
 # Checks for build, host and target systems.
 AC_CANONICAL_BUILD
 AC_CANONICAL_HOST
-- 
2.25.1



             reply	other threads:[~2022-04-09  2:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-09  2:29 Glenn Washburn [this message]
2022-04-11 16:49 ` [PATCH v3] configure: Fix default -O2 being added when CFLAGS not set Robbie Harwood
2022-04-14 15:10   ` Daniel Kiper

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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

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

  git send-email \
    --in-reply-to=20220409022959.178485-1-development@efficientek.com \
    --to=development@efficientek.com \
    --cc=dkiper@net-space.pl \
    --cc=grub-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* 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.