configure: fix -Werror builds
[m6w6/ext-http] / config9.m4
index 1f8adabd338b4655dafdcb8b0ccba60de36cda88..dda5b015fe8bc0138a2ba0f3781628be373dd500 100644 (file)
@@ -82,6 +82,11 @@ if test "$PHP_HTTP" != "no"; then
 
                PECL_CHECK_CONFIG(libicu, [$ICU_CONFIG], [--version], [--cppflags], [--ldflags-searchpath], [--ldflags-libsonly])
                AC_CACHE_CHECK([for uidna_IDNToASCII], PECL_CACHE_VAR([HAVE_UIDNA_IDNToASCII]), [
+                       if printf "%s" "$CFLAGS" | $EGREP -q "(^|\s)-Werror\b"; then
+                               if ! printf "%s" "$CFLAGS" | $EGREP -q "(^|\s)-Wno-error=deprecated-declarations\b"; then
+                                       CFLAGS="$CFLAGS -Wno-error=deprecated-declarations"
+                               fi
+                       fi
                        AC_TRY_LINK([
                                #include <unicode/uidna.h>
                        ], [