<commit_before>dnl config.m4 for pecl/http
dnl $Id$
dnl vim: noet ts=1 sw=1

PHP_ARG_ENABLE([http], [whether to enable extended HTTP support],
[  --enable-http           Enable extended HTTP support])
PHP_ARG_WITH([http-curl-requests], [whether to enable cURL HTTP request support],
[  --with-http-curl-requests[=LIBCURLDIR]
                           HTTP: with cURL request support], $PHP_HTTP, $PHP_HTTP)
PHP_ARG_WITH([http-zlib-compression], [whether to enable zlib encodings support],
[  --with-http-zlib-compression[=LIBZDIR]
                           HTTP: with zlib encodings support], $PHP_HTTP, $PHP_HTTP)
PHP_ARG_WITH([http-magic-mime], [whether to enable response content type guessing],
[  --with-http-magic-mime[=LIBMAGICDIR]
                           HTTP: with magic mime response content type guessing], "no", "no")

if test "$PHP_HTTP" != "no"; then

	ifdef([AC_PROG_EGREP], [
		AC_PROG_EGREP
	], [
		AC_CHECK_PROG(EGREP, egrep, egrep)
	])
	ifdef([AC_PROG_SED], [
		AC_PROG_SED
	], [
		ifdef([LT_AC_PROG_SED], [
			LT_AC_PROG_SED
		], [
			AC_CHECK_PROG(SED, sed, sed)
		])
	])

dnl -------
dnl HEADERS
dnl -------
	AC_CHECK_HEADERS([netdb.h unistd.h])

dnl ----
dnl ZLIB
dnl ----
	if test "$PHP_HTTP_ZLIB_ENCODINGS" != "no"; then
		AC_MSG_CHECKING([for zlib.h])
		ZLIB_DIR=
		for i in "$PHP_HTTP_ZLIB_COMPRESSION" "$PHP_ZLIB_DIR" "$PHP_ZLIB" /user/local /usr /opt; do
			if test -f "$i/include/zlib.h"; then
				ZLIB_DIR=$i
				break;
			fi
		done
		if test -z "$ZLIB_DIR"; then
			AC_MSG_RESULT([not found])
			AC_MSG_WARN([could not find zlib.h])
		else
			AC_MSG_RESULT([found in $ZLIB_DIR])
			AC_MSG_CHECKING([for zlib version >= 1.2.0.4])
			ZLIB_VERSION=`$EGREP "define ZLIB_VERSION" $ZLIB_DIR/include/zlib.h | $SED -e 's/[[^0-9\.]]//g'`
			AC_MSG_RESULT([$ZLIB_VERSION])<commit_msg>- typo<commit_after>dnl config.m4 for pecl/http
dnl $Id$
dnl vim: noet ts=1 sw=1

PHP_ARG_ENABLE([http], [whether to enable extended HTTP support],
[  --enable-http           Enable extended HTTP support])
PHP_ARG_WITH([http-curl-requests], [whether to enable cURL HTTP request support],
[  --with-http-curl-requests[=LIBCURLDIR]
                           HTTP: with cURL request support], $PHP_HTTP, $PHP_HTTP)
PHP_ARG_WITH([http-zlib-compression], [whether to enable zlib encodings support],
[  --with-http-zlib-compression[=LIBZDIR]
                           HTTP: with zlib encodings support], $PHP_HTTP, $PHP_HTTP)
PHP_ARG_WITH([http-magic-mime], [whether to enable response content type guessing],
[  --with-http-magic-mime[=LIBMAGICDIR]
                           HTTP: with magic mime response content type guessing], "no", "no")

if test "$PHP_HTTP" != "no"; then

	ifdef([AC_PROG_EGREP], [
		AC_PROG_EGREP
	], [
		AC_CHECK_PROG(EGREP, egrep, egrep)
	])
	ifdef([AC_PROG_SED], [
		AC_PROG_SED
	], [
		ifdef([LT_AC_PROG_SED], [
			LT_AC_PROG_SED
		], [
			AC_CHECK_PROG(SED, sed, sed)
		])
	])

dnl -------
dnl HEADERS
dnl -------
	AC_CHECK_HEADERS([netdb.h unistd.h])

dnl ----
dnl ZLIB
dnl ----
	if test "$PHP_HTTP_ZLIB_ENCODINGS" != "no"; then
		AC_MSG_CHECKING([for zlib.h])
		ZLIB_DIR=
		for i in "$PHP_HTTP_ZLIB_COMPRESSION" "$PHP_ZLIB_DIR" "$PHP_ZLIB" /usr/local /usr /opt; do
			if test -f "$i/include/zlib.h"; then
				ZLIB_DIR=$i
				break;
			fi
		done
		if test -z "$ZLIB_DIR"; then
			AC_MSG_RESULT([not found])
			AC_MSG_WARN([could not find zlib.h])
		else
			AC_MSG_RESULT([found in $ZLIB_DIR])
			AC_MSG_CHECKING([for zlib version >= 1.2.0.4])
			ZLIB_VERSION=`$EGREP "define ZLIB_VERSION" $ZLIB_DIR/include/zlib.h | $SED -e 's/[[^0-9\.]]//g'`
			AC_MSG_RESULT([$ZLIB_VERSION])
{'fraction_non_alphanumeric': 0.15080243497509685, 'fraction_numerical': 0.004980630879911455, 'mean_word_length': 3.2781065088757395, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7091373', 'n_tokens_mistral': 1545, 'n_tokens_neox': 1425, 'n_words': 308}