<commit_before>dnl @synopsis XERCES_CURL_PREFIX
dnl
dnl Determines the prefix for libcurl
dnl
dnl @category C
dnl @author <NAME>
dnl @version 2005-05-23
dnl @license AllPermissive
dnl
dnl $Id$

AC_DEFUN([XERCES_CURL_PREFIX],
	[
	AC_ARG_WITH([curl],
		[AS_HELP_STRING([--with-curl[[[[=DIR]]]]],[Specify location of libcurl])],
		[
                  if test x"$with_curl" = x"yes"; then
                    with_curl=
                  fi
                ],
		[with_curl=])

	# Determine if curl is available
	AC_CACHE_VAL([xerces_cv_curl_present],
	[
		xerces_cv_curl_present=no
		if test x"$with_curl" != x"no"; then

                  # See if we were given a prefix.
                  #
		  if test -n "$with_curl"; then
                    AC_PATH_PROG([curl_config], [curl-config],[],[$with_curl/bin])
                  else
                    AC_PATH_PROG([curl_config], [curl-config],[])
                  fi

                  if test -n "$curl_config"; then
                    curl_flags=`$curl_config --cflags`
		    curl_libs=`$curl_config --libs`
                  else
                    if test -n "$with_curl"; then
                      curl_flags="-I$with_curl/include"
     		      curl_libs="-L$with_curl/lib -lcurl"
                    else
                      # Default compiler paths.
                      #
                      curl_flags=
     		      curl_libs=-lcurl
                    fi
                  fi

                  # Check that the headers exist and can be compiled.
                  #
                  orig_cppflags=$CPPFLAGS
                  if test -n "$curl_flags"; then
		    CPPFLAGS="$curl_flags $CPPFLAGS"
                  fi
                  AC_CHECK_HEADER([curl/curl.h], [xerces_cv_curl_present=yes])
		  CPPFLAGS=$orig_cppflags

                  if test x"$xerces_cv_curl_present" != x"no"; then

                    # Check that the library can be linked.
                    #
                    AC_MSG_CHECKING([for curl_multi_init in -lcurl])

		    orig_ldflags=$LDFLAGS
		    LDFLAGS="$curl_libs $LDFLAGS"

                    AC_LINK_IFELSE(
		    AC_LANG_SOURCE[[
                    #include <curl/curl.h>
                    #include <curl/multi.h>
                    #include <curl/easy.h>

                    int main ()
                    {
                      curl_multi_init();
                      return 0;
                    }
		    ]],
		    [], [xerces_cv_curl_present=no])

		    LDFLAGS=$orig_ldflags

                    if test x"$xerces_cv_curl_present" != x"no"; then
		      AC_MSG_RESULT([yes])
                    else
                      AC_MSG_RESULT([no])
                    fi
                  fi
		fi
	])

        AC_CACHE_VAL([xerces_cv_curl_flags], [xerces_cv_curl_flags=$curl_flags])
	AC_CACHE_VAL([xerces_cv_curl_libs], [xerces_cv_curl_libs=$curl_libs])

	AC_SUBST([CURL_PRESENT], [$xerces_cv_curl_present])<commit_msg>Use LIBS variable instead of LDFLAGS to specify the location of cURL (XERCESC-2028). Patch by <NAME><commit_after>dnl @synopsis XERCES_CURL_PREFIX
dnl
dnl Determines the prefix for libcurl
dnl
dnl @category C
dnl @author <NAME>
dnl @version 2005-05-23
dnl @license AllPermissive
dnl
dnl $Id$

AC_DEFUN([XERCES_CURL_PREFIX],
	[
	AC_ARG_WITH([curl],
		[AS_HELP_STRING([--with-curl[[[[=DIR]]]]],[Specify location of libcurl])],
		[
			if test x"$with_curl" = x"yes"; then
				with_curl=
			fi
		],
		[with_curl=])

	# Determine if curl is available
	AC_CACHE_VAL([xerces_cv_curl_present],
	[
		xerces_cv_curl_present=no
		if test x"$with_curl" != x"no"; then

		# See if we were given a prefix.
		#
		if test -n "$with_curl"; then
			AC_PATH_PROG([curl_config], [curl-config],[],[$with_curl/bin])
		else
			AC_PATH_PROG([curl_config], [curl-config],[])
		fi

		if test -n "$curl_config"; then
			curl_flags=`$curl_config --cflags`
			curl_libs=`$curl_config --libs`
		else
			if test -n "$with_curl"; then
				curl_flags="-I$with_curl/include"
				curl_libs="-L$with_curl/lib -lcurl"
			else
				# Default compiler paths.
				#
				curl_flags=
				curl_libs=-lcurl
			fi
		fi

		# Check that the headers exist and can be compiled.
		#
		orig_cppflags=$CPPFLAGS
		if test -n "$curl_flags"; then
			CPPFLAGS="$curl_flags $CPPFLAGS"
		fi
		AC_CHECK_HEADER([curl/curl.h], [xerces_cv_curl_present=yes])
		CPPFLAGS=$orig_cppflags

		if test x"$xerces_cv_curl_present" != x"no"; then

			# Check that the library can be linked.
			#
			AC_MSG_CHECKING([for curl_multi_init in -lcurl])

			orig_libs=$LIBS
			LIBS="$curl_libs $LIBS"

			AC_LINK_IFELSE(
				AC_LANG_SOURCE[[
                    #include <curl/curl.h>
                    #include <curl/multi.h>
                    #include <curl/easy.h>

                    int main ()
                    {
                      curl_multi_init();
                      return 0;
                    }
				]],
				[], [xerces_cv_curl_present=no])

			LIBS=$orig_libs

			if test x"$xerces_cv_curl_present" != x"no"; then
				AC_MSG_RESULT([yes])
			else
				AC_MSG_RESULT([no])
			fi
		fi
	fi
	])

	AC_CACHE_VAL([xerces_cv_curl_flags], [xerces_cv_curl_flags=$curl_flags])
	AC_CACHE_VAL([xerces_cv_curl_libs], [xerces_cv_curl_libs=$curl_libs])

	AC_SUBST([CURL_PRESENT], [$xerces_cv_curl_present])
{'fraction_non_alphanumeric': 0.10851830772149497, 'fraction_numerical': 0.004173781066211345, 'mean_word_length': 1.8998899889988998, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 12, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, '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': '4789633', 'n_tokens_mistral': 2093, 'n_tokens_neox': 1727, 'n_words': 350}