blob: 1de2ed2d69c55b342e3b7163b404594628118819 (
plain)
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
|
From: Lukas Schwaighofer <lukas@schwaighofer.name>
Date: Thu, 20 Apr 2017 23:26:01 +0200
Subject: configure.in: preserve CFLAGS
Forwarded: https://lists.alioth.debian.org/pipermail/pkg-security-team/Week-of-Mon-20170417/001267.html
This patch fixes two problems with configure.in:
* The [ and ] characters, which are part of the perl command, get
removed by m4/autoconf processing. The patch replaces them by @<:@
and @:>@ so the perl snippet ends up correctly in the configure script
* Do not remove `-g` if it was explicitly included in the CFLAGS given
to configure (the user knows best). Instead only remove `-g` from the
default CFLAGS.
---
configure.in | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
--- a/configure.in
+++ b/configure.in
@@ -4,6 +4,8 @@
AM_INIT_AUTOMAKE([1.9 foreign])
AM_CONFIG_HEADER(config.h)
+# remove -g from the default flags
+: ${CFLAGS="-O2"}
AC_PROG_CC
AM_PROG_CC_STDC
AC_HEADER_STDC
@@ -27,15 +29,10 @@
AC_ARG_ENABLE(debug, [ --enable-debug turn on debugging], enable_debug=yes, enable_debug=no)
if test "x$enable_debug" = "xyes"; then
# remove -O flags from CFLAGS
- CFLAGS=`perl -e '$ARGV[0]=~s/-O\d?//g;print $ARGV[0]' -- "$CFLAGS"`
+ CFLAGS=`perl -e '$ARGV@<:@0@:>@=~s/-O\d?//g;print $ARGV@<:@0@:>@' -- "$CFLAGS"`
# add debug parameters
CFLAGS="$CFLAGS -g -DDEBUG -DDOJDEBUG"
AC_MSG_RESULT(yes)
-else
- # remove -g flags from CFLAGS
- CFLAGS=`perl -e '$ARGV[0]=~s/-g//g;print $ARGV[0]' -- "$CFLAGS"`
- CFLAGS="$CFLAGS -O2"
- AC_MSG_RESULT(no)
fi
# produce Makefiles
|