File: Don-t-change-the-C-XX-FLAGS-provided-by-the-user.patch

package info (click to toggle)
xml-security-c 2.0.2-4
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 6,744 kB
  • sloc: cpp: 45,884; sh: 4,157; makefile: 560; perl: 228
file content (66 lines) | stat: -rw-r--r-- 2,071 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
From: =?utf-8?q?Ferenc_W=C3=A1gner?= <wferi@debian.org>
Date: Sat, 24 Nov 2018 01:27:26 +0100
Subject: Don't change the C(XX)FLAGS provided by the user

Leave the default at -g -O2 as AC_PROG_CC sets it; such options are
better customized by setting C(XX)FLAGS on the command line.
Defining NDEBUG is risky, don't do that; use --enable-debug for
producing the debug variant only.
Enable another bunch of warnings (-W) under GCC.
---
 configure.ac     | 16 ++++++++--------
 xsec/Makefile.am |  2 +-
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/configure.ac b/configure.ac
index 9b5ea48..5c5d0cf 100644
--- a/configure.ac
+++ b/configure.ac
@@ -27,15 +27,12 @@ PKG_INSTALLDIR
 AC_SYS_LARGEFILE
 
 AC_ARG_ENABLE(debug,
-    AS_HELP_STRING([--enable-debug],[Have GCC compile with symbols (Default = no)]),
+    AS_HELP_STRING([--enable-debug],[Produce debug variant (Default = no)]),
     enable_debug=$enableval, enable_debug=no)
 
 if test "$enable_debug" = "yes" ; then
-    GCC_CFLAGS="$CFLAGS -g -D_DEBUG"
-    GCC_CXXFLAGS="$CXXFLAGS -g -D_DEBUG"
-else
-    GCC_CFLAGS="$CFLAGS -O2 -DNDEBUG"
-    GCC_CXXFLAGS="$CXXFLAGS -O2 -DNDEBUG"
+    AM_CFLAGS="-D_DEBUG"
+    AM_CXXFLAGS="-D_DEBUG"
 fi
 
 
@@ -56,10 +53,13 @@ AC_PROG_AWK
 AC_CHECK_PROG(AUTOCONF, autoconf, autoconf, true)
 
 if test "$GCC" = "yes" ; then
-    CFLAGS="-Wall $GCC_CFLAGS"
-    CXXFLAGS="-Wall $GCC_CXXFLAGS"
+    AM_CFLAGS="$AM_CFLAGS -Wall -W"
+    AM_CXXFLAGS="$AM_CXXFLAGS -Wall -W"
 fi
 
+AC_SUBST([AM_CFLAGS])
+AC_SUBST([AM_CXXFLAGS])
+
 AX_PTHREAD(,[AC_MSG_ERROR([unable to find pthreads, currently this is required])])
 
 # Check for required includes
diff --git a/xsec/Makefile.am b/xsec/Makefile.am
index 91ea82a..781548e 100644
--- a/xsec/Makefile.am
+++ b/xsec/Makefile.am
@@ -21,7 +21,7 @@ AM_CPPFLAGS = -I$(top_builddir) -I$(top_srcdir)
 noinst_PROGRAMS = ${samples}
 bin_PROGRAMS = ${tools}
 
-AM_CXXFLAGS = $(xerces_CXXFLAGS) $(xalan_CXXFLAGS)
+AM_CXXFLAGS += $(xerces_CXXFLAGS) $(xalan_CXXFLAGS)
 LDADD = libxml-security-c.la $(xerces_LIBS) $(xalan_LIBS)
 
 #