configure: fix -Werror builds
authorMichael Wallner <mike@php.net>
Tue, 13 Dec 2016 09:10:09 +0000 (10:10 +0100)
committerMichael Wallner <mike@php.net>
Tue, 13 Dec 2016 09:21:37 +0000 (10:21 +0100)
autoconf/pecl/libcurl.m4
config9.m4

index 22b24c6..73ea259 100644 (file)
@@ -47,6 +47,7 @@ AC_DEFUN([PECL_HAVE_LIBCURL_SSLLIB], [
        if test -z "$PECL_VAR([LIBCURL_SSLLIB])"; then
                AC_CACHE_CHECK([for $1 providing SSL in libcurl], PECL_CACHE_VAR([HAVE_LIBCURL_$1]), [
                        AC_TRY_RUN([
+                               #include <strings.h>
                                #include <curl/curl.h>
                                int main(int argc, char *argv[]) {
                                        curl_version_info_data *data = curl_version_info(CURLVERSION_NOW);
index 1f8adab..dda5b01 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>
                        ], [