SHA256
1
0
forked from pool/libgtpnl
libgtpnl/0001-Revert-configure-regular_C-PP-FLAGS-C-PP-FLAGS.patch
2024-10-21 00:16:55 +02:00

95 lines
3.9 KiB
Diff

From fba3ca48d9de918b117b42105db751c87ee0dfd8 Mon Sep 17 00:00:00 2001
From: Jan Engelhardt <jengelh@inai.de>
Date: Mon, 21 Oct 2024 00:11:52 +0200
Subject: [PATCH 1/2] Revert `configure: regular_C(PP)FLAGS -> C(PP)FLAGS`
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
This commit reverts dd335ef8fc41567e324a3d26f1ec30d04c69a0bb.
Observed:
```
$ configure && make CPPFLAGS=-DNDEBUG
gcc -DHAVE_CONFIG_H -I. -I.. -DNDEBUG -I../include -I/usr/include/libmnl -DNDEBUG -Wall -Waggregate-return -Wmissing-declarations -Wmissing-prototypes -Wshadow -Wstrict-prototypes -Wformat=2 -pipe -std=gnu11 -fvisibility=hidden -Wall -Waggregate-return -Wmissing-declarations -Wmissing-prototypes -Wshadow -Wstrict-prototypes -Wformat=2 -pipe -std=gnu11 -MT gtp-tunnel.o -MD -MP -MF $depbase.Tpo -c -o gtp-tunnel.o gtp-tunnel.c &&\
```
Expected:
```
gcc -DHAVE_CONFIG_H -I. -I.. -D_FILE_OFFSET_BITS=64 -D_REENTRANT -I../include -I/usr/include/libmnl -D_FILE_OFFSET_BITS=64 -D_REENTRANT -Wall -Waggregate-return -Wmissing-declarations -Wmissing-prototypes -Wshadow -Wstrict-prototypes -Wformat=2 -pipe -std=gnu11 -fvisibility=hidden -Wall -Waggregate-return -Wmissing-declarations -Wmissing-prototypes -Wshadow -Wstrict-prototypes -Wformat=2 -pipe -std=gnu11 -MT gtp-tunnel.o -MD -MP -MF $depbase.Tpo -c -o gtp-tunnel.o gtp-tunnel.c &&\
```
Including ${CFLAGS} in AM_CFLAGS (which is totally wrong)
is the cause for the double apperance of -DNDEBUG.
_FILE_OFFSET_BITS is lost because dd335 violated one core principle
of autoconf/automake: configure MUST run idempotent and not touch
CPPFLAGS and CFLAGS, pursuant to automake.info §3.6 "User variables".
---
Make_global.am | 4 ++--
configure.ac | 16 ++++++++--------
2 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/Make_global.am b/Make_global.am
index 9a3d5b2..f2cb36c 100644
--- a/Make_global.am
+++ b/Make_global.am
@@ -1,2 +1,2 @@
-AM_CPPFLAGS = ${CPPFLAGS} -I${top_srcdir}/include ${LIBMNL_CFLAGS}
-AM_CFLAGS = ${CFLAGS} ${GCC_FVISIBILITY_HIDDEN}
+AM_CPPFLAGS = ${regular_CPPFLAGS} -I${top_srcdir}/include ${LIBMNL_CFLAGS}
+AM_CFLAGS = ${regular_CFLAGS} ${GCC_FVISIBILITY_HIDDEN}
diff --git a/configure.ac b/configure.ac
index 90e4dce..6eabd32 100644
--- a/configure.ac
+++ b/configure.ac
@@ -9,8 +9,8 @@ AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_HEADERS([config.h])
AM_INIT_AUTOMAKE([foreign tar-pax no-dist-gzip dist-bzip2 1.6 subdir-objects])
-CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=64 -D_REENTRANT"
-CFLAGS="$CFLAGS -Wall -Waggregate-return -Wmissing-declarations \
+regular_CPPFLAGS="-D_FILE_OFFSET_BITS=64 -D_REENTRANT"
+regular_CFLAGS="-Wall -Waggregate-return -Wmissing-declarations \
-Wmissing-prototypes -Wshadow -Wstrict-prototypes \
-Wformat=2 -pipe"
@@ -55,8 +55,8 @@ AC_ARG_ENABLE(sanitize,
[sanitize=$enableval], [sanitize="no"])
if test x"$sanitize" = x"yes"
then
- CFLAGS="$CFLAGS -fsanitize=address -fsanitize=undefined"
- CPPFLAGS="$CPPFLAGS -fsanitize=address -fsanitize=undefined"
+ regular_CFLAGS="-fsanitize=address -fsanitize=undefined"
+ regular_CPPFLAGS="-fsanitize=address -fsanitize=undefined"
fi
AC_ARG_ENABLE(werror,
@@ -74,8 +74,8 @@ then
WERROR_FLAGS+=" -Werror=implicit-int -Werror=int-conversion -Werror=old-style-definition"
WERROR_FLAGS+=" -Wno-error=deprecated -Wno-error=deprecated-declarations"
WERROR_FLAGS+=" -Wno-error=cpp" # "#warning"
- CFLAGS="$CFLAGS $WERROR_FLAGS"
- CPPFLAGS="$CPPFLAGS $WERROR_FLAGS"
+ regular_CFLAGS="$WERROR_FLAGS"
+ regular_CPPFLAGS="$WERROR_FLAGS"
fi
AC_ARG_ENABLE(qemu_tests,
@@ -91,8 +91,8 @@ if test x"$qemu_tests" = x"yes" && ! $srcdir/tests/qemu/check-depends.sh; then
AC_MSG_ERROR([missing programs for --enable-qemu-tests])
fi
-AC_SUBST([CPPFLAGS])
-AC_SUBST([CFLAGS])
+AC_SUBST([regular_CPPFLAGS])
+AC_SUBST([regular_CFLAGS])
AC_CONFIG_FILES([
Makefile
include/Makefile
--
2.47.0