Package: snort / 2.9.7.0-5

configure_werror Patch series | download
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
Description: Strip properly werror

 When removing -Werror, make sure that we strip it
 properly, including the possibility of it having a 
 value.

 If not done this way, the configure script will complain
 that gcc cannot build executables because it ends up
 replacing 'gcc -Werror=format-security' and changing
 it into 'gcc =format-security', which fails to build

Author: Javier Fernández-Sanguino Peña <jfs@debian.org>
Origin: vendor
Last-Update: 2014-10-24


diff --git a/configure.in b/configure.in
index b2bd444..8910ab6 100644
--- a/configure.in
+++ b/configure.in
@@ -15,6 +15,10 @@ ADD_WERROR="no"
 # for example AC_CHECK_LIB, will fail because of
 # warning: conflicting types for built-in function <func>
 if eval "echo $CFLAGS | grep -e -Werror"; then
+    CFLAGS=`echo $CFLAGS | sed -e "s/-Werror=.* / /g"` # Remove Werrror with parameter ('Werror=somevalue') first, possible in gcc 4.6
+    # Note: we do not ADD -Werror if we get it with a parameter
+fi
+if eval "echo $CFLAGS | grep -e -Werror"; then
     CFLAGS=`echo $CFLAGS | sed -e "s/-Werror//g"`
     ADD_WERROR="yes"
 fi