diff mbox series

[01/37] libxfs: require -std=gnu11 for compilation by default

Message ID 172954783487.34558.3883793884591579863.stgit@frogsfrogsfrogs (mailing list archive)
State Deferred, archived
Headers show
Series [01/37] libxfs: require -std=gnu11 for compilation by default | expand

Commit Message

Darrick J. Wong Oct. 21, 2024, 9:59 p.m. UTC
From: Darrick J. Wong <djwong@kernel.org>

The kernel now builds with -std=gnu11, so let's make xfsprogs do that by
default too.  Distributions can still override the parameters by passing
CFLAGS= and BUILD_CFLAGS= to configure, just as they always have.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
---
 configure.ac |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

Comments

Christoph Hellwig Oct. 22, 2024, 5:56 a.m. UTC | #1
On Mon, Oct 21, 2024 at 02:59:11PM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <djwong@kernel.org>
> 
> The kernel now builds with -std=gnu11, so let's make xfsprogs do that by
> default too.  Distributions can still override the parameters by passing
> CFLAGS= and BUILD_CFLAGS= to configure, just as they always have.

Looks good:

Reviewed-by: Christoph Hellwig <hch@lst.de>
diff mbox series

Patch

diff --git a/configure.ac b/configure.ac
index 901208a8d273eb..b75f7d9e7563b2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -5,6 +5,11 @@  AC_CONFIG_MACRO_DIR([m4])
 AC_CONFIG_SRCDIR([include/libxfs.h])
 AC_PREFIX_DEFAULT(/usr)
 
+# Default CFLAGS if nobody specifies anything else
+if test "${CFLAGS+set}" != "set"; then
+	CFLAGS="-g -O2 -std=gnu11"
+fi
+
 AC_PROG_INSTALL
 LT_INIT
 
@@ -22,7 +27,7 @@  if test "${BUILD_CFLAGS+set}" != "set"; then
   if test $cross_compiling = no; then
     BUILD_CFLAGS="$CFLAGS"
   else
-    BUILD_CFLAGS="-g -O2"
+    BUILD_CFLAGS="-g -O2 -std=gnu11"
   fi
 fi