Make sure we aren't passing -Werror in the CFLAGS for configure scripts
authorIan Lynagh <igloo@earth.li>
Mon, 15 Jun 2009 21:47:58 +0000 (21:47 +0000)
committerIan Lynagh <igloo@earth.li>
Mon, 15 Jun 2009 21:47:58 +0000 (21:47 +0000)
When configure tests for a feature it may not generate warning-free C
code, and thus may think that the feature doesn't exist if -Werror is
on.

rules/build-package-data.mk

index 79591df..1e2311f 100644 (file)
@@ -20,7 +20,10 @@ ifeq "$(HSCOLOUR_SRCS)" "YES"
 $1_$2_CONFIGURE_OPTS += --with-hscolour="$$(HSCOLOUR)"
 endif
 
-$1_$2_CONFIGURE_OPTS += --configure-option=CFLAGS="$$(SRC_CC_OPTS) $$($1_CC_OPTS) $$($1_$2_CC_OPTS)"
+# We filter out -Werror from SRC_CC_OPTS, because when configure tests
+# for a feature it may not generate warning-free C code, and thus may
+# think that the feature doesn't exist if -Werror is on.
+$1_$2_CONFIGURE_OPTS += --configure-option=CFLAGS="$$(filter-out -Werror,$$(SRC_CC_OPTS)) $$($1_CC_OPTS) $$($1_$2_CC_OPTS)"
 $1_$2_CONFIGURE_OPTS += --configure-option=LDFLAGS="$$(SRC_LD_OPTS) $$($1_LD_OPTS) $$($1_$2_LD_OPTS)"
 
 # This rule configures the package, generates the package-data.mk file