X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=config9.m4;h=695701b6362ec620a970528b0d315ba3109d7fbf;hp=c8e0d45330e2cab6fe3b62f6117ae69858c098d9;hb=HEAD;hpb=80bb9787a447fd8443b824f4b3f38ecf87eca9b6 diff --git a/config9.m4 b/config9.m4 index c8e0d45..35f1af1 100644 --- a/config9.m4 +++ b/config9.m4 @@ -2,6 +2,7 @@ m4_foreach(dir, [., ext/http], [ sinclude(dir/autoconf/pecl/pecl.m4) sinclude(dir/autoconf/pecl/zlib.m4) + sinclude(dir/autoconf/pecl/libbrotli.m4) sinclude(dir/autoconf/pecl/libcurl.m4) sinclude(dir/autoconf/pecl/libevent.m4) ]) @@ -24,19 +25,29 @@ if test "$PHP_HTTP" != "no"; then ]) AC_CHECK_FUNCS(mbrtowc mbtowc iswalnum inet_pton) + CFLAGS="$CFLAGS -Wno-strict-prototypes" + dnl ZLIB PHP_ARG_WITH([http-zlib-dir], [whether/where to check for zlib], - [ --with-http-zlib-dir[=DIR] HTTP: where to find zlib], $PHP_HTTP, no) + [ --with-http-zlib-dir[=DIR] HTTP: where to find zlib], $PHP_HTTP) PECL_CHECK_ZLIB([$PHP_HTTP_ZLIB_DIR], [1.2.0.4]) PECL_CHECK_DONE(zlib, $PECL_VAR([HAVE_ZLIB])) + dnl BROTLI + PHP_ARG_WITH([http-libbrotli-dir], [whether/where to check for libbrotli], + [ --with-http-libbrotli-dir[=DIR] HTTP: where to find libbrotli], $PHP_HTTP) + PECL_CHECK_LIBBROTLI([$PHP_HTTP_LIBBROTLI_DIR], [1.0]) + PECL_CHECK_DONE(libbrotli, $PECL_VAR([HAVE_LIBBROTLI])) + dnl CURL PHP_ARG_WITH([http-libcurl-dir], [whether/where to check for libcurl], - [ --with-http-libcurl-dir[=DIR] HTTP: where to find libcurl], $PHP_HTTP, no) + [ --with-http-libcurl-dir[=DIR] HTTP: where to find libcurl], $PHP_HTTP) if test "$PHP_HTTP_LIBCURL_DIR" != "no"; then PECL_CHECK_LIBCURL([$PHP_HTTP_LIBCURL_DIR], [7.18.2]) PECL_HAVE_LIBCURL_PROTOCOL([HTTP], [ PECL_HAVE_LIBCURL_FEATURE([HTTP2]) + PECL_HAVE_LIBCURL_FEATURE([ALT-SVC]) + PECL_HAVE_LIBCURL_FEATURE([HSTS]) PECL_HAVE_LIBCURL_ARES PECL_HAVE_LIBCURL_SSL PECL_HAVE_LIBCURL_CA @@ -58,7 +69,7 @@ if test "$PHP_HTTP" != "no"; then [ --with-http-libidn2-dir[=DIR] HTTP: where to find libidn2], $PHP_HTTP_LIBCURL_DIR, no) if test "$PHP_HTTP_LIBIDN2_DIR" != "no"; then PECL_CHECK_CUSTOM(libidn2, "$PHP_HTTP_LIBIDN2_DIR", idn2.h, idn2, - [$($EGREP "define IDN2_VERSION " "$path/include/idn2.h" | $SED -e's/^.*VERSION //g' -e 's/@<:@^0-9\.@:>@//g')]) + [$($EGREP "define IDN2_VERSION " "include/idn2.h" | $SED -e's/^.*VERSION //g' -e 's/@<:@^0-9\.@:>@//g')]) if $PECL_VAR([HAVE_LIBIDN2]); then PECL_DEFINE([HAVE_IDNA2008]) fi @@ -69,19 +80,37 @@ if test "$PHP_HTTP" != "no"; then if test "$PHP_HTTP_LIBIDN_DIR" != "no"; then PECL_CHECK_PKGCONFIG(libidn, [$PHP_HTTP_LIBIDN_DIR]) if $PECL_VAR([HAVE_LIBIDN]); then - PECL_DEFINE([HAVE_IDNA2003]) + PECL_HAVE_VERSION(libidn, 1.36, [ + PECL_HAVE_VERSION(libidn, 1.39, [ + PECL_DEFINE([HAVE_IDNA2003]) + ], [ + PECL_VAR([HAVE_LIBIDN])=false + AC_MSG_WARN([libidn locale detection broken; disabling libidn support]) + ]) + ], [ + PECL_DEFINE([HAVE_IDNA2003]) + ]) fi PECL_CHECK_DONE(libidn, $PECL_VAR([HAVE_LIBIDN])) fi dnl ICU IDNA PHP_ARG_WITH([http-libicu-dir], [whether/where to check for libicu], - [ --with-http-libidn-dir[=DIR] HTTP: where to find libicu], $PHP_HTTP_LIBCURL_DIR, no) + [ --with-http-libicu-dir[=DIR] HTTP: where to find libicu], $PHP_HTTP_LIBCURL_DIR, no) if test "$PHP_HTTP_LIBICU_DIR" != "no"; then AC_PATH_PROG(ICU_CONFIG, icu-config, false, [$PHP_HTTP_LIBICU_DIR/bin:$PATH:/usr/local/bin]) - PECL_CHECK_CONFIG(libicu, [$ICU_CONFIG], [--version], [--cppflags], [--ldflags-searchpath], [--ldflags-libsonly]) + if $ICU_CONFIG --exists >/dev/null 2>/dev/null; then + PECL_CHECK_CONFIG(libicu, [$ICU_CONFIG], [--version], [--cppflags], [--ldflags-searchpath], [--ldflags-libsonly]) + else + PECL_CHECK_PKGCONFIG(icu-i18n, [$PHP_HTTP_LIBICU_DIR]) + fi 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 ], [ @@ -120,7 +149,7 @@ if test "$PHP_HTTP" != "no"; then [ --with-http-libidnkit2-dir[=DIR] HTTP: where to find libidnkit2], $PHP_HTTP_LIBCURL_DIR, no) if test "$PHP_HTTP_LIBIDNKIT2_DIR" != "no"; then PECL_CHECK_CUSTOM(libidnkit2, "$PHP_HTTP_LIBIDNKIT2_DIR", idn/api.h, idnkit, - [$($EGREP "define IDNKIT_VERSION_LIBIDN\b" "$path/include/idn/version.h" | $SED -e's/^.*VERSION_LIBIDN//g' -e 's/@<:@^0-9\.@:>@//g')]) + [$($EGREP "define IDNKIT_VERSION_LIBIDN\b" "include/idn/version.h" | $SED -e's/^.*VERSION_LIBIDN//g' -e 's/@<:@^0-9\.@:>@//g')]) if $PECL_VAR([HAVE_LIBIDNKIT2]); then PECL_DEFINE([HAVE_IDNA2008]) fi @@ -135,7 +164,7 @@ if test "$PHP_HTTP" != "no"; then AC_MSG_WARN([libidnkit-$PECL_VAR([LIBIDNKIT2_VERSION]) already enabled, skipping libidnkit1]) else PECL_CHECK_CUSTOM(libidnkit, "$PHP_HTTP_LIBIDNKIT_DIR", idn/api.h, idnkit, - [$($EGREP "define IDNKIT_VERSION\b" "$path/include/idn/version.h" | $SED -e's/^.*VERSION//g' -e 's/@<:@^0-9\.@:>@//g')]) + [$($EGREP "define IDNKIT_VERSION\b" "include/idn/version.h" | $SED -e's/^.*VERSION//g' -e 's/@<:@^0-9\.@:>@//g')]) if $PECL_VAR([HAVE_LIBIDNKIT]); then PECL_DEFINE([HAVE_IDNA2003]) fi @@ -149,12 +178,6 @@ if test "$PHP_HTTP" != "no"; then ], [ AC_MSG_ERROR([please install and enable pecl/raphf]) ]) - PECL_HAVE_PHP_EXT([propro], [ - PECL_HAVE_PHP_EXT_HEADER([propro]) - ], [ - AC_MSG_ERROR([please install and enable pecl/propro]) - ]) - PECL_HAVE_PHP_EXT([hash]) PECL_HAVE_PHP_EXT([iconv]) dnl DONE @@ -184,7 +207,6 @@ if test "$PHP_HTTP" != "no"; then fi fi PHP_ADD_EXTENSION_DEP([http], [raphf], true) - PHP_ADD_EXTENSION_DEP([http], [propro], true) PHP_SUBST(PECL_VAR([HEADERS])) PHP_SUBST(PECL_VAR([SOURCES]))