aboutsummaryrefslogtreecommitdiffstats
path: root/testing/elfutils/no-werror.patch
blob: ddf963244a753f4f8ac0236d1abbd80c73c58649 (plain) (blame)
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
diff --git a/config/eu.am b/config/eu.am
index 8fe1e25..afeb095 100644
--- a/config/eu.am
+++ b/config/eu.am
@@ -71,7 +71,7 @@ AM_CFLAGS = -std=gnu99 -Wall -Wshadow -Wformat=2 \
 	    -Wold-style-definition -Wstrict-prototypes \
 	    $(LOGICAL_OP_WARNING) $(DUPLICATED_COND_WARNING) \
 	    $(NULL_DEREFERENCE_WARNING) $(IMPLICIT_FALLTHROUGH_WARNING) \
-	    $(if $($(*F)_no_Werror),,-Werror) \
+	    $(if $($(*F)_no_Werror),,$(WERROR)) \
 	    $(if $($(*F)_no_Wunused),,-Wunused -Wextra) \
 	    $(if $($(*F)_no_Wstack_usage),,$(STACK_USAGE_WARNING)) \
 	    $($(*F)_CFLAGS)
diff --git a/configure.ac b/configure.ac
index 4549906..6a74a06 100644
--- a/configure.ac
+++ b/configure.ac
@@ -57,6 +57,14 @@ AC_CONFIG_FILES([elfutils.spec:config/elfutils.spec.in])
 
 AC_CANONICAL_HOST
 
+AC_ARG_ENABLE(werror,
+[AS_HELP_STRING([--disable-werror],
+                [turn off -Werror @<:@default=enabled@:>@])])
+if test "x$enable_werror" != "xno"; then
+  WERROR="-Werror"
+fi
+AC_SUBST(WERROR)
+
 AC_ARG_ENABLE(deterministic-archives,
 [AS_HELP_STRING([--enable-deterministic-archives],
 		[ar and ranlib default to -D behavior])], [