diff --git a/cmake/libraries.cmake b/cmake/libraries.cmake index 6697a7aa0c8..7cf8f3a68da 100644 --- a/cmake/libraries.cmake +++ b/cmake/libraries.cmake @@ -11,16 +11,16 @@ set(FLB_PATH_LIB_MSGPACK "lib/msgpack-c") set(FLB_PATH_LIB_NGHTTP2 "lib/nghttp2-1.65.0") set(FLB_PATH_LIB_AVRO "lib/avro") set(FLB_PATH_LIB_CHUNKIO "lib/chunkio") -set(FLB_PATH_LIB_LUAJIT "lib/luajit-04dca791") +set(FLB_PATH_LIB_LUAJIT "lib/luajit-7152e154") set(FLB_PATH_LIB_MONKEY "lib/monkey") set(FLB_PATH_LIB_JSMN "lib/jsmn") -set(FLB_PATH_LIB_SQLITE "lib/sqlite-amalgamation-3450200") +set(FLB_PATH_LIB_SQLITE "lib/sqlite-amalgamation-3510100") set(FLB_PATH_LIB_JANSSON "lib/jansson-e23f558") set(FLB_PATH_LIB_ONIGMO "lib/onigmo") set(FLB_PATH_LIB_MPACK "lib/mpack-amalgamation-1.1.1") set(FLB_PATH_LIB_MINIZ "lib/miniz") set(FLB_PATH_LIB_TUTF8E "lib/tutf8e") -set(FLB_PATH_LIB_CARES "lib/c-ares-1.34.4") +set(FLB_PATH_LIB_CARES "lib/c-ares-1.34.6") set(FLB_PATH_LIB_SNAPPY "lib/snappy-fef67ac") set(FLB_PATH_LIB_RDKAFKA "lib/librdkafka-2.10.1") set(FLB_PATH_LIB_RING_BUFFER "lib/lwrb") diff --git a/lib/c-ares-1.34.4/RELEASE-NOTES.md b/lib/c-ares-1.34.4/RELEASE-NOTES.md deleted file mode 100644 index 19a204b3ea9..00000000000 --- a/lib/c-ares-1.34.4/RELEASE-NOTES.md +++ /dev/null @@ -1,25 +0,0 @@ -## c-ares version 1.34.4 - December 14 2024 - -This is a bugfix release. - -Changes: -* QNX Port: Port to QNX 8, add primary config reading support, add CI build. [PR #934](https://github.com/c-ares/c-ares/pull/934), [PR #937](https://github.com/c-ares/c-ares/pull/937), [PR #938](https://github.com/c-ares/c-ares/pull/938) - -Bugfixes: -* Empty TXT records were not being preserved. [PR #922](https://github.com/c-ares/c-ares/pull/922) -* docs: update deprecation notices for `ares_create_query()` and `ares_mkquery()`. [PR #910](https://github.com/c-ares/c-ares/pull/910) -* license: some files weren't properly updated. [PR #920](https://github.com/c-ares/c-ares/pull/920) -* Fix bind local device regression from 1.34.0. [PR #929](https://github.com/c-ares/c-ares/pull/929), [PR #931](https://github.com/c-ares/c-ares/pull/931), [PR #935](https://github.com/c-ares/c-ares/pull/935) -* CMake: set policy version to prevent deprecation warnings. [PR #932](https://github.com/c-ares/c-ares/pull/932) -* CMake: shared and static library names should be the same on unix platforms like autotools uses. [PR #933](https://github.com/c-ares/c-ares/pull/933) -* Update to latest autoconf archive macros for enhanced system compatibility. [PR #936](https://github.com/c-ares/c-ares/pull/936) - -Thanks go to these friendly people for their efforts and contributions for this -release: - -* Brad House (@bradh352) -* Daniel Stenberg (@bagder) -* Gregor Jasny (@gjasny) -* @marcovsz -* Nikolaos Chatzikonstantinou (@createyourpersonalaccount) -* @vlasovsoft1979 diff --git a/lib/c-ares-1.34.4/m4/ax_cxx_compile_stdcxx_14.m4 b/lib/c-ares-1.34.4/m4/ax_cxx_compile_stdcxx_14.m4 deleted file mode 100644 index 094db0d025c..00000000000 --- a/lib/c-ares-1.34.4/m4/ax_cxx_compile_stdcxx_14.m4 +++ /dev/null @@ -1,34 +0,0 @@ -# ============================================================================= -# https://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx_14.html -# ============================================================================= -# -# SYNOPSIS -# -# AX_CXX_COMPILE_STDCXX_14([ext|noext], [mandatory|optional]) -# -# DESCRIPTION -# -# Check for baseline language coverage in the compiler for the C++14 -# standard; if necessary, add switches to CXX and CXXCPP to enable -# support. -# -# This macro is a convenience alias for calling the AX_CXX_COMPILE_STDCXX -# macro with the version set to C++14. The two optional arguments are -# forwarded literally as the second and third argument respectively. -# Please see the documentation for the AX_CXX_COMPILE_STDCXX macro for -# more information. If you want to use this macro, you also need to -# download the ax_cxx_compile_stdcxx.m4 file. -# -# LICENSE -# -# Copyright (c) 2015 Moritz Klammler -# -# Copying and distribution of this file, with or without modification, are -# permitted in any medium without royalty provided the copyright notice -# and this notice are preserved. This file is offered as-is, without any -# warranty. - -#serial 5 - -AX_REQUIRE_DEFINED([AX_CXX_COMPILE_STDCXX]) -AC_DEFUN([AX_CXX_COMPILE_STDCXX_14], [AX_CXX_COMPILE_STDCXX([14], [$1], [$2])]) diff --git a/lib/c-ares-1.34.4/AUTHORS b/lib/c-ares-1.34.6/AUTHORS similarity index 100% rename from lib/c-ares-1.34.4/AUTHORS rename to lib/c-ares-1.34.6/AUTHORS diff --git a/lib/c-ares-1.34.4/CMakeLists.txt b/lib/c-ares-1.34.6/CMakeLists.txt similarity index 97% rename from lib/c-ares-1.34.4/CMakeLists.txt rename to lib/c-ares-1.34.6/CMakeLists.txt index 139defd8ffd..a2a9c19329e 100644 --- a/lib/c-ares-1.34.4/CMakeLists.txt +++ b/lib/c-ares-1.34.6/CMakeLists.txt @@ -12,7 +12,7 @@ INCLUDE (CheckCSourceCompiles) INCLUDE (CheckStructHasMember) INCLUDE (CheckLibraryExists) -PROJECT (c-ares LANGUAGES C VERSION "1.34.4" ) +PROJECT (c-ares LANGUAGES C VERSION "1.34.6" ) # Set this version before release SET (CARES_VERSION "${PROJECT_VERSION}") @@ -30,7 +30,7 @@ INCLUDE (GNUInstallDirs) # include this *AFTER* PROJECT(), otherwise paths are w # For example, a version of 4:0:2 would generate output such as: # libname.so -> libname.so.2 # libname.so.2 -> libname.so.2.2.0 -SET (CARES_LIB_VERSIONINFO "21:3:19") +SET (CARES_LIB_VERSIONINFO "21:5:19") OPTION (CARES_STATIC "Build as a static library" OFF) @@ -45,15 +45,6 @@ OPTION (CARES_THREADS "Build with thread-safety support" OPTION (CARES_COVERAGE "Build for code coverage" OFF) SET (CARES_RANDOM_FILE "/dev/urandom" CACHE STRING "Suitable File / Device Path for entropy, such as /dev/urandom") - -# Tests require a C++14 compiler -IF (CARES_BUILD_TESTS OR CARES_BUILD_CONTAINER_TESTS) - set(CMAKE_CXX_STANDARD 14) - set(CMAKE_CXX_STANDARD_REQUIRED TRUE) - set(CMAKE_CXX_EXTENSIONS FALSE) - enable_language(CXX) -ENDIF () - # Tests require static to be enabled on Windows to be able to access otherwise hidden symbols IF ((CARES_BUILD_TESTS OR CARES_BUILD_CONTAINER_TESTS) AND (NOT CARES_STATIC) AND WIN32) SET (CARES_STATIC ON) @@ -269,17 +260,19 @@ ELSEIF (CMAKE_SYSTEM_NAME STREQUAL "SunOS") LIST (APPEND SYSFLAGS -D__EXTENSIONS__ -D_REENTRANT -D_XOPEN_SOURCE=600) ELSEIF (CMAKE_SYSTEM_NAME STREQUAL "AIX") LIST (APPEND SYSFLAGS -D_ALL_SOURCE -D_XOPEN_SOURCE=700 -D_USE_IRS) -ELSEIF (CMAKE_SYSTEM_NAME STREQUAL "FreeBSD") +ELSEIF (CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" OR CMAKE_SYSTEM_NAME STREQUAL "MidnightBSD") # Don't define _XOPEN_SOURCE on FreeBSD, it actually reduces visibility instead of increasing it ELSEIF (CMAKE_SYSTEM_NAME STREQUAL "QNX") LIST (APPEND SYSFLAGS -D_QNX_SOURCE) ELSEIF (WIN32) - LIST (APPEND SYSFLAGS -DWIN32_LEAN_AND_MEAN -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -D_WIN32_WINNT=0x0602) + LIST (APPEND SYSFLAGS -DWIN32_LEAN_AND_MEAN -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE) + IF (NOT CMAKE_C_FLAGS MATCHES ".*-D_WIN32_WINNT=.*") + LIST (APPEND SYSFLAGS -D_WIN32_WINNT=0x0602) + ENDIF () ENDIF () ADD_DEFINITIONS(${SYSFLAGS}) - # Tell C-Ares about libraries to depend on IF (HAVE_LIBRESOLV) LIST (APPEND CARES_DEPENDENT_LIBS resolv) @@ -426,6 +419,7 @@ CHECK_SYMBOL_EXISTS (getservbyname_r "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_GETSERV CHECK_SYMBOL_EXISTS (gettimeofday "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_GETTIMEOFDAY) CHECK_SYMBOL_EXISTS (if_indextoname "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_IF_INDEXTONAME) CHECK_SYMBOL_EXISTS (if_nametoindex "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_IF_NAMETOINDEX) +CHECK_SYMBOL_EXISTS (GetBestRoute2 "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_GETBESTROUTE2) CHECK_SYMBOL_EXISTS (ConvertInterfaceIndexToLuid "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_CONVERTINTERFACEINDEXTOLUID) CHECK_SYMBOL_EXISTS (ConvertInterfaceLuidToNameA "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_CONVERTINTERFACELUIDTONAMEA) CHECK_SYMBOL_EXISTS (NotifyIpInterfaceChange "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_NOTIFYIPINTERFACECHANGE) @@ -503,11 +497,7 @@ IF (CARES_THREADS) CARES_EXTRAINCLUDE_IFSET (HAVE_PTHREAD_H pthread.h) CARES_EXTRAINCLUDE_IFSET (HAVE_PTHREAD_NP_H pthread_np.h) CHECK_SYMBOL_EXISTS (pthread_init "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_PTHREAD_INIT) - # Make sure libcares.pc.cmake knows about thread libraries on static builds - # The variable set by FIND_PACKAGE(Threads) has a -l prefix on it, we need - # to strip that first since CARES_DEPENDENT_LIBS doesn't expect that. - STRING (REPLACE "-l" "" CARES_THREAD_LIBRARY "${CMAKE_THREAD_LIBS_INIT}") - LIST (APPEND CARES_DEPENDENT_LIBS ${CARES_THREAD_LIBRARY}) + LIST (APPEND CARES_DEPENDENT_LIBS ${CMAKE_THREAD_LIBS_INIT}) ELSE () MESSAGE (WARNING "Threading support not found, disabling...") SET (CARES_THREADS OFF) @@ -631,6 +621,7 @@ IF (HAVE_GETADDRINFO) CMAKE_SYSTEM_NAME STREQUAL "NetBSD" OR CMAKE_SYSTEM_NAME STREQUAL "SunOS" OR CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" OR + CMAKE_SYSTEM_NAME STREQUAL "MidnightBSD" OR CMAKE_SYSTEM_NAME STREQUAL "AIX" OR WIN32) SET (HAVE_GETADDRINFO_THREADSAFE 1) @@ -777,7 +768,10 @@ IF (CARES_INSTALL) # pkgconfig support for static builds FOREACH (LIB ${CARES_DEPENDENT_LIBS}) - SET (CARES_PRIVATE_LIBS "${CARES_PRIVATE_LIBS} -l${LIB}") + IF (NOT LIB MATCHES "^-") + SET (LIB "-l${LIB}") + ENDIF () + SET (CARES_PRIVATE_LIBS "${CARES_PRIVATE_LIBS} ${LIB}") ENDFOREACH () CONFIGURE_FILE("libcares.pc.cmake" "libcares.pc" @ONLY) diff --git a/lib/c-ares-1.34.4/CONTRIBUTING.md b/lib/c-ares-1.34.6/CONTRIBUTING.md similarity index 100% rename from lib/c-ares-1.34.4/CONTRIBUTING.md rename to lib/c-ares-1.34.6/CONTRIBUTING.md diff --git a/lib/c-ares-1.34.4/DEVELOPER-NOTES.md b/lib/c-ares-1.34.6/DEVELOPER-NOTES.md similarity index 100% rename from lib/c-ares-1.34.4/DEVELOPER-NOTES.md rename to lib/c-ares-1.34.6/DEVELOPER-NOTES.md diff --git a/lib/c-ares-1.34.4/INSTALL.md b/lib/c-ares-1.34.6/INSTALL.md similarity index 100% rename from lib/c-ares-1.34.4/INSTALL.md rename to lib/c-ares-1.34.6/INSTALL.md diff --git a/lib/c-ares-1.34.4/LICENSE.md b/lib/c-ares-1.34.6/LICENSE.md similarity index 100% rename from lib/c-ares-1.34.4/LICENSE.md rename to lib/c-ares-1.34.6/LICENSE.md diff --git a/lib/c-ares-1.34.4/Makefile.Watcom b/lib/c-ares-1.34.6/Makefile.Watcom similarity index 100% rename from lib/c-ares-1.34.4/Makefile.Watcom rename to lib/c-ares-1.34.6/Makefile.Watcom diff --git a/lib/c-ares-1.34.4/Makefile.am b/lib/c-ares-1.34.6/Makefile.am similarity index 100% rename from lib/c-ares-1.34.4/Makefile.am rename to lib/c-ares-1.34.6/Makefile.am diff --git a/lib/c-ares-1.34.4/Makefile.dj b/lib/c-ares-1.34.6/Makefile.dj similarity index 100% rename from lib/c-ares-1.34.4/Makefile.dj rename to lib/c-ares-1.34.6/Makefile.dj diff --git a/lib/c-ares-1.34.4/Makefile.in b/lib/c-ares-1.34.6/Makefile.in similarity index 99% rename from lib/c-ares-1.34.4/Makefile.in rename to lib/c-ares-1.34.6/Makefile.in index 2342125d136..ba5253f890c 100644 --- a/lib/c-ares-1.34.4/Makefile.in +++ b/lib/c-ares-1.34.6/Makefile.in @@ -133,7 +133,6 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ares_check_user_namespace.m4 \ $(top_srcdir)/m4/ax_code_coverage.m4 \ $(top_srcdir)/m4/ax_compiler_vendor.m4 \ $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \ - $(top_srcdir)/m4/ax_cxx_compile_stdcxx_14.m4 \ $(top_srcdir)/m4/ax_file_escapes.m4 \ $(top_srcdir)/m4/ax_pthread.m4 \ $(top_srcdir)/m4/ax_require_defined.m4 \ @@ -329,14 +328,18 @@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ +FILECMD = @FILECMD@ GCOV = @GCOV@ GENHTML = @GENHTML@ GMOCK112_CFLAGS = @GMOCK112_CFLAGS@ GMOCK112_LIBS = @GMOCK112_LIBS@ +GMOCK117_CFLAGS = @GMOCK117_CFLAGS@ +GMOCK117_LIBS = @GMOCK117_LIBS@ GMOCK_CFLAGS = @GMOCK_CFLAGS@ GMOCK_LIBS = @GMOCK_LIBS@ GREP = @GREP@ HAVE_CXX14 = @HAVE_CXX14@ +HAVE_CXX17 = @HAVE_CXX17@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ diff --git a/lib/c-ares-1.34.4/Makefile.m32 b/lib/c-ares-1.34.6/Makefile.m32 similarity index 96% rename from lib/c-ares-1.34.4/Makefile.m32 rename to lib/c-ares-1.34.6/Makefile.m32 index 7bd85165978..427b08771e1 100644 --- a/lib/c-ares-1.34.4/Makefile.m32 +++ b/lib/c-ares-1.34.6/Makefile.m32 @@ -19,7 +19,9 @@ RANLIB = $(CROSSPREFIX)ranlib #RM = rm -f CP = cp -afv -CFLAGS = $(CARES_CFLAG_EXTRAS) -O2 -Wall -I./include -I./src/lib -I./src/lib/include -D_WIN32_WINNT=0x0602 +WIN32_WINNT ?= 0x0602 + +CFLAGS = $(CARES_CFLAG_EXTRAS) -O2 -Wall -I./include -I./src/lib -I./src/lib/include -D_WIN32_WINNT=$(WIN32_WINNT) CFLAGS += -DCARES_STATICLIB LDFLAGS = $(CARES_LDFLAG_EXTRAS) -s LIBS = -lws2_32 -liphlpapi diff --git a/lib/c-ares-1.34.4/Makefile.msvc b/lib/c-ares-1.34.6/Makefile.msvc similarity index 100% rename from lib/c-ares-1.34.4/Makefile.msvc rename to lib/c-ares-1.34.6/Makefile.msvc diff --git a/lib/c-ares-1.34.4/Makefile.netware b/lib/c-ares-1.34.6/Makefile.netware similarity index 100% rename from lib/c-ares-1.34.4/Makefile.netware rename to lib/c-ares-1.34.6/Makefile.netware diff --git a/lib/c-ares-1.34.4/README.md b/lib/c-ares-1.34.6/README.md similarity index 100% rename from lib/c-ares-1.34.4/README.md rename to lib/c-ares-1.34.6/README.md diff --git a/lib/c-ares-1.34.4/README.msvc b/lib/c-ares-1.34.6/README.msvc similarity index 100% rename from lib/c-ares-1.34.4/README.msvc rename to lib/c-ares-1.34.6/README.msvc diff --git a/lib/c-ares-1.34.6/RELEASE-NOTES.md b/lib/c-ares-1.34.6/RELEASE-NOTES.md new file mode 100644 index 00000000000..ded75001b54 --- /dev/null +++ b/lib/c-ares-1.34.6/RELEASE-NOTES.md @@ -0,0 +1,42 @@ +## c-ares version 1.34.6 - December 8 2025 + +This is a security release. + +Security: +* CVE-2025-62408. A use-after-free bug has been uncovered in read_answers() that + was introduced in v1.32.3. Please see https://github.com/c-ares/c-ares/security/advisories/GHSA-jq53-42q6-pqr5 + +Changes: +* Ignore Windows IDN Search Domains until proper IDN support is added. [PR #1034](https://github.com/c-ares/c-ares/pull/1034) + +Bugfixes: +* Event Thread could stall when not notified of new queries on existing + connections that are in a bad state + [PR #1032](https://github.com/c-ares/c-ares/pull/1032) +* fix conversion of invalid service to port number in ares_getaddrinfo() + [PR #1029](https://github.com/c-ares/c-ares/pull/1029) +* fix memory leak in ares_uri + [PR #1012](https://github.com/c-ares/c-ares/pull/1012) +* Ignore ares_event_configchg_init failures + [PR #1009](https://github.com/c-ares/c-ares/pull/1009) +* Use XOR for random seed generation on fallback logic. + [PR #994](https://github.com/c-ares/c-ares/pull/994) +* Fix clang build on windows. + [PR #996](https://github.com/c-ares/c-ares/pull/996) +* Fix IPv6 link-local nameservers in /etc/resolv.conf + [PR #996](https://github.com/c-ares/c-ares/pull/997) +* Fix a few build issues on MidnightBSD. + [PR #983](https://github.com/c-ares/c-ares/pull/983) + +Thanks go to these friendly people for their efforts and contributions for this +release: + +* Brad House (@bradh352) +* (@F3lixTheCat) +* Lucas Holt (@laffer1) +* @oargon +* Pavel P (@pps83) +* Sean Harmer (@seanharmer) +* Uwe (@nixblik) + + diff --git a/lib/c-ares-1.34.4/SECURITY.md b/lib/c-ares-1.34.6/SECURITY.md similarity index 100% rename from lib/c-ares-1.34.4/SECURITY.md rename to lib/c-ares-1.34.6/SECURITY.md diff --git a/lib/c-ares-1.34.4/aclocal.m4 b/lib/c-ares-1.34.6/aclocal.m4 similarity index 99% rename from lib/c-ares-1.34.4/aclocal.m4 rename to lib/c-ares-1.34.6/aclocal.m4 index 04f8786c9c0..a732fb0e2e1 100644 --- a/lib/c-ares-1.34.4/aclocal.m4 +++ b/lib/c-ares-1.34.6/aclocal.m4 @@ -1236,7 +1236,6 @@ m4_include([m4/ax_check_link_flag.m4]) m4_include([m4/ax_code_coverage.m4]) m4_include([m4/ax_compiler_vendor.m4]) m4_include([m4/ax_cxx_compile_stdcxx.m4]) -m4_include([m4/ax_cxx_compile_stdcxx_14.m4]) m4_include([m4/ax_file_escapes.m4]) m4_include([m4/ax_pthread.m4]) m4_include([m4/ax_require_defined.m4]) diff --git a/lib/c-ares-1.34.4/aminclude_static.am b/lib/c-ares-1.34.6/aminclude_static.am similarity index 99% rename from lib/c-ares-1.34.4/aminclude_static.am rename to lib/c-ares-1.34.6/aminclude_static.am index ec7a86a43e6..07239563e6a 100644 --- a/lib/c-ares-1.34.4/aminclude_static.am +++ b/lib/c-ares-1.34.6/aminclude_static.am @@ -1,6 +1,6 @@ # aminclude_static.am generated automatically by Autoconf -# from AX_AM_MACROS_STATIC on Sat Dec 14 15:15:44 UTC 2024 +# from AX_AM_MACROS_STATIC on Mon Dec 8 16:21:41 UTC 2025 # Code coverage diff --git a/lib/c-ares-1.34.4/buildconf b/lib/c-ares-1.34.6/buildconf similarity index 100% rename from lib/c-ares-1.34.4/buildconf rename to lib/c-ares-1.34.6/buildconf diff --git a/lib/c-ares-1.34.4/buildconf.bat b/lib/c-ares-1.34.6/buildconf.bat similarity index 100% rename from lib/c-ares-1.34.4/buildconf.bat rename to lib/c-ares-1.34.6/buildconf.bat diff --git a/lib/c-ares-1.34.4/c-ares-config.cmake.in b/lib/c-ares-1.34.6/c-ares-config.cmake.in similarity index 100% rename from lib/c-ares-1.34.4/c-ares-config.cmake.in rename to lib/c-ares-1.34.6/c-ares-config.cmake.in diff --git a/lib/c-ares-1.34.4/cmake/EnableWarnings.cmake b/lib/c-ares-1.34.6/cmake/EnableWarnings.cmake similarity index 100% rename from lib/c-ares-1.34.4/cmake/EnableWarnings.cmake rename to lib/c-ares-1.34.6/cmake/EnableWarnings.cmake diff --git a/lib/c-ares-1.34.4/config/compile b/lib/c-ares-1.34.6/config/compile similarity index 100% rename from lib/c-ares-1.34.4/config/compile rename to lib/c-ares-1.34.6/config/compile diff --git a/lib/c-ares-1.34.4/config/config.guess b/lib/c-ares-1.34.6/config/config.guess similarity index 100% rename from lib/c-ares-1.34.4/config/config.guess rename to lib/c-ares-1.34.6/config/config.guess diff --git a/lib/c-ares-1.34.4/config/config.sub b/lib/c-ares-1.34.6/config/config.sub similarity index 100% rename from lib/c-ares-1.34.4/config/config.sub rename to lib/c-ares-1.34.6/config/config.sub diff --git a/lib/c-ares-1.34.4/config/depcomp b/lib/c-ares-1.34.6/config/depcomp similarity index 100% rename from lib/c-ares-1.34.4/config/depcomp rename to lib/c-ares-1.34.6/config/depcomp diff --git a/lib/c-ares-1.34.4/config/install-sh b/lib/c-ares-1.34.6/config/install-sh similarity index 100% rename from lib/c-ares-1.34.4/config/install-sh rename to lib/c-ares-1.34.6/config/install-sh diff --git a/lib/c-ares-1.34.4/config/ltmain.sh b/lib/c-ares-1.34.6/config/ltmain.sh similarity index 94% rename from lib/c-ares-1.34.4/config/ltmain.sh rename to lib/c-ares-1.34.6/config/ltmain.sh index 540a92ab547..977e5237bb0 100755 --- a/lib/c-ares-1.34.4/config/ltmain.sh +++ b/lib/c-ares-1.34.6/config/ltmain.sh @@ -1,12 +1,12 @@ -#! /bin/sh +#! /usr/bin/env sh ## DO NOT EDIT - This file generated from ./build-aux/ltmain.in -## by inline-source v2014-01-03.01 +## by inline-source v2019-02-19.15 -# libtool (GNU libtool) 2.4.6 +# libtool (GNU libtool) 2.4.7 # Provide generalized library-building support services. # Written by Gordon Matzigkeit , 1996 -# Copyright (C) 1996-2015 Free Software Foundation, Inc. +# Copyright (C) 1996-2019, 2021-2022 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. @@ -31,8 +31,8 @@ PROGRAM=libtool PACKAGE=libtool -VERSION="2.4.6 Debian-2.4.6-15build2" -package_revision=2.4.6 +VERSION="2.4.7 Debian-2.4.7-7build1" +package_revision=2.4.7 ## ------ ## @@ -64,34 +64,25 @@ package_revision=2.4.6 # libraries, which are installed to $pkgauxdir. # Set a version string for this script. -scriptversion=2015-01-20.17; # UTC +scriptversion=2019-02-19.15; # UTC # General shell script boiler plate, and helper functions. # Written by Gary V. Vaughan, 2004 -# Copyright (C) 2004-2015 Free Software Foundation, Inc. -# This is free software; see the source for copying conditions. There is NO -# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or -# (at your option) any later version. - -# As a special exception to the GNU General Public License, if you distribute -# this file as part of a program or library that is built using GNU Libtool, -# you may include this file under the same distribution terms that you use -# for the rest of that program. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNES FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# This is free software. There is NO warranty; not even for +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# +# Copyright (C) 2004-2019, 2021 Bootstrap Authors +# +# This file is dual licensed under the terms of the MIT license +# , and GPL version 2 or later +# . You must apply one of +# these licenses when using or redistributing this software or any of +# the files within it. See the URLs above, or the file `LICENSE` +# included in the Bootstrap distribution for the full license texts. -# Please report bugs or propose patches to gary@gnu.org. +# Please report bugs or propose patches to: +# ## ------ ## @@ -139,9 +130,12 @@ do _G_safe_locale=\"$_G_var=C; \$_G_safe_locale\" fi" done - -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH +# These NLS vars are set unconditionally (bootstrap issue #24). Unset those +# in case the environment reset is needed later and the $save_* variant is not +# defined (see the code above). +LC_ALL=C +LANGUAGE=C +export LANGUAGE LC_ALL # Make sure IFS has a sensible default sp=' ' @@ -159,6 +153,26 @@ if test "${PATH_SEPARATOR+set}" != set; then fi +# func_unset VAR +# -------------- +# Portably unset VAR. +# In some shells, an 'unset VAR' statement leaves a non-zero return +# status if VAR is already unset, which might be problematic if the +# statement is used at the end of a function (thus poisoning its return +# value) or when 'set -e' is active (causing even a spurious abort of +# the script in this case). +func_unset () +{ + { eval $1=; (eval unset $1) >/dev/null 2>&1 && eval unset $1 || : ; } +} + + +# Make sure CDPATH doesn't cause `cd` commands to output the target dir. +func_unset CDPATH + +# Make sure ${,E,F}GREP behave sanely. +func_unset GREP_OPTIONS + ## ------------------------- ## ## Locate command utilities. ## @@ -259,7 +273,7 @@ test -z "$SED" && { rm -f conftest.in conftest.tmp conftest.nl conftest.out } - func_path_progs "sed gsed" func_check_prog_sed $PATH:/usr/xpg4/bin + func_path_progs "sed gsed" func_check_prog_sed "$PATH:/usr/xpg4/bin" rm -f conftest.sed SED=$func_path_progs_result } @@ -295,7 +309,7 @@ test -z "$GREP" && { rm -f conftest.in conftest.tmp conftest.nl conftest.out } - func_path_progs "grep ggrep" func_check_prog_grep $PATH:/usr/xpg4/bin + func_path_progs "grep ggrep" func_check_prog_grep "$PATH:/usr/xpg4/bin" GREP=$func_path_progs_result } @@ -360,6 +374,35 @@ sed_double_backslash="\ s/\\([^$_G_bs]\\)$_G_bs2$_G_dollar/\\1$_G_bs2$_G_bs$_G_dollar/g s/\n//g" +# require_check_ifs_backslash +# --------------------------- +# Check if we can use backslash as IFS='\' separator, and set +# $check_ifs_backshlash_broken to ':' or 'false'. +require_check_ifs_backslash=func_require_check_ifs_backslash +func_require_check_ifs_backslash () +{ + _G_save_IFS=$IFS + IFS='\' + _G_check_ifs_backshlash='a\\b' + for _G_i in $_G_check_ifs_backshlash + do + case $_G_i in + a) + check_ifs_backshlash_broken=false + ;; + '') + break + ;; + *) + check_ifs_backshlash_broken=: + break + ;; + esac + done + IFS=$_G_save_IFS + require_check_ifs_backslash=: +} + ## ----------------- ## ## Global variables. ## @@ -529,27 +572,15 @@ func_require_term_colors () # --------------------- # Append VALUE onto the existing contents of VAR. - # We should try to minimise forks, especially on Windows where they are - # unreasonably slow, so skip the feature probes when bash or zsh are - # being used: - if test set = "${BASH_VERSION+set}${ZSH_VERSION+set}"; then - : ${_G_HAVE_ARITH_OP="yes"} - : ${_G_HAVE_XSI_OPS="yes"} - # The += operator was introduced in bash 3.1 - case $BASH_VERSION in - [12].* | 3.0 | 3.0*) ;; - *) - : ${_G_HAVE_PLUSEQ_OP="yes"} - ;; - esac - fi - # _G_HAVE_PLUSEQ_OP # Can be empty, in which case the shell is probed, "yes" if += is # useable or anything else if it does not work. - test -z "$_G_HAVE_PLUSEQ_OP" \ - && (eval 'x=a; x+=" b"; test "a b" = "$x"') 2>/dev/null \ - && _G_HAVE_PLUSEQ_OP=yes + if test -z "$_G_HAVE_PLUSEQ_OP" && \ + __PLUSEQ_TEST="a" && \ + __PLUSEQ_TEST+=" b" 2>/dev/null && \ + test "a b" = "$__PLUSEQ_TEST"; then + _G_HAVE_PLUSEQ_OP=yes + fi if test yes = "$_G_HAVE_PLUSEQ_OP" then @@ -580,16 +611,16 @@ if test yes = "$_G_HAVE_PLUSEQ_OP"; then { $debug_cmd - func_quote_for_eval "$2" - eval "$1+=\\ \$func_quote_for_eval_result" + func_quote_arg pretty "$2" + eval "$1+=\\ \$func_quote_arg_result" }' else func_append_quoted () { $debug_cmd - func_quote_for_eval "$2" - eval "$1=\$$1\\ \$func_quote_for_eval_result" + func_quote_arg pretty "$2" + eval "$1=\$$1\\ \$func_quote_arg_result" } fi @@ -1091,85 +1122,203 @@ func_relative_path () } -# func_quote_for_eval ARG... -# -------------------------- -# Aesthetically quote ARGs to be evaled later. -# This function returns two values: -# i) func_quote_for_eval_result -# double-quoted, suitable for a subsequent eval -# ii) func_quote_for_eval_unquoted_result -# has all characters that are still active within double -# quotes backslashified. -func_quote_for_eval () +# func_quote_portable EVAL ARG +# ---------------------------- +# Internal function to portably implement func_quote_arg. Note that we still +# keep attention to performance here so we as much as possible try to avoid +# calling sed binary (so far O(N) complexity as long as func_append is O(1)). +func_quote_portable () { $debug_cmd - func_quote_for_eval_unquoted_result= - func_quote_for_eval_result= - while test 0 -lt $#; do - case $1 in - *[\\\`\"\$]*) - _G_unquoted_arg=`printf '%s\n' "$1" |$SED "$sed_quote_subst"` ;; - *) - _G_unquoted_arg=$1 ;; - esac - if test -n "$func_quote_for_eval_unquoted_result"; then - func_append func_quote_for_eval_unquoted_result " $_G_unquoted_arg" - else - func_append func_quote_for_eval_unquoted_result "$_G_unquoted_arg" + $require_check_ifs_backslash + + func_quote_portable_result=$2 + + # one-time-loop (easy break) + while true + do + if $1; then + func_quote_portable_result=`$ECHO "$2" | $SED \ + -e "$sed_double_quote_subst" -e "$sed_double_backslash"` + break fi - case $_G_unquoted_arg in - # Double-quote args containing shell metacharacters to delay - # word splitting, command substitution and variable expansion - # for a subsequent eval. - # Many Bourne shells cannot handle close brackets correctly - # in scan sets, so we specify it separately. - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - _G_quoted_arg=\"$_G_unquoted_arg\" + # Quote for eval. + case $func_quote_portable_result in + *[\\\`\"\$]*) + # Fallback to sed for $func_check_bs_ifs_broken=:, or when the string + # contains the shell wildcard characters. + case $check_ifs_backshlash_broken$func_quote_portable_result in + :*|*[\[\*\?]*) + func_quote_portable_result=`$ECHO "$func_quote_portable_result" \ + | $SED "$sed_quote_subst"` + break + ;; + esac + + func_quote_portable_old_IFS=$IFS + for _G_char in '\' '`' '"' '$' + do + # STATE($1) PREV($2) SEPARATOR($3) + set start "" "" + func_quote_portable_result=dummy"$_G_char$func_quote_portable_result$_G_char"dummy + IFS=$_G_char + for _G_part in $func_quote_portable_result + do + case $1 in + quote) + func_append func_quote_portable_result "$3$2" + set quote "$_G_part" "\\$_G_char" + ;; + start) + set first "" "" + func_quote_portable_result= + ;; + first) + set quote "$_G_part" "" + ;; + esac + done + done + IFS=$func_quote_portable_old_IFS ;; - *) - _G_quoted_arg=$_G_unquoted_arg - ;; + *) ;; esac - - if test -n "$func_quote_for_eval_result"; then - func_append func_quote_for_eval_result " $_G_quoted_arg" - else - func_append func_quote_for_eval_result "$_G_quoted_arg" - fi - shift + break done + + func_quote_portable_unquoted_result=$func_quote_portable_result + case $func_quote_portable_result in + # double-quote args containing shell metacharacters to delay + # word splitting, command substitution and variable expansion + # for a subsequent eval. + # many bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + func_quote_portable_result=\"$func_quote_portable_result\" + ;; + esac } -# func_quote_for_expand ARG -# ------------------------- -# Aesthetically quote ARG to be evaled later; same as above, -# but do not quote variable references. -func_quote_for_expand () -{ - $debug_cmd +# func_quotefast_eval ARG +# ----------------------- +# Quote one ARG (internal). This is equivalent to 'func_quote_arg eval ARG', +# but optimized for speed. Result is stored in $func_quotefast_eval. +if test xyes = `(x=; printf -v x %q yes; echo x"$x") 2>/dev/null`; then + printf -v _GL_test_printf_tilde %q '~' + if test '\~' = "$_GL_test_printf_tilde"; then + func_quotefast_eval () + { + printf -v func_quotefast_eval_result %q "$1" + } + else + # Broken older Bash implementations. Make those faster too if possible. + func_quotefast_eval () + { + case $1 in + '~'*) + func_quote_portable false "$1" + func_quotefast_eval_result=$func_quote_portable_result + ;; + *) + printf -v func_quotefast_eval_result %q "$1" + ;; + esac + } + fi +else + func_quotefast_eval () + { + func_quote_portable false "$1" + func_quotefast_eval_result=$func_quote_portable_result + } +fi - case $1 in - *[\\\`\"]*) - _G_arg=`$ECHO "$1" | $SED \ - -e "$sed_double_quote_subst" -e "$sed_double_backslash"` ;; - *) - _G_arg=$1 ;; + +# func_quote_arg MODEs ARG +# ------------------------ +# Quote one ARG to be evaled later. MODEs argument may contain zero or more +# specifiers listed below separated by ',' character. This function returns two +# values: +# i) func_quote_arg_result +# double-quoted (when needed), suitable for a subsequent eval +# ii) func_quote_arg_unquoted_result +# has all characters that are still active within double +# quotes backslashified. Available only if 'unquoted' is specified. +# +# Available modes: +# ---------------- +# 'eval' (default) +# - escape shell special characters +# 'expand' +# - the same as 'eval'; but do not quote variable references +# 'pretty' +# - request aesthetic output, i.e. '"a b"' instead of 'a\ b'. This might +# be used later in func_quote to get output like: 'echo "a b"' instead +# of 'echo a\ b'. This is slower than default on some shells. +# 'unquoted' +# - produce also $func_quote_arg_unquoted_result which does not contain +# wrapping double-quotes. +# +# Examples for 'func_quote_arg pretty,unquoted string': +# +# string | *_result | *_unquoted_result +# ------------+-----------------------+------------------- +# " | \" | \" +# a b | "a b" | a b +# "a b" | "\"a b\"" | \"a b\" +# * | "*" | * +# z="${x-$y}" | "z=\"\${x-\$y}\"" | z=\"\${x-\$y}\" +# +# Examples for 'func_quote_arg pretty,unquoted,expand string': +# +# string | *_result | *_unquoted_result +# --------------+---------------------+-------------------- +# z="${x-$y}" | "z=\"${x-$y}\"" | z=\"${x-$y}\" +func_quote_arg () +{ + _G_quote_expand=false + case ,$1, in + *,expand,*) + _G_quote_expand=: + ;; esac - case $_G_arg in - # Double-quote args containing shell metacharacters to delay - # word splitting and command substitution for a subsequent eval. - # Many Bourne shells cannot handle close brackets correctly - # in scan sets, so we specify it separately. - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - _G_arg=\"$_G_arg\" + case ,$1, in + *,pretty,*|*,expand,*|*,unquoted,*) + func_quote_portable $_G_quote_expand "$2" + func_quote_arg_result=$func_quote_portable_result + func_quote_arg_unquoted_result=$func_quote_portable_unquoted_result + ;; + *) + # Faster quote-for-eval for some shells. + func_quotefast_eval "$2" + func_quote_arg_result=$func_quotefast_eval_result ;; esac +} + - func_quote_for_expand_result=$_G_arg +# func_quote MODEs ARGs... +# ------------------------ +# Quote all ARGs to be evaled later and join them into single command. See +# func_quote_arg's description for more info. +func_quote () +{ + $debug_cmd + _G_func_quote_mode=$1 ; shift + func_quote_result= + while test 0 -lt $#; do + func_quote_arg "$_G_func_quote_mode" "$1" + if test -n "$func_quote_result"; then + func_append func_quote_result " $func_quote_arg_result" + else + func_append func_quote_result "$func_quote_arg_result" + fi + shift + done } @@ -1215,8 +1364,8 @@ func_show_eval () _G_cmd=$1 _G_fail_exp=${2-':'} - func_quote_for_expand "$_G_cmd" - eval "func_notquiet $func_quote_for_expand_result" + func_quote_arg pretty,expand "$_G_cmd" + eval "func_notquiet $func_quote_arg_result" $opt_dry_run || { eval "$_G_cmd" @@ -1241,8 +1390,8 @@ func_show_eval_locale () _G_fail_exp=${2-':'} $opt_quiet || { - func_quote_for_expand "$_G_cmd" - eval "func_echo $func_quote_for_expand_result" + func_quote_arg expand,pretty "$_G_cmd" + eval "func_echo $func_quote_arg_result" } $opt_dry_run || { @@ -1369,30 +1518,26 @@ func_lt_ver () # End: #! /bin/sh -# Set a version string for this script. -scriptversion=2015-10-07.11; # UTC - # A portable, pluggable option parser for Bourne shell. # Written by Gary V. Vaughan, 2010 -# Copyright (C) 2010-2015 Free Software Foundation, Inc. -# This is free software; see the source for copying conditions. There is NO -# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. +# This is free software. There is NO warranty; not even for +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# +# Copyright (C) 2010-2019, 2021 Bootstrap Authors +# +# This file is dual licensed under the terms of the MIT license +# , and GPL version 2 or later +# . You must apply one of +# these licenses when using or redistributing this software or any of +# the files within it. See the URLs above, or the file `LICENSE` +# included in the Bootstrap distribution for the full license texts. -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# Please report bugs or propose patches to: +# -# Please report bugs or propose patches to gary@gnu.org. +# Set a version string for this script. +scriptversion=2019-02-19.15; # UTC ## ------ ## @@ -1415,7 +1560,7 @@ scriptversion=2015-10-07.11; # UTC # # In order for the '--version' option to work, you will need to have a # suitably formatted comment like the one at the top of this file -# starting with '# Written by ' and ending with '# warranty; '. +# starting with '# Written by ' and ending with '# Copyright'. # # For '-h' and '--help' to work, you will also need a one line # description of your script's purpose in a comment directly above the @@ -1427,7 +1572,7 @@ scriptversion=2015-10-07.11; # UTC # to display verbose messages only when your user has specified # '--verbose'. # -# After sourcing this file, you can plug processing for additional +# After sourcing this file, you can plug in processing for additional # options by amending the variables from the 'Configuration' section # below, and following the instructions in the 'Option parsing' # section further down. @@ -1476,8 +1621,8 @@ fatal_help="Try '\$progname --help' for more information." ## ------------------------- ## # This section contains functions for adding, removing, and running hooks -# to the main code. A hook is just a named list of of function, that can -# be run in order later on. +# in the main code. A hook is just a list of function names that can be +# run in order later on. # func_hookable FUNC_NAME # ----------------------- @@ -1510,7 +1655,8 @@ func_add_hook () # func_remove_hook FUNC_NAME HOOK_FUNC # ------------------------------------ -# Remove HOOK_FUNC from the list of functions called by FUNC_NAME. +# Remove HOOK_FUNC from the list of hook functions to be called by +# FUNC_NAME. func_remove_hook () { $debug_cmd @@ -1519,10 +1665,28 @@ func_remove_hook () } +# func_propagate_result FUNC_NAME_A FUNC_NAME_B +# --------------------------------------------- +# If the *_result variable of FUNC_NAME_A _is set_, assign its value to +# *_result variable of FUNC_NAME_B. +func_propagate_result () +{ + $debug_cmd + + func_propagate_result_result=: + if eval "test \"\${${1}_result+set}\" = set" + then + eval "${2}_result=\$${1}_result" + else + func_propagate_result_result=false + fi +} + + # func_run_hooks FUNC_NAME [ARG]... # --------------------------------- # Run all hook functions registered to FUNC_NAME. -# It is assumed that the list of hook functions contains nothing more +# It's assumed that the list of hook functions contains nothing more # than a whitespace-delimited list of legal shell function names, and # no effort is wasted trying to catch shell meta-characters or preserve # whitespace. @@ -1534,22 +1698,19 @@ func_run_hooks () case " $hookable_fns " in *" $1 "*) ;; - *) func_fatal_error "'$1' does not support hook funcions.n" ;; + *) func_fatal_error "'$1' does not support hook functions." ;; esac eval _G_hook_fns=\$$1_hooks; shift for _G_hook in $_G_hook_fns; do - if eval $_G_hook '"$@"'; then - # store returned options list back into positional - # parameters for next 'cmd' execution. - eval _G_hook_result=\$${_G_hook}_result - eval set dummy "$_G_hook_result"; shift - _G_rc_run_hooks=: + func_unset "${_G_hook}_result" + eval $_G_hook '${1+"$@"}' + func_propagate_result $_G_hook func_run_hooks + if $func_propagate_result_result; then + eval set dummy "$func_run_hooks_result"; shift fi done - - $_G_rc_run_hooks && func_run_hooks_result=$_G_hook_result } @@ -1559,14 +1720,16 @@ func_run_hooks () ## --------------- ## # In order to add your own option parsing hooks, you must accept the -# full positional parameter list in your hook function, you may remove/edit -# any options that you action, and then pass back the remaining unprocessed -# options in '_result', escaped suitably for -# 'eval'. In this case you also must return $EXIT_SUCCESS to let the -# hook's caller know that it should pay attention to -# '_result'. Returning $EXIT_FAILURE signalizes that -# arguments are left untouched by the hook and therefore caller will ignore the -# result variable. +# full positional parameter list from your hook function. You may remove +# or edit any options that you action, and then pass back the remaining +# unprocessed options in '_result', escaped +# suitably for 'eval'. +# +# The '_result' variable is automatically unset +# before your hook gets called; for best performance, only set the +# *_result variable when necessary (i.e. don't call the 'func_quote' +# function unnecessarily because it can be an expensive operation on some +# machines). # # Like this: # @@ -1578,11 +1741,8 @@ func_run_hooks () # usage_message=$usage_message' # -s, --silent don'\''t print informational messages # ' -# # No change in '$@' (ignored completely by this hook). There is -# # no need to do the equivalent (but slower) action: -# # func_quote_for_eval ${1+"$@"} -# # my_options_prep_result=$func_quote_for_eval_result -# false +# # No change in '$@' (ignored completely by this hook). Leave +# # my_options_prep_result variable intact. # } # func_add_hook func_options_prep my_options_prep # @@ -1593,7 +1753,7 @@ func_run_hooks () # # args_changed=false # -# # Note that for efficiency, we parse as many options as we can +# # Note that, for efficiency, we parse as many options as we can # # recognise in a loop before passing the remainder back to the # # caller on the first unrecognised argument we encounter. # while test $# -gt 0; do @@ -1610,18 +1770,17 @@ func_run_hooks () # args_changed=: # ;; # *) # Make sure the first unrecognised option "$_G_opt" -# # is added back to "$@", we could need that later -# # if $args_changed is true. +# # is added back to "$@" in case we need it later, +# # if $args_changed was set to 'true'. # set dummy "$_G_opt" ${1+"$@"}; shift; break ;; # esac # done # +# # Only call 'func_quote' here if we processed at least one argument. # if $args_changed; then -# func_quote_for_eval ${1+"$@"} -# my_silent_option_result=$func_quote_for_eval_result +# func_quote eval ${1+"$@"} +# my_silent_option_result=$func_quote_result # fi -# -# $args_changed # } # func_add_hook func_parse_options my_silent_option # @@ -1632,8 +1791,6 @@ func_run_hooks () # # $opt_silent && $opt_verbose && func_fatal_help "\ # '--silent' and '--verbose' options are mutually exclusive." -# -# false # } # func_add_hook func_validate_options my_option_validation # @@ -1649,13 +1806,8 @@ func_options_finish () { $debug_cmd - _G_func_options_finish_exit=false - if func_run_hooks func_options ${1+"$@"}; then - func_options_finish_result=$func_run_hooks_result - _G_func_options_finish_exit=: - fi - - $_G_func_options_finish_exit + func_run_hooks func_options ${1+"$@"} + func_propagate_result func_run_hooks func_options_finish } @@ -1668,28 +1820,27 @@ func_options () { $debug_cmd - _G_rc_options=false + _G_options_quoted=false for my_func in options_prep parse_options validate_options options_finish do - if eval func_$my_func '${1+"$@"}'; then - eval _G_res_var='$'"func_${my_func}_result" - eval set dummy "$_G_res_var" ; shift - _G_rc_options=: + func_unset func_${my_func}_result + func_unset func_run_hooks_result + eval func_$my_func '${1+"$@"}' + func_propagate_result func_$my_func func_options + if $func_propagate_result_result; then + eval set dummy "$func_options_result"; shift + _G_options_quoted=: fi done - # Save modified positional parameters for caller. As a top-level - # options-parser function we always need to set the 'func_options_result' - # variable (regardless the $_G_rc_options value). - if $_G_rc_options; then - func_options_result=$_G_res_var - else - func_quote_for_eval ${1+"$@"} - func_options_result=$func_quote_for_eval_result - fi - - $_G_rc_options + $_G_options_quoted || { + # As we (func_options) are top-level options-parser function and + # nobody quoted "$@" for us yet, we need to do it explicitly for + # caller. + func_quote eval ${1+"$@"} + func_options_result=$func_quote_result + } } @@ -1699,8 +1850,7 @@ func_options () # Note that when calling hook functions, we pass through the list of # positional parameters. If a hook function modifies that list, and # needs to propagate that back to rest of this script, then the complete -# modified list must be put in 'func_run_hooks_result' before -# returning $EXIT_SUCCESS (otherwise $EXIT_FAILURE is returned). +# modified list must be put in 'func_run_hooks_result' before returning. func_hookable func_options_prep func_options_prep () { @@ -1710,14 +1860,8 @@ func_options_prep () opt_verbose=false opt_warning_types= - _G_rc_options_prep=false - if func_run_hooks func_options_prep ${1+"$@"}; then - _G_rc_options_prep=: - # save modified positional parameters for caller - func_options_prep_result=$func_run_hooks_result - fi - - $_G_rc_options_prep + func_run_hooks func_options_prep ${1+"$@"} + func_propagate_result func_run_hooks func_options_prep } @@ -1729,27 +1873,32 @@ func_parse_options () { $debug_cmd - func_parse_options_result= - - _G_rc_parse_options=false + _G_parse_options_requote=false # this just eases exit handling while test $# -gt 0; do # Defer to hook functions for initial option parsing, so they # get priority in the event of reusing an option name. - if func_run_hooks func_parse_options ${1+"$@"}; then - eval set dummy "$func_run_hooks_result"; shift - _G_rc_parse_options=: + func_run_hooks func_parse_options ${1+"$@"} + func_propagate_result func_run_hooks func_parse_options + if $func_propagate_result_result; then + eval set dummy "$func_parse_options_result"; shift + # Even though we may have changed "$@", we passed the "$@" array + # down into the hook and it quoted it for us (because we are in + # this if-branch). No need to quote it again. + _G_parse_options_requote=false fi # Break out of the loop if we already parsed every option. test $# -gt 0 || break + # We expect that one of the options parsed in this function matches + # and thus we remove _G_opt from "$@" and need to re-quote. _G_match_parse_options=: _G_opt=$1 shift case $_G_opt in --debug|-x) debug_cmd='set -x' - func_echo "enabling shell trace mode" + func_echo "enabling shell trace mode" >&2 $debug_cmd ;; @@ -1760,7 +1909,7 @@ func_parse_options () --warnings|--warning|-W) if test $# = 0 && func_missing_arg $_G_opt; then - _G_rc_parse_options=: + _G_parse_options_requote=: break fi case " $warning_categories $1" in @@ -1815,7 +1964,7 @@ func_parse_options () shift ;; - --) _G_rc_parse_options=: ; break ;; + --) _G_parse_options_requote=: ; break ;; -*) func_fatal_help "unrecognised option: '$_G_opt'" ;; *) set dummy "$_G_opt" ${1+"$@"}; shift _G_match_parse_options=false @@ -1823,17 +1972,16 @@ func_parse_options () ;; esac - $_G_match_parse_options && _G_rc_parse_options=: + if $_G_match_parse_options; then + _G_parse_options_requote=: + fi done - - if $_G_rc_parse_options; then + if $_G_parse_options_requote; then # save modified positional parameters for caller - func_quote_for_eval ${1+"$@"} - func_parse_options_result=$func_quote_for_eval_result + func_quote eval ${1+"$@"} + func_parse_options_result=$func_quote_result fi - - $_G_rc_parse_options } @@ -1846,21 +1994,14 @@ func_validate_options () { $debug_cmd - _G_rc_validate_options=false - # Display all warnings if -W was not given. test -n "$opt_warning_types" || opt_warning_types=" $warning_categories" - if func_run_hooks func_validate_options ${1+"$@"}; then - # save modified positional parameters for caller - func_validate_options_result=$func_run_hooks_result - _G_rc_validate_options=: - fi + func_run_hooks func_validate_options ${1+"$@"} + func_propagate_result func_run_hooks func_validate_options # Bail if the options were screwed! $exit_cmd $EXIT_FAILURE - - $_G_rc_validate_options } @@ -1916,8 +2057,8 @@ func_missing_arg () # func_split_equals STRING # ------------------------ -# Set func_split_equals_lhs and func_split_equals_rhs shell variables after -# splitting STRING at the '=' sign. +# Set func_split_equals_lhs and func_split_equals_rhs shell variables +# after splitting STRING at the '=' sign. test -z "$_G_HAVE_XSI_OPS" \ && (eval 'x=a/b/c; test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ @@ -1932,8 +2073,9 @@ then func_split_equals_lhs=${1%%=*} func_split_equals_rhs=${1#*=} - test "x$func_split_equals_lhs" = "x$1" \ - && func_split_equals_rhs= + if test "x$func_split_equals_lhs" = "x$1"; then + func_split_equals_rhs= + fi }' else # ...otherwise fall back to using expr, which is often a shell builtin. @@ -1943,7 +2085,7 @@ else func_split_equals_lhs=`expr "x$1" : 'x\([^=]*\)'` func_split_equals_rhs= - test "x$func_split_equals_lhs" = "x$1" \ + test "x$func_split_equals_lhs=" = "x$1" \ || func_split_equals_rhs=`expr "x$1" : 'x[^=]*=\(.*\)$'` } fi #func_split_equals @@ -1969,7 +2111,7 @@ else { $debug_cmd - func_split_short_opt_name=`expr "x$1" : 'x-\(.\)'` + func_split_short_opt_name=`expr "x$1" : 'x\(-.\)'` func_split_short_opt_arg=`expr "x$1" : 'x-.\(.*\)$'` } fi #func_split_short_opt @@ -2011,31 +2153,44 @@ func_usage_message () # func_version # ------------ # Echo version message to standard output and exit. +# The version message is extracted from the calling file's header +# comments, with leading '# ' stripped: +# 1. First display the progname and version +# 2. Followed by the header comment line matching /^# Written by / +# 3. Then a blank line followed by the first following line matching +# /^# Copyright / +# 4. Immediately followed by any lines between the previous matches, +# except lines preceding the intervening completely blank line. +# For example, see the header comments of this file. func_version () { $debug_cmd printf '%s\n' "$progname $scriptversion" $SED -n ' - /(C)/!b go - :more - /\./!{ - N - s|\n# | | - b more - } - :go - /^# Written by /,/# warranty; / { - s|^# || - s|^# *$|| - s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2| - p + /^# Written by /!b + s|^# ||; p; n + + :fwd2blnk + /./ { + n + b fwd2blnk } - /^# Written by / { - s|^# || - p + p; n + + :holdwrnt + s|^# || + s|^# *$|| + /^Copyright /!{ + /./H + n + b holdwrnt } - /^warranty; /q' < "$progpath" + + s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2| + G + s|\(\n\)\n*|\1|g + p; q' < "$progpath" exit $? } @@ -2045,12 +2200,12 @@ func_version () # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) -# time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC" +# time-stamp-pattern: "30/scriptversion=%:y-%02m-%02d.%02H; # UTC" # time-stamp-time-zone: "UTC" # End: # Set a version string. -scriptversion='(GNU libtool) 2.4.6' +scriptversion='(GNU libtool) 2.4.7' # func_echo ARG... @@ -2141,7 +2296,7 @@ include the following information: compiler: $LTCC compiler flags: $LTCFLAGS linker: $LD (gnu? $with_gnu_ld) - version: $progname $scriptversion Debian-2.4.6-15build2 + version: $progname $scriptversion Debian-2.4.7-7build1 automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q` autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q` @@ -2197,7 +2352,7 @@ fi # a configuration failure hint, and exit. func_fatal_configuration () { - func__fatal_error ${1+"$@"} \ + func_fatal_error ${1+"$@"} \ "See the $PACKAGE documentation for more information." \ "Fatal configuration error." } @@ -2345,6 +2500,8 @@ libtool_options_prep () _G_rc_lt_options_prep=: + _G_rc_lt_options_prep=: + # Shorthand for --mode=foo, only valid as the first argument case $1 in clean|clea|cle|cl) @@ -2375,11 +2532,9 @@ libtool_options_prep () if $_G_rc_lt_options_prep; then # Pass back the list of options. - func_quote_for_eval ${1+"$@"} - libtool_options_prep_result=$func_quote_for_eval_result + func_quote eval ${1+"$@"} + libtool_options_prep_result=$func_quote_result fi - - $_G_rc_lt_options_prep } func_add_hook func_options_prep libtool_options_prep @@ -2482,11 +2637,9 @@ libtool_parse_options () if $_G_rc_lt_parse_options; then # save modified positional parameters for caller - func_quote_for_eval ${1+"$@"} - libtool_parse_options_result=$func_quote_for_eval_result + func_quote eval ${1+"$@"} + libtool_parse_options_result=$func_quote_result fi - - $_G_rc_lt_parse_options } func_add_hook func_parse_options libtool_parse_options @@ -2543,8 +2696,8 @@ libtool_validate_options () } # Pass back the unparsed argument list - func_quote_for_eval ${1+"$@"} - libtool_validate_options_result=$func_quote_for_eval_result + func_quote eval ${1+"$@"} + libtool_validate_options_result=$func_quote_result } func_add_hook func_validate_options libtool_validate_options @@ -3510,8 +3663,8 @@ func_mode_compile () esac done - func_quote_for_eval "$libobj" - test "X$libobj" != "X$func_quote_for_eval_result" \ + func_quote_arg pretty "$libobj" + test "X$libobj" != "X$func_quote_arg_result" \ && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ && func_warning "libobj name '$libobj' may not contain shell special characters." func_dirname_and_basename "$obj" "/" "" @@ -3584,8 +3737,8 @@ compiler." func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 srcfile=$func_to_tool_file_result - func_quote_for_eval "$srcfile" - qsrcfile=$func_quote_for_eval_result + func_quote_arg pretty "$srcfile" + qsrcfile=$func_quote_arg_result # Only build a PIC object if we are building libtool libraries. if test yes = "$build_libtool_libs"; then @@ -3740,7 +3893,8 @@ This mode accepts the following additional options: -prefer-non-pic try to build non-PIC objects only -shared do not build a '.o' file suitable for static linking -static only build a '.o' file suitable for static linking - -Wc,FLAG pass FLAG directly to the compiler + -Wc,FLAG + -Xcompiler FLAG pass FLAG directly to the compiler COMPILE-COMMAND is a command to be used in creating a 'standard' object file from the given SOURCEFILE. @@ -3846,6 +4000,8 @@ The following components of LINK-COMMAND are treated specially: -weak LIBNAME declare that the target provides the LIBNAME interface -Wc,FLAG -Xcompiler FLAG pass linker-specific FLAG directly to the compiler + -Wa,FLAG + -Xassembler FLAG pass linker-specific FLAG directly to the assembler -Wl,FLAG -Xlinker FLAG pass linker-specific FLAG directly to the linker -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) @@ -4188,8 +4344,8 @@ func_mode_install () case $nonopt in *shtool*) :;; *) false;; esac then # Aesthetically quote it. - func_quote_for_eval "$nonopt" - install_prog="$func_quote_for_eval_result " + func_quote_arg pretty "$nonopt" + install_prog="$func_quote_arg_result " arg=$1 shift else @@ -4199,8 +4355,8 @@ func_mode_install () # The real first argument should be the name of the installation program. # Aesthetically quote it. - func_quote_for_eval "$arg" - func_append install_prog "$func_quote_for_eval_result" + func_quote_arg pretty "$arg" + func_append install_prog "$func_quote_arg_result" install_shared_prog=$install_prog case " $install_prog " in *[\\\ /]cp\ *) install_cp=: ;; @@ -4257,12 +4413,12 @@ func_mode_install () esac # Aesthetically quote the argument. - func_quote_for_eval "$arg" - func_append install_prog " $func_quote_for_eval_result" + func_quote_arg pretty "$arg" + func_append install_prog " $func_quote_arg_result" if test -n "$arg2"; then - func_quote_for_eval "$arg2" + func_quote_arg pretty "$arg2" fi - func_append install_shared_prog " $func_quote_for_eval_result" + func_append install_shared_prog " $func_quote_arg_result" done test -z "$install_prog" && \ @@ -4273,8 +4429,8 @@ func_mode_install () if test -n "$install_override_mode" && $no_mode; then if $install_cp; then :; else - func_quote_for_eval "$install_override_mode" - func_append install_shared_prog " -m $func_quote_for_eval_result" + func_quote_arg pretty "$install_override_mode" + func_append install_shared_prog " -m $func_quote_arg_result" fi fi @@ -4570,8 +4726,8 @@ func_mode_install () relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` $opt_quiet || { - func_quote_for_expand "$relink_command" - eval "func_echo $func_quote_for_expand_result" + func_quote_arg expand,pretty "$relink_command" + eval "func_echo $func_quote_arg_result" } if eval "$relink_command"; then : else @@ -5350,7 +5506,8 @@ else if test \"\$libtool_execute_magic\" != \"$magic\"; then file=\"\$0\"" - qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` + func_quote_arg pretty "$ECHO" + qECHO=$func_quote_arg_result $ECHO "\ # A function that is used when there is no print builtin or printf. @@ -5360,7 +5517,7 @@ func_fallback_echo () \$1 _LTECHO_EOF' } - ECHO=\"$qECHO\" + ECHO=$qECHO fi # Very basic option parsing. These options are (a) specific to @@ -6703,9 +6860,9 @@ func_mode_link () while test "$#" -gt 0; do arg=$1 shift - func_quote_for_eval "$arg" - qarg=$func_quote_for_eval_unquoted_result - func_append libtool_args " $func_quote_for_eval_result" + func_quote_arg pretty,unquoted "$arg" + qarg=$func_quote_arg_unquoted_result + func_append libtool_args " $func_quote_arg_result" # If the previous option needs an argument, assign it. if test -n "$prev"; then @@ -6941,6 +7098,13 @@ func_mode_link () prev= continue ;; + xassembler) + func_append compiler_flags " -Xassembler $qarg" + prev= + func_append compile_command " -Xassembler $qarg" + func_append finalize_command " -Xassembler $qarg" + continue + ;; xcclinker) func_append linker_flags " $qarg" func_append compiler_flags " $qarg" @@ -7111,7 +7275,7 @@ func_mode_link () # These systems don't actually have a C library (as such) test X-lc = "X$arg" && continue ;; - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*) + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig* | *-*-midnightbsd*) # Do not include libc due to us having libc/libc_r. test X-lc = "X$arg" && continue ;; @@ -7131,7 +7295,7 @@ func_mode_link () esac elif test X-lc_r = "X$arg"; then case $host in - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*) + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig* | *-*-midnightbsd*) # Do not include libc_r directly, use -pthread flag. continue ;; @@ -7161,8 +7325,20 @@ func_mode_link () prev=xcompiler continue ;; - - -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ + # Solaris ld rejects as of 11.4. Refer to Oracle bug 22985199. + -pthread) + case $host in + *solaris2*) ;; + *) + case "$new_inherited_linker_flags " in + *" $arg "*) ;; + * ) func_append new_inherited_linker_flags " $arg" ;; + esac + ;; + esac + continue + ;; + -mt|-mthreads|-kthread|-Kthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) func_append compiler_flags " $arg" func_append compile_command " $arg" @@ -7303,9 +7479,9 @@ func_mode_link () save_ifs=$IFS; IFS=, for flag in $args; do IFS=$save_ifs - func_quote_for_eval "$flag" - func_append arg " $func_quote_for_eval_result" - func_append compiler_flags " $func_quote_for_eval_result" + func_quote_arg pretty "$flag" + func_append arg " $func_quote_arg_result" + func_append compiler_flags " $func_quote_arg_result" done IFS=$save_ifs func_stripname ' ' '' "$arg" @@ -7319,16 +7495,21 @@ func_mode_link () save_ifs=$IFS; IFS=, for flag in $args; do IFS=$save_ifs - func_quote_for_eval "$flag" - func_append arg " $wl$func_quote_for_eval_result" - func_append compiler_flags " $wl$func_quote_for_eval_result" - func_append linker_flags " $func_quote_for_eval_result" + func_quote_arg pretty "$flag" + func_append arg " $wl$func_quote_arg_result" + func_append compiler_flags " $wl$func_quote_arg_result" + func_append linker_flags " $func_quote_arg_result" done IFS=$save_ifs func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; + -Xassembler) + prev=xassembler + continue + ;; + -Xcompiler) prev=xcompiler continue @@ -7346,8 +7527,8 @@ func_mode_link () # -msg_* for osf cc -msg_*) - func_quote_for_eval "$arg" - arg=$func_quote_for_eval_result + func_quote_arg pretty "$arg" + arg=$func_quote_arg_result ;; # Flags to be passed through unchanged, with rationale: @@ -7370,12 +7551,13 @@ func_mode_link () # -fuse-ld=* Linker select flags for GCC # -static-* direct GCC to link specific libraries statically # -fcilkplus Cilk Plus language extension features for C/C++ + # -Wa,* Pass flags directly to the assembler -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \ - -specs=*|-fsanitize=*|-fuse-ld=*|-static-*|-fcilkplus) - func_quote_for_eval "$arg" - arg=$func_quote_for_eval_result + -specs=*|-fsanitize=*|-fuse-ld=*|-static-*|-fcilkplus|-Wa,*) + func_quote_arg pretty "$arg" + arg=$func_quote_arg_result func_append compile_command " $arg" func_append finalize_command " $arg" func_append compiler_flags " $arg" @@ -7396,15 +7578,15 @@ func_mode_link () continue else # Otherwise treat like 'Some other compiler flag' below - func_quote_for_eval "$arg" - arg=$func_quote_for_eval_result + func_quote_arg pretty "$arg" + arg=$func_quote_arg_result fi ;; # Some other compiler flag. -* | +*) - func_quote_for_eval "$arg" - arg=$func_quote_for_eval_result + func_quote_arg pretty "$arg" + arg=$func_quote_arg_result ;; *.$objext) @@ -7524,8 +7706,8 @@ func_mode_link () *) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. - func_quote_for_eval "$arg" - arg=$func_quote_for_eval_result + func_quote_arg pretty "$arg" + arg=$func_quote_arg_result ;; esac # arg @@ -8733,7 +8915,7 @@ func_mode_link () test CXX = "$tagname" && { case $host_os in linux*) - case `$CC -V 2>&1 | sed 5q` in + case `$CC -V 2>&1 | $SED 5q` in *Sun\ C*) # Sun C++ 5.9 func_suncc_cstd_abi @@ -8906,7 +9088,7 @@ func_mode_link () # case $version_type in # correct linux to gnu/linux during the next big refactor - darwin|freebsd-elf|linux|osf|windows|none) + darwin|freebsd-elf|linux|midnightbsd-elf|osf|windows|none) func_arith $number_major + $number_minor current=$func_arith_result age=$number_minor @@ -9000,7 +9182,7 @@ func_mode_link () versuffix=.$current.$revision ;; - freebsd-elf) + freebsd-elf | midnightbsd-elf) func_arith $current - $age major=.$func_arith_result versuffix=$major.$age.$revision @@ -9226,7 +9408,7 @@ func_mode_link () *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-midnightbsd*) # Do not include libc due to us having libc/libc_r. ;; *-*-sco3.2v5* | *-*-sco5v6*) @@ -10037,8 +10219,8 @@ EOF for cmd in $concat_cmds; do IFS=$save_ifs $opt_quiet || { - func_quote_for_expand "$cmd" - eval "func_echo $func_quote_for_expand_result" + func_quote_arg expand,pretty "$cmd" + eval "func_echo $func_quote_arg_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? @@ -10131,8 +10313,8 @@ EOF eval cmd=\"$cmd\" IFS=$save_ifs $opt_quiet || { - func_quote_for_expand "$cmd" - eval "func_echo $func_quote_for_expand_result" + func_quote_arg expand,pretty "$cmd" + eval "func_echo $func_quote_arg_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? @@ -10606,12 +10788,13 @@ EOF elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else - func_quote_for_eval "$var_value" - relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" + func_quote_arg pretty "$var_value" + relink_command="$var=$func_quote_arg_result; export $var; $relink_command" fi done - relink_command="(cd `pwd`; $relink_command)" - relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` + func_quote eval cd "`pwd`" + func_quote_arg pretty,unquoted "($func_quote_result; $relink_command)" + relink_command=$func_quote_arg_unquoted_result fi # Only actually do things if not in dry run mode. @@ -10851,13 +11034,15 @@ EOF elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else - func_quote_for_eval "$var_value" - relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" + func_quote_arg pretty,unquoted "$var_value" + relink_command="$var=$func_quote_arg_unquoted_result; export $var; $relink_command" fi done # Quote the link command for shipping. - relink_command="(cd `pwd`; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" - relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` + func_quote eval cd "`pwd`" + relink_command="($func_quote_result; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" + func_quote_arg pretty,unquoted "$relink_command" + relink_command=$func_quote_arg_unquoted_result if test yes = "$hardcode_automatic"; then relink_command= fi diff --git a/lib/c-ares-1.34.4/config/missing b/lib/c-ares-1.34.6/config/missing similarity index 100% rename from lib/c-ares-1.34.4/config/missing rename to lib/c-ares-1.34.6/config/missing diff --git a/lib/c-ares-1.34.4/config/test-driver b/lib/c-ares-1.34.6/config/test-driver similarity index 100% rename from lib/c-ares-1.34.4/config/test-driver rename to lib/c-ares-1.34.6/config/test-driver diff --git a/lib/c-ares-1.34.4/configure b/lib/c-ares-1.34.6/configure similarity index 94% rename from lib/c-ares-1.34.4/configure rename to lib/c-ares-1.34.6/configure index d02f117d2f0..f91e2c95686 100755 --- a/lib/c-ares-1.34.4/configure +++ b/lib/c-ares-1.34.6/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.71 for c-ares 1.34.4. +# Generated by GNU Autoconf 2.71 for c-ares 1.34.6. # # Report bugs to . # @@ -621,8 +621,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='c-ares' PACKAGE_TARNAME='c-ares' -PACKAGE_VERSION='1.34.4' -PACKAGE_STRING='c-ares 1.34.4' +PACKAGE_VERSION='1.34.6' +PACKAGE_STRING='c-ares 1.34.6' PACKAGE_BUGREPORT='c-ares mailing list: http://lists.haxx.se/listinfo/c-ares' PACKAGE_URL='' @@ -669,6 +669,8 @@ AM_CPPFLAGS AM_CFLAGS BUILD_TESTS_FALSE BUILD_TESTS_TRUE +GMOCK117_LIBS +GMOCK117_CFLAGS GMOCK112_LIBS GMOCK112_CFLAGS GMOCK_LIBS @@ -715,6 +717,7 @@ MANIFEST_TOOL RANLIB ac_ct_AR AR +FILECMD LN_S NM ac_ct_DUMPBIN @@ -778,6 +781,7 @@ am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM +HAVE_CXX17 HAVE_CXX14 ac_ct_CXX CXXFLAGS @@ -875,7 +879,9 @@ PKG_CONFIG_LIBDIR GMOCK_CFLAGS GMOCK_LIBS GMOCK112_CFLAGS -GMOCK112_LIBS' +GMOCK112_LIBS +GMOCK117_CFLAGS +GMOCK117_LIBS' # Initialize some variables set by options. @@ -1424,7 +1430,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures c-ares 1.34.4 to adapt to many kinds of systems. +\`configure' configures c-ares 1.34.6 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1495,7 +1501,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of c-ares 1.34.4:";; + short | recursive ) echo "Configuration of c-ares 1.34.6:";; esac cat <<\_ACEOF @@ -1569,6 +1575,10 @@ Some influential environment variables: C compiler flags for GMOCK112, overriding pkg-config GMOCK112_LIBS linker flags for GMOCK112, overriding pkg-config + GMOCK117_CFLAGS + C compiler flags for GMOCK117, overriding pkg-config + GMOCK117_LIBS + linker flags for GMOCK117, overriding pkg-config Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. @@ -1637,7 +1647,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -c-ares configure 1.34.4 +c-ares configure 1.34.6 generated by GNU Autoconf 2.71 Copyright (C) 2021 Free Software Foundation, Inc. @@ -2261,7 +2271,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by c-ares $as_me 1.34.4, which was +It was created by c-ares $as_me 1.34.6, which was generated by GNU Autoconf 2.71. Invocation command line was $ $0$ac_configure_args_raw @@ -3235,7 +3245,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu -CARES_VERSION_INFO="21:3:19" +CARES_VERSION_INFO="21:5:19" @@ -4755,11 +4765,11 @@ if test x$ac_prog_cxx_stdcxx = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CXX option to enable C++11 features" >&5 printf %s "checking for $CXX option to enable C++11 features... " >&6; } -if test ${ac_cv_prog_cxx_11+y} +if test ${ac_cv_prog_cxx_cxx11+y} then : printf %s "(cached) " >&6 else $as_nop - ac_cv_prog_cxx_11=no + ac_cv_prog_cxx_cxx11=no ac_save_CXX=$CXX cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -4801,11 +4811,11 @@ if test x$ac_prog_cxx_stdcxx = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CXX option to enable C++98 features" >&5 printf %s "checking for $CXX option to enable C++98 features... " >&6; } -if test ${ac_cv_prog_cxx_98+y} +if test ${ac_cv_prog_cxx_cxx98+y} then : printf %s "(cached) " >&6 else $as_nop - ac_cv_prog_cxx_98=no + ac_cv_prog_cxx_cxx98=no ac_save_CXX=$CXX cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -5354,217 +5364,1098 @@ printf "%s\n" "#define HAVE_CXX14 1" >>confdefs.h fi -am__api_version='1.16' + ax_cxx_compile_alternatives="17 1z" ax_cxx_compile_cxx17_required=false + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + ac_success=no - # Find a good install program. We prefer a C program (faster), -# so one script is as good as another. But avoid the broken or -# incompatible versions: -# SysV /etc/install, /usr/sbin/install -# SunOS /usr/etc/install -# IRIX /sbin/install -# AIX /bin/install -# AmigaOS /C/install, which installs bootblocks on floppy discs -# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag -# AFS /usr/afsws/bin/install, which mishandles nonexistent args -# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" -# OS/2's system install, which has a completely different semantic -# ./install, which can be erroneously created by make from ./install.sh. -# Reject install programs that cannot install multiple files. -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 -printf %s "checking for a BSD-compatible install... " >&6; } -if test -z "$INSTALL"; then -if test ${ac_cv_path_install+y} + + + + if test x$ac_success = xno; then + for alternative in ${ax_cxx_compile_alternatives}; do + for switch in -std=c++${alternative} +std=c++${alternative} "-h std=c++${alternative}" MSVC; do + if test x"$switch" = xMSVC; then + switch=-std:c++${alternative} + cachevar=`printf "%s\n" "ax_cv_cxx_compile_cxx17_${switch}_MSVC" | $as_tr_sh` + else + cachevar=`printf "%s\n" "ax_cv_cxx_compile_cxx17_$switch" | $as_tr_sh` + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++17 features with $switch" >&5 +printf %s "checking whether $CXX supports C++17 features with $switch... " >&6; } +if eval test \${$cachevar+y} then : printf %s "(cached) " >&6 else $as_nop - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - # Account for fact that we put trailing slashes in our PATH walk. -case $as_dir in #(( - ./ | /[cC]/* | \ - /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ - ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ - /usr/ucb/* ) ;; - *) - # OSF1 and SCO ODT 3.0 have their own names for install. - # Don't use installbsd from OSF since it installs stuff as root - # by default. - for ac_prog in ginstall scoinst install; do - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_prog$ac_exec_ext"; then - if test $ac_prog = install && - grep dspmsg "$as_dir$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # AIX install. It has an incompatible calling convention. - : - elif test $ac_prog = install && - grep pwplus "$as_dir$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # program-specific install script used by HP pwplus--don't use. - : - else - rm -rf conftest.one conftest.two conftest.dir - echo one > conftest.one - echo two > conftest.two - mkdir conftest.dir - if "$as_dir$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir/" && - test -s conftest.one && test -s conftest.two && - test -s conftest.dir/conftest.one && - test -s conftest.dir/conftest.two - then - ac_cv_path_install="$as_dir$ac_prog$ac_exec_ext -c" - break 3 - fi - fi - fi - done - done - ;; -esac + ac_save_CXX="$CXX" + CXX="$CXX $switch" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ - done -IFS=$as_save_IFS -rm -rf conftest.one conftest.two conftest.dir +// If the compiler admits that it is not ready for C++11, why torture it? +// Hopefully, this will speed up the test. -fi - if test ${ac_cv_path_install+y}; then - INSTALL=$ac_cv_path_install - else - # As a last resort, use the slow shell script. Don't cache a - # value for INSTALL within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the value is a relative name. - INSTALL=$ac_install_sh - fi -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 -printf "%s\n" "$INSTALL" >&6; } +#ifndef __cplusplus -# Use test -z because SunOS4 sh mishandles braces in ${var-val}. -# It thinks the first close brace ends the variable substitution. -test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' +#error "This is not a C++ compiler" -test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' +// MSVC always sets __cplusplus to 199711L in older versions; newer versions +// only set it correctly if /Zc:__cplusplus is specified as well as a +// /std:c++NN switch: +// +// https://devblogs.microsoft.com/cppblog/msvc-now-correctly-reports-__cplusplus/ +// +// The value __cplusplus ought to have is available in _MSVC_LANG since +// Visual Studio 2015 Update 3: +// +// https://learn.microsoft.com/en-us/cpp/preprocessor/predefined-macros +// +// This was also the first MSVC version to support C++14 so we can't use the +// value of either __cplusplus or _MSVC_LANG to quickly rule out MSVC having +// C++11 or C++14 support, but we can check _MSVC_LANG for C++17 and later. +#elif __cplusplus < 201103L && !defined _MSC_VER -test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' +#error "This is not a C++11 compiler" -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 -printf %s "checking whether build environment is sane... " >&6; } -# Reject unsafe characters in $srcdir or the absolute working directory -# name. Accept space and tab only in the latter. -am_lf=' -' -case `pwd` in - *[\\\"\#\$\&\'\`$am_lf]*) - as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; -esac -case $srcdir in - *[\\\"\#\$\&\'\`$am_lf\ \ ]*) - as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; -esac +#else -# Do 'set' in a subshell so we don't clobber the current shell's -# arguments. Must try -L first in case configure is actually a -# symlink; some systems play weird games with the mod time of symlinks -# (eg FreeBSD returns the mod time of the symlink's containing -# directory). -if ( - am_has_slept=no - for am_try in 1 2; do - echo "timestamp, slept: $am_has_slept" > conftest.file - set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` - if test "$*" = "X"; then - # -L didn't work. - set X `ls -t "$srcdir/configure" conftest.file` - fi - if test "$*" != "X $srcdir/configure conftest.file" \ - && test "$*" != "X conftest.file $srcdir/configure"; then +namespace cxx11 +{ - # If neither matched, then we have a broken ls. This can happen - # if, for instance, CONFIG_SHELL is bash and it inherits a - # broken ls alias from the environment. This has actually - # happened. Such a system could not be considered "sane". - as_fn_error $? "ls -t appears to fail. Make sure there is not a broken - alias in your environment" "$LINENO" 5 - fi - if test "$2" = conftest.file || test $am_try -eq 2; then - break - fi - # Just in case. - sleep 1 - am_has_slept=yes - done - test "$2" = conftest.file - ) -then - # Ok. - : -else - as_fn_error $? "newly created file is older than distributed files! -Check your system clock" "$LINENO" 5 -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } -# If we didn't sleep, we still need to ensure time stamps of config.status and -# generated files are strictly newer. -am_sleep_pid= -if grep 'slept: no' conftest.file >/dev/null 2>&1; then - ( sleep 1 ) & - am_sleep_pid=$! -fi + namespace test_static_assert + { -rm -f conftest.file + template + struct check + { + static_assert(sizeof(int) <= sizeof(T), "not big enough"); + }; -test "$program_prefix" != NONE && - program_transform_name="s&^&$program_prefix&;$program_transform_name" -# Use a double $ so make ignores it. -test "$program_suffix" != NONE && - program_transform_name="s&\$&$program_suffix&;$program_transform_name" -# Double any \ or $. -# By default was `s,x,x', remove it if useless. -ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' -program_transform_name=`printf "%s\n" "$program_transform_name" | sed "$ac_script"` + } + namespace test_final_override + { - if test x"${MISSING+set}" != xset; then - MISSING="\${SHELL} '$am_aux_dir/missing'" -fi -# Use eval to expand $SHELL -if eval "$MISSING --is-lightweight"; then - am_missing_run="$MISSING " -else - am_missing_run= - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 -printf "%s\n" "$as_me: WARNING: 'missing' script is too old or missing" >&2;} -fi + struct Base + { + virtual ~Base() {} + virtual void f() {} + }; -if test x"${install_sh+set}" != xset; then - case $am_aux_dir in - *\ * | *\ *) - install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; - *) - install_sh="\${SHELL} $am_aux_dir/install-sh" - esac -fi + struct Derived : public Base + { + virtual ~Derived() override {} + virtual void f() override {} + }; -# Installed binaries are usually stripped using 'strip' when the user -# run "make install-strip". However 'strip' might not be the right -# tool to use in cross-compilation environments, therefore Automake -# will honor the 'STRIP' environment variable to overrule this program. -if test "$cross_compiling" != no; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. -set dummy ${ac_tool_prefix}strip; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_STRIP+y} + } + + namespace test_double_right_angle_brackets + { + + template < typename T > + struct check {}; + + typedef check single_type; + typedef check> double_type; + typedef check>> triple_type; + typedef check>>> quadruple_type; + + } + + namespace test_decltype + { + + int + f() + { + int a = 1; + decltype(a) b = 2; + return a + b; + } + + } + + namespace test_type_deduction + { + + template < typename T1, typename T2 > + struct is_same + { + static const bool value = false; + }; + + template < typename T > + struct is_same + { + static const bool value = true; + }; + + template < typename T1, typename T2 > + auto + add(T1 a1, T2 a2) -> decltype(a1 + a2) + { + return a1 + a2; + } + + int + test(const int c, volatile int v) + { + static_assert(is_same::value == true, ""); + static_assert(is_same::value == false, ""); + static_assert(is_same::value == false, ""); + auto ac = c; + auto av = v; + auto sumi = ac + av + 'x'; + auto sumf = ac + av + 1.0; + static_assert(is_same::value == true, ""); + static_assert(is_same::value == true, ""); + static_assert(is_same::value == true, ""); + static_assert(is_same::value == false, ""); + static_assert(is_same::value == true, ""); + return (sumf > 0.0) ? sumi : add(c, v); + } + + } + + namespace test_noexcept + { + + int f() { return 0; } + int g() noexcept { return 0; } + + static_assert(noexcept(f()) == false, ""); + static_assert(noexcept(g()) == true, ""); + + } + + namespace test_constexpr + { + + template < typename CharT > + unsigned long constexpr + strlen_c_r(const CharT *const s, const unsigned long acc) noexcept + { + return *s ? strlen_c_r(s + 1, acc + 1) : acc; + } + + template < typename CharT > + unsigned long constexpr + strlen_c(const CharT *const s) noexcept + { + return strlen_c_r(s, 0UL); + } + + static_assert(strlen_c("") == 0UL, ""); + static_assert(strlen_c("1") == 1UL, ""); + static_assert(strlen_c("example") == 7UL, ""); + static_assert(strlen_c("another\0example") == 7UL, ""); + + } + + namespace test_rvalue_references + { + + template < int N > + struct answer + { + static constexpr int value = N; + }; + + answer<1> f(int&) { return answer<1>(); } + answer<2> f(const int&) { return answer<2>(); } + answer<3> f(int&&) { return answer<3>(); } + + void + test() + { + int i = 0; + const int c = 0; + static_assert(decltype(f(i))::value == 1, ""); + static_assert(decltype(f(c))::value == 2, ""); + static_assert(decltype(f(0))::value == 3, ""); + } + + } + + namespace test_uniform_initialization + { + + struct test + { + static const int zero {}; + static const int one {1}; + }; + + static_assert(test::zero == 0, ""); + static_assert(test::one == 1, ""); + + } + + namespace test_lambdas + { + + void + test1() + { + auto lambda1 = [](){}; + auto lambda2 = lambda1; + lambda1(); + lambda2(); + } + + int + test2() + { + auto a = [](int i, int j){ return i + j; }(1, 2); + auto b = []() -> int { return '0'; }(); + auto c = [=](){ return a + b; }(); + auto d = [&](){ return c; }(); + auto e = [a, &b](int x) mutable { + const auto identity = [](int y){ return y; }; + for (auto i = 0; i < a; ++i) + a += b--; + return x + identity(a + b); + }(0); + return a + b + c + d + e; + } + + int + test3() + { + const auto nullary = [](){ return 0; }; + const auto unary = [](int x){ return x; }; + using nullary_t = decltype(nullary); + using unary_t = decltype(unary); + const auto higher1st = [](nullary_t f){ return f(); }; + const auto higher2nd = [unary](nullary_t f1){ + return [unary, f1](unary_t f2){ return f2(unary(f1())); }; + }; + return higher1st(nullary) + higher2nd(nullary)(unary); + } + + } + + namespace test_variadic_templates + { + + template + struct sum; + + template + struct sum + { + static constexpr auto value = N0 + sum::value; + }; + + template <> + struct sum<> + { + static constexpr auto value = 0; + }; + + static_assert(sum<>::value == 0, ""); + static_assert(sum<1>::value == 1, ""); + static_assert(sum<23>::value == 23, ""); + static_assert(sum<1, 2>::value == 3, ""); + static_assert(sum<5, 5, 11>::value == 21, ""); + static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, ""); + + } + + // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae + // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function + // because of this. + namespace test_template_alias_sfinae + { + + struct foo {}; + + template + using member = typename T::member_type; + + template + void func(...) {} + + template + void func(member*) {} + + void test(); + + void test() { func(0); } + + } + +} // namespace cxx11 + +#endif // __cplusplus >= 201103L + + + + +// If the compiler admits that it is not ready for C++14, why torture it? +// Hopefully, this will speed up the test. + +#ifndef __cplusplus + +#error "This is not a C++ compiler" + +#elif __cplusplus < 201402L && !defined _MSC_VER + +#error "This is not a C++14 compiler" + +#else + +namespace cxx14 +{ + + namespace test_polymorphic_lambdas + { + + int + test() + { + const auto lambda = [](auto&&... args){ + const auto istiny = [](auto x){ + return (sizeof(x) == 1UL) ? 1 : 0; + }; + const int aretiny[] = { istiny(args)... }; + return aretiny[0]; + }; + return lambda(1, 1L, 1.0f, '1'); + } + + } + + namespace test_binary_literals + { + + constexpr auto ivii = 0b0000000000101010; + static_assert(ivii == 42, "wrong value"); + + } + + namespace test_generalized_constexpr + { + + template < typename CharT > + constexpr unsigned long + strlen_c(const CharT *const s) noexcept + { + auto length = 0UL; + for (auto p = s; *p; ++p) + ++length; + return length; + } + + static_assert(strlen_c("") == 0UL, ""); + static_assert(strlen_c("x") == 1UL, ""); + static_assert(strlen_c("test") == 4UL, ""); + static_assert(strlen_c("another\0test") == 7UL, ""); + + } + + namespace test_lambda_init_capture + { + + int + test() + { + auto x = 0; + const auto lambda1 = [a = x](int b){ return a + b; }; + const auto lambda2 = [a = lambda1(x)](){ return a; }; + return lambda2(); + } + + } + + namespace test_digit_separators + { + + constexpr auto ten_million = 100'000'000; + static_assert(ten_million == 100000000, ""); + + } + + namespace test_return_type_deduction + { + + auto f(int& x) { return x; } + decltype(auto) g(int& x) { return x; } + + template < typename T1, typename T2 > + struct is_same + { + static constexpr auto value = false; + }; + + template < typename T > + struct is_same + { + static constexpr auto value = true; + }; + + int + test() + { + auto x = 0; + static_assert(is_same::value, ""); + static_assert(is_same::value, ""); + return x; + } + + } + +} // namespace cxx14 + +#endif // __cplusplus >= 201402L + + + + +// If the compiler admits that it is not ready for C++17, why torture it? +// Hopefully, this will speed up the test. + +#ifndef __cplusplus + +#error "This is not a C++ compiler" + +#elif (defined _MSVC_LANG ? _MSVC_LANG : __cplusplus) < 201703L + +#error "This is not a C++17 compiler" + +#else + +#include +#include +#include + +namespace cxx17 +{ + + namespace test_constexpr_lambdas + { + + constexpr int foo = [](){return 42;}(); + + } + + namespace test::nested_namespace::definitions + { + + } + + namespace test_fold_expression + { + + template + int multiply(Args... args) + { + return (args * ... * 1); + } + + template + bool all(Args... args) + { + return (args && ...); + } + + } + + namespace test_extended_static_assert + { + + static_assert (true); + + } + + namespace test_auto_brace_init_list + { + + auto foo = {5}; + auto bar {5}; + + static_assert(std::is_same, decltype(foo)>::value); + static_assert(std::is_same::value); + } + + namespace test_typename_in_template_template_parameter + { + + template typename X> struct D; + + } + + namespace test_fallthrough_nodiscard_maybe_unused_attributes + { + + int f1() + { + return 42; + } + + [[nodiscard]] int f2() + { + [[maybe_unused]] auto unused = f1(); + + switch (f1()) + { + case 17: + f1(); + [[fallthrough]]; + case 42: + f1(); + } + return f1(); + } + + } + + namespace test_extended_aggregate_initialization + { + + struct base1 + { + int b1, b2 = 42; + }; + + struct base2 + { + base2() { + b3 = 42; + } + int b3; + }; + + struct derived : base1, base2 + { + int d; + }; + + derived d1 {{1, 2}, {}, 4}; // full initialization + derived d2 {{}, {}, 4}; // value-initialized bases + + } + + namespace test_general_range_based_for_loop + { + + struct iter + { + int i; + + int& operator* () + { + return i; + } + + const int& operator* () const + { + return i; + } + + iter& operator++() + { + ++i; + return *this; + } + }; + + struct sentinel + { + int i; + }; + + bool operator== (const iter& i, const sentinel& s) + { + return i.i == s.i; + } + + bool operator!= (const iter& i, const sentinel& s) + { + return !(i == s); + } + + struct range + { + iter begin() const + { + return {0}; + } + + sentinel end() const + { + return {5}; + } + }; + + void f() + { + range r {}; + + for (auto i : r) + { + [[maybe_unused]] auto v = i; + } + } + + } + + namespace test_lambda_capture_asterisk_this_by_value + { + + struct t + { + int i; + int foo() + { + return [*this]() + { + return i; + }(); + } + }; + + } + + namespace test_enum_class_construction + { + + enum class byte : unsigned char + {}; + + byte foo {42}; + + } + + namespace test_constexpr_if + { + + template + int f () + { + if constexpr(cond) + { + return 13; + } + else + { + return 42; + } + } + + } + + namespace test_selection_statement_with_initializer + { + + int f() + { + return 13; + } + + int f2() + { + if (auto i = f(); i > 0) + { + return 3; + } + + switch (auto i = f(); i + 4) + { + case 17: + return 2; + + default: + return 1; + } + } + + } + + namespace test_template_argument_deduction_for_class_templates + { + + template + struct pair + { + pair (T1 p1, T2 p2) + : m1 {p1}, + m2 {p2} + {} + + T1 m1; + T2 m2; + }; + + void f() + { + [[maybe_unused]] auto p = pair{13, 42u}; + } + + } + + namespace test_non_type_auto_template_parameters + { + + template + struct B + {}; + + B<5> b1; + B<'a'> b2; + + } + + namespace test_structured_bindings + { + + int arr[2] = { 1, 2 }; + std::pair pr = { 1, 2 }; + + auto f1() -> int(&)[2] + { + return arr; + } + + auto f2() -> std::pair& + { + return pr; + } + + struct S + { + int x1 : 2; + volatile double y1; + }; + + S f3() + { + return {}; + } + + auto [ x1, y1 ] = f1(); + auto& [ xr1, yr1 ] = f1(); + auto [ x2, y2 ] = f2(); + auto& [ xr2, yr2 ] = f2(); + const auto [ x3, y3 ] = f3(); + + } + + namespace test_exception_spec_type_system + { + + struct Good {}; + struct Bad {}; + + void g1() noexcept; + void g2(); + + template + Bad + f(T*, T*); + + template + Good + f(T1*, T2*); + + static_assert (std::is_same_v); + + } + + namespace test_inline_variables + { + + template void f(T) + {} + + template inline T g(T) + { + return T{}; + } + + template<> inline void f<>(int) + {} + + template<> int g<>(int) + { + return 5; + } + + } + +} // namespace cxx17 + +#endif // (defined _MSVC_LANG ? _MSVC_LANG : __cplusplus) < 201703L + + + +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + eval $cachevar=yes +else $as_nop + eval $cachevar=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + CXX="$ac_save_CXX" +fi +eval ac_res=\$$cachevar + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test x\$$cachevar = xyes; then + CXX="$CXX $switch" + if test -n "$CXXCPP" ; then + CXXCPP="$CXXCPP $switch" + fi + ac_success=yes + break + fi + done + if test x$ac_success = xyes; then + break + fi + done + fi + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + if test x$ax_cxx_compile_cxx17_required = xtrue; then + if test x$ac_success = xno; then + as_fn_error $? "*** A compiler with support for C++17 language features is required." "$LINENO" 5 + fi + fi + if test x$ac_success = xno; then + HAVE_CXX17=0 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: No compiler with C++17 support was found" >&5 +printf "%s\n" "$as_me: No compiler with C++17 support was found" >&6;} + else + HAVE_CXX17=1 + +printf "%s\n" "#define HAVE_CXX17 1" >>confdefs.h + + fi + + +am__api_version='1.16' + + + # Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +# Reject install programs that cannot install multiple files. +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 +printf %s "checking for a BSD-compatible install... " >&6; } +if test -z "$INSTALL"; then +if test ${ac_cv_path_install+y} +then : + printf %s "(cached) " >&6 +else $as_nop + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + # Account for fact that we put trailing slashes in our PATH walk. +case $as_dir in #(( + ./ | /[cC]/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_prog$ac_exec_ext"; then + if test $ac_prog = install && + grep dspmsg "$as_dir$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + rm -rf conftest.one conftest.two conftest.dir + echo one > conftest.one + echo two > conftest.two + mkdir conftest.dir + if "$as_dir$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir/" && + test -s conftest.one && test -s conftest.two && + test -s conftest.dir/conftest.one && + test -s conftest.dir/conftest.two + then + ac_cv_path_install="$as_dir$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + fi + done + done + ;; +esac + + done +IFS=$as_save_IFS + +rm -rf conftest.one conftest.two conftest.dir + +fi + if test ${ac_cv_path_install+y}; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. Don't cache a + # value for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + INSTALL=$ac_install_sh + fi +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 +printf "%s\n" "$INSTALL" >&6; } + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 +printf %s "checking whether build environment is sane... " >&6; } +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[\\\"\#\$\&\'\`$am_lf]*) + as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; +esac +case $srcdir in + *[\\\"\#\$\&\'\`$am_lf\ \ ]*) + as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; +esac + +# Do 'set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + am_has_slept=no + for am_try in 1 2; do + echo "timestamp, slept: $am_has_slept" > conftest.file + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + if test "$*" != "X $srcdir/configure conftest.file" \ + && test "$*" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + as_fn_error $? "ls -t appears to fail. Make sure there is not a broken + alias in your environment" "$LINENO" 5 + fi + if test "$2" = conftest.file || test $am_try -eq 2; then + break + fi + # Just in case. + sleep 1 + am_has_slept=yes + done + test "$2" = conftest.file + ) +then + # Ok. + : +else + as_fn_error $? "newly created file is older than distributed files! +Check your system clock" "$LINENO" 5 +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +# If we didn't sleep, we still need to ensure time stamps of config.status and +# generated files are strictly newer. +am_sleep_pid= +if grep 'slept: no' conftest.file >/dev/null 2>&1; then + ( sleep 1 ) & + am_sleep_pid=$! +fi + +rm -f conftest.file + +test "$program_prefix" != NONE && + program_transform_name="s&^&$program_prefix&;$program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s&\$&$program_suffix&;$program_transform_name" +# Double any \ or $. +# By default was `s,x,x', remove it if useless. +ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' +program_transform_name=`printf "%s\n" "$program_transform_name" | sed "$ac_script"` + + + if test x"${MISSING+set}" != xset; then + MISSING="\${SHELL} '$am_aux_dir/missing'" +fi +# Use eval to expand $SHELL +if eval "$MISSING --is-lightweight"; then + am_missing_run="$MISSING " +else + am_missing_run= + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 +printf "%s\n" "$as_me: WARNING: 'missing' script is too old or missing" >&2;} +fi + +if test x"${install_sh+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi + +# Installed binaries are usually stripped using 'strip' when the user +# run "make install-strip". However 'strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the 'STRIP' environment variable to overrule this program. +if test "$cross_compiling" != no; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_STRIP+y} then : printf %s "(cached) " >&6 else $as_nop @@ -5927,7 +6818,7 @@ fi # Define the identity of the package. PACKAGE='c-ares' - VERSION='1.34.4' + VERSION='1.34.6' printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h @@ -6296,8 +7187,8 @@ esac -macro_version='2.4.6' -macro_revision='2.4.6' +macro_version='2.4.7' +macro_revision='2.4.7' @@ -6925,13 +7816,13 @@ else mingw*) lt_bad_file=conftest.nm/nofile ;; *) lt_bad_file=/dev/null ;; esac - case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in + case `"$tmp_nm" -B $lt_bad_file 2>&1 | $SED '1q'` in *$lt_bad_file* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break 2 ;; *) - case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + case `"$tmp_nm" -p /dev/null 2>&1 | $SED '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break 2 @@ -7069,7 +7960,7 @@ esac fi fi - case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in + case `$DUMPBIN -symbols -headers /dev/null 2>&1 | $SED '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols -headers" ;; @@ -7173,7 +8064,7 @@ else $as_nop lt_cv_sys_max_cmd_len=8192; ;; - bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*) + bitrig* | darwin* | dragonfly* | freebsd* | midnightbsd* | netbsd* | openbsd*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` @@ -7216,7 +8107,7 @@ else $as_nop sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then - lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` + lt_cv_sys_max_cmd_len=`echo $kargmax | $SED 's/.*[ ]//'` else lt_cv_sys_max_cmd_len=32768 fi @@ -7421,6 +8312,114 @@ esac +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}file", so it can be a program name with args. +set dummy ${ac_tool_prefix}file; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_FILECMD+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$FILECMD"; then + ac_cv_prog_FILECMD="$FILECMD" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_FILECMD="${ac_tool_prefix}file" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +FILECMD=$ac_cv_prog_FILECMD +if test -n "$FILECMD"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $FILECMD" >&5 +printf "%s\n" "$FILECMD" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_FILECMD"; then + ac_ct_FILECMD=$FILECMD + # Extract the first word of "file", so it can be a program name with args. +set dummy file; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_FILECMD+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_FILECMD"; then + ac_cv_prog_ac_ct_FILECMD="$ac_ct_FILECMD" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_FILECMD="file" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_FILECMD=$ac_cv_prog_ac_ct_FILECMD +if test -n "$ac_ct_FILECMD"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_FILECMD" >&5 +printf "%s\n" "$ac_ct_FILECMD" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_FILECMD" = x; then + FILECMD=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + FILECMD=$ac_ct_FILECMD + fi +else + FILECMD="$ac_cv_prog_FILECMD" +fi + + + + + + + if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; ac_word=$2 @@ -7561,7 +8560,7 @@ beos*) bsdi[45]*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' - lt_cv_file_magic_cmd='/usr/bin/file -L' + lt_cv_file_magic_cmd='$FILECMD -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; @@ -7595,14 +8594,14 @@ darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; -freebsd* | dragonfly*) +freebsd* | dragonfly* | midnightbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' - lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_cmd=$FILECMD lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac @@ -7616,7 +8615,7 @@ haiku*) ;; hpux10.20* | hpux11*) - lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_cmd=$FILECMD case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' @@ -7663,7 +8662,7 @@ netbsd* | netbsdelf*-gnu) newos6*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' - lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_cmd=$FILECMD lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; @@ -8033,13 +9032,29 @@ esac fi : ${AR=ar} -: ${AR_FLAGS=cr} +# Use ARFLAGS variable as AR's operation code to sync the variable naming with +# Automake. If both AR_FLAGS and ARFLAGS are specified, AR_FLAGS should have +# higher priority because thats what people were doing historically (setting +# ARFLAGS for automake and AR_FLAGS for libtool). FIXME: Make the AR_FLAGS +# variable obsoleted/removed. + +test ${AR_FLAGS+y} || AR_FLAGS=${ARFLAGS-cr} +lt_ar_flags=$AR_FLAGS + + + + + + +# Make AR_FLAGS overridable by 'make ARFLAGS='. Don't try to run-time override +# by AR_FLAGS because that was never working and AR_FLAGS is about to die. + @@ -8456,7 +9471,7 @@ esac if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Gets list of data symbols to import. - lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'" + lt_cv_sys_global_symbol_to_import="$SED -n -e 's/^I .* \(.*\)$/\1/p'" # Adjust the below global symbol transforms to fixup imported variables. lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" @@ -8474,20 +9489,20 @@ fi # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. -lt_cv_sys_global_symbol_to_cdecl="sed -n"\ +lt_cv_sys_global_symbol_to_cdecl="$SED -n"\ $lt_cdecl_hook\ " -e 's/^T .* \(.*\)$/extern int \1();/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address -lt_cv_sys_global_symbol_to_c_name_address="sed -n"\ +lt_cv_sys_global_symbol_to_c_name_address="$SED -n"\ $lt_c_name_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" # Transform an extracted symbol line into symbol name with lib prefix and # symbol address. -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\ +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="$SED -n"\ $lt_c_name_lib_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ @@ -8511,7 +9526,7 @@ for ac_symprfx in "" "_"; do if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function, # D for any global variable and I for any imported variable. - # Also find C++ and __fastcall symbols from MSVC++, + # Also find C++ and __fastcall symbols from MSVC++ or ICC, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK '"\ " {last_section=section; section=\$ 3};"\ @@ -8529,9 +9544,9 @@ for ac_symprfx in "" "_"; do " s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx" else - lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + lt_cv_sys_global_symbol_pipe="$SED -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi - lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" + lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | $SED '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no @@ -8731,7 +9746,7 @@ case $with_sysroot in #( fi ;; #( /*) - lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` + lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"` ;; #( no|'') ;; #( @@ -8856,7 +9871,7 @@ ia64-*-hpux*) ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE=32 ;; @@ -8877,7 +9892,7 @@ ia64-*-hpux*) printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then if test yes = "$lt_cv_prog_gnu_ld"; then - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; @@ -8889,7 +9904,7 @@ ia64-*-hpux*) ;; esac else - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; @@ -8915,7 +9930,7 @@ mips64*-*linux*) printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then emul=elf - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *32-bit*) emul="${emul}32" ;; @@ -8923,7 +9938,7 @@ mips64*-*linux*) emul="${emul}64" ;; esac - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *MSB*) emul="${emul}btsmip" ;; @@ -8931,7 +9946,7 @@ mips64*-*linux*) emul="${emul}ltsmip" ;; esac - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *N32*) emul="${emul}n32" ;; @@ -8955,14 +9970,14 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - case `/usr/bin/file conftest.o` in + case `$FILECMD conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) - case `/usr/bin/file conftest.o` in + case `$FILECMD conftest.o` in *x86-64*) LD="${LD-ld} -m elf32_x86_64" ;; @@ -9070,7 +10085,7 @@ printf "%s\n" "$lt_cv_cc_needs_belf" >&6; } ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - case `/usr/bin/file conftest.o` in + case `$FILECMD conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) @@ -9853,8 +10868,8 @@ int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 - echo "$AR cr libconftest.a conftest.o" >&5 - $AR cr libconftest.a conftest.o 2>&5 + echo "$AR $AR_FLAGS libconftest.a conftest.o" >&5 + $AR $AR_FLAGS libconftest.a conftest.o 2>&5 echo "$RANLIB libconftest.a" >&5 $RANLIB libconftest.a 2>&5 cat > conftest.c << _LT_EOF @@ -9881,17 +10896,12 @@ printf "%s\n" "$lt_cv_ld_force_load" >&6; } _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; - darwin*) # darwin 5.x on - # if running on 10.5 or later, the deployment target defaults - # to the OS version, if on x86, and 10.4, the deployment - # target defaults to 10.4. Don't you love it? - case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in - 10.0,*86*-darwin8*|10.0,*-darwin[912]*) - _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; - 10.[012][,.]*) - _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; - 10.*|11.*) - _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; + darwin*) + case $MACOSX_DEPLOYMENT_TARGET,$host in + 10.[012],*|,*powerpc*-darwin[5-8]*) + _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; + *) + _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; esac ;; esac @@ -10588,8 +11598,8 @@ esac ofile=libtool can_build_shared=yes -# All known linkers require a '.a' archive for static linking (except MSVC, -# which needs '.lib'). +# All known linkers require a '.a' archive for static linking (except MSVC and +# ICC, which need '.lib'). libext=a with_gnu_ld=$lt_cv_prog_gnu_ld @@ -11107,7 +12117,7 @@ lt_prog_compiler_static= lt_prog_compiler_static='-qstaticlink' ;; *) - case `$CC -V 2>&1 | sed 5q` in + case `$CC -V 2>&1 | $SED 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic='-KPIC' @@ -11530,15 +12540,15 @@ printf %s "checking whether the $compiler linker ($LD) supports shared libraries case $host_os in cygwin* | mingw* | pw32* | cegcc*) - # FIXME: the MSVC++ port hasn't been tested in a loooong time + # FIXME: the MSVC++ and ICC port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. + # Microsoft Visual C++ or Intel C++ Compiler. if test yes != "$GCC"; then with_gnu_ld=no fi ;; interix*) - # we just hope/assume this is gcc and not c89 (= MSVC++) + # we just hope/assume this is gcc and not c89 (= MSVC++ or ICC) with_gnu_ld=yes ;; openbsd* | bitrig*) @@ -11593,7 +12603,7 @@ printf %s "checking whether the $compiler linker ($LD) supports shared libraries whole_archive_flag_spec= fi supports_anon_versioning=no - case `$LD -v | $SED -e 's/(^)\+)\s\+//' 2>&1` in + case `$LD -v | $SED -e 's/([^)]\+)\s\+//' 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... @@ -11705,6 +12715,7 @@ _LT_EOF emximp -o $lib $output_objdir/$libname.def' old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes=yes + file_list_spec='@' ;; interix[3-9]*) @@ -11719,7 +12730,7 @@ _LT_EOF # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - archive_expsym_cmds='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds='$SED "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) @@ -11762,7 +12773,7 @@ _LT_EOF compiler_needs_object=yes ;; esac - case `$CC -V 2>&1 | sed 5q` in + case `$CC -V 2>&1 | $SED 5q` in *Sun\ C*) # Sun C 5.9 whole_archive_flag_spec='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' compiler_needs_object=yes @@ -11774,13 +12785,14 @@ _LT_EOF if test yes = "$supports_anon_versioning"; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi case $cc_basename in tcc*) + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' export_dynamic_flag_spec='-rdynamic' ;; xlf* | bgf* | bgxlf* | mpixlf*) @@ -11790,7 +12802,7 @@ _LT_EOF archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test yes = "$supports_anon_versioning"; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi @@ -11922,7 +12934,7 @@ _LT_EOF if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else - export_symbols_cmds='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' + export_symbols_cmds='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no @@ -12193,12 +13205,12 @@ fi cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. + # Microsoft Visual C++ or Intel C++ Compiler. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in - cl*) - # Native MSVC + cl* | icl*) + # Native MSVC or ICC hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported always_export_symbols=yes @@ -12239,7 +13251,7 @@ fi fi' ;; *) - # Assume MSVC wrapper + # Assume MSVC and ICC wrapper hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. @@ -12280,8 +13292,8 @@ fi output_verbose_link_cmd=func_echo_all archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" - archive_expsym_cmds="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" - module_expsym_cmds="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" + archive_expsym_cmds="$SED 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" + module_expsym_cmds="$SED -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" else ld_shlibs=no @@ -12315,7 +13327,7 @@ fi ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd* | dragonfly*) + freebsd* | dragonfly* | midnightbsd*) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes @@ -12496,6 +13508,7 @@ printf "%s\n" "$lt_cv_irix_exported_symbol" >&6; } # Fabrice Bellard et al's Tiny C Compiler ld_shlibs=yes archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' ;; esac ;; @@ -12567,6 +13580,7 @@ printf "%s\n" "$lt_cv_irix_exported_symbol" >&6; } emximp -o $lib $output_objdir/$libname.def' old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes=yes + file_list_spec='@' ;; osf3*) @@ -13259,7 +14273,7 @@ cygwin* | mingw* | pw32* | cegcc*) case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' - soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + soname_spec='`echo $libname | $SED -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" ;; @@ -13269,14 +14283,14 @@ cygwin* | mingw* | pw32* | cegcc*) ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + library_names_spec='`echo $libname | $SED -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; esac dynamic_linker='Win32 ld.exe' ;; - *,cl*) - # Native MSVC + *,cl* | *,icl*) + # Native MSVC or ICC libname_spec='$name' soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' library_names_spec='$libname.dll.lib' @@ -13295,7 +14309,7 @@ cygwin* | mingw* | pw32* | cegcc*) done IFS=$lt_save_ifs # Convert to MSYS style. - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form @@ -13332,7 +14346,7 @@ cygwin* | mingw* | pw32* | cegcc*) ;; *) - # Assume MSVC wrapper + # Assume MSVC and ICC wrapper library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; @@ -13365,7 +14379,7 @@ dgux*) shlibpath_var=LD_LIBRARY_PATH ;; -freebsd* | dragonfly*) +freebsd* | dragonfly* | midnightbsd*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then @@ -14530,30 +15544,41 @@ striplib= old_striplib= { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 printf %s "checking whether stripping libraries is possible... " >&6; } -if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then - test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" - test -z "$striplib" && striplib="$STRIP --strip-unneeded" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } +if test -z "$STRIP"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } else -# FIXME - insert some real tests, host_os isn't really good enough - case $host_os in - darwin*) - if test -n "$STRIP"; then + if $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then + old_striplib="$STRIP --strip-debug" + striplib="$STRIP --strip-unneeded" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + else + case $host_os in + darwin*) + # FIXME - insert some real tests, host_os isn't really good enough striplib="$STRIP -x" old_striplib="$STRIP -S" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } - else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 + ;; + freebsd*) + if $STRIP -V 2>&1 | $GREP "elftoolchain" >/dev/null; then + old_striplib="$STRIP --strip-debug" + striplib="$STRIP --strip-unneeded" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } - fi - ;; - *) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 + fi + ;; + *) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } - ;; - esac + ;; + esac + fi fi @@ -15323,8 +16348,8 @@ fi cygwin* | mingw* | pw32* | cegcc*) case $GXX,$cc_basename in - ,cl* | no,cl*) - # Native MSVC + ,cl* | no,cl* | ,icl* | no,icl*) + # Native MSVC or ICC # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec_CXX=' ' @@ -15415,11 +16440,11 @@ fi output_verbose_link_cmd=func_echo_all archive_cmds_CXX="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" module_cmds_CXX="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" - archive_expsym_cmds_CXX="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" - module_expsym_cmds_CXX="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" + archive_expsym_cmds_CXX="$SED 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" + module_expsym_cmds_CXX="$SED -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" if test yes != "$lt_cv_apple_cc_single_mod"; then archive_cmds_CXX="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil" - archive_expsym_cmds_CXX="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil" + archive_expsym_cmds_CXX="$SED 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil" fi else @@ -15454,6 +16479,7 @@ fi emximp -o $lib $output_objdir/$libname.def' old_archive_From_new_cmds_CXX='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes_CXX=yes + file_list_spec_CXX='@' ;; dgux*) @@ -15484,7 +16510,7 @@ fi archive_cmds_need_lc_CXX=no ;; - freebsd* | dragonfly*) + freebsd* | dragonfly* | midnightbsd*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions ld_shlibs_CXX=yes @@ -15621,7 +16647,7 @@ fi # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - archive_expsym_cmds_CXX='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds_CXX='$SED "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in @@ -15761,13 +16787,13 @@ fi archive_cmds_CXX='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' if test yes = "$supports_anon_versioning"; then archive_expsym_cmds_CXX='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi ;; *) - case `$CC -V 2>&1 | sed 5q` in + case `$CC -V 2>&1 | $SED 5q` in *Sun\ C*) # Sun C++ 5.9 no_undefined_flag_CXX=' -zdefs' @@ -16424,7 +17450,7 @@ lt_prog_compiler_static_CXX= ;; esac ;; - freebsd* | dragonfly*) + freebsd* | dragonfly* | midnightbsd*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) @@ -16507,7 +17533,7 @@ lt_prog_compiler_static_CXX= lt_prog_compiler_static_CXX='-qstaticlink' ;; *) - case `$CC -V 2>&1 | sed 5q` in + case `$CC -V 2>&1 | $SED 5q` in *Sun\ C*) # Sun C++ 5.9 lt_prog_compiler_pic_CXX='-KPIC' @@ -16894,7 +17920,7 @@ printf %s "checking whether the $compiler linker ($LD) supports shared libraries if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else - export_symbols_cmds_CXX='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' + export_symbols_cmds_CXX='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi ;; pw32*) @@ -16902,7 +17928,7 @@ printf %s "checking whether the $compiler linker ($LD) supports shared libraries ;; cygwin* | mingw* | cegcc*) case $cc_basename in - cl*) + cl* | icl*) exclude_expsyms_CXX='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' ;; *) @@ -17253,7 +18279,7 @@ cygwin* | mingw* | pw32* | cegcc*) case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' - soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + soname_spec='`echo $libname | $SED -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; mingw* | cegcc*) @@ -17262,14 +18288,14 @@ cygwin* | mingw* | pw32* | cegcc*) ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + library_names_spec='`echo $libname | $SED -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; esac dynamic_linker='Win32 ld.exe' ;; - *,cl*) - # Native MSVC + *,cl* | *,icl*) + # Native MSVC or ICC libname_spec='$name' soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' library_names_spec='$libname.dll.lib' @@ -17288,7 +18314,7 @@ cygwin* | mingw* | pw32* | cegcc*) done IFS=$lt_save_ifs # Convert to MSYS style. - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form @@ -17325,7 +18351,7 @@ cygwin* | mingw* | pw32* | cegcc*) ;; *) - # Assume MSVC wrapper + # Assume MSVC and ICC wrapper library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; @@ -17357,7 +18383,7 @@ dgux*) shlibpath_var=LD_LIBRARY_PATH ;; -freebsd* | dragonfly*) +freebsd* | dragonfly* | midnightbsd*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then @@ -18006,7 +19032,219 @@ do esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="${ac_tool_prefix}gcc" + ac_cv_prog_CC="${ac_tool_prefix}gcc" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="gcc" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + fi +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + if test "$as_dir$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi @@ -18026,11 +19264,15 @@ printf "%s\n" "no" >&6; } fi + test -n "$CC" && break + done fi -if test -z "$ac_cv_prog_CC"; then +if test -z "$CC"; then ac_ct_CC=$CC - # Extract the first word of "gcc", so it can be a program name with args. -set dummy gcc; ac_word=$2 + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} @@ -18051,7 +19293,7 @@ do esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="gcc" + ac_cv_prog_ac_ct_CC="$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi @@ -18070,6 +19312,10 @@ else printf "%s\n" "no" >&6; } fi + + test -n "$ac_ct_CC" && break +done + if test "x$ac_ct_CC" = x; then CC="" else @@ -18081,14 +19327,13 @@ ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi -else - CC="$ac_cv_prog_CC" fi +fi if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. -set dummy ${ac_tool_prefix}cc; ac_word=$2 + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}clang", so it can be a program name with args. +set dummy ${ac_tool_prefix}clang; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} @@ -18109,7 +19354,7 @@ do esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="${ac_tool_prefix}cc" + ac_cv_prog_CC="${ac_tool_prefix}clang" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi @@ -18129,241 +19374,443 @@ printf "%s\n" "no" >&6; } fi - fi fi -if test -z "$CC"; then - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "clang", so it can be a program name with args. +set dummy clang; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_CC+y} +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="clang" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +fi + + +test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5; } + +# Provide some information about the compiler. +printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion -version; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C" >&5 +printf %s "checking whether the compiler supports GNU C... " >&6; } +if test ${ac_cv_c_compiler_gnu+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_compiler_gnu=yes +else $as_nop + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; } +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi +ac_test_CFLAGS=${CFLAGS+y} +ac_save_CFLAGS=$CFLAGS +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +printf %s "checking whether $CC accepts -g... " >&6; } +if test ${ac_cv_prog_cc_g+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_g=yes +else $as_nop + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + +else $as_nop + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +printf "%s\n" "$ac_cv_prog_cc_g" >&6; } +if test $ac_test_CFLAGS; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +ac_prog_cc_stdc=no +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5 +printf %s "checking for $CC option to enable C11 features... " >&6; } +if test ${ac_cv_prog_cc_c11+y} then : printf %s "(cached) " >&6 else $as_nop - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - ac_prog_rejected=no -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH + ac_cv_prog_cc_c11=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_c_conftest_c11_program +_ACEOF +for ac_arg in '' -std=gnu11 do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - if test "$as_dir$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then - ac_prog_rejected=yes - continue - fi - ac_cv_prog_CC="cc" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -if test $ac_prog_rejected = yes; then - # We found a bogon in the path, so make sure we never use it. - set dummy $ac_cv_prog_CC - shift - if test $# != 0; then - # We chose a different compiler from the bogus one. - # However, it has the same basename, so the bogon will be chosen - # first if we set CC to just the basename; use the full file name. - shift - ac_cv_prog_CC="$as_dir$ac_word${1+' '}$@" - fi + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_c11=$ac_arg fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cc_c11" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC fi + +if test "x$ac_cv_prog_cc_c11" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cc_c11" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 +printf "%s\n" "$ac_cv_prog_cc_c11" >&6; } + CC="$CC $ac_cv_prog_cc_c11" fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -printf "%s\n" "$CC" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11 + ac_prog_cc_stdc=c11 fi - - fi -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - for ac_prog in cl.exe - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_CC+y} +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5 +printf %s "checking for $CC option to enable C99 features... " >&6; } +if test ${ac_cv_prog_cc_c99+y} then : printf %s "(cached) " >&6 else $as_nop - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH + ac_cv_prog_cc_c99=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_c_conftest_c99_program +_ACEOF +for ac_arg in '' -std=gnu99 -std=c99 -c99 -qlanglvl=extc1x -qlanglvl=extc99 -AC99 -D_STDC_C99= do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_c99=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cc_c99" != "xno" && break done - done -IFS=$as_save_IFS - +rm -f conftest.$ac_ext +CC=$ac_save_CC fi + +if test "x$ac_cv_prog_cc_c99" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cc_c99" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 +printf "%s\n" "$ac_cv_prog_cc_c99" >&6; } + CC="$CC $ac_cv_prog_cc_c99" fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -printf "%s\n" "$CC" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 + ac_prog_cc_stdc=c99 fi - - - test -n "$CC" && break - done fi -if test -z "$CC"; then - ac_ct_CC=$CC - for ac_prog in cl.exe -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_ac_ct_CC+y} +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features" >&5 +printf %s "checking for $CC option to enable C89 features... " >&6; } +if test ${ac_cv_prog_cc_c89+y} then : printf %s "(cached) " >&6 else $as_nop - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_c_conftest_c89_program +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="$ac_prog" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cc_c89" != "xno" && break done - done -IFS=$as_save_IFS +rm -f conftest.$ac_ext +CC=$ac_save_CC +fi +if test "x$ac_cv_prog_cc_c89" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cc_c89" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +printf "%s\n" "$ac_cv_prog_cc_c89" >&6; } + CC="$CC $ac_cv_prog_cc_c89" fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 + ac_prog_cc_stdc=c89 fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -printf "%s\n" "$ac_ct_CC" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu - test -n "$ac_ct_CC" && break -done - - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi -fi - -fi -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}clang", so it can be a program name with args. -set dummy ${ac_tool_prefix}clang; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_CC+y} + + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 +printf %s "checking whether $CC understands -c and -o together... " >&6; } +if test ${am_cv_prog_cc_c_o+y} then : printf %s "(cached) " >&6 else $as_nop - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="${ac_tool_prefix}clang" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int +main (void) +{ + + ; + return 0; +} +_ACEOF + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 + ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + rm -f core conftest* + unset am_i fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 +printf "%s\n" "$am_cv_prog_cc_c_o" >&6; } +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -printf "%s\n" "$CC" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu -fi -if test -z "$ac_cv_prog_CC"; then - ac_ct_CC=$CC - # Extract the first word of "clang", so it can be a program name with args. -set dummy clang; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_ac_ct_CC+y} + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 +printf %s "checking for egrep... " >&6; } +if test ${ac_cv_path_EGREP+y} then : printf %s "(cached) " >&6 else $as_nop - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + if test -z "$EGREP"; then + ac_path_EGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS case $as_dir in #((( @@ -18371,89 +19818,113 @@ do */) ;; *) as_dir=$as_dir/ ;; esac + for ac_prog in egrep + do for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="clang" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done + ac_path_EGREP="$as_dir$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_EGREP" || continue +# Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + printf %s 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + printf "%s\n" 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break done -IFS=$as_save_IFS - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -printf "%s\n" "$ac_ct_CC" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac - CC=$ac_ct_CC + + $ac_path_EGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP"; then + as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else - CC="$ac_cv_prog_CC" + ac_cv_path_EGREP=$EGREP fi + fi fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 +printf "%s\n" "$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" -test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "no acceptable C compiler found in \$PATH -See \`config.log' for more details" "$LINENO" 5; } -# Provide some information about the compiler. -printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 -set X $ac_compile -ac_compiler=$2 -for ac_option in --version -v -V -qversion -version; do - { { ac_try="$ac_compiler $ac_option >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$ac_try_echo"; } >&5 - (eval "$ac_compiler $ac_option >&5") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - sed '10a\ -... rest of stderr output deleted ... - 10q' conftest.err >conftest.er1 - cat conftest.er1 >&5 - fi - rm -f conftest.er1 conftest.err - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } -done -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C" >&5 -printf %s "checking whether the compiler supports GNU C... " >&6; } -if test ${ac_cv_c_compiler_gnu+y} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler vendor" >&5 +printf %s "checking for C compiler vendor... " >&6; } +if test ${ax_cv_c_compiler_vendor+y} then : printf %s "(cached) " >&6 else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + + vendors=" + intel: __ICC,__ECC,__INTEL_COMPILER + ibm: __xlc__,__xlC__,__IBMC__,__IBMCPP__,__ibmxl__ + pathscale: __PATHCC__,__PATHSCALE__ + clang: __clang__ + cray: _CRAYC + fujitsu: __FUJITSU + sdcc: SDCC,__SDCC + sx: _SX + nvhpc: __NVCOMPILER + portland: __PGI + gnu: __GNUC__ + sun: __SUNPRO_C,__SUNPRO_CC,__SUNPRO_F90,__SUNPRO_F95 + hp: __HP_cc,__HP_aCC + dec: __DECC,__DECCXX,__DECC_VER,__DECCXX_VER + borland: __BORLANDC__,__CODEGEARC__,__TURBOC__ + comeau: __COMO__ + kai: __KCC + lcc: __LCC__ + sgi: __sgi,sgi + microsoft: _MSC_VER + metrowerks: __MWERKS__ + watcom: __WATCOMC__ + tcc: __TINYC__ + unknown: UNKNOWN + " + for ventest in $vendors; do + case $ventest in + *:) + vendor=$ventest + continue + ;; + *) + vencpp="defined("`echo $ventest | sed 's/,/) || defined(/g'`")" + ;; + esac + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { -#ifndef __GNUC__ - choke me + +#if !($vencpp) + thisisanerror; #endif ; @@ -18462,724 +19933,691 @@ main (void) _ACEOF if ac_fn_c_try_compile "$LINENO" then : - ac_compiler_gnu=yes -else $as_nop - ac_compiler_gnu=no + break fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -ac_cv_c_compiler_gnu=$ac_compiler_gnu + done + + ax_cv_c_compiler_vendor=`echo $vendor | cut -d: -f1` fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 -printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; } -ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_c_compiler_vendor" >&5 +printf "%s\n" "$ax_cv_c_compiler_vendor" >&6; } -if test $ac_compiler_gnu = yes; then - GCC=yes -else - GCC= + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether this is native windows" >&5 +printf %s "checking whether this is native windows... " >&6; } +ac_cv_native_windows=no +ac_cv_windows=no +case $host_os in + mingw*) + ac_cv_native_windows=yes + ac_cv_windows=yes + ;; + cygwin*) + ac_cv_windows=yes + ;; +esac +if test "$ax_cv_c_compiler_vendor" = "microsoft" ; then + ac_cv_native_windows=yes + ac_cv_windows=yes fi -ac_test_CFLAGS=${CFLAGS+y} -ac_save_CFLAGS=$CFLAGS -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 -printf %s "checking whether $CC accepts -g... " >&6; } -if test ${ac_cv_prog_cc_g+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_save_c_werror_flag=$ac_c_werror_flag - ac_c_werror_flag=yes - ac_cv_prog_cc_g=no - CFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_native_windows" >&5 +printf "%s\n" "$ac_cv_native_windows" >&6; } -int -main (void) -{ - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" +# Check whether --enable-shared was given. +if test ${enable_shared+y} then : - ac_cv_prog_cc_g=yes + enableval=$enable_shared; p=${PACKAGE-default} + case $enableval in + yes) enable_shared=yes ;; + no) enable_shared=no ;; + *) + enable_shared=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, + for pkg in $enableval; do + IFS=$lt_save_ifs + if test "X$pkg" = "X$p"; then + enable_shared=yes + fi + done + IFS=$lt_save_ifs + ;; + esac else $as_nop - CFLAGS="" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + enable_shared=yes +fi -int -main (void) -{ - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : -else $as_nop - ac_c_werror_flag=$ac_save_c_werror_flag - CFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int -main (void) -{ - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - ac_cv_prog_cc_g=yes -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - ac_c_werror_flag=$ac_save_c_werror_flag -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 -printf "%s\n" "$ac_cv_prog_cc_g" >&6; } -if test $ac_test_CFLAGS; then - CFLAGS=$ac_save_CFLAGS -elif test $ac_cv_prog_cc_g = yes; then - if test "$GCC" = yes; then - CFLAGS="-g -O2" - else - CFLAGS="-g" - fi -else - if test "$GCC" = yes; then - CFLAGS="-O2" - else - CFLAGS= - fi -fi -ac_prog_cc_stdc=no -if test x$ac_prog_cc_stdc = xno + + +if test "x$ac_cv_windows" = "xyes" then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5 -printf %s "checking for $CC option to enable C11 features... " >&6; } -if test ${ac_cv_prog_cc_c11+y} + # Check whether --enable-static was given. +if test ${enable_static+y} then : - printf %s "(cached) " >&6 + enableval=$enable_static; p=${PACKAGE-default} + case $enableval in + yes) enable_static=yes ;; + no) enable_static=no ;; + *) + enable_static=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, + for pkg in $enableval; do + IFS=$lt_save_ifs + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS=$lt_save_ifs + ;; + esac else $as_nop - ac_cv_prog_cc_c11=no -ac_save_CC=$CC -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$ac_c_conftest_c11_program -_ACEOF -for ac_arg in '' -std=gnu11 -do - CC="$ac_save_CC $ac_arg" - if ac_fn_c_try_compile "$LINENO" -then : - ac_cv_prog_cc_c11=$ac_arg -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam - test "x$ac_cv_prog_cc_c11" != "xno" && break -done -rm -f conftest.$ac_ext -CC=$ac_save_CC + enable_static=no fi -if test "x$ac_cv_prog_cc_c11" = xno -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -printf "%s\n" "unsupported" >&6; } -else $as_nop - if test "x$ac_cv_prog_cc_c11" = x -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -printf "%s\n" "none needed" >&6; } + + + + + else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 -printf "%s\n" "$ac_cv_prog_cc_c11" >&6; } - CC="$CC $ac_cv_prog_cc_c11" -fi - ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11 - ac_prog_cc_stdc=c11 -fi -fi -if test x$ac_prog_cc_stdc = xno -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5 -printf %s "checking for $CC option to enable C99 features... " >&6; } -if test ${ac_cv_prog_cc_c99+y} + # Check whether --enable-static was given. +if test ${enable_static+y} then : - printf %s "(cached) " >&6 + enableval=$enable_static; p=${PACKAGE-default} + case $enableval in + yes) enable_static=yes ;; + no) enable_static=no ;; + *) + enable_static=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, + for pkg in $enableval; do + IFS=$lt_save_ifs + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS=$lt_save_ifs + ;; + esac else $as_nop - ac_cv_prog_cc_c99=no -ac_save_CC=$CC -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$ac_c_conftest_c99_program -_ACEOF -for ac_arg in '' -std=gnu99 -std=c99 -c99 -qlanglvl=extc1x -qlanglvl=extc99 -AC99 -D_STDC_C99= -do - CC="$ac_save_CC $ac_arg" - if ac_fn_c_try_compile "$LINENO" -then : - ac_cv_prog_cc_c99=$ac_arg + enable_static=yes fi -rm -f core conftest.err conftest.$ac_objext conftest.beam - test "x$ac_cv_prog_cc_c99" != "xno" && break -done -rm -f conftest.$ac_ext -CC=$ac_save_CC + + + + + + fi -if test "x$ac_cv_prog_cc_c99" = xno -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -printf "%s\n" "unsupported" >&6; } -else $as_nop - if test "x$ac_cv_prog_cc_c99" = x +# Check whether --enable-warnings was given. +if test ${enable_warnings+y} then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -printf "%s\n" "none needed" >&6; } + enableval=$enable_warnings; enable_warnings=${enableval} else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 -printf "%s\n" "$ac_cv_prog_cc_c99" >&6; } - CC="$CC $ac_cv_prog_cc_c99" -fi - ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 - ac_prog_cc_stdc=c99 -fi + enable_warnings=yes fi -if test x$ac_prog_cc_stdc = xno -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features" >&5 -printf %s "checking for $CC option to enable C89 features... " >&6; } -if test ${ac_cv_prog_cc_c89+y} + + +# Check whether --enable-symbol-hiding was given. +if test ${enable_symbol_hiding+y} then : - printf %s "(cached) " >&6 + enableval=$enable_symbol_hiding; + symbol_hiding="$enableval" + if test "$symbol_hiding" = "no" -a "x$enable_shared" = "xyes" ; then + case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + as_fn_error $? "Cannot disable symbol hiding on windows" "$LINENO" 5 + ;; + esac + fi + else $as_nop - ac_cv_prog_cc_c89=no -ac_save_CC=$CC -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$ac_c_conftest_c89_program -_ACEOF -for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" -do - CC="$ac_save_CC $ac_arg" - if ac_fn_c_try_compile "$LINENO" -then : - ac_cv_prog_cc_c89=$ac_arg -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam - test "x$ac_cv_prog_cc_c89" != "xno" && break -done -rm -f conftest.$ac_ext -CC=$ac_save_CC + + if test "x$enable_shared" = "xyes" ; then + symbol_hiding="maybe" + else + symbol_hiding="no" + fi + + fi -if test "x$ac_cv_prog_cc_c89" = xno + +# Check whether --enable-tests was given. +if test ${enable_tests+y} then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -printf "%s\n" "unsupported" >&6; } + enableval=$enable_tests; build_tests="$enableval" else $as_nop - if test "x$ac_cv_prog_cc_c89" = x + if test "x$HAVE_CXX14" = "x1" && test "x$cross_compiling" = "xno" ; then + build_tests="maybe" + else + build_tests="no" + fi + + +fi + + +# Check whether --enable-cares-threads was given. +if test ${enable_cares_threads+y} then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -printf "%s\n" "none needed" >&6; } + enableval=$enable_cares_threads; CARES_THREADS=${enableval} else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 -printf "%s\n" "$ac_cv_prog_cc_c89" >&6; } - CC="$CC $ac_cv_prog_cc_c89" -fi - ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 - ac_prog_cc_stdc=c89 -fi + CARES_THREADS=yes fi -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 -printf %s "checking whether $CC understands -c and -o together... " >&6; } -if test ${am_cv_prog_cc_c_o+y} +# Check whether --with-random was given. +if test ${with_random+y} then : - printf %s "(cached) " >&6 + withval=$with_random; CARES_RANDOM_FILE="$withval" else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + CARES_RANDOM_FILE="/dev/urandom" -int -main (void) -{ +fi + +if test -n "$CARES_RANDOM_FILE" && test X"$CARES_RANDOM_FILE" != Xno ; then + + +printf "%s\n" "#define CARES_RANDOM_FILE \"$CARES_RANDOM_FILE\"" >>confdefs.h - ; - return 0; -} -_ACEOF - # Make sure it works both with $CC and with simple cc. - # Following AC_PROG_CC_C_O, we do the test twice because some - # compilers refuse to overwrite an existing .o file with -o, - # though they will create one. - am_cv_prog_cc_c_o=yes - for am_i in 1 2; do - if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 - ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } \ - && test -f conftest2.$ac_objext; then - : OK - else - am_cv_prog_cc_c_o=no - break - fi - done - rm -f core conftest* - unset am_i fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 -printf "%s\n" "$am_cv_prog_cc_c_o" >&6; } -if test "$am_cv_prog_cc_c_o" != yes; then - # Losing compiler, so override with the script. - # FIXME: It is wrong to rewrite CC. - # But if we don't then we get into trouble of one sort or another. - # A longer-term fix would be to have automake use am__CC in this case, - # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" - CC="$am_aux_dir/compile $CC" + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 +printf %s "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } + # Check whether --enable-maintainer-mode was given. +if test ${enable_maintainer_mode+y} +then : + enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval +else $as_nop + USE_MAINTAINER_MODE=no +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5 +printf "%s\n" "$USE_MAINTAINER_MODE" >&6; } + if test $USE_MAINTAINER_MODE = yes; then + MAINTAINER_MODE_TRUE= + MAINTAINER_MODE_FALSE='#' +else + MAINTAINER_MODE_TRUE='#' + MAINTAINER_MODE_FALSE= fi -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu + MAINT=$MAINTAINER_MODE_TRUE -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 -printf %s "checking for egrep... " >&6; } -if test ${ac_cv_path_EGREP+y} +# Check whether --enable-silent-rules was given. +if test ${enable_silent_rules+y} then : - printf %s "(cached) " >&6 -else $as_nop - if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 - then ac_cv_path_EGREP="$GREP -E" - else - if test -z "$EGREP"; then - ac_path_EGREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_prog in egrep - do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_EGREP="$as_dir$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_EGREP" || continue -# Check for GNU ac_path_EGREP and select it if it is found. - # Check for GNU $ac_path_EGREP -case `"$ac_path_EGREP" --version 2>&1` in -*GNU*) - ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; -*) - ac_count=0 - printf %s 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - printf "%s\n" 'EGREP' >> "conftest.nl" - "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_EGREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_EGREP="$ac_path_EGREP" - ac_path_EGREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac + enableval=$enable_silent_rules; +fi - $ac_path_EGREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_EGREP"; then - as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi +case $enable_silent_rules in # ((( + yes) AM_DEFAULT_VERBOSITY=0;; + no) AM_DEFAULT_VERBOSITY=1;; + *) AM_DEFAULT_VERBOSITY=0;; +esac +am_make=${MAKE-make} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 +printf %s "checking whether $am_make supports nested variables... " >&6; } +if test ${am_cv_make_support_nested_variables+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if printf "%s\n" 'TRUE=$(BAR$(V)) +BAR0=false +BAR1=true +V=1 +am__doit: + @$(TRUE) +.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then + am_cv_make_support_nested_variables=yes else - ac_cv_path_EGREP=$EGREP + am_cv_make_support_nested_variables=no fi - - fi fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 -printf "%s\n" "$ac_cv_path_EGREP" >&6; } - EGREP="$ac_cv_path_EGREP" +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 +printf "%s\n" "$am_cv_make_support_nested_variables" >&6; } +if test $am_cv_make_support_nested_variables = yes; then + AM_V='$(V)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +else + AM_V=$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +fi +AM_BACKSLASH='\' - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler vendor" >&5 -printf %s "checking for C compiler vendor... " >&6; } -if test ${ax_cv_c_compiler_vendor+y} -then : - printf %s "(cached) " >&6 -else $as_nop - vendors=" - intel: __ICC,__ECC,__INTEL_COMPILER - ibm: __xlc__,__xlC__,__IBMC__,__IBMCPP__,__ibmxl__ - pathscale: __PATHCC__,__PATHSCALE__ - clang: __clang__ - cray: _CRAYC - fujitsu: __FUJITSU - sdcc: SDCC,__SDCC - sx: _SX - nvhpc: __NVCOMPILER - portland: __PGI - gnu: __GNUC__ - sun: __SUNPRO_C,__SUNPRO_CC,__SUNPRO_F90,__SUNPRO_F95 - hp: __HP_cc,__HP_aCC - dec: __DECC,__DECCXX,__DECC_VER,__DECCXX_VER - borland: __BORLANDC__,__CODEGEARC__,__TURBOC__ - comeau: __COMO__ - kai: __KCC - lcc: __LCC__ - sgi: __sgi,sgi - microsoft: _MSC_VER - metrowerks: __MWERKS__ - watcom: __WATCOMC__ - tcc: __TINYC__ - unknown: UNKNOWN - " - for ventest in $vendors; do - case $ventest in - *:) - vendor=$ventest - continue - ;; - *) - vencpp="defined("`echo $ventest | sed 's/,/) || defined(/g'`")" - ;; - esac - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int -main (void) -{ -#if !($vencpp) - thisisanerror; -#endif - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - break -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - done - ax_cv_c_compiler_vendor=`echo $vendor | cut -d: -f1` -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_c_compiler_vendor" >&5 -printf "%s\n" "$ax_cv_c_compiler_vendor" >&6; } -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether this is native windows" >&5 -printf %s "checking whether this is native windows... " >&6; } -ac_cv_native_windows=no -ac_cv_windows=no -case $host_os in - mingw*) - ac_cv_native_windows=yes - ac_cv_windows=yes - ;; - cygwin*) - ac_cv_windows=yes - ;; -esac -if test "$ax_cv_c_compiler_vendor" = "microsoft" ; then - ac_cv_native_windows=yes - ac_cv_windows=yes + + + + + + + + # allow to override gcov location + +# Check whether --with-gcov was given. +if test ${with_gcov+y} +then : + withval=$with_gcov; _AX_CODE_COVERAGE_GCOV_PROG_WITH=$with_gcov +else $as_nop + _AX_CODE_COVERAGE_GCOV_PROG_WITH=gcov fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_native_windows" >&5 -printf "%s\n" "$ac_cv_native_windows" >&6; } -# Check whether --enable-shared was given. -if test ${enable_shared+y} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to build with code coverage support" >&5 +printf %s "checking whether to build with code coverage support... " >&6; } + # Check whether --enable-code-coverage was given. +if test ${enable_code_coverage+y} then : - enableval=$enable_shared; p=${PACKAGE-default} - case $enableval in - yes) enable_shared=yes ;; - no) enable_shared=no ;; - *) - enable_shared=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, - for pkg in $enableval; do - IFS=$lt_save_ifs - if test "X$pkg" = "X$p"; then - enable_shared=yes - fi - done - IFS=$lt_save_ifs - ;; - esac + enableval=$enable_code_coverage; else $as_nop - enable_shared=yes + enable_code_coverage=no fi + if test "x$enable_code_coverage" = xyes; then + CODE_COVERAGE_ENABLED_TRUE= + CODE_COVERAGE_ENABLED_FALSE='#' +else + CODE_COVERAGE_ENABLED_TRUE='#' + CODE_COVERAGE_ENABLED_FALSE= +fi + CODE_COVERAGE_ENABLED=$enable_code_coverage + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_code_coverage" >&5 +printf "%s\n" "$enable_code_coverage" >&6; } + if test "x$enable_code_coverage" = xyes +then : -if test "x$ac_cv_windows" = "xyes" + for ac_prog in gawk mawk nawk awk +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_AWK+y} then : - # Check whether --enable-static was given. -if test ${enable_static+y} + printf %s "(cached) " >&6 +else $as_nop + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_AWK="$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 +printf "%s\n" "$AWK" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$AWK" && break +done + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU make" >&5 +printf %s "checking for GNU make... " >&6; } +if test ${_cv_gnu_make_command+y} then : - enableval=$enable_static; p=${PACKAGE-default} - case $enableval in - yes) enable_static=yes ;; - no) enable_static=no ;; - *) - enable_static=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, - for pkg in $enableval; do - IFS=$lt_save_ifs - if test "X$pkg" = "X$p"; then - enable_static=yes - fi - done - IFS=$lt_save_ifs - ;; - esac + printf %s "(cached) " >&6 else $as_nop - enable_static=no + _cv_gnu_make_command="" ; + for a in "$MAKE" make gmake gnumake ; do + if test -z "$a" ; then continue ; fi ; + if "$a" --version 2> /dev/null | grep GNU 2>&1 > /dev/null ; then + _cv_gnu_make_command=$a ; + AX_CHECK_GNU_MAKE_HEADLINE=$("$a" --version 2> /dev/null | grep "GNU Make") + ax_check_gnu_make_version=$(echo ${AX_CHECK_GNU_MAKE_HEADLINE} | ${AWK} -F " " '{ print $(NF); }') + break ; + fi + done ; +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $_cv_gnu_make_command" >&5 +printf "%s\n" "$_cv_gnu_make_command" >&6; } + if test "x$_cv_gnu_make_command" = x"" +then : + ifGNUmake="#" +else $as_nop + ifGNUmake="" fi - - - - - - + if test "x$_cv_gnu_make_command" = x"" +then : + ifnGNUmake="" else $as_nop - # Check whether --enable-static was given. -if test ${enable_static+y} + ifnGNUmake="#" +fi + if test "x$_cv_gnu_make_command" = x"" then : - enableval=$enable_static; p=${PACKAGE-default} - case $enableval in - yes) enable_static=yes ;; - no) enable_static=no ;; - *) - enable_static=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, - for pkg in $enableval; do - IFS=$lt_save_ifs - if test "X$pkg" = "X$p"; then - enable_static=yes - fi - done - IFS=$lt_save_ifs - ;; - esac + { ax_cv_gnu_make_command=; unset ax_cv_gnu_make_command;} else $as_nop - enable_static=yes + ax_cv_gnu_make_command=${_cv_gnu_make_command} +fi + if test "x$_cv_gnu_make_command" = x"" +then : + as_fn_error $? "not using GNU make that is needed for coverage" "$LINENO" 5 fi - - -fi - -# Check whether --enable-warnings was given. -if test ${enable_warnings+y} + # check for gcov + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}$_AX_CODE_COVERAGE_GCOV_PROG_WITH", so it can be a program name with args. +set dummy ${ac_tool_prefix}$_AX_CODE_COVERAGE_GCOV_PROG_WITH; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_GCOV+y} then : - enableval=$enable_warnings; enable_warnings=${enableval} + printf %s "(cached) " >&6 else $as_nop - enable_warnings=yes + if test -n "$GCOV"; then + ac_cv_prog_GCOV="$GCOV" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_GCOV="${ac_tool_prefix}$_AX_CODE_COVERAGE_GCOV_PROG_WITH" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +GCOV=$ac_cv_prog_GCOV +if test -n "$GCOV"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $GCOV" >&5 +printf "%s\n" "$GCOV" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -# Check whether --enable-symbol-hiding was given. -if test ${enable_symbol_hiding+y} +fi +if test -z "$ac_cv_prog_GCOV"; then + ac_ct_GCOV=$GCOV + # Extract the first word of "$_AX_CODE_COVERAGE_GCOV_PROG_WITH", so it can be a program name with args. +set dummy $_AX_CODE_COVERAGE_GCOV_PROG_WITH; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_GCOV+y} then : - enableval=$enable_symbol_hiding; - symbol_hiding="$enableval" - if test "$symbol_hiding" = "no" -a "x$enable_shared" = "xyes" ; then - case $host_os in - cygwin* | mingw* | pw32* | cegcc*) - as_fn_error $? "Cannot disable symbol hiding on windows" "$LINENO" 5 - ;; - esac - fi - + printf %s "(cached) " >&6 else $as_nop + if test -n "$ac_ct_GCOV"; then + ac_cv_prog_ac_ct_GCOV="$ac_ct_GCOV" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_GCOV="$_AX_CODE_COVERAGE_GCOV_PROG_WITH" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS - if test "x$enable_shared" = "xyes" ; then - symbol_hiding="maybe" - else - symbol_hiding="no" - fi +fi +fi +ac_ct_GCOV=$ac_cv_prog_ac_ct_GCOV +if test -n "$ac_ct_GCOV"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_GCOV" >&5 +printf "%s\n" "$ac_ct_GCOV" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + if test "x$ac_ct_GCOV" = x; then + GCOV=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + GCOV=$ac_ct_GCOV + fi +else + GCOV="$ac_cv_prog_GCOV" +fi + if test "X$GCOV" = "X:" +then : + as_fn_error $? "gcov is needed to do coverage" "$LINENO" 5 fi -# Check whether --enable-tests was given. -if test ${enable_tests+y} + if test "$GCC" = "no" then : - enableval=$enable_tests; build_tests="$enableval" -else $as_nop - if test "x$HAVE_CXX14" = "x1" && test "x$cross_compiling" = "xno" ; then - build_tests="maybe" - else - build_tests="no" - fi + as_fn_error $? "not compiling with gcc, which is required for gcov code coverage" "$LINENO" 5 fi - -# Check whether --enable-cares-threads was given. -if test ${enable_cares_threads+y} + # Extract the first word of "lcov", so it can be a program name with args. +set dummy lcov; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_LCOV+y} then : - enableval=$enable_cares_threads; CARES_THREADS=${enableval} + printf %s "(cached) " >&6 else $as_nop - CARES_THREADS=yes -fi + if test -n "$LCOV"; then + ac_cv_prog_LCOV="$LCOV" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_LCOV="lcov" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS +fi +fi +LCOV=$ac_cv_prog_LCOV +if test -n "$LCOV"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LCOV" >&5 +printf "%s\n" "$LCOV" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi -# Check whether --with-random was given. -if test ${with_random+y} + # Extract the first word of "genhtml", so it can be a program name with args. +set dummy genhtml; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_GENHTML+y} then : - withval=$with_random; CARES_RANDOM_FILE="$withval" + printf %s "(cached) " >&6 else $as_nop - CARES_RANDOM_FILE="/dev/urandom" + if test -n "$GENHTML"; then + ac_cv_prog_GENHTML="$GENHTML" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_GENHTML="genhtml" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS fi - -if test -n "$CARES_RANDOM_FILE" && test X"$CARES_RANDOM_FILE" != Xno ; then - - -printf "%s\n" "#define CARES_RANDOM_FILE \"$CARES_RANDOM_FILE\"" >>confdefs.h - +fi +GENHTML=$ac_cv_prog_GENHTML +if test -n "$GENHTML"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $GENHTML" >&5 +printf "%s\n" "$GENHTML" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 -printf %s "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } - # Check whether --enable-maintainer-mode was given. -if test ${enable_maintainer_mode+y} + + if test x"$LCOV" = x then : - enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval -else $as_nop - USE_MAINTAINER_MODE=no -fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5 -printf "%s\n" "$USE_MAINTAINER_MODE" >&6; } - if test $USE_MAINTAINER_MODE = yes; then - MAINTAINER_MODE_TRUE= - MAINTAINER_MODE_FALSE='#' -else - MAINTAINER_MODE_TRUE='#' - MAINTAINER_MODE_FALSE= + as_fn_error $? "To enable code coverage reporting you must have lcov installed" "$LINENO" 5 + fi - MAINT=$MAINTAINER_MODE_TRUE + if test x"$GENHTML" = x +then : + as_fn_error $? "Could not find genhtml from the lcov package" "$LINENO" 5 -# Check whether --enable-silent-rules was given. -if test ${enable_silent_rules+y} -then : - enableval=$enable_silent_rules; fi -case $enable_silent_rules in # ((( - yes) AM_DEFAULT_VERBOSITY=0;; - no) AM_DEFAULT_VERBOSITY=1;; - *) AM_DEFAULT_VERBOSITY=0;; -esac -am_make=${MAKE-make} -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 -printf %s "checking whether $am_make supports nested variables... " >&6; } -if test ${am_cv_make_support_nested_variables+y} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for _gcov_init in -lgcov" >&5 +printf %s "checking for _gcov_init in -lgcov... " >&6; } +if test ${ac_cv_lib_gcov__gcov_init+y} then : printf %s "(cached) " >&6 else $as_nop - if printf "%s\n" 'TRUE=$(BAR$(V)) -BAR0=false -BAR1=true -V=1 -am__doit: - @$(TRUE) -.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then - am_cv_make_support_nested_variables=yes -else - am_cv_make_support_nested_variables=no + ac_check_lib_save_LIBS=$LIBS +LIBS="-lgcov $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char _gcov_init (); +int +main (void) +{ +return _gcov_init (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_gcov__gcov_init=yes +else $as_nop + ac_cv_lib_gcov__gcov_init=no fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 -printf "%s\n" "$am_cv_make_support_nested_variables" >&6; } -if test $am_cv_make_support_nested_variables = yes; then - AM_V='$(V)' - AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' -else - AM_V=$AM_DEFAULT_VERBOSITY - AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gcov__gcov_init" >&5 +printf "%s\n" "$ac_cv_lib_gcov__gcov_init" >&6; } +if test "x$ac_cv_lib_gcov__gcov_init" = xyes +then : + CODE_COVERAGE_LIBS="-lgcov" +else $as_nop + CODE_COVERAGE_LIBS="" fi -AM_BACKSLASH='\' + CODE_COVERAGE_CPPFLAGS="-DNDEBUG" + CODE_COVERAGE_CFLAGS="-O0 -g -fprofile-arcs -ftest-coverage" + CODE_COVERAGE_CXXFLAGS="-O0 -g -fprofile-arcs -ftest-coverage" + +fi @@ -19191,449 +20629,609 @@ AM_BACKSLASH='\' +# Check whether --enable-largefile was given. +if test ${enable_largefile+y} +then : + enableval=$enable_largefile; +fi - # allow to override gcov location +if test "$enable_largefile" != no; then -# Check whether --with-gcov was given. -if test ${with_gcov+y} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5 +printf %s "checking for special C compiler options needed for large files... " >&6; } +if test ${ac_cv_sys_largefile_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_sys_largefile_CC=no + if test "$GCC" != yes; then + ac_save_CC=$CC + while :; do + # IRIX 6.2 and later do not support large files by default, + # so use the C compiler's -n32 option if that helps. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main (void) +{ + + ; + return 0; +} +_ACEOF + if ac_fn_c_try_compile "$LINENO" +then : + break +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + CC="$CC -n32" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_sys_largefile_CC=' -n32'; break +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + break + done + CC=$ac_save_CC + rm -f conftest.$ac_ext + fi +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5 +printf "%s\n" "$ac_cv_sys_largefile_CC" >&6; } + if test "$ac_cv_sys_largefile_CC" != no; then + CC=$CC$ac_cv_sys_largefile_CC + fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5 +printf %s "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; } +if test ${ac_cv_sys_file_offset_bits+y} +then : + printf %s "(cached) " >&6 +else $as_nop + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_sys_file_offset_bits=no; break +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#define _FILE_OFFSET_BITS 64 +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_sys_file_offset_bits=64; break +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ac_cv_sys_file_offset_bits=unknown + break +done +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5 +printf "%s\n" "$ac_cv_sys_file_offset_bits" >&6; } +case $ac_cv_sys_file_offset_bits in #( + no | unknown) ;; + *) +printf "%s\n" "#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits" >>confdefs.h +;; +esac +rm -rf conftest* + if test $ac_cv_sys_file_offset_bits = unknown; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5 +printf %s "checking for _LARGE_FILES value needed for large files... " >&6; } +if test ${ac_cv_sys_large_files+y} +then : + printf %s "(cached) " >&6 +else $as_nop + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" then : - withval=$with_gcov; _AX_CODE_COVERAGE_GCOV_PROG_WITH=$with_gcov -else $as_nop - _AX_CODE_COVERAGE_GCOV_PROG_WITH=gcov + ac_cv_sys_large_files=no; break fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#define _LARGE_FILES 1 +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main (void) +{ - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to build with code coverage support" >&5 -printf %s "checking whether to build with code coverage support... " >&6; } - # Check whether --enable-code-coverage was given. -if test ${enable_code_coverage+y} + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" then : - enableval=$enable_code_coverage; -else $as_nop - enable_code_coverage=no + ac_cv_sys_large_files=1; break fi - - - if test "x$enable_code_coverage" = xyes; then - CODE_COVERAGE_ENABLED_TRUE= - CODE_COVERAGE_ENABLED_FALSE='#' -else - CODE_COVERAGE_ENABLED_TRUE='#' - CODE_COVERAGE_ENABLED_FALSE= +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ac_cv_sys_large_files=unknown + break +done +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5 +printf "%s\n" "$ac_cv_sys_large_files" >&6; } +case $ac_cv_sys_large_files in #( + no | unknown) ;; + *) +printf "%s\n" "#define _LARGE_FILES $ac_cv_sys_large_files" >>confdefs.h +;; +esac +rm -rf conftest* + fi fi - CODE_COVERAGE_ENABLED=$enable_code_coverage - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_code_coverage" >&5 -printf "%s\n" "$enable_code_coverage" >&6; } +case $host_os in + solaris*) - if test "x$enable_code_coverage" = xyes -then : +printf "%s\n" "#define ETC_INET 1" >>confdefs.h + ;; +esac - for ac_prog in gawk mawk nawk awk -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_AWK+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$AWK"; then - ac_cv_prog_AWK="$AWK" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_AWK="$ac_prog" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS +case $host_os in + solaris2*) + if test "x$GCC" = 'xyes'; then -fi -fi -AWK=$ac_cv_prog_AWK -if test -n "$AWK"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 -printf "%s\n" "$AWK" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - test -n "$AWK" && break -done - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU make" >&5 -printf %s "checking for GNU make... " >&6; } -if test ${_cv_gnu_make_command+y} +for flag in -mimpure-text; do + as_CACHEVAR=`printf "%s\n" "ax_cv_check_ldflags__$flag" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the linker accepts $flag" >&5 +printf %s "checking whether the linker accepts $flag... " >&6; } +if eval test \${$as_CACHEVAR+y} then : printf %s "(cached) " >&6 else $as_nop - _cv_gnu_make_command="" ; - for a in "$MAKE" make gmake gnumake ; do - if test -z "$a" ; then continue ; fi ; - if "$a" --version 2> /dev/null | grep GNU 2>&1 > /dev/null ; then - _cv_gnu_make_command=$a ; - AX_CHECK_GNU_MAKE_HEADLINE=$("$a" --version 2> /dev/null | grep "GNU Make") - ax_check_gnu_make_version=$(echo ${AX_CHECK_GNU_MAKE_HEADLINE} | ${AWK} -F " " '{ print $(NF); }') - break ; - fi - done ; -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $_cv_gnu_make_command" >&5 -printf "%s\n" "$_cv_gnu_make_command" >&6; } - if test "x$_cv_gnu_make_command" = x"" -then : - ifGNUmake="#" -else $as_nop - ifGNUmake="" -fi - if test "x$_cv_gnu_make_command" = x"" -then : - ifnGNUmake="" -else $as_nop - ifnGNUmake="#" -fi - if test "x$_cv_gnu_make_command" = x"" -then : - { ax_cv_gnu_make_command=; unset ax_cv_gnu_make_command;} -else $as_nop - ax_cv_gnu_make_command=${_cv_gnu_make_command} -fi - if test "x$_cv_gnu_make_command" = x"" -then : - as_fn_error $? "not using GNU make that is needed for coverage" "$LINENO" 5 -fi - + ax_check_save_flags=$LDFLAGS + LDFLAGS="$LDFLAGS $flag" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int +main (void) +{ - # check for gcov - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}$_AX_CODE_COVERAGE_GCOV_PROG_WITH", so it can be a program name with args. -set dummy ${ac_tool_prefix}$_AX_CODE_COVERAGE_GCOV_PROG_WITH; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_GCOV+y} + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" then : - printf %s "(cached) " >&6 + eval "$as_CACHEVAR=yes" else $as_nop - if test -n "$GCOV"; then - ac_cv_prog_GCOV="$GCOV" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_GCOV="${ac_tool_prefix}$_AX_CODE_COVERAGE_GCOV_PROG_WITH" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi + eval "$as_CACHEVAR=no" fi -GCOV=$ac_cv_prog_GCOV -if test -n "$GCOV"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $GCOV" >&5 -printf "%s\n" "$GCOV" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$ax_check_save_flags fi +eval ac_res=\$$as_CACHEVAR + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_CACHEVAR"\" = x"yes" +then : - -fi -if test -z "$ac_cv_prog_GCOV"; then - ac_ct_GCOV=$GCOV - # Extract the first word of "$_AX_CODE_COVERAGE_GCOV_PROG_WITH", so it can be a program name with args. -set dummy $_AX_CODE_COVERAGE_GCOV_PROG_WITH; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_ac_ct_GCOV+y} +if test ${LDFLAGS+y} then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_GCOV"; then - ac_cv_prog_ac_ct_GCOV="$ac_ct_GCOV" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_GCOV="$_AX_CODE_COVERAGE_GCOV_PROG_WITH" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS + + case " $LDFLAGS " in #( + *" $flag "*) : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : LDFLAGS already contains \$flag"; } >&5 + (: LDFLAGS already contains $flag) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } ;; #( + *) : + + as_fn_append LDFLAGS " $flag" + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : LDFLAGS=\"\$LDFLAGS\""; } >&5 + (: LDFLAGS="$LDFLAGS") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + ;; +esac + +else $as_nop + + LDFLAGS=$flag + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : LDFLAGS=\"\$LDFLAGS\""; } >&5 + (: LDFLAGS="$LDFLAGS") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } fi -fi -ac_ct_GCOV=$ac_cv_prog_ac_ct_GCOV -if test -n "$ac_ct_GCOV"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_GCOV" >&5 -printf "%s\n" "$ac_ct_GCOV" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + +else $as_nop + : fi - if test "x$ac_ct_GCOV" = x; then - GCOV=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; +done + + fi + ;; + *) + ;; esac - GCOV=$ac_ct_GCOV - fi + +cares_use_no_undefined=no +case $host_os in + cygwin* | mingw* | pw32* | cegcc* | os2* | aix*) + cares_use_no_undefined=yes + ;; + *) + ;; +esac + if test "$cares_use_no_undefined" = 'yes'; then + CARES_USE_NO_UNDEFINED_TRUE= + CARES_USE_NO_UNDEFINED_FALSE='#' else - GCOV="$ac_cv_prog_GCOV" + CARES_USE_NO_UNDEFINED_TRUE='#' + CARES_USE_NO_UNDEFINED_FALSE= fi - if test "X$GCOV" = "X:" -then : - as_fn_error $? "gcov is needed to do coverage" "$LINENO" 5 + + +if test "$ac_cv_native_windows" = "yes" ; then + AM_CPPFLAGS="$AM_CPPFLAGS -D_WIN32_WINNT=0x0602 -DWIN32_LEAN_AND_MEAN" fi +if test "$ac_cv_native_windows" = "yes" -a "x$enable_shared" = "xyes" -a "x$enable_static" = "xyes" ; then + as_fn_error $? "Windows cannot build both static and shared simultaneously, specify --disable-shared or --disable-static" "$LINENO" 5 +fi - if test "$GCC" = "no" +if test "x$enable_shared" = "xno" -a "x$enable_static" = "xyes" ; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we need CARES_STATICLIB definition" >&5 +printf %s "checking whether we need CARES_STATICLIB definition... " >&6; } + if test "$ac_cv_native_windows" = "yes" ; then + +if test ${AM_CPPFLAGS+y} then : - as_fn_error $? "not compiling with gcc, which is required for gcov code coverage" "$LINENO" 5 + case " $AM_CPPFLAGS " in #( + *" -DCARES_STATICLIB "*) : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CPPFLAGS already contains -DCARES_STATICLIB"; } >&5 + (: AM_CPPFLAGS already contains -DCARES_STATICLIB) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } ;; #( + *) : -fi + as_fn_append AM_CPPFLAGS " -DCARES_STATICLIB" + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CPPFLAGS=\"\$AM_CPPFLAGS\""; } >&5 + (: AM_CPPFLAGS="$AM_CPPFLAGS") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + ;; +esac - # Extract the first word of "lcov", so it can be a program name with args. -set dummy lcov; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_LCOV+y} -then : - printf %s "(cached) " >&6 else $as_nop - if test -n "$LCOV"; then - ac_cv_prog_LCOV="$LCOV" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_LCOV="lcov" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS + + AM_CPPFLAGS=-DCARES_STATICLIB + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CPPFLAGS=\"\$AM_CPPFLAGS\""; } >&5 + (: AM_CPPFLAGS="$AM_CPPFLAGS") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } fi -fi -LCOV=$ac_cv_prog_LCOV -if test -n "$LCOV"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LCOV" >&5 -printf "%s\n" "$LCOV" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 + + PKGCONFIG_CFLAGS="-DCARES_STATICLIB" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } + fi fi +CARES_SYMBOL_HIDING_CFLAG="" +if test "$symbol_hiding" != "no" ; then + compiler_supports_symbol_hiding="no" + if test "$ac_cv_windows" = "yes" ; then + compiler_supports_symbol_hiding="yes" + else + case "$ax_cv_c_compiler_vendor" in + clang|gnu|intel) - # Extract the first word of "genhtml", so it can be a program name with args. -set dummy genhtml; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_GENHTML+y} + + + +for flag in -fvisibility=hidden; do + as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$flag" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler accepts $flag" >&5 +printf %s "checking whether the C compiler accepts $flag... " >&6; } +if eval test \${$as_CACHEVAR+y} then : printf %s "(cached) " >&6 else $as_nop - if test -n "$GENHTML"; then - ac_cv_prog_GENHTML="$GENHTML" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_GENHTML="genhtml" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 + + ax_check_save_flags=$CFLAGS + if test x"$GCC" = xyes ; then + add_gnu_werror="-Werror" fi -done - done -IFS=$as_save_IFS + CFLAGS="$CFLAGS $flag $add_gnu_werror" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_CACHEVAR=yes" +else $as_nop + eval "$as_CACHEVAR=no" fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + CFLAGS=$ax_check_save_flags fi -GENHTML=$ac_cv_prog_GENHTML -if test -n "$GENHTML"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $GENHTML" >&5 -printf "%s\n" "$GENHTML" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi +eval ac_res=\$$as_CACHEVAR + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_CACHEVAR"\" = x"yes" +then : +if test ${CARES_SYMBOL_HIDING_CFLAG+y} +then : + case " $CARES_SYMBOL_HIDING_CFLAG " in #( + *" $flag "*) : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : CARES_SYMBOL_HIDING_CFLAG already contains \$flag"; } >&5 + (: CARES_SYMBOL_HIDING_CFLAG already contains $flag) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } ;; #( + *) : - if test x"$LCOV" = x -then : + as_fn_append CARES_SYMBOL_HIDING_CFLAG " $flag" + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : CARES_SYMBOL_HIDING_CFLAG=\"\$CARES_SYMBOL_HIDING_CFLAG\""; } >&5 + (: CARES_SYMBOL_HIDING_CFLAG="$CARES_SYMBOL_HIDING_CFLAG") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + ;; +esac - as_fn_error $? "To enable code coverage reporting you must have lcov installed" "$LINENO" 5 +else $as_nop + + CARES_SYMBOL_HIDING_CFLAG=$flag + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : CARES_SYMBOL_HIDING_CFLAG=\"\$CARES_SYMBOL_HIDING_CFLAG\""; } >&5 + (: CARES_SYMBOL_HIDING_CFLAG="$CARES_SYMBOL_HIDING_CFLAG") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + +fi +else $as_nop + : fi - if test x"$GENHTML" = x -then : +done - as_fn_error $? "Could not find genhtml from the lcov package" "$LINENO" 5 + if test "x$CARES_SYMBOL_HIDING_CFLAG" != "x" ; then + compiler_supports_symbol_hiding="yes" + fi + ;; + sun) -fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for _gcov_init in -lgcov" >&5 -printf %s "checking for _gcov_init in -lgcov... " >&6; } -if test ${ac_cv_lib_gcov__gcov_init+y} + + +for flag in -xldscope=hidden; do + as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$flag" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler accepts $flag" >&5 +printf %s "checking whether the C compiler accepts $flag... " >&6; } +if eval test \${$as_CACHEVAR+y} then : printf %s "(cached) " >&6 else $as_nop - ac_check_lib_save_LIBS=$LIBS -LIBS="-lgcov $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext + + ax_check_save_flags=$CFLAGS + if test x"$GCC" = xyes ; then + add_gnu_werror="-Werror" + fi + CFLAGS="$CFLAGS $flag $add_gnu_werror" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char _gcov_init (); int main (void) { -return _gcov_init (); + ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO" +if ac_fn_c_try_compile "$LINENO" then : - ac_cv_lib_gcov__gcov_init=yes + eval "$as_CACHEVAR=yes" else $as_nop - ac_cv_lib_gcov__gcov_init=no + eval "$as_CACHEVAR=no" fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + CFLAGS=$ax_check_save_flags fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gcov__gcov_init" >&5 -printf "%s\n" "$ac_cv_lib_gcov__gcov_init" >&6; } -if test "x$ac_cv_lib_gcov__gcov_init" = xyes +eval ac_res=\$$as_CACHEVAR + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_CACHEVAR"\" = x"yes" then : - CODE_COVERAGE_LIBS="-lgcov" -else $as_nop - CODE_COVERAGE_LIBS="" -fi - - - CODE_COVERAGE_CPPFLAGS="-DNDEBUG" - CODE_COVERAGE_CFLAGS="-O0 -g -fprofile-arcs -ftest-coverage" - CODE_COVERAGE_CXXFLAGS="-O0 -g -fprofile-arcs -ftest-coverage" - +if test ${CARES_SYMBOL_HIDING_CFLAG+y} +then : + case " $CARES_SYMBOL_HIDING_CFLAG " in #( + *" $flag "*) : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : CARES_SYMBOL_HIDING_CFLAG already contains \$flag"; } >&5 + (: CARES_SYMBOL_HIDING_CFLAG already contains $flag) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } ;; #( + *) : + as_fn_append CARES_SYMBOL_HIDING_CFLAG " $flag" + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : CARES_SYMBOL_HIDING_CFLAG=\"\$CARES_SYMBOL_HIDING_CFLAG\""; } >&5 + (: CARES_SYMBOL_HIDING_CFLAG="$CARES_SYMBOL_HIDING_CFLAG") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + ;; +esac +else $as_nop + CARES_SYMBOL_HIDING_CFLAG=$flag + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : CARES_SYMBOL_HIDING_CFLAG=\"\$CARES_SYMBOL_HIDING_CFLAG\""; } >&5 + (: CARES_SYMBOL_HIDING_CFLAG="$CARES_SYMBOL_HIDING_CFLAG") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } fi +else $as_nop + : +fi +done + if test "x$CARES_SYMBOL_HIDING_CFLAG" != "x" ; then + compiler_supports_symbol_hiding="yes" + fi + ;; + esac + fi + if test "$compiler_supports_symbol_hiding" = "no" ; then + if test "$symbol_hiding" = "yes" ; then + as_fn_error $? "Compiler does not support symbol hiding" "$LINENO" 5 + else + symbol_hiding="no" + fi + else +printf "%s\n" "#define CARES_SYMBOL_HIDING 1 " >>confdefs.h + symbol_hiding="yes" + fi +fi + if test "x$symbol_hiding" = "xyes"; then + CARES_SYMBOL_HIDING_TRUE= + CARES_SYMBOL_HIDING_FALSE='#' +else + CARES_SYMBOL_HIDING_TRUE='#' + CARES_SYMBOL_HIDING_FALSE= +fi +if test "$enable_warnings" = "yes"; then -# Check whether --enable-largefile was given. -if test ${enable_largefile+y} -then : - enableval=$enable_largefile; -fi -if test "$enable_largefile" != no; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5 -printf %s "checking for special C compiler options needed for large files... " >&6; } -if test ${ac_cv_sys_largefile_CC+y} +for flag in -Wall -Wextra -Waggregate-return -Wcast-align -Wcast-qual -Wconversion -Wdeclaration-after-statement -Wdouble-promotion -Wfloat-equal -Wformat-security -Winit-self -Wjump-misses-init -Wlogical-op -Wmissing-braces -Wmissing-declarations -Wmissing-format-attribute -Wmissing-include-dirs -Wmissing-prototypes -Wnested-externs -Wno-coverage-mismatch -Wold-style-definition -Wpacked -Wpedantic -Wpointer-arith -Wredundant-decls -Wshadow -Wsign-conversion -Wstrict-overflow -Wstrict-prototypes -Wtrampolines -Wundef -Wunreachable-code -Wunused -Wvariadic-macros -Wvla -Wwrite-strings -Werror=implicit-int -Werror=implicit-function-declaration -Werror=partial-availability -Wno-long-long ; do + as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags_-Werror_$flag" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler accepts $flag" >&5 +printf %s "checking whether the C compiler accepts $flag... " >&6; } +if eval test \${$as_CACHEVAR+y} then : printf %s "(cached) " >&6 else $as_nop - ac_cv_sys_largefile_CC=no - if test "$GCC" != yes; then - ac_save_CC=$CC - while :; do - # IRIX 6.2 and later do not support large files by default, - # so use the C compiler's -n32 option if that helps. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + + ax_check_save_flags=$CFLAGS + if test x"$GCC" = xyes ; then + add_gnu_werror="-Werror" + fi + CFLAGS="$CFLAGS -Werror $flag $add_gnu_werror" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include - /* Check that off_t can represent 2**63 - 1 correctly. - We can't simply define LARGE_OFF_T to be 9223372036854775807, - since some C++ compilers masquerading as C compilers - incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) - int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 - && LARGE_OFF_T % 2147483647 == 1) - ? 1 : -1]; + int main (void) { @@ -19642,47 +21240,84 @@ main (void) return 0; } _ACEOF - if ac_fn_c_try_compile "$LINENO" +if ac_fn_c_try_compile "$LINENO" then : - break + eval "$as_CACHEVAR=yes" +else $as_nop + eval "$as_CACHEVAR=no" fi -rm -f core conftest.err conftest.$ac_objext conftest.beam - CC="$CC -n32" - if ac_fn_c_try_compile "$LINENO" +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + CFLAGS=$ax_check_save_flags +fi +eval ac_res=\$$as_CACHEVAR + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_CACHEVAR"\" = x"yes" then : - ac_cv_sys_largefile_CC=' -n32'; break + +if test ${AM_CFLAGS+y} +then : + + case " $AM_CFLAGS " in #( + *" $flag "*) : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS already contains \$flag"; } >&5 + (: AM_CFLAGS already contains $flag) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } ;; #( + *) : + + as_fn_append AM_CFLAGS " $flag" + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS=\"\$AM_CFLAGS\""; } >&5 + (: AM_CFLAGS="$AM_CFLAGS") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + ;; +esac + +else $as_nop + + AM_CFLAGS=$flag + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS=\"\$AM_CFLAGS\""; } >&5 + (: AM_CFLAGS="$AM_CFLAGS") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + fi -rm -f core conftest.err conftest.$ac_objext conftest.beam - break - done - CC=$ac_save_CC - rm -f conftest.$ac_ext - fi + +else $as_nop + : fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5 -printf "%s\n" "$ac_cv_sys_largefile_CC" >&6; } - if test "$ac_cv_sys_largefile_CC" != no; then - CC=$CC$ac_cv_sys_largefile_CC - fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5 -printf %s "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; } -if test ${ac_cv_sys_file_offset_bits+y} +done + +fi + +case $host_os in + *qnx*|*android*) + + + + +for flag in -std=c99; do + as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags_-Werror_$flag" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler accepts $flag" >&5 +printf %s "checking whether the C compiler accepts $flag... " >&6; } +if eval test \${$as_CACHEVAR+y} then : printf %s "(cached) " >&6 else $as_nop - while :; do + + ax_check_save_flags=$CFLAGS + if test x"$GCC" = xyes ; then + add_gnu_werror="-Werror" + fi + CFLAGS="$CFLAGS -Werror $flag $add_gnu_werror" cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - /* Check that off_t can represent 2**63 - 1 correctly. - We can't simply define LARGE_OFF_T to be 9223372036854775807, - since some C++ compilers masquerading as C compilers - incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) - int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 - && LARGE_OFF_T % 2147483647 == 1) - ? 1 : -1]; +/* end confdefs.h. */ + int main (void) { @@ -19693,66 +21328,80 @@ main (void) _ACEOF if ac_fn_c_try_compile "$LINENO" then : - ac_cv_sys_file_offset_bits=no; break + eval "$as_CACHEVAR=yes" +else $as_nop + eval "$as_CACHEVAR=no" fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#define _FILE_OFFSET_BITS 64 -#include - /* Check that off_t can represent 2**63 - 1 correctly. - We can't simply define LARGE_OFF_T to be 9223372036854775807, - since some C++ compilers masquerading as C compilers - incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) - int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 - && LARGE_OFF_T % 2147483647 == 1) - ? 1 : -1]; -int -main (void) -{ + CFLAGS=$ax_check_save_flags +fi +eval ac_res=\$$as_CACHEVAR + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_CACHEVAR"\" = x"yes" +then : - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" +if test ${AM_CFLAGS+y} then : - ac_cv_sys_file_offset_bits=64; break + + case " $AM_CFLAGS " in #( + *" $flag "*) : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS already contains \$flag"; } >&5 + (: AM_CFLAGS already contains $flag) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } ;; #( + *) : + + as_fn_append AM_CFLAGS " $flag" + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS=\"\$AM_CFLAGS\""; } >&5 + (: AM_CFLAGS="$AM_CFLAGS") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + ;; +esac + +else $as_nop + + AM_CFLAGS=$flag + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS=\"\$AM_CFLAGS\""; } >&5 + (: AM_CFLAGS="$AM_CFLAGS") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - ac_cv_sys_file_offset_bits=unknown - break -done + +else $as_nop + : fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5 -printf "%s\n" "$ac_cv_sys_file_offset_bits" >&6; } -case $ac_cv_sys_file_offset_bits in #( - no | unknown) ;; + +done + + ;; *) -printf "%s\n" "#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits" >>confdefs.h -;; -esac -rm -rf conftest* - if test $ac_cv_sys_file_offset_bits = unknown; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5 -printf %s "checking for _LARGE_FILES value needed for large files... " >&6; } -if test ${ac_cv_sys_large_files+y} + + + + +for flag in -std=c90; do + as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags_-Werror_$flag" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler accepts $flag" >&5 +printf %s "checking whether the C compiler accepts $flag... " >&6; } +if eval test \${$as_CACHEVAR+y} then : printf %s "(cached) " >&6 else $as_nop - while :; do + + ax_check_save_flags=$CFLAGS + if test x"$GCC" = xyes ; then + add_gnu_werror="-Werror" + fi + CFLAGS="$CFLAGS -Werror $flag $add_gnu_werror" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include - /* Check that off_t can represent 2**63 - 1 correctly. - We can't simply define LARGE_OFF_T to be 9223372036854775807, - since some C++ compilers masquerading as C compilers - incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) - int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 - && LARGE_OFF_T % 2147483647 == 1) - ? 1 : -1]; + int main (void) { @@ -19763,21 +21412,83 @@ main (void) _ACEOF if ac_fn_c_try_compile "$LINENO" then : - ac_cv_sys_large_files=no; break + eval "$as_CACHEVAR=yes" +else $as_nop + eval "$as_CACHEVAR=no" fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + CFLAGS=$ax_check_save_flags +fi +eval ac_res=\$$as_CACHEVAR + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_CACHEVAR"\" = x"yes" +then : + +if test ${AM_CFLAGS+y} +then : + + case " $AM_CFLAGS " in #( + *" $flag "*) : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS already contains \$flag"; } >&5 + (: AM_CFLAGS already contains $flag) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } ;; #( + *) : + + as_fn_append AM_CFLAGS " $flag" + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS=\"\$AM_CFLAGS\""; } >&5 + (: AM_CFLAGS="$AM_CFLAGS") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + ;; +esac + +else $as_nop + + AM_CFLAGS=$flag + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS=\"\$AM_CFLAGS\""; } >&5 + (: AM_CFLAGS="$AM_CFLAGS") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + +fi + +else $as_nop + : +fi + +done + + ;; +esac + +case $host_os in + *qnx*) + + + + +for flag in -D_QNX_SOURCE; do + as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags_-Werror_$flag" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler accepts $flag" >&5 +printf %s "checking whether the C compiler accepts $flag... " >&6; } +if eval test \${$as_CACHEVAR+y} +then : + printf %s "(cached) " >&6 +else $as_nop + + ax_check_save_flags=$CFLAGS + if test x"$GCC" = xyes ; then + add_gnu_werror="-Werror" + fi + CFLAGS="$CFLAGS -Werror $flag $add_gnu_werror" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#define _LARGE_FILES 1 -#include - /* Check that off_t can represent 2**63 - 1 correctly. - We can't simply define LARGE_OFF_T to be 9223372036854775807, - since some C++ compilers masquerading as C compilers - incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) - int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 - && LARGE_OFF_T % 2147483647 == 1) - ? 1 : -1]; + int main (void) { @@ -19788,52 +21499,79 @@ main (void) _ACEOF if ac_fn_c_try_compile "$LINENO" then : - ac_cv_sys_large_files=1; break + eval "$as_CACHEVAR=yes" +else $as_nop + eval "$as_CACHEVAR=no" fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - ac_cv_sys_large_files=unknown - break -done + CFLAGS=$ax_check_save_flags fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5 -printf "%s\n" "$ac_cv_sys_large_files" >&6; } -case $ac_cv_sys_large_files in #( - no | unknown) ;; - *) -printf "%s\n" "#define _LARGE_FILES $ac_cv_sys_large_files" >>confdefs.h -;; +eval ac_res=\$$as_CACHEVAR + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_CACHEVAR"\" = x"yes" +then : + +if test ${AM_CPPFLAGS+y} +then : + + case " $AM_CPPFLAGS " in #( + *" $flag "*) : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CPPFLAGS already contains \$flag"; } >&5 + (: AM_CPPFLAGS already contains $flag) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } ;; #( + *) : + + as_fn_append AM_CPPFLAGS " $flag" + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CPPFLAGS=\"\$AM_CPPFLAGS\""; } >&5 + (: AM_CPPFLAGS="$AM_CPPFLAGS") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + ;; esac -rm -rf conftest* - fi -fi +else $as_nop + + AM_CPPFLAGS=$flag + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CPPFLAGS=\"\$AM_CPPFLAGS\""; } >&5 + (: AM_CPPFLAGS="$AM_CPPFLAGS") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } -case $host_os in - solaris*) +fi -printf "%s\n" "#define ETC_INET 1" >>confdefs.h +else $as_nop + : +fi + +done - ;; + ;; esac -case $host_os in - solaris2*) - if test "x$GCC" = 'xyes'; then +if test "$ax_cv_c_compiler_vendor" = "intel"; then -for flag in -mimpure-text; do - as_CACHEVAR=`printf "%s\n" "ax_cv_check_ldflags__$flag" | $as_tr_sh` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the linker accepts $flag" >&5 -printf %s "checking whether the linker accepts $flag... " >&6; } +for flag in -shared-intel; do + as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$flag" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler accepts $flag" >&5 +printf %s "checking whether the C compiler accepts $flag... " >&6; } if eval test \${$as_CACHEVAR+y} then : printf %s "(cached) " >&6 else $as_nop - ax_check_save_flags=$LDFLAGS - LDFLAGS="$LDFLAGS $flag" + ax_check_save_flags=$CFLAGS + if test x"$GCC" = xyes ; then + add_gnu_werror="-Werror" + fi + CFLAGS="$CFLAGS $flag $add_gnu_werror" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -19845,15 +21583,14 @@ main (void) return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO" +if ac_fn_c_try_compile "$LINENO" then : eval "$as_CACHEVAR=yes" else $as_nop eval "$as_CACHEVAR=no" fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext - LDFLAGS=$ax_check_save_flags +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + CFLAGS=$ax_check_save_flags fi eval ac_res=\$$as_CACHEVAR { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 @@ -19861,21 +21598,21 @@ printf "%s\n" "$ac_res" >&6; } if eval test \"x\$"$as_CACHEVAR"\" = x"yes" then : -if test ${LDFLAGS+y} +if test ${AM_CFLAGS+y} then : - case " $LDFLAGS " in #( + case " $AM_CFLAGS " in #( *" $flag "*) : - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : LDFLAGS already contains \$flag"; } >&5 - (: LDFLAGS already contains $flag) 2>&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS already contains \$flag"; } >&5 + (: AM_CFLAGS already contains $flag) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } ;; #( *) : - as_fn_append LDFLAGS " $flag" - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : LDFLAGS=\"\$LDFLAGS\""; } >&5 - (: LDFLAGS="$LDFLAGS") 2>&5 + as_fn_append AM_CFLAGS " $flag" + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS=\"\$AM_CFLAGS\""; } >&5 + (: AM_CFLAGS="$AM_CFLAGS") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } @@ -19884,9 +21621,9 @@ esac else $as_nop - LDFLAGS=$flag - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : LDFLAGS=\"\$LDFLAGS\""; } >&5 - (: LDFLAGS="$LDFLAGS") 2>&5 + AM_CFLAGS=$flag + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS=\"\$AM_CFLAGS\""; } >&5 + (: AM_CFLAGS="$AM_CFLAGS") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } @@ -19899,110 +21636,292 @@ fi done - fi - ;; - *) - ;; -esac +fi -cares_use_no_undefined=no -case $host_os in - cygwin* | mingw* | pw32* | cegcc* | os2* | aix*) - cares_use_no_undefined=yes - ;; - *) - ;; -esac - if test "$cares_use_no_undefined" = 'yes'; then - CARES_USE_NO_UNDEFINED_TRUE= - CARES_USE_NO_UNDEFINED_FALSE='#' +if test "$ac_cv_native_windows" = "yes" ; then + + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 +printf %s "checking how to run the C preprocessor... " >&6; } +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if test ${ac_cv_prog_CPP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + # Double quotes because $CC needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" cpp /lib/cpp + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO" +then : + +else $as_nop + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO" +then : + # Broken: success on invalid input. +continue +else $as_nop + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok +then : + break +fi + + done + ac_cv_prog_CPP=$CPP + +fi + CPP=$ac_cv_prog_CPP else - CARES_USE_NO_UNDEFINED_TRUE='#' - CARES_USE_NO_UNDEFINED_FALSE= + ac_cv_prog_CPP=$CPP +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 +printf "%s\n" "$CPP" >&6; } +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO" +then : + +else $as_nop + # Broken: fails on valid input. +continue fi +rm -f conftest.err conftest.i conftest.$ac_ext + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO" +then : + # Broken: success on invalid input. +continue +else $as_nop + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok +then : -if test "$ac_cv_native_windows" = "yes" ; then - AM_CPPFLAGS="$AM_CPPFLAGS -D_WIN32_WINNT=0x0602 -DWIN32_LEAN_AND_MEAN" +else $as_nop + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details" "$LINENO" 5; } fi -if test "$ac_cv_native_windows" = "yes" -a "x$enable_shared" = "xyes" -a "x$enable_static" = "xyes" ; then - as_fn_error $? "Windows cannot build both static and shared simultaneously, specify --disable-shared or --disable-static" "$LINENO" 5 +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +ac_fn_c_check_header_preproc "$LINENO" "windows.h" "ac_cv_header_windows_h" +if test "x$ac_cv_header_windows_h" = xyes +then : + printf "%s\n" "#define HAVE_WINDOWS_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_preproc "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" +if test "x$ac_cv_header_winsock2_h" = xyes +then : + printf "%s\n" "#define HAVE_WINSOCK2_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_preproc "$LINENO" "ws2tcpip.h" "ac_cv_header_ws2tcpip_h" +if test "x$ac_cv_header_ws2tcpip_h" = xyes +then : + printf "%s\n" "#define HAVE_WS2TCPIP_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_preproc "$LINENO" "iphlpapi.h" "ac_cv_header_iphlpapi_h" +if test "x$ac_cv_header_iphlpapi_h" = xyes +then : + printf "%s\n" "#define HAVE_IPHLPAPI_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_preproc "$LINENO" "netioapi.h" "ac_cv_header_netioapi_h" +if test "x$ac_cv_header_netioapi_h" = xyes +then : + printf "%s\n" "#define HAVE_NETIOAPI_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_preproc "$LINENO" "ws2ipdef.h" "ac_cv_header_ws2ipdef_h" +if test "x$ac_cv_header_ws2ipdef_h" = xyes +then : + printf "%s\n" "#define HAVE_WS2IPDEF_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_preproc "$LINENO" "winternl.h" "ac_cv_header_winternl_h" +if test "x$ac_cv_header_winternl_h" = xyes +then : + printf "%s\n" "#define HAVE_WINTERNL_H 1" >>confdefs.h + fi +ac_fn_c_check_header_preproc "$LINENO" "ntdef.h" "ac_cv_header_ntdef_h" +if test "x$ac_cv_header_ntdef_h" = xyes +then : + printf "%s\n" "#define HAVE_NTDEF_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_preproc "$LINENO" "ntstatus.h" "ac_cv_header_ntstatus_h" +if test "x$ac_cv_header_ntstatus_h" = xyes +then : + printf "%s\n" "#define HAVE_NTSTATUS_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_preproc "$LINENO" "mswsock.h" "ac_cv_header_mswsock_h" +if test "x$ac_cv_header_mswsock_h" = xyes +then : + printf "%s\n" "#define HAVE_MSWSOCK_H 1" >>confdefs.h -if test "x$enable_shared" = "xno" -a "x$enable_static" = "xyes" ; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we need CARES_STATICLIB definition" >&5 -printf %s "checking whether we need CARES_STATICLIB definition... " >&6; } - if test "$ac_cv_native_windows" = "yes" ; then +fi -if test ${AM_CPPFLAGS+y} -then : - case " $AM_CPPFLAGS " in #( - *" -DCARES_STATICLIB "*) : - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CPPFLAGS already contains -DCARES_STATICLIB"; } >&5 - (: AM_CPPFLAGS already contains -DCARES_STATICLIB) 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } ;; #( - *) : + if test "$ac_cv_header_winsock2_h" = "yes"; then + LIBS="$LIBS -lws2_32 -liphlpapi" + fi +fi - as_fn_append AM_CPPFLAGS " -DCARES_STATICLIB" - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CPPFLAGS=\"\$AM_CPPFLAGS\""; } >&5 - (: AM_CPPFLAGS="$AM_CPPFLAGS") 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - ;; -esac +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing getservbyport" >&5 +printf %s "checking for library containing getservbyport... " >&6; } +if test ${ac_cv_search_getservbyport+y} +then : + printf %s "(cached) " >&6 else $as_nop + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ - AM_CPPFLAGS=-DCARES_STATICLIB - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CPPFLAGS=\"\$AM_CPPFLAGS\""; } >&5 - (: AM_CPPFLAGS="$AM_CPPFLAGS") 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char getservbyport (); +int +main (void) +{ +return getservbyport (); + ; + return 0; +} +_ACEOF +for ac_lib in '' nsl socket resolv +do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO" +then : + ac_cv_search_getservbyport=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext + if test ${ac_cv_search_getservbyport+y} +then : + break +fi +done +if test ${ac_cv_search_getservbyport+y} +then : +else $as_nop + ac_cv_search_getservbyport=no fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_getservbyport" >&5 +printf "%s\n" "$ac_cv_search_getservbyport" >&6; } +ac_res=$ac_cv_search_getservbyport +if test "$ac_res" != no +then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - PKGCONFIG_CFLAGS="-DCARES_STATICLIB" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } - else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } - fi fi -CARES_SYMBOL_HIDING_CFLAG="" -if test "$symbol_hiding" != "no" ; then - compiler_supports_symbol_hiding="no" - if test "$ac_cv_windows" = "yes" ; then - compiler_supports_symbol_hiding="yes" - else - case "$ax_cv_c_compiler_vendor" in - clang|gnu|intel) + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if libxnet is required" >&5 +printf %s "checking if libxnet is required... " >&6; } +need_xnet=no +case $host_os in + hpux*) + XNET_LIBS="" -for flag in -fvisibility=hidden; do - as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$flag" | $as_tr_sh` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler accepts $flag" >&5 -printf %s "checking whether the C compiler accepts $flag... " >&6; } +for flag in -lxnet; do + as_CACHEVAR=`printf "%s\n" "ax_cv_check_ldflags__$flag" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the linker accepts $flag" >&5 +printf %s "checking whether the linker accepts $flag... " >&6; } if eval test \${$as_CACHEVAR+y} then : printf %s "(cached) " >&6 else $as_nop - ax_check_save_flags=$CFLAGS - if test x"$GCC" = xyes ; then - add_gnu_werror="-Werror" - fi - CFLAGS="$CFLAGS $flag $add_gnu_werror" + ax_check_save_flags=$LDFLAGS + LDFLAGS="$LDFLAGS $flag" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -20014,14 +21933,15 @@ main (void) return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" +if ac_fn_c_try_link "$LINENO" then : eval "$as_CACHEVAR=yes" else $as_nop eval "$as_CACHEVAR=no" fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - CFLAGS=$ax_check_save_flags +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$ax_check_save_flags fi eval ac_res=\$$as_CACHEVAR { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 @@ -20029,21 +21949,21 @@ printf "%s\n" "$ac_res" >&6; } if eval test \"x\$"$as_CACHEVAR"\" = x"yes" then : -if test ${CARES_SYMBOL_HIDING_CFLAG+y} +if test ${XNET_LIBS+y} then : - case " $CARES_SYMBOL_HIDING_CFLAG " in #( + case " $XNET_LIBS " in #( *" $flag "*) : - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : CARES_SYMBOL_HIDING_CFLAG already contains \$flag"; } >&5 - (: CARES_SYMBOL_HIDING_CFLAG already contains $flag) 2>&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : XNET_LIBS already contains \$flag"; } >&5 + (: XNET_LIBS already contains $flag) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } ;; #( *) : - as_fn_append CARES_SYMBOL_HIDING_CFLAG " $flag" - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : CARES_SYMBOL_HIDING_CFLAG=\"\$CARES_SYMBOL_HIDING_CFLAG\""; } >&5 - (: CARES_SYMBOL_HIDING_CFLAG="$CARES_SYMBOL_HIDING_CFLAG") 2>&5 + as_fn_append XNET_LIBS " $flag" + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : XNET_LIBS=\"\$XNET_LIBS\""; } >&5 + (: XNET_LIBS="$XNET_LIBS") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } @@ -20052,9 +21972,9 @@ esac else $as_nop - CARES_SYMBOL_HIDING_CFLAG=$flag - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : CARES_SYMBOL_HIDING_CFLAG=\"\$CARES_SYMBOL_HIDING_CFLAG\""; } >&5 - (: CARES_SYMBOL_HIDING_CFLAG="$CARES_SYMBOL_HIDING_CFLAG") 2>&5 + XNET_LIBS=$flag + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : XNET_LIBS=\"\$XNET_LIBS\""; } >&5 + (: XNET_LIBS="$XNET_LIBS") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } @@ -20067,915 +21987,1342 @@ fi done - if test "x$CARES_SYMBOL_HIDING_CFLAG" != "x" ; then - compiler_supports_symbol_hiding="yes" - fi - ;; - sun) - - + if test "x$XNET_LIBS" != "x" ; then + LIBS="$LIBS $XNET_LIBS" + need_xnet=yes + fi + ;; +esac +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $need_xnet" >&5 +printf "%s\n" "$need_xnet" >&6; } +if test "x$host_vendor" = "xibm" -a "x$host_os" = "xopenedition" +then : -for flag in -xldscope=hidden; do - as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$flag" | $as_tr_sh` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler accepts $flag" >&5 -printf %s "checking whether the C compiler accepts $flag... " >&6; } -if eval test \${$as_CACHEVAR+y} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing res_init" >&5 +printf %s "checking for library containing res_init... " >&6; } +if test ${ac_cv_search_res_init+y} then : printf %s "(cached) " >&6 else $as_nop - - ax_check_save_flags=$CFLAGS - if test x"$GCC" = xyes ; then - add_gnu_werror="-Werror" - fi - CFLAGS="$CFLAGS $flag $add_gnu_werror" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char res_init (); int main (void) { - +return res_init (); ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO" +for ac_lib in '' resolv +do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO" then : - eval "$as_CACHEVAR=yes" -else $as_nop - eval "$as_CACHEVAR=no" + ac_cv_search_res_init=$ac_res fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - CFLAGS=$ax_check_save_flags +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext + if test ${ac_cv_search_res_init+y} +then : + break fi -eval ac_res=\$$as_CACHEVAR - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } -if eval test \"x\$"$as_CACHEVAR"\" = x"yes" +done +if test ${ac_cv_search_res_init+y} then : -if test ${CARES_SYMBOL_HIDING_CFLAG+y} +else $as_nop + ac_cv_search_res_init=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_res_init" >&5 +printf "%s\n" "$ac_cv_search_res_init" >&6; } +ac_res=$ac_cv_search_res_init +if test "$ac_res" != no then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - case " $CARES_SYMBOL_HIDING_CFLAG " in #( - *" $flag "*) : - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : CARES_SYMBOL_HIDING_CFLAG already contains \$flag"; } >&5 - (: CARES_SYMBOL_HIDING_CFLAG already contains $flag) 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } ;; #( - *) : - as_fn_append CARES_SYMBOL_HIDING_CFLAG " $flag" - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : CARES_SYMBOL_HIDING_CFLAG=\"\$CARES_SYMBOL_HIDING_CFLAG\""; } >&5 - (: CARES_SYMBOL_HIDING_CFLAG="$CARES_SYMBOL_HIDING_CFLAG") 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - ;; -esac +printf "%s\n" "#define CARES_USE_LIBRESOLV 1" >>confdefs.h + else $as_nop - CARES_SYMBOL_HIDING_CFLAG=$flag - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : CARES_SYMBOL_HIDING_CFLAG=\"\$CARES_SYMBOL_HIDING_CFLAG\""; } >&5 - (: CARES_SYMBOL_HIDING_CFLAG="$CARES_SYMBOL_HIDING_CFLAG") 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } + as_fn_error $? "Unable to find libresolv which is required for z/OS" "$LINENO" 5 + +fi + fi -else $as_nop - : -fi -done +if test "x$host_vendor" = "xapple" +then : - if test "x$CARES_SYMBOL_HIDING_CFLAG" != "x" ; then - compiler_supports_symbol_hiding="yes" - fi - ;; - esac - fi - if test "$compiler_supports_symbol_hiding" = "no" ; then - if test "$symbol_hiding" = "yes" ; then - as_fn_error $? "Compiler does not support symbol hiding" "$LINENO" 5 - else - symbol_hiding="no" - fi - else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for iOS minimum version 10 or later" >&5 +printf %s "checking for iOS minimum version 10 or later... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -printf "%s\n" "#define CARES_SYMBOL_HIDING 1 " >>confdefs.h - symbol_hiding="yes" - fi -fi - if test "x$symbol_hiding" = "xyes"; then - CARES_SYMBOL_HIDING_TRUE= - CARES_SYMBOL_HIDING_FALSE='#' -else - CARES_SYMBOL_HIDING_TRUE='#' - CARES_SYMBOL_HIDING_FALSE= -fi +#include +#include +#include +int +main (void) +{ +#if TARGET_OS_IPHONE == 0 || __IPHONE_OS_VERSION_MIN_REQUIRED < 100000 +#error Not iOS 10 or later +#endif +return 0; + ; + return 0; +} -if test "$enable_warnings" = "yes"; then +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + ac_cv_ios_10="yes" +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } -for flag in -Wall -Wextra -Waggregate-return -Wcast-align -Wcast-qual -Wconversion -Wdeclaration-after-statement -Wdouble-promotion -Wfloat-equal -Wformat-security -Winit-self -Wjump-misses-init -Wlogical-op -Wmissing-braces -Wmissing-declarations -Wmissing-format-attribute -Wmissing-include-dirs -Wmissing-prototypes -Wnested-externs -Wno-coverage-mismatch -Wold-style-definition -Wpacked -Wpedantic -Wpointer-arith -Wredundant-decls -Wshadow -Wsign-conversion -Wstrict-overflow -Wstrict-prototypes -Wtrampolines -Wundef -Wunreachable-code -Wunused -Wvariadic-macros -Wvla -Wwrite-strings -Werror=implicit-int -Werror=implicit-function-declaration -Werror=partial-availability -Wno-long-long ; do - as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags_-Werror_$flag" | $as_tr_sh` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler accepts $flag" >&5 -printf %s "checking whether the C compiler accepts $flag... " >&6; } -if eval test \${$as_CACHEVAR+y} +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + +fi + +if test "x$host_vendor" = "xapple" then : - printf %s "(cached) " >&6 -else $as_nop - ax_check_save_flags=$CFLAGS - if test x"$GCC" = xyes ; then - add_gnu_werror="-Werror" - fi - CFLAGS="$CFLAGS -Werror $flag $add_gnu_werror" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for macOS minimum version 10.12 or later" >&5 +printf %s "checking for macOS minimum version 10.12 or later... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ + +#include +#include +#include + int main (void) { +#ifndef MAC_OS_X_VERSION_10_12 +# define MAC_OS_X_VERSION_10_12 101200 +#endif +#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_12 +#error Not macOS 10.12 or later +#endif +return 0; + ; return 0; } + _ACEOF if ac_fn_c_try_compile "$LINENO" then : - eval "$as_CACHEVAR=yes" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + ac_cv_macos_10_12="yes" + else $as_nop - eval "$as_CACHEVAR=no" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - CFLAGS=$ax_check_save_flags + fi -eval ac_res=\$$as_CACHEVAR - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } -if eval test \"x\$"$as_CACHEVAR"\" = x"yes" + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to use libgcc" >&5 +printf %s "checking whether to use libgcc... " >&6; } +# Check whether --enable-libgcc was given. +if test ${enable_libgcc+y} then : + enableval=$enable_libgcc; case "$enableval" in + yes) + LIBS="$LIBS -lgcc" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + ;; + *) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ;; + esac +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } -if test ${AM_CFLAGS+y} +fi + + +ac_fn_c_check_header_compile "$LINENO" "malloc.h" "ac_cv_header_malloc_h" " +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_SYS_TIME_H +#include +#endif +#ifdef HAVE_ARPA_NAMESER_H +#include +#endif + +#ifdef HAVE_SYS_SOCKET_H +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif + + +" +if test "x$ac_cv_header_malloc_h" = xyes then : + printf "%s\n" "#define HAVE_MALLOC_H 1" >>confdefs.h - case " $AM_CFLAGS " in #( - *" $flag "*) : - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS already contains \$flag"; } >&5 - (: AM_CFLAGS already contains $flag) 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } ;; #( - *) : +fi +ac_fn_c_check_header_compile "$LINENO" "memory.h" "ac_cv_header_memory_h" " +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_SYS_TIME_H +#include +#endif +#ifdef HAVE_ARPA_NAMESER_H +#include +#endif - as_fn_append AM_CFLAGS " $flag" - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS=\"\$AM_CFLAGS\""; } >&5 - (: AM_CFLAGS="$AM_CFLAGS") 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - ;; -esac +#ifdef HAVE_SYS_SOCKET_H +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif -else $as_nop - AM_CFLAGS=$flag - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS=\"\$AM_CFLAGS\""; } >&5 - (: AM_CFLAGS="$AM_CFLAGS") 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } +" +if test "x$ac_cv_header_memory_h" = xyes +then : + printf "%s\n" "#define HAVE_MEMORY_H 1" >>confdefs.h fi +ac_fn_c_check_header_compile "$LINENO" "AvailabilityMacros.h" "ac_cv_header_AvailabilityMacros_h" " +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_SYS_TIME_H +#include +#endif +#ifdef HAVE_ARPA_NAMESER_H +#include +#endif + +#ifdef HAVE_SYS_SOCKET_H +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif + + +" +if test "x$ac_cv_header_AvailabilityMacros_h" = xyes +then : + printf "%s\n" "#define HAVE_AVAILABILITYMACROS_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "sys/types.h" "ac_cv_header_sys_types_h" " +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_SYS_TIME_H +#include +#endif +#ifdef HAVE_ARPA_NAMESER_H +#include +#endif + +#ifdef HAVE_SYS_SOCKET_H +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif + + +" +if test "x$ac_cv_header_sys_types_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_TYPES_H 1" >>confdefs.h -else $as_nop - : fi +ac_fn_c_check_header_compile "$LINENO" "sys/time.h" "ac_cv_header_sys_time_h" " +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_SYS_TIME_H +#include +#endif +#ifdef HAVE_ARPA_NAMESER_H +#include +#endif -done +#ifdef HAVE_SYS_SOCKET_H +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif -fi -case $host_os in - *qnx*|*android*) +" +if test "x$ac_cv_header_sys_time_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_TIME_H 1" >>confdefs.h +fi +ac_fn_c_check_header_compile "$LINENO" "sys/select.h" "ac_cv_header_sys_select_h" " +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_SYS_TIME_H +#include +#endif +#ifdef HAVE_ARPA_NAMESER_H +#include +#endif +#ifdef HAVE_SYS_SOCKET_H +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif -for flag in -std=c99; do - as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags_-Werror_$flag" | $as_tr_sh` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler accepts $flag" >&5 -printf %s "checking whether the C compiler accepts $flag... " >&6; } -if eval test \${$as_CACHEVAR+y} +" +if test "x$ac_cv_header_sys_select_h" = xyes then : - printf %s "(cached) " >&6 -else $as_nop + printf "%s\n" "#define HAVE_SYS_SELECT_H 1" >>confdefs.h - ax_check_save_flags=$CFLAGS - if test x"$GCC" = xyes ; then - add_gnu_werror="-Werror" - fi - CFLAGS="$CFLAGS -Werror $flag $add_gnu_werror" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ +fi +ac_fn_c_check_header_compile "$LINENO" "sys/socket.h" "ac_cv_header_sys_socket_h" " +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_SYS_TIME_H +#include +#endif +#ifdef HAVE_ARPA_NAMESER_H +#include +#endif -int -main (void) -{ +#ifdef HAVE_SYS_SOCKET_H +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - eval "$as_CACHEVAR=yes" -else $as_nop - eval "$as_CACHEVAR=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - CFLAGS=$ax_check_save_flags -fi -eval ac_res=\$$as_CACHEVAR - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } -if eval test \"x\$"$as_CACHEVAR"\" = x"yes" -then : -if test ${AM_CFLAGS+y} +" +if test "x$ac_cv_header_sys_socket_h" = xyes then : + printf "%s\n" "#define HAVE_SYS_SOCKET_H 1" >>confdefs.h - case " $AM_CFLAGS " in #( - *" $flag "*) : - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS already contains \$flag"; } >&5 - (: AM_CFLAGS already contains $flag) 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } ;; #( - *) : +fi +ac_fn_c_check_header_compile "$LINENO" "sys/filio.h" "ac_cv_header_sys_filio_h" " +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_SYS_TIME_H +#include +#endif +#ifdef HAVE_ARPA_NAMESER_H +#include +#endif - as_fn_append AM_CFLAGS " $flag" - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS=\"\$AM_CFLAGS\""; } >&5 - (: AM_CFLAGS="$AM_CFLAGS") 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - ;; -esac +#ifdef HAVE_SYS_SOCKET_H +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif -else $as_nop - AM_CFLAGS=$flag - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS=\"\$AM_CFLAGS\""; } >&5 - (: AM_CFLAGS="$AM_CFLAGS") 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } +" +if test "x$ac_cv_header_sys_filio_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_FILIO_H 1" >>confdefs.h fi +ac_fn_c_check_header_compile "$LINENO" "sys/ioctl.h" "ac_cv_header_sys_ioctl_h" " +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_SYS_TIME_H +#include +#endif +#ifdef HAVE_ARPA_NAMESER_H +#include +#endif -else $as_nop - : -fi +#ifdef HAVE_SYS_SOCKET_H +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif -done - ;; - *) +" +if test "x$ac_cv_header_sys_ioctl_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_IOCTL_H 1" >>confdefs.h +fi +ac_fn_c_check_header_compile "$LINENO" "sys/param.h" "ac_cv_header_sys_param_h" " +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_SYS_TIME_H +#include +#endif +#ifdef HAVE_ARPA_NAMESER_H +#include +#endif +#ifdef HAVE_SYS_SOCKET_H +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif -for flag in -std=c90; do - as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags_-Werror_$flag" | $as_tr_sh` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler accepts $flag" >&5 -printf %s "checking whether the C compiler accepts $flag... " >&6; } -if eval test \${$as_CACHEVAR+y} +" +if test "x$ac_cv_header_sys_param_h" = xyes then : - printf %s "(cached) " >&6 -else $as_nop + printf "%s\n" "#define HAVE_SYS_PARAM_H 1" >>confdefs.h - ax_check_save_flags=$CFLAGS - if test x"$GCC" = xyes ; then - add_gnu_werror="-Werror" - fi - CFLAGS="$CFLAGS -Werror $flag $add_gnu_werror" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ +fi +ac_fn_c_check_header_compile "$LINENO" "sys/uio.h" "ac_cv_header_sys_uio_h" " +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_SYS_TIME_H +#include +#endif +#ifdef HAVE_ARPA_NAMESER_H +#include +#endif -int -main (void) -{ +#ifdef HAVE_SYS_SOCKET_H +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - eval "$as_CACHEVAR=yes" -else $as_nop - eval "$as_CACHEVAR=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - CFLAGS=$ax_check_save_flags -fi -eval ac_res=\$$as_CACHEVAR - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } -if eval test \"x\$"$as_CACHEVAR"\" = x"yes" -then : -if test ${AM_CFLAGS+y} +" +if test "x$ac_cv_header_sys_uio_h" = xyes then : + printf "%s\n" "#define HAVE_SYS_UIO_H 1" >>confdefs.h - case " $AM_CFLAGS " in #( - *" $flag "*) : - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS already contains \$flag"; } >&5 - (: AM_CFLAGS already contains $flag) 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } ;; #( - *) : +fi +ac_fn_c_check_header_compile "$LINENO" "sys/random.h" "ac_cv_header_sys_random_h" " +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_SYS_TIME_H +#include +#endif +#ifdef HAVE_ARPA_NAMESER_H +#include +#endif - as_fn_append AM_CFLAGS " $flag" - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS=\"\$AM_CFLAGS\""; } >&5 - (: AM_CFLAGS="$AM_CFLAGS") 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - ;; -esac +#ifdef HAVE_SYS_SOCKET_H +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif -else $as_nop - AM_CFLAGS=$flag - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS=\"\$AM_CFLAGS\""; } >&5 - (: AM_CFLAGS="$AM_CFLAGS") 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } +" +if test "x$ac_cv_header_sys_random_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_RANDOM_H 1" >>confdefs.h fi +ac_fn_c_check_header_compile "$LINENO" "sys/event.h" "ac_cv_header_sys_event_h" " +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_SYS_TIME_H +#include +#endif +#ifdef HAVE_ARPA_NAMESER_H +#include +#endif + +#ifdef HAVE_SYS_SOCKET_H +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif + + +" +if test "x$ac_cv_header_sys_event_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_EVENT_H 1" >>confdefs.h -else $as_nop - : fi +ac_fn_c_check_header_compile "$LINENO" "sys/epoll.h" "ac_cv_header_sys_epoll_h" " +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_SYS_TIME_H +#include +#endif +#ifdef HAVE_ARPA_NAMESER_H +#include +#endif -done +#ifdef HAVE_SYS_SOCKET_H +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif - ;; -esac -case $host_os in - *qnx*) +" +if test "x$ac_cv_header_sys_epoll_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_EPOLL_H 1" >>confdefs.h +fi +ac_fn_c_check_header_compile "$LINENO" "assert.h" "ac_cv_header_assert_h" " +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_SYS_TIME_H +#include +#endif +#ifdef HAVE_ARPA_NAMESER_H +#include +#endif +#ifdef HAVE_SYS_SOCKET_H +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif -for flag in -D_QNX_SOURCE; do - as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags_-Werror_$flag" | $as_tr_sh` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler accepts $flag" >&5 -printf %s "checking whether the C compiler accepts $flag... " >&6; } -if eval test \${$as_CACHEVAR+y} +" +if test "x$ac_cv_header_assert_h" = xyes then : - printf %s "(cached) " >&6 -else $as_nop + printf "%s\n" "#define HAVE_ASSERT_H 1" >>confdefs.h - ax_check_save_flags=$CFLAGS - if test x"$GCC" = xyes ; then - add_gnu_werror="-Werror" - fi - CFLAGS="$CFLAGS -Werror $flag $add_gnu_werror" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ +fi +ac_fn_c_check_header_compile "$LINENO" "iphlpapi.h" "ac_cv_header_iphlpapi_h" " +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_SYS_TIME_H +#include +#endif +#ifdef HAVE_ARPA_NAMESER_H +#include +#endif -int -main (void) -{ +#ifdef HAVE_SYS_SOCKET_H +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" + +" +if test "x$ac_cv_header_iphlpapi_h" = xyes then : - eval "$as_CACHEVAR=yes" -else $as_nop - eval "$as_CACHEVAR=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - CFLAGS=$ax_check_save_flags + printf "%s\n" "#define HAVE_IPHLPAPI_H 1" >>confdefs.h + fi -eval ac_res=\$$as_CACHEVAR - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } -if eval test \"x\$"$as_CACHEVAR"\" = x"yes" -then : +ac_fn_c_check_header_compile "$LINENO" "netioapi.h" "ac_cv_header_netioapi_h" " +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_SYS_TIME_H +#include +#endif +#ifdef HAVE_ARPA_NAMESER_H +#include +#endif -if test ${AM_CPPFLAGS+y} +#ifdef HAVE_SYS_SOCKET_H +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif + + +" +if test "x$ac_cv_header_netioapi_h" = xyes then : + printf "%s\n" "#define HAVE_NETIOAPI_H 1" >>confdefs.h - case " $AM_CPPFLAGS " in #( - *" $flag "*) : - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CPPFLAGS already contains \$flag"; } >&5 - (: AM_CPPFLAGS already contains $flag) 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } ;; #( - *) : +fi +ac_fn_c_check_header_compile "$LINENO" "netdb.h" "ac_cv_header_netdb_h" " +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_SYS_TIME_H +#include +#endif +#ifdef HAVE_ARPA_NAMESER_H +#include +#endif - as_fn_append AM_CPPFLAGS " $flag" - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CPPFLAGS=\"\$AM_CPPFLAGS\""; } >&5 - (: AM_CPPFLAGS="$AM_CPPFLAGS") 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - ;; -esac +#ifdef HAVE_SYS_SOCKET_H +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif -else $as_nop - AM_CPPFLAGS=$flag - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CPPFLAGS=\"\$AM_CPPFLAGS\""; } >&5 - (: AM_CPPFLAGS="$AM_CPPFLAGS") 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } +" +if test "x$ac_cv_header_netdb_h" = xyes +then : + printf "%s\n" "#define HAVE_NETDB_H 1" >>confdefs.h fi +ac_fn_c_check_header_compile "$LINENO" "netinet/in.h" "ac_cv_header_netinet_in_h" " +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_SYS_TIME_H +#include +#endif +#ifdef HAVE_ARPA_NAMESER_H +#include +#endif + +#ifdef HAVE_SYS_SOCKET_H +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif + + +" +if test "x$ac_cv_header_netinet_in_h" = xyes +then : + printf "%s\n" "#define HAVE_NETINET_IN_H 1" >>confdefs.h -else $as_nop - : fi +ac_fn_c_check_header_compile "$LINENO" "netinet6/in6.h" "ac_cv_header_netinet6_in6_h" " +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_SYS_TIME_H +#include +#endif +#ifdef HAVE_ARPA_NAMESER_H +#include +#endif -done +#ifdef HAVE_SYS_SOCKET_H +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif - ;; -esac -if test "$ax_cv_c_compiler_vendor" = "intel"; then +" +if test "x$ac_cv_header_netinet6_in6_h" = xyes +then : + printf "%s\n" "#define HAVE_NETINET6_IN6_H 1" >>confdefs.h +fi +ac_fn_c_check_header_compile "$LINENO" "netinet/tcp.h" "ac_cv_header_netinet_tcp_h" " +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_SYS_TIME_H +#include +#endif +#ifdef HAVE_ARPA_NAMESER_H +#include +#endif +#ifdef HAVE_SYS_SOCKET_H +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif -for flag in -shared-intel; do - as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$flag" | $as_tr_sh` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler accepts $flag" >&5 -printf %s "checking whether the C compiler accepts $flag... " >&6; } -if eval test \${$as_CACHEVAR+y} +" +if test "x$ac_cv_header_netinet_tcp_h" = xyes then : - printf %s "(cached) " >&6 -else $as_nop + printf "%s\n" "#define HAVE_NETINET_TCP_H 1" >>confdefs.h - ax_check_save_flags=$CFLAGS - if test x"$GCC" = xyes ; then - add_gnu_werror="-Werror" - fi - CFLAGS="$CFLAGS $flag $add_gnu_werror" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ +fi +ac_fn_c_check_header_compile "$LINENO" "net/if.h" "ac_cv_header_net_if_h" " +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_SYS_TIME_H +#include +#endif +#ifdef HAVE_ARPA_NAMESER_H +#include +#endif -int -main (void) -{ +#ifdef HAVE_SYS_SOCKET_H +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - eval "$as_CACHEVAR=yes" -else $as_nop - eval "$as_CACHEVAR=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - CFLAGS=$ax_check_save_flags -fi -eval ac_res=\$$as_CACHEVAR - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } -if eval test \"x\$"$as_CACHEVAR"\" = x"yes" -then : -if test ${AM_CFLAGS+y} +" +if test "x$ac_cv_header_net_if_h" = xyes then : + printf "%s\n" "#define HAVE_NET_IF_H 1" >>confdefs.h - case " $AM_CFLAGS " in #( - *" $flag "*) : - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS already contains \$flag"; } >&5 - (: AM_CFLAGS already contains $flag) 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } ;; #( - *) : +fi +ac_fn_c_check_header_compile "$LINENO" "ifaddrs.h" "ac_cv_header_ifaddrs_h" " +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_SYS_TIME_H +#include +#endif +#ifdef HAVE_ARPA_NAMESER_H +#include +#endif - as_fn_append AM_CFLAGS " $flag" - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS=\"\$AM_CFLAGS\""; } >&5 - (: AM_CFLAGS="$AM_CFLAGS") 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - ;; -esac +#ifdef HAVE_SYS_SOCKET_H +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif -else $as_nop - AM_CFLAGS=$flag - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS=\"\$AM_CFLAGS\""; } >&5 - (: AM_CFLAGS="$AM_CFLAGS") 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } +" +if test "x$ac_cv_header_ifaddrs_h" = xyes +then : + printf "%s\n" "#define HAVE_IFADDRS_H 1" >>confdefs.h fi +ac_fn_c_check_header_compile "$LINENO" "fcntl.h" "ac_cv_header_fcntl_h" " +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_SYS_TIME_H +#include +#endif +#ifdef HAVE_ARPA_NAMESER_H +#include +#endif -else $as_nop - : -fi +#ifdef HAVE_SYS_SOCKET_H +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif -done + +" +if test "x$ac_cv_header_fcntl_h" = xyes +then : + printf "%s\n" "#define HAVE_FCNTL_H 1" >>confdefs.h fi +ac_fn_c_check_header_compile "$LINENO" "errno.h" "ac_cv_header_errno_h" " +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_SYS_TIME_H +#include +#endif +#ifdef HAVE_ARPA_NAMESER_H +#include +#endif -if test "$ac_cv_native_windows" = "yes" ; then +#ifdef HAVE_SYS_SOCKET_H +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 -printf %s "checking how to run the C preprocessor... " >&6; } -# On Suns, sometimes $CPP names a directory. -if test -n "$CPP" && test -d "$CPP"; then - CPP= -fi -if test -z "$CPP"; then - if test ${ac_cv_prog_CPP+y} -then : - printf %s "(cached) " >&6 -else $as_nop - # Double quotes because $CC needs to be expanded - for CPP in "$CC -E" "$CC -E -traditional-cpp" cpp /lib/cpp - do - ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - Syntax error -_ACEOF -if ac_fn_c_try_cpp "$LINENO" + +" +if test "x$ac_cv_header_errno_h" = xyes then : + printf "%s\n" "#define HAVE_ERRNO_H 1" >>confdefs.h -else $as_nop - # Broken: fails on valid input. -continue fi -rm -f conftest.err conftest.i conftest.$ac_ext +ac_fn_c_check_header_compile "$LINENO" "socket.h" "ac_cv_header_socket_h" " +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_SYS_TIME_H +#include +#endif +#ifdef HAVE_ARPA_NAMESER_H +#include +#endif - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if ac_fn_c_try_cpp "$LINENO" +#ifdef HAVE_SYS_SOCKET_H +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif + + +" +if test "x$ac_cv_header_socket_h" = xyes then : - # Broken: success on invalid input. -continue -else $as_nop - # Passes both tests. -ac_preproc_ok=: -break + printf "%s\n" "#define HAVE_SOCKET_H 1" >>confdefs.h + fi -rm -f conftest.err conftest.i conftest.$ac_ext +ac_fn_c_check_header_compile "$LINENO" "strings.h" "ac_cv_header_strings_h" " +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_SYS_TIME_H +#include +#endif +#ifdef HAVE_ARPA_NAMESER_H +#include +#endif -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok -then : - break -fi +#ifdef HAVE_SYS_SOCKET_H +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif - done - ac_cv_prog_CPP=$CPP -fi - CPP=$ac_cv_prog_CPP -else - ac_cv_prog_CPP=$CPP -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 -printf "%s\n" "$CPP" >&6; } -ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - Syntax error -_ACEOF -if ac_fn_c_try_cpp "$LINENO" +" +if test "x$ac_cv_header_strings_h" = xyes then : + printf "%s\n" "#define HAVE_STRINGS_H 1" >>confdefs.h -else $as_nop - # Broken: fails on valid input. -continue fi -rm -f conftest.err conftest.i conftest.$ac_ext +ac_fn_c_check_header_compile "$LINENO" "stdbool.h" "ac_cv_header_stdbool_h" " +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_SYS_TIME_H +#include +#endif +#ifdef HAVE_ARPA_NAMESER_H +#include +#endif - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if ac_fn_c_try_cpp "$LINENO" -then : - # Broken: success on invalid input. -continue -else $as_nop - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.i conftest.$ac_ext +#ifdef HAVE_SYS_SOCKET_H +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok + +" +if test "x$ac_cv_header_stdbool_h" = xyes then : + printf "%s\n" "#define HAVE_STDBOOL_H 1" >>confdefs.h -else $as_nop - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details" "$LINENO" 5; } fi +ac_fn_c_check_header_compile "$LINENO" "time.h" "ac_cv_header_time_h" " +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_SYS_TIME_H +#include +#endif +#ifdef HAVE_ARPA_NAMESER_H +#include +#endif -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu +#ifdef HAVE_SYS_SOCKET_H +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif -ac_fn_c_check_header_preproc "$LINENO" "windows.h" "ac_cv_header_windows_h" -if test "x$ac_cv_header_windows_h" = xyes +" +if test "x$ac_cv_header_time_h" = xyes then : - printf "%s\n" "#define HAVE_WINDOWS_H 1" >>confdefs.h + printf "%s\n" "#define HAVE_TIME_H 1" >>confdefs.h fi -ac_fn_c_check_header_preproc "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" -if test "x$ac_cv_header_winsock2_h" = xyes -then : - printf "%s\n" "#define HAVE_WINSOCK2_H 1" >>confdefs.h +ac_fn_c_check_header_compile "$LINENO" "poll.h" "ac_cv_header_poll_h" " +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_SYS_TIME_H +#include +#endif +#ifdef HAVE_ARPA_NAMESER_H +#include +#endif -fi -ac_fn_c_check_header_preproc "$LINENO" "ws2tcpip.h" "ac_cv_header_ws2tcpip_h" -if test "x$ac_cv_header_ws2tcpip_h" = xyes +#ifdef HAVE_SYS_SOCKET_H +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif + + +" +if test "x$ac_cv_header_poll_h" = xyes then : - printf "%s\n" "#define HAVE_WS2TCPIP_H 1" >>confdefs.h + printf "%s\n" "#define HAVE_POLL_H 1" >>confdefs.h fi -ac_fn_c_check_header_preproc "$LINENO" "iphlpapi.h" "ac_cv_header_iphlpapi_h" -if test "x$ac_cv_header_iphlpapi_h" = xyes +ac_fn_c_check_header_compile "$LINENO" "limits.h" "ac_cv_header_limits_h" " +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_SYS_TIME_H +#include +#endif +#ifdef HAVE_ARPA_NAMESER_H +#include +#endif + +#ifdef HAVE_SYS_SOCKET_H +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif + + +" +if test "x$ac_cv_header_limits_h" = xyes then : - printf "%s\n" "#define HAVE_IPHLPAPI_H 1" >>confdefs.h + printf "%s\n" "#define HAVE_LIMITS_H 1" >>confdefs.h fi -ac_fn_c_check_header_preproc "$LINENO" "netioapi.h" "ac_cv_header_netioapi_h" -if test "x$ac_cv_header_netioapi_h" = xyes +ac_fn_c_check_header_compile "$LINENO" "arpa/nameser.h" "ac_cv_header_arpa_nameser_h" " +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_SYS_TIME_H +#include +#endif +#ifdef HAVE_ARPA_NAMESER_H +#include +#endif + +#ifdef HAVE_SYS_SOCKET_H +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif + + +" +if test "x$ac_cv_header_arpa_nameser_h" = xyes then : - printf "%s\n" "#define HAVE_NETIOAPI_H 1" >>confdefs.h + printf "%s\n" "#define HAVE_ARPA_NAMESER_H 1" >>confdefs.h fi -ac_fn_c_check_header_preproc "$LINENO" "ws2ipdef.h" "ac_cv_header_ws2ipdef_h" -if test "x$ac_cv_header_ws2ipdef_h" = xyes +ac_fn_c_check_header_compile "$LINENO" "arpa/nameser_compat.h" "ac_cv_header_arpa_nameser_compat_h" " +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_SYS_TIME_H +#include +#endif +#ifdef HAVE_ARPA_NAMESER_H +#include +#endif + +#ifdef HAVE_SYS_SOCKET_H +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif + + +" +if test "x$ac_cv_header_arpa_nameser_compat_h" = xyes then : - printf "%s\n" "#define HAVE_WS2IPDEF_H 1" >>confdefs.h + printf "%s\n" "#define HAVE_ARPA_NAMESER_COMPAT_H 1" >>confdefs.h fi -ac_fn_c_check_header_preproc "$LINENO" "winternl.h" "ac_cv_header_winternl_h" -if test "x$ac_cv_header_winternl_h" = xyes +ac_fn_c_check_header_compile "$LINENO" "arpa/inet.h" "ac_cv_header_arpa_inet_h" " +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_SYS_TIME_H +#include +#endif +#ifdef HAVE_ARPA_NAMESER_H +#include +#endif + +#ifdef HAVE_SYS_SOCKET_H +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif + + +" +if test "x$ac_cv_header_arpa_inet_h" = xyes then : - printf "%s\n" "#define HAVE_WINTERNL_H 1" >>confdefs.h + printf "%s\n" "#define HAVE_ARPA_INET_H 1" >>confdefs.h fi -ac_fn_c_check_header_preproc "$LINENO" "ntdef.h" "ac_cv_header_ntdef_h" -if test "x$ac_cv_header_ntdef_h" = xyes -then : - printf "%s\n" "#define HAVE_NTDEF_H 1" >>confdefs.h +ac_fn_c_check_header_compile "$LINENO" "sys/system_properties.h" "ac_cv_header_sys_system_properties_h" " +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_SYS_TIME_H +#include +#endif +#ifdef HAVE_ARPA_NAMESER_H +#include +#endif -fi -ac_fn_c_check_header_preproc "$LINENO" "ntstatus.h" "ac_cv_header_ntstatus_h" -if test "x$ac_cv_header_ntstatus_h" = xyes -then : - printf "%s\n" "#define HAVE_NTSTATUS_H 1" >>confdefs.h +#ifdef HAVE_SYS_SOCKET_H +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif -fi -ac_fn_c_check_header_preproc "$LINENO" "mswsock.h" "ac_cv_header_mswsock_h" -if test "x$ac_cv_header_mswsock_h" = xyes + +" +if test "x$ac_cv_header_sys_system_properties_h" = xyes then : - printf "%s\n" "#define HAVE_MSWSOCK_H 1" >>confdefs.h + printf "%s\n" "#define HAVE_SYS_SYSTEM_PROPERTIES_H 1" >>confdefs.h fi - if test "$ac_cv_header_winsock2_h" = "yes"; then - LIBS="$LIBS -lws2_32 -liphlpapi" - fi -fi +cares_all_includes=" +#include +#include +#ifdef HAVE_AVAILABILITYMACROS_H +# include +#endif +#ifdef HAVE_SYS_UIO_H +# include +#endif +#ifdef HAVE_NETINET_IN_H +# include +#endif +#ifdef HAVE_TCP_H +# include +#endif +#ifdef HAVE_SYS_FILIO_H +# include +#endif +#ifdef HAVE_SYS_IOCTL_H +# include +#endif +#ifdef HAVE_UNISTD_H +# include +#endif +#ifdef HAVE_STRING_H +# include +#endif +#ifdef HAVE_STRINGS_H +# include +#endif +#ifdef HAVE_TIME_H +# include +#endif +#ifdef HAVE_SYS_TIME_H +# include +#endif +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_SYS_STAT_H +# include +#endif +#ifdef HAVE_SYS_RANDOM_H +# include +#endif +#ifdef HAVE_SYS_EVENT_H +# include +#endif +#ifdef HAVE_SYS_EPOLL_H +# include +#endif +#ifdef HAVE_SYS_SOCKET_H +# include +#endif +#ifdef HAVE_SYS_PARAM_H +# include +#endif +#ifdef HAVE_FCNTL_H +# include +#endif +#ifdef HAVE_POLL_H +# include +#endif +#ifdef HAVE_NET_IF_H +# include +#endif +#ifdef HAVE_IFADDRS_H +# include +#endif +#ifdef HAVE_NETINET_IN_H +# include +#endif +#ifdef HAVE_NETINET_TCP_H +# include +#endif +#ifdef HAVE_NETDB_H +# include +#endif +#ifdef HAVE_ARPA_INET_H +# include +#endif +#ifdef HAVE_RESOLV_H +# include +#endif +#ifdef HAVE_SYS_SYSTEM_PROPERTIES_H +# include +#endif +#ifdef HAVE_IPHLPAPI_H +# include +#endif +#ifdef HAVE_NETIOAPI_H +# include +#endif +#ifdef HAVE_WINSOCK2_H +# include +#endif +#ifdef HAVE_WS2IPDEF_H +# include +#endif +#ifdef HAVE_WS2TCPIP_H +# include +#endif +#ifdef HAVE_WINDOWS_H +# include +#endif +" -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing getservbyport" >&5 -printf %s "checking for library containing getservbyport... " >&6; } -if test ${ac_cv_search_getservbyport+y} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC options needed to detect all undeclared functions" >&5 +printf %s "checking for $CC options needed to detect all undeclared functions... " >&6; } +if test ${ac_cv_c_undeclared_builtin_options+y} then : printf %s "(cached) " >&6 else $as_nop - ac_func_search_save_LIBS=$LIBS -cat confdefs.h - <<_ACEOF >conftest.$ac_ext + ac_save_CFLAGS=$CFLAGS + ac_cv_c_undeclared_builtin_options='cannot detect' + for ac_arg in '' -fno-builtin; do + CFLAGS="$ac_save_CFLAGS $ac_arg" + # This test program should *not* compile successfully. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char getservbyport (); int main (void) { -return getservbyport (); +(void) strchr; ; return 0; } _ACEOF -for ac_lib in '' nsl socket resolv -do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - if ac_fn_c_try_link "$LINENO" +if ac_fn_c_try_compile "$LINENO" then : - ac_cv_search_getservbyport=$ac_res -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext - if test ${ac_cv_search_getservbyport+y} + +else $as_nop + # This test program should compile successfully. + # No library function is consistently available on + # freestanding implementations, so test against a dummy + # declaration. Include always-available headers on the + # off chance that they somehow elicit warnings. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include +extern void ac_decl (int, char *); + +int +main (void) +{ +(void) ac_decl (0, (char *) 0); + (void) ac_decl; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" then : - break -fi -done -if test ${ac_cv_search_getservbyport+y} + if test x"$ac_arg" = x then : - + ac_cv_c_undeclared_builtin_options='none needed' else $as_nop - ac_cv_search_getservbyport=no + ac_cv_c_undeclared_builtin_options=$ac_arg fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS + break fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_getservbyport" >&5 -printf "%s\n" "$ac_cv_search_getservbyport" >&6; } -ac_res=$ac_cv_search_getservbyport -if test "$ac_res" != no -then : - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + done + CFLAGS=$ac_save_CFLAGS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_undeclared_builtin_options" >&5 +printf "%s\n" "$ac_cv_c_undeclared_builtin_options" >&6; } + case $ac_cv_c_undeclared_builtin_options in #( + 'cannot detect') : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot make $CC report undeclared builtins +See \`config.log' for more details" "$LINENO" 5; } ;; #( + 'none needed') : + ac_c_undeclared_builtin_options='' ;; #( + *) : + ac_c_undeclared_builtin_options=$ac_cv_c_undeclared_builtin_options ;; +esac -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if libxnet is required" >&5 -printf %s "checking if libxnet is required... " >&6; } -need_xnet=no -case $host_os in - hpux*) - XNET_LIBS="" +ac_fn_check_decl "$LINENO" "HAVE_ARPA_NAMESER_H" "ac_cv_have_decl_HAVE_ARPA_NAMESER_H" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_HAVE_ARPA_NAMESER_H" = xyes +then : +cat >>confdefs.h <<_EOF +#define CARES_HAVE_ARPA_NAMESER_H 1 +_EOF +fi +ac_fn_check_decl "$LINENO" "HAVE_ARPA_NAMESER_COMPAT_H" "ac_cv_have_decl_HAVE_ARPA_NAMESER_COMPAT_H" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_HAVE_ARPA_NAMESER_COMPAT_H" = xyes +then : +cat >>confdefs.h <<_EOF +#define CARES_HAVE_ARPA_NAMESER_COMPAT_H 1 +_EOF -for flag in -lxnet; do - as_CACHEVAR=`printf "%s\n" "ax_cv_check_ldflags__$flag" | $as_tr_sh` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the linker accepts $flag" >&5 -printf %s "checking whether the linker accepts $flag... " >&6; } -if eval test \${$as_CACHEVAR+y} +fi +ac_fn_c_check_type "$LINENO" "long long" "ac_cv_type_long_long" "$ac_includes_default" +if test "x$ac_cv_type_long_long" = xyes then : - printf %s "(cached) " >&6 -else $as_nop - ax_check_save_flags=$LDFLAGS - LDFLAGS="$LDFLAGS $flag" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ +printf "%s\n" "#define HAVE_LONGLONG 1" >>confdefs.h -int -main (void) -{ +fi - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" +ac_fn_c_check_type "$LINENO" "ssize_t" "ac_cv_type_ssize_t" "$ac_includes_default" +if test "x$ac_cv_type_ssize_t" = xyes then : - eval "$as_CACHEVAR=yes" + CARES_TYPEOF_ARES_SSIZE_T=ssize_t else $as_nop - eval "$as_CACHEVAR=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext - LDFLAGS=$ax_check_save_flags + CARES_TYPEOF_ARES_SSIZE_T=int fi -eval ac_res=\$$as_CACHEVAR - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } -if eval test \"x\$"$as_CACHEVAR"\" = x"yes" -then : -if test ${XNET_LIBS+y} + +printf "%s\n" "#define CARES_TYPEOF_ARES_SSIZE_T ${CARES_TYPEOF_ARES_SSIZE_T}" >>confdefs.h + + +ac_fn_c_check_type "$LINENO" "socklen_t" "ac_cv_type_socklen_t" "$cares_all_includes + +" +if test "x$ac_cv_type_socklen_t" = xyes then : - case " $XNET_LIBS " in #( - *" $flag "*) : - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : XNET_LIBS already contains \$flag"; } >&5 - (: XNET_LIBS already contains $flag) 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } ;; #( - *) : - as_fn_append XNET_LIBS " $flag" - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : XNET_LIBS=\"\$XNET_LIBS\""; } >&5 - (: XNET_LIBS="$XNET_LIBS") 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - ;; -esac +printf "%s\n" "#define HAVE_SOCKLEN_T /**/" >>confdefs.h -else $as_nop - XNET_LIBS=$flag - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : XNET_LIBS=\"\$XNET_LIBS\""; } >&5 - (: XNET_LIBS="$XNET_LIBS") 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } +cat >>confdefs.h <<_EOF +#define CARES_TYPEOF_ARES_SOCKLEN_T socklen_t +_EOF -fi else $as_nop - : -fi -done +cat >>confdefs.h <<_EOF +#define CARES_TYPEOF_ARES_SOCKLEN_T int +_EOF - if test "x$XNET_LIBS" != "x" ; then - LIBS="$LIBS $XNET_LIBS" - need_xnet=yes - fi - ;; -esac -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $need_xnet" >&5 -printf "%s\n" "$need_xnet" >&6; } +fi -if test "x$host_vendor" = "xibm" -a "x$host_os" = "xopenedition" + +ac_fn_c_check_type "$LINENO" "SOCKET" "ac_cv_type_SOCKET" "$cares_all_includes +" +if test "x$ac_cv_type_SOCKET" = xyes then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing res_init" >&5 -printf %s "checking for library containing res_init... " >&6; } -if test ${ac_cv_search_res_init+y} +fi + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing clock_gettime" >&5 +printf %s "checking for library containing clock_gettime... " >&6; } +if test ${ac_cv_search_clock_gettime+y} then : printf %s "(cached) " >&6 else $as_nop @@ -20986,16 +23333,16 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -char res_init (); +char clock_gettime (); int main (void) { -return res_init (); +return clock_gettime (); ; return 0; } _ACEOF -for ac_lib in '' resolv +for ac_lib in '' rt posix4 do if test -z "$ac_lib"; then ac_res="none required" @@ -21005,3418 +23352,3045 @@ do fi if ac_fn_c_try_link "$LINENO" then : - ac_cv_search_res_init=$ac_res + ac_cv_search_clock_gettime=$ac_res fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext - if test ${ac_cv_search_res_init+y} + if test ${ac_cv_search_clock_gettime+y} then : break fi done -if test ${ac_cv_search_res_init+y} +if test ${ac_cv_search_clock_gettime+y} then : else $as_nop - ac_cv_search_res_init=no + ac_cv_search_clock_gettime=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_res_init" >&5 -printf "%s\n" "$ac_cv_search_res_init" >&6; } -ac_res=$ac_cv_search_res_init +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_clock_gettime" >&5 +printf "%s\n" "$ac_cv_search_clock_gettime" >&6; } +ac_res=$ac_cv_search_clock_gettime if test "$ac_res" != no then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" +fi -printf "%s\n" "#define CARES_USE_LIBRESOLV 1" >>confdefs.h -else $as_nop +ac_fn_check_decl "$LINENO" "strnlen" "ac_cv_have_decl_strnlen" "$cares_all_includes +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_strnlen" = xyes +then : - as_fn_error $? "Unable to find libresolv which is required for z/OS" "$LINENO" 5 +printf "%s\n" "#define HAVE_STRNLEN 1" >>confdefs.h fi +ac_fn_check_decl "$LINENO" "memmem" "ac_cv_have_decl_memmem" "$cares_all_includes +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_memmem" = xyes +then : +printf "%s\n" "#define HAVE_MEMMEM 1" >>confdefs.h fi - - -if test "x$host_vendor" = "xapple" +ac_fn_check_decl "$LINENO" "recv" "ac_cv_have_decl_recv" "$cares_all_includes +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_recv" = xyes then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for iOS minimum version 10 or later" >&5 -printf %s "checking for iOS minimum version 10 or later... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - -#include -#include -#include - -int -main (void) -{ - -#if TARGET_OS_IPHONE == 0 || __IPHONE_OS_VERSION_MIN_REQUIRED < 100000 -#error Not iOS 10 or later -#endif -return 0; - - ; - return 0; -} +printf "%s\n" "#define HAVE_RECV 1" >>confdefs.h -_ACEOF -if ac_fn_c_try_compile "$LINENO" +fi +ac_fn_check_decl "$LINENO" "recvfrom" "ac_cv_have_decl_recvfrom" "$cares_all_includes +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_recvfrom" = xyes then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } - ac_cv_ios_10="yes" - -else $as_nop - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } - -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +printf "%s\n" "#define HAVE_RECVFROM 1" >>confdefs.h fi - -if test "x$host_vendor" = "xapple" +ac_fn_check_decl "$LINENO" "send" "ac_cv_have_decl_send" "$cares_all_includes +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_send" = xyes then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for macOS minimum version 10.12 or later" >&5 -printf %s "checking for macOS minimum version 10.12 or later... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - -#include -#include -#include - -int -main (void) -{ - -#ifndef MAC_OS_X_VERSION_10_12 -# define MAC_OS_X_VERSION_10_12 101200 -#endif -#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_12 -#error Not macOS 10.12 or later -#endif -return 0; - - ; - return 0; -} +printf "%s\n" "#define HAVE_SEND 1" >>confdefs.h -_ACEOF -if ac_fn_c_try_compile "$LINENO" +fi +ac_fn_check_decl "$LINENO" "sendto" "ac_cv_have_decl_sendto" "$cares_all_includes +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_sendto" = xyes then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } - ac_cv_macos_10_12="yes" - -else $as_nop - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +printf "%s\n" "#define HAVE_SENDTO 1" >>confdefs.h fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +ac_fn_check_decl "$LINENO" "getnameinfo" "ac_cv_have_decl_getnameinfo" "$cares_all_includes +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_getnameinfo" = xyes +then : -fi +printf "%s\n" "#define HAVE_GETNAMEINFO 1" >>confdefs.h -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to use libgcc" >&5 -printf %s "checking whether to use libgcc... " >&6; } -# Check whether --enable-libgcc was given. -if test ${enable_libgcc+y} +fi +ac_fn_check_decl "$LINENO" "gethostname" "ac_cv_have_decl_gethostname" "$cares_all_includes +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_gethostname" = xyes then : - enableval=$enable_libgcc; case "$enableval" in - yes) - LIBS="$LIBS -lgcc" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } - ;; - *) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } - ;; - esac -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + +printf "%s\n" "#define HAVE_GETHOSTNAME 1" >>confdefs.h fi +ac_fn_check_decl "$LINENO" "connect" "ac_cv_have_decl_connect" "$cares_all_includes +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_connect" = xyes +then : +printf "%s\n" "#define HAVE_CONNECT 1" >>confdefs.h -ac_fn_c_check_header_compile "$LINENO" "malloc.h" "ac_cv_header_malloc_h" " -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_TIME_H -#include -#endif -#ifdef HAVE_ARPA_NAMESER_H -#include -#endif - -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#ifdef HAVE_NETINET_IN_H -#include -#endif +fi +ac_fn_check_decl "$LINENO" "connectx" "ac_cv_have_decl_connectx" "$cares_all_includes +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_connectx" = xyes +then : +printf "%s\n" "#define HAVE_CONNECTX 1" >>confdefs.h -" -if test "x$ac_cv_header_malloc_h" = xyes +fi +ac_fn_check_decl "$LINENO" "closesocket" "ac_cv_have_decl_closesocket" "$cares_all_includes +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_closesocket" = xyes then : - printf "%s\n" "#define HAVE_MALLOC_H 1" >>confdefs.h + +printf "%s\n" "#define HAVE_CLOSESOCKET 1" >>confdefs.h fi -ac_fn_c_check_header_compile "$LINENO" "memory.h" "ac_cv_header_memory_h" " -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_TIME_H -#include -#endif -#ifdef HAVE_ARPA_NAMESER_H -#include -#endif +ac_fn_check_decl "$LINENO" "CloseSocket" "ac_cv_have_decl_CloseSocket" "$cares_all_includes +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_CloseSocket" = xyes +then : -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#ifdef HAVE_NETINET_IN_H -#include -#endif +printf "%s\n" "#define HAVE_CLOSESOCKET_CAMEL 1" >>confdefs.h +fi +ac_fn_check_decl "$LINENO" "fcntl" "ac_cv_have_decl_fcntl" "$cares_all_includes +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_fcntl" = xyes +then : -" -if test "x$ac_cv_header_memory_h" = xyes +printf "%s\n" "#define HAVE_FCNTL 1" >>confdefs.h + +fi +ac_fn_check_decl "$LINENO" "getenv" "ac_cv_have_decl_getenv" "$cares_all_includes +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_getenv" = xyes then : - printf "%s\n" "#define HAVE_MEMORY_H 1" >>confdefs.h + +printf "%s\n" "#define HAVE_GETENV 1" >>confdefs.h fi -ac_fn_c_check_header_compile "$LINENO" "AvailabilityMacros.h" "ac_cv_header_AvailabilityMacros_h" " -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_TIME_H -#include -#endif -#ifdef HAVE_ARPA_NAMESER_H -#include -#endif +ac_fn_check_decl "$LINENO" "gethostname" "ac_cv_have_decl_gethostname" "$cares_all_includes +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_gethostname" = xyes +then : -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#ifdef HAVE_NETINET_IN_H -#include -#endif +printf "%s\n" "#define HAVE_GETHOSTNAME 1" >>confdefs.h + +fi +ac_fn_check_decl "$LINENO" "getrandom" "ac_cv_have_decl_getrandom" "$cares_all_includes +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_getrandom" = xyes +then : +printf "%s\n" "#define HAVE_GETRANDOM 1" >>confdefs.h -" -if test "x$ac_cv_header_AvailabilityMacros_h" = xyes +fi +ac_fn_check_decl "$LINENO" "getservbyport_r" "ac_cv_have_decl_getservbyport_r" "$cares_all_includes +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_getservbyport_r" = xyes then : - printf "%s\n" "#define HAVE_AVAILABILITYMACROS_H 1" >>confdefs.h + +printf "%s\n" "#define HAVE_GETSERVBYPORT_R 1" >>confdefs.h fi -ac_fn_c_check_header_compile "$LINENO" "sys/types.h" "ac_cv_header_sys_types_h" " -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_TIME_H -#include -#endif -#ifdef HAVE_ARPA_NAMESER_H -#include -#endif +ac_fn_check_decl "$LINENO" "inet_net_pton" "ac_cv_have_decl_inet_net_pton" "$cares_all_includes +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_inet_net_pton" = xyes +then : -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#ifdef HAVE_NETINET_IN_H -#include -#endif +printf "%s\n" "#define HAVE_INET_NET_PTON 1" >>confdefs.h + +fi +ac_fn_check_decl "$LINENO" "inet_ntop" "ac_cv_have_decl_inet_ntop" "$cares_all_includes +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_inet_ntop" = xyes +then : +printf "%s\n" "#define HAVE_INET_NTOP 1" >>confdefs.h -" -if test "x$ac_cv_header_sys_types_h" = xyes +fi +ac_fn_check_decl "$LINENO" "inet_pton" "ac_cv_have_decl_inet_pton" "$cares_all_includes +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_inet_pton" = xyes then : - printf "%s\n" "#define HAVE_SYS_TYPES_H 1" >>confdefs.h + +printf "%s\n" "#define HAVE_INET_PTON 1" >>confdefs.h fi -ac_fn_c_check_header_compile "$LINENO" "sys/time.h" "ac_cv_header_sys_time_h" " -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_TIME_H -#include -#endif -#ifdef HAVE_ARPA_NAMESER_H -#include -#endif +ac_fn_check_decl "$LINENO" "ioctl" "ac_cv_have_decl_ioctl" "$cares_all_includes +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_ioctl" = xyes +then : -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#ifdef HAVE_NETINET_IN_H -#include -#endif +printf "%s\n" "#define HAVE_IOCTL 1" >>confdefs.h +fi +ac_fn_check_decl "$LINENO" "ioctlsocket" "ac_cv_have_decl_ioctlsocket" "$cares_all_includes +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_ioctlsocket" = xyes +then : -" -if test "x$ac_cv_header_sys_time_h" = xyes +printf "%s\n" "#define HAVE_IOCTLSOCKET 1" >>confdefs.h + +fi +ac_fn_check_decl "$LINENO" "IoctlSocket" "ac_cv_have_decl_IoctlSocket" "$cares_all_includes +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_IoctlSocket" = xyes then : - printf "%s\n" "#define HAVE_SYS_TIME_H 1" >>confdefs.h + +printf "%s\n" "#define HAVE_IOCTLSOCKET_CAMEL 1" >>confdefs.h fi -ac_fn_c_check_header_compile "$LINENO" "sys/select.h" "ac_cv_header_sys_select_h" " -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_TIME_H -#include -#endif -#ifdef HAVE_ARPA_NAMESER_H -#include -#endif +ac_fn_check_decl "$LINENO" "setsockopt" "ac_cv_have_decl_setsockopt" "$cares_all_includes +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_setsockopt" = xyes +then : -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#ifdef HAVE_NETINET_IN_H -#include -#endif +printf "%s\n" "#define HAVE_SETSOCKOPT 1" >>confdefs.h + +fi +ac_fn_check_decl "$LINENO" "socket" "ac_cv_have_decl_socket" "$cares_all_includes +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_socket" = xyes +then : +printf "%s\n" "#define HAVE_SOCKET 1" >>confdefs.h -" -if test "x$ac_cv_header_sys_select_h" = xyes +fi +ac_fn_check_decl "$LINENO" "strcasecmp" "ac_cv_have_decl_strcasecmp" "$cares_all_includes +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_strcasecmp" = xyes then : - printf "%s\n" "#define HAVE_SYS_SELECT_H 1" >>confdefs.h + +printf "%s\n" "#define HAVE_STRCASECMP 1" >>confdefs.h fi -ac_fn_c_check_header_compile "$LINENO" "sys/socket.h" "ac_cv_header_sys_socket_h" " -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_TIME_H -#include -#endif -#ifdef HAVE_ARPA_NAMESER_H -#include -#endif +ac_fn_check_decl "$LINENO" "strdup" "ac_cv_have_decl_strdup" "$cares_all_includes +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_strdup" = xyes +then : -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#ifdef HAVE_NETINET_IN_H -#include -#endif +printf "%s\n" "#define HAVE_STRDUP 1" >>confdefs.h + +fi +ac_fn_check_decl "$LINENO" "stricmp" "ac_cv_have_decl_stricmp" "$cares_all_includes +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_stricmp" = xyes +then : +printf "%s\n" "#define HAVE_STRICMP 1" >>confdefs.h -" -if test "x$ac_cv_header_sys_socket_h" = xyes +fi +ac_fn_check_decl "$LINENO" "strncasecmp" "ac_cv_have_decl_strncasecmp" "$cares_all_includes +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_strncasecmp" = xyes then : - printf "%s\n" "#define HAVE_SYS_SOCKET_H 1" >>confdefs.h + +printf "%s\n" "#define HAVE_STRNCASECMP 1" >>confdefs.h fi -ac_fn_c_check_header_compile "$LINENO" "sys/filio.h" "ac_cv_header_sys_filio_h" " -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_TIME_H -#include -#endif -#ifdef HAVE_ARPA_NAMESER_H -#include -#endif +ac_fn_check_decl "$LINENO" "strncmpi" "ac_cv_have_decl_strncmpi" "$cares_all_includes +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_strncmpi" = xyes +then : -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#ifdef HAVE_NETINET_IN_H -#include -#endif +printf "%s\n" "#define HAVE_STRNCMPI 1" >>confdefs.h +fi +ac_fn_check_decl "$LINENO" "strnicmp" "ac_cv_have_decl_strnicmp" "$cares_all_includes +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_strnicmp" = xyes +then : -" -if test "x$ac_cv_header_sys_filio_h" = xyes +printf "%s\n" "#define HAVE_STRNICMP 1" >>confdefs.h + +fi +ac_fn_check_decl "$LINENO" "writev" "ac_cv_have_decl_writev" "$cares_all_includes +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_writev" = xyes then : - printf "%s\n" "#define HAVE_SYS_FILIO_H 1" >>confdefs.h + +printf "%s\n" "#define HAVE_WRITEV 1" >>confdefs.h fi -ac_fn_c_check_header_compile "$LINENO" "sys/ioctl.h" "ac_cv_header_sys_ioctl_h" " -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_TIME_H -#include -#endif -#ifdef HAVE_ARPA_NAMESER_H -#include -#endif +ac_fn_check_decl "$LINENO" "arc4random_buf" "ac_cv_have_decl_arc4random_buf" "$cares_all_includes +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_arc4random_buf" = xyes +then : -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#ifdef HAVE_NETINET_IN_H -#include -#endif +printf "%s\n" "#define HAVE_ARC4RANDOM_BUF 1" >>confdefs.h + +fi +ac_fn_check_decl "$LINENO" "stat" "ac_cv_have_decl_stat" "$cares_all_includes +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_stat" = xyes +then : +printf "%s\n" "#define HAVE_STAT 1" >>confdefs.h -" -if test "x$ac_cv_header_sys_ioctl_h" = xyes +fi +ac_fn_check_decl "$LINENO" "gettimeofday" "ac_cv_have_decl_gettimeofday" "$cares_all_includes +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_gettimeofday" = xyes then : - printf "%s\n" "#define HAVE_SYS_IOCTL_H 1" >>confdefs.h + +printf "%s\n" "#define HAVE_GETTIMEOFDAY 1" >>confdefs.h fi -ac_fn_c_check_header_compile "$LINENO" "sys/param.h" "ac_cv_header_sys_param_h" " -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_TIME_H -#include -#endif -#ifdef HAVE_ARPA_NAMESER_H -#include -#endif +ac_fn_check_decl "$LINENO" "clock_gettime" "ac_cv_have_decl_clock_gettime" "$cares_all_includes +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_clock_gettime" = xyes +then : -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#ifdef HAVE_NETINET_IN_H -#include -#endif +printf "%s\n" "#define HAVE_CLOCK_GETTIME 1" >>confdefs.h +fi +ac_fn_check_decl "$LINENO" "if_indextoname" "ac_cv_have_decl_if_indextoname" "$cares_all_includes +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_if_indextoname" = xyes +then : -" -if test "x$ac_cv_header_sys_param_h" = xyes +printf "%s\n" "#define HAVE_IF_INDEXTONAME 1" >>confdefs.h + +fi +ac_fn_check_decl "$LINENO" "if_nametoindex" "ac_cv_have_decl_if_nametoindex" "$cares_all_includes +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_if_nametoindex" = xyes then : - printf "%s\n" "#define HAVE_SYS_PARAM_H 1" >>confdefs.h + +printf "%s\n" "#define HAVE_IF_NAMETOINDEX 1" >>confdefs.h fi -ac_fn_c_check_header_compile "$LINENO" "sys/uio.h" "ac_cv_header_sys_uio_h" " -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_TIME_H -#include -#endif -#ifdef HAVE_ARPA_NAMESER_H -#include -#endif +ac_fn_check_decl "$LINENO" "getifaddrs" "ac_cv_have_decl_getifaddrs" "$cares_all_includes +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_getifaddrs" = xyes +then : -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#ifdef HAVE_NETINET_IN_H -#include -#endif +printf "%s\n" "#define HAVE_GETIFADDRS 1" >>confdefs.h + +fi +ac_fn_check_decl "$LINENO" "poll" "ac_cv_have_decl_poll" "$cares_all_includes +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_poll" = xyes +then : +printf "%s\n" "#define HAVE_POLL 1" >>confdefs.h -" -if test "x$ac_cv_header_sys_uio_h" = xyes +fi +ac_fn_check_decl "$LINENO" "pipe" "ac_cv_have_decl_pipe" "$cares_all_includes +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_pipe" = xyes then : - printf "%s\n" "#define HAVE_SYS_UIO_H 1" >>confdefs.h + +printf "%s\n" "#define HAVE_PIPE 1" >>confdefs.h fi -ac_fn_c_check_header_compile "$LINENO" "sys/random.h" "ac_cv_header_sys_random_h" " -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_TIME_H -#include -#endif -#ifdef HAVE_ARPA_NAMESER_H -#include -#endif +ac_fn_check_decl "$LINENO" "pipe2" "ac_cv_have_decl_pipe2" "$cares_all_includes +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_pipe2" = xyes +then : -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#ifdef HAVE_NETINET_IN_H -#include -#endif +printf "%s\n" "#define HAVE_PIPE2 1" >>confdefs.h + +fi +ac_fn_check_decl "$LINENO" "kqueue" "ac_cv_have_decl_kqueue" "$cares_all_includes +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_kqueue" = xyes +then : +printf "%s\n" "#define HAVE_KQUEUE 1" >>confdefs.h -" -if test "x$ac_cv_header_sys_random_h" = xyes +fi +ac_fn_check_decl "$LINENO" "epoll_create1" "ac_cv_have_decl_epoll_create1" "$cares_all_includes +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_epoll_create1" = xyes then : - printf "%s\n" "#define HAVE_SYS_RANDOM_H 1" >>confdefs.h + +printf "%s\n" "#define HAVE_EPOLL 1" >>confdefs.h fi -ac_fn_c_check_header_compile "$LINENO" "sys/event.h" "ac_cv_header_sys_event_h" " -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_TIME_H -#include -#endif -#ifdef HAVE_ARPA_NAMESER_H -#include -#endif +ac_fn_check_decl "$LINENO" "GetBestRoute2" "ac_cv_have_decl_GetBestRoute2" "$cares_all_includes +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_GetBestRoute2" = xyes +then : -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#ifdef HAVE_NETINET_IN_H -#include -#endif +printf "%s\n" "#define HAVE_GETBESTROUTE2 1" >>confdefs.h + +fi +ac_fn_check_decl "$LINENO" "ConvertInterfaceIndexToLuid" "ac_cv_have_decl_ConvertInterfaceIndexToLuid" "$cares_all_includes +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_ConvertInterfaceIndexToLuid" = xyes +then : +printf "%s\n" "#define HAVE_CONVERTINTERFACEINDEXTOLUID 1" >>confdefs.h -" -if test "x$ac_cv_header_sys_event_h" = xyes +fi +ac_fn_check_decl "$LINENO" "ConvertInterfaceLuidToNameA" "ac_cv_have_decl_ConvertInterfaceLuidToNameA" "$cares_all_includes +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_ConvertInterfaceLuidToNameA" = xyes then : - printf "%s\n" "#define HAVE_SYS_EVENT_H 1" >>confdefs.h + +printf "%s\n" "#define HAVE_CONVERTINTERFACELUIDTONAMEA 1" >>confdefs.h fi -ac_fn_c_check_header_compile "$LINENO" "sys/epoll.h" "ac_cv_header_sys_epoll_h" " -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_TIME_H -#include -#endif -#ifdef HAVE_ARPA_NAMESER_H -#include -#endif +ac_fn_check_decl "$LINENO" "NotifyIpInterfaceChange" "ac_cv_have_decl_NotifyIpInterfaceChange" "$cares_all_includes +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_NotifyIpInterfaceChange" = xyes +then : -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#ifdef HAVE_NETINET_IN_H -#include -#endif +printf "%s\n" "#define HAVE_NOTIFYIPINTERFACECHANGE 1" >>confdefs.h + +fi +ac_fn_check_decl "$LINENO" "RegisterWaitForSingleObject" "ac_cv_have_decl_RegisterWaitForSingleObject" "$cares_all_includes +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_RegisterWaitForSingleObject" = xyes +then : +printf "%s\n" "#define HAVE_REGISTERWAITFORSINGLEOBJECT 1" >>confdefs.h -" -if test "x$ac_cv_header_sys_epoll_h" = xyes +fi +ac_fn_check_decl "$LINENO" "__system_property_get" "ac_cv_have_decl___system_property_get" "$cares_all_includes +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl___system_property_get" = xyes then : - printf "%s\n" "#define HAVE_SYS_EPOLL_H 1" >>confdefs.h + +printf "%s\n" "#define HAVE___SYSTEM_PROPERTY_GET 1" >>confdefs.h fi -ac_fn_c_check_header_compile "$LINENO" "assert.h" "ac_cv_header_assert_h" " -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_TIME_H -#include -#endif -#ifdef HAVE_ARPA_NAMESER_H -#include -#endif -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#ifdef HAVE_NETINET_IN_H -#include -#endif -" -if test "x$ac_cv_header_assert_h" = xyes -then : - printf "%s\n" "#define HAVE_ASSERT_H 1" >>confdefs.h +if test "x$ac_cv_type_ssize_t" = "xyes" -a "x$ac_cv_type_socklen_t" = "xyes" -a "x$ac_cv_native_windows" != "xyes" ; then + recvfrom_type_retv="ssize_t" + recvfrom_type_arg3="size_t" +else + recvfrom_type_retv="int" + recvfrom_type_arg3="int" +fi +if test "x$ac_cv_type_SOCKET" = "xyes" ; then + recvfrom_type_arg1="SOCKET" +else + recvfrom_type_arg1="int" fi -ac_fn_c_check_header_compile "$LINENO" "iphlpapi.h" "ac_cv_header_iphlpapi_h" " -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_TIME_H -#include -#endif -#ifdef HAVE_ARPA_NAMESER_H -#include -#endif -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#ifdef HAVE_NETINET_IN_H -#include -#endif +if test "x$ac_cv_type_socklen_t" = "xyes" ; then + recvfrom_type_arg6="socklen_t *" + getnameinfo_type_arg2="socklen_t" + getnameinfo_type_arg46="socklen_t" +else + recvfrom_type_arg6="int *" + getnameinfo_type_arg2="int" + getnameinfo_type_arg46="int" +fi +if test "x$ac_cv_native_windows" = "xyes" ; then + recv_type_arg2="char *" +else + recv_type_arg2="void *" +fi -" -if test "x$ac_cv_header_iphlpapi_h" = xyes -then : - printf "%s\n" "#define HAVE_IPHLPAPI_H 1" >>confdefs.h +recv_type_retv=${recvfrom_type_retv} +send_type_retv=${recvfrom_type_retv} +recv_type_arg1=${recvfrom_type_arg1} +recvfrom_type_arg2=${recv_type_arg2} +send_type_arg1=${recvfrom_type_arg1} +recv_type_arg3=${recvfrom_type_arg3} +send_type_arg3=${recvfrom_type_arg3} +gethostname_type_arg2=${recvfrom_type_arg3} -fi -ac_fn_c_check_header_compile "$LINENO" "netioapi.h" "ac_cv_header_netioapi_h" " -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_TIME_H -#include -#endif -#ifdef HAVE_ARPA_NAMESER_H -#include -#endif +recvfrom_qual_arg5= +recvfrom_type_arg4=int +recvfrom_type_arg5="struct sockaddr *" +recv_type_arg4=int +getnameinfo_type_arg1="struct sockaddr *" +getnameinfo_type_arg7=int +send_type_arg2="const void *" +send_type_arg4=int -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#ifdef HAVE_NETINET_IN_H -#include -#endif +printf "%s\n" "#define RECVFROM_TYPE_RETV ${recvfrom_type_retv} " >>confdefs.h -" -if test "x$ac_cv_header_netioapi_h" = xyes -then : - printf "%s\n" "#define HAVE_NETIOAPI_H 1" >>confdefs.h -fi -ac_fn_c_check_header_compile "$LINENO" "netdb.h" "ac_cv_header_netdb_h" " -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_TIME_H -#include -#endif -#ifdef HAVE_ARPA_NAMESER_H -#include -#endif +printf "%s\n" "#define RECVFROM_TYPE_ARG1 ${recvfrom_type_arg1} " >>confdefs.h -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#ifdef HAVE_NETINET_IN_H -#include -#endif +printf "%s\n" "#define RECVFROM_TYPE_ARG2 ${recvfrom_type_arg2} " >>confdefs.h -" -if test "x$ac_cv_header_netdb_h" = xyes -then : - printf "%s\n" "#define HAVE_NETDB_H 1" >>confdefs.h -fi -ac_fn_c_check_header_compile "$LINENO" "netinet/in.h" "ac_cv_header_netinet_in_h" " -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_TIME_H -#include -#endif -#ifdef HAVE_ARPA_NAMESER_H -#include -#endif +printf "%s\n" "#define RECVFROM_TYPE_ARG3 ${recvfrom_type_arg3} " >>confdefs.h -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#ifdef HAVE_NETINET_IN_H -#include -#endif +printf "%s\n" "#define RECVFROM_TYPE_ARG4 ${recvfrom_type_arg4} " >>confdefs.h -" -if test "x$ac_cv_header_netinet_in_h" = xyes -then : - printf "%s\n" "#define HAVE_NETINET_IN_H 1" >>confdefs.h -fi -ac_fn_c_check_header_compile "$LINENO" "netinet6/in6.h" "ac_cv_header_netinet6_in6_h" " -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_TIME_H -#include -#endif -#ifdef HAVE_ARPA_NAMESER_H -#include -#endif +printf "%s\n" "#define RECVFROM_TYPE_ARG5 ${recvfrom_type_arg5} " >>confdefs.h -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#ifdef HAVE_NETINET_IN_H -#include -#endif +printf "%s\n" "#define RECVFROM_QUAL_ARG5 ${recvfrom_qual_arg5}" >>confdefs.h -" -if test "x$ac_cv_header_netinet6_in6_h" = xyes -then : - printf "%s\n" "#define HAVE_NETINET6_IN6_H 1" >>confdefs.h -fi -ac_fn_c_check_header_compile "$LINENO" "netinet/tcp.h" "ac_cv_header_netinet_tcp_h" " -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_TIME_H -#include -#endif -#ifdef HAVE_ARPA_NAMESER_H -#include -#endif -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#ifdef HAVE_NETINET_IN_H -#include -#endif +printf "%s\n" "#define RECV_TYPE_RETV ${recv_type_retv} " >>confdefs.h -" -if test "x$ac_cv_header_netinet_tcp_h" = xyes -then : - printf "%s\n" "#define HAVE_NETINET_TCP_H 1" >>confdefs.h +printf "%s\n" "#define RECV_TYPE_ARG1 ${recv_type_arg1} " >>confdefs.h -fi -ac_fn_c_check_header_compile "$LINENO" "net/if.h" "ac_cv_header_net_if_h" " -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_TIME_H -#include -#endif -#ifdef HAVE_ARPA_NAMESER_H -#include -#endif -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#ifdef HAVE_NETINET_IN_H -#include -#endif +printf "%s\n" "#define RECV_TYPE_ARG2 ${recv_type_arg2} " >>confdefs.h -" -if test "x$ac_cv_header_net_if_h" = xyes -then : - printf "%s\n" "#define HAVE_NET_IF_H 1" >>confdefs.h +printf "%s\n" "#define RECV_TYPE_ARG3 ${recv_type_arg3} " >>confdefs.h -fi -ac_fn_c_check_header_compile "$LINENO" "ifaddrs.h" "ac_cv_header_ifaddrs_h" " -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_TIME_H -#include -#endif -#ifdef HAVE_ARPA_NAMESER_H -#include -#endif -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#ifdef HAVE_NETINET_IN_H -#include -#endif +printf "%s\n" "#define RECV_TYPE_ARG4 ${recv_type_arg4} " >>confdefs.h -" -if test "x$ac_cv_header_ifaddrs_h" = xyes -then : - printf "%s\n" "#define HAVE_IFADDRS_H 1" >>confdefs.h -fi -ac_fn_c_check_header_compile "$LINENO" "fcntl.h" "ac_cv_header_fcntl_h" " -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_TIME_H -#include -#endif -#ifdef HAVE_ARPA_NAMESER_H -#include -#endif +printf "%s\n" "#define SEND_TYPE_RETV ${send_type_retv} " >>confdefs.h + -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#ifdef HAVE_NETINET_IN_H -#include -#endif +printf "%s\n" "#define SEND_TYPE_ARG1 ${send_type_arg1} " >>confdefs.h -" -if test "x$ac_cv_header_fcntl_h" = xyes -then : - printf "%s\n" "#define HAVE_FCNTL_H 1" >>confdefs.h +printf "%s\n" "#define SEND_TYPE_ARG2 ${send_type_arg2} " >>confdefs.h -fi -ac_fn_c_check_header_compile "$LINENO" "errno.h" "ac_cv_header_errno_h" " -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_TIME_H -#include -#endif -#ifdef HAVE_ARPA_NAMESER_H -#include -#endif -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#ifdef HAVE_NETINET_IN_H -#include -#endif +printf "%s\n" "#define SEND_TYPE_ARG3 ${send_type_arg3} " >>confdefs.h -" -if test "x$ac_cv_header_errno_h" = xyes -then : - printf "%s\n" "#define HAVE_ERRNO_H 1" >>confdefs.h +printf "%s\n" "#define SEND_TYPE_ARG4 ${send_type_arg4} " >>confdefs.h -fi -ac_fn_c_check_header_compile "$LINENO" "socket.h" "ac_cv_header_socket_h" " -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_TIME_H -#include -#endif -#ifdef HAVE_ARPA_NAMESER_H -#include -#endif -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#ifdef HAVE_NETINET_IN_H -#include -#endif +printf "%s\n" "#define GETNAMEINFO_TYPE_ARG1 ${getnameinfo_type_arg1} " >>confdefs.h -" -if test "x$ac_cv_header_socket_h" = xyes -then : - printf "%s\n" "#define HAVE_SOCKET_H 1" >>confdefs.h -fi -ac_fn_c_check_header_compile "$LINENO" "strings.h" "ac_cv_header_strings_h" " -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_TIME_H -#include -#endif -#ifdef HAVE_ARPA_NAMESER_H -#include -#endif +printf "%s\n" "#define GETNAMEINFO_TYPE_ARG2 ${getnameinfo_type_arg2} " >>confdefs.h -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#ifdef HAVE_NETINET_IN_H -#include -#endif +printf "%s\n" "#define GETNAMEINFO_TYPE_ARG7 ${getnameinfo_type_arg7} " >>confdefs.h -" -if test "x$ac_cv_header_strings_h" = xyes -then : - printf "%s\n" "#define HAVE_STRINGS_H 1" >>confdefs.h -fi -ac_fn_c_check_header_compile "$LINENO" "stdbool.h" "ac_cv_header_stdbool_h" " -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_TIME_H -#include -#endif -#ifdef HAVE_ARPA_NAMESER_H -#include -#endif +printf "%s\n" "#define GETNAMEINFO_TYPE_ARG46 ${getnameinfo_type_arg46} " >>confdefs.h -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#ifdef HAVE_NETINET_IN_H -#include -#endif -" -if test "x$ac_cv_header_stdbool_h" = xyes -then : - printf "%s\n" "#define HAVE_STDBOOL_H 1" >>confdefs.h +printf "%s\n" "#define GETHOSTNAME_TYPE_ARG2 ${gethostname_type_arg2} " >>confdefs.h -fi -ac_fn_c_check_header_compile "$LINENO" "time.h" "ac_cv_header_time_h" " -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_TIME_H -#include -#endif -#ifdef HAVE_ARPA_NAMESER_H -#include -#endif -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#ifdef HAVE_NETINET_IN_H -#include -#endif +if test "$ac_cv_have_decl_getservbyport_r" = "yes" ; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking number of arguments for getservbyport_r()" >&5 +printf %s "checking number of arguments for getservbyport_r()... " >&6; } + getservbyport_r_args=6 + case $host_os in + solaris*) + getservbyport_r_args=5 + ;; + aix*|openbsd*) + getservbyport_r_args=4 + ;; + esac + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $getservbyport_r_args" >&5 +printf "%s\n" "$getservbyport_r_args" >&6; } -" -if test "x$ac_cv_header_time_h" = xyes -then : - printf "%s\n" "#define HAVE_TIME_H 1" >>confdefs.h +printf "%s\n" "#define GETSERVBYPORT_R_ARGS $getservbyport_r_args " >>confdefs.h fi -ac_fn_c_check_header_compile "$LINENO" "poll.h" "ac_cv_header_poll_h" " -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_TIME_H -#include -#endif -#ifdef HAVE_ARPA_NAMESER_H -#include -#endif -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#ifdef HAVE_NETINET_IN_H -#include -#endif +if test "$ac_cv_have_decl_getservbyname_r" = "yes" ; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking number of arguments for getservbyname_r()" >&5 +printf %s "checking number of arguments for getservbyname_r()... " >&6; } + getservbyname_r_args=6 + case $host_os in + solaris*) + getservbyname_r_args=5 + ;; + aix*|openbsd*) + getservbyname_r_args=4 + ;; + esac + +printf "%s\n" "#define GETSERVBYNAME_R_ARGS $getservbyname_r_args " >>confdefs.h + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $getservbyname_r_args" >&5 +printf "%s\n" "$getservbyname_r_args" >&6; } +fi -" -if test "x$ac_cv_header_poll_h" = xyes +ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" +if test "x$ac_cv_type_size_t" = xyes then : - printf "%s\n" "#define HAVE_POLL_H 1" >>confdefs.h -fi -ac_fn_c_check_header_compile "$LINENO" "limits.h" "ac_cv_header_limits_h" " -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_TIME_H -#include -#endif -#ifdef HAVE_ARPA_NAMESER_H -#include -#endif +else $as_nop -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#ifdef HAVE_NETINET_IN_H -#include -#endif +printf "%s\n" "#define size_t unsigned int" >>confdefs.h +fi -" -if test "x$ac_cv_header_limits_h" = xyes +ac_fn_check_decl "$LINENO" "AF_INET6" "ac_cv_have_decl_AF_INET6" "$cares_all_includes +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_AF_INET6" = xyes then : - printf "%s\n" "#define HAVE_LIMITS_H 1" >>confdefs.h -fi -ac_fn_c_check_header_compile "$LINENO" "arpa/nameser.h" "ac_cv_header_arpa_nameser_h" " -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_TIME_H -#include -#endif -#ifdef HAVE_ARPA_NAMESER_H -#include -#endif +printf "%s\n" "#define HAVE_AF_INET6 1" >>confdefs.h -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#ifdef HAVE_NETINET_IN_H -#include -#endif +fi +ac_fn_check_decl "$LINENO" "PF_INET6" "ac_cv_have_decl_PF_INET6" "$cares_all_includes +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_PF_INET6" = xyes +then : +printf "%s\n" "#define HAVE_PF_INET6 1" >>confdefs.h +fi +ac_fn_c_check_type "$LINENO" "struct in6_addr" "ac_cv_type_struct_in6_addr" "$cares_all_includes " -if test "x$ac_cv_header_arpa_nameser_h" = xyes +if test "x$ac_cv_type_struct_in6_addr" = xyes then : - printf "%s\n" "#define HAVE_ARPA_NAMESER_H 1" >>confdefs.h + +printf "%s\n" "#define HAVE_STRUCT_IN6_ADDR 1" >>confdefs.h + fi -ac_fn_c_check_header_compile "$LINENO" "arpa/nameser_compat.h" "ac_cv_header_arpa_nameser_compat_h" " -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_TIME_H -#include -#endif -#ifdef HAVE_ARPA_NAMESER_H -#include -#endif -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#ifdef HAVE_NETINET_IN_H -#include -#endif +ac_fn_c_check_type "$LINENO" "struct sockaddr_in6" "ac_cv_type_struct_sockaddr_in6" "$cares_all_includes +" +if test "x$ac_cv_type_struct_sockaddr_in6" = xyes +then : + +printf "%s\n" "#define HAVE_STRUCT_SOCKADDR_IN6 1" >>confdefs.h + +fi +ac_fn_c_check_type "$LINENO" "struct sockaddr_storage" "ac_cv_type_struct_sockaddr_storage" "$cares_all_includes " -if test "x$ac_cv_header_arpa_nameser_compat_h" = xyes +if test "x$ac_cv_type_struct_sockaddr_storage" = xyes then : - printf "%s\n" "#define HAVE_ARPA_NAMESER_COMPAT_H 1" >>confdefs.h -fi -ac_fn_c_check_header_compile "$LINENO" "arpa/inet.h" "ac_cv_header_arpa_inet_h" " -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_TIME_H -#include -#endif -#ifdef HAVE_ARPA_NAMESER_H -#include -#endif +printf "%s\n" "#define HAVE_STRUCT_SOCKADDR_STORAGE 1" >>confdefs.h -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#ifdef HAVE_NETINET_IN_H -#include -#endif +fi +ac_fn_c_check_type "$LINENO" "struct addrinfo" "ac_cv_type_struct_addrinfo" "$cares_all_includes " -if test "x$ac_cv_header_arpa_inet_h" = xyes +if test "x$ac_cv_type_struct_addrinfo" = xyes then : - printf "%s\n" "#define HAVE_ARPA_INET_H 1" >>confdefs.h -fi -ac_fn_c_check_header_compile "$LINENO" "sys/system_properties.h" "ac_cv_header_sys_system_properties_h" " -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_TIME_H -#include -#endif -#ifdef HAVE_ARPA_NAMESER_H -#include -#endif +printf "%s\n" "#define HAVE_STRUCT_ADDRINFO 1" >>confdefs.h -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#ifdef HAVE_NETINET_IN_H -#include -#endif +fi +ac_fn_c_check_type "$LINENO" "struct timeval" "ac_cv_type_struct_timeval" "$cares_all_includes " -if test "x$ac_cv_header_sys_system_properties_h" = xyes +if test "x$ac_cv_type_struct_timeval" = xyes then : - printf "%s\n" "#define HAVE_SYS_SYSTEM_PROPERTIES_H 1" >>confdefs.h -fi +printf "%s\n" "#define HAVE_STRUCT_TIMEVAL 1" >>confdefs.h +fi -cares_all_includes=" -#include -#include -#ifdef HAVE_AVAILABILITYMACROS_H -# include -#endif -#ifdef HAVE_SYS_UIO_H -# include -#endif -#ifdef HAVE_NETINET_IN_H -# include -#endif -#ifdef HAVE_TCP_H -# include -#endif -#ifdef HAVE_SYS_FILIO_H -# include -#endif -#ifdef HAVE_SYS_IOCTL_H -# include -#endif -#ifdef HAVE_UNISTD_H -# include -#endif -#ifdef HAVE_STRING_H -# include -#endif -#ifdef HAVE_STRINGS_H -# include -#endif -#ifdef HAVE_TIME_H -# include -#endif -#ifdef HAVE_SYS_TIME_H -# include -#endif -#ifdef HAVE_SYS_TYPES_H -# include -#endif -#ifdef HAVE_SYS_STAT_H -# include -#endif -#ifdef HAVE_SYS_RANDOM_H -# include -#endif -#ifdef HAVE_SYS_EVENT_H -# include -#endif -#ifdef HAVE_SYS_EPOLL_H -# include -#endif -#ifdef HAVE_SYS_SOCKET_H -# include -#endif -#ifdef HAVE_SYS_PARAM_H -# include -#endif -#ifdef HAVE_FCNTL_H -# include -#endif -#ifdef HAVE_POLL_H -# include -#endif -#ifdef HAVE_NET_IF_H -# include -#endif -#ifdef HAVE_IFADDRS_H -# include -#endif -#ifdef HAVE_NETINET_IN_H -# include -#endif -#ifdef HAVE_NETINET_TCP_H -# include -#endif -#ifdef HAVE_NETDB_H -# include -#endif -#ifdef HAVE_ARPA_INET_H -# include -#endif -#ifdef HAVE_RESOLV_H -# include -#endif -#ifdef HAVE_SYS_SYSTEM_PROPERTIES_H -# include -#endif -#ifdef HAVE_IPHLPAPI_H -# include -#endif -#ifdef HAVE_NETIOAPI_H -# include -#endif -#ifdef HAVE_WINSOCK2_H -# include -#endif -#ifdef HAVE_WS2IPDEF_H -# include -#endif -#ifdef HAVE_WS2TCPIP_H -# include -#endif -#ifdef HAVE_WINDOWS_H -# include -#endif +ac_fn_c_check_member "$LINENO" "struct sockaddr_in6" "sin6_scope_id" "ac_cv_member_struct_sockaddr_in6_sin6_scope_id" "$cares_all_includes " +if test "x$ac_cv_member_struct_sockaddr_in6_sin6_scope_id" = xyes +then : -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC options needed to detect all undeclared functions" >&5 -printf %s "checking for $CC options needed to detect all undeclared functions... " >&6; } -if test ${ac_cv_c_undeclared_builtin_options+y} +printf "%s\n" "#define HAVE_STRUCT_SOCKADDR_IN6_SIN6_SCOPE_ID 1" >>confdefs.h + + +fi + +ac_fn_c_check_member "$LINENO" "struct addrinfo" "ai_flags" "ac_cv_member_struct_addrinfo_ai_flags" "$cares_all_includes +" +if test "x$ac_cv_member_struct_addrinfo_ai_flags" = xyes then : - printf %s "(cached) " >&6 -else $as_nop - ac_save_CFLAGS=$CFLAGS - ac_cv_c_undeclared_builtin_options='cannot detect' - for ac_arg in '' -fno-builtin; do - CFLAGS="$ac_save_CFLAGS $ac_arg" - # This test program should *not* compile successfully. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int -main (void) -{ -(void) strchr; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" +printf "%s\n" "#define HAVE_STRUCT_ADDRINFO_AI_FLAGS 1" >>confdefs.h + + +fi + +ac_fn_check_decl "$LINENO" "FIONBIO" "ac_cv_have_decl_FIONBIO" "$cares_all_includes +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_FIONBIO" = xyes then : -else $as_nop - # This test program should compile successfully. - # No library function is consistently available on - # freestanding implementations, so test against a dummy - # declaration. Include always-available headers on the - # off chance that they somehow elicit warnings. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#include -#include -extern void ac_decl (int, char *); +fi +ac_fn_check_decl "$LINENO" "O_NONBLOCK" "ac_cv_have_decl_O_NONBLOCK" "$cares_all_includes +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_O_NONBLOCK" = xyes +then : -int -main (void) -{ -(void) ac_decl (0, (char *) 0); - (void) ac_decl; +fi +ac_fn_check_decl "$LINENO" "SO_NONBLOCK" "ac_cv_have_decl_SO_NONBLOCK" "$cares_all_includes +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_SO_NONBLOCK" = xyes +then : - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" +fi +ac_fn_check_decl "$LINENO" "MSG_NOSIGNAL" "ac_cv_have_decl_MSG_NOSIGNAL" "$cares_all_includes +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_MSG_NOSIGNAL" = xyes then : - if test x"$ac_arg" = x + +fi +ac_fn_check_decl "$LINENO" "CLOCK_MONOTONIC" "ac_cv_have_decl_CLOCK_MONOTONIC" "$cares_all_includes +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_CLOCK_MONOTONIC" = xyes then : - ac_cv_c_undeclared_builtin_options='none needed' -else $as_nop - ac_cv_c_undeclared_builtin_options=$ac_arg + +fi + +if test "$ac_cv_have_decl_CLOCK_MONOTONIC" = "yes" -a "$ac_cv_have_decl_clock_gettime" = "yes" ; then + +printf "%s\n" "#define HAVE_CLOCK_GETTIME_MONOTONIC 1 " >>confdefs.h + +fi + +if test "$ac_cv_have_decl_FIONBIO" = "yes" -a "$ac_cv_have_decl_ioctl" = "yes" ; then + +printf "%s\n" "#define HAVE_IOCTL_FIONBIO 1 " >>confdefs.h + fi - break +if test "$ac_cv_have_decl_FIONBIO" = "yes" -a "$ac_cv_have_decl_ioctlsocket" = "yes" ; then + +printf "%s\n" "#define HAVE_IOCTLSOCKET_FIONBIO 1 " >>confdefs.h + fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +if test "$ac_cv_have_decl_SO_NONBLOCK" = "yes" -a "$ac_cv_have_decl_setsockopt" = "yes" ; then + +printf "%s\n" "#define HAVE_SETSOCKOPT_SO_NONBLOCK 1 " >>confdefs.h + fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - done - CFLAGS=$ac_save_CFLAGS +if test "$ac_cv_have_decl_O_NONBLOCK" = "yes" -a "$ac_cv_have_decl_fcntl" = "yes" ; then + +printf "%s\n" "#define HAVE_FCNTL_O_NONBLOCK 1 " >>confdefs.h fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_undeclared_builtin_options" >&5 -printf "%s\n" "$ac_cv_c_undeclared_builtin_options" >&6; } - case $ac_cv_c_undeclared_builtin_options in #( - 'cannot detect') : - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot make $CC report undeclared builtins -See \`config.log' for more details" "$LINENO" 5; } ;; #( - 'none needed') : - ac_c_undeclared_builtin_options='' ;; #( - *) : - ac_c_undeclared_builtin_options=$ac_cv_c_undeclared_builtin_options ;; -esac -ac_fn_check_decl "$LINENO" "HAVE_ARPA_NAMESER_H" "ac_cv_have_decl_HAVE_ARPA_NAMESER_H" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" -if test "x$ac_cv_have_decl_HAVE_ARPA_NAMESER_H" = xyes -then : +if test "x$ac_cv_header_sys_types_h" = "xyes" ; then cat >>confdefs.h <<_EOF -#define CARES_HAVE_ARPA_NAMESER_H 1 +#define CARES_HAVE_SYS_TYPES_H 1 _EOF fi -ac_fn_check_decl "$LINENO" "HAVE_ARPA_NAMESER_COMPAT_H" "ac_cv_have_decl_HAVE_ARPA_NAMESER_COMPAT_H" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" -if test "x$ac_cv_have_decl_HAVE_ARPA_NAMESER_COMPAT_H" = xyes -then : +if test "x$ac_cv_header_sys_socket_h" = "xyes" ; then cat >>confdefs.h <<_EOF -#define CARES_HAVE_ARPA_NAMESER_COMPAT_H 1 +#define CARES_HAVE_SYS_SOCKET_H 1 _EOF fi -ac_fn_c_check_type "$LINENO" "long long" "ac_cv_type_long_long" "$ac_includes_default" -if test "x$ac_cv_type_long_long" = xyes -then : - -printf "%s\n" "#define HAVE_LONGLONG 1" >>confdefs.h +if test "x$ac_cv_header_sys_select_h" = "xyes" ; then -fi +cat >>confdefs.h <<_EOF +#define CARES_HAVE_SYS_SELECT_H 1 +_EOF -ac_fn_c_check_type "$LINENO" "ssize_t" "ac_cv_type_ssize_t" "$ac_includes_default" -if test "x$ac_cv_type_ssize_t" = xyes -then : - CARES_TYPEOF_ARES_SSIZE_T=ssize_t -else $as_nop - CARES_TYPEOF_ARES_SSIZE_T=int fi +if test "x$ac_cv_header_ws2tcpip_h" = "xyes" ; then +cat >>confdefs.h <<_EOF +#define CARES_HAVE_WS2TCPIP_H 1 +_EOF -printf "%s\n" "#define CARES_TYPEOF_ARES_SSIZE_T ${CARES_TYPEOF_ARES_SSIZE_T}" >>confdefs.h - - -ac_fn_c_check_type "$LINENO" "socklen_t" "ac_cv_type_socklen_t" "$cares_all_includes +fi +if test "x$ac_cv_header_winsock2_h" = "xyes" ; then -" -if test "x$ac_cv_type_socklen_t" = xyes -then : +cat >>confdefs.h <<_EOF +#define CARES_HAVE_WINSOCK2_H 1 +_EOF +fi +if test "x$ac_cv_header_windows_h" = "xyes" ; then -printf "%s\n" "#define HAVE_SOCKLEN_T /**/" >>confdefs.h +cat >>confdefs.h <<_EOF +#define CARES_HAVE_WINDOWS_H 1 +_EOF +fi +if test "x$ac_cv_header_arpa_nameser_h" = "xyes" ; then cat >>confdefs.h <<_EOF -#define CARES_TYPEOF_ARES_SOCKLEN_T socklen_t +#define CARES_HAVE_ARPA_NAMESER_H 1 _EOF - -else $as_nop +fi +if test "x$ac_cv_header_arpa_nameser_compa_h" = "xyes" ; then cat >>confdefs.h <<_EOF -#define CARES_TYPEOF_ARES_SOCKLEN_T int +#define CARES_HAVE_ARPA_NAMESER_COMPA_H 1 _EOF fi -ac_fn_c_check_type "$LINENO" "SOCKET" "ac_cv_type_SOCKET" "$cares_all_includes -" -if test "x$ac_cv_type_SOCKET" = xyes -then : -fi +if test "${CARES_THREADS}" = "yes" -a "x${ac_cv_native_windows}" != "xyes" ; then -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing clock_gettime" >&5 -printf %s "checking for library containing clock_gettime... " >&6; } -if test ${ac_cv_search_clock_gettime+y} + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +ax_pthread_ok=no + +# We used to check for pthread.h first, but this fails if pthread.h +# requires special compiler flags (e.g. on Tru64 or Sequent). +# It gets checked for in the link test anyway. + +# First of all, check if the user has set any of the PTHREAD_LIBS, +# etcetera environment variables, and if threads linking works using +# them: +if test "x$PTHREAD_CFLAGS$PTHREAD_LIBS" != "x"; then + ax_pthread_save_CC="$CC" + ax_pthread_save_CFLAGS="$CFLAGS" + ax_pthread_save_LIBS="$LIBS" + if test "x$PTHREAD_CC" != "x" then : - printf %s "(cached) " >&6 -else $as_nop - ac_func_search_save_LIBS=$LIBS -cat confdefs.h - <<_ACEOF >conftest.$ac_ext + CC="$PTHREAD_CC" +fi + if test "x$PTHREAD_CXX" != "x" +then : + CXX="$PTHREAD_CXX" +fi + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + LIBS="$PTHREAD_LIBS $LIBS" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pthread_join using $CC $PTHREAD_CFLAGS $PTHREAD_LIBS" >&5 +printf %s "checking for pthread_join using $CC $PTHREAD_CFLAGS $PTHREAD_LIBS... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -char clock_gettime (); +char pthread_join (); int main (void) { -return clock_gettime (); +return pthread_join (); ; return 0; } _ACEOF -for ac_lib in '' rt posix4 -do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - if ac_fn_c_try_link "$LINENO" +if ac_fn_c_try_link "$LINENO" then : - ac_cv_search_clock_gettime=$ac_res + ax_pthread_ok=yes fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext - if test ${ac_cv_search_clock_gettime+y} -then : - break + conftest$ac_exeext conftest.$ac_ext + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_ok" >&5 +printf "%s\n" "$ax_pthread_ok" >&6; } + if test "x$ax_pthread_ok" = "xno"; then + PTHREAD_LIBS="" + PTHREAD_CFLAGS="" + fi + CC="$ax_pthread_save_CC" + CFLAGS="$ax_pthread_save_CFLAGS" + LIBS="$ax_pthread_save_LIBS" fi -done -if test ${ac_cv_search_clock_gettime+y} -then : -else $as_nop - ac_cv_search_clock_gettime=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_clock_gettime" >&5 -printf "%s\n" "$ac_cv_search_clock_gettime" >&6; } -ac_res=$ac_cv_search_clock_gettime -if test "$ac_res" != no -then : - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" +# We must check for the threads library under a number of different +# names; the ordering is very important because some systems +# (e.g. DEC) have both -lpthread and -lpthreads, where one of the +# libraries is broken (non-POSIX). + +# Create a list of thread flags to try. Items with a "," contain both +# C compiler flags (before ",") and linker flags (after ","). Other items +# starting with a "-" are C compiler flags, and remaining items are +# library names, except for "none" which indicates that we try without +# any flags at all, and "pthread-config" which is a program returning +# the flags for the Pth emulation library. + +ax_pthread_flags="pthreads none -Kthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config" + +# The ordering *is* (sometimes) important. Some notes on the +# individual items follow: + +# pthreads: AIX (must check this before -lpthread) +# none: in case threads are in libc; should be tried before -Kthread and +# other compiler flags to prevent continual compiler warnings +# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h) +# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads), Tru64 +# (Note: HP C rejects this with "bad form for `-t' option") +# -pthreads: Solaris/gcc (Note: HP C also rejects) +# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it +# doesn't hurt to check since this sometimes defines pthreads and +# -D_REENTRANT too), HP C (must be checked before -lpthread, which +# is present but should not be used directly; and before -mthreads, +# because the compiler interprets this as "-mt" + "-hreads") +# -mthreads: Mingw32/gcc, Lynx/gcc +# pthread: Linux, etcetera +# --thread-safe: KAI C++ +# pthread-config: use pthread-config program (for GNU Pth library) + +case $host_os in + + freebsd*|midnightbsd*) + + # -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able) + # lthread: LinuxThreads port on FreeBSD (also preferred to -pthread) + + ax_pthread_flags="-kthread lthread $ax_pthread_flags" + ;; + + hpux*) + + # From the cc(1) man page: "[-mt] Sets various -D flags to enable + # multi-threading and also sets -lpthread." + + ax_pthread_flags="-mt -pthread pthread $ax_pthread_flags" + ;; + + openedition*) + + # IBM z/OS requires a feature-test macro to be defined in order to + # enable POSIX threads at all, so give the user a hint if this is + # not set. (We don't define these ourselves, as they can affect + # other portions of the system API in unpredictable ways.) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +# if !defined(_OPEN_THREADS) && !defined(_UNIX03_THREADS) + AX_PTHREAD_ZOS_MISSING +# endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "AX_PTHREAD_ZOS_MISSING" >/dev/null 2>&1 +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: IBM z/OS requires -D_OPEN_THREADS or -D_UNIX03_THREADS to enable pthreads support." >&5 +printf "%s\n" "$as_me: WARNING: IBM z/OS requires -D_OPEN_THREADS or -D_UNIX03_THREADS to enable pthreads support." >&2;} fi +rm -rf conftest* + + ;; + solaris*) + # On Solaris (at least, for some versions), libc contains stubbed + # (non-functional) versions of the pthreads routines, so link-based + # tests will erroneously succeed. (N.B.: The stubs are missing + # pthread_cleanup_push, or rather a function called by this macro, + # so we could check for that, but who knows whether they'll stub + # that too in a future libc.) So we'll check first for the + # standard Solaris way of linking pthreads (-mt -lpthread). -ac_fn_check_decl "$LINENO" "strnlen" "ac_cv_have_decl_strnlen" "$cares_all_includes -" "$ac_c_undeclared_builtin_options" "CFLAGS" -if test "x$ac_cv_have_decl_strnlen" = xyes -then : + ax_pthread_flags="-mt,-lpthread pthread $ax_pthread_flags" + ;; +esac -printf "%s\n" "#define HAVE_STRNLEN 1" >>confdefs.h +# Are we compiling with Clang? -fi -ac_fn_check_decl "$LINENO" "memmem" "ac_cv_have_decl_memmem" "$cares_all_includes -" "$ac_c_undeclared_builtin_options" "CFLAGS" -if test "x$ac_cv_have_decl_memmem" = xyes +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC is Clang" >&5 +printf %s "checking whether $CC is Clang... " >&6; } +if test ${ax_cv_PTHREAD_CLANG+y} then : + printf %s "(cached) " >&6 +else $as_nop + ax_cv_PTHREAD_CLANG=no + # Note that Autoconf sets GCC=yes for Clang as well as GCC + if test "x$GCC" = "xyes"; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Note: Clang 2.7 lacks __clang_[a-z]+__ */ +# if defined(__clang__) && defined(__llvm__) + AX_PTHREAD_CC_IS_CLANG +# endif -printf "%s\n" "#define HAVE_MEMMEM 1" >>confdefs.h - -fi -ac_fn_check_decl "$LINENO" "recv" "ac_cv_have_decl_recv" "$cares_all_includes -" "$ac_c_undeclared_builtin_options" "CFLAGS" -if test "x$ac_cv_have_decl_recv" = xyes +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "AX_PTHREAD_CC_IS_CLANG" >/dev/null 2>&1 then : - -printf "%s\n" "#define HAVE_RECV 1" >>confdefs.h - + ax_cv_PTHREAD_CLANG=yes fi -ac_fn_check_decl "$LINENO" "recvfrom" "ac_cv_have_decl_recvfrom" "$cares_all_includes -" "$ac_c_undeclared_builtin_options" "CFLAGS" -if test "x$ac_cv_have_decl_recvfrom" = xyes -then : +rm -rf conftest* -printf "%s\n" "#define HAVE_RECVFROM 1" >>confdefs.h + fi fi -ac_fn_check_decl "$LINENO" "send" "ac_cv_have_decl_send" "$cares_all_includes -" "$ac_c_undeclared_builtin_options" "CFLAGS" -if test "x$ac_cv_have_decl_send" = xyes -then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_CLANG" >&5 +printf "%s\n" "$ax_cv_PTHREAD_CLANG" >&6; } +ax_pthread_clang="$ax_cv_PTHREAD_CLANG" -printf "%s\n" "#define HAVE_SEND 1" >>confdefs.h -fi -ac_fn_check_decl "$LINENO" "sendto" "ac_cv_have_decl_sendto" "$cares_all_includes -" "$ac_c_undeclared_builtin_options" "CFLAGS" -if test "x$ac_cv_have_decl_sendto" = xyes -then : +# GCC generally uses -pthread, or -pthreads on some platforms (e.g. SPARC) -printf "%s\n" "#define HAVE_SENDTO 1" >>confdefs.h +# Note that for GCC and Clang -pthread generally implies -lpthread, +# except when -nostdlib is passed. +# This is problematic using libtool to build C++ shared libraries with pthread: +# [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=25460 +# [2] https://bugzilla.redhat.com/show_bug.cgi?id=661333 +# [3] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=468555 +# To solve this, first try -pthread together with -lpthread for GCC -fi -ac_fn_check_decl "$LINENO" "getnameinfo" "ac_cv_have_decl_getnameinfo" "$cares_all_includes -" "$ac_c_undeclared_builtin_options" "CFLAGS" -if test "x$ac_cv_have_decl_getnameinfo" = xyes +if test "x$GCC" = "xyes" then : - -printf "%s\n" "#define HAVE_GETNAMEINFO 1" >>confdefs.h - + ax_pthread_flags="-pthread,-lpthread -pthread -pthreads $ax_pthread_flags" fi -ac_fn_check_decl "$LINENO" "gethostname" "ac_cv_have_decl_gethostname" "$cares_all_includes -" "$ac_c_undeclared_builtin_options" "CFLAGS" -if test "x$ac_cv_have_decl_gethostname" = xyes -then : -printf "%s\n" "#define HAVE_GETHOSTNAME 1" >>confdefs.h +# Clang takes -pthread (never supported any other flag), but we'll try with -lpthread first -fi -ac_fn_check_decl "$LINENO" "connect" "ac_cv_have_decl_connect" "$cares_all_includes -" "$ac_c_undeclared_builtin_options" "CFLAGS" -if test "x$ac_cv_have_decl_connect" = xyes +if test "x$ax_pthread_clang" = "xyes" then : + ax_pthread_flags="-pthread,-lpthread -pthread" +fi -printf "%s\n" "#define HAVE_CONNECT 1" >>confdefs.h -fi -ac_fn_check_decl "$LINENO" "connectx" "ac_cv_have_decl_connectx" "$cares_all_includes -" "$ac_c_undeclared_builtin_options" "CFLAGS" -if test "x$ac_cv_have_decl_connectx" = xyes -then : +# The presence of a feature test macro requesting re-entrant function +# definitions is, on some systems, a strong hint that pthreads support is +# correctly enabled -printf "%s\n" "#define HAVE_CONNECTX 1" >>confdefs.h +case $host_os in + darwin* | hpux* | linux* | osf* | solaris*) + ax_pthread_check_macro="_REENTRANT" + ;; -fi -ac_fn_check_decl "$LINENO" "closesocket" "ac_cv_have_decl_closesocket" "$cares_all_includes -" "$ac_c_undeclared_builtin_options" "CFLAGS" -if test "x$ac_cv_have_decl_closesocket" = xyes + aix*) + ax_pthread_check_macro="_THREAD_SAFE" + ;; + + *) + ax_pthread_check_macro="--" + ;; +esac +if test "x$ax_pthread_check_macro" = "x--" then : + ax_pthread_check_cond=0 +else $as_nop + ax_pthread_check_cond="!defined($ax_pthread_check_macro)" +fi -printf "%s\n" "#define HAVE_CLOSESOCKET 1" >>confdefs.h -fi -ac_fn_check_decl "$LINENO" "CloseSocket" "ac_cv_have_decl_CloseSocket" "$cares_all_includes -" "$ac_c_undeclared_builtin_options" "CFLAGS" -if test "x$ac_cv_have_decl_CloseSocket" = xyes -then : +if test "x$ax_pthread_ok" = "xno"; then +for ax_pthread_try_flag in $ax_pthread_flags; do -printf "%s\n" "#define HAVE_CLOSESOCKET_CAMEL 1" >>confdefs.h + case $ax_pthread_try_flag in + none) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether pthreads work without any flags" >&5 +printf %s "checking whether pthreads work without any flags... " >&6; } + ;; -fi -ac_fn_check_decl "$LINENO" "fcntl" "ac_cv_have_decl_fcntl" "$cares_all_includes -" "$ac_c_undeclared_builtin_options" "CFLAGS" -if test "x$ac_cv_have_decl_fcntl" = xyes -then : + *,*) + PTHREAD_CFLAGS=`echo $ax_pthread_try_flag | sed "s/^\(.*\),\(.*\)$/\1/"` + PTHREAD_LIBS=`echo $ax_pthread_try_flag | sed "s/^\(.*\),\(.*\)$/\2/"` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether pthreads work with \"$PTHREAD_CFLAGS\" and \"$PTHREAD_LIBS\"" >&5 +printf %s "checking whether pthreads work with \"$PTHREAD_CFLAGS\" and \"$PTHREAD_LIBS\"... " >&6; } + ;; -printf "%s\n" "#define HAVE_FCNTL 1" >>confdefs.h + -*) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether pthreads work with $ax_pthread_try_flag" >&5 +printf %s "checking whether pthreads work with $ax_pthread_try_flag... " >&6; } + PTHREAD_CFLAGS="$ax_pthread_try_flag" + ;; -fi -ac_fn_check_decl "$LINENO" "getenv" "ac_cv_have_decl_getenv" "$cares_all_includes -" "$ac_c_undeclared_builtin_options" "CFLAGS" -if test "x$ac_cv_have_decl_getenv" = xyes + pthread-config) + # Extract the first word of "pthread-config", so it can be a program name with args. +set dummy pthread-config; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ax_pthread_config+y} then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ax_pthread_config"; then + ac_cv_prog_ax_pthread_config="$ax_pthread_config" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ax_pthread_config="yes" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS -printf "%s\n" "#define HAVE_GETENV 1" >>confdefs.h - + test -z "$ac_cv_prog_ax_pthread_config" && ac_cv_prog_ax_pthread_config="no" +fi +fi +ax_pthread_config=$ac_cv_prog_ax_pthread_config +if test -n "$ax_pthread_config"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_config" >&5 +printf "%s\n" "$ax_pthread_config" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -ac_fn_check_decl "$LINENO" "gethostname" "ac_cv_have_decl_gethostname" "$cares_all_includes -" "$ac_c_undeclared_builtin_options" "CFLAGS" -if test "x$ac_cv_have_decl_gethostname" = xyes -then : -printf "%s\n" "#define HAVE_GETHOSTNAME 1" >>confdefs.h -fi -ac_fn_check_decl "$LINENO" "getrandom" "ac_cv_have_decl_getrandom" "$cares_all_includes -" "$ac_c_undeclared_builtin_options" "CFLAGS" -if test "x$ac_cv_have_decl_getrandom" = xyes + if test "x$ax_pthread_config" = "xno" then : + continue +fi + PTHREAD_CFLAGS="`pthread-config --cflags`" + PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`" + ;; -printf "%s\n" "#define HAVE_GETRANDOM 1" >>confdefs.h + *) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for the pthreads library -l$ax_pthread_try_flag" >&5 +printf %s "checking for the pthreads library -l$ax_pthread_try_flag... " >&6; } + PTHREAD_LIBS="-l$ax_pthread_try_flag" + ;; + esac -fi -ac_fn_check_decl "$LINENO" "getservbyport_r" "ac_cv_have_decl_getservbyport_r" "$cares_all_includes -" "$ac_c_undeclared_builtin_options" "CFLAGS" -if test "x$ac_cv_have_decl_getservbyport_r" = xyes -then : + ax_pthread_save_CFLAGS="$CFLAGS" + ax_pthread_save_LIBS="$LIBS" + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + LIBS="$PTHREAD_LIBS $LIBS" -printf "%s\n" "#define HAVE_GETSERVBYPORT_R 1" >>confdefs.h + # Check for various functions. We must include pthread.h, + # since some functions may be macros. (On the Sequent, we + # need a special flag -Kthread to make this header compile.) + # We check for pthread_join because it is in -lpthread on IRIX + # while pthread_create is in libc. We check for pthread_attr_init + # due to DEC craziness with -lpthreads. We check for + # pthread_cleanup_push because it is one of the few pthread + # functions on Solaris that doesn't have a non-functional libc stub. + # We try pthread_create on general principles. -fi -ac_fn_check_decl "$LINENO" "inet_net_pton" "ac_cv_have_decl_inet_net_pton" "$cares_all_includes -" "$ac_c_undeclared_builtin_options" "CFLAGS" -if test "x$ac_cv_have_decl_inet_net_pton" = xyes + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +# if $ax_pthread_check_cond +# error "$ax_pthread_check_macro must be defined" +# endif + static void *some_global = NULL; + static void routine(void *a) + { + /* To avoid any unused-parameter or + unused-but-set-parameter warning. */ + some_global = a; + } + static void *start_routine(void *a) { return a; } +int +main (void) +{ +pthread_t th; pthread_attr_t attr; + pthread_create(&th, 0, start_routine, 0); + pthread_join(th, 0); + pthread_attr_init(&attr); + pthread_cleanup_push(routine, 0); + pthread_cleanup_pop(0) /* ; */ + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" then : - -printf "%s\n" "#define HAVE_INET_NET_PTON 1" >>confdefs.h - + ax_pthread_ok=yes fi -ac_fn_check_decl "$LINENO" "inet_ntop" "ac_cv_have_decl_inet_ntop" "$cares_all_includes -" "$ac_c_undeclared_builtin_options" "CFLAGS" -if test "x$ac_cv_have_decl_inet_ntop" = xyes -then : +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext -printf "%s\n" "#define HAVE_INET_NTOP 1" >>confdefs.h + CFLAGS="$ax_pthread_save_CFLAGS" + LIBS="$ax_pthread_save_LIBS" -fi -ac_fn_check_decl "$LINENO" "inet_pton" "ac_cv_have_decl_inet_pton" "$cares_all_includes -" "$ac_c_undeclared_builtin_options" "CFLAGS" -if test "x$ac_cv_have_decl_inet_pton" = xyes + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_ok" >&5 +printf "%s\n" "$ax_pthread_ok" >&6; } + if test "x$ax_pthread_ok" = "xyes" then : - -printf "%s\n" "#define HAVE_INET_PTON 1" >>confdefs.h - + break fi -ac_fn_check_decl "$LINENO" "ioctl" "ac_cv_have_decl_ioctl" "$cares_all_includes -" "$ac_c_undeclared_builtin_options" "CFLAGS" -if test "x$ac_cv_have_decl_ioctl" = xyes -then : - -printf "%s\n" "#define HAVE_IOCTL 1" >>confdefs.h + PTHREAD_LIBS="" + PTHREAD_CFLAGS="" +done fi -ac_fn_check_decl "$LINENO" "ioctlsocket" "ac_cv_have_decl_ioctlsocket" "$cares_all_includes -" "$ac_c_undeclared_builtin_options" "CFLAGS" -if test "x$ac_cv_have_decl_ioctlsocket" = xyes -then : -printf "%s\n" "#define HAVE_IOCTLSOCKET 1" >>confdefs.h -fi -ac_fn_check_decl "$LINENO" "IoctlSocket" "ac_cv_have_decl_IoctlSocket" "$cares_all_includes -" "$ac_c_undeclared_builtin_options" "CFLAGS" -if test "x$ac_cv_have_decl_IoctlSocket" = xyes -then : +# Clang needs special handling, because older versions handle the -pthread +# option in a rather... idiosyncratic way -printf "%s\n" "#define HAVE_IOCTLSOCKET_CAMEL 1" >>confdefs.h +if test "x$ax_pthread_clang" = "xyes"; then -fi -ac_fn_check_decl "$LINENO" "setsockopt" "ac_cv_have_decl_setsockopt" "$cares_all_includes -" "$ac_c_undeclared_builtin_options" "CFLAGS" -if test "x$ac_cv_have_decl_setsockopt" = xyes -then : + # Clang takes -pthread; it has never supported any other flag -printf "%s\n" "#define HAVE_SETSOCKOPT 1" >>confdefs.h + # (Note 1: This will need to be revisited if a system that Clang + # supports has POSIX threads in a separate library. This tends not + # to be the way of modern systems, but it's conceivable.) -fi -ac_fn_check_decl "$LINENO" "socket" "ac_cv_have_decl_socket" "$cares_all_includes -" "$ac_c_undeclared_builtin_options" "CFLAGS" -if test "x$ac_cv_have_decl_socket" = xyes -then : + # (Note 2: On some systems, notably Darwin, -pthread is not needed + # to get POSIX threads support; the API is always present and + # active. We could reasonably leave PTHREAD_CFLAGS empty. But + # -pthread does define _REENTRANT, and while the Darwin headers + # ignore this macro, third-party headers might not.) -printf "%s\n" "#define HAVE_SOCKET 1" >>confdefs.h + # However, older versions of Clang make a point of warning the user + # that, in an invocation where only linking and no compilation is + # taking place, the -pthread option has no effect ("argument unused + # during compilation"). They expect -pthread to be passed in only + # when source code is being compiled. + # + # Problem is, this is at odds with the way Automake and most other + # C build frameworks function, which is that the same flags used in + # compilation (CFLAGS) are also used in linking. Many systems + # supported by AX_PTHREAD require exactly this for POSIX threads + # support, and in fact it is often not straightforward to specify a + # flag that is used only in the compilation phase and not in + # linking. Such a scenario is extremely rare in practice. + # + # Even though use of the -pthread flag in linking would only print + # a warning, this can be a nuisance for well-run software projects + # that build with -Werror. So if the active version of Clang has + # this misfeature, we search for an option to squash it. -fi -ac_fn_check_decl "$LINENO" "strcasecmp" "ac_cv_have_decl_strcasecmp" "$cares_all_includes -" "$ac_c_undeclared_builtin_options" "CFLAGS" -if test "x$ac_cv_have_decl_strcasecmp" = xyes + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether Clang needs flag to prevent \"argument unused\" warning when linking with -pthread" >&5 +printf %s "checking whether Clang needs flag to prevent \"argument unused\" warning when linking with -pthread... " >&6; } +if test ${ax_cv_PTHREAD_CLANG_NO_WARN_FLAG+y} then : - -printf "%s\n" "#define HAVE_STRCASECMP 1" >>confdefs.h - -fi -ac_fn_check_decl "$LINENO" "strdup" "ac_cv_have_decl_strdup" "$cares_all_includes -" "$ac_c_undeclared_builtin_options" "CFLAGS" -if test "x$ac_cv_have_decl_strdup" = xyes + printf %s "(cached) " >&6 +else $as_nop + ax_cv_PTHREAD_CLANG_NO_WARN_FLAG=unknown + # Create an alternate version of $ac_link that compiles and + # links in two steps (.c -> .o, .o -> exe) instead of one + # (.c -> exe), because the warning occurs only in the second + # step + ax_pthread_save_ac_link="$ac_link" + ax_pthread_sed='s/conftest\.\$ac_ext/conftest.$ac_objext/g' + ax_pthread_link_step=`printf "%s\n" "$ac_link" | sed "$ax_pthread_sed"` + ax_pthread_2step_ac_link="($ac_compile) && (echo ==== >&5) && ($ax_pthread_link_step)" + ax_pthread_save_CFLAGS="$CFLAGS" + for ax_pthread_try in '' -Qunused-arguments -Wno-unused-command-line-argument unknown; do + if test "x$ax_pthread_try" = "xunknown" then : - -printf "%s\n" "#define HAVE_STRDUP 1" >>confdefs.h - + break fi -ac_fn_check_decl "$LINENO" "stricmp" "ac_cv_have_decl_stricmp" "$cares_all_includes -" "$ac_c_undeclared_builtin_options" "CFLAGS" -if test "x$ac_cv_have_decl_stricmp" = xyes + CFLAGS="-Werror -Wunknown-warning-option $ax_pthread_try -pthread $ax_pthread_save_CFLAGS" + ac_link="$ax_pthread_save_ac_link" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int main(void){return 0;} +_ACEOF +if ac_fn_c_try_link "$LINENO" then : - -printf "%s\n" "#define HAVE_STRICMP 1" >>confdefs.h - -fi -ac_fn_check_decl "$LINENO" "strncasecmp" "ac_cv_have_decl_strncasecmp" "$cares_all_includes -" "$ac_c_undeclared_builtin_options" "CFLAGS" -if test "x$ac_cv_have_decl_strncasecmp" = xyes + ac_link="$ax_pthread_2step_ac_link" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int main(void){return 0;} +_ACEOF +if ac_fn_c_try_link "$LINENO" then : - -printf "%s\n" "#define HAVE_STRNCASECMP 1" >>confdefs.h - + break fi -ac_fn_check_decl "$LINENO" "strncmpi" "ac_cv_have_decl_strncmpi" "$cares_all_includes -" "$ac_c_undeclared_builtin_options" "CFLAGS" -if test "x$ac_cv_have_decl_strncmpi" = xyes -then : - -printf "%s\n" "#define HAVE_STRNCMPI 1" >>confdefs.h +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext fi -ac_fn_check_decl "$LINENO" "strnicmp" "ac_cv_have_decl_strnicmp" "$cares_all_includes -" "$ac_c_undeclared_builtin_options" "CFLAGS" -if test "x$ac_cv_have_decl_strnicmp" = xyes +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + done + ac_link="$ax_pthread_save_ac_link" + CFLAGS="$ax_pthread_save_CFLAGS" + if test "x$ax_pthread_try" = "x" then : - -printf "%s\n" "#define HAVE_STRNICMP 1" >>confdefs.h - + ax_pthread_try=no fi -ac_fn_check_decl "$LINENO" "writev" "ac_cv_have_decl_writev" "$cares_all_includes -" "$ac_c_undeclared_builtin_options" "CFLAGS" -if test "x$ac_cv_have_decl_writev" = xyes -then : - -printf "%s\n" "#define HAVE_WRITEV 1" >>confdefs.h + ax_cv_PTHREAD_CLANG_NO_WARN_FLAG="$ax_pthread_try" fi -ac_fn_check_decl "$LINENO" "arc4random_buf" "ac_cv_have_decl_arc4random_buf" "$cares_all_includes -" "$ac_c_undeclared_builtin_options" "CFLAGS" -if test "x$ac_cv_have_decl_arc4random_buf" = xyes -then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" >&5 +printf "%s\n" "$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" >&6; } -printf "%s\n" "#define HAVE_ARC4RANDOM_BUF 1" >>confdefs.h + case "$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" in + no | unknown) ;; + *) PTHREAD_CFLAGS="$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG $PTHREAD_CFLAGS" ;; + esac -fi -ac_fn_check_decl "$LINENO" "stat" "ac_cv_have_decl_stat" "$cares_all_includes -" "$ac_c_undeclared_builtin_options" "CFLAGS" -if test "x$ac_cv_have_decl_stat" = xyes -then : +fi # $ax_pthread_clang = yes -printf "%s\n" "#define HAVE_STAT 1" >>confdefs.h -fi -ac_fn_check_decl "$LINENO" "gettimeofday" "ac_cv_have_decl_gettimeofday" "$cares_all_includes -" "$ac_c_undeclared_builtin_options" "CFLAGS" -if test "x$ac_cv_have_decl_gettimeofday" = xyes -then : -printf "%s\n" "#define HAVE_GETTIMEOFDAY 1" >>confdefs.h +# Various other checks: +if test "x$ax_pthread_ok" = "xyes"; then + ax_pthread_save_CFLAGS="$CFLAGS" + ax_pthread_save_LIBS="$LIBS" + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + LIBS="$PTHREAD_LIBS $LIBS" -fi -ac_fn_check_decl "$LINENO" "clock_gettime" "ac_cv_have_decl_clock_gettime" "$cares_all_includes -" "$ac_c_undeclared_builtin_options" "CFLAGS" -if test "x$ac_cv_have_decl_clock_gettime" = xyes + # Detect AIX lossage: JOINABLE attribute is called UNDETACHED. + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for joinable pthread attribute" >&5 +printf %s "checking for joinable pthread attribute... " >&6; } +if test ${ax_cv_PTHREAD_JOINABLE_ATTR+y} then : - -printf "%s\n" "#define HAVE_CLOCK_GETTIME 1" >>confdefs.h - -fi -ac_fn_check_decl "$LINENO" "if_indextoname" "ac_cv_have_decl_if_indextoname" "$cares_all_includes -" "$ac_c_undeclared_builtin_options" "CFLAGS" -if test "x$ac_cv_have_decl_if_indextoname" = xyes + printf %s "(cached) " >&6 +else $as_nop + ax_cv_PTHREAD_JOINABLE_ATTR=unknown + for ax_pthread_attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main (void) +{ +int attr = $ax_pthread_attr; return attr /* ; */ + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" then : - -printf "%s\n" "#define HAVE_IF_INDEXTONAME 1" >>confdefs.h - + ax_cv_PTHREAD_JOINABLE_ATTR=$ax_pthread_attr; break fi -ac_fn_check_decl "$LINENO" "if_nametoindex" "ac_cv_have_decl_if_nametoindex" "$cares_all_includes -" "$ac_c_undeclared_builtin_options" "CFLAGS" -if test "x$ac_cv_have_decl_if_nametoindex" = xyes -then : - -printf "%s\n" "#define HAVE_IF_NAMETOINDEX 1" >>confdefs.h +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + done fi -ac_fn_check_decl "$LINENO" "getifaddrs" "ac_cv_have_decl_getifaddrs" "$cares_all_includes -" "$ac_c_undeclared_builtin_options" "CFLAGS" -if test "x$ac_cv_have_decl_getifaddrs" = xyes +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_JOINABLE_ATTR" >&5 +printf "%s\n" "$ax_cv_PTHREAD_JOINABLE_ATTR" >&6; } + if test "x$ax_cv_PTHREAD_JOINABLE_ATTR" != "xunknown" && \ + test "x$ax_cv_PTHREAD_JOINABLE_ATTR" != "xPTHREAD_CREATE_JOINABLE" && \ + test "x$ax_pthread_joinable_attr_defined" != "xyes" then : -printf "%s\n" "#define HAVE_GETIFADDRS 1" >>confdefs.h - -fi -ac_fn_check_decl "$LINENO" "poll" "ac_cv_have_decl_poll" "$cares_all_includes -" "$ac_c_undeclared_builtin_options" "CFLAGS" -if test "x$ac_cv_have_decl_poll" = xyes -then : +printf "%s\n" "#define PTHREAD_CREATE_JOINABLE $ax_cv_PTHREAD_JOINABLE_ATTR" >>confdefs.h -printf "%s\n" "#define HAVE_POLL 1" >>confdefs.h + ax_pthread_joinable_attr_defined=yes fi -ac_fn_check_decl "$LINENO" "pipe" "ac_cv_have_decl_pipe" "$cares_all_includes -" "$ac_c_undeclared_builtin_options" "CFLAGS" -if test "x$ac_cv_have_decl_pipe" = xyes -then : -printf "%s\n" "#define HAVE_PIPE 1" >>confdefs.h - -fi -ac_fn_check_decl "$LINENO" "pipe2" "ac_cv_have_decl_pipe2" "$cares_all_includes -" "$ac_c_undeclared_builtin_options" "CFLAGS" -if test "x$ac_cv_have_decl_pipe2" = xyes + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether more special flags are required for pthreads" >&5 +printf %s "checking whether more special flags are required for pthreads... " >&6; } +if test ${ax_cv_PTHREAD_SPECIAL_FLAGS+y} then : - -printf "%s\n" "#define HAVE_PIPE2 1" >>confdefs.h + printf %s "(cached) " >&6 +else $as_nop + ax_cv_PTHREAD_SPECIAL_FLAGS=no + case $host_os in + solaris*) + ax_cv_PTHREAD_SPECIAL_FLAGS="-D_POSIX_PTHREAD_SEMANTICS" + ;; + esac fi -ac_fn_check_decl "$LINENO" "kqueue" "ac_cv_have_decl_kqueue" "$cares_all_includes -" "$ac_c_undeclared_builtin_options" "CFLAGS" -if test "x$ac_cv_have_decl_kqueue" = xyes +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_SPECIAL_FLAGS" >&5 +printf "%s\n" "$ax_cv_PTHREAD_SPECIAL_FLAGS" >&6; } + if test "x$ax_cv_PTHREAD_SPECIAL_FLAGS" != "xno" && \ + test "x$ax_pthread_special_flags_added" != "xyes" then : - -printf "%s\n" "#define HAVE_KQUEUE 1" >>confdefs.h - + PTHREAD_CFLAGS="$ax_cv_PTHREAD_SPECIAL_FLAGS $PTHREAD_CFLAGS" + ax_pthread_special_flags_added=yes fi -ac_fn_check_decl "$LINENO" "epoll_create1" "ac_cv_have_decl_epoll_create1" "$cares_all_includes -" "$ac_c_undeclared_builtin_options" "CFLAGS" -if test "x$ac_cv_have_decl_epoll_create1" = xyes -then : - -printf "%s\n" "#define HAVE_EPOLL 1" >>confdefs.h -fi -ac_fn_check_decl "$LINENO" "ConvertInterfaceIndexToLuid" "ac_cv_have_decl_ConvertInterfaceIndexToLuid" "$cares_all_includes -" "$ac_c_undeclared_builtin_options" "CFLAGS" -if test "x$ac_cv_have_decl_ConvertInterfaceIndexToLuid" = xyes + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for PTHREAD_PRIO_INHERIT" >&5 +printf %s "checking for PTHREAD_PRIO_INHERIT... " >&6; } +if test ${ax_cv_PTHREAD_PRIO_INHERIT+y} then : - -printf "%s\n" "#define HAVE_CONVERTINTERFACEINDEXTOLUID 1" >>confdefs.h - -fi -ac_fn_check_decl "$LINENO" "ConvertInterfaceLuidToNameA" "ac_cv_have_decl_ConvertInterfaceLuidToNameA" "$cares_all_includes -" "$ac_c_undeclared_builtin_options" "CFLAGS" -if test "x$ac_cv_have_decl_ConvertInterfaceLuidToNameA" = xyes + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main (void) +{ +int i = PTHREAD_PRIO_INHERIT; + return i; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" then : - -printf "%s\n" "#define HAVE_CONVERTINTERFACELUIDTONAMEA 1" >>confdefs.h - + ax_cv_PTHREAD_PRIO_INHERIT=yes +else $as_nop + ax_cv_PTHREAD_PRIO_INHERIT=no fi -ac_fn_check_decl "$LINENO" "NotifyIpInterfaceChange" "ac_cv_have_decl_NotifyIpInterfaceChange" "$cares_all_includes -" "$ac_c_undeclared_builtin_options" "CFLAGS" -if test "x$ac_cv_have_decl_NotifyIpInterfaceChange" = xyes -then : - -printf "%s\n" "#define HAVE_NOTIFYIPINTERFACECHANGE 1" >>confdefs.h +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext fi -ac_fn_check_decl "$LINENO" "RegisterWaitForSingleObject" "ac_cv_have_decl_RegisterWaitForSingleObject" "$cares_all_includes -" "$ac_c_undeclared_builtin_options" "CFLAGS" -if test "x$ac_cv_have_decl_RegisterWaitForSingleObject" = xyes +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_PRIO_INHERIT" >&5 +printf "%s\n" "$ax_cv_PTHREAD_PRIO_INHERIT" >&6; } + if test "x$ax_cv_PTHREAD_PRIO_INHERIT" = "xyes" && \ + test "x$ax_pthread_prio_inherit_defined" != "xyes" then : -printf "%s\n" "#define HAVE_REGISTERWAITFORSINGLEOBJECT 1" >>confdefs.h - -fi -ac_fn_check_decl "$LINENO" "__system_property_get" "ac_cv_have_decl___system_property_get" "$cares_all_includes -" "$ac_c_undeclared_builtin_options" "CFLAGS" -if test "x$ac_cv_have_decl___system_property_get" = xyes -then : +printf "%s\n" "#define HAVE_PTHREAD_PRIO_INHERIT 1" >>confdefs.h -printf "%s\n" "#define HAVE___SYSTEM_PROPERTY_GET 1" >>confdefs.h + ax_pthread_prio_inherit_defined=yes fi + CFLAGS="$ax_pthread_save_CFLAGS" + LIBS="$ax_pthread_save_LIBS" + # More AIX lossage: compile with *_r variant + if test "x$GCC" != "xyes"; then + case $host_os in + aix*) + case "x/$CC" in #( + x*/c89|x*/c89_128|x*/c99|x*/c99_128|x*/cc|x*/cc128|x*/xlc|x*/xlc_v6|x*/xlc128|x*/xlc128_v6) : + #handle absolute path differently from PATH based program lookup + case "x$CC" in #( + x/*) : -if test "x$ac_cv_type_ssize_t" = "xyes" -a "x$ac_cv_type_socklen_t" = "xyes" -a "x$ac_cv_native_windows" != "xyes" ; then - recvfrom_type_retv="ssize_t" - recvfrom_type_arg3="size_t" -else - recvfrom_type_retv="int" - recvfrom_type_arg3="int" + if as_fn_executable_p ${CC}_r +then : + PTHREAD_CC="${CC}_r" +fi + if test "x${CXX}" != "x" +then : + if as_fn_executable_p ${CXX}_r +then : + PTHREAD_CXX="${CXX}_r" fi - -if test "x$ac_cv_type_SOCKET" = "xyes" ; then - recvfrom_type_arg1="SOCKET" -else - recvfrom_type_arg1="int" fi + ;; #( + *) : -if test "x$ac_cv_type_socklen_t" = "xyes" ; then - recvfrom_type_arg6="socklen_t *" - getnameinfo_type_arg2="socklen_t" - getnameinfo_type_arg46="socklen_t" + for ac_prog in ${CC}_r +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_PTHREAD_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$PTHREAD_CC"; then + ac_cv_prog_PTHREAD_CC="$PTHREAD_CC" # Let the user override the test. else - recvfrom_type_arg6="int *" - getnameinfo_type_arg2="int" - getnameinfo_type_arg46="int" -fi +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_PTHREAD_CC="$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS -if test "x$ac_cv_native_windows" = "xyes" ; then - recv_type_arg2="char *" +fi +fi +PTHREAD_CC=$ac_cv_prog_PTHREAD_CC +if test -n "$PTHREAD_CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PTHREAD_CC" >&5 +printf "%s\n" "$PTHREAD_CC" >&6; } else - recv_type_arg2="void *" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -recv_type_retv=${recvfrom_type_retv} -send_type_retv=${recvfrom_type_retv} -recv_type_arg1=${recvfrom_type_arg1} -recvfrom_type_arg2=${recv_type_arg2} -send_type_arg1=${recvfrom_type_arg1} -recv_type_arg3=${recvfrom_type_arg3} -send_type_arg3=${recvfrom_type_arg3} -gethostname_type_arg2=${recvfrom_type_arg3} - -recvfrom_qual_arg5= -recvfrom_type_arg4=int -recvfrom_type_arg5="struct sockaddr *" -recv_type_arg4=int -getnameinfo_type_arg1="struct sockaddr *" -getnameinfo_type_arg7=int -send_type_arg2="const void *" -send_type_arg4=int + test -n "$PTHREAD_CC" && break +done +test -n "$PTHREAD_CC" || PTHREAD_CC="$CC" -printf "%s\n" "#define RECVFROM_TYPE_RETV ${recvfrom_type_retv} " >>confdefs.h - - -printf "%s\n" "#define RECVFROM_TYPE_ARG1 ${recvfrom_type_arg1} " >>confdefs.h - - -printf "%s\n" "#define RECVFROM_TYPE_ARG2 ${recvfrom_type_arg2} " >>confdefs.h - + if test "x${CXX}" != "x" +then : + for ac_prog in ${CXX}_r +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_PTHREAD_CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$PTHREAD_CXX"; then + ac_cv_prog_PTHREAD_CXX="$PTHREAD_CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_PTHREAD_CXX="$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS -printf "%s\n" "#define RECVFROM_TYPE_ARG3 ${recvfrom_type_arg3} " >>confdefs.h +fi +fi +PTHREAD_CXX=$ac_cv_prog_PTHREAD_CXX +if test -n "$PTHREAD_CXX"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PTHREAD_CXX" >&5 +printf "%s\n" "$PTHREAD_CXX" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi -printf "%s\n" "#define RECVFROM_TYPE_ARG4 ${recvfrom_type_arg4} " >>confdefs.h + test -n "$PTHREAD_CXX" && break +done +test -n "$PTHREAD_CXX" || PTHREAD_CXX="$CXX" +fi -printf "%s\n" "#define RECVFROM_TYPE_ARG5 ${recvfrom_type_arg5} " >>confdefs.h + ;; +esac + ;; #( + *) : + ;; +esac + ;; + esac + fi +fi +test -n "$PTHREAD_CC" || PTHREAD_CC="$CC" +test -n "$PTHREAD_CXX" || PTHREAD_CXX="$CXX" -printf "%s\n" "#define RECVFROM_QUAL_ARG5 ${recvfrom_qual_arg5}" >>confdefs.h -printf "%s\n" "#define RECV_TYPE_RETV ${recv_type_retv} " >>confdefs.h -printf "%s\n" "#define RECV_TYPE_ARG1 ${recv_type_arg1} " >>confdefs.h +# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: +if test "x$ax_pthread_ok" = "xyes"; then + : +else + ax_pthread_ok=no -printf "%s\n" "#define RECV_TYPE_ARG2 ${recv_type_arg2} " >>confdefs.h + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: threads requested but not supported" >&5 +printf "%s\n" "$as_me: WARNING: threads requested but not supported" >&2;} + CARES_THREADS=no +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu -printf "%s\n" "#define RECV_TYPE_ARG3 ${recv_type_arg3} " >>confdefs.h -printf "%s\n" "#define RECV_TYPE_ARG4 ${recv_type_arg4} " >>confdefs.h + if test "${CARES_THREADS}" = "yes" ; then + ac_fn_c_check_header_compile "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default" +if test "x$ac_cv_header_pthread_h" = xyes +then : + printf "%s\n" "#define HAVE_PTHREAD_H 1" >>confdefs.h +fi +ac_fn_c_check_header_compile "$LINENO" "pthread_np.h" "ac_cv_header_pthread_np_h" "$ac_includes_default" +if test "x$ac_cv_header_pthread_np_h" = xyes +then : + printf "%s\n" "#define HAVE_PTHREAD_NP_H 1" >>confdefs.h +fi -printf "%s\n" "#define SEND_TYPE_RETV ${send_type_retv} " >>confdefs.h + LIBS="$PTHREAD_LIBS $LIBS" + AM_CFLAGS="$AM_CFLAGS $PTHREAD_CFLAGS" + CC="$PTHREAD_CC" + CXX="$PTHREAD_CXX" + fi +fi +if test "${CARES_THREADS}" = "yes" ; then -printf "%s\n" "#define SEND_TYPE_ARG1 ${send_type_arg1} " >>confdefs.h +printf "%s\n" "#define CARES_THREADS 1 " >>confdefs.h +fi -printf "%s\n" "#define SEND_TYPE_ARG2 ${send_type_arg2} " >>confdefs.h +CARES_PRIVATE_LIBS="$LIBS" -printf "%s\n" "#define SEND_TYPE_ARG3 ${send_type_arg3} " >>confdefs.h +BUILD_SUBDIRS="include src docs" -printf "%s\n" "#define SEND_TYPE_ARG4 ${send_type_arg4} " >>confdefs.h +if test "x$build_tests" != "xno" -a "x$cross_compiling" = "xyes" ; then + if test "x$build_tests" = "xmaybe" ; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cannot build tests when cross compiling" >&5 +printf "%s\n" "$as_me: WARNING: cannot build tests when cross compiling" >&2;} + build_tests=no + else + as_fn_error $? "*** Tests not supported when cross compiling" "$LINENO" 5 + fi +fi +# Check whether --enable-tests-crossbuild was given. +if test ${enable_tests_crossbuild+y} +then : + enableval=$enable_tests_crossbuild; build_tests="$enableval" -printf "%s\n" "#define GETNAMEINFO_TYPE_ARG1 ${getnameinfo_type_arg1} " >>confdefs.h +fi -printf "%s\n" "#define GETNAMEINFO_TYPE_ARG2 ${getnameinfo_type_arg2} " >>confdefs.h +if test "x$build_tests" != "xno" ; then -printf "%s\n" "#define GETNAMEINFO_TYPE_ARG7 ${getnameinfo_type_arg7} " >>confdefs.h -printf "%s\n" "#define GETNAMEINFO_TYPE_ARG46 ${getnameinfo_type_arg46} " >>confdefs.h -printf "%s\n" "#define GETHOSTNAME_TYPE_ARG2 ${gethostname_type_arg2} " >>confdefs.h +if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. +set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_PKG_CONFIG+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_PKG_CONFIG="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + ;; +esac +fi +PKG_CONFIG=$ac_cv_path_PKG_CONFIG +if test -n "$PKG_CONFIG"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 +printf "%s\n" "$PKG_CONFIG" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi -if test "$ac_cv_have_decl_getservbyport_r" = "yes" ; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking number of arguments for getservbyport_r()" >&5 -printf %s "checking number of arguments for getservbyport_r()... " >&6; } - getservbyport_r_args=6 - case $host_os in - solaris*) - getservbyport_r_args=5 - ;; - aix*|openbsd*) - getservbyport_r_args=4 - ;; +fi +if test -z "$ac_cv_path_PKG_CONFIG"; then + ac_pt_PKG_CONFIG=$PKG_CONFIG + # Extract the first word of "pkg-config", so it can be a program name with args. +set dummy pkg-config; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_ac_pt_PKG_CONFIG+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $ac_pt_PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; esac - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $getservbyport_r_args" >&5 -printf "%s\n" "$getservbyport_r_args" >&6; } + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_PKG_CONFIG="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS -printf "%s\n" "#define GETSERVBYPORT_R_ARGS $getservbyport_r_args " >>confdefs.h + ;; +esac +fi +ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG +if test -n "$ac_pt_PKG_CONFIG"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 +printf "%s\n" "$ac_pt_PKG_CONFIG" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + if test "x$ac_pt_PKG_CONFIG" = x; then + PKG_CONFIG="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + PKG_CONFIG=$ac_pt_PKG_CONFIG + fi +else + PKG_CONFIG="$ac_cv_path_PKG_CONFIG" fi -if test "$ac_cv_have_decl_getservbyname_r" = "yes" ; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking number of arguments for getservbyname_r()" >&5 -printf %s "checking number of arguments for getservbyname_r()... " >&6; } - getservbyname_r_args=6 - case $host_os in - solaris*) - getservbyname_r_args=5 - ;; - aix*|openbsd*) - getservbyname_r_args=4 - ;; - esac +fi +if test -n "$PKG_CONFIG"; then + _pkg_min_version=0.9.0 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 +printf %s "checking pkg-config is at least version $_pkg_min_version... " >&6; } + if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + PKG_CONFIG="" + fi +fi -printf "%s\n" "#define GETSERVBYNAME_R_ARGS $getservbyname_r_args " >>confdefs.h +pkg_failed=no +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gmock" >&5 +printf %s "checking for gmock... " >&6; } - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $getservbyname_r_args" >&5 -printf "%s\n" "$getservbyname_r_args" >&6; } +if test -n "$GMOCK_CFLAGS"; then + pkg_cv_GMOCK_CFLAGS="$GMOCK_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gmock\""; } >&5 + ($PKG_CONFIG --exists --print-errors "gmock") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_GMOCK_CFLAGS=`$PKG_CONFIG --cflags "gmock" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$GMOCK_LIBS"; then + pkg_cv_GMOCK_LIBS="$GMOCK_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gmock\""; } >&5 + ($PKG_CONFIG --exists --print-errors "gmock") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_GMOCK_LIBS=`$PKG_CONFIG --libs "gmock" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried fi -ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" -if test "x$ac_cv_type_size_t" = xyes -then : -else $as_nop -printf "%s\n" "#define size_t unsigned int" >>confdefs.h +if test $pkg_failed = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no fi + if test $_pkg_short_errors_supported = yes; then + GMOCK_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "gmock" 2>&1` + else + GMOCK_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "gmock" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$GMOCK_PKG_ERRORS" >&5 -ac_fn_check_decl "$LINENO" "AF_INET6" "ac_cv_have_decl_AF_INET6" "$cares_all_includes -" "$ac_c_undeclared_builtin_options" "CFLAGS" -if test "x$ac_cv_have_decl_AF_INET6" = xyes -then : - -printf "%s\n" "#define HAVE_AF_INET6 1" >>confdefs.h - + have_gmock=no +elif test $pkg_failed = untried; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + have_gmock=no +else + GMOCK_CFLAGS=$pkg_cv_GMOCK_CFLAGS + GMOCK_LIBS=$pkg_cv_GMOCK_LIBS + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + have_gmock=yes fi -ac_fn_check_decl "$LINENO" "PF_INET6" "ac_cv_have_decl_PF_INET6" "$cares_all_includes -" "$ac_c_undeclared_builtin_options" "CFLAGS" -if test "x$ac_cv_have_decl_PF_INET6" = xyes -then : + if test "x$have_gmock" = "xno" ; then + if test "x$build_tests" = "xmaybe" ; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: gmock could not be found, not building tests" >&5 +printf "%s\n" "$as_me: WARNING: gmock could not be found, not building tests" >&2;} + build_tests=no + else + as_fn_error $? "tests require gmock" "$LINENO" 5 + fi + else -printf "%s\n" "#define HAVE_PF_INET6 1" >>confdefs.h +pkg_failed=no +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gmock >= 1.12.0" >&5 +printf %s "checking for gmock >= 1.12.0... " >&6; } +if test -n "$GMOCK112_CFLAGS"; then + pkg_cv_GMOCK112_CFLAGS="$GMOCK112_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gmock >= 1.12.0\""; } >&5 + ($PKG_CONFIG --exists --print-errors "gmock >= 1.12.0") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_GMOCK112_CFLAGS=`$PKG_CONFIG --cflags "gmock >= 1.12.0" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes fi -ac_fn_c_check_type "$LINENO" "struct in6_addr" "ac_cv_type_struct_in6_addr" "$cares_all_includes -" -if test "x$ac_cv_type_struct_in6_addr" = xyes -then : - -printf "%s\n" "#define HAVE_STRUCT_IN6_ADDR 1" >>confdefs.h - - + else + pkg_failed=untried +fi +if test -n "$GMOCK112_LIBS"; then + pkg_cv_GMOCK112_LIBS="$GMOCK112_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gmock >= 1.12.0\""; } >&5 + ($PKG_CONFIG --exists --print-errors "gmock >= 1.12.0") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_GMOCK112_LIBS=`$PKG_CONFIG --libs "gmock >= 1.12.0" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried fi -ac_fn_c_check_type "$LINENO" "struct sockaddr_in6" "ac_cv_type_struct_sockaddr_in6" "$cares_all_includes -" -if test "x$ac_cv_type_struct_sockaddr_in6" = xyes -then : -printf "%s\n" "#define HAVE_STRUCT_SOCKADDR_IN6 1" >>confdefs.h +if test $pkg_failed = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no fi + if test $_pkg_short_errors_supported = yes; then + GMOCK112_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "gmock >= 1.12.0" 2>&1` + else + GMOCK112_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "gmock >= 1.12.0" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$GMOCK112_PKG_ERRORS" >&5 -ac_fn_c_check_type "$LINENO" "struct sockaddr_storage" "ac_cv_type_struct_sockaddr_storage" "$cares_all_includes -" -if test "x$ac_cv_type_struct_sockaddr_storage" = xyes + have_gmock_v112=no +elif test $pkg_failed = untried; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + have_gmock_v112=no +else + GMOCK112_CFLAGS=$pkg_cv_GMOCK112_CFLAGS + GMOCK112_LIBS=$pkg_cv_GMOCK112_LIBS + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + have_gmock_v112=yes +fi + if test "x$have_gmock_v112" = "xyes" ; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether user namespaces are supported" >&5 +printf %s "checking whether user namespaces are supported... " >&6; } +if test ${ares_cv_user_namespace+y} then : + printf %s "(cached) " >&6 +else $as_nop -printf "%s\n" "#define HAVE_STRUCT_SOCKADDR_STORAGE 1" >>confdefs.h - - -fi + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu -ac_fn_c_check_type "$LINENO" "struct addrinfo" "ac_cv_type_struct_addrinfo" "$cares_all_includes -" -if test "x$ac_cv_type_struct_addrinfo" = xyes + if test "$cross_compiling" = yes then : + ares_cv_user_namespace=no +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -printf "%s\n" "#define HAVE_STRUCT_ADDRINFO 1" >>confdefs.h +#define _GNU_SOURCE +#include +#include +#include +#include +#include +#include +#include +int userfn(void *d) { + usleep(100000); /* synchronize by sleep */ + return (getuid() != 0); +} +char userst[1024*1024]; +int main() { + char buffer[1024]; + int rc, status, fd; + pid_t child = clone(userfn, userst + 1024*1024, CLONE_NEWUSER|SIGCHLD, 0); + if (child < 0) return 1; -fi + snprintf(buffer, sizeof(buffer), "/proc/%d/uid_map", child); + fd = open(buffer, O_CREAT|O_WRONLY|O_TRUNC, 0755); + snprintf(buffer, sizeof(buffer), "0 %d 1\n", getuid()); + write(fd, buffer, strlen(buffer)); + close(fd); -ac_fn_c_check_type "$LINENO" "struct timeval" "ac_cv_type_struct_timeval" "$cares_all_includes -" -if test "x$ac_cv_type_struct_timeval" = xyes + rc = waitpid(child, &status, 0); + if (rc <= 0) return 1; + if (!WIFEXITED(status)) return 1; + return WEXITSTATUS(status); +} + +_ACEOF +if ac_fn_c_try_run "$LINENO" then : + ares_cv_user_namespace=yes +else $as_nop + ares_cv_user_namespace=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi -printf "%s\n" "#define HAVE_STRUCT_TIMEVAL 1" >>confdefs.h + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ares_cv_user_namespace" >&5 +printf "%s\n" "$ares_cv_user_namespace" >&6; } + if test "$ares_cv_user_namespace" = yes; then -ac_fn_c_check_member "$LINENO" "struct sockaddr_in6" "sin6_scope_id" "ac_cv_member_struct_sockaddr_in6_sin6_scope_id" "$cares_all_includes -" -if test "x$ac_cv_member_struct_sockaddr_in6_sin6_scope_id" = xyes -then : +printf "%s\n" "#define HAVE_USER_NAMESPACE 1" >>confdefs.h -printf "%s\n" "#define HAVE_STRUCT_SOCKADDR_IN6_SIN6_SCOPE_ID 1" >>confdefs.h + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether UTS namespaces are supported" >&5 +printf %s "checking whether UTS namespaces are supported... " >&6; } +if test ${ares_cv_uts_namespace+y} +then : + printf %s "(cached) " >&6 +else $as_nop -fi + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu -ac_fn_c_check_member "$LINENO" "struct addrinfo" "ai_flags" "ac_cv_member_struct_addrinfo_ai_flags" "$cares_all_includes -" -if test "x$ac_cv_member_struct_addrinfo_ai_flags" = xyes + if test "$cross_compiling" = yes then : + ares_cv_uts_namespace=no +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -printf "%s\n" "#define HAVE_STRUCT_ADDRINFO_AI_FLAGS 1" >>confdefs.h +#define _GNU_SOURCE +#include +#include +#include +#include +#include +#include +#include +#include +int utsfn(void *d) { + char buffer[1024]; + const char *name = "autoconftest"; + int rc = sethostname(name, strlen(name)); + if (rc != 0) return 1; + gethostname(buffer, 1024); + return (strcmp(buffer, name) != 0); +} -fi +char st2[1024*1024]; +int fn(void *d) { + pid_t child; + int rc, status; + usleep(100000); /* synchronize by sleep */ + if (getuid() != 0) return 1; + child = clone(utsfn, st2 + 1024*1024, CLONE_NEWUTS|SIGCHLD, 0); + if (child < 0) return 1; + rc = waitpid(child, &status, 0); + if (rc <= 0) return 1; + if (!WIFEXITED(status)) return 1; + return WEXITSTATUS(status); +} +char st[1024*1024]; +int main() { + char buffer[1024]; + int rc, status, fd; + pid_t child = clone(fn, st + 1024*1024, CLONE_NEWUSER|SIGCHLD, 0); + if (child < 0) return 1; -ac_fn_check_decl "$LINENO" "FIONBIO" "ac_cv_have_decl_FIONBIO" "$cares_all_includes -" "$ac_c_undeclared_builtin_options" "CFLAGS" -if test "x$ac_cv_have_decl_FIONBIO" = xyes -then : + snprintf(buffer, sizeof(buffer), "/proc/%d/uid_map", child); + fd = open(buffer, O_CREAT|O_WRONLY|O_TRUNC, 0755); + snprintf(buffer, sizeof(buffer), "0 %d 1\n", getuid()); + write(fd, buffer, strlen(buffer)); + close(fd); -fi -ac_fn_check_decl "$LINENO" "O_NONBLOCK" "ac_cv_have_decl_O_NONBLOCK" "$cares_all_includes -" "$ac_c_undeclared_builtin_options" "CFLAGS" -if test "x$ac_cv_have_decl_O_NONBLOCK" = xyes -then : + rc = waitpid(child, &status, 0); + if (rc <= 0) return 1; + if (!WIFEXITED(status)) return 1; + return WEXITSTATUS(status); +} -fi -ac_fn_check_decl "$LINENO" "SO_NONBLOCK" "ac_cv_have_decl_SO_NONBLOCK" "$cares_all_includes -" "$ac_c_undeclared_builtin_options" "CFLAGS" -if test "x$ac_cv_have_decl_SO_NONBLOCK" = xyes -then : -fi -ac_fn_check_decl "$LINENO" "MSG_NOSIGNAL" "ac_cv_have_decl_MSG_NOSIGNAL" "$cares_all_includes -" "$ac_c_undeclared_builtin_options" "CFLAGS" -if test "x$ac_cv_have_decl_MSG_NOSIGNAL" = xyes +_ACEOF +if ac_fn_c_try_run "$LINENO" then : - + ares_cv_uts_namespace=yes +else $as_nop + ares_cv_uts_namespace=no fi -ac_fn_check_decl "$LINENO" "CLOCK_MONOTONIC" "ac_cv_have_decl_CLOCK_MONOTONIC" "$cares_all_includes -" "$ac_c_undeclared_builtin_options" "CFLAGS" -if test "x$ac_cv_have_decl_CLOCK_MONOTONIC" = xyes -then : - +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext fi -if test "$ac_cv_have_decl_CLOCK_MONOTONIC" = "yes" -a "$ac_cv_have_decl_clock_gettime" = "yes" ; then + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu -printf "%s\n" "#define HAVE_CLOCK_GETTIME_MONOTONIC 1 " >>confdefs.h fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ares_cv_uts_namespace" >&5 +printf "%s\n" "$ares_cv_uts_namespace" >&6; } + if test "$ares_cv_uts_namespace" = yes; then -if test "$ac_cv_have_decl_FIONBIO" = "yes" -a "$ac_cv_have_decl_ioctl" = "yes" ; then +printf "%s\n" "#define HAVE_UTS_NAMESPACE 1" >>confdefs.h -printf "%s\n" "#define HAVE_IOCTL_FIONBIO 1 " >>confdefs.h + fi -fi -if test "$ac_cv_have_decl_FIONBIO" = "yes" -a "$ac_cv_have_decl_ioctlsocket" = "yes" ; then + fi -printf "%s\n" "#define HAVE_IOCTLSOCKET_FIONBIO 1 " >>confdefs.h +pkg_failed=no +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gmock >= 1.17.0" >&5 +printf %s "checking for gmock >= 1.17.0... " >&6; } +if test -n "$GMOCK117_CFLAGS"; then + pkg_cv_GMOCK117_CFLAGS="$GMOCK117_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gmock >= 1.17.0\""; } >&5 + ($PKG_CONFIG --exists --print-errors "gmock >= 1.17.0") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_GMOCK117_CFLAGS=`$PKG_CONFIG --cflags "gmock >= 1.17.0" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes fi -if test "$ac_cv_have_decl_SO_NONBLOCK" = "yes" -a "$ac_cv_have_decl_setsockopt" = "yes" ; then - -printf "%s\n" "#define HAVE_SETSOCKOPT_SO_NONBLOCK 1 " >>confdefs.h - + else + pkg_failed=untried +fi +if test -n "$GMOCK117_LIBS"; then + pkg_cv_GMOCK117_LIBS="$GMOCK117_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gmock >= 1.17.0\""; } >&5 + ($PKG_CONFIG --exists --print-errors "gmock >= 1.17.0") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_GMOCK117_LIBS=`$PKG_CONFIG --libs "gmock >= 1.17.0" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried fi -if test "$ac_cv_have_decl_O_NONBLOCK" = "yes" -a "$ac_cv_have_decl_fcntl" = "yes" ; then -printf "%s\n" "#define HAVE_FCNTL_O_NONBLOCK 1 " >>confdefs.h -fi -if test "x$ac_cv_header_sys_types_h" = "xyes" ; then +if test $pkg_failed = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } -cat >>confdefs.h <<_EOF -#define CARES_HAVE_SYS_TYPES_H 1 -_EOF +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + GMOCK117_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "gmock >= 1.17.0" 2>&1` + else + GMOCK117_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "gmock >= 1.17.0" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$GMOCK117_PKG_ERRORS" >&5 + have_gmock_v117=no +elif test $pkg_failed = untried; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + have_gmock_v117=no +else + GMOCK117_CFLAGS=$pkg_cv_GMOCK117_CFLAGS + GMOCK117_LIBS=$pkg_cv_GMOCK117_LIBS + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + have_gmock_v117=yes fi -if test "x$ac_cv_header_sys_socket_h" = "xyes" ; then + if test "x$have_gmock_v117" = "xyes" ; then + ax_cxx_compile_alternatives="17 1z" ax_cxx_compile_cxx17_required=true + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + ac_success=no -cat >>confdefs.h <<_EOF -#define CARES_HAVE_SYS_SOCKET_H 1 -_EOF -fi -if test "x$ac_cv_header_sys_select_h" = "xyes" ; then -cat >>confdefs.h <<_EOF -#define CARES_HAVE_SYS_SELECT_H 1 -_EOF -fi -if test "x$ac_cv_header_ws2tcpip_h" = "xyes" ; then -cat >>confdefs.h <<_EOF -#define CARES_HAVE_WS2TCPIP_H 1 -_EOF + if test x$ac_success = xno; then + for alternative in ${ax_cxx_compile_alternatives}; do + for switch in -std=c++${alternative} +std=c++${alternative} "-h std=c++${alternative}" MSVC; do + if test x"$switch" = xMSVC; then + switch=-std:c++${alternative} + cachevar=`printf "%s\n" "ax_cv_cxx_compile_cxx17_${switch}_MSVC" | $as_tr_sh` + else + cachevar=`printf "%s\n" "ax_cv_cxx_compile_cxx17_$switch" | $as_tr_sh` + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++17 features with $switch" >&5 +printf %s "checking whether $CXX supports C++17 features with $switch... " >&6; } +if eval test \${$cachevar+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_save_CXX="$CXX" + CXX="$CXX $switch" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -fi -if test "x$ac_cv_header_winsock2_h" = "xyes" ; then -cat >>confdefs.h <<_EOF -#define CARES_HAVE_WINSOCK2_H 1 -_EOF +// If the compiler admits that it is not ready for C++11, why torture it? +// Hopefully, this will speed up the test. -fi -if test "x$ac_cv_header_windows_h" = "xyes" ; then +#ifndef __cplusplus -cat >>confdefs.h <<_EOF -#define CARES_HAVE_WINDOWS_H 1 -_EOF +#error "This is not a C++ compiler" -fi -if test "x$ac_cv_header_arpa_nameser_h" = "xyes" ; then +// MSVC always sets __cplusplus to 199711L in older versions; newer versions +// only set it correctly if /Zc:__cplusplus is specified as well as a +// /std:c++NN switch: +// +// https://devblogs.microsoft.com/cppblog/msvc-now-correctly-reports-__cplusplus/ +// +// The value __cplusplus ought to have is available in _MSVC_LANG since +// Visual Studio 2015 Update 3: +// +// https://learn.microsoft.com/en-us/cpp/preprocessor/predefined-macros +// +// This was also the first MSVC version to support C++14 so we can't use the +// value of either __cplusplus or _MSVC_LANG to quickly rule out MSVC having +// C++11 or C++14 support, but we can check _MSVC_LANG for C++17 and later. +#elif __cplusplus < 201103L && !defined _MSC_VER -cat >>confdefs.h <<_EOF -#define CARES_HAVE_ARPA_NAMESER_H 1 -_EOF +#error "This is not a C++11 compiler" -fi -if test "x$ac_cv_header_arpa_nameser_compa_h" = "xyes" ; then +#else -cat >>confdefs.h <<_EOF -#define CARES_HAVE_ARPA_NAMESER_COMPA_H 1 -_EOF +namespace cxx11 +{ -fi + namespace test_static_assert + { + + template + struct check + { + static_assert(sizeof(int) <= sizeof(T), "not big enough"); + }; + } + namespace test_final_override + { -if test "${CARES_THREADS}" = "yes" -a "x${ac_cv_native_windows}" != "xyes" ; then + struct Base + { + virtual ~Base() {} + virtual void f() {} + }; + struct Derived : public Base + { + virtual ~Derived() override {} + virtual void f() override {} + }; + } + namespace test_double_right_angle_brackets + { -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu + template < typename T > + struct check {}; -ax_pthread_ok=no + typedef check single_type; + typedef check> double_type; + typedef check>> triple_type; + typedef check>>> quadruple_type; -# We used to check for pthread.h first, but this fails if pthread.h -# requires special compiler flags (e.g. on Tru64 or Sequent). -# It gets checked for in the link test anyway. + } -# First of all, check if the user has set any of the PTHREAD_LIBS, -# etcetera environment variables, and if threads linking works using -# them: -if test "x$PTHREAD_CFLAGS$PTHREAD_LIBS" != "x"; then - ax_pthread_save_CC="$CC" - ax_pthread_save_CFLAGS="$CFLAGS" - ax_pthread_save_LIBS="$LIBS" - if test "x$PTHREAD_CC" != "x" -then : - CC="$PTHREAD_CC" -fi - if test "x$PTHREAD_CXX" != "x" -then : - CXX="$PTHREAD_CXX" -fi - CFLAGS="$CFLAGS $PTHREAD_CFLAGS" - LIBS="$PTHREAD_LIBS $LIBS" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pthread_join using $CC $PTHREAD_CFLAGS $PTHREAD_LIBS" >&5 -printf %s "checking for pthread_join using $CC $PTHREAD_CFLAGS $PTHREAD_LIBS... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + namespace test_decltype + { -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char pthread_join (); -int -main (void) -{ -return pthread_join (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ax_pthread_ok=yes -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_ok" >&5 -printf "%s\n" "$ax_pthread_ok" >&6; } - if test "x$ax_pthread_ok" = "xno"; then - PTHREAD_LIBS="" - PTHREAD_CFLAGS="" - fi - CC="$ax_pthread_save_CC" - CFLAGS="$ax_pthread_save_CFLAGS" - LIBS="$ax_pthread_save_LIBS" -fi + int + f() + { + int a = 1; + decltype(a) b = 2; + return a + b; + } -# We must check for the threads library under a number of different -# names; the ordering is very important because some systems -# (e.g. DEC) have both -lpthread and -lpthreads, where one of the -# libraries is broken (non-POSIX). + } -# Create a list of thread flags to try. Items with a "," contain both -# C compiler flags (before ",") and linker flags (after ","). Other items -# starting with a "-" are C compiler flags, and remaining items are -# library names, except for "none" which indicates that we try without -# any flags at all, and "pthread-config" which is a program returning -# the flags for the Pth emulation library. + namespace test_type_deduction + { -ax_pthread_flags="pthreads none -Kthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config" + template < typename T1, typename T2 > + struct is_same + { + static const bool value = false; + }; -# The ordering *is* (sometimes) important. Some notes on the -# individual items follow: + template < typename T > + struct is_same + { + static const bool value = true; + }; -# pthreads: AIX (must check this before -lpthread) -# none: in case threads are in libc; should be tried before -Kthread and -# other compiler flags to prevent continual compiler warnings -# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h) -# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads), Tru64 -# (Note: HP C rejects this with "bad form for `-t' option") -# -pthreads: Solaris/gcc (Note: HP C also rejects) -# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it -# doesn't hurt to check since this sometimes defines pthreads and -# -D_REENTRANT too), HP C (must be checked before -lpthread, which -# is present but should not be used directly; and before -mthreads, -# because the compiler interprets this as "-mt" + "-hreads") -# -mthreads: Mingw32/gcc, Lynx/gcc -# pthread: Linux, etcetera -# --thread-safe: KAI C++ -# pthread-config: use pthread-config program (for GNU Pth library) + template < typename T1, typename T2 > + auto + add(T1 a1, T2 a2) -> decltype(a1 + a2) + { + return a1 + a2; + } -case $host_os in + int + test(const int c, volatile int v) + { + static_assert(is_same::value == true, ""); + static_assert(is_same::value == false, ""); + static_assert(is_same::value == false, ""); + auto ac = c; + auto av = v; + auto sumi = ac + av + 'x'; + auto sumf = ac + av + 1.0; + static_assert(is_same::value == true, ""); + static_assert(is_same::value == true, ""); + static_assert(is_same::value == true, ""); + static_assert(is_same::value == false, ""); + static_assert(is_same::value == true, ""); + return (sumf > 0.0) ? sumi : add(c, v); + } - freebsd*) + } - # -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able) - # lthread: LinuxThreads port on FreeBSD (also preferred to -pthread) + namespace test_noexcept + { - ax_pthread_flags="-kthread lthread $ax_pthread_flags" - ;; + int f() { return 0; } + int g() noexcept { return 0; } - hpux*) + static_assert(noexcept(f()) == false, ""); + static_assert(noexcept(g()) == true, ""); - # From the cc(1) man page: "[-mt] Sets various -D flags to enable - # multi-threading and also sets -lpthread." + } - ax_pthread_flags="-mt -pthread pthread $ax_pthread_flags" - ;; + namespace test_constexpr + { - openedition*) + template < typename CharT > + unsigned long constexpr + strlen_c_r(const CharT *const s, const unsigned long acc) noexcept + { + return *s ? strlen_c_r(s + 1, acc + 1) : acc; + } - # IBM z/OS requires a feature-test macro to be defined in order to - # enable POSIX threads at all, so give the user a hint if this is - # not set. (We don't define these ourselves, as they can affect - # other portions of the system API in unpredictable ways.) + template < typename CharT > + unsigned long constexpr + strlen_c(const CharT *const s) noexcept + { + return strlen_c_r(s, 0UL); + } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + static_assert(strlen_c("") == 0UL, ""); + static_assert(strlen_c("1") == 1UL, ""); + static_assert(strlen_c("example") == 7UL, ""); + static_assert(strlen_c("another\0example") == 7UL, ""); -# if !defined(_OPEN_THREADS) && !defined(_UNIX03_THREADS) - AX_PTHREAD_ZOS_MISSING -# endif + } -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "AX_PTHREAD_ZOS_MISSING" >/dev/null 2>&1 -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: IBM z/OS requires -D_OPEN_THREADS or -D_UNIX03_THREADS to enable pthreads support." >&5 -printf "%s\n" "$as_me: WARNING: IBM z/OS requires -D_OPEN_THREADS or -D_UNIX03_THREADS to enable pthreads support." >&2;} -fi -rm -rf conftest* + namespace test_rvalue_references + { - ;; + template < int N > + struct answer + { + static constexpr int value = N; + }; - solaris*) + answer<1> f(int&) { return answer<1>(); } + answer<2> f(const int&) { return answer<2>(); } + answer<3> f(int&&) { return answer<3>(); } - # On Solaris (at least, for some versions), libc contains stubbed - # (non-functional) versions of the pthreads routines, so link-based - # tests will erroneously succeed. (N.B.: The stubs are missing - # pthread_cleanup_push, or rather a function called by this macro, - # so we could check for that, but who knows whether they'll stub - # that too in a future libc.) So we'll check first for the - # standard Solaris way of linking pthreads (-mt -lpthread). + void + test() + { + int i = 0; + const int c = 0; + static_assert(decltype(f(i))::value == 1, ""); + static_assert(decltype(f(c))::value == 2, ""); + static_assert(decltype(f(0))::value == 3, ""); + } - ax_pthread_flags="-mt,-lpthread pthread $ax_pthread_flags" - ;; -esac + } -# Are we compiling with Clang? + namespace test_uniform_initialization + { -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC is Clang" >&5 -printf %s "checking whether $CC is Clang... " >&6; } -if test ${ax_cv_PTHREAD_CLANG+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ax_cv_PTHREAD_CLANG=no - # Note that Autoconf sets GCC=yes for Clang as well as GCC - if test "x$GCC" = "xyes"; then - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -/* Note: Clang 2.7 lacks __clang_[a-z]+__ */ -# if defined(__clang__) && defined(__llvm__) - AX_PTHREAD_CC_IS_CLANG -# endif + struct test + { + static const int zero {}; + static const int one {1}; + }; -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "AX_PTHREAD_CC_IS_CLANG" >/dev/null 2>&1 -then : - ax_cv_PTHREAD_CLANG=yes -fi -rm -rf conftest* + static_assert(test::zero == 0, ""); + static_assert(test::one == 1, ""); - fi + } -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_CLANG" >&5 -printf "%s\n" "$ax_cv_PTHREAD_CLANG" >&6; } -ax_pthread_clang="$ax_cv_PTHREAD_CLANG" + namespace test_lambdas + { + void + test1() + { + auto lambda1 = [](){}; + auto lambda2 = lambda1; + lambda1(); + lambda2(); + } -# GCC generally uses -pthread, or -pthreads on some platforms (e.g. SPARC) + int + test2() + { + auto a = [](int i, int j){ return i + j; }(1, 2); + auto b = []() -> int { return '0'; }(); + auto c = [=](){ return a + b; }(); + auto d = [&](){ return c; }(); + auto e = [a, &b](int x) mutable { + const auto identity = [](int y){ return y; }; + for (auto i = 0; i < a; ++i) + a += b--; + return x + identity(a + b); + }(0); + return a + b + c + d + e; + } -# Note that for GCC and Clang -pthread generally implies -lpthread, -# except when -nostdlib is passed. -# This is problematic using libtool to build C++ shared libraries with pthread: -# [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=25460 -# [2] https://bugzilla.redhat.com/show_bug.cgi?id=661333 -# [3] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=468555 -# To solve this, first try -pthread together with -lpthread for GCC + int + test3() + { + const auto nullary = [](){ return 0; }; + const auto unary = [](int x){ return x; }; + using nullary_t = decltype(nullary); + using unary_t = decltype(unary); + const auto higher1st = [](nullary_t f){ return f(); }; + const auto higher2nd = [unary](nullary_t f1){ + return [unary, f1](unary_t f2){ return f2(unary(f1())); }; + }; + return higher1st(nullary) + higher2nd(nullary)(unary); + } -if test "x$GCC" = "xyes" -then : - ax_pthread_flags="-pthread,-lpthread -pthread -pthreads $ax_pthread_flags" -fi + } -# Clang takes -pthread (never supported any other flag), but we'll try with -lpthread first + namespace test_variadic_templates + { -if test "x$ax_pthread_clang" = "xyes" -then : - ax_pthread_flags="-pthread,-lpthread -pthread" -fi + template + struct sum; + template + struct sum + { + static constexpr auto value = N0 + sum::value; + }; -# The presence of a feature test macro requesting re-entrant function -# definitions is, on some systems, a strong hint that pthreads support is -# correctly enabled + template <> + struct sum<> + { + static constexpr auto value = 0; + }; -case $host_os in - darwin* | hpux* | linux* | osf* | solaris*) - ax_pthread_check_macro="_REENTRANT" - ;; + static_assert(sum<>::value == 0, ""); + static_assert(sum<1>::value == 1, ""); + static_assert(sum<23>::value == 23, ""); + static_assert(sum<1, 2>::value == 3, ""); + static_assert(sum<5, 5, 11>::value == 21, ""); + static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, ""); - aix*) - ax_pthread_check_macro="_THREAD_SAFE" - ;; + } - *) - ax_pthread_check_macro="--" - ;; -esac -if test "x$ax_pthread_check_macro" = "x--" -then : - ax_pthread_check_cond=0 -else $as_nop - ax_pthread_check_cond="!defined($ax_pthread_check_macro)" -fi + // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae + // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function + // because of this. + namespace test_template_alias_sfinae + { + struct foo {}; -if test "x$ax_pthread_ok" = "xno"; then -for ax_pthread_try_flag in $ax_pthread_flags; do + template + using member = typename T::member_type; - case $ax_pthread_try_flag in - none) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether pthreads work without any flags" >&5 -printf %s "checking whether pthreads work without any flags... " >&6; } - ;; + template + void func(...) {} - *,*) - PTHREAD_CFLAGS=`echo $ax_pthread_try_flag | sed "s/^\(.*\),\(.*\)$/\1/"` - PTHREAD_LIBS=`echo $ax_pthread_try_flag | sed "s/^\(.*\),\(.*\)$/\2/"` - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether pthreads work with \"$PTHREAD_CFLAGS\" and \"$PTHREAD_LIBS\"" >&5 -printf %s "checking whether pthreads work with \"$PTHREAD_CFLAGS\" and \"$PTHREAD_LIBS\"... " >&6; } - ;; + template + void func(member*) {} - -*) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether pthreads work with $ax_pthread_try_flag" >&5 -printf %s "checking whether pthreads work with $ax_pthread_try_flag... " >&6; } - PTHREAD_CFLAGS="$ax_pthread_try_flag" - ;; + void test(); - pthread-config) - # Extract the first word of "pthread-config", so it can be a program name with args. -set dummy pthread-config; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_ax_pthread_config+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$ax_pthread_config"; then - ac_cv_prog_ax_pthread_config="$ax_pthread_config" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_ax_pthread_config="yes" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS + void test() { func(0); } - test -z "$ac_cv_prog_ax_pthread_config" && ac_cv_prog_ax_pthread_config="no" -fi -fi -ax_pthread_config=$ac_cv_prog_ax_pthread_config -if test -n "$ax_pthread_config"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_config" >&5 -printf "%s\n" "$ax_pthread_config" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi + } +} // namespace cxx11 - if test "x$ax_pthread_config" = "xno" -then : - continue -fi - PTHREAD_CFLAGS="`pthread-config --cflags`" - PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`" - ;; +#endif // __cplusplus >= 201103L - *) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for the pthreads library -l$ax_pthread_try_flag" >&5 -printf %s "checking for the pthreads library -l$ax_pthread_try_flag... " >&6; } - PTHREAD_LIBS="-l$ax_pthread_try_flag" - ;; - esac - ax_pthread_save_CFLAGS="$CFLAGS" - ax_pthread_save_LIBS="$LIBS" - CFLAGS="$CFLAGS $PTHREAD_CFLAGS" - LIBS="$PTHREAD_LIBS $LIBS" - # Check for various functions. We must include pthread.h, - # since some functions may be macros. (On the Sequent, we - # need a special flag -Kthread to make this header compile.) - # We check for pthread_join because it is in -lpthread on IRIX - # while pthread_create is in libc. We check for pthread_attr_init - # due to DEC craziness with -lpthreads. We check for - # pthread_cleanup_push because it is one of the few pthread - # functions on Solaris that doesn't have a non-functional libc stub. - # We try pthread_create on general principles. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -# if $ax_pthread_check_cond -# error "$ax_pthread_check_macro must be defined" -# endif - static void *some_global = NULL; - static void routine(void *a) - { - /* To avoid any unused-parameter or - unused-but-set-parameter warning. */ - some_global = a; - } - static void *start_routine(void *a) { return a; } -int -main (void) -{ -pthread_t th; pthread_attr_t attr; - pthread_create(&th, 0, start_routine, 0); - pthread_join(th, 0); - pthread_attr_init(&attr); - pthread_cleanup_push(routine, 0); - pthread_cleanup_pop(0) /* ; */ - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ax_pthread_ok=yes -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext +// If the compiler admits that it is not ready for C++14, why torture it? +// Hopefully, this will speed up the test. - CFLAGS="$ax_pthread_save_CFLAGS" - LIBS="$ax_pthread_save_LIBS" +#ifndef __cplusplus - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_ok" >&5 -printf "%s\n" "$ax_pthread_ok" >&6; } - if test "x$ax_pthread_ok" = "xyes" -then : - break -fi +#error "This is not a C++ compiler" - PTHREAD_LIBS="" - PTHREAD_CFLAGS="" -done -fi +#elif __cplusplus < 201402L && !defined _MSC_VER +#error "This is not a C++14 compiler" -# Clang needs special handling, because older versions handle the -pthread -# option in a rather... idiosyncratic way +#else -if test "x$ax_pthread_clang" = "xyes"; then +namespace cxx14 +{ - # Clang takes -pthread; it has never supported any other flag + namespace test_polymorphic_lambdas + { - # (Note 1: This will need to be revisited if a system that Clang - # supports has POSIX threads in a separate library. This tends not - # to be the way of modern systems, but it's conceivable.) + int + test() + { + const auto lambda = [](auto&&... args){ + const auto istiny = [](auto x){ + return (sizeof(x) == 1UL) ? 1 : 0; + }; + const int aretiny[] = { istiny(args)... }; + return aretiny[0]; + }; + return lambda(1, 1L, 1.0f, '1'); + } - # (Note 2: On some systems, notably Darwin, -pthread is not needed - # to get POSIX threads support; the API is always present and - # active. We could reasonably leave PTHREAD_CFLAGS empty. But - # -pthread does define _REENTRANT, and while the Darwin headers - # ignore this macro, third-party headers might not.) + } - # However, older versions of Clang make a point of warning the user - # that, in an invocation where only linking and no compilation is - # taking place, the -pthread option has no effect ("argument unused - # during compilation"). They expect -pthread to be passed in only - # when source code is being compiled. - # - # Problem is, this is at odds with the way Automake and most other - # C build frameworks function, which is that the same flags used in - # compilation (CFLAGS) are also used in linking. Many systems - # supported by AX_PTHREAD require exactly this for POSIX threads - # support, and in fact it is often not straightforward to specify a - # flag that is used only in the compilation phase and not in - # linking. Such a scenario is extremely rare in practice. - # - # Even though use of the -pthread flag in linking would only print - # a warning, this can be a nuisance for well-run software projects - # that build with -Werror. So if the active version of Clang has - # this misfeature, we search for an option to squash it. + namespace test_binary_literals + { - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether Clang needs flag to prevent \"argument unused\" warning when linking with -pthread" >&5 -printf %s "checking whether Clang needs flag to prevent \"argument unused\" warning when linking with -pthread... " >&6; } -if test ${ax_cv_PTHREAD_CLANG_NO_WARN_FLAG+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ax_cv_PTHREAD_CLANG_NO_WARN_FLAG=unknown - # Create an alternate version of $ac_link that compiles and - # links in two steps (.c -> .o, .o -> exe) instead of one - # (.c -> exe), because the warning occurs only in the second - # step - ax_pthread_save_ac_link="$ac_link" - ax_pthread_sed='s/conftest\.\$ac_ext/conftest.$ac_objext/g' - ax_pthread_link_step=`printf "%s\n" "$ac_link" | sed "$ax_pthread_sed"` - ax_pthread_2step_ac_link="($ac_compile) && (echo ==== >&5) && ($ax_pthread_link_step)" - ax_pthread_save_CFLAGS="$CFLAGS" - for ax_pthread_try in '' -Qunused-arguments -Wno-unused-command-line-argument unknown; do - if test "x$ax_pthread_try" = "xunknown" -then : - break -fi - CFLAGS="-Werror -Wunknown-warning-option $ax_pthread_try -pthread $ax_pthread_save_CFLAGS" - ac_link="$ax_pthread_save_ac_link" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int main(void){return 0;} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_link="$ax_pthread_2step_ac_link" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int main(void){return 0;} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - break -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext + constexpr auto ivii = 0b0000000000101010; + static_assert(ivii == 42, "wrong value"); -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext - done - ac_link="$ax_pthread_save_ac_link" - CFLAGS="$ax_pthread_save_CFLAGS" - if test "x$ax_pthread_try" = "x" -then : - ax_pthread_try=no -fi - ax_cv_PTHREAD_CLANG_NO_WARN_FLAG="$ax_pthread_try" + } -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" >&5 -printf "%s\n" "$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" >&6; } + namespace test_generalized_constexpr + { - case "$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" in - no | unknown) ;; - *) PTHREAD_CFLAGS="$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG $PTHREAD_CFLAGS" ;; - esac + template < typename CharT > + constexpr unsigned long + strlen_c(const CharT *const s) noexcept + { + auto length = 0UL; + for (auto p = s; *p; ++p) + ++length; + return length; + } -fi # $ax_pthread_clang = yes + static_assert(strlen_c("") == 0UL, ""); + static_assert(strlen_c("x") == 1UL, ""); + static_assert(strlen_c("test") == 4UL, ""); + static_assert(strlen_c("another\0test") == 7UL, ""); + } + namespace test_lambda_init_capture + { -# Various other checks: -if test "x$ax_pthread_ok" = "xyes"; then - ax_pthread_save_CFLAGS="$CFLAGS" - ax_pthread_save_LIBS="$LIBS" - CFLAGS="$CFLAGS $PTHREAD_CFLAGS" - LIBS="$PTHREAD_LIBS $LIBS" + int + test() + { + auto x = 0; + const auto lambda1 = [a = x](int b){ return a + b; }; + const auto lambda2 = [a = lambda1(x)](){ return a; }; + return lambda2(); + } - # Detect AIX lossage: JOINABLE attribute is called UNDETACHED. - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for joinable pthread attribute" >&5 -printf %s "checking for joinable pthread attribute... " >&6; } -if test ${ax_cv_PTHREAD_JOINABLE_ATTR+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ax_cv_PTHREAD_JOINABLE_ATTR=unknown - for ax_pthread_attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main (void) -{ -int attr = $ax_pthread_attr; return attr /* ; */ - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ax_cv_PTHREAD_JOINABLE_ATTR=$ax_pthread_attr; break -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext - done + } -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_JOINABLE_ATTR" >&5 -printf "%s\n" "$ax_cv_PTHREAD_JOINABLE_ATTR" >&6; } - if test "x$ax_cv_PTHREAD_JOINABLE_ATTR" != "xunknown" && \ - test "x$ax_cv_PTHREAD_JOINABLE_ATTR" != "xPTHREAD_CREATE_JOINABLE" && \ - test "x$ax_pthread_joinable_attr_defined" != "xyes" -then : + namespace test_digit_separators + { -printf "%s\n" "#define PTHREAD_CREATE_JOINABLE $ax_cv_PTHREAD_JOINABLE_ATTR" >>confdefs.h + constexpr auto ten_million = 100'000'000; + static_assert(ten_million == 100000000, ""); - ax_pthread_joinable_attr_defined=yes + } -fi + namespace test_return_type_deduction + { - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether more special flags are required for pthreads" >&5 -printf %s "checking whether more special flags are required for pthreads... " >&6; } -if test ${ax_cv_PTHREAD_SPECIAL_FLAGS+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ax_cv_PTHREAD_SPECIAL_FLAGS=no - case $host_os in - solaris*) - ax_cv_PTHREAD_SPECIAL_FLAGS="-D_POSIX_PTHREAD_SEMANTICS" - ;; - esac + auto f(int& x) { return x; } + decltype(auto) g(int& x) { return x; } -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_SPECIAL_FLAGS" >&5 -printf "%s\n" "$ax_cv_PTHREAD_SPECIAL_FLAGS" >&6; } - if test "x$ax_cv_PTHREAD_SPECIAL_FLAGS" != "xno" && \ - test "x$ax_pthread_special_flags_added" != "xyes" -then : - PTHREAD_CFLAGS="$ax_cv_PTHREAD_SPECIAL_FLAGS $PTHREAD_CFLAGS" - ax_pthread_special_flags_added=yes -fi + template < typename T1, typename T2 > + struct is_same + { + static constexpr auto value = false; + }; - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for PTHREAD_PRIO_INHERIT" >&5 -printf %s "checking for PTHREAD_PRIO_INHERIT... " >&6; } -if test ${ax_cv_PTHREAD_PRIO_INHERIT+y} -then : - printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main (void) -{ -int i = PTHREAD_PRIO_INHERIT; - return i; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ax_cv_PTHREAD_PRIO_INHERIT=yes -else $as_nop - ax_cv_PTHREAD_PRIO_INHERIT=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext + template < typename T > + struct is_same + { + static constexpr auto value = true; + }; -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_PRIO_INHERIT" >&5 -printf "%s\n" "$ax_cv_PTHREAD_PRIO_INHERIT" >&6; } - if test "x$ax_cv_PTHREAD_PRIO_INHERIT" = "xyes" && \ - test "x$ax_pthread_prio_inherit_defined" != "xyes" -then : + int + test() + { + auto x = 0; + static_assert(is_same::value, ""); + static_assert(is_same::value, ""); + return x; + } -printf "%s\n" "#define HAVE_PTHREAD_PRIO_INHERIT 1" >>confdefs.h + } - ax_pthread_prio_inherit_defined=yes +} // namespace cxx14 -fi +#endif // __cplusplus >= 201402L - CFLAGS="$ax_pthread_save_CFLAGS" - LIBS="$ax_pthread_save_LIBS" - # More AIX lossage: compile with *_r variant - if test "x$GCC" != "xyes"; then - case $host_os in - aix*) - case "x/$CC" in #( - x*/c89|x*/c89_128|x*/c99|x*/c99_128|x*/cc|x*/cc128|x*/xlc|x*/xlc_v6|x*/xlc128|x*/xlc128_v6) : - #handle absolute path differently from PATH based program lookup - case "x$CC" in #( - x/*) : - if as_fn_executable_p ${CC}_r -then : - PTHREAD_CC="${CC}_r" -fi - if test "x${CXX}" != "x" -then : - if as_fn_executable_p ${CXX}_r -then : - PTHREAD_CXX="${CXX}_r" -fi -fi - ;; #( - *) : - for ac_prog in ${CC}_r -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_PTHREAD_CC+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$PTHREAD_CC"; then - ac_cv_prog_PTHREAD_CC="$PTHREAD_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_PTHREAD_CC="$ac_prog" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS +// If the compiler admits that it is not ready for C++17, why torture it? +// Hopefully, this will speed up the test. -fi -fi -PTHREAD_CC=$ac_cv_prog_PTHREAD_CC -if test -n "$PTHREAD_CC"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PTHREAD_CC" >&5 -printf "%s\n" "$PTHREAD_CC" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi +#ifndef __cplusplus +#error "This is not a C++ compiler" - test -n "$PTHREAD_CC" && break -done -test -n "$PTHREAD_CC" || PTHREAD_CC="$CC" +#elif (defined _MSVC_LANG ? _MSVC_LANG : __cplusplus) < 201703L - if test "x${CXX}" != "x" -then : - for ac_prog in ${CXX}_r -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_PTHREAD_CXX+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$PTHREAD_CXX"; then - ac_cv_prog_PTHREAD_CXX="$PTHREAD_CXX" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_PTHREAD_CXX="$ac_prog" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS +#error "This is not a C++17 compiler" -fi -fi -PTHREAD_CXX=$ac_cv_prog_PTHREAD_CXX -if test -n "$PTHREAD_CXX"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PTHREAD_CXX" >&5 -printf "%s\n" "$PTHREAD_CXX" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi +#else +#include +#include +#include - test -n "$PTHREAD_CXX" && break -done -test -n "$PTHREAD_CXX" || PTHREAD_CXX="$CXX" +namespace cxx17 +{ -fi + namespace test_constexpr_lambdas + { - ;; -esac - ;; #( - *) : - ;; -esac - ;; - esac - fi -fi + constexpr int foo = [](){return 42;}(); -test -n "$PTHREAD_CC" || PTHREAD_CC="$CC" -test -n "$PTHREAD_CXX" || PTHREAD_CXX="$CXX" + } + namespace test::nested_namespace::definitions + { + } + namespace test_fold_expression + { + template + int multiply(Args... args) + { + return (args * ... * 1); + } + template + bool all(Args... args) + { + return (args && ...); + } -# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: -if test "x$ax_pthread_ok" = "xyes"; then + } - : -else - ax_pthread_ok=no + namespace test_extended_static_assert + { - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: threads requested but not supported" >&5 -printf "%s\n" "$as_me: WARNING: threads requested but not supported" >&2;} - CARES_THREADS=no + static_assert (true); -fi -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu + } + namespace test_auto_brace_init_list + { + auto foo = {5}; + auto bar {5}; - if test "${CARES_THREADS}" = "yes" ; then - ac_fn_c_check_header_compile "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default" -if test "x$ac_cv_header_pthread_h" = xyes -then : - printf "%s\n" "#define HAVE_PTHREAD_H 1" >>confdefs.h + static_assert(std::is_same, decltype(foo)>::value); + static_assert(std::is_same::value); + } -fi -ac_fn_c_check_header_compile "$LINENO" "pthread_np.h" "ac_cv_header_pthread_np_h" "$ac_includes_default" -if test "x$ac_cv_header_pthread_np_h" = xyes -then : - printf "%s\n" "#define HAVE_PTHREAD_NP_H 1" >>confdefs.h + namespace test_typename_in_template_template_parameter + { -fi + template typename X> struct D; - LIBS="$PTHREAD_LIBS $LIBS" - AM_CFLAGS="$AM_CFLAGS $PTHREAD_CFLAGS" - CC="$PTHREAD_CC" - CXX="$PTHREAD_CXX" - fi -fi + } -if test "${CARES_THREADS}" = "yes" ; then + namespace test_fallthrough_nodiscard_maybe_unused_attributes + { -printf "%s\n" "#define CARES_THREADS 1 " >>confdefs.h + int f1() + { + return 42; + } -fi + [[nodiscard]] int f2() + { + [[maybe_unused]] auto unused = f1(); + + switch (f1()) + { + case 17: + f1(); + [[fallthrough]]; + case 42: + f1(); + } + return f1(); + } -CARES_PRIVATE_LIBS="$LIBS" + } + + namespace test_extended_aggregate_initialization + { + struct base1 + { + int b1, b2 = 42; + }; -BUILD_SUBDIRS="include src docs" + struct base2 + { + base2() { + b3 = 42; + } + int b3; + }; + struct derived : base1, base2 + { + int d; + }; + derived d1 {{1, 2}, {}, 4}; // full initialization + derived d2 {{}, {}, 4}; // value-initialized bases -if test "x$build_tests" != "xno" -a "x$HAVE_CXX14" = "0" ; then - if test "x$build_tests" = "xmaybe" ; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cannot build tests without a CXX14 compiler" >&5 -printf "%s\n" "$as_me: WARNING: cannot build tests without a CXX14 compiler" >&2;} - build_tests=no - else - as_fn_error $? "*** Building tests requires a CXX14 compiler" "$LINENO" 5 - fi -fi -if test "x$build_tests" != "xno" -a "x$cross_compiling" = "xyes" ; then - if test "x$build_tests" = "xmaybe" ; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cannot build tests when cross compiling" >&5 -printf "%s\n" "$as_me: WARNING: cannot build tests when cross compiling" >&2;} - build_tests=no - else - as_fn_error $? "*** Tests not supported when cross compiling" "$LINENO" 5 - fi -fi + } -# Check whether --enable-tests-crossbuild was given. -if test ${enable_tests_crossbuild+y} -then : - enableval=$enable_tests_crossbuild; build_tests="$enableval" + namespace test_general_range_based_for_loop + { -fi + struct iter + { + int i; + int& operator* () + { + return i; + } -if test "x$build_tests" != "xno" ; then + const int& operator* () const + { + return i; + } + iter& operator++() + { + ++i; + return *this; + } + }; + struct sentinel + { + int i; + }; + bool operator== (const iter& i, const sentinel& s) + { + return i.i == s.i; + } + bool operator!= (const iter& i, const sentinel& s) + { + return !(i == s); + } + struct range + { + iter begin() const + { + return {0}; + } + sentinel end() const + { + return {5}; + } + }; -if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. -set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_path_PKG_CONFIG+y} -then : - printf %s "(cached) " >&6 -else $as_nop - case $PKG_CONFIG in - [\\/]* | ?:[\\/]*) - ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_path_PKG_CONFIG="$as_dir$ac_word$ac_exec_ext" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS + void f() + { + range r {}; - ;; -esac -fi -PKG_CONFIG=$ac_cv_path_PKG_CONFIG -if test -n "$PKG_CONFIG"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 -printf "%s\n" "$PKG_CONFIG" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi + for (auto i : r) + { + [[maybe_unused]] auto v = i; + } + } + } -fi -if test -z "$ac_cv_path_PKG_CONFIG"; then - ac_pt_PKG_CONFIG=$PKG_CONFIG - # Extract the first word of "pkg-config", so it can be a program name with args. -set dummy pkg-config; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_path_ac_pt_PKG_CONFIG+y} -then : - printf %s "(cached) " >&6 -else $as_nop - case $ac_pt_PKG_CONFIG in - [\\/]* | ?:[\\/]*) - ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_path_ac_pt_PKG_CONFIG="$as_dir$ac_word$ac_exec_ext" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS + namespace test_lambda_capture_asterisk_this_by_value + { - ;; -esac -fi -ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG -if test -n "$ac_pt_PKG_CONFIG"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 -printf "%s\n" "$ac_pt_PKG_CONFIG" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi + struct t + { + int i; + int foo() + { + return [*this]() + { + return i; + }(); + } + }; - if test "x$ac_pt_PKG_CONFIG" = x; then - PKG_CONFIG="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - PKG_CONFIG=$ac_pt_PKG_CONFIG - fi -else - PKG_CONFIG="$ac_cv_path_PKG_CONFIG" -fi + } -fi -if test -n "$PKG_CONFIG"; then - _pkg_min_version=0.9.0 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 -printf %s "checking pkg-config is at least version $_pkg_min_version... " >&6; } - if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } - else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } - PKG_CONFIG="" - fi -fi + namespace test_enum_class_construction + { -pkg_failed=no -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gmock" >&5 -printf %s "checking for gmock... " >&6; } + enum class byte : unsigned char + {}; -if test -n "$GMOCK_CFLAGS"; then - pkg_cv_GMOCK_CFLAGS="$GMOCK_CFLAGS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gmock\""; } >&5 - ($PKG_CONFIG --exists --print-errors "gmock") 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_GMOCK_CFLAGS=`$PKG_CONFIG --cflags "gmock" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes -else - pkg_failed=yes -fi - else - pkg_failed=untried -fi -if test -n "$GMOCK_LIBS"; then - pkg_cv_GMOCK_LIBS="$GMOCK_LIBS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gmock\""; } >&5 - ($PKG_CONFIG --exists --print-errors "gmock") 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_GMOCK_LIBS=`$PKG_CONFIG --libs "gmock" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes -else - pkg_failed=yes -fi - else - pkg_failed=untried -fi + byte foo {42}; + } + namespace test_constexpr_if + { -if test $pkg_failed = yes; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + template + int f () + { + if constexpr(cond) + { + return 13; + } + else + { + return 42; + } + } -if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then - _pkg_short_errors_supported=yes -else - _pkg_short_errors_supported=no -fi - if test $_pkg_short_errors_supported = yes; then - GMOCK_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "gmock" 2>&1` - else - GMOCK_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "gmock" 2>&1` - fi - # Put the nasty error message in config.log where it belongs - echo "$GMOCK_PKG_ERRORS" >&5 + } - have_gmock=no -elif test $pkg_failed = untried; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } - have_gmock=no -else - GMOCK_CFLAGS=$pkg_cv_GMOCK_CFLAGS - GMOCK_LIBS=$pkg_cv_GMOCK_LIBS - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } - have_gmock=yes -fi - if test "x$have_gmock" = "xno" ; then - if test "x$build_tests" = "xmaybe" ; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: gmock could not be found, not building tests" >&5 -printf "%s\n" "$as_me: WARNING: gmock could not be found, not building tests" >&2;} - build_tests=no - else - as_fn_error $? "tests require gmock" "$LINENO" 5 - fi - else + namespace test_selection_statement_with_initializer + { -pkg_failed=no -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gmock >= 1.12.0" >&5 -printf %s "checking for gmock >= 1.12.0... " >&6; } + int f() + { + return 13; + } -if test -n "$GMOCK112_CFLAGS"; then - pkg_cv_GMOCK112_CFLAGS="$GMOCK112_CFLAGS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gmock >= 1.12.0\""; } >&5 - ($PKG_CONFIG --exists --print-errors "gmock >= 1.12.0") 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_GMOCK112_CFLAGS=`$PKG_CONFIG --cflags "gmock >= 1.12.0" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes -else - pkg_failed=yes -fi - else - pkg_failed=untried -fi -if test -n "$GMOCK112_LIBS"; then - pkg_cv_GMOCK112_LIBS="$GMOCK112_LIBS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gmock >= 1.12.0\""; } >&5 - ($PKG_CONFIG --exists --print-errors "gmock >= 1.12.0") 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_GMOCK112_LIBS=`$PKG_CONFIG --libs "gmock >= 1.12.0" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes -else - pkg_failed=yes -fi - else - pkg_failed=untried -fi + int f2() + { + if (auto i = f(); i > 0) + { + return 3; + } + switch (auto i = f(); i + 4) + { + case 17: + return 2; + default: + return 1; + } + } -if test $pkg_failed = yes; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + } -if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then - _pkg_short_errors_supported=yes -else - _pkg_short_errors_supported=no -fi - if test $_pkg_short_errors_supported = yes; then - GMOCK112_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "gmock >= 1.12.0" 2>&1` - else - GMOCK112_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "gmock >= 1.12.0" 2>&1` - fi - # Put the nasty error message in config.log where it belongs - echo "$GMOCK112_PKG_ERRORS" >&5 + namespace test_template_argument_deduction_for_class_templates + { - have_gmock_v112=no -elif test $pkg_failed = untried; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } - have_gmock_v112=no -else - GMOCK112_CFLAGS=$pkg_cv_GMOCK112_CFLAGS - GMOCK112_LIBS=$pkg_cv_GMOCK112_LIBS - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } - have_gmock_v112=yes -fi - if test "x$have_gmock_v112" = "xyes" ; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether user namespaces are supported" >&5 -printf %s "checking whether user namespaces are supported... " >&6; } -if test ${ares_cv_user_namespace+y} -then : - printf %s "(cached) " >&6 -else $as_nop + template + struct pair + { + pair (T1 p1, T2 p2) + : m1 {p1}, + m2 {p2} + {} - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu + T1 m1; + T2 m2; + }; - if test "$cross_compiling" = yes -then : - ares_cv_user_namespace=no -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + void f() + { + [[maybe_unused]] auto p = pair{13, 42u}; + } -#define _GNU_SOURCE -#include -#include -#include -#include -#include -#include -#include + } -int userfn(void *d) { - usleep(100000); /* synchronize by sleep */ - return (getuid() != 0); -} -char userst[1024*1024]; -int main() { - char buffer[1024]; - int rc, status, fd; - pid_t child = clone(userfn, userst + 1024*1024, CLONE_NEWUSER|SIGCHLD, 0); - if (child < 0) return 1; + namespace test_non_type_auto_template_parameters + { - snprintf(buffer, sizeof(buffer), "/proc/%d/uid_map", child); - fd = open(buffer, O_CREAT|O_WRONLY|O_TRUNC, 0755); - snprintf(buffer, sizeof(buffer), "0 %d 1\n", getuid()); - write(fd, buffer, strlen(buffer)); - close(fd); + template + struct B + {}; - rc = waitpid(child, &status, 0); - if (rc <= 0) return 1; - if (!WIFEXITED(status)) return 1; - return WEXITSTATUS(status); -} + B<5> b1; + B<'a'> b2; -_ACEOF -if ac_fn_c_try_run "$LINENO" -then : - ares_cv_user_namespace=yes -else $as_nop - ares_cv_user_namespace=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi + } - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu + namespace test_structured_bindings + { + int arr[2] = { 1, 2 }; + std::pair pr = { 1, 2 }; -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ares_cv_user_namespace" >&5 -printf "%s\n" "$ares_cv_user_namespace" >&6; } - if test "$ares_cv_user_namespace" = yes; then + auto f1() -> int(&)[2] + { + return arr; + } -printf "%s\n" "#define HAVE_USER_NAMESPACE 1" >>confdefs.h + auto f2() -> std::pair& + { + return pr; + } - fi + struct S + { + int x1 : 2; + volatile double y1; + }; - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether UTS namespaces are supported" >&5 -printf %s "checking whether UTS namespaces are supported... " >&6; } -if test ${ares_cv_uts_namespace+y} -then : - printf %s "(cached) " >&6 -else $as_nop + S f3() + { + return {}; + } - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu + auto [ x1, y1 ] = f1(); + auto& [ xr1, yr1 ] = f1(); + auto [ x2, y2 ] = f2(); + auto& [ xr2, yr2 ] = f2(); + const auto [ x3, y3 ] = f3(); - if test "$cross_compiling" = yes -then : - ares_cv_uts_namespace=no -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + } -#define _GNU_SOURCE -#include -#include -#include -#include -#include -#include -#include -#include + namespace test_exception_spec_type_system + { -int utsfn(void *d) { - char buffer[1024]; - const char *name = "autoconftest"; - int rc = sethostname(name, strlen(name)); - if (rc != 0) return 1; - gethostname(buffer, 1024); - return (strcmp(buffer, name) != 0); -} + struct Good {}; + struct Bad {}; -char st2[1024*1024]; -int fn(void *d) { - pid_t child; - int rc, status; - usleep(100000); /* synchronize by sleep */ - if (getuid() != 0) return 1; - child = clone(utsfn, st2 + 1024*1024, CLONE_NEWUTS|SIGCHLD, 0); - if (child < 0) return 1; - rc = waitpid(child, &status, 0); - if (rc <= 0) return 1; - if (!WIFEXITED(status)) return 1; - return WEXITSTATUS(status); -} -char st[1024*1024]; -int main() { - char buffer[1024]; - int rc, status, fd; - pid_t child = clone(fn, st + 1024*1024, CLONE_NEWUSER|SIGCHLD, 0); - if (child < 0) return 1; + void g1() noexcept; + void g2(); - snprintf(buffer, sizeof(buffer), "/proc/%d/uid_map", child); - fd = open(buffer, O_CREAT|O_WRONLY|O_TRUNC, 0755); - snprintf(buffer, sizeof(buffer), "0 %d 1\n", getuid()); - write(fd, buffer, strlen(buffer)); - close(fd); + template + Bad + f(T*, T*); + + template + Good + f(T1*, T2*); + + static_assert (std::is_same_v); + + } + + namespace test_inline_variables + { + + template void f(T) + {} + + template inline T g(T) + { + return T{}; + } + + template<> inline void f<>(int) + {} + + template<> int g<>(int) + { + return 5; + } + + } + +} // namespace cxx17 + +#endif // (defined _MSVC_LANG ? _MSVC_LANG : __cplusplus) < 201703L - rc = waitpid(child, &status, 0); - if (rc <= 0) return 1; - if (!WIFEXITED(status)) return 1; - return WEXITSTATUS(status); -} _ACEOF -if ac_fn_c_try_run "$LINENO" +if ac_fn_cxx_try_compile "$LINENO" then : - ares_cv_uts_namespace=yes + eval $cachevar=yes else $as_nop - ares_cv_uts_namespace=no + eval $cachevar=no fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + CXX="$ac_save_CXX" fi - - ac_ext=c +eval ac_res=\$$cachevar + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test x\$$cachevar = xyes; then + CXX="$CXX $switch" + if test -n "$CXXCPP" ; then + CXXCPP="$CXXCPP $switch" + fi + ac_success=yes + break + fi + done + if test x$ac_success = xyes; then + break + fi + done + fi + ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu + if test x$ax_cxx_compile_cxx17_required = xtrue; then + if test x$ac_success = xno; then + as_fn_error $? "*** A compiler with support for C++17 language features is required." "$LINENO" 5 + fi + fi + if test x$ac_success = xno; then + HAVE_CXX17=0 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: No compiler with C++17 support was found" >&5 +printf "%s\n" "$as_me: No compiler with C++17 support was found" >&6;} + else + HAVE_CXX17=1 -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ares_cv_uts_namespace" >&5 -printf "%s\n" "$ares_cv_uts_namespace" >&6; } - if test "$ares_cv_uts_namespace" = yes; then - -printf "%s\n" "#define HAVE_UTS_NAMESPACE 1" >>confdefs.h - - fi +printf "%s\n" "#define HAVE_CXX17 1" >>confdefs.h - fi fi -fi -if test "x$build_tests" != "xno" ; then - build_tests=yes - ax_cxx_compile_alternatives="14 1y" ax_cxx_compile_cxx14_required=true + + else + ax_cxx_compile_alternatives="14 1y" ax_cxx_compile_cxx14_required=true ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -24919,6 +26893,12 @@ printf "%s\n" "#define HAVE_CXX14 1" >>confdefs.h fi + fi + fi +fi +if test "x$build_tests" != "xno" ; then + build_tests=yes + if test "$ac_cv_native_windows" != "yes" ; then @@ -25023,7 +27003,7 @@ ax_pthread_flags="pthreads none -Kthread -pthread -pthreads -mthreads pthread -- case $host_os in - freebsd*) + freebsd*|midnightbsd*) # -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able) # lthread: LinuxThreads port on FreeBSD (also preferred to -pthread) @@ -26258,7 +28238,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by c-ares $as_me 1.34.4, which was +This file was extended by c-ares $as_me 1.34.6, which was generated by GNU Autoconf 2.71. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -26326,7 +28306,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ -c-ares config.status 1.34.4 +c-ares config.status 1.34.6 configured by $0, generated by GNU Autoconf 2.71, with options \\"\$ac_cs_config\\" @@ -26492,12 +28472,14 @@ lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_q lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' +FILECMD='`$ECHO "$FILECMD" | $SED "$delay_single_quote_subst"`' deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' +lt_ar_flags='`$ECHO "$lt_ar_flags" | $SED "$delay_single_quote_subst"`' AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' @@ -26675,13 +28657,13 @@ LN_S \ lt_SP2NL \ lt_NL2SP \ reload_flag \ +FILECMD \ deplibs_check_method \ file_magic_cmd \ file_magic_glob \ want_nocaseglob \ sharedlib_from_linklib_cmd \ AR \ -AR_FLAGS \ archiver_list_spec \ STRIP \ RANLIB \ @@ -27684,6 +29666,9 @@ to_host_file_cmd=$lt_cv_to_host_file_cmd # convert \$build files to toolchain format. to_tool_file_cmd=$lt_cv_to_tool_file_cmd +# A file(cmd) program that detects file types. +FILECMD=$lt_FILECMD + # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method @@ -27702,8 +29687,11 @@ sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd # The archiver. AR=$lt_AR +# Flags to create an archive (by configure). +lt_ar_flags=$lt_ar_flags + # Flags to create an archive. -AR_FLAGS=$lt_AR_FLAGS +AR_FLAGS=\${ARFLAGS-"\$lt_ar_flags"} # How to feed a file listing to the archiver. archiver_list_spec=$lt_archiver_list_spec @@ -28093,7 +30081,7 @@ ltmain=$ac_aux_dir/ltmain.sh # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? - sed '$q' "$ltmain" >> "$cfgfile" \ + $SED '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || diff --git a/lib/c-ares-1.34.4/configure.ac b/lib/c-ares-1.34.6/configure.ac similarity index 98% rename from lib/c-ares-1.34.4/configure.ac rename to lib/c-ares-1.34.6/configure.ac index 9dacf1fb2e4..744a99be56a 100644 --- a/lib/c-ares-1.34.4/configure.ac +++ b/lib/c-ares-1.34.6/configure.ac @@ -2,10 +2,10 @@ dnl Copyright (C) The c-ares project and its contributors dnl SPDX-License-Identifier: MIT AC_PREREQ([2.69]) -AC_INIT([c-ares], [1.34.4], +AC_INIT([c-ares], [1.34.6], [c-ares mailing list: http://lists.haxx.se/listinfo/c-ares]) -CARES_VERSION_INFO="21:3:19" +CARES_VERSION_INFO="21:5:19" dnl This flag accepts an argument of the form current[:revision[:age]]. So, dnl passing -version-info 3:12:1 sets current to 3, revision to 12, and age to dnl 1. @@ -40,7 +40,8 @@ AC_CONFIG_HEADERS([src/lib/ares_config.h include/ares_build.h]) AC_CONFIG_AUX_DIR(config) AC_CONFIG_MACRO_DIR([m4]) AC_USE_SYSTEM_EXTENSIONS -AX_CXX_COMPILE_STDCXX_14([noext],[optional]) +AX_CXX_COMPILE_STDCXX(14,[noext],[optional]) +AX_CXX_COMPILE_STDCXX(17,[noext],[optional]) AM_INIT_AUTOMAKE([foreign subdir-objects 1.9.6]) LT_INIT([win32-dll,pic,disable-fast-install,aix-soname=svr4]) AC_LANG([C]) @@ -594,6 +595,7 @@ AC_CHECK_DECL(pipe, [AC_DEFINE([HAVE_PIPE], 1, [Define t AC_CHECK_DECL(pipe2, [AC_DEFINE([HAVE_PIPE2], 1, [Define to 1 if you have `pipe2`] )], [], $cares_all_includes) AC_CHECK_DECL(kqueue, [AC_DEFINE([HAVE_KQUEUE], 1, [Define to 1 if you have `kqueue`] )], [], $cares_all_includes) AC_CHECK_DECL(epoll_create1, [AC_DEFINE([HAVE_EPOLL], 1, [Define to 1 if you have `epoll_{create1,ctl,wait}`])], [], $cares_all_includes) +AC_CHECK_DECL(GetBestRoute2, [AC_DEFINE([HAVE_GETBESTROUTE2], 1, [Define to 1 if you have `GetBestRoute2`] )], [], $cares_all_includes) AC_CHECK_DECL(ConvertInterfaceIndexToLuid, [AC_DEFINE([HAVE_CONVERTINTERFACEINDEXTOLUID], 1, [Define to 1 if you have `ConvertInterfaceIndexToLuid`])], [], $cares_all_includes) AC_CHECK_DECL(ConvertInterfaceLuidToNameA, [AC_DEFINE([HAVE_CONVERTINTERFACELUIDTONAMEA], 1, [Define to 1 if you have `ConvertInterfaceLuidToNameA`])], [], $cares_all_includes) AC_CHECK_DECL(NotifyIpInterfaceChange, [AC_DEFINE([HAVE_NOTIFYIPINTERFACECHANGE], 1, [Define to 1 if you have `NotifyIpInterfaceChange`] )], [], $cares_all_includes) @@ -805,14 +807,6 @@ BUILD_SUBDIRS="include src docs" dnl ******** TESTS ******* -if test "x$build_tests" != "xno" -a "x$HAVE_CXX14" = "0" ; then - if test "x$build_tests" = "xmaybe" ; then - AC_MSG_WARN([cannot build tests without a CXX14 compiler]) - build_tests=no - else - AC_MSG_ERROR([*** Building tests requires a CXX14 compiler]) - fi -fi if test "x$build_tests" != "xno" -a "x$cross_compiling" = "xyes" ; then if test "x$build_tests" = "xmaybe" ; then AC_MSG_WARN([cannot build tests when cross compiling]) @@ -843,12 +837,19 @@ if test "x$build_tests" != "xno" ; then ARES_CHECK_USER_NAMESPACE ARES_CHECK_UTS_NAMESPACE fi + PKG_CHECK_MODULES([GMOCK117], [gmock >= 1.17.0], [ have_gmock_v117=yes ], [ have_gmock_v117=no ]) + if test "x$have_gmock_v117" = "xyes" ; then + dnl GMock v1.17.0 requires C++17 or higher + AX_CXX_COMPILE_STDCXX(17,[noext],[mandatory]) + else + dnl older version needed v1.14.0 + AX_CXX_COMPILE_STDCXX(14,[noext],[mandatory]) + fi fi fi if test "x$build_tests" != "xno" ; then build_tests=yes - AX_CXX_COMPILE_STDCXX_14([noext],[mandatory]) if test "$ac_cv_native_windows" != "yes" ; then AX_PTHREAD([ CARES_TEST_PTHREADS="yes" ], [ AC_MSG_ERROR([threading required for tests]) ]) fi diff --git a/lib/c-ares-1.34.4/docs/CMakeLists.txt b/lib/c-ares-1.34.6/docs/CMakeLists.txt similarity index 100% rename from lib/c-ares-1.34.4/docs/CMakeLists.txt rename to lib/c-ares-1.34.6/docs/CMakeLists.txt diff --git a/lib/c-ares-1.34.4/docs/Makefile.am b/lib/c-ares-1.34.6/docs/Makefile.am similarity index 100% rename from lib/c-ares-1.34.4/docs/Makefile.am rename to lib/c-ares-1.34.6/docs/Makefile.am diff --git a/lib/c-ares-1.34.4/docs/Makefile.in b/lib/c-ares-1.34.6/docs/Makefile.in similarity index 99% rename from lib/c-ares-1.34.4/docs/Makefile.in rename to lib/c-ares-1.34.6/docs/Makefile.in index 0d1873c9662..501364eb8d9 100644 --- a/lib/c-ares-1.34.4/docs/Makefile.in +++ b/lib/c-ares-1.34.6/docs/Makefile.in @@ -107,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ares_check_user_namespace.m4 \ $(top_srcdir)/m4/ax_code_coverage.m4 \ $(top_srcdir)/m4/ax_compiler_vendor.m4 \ $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \ - $(top_srcdir)/m4/ax_cxx_compile_stdcxx_14.m4 \ $(top_srcdir)/m4/ax_file_escapes.m4 \ $(top_srcdir)/m4/ax_pthread.m4 \ $(top_srcdir)/m4/ax_require_defined.m4 \ @@ -223,14 +222,18 @@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ +FILECMD = @FILECMD@ GCOV = @GCOV@ GENHTML = @GENHTML@ GMOCK112_CFLAGS = @GMOCK112_CFLAGS@ GMOCK112_LIBS = @GMOCK112_LIBS@ +GMOCK117_CFLAGS = @GMOCK117_CFLAGS@ +GMOCK117_LIBS = @GMOCK117_LIBS@ GMOCK_CFLAGS = @GMOCK_CFLAGS@ GMOCK_LIBS = @GMOCK_LIBS@ GREP = @GREP@ HAVE_CXX14 = @HAVE_CXX14@ +HAVE_CXX17 = @HAVE_CXX17@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ diff --git a/lib/c-ares-1.34.4/docs/Makefile.inc b/lib/c-ares-1.34.6/docs/Makefile.inc similarity index 100% rename from lib/c-ares-1.34.4/docs/Makefile.inc rename to lib/c-ares-1.34.6/docs/Makefile.inc diff --git a/lib/c-ares-1.34.4/docs/adig.1 b/lib/c-ares-1.34.6/docs/adig.1 similarity index 100% rename from lib/c-ares-1.34.4/docs/adig.1 rename to lib/c-ares-1.34.6/docs/adig.1 diff --git a/lib/c-ares-1.34.4/docs/ahost.1 b/lib/c-ares-1.34.6/docs/ahost.1 similarity index 100% rename from lib/c-ares-1.34.4/docs/ahost.1 rename to lib/c-ares-1.34.6/docs/ahost.1 diff --git a/lib/c-ares-1.34.4/docs/ares_cancel.3 b/lib/c-ares-1.34.6/docs/ares_cancel.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_cancel.3 rename to lib/c-ares-1.34.6/docs/ares_cancel.3 diff --git a/lib/c-ares-1.34.4/docs/ares_create_query.3 b/lib/c-ares-1.34.6/docs/ares_create_query.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_create_query.3 rename to lib/c-ares-1.34.6/docs/ares_create_query.3 diff --git a/lib/c-ares-1.34.4/docs/ares_destroy.3 b/lib/c-ares-1.34.6/docs/ares_destroy.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_destroy.3 rename to lib/c-ares-1.34.6/docs/ares_destroy.3 diff --git a/lib/c-ares-1.34.4/docs/ares_destroy_options.3 b/lib/c-ares-1.34.6/docs/ares_destroy_options.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_destroy_options.3 rename to lib/c-ares-1.34.6/docs/ares_destroy_options.3 diff --git a/lib/c-ares-1.34.4/docs/ares_dns_class_fromstr.3 b/lib/c-ares-1.34.6/docs/ares_dns_class_fromstr.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_dns_class_fromstr.3 rename to lib/c-ares-1.34.6/docs/ares_dns_class_fromstr.3 diff --git a/lib/c-ares-1.34.4/docs/ares_dns_class_t.3 b/lib/c-ares-1.34.6/docs/ares_dns_class_t.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_dns_class_t.3 rename to lib/c-ares-1.34.6/docs/ares_dns_class_t.3 diff --git a/lib/c-ares-1.34.4/docs/ares_dns_class_tostr.3 b/lib/c-ares-1.34.6/docs/ares_dns_class_tostr.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_dns_class_tostr.3 rename to lib/c-ares-1.34.6/docs/ares_dns_class_tostr.3 diff --git a/lib/c-ares-1.34.4/docs/ares_dns_datatype_t.3 b/lib/c-ares-1.34.6/docs/ares_dns_datatype_t.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_dns_datatype_t.3 rename to lib/c-ares-1.34.6/docs/ares_dns_datatype_t.3 diff --git a/lib/c-ares-1.34.4/docs/ares_dns_flags_t.3 b/lib/c-ares-1.34.6/docs/ares_dns_flags_t.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_dns_flags_t.3 rename to lib/c-ares-1.34.6/docs/ares_dns_flags_t.3 diff --git a/lib/c-ares-1.34.4/docs/ares_dns_mapping.3 b/lib/c-ares-1.34.6/docs/ares_dns_mapping.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_dns_mapping.3 rename to lib/c-ares-1.34.6/docs/ares_dns_mapping.3 diff --git a/lib/c-ares-1.34.4/docs/ares_dns_opcode_t.3 b/lib/c-ares-1.34.6/docs/ares_dns_opcode_t.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_dns_opcode_t.3 rename to lib/c-ares-1.34.6/docs/ares_dns_opcode_t.3 diff --git a/lib/c-ares-1.34.4/docs/ares_dns_opcode_tostr.3 b/lib/c-ares-1.34.6/docs/ares_dns_opcode_tostr.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_dns_opcode_tostr.3 rename to lib/c-ares-1.34.6/docs/ares_dns_opcode_tostr.3 diff --git a/lib/c-ares-1.34.4/docs/ares_dns_opt_datatype_t.3 b/lib/c-ares-1.34.6/docs/ares_dns_opt_datatype_t.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_dns_opt_datatype_t.3 rename to lib/c-ares-1.34.6/docs/ares_dns_opt_datatype_t.3 diff --git a/lib/c-ares-1.34.4/docs/ares_dns_opt_get_datatype.3 b/lib/c-ares-1.34.6/docs/ares_dns_opt_get_datatype.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_dns_opt_get_datatype.3 rename to lib/c-ares-1.34.6/docs/ares_dns_opt_get_datatype.3 diff --git a/lib/c-ares-1.34.4/docs/ares_dns_opt_get_name.3 b/lib/c-ares-1.34.6/docs/ares_dns_opt_get_name.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_dns_opt_get_name.3 rename to lib/c-ares-1.34.6/docs/ares_dns_opt_get_name.3 diff --git a/lib/c-ares-1.34.4/docs/ares_dns_parse.3 b/lib/c-ares-1.34.6/docs/ares_dns_parse.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_dns_parse.3 rename to lib/c-ares-1.34.6/docs/ares_dns_parse.3 diff --git a/lib/c-ares-1.34.4/docs/ares_dns_rcode_t.3 b/lib/c-ares-1.34.6/docs/ares_dns_rcode_t.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_dns_rcode_t.3 rename to lib/c-ares-1.34.6/docs/ares_dns_rcode_t.3 diff --git a/lib/c-ares-1.34.4/docs/ares_dns_rcode_tostr.3 b/lib/c-ares-1.34.6/docs/ares_dns_rcode_tostr.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_dns_rcode_tostr.3 rename to lib/c-ares-1.34.6/docs/ares_dns_rcode_tostr.3 diff --git a/lib/c-ares-1.34.4/docs/ares_dns_rec_type_fromstr.3 b/lib/c-ares-1.34.6/docs/ares_dns_rec_type_fromstr.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_dns_rec_type_fromstr.3 rename to lib/c-ares-1.34.6/docs/ares_dns_rec_type_fromstr.3 diff --git a/lib/c-ares-1.34.4/docs/ares_dns_rec_type_t.3 b/lib/c-ares-1.34.6/docs/ares_dns_rec_type_t.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_dns_rec_type_t.3 rename to lib/c-ares-1.34.6/docs/ares_dns_rec_type_t.3 diff --git a/lib/c-ares-1.34.4/docs/ares_dns_rec_type_tostr.3 b/lib/c-ares-1.34.6/docs/ares_dns_rec_type_tostr.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_dns_rec_type_tostr.3 rename to lib/c-ares-1.34.6/docs/ares_dns_rec_type_tostr.3 diff --git a/lib/c-ares-1.34.4/docs/ares_dns_record.3 b/lib/c-ares-1.34.6/docs/ares_dns_record.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_dns_record.3 rename to lib/c-ares-1.34.6/docs/ares_dns_record.3 diff --git a/lib/c-ares-1.34.4/docs/ares_dns_record_create.3 b/lib/c-ares-1.34.6/docs/ares_dns_record_create.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_dns_record_create.3 rename to lib/c-ares-1.34.6/docs/ares_dns_record_create.3 diff --git a/lib/c-ares-1.34.4/docs/ares_dns_record_destroy.3 b/lib/c-ares-1.34.6/docs/ares_dns_record_destroy.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_dns_record_destroy.3 rename to lib/c-ares-1.34.6/docs/ares_dns_record_destroy.3 diff --git a/lib/c-ares-1.34.4/docs/ares_dns_record_duplicate.3 b/lib/c-ares-1.34.6/docs/ares_dns_record_duplicate.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_dns_record_duplicate.3 rename to lib/c-ares-1.34.6/docs/ares_dns_record_duplicate.3 diff --git a/lib/c-ares-1.34.4/docs/ares_dns_record_get_flags.3 b/lib/c-ares-1.34.6/docs/ares_dns_record_get_flags.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_dns_record_get_flags.3 rename to lib/c-ares-1.34.6/docs/ares_dns_record_get_flags.3 diff --git a/lib/c-ares-1.34.4/docs/ares_dns_record_get_id.3 b/lib/c-ares-1.34.6/docs/ares_dns_record_get_id.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_dns_record_get_id.3 rename to lib/c-ares-1.34.6/docs/ares_dns_record_get_id.3 diff --git a/lib/c-ares-1.34.4/docs/ares_dns_record_get_opcode.3 b/lib/c-ares-1.34.6/docs/ares_dns_record_get_opcode.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_dns_record_get_opcode.3 rename to lib/c-ares-1.34.6/docs/ares_dns_record_get_opcode.3 diff --git a/lib/c-ares-1.34.4/docs/ares_dns_record_get_rcode.3 b/lib/c-ares-1.34.6/docs/ares_dns_record_get_rcode.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_dns_record_get_rcode.3 rename to lib/c-ares-1.34.6/docs/ares_dns_record_get_rcode.3 diff --git a/lib/c-ares-1.34.4/docs/ares_dns_record_query_add.3 b/lib/c-ares-1.34.6/docs/ares_dns_record_query_add.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_dns_record_query_add.3 rename to lib/c-ares-1.34.6/docs/ares_dns_record_query_add.3 diff --git a/lib/c-ares-1.34.4/docs/ares_dns_record_query_cnt.3 b/lib/c-ares-1.34.6/docs/ares_dns_record_query_cnt.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_dns_record_query_cnt.3 rename to lib/c-ares-1.34.6/docs/ares_dns_record_query_cnt.3 diff --git a/lib/c-ares-1.34.4/docs/ares_dns_record_query_get.3 b/lib/c-ares-1.34.6/docs/ares_dns_record_query_get.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_dns_record_query_get.3 rename to lib/c-ares-1.34.6/docs/ares_dns_record_query_get.3 diff --git a/lib/c-ares-1.34.4/docs/ares_dns_record_query_set_name.3 b/lib/c-ares-1.34.6/docs/ares_dns_record_query_set_name.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_dns_record_query_set_name.3 rename to lib/c-ares-1.34.6/docs/ares_dns_record_query_set_name.3 diff --git a/lib/c-ares-1.34.4/docs/ares_dns_record_query_set_type.3 b/lib/c-ares-1.34.6/docs/ares_dns_record_query_set_type.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_dns_record_query_set_type.3 rename to lib/c-ares-1.34.6/docs/ares_dns_record_query_set_type.3 diff --git a/lib/c-ares-1.34.4/docs/ares_dns_record_rr_add.3 b/lib/c-ares-1.34.6/docs/ares_dns_record_rr_add.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_dns_record_rr_add.3 rename to lib/c-ares-1.34.6/docs/ares_dns_record_rr_add.3 diff --git a/lib/c-ares-1.34.4/docs/ares_dns_record_rr_cnt.3 b/lib/c-ares-1.34.6/docs/ares_dns_record_rr_cnt.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_dns_record_rr_cnt.3 rename to lib/c-ares-1.34.6/docs/ares_dns_record_rr_cnt.3 diff --git a/lib/c-ares-1.34.4/docs/ares_dns_record_rr_del.3 b/lib/c-ares-1.34.6/docs/ares_dns_record_rr_del.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_dns_record_rr_del.3 rename to lib/c-ares-1.34.6/docs/ares_dns_record_rr_del.3 diff --git a/lib/c-ares-1.34.4/docs/ares_dns_record_rr_get.3 b/lib/c-ares-1.34.6/docs/ares_dns_record_rr_get.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_dns_record_rr_get.3 rename to lib/c-ares-1.34.6/docs/ares_dns_record_rr_get.3 diff --git a/lib/c-ares-1.34.4/docs/ares_dns_record_rr_get_const.3 b/lib/c-ares-1.34.6/docs/ares_dns_record_rr_get_const.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_dns_record_rr_get_const.3 rename to lib/c-ares-1.34.6/docs/ares_dns_record_rr_get_const.3 diff --git a/lib/c-ares-1.34.4/docs/ares_dns_record_set_id.3 b/lib/c-ares-1.34.6/docs/ares_dns_record_set_id.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_dns_record_set_id.3 rename to lib/c-ares-1.34.6/docs/ares_dns_record_set_id.3 diff --git a/lib/c-ares-1.34.4/docs/ares_dns_rr.3 b/lib/c-ares-1.34.6/docs/ares_dns_rr.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_dns_rr.3 rename to lib/c-ares-1.34.6/docs/ares_dns_rr.3 diff --git a/lib/c-ares-1.34.4/docs/ares_dns_rr_add_abin.3 b/lib/c-ares-1.34.6/docs/ares_dns_rr_add_abin.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_dns_rr_add_abin.3 rename to lib/c-ares-1.34.6/docs/ares_dns_rr_add_abin.3 diff --git a/lib/c-ares-1.34.4/docs/ares_dns_rr_del_abin.3 b/lib/c-ares-1.34.6/docs/ares_dns_rr_del_abin.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_dns_rr_del_abin.3 rename to lib/c-ares-1.34.6/docs/ares_dns_rr_del_abin.3 diff --git a/lib/c-ares-1.34.4/docs/ares_dns_rr_del_opt_byid.3 b/lib/c-ares-1.34.6/docs/ares_dns_rr_del_opt_byid.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_dns_rr_del_opt_byid.3 rename to lib/c-ares-1.34.6/docs/ares_dns_rr_del_opt_byid.3 diff --git a/lib/c-ares-1.34.4/docs/ares_dns_rr_get_abin.3 b/lib/c-ares-1.34.6/docs/ares_dns_rr_get_abin.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_dns_rr_get_abin.3 rename to lib/c-ares-1.34.6/docs/ares_dns_rr_get_abin.3 diff --git a/lib/c-ares-1.34.4/docs/ares_dns_rr_get_abin_cnt.3 b/lib/c-ares-1.34.6/docs/ares_dns_rr_get_abin_cnt.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_dns_rr_get_abin_cnt.3 rename to lib/c-ares-1.34.6/docs/ares_dns_rr_get_abin_cnt.3 diff --git a/lib/c-ares-1.34.4/docs/ares_dns_rr_get_addr.3 b/lib/c-ares-1.34.6/docs/ares_dns_rr_get_addr.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_dns_rr_get_addr.3 rename to lib/c-ares-1.34.6/docs/ares_dns_rr_get_addr.3 diff --git a/lib/c-ares-1.34.4/docs/ares_dns_rr_get_addr6.3 b/lib/c-ares-1.34.6/docs/ares_dns_rr_get_addr6.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_dns_rr_get_addr6.3 rename to lib/c-ares-1.34.6/docs/ares_dns_rr_get_addr6.3 diff --git a/lib/c-ares-1.34.4/docs/ares_dns_rr_get_bin.3 b/lib/c-ares-1.34.6/docs/ares_dns_rr_get_bin.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_dns_rr_get_bin.3 rename to lib/c-ares-1.34.6/docs/ares_dns_rr_get_bin.3 diff --git a/lib/c-ares-1.34.4/docs/ares_dns_rr_get_class.3 b/lib/c-ares-1.34.6/docs/ares_dns_rr_get_class.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_dns_rr_get_class.3 rename to lib/c-ares-1.34.6/docs/ares_dns_rr_get_class.3 diff --git a/lib/c-ares-1.34.4/docs/ares_dns_rr_get_keys.3 b/lib/c-ares-1.34.6/docs/ares_dns_rr_get_keys.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_dns_rr_get_keys.3 rename to lib/c-ares-1.34.6/docs/ares_dns_rr_get_keys.3 diff --git a/lib/c-ares-1.34.4/docs/ares_dns_rr_get_name.3 b/lib/c-ares-1.34.6/docs/ares_dns_rr_get_name.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_dns_rr_get_name.3 rename to lib/c-ares-1.34.6/docs/ares_dns_rr_get_name.3 diff --git a/lib/c-ares-1.34.4/docs/ares_dns_rr_get_opt.3 b/lib/c-ares-1.34.6/docs/ares_dns_rr_get_opt.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_dns_rr_get_opt.3 rename to lib/c-ares-1.34.6/docs/ares_dns_rr_get_opt.3 diff --git a/lib/c-ares-1.34.4/docs/ares_dns_rr_get_opt_byid.3 b/lib/c-ares-1.34.6/docs/ares_dns_rr_get_opt_byid.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_dns_rr_get_opt_byid.3 rename to lib/c-ares-1.34.6/docs/ares_dns_rr_get_opt_byid.3 diff --git a/lib/c-ares-1.34.4/docs/ares_dns_rr_get_opt_cnt.3 b/lib/c-ares-1.34.6/docs/ares_dns_rr_get_opt_cnt.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_dns_rr_get_opt_cnt.3 rename to lib/c-ares-1.34.6/docs/ares_dns_rr_get_opt_cnt.3 diff --git a/lib/c-ares-1.34.4/docs/ares_dns_rr_get_str.3 b/lib/c-ares-1.34.6/docs/ares_dns_rr_get_str.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_dns_rr_get_str.3 rename to lib/c-ares-1.34.6/docs/ares_dns_rr_get_str.3 diff --git a/lib/c-ares-1.34.4/docs/ares_dns_rr_get_ttl.3 b/lib/c-ares-1.34.6/docs/ares_dns_rr_get_ttl.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_dns_rr_get_ttl.3 rename to lib/c-ares-1.34.6/docs/ares_dns_rr_get_ttl.3 diff --git a/lib/c-ares-1.34.4/docs/ares_dns_rr_get_type.3 b/lib/c-ares-1.34.6/docs/ares_dns_rr_get_type.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_dns_rr_get_type.3 rename to lib/c-ares-1.34.6/docs/ares_dns_rr_get_type.3 diff --git a/lib/c-ares-1.34.4/docs/ares_dns_rr_get_u16.3 b/lib/c-ares-1.34.6/docs/ares_dns_rr_get_u16.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_dns_rr_get_u16.3 rename to lib/c-ares-1.34.6/docs/ares_dns_rr_get_u16.3 diff --git a/lib/c-ares-1.34.4/docs/ares_dns_rr_get_u32.3 b/lib/c-ares-1.34.6/docs/ares_dns_rr_get_u32.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_dns_rr_get_u32.3 rename to lib/c-ares-1.34.6/docs/ares_dns_rr_get_u32.3 diff --git a/lib/c-ares-1.34.4/docs/ares_dns_rr_get_u8.3 b/lib/c-ares-1.34.6/docs/ares_dns_rr_get_u8.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_dns_rr_get_u8.3 rename to lib/c-ares-1.34.6/docs/ares_dns_rr_get_u8.3 diff --git a/lib/c-ares-1.34.4/docs/ares_dns_rr_key_datatype.3 b/lib/c-ares-1.34.6/docs/ares_dns_rr_key_datatype.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_dns_rr_key_datatype.3 rename to lib/c-ares-1.34.6/docs/ares_dns_rr_key_datatype.3 diff --git a/lib/c-ares-1.34.4/docs/ares_dns_rr_key_t.3 b/lib/c-ares-1.34.6/docs/ares_dns_rr_key_t.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_dns_rr_key_t.3 rename to lib/c-ares-1.34.6/docs/ares_dns_rr_key_t.3 diff --git a/lib/c-ares-1.34.4/docs/ares_dns_rr_key_to_rec_type.3 b/lib/c-ares-1.34.6/docs/ares_dns_rr_key_to_rec_type.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_dns_rr_key_to_rec_type.3 rename to lib/c-ares-1.34.6/docs/ares_dns_rr_key_to_rec_type.3 diff --git a/lib/c-ares-1.34.4/docs/ares_dns_rr_key_tostr.3 b/lib/c-ares-1.34.6/docs/ares_dns_rr_key_tostr.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_dns_rr_key_tostr.3 rename to lib/c-ares-1.34.6/docs/ares_dns_rr_key_tostr.3 diff --git a/lib/c-ares-1.34.4/docs/ares_dns_rr_set_addr.3 b/lib/c-ares-1.34.6/docs/ares_dns_rr_set_addr.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_dns_rr_set_addr.3 rename to lib/c-ares-1.34.6/docs/ares_dns_rr_set_addr.3 diff --git a/lib/c-ares-1.34.4/docs/ares_dns_rr_set_addr6.3 b/lib/c-ares-1.34.6/docs/ares_dns_rr_set_addr6.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_dns_rr_set_addr6.3 rename to lib/c-ares-1.34.6/docs/ares_dns_rr_set_addr6.3 diff --git a/lib/c-ares-1.34.4/docs/ares_dns_rr_set_bin.3 b/lib/c-ares-1.34.6/docs/ares_dns_rr_set_bin.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_dns_rr_set_bin.3 rename to lib/c-ares-1.34.6/docs/ares_dns_rr_set_bin.3 diff --git a/lib/c-ares-1.34.4/docs/ares_dns_rr_set_opt.3 b/lib/c-ares-1.34.6/docs/ares_dns_rr_set_opt.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_dns_rr_set_opt.3 rename to lib/c-ares-1.34.6/docs/ares_dns_rr_set_opt.3 diff --git a/lib/c-ares-1.34.4/docs/ares_dns_rr_set_str.3 b/lib/c-ares-1.34.6/docs/ares_dns_rr_set_str.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_dns_rr_set_str.3 rename to lib/c-ares-1.34.6/docs/ares_dns_rr_set_str.3 diff --git a/lib/c-ares-1.34.4/docs/ares_dns_rr_set_u16.3 b/lib/c-ares-1.34.6/docs/ares_dns_rr_set_u16.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_dns_rr_set_u16.3 rename to lib/c-ares-1.34.6/docs/ares_dns_rr_set_u16.3 diff --git a/lib/c-ares-1.34.4/docs/ares_dns_rr_set_u32.3 b/lib/c-ares-1.34.6/docs/ares_dns_rr_set_u32.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_dns_rr_set_u32.3 rename to lib/c-ares-1.34.6/docs/ares_dns_rr_set_u32.3 diff --git a/lib/c-ares-1.34.4/docs/ares_dns_rr_set_u8.3 b/lib/c-ares-1.34.6/docs/ares_dns_rr_set_u8.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_dns_rr_set_u8.3 rename to lib/c-ares-1.34.6/docs/ares_dns_rr_set_u8.3 diff --git a/lib/c-ares-1.34.4/docs/ares_dns_section_t.3 b/lib/c-ares-1.34.6/docs/ares_dns_section_t.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_dns_section_t.3 rename to lib/c-ares-1.34.6/docs/ares_dns_section_t.3 diff --git a/lib/c-ares-1.34.4/docs/ares_dns_section_tostr.3 b/lib/c-ares-1.34.6/docs/ares_dns_section_tostr.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_dns_section_tostr.3 rename to lib/c-ares-1.34.6/docs/ares_dns_section_tostr.3 diff --git a/lib/c-ares-1.34.4/docs/ares_dns_write.3 b/lib/c-ares-1.34.6/docs/ares_dns_write.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_dns_write.3 rename to lib/c-ares-1.34.6/docs/ares_dns_write.3 diff --git a/lib/c-ares-1.34.4/docs/ares_dup.3 b/lib/c-ares-1.34.6/docs/ares_dup.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_dup.3 rename to lib/c-ares-1.34.6/docs/ares_dup.3 diff --git a/lib/c-ares-1.34.4/docs/ares_expand_name.3 b/lib/c-ares-1.34.6/docs/ares_expand_name.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_expand_name.3 rename to lib/c-ares-1.34.6/docs/ares_expand_name.3 diff --git a/lib/c-ares-1.34.4/docs/ares_expand_string.3 b/lib/c-ares-1.34.6/docs/ares_expand_string.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_expand_string.3 rename to lib/c-ares-1.34.6/docs/ares_expand_string.3 diff --git a/lib/c-ares-1.34.4/docs/ares_fds.3 b/lib/c-ares-1.34.6/docs/ares_fds.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_fds.3 rename to lib/c-ares-1.34.6/docs/ares_fds.3 diff --git a/lib/c-ares-1.34.4/docs/ares_free_data.3 b/lib/c-ares-1.34.6/docs/ares_free_data.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_free_data.3 rename to lib/c-ares-1.34.6/docs/ares_free_data.3 diff --git a/lib/c-ares-1.34.4/docs/ares_free_hostent.3 b/lib/c-ares-1.34.6/docs/ares_free_hostent.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_free_hostent.3 rename to lib/c-ares-1.34.6/docs/ares_free_hostent.3 diff --git a/lib/c-ares-1.34.4/docs/ares_free_string.3 b/lib/c-ares-1.34.6/docs/ares_free_string.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_free_string.3 rename to lib/c-ares-1.34.6/docs/ares_free_string.3 diff --git a/lib/c-ares-1.34.4/docs/ares_freeaddrinfo.3 b/lib/c-ares-1.34.6/docs/ares_freeaddrinfo.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_freeaddrinfo.3 rename to lib/c-ares-1.34.6/docs/ares_freeaddrinfo.3 diff --git a/lib/c-ares-1.34.4/docs/ares_get_servers.3 b/lib/c-ares-1.34.6/docs/ares_get_servers.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_get_servers.3 rename to lib/c-ares-1.34.6/docs/ares_get_servers.3 diff --git a/lib/c-ares-1.34.4/docs/ares_get_servers_csv.3 b/lib/c-ares-1.34.6/docs/ares_get_servers_csv.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_get_servers_csv.3 rename to lib/c-ares-1.34.6/docs/ares_get_servers_csv.3 diff --git a/lib/c-ares-1.34.4/docs/ares_get_servers_ports.3 b/lib/c-ares-1.34.6/docs/ares_get_servers_ports.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_get_servers_ports.3 rename to lib/c-ares-1.34.6/docs/ares_get_servers_ports.3 diff --git a/lib/c-ares-1.34.4/docs/ares_getaddrinfo.3 b/lib/c-ares-1.34.6/docs/ares_getaddrinfo.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_getaddrinfo.3 rename to lib/c-ares-1.34.6/docs/ares_getaddrinfo.3 diff --git a/lib/c-ares-1.34.4/docs/ares_gethostbyaddr.3 b/lib/c-ares-1.34.6/docs/ares_gethostbyaddr.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_gethostbyaddr.3 rename to lib/c-ares-1.34.6/docs/ares_gethostbyaddr.3 diff --git a/lib/c-ares-1.34.4/docs/ares_gethostbyname.3 b/lib/c-ares-1.34.6/docs/ares_gethostbyname.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_gethostbyname.3 rename to lib/c-ares-1.34.6/docs/ares_gethostbyname.3 diff --git a/lib/c-ares-1.34.4/docs/ares_gethostbyname_file.3 b/lib/c-ares-1.34.6/docs/ares_gethostbyname_file.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_gethostbyname_file.3 rename to lib/c-ares-1.34.6/docs/ares_gethostbyname_file.3 diff --git a/lib/c-ares-1.34.4/docs/ares_getnameinfo.3 b/lib/c-ares-1.34.6/docs/ares_getnameinfo.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_getnameinfo.3 rename to lib/c-ares-1.34.6/docs/ares_getnameinfo.3 diff --git a/lib/c-ares-1.34.4/docs/ares_getsock.3 b/lib/c-ares-1.34.6/docs/ares_getsock.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_getsock.3 rename to lib/c-ares-1.34.6/docs/ares_getsock.3 diff --git a/lib/c-ares-1.34.4/docs/ares_inet_ntop.3 b/lib/c-ares-1.34.6/docs/ares_inet_ntop.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_inet_ntop.3 rename to lib/c-ares-1.34.6/docs/ares_inet_ntop.3 diff --git a/lib/c-ares-1.34.4/docs/ares_inet_pton.3 b/lib/c-ares-1.34.6/docs/ares_inet_pton.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_inet_pton.3 rename to lib/c-ares-1.34.6/docs/ares_inet_pton.3 diff --git a/lib/c-ares-1.34.4/docs/ares_init.3 b/lib/c-ares-1.34.6/docs/ares_init.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_init.3 rename to lib/c-ares-1.34.6/docs/ares_init.3 diff --git a/lib/c-ares-1.34.4/docs/ares_init_options.3 b/lib/c-ares-1.34.6/docs/ares_init_options.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_init_options.3 rename to lib/c-ares-1.34.6/docs/ares_init_options.3 diff --git a/lib/c-ares-1.34.4/docs/ares_library_cleanup.3 b/lib/c-ares-1.34.6/docs/ares_library_cleanup.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_library_cleanup.3 rename to lib/c-ares-1.34.6/docs/ares_library_cleanup.3 diff --git a/lib/c-ares-1.34.4/docs/ares_library_init.3 b/lib/c-ares-1.34.6/docs/ares_library_init.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_library_init.3 rename to lib/c-ares-1.34.6/docs/ares_library_init.3 diff --git a/lib/c-ares-1.34.4/docs/ares_library_init_android.3 b/lib/c-ares-1.34.6/docs/ares_library_init_android.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_library_init_android.3 rename to lib/c-ares-1.34.6/docs/ares_library_init_android.3 diff --git a/lib/c-ares-1.34.4/docs/ares_library_initialized.3 b/lib/c-ares-1.34.6/docs/ares_library_initialized.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_library_initialized.3 rename to lib/c-ares-1.34.6/docs/ares_library_initialized.3 diff --git a/lib/c-ares-1.34.4/docs/ares_mkquery.3 b/lib/c-ares-1.34.6/docs/ares_mkquery.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_mkquery.3 rename to lib/c-ares-1.34.6/docs/ares_mkquery.3 diff --git a/lib/c-ares-1.34.4/docs/ares_opt_param_t.3 b/lib/c-ares-1.34.6/docs/ares_opt_param_t.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_opt_param_t.3 rename to lib/c-ares-1.34.6/docs/ares_opt_param_t.3 diff --git a/lib/c-ares-1.34.4/docs/ares_parse_a_reply.3 b/lib/c-ares-1.34.6/docs/ares_parse_a_reply.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_parse_a_reply.3 rename to lib/c-ares-1.34.6/docs/ares_parse_a_reply.3 diff --git a/lib/c-ares-1.34.4/docs/ares_parse_aaaa_reply.3 b/lib/c-ares-1.34.6/docs/ares_parse_aaaa_reply.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_parse_aaaa_reply.3 rename to lib/c-ares-1.34.6/docs/ares_parse_aaaa_reply.3 diff --git a/lib/c-ares-1.34.4/docs/ares_parse_caa_reply.3 b/lib/c-ares-1.34.6/docs/ares_parse_caa_reply.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_parse_caa_reply.3 rename to lib/c-ares-1.34.6/docs/ares_parse_caa_reply.3 diff --git a/lib/c-ares-1.34.4/docs/ares_parse_mx_reply.3 b/lib/c-ares-1.34.6/docs/ares_parse_mx_reply.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_parse_mx_reply.3 rename to lib/c-ares-1.34.6/docs/ares_parse_mx_reply.3 diff --git a/lib/c-ares-1.34.4/docs/ares_parse_naptr_reply.3 b/lib/c-ares-1.34.6/docs/ares_parse_naptr_reply.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_parse_naptr_reply.3 rename to lib/c-ares-1.34.6/docs/ares_parse_naptr_reply.3 diff --git a/lib/c-ares-1.34.4/docs/ares_parse_ns_reply.3 b/lib/c-ares-1.34.6/docs/ares_parse_ns_reply.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_parse_ns_reply.3 rename to lib/c-ares-1.34.6/docs/ares_parse_ns_reply.3 diff --git a/lib/c-ares-1.34.4/docs/ares_parse_ptr_reply.3 b/lib/c-ares-1.34.6/docs/ares_parse_ptr_reply.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_parse_ptr_reply.3 rename to lib/c-ares-1.34.6/docs/ares_parse_ptr_reply.3 diff --git a/lib/c-ares-1.34.4/docs/ares_parse_soa_reply.3 b/lib/c-ares-1.34.6/docs/ares_parse_soa_reply.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_parse_soa_reply.3 rename to lib/c-ares-1.34.6/docs/ares_parse_soa_reply.3 diff --git a/lib/c-ares-1.34.4/docs/ares_parse_srv_reply.3 b/lib/c-ares-1.34.6/docs/ares_parse_srv_reply.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_parse_srv_reply.3 rename to lib/c-ares-1.34.6/docs/ares_parse_srv_reply.3 diff --git a/lib/c-ares-1.34.4/docs/ares_parse_txt_reply.3 b/lib/c-ares-1.34.6/docs/ares_parse_txt_reply.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_parse_txt_reply.3 rename to lib/c-ares-1.34.6/docs/ares_parse_txt_reply.3 diff --git a/lib/c-ares-1.34.4/docs/ares_parse_uri_reply.3 b/lib/c-ares-1.34.6/docs/ares_parse_uri_reply.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_parse_uri_reply.3 rename to lib/c-ares-1.34.6/docs/ares_parse_uri_reply.3 diff --git a/lib/c-ares-1.34.4/docs/ares_process.3 b/lib/c-ares-1.34.6/docs/ares_process.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_process.3 rename to lib/c-ares-1.34.6/docs/ares_process.3 diff --git a/lib/c-ares-1.34.4/docs/ares_process_fd.3 b/lib/c-ares-1.34.6/docs/ares_process_fd.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_process_fd.3 rename to lib/c-ares-1.34.6/docs/ares_process_fd.3 diff --git a/lib/c-ares-1.34.4/docs/ares_process_fds.3 b/lib/c-ares-1.34.6/docs/ares_process_fds.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_process_fds.3 rename to lib/c-ares-1.34.6/docs/ares_process_fds.3 diff --git a/lib/c-ares-1.34.4/docs/ares_process_pending_write.3 b/lib/c-ares-1.34.6/docs/ares_process_pending_write.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_process_pending_write.3 rename to lib/c-ares-1.34.6/docs/ares_process_pending_write.3 diff --git a/lib/c-ares-1.34.4/docs/ares_query.3 b/lib/c-ares-1.34.6/docs/ares_query.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_query.3 rename to lib/c-ares-1.34.6/docs/ares_query.3 diff --git a/lib/c-ares-1.34.4/docs/ares_query_dnsrec.3 b/lib/c-ares-1.34.6/docs/ares_query_dnsrec.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_query_dnsrec.3 rename to lib/c-ares-1.34.6/docs/ares_query_dnsrec.3 diff --git a/lib/c-ares-1.34.4/docs/ares_queue.3 b/lib/c-ares-1.34.6/docs/ares_queue.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_queue.3 rename to lib/c-ares-1.34.6/docs/ares_queue.3 diff --git a/lib/c-ares-1.34.4/docs/ares_queue_active_queries.3 b/lib/c-ares-1.34.6/docs/ares_queue_active_queries.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_queue_active_queries.3 rename to lib/c-ares-1.34.6/docs/ares_queue_active_queries.3 diff --git a/lib/c-ares-1.34.4/docs/ares_queue_wait_empty.3 b/lib/c-ares-1.34.6/docs/ares_queue_wait_empty.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_queue_wait_empty.3 rename to lib/c-ares-1.34.6/docs/ares_queue_wait_empty.3 diff --git a/lib/c-ares-1.34.4/docs/ares_reinit.3 b/lib/c-ares-1.34.6/docs/ares_reinit.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_reinit.3 rename to lib/c-ares-1.34.6/docs/ares_reinit.3 diff --git a/lib/c-ares-1.34.4/docs/ares_save_options.3 b/lib/c-ares-1.34.6/docs/ares_save_options.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_save_options.3 rename to lib/c-ares-1.34.6/docs/ares_save_options.3 diff --git a/lib/c-ares-1.34.4/docs/ares_search.3 b/lib/c-ares-1.34.6/docs/ares_search.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_search.3 rename to lib/c-ares-1.34.6/docs/ares_search.3 diff --git a/lib/c-ares-1.34.4/docs/ares_search_dnsrec.3 b/lib/c-ares-1.34.6/docs/ares_search_dnsrec.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_search_dnsrec.3 rename to lib/c-ares-1.34.6/docs/ares_search_dnsrec.3 diff --git a/lib/c-ares-1.34.4/docs/ares_send.3 b/lib/c-ares-1.34.6/docs/ares_send.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_send.3 rename to lib/c-ares-1.34.6/docs/ares_send.3 diff --git a/lib/c-ares-1.34.4/docs/ares_send_dnsrec.3 b/lib/c-ares-1.34.6/docs/ares_send_dnsrec.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_send_dnsrec.3 rename to lib/c-ares-1.34.6/docs/ares_send_dnsrec.3 diff --git a/lib/c-ares-1.34.4/docs/ares_set_local_dev.3 b/lib/c-ares-1.34.6/docs/ares_set_local_dev.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_set_local_dev.3 rename to lib/c-ares-1.34.6/docs/ares_set_local_dev.3 diff --git a/lib/c-ares-1.34.4/docs/ares_set_local_ip4.3 b/lib/c-ares-1.34.6/docs/ares_set_local_ip4.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_set_local_ip4.3 rename to lib/c-ares-1.34.6/docs/ares_set_local_ip4.3 diff --git a/lib/c-ares-1.34.4/docs/ares_set_local_ip6.3 b/lib/c-ares-1.34.6/docs/ares_set_local_ip6.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_set_local_ip6.3 rename to lib/c-ares-1.34.6/docs/ares_set_local_ip6.3 diff --git a/lib/c-ares-1.34.4/docs/ares_set_pending_write_cb.3 b/lib/c-ares-1.34.6/docs/ares_set_pending_write_cb.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_set_pending_write_cb.3 rename to lib/c-ares-1.34.6/docs/ares_set_pending_write_cb.3 diff --git a/lib/c-ares-1.34.4/docs/ares_set_server_state_callback.3 b/lib/c-ares-1.34.6/docs/ares_set_server_state_callback.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_set_server_state_callback.3 rename to lib/c-ares-1.34.6/docs/ares_set_server_state_callback.3 diff --git a/lib/c-ares-1.34.4/docs/ares_set_servers.3 b/lib/c-ares-1.34.6/docs/ares_set_servers.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_set_servers.3 rename to lib/c-ares-1.34.6/docs/ares_set_servers.3 diff --git a/lib/c-ares-1.34.4/docs/ares_set_servers_csv.3 b/lib/c-ares-1.34.6/docs/ares_set_servers_csv.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_set_servers_csv.3 rename to lib/c-ares-1.34.6/docs/ares_set_servers_csv.3 diff --git a/lib/c-ares-1.34.4/docs/ares_set_servers_ports.3 b/lib/c-ares-1.34.6/docs/ares_set_servers_ports.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_set_servers_ports.3 rename to lib/c-ares-1.34.6/docs/ares_set_servers_ports.3 diff --git a/lib/c-ares-1.34.4/docs/ares_set_servers_ports_csv.3 b/lib/c-ares-1.34.6/docs/ares_set_servers_ports_csv.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_set_servers_ports_csv.3 rename to lib/c-ares-1.34.6/docs/ares_set_servers_ports_csv.3 diff --git a/lib/c-ares-1.34.4/docs/ares_set_socket_callback.3 b/lib/c-ares-1.34.6/docs/ares_set_socket_callback.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_set_socket_callback.3 rename to lib/c-ares-1.34.6/docs/ares_set_socket_callback.3 diff --git a/lib/c-ares-1.34.4/docs/ares_set_socket_configure_callback.3 b/lib/c-ares-1.34.6/docs/ares_set_socket_configure_callback.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_set_socket_configure_callback.3 rename to lib/c-ares-1.34.6/docs/ares_set_socket_configure_callback.3 diff --git a/lib/c-ares-1.34.4/docs/ares_set_socket_functions.3 b/lib/c-ares-1.34.6/docs/ares_set_socket_functions.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_set_socket_functions.3 rename to lib/c-ares-1.34.6/docs/ares_set_socket_functions.3 diff --git a/lib/c-ares-1.34.4/docs/ares_set_socket_functions_ex.3 b/lib/c-ares-1.34.6/docs/ares_set_socket_functions_ex.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_set_socket_functions_ex.3 rename to lib/c-ares-1.34.6/docs/ares_set_socket_functions_ex.3 diff --git a/lib/c-ares-1.34.4/docs/ares_set_sortlist.3 b/lib/c-ares-1.34.6/docs/ares_set_sortlist.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_set_sortlist.3 rename to lib/c-ares-1.34.6/docs/ares_set_sortlist.3 diff --git a/lib/c-ares-1.34.4/docs/ares_strerror.3 b/lib/c-ares-1.34.6/docs/ares_strerror.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_strerror.3 rename to lib/c-ares-1.34.6/docs/ares_strerror.3 diff --git a/lib/c-ares-1.34.4/docs/ares_svcb_param_t.3 b/lib/c-ares-1.34.6/docs/ares_svcb_param_t.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_svcb_param_t.3 rename to lib/c-ares-1.34.6/docs/ares_svcb_param_t.3 diff --git a/lib/c-ares-1.34.4/docs/ares_threadsafety.3 b/lib/c-ares-1.34.6/docs/ares_threadsafety.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_threadsafety.3 rename to lib/c-ares-1.34.6/docs/ares_threadsafety.3 diff --git a/lib/c-ares-1.34.4/docs/ares_timeout.3 b/lib/c-ares-1.34.6/docs/ares_timeout.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_timeout.3 rename to lib/c-ares-1.34.6/docs/ares_timeout.3 diff --git a/lib/c-ares-1.34.4/docs/ares_tlsa_match_t.3 b/lib/c-ares-1.34.6/docs/ares_tlsa_match_t.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_tlsa_match_t.3 rename to lib/c-ares-1.34.6/docs/ares_tlsa_match_t.3 diff --git a/lib/c-ares-1.34.4/docs/ares_tlsa_selector_t.3 b/lib/c-ares-1.34.6/docs/ares_tlsa_selector_t.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_tlsa_selector_t.3 rename to lib/c-ares-1.34.6/docs/ares_tlsa_selector_t.3 diff --git a/lib/c-ares-1.34.4/docs/ares_tlsa_usage_t.3 b/lib/c-ares-1.34.6/docs/ares_tlsa_usage_t.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_tlsa_usage_t.3 rename to lib/c-ares-1.34.6/docs/ares_tlsa_usage_t.3 diff --git a/lib/c-ares-1.34.4/docs/ares_version.3 b/lib/c-ares-1.34.6/docs/ares_version.3 similarity index 100% rename from lib/c-ares-1.34.4/docs/ares_version.3 rename to lib/c-ares-1.34.6/docs/ares_version.3 diff --git a/lib/c-ares-1.34.4/include/CMakeLists.txt b/lib/c-ares-1.34.6/include/CMakeLists.txt similarity index 100% rename from lib/c-ares-1.34.4/include/CMakeLists.txt rename to lib/c-ares-1.34.6/include/CMakeLists.txt diff --git a/lib/c-ares-1.34.4/include/Makefile.am b/lib/c-ares-1.34.6/include/Makefile.am similarity index 100% rename from lib/c-ares-1.34.4/include/Makefile.am rename to lib/c-ares-1.34.6/include/Makefile.am diff --git a/lib/c-ares-1.34.4/include/Makefile.in b/lib/c-ares-1.34.6/include/Makefile.in similarity index 99% rename from lib/c-ares-1.34.4/include/Makefile.in rename to lib/c-ares-1.34.6/include/Makefile.in index 7dc40eb08fa..3588b27a927 100644 --- a/lib/c-ares-1.34.4/include/Makefile.in +++ b/lib/c-ares-1.34.6/include/Makefile.in @@ -105,7 +105,6 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ares_check_user_namespace.m4 \ $(top_srcdir)/m4/ax_code_coverage.m4 \ $(top_srcdir)/m4/ax_compiler_vendor.m4 \ $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \ - $(top_srcdir)/m4/ax_cxx_compile_stdcxx_14.m4 \ $(top_srcdir)/m4/ax_file_escapes.m4 \ $(top_srcdir)/m4/ax_pthread.m4 \ $(top_srcdir)/m4/ax_require_defined.m4 \ @@ -234,14 +233,18 @@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ +FILECMD = @FILECMD@ GCOV = @GCOV@ GENHTML = @GENHTML@ GMOCK112_CFLAGS = @GMOCK112_CFLAGS@ GMOCK112_LIBS = @GMOCK112_LIBS@ +GMOCK117_CFLAGS = @GMOCK117_CFLAGS@ +GMOCK117_LIBS = @GMOCK117_LIBS@ GMOCK_CFLAGS = @GMOCK_CFLAGS@ GMOCK_LIBS = @GMOCK_LIBS@ GREP = @GREP@ HAVE_CXX14 = @HAVE_CXX14@ +HAVE_CXX17 = @HAVE_CXX17@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ diff --git a/lib/c-ares-1.34.4/include/ares.h b/lib/c-ares-1.34.6/include/ares.h similarity index 100% rename from lib/c-ares-1.34.4/include/ares.h rename to lib/c-ares-1.34.6/include/ares.h diff --git a/lib/c-ares-1.34.4/include/ares_build.h b/lib/c-ares-1.34.6/include/ares_build.h similarity index 100% rename from lib/c-ares-1.34.4/include/ares_build.h rename to lib/c-ares-1.34.6/include/ares_build.h diff --git a/lib/c-ares-1.34.4/include/ares_build.h.cmake b/lib/c-ares-1.34.6/include/ares_build.h.cmake similarity index 100% rename from lib/c-ares-1.34.4/include/ares_build.h.cmake rename to lib/c-ares-1.34.6/include/ares_build.h.cmake diff --git a/lib/c-ares-1.34.4/include/ares_build.h.in b/lib/c-ares-1.34.6/include/ares_build.h.in similarity index 100% rename from lib/c-ares-1.34.4/include/ares_build.h.in rename to lib/c-ares-1.34.6/include/ares_build.h.in diff --git a/lib/c-ares-1.34.4/include/ares_dns.h b/lib/c-ares-1.34.6/include/ares_dns.h similarity index 100% rename from lib/c-ares-1.34.4/include/ares_dns.h rename to lib/c-ares-1.34.6/include/ares_dns.h diff --git a/lib/c-ares-1.34.4/include/ares_dns_record.h b/lib/c-ares-1.34.6/include/ares_dns_record.h similarity index 99% rename from lib/c-ares-1.34.4/include/ares_dns_record.h rename to lib/c-ares-1.34.6/include/ares_dns_record.h index 2896eab24b3..cec9f47f63d 100644 --- a/lib/c-ares-1.34.4/include/ares_dns_record.h +++ b/lib/c-ares-1.34.6/include/ares_dns_record.h @@ -1104,7 +1104,7 @@ CARES_EXTERN ares_status_t ares_dns_write(const ares_dns_record_t *dnsrec, * (such as the ttl decrement capability). * * \param[in] dnsrec Pointer to initialized and filled DNS record object. - * \return duplicted DNS record object, or NULL on out of memory. + * \return duplicated DNS record object, or NULL on out of memory. */ CARES_EXTERN ares_dns_record_t * ares_dns_record_duplicate(const ares_dns_record_t *dnsrec); diff --git a/lib/c-ares-1.34.4/include/ares_nameser.h b/lib/c-ares-1.34.6/include/ares_nameser.h similarity index 100% rename from lib/c-ares-1.34.4/include/ares_nameser.h rename to lib/c-ares-1.34.6/include/ares_nameser.h diff --git a/lib/c-ares-1.34.4/include/ares_version.h b/lib/c-ares-1.34.6/include/ares_version.h similarity index 93% rename from lib/c-ares-1.34.4/include/ares_version.h rename to lib/c-ares-1.34.6/include/ares_version.h index 782046bd79d..006029c12df 100644 --- a/lib/c-ares-1.34.4/include/ares_version.h +++ b/lib/c-ares-1.34.6/include/ares_version.h @@ -28,12 +28,12 @@ #define ARES__VERSION_H /* This is the global package copyright */ -#define ARES_COPYRIGHT "2004 - 2024 Daniel Stenberg, ." +#define ARES_COPYRIGHT "2004 - 2025 Daniel Stenberg, ." #define ARES_VERSION_MAJOR 1 #define ARES_VERSION_MINOR 34 -#define ARES_VERSION_PATCH 4 -#define ARES_VERSION_STR "1.34.4" +#define ARES_VERSION_PATCH 6 +#define ARES_VERSION_STR "1.34.6" /* NOTE: We cannot make the version string a C preprocessor stringify operation * due to assumptions made by integrators that aren't properly using diff --git a/lib/c-ares-1.34.4/libcares.pc.cmake b/lib/c-ares-1.34.6/libcares.pc.cmake similarity index 100% rename from lib/c-ares-1.34.4/libcares.pc.cmake rename to lib/c-ares-1.34.6/libcares.pc.cmake diff --git a/lib/c-ares-1.34.4/libcares.pc.in b/lib/c-ares-1.34.6/libcares.pc.in similarity index 100% rename from lib/c-ares-1.34.4/libcares.pc.in rename to lib/c-ares-1.34.6/libcares.pc.in diff --git a/lib/c-ares-1.34.4/m4/ares_check_user_namespace.m4 b/lib/c-ares-1.34.6/m4/ares_check_user_namespace.m4 similarity index 100% rename from lib/c-ares-1.34.4/m4/ares_check_user_namespace.m4 rename to lib/c-ares-1.34.6/m4/ares_check_user_namespace.m4 diff --git a/lib/c-ares-1.34.4/m4/ares_check_uts_namespace.m4 b/lib/c-ares-1.34.6/m4/ares_check_uts_namespace.m4 similarity index 100% rename from lib/c-ares-1.34.4/m4/ares_check_uts_namespace.m4 rename to lib/c-ares-1.34.6/m4/ares_check_uts_namespace.m4 diff --git a/lib/c-ares-1.34.4/m4/ax_ac_append_to_file.m4 b/lib/c-ares-1.34.6/m4/ax_ac_append_to_file.m4 similarity index 100% rename from lib/c-ares-1.34.4/m4/ax_ac_append_to_file.m4 rename to lib/c-ares-1.34.6/m4/ax_ac_append_to_file.m4 diff --git a/lib/c-ares-1.34.4/m4/ax_ac_print_to_file.m4 b/lib/c-ares-1.34.6/m4/ax_ac_print_to_file.m4 similarity index 100% rename from lib/c-ares-1.34.4/m4/ax_ac_print_to_file.m4 rename to lib/c-ares-1.34.6/m4/ax_ac_print_to_file.m4 diff --git a/lib/c-ares-1.34.4/m4/ax_add_am_macro_static.m4 b/lib/c-ares-1.34.6/m4/ax_add_am_macro_static.m4 similarity index 100% rename from lib/c-ares-1.34.4/m4/ax_add_am_macro_static.m4 rename to lib/c-ares-1.34.6/m4/ax_add_am_macro_static.m4 diff --git a/lib/c-ares-1.34.4/m4/ax_am_macros_static.m4 b/lib/c-ares-1.34.6/m4/ax_am_macros_static.m4 similarity index 100% rename from lib/c-ares-1.34.4/m4/ax_am_macros_static.m4 rename to lib/c-ares-1.34.6/m4/ax_am_macros_static.m4 diff --git a/lib/c-ares-1.34.4/m4/ax_append_compile_flags.m4 b/lib/c-ares-1.34.6/m4/ax_append_compile_flags.m4 similarity index 100% rename from lib/c-ares-1.34.4/m4/ax_append_compile_flags.m4 rename to lib/c-ares-1.34.6/m4/ax_append_compile_flags.m4 diff --git a/lib/c-ares-1.34.4/m4/ax_append_flag.m4 b/lib/c-ares-1.34.6/m4/ax_append_flag.m4 similarity index 100% rename from lib/c-ares-1.34.4/m4/ax_append_flag.m4 rename to lib/c-ares-1.34.6/m4/ax_append_flag.m4 diff --git a/lib/c-ares-1.34.4/m4/ax_append_link_flags.m4 b/lib/c-ares-1.34.6/m4/ax_append_link_flags.m4 similarity index 100% rename from lib/c-ares-1.34.4/m4/ax_append_link_flags.m4 rename to lib/c-ares-1.34.6/m4/ax_append_link_flags.m4 diff --git a/lib/c-ares-1.34.4/m4/ax_check_compile_flag.m4 b/lib/c-ares-1.34.6/m4/ax_check_compile_flag.m4 similarity index 100% rename from lib/c-ares-1.34.4/m4/ax_check_compile_flag.m4 rename to lib/c-ares-1.34.6/m4/ax_check_compile_flag.m4 diff --git a/lib/c-ares-1.34.4/m4/ax_check_gnu_make.m4 b/lib/c-ares-1.34.6/m4/ax_check_gnu_make.m4 similarity index 100% rename from lib/c-ares-1.34.4/m4/ax_check_gnu_make.m4 rename to lib/c-ares-1.34.6/m4/ax_check_gnu_make.m4 diff --git a/lib/c-ares-1.34.4/m4/ax_check_link_flag.m4 b/lib/c-ares-1.34.6/m4/ax_check_link_flag.m4 similarity index 100% rename from lib/c-ares-1.34.4/m4/ax_check_link_flag.m4 rename to lib/c-ares-1.34.6/m4/ax_check_link_flag.m4 diff --git a/lib/c-ares-1.34.4/m4/ax_code_coverage.m4 b/lib/c-ares-1.34.6/m4/ax_code_coverage.m4 similarity index 100% rename from lib/c-ares-1.34.4/m4/ax_code_coverage.m4 rename to lib/c-ares-1.34.6/m4/ax_code_coverage.m4 diff --git a/lib/c-ares-1.34.4/m4/ax_compiler_vendor.m4 b/lib/c-ares-1.34.6/m4/ax_compiler_vendor.m4 similarity index 100% rename from lib/c-ares-1.34.4/m4/ax_compiler_vendor.m4 rename to lib/c-ares-1.34.6/m4/ax_compiler_vendor.m4 diff --git a/lib/c-ares-1.34.4/m4/ax_cxx_compile_stdcxx.m4 b/lib/c-ares-1.34.6/m4/ax_cxx_compile_stdcxx.m4 similarity index 100% rename from lib/c-ares-1.34.4/m4/ax_cxx_compile_stdcxx.m4 rename to lib/c-ares-1.34.6/m4/ax_cxx_compile_stdcxx.m4 diff --git a/lib/c-ares-1.34.4/m4/ax_file_escapes.m4 b/lib/c-ares-1.34.6/m4/ax_file_escapes.m4 similarity index 100% rename from lib/c-ares-1.34.4/m4/ax_file_escapes.m4 rename to lib/c-ares-1.34.6/m4/ax_file_escapes.m4 diff --git a/lib/c-ares-1.34.4/m4/ax_pthread.m4 b/lib/c-ares-1.34.6/m4/ax_pthread.m4 similarity index 99% rename from lib/c-ares-1.34.4/m4/ax_pthread.m4 rename to lib/c-ares-1.34.6/m4/ax_pthread.m4 index 9f35d139149..f882317660b 100644 --- a/lib/c-ares-1.34.4/m4/ax_pthread.m4 +++ b/lib/c-ares-1.34.6/m4/ax_pthread.m4 @@ -160,7 +160,7 @@ ax_pthread_flags="pthreads none -Kthread -pthread -pthreads -mthreads pthread -- case $host_os in - freebsd*) + freebsd*|midnightbsd*) # -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able) # lthread: LinuxThreads port on FreeBSD (also preferred to -pthread) diff --git a/lib/c-ares-1.34.4/m4/ax_require_defined.m4 b/lib/c-ares-1.34.6/m4/ax_require_defined.m4 similarity index 100% rename from lib/c-ares-1.34.4/m4/ax_require_defined.m4 rename to lib/c-ares-1.34.6/m4/ax_require_defined.m4 diff --git a/lib/c-ares-1.34.4/m4/libtool.m4 b/lib/c-ares-1.34.6/m4/libtool.m4 similarity index 97% rename from lib/c-ares-1.34.4/m4/libtool.m4 rename to lib/c-ares-1.34.6/m4/libtool.m4 index c4c02946dec..e7b68334557 100755 --- a/lib/c-ares-1.34.4/m4/libtool.m4 +++ b/lib/c-ares-1.34.6/m4/libtool.m4 @@ -1,6 +1,7 @@ # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # -# Copyright (C) 1996-2001, 2003-2015 Free Software Foundation, Inc. +# Copyright (C) 1996-2001, 2003-2019, 2021-2022 Free Software +# Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is free software; the Free Software Foundation gives @@ -31,7 +32,7 @@ m4_define([_LT_COPYING], [dnl # along with this program. If not, see . ]) -# serial 58 LT_INIT +# serial 59 LT_INIT # LT_PREREQ(VERSION) @@ -181,6 +182,7 @@ m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl m4_require([_LT_CMD_RELOAD])dnl +m4_require([_LT_DECL_FILECMD])dnl m4_require([_LT_CHECK_MAGIC_METHOD])dnl m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl m4_require([_LT_CMD_OLD_ARCHIVE])dnl @@ -219,8 +221,8 @@ esac ofile=libtool can_build_shared=yes -# All known linkers require a '.a' archive for static linking (except MSVC, -# which needs '.lib'). +# All known linkers require a '.a' archive for static linking (except MSVC and +# ICC, which need '.lib'). libext=a with_gnu_ld=$lt_cv_prog_gnu_ld @@ -777,7 +779,7 @@ _LT_EOF # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? - sed '$q' "$ltmain" >> "$cfgfile" \ + $SED '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || @@ -1041,8 +1043,8 @@ int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD - echo "$AR cr libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD - $AR cr libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD + echo "$AR $AR_FLAGS libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD + $AR $AR_FLAGS libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD cat > conftest.c << _LT_EOF @@ -1066,17 +1068,12 @@ _LT_EOF _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; - darwin*) # darwin 5.x on - # if running on 10.5 or later, the deployment target defaults - # to the OS version, if on x86, and 10.4, the deployment - # target defaults to 10.4. Don't you love it? - case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in - 10.0,*86*-darwin8*|10.0,*-darwin[[912]]*) - _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; - 10.[[012]][[,.]]*) - _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; - 10.*|11.*) - _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; + darwin*) + case $MACOSX_DEPLOYMENT_TARGET,$host in + 10.[[012]],*|,*powerpc*-darwin[[5-8]]*) + _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; + *) + _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; esac ;; esac @@ -1125,12 +1122,12 @@ m4_defun([_LT_DARWIN_LINKER_FEATURES], output_verbose_link_cmd=func_echo_all _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" - _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" - _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" + _LT_TAGVAR(archive_expsym_cmds, $1)="$SED 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" + _LT_TAGVAR(module_expsym_cmds, $1)="$SED -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" m4_if([$1], [CXX], [ if test yes != "$lt_cv_apple_cc_single_mod"; then _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil" - _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil" + _LT_TAGVAR(archive_expsym_cmds, $1)="$SED 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil" fi ],[]) else @@ -1244,7 +1241,8 @@ _LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) # _LT_WITH_SYSROOT # ---------------- AC_DEFUN([_LT_WITH_SYSROOT], -[AC_MSG_CHECKING([for sysroot]) +[m4_require([_LT_DECL_SED])dnl +AC_MSG_CHECKING([for sysroot]) AC_ARG_WITH([sysroot], [AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@], [Search for dependent libraries within DIR (or the compiler's sysroot @@ -1261,7 +1259,7 @@ case $with_sysroot in #( fi ;; #( /*) - lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` + lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"` ;; #( no|'') ;; #( @@ -1291,7 +1289,7 @@ ia64-*-hpux*) # options accordingly. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE=32 ;; @@ -1308,7 +1306,7 @@ ia64-*-hpux*) echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test yes = "$lt_cv_prog_gnu_ld"; then - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; @@ -1320,7 +1318,7 @@ ia64-*-hpux*) ;; esac else - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; @@ -1342,7 +1340,7 @@ mips64*-*linux*) echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then emul=elf - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *32-bit*) emul="${emul}32" ;; @@ -1350,7 +1348,7 @@ mips64*-*linux*) emul="${emul}64" ;; esac - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *MSB*) emul="${emul}btsmip" ;; @@ -1358,7 +1356,7 @@ mips64*-*linux*) emul="${emul}ltsmip" ;; esac - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *N32*) emul="${emul}n32" ;; @@ -1378,14 +1376,14 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # not appear in the list. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then - case `/usr/bin/file conftest.o` in + case `$FILECMD conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) - case `/usr/bin/file conftest.o` in + case `$FILECMD conftest.o` in *x86-64*) LD="${LD-ld} -m elf32_x86_64" ;; @@ -1453,7 +1451,7 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # options accordingly. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then - case `/usr/bin/file conftest.o` in + case `$FILECMD conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) @@ -1492,9 +1490,22 @@ need_locks=$enable_libtool_lock m4_defun([_LT_PROG_AR], [AC_CHECK_TOOLS(AR, [ar], false) : ${AR=ar} -: ${AR_FLAGS=cr} _LT_DECL([], [AR], [1], [The archiver]) -_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive]) + +# Use ARFLAGS variable as AR's operation code to sync the variable naming with +# Automake. If both AR_FLAGS and ARFLAGS are specified, AR_FLAGS should have +# higher priority because thats what people were doing historically (setting +# ARFLAGS for automake and AR_FLAGS for libtool). FIXME: Make the AR_FLAGS +# variable obsoleted/removed. + +test ${AR_FLAGS+y} || AR_FLAGS=${ARFLAGS-cr} +lt_ar_flags=$AR_FLAGS +_LT_DECL([], [lt_ar_flags], [0], [Flags to create an archive (by configure)]) + +# Make AR_FLAGS overridable by 'make ARFLAGS='. Don't try to run-time override +# by AR_FLAGS because that was never working and AR_FLAGS is about to die. +_LT_DECL([], [AR_FLAGS], [\@S|@{ARFLAGS-"\@S|@lt_ar_flags"}], + [Flags to create an archive]) AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], [lt_cv_ar_at_file=no @@ -1713,7 +1724,7 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl lt_cv_sys_max_cmd_len=8192; ;; - bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*) + bitrig* | darwin* | dragonfly* | freebsd* | midnightbsd* | netbsd* | openbsd*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` @@ -1756,7 +1767,7 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then - lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` + lt_cv_sys_max_cmd_len=`echo $kargmax | $SED 's/.*[[ ]]//'` else lt_cv_sys_max_cmd_len=32768 fi @@ -2206,26 +2217,35 @@ m4_defun([_LT_CMD_STRIPLIB], striplib= old_striplib= AC_MSG_CHECKING([whether stripping libraries is possible]) -if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then - test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" - test -z "$striplib" && striplib="$STRIP --strip-unneeded" - AC_MSG_RESULT([yes]) +if test -z "$STRIP"; then + AC_MSG_RESULT([no]) else -# FIXME - insert some real tests, host_os isn't really good enough - case $host_os in - darwin*) - if test -n "$STRIP"; then + if $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then + old_striplib="$STRIP --strip-debug" + striplib="$STRIP --strip-unneeded" + AC_MSG_RESULT([yes]) + else + case $host_os in + darwin*) + # FIXME - insert some real tests, host_os isn't really good enough striplib="$STRIP -x" old_striplib="$STRIP -S" AC_MSG_RESULT([yes]) - else + ;; + freebsd*) + if $STRIP -V 2>&1 | $GREP "elftoolchain" >/dev/null; then + old_striplib="$STRIP --strip-debug" + striplib="$STRIP --strip-unneeded" + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + fi + ;; + *) AC_MSG_RESULT([no]) - fi - ;; - *) - AC_MSG_RESULT([no]) - ;; - esac + ;; + esac + fi fi _LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) _LT_DECL([], [striplib], [1]) @@ -2548,7 +2568,7 @@ cygwin* | mingw* | pw32* | cegcc*) case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' - soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' + soname_spec='`echo $libname | $SED -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) ;; @@ -2558,14 +2578,14 @@ m4_if([$1], [],[ ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' + library_names_spec='`echo $libname | $SED -e 's/^lib/pw/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' ;; esac dynamic_linker='Win32 ld.exe' ;; - *,cl*) - # Native MSVC + *,cl* | *,icl*) + # Native MSVC or ICC libname_spec='$name' soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' library_names_spec='$libname.dll.lib' @@ -2584,7 +2604,7 @@ m4_if([$1], [],[ done IFS=$lt_save_ifs # Convert to MSYS style. - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form @@ -2621,7 +2641,7 @@ m4_if([$1], [],[ ;; *) - # Assume MSVC wrapper + # Assume MSVC and ICC wrapper library_names_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; @@ -2654,7 +2674,7 @@ dgux*) shlibpath_var=LD_LIBRARY_PATH ;; -freebsd* | dragonfly*) +freebsd* | dragonfly* | midnightbsd*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then @@ -3465,7 +3485,7 @@ beos*) bsdi[[45]]*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)' - lt_cv_file_magic_cmd='/usr/bin/file -L' + lt_cv_file_magic_cmd='$FILECMD -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; @@ -3499,14 +3519,14 @@ darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; -freebsd* | dragonfly*) +freebsd* | dragonfly* | midnightbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' - lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_cmd=$FILECMD lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac @@ -3520,7 +3540,7 @@ haiku*) ;; hpux10.20* | hpux11*) - lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_cmd=$FILECMD case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' @@ -3567,7 +3587,7 @@ netbsd* | netbsdelf*-gnu) newos6*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' - lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_cmd=$FILECMD lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; @@ -3694,13 +3714,13 @@ else mingw*) lt_bad_file=conftest.nm/nofile ;; *) lt_bad_file=/dev/null ;; esac - case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in + case `"$tmp_nm" -B $lt_bad_file 2>&1 | $SED '1q'` in *$lt_bad_file* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break 2 ;; *) - case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + case `"$tmp_nm" -p /dev/null 2>&1 | $SED '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break 2 @@ -3726,7 +3746,7 @@ else # Let the user override the test. else AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) - case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in + case `$DUMPBIN -symbols -headers /dev/null 2>&1 | $SED '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols -headers" ;; @@ -3966,7 +3986,7 @@ esac if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Gets list of data symbols to import. - lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'" + lt_cv_sys_global_symbol_to_import="$SED -n -e 's/^I .* \(.*\)$/\1/p'" # Adjust the below global symbol transforms to fixup imported variables. lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" @@ -3984,20 +4004,20 @@ fi # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. -lt_cv_sys_global_symbol_to_cdecl="sed -n"\ +lt_cv_sys_global_symbol_to_cdecl="$SED -n"\ $lt_cdecl_hook\ " -e 's/^T .* \(.*\)$/extern int \1();/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address -lt_cv_sys_global_symbol_to_c_name_address="sed -n"\ +lt_cv_sys_global_symbol_to_c_name_address="$SED -n"\ $lt_c_name_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" # Transform an extracted symbol line into symbol name with lib prefix and # symbol address. -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\ +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="$SED -n"\ $lt_c_name_lib_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ @@ -4021,7 +4041,7 @@ for ac_symprfx in "" "_"; do if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function, # D for any global variable and I for any imported variable. - # Also find C++ and __fastcall symbols from MSVC++, + # Also find C++ and __fastcall symbols from MSVC++ or ICC, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK ['"\ " {last_section=section; section=\$ 3};"\ @@ -4039,9 +4059,9 @@ for ac_symprfx in "" "_"; do " s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx]" else - lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + lt_cv_sys_global_symbol_pipe="$SED -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi - lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" + lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | $SED '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no @@ -4329,7 +4349,7 @@ m4_if([$1], [CXX], [ ;; esac ;; - freebsd* | dragonfly*) + freebsd* | dragonfly* | midnightbsd*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) @@ -4412,7 +4432,7 @@ m4_if([$1], [CXX], [ _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) - case `$CC -V 2>&1 | sed 5q` in + case `$CC -V 2>&1 | $SED 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' @@ -4754,7 +4774,7 @@ m4_if([$1], [CXX], [ _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) - case `$CC -V 2>&1 | sed 5q` in + case `$CC -V 2>&1 | $SED 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' @@ -4937,7 +4957,7 @@ m4_if([$1], [CXX], [ if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else - _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' + _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi ;; pw32*) @@ -4945,7 +4965,7 @@ m4_if([$1], [CXX], [ ;; cygwin* | mingw* | cegcc*) case $cc_basename in - cl*) + cl* | icl*) _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' ;; *) @@ -5005,15 +5025,15 @@ dnl Note also adjust exclude_expsyms for C++ above. case $host_os in cygwin* | mingw* | pw32* | cegcc*) - # FIXME: the MSVC++ port hasn't been tested in a loooong time + # FIXME: the MSVC++ and ICC port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. + # Microsoft Visual C++ or Intel C++ Compiler. if test yes != "$GCC"; then with_gnu_ld=no fi ;; interix*) - # we just hope/assume this is gcc and not c89 (= MSVC++) + # we just hope/assume this is gcc and not c89 (= MSVC++ or ICC) with_gnu_ld=yes ;; openbsd* | bitrig*) @@ -5068,7 +5088,7 @@ dnl Note also adjust exclude_expsyms for C++ above. _LT_TAGVAR(whole_archive_flag_spec, $1)= fi supports_anon_versioning=no - case `$LD -v | $SED -e 's/([^)]\+)\s\+//' 2>&1` in + case `$LD -v | $SED -e 's/([[^)]]\+)\s\+//' 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... @@ -5180,6 +5200,7 @@ _LT_EOF emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='@' ;; interix[[3-9]]*) @@ -5194,7 +5215,7 @@ _LT_EOF # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$SED "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) @@ -5237,7 +5258,7 @@ _LT_EOF _LT_TAGVAR(compiler_needs_object, $1)=yes ;; esac - case `$CC -V 2>&1 | sed 5q` in + case `$CC -V 2>&1 | $SED 5q` in *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes @@ -5249,13 +5270,14 @@ _LT_EOF if test yes = "$supports_anon_versioning"; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi case $cc_basename in tcc*) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='-rdynamic' ;; xlf* | bgf* | bgxlf* | mpixlf*) @@ -5265,7 +5287,7 @@ _LT_EOF _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test yes = "$supports_anon_versioning"; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi @@ -5397,7 +5419,7 @@ _LT_EOF if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else - _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' + _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no @@ -5580,12 +5602,12 @@ _LT_EOF cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. + # Microsoft Visual C++ or Intel C++ Compiler. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in - cl*) - # Native MSVC + cl* | icl*) + # Native MSVC or ICC _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes @@ -5626,7 +5648,7 @@ _LT_EOF fi' ;; *) - # Assume MSVC wrapper + # Assume MSVC and ICC wrapper _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Tell ltmain to make .lib files, not .a files. @@ -5674,7 +5696,7 @@ _LT_EOF ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd* | dragonfly*) + freebsd* | dragonfly* | midnightbsd*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes @@ -5815,6 +5837,7 @@ _LT_EOF # Fabrice Bellard et al's Tiny C Compiler _LT_TAGVAR(ld_shlibs, $1)=yes _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' ;; esac ;; @@ -5886,6 +5909,7 @@ _LT_EOF emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='@' ;; osf3*) @@ -6656,8 +6680,8 @@ if test yes != "$_lt_caught_CXX_error"; then cygwin* | mingw* | pw32* | cegcc*) case $GXX,$cc_basename in - ,cl* | no,cl*) - # Native MSVC + ,cl* | no,cl* | ,icl* | no,icl*) + # Native MSVC or ICC # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' @@ -6755,6 +6779,7 @@ if test yes != "$_lt_caught_CXX_error"; then emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='@' ;; dgux*) @@ -6785,7 +6810,7 @@ if test yes != "$_lt_caught_CXX_error"; then _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; - freebsd* | dragonfly*) + freebsd* | dragonfly* | midnightbsd*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions _LT_TAGVAR(ld_shlibs, $1)=yes @@ -6922,7 +6947,7 @@ if test yes != "$_lt_caught_CXX_error"; then # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$SED "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in @@ -7062,13 +7087,13 @@ if test yes != "$_lt_caught_CXX_error"; then _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' if test yes = "$supports_anon_versioning"; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi ;; *) - case `$CC -V 2>&1 | sed 5q` in + case `$CC -V 2>&1 | $SED 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' @@ -8214,6 +8239,14 @@ _LT_DECL([], [DLLTOOL], [1], [DLL creation program]) AC_SUBST([DLLTOOL]) ]) +# _LT_DECL_FILECMD +# ---------------- +# Check for a file(cmd) program that can be used to detect file type and magic +m4_defun([_LT_DECL_FILECMD], +[AC_CHECK_TOOL([FILECMD], [file], [:]) +_LT_DECL([], [FILECMD], [1], [A file(cmd) program that detects file types]) +])# _LD_DECL_FILECMD + # _LT_DECL_SED # ------------ # Check for a fully-functional sed program, that truncates diff --git a/lib/c-ares-1.34.4/m4/ltoptions.m4 b/lib/c-ares-1.34.6/m4/ltoptions.m4 similarity index 99% rename from lib/c-ares-1.34.4/m4/ltoptions.m4 rename to lib/c-ares-1.34.6/m4/ltoptions.m4 index 94b08297666..b0b5e9c2126 100755 --- a/lib/c-ares-1.34.4/m4/ltoptions.m4 +++ b/lib/c-ares-1.34.6/m4/ltoptions.m4 @@ -1,7 +1,7 @@ # Helper functions for option handling. -*- Autoconf -*- # -# Copyright (C) 2004-2005, 2007-2009, 2011-2015 Free Software -# Foundation, Inc. +# Copyright (C) 2004-2005, 2007-2009, 2011-2019, 2021-2022 Free +# Software Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives diff --git a/lib/c-ares-1.34.4/m4/ltsugar.m4 b/lib/c-ares-1.34.6/m4/ltsugar.m4 similarity index 98% rename from lib/c-ares-1.34.4/m4/ltsugar.m4 rename to lib/c-ares-1.34.6/m4/ltsugar.m4 index 48bc9344a4d..902508bd93a 100755 --- a/lib/c-ares-1.34.4/m4/ltsugar.m4 +++ b/lib/c-ares-1.34.6/m4/ltsugar.m4 @@ -1,6 +1,6 @@ # ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- # -# Copyright (C) 2004-2005, 2007-2008, 2011-2015 Free Software +# Copyright (C) 2004-2005, 2007-2008, 2011-2019, 2021-2022 Free Software # Foundation, Inc. # Written by Gary V. Vaughan, 2004 # diff --git a/lib/c-ares-1.34.4/m4/ltversion.m4 b/lib/c-ares-1.34.6/m4/ltversion.m4 similarity index 66% rename from lib/c-ares-1.34.4/m4/ltversion.m4 rename to lib/c-ares-1.34.6/m4/ltversion.m4 index fa04b52a3bf..b155d0aceca 100755 --- a/lib/c-ares-1.34.4/m4/ltversion.m4 +++ b/lib/c-ares-1.34.6/m4/ltversion.m4 @@ -1,6 +1,7 @@ # ltversion.m4 -- version numbers -*- Autoconf -*- # -# Copyright (C) 2004, 2011-2015 Free Software Foundation, Inc. +# Copyright (C) 2004, 2011-2019, 2021-2022 Free Software Foundation, +# Inc. # Written by Scott James Remnant, 2004 # # This file is free software; the Free Software Foundation gives @@ -9,15 +10,15 @@ # @configure_input@ -# serial 4179 ltversion.m4 +# serial 4245 ltversion.m4 # This file is part of GNU Libtool -m4_define([LT_PACKAGE_VERSION], [2.4.6]) -m4_define([LT_PACKAGE_REVISION], [2.4.6]) +m4_define([LT_PACKAGE_VERSION], [2.4.7]) +m4_define([LT_PACKAGE_REVISION], [2.4.7]) AC_DEFUN([LTVERSION_VERSION], -[macro_version='2.4.6' -macro_revision='2.4.6' +[macro_version='2.4.7' +macro_revision='2.4.7' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) diff --git a/lib/c-ares-1.34.4/m4/lt~obsolete.m4 b/lib/c-ares-1.34.6/m4/lt~obsolete.m4 similarity index 98% rename from lib/c-ares-1.34.4/m4/lt~obsolete.m4 rename to lib/c-ares-1.34.6/m4/lt~obsolete.m4 index c6b26f88f6c..0f7a8759da8 100755 --- a/lib/c-ares-1.34.4/m4/lt~obsolete.m4 +++ b/lib/c-ares-1.34.6/m4/lt~obsolete.m4 @@ -1,7 +1,7 @@ # lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # -# Copyright (C) 2004-2005, 2007, 2009, 2011-2015 Free Software -# Foundation, Inc. +# Copyright (C) 2004-2005, 2007, 2009, 2011-2019, 2021-2022 Free +# Software Foundation, Inc. # Written by Scott James Remnant, 2004. # # This file is free software; the Free Software Foundation gives diff --git a/lib/c-ares-1.34.4/m4/pkg.m4 b/lib/c-ares-1.34.6/m4/pkg.m4 similarity index 100% rename from lib/c-ares-1.34.4/m4/pkg.m4 rename to lib/c-ares-1.34.6/m4/pkg.m4 diff --git a/lib/c-ares-1.34.4/src/CMakeLists.txt b/lib/c-ares-1.34.6/src/CMakeLists.txt similarity index 100% rename from lib/c-ares-1.34.4/src/CMakeLists.txt rename to lib/c-ares-1.34.6/src/CMakeLists.txt diff --git a/lib/c-ares-1.34.4/src/Makefile.am b/lib/c-ares-1.34.6/src/Makefile.am similarity index 100% rename from lib/c-ares-1.34.4/src/Makefile.am rename to lib/c-ares-1.34.6/src/Makefile.am diff --git a/lib/c-ares-1.34.4/src/Makefile.in b/lib/c-ares-1.34.6/src/Makefile.in similarity index 99% rename from lib/c-ares-1.34.4/src/Makefile.in rename to lib/c-ares-1.34.6/src/Makefile.in index 1f286880247..ff4275b6baf 100644 --- a/lib/c-ares-1.34.4/src/Makefile.in +++ b/lib/c-ares-1.34.6/src/Makefile.in @@ -104,7 +104,6 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ares_check_user_namespace.m4 \ $(top_srcdir)/m4/ax_code_coverage.m4 \ $(top_srcdir)/m4/ax_compiler_vendor.m4 \ $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \ - $(top_srcdir)/m4/ax_cxx_compile_stdcxx_14.m4 \ $(top_srcdir)/m4/ax_file_escapes.m4 \ $(top_srcdir)/m4/ax_pthread.m4 \ $(top_srcdir)/m4/ax_require_defined.m4 \ @@ -245,14 +244,18 @@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ +FILECMD = @FILECMD@ GCOV = @GCOV@ GENHTML = @GENHTML@ GMOCK112_CFLAGS = @GMOCK112_CFLAGS@ GMOCK112_LIBS = @GMOCK112_LIBS@ +GMOCK117_CFLAGS = @GMOCK117_CFLAGS@ +GMOCK117_LIBS = @GMOCK117_LIBS@ GMOCK_CFLAGS = @GMOCK_CFLAGS@ GMOCK_LIBS = @GMOCK_LIBS@ GREP = @GREP@ HAVE_CXX14 = @HAVE_CXX14@ +HAVE_CXX17 = @HAVE_CXX17@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ diff --git a/lib/c-ares-1.34.4/src/lib/CMakeLists.txt b/lib/c-ares-1.34.6/src/lib/CMakeLists.txt similarity index 92% rename from lib/c-ares-1.34.4/src/lib/CMakeLists.txt rename to lib/c-ares-1.34.6/src/lib/CMakeLists.txt index 9d4e10924d0..bdb2690fb67 100644 --- a/lib/c-ares-1.34.4/src/lib/CMakeLists.txt +++ b/lib/c-ares-1.34.6/src/lib/CMakeLists.txt @@ -15,6 +15,14 @@ IF (CARES_SHARED) # Include resource file in windows builds for versioned DLLs IF (WIN32) TARGET_SOURCES (${PROJECT_NAME} PRIVATE cares.rc) + + # Check for use of llvm-rc (implies clang is being used). We need to set the + # compile flags to use the correct codepage for the resource compiler. + # This is needed for the copyright symbol to be encoded correctly. + # The default codepage is 1252 (Windows Latin-1) but llvm-rc defaults to UTF-8. + if (CMAKE_RC_COMPILER MATCHES "llvm-rc") + set_source_files_properties(cares.rc PROPERTIES COMPILE_FLAGS "/C 1252") + endif() ENDIF() # Convert CARES_LIB_VERSIONINFO libtool version format into VERSION and SOVERSION diff --git a/lib/c-ares-1.34.4/src/lib/Makefile.am b/lib/c-ares-1.34.6/src/lib/Makefile.am similarity index 100% rename from lib/c-ares-1.34.4/src/lib/Makefile.am rename to lib/c-ares-1.34.6/src/lib/Makefile.am diff --git a/lib/c-ares-1.34.4/src/lib/Makefile.in b/lib/c-ares-1.34.6/src/lib/Makefile.in similarity index 99% rename from lib/c-ares-1.34.4/src/lib/Makefile.in rename to lib/c-ares-1.34.6/src/lib/Makefile.in index a45fc10b544..e92732eaf72 100644 --- a/lib/c-ares-1.34.4/src/lib/Makefile.in +++ b/lib/c-ares-1.34.6/src/lib/Makefile.in @@ -15,7 +15,7 @@ @SET_MAKE@ # aminclude_static.am generated automatically by Autoconf -# from AX_AM_MACROS_STATIC on Sat Dec 14 15:15:44 UTC 2024 +# from AX_AM_MACROS_STATIC on Mon Dec 8 16:21:41 UTC 2025 # Copyright (C) The c-ares project and its contributors # SPDX-License-Identifier: MIT @@ -115,7 +115,6 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ares_check_user_namespace.m4 \ $(top_srcdir)/m4/ax_code_coverage.m4 \ $(top_srcdir)/m4/ax_compiler_vendor.m4 \ $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \ - $(top_srcdir)/m4/ax_cxx_compile_stdcxx_14.m4 \ $(top_srcdir)/m4/ax_file_escapes.m4 \ $(top_srcdir)/m4/ax_pthread.m4 \ $(top_srcdir)/m4/ax_require_defined.m4 \ @@ -490,14 +489,18 @@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ +FILECMD = @FILECMD@ GCOV = @GCOV@ GENHTML = @GENHTML@ GMOCK112_CFLAGS = @GMOCK112_CFLAGS@ GMOCK112_LIBS = @GMOCK112_LIBS@ +GMOCK117_CFLAGS = @GMOCK117_CFLAGS@ +GMOCK117_LIBS = @GMOCK117_LIBS@ GMOCK_CFLAGS = @GMOCK_CFLAGS@ GMOCK_LIBS = @GMOCK_LIBS@ GREP = @GREP@ HAVE_CXX14 = @HAVE_CXX14@ +HAVE_CXX17 = @HAVE_CXX17@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ diff --git a/lib/c-ares-1.34.4/src/lib/Makefile.inc b/lib/c-ares-1.34.6/src/lib/Makefile.inc similarity index 100% rename from lib/c-ares-1.34.4/src/lib/Makefile.inc rename to lib/c-ares-1.34.6/src/lib/Makefile.inc diff --git a/lib/c-ares-1.34.4/src/lib/ares_addrinfo2hostent.c b/lib/c-ares-1.34.6/src/lib/ares_addrinfo2hostent.c similarity index 67% rename from lib/c-ares-1.34.4/src/lib/ares_addrinfo2hostent.c rename to lib/c-ares-1.34.6/src/lib/ares_addrinfo2hostent.c index 2bbc791157b..239ca5bce7d 100644 --- a/lib/c-ares-1.34.4/src/lib/ares_addrinfo2hostent.c +++ b/lib/c-ares-1.34.6/src/lib/ares_addrinfo2hostent.c @@ -47,119 +47,154 @@ # include #endif +static size_t hostent_nalias(const struct hostent *host) +{ + size_t i; + for (i=0; host->h_aliases != NULL && host->h_aliases[i] != NULL; i++) + ; + + return i; +} + +static size_t ai_nalias(const struct ares_addrinfo *ai) +{ + const struct ares_addrinfo_cname *cname; + size_t i = 0; + + for (cname = ai->cnames; cname != NULL; cname=cname->next) { + i++; + } + + return i; +} + +static size_t hostent_naddr(const struct hostent *host) +{ + size_t i; + for (i=0; host->h_addr_list != NULL && host->h_addr_list[i] != NULL; i++) + ; + + return i; +} + +static size_t ai_naddr(const struct ares_addrinfo *ai, int af) +{ + const struct ares_addrinfo_node *node; + size_t i = 0; + + for (node = ai->nodes; node != NULL; node=node->ai_next) { + if (af != AF_UNSPEC && af != node->ai_family) + continue; + i++; + } + + return i; +} ares_status_t ares_addrinfo2hostent(const struct ares_addrinfo *ai, int family, struct hostent **host) { struct ares_addrinfo_node *next; - struct ares_addrinfo_cname *next_cname; char **aliases = NULL; - char *addrs = NULL; + char **addrs = NULL; size_t naliases = 0; size_t naddrs = 0; - size_t alias = 0; size_t i; + size_t ealiases = 0; + size_t eaddrs = 0; if (ai == NULL || host == NULL) { return ARES_EBADQUERY; /* LCOV_EXCL_LINE: DefensiveCoding */ } - /* Use the first node of the response as the family, since hostent can only + /* Use either the host set in the passed in hosts to be filled in, or the + * first node of the response as the family, since hostent can only * represent one family. We assume getaddrinfo() returned a sorted list if * the user requested AF_UNSPEC. */ - if (family == AF_UNSPEC && ai->nodes) { - family = ai->nodes->ai_family; + if (family == AF_UNSPEC) { + if (*host != NULL && (*host)->h_addrtype != AF_UNSPEC) { + family = (*host)->h_addrtype; + } else if (ai->nodes != NULL) { + family = ai->nodes->ai_family; + } } if (family != AF_INET && family != AF_INET6) { return ARES_EBADQUERY; /* LCOV_EXCL_LINE: DefensiveCoding */ } - *host = ares_malloc(sizeof(**host)); - if (!(*host)) { - goto enomem; /* LCOV_EXCL_LINE: OutOfMemory */ + if (*host == NULL) { + *host = ares_malloc_zero(sizeof(**host)); + if (!(*host)) { + goto enomem; /* LCOV_EXCL_LINE: OutOfMemory */ + } } - memset(*host, 0, sizeof(**host)); - next = ai->nodes; - while (next) { - if (next->ai_family == family) { - ++naddrs; - } - next = next->ai_next; + (*host)->h_addrtype = (HOSTENT_ADDRTYPE_TYPE)family; + if (family == AF_INET) { + (*host)->h_length = sizeof(struct in_addr); + } else if (family == AF_INET6) { + (*host)->h_length = sizeof(struct ares_in6_addr); } - next_cname = ai->cnames; - while (next_cname) { - if (next_cname->alias) { - ++naliases; + if ((*host)->h_name == NULL) { + if (ai->cnames) { + (*host)->h_name = ares_strdup(ai->cnames->name); + if ((*host)->h_name == NULL && ai->cnames->name) { + goto enomem; /* LCOV_EXCL_LINE: OutOfMemory */ + } + } else { + (*host)->h_name = ares_strdup(ai->name); + if ((*host)->h_name == NULL && ai->name) { + goto enomem; /* LCOV_EXCL_LINE: OutOfMemory */ + } } - next_cname = next_cname->next; } - aliases = ares_malloc((naliases + 1) * sizeof(char *)); + naliases = ai_nalias(ai); + ealiases = hostent_nalias(*host); + aliases = ares_realloc_zero((*host)->h_aliases, + ealiases * sizeof(char *), + (naliases + ealiases + 1) * sizeof(char *)); if (!aliases) { goto enomem; /* LCOV_EXCL_LINE: OutOfMemory */ } (*host)->h_aliases = aliases; - memset(aliases, 0, (naliases + 1) * sizeof(char *)); if (naliases) { - for (next_cname = ai->cnames; next_cname != NULL; - next_cname = next_cname->next) { - if (next_cname->alias == NULL) { + const struct ares_addrinfo_cname *cname; + i = ealiases; + for (cname = ai->cnames; cname != NULL; cname = cname->next) { + if (cname->alias == NULL) { continue; } - aliases[alias] = ares_strdup(next_cname->alias); - if (!aliases[alias]) { + (*host)->h_aliases[i] = ares_strdup(cname->alias); + if ((*host)->h_aliases[i] == NULL) { goto enomem; /* LCOV_EXCL_LINE: OutOfMemory */ } - alias++; + i++; } } - - (*host)->h_addr_list = ares_malloc((naddrs + 1) * sizeof(char *)); - if (!(*host)->h_addr_list) { + naddrs = ai_naddr(ai, family); + eaddrs = hostent_naddr(*host); + addrs = ares_realloc_zero((*host)->h_addr_list, eaddrs * sizeof(char *), + (naddrs + eaddrs + 1) * sizeof(char *)); + if (addrs == NULL) { goto enomem; /* LCOV_EXCL_LINE: OutOfMemory */ } - - memset((*host)->h_addr_list, 0, (naddrs + 1) * sizeof(char *)); - - if (ai->cnames) { - (*host)->h_name = ares_strdup(ai->cnames->name); - if ((*host)->h_name == NULL && ai->cnames->name) { - goto enomem; /* LCOV_EXCL_LINE: OutOfMemory */ - } - } else { - (*host)->h_name = ares_strdup(ai->name); - if ((*host)->h_name == NULL && ai->name) { - goto enomem; /* LCOV_EXCL_LINE: OutOfMemory */ - } - } - - (*host)->h_addrtype = (HOSTENT_ADDRTYPE_TYPE)family; - - if (family == AF_INET) { - (*host)->h_length = sizeof(struct in_addr); - } - - if (family == AF_INET6) { - (*host)->h_length = sizeof(struct ares_in6_addr); - } + (*host)->h_addr_list = addrs; if (naddrs) { - addrs = ares_malloc(naddrs * (size_t)(*host)->h_length); - if (!addrs) { - goto enomem; /* LCOV_EXCL_LINE: OutOfMemory */ - } - - i = 0; + i = eaddrs; for (next = ai->nodes; next != NULL; next = next->ai_next) { if (next->ai_family != family) { continue; } - (*host)->h_addr_list[i] = addrs + (i * (size_t)(*host)->h_length); + (*host)->h_addr_list[i] = ares_malloc_zero((size_t)(*host)->h_length); + if ((*host)->h_addr_list[i] == NULL) { + goto enomem; /* LCOV_EXCL_LINE: OutOfMemory */ + } if (family == AF_INET6) { memcpy((*host)->h_addr_list[i], &(CARES_INADDR_CAST(const struct sockaddr_in6 *, next->ai_addr) @@ -172,15 +207,11 @@ ares_status_t ares_addrinfo2hostent(const struct ares_addrinfo *ai, int family, ->sin_addr), (size_t)(*host)->h_length); } - ++i; - } - - if (i == 0) { - ares_free(addrs); + i++; } } - if (naddrs == 0 && naliases == 0) { + if (naddrs + eaddrs == 0 && naliases + ealiases == 0) { ares_free_hostent(*host); *host = NULL; return ARES_ENODATA; diff --git a/lib/c-ares-1.34.4/src/lib/ares_addrinfo_localhost.c b/lib/c-ares-1.34.6/src/lib/ares_addrinfo_localhost.c similarity index 83% rename from lib/c-ares-1.34.4/src/lib/ares_addrinfo_localhost.c rename to lib/c-ares-1.34.6/src/lib/ares_addrinfo_localhost.c index 6f4f2a373b3..2abb0c48a6f 100644 --- a/lib/c-ares-1.34.4/src/lib/ares_addrinfo_localhost.c +++ b/lib/c-ares-1.34.6/src/lib/ares_addrinfo_localhost.c @@ -49,6 +49,19 @@ # endif #endif +static ares_bool_t ares_ai_has_family(int aftype, + const struct ares_addrinfo_node *nodes) +{ + const struct ares_addrinfo_node *node; + + for (node = nodes; node != NULL; node = node->ai_next) { + if (node->ai_family == aftype) + return ARES_TRUE; + } + + return ARES_FALSE; +} + ares_status_t ares_append_ai_node(int aftype, unsigned short port, unsigned int ttl, const void *adata, struct ares_addrinfo_node **nodes) @@ -107,7 +120,8 @@ static ares_status_t { ares_status_t status = ARES_SUCCESS; - if (aftype == AF_UNSPEC || aftype == AF_INET6) { + if ((aftype == AF_UNSPEC || aftype == AF_INET6) && + !ares_ai_has_family(AF_INET6, *nodes)) { struct ares_in6_addr addr6; ares_inet_pton(AF_INET6, "::1", &addr6); status = ares_append_ai_node(AF_INET6, port, 0, &addr6, nodes); @@ -116,7 +130,8 @@ static ares_status_t } } - if (aftype == AF_UNSPEC || aftype == AF_INET) { + if ((aftype == AF_UNSPEC || aftype == AF_INET) && + !ares_ai_has_family(AF_INET, *nodes)) { struct in_addr addr4; ares_inet_pton(AF_INET, "127.0.0.1", &addr4); status = ares_append_ai_node(AF_INET, port, 0, &addr4, nodes); @@ -150,11 +165,13 @@ static ares_status_t continue; } - if (table->Table[i].Address.si_family == AF_INET) { + if (table->Table[i].Address.si_family == AF_INET && + !ares_ai_has_family(AF_INET, *nodes)) { status = ares_append_ai_node(table->Table[i].Address.si_family, port, 0, &table->Table[i].Address.Ipv4.sin_addr, nodes); - } else if (table->Table[i].Address.si_family == AF_INET6) { + } else if (table->Table[i].Address.si_family == AF_INET6 && + !ares_ai_has_family(AF_INET6, *nodes)) { status = ares_append_ai_node(table->Table[i].Address.si_family, port, 0, &table->Table[i].Address.Ipv6.sin6_addr, nodes); @@ -195,8 +212,7 @@ ares_status_t ares_addrinfo_localhost(const char *name, unsigned short port, const struct ares_addrinfo_hints *hints, struct ares_addrinfo *ai) { - struct ares_addrinfo_node *nodes = NULL; - ares_status_t status; + ares_status_t status; /* Validate family */ switch (hints->ai_family) { @@ -208,26 +224,22 @@ ares_status_t ares_addrinfo_localhost(const char *name, unsigned short port, return ARES_EBADFAMILY; /* LCOV_EXCL_LINE: DefensiveCoding */ } + if (ai->name != NULL) { + ares_free(ai->name); + } ai->name = ares_strdup(name); - if (!ai->name) { - goto enomem; /* LCOV_EXCL_LINE: OutOfMemory */ + if (ai->name == NULL) { + status = ARES_ENOMEM; + goto done; /* LCOV_EXCL_LINE: OutOfMemory */ } - status = ares_system_loopback_addrs(hints->ai_family, port, &nodes); - - if (status == ARES_ENOTFOUND) { - status = ares_default_loopback_addrs(hints->ai_family, port, &nodes); + status = ares_system_loopback_addrs(hints->ai_family, port, &ai->nodes); + if (status != ARES_SUCCESS && status != ARES_ENOTFOUND) { + goto done; } - ares_addrinfo_cat_nodes(&ai->nodes, nodes); + status = ares_default_loopback_addrs(hints->ai_family, port, &ai->nodes); +done: return status; - -/* LCOV_EXCL_START: OutOfMemory */ -enomem: - ares_freeaddrinfo_nodes(nodes); - ares_free(ai->name); - ai->name = NULL; - return ARES_ENOMEM; - /* LCOV_EXCL_STOP */ } diff --git a/lib/c-ares-1.34.4/src/lib/ares_android.c b/lib/c-ares-1.34.6/src/lib/ares_android.c similarity index 100% rename from lib/c-ares-1.34.4/src/lib/ares_android.c rename to lib/c-ares-1.34.6/src/lib/ares_android.c diff --git a/lib/c-ares-1.34.4/src/lib/ares_android.h b/lib/c-ares-1.34.6/src/lib/ares_android.h similarity index 100% rename from lib/c-ares-1.34.4/src/lib/ares_android.h rename to lib/c-ares-1.34.6/src/lib/ares_android.h diff --git a/lib/c-ares-1.34.4/src/lib/ares_cancel.c b/lib/c-ares-1.34.6/src/lib/ares_cancel.c similarity index 100% rename from lib/c-ares-1.34.4/src/lib/ares_cancel.c rename to lib/c-ares-1.34.6/src/lib/ares_cancel.c diff --git a/lib/c-ares-1.34.4/src/lib/ares_close_sockets.c b/lib/c-ares-1.34.6/src/lib/ares_close_sockets.c similarity index 99% rename from lib/c-ares-1.34.4/src/lib/ares_close_sockets.c rename to lib/c-ares-1.34.6/src/lib/ares_close_sockets.c index fd3bf3c4b1e..347f43e6fcd 100644 --- a/lib/c-ares-1.34.4/src/lib/ares_close_sockets.c +++ b/lib/c-ares-1.34.6/src/lib/ares_close_sockets.c @@ -37,7 +37,7 @@ static void ares_requeue_queries(ares_conn_t *conn, ares_tvnow(&now); while ((query = ares_llist_first_val(conn->queries_to_conn)) != NULL) { - ares_requeue_query(query, &now, requeue_status, ARES_TRUE, NULL); + ares_requeue_query(query, &now, requeue_status, ARES_TRUE, NULL, NULL); } } diff --git a/lib/c-ares-1.34.4/src/lib/ares_config.h.cmake b/lib/c-ares-1.34.6/src/lib/ares_config.h.cmake similarity index 99% rename from lib/c-ares-1.34.4/src/lib/ares_config.h.cmake rename to lib/c-ares-1.34.6/src/lib/ares_config.h.cmake index 51744fe1438..cff18187212 100644 --- a/lib/c-ares-1.34.4/src/lib/ares_config.h.cmake +++ b/lib/c-ares-1.34.6/src/lib/ares_config.h.cmake @@ -145,6 +145,9 @@ /* Define to 1 if you have the `if_nametoindex' function. */ #cmakedefine HAVE_IF_NAMETOINDEX 1 +/* Define to 1 if you have the `GetBestRoute2' function. */ +#cmakedefine HAVE_GETBESTROUTE2 1 + /* Define to 1 if you have the `ConvertInterfaceIndexToLuid' function. */ #cmakedefine HAVE_CONVERTINTERFACEINDEXTOLUID 1 diff --git a/lib/c-ares-1.34.4/src/lib/ares_config.h.in b/lib/c-ares-1.34.6/src/lib/ares_config.h.in similarity index 99% rename from lib/c-ares-1.34.4/src/lib/ares_config.h.in rename to lib/c-ares-1.34.6/src/lib/ares_config.h.in index a62e1708935..c56e426ea59 100644 --- a/lib/c-ares-1.34.4/src/lib/ares_config.h.in +++ b/lib/c-ares-1.34.6/src/lib/ares_config.h.in @@ -87,6 +87,9 @@ /* define if the compiler supports basic C++14 syntax */ #undef HAVE_CXX14 +/* define if the compiler supports basic C++17 syntax */ +#undef HAVE_CXX17 + /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H @@ -105,6 +108,9 @@ /* fcntl() with O_NONBLOCK support */ #undef HAVE_FCNTL_O_NONBLOCK +/* Define to 1 if you have `GetBestRoute2` */ +#undef HAVE_GETBESTROUTE2 + /* Define to 1 if you have `getenv` */ #undef HAVE_GETENV diff --git a/lib/c-ares-1.34.4/src/lib/ares_conn.c b/lib/c-ares-1.34.6/src/lib/ares_conn.c similarity index 100% rename from lib/c-ares-1.34.4/src/lib/ares_conn.c rename to lib/c-ares-1.34.6/src/lib/ares_conn.c diff --git a/lib/c-ares-1.34.4/src/lib/ares_conn.h b/lib/c-ares-1.34.6/src/lib/ares_conn.h similarity index 100% rename from lib/c-ares-1.34.4/src/lib/ares_conn.h rename to lib/c-ares-1.34.6/src/lib/ares_conn.h diff --git a/lib/c-ares-1.34.4/src/lib/ares_cookie.c b/lib/c-ares-1.34.6/src/lib/ares_cookie.c similarity index 99% rename from lib/c-ares-1.34.4/src/lib/ares_cookie.c rename to lib/c-ares-1.34.6/src/lib/ares_cookie.c index f31c74e748d..509e12050e0 100644 --- a/lib/c-ares-1.34.4/src/lib/ares_cookie.c +++ b/lib/c-ares-1.34.6/src/lib/ares_cookie.c @@ -115,7 +115,7 @@ * - If `cookie.unsupported_ts` evaluates less than * `COOKIE_UNSUPPORTED_TIMEOUT` * - Ensure there is no EDNS cookie opt (10) set (shouldn't be unless - * requestor had put this themselves), then **skip any remaining + * requester had put this themselves), then **skip any remaining * processing** as we don't want to try to send cookies. * - Otherwise: * - clear all cookie settings, set `cookie.state = INITIAL`. @@ -369,7 +369,8 @@ ares_status_t ares_cookie_apply(ares_dns_record_t *dnsrec, ares_conn_t *conn, ares_status_t ares_cookie_validate(ares_query_t *query, const ares_dns_record_t *dnsresp, - ares_conn_t *conn, const ares_timeval_t *now) + ares_conn_t *conn, const ares_timeval_t *now, + ares_array_t **requeue) { ares_server_t *server = conn->server; ares_cookie_t *cookie = &server->cookie; @@ -427,7 +428,8 @@ ares_status_t ares_cookie_validate(ares_query_t *query, /* Resend the request, hopefully it will work the next time as we should * have recorded a server cookie */ ares_requeue_query(query, now, ARES_SUCCESS, - ARES_FALSE /* Don't increment try count */, NULL); + ARES_FALSE /* Don't increment try count */, NULL, + requeue); /* Parent needs to drop this response */ return ARES_EBADRESP; diff --git a/lib/c-ares-1.34.4/src/lib/ares_data.c b/lib/c-ares-1.34.6/src/lib/ares_data.c similarity index 100% rename from lib/c-ares-1.34.4/src/lib/ares_data.c rename to lib/c-ares-1.34.6/src/lib/ares_data.c diff --git a/lib/c-ares-1.34.4/src/lib/ares_data.h b/lib/c-ares-1.34.6/src/lib/ares_data.h similarity index 100% rename from lib/c-ares-1.34.4/src/lib/ares_data.h rename to lib/c-ares-1.34.6/src/lib/ares_data.h diff --git a/lib/c-ares-1.34.4/src/lib/ares_destroy.c b/lib/c-ares-1.34.6/src/lib/ares_destroy.c similarity index 100% rename from lib/c-ares-1.34.4/src/lib/ares_destroy.c rename to lib/c-ares-1.34.6/src/lib/ares_destroy.c diff --git a/lib/c-ares-1.34.4/src/lib/ares_free_hostent.c b/lib/c-ares-1.34.6/src/lib/ares_free_hostent.c similarity index 91% rename from lib/c-ares-1.34.4/src/lib/ares_free_hostent.c rename to lib/c-ares-1.34.6/src/lib/ares_free_hostent.c index bf2037238b5..dfcbdf4910b 100644 --- a/lib/c-ares-1.34.4/src/lib/ares_free_hostent.c +++ b/lib/c-ares-1.34.6/src/lib/ares_free_hostent.c @@ -44,9 +44,10 @@ void ares_free_hostent(struct hostent *host) } ares_free(host->h_aliases); if (host->h_addr_list) { - ares_free( - host->h_addr_list[0]); /* no matter if there is one or many entries, - there is only one malloc for all of them */ + size_t i; + for (i=0; host->h_addr_list[i] != NULL; i++) { + ares_free(host->h_addr_list[i]); + } ares_free(host->h_addr_list); } ares_free(host); diff --git a/lib/c-ares-1.34.4/src/lib/ares_free_string.c b/lib/c-ares-1.34.6/src/lib/ares_free_string.c similarity index 100% rename from lib/c-ares-1.34.4/src/lib/ares_free_string.c rename to lib/c-ares-1.34.6/src/lib/ares_free_string.c diff --git a/lib/c-ares-1.34.4/src/lib/ares_freeaddrinfo.c b/lib/c-ares-1.34.6/src/lib/ares_freeaddrinfo.c similarity index 100% rename from lib/c-ares-1.34.4/src/lib/ares_freeaddrinfo.c rename to lib/c-ares-1.34.6/src/lib/ares_freeaddrinfo.c diff --git a/lib/c-ares-1.34.4/src/lib/ares_getaddrinfo.c b/lib/c-ares-1.34.6/src/lib/ares_getaddrinfo.c similarity index 96% rename from lib/c-ares-1.34.4/src/lib/ares_getaddrinfo.c rename to lib/c-ares-1.34.6/src/lib/ares_getaddrinfo.c index 32791dc37dc..6009de36a3d 100644 --- a/lib/c-ares-1.34.4/src/lib/ares_getaddrinfo.c +++ b/lib/c-ares-1.34.6/src/lib/ares_getaddrinfo.c @@ -418,9 +418,13 @@ static ares_status_t file_lookup(struct host_query *hquery) * SHOULD recognize localhost names as special and SHOULD always return the * IP loopback address for address queries". * We will also ignore ALL errors when trying to resolve localhost, such - * as permissions errors reading /etc/hosts or a malformed /etc/hosts */ - if (status != ARES_SUCCESS && status != ARES_ENOMEM && - ares_is_localhost(hquery->name)) { + * as permissions errors reading /etc/hosts or a malformed /etc/hosts. + * + * Also, just because the query itself returned success from /etc/hosts + * lookup doesn't mean it returned everything it needed to for all requested + * address families. As long as we're not on a critical out of memory + * condition pass it through to fill in any other address classes. */ + if (status != ARES_ENOMEM && ares_is_localhost(hquery->name)) { return ares_addrinfo_localhost(hquery->name, hquery->port, &hquery->hints, hquery->ai); } @@ -571,6 +575,23 @@ static void host_callback(void *arg, ares_status_t status, size_t timeouts, /* at this point we keep on waiting for the next query to finish */ } +static ares_bool_t numeric_service_to_port(const char *service, + unsigned short *port) +{ + char *end; + unsigned long val; + + errno = 0; + val = strtoul(service, &end, 10); + + if (errno == 0 && *end == '\0' && val <= 65535) { + *port = (unsigned short)val; + return ARES_TRUE; + } + + return ARES_FALSE; +} + static void ares_getaddrinfo_int(ares_channel_t *channel, const char *name, const char *service, const struct ares_addrinfo_hints *hints, @@ -602,25 +623,17 @@ static void ares_getaddrinfo_int(ares_channel_t *channel, const char *name, if (service) { if (hints->ai_flags & ARES_AI_NUMERICSERV) { - unsigned long val; - errno = 0; - val = strtoul(service, NULL, 0); - if ((val == 0 && errno != 0) || val > 65535) { + if (!numeric_service_to_port(service, &port)) { callback(arg, ARES_ESERVICE, 0, NULL); return; } - port = (unsigned short)val; } else { port = lookup_service(service, 0); if (!port) { - unsigned long val; - errno = 0; - val = strtoul(service, NULL, 0); - if ((val == 0 && errno != 0) || val > 65535) { + if (!numeric_service_to_port(service, &port)) { callback(arg, ARES_ESERVICE, 0, NULL); return; } - port = (unsigned short)val; } } } diff --git a/lib/c-ares-1.34.4/src/lib/ares_getenv.c b/lib/c-ares-1.34.6/src/lib/ares_getenv.c similarity index 100% rename from lib/c-ares-1.34.4/src/lib/ares_getenv.c rename to lib/c-ares-1.34.6/src/lib/ares_getenv.c diff --git a/lib/c-ares-1.34.4/src/lib/ares_getenv.h b/lib/c-ares-1.34.6/src/lib/ares_getenv.h similarity index 100% rename from lib/c-ares-1.34.4/src/lib/ares_getenv.h rename to lib/c-ares-1.34.6/src/lib/ares_getenv.h diff --git a/lib/c-ares-1.34.4/src/lib/ares_gethostbyaddr.c b/lib/c-ares-1.34.6/src/lib/ares_gethostbyaddr.c similarity index 99% rename from lib/c-ares-1.34.4/src/lib/ares_gethostbyaddr.c rename to lib/c-ares-1.34.6/src/lib/ares_gethostbyaddr.c index a7acf3c45c9..69c509ab11b 100644 --- a/lib/c-ares-1.34.4/src/lib/ares_gethostbyaddr.c +++ b/lib/c-ares-1.34.6/src/lib/ares_gethostbyaddr.c @@ -120,7 +120,7 @@ static void next_lookup(struct addr_query *aquery) { const char *p; ares_status_t status; - struct hostent *host; + struct hostent *host = NULL; char *name; for (p = aquery->remaining_lookups; *p; p++) { diff --git a/lib/c-ares-1.34.4/src/lib/ares_gethostbyname.c b/lib/c-ares-1.34.6/src/lib/ares_gethostbyname.c similarity index 96% rename from lib/c-ares-1.34.4/src/lib/ares_gethostbyname.c rename to lib/c-ares-1.34.6/src/lib/ares_gethostbyname.c index 56de729526a..d451b468511 100644 --- a/lib/c-ares-1.34.4/src/lib/ares_gethostbyname.c +++ b/lib/c-ares-1.34.6/src/lib/ares_gethostbyname.c @@ -287,6 +287,8 @@ static ares_status_t ares_gethostbyname_file_int(ares_channel_t *channel, return ARES_ENOTFOUND; } + *host = NULL; + /* Per RFC 7686, reject queries for ".onion" domain names with NXDOMAIN. */ if (ares_is_onion_domain(name)) { return ARES_ENOTFOUND; @@ -307,9 +309,13 @@ static ares_status_t ares_gethostbyname_file_int(ares_channel_t *channel, * SHOULD recognize localhost names as special and SHOULD always return the * IP loopback address for address queries". * We will also ignore ALL errors when trying to resolve localhost, such - * as permissions errors reading /etc/hosts or a malformed /etc/hosts */ - if (status != ARES_SUCCESS && status != ARES_ENOMEM && - ares_is_localhost(name)) { + * as permissions errors reading /etc/hosts or a malformed /etc/hosts. + * + * Also, just because the query itself returned success from /etc/hosts + * lookup doesn't mean it returned everything it needed to for all requested + * address families. As long as we're not on a critical out of memory + * condition pass it through to fill in any other address classes. */ + if (status != ARES_ENOMEM && ares_is_localhost(name)) { return ares_hostent_localhost(name, family, host); } diff --git a/lib/c-ares-1.34.4/src/lib/ares_getnameinfo.c b/lib/c-ares-1.34.6/src/lib/ares_getnameinfo.c similarity index 100% rename from lib/c-ares-1.34.4/src/lib/ares_getnameinfo.c rename to lib/c-ares-1.34.6/src/lib/ares_getnameinfo.c diff --git a/lib/c-ares-1.34.4/src/lib/ares_hosts_file.c b/lib/c-ares-1.34.6/src/lib/ares_hosts_file.c similarity index 98% rename from lib/c-ares-1.34.4/src/lib/ares_hosts_file.c rename to lib/c-ares-1.34.6/src/lib/ares_hosts_file.c index 0439b8e1d47..c0fb80766a7 100644 --- a/lib/c-ares-1.34.4/src/lib/ares_hosts_file.c +++ b/lib/c-ares-1.34.6/src/lib/ares_hosts_file.c @@ -41,6 +41,11 @@ #endif #include +#ifdef USE_WINSOCK +# define DATABASEPATH "DatabasePath" +# define WIN_PATH_HOSTS "\\hosts" +#endif + /* HOSTS FILE PROCESSING OVERVIEW * ============================== * The hosts file on the system contains static entries to be processed locally @@ -845,7 +850,7 @@ ares_status_t ares_hosts_entry_to_addrinfo(const ares_hosts_entry_t *entry, ares_bool_t want_cnames, struct ares_addrinfo *ai) { - ares_status_t status; + ares_status_t status = ARES_ENOTFOUND; struct ares_addrinfo_cname *cnames = NULL; struct ares_addrinfo_node *ainodes = NULL; ares_llist_node_t *node; @@ -860,6 +865,7 @@ ares_status_t ares_hosts_entry_to_addrinfo(const ares_hosts_entry_t *entry, } if (name != NULL) { + ares_free(ai->name); ai->name = ares_strdup(name); if (ai->name == NULL) { status = ARES_ENOMEM; /* LCOV_EXCL_LINE: OutOfMemory */ @@ -888,6 +894,11 @@ ares_status_t ares_hosts_entry_to_addrinfo(const ares_hosts_entry_t *entry, } } + /* Might be ARES_ENOTFOUND here if no ips matched requested address family */ + if (status != ARES_SUCCESS) { + goto done; + } + if (want_cnames) { status = ares_hosts_ai_append_cnames(entry, &cnames); if (status != ARES_SUCCESS) { diff --git a/lib/c-ares-1.34.4/src/lib/ares_inet_net_pton.h b/lib/c-ares-1.34.6/src/lib/ares_inet_net_pton.h similarity index 100% rename from lib/c-ares-1.34.4/src/lib/ares_inet_net_pton.h rename to lib/c-ares-1.34.6/src/lib/ares_inet_net_pton.h diff --git a/lib/c-ares-1.34.4/src/lib/ares_init.c b/lib/c-ares-1.34.6/src/lib/ares_init.c similarity index 92% rename from lib/c-ares-1.34.4/src/lib/ares_init.c rename to lib/c-ares-1.34.6/src/lib/ares_init.c index ae78262a112..dc094c4df6e 100644 --- a/lib/c-ares-1.34.4/src/lib/ares_init.c +++ b/lib/c-ares-1.34.6/src/lib/ares_init.c @@ -271,6 +271,8 @@ int ares_init_options(ares_channel_t **channelptr, goto done; } + ares_set_socket_functions_def(channel); + /* Initialize Server List */ channel->servers = ares_slist_create(channel->rand_state, server_sort_cb, server_destroy_cb); @@ -346,8 +348,6 @@ int ares_init_options(ares_channel_t **channelptr, goto done; } - ares_set_socket_functions_def(channel); - /* Initialize the event thread */ if (channel->optmask & ARES_OPT_EVENT_THREAD) { ares_event_thread_t *e = NULL; @@ -362,7 +362,8 @@ int ares_init_options(ares_channel_t **channelptr, e = channel->sock_state_cb_data; status = ares_event_configchg_init(&e->configchg, e); if (status != ARES_SUCCESS && status != ARES_ENOTIMP) { - goto done; /* LCOV_EXCL_LINE: UntestablePath */ + DEBUGF(fprintf(stderr, "Error: ares_event_configchg_init failed: %s\n", + ares_strerror(status))); } status = ARES_SUCCESS; } @@ -484,16 +485,20 @@ int ares_dup(ares_channel_t **dest, const ares_channel_t *src) ares_channel_lock(src); /* Now clone the options that ares_save_options() doesn't support, but are * user-provided */ - (*dest)->sock_create_cb = src->sock_create_cb; - (*dest)->sock_create_cb_data = src->sock_create_cb_data; - (*dest)->sock_config_cb = src->sock_config_cb; - (*dest)->sock_config_cb_data = src->sock_config_cb_data; + (*dest)->sock_create_cb = src->sock_create_cb; + (*dest)->sock_create_cb_data = src->sock_create_cb_data; + (*dest)->sock_config_cb = src->sock_config_cb; + (*dest)->sock_config_cb_data = src->sock_config_cb_data; memcpy(&(*dest)->sock_funcs, &(src->sock_funcs), sizeof((*dest)->sock_funcs)); - (*dest)->sock_func_cb_data = src->sock_func_cb_data; - (*dest)->legacy_sock_funcs = src->legacy_sock_funcs; - (*dest)->legacy_sock_funcs_cb_data = src->legacy_sock_funcs_cb_data; - (*dest)->server_state_cb = src->server_state_cb; - (*dest)->server_state_cb_data = src->server_state_cb_data; + (*dest)->sock_func_cb_data = src->sock_func_cb_data; + (*dest)->legacy_sock_funcs = src->legacy_sock_funcs; + (*dest)->legacy_sock_funcs_cb_data = src->legacy_sock_funcs_cb_data; + (*dest)->server_state_cb = src->server_state_cb; + (*dest)->server_state_cb_data = src->server_state_cb_data; + (*dest)->notify_pending_write_cb = src->notify_pending_write_cb; + (*dest)->notify_pending_write_cb_data = src->notify_pending_write_cb_data; + (*dest)->query_enqueue_cb = src->query_enqueue_cb; + (*dest)->query_enqueue_cb_data = src->query_enqueue_cb_data; ares_strcpy((*dest)->local_dev_name, src->local_dev_name, sizeof((*dest)->local_dev_name)); @@ -598,3 +603,15 @@ int ares_set_sortlist(ares_channel_t *channel, const char *sortstr) ares_channel_unlock(channel); return (int)status; } + +void ares_set_query_enqueue_cb(ares_channel_t *channel, + ares_query_enqueue_cb callback, + void *user_data) +{ + if (channel == NULL) { + return; + } + + channel->query_enqueue_cb = callback; + channel->query_enqueue_cb_data = user_data; +} diff --git a/lib/c-ares-1.34.4/src/lib/ares_ipv6.h b/lib/c-ares-1.34.6/src/lib/ares_ipv6.h similarity index 89% rename from lib/c-ares-1.34.4/src/lib/ares_ipv6.h rename to lib/c-ares-1.34.6/src/lib/ares_ipv6.h index 5da341b0106..d2007cc29ec 100644 --- a/lib/c-ares-1.34.4/src/lib/ares_ipv6.h +++ b/lib/c-ares-1.34.6/src/lib/ares_ipv6.h @@ -90,6 +90,16 @@ struct addrinfo { # define NS_INT16SZ 2 #endif +/* Windows XP Compatibility with later MSVC/Mingw versions */ +#if defined(_WIN32) +# if !defined(IF_MAX_STRING_SIZE) +# define IF_MAX_STRING_SIZE 256 /* =256 in */ +# endif +# if !defined(NDIS_IF_MAX_STRING_SIZE) +# define NDIS_IF_MAX_STRING_SIZE IF_MAX_STRING_SIZE /* =256 in */ +# endif +#endif + #ifndef IF_NAMESIZE # ifdef IFNAMSIZ # define IF_NAMESIZE IFNAMSIZ diff --git a/lib/c-ares-1.34.4/src/lib/ares_library_init.c b/lib/c-ares-1.34.6/src/lib/ares_library_init.c similarity index 100% rename from lib/c-ares-1.34.4/src/lib/ares_library_init.c rename to lib/c-ares-1.34.6/src/lib/ares_library_init.c diff --git a/lib/c-ares-1.34.4/src/lib/ares_metrics.c b/lib/c-ares-1.34.6/src/lib/ares_metrics.c similarity index 99% rename from lib/c-ares-1.34.4/src/lib/ares_metrics.c rename to lib/c-ares-1.34.6/src/lib/ares_metrics.c index 13e34decc06..deb3b7febcc 100644 --- a/lib/c-ares-1.34.4/src/lib/ares_metrics.c +++ b/lib/c-ares-1.34.6/src/lib/ares_metrics.c @@ -197,7 +197,7 @@ void ares_metrics_record(const ares_query_t *query, ares_server_t *server, } if (query_ms > server->metrics[i].latency_max_ms) { - server->metrics[i].latency_min_ms = query_ms; + server->metrics[i].latency_max_ms = query_ms; } server->metrics[i].total_count++; diff --git a/lib/c-ares-1.34.4/src/lib/ares_options.c b/lib/c-ares-1.34.6/src/lib/ares_options.c similarity index 100% rename from lib/c-ares-1.34.4/src/lib/ares_options.c rename to lib/c-ares-1.34.6/src/lib/ares_options.c diff --git a/lib/c-ares-1.34.4/src/lib/ares_parse_into_addrinfo.c b/lib/c-ares-1.34.6/src/lib/ares_parse_into_addrinfo.c similarity index 100% rename from lib/c-ares-1.34.4/src/lib/ares_parse_into_addrinfo.c rename to lib/c-ares-1.34.6/src/lib/ares_parse_into_addrinfo.c diff --git a/lib/c-ares-1.34.4/src/lib/ares_private.h b/lib/c-ares-1.34.6/src/lib/ares_private.h similarity index 96% rename from lib/c-ares-1.34.4/src/lib/ares_private.h rename to lib/c-ares-1.34.6/src/lib/ares_private.h index e6d44e8b864..d6bd426d39c 100644 --- a/lib/c-ares-1.34.4/src/lib/ares_private.h +++ b/lib/c-ares-1.34.6/src/lib/ares_private.h @@ -83,21 +83,7 @@ #define CARES_INADDR_CAST(type, var) ((type)((const void *)var)) #if defined(USE_WINSOCK) - -# define WIN_NS_9X "System\\CurrentControlSet\\Services\\VxD\\MSTCP" # define WIN_NS_NT_KEY "System\\CurrentControlSet\\Services\\Tcpip\\Parameters" -# define WIN_DNSCLIENT "Software\\Policies\\Microsoft\\System\\DNSClient" -# define WIN_NT_DNSCLIENT \ - "Software\\Policies\\Microsoft\\Windows NT\\DNSClient" -# define NAMESERVER "NameServer" -# define DHCPNAMESERVER "DhcpNameServer" -# define DATABASEPATH "DatabasePath" -# define WIN_PATH_HOSTS "\\hosts" -# define SEARCHLIST_KEY "SearchList" -# define PRIMARYDNSSUFFIX_KEY "PrimaryDNSSuffix" -# define INTERFACES_KEY "Interfaces" -# define DOMAIN_KEY "Domain" -# define DHCPDOMAIN_KEY "DhcpDomain" # define PATH_RESOLV_CONF "" #elif defined(WATT32) @@ -145,6 +131,8 @@ W32_FUNC const char *_w32_GetHostsFile(void); #define DEFAULT_SERVER_RETRY_CHANCE 10 #define DEFAULT_SERVER_RETRY_DELAY 5000 +typedef void (*ares_query_enqueue_cb)(void *data); + struct ares_query; typedef struct ares_query ares_query_t; @@ -269,6 +257,9 @@ struct ares_channeldata { void *notify_pending_write_cb_data; ares_bool_t notify_pending_write; + ares_query_enqueue_cb query_enqueue_cb; + void *query_enqueue_cb_data; + /* Path for resolv.conf file, configurable via ares_options */ char *resolvconf_path; @@ -321,7 +312,8 @@ ares_status_t ares_send_query(ares_server_t *requested_server /* Optional */, ares_status_t ares_requeue_query(ares_query_t *query, const ares_timeval_t *now, ares_status_t status, ares_bool_t inc_try_count, - const ares_dns_record_t *dnsrec); + ares_dns_record_t *dnsrec, + ares_array_t **requeue); /*! Count the number of labels (dots+1) in a domain */ size_t ares_name_label_cnt(const char *name); @@ -366,6 +358,9 @@ ares_status_t ares_init_servers_state(ares_channel_t *channel); ares_status_t ares_init_by_options(ares_channel_t *channel, const struct ares_options *options, int optmask); +void ares_set_query_enqueue_cb(ares_channel_t *channel, + ares_query_enqueue_cb callback, + void *user_data); ares_status_t ares_init_by_sysconfig(ares_channel_t *channel); void ares_set_socket_functions_def(ares_channel_t *channel); @@ -455,8 +450,10 @@ ares_status_t ares_parse_ptr_reply_dnsrec(const ares_dns_record_t *dnsrec, const void *addr, int addrlen, int family, struct hostent **host); +/* host address must be valid or NULL as will create or append */ ares_status_t ares_addrinfo2hostent(const struct ares_addrinfo *ai, int family, struct hostent **host); + ares_status_t ares_addrinfo2addrttl(const struct ares_addrinfo *ai, int family, size_t req_naddrttls, struct ares_addrttl *addrttls, @@ -591,10 +588,10 @@ ares_status_t ares_qcache_create(ares_rand_state *rand_state, unsigned int max_ttl, ares_qcache_t **cache_out); void ares_qcache_flush(ares_qcache_t *cache); -ares_status_t ares_qcache_insert(ares_channel_t *channel, - const ares_timeval_t *now, - const ares_query_t *query, - ares_dns_record_t *dnsrec); +ares_status_t ares_qcache_insert(ares_channel_t *channel, + const ares_timeval_t *now, + const ares_query_t *query, + const ares_dns_record_t *dnsrec); ares_status_t ares_qcache_fetch(ares_channel_t *channel, const ares_timeval_t *now, const ares_dns_record_t *dnsrec, @@ -610,7 +607,8 @@ ares_status_t ares_cookie_apply(ares_dns_record_t *dnsrec, ares_conn_t *conn, ares_status_t ares_cookie_validate(ares_query_t *query, const ares_dns_record_t *dnsresp, ares_conn_t *conn, - const ares_timeval_t *now); + const ares_timeval_t *now, + ares_array_t **requeue); ares_status_t ares_channel_threading_init(ares_channel_t *channel); void ares_channel_threading_destroy(ares_channel_t *channel); diff --git a/lib/c-ares-1.34.4/src/lib/ares_process.c b/lib/c-ares-1.34.6/src/lib/ares_process.c similarity index 87% rename from lib/c-ares-1.34.4/src/lib/ares_process.c rename to lib/c-ares-1.34.6/src/lib/ares_process.c index 3d186ea9d58..9352968419e 100644 --- a/lib/c-ares-1.34.4/src/lib/ares_process.c +++ b/lib/c-ares-1.34.6/src/lib/ares_process.c @@ -56,14 +56,16 @@ static ares_status_t process_timeouts(ares_channel_t *channel, static ares_status_t process_answer(ares_channel_t *channel, const unsigned char *abuf, size_t alen, ares_conn_t *conn, - const ares_timeval_t *now); + const ares_timeval_t *now, + ares_array_t **requeue); static void handle_conn_error(ares_conn_t *conn, ares_bool_t critical_failure, ares_status_t failure_status); static ares_bool_t same_questions(const ares_query_t *query, const ares_dns_record_t *arec); static void end_query(ares_channel_t *channel, ares_server_t *server, ares_query_t *query, ares_status_t status, - const ares_dns_record_t *dnsrec); + ares_dns_record_t *dnsrec, + ares_array_t **requeue); static void ares_query_remove_from_conn(ares_query_t *query) { @@ -229,11 +231,14 @@ static ares_status_t ares_process_fds_nolock(ares_channel_t *channel, } if (!(flags & ARES_PROCESS_FLAG_SKIP_NON_FD)) { - ares_check_cleanup_conns(channel); status = process_timeouts(channel, &now); if (status == ARES_ENOMEM) { goto done; } + + /* Cleanup should be done after processing timeouts as it may invalidate + * connections */ + ares_check_cleanup_conns(channel); } done: @@ -510,10 +515,69 @@ static ares_status_t read_conn_packets(ares_conn_t *conn) return ARES_SUCCESS; } +typedef enum { + REQUEUE_REQUEUE = 1, + REQUEUE_ENDQUERY = 2 +} requeue_type_t; + +/* Simple data structure to store a query that needs to be requeued with + * optional server */ +typedef struct { + requeue_type_t type; /* type of entry, requeue or endquery */ + unsigned short qid; /* query id */ + ares_server_t *server; /* requeue only: optional */ + ares_status_t status; /* endquery only */ + ares_dns_record_t *dnsrec; /* endquery only: optional */ +} ares_requeue_t; + +static ares_status_t ares_append_requeue_int(ares_array_t **requeue, + requeue_type_t type, + ares_query_t *query, + ares_server_t *server, + ares_status_t status, + ares_dns_record_t *dnsrec) +{ + ares_requeue_t entry; + + if (*requeue == NULL) { + *requeue = ares_array_create(sizeof(ares_requeue_t), NULL); + if (*requeue == NULL) { + return ARES_ENOMEM; + } + } + + ares_query_remove_from_conn(query); + + entry.type = type; + entry.qid = query->qid; + entry.server = server; + entry.status = status; + entry.dnsrec = dnsrec; + return ares_array_insertdata_last(*requeue, &entry); +} + +static ares_status_t ares_append_requeue(ares_array_t **requeue, + ares_query_t *query, + ares_server_t *server) +{ + return ares_append_requeue_int(requeue, REQUEUE_REQUEUE, query, server, 0, + NULL); +} + +static ares_status_t ares_append_endqueue(ares_array_t **requeue, + ares_query_t *query, + ares_status_t status, + ares_dns_record_t *dnsrec) +{ + return ares_append_requeue_int(requeue, REQUEUE_ENDQUERY, query, NULL, status, + dnsrec); +} + static ares_status_t read_answers(ares_conn_t *conn, const ares_timeval_t *now) { ares_status_t status; - ares_channel_t *channel = conn->server->channel; + ares_channel_t *channel = conn->server->channel; + ares_array_t *requeue = NULL; /* Process all queued answers */ while (1) { @@ -550,15 +614,55 @@ static ares_status_t read_answers(ares_conn_t *conn, const ares_timeval_t *now) data_len -= 2; /* We finished reading this answer; process it */ - status = process_answer(channel, data, data_len, conn, now); + status = process_answer(channel, data, data_len, conn, now, &requeue); if (status != ARES_SUCCESS) { handle_conn_error(conn, ARES_TRUE, status); - return status; + goto cleanup; } /* Since we processed the answer, clear the tag so space can be reclaimed */ ares_buf_tag_clear(conn->in_buf); } + +cleanup: + + /* Flush requeue */ + while (ares_array_len(requeue) > 0) { + ares_query_t *query; + ares_requeue_t entry; + ares_status_t internal_status; + + internal_status = ares_array_claim_at(&entry, sizeof(entry), requeue, 0); + if (internal_status != ARES_SUCCESS) { + break; + } + + query = ares_htable_szvp_get_direct(channel->queries_by_qid, entry.qid); + + if (entry.type == REQUEUE_REQUEUE) { + /* query disappeared */ + if (query == NULL) { + continue; + } + internal_status = ares_send_query(entry.server, query, now); + /* We only care about ARES_ENOMEM */ + if (internal_status == ARES_ENOMEM) { + status = ARES_ENOMEM; + } + } else { /* REQUEUE_ENDQUERY */ + if (query != NULL) { + query->callback(query->arg, entry.status, query->timeouts, entry.dnsrec); + ares_free_query(query); + } + ares_dns_record_destroy(entry.dnsrec); + } + } + /* Don't forget to send notification if queue emptied */ + if (requeue != NULL) { + ares_queue_notify_empty(channel); + } + ares_array_destroy(requeue); + return status; } @@ -611,7 +715,8 @@ static ares_status_t process_timeouts(ares_channel_t *channel, conn = query->conn; server_increment_failures(conn->server, query->using_tcp); - status = ares_requeue_query(query, now, ARES_ETIMEOUT, ARES_TRUE, NULL); + status = ares_requeue_query(query, now, ARES_ETIMEOUT, ARES_TRUE, NULL, + NULL); if (status == ARES_ENOMEM) { goto done; } @@ -701,7 +806,8 @@ static ares_bool_t issue_might_be_edns(const ares_dns_record_t *req, static ares_status_t process_answer(ares_channel_t *channel, const unsigned char *abuf, size_t alen, ares_conn_t *conn, - const ares_timeval_t *now) + const ares_timeval_t *now, + ares_array_t **requeue) { ares_query_t *query; /* Cache these as once ares_send_query() gets called, it may end up @@ -745,7 +851,8 @@ static ares_status_t process_answer(ares_channel_t *channel, /* Validate DNS cookie in response. This function may need to requeue the * query. */ - if (ares_cookie_validate(query, rdnsrec, conn, now) != ARES_SUCCESS) { + if (ares_cookie_validate(query, rdnsrec, conn, now, requeue) + != ARES_SUCCESS) { /* Drop response and return */ status = ARES_SUCCESS; goto cleanup; @@ -764,13 +871,12 @@ static ares_status_t process_answer(ares_channel_t *channel, if (issue_might_be_edns(query->query, rdnsrec)) { status = rewrite_without_edns(query); if (status != ARES_SUCCESS) { - end_query(channel, server, query, status, NULL); + end_query(channel, server, query, status, NULL, NULL); goto cleanup; } - /* Send to same server */ - ares_send_query(server, query, now); - status = ARES_SUCCESS; + /* Requeue to same server */ + status = ares_append_requeue(requeue, query, server); goto cleanup; } @@ -782,8 +888,9 @@ static ares_status_t process_answer(ares_channel_t *channel, !(conn->flags & ARES_CONN_FLAG_TCP) && !(channel->flags & ARES_FLAG_IGNTC)) { query->using_tcp = ARES_TRUE; - ares_send_query(NULL, query, now); - status = ARES_SUCCESS; /* Switched to TCP is ok */ + status = ares_append_requeue(requeue, query, NULL); + /* Status will reflect success except on memory error, which is good since + * requeuing to TCP is ok */ goto cleanup; } @@ -809,23 +916,26 @@ static ares_status_t process_answer(ares_channel_t *channel, } server_increment_failures(server, query->using_tcp); - ares_requeue_query(query, now, status, ARES_TRUE, rdnsrec); - - /* Should any of these cause a connection termination? - * Maybe SERVER_FAILURE? */ - status = ARES_SUCCESS; + status = ares_requeue_query(query, now, status, ARES_TRUE, rdnsrec, + requeue); + rdnsrec = NULL; /* Free'd by ares_requeue_query() */ + + if (status != ARES_ENOMEM) { + /* Should any of these cause a connection termination? + * Maybe SERVER_FAILURE? */ + status = ARES_SUCCESS; + } goto cleanup; } } /* If cache insertion was successful, it took ownership. We ignore * other cache insertion failures. */ - if (ares_qcache_insert(channel, now, query, rdnsrec) == ARES_SUCCESS) { - is_cached = ARES_TRUE; - } + ares_qcache_insert(channel, now, query, rdnsrec); server_set_good(server, query->using_tcp); - end_query(channel, server, query, ARES_SUCCESS, rdnsrec); + end_query(channel, server, query, ARES_SUCCESS, rdnsrec, requeue); + rdnsrec = NULL; /* Free'd by the requeue */ status = ARES_SUCCESS; @@ -854,10 +964,14 @@ static void handle_conn_error(ares_conn_t *conn, ares_bool_t critical_failure, ares_close_connection(conn, failure_status); } +/* Requeue query will normally call ares_send_query() but in some circumstances + * this needs to be delayed, so if requeue is not NULL, it will add the query + * to the queue instead */ ares_status_t ares_requeue_query(ares_query_t *query, const ares_timeval_t *now, ares_status_t status, ares_bool_t inc_try_count, - const ares_dns_record_t *dnsrec) + ares_dns_record_t *dnsrec, + ares_array_t **requeue) { ares_channel_t *channel = query->channel; size_t max_tries = ares_slist_len(channel->servers) * channel->tries; @@ -873,6 +987,10 @@ ares_status_t ares_requeue_query(ares_query_t *query, const ares_timeval_t *now, } if (query->try_count < max_tries && !query->no_retries) { + ares_dns_record_destroy(dnsrec); + if (requeue != NULL) { + return ares_append_requeue(requeue, query, NULL); + } return ares_send_query(NULL, query, now); } @@ -881,7 +999,7 @@ ares_status_t ares_requeue_query(ares_query_t *query, const ares_timeval_t *now, query->error_status = ARES_ETIMEOUT; } - end_query(channel, NULL, query, query->error_status, dnsrec); + end_query(channel, NULL, query, query->error_status, dnsrec, requeue); return ARES_ETIMEOUT; } @@ -1087,6 +1205,12 @@ static ares_conn_t *ares_fetch_connection(const ares_channel_t *channel, return NULL; } + /* If the associated server has failures, don't use it. It should be cleaned + * up later. */ + if (conn->server->consec_failures > 0) { + return NULL; + } + /* Used too many times */ if (channel->udp_max_queries > 0 && conn->total_queries >= channel->udp_max_queries) { @@ -1148,7 +1272,6 @@ ares_status_t ares_send_query(ares_server_t *requested_server, ares_status_t status; ares_bool_t probe_downed_server = ARES_TRUE; - /* Choose the server to send the query to */ if (requested_server != NULL) { server = requested_server; @@ -1163,7 +1286,7 @@ ares_status_t ares_send_query(ares_server_t *requested_server, } if (server == NULL) { - end_query(channel, server, query, ARES_ENOSERVER /* ? */, NULL); + end_query(channel, server, query, ARES_ENOSERVER /* ? */, NULL, NULL); return ARES_ENOSERVER; } @@ -1187,11 +1310,11 @@ ares_status_t ares_send_query(ares_server_t *requested_server, case ARES_ECONNREFUSED: case ARES_EBADFAMILY: server_increment_failures(server, query->using_tcp); - return ares_requeue_query(query, now, status, ARES_TRUE, NULL); + return ares_requeue_query(query, now, status, ARES_TRUE, NULL, NULL); /* Anything else is not retryable, likely ENOMEM */ default: - end_query(channel, server, query, status, NULL); + end_query(channel, server, query, status, NULL, NULL); return status; } } @@ -1205,7 +1328,7 @@ ares_status_t ares_send_query(ares_server_t *requested_server, case ARES_ENOMEM: /* Not retryable */ - end_query(channel, server, query, status, NULL); + end_query(channel, server, query, status, NULL, NULL); return status; /* These conditions are retryable as they are server-specific @@ -1213,7 +1336,7 @@ ares_status_t ares_send_query(ares_server_t *requested_server, case ARES_ECONNREFUSED: case ARES_EBADFAMILY: handle_conn_error(conn, ARES_TRUE, status); - status = ares_requeue_query(query, now, status, ARES_TRUE, NULL); + status = ares_requeue_query(query, now, status, ARES_TRUE, NULL, NULL); if (status == ARES_ETIMEOUT) { status = ARES_ECONNREFUSED; } @@ -1221,7 +1344,7 @@ ares_status_t ares_send_query(ares_server_t *requested_server, default: server_increment_failures(server, query->using_tcp); - status = ares_requeue_query(query, now, status, ARES_TRUE, NULL); + status = ares_requeue_query(query, now, status, ARES_TRUE, NULL, NULL); return status; } @@ -1237,7 +1360,7 @@ ares_status_t ares_send_query(ares_server_t *requested_server, ares_slist_insert(channel->queries_by_timeout, query); if (!query->node_queries_by_timeout) { /* LCOV_EXCL_START: OutOfMemory */ - end_query(channel, server, query, ARES_ENOMEM, NULL); + end_query(channel, server, query, ARES_ENOMEM, NULL, NULL); return ARES_ENOMEM; /* LCOV_EXCL_STOP */ } @@ -1250,7 +1373,7 @@ ares_status_t ares_send_query(ares_server_t *requested_server, if (query->node_queries_to_conn == NULL) { /* LCOV_EXCL_START: OutOfMemory */ - end_query(channel, server, query, ARES_ENOMEM, NULL); + end_query(channel, server, query, ARES_ENOMEM, NULL, NULL); return ARES_ENOMEM; /* LCOV_EXCL_STOP */ } @@ -1264,6 +1387,10 @@ ares_status_t ares_send_query(ares_server_t *requested_server, ares_probe_failed_server(channel, server, query); } + if (channel->query_enqueue_cb) { + channel->query_enqueue_cb(channel->query_enqueue_cb_data); + } + return ARES_SUCCESS; } @@ -1338,7 +1465,7 @@ static void ares_detach_query(ares_query_t *query) static void end_query(ares_channel_t *channel, ares_server_t *server, ares_query_t *query, ares_status_t status, - const ares_dns_record_t *dnsrec) + ares_dns_record_t *dnsrec, ares_array_t **requeue) { /* If we were probing for the server to come back online, lets mark it as * no longer being probed */ @@ -1348,6 +1475,12 @@ static void end_query(ares_channel_t *channel, ares_server_t *server, ares_metrics_record(query, server, status, dnsrec); + /* Delay calling the query callback */ + if (requeue != NULL) { + ares_append_endqueue(requeue, query, status, dnsrec); + return; + } + /* Invoke the callback. */ query->callback(query->arg, status, query->timeouts, dnsrec); ares_free_query(query); diff --git a/lib/c-ares-1.34.4/src/lib/ares_qcache.c b/lib/c-ares-1.34.6/src/lib/ares_qcache.c similarity index 95% rename from lib/c-ares-1.34.4/src/lib/ares_qcache.c rename to lib/c-ares-1.34.6/src/lib/ares_qcache.c index 97c0a9137da..4050ff54bf1 100644 --- a/lib/c-ares-1.34.4/src/lib/ares_qcache.c +++ b/lib/c-ares-1.34.6/src/lib/ares_qcache.c @@ -421,10 +421,20 @@ ares_status_t ares_qcache_fetch(ares_channel_t *channel, return status; } -ares_status_t ares_qcache_insert(ares_channel_t *channel, - const ares_timeval_t *now, - const ares_query_t *query, - ares_dns_record_t *dnsrec) +ares_status_t ares_qcache_insert(ares_channel_t *channel, + const ares_timeval_t *now, + const ares_query_t *query, + const ares_dns_record_t *dnsrec) { - return ares_qcache_insert_int(channel->qcache, dnsrec, query->query, now); + ares_dns_record_t *dupdns = ares_dns_record_duplicate(dnsrec); + ares_status_t status; + + if (dupdns == NULL) { + return ARES_ENOMEM; + } + status = ares_qcache_insert_int(channel->qcache, dupdns, query->query, now); + if (status != ARES_SUCCESS) { + ares_dns_record_destroy(dupdns); + } + return status; } diff --git a/lib/c-ares-1.34.4/src/lib/ares_query.c b/lib/c-ares-1.34.6/src/lib/ares_query.c similarity index 100% rename from lib/c-ares-1.34.4/src/lib/ares_query.c rename to lib/c-ares-1.34.6/src/lib/ares_query.c diff --git a/lib/c-ares-1.34.4/src/lib/ares_search.c b/lib/c-ares-1.34.6/src/lib/ares_search.c similarity index 100% rename from lib/c-ares-1.34.4/src/lib/ares_search.c rename to lib/c-ares-1.34.6/src/lib/ares_search.c diff --git a/lib/c-ares-1.34.4/src/lib/ares_send.c b/lib/c-ares-1.34.6/src/lib/ares_send.c similarity index 100% rename from lib/c-ares-1.34.4/src/lib/ares_send.c rename to lib/c-ares-1.34.6/src/lib/ares_send.c diff --git a/lib/c-ares-1.34.4/src/lib/ares_set_socket_functions.c b/lib/c-ares-1.34.6/src/lib/ares_set_socket_functions.c similarity index 98% rename from lib/c-ares-1.34.4/src/lib/ares_set_socket_functions.c rename to lib/c-ares-1.34.6/src/lib/ares_set_socket_functions.c index 7216ffa933f..9994e81df51 100644 --- a/lib/c-ares-1.34.4/src/lib/ares_set_socket_functions.c +++ b/lib/c-ares-1.34.6/src/lib/ares_set_socket_functions.c @@ -61,7 +61,7 @@ # define TFO_USE_SENDTO 0 # define TFO_USE_CONNECTX 0 # define TFO_CLIENT_SOCKOPT TCP_FASTOPEN_CONNECT -#elif defined(__FreeBSD__) && defined(TCP_FASTOPEN) +#elif (defined(__MidnightBSD__) || defined(__FreeBSD__)) && defined(TCP_FASTOPEN) # define TFO_SUPPORTED 1 # define TFO_SKIP_CONNECT 1 # define TFO_USE_SENDTO 1 @@ -127,6 +127,8 @@ ares_status_t channel->sock_funcs.asendto = funcs->asendto; channel->sock_funcs.agetsockname = funcs->agetsockname; channel->sock_funcs.abind = funcs->abind; + channel->sock_funcs.aif_nametoindex = funcs->aif_nametoindex; + channel->sock_funcs.aif_indextoname = funcs->aif_indextoname; } /* Implement newer versions here ...*/ diff --git a/lib/c-ares-1.34.4/src/lib/ares_setup.h b/lib/c-ares-1.34.6/src/lib/ares_setup.h similarity index 100% rename from lib/c-ares-1.34.4/src/lib/ares_setup.h rename to lib/c-ares-1.34.6/src/lib/ares_setup.h diff --git a/lib/c-ares-1.34.4/src/lib/ares_socket.c b/lib/c-ares-1.34.6/src/lib/ares_socket.c similarity index 100% rename from lib/c-ares-1.34.4/src/lib/ares_socket.c rename to lib/c-ares-1.34.6/src/lib/ares_socket.c diff --git a/lib/c-ares-1.34.4/src/lib/ares_socket.h b/lib/c-ares-1.34.6/src/lib/ares_socket.h similarity index 100% rename from lib/c-ares-1.34.4/src/lib/ares_socket.h rename to lib/c-ares-1.34.6/src/lib/ares_socket.h diff --git a/lib/c-ares-1.34.4/src/lib/ares_sortaddrinfo.c b/lib/c-ares-1.34.6/src/lib/ares_sortaddrinfo.c similarity index 100% rename from lib/c-ares-1.34.4/src/lib/ares_sortaddrinfo.c rename to lib/c-ares-1.34.6/src/lib/ares_sortaddrinfo.c diff --git a/lib/c-ares-1.34.4/src/lib/ares_strerror.c b/lib/c-ares-1.34.6/src/lib/ares_strerror.c similarity index 100% rename from lib/c-ares-1.34.4/src/lib/ares_strerror.c rename to lib/c-ares-1.34.6/src/lib/ares_strerror.c diff --git a/lib/c-ares-1.34.4/src/lib/ares_sysconfig.c b/lib/c-ares-1.34.6/src/lib/ares_sysconfig.c similarity index 100% rename from lib/c-ares-1.34.4/src/lib/ares_sysconfig.c rename to lib/c-ares-1.34.6/src/lib/ares_sysconfig.c diff --git a/lib/c-ares-1.34.4/src/lib/ares_sysconfig_files.c b/lib/c-ares-1.34.6/src/lib/ares_sysconfig_files.c similarity index 100% rename from lib/c-ares-1.34.4/src/lib/ares_sysconfig_files.c rename to lib/c-ares-1.34.6/src/lib/ares_sysconfig_files.c diff --git a/lib/c-ares-1.34.4/src/lib/ares_sysconfig_mac.c b/lib/c-ares-1.34.6/src/lib/ares_sysconfig_mac.c similarity index 100% rename from lib/c-ares-1.34.4/src/lib/ares_sysconfig_mac.c rename to lib/c-ares-1.34.6/src/lib/ares_sysconfig_mac.c diff --git a/lib/c-ares-1.34.4/src/lib/ares_sysconfig_win.c b/lib/c-ares-1.34.6/src/lib/ares_sysconfig_win.c similarity index 88% rename from lib/c-ares-1.34.4/src/lib/ares_sysconfig_win.c rename to lib/c-ares-1.34.6/src/lib/ares_sysconfig_win.c index f6e07f92e47..35f4bd8e72a 100644 --- a/lib/c-ares-1.34.4/src/lib/ares_sysconfig_win.c +++ b/lib/c-ares-1.34.6/src/lib/ares_sysconfig_win.c @@ -55,6 +55,19 @@ #include "ares_inet_net_pton.h" #if defined(USE_WINSOCK) + +# define WIN_NS_9X "System\\CurrentControlSet\\Services\\VxD\\MSTCP" +# define WIN_DNSCLIENT "Software\\Policies\\Microsoft\\System\\DNSClient" +# define WIN_NT_DNSCLIENT \ + "Software\\Policies\\Microsoft\\Windows NT\\DNSClient" +# define NAMESERVER "NameServer" +# define DHCPNAMESERVER "DhcpNameServer" +# define SEARCHLIST_KEY L"SearchList" +# define PRIMARYDNSSUFFIX_KEY L"PrimaryDNSSuffix" +# define INTERFACES_KEY "Interfaces" +# define DOMAIN_KEY L"Domain" +# define DHCPDOMAIN_KEY L"DhcpDomain" + /* * get_REG_SZ() * @@ -69,38 +82,48 @@ * * Supported on Windows NT 3.5 and newer. */ -static ares_bool_t get_REG_SZ(HKEY hKey, const char *leafKeyName, char **outptr) +static ares_bool_t get_REG_SZ(HKEY hKey, const WCHAR *leafKeyName, char **outptr) { - DWORD size = 0; - int res; + DWORD size = 0; + int res; + int len; + WCHAR *val = NULL; *outptr = NULL; /* Find out size of string stored in registry */ - res = RegQueryValueExA(hKey, leafKeyName, 0, NULL, NULL, &size); + res = RegQueryValueExW(hKey, leafKeyName, 0, NULL, NULL, &size); if ((res != ERROR_SUCCESS && res != ERROR_MORE_DATA) || !size) { return ARES_FALSE; } /* Allocate buffer of indicated size plus one given that string might have been stored without null termination */ - *outptr = ares_malloc(size + 1); - if (!*outptr) { + val = ares_malloc_zero(size + sizeof(WCHAR)); + if (val == NULL) { return ARES_FALSE; } /* Get the value for real */ - res = RegQueryValueExA(hKey, leafKeyName, 0, NULL, (unsigned char *)*outptr, - &size); - if ((res != ERROR_SUCCESS) || (size == 1)) { + res = RegQueryValueExW(hKey, leafKeyName, 0, NULL, (BYTE *)val, &size); + if (res != ERROR_SUCCESS || size == 1) { + ares_free(val); + return ARES_FALSE; + } + + /* Convert to UTF8 */ + len = WideCharToMultiByte(CP_UTF8, 0, val, -1, NULL, 0, NULL, NULL); + if (len == 0) { + return ARES_FALSE; + } + *outptr = ares_malloc_zero((size_t)len + 1); + if (WideCharToMultiByte(CP_UTF8, 0, val, -1, *outptr, len, NULL, NULL) + == 0) { ares_free(*outptr); *outptr = NULL; return ARES_FALSE; } - /* Null terminate buffer always */ - *(*outptr + size) = '\0'; - return ARES_TRUE; } @@ -135,6 +158,14 @@ static void commajoin(char **dst, const char *src) commanjoin(dst, src, ares_strlen(src)); } +static void commajoin_asciionly(char **dst, const char *src) +{ + if (!ares_str_isprint(src, ares_strlen(src))) { + return; + } + commanjoin(dst, src, ares_strlen(src)); +} + /* A structure to hold the string form of IPv4 and IPv6 addresses so we can * sort them by a metric. */ @@ -176,6 +207,7 @@ static int compareAddresses(const void *arg1, const void *arg2) return 0; } +#if defined(HAVE_GETBESTROUTE2) && !defined(__WATCOMC__) /* There can be multiple routes to "the Internet". And there can be different * DNS servers associated with each of the interfaces that offer those routes. * We have to assume that any DNS server can serve any request. But, some DNS @@ -213,18 +245,6 @@ static ULONG getBestRouteMetric(IF_LUID * const luid, /* Can't be const :( */ const SOCKADDR_INET * const dest, const ULONG interfaceMetric) { - /* On this interface, get the best route to that destination. */ -# if defined(__WATCOMC__) - /* OpenWatcom's builtin Windows SDK does not have a definition for - * MIB_IPFORWARD_ROW2, and also does not allow the usage of SOCKADDR_INET - * as a variable. Let's work around this by returning the worst possible - * metric, but only when using the OpenWatcom compiler. - * It may be worth investigating using a different version of the Windows - * SDK with OpenWatcom in the future, though this may be fixed in OpenWatcom - * 2.0. - */ - return (ULONG)-1; -# else MIB_IPFORWARD_ROW2 row; SOCKADDR_INET ignored; if (GetBestRoute2(/* The interface to use. The index is ignored since we are @@ -257,8 +277,8 @@ static ULONG getBestRouteMetric(IF_LUID * const luid, /* Can't be const :( */ * which describes the combination as a "sum". */ return row.Metric + interfaceMetric; -# endif /* __WATCOMC__ */ } +#endif /* * get_DNS_Windows() @@ -379,9 +399,21 @@ static ares_bool_t get_DNS_Windows(char **outptr) addressesSize = newSize; } +# if defined(HAVE_GETBESTROUTE2) && !defined(__WATCOMC__) + /* OpenWatcom's builtin Windows SDK does not have a definition for + * MIB_IPFORWARD_ROW2, and also does not allow the usage of SOCKADDR_INET + * as a variable. Let's work around this by returning the worst possible + * metric, but only when using the OpenWatcom compiler. + * It may be worth investigating using a different version of the Windows + * SDK with OpenWatcom in the future, though this may be fixed in OpenWatcom + * 2.0. + */ addresses[addressesIndex].metric = getBestRouteMetric( &ipaaEntry->Luid, (SOCKADDR_INET *)((void *)(namesrvr.sa)), ipaaEntry->Ipv4Metric); +# else + addresses[addressesIndex].metric = (ULONG)-1; +# endif /* Record insertion index to make qsort stable */ addresses[addressesIndex].orig_idx = addressesIndex; @@ -423,9 +455,13 @@ static ares_bool_t get_DNS_Windows(char **outptr) ll_scope = ipaaEntry->Ipv6IfIndex; } +# if defined(HAVE_GETBESTROUTE2) && !defined(__WATCOMC__) addresses[addressesIndex].metric = getBestRouteMetric( &ipaaEntry->Luid, (SOCKADDR_INET *)((void *)(namesrvr.sa)), ipaaEntry->Ipv6Metric); +# else + addresses[addressesIndex].metric = (ULONG)-1; +# endif /* Record insertion index to make qsort stable */ addresses[addressesIndex].orig_idx = addressesIndex; @@ -518,7 +554,7 @@ static ares_bool_t get_SuffixList_Windows(char **outptr) ERROR_SUCCESS) { get_REG_SZ(hKey, SEARCHLIST_KEY, outptr); if (get_REG_SZ(hKey, DOMAIN_KEY, &p)) { - commajoin(outptr, p); + commajoin_asciionly(outptr, p); ares_free(p); p = NULL; } @@ -528,7 +564,7 @@ static ares_bool_t get_SuffixList_Windows(char **outptr) if (RegOpenKeyExA(HKEY_LOCAL_MACHINE, WIN_NT_DNSCLIENT, 0, KEY_READ, &hKey) == ERROR_SUCCESS) { if (get_REG_SZ(hKey, SEARCHLIST_KEY, &p)) { - commajoin(outptr, p); + commajoin_asciionly(outptr, p); ares_free(p); p = NULL; } @@ -540,7 +576,7 @@ static ares_bool_t get_SuffixList_Windows(char **outptr) if (RegOpenKeyExA(HKEY_LOCAL_MACHINE, WIN_DNSCLIENT, 0, KEY_READ, &hKey) == ERROR_SUCCESS) { if (get_REG_SZ(hKey, PRIMARYDNSSUFFIX_KEY, &p)) { - commajoin(outptr, p); + commajoin_asciionly(outptr, p); ares_free(p); p = NULL; } @@ -562,17 +598,17 @@ static ares_bool_t get_SuffixList_Windows(char **outptr) } /* p can be comma separated (SearchList) */ if (get_REG_SZ(hKeyEnum, SEARCHLIST_KEY, &p)) { - commajoin(outptr, p); + commajoin_asciionly(outptr, p); ares_free(p); p = NULL; } if (get_REG_SZ(hKeyEnum, DOMAIN_KEY, &p)) { - commajoin(outptr, p); + commajoin_asciionly(outptr, p); ares_free(p); p = NULL; } if (get_REG_SZ(hKeyEnum, DHCPDOMAIN_KEY, &p)) { - commajoin(outptr, p); + commajoin_asciionly(outptr, p); ares_free(p); p = NULL; } diff --git a/lib/c-ares-1.34.4/src/lib/ares_timeout.c b/lib/c-ares-1.34.6/src/lib/ares_timeout.c similarity index 100% rename from lib/c-ares-1.34.4/src/lib/ares_timeout.c rename to lib/c-ares-1.34.6/src/lib/ares_timeout.c diff --git a/lib/c-ares-1.34.4/src/lib/ares_update_servers.c b/lib/c-ares-1.34.6/src/lib/ares_update_servers.c similarity index 100% rename from lib/c-ares-1.34.4/src/lib/ares_update_servers.c rename to lib/c-ares-1.34.6/src/lib/ares_update_servers.c diff --git a/lib/c-ares-1.34.4/src/lib/ares_version.c b/lib/c-ares-1.34.6/src/lib/ares_version.c similarity index 100% rename from lib/c-ares-1.34.4/src/lib/ares_version.c rename to lib/c-ares-1.34.6/src/lib/ares_version.c diff --git a/lib/c-ares-1.34.4/src/lib/cares.rc b/lib/c-ares-1.34.6/src/lib/cares.rc similarity index 97% rename from lib/c-ares-1.34.4/src/lib/cares.rc rename to lib/c-ares-1.34.6/src/lib/cares.rc index 9275b0796bf..49fa71ceec3 100644 --- a/lib/c-ares-1.34.4/src/lib/cares.rc +++ b/lib/c-ares-1.34.6/src/lib/cares.rc @@ -63,7 +63,7 @@ BEGIN #endif VALUE "ProductName", "The c-ares library\0" VALUE "ProductVersion", ARES_VERSION_STR "\0" - VALUE "LegalCopyright", "© " ARES_COPYRIGHT "\0" + VALUE "LegalCopyright", "Copyright (c) " ARES_COPYRIGHT "\0" VALUE "License", "https://c-ares.org/license.html\0" END END diff --git a/lib/c-ares-1.34.4/src/lib/config-dos.h b/lib/c-ares-1.34.6/src/lib/config-dos.h similarity index 100% rename from lib/c-ares-1.34.4/src/lib/config-dos.h rename to lib/c-ares-1.34.6/src/lib/config-dos.h diff --git a/lib/c-ares-1.34.4/src/lib/config-win32.h b/lib/c-ares-1.34.6/src/lib/config-win32.h similarity index 98% rename from lib/c-ares-1.34.4/src/lib/config-win32.h rename to lib/c-ares-1.34.6/src/lib/config-win32.h index be233a2f8b9..fc533c75516 100644 --- a/lib/c-ares-1.34.4/src/lib/config-win32.h +++ b/lib/c-ares-1.34.6/src/lib/config-win32.h @@ -237,8 +237,10 @@ # undef HAVE_NETIOAPI_H #endif -/* Threading support enabled */ -#define CARES_THREADS 1 +/* Threading support enabled for Vista+ */ +#if !defined(_WIN32_WINNT) || _WIN32_WINNT >= 0x0600 +# define CARES_THREADS 1 +#endif /* ---------------------------------------------------------------- */ /* TYPEDEF REPLACEMENTS */ @@ -370,6 +372,8 @@ # define HAVE_CONVERTINTERFACELUIDTONAMEA 1 /* Define to 1 if you have the `NotifyIpInterfaceChange' function. */ # define HAVE_NOTIFYIPINTERFACECHANGE 1 +/* Define to 1 if you have the `GetBestRoute2` function */ +# define HAVE_GETBESTROUTE2 1 #endif /* ---------------------------------------------------------------- */ diff --git a/lib/c-ares-1.34.4/src/lib/dsa/ares_array.c b/lib/c-ares-1.34.6/src/lib/dsa/ares_array.c similarity index 100% rename from lib/c-ares-1.34.4/src/lib/dsa/ares_array.c rename to lib/c-ares-1.34.6/src/lib/dsa/ares_array.c diff --git a/lib/c-ares-1.34.4/src/lib/dsa/ares_htable.c b/lib/c-ares-1.34.6/src/lib/dsa/ares_htable.c similarity index 100% rename from lib/c-ares-1.34.4/src/lib/dsa/ares_htable.c rename to lib/c-ares-1.34.6/src/lib/dsa/ares_htable.c diff --git a/lib/c-ares-1.34.4/src/lib/dsa/ares_htable.h b/lib/c-ares-1.34.6/src/lib/dsa/ares_htable.h similarity index 100% rename from lib/c-ares-1.34.4/src/lib/dsa/ares_htable.h rename to lib/c-ares-1.34.6/src/lib/dsa/ares_htable.h diff --git a/lib/c-ares-1.34.4/src/lib/dsa/ares_htable_asvp.c b/lib/c-ares-1.34.6/src/lib/dsa/ares_htable_asvp.c similarity index 100% rename from lib/c-ares-1.34.4/src/lib/dsa/ares_htable_asvp.c rename to lib/c-ares-1.34.6/src/lib/dsa/ares_htable_asvp.c diff --git a/lib/c-ares-1.34.4/src/lib/dsa/ares_htable_dict.c b/lib/c-ares-1.34.6/src/lib/dsa/ares_htable_dict.c similarity index 100% rename from lib/c-ares-1.34.4/src/lib/dsa/ares_htable_dict.c rename to lib/c-ares-1.34.6/src/lib/dsa/ares_htable_dict.c diff --git a/lib/c-ares-1.34.4/src/lib/dsa/ares_htable_strvp.c b/lib/c-ares-1.34.6/src/lib/dsa/ares_htable_strvp.c similarity index 100% rename from lib/c-ares-1.34.4/src/lib/dsa/ares_htable_strvp.c rename to lib/c-ares-1.34.6/src/lib/dsa/ares_htable_strvp.c diff --git a/lib/c-ares-1.34.4/src/lib/dsa/ares_htable_szvp.c b/lib/c-ares-1.34.6/src/lib/dsa/ares_htable_szvp.c similarity index 100% rename from lib/c-ares-1.34.4/src/lib/dsa/ares_htable_szvp.c rename to lib/c-ares-1.34.6/src/lib/dsa/ares_htable_szvp.c diff --git a/lib/c-ares-1.34.4/src/lib/dsa/ares_htable_vpstr.c b/lib/c-ares-1.34.6/src/lib/dsa/ares_htable_vpstr.c similarity index 100% rename from lib/c-ares-1.34.4/src/lib/dsa/ares_htable_vpstr.c rename to lib/c-ares-1.34.6/src/lib/dsa/ares_htable_vpstr.c diff --git a/lib/c-ares-1.34.4/src/lib/dsa/ares_htable_vpvp.c b/lib/c-ares-1.34.6/src/lib/dsa/ares_htable_vpvp.c similarity index 100% rename from lib/c-ares-1.34.4/src/lib/dsa/ares_htable_vpvp.c rename to lib/c-ares-1.34.6/src/lib/dsa/ares_htable_vpvp.c diff --git a/lib/c-ares-1.34.4/src/lib/dsa/ares_llist.c b/lib/c-ares-1.34.6/src/lib/dsa/ares_llist.c similarity index 100% rename from lib/c-ares-1.34.4/src/lib/dsa/ares_llist.c rename to lib/c-ares-1.34.6/src/lib/dsa/ares_llist.c diff --git a/lib/c-ares-1.34.4/src/lib/dsa/ares_slist.c b/lib/c-ares-1.34.6/src/lib/dsa/ares_slist.c similarity index 100% rename from lib/c-ares-1.34.4/src/lib/dsa/ares_slist.c rename to lib/c-ares-1.34.6/src/lib/dsa/ares_slist.c diff --git a/lib/c-ares-1.34.4/src/lib/dsa/ares_slist.h b/lib/c-ares-1.34.6/src/lib/dsa/ares_slist.h similarity index 100% rename from lib/c-ares-1.34.4/src/lib/dsa/ares_slist.h rename to lib/c-ares-1.34.6/src/lib/dsa/ares_slist.h diff --git a/lib/c-ares-1.34.4/src/lib/event/ares_event.h b/lib/c-ares-1.34.6/src/lib/event/ares_event.h similarity index 97% rename from lib/c-ares-1.34.4/src/lib/event/ares_event.h rename to lib/c-ares-1.34.6/src/lib/event/ares_event.h index 36cd10dcf89..bf298dfb619 100644 --- a/lib/c-ares-1.34.4/src/lib/event/ares_event.h +++ b/lib/c-ares-1.34.6/src/lib/event/ares_event.h @@ -159,30 +159,33 @@ ares_status_t ares_event_update(ares_event_t **event, ares_event_thread_t *e, ares_event_signal_cb_t signal_cb); -#ifdef HAVE_PIPE +#ifdef CARES_THREADS +# ifdef HAVE_PIPE ares_event_t *ares_pipeevent_create(ares_event_thread_t *e); -#endif +# endif -#ifdef HAVE_POLL +# ifdef HAVE_POLL extern const ares_event_sys_t ares_evsys_poll; -#endif +# endif -#ifdef HAVE_KQUEUE +# ifdef HAVE_KQUEUE extern const ares_event_sys_t ares_evsys_kqueue; -#endif +# endif -#ifdef HAVE_EPOLL +# ifdef HAVE_EPOLL extern const ares_event_sys_t ares_evsys_epoll; -#endif +# endif -#ifdef _WIN32 +# ifdef _WIN32 extern const ares_event_sys_t ares_evsys_win32; -#endif +# endif /* All systems have select(), but not all have a way to wake, so we require * pipe() to wake the select() */ -#ifdef HAVE_PIPE +# ifdef HAVE_PIPE extern const ares_event_sys_t ares_evsys_select; +# endif + #endif #endif diff --git a/lib/c-ares-1.34.4/src/lib/event/ares_event_configchg.c b/lib/c-ares-1.34.6/src/lib/event/ares_event_configchg.c similarity index 97% rename from lib/c-ares-1.34.4/src/lib/event/ares_event_configchg.c rename to lib/c-ares-1.34.6/src/lib/event/ares_event_configchg.c index 5ecc6888ab7..add729574e4 100644 --- a/lib/c-ares-1.34.4/src/lib/event/ares_event_configchg.c +++ b/lib/c-ares-1.34.6/src/lib/event/ares_event_configchg.c @@ -26,7 +26,7 @@ #include "ares_private.h" #include "ares_event.h" -#ifdef __ANDROID__ +#if defined(__ANDROID__) && defined(CARES_THREADS) ares_status_t ares_event_configchg_init(ares_event_configchg_t **configchg, ares_event_thread_t *e) @@ -43,7 +43,7 @@ void ares_event_configchg_destroy(ares_event_configchg_t *configchg) (void)configchg; } -#elif defined(__linux__) +#elif defined(__linux__) && defined(CARES_THREADS) # include @@ -174,7 +174,7 @@ ares_status_t ares_event_configchg_init(ares_event_configchg_t **configchg, return status; } -#elif defined(USE_WINSOCK) +#elif defined(USE_WINSOCK) && defined(CARES_THREADS) # include # include @@ -379,10 +379,11 @@ ares_status_t ares_event_configchg_init(ares_event_configchg_t **configchg, return status; } -#elif defined(__APPLE__) +#elif defined(__APPLE__) && defined(CARES_THREADS) # include # include +# include # include # include # include @@ -531,7 +532,7 @@ ares_status_t ares_event_configchg_init(ares_event_configchg_t **configchg, return status; } -#elif defined(HAVE_STAT) && !defined(_WIN32) +#elif defined(HAVE_STAT) && !defined(_WIN32) && defined(CARES_THREADS) # ifdef HAVE_SYS_TYPES_H # include # endif @@ -665,6 +666,12 @@ ares_status_t ares_event_configchg_init(ares_event_configchg_t **configchg, goto done; } + c->lock = ares_thread_mutex_create(); + if (c->lock == NULL) { + status = ARES_ENOMEM; + goto done; + } + c->resolvconf_path = c->e->channel->resolvconf_path; if (c->resolvconf_path == NULL) { c->resolvconf_path = PATH_RESOLV_CONF; @@ -722,6 +729,8 @@ void ares_event_configchg_destroy(ares_event_configchg_t *configchg) ares_status_t ares_event_configchg_init(ares_event_configchg_t **configchg, ares_event_thread_t *e) { + (void)configchg; + (void)e; /* No ability */ return ARES_ENOTIMP; } @@ -729,6 +738,7 @@ ares_status_t ares_event_configchg_init(ares_event_configchg_t **configchg, void ares_event_configchg_destroy(ares_event_configchg_t *configchg) { /* No-op */ + (void)configchg; } #endif diff --git a/lib/c-ares-1.34.4/src/lib/event/ares_event_epoll.c b/lib/c-ares-1.34.6/src/lib/event/ares_event_epoll.c similarity index 99% rename from lib/c-ares-1.34.4/src/lib/event/ares_event_epoll.c rename to lib/c-ares-1.34.6/src/lib/event/ares_event_epoll.c index 538c38b4f94..d451c86a3d5 100644 --- a/lib/c-ares-1.34.4/src/lib/event/ares_event_epoll.c +++ b/lib/c-ares-1.34.6/src/lib/event/ares_event_epoll.c @@ -26,6 +26,8 @@ #include "ares_private.h" #include "ares_event.h" +#if defined(HAVE_EPOLL) && defined(CARES_THREADS) + #ifdef HAVE_SYS_EPOLL_H # include #endif @@ -33,8 +35,6 @@ # include #endif -#ifdef HAVE_EPOLL - typedef struct { int epoll_fd; } ares_evsys_epoll_t; diff --git a/lib/c-ares-1.34.4/src/lib/event/ares_event_kqueue.c b/lib/c-ares-1.34.6/src/lib/event/ares_event_kqueue.c similarity index 99% rename from lib/c-ares-1.34.4/src/lib/event/ares_event_kqueue.c rename to lib/c-ares-1.34.6/src/lib/event/ares_event_kqueue.c index dbbd0dbd9f7..00cdcbe9c2a 100644 --- a/lib/c-ares-1.34.4/src/lib/event/ares_event_kqueue.c +++ b/lib/c-ares-1.34.6/src/lib/event/ares_event_kqueue.c @@ -26,6 +26,8 @@ #include "ares_private.h" #include "ares_event.h" +#if defined(HAVE_KQUEUE) && defined(CARES_THREADS) + #ifdef HAVE_SYS_TYPES_H # include #endif @@ -39,8 +41,6 @@ # include #endif -#ifdef HAVE_KQUEUE - typedef struct { int kqueue_fd; struct kevent *changelist; diff --git a/lib/c-ares-1.34.4/src/lib/event/ares_event_poll.c b/lib/c-ares-1.34.6/src/lib/event/ares_event_poll.c similarity index 98% rename from lib/c-ares-1.34.4/src/lib/event/ares_event_poll.c rename to lib/c-ares-1.34.6/src/lib/event/ares_event_poll.c index c6ab4b62072..28e3c096576 100644 --- a/lib/c-ares-1.34.4/src/lib/event/ares_event_poll.c +++ b/lib/c-ares-1.34.6/src/lib/event/ares_event_poll.c @@ -25,12 +25,13 @@ */ #include "ares_private.h" #include "ares_event.h" + +#if defined(HAVE_POLL) && defined(CARES_THREADS) + #ifdef HAVE_POLL_H # include #endif -#if defined(HAVE_POLL) - static ares_bool_t ares_evsys_poll_init(ares_event_thread_t *e) { e->ev_signal = ares_pipeevent_create(e); diff --git a/lib/c-ares-1.34.4/src/lib/event/ares_event_select.c b/lib/c-ares-1.34.6/src/lib/event/ares_event_select.c similarity index 98% rename from lib/c-ares-1.34.4/src/lib/event/ares_event_select.c rename to lib/c-ares-1.34.6/src/lib/event/ares_event_select.c index 4d7c085d872..df758b5a1e5 100644 --- a/lib/c-ares-1.34.4/src/lib/event/ares_event_select.c +++ b/lib/c-ares-1.34.6/src/lib/event/ares_event_select.c @@ -31,13 +31,14 @@ #include "ares_private.h" #include "ares_event.h" -#ifdef HAVE_SYS_SELECT_H -# include -#endif /* All systems have select(), but not all have a way to wake, so we require * pipe() to wake the select() */ -#if defined(HAVE_PIPE) +#if defined(HAVE_PIPE) && defined(CARES_THREADS) + +#ifdef HAVE_SYS_SELECT_H +# include +#endif static ares_bool_t ares_evsys_select_init(ares_event_thread_t *e) { diff --git a/lib/c-ares-1.34.4/src/lib/event/ares_event_thread.c b/lib/c-ares-1.34.6/src/lib/event/ares_event_thread.c similarity index 97% rename from lib/c-ares-1.34.4/src/lib/event/ares_event_thread.c rename to lib/c-ares-1.34.6/src/lib/event/ares_event_thread.c index d59b7880a41..35e86377c29 100644 --- a/lib/c-ares-1.34.4/src/lib/event/ares_event_thread.c +++ b/lib/c-ares-1.34.6/src/lib/event/ares_event_thread.c @@ -26,6 +26,7 @@ #include "ares_private.h" #include "ares_event.h" +#ifdef CARES_THREADS static void ares_event_destroy_cb(void *arg) { ares_event_t *event = arg; @@ -234,6 +235,12 @@ static void notifywrite_cb(void *data) ares_event_thread_wake(e); } +static void notifyenqueue_cb(void *data) +{ + ares_event_thread_t *e = data; + ares_event_thread_wake(e); +} + static void ares_event_process_updates(ares_event_thread_t *e) { ares_llist_node_t *node; @@ -414,6 +421,7 @@ void ares_event_thread_destroy(ares_channel_t *channel) channel->sock_state_cb = NULL; channel->notify_pending_write_cb = NULL; channel->notify_pending_write_cb_data = NULL; + ares_set_query_enqueue_cb(channel, NULL, NULL); } static const ares_event_sys_t *ares_event_fetch_sys(ares_evsys_t evsys) @@ -520,6 +528,7 @@ ares_status_t ares_event_thread_init(ares_channel_t *channel) channel->sock_state_cb_data = e; channel->notify_pending_write_cb = notifywrite_cb; channel->notify_pending_write_cb_data = e; + ares_set_query_enqueue_cb(channel, notifyenqueue_cb, e); if (!e->ev_sys->init(e)) { /* LCOV_EXCL_START: UntestablePath */ @@ -549,3 +558,18 @@ ares_status_t ares_event_thread_init(ares_channel_t *channel) return ARES_SUCCESS; } + +#else + +ares_status_t ares_event_thread_init(ares_channel_t *channel) +{ + (void)channel; + return ARES_ENOTIMP; +} + +void ares_event_thread_destroy(ares_channel_t *channel) +{ + (void)channel; +} + +#endif diff --git a/lib/c-ares-1.34.4/src/lib/event/ares_event_wake_pipe.c b/lib/c-ares-1.34.6/src/lib/event/ares_event_wake_pipe.c similarity index 96% rename from lib/c-ares-1.34.4/src/lib/event/ares_event_wake_pipe.c rename to lib/c-ares-1.34.6/src/lib/event/ares_event_wake_pipe.c index d3b166a3d6c..cd1534bbbd5 100644 --- a/lib/c-ares-1.34.4/src/lib/event/ares_event_wake_pipe.c +++ b/lib/c-ares-1.34.6/src/lib/event/ares_event_wake_pipe.c @@ -25,14 +25,16 @@ */ #include "ares_private.h" #include "ares_event.h" -#ifdef HAVE_UNISTD_H -# include -#endif -#ifdef HAVE_FCNTL_H -# include -#endif -#ifdef HAVE_PIPE +#if defined(HAVE_PIPE) && defined(CARES_THREADS) + +# ifdef HAVE_UNISTD_H +# include +# endif +# ifdef HAVE_FCNTL_H +# include +# endif + typedef struct { int filedes[2]; } ares_pipeevent_t; diff --git a/lib/c-ares-1.34.4/src/lib/event/ares_event_win32.c b/lib/c-ares-1.34.6/src/lib/event/ares_event_win32.c similarity index 99% rename from lib/c-ares-1.34.4/src/lib/event/ares_event_win32.c rename to lib/c-ares-1.34.6/src/lib/event/ares_event_win32.c index 1531b6d81dd..d7d1d657350 100644 --- a/lib/c-ares-1.34.4/src/lib/event/ares_event_win32.c +++ b/lib/c-ares-1.34.6/src/lib/event/ares_event_win32.c @@ -37,12 +37,14 @@ #include "ares_private.h" #include "ares_event.h" #include "ares_event_win32.h" + + +#if defined(USE_WINSOCK) && defined(CARES_THREADS) + #ifdef HAVE_LIMITS_H # include #endif -#if defined(USE_WINSOCK) - /* IMPLEMENTATION NOTES * ==================== * @@ -667,7 +669,7 @@ static ares_bool_t ares_evsys_win32_afd_cancel(ares_evsys_win32_eventdata_t *ed) /* NtCancelIoFileEx() may return STATUS_NOT_FOUND if the operation completed * just before calling NtCancelIoFileEx(), but we have not yet received the - * notifiction (but it should be queued for the next IOCP event). */ + * notification (but it should be queued for the next IOCP event). */ if (status == STATUS_SUCCESS || status == STATUS_NOT_FOUND) { return ARES_TRUE; } diff --git a/lib/c-ares-1.34.4/src/lib/event/ares_event_win32.h b/lib/c-ares-1.34.6/src/lib/event/ares_event_win32.h similarity index 100% rename from lib/c-ares-1.34.4/src/lib/event/ares_event_win32.h rename to lib/c-ares-1.34.6/src/lib/event/ares_event_win32.h diff --git a/lib/c-ares-1.34.4/src/lib/include/ares_array.h b/lib/c-ares-1.34.6/src/lib/include/ares_array.h similarity index 100% rename from lib/c-ares-1.34.4/src/lib/include/ares_array.h rename to lib/c-ares-1.34.6/src/lib/include/ares_array.h diff --git a/lib/c-ares-1.34.4/src/lib/include/ares_buf.h b/lib/c-ares-1.34.6/src/lib/include/ares_buf.h similarity index 100% rename from lib/c-ares-1.34.4/src/lib/include/ares_buf.h rename to lib/c-ares-1.34.6/src/lib/include/ares_buf.h diff --git a/lib/c-ares-1.34.4/src/lib/include/ares_htable_asvp.h b/lib/c-ares-1.34.6/src/lib/include/ares_htable_asvp.h similarity index 100% rename from lib/c-ares-1.34.4/src/lib/include/ares_htable_asvp.h rename to lib/c-ares-1.34.6/src/lib/include/ares_htable_asvp.h diff --git a/lib/c-ares-1.34.4/src/lib/include/ares_htable_dict.h b/lib/c-ares-1.34.6/src/lib/include/ares_htable_dict.h similarity index 100% rename from lib/c-ares-1.34.4/src/lib/include/ares_htable_dict.h rename to lib/c-ares-1.34.6/src/lib/include/ares_htable_dict.h diff --git a/lib/c-ares-1.34.4/src/lib/include/ares_htable_strvp.h b/lib/c-ares-1.34.6/src/lib/include/ares_htable_strvp.h similarity index 100% rename from lib/c-ares-1.34.4/src/lib/include/ares_htable_strvp.h rename to lib/c-ares-1.34.6/src/lib/include/ares_htable_strvp.h diff --git a/lib/c-ares-1.34.4/src/lib/include/ares_htable_szvp.h b/lib/c-ares-1.34.6/src/lib/include/ares_htable_szvp.h similarity index 100% rename from lib/c-ares-1.34.4/src/lib/include/ares_htable_szvp.h rename to lib/c-ares-1.34.6/src/lib/include/ares_htable_szvp.h diff --git a/lib/c-ares-1.34.4/src/lib/include/ares_htable_vpstr.h b/lib/c-ares-1.34.6/src/lib/include/ares_htable_vpstr.h similarity index 100% rename from lib/c-ares-1.34.4/src/lib/include/ares_htable_vpstr.h rename to lib/c-ares-1.34.6/src/lib/include/ares_htable_vpstr.h diff --git a/lib/c-ares-1.34.4/src/lib/include/ares_htable_vpvp.h b/lib/c-ares-1.34.6/src/lib/include/ares_htable_vpvp.h similarity index 100% rename from lib/c-ares-1.34.4/src/lib/include/ares_htable_vpvp.h rename to lib/c-ares-1.34.6/src/lib/include/ares_htable_vpvp.h diff --git a/lib/c-ares-1.34.4/src/lib/include/ares_llist.h b/lib/c-ares-1.34.6/src/lib/include/ares_llist.h similarity index 100% rename from lib/c-ares-1.34.4/src/lib/include/ares_llist.h rename to lib/c-ares-1.34.6/src/lib/include/ares_llist.h diff --git a/lib/c-ares-1.34.4/src/lib/include/ares_mem.h b/lib/c-ares-1.34.6/src/lib/include/ares_mem.h similarity index 100% rename from lib/c-ares-1.34.4/src/lib/include/ares_mem.h rename to lib/c-ares-1.34.6/src/lib/include/ares_mem.h diff --git a/lib/c-ares-1.34.4/src/lib/include/ares_str.h b/lib/c-ares-1.34.6/src/lib/include/ares_str.h similarity index 100% rename from lib/c-ares-1.34.4/src/lib/include/ares_str.h rename to lib/c-ares-1.34.6/src/lib/include/ares_str.h diff --git a/lib/c-ares-1.34.4/src/lib/inet_net_pton.c b/lib/c-ares-1.34.6/src/lib/inet_net_pton.c similarity index 100% rename from lib/c-ares-1.34.4/src/lib/inet_net_pton.c rename to lib/c-ares-1.34.6/src/lib/inet_net_pton.c diff --git a/lib/c-ares-1.34.4/src/lib/inet_ntop.c b/lib/c-ares-1.34.6/src/lib/inet_ntop.c similarity index 100% rename from lib/c-ares-1.34.4/src/lib/inet_ntop.c rename to lib/c-ares-1.34.6/src/lib/inet_ntop.c diff --git a/lib/c-ares-1.34.4/src/lib/legacy/ares_create_query.c b/lib/c-ares-1.34.6/src/lib/legacy/ares_create_query.c similarity index 100% rename from lib/c-ares-1.34.4/src/lib/legacy/ares_create_query.c rename to lib/c-ares-1.34.6/src/lib/legacy/ares_create_query.c diff --git a/lib/c-ares-1.34.4/src/lib/legacy/ares_expand_name.c b/lib/c-ares-1.34.6/src/lib/legacy/ares_expand_name.c similarity index 100% rename from lib/c-ares-1.34.4/src/lib/legacy/ares_expand_name.c rename to lib/c-ares-1.34.6/src/lib/legacy/ares_expand_name.c diff --git a/lib/c-ares-1.34.4/src/lib/legacy/ares_expand_string.c b/lib/c-ares-1.34.6/src/lib/legacy/ares_expand_string.c similarity index 100% rename from lib/c-ares-1.34.4/src/lib/legacy/ares_expand_string.c rename to lib/c-ares-1.34.6/src/lib/legacy/ares_expand_string.c diff --git a/lib/c-ares-1.34.4/src/lib/legacy/ares_fds.c b/lib/c-ares-1.34.6/src/lib/legacy/ares_fds.c similarity index 100% rename from lib/c-ares-1.34.4/src/lib/legacy/ares_fds.c rename to lib/c-ares-1.34.6/src/lib/legacy/ares_fds.c diff --git a/lib/c-ares-1.34.4/src/lib/legacy/ares_getsock.c b/lib/c-ares-1.34.6/src/lib/legacy/ares_getsock.c similarity index 100% rename from lib/c-ares-1.34.4/src/lib/legacy/ares_getsock.c rename to lib/c-ares-1.34.6/src/lib/legacy/ares_getsock.c diff --git a/lib/c-ares-1.34.4/src/lib/legacy/ares_parse_a_reply.c b/lib/c-ares-1.34.6/src/lib/legacy/ares_parse_a_reply.c similarity index 99% rename from lib/c-ares-1.34.4/src/lib/legacy/ares_parse_a_reply.c rename to lib/c-ares-1.34.6/src/lib/legacy/ares_parse_a_reply.c index 870aaccf76c..9fd4a07ac0f 100644 --- a/lib/c-ares-1.34.4/src/lib/legacy/ares_parse_a_reply.c +++ b/lib/c-ares-1.34.6/src/lib/legacy/ares_parse_a_reply.c @@ -77,6 +77,7 @@ int ares_parse_a_reply(const unsigned char *abuf, int alen, } if (host != NULL) { + *host = NULL; status = ares_addrinfo2hostent(&ai, AF_INET, host); if (status != ARES_SUCCESS && status != ARES_ENODATA) { goto fail; /* LCOV_EXCL_LINE: DefensiveCoding */ diff --git a/lib/c-ares-1.34.4/src/lib/legacy/ares_parse_aaaa_reply.c b/lib/c-ares-1.34.6/src/lib/legacy/ares_parse_aaaa_reply.c similarity index 99% rename from lib/c-ares-1.34.4/src/lib/legacy/ares_parse_aaaa_reply.c rename to lib/c-ares-1.34.6/src/lib/legacy/ares_parse_aaaa_reply.c index 278642f0b3e..4c177ec9cbb 100644 --- a/lib/c-ares-1.34.4/src/lib/legacy/ares_parse_aaaa_reply.c +++ b/lib/c-ares-1.34.6/src/lib/legacy/ares_parse_aaaa_reply.c @@ -80,6 +80,7 @@ int ares_parse_aaaa_reply(const unsigned char *abuf, int alen, } if (host != NULL) { + *host = NULL; status = ares_addrinfo2hostent(&ai, AF_INET6, host); if (status != ARES_SUCCESS && status != ARES_ENODATA) { goto fail; /* LCOV_EXCL_LINE: DefensiveCoding */ diff --git a/lib/c-ares-1.34.4/src/lib/legacy/ares_parse_caa_reply.c b/lib/c-ares-1.34.6/src/lib/legacy/ares_parse_caa_reply.c similarity index 100% rename from lib/c-ares-1.34.4/src/lib/legacy/ares_parse_caa_reply.c rename to lib/c-ares-1.34.6/src/lib/legacy/ares_parse_caa_reply.c diff --git a/lib/c-ares-1.34.4/src/lib/legacy/ares_parse_mx_reply.c b/lib/c-ares-1.34.6/src/lib/legacy/ares_parse_mx_reply.c similarity index 100% rename from lib/c-ares-1.34.4/src/lib/legacy/ares_parse_mx_reply.c rename to lib/c-ares-1.34.6/src/lib/legacy/ares_parse_mx_reply.c diff --git a/lib/c-ares-1.34.4/src/lib/legacy/ares_parse_naptr_reply.c b/lib/c-ares-1.34.6/src/lib/legacy/ares_parse_naptr_reply.c similarity index 100% rename from lib/c-ares-1.34.4/src/lib/legacy/ares_parse_naptr_reply.c rename to lib/c-ares-1.34.6/src/lib/legacy/ares_parse_naptr_reply.c diff --git a/lib/c-ares-1.34.4/src/lib/legacy/ares_parse_ns_reply.c b/lib/c-ares-1.34.6/src/lib/legacy/ares_parse_ns_reply.c similarity index 100% rename from lib/c-ares-1.34.4/src/lib/legacy/ares_parse_ns_reply.c rename to lib/c-ares-1.34.6/src/lib/legacy/ares_parse_ns_reply.c diff --git a/lib/c-ares-1.34.4/src/lib/legacy/ares_parse_ptr_reply.c b/lib/c-ares-1.34.6/src/lib/legacy/ares_parse_ptr_reply.c similarity index 100% rename from lib/c-ares-1.34.4/src/lib/legacy/ares_parse_ptr_reply.c rename to lib/c-ares-1.34.6/src/lib/legacy/ares_parse_ptr_reply.c diff --git a/lib/c-ares-1.34.4/src/lib/legacy/ares_parse_soa_reply.c b/lib/c-ares-1.34.6/src/lib/legacy/ares_parse_soa_reply.c similarity index 100% rename from lib/c-ares-1.34.4/src/lib/legacy/ares_parse_soa_reply.c rename to lib/c-ares-1.34.6/src/lib/legacy/ares_parse_soa_reply.c diff --git a/lib/c-ares-1.34.4/src/lib/legacy/ares_parse_srv_reply.c b/lib/c-ares-1.34.6/src/lib/legacy/ares_parse_srv_reply.c similarity index 100% rename from lib/c-ares-1.34.4/src/lib/legacy/ares_parse_srv_reply.c rename to lib/c-ares-1.34.6/src/lib/legacy/ares_parse_srv_reply.c diff --git a/lib/c-ares-1.34.4/src/lib/legacy/ares_parse_txt_reply.c b/lib/c-ares-1.34.6/src/lib/legacy/ares_parse_txt_reply.c similarity index 100% rename from lib/c-ares-1.34.4/src/lib/legacy/ares_parse_txt_reply.c rename to lib/c-ares-1.34.6/src/lib/legacy/ares_parse_txt_reply.c diff --git a/lib/c-ares-1.34.4/src/lib/legacy/ares_parse_uri_reply.c b/lib/c-ares-1.34.6/src/lib/legacy/ares_parse_uri_reply.c similarity index 100% rename from lib/c-ares-1.34.4/src/lib/legacy/ares_parse_uri_reply.c rename to lib/c-ares-1.34.6/src/lib/legacy/ares_parse_uri_reply.c diff --git a/lib/c-ares-1.34.4/src/lib/record/ares_dns_mapping.c b/lib/c-ares-1.34.6/src/lib/record/ares_dns_mapping.c similarity index 100% rename from lib/c-ares-1.34.4/src/lib/record/ares_dns_mapping.c rename to lib/c-ares-1.34.6/src/lib/record/ares_dns_mapping.c diff --git a/lib/c-ares-1.34.4/src/lib/record/ares_dns_multistring.c b/lib/c-ares-1.34.6/src/lib/record/ares_dns_multistring.c similarity index 100% rename from lib/c-ares-1.34.4/src/lib/record/ares_dns_multistring.c rename to lib/c-ares-1.34.6/src/lib/record/ares_dns_multistring.c diff --git a/lib/c-ares-1.34.4/src/lib/record/ares_dns_multistring.h b/lib/c-ares-1.34.6/src/lib/record/ares_dns_multistring.h similarity index 100% rename from lib/c-ares-1.34.4/src/lib/record/ares_dns_multistring.h rename to lib/c-ares-1.34.6/src/lib/record/ares_dns_multistring.h diff --git a/lib/c-ares-1.34.4/src/lib/record/ares_dns_name.c b/lib/c-ares-1.34.6/src/lib/record/ares_dns_name.c similarity index 100% rename from lib/c-ares-1.34.4/src/lib/record/ares_dns_name.c rename to lib/c-ares-1.34.6/src/lib/record/ares_dns_name.c diff --git a/lib/c-ares-1.34.4/src/lib/record/ares_dns_parse.c b/lib/c-ares-1.34.6/src/lib/record/ares_dns_parse.c similarity index 100% rename from lib/c-ares-1.34.4/src/lib/record/ares_dns_parse.c rename to lib/c-ares-1.34.6/src/lib/record/ares_dns_parse.c diff --git a/lib/c-ares-1.34.4/src/lib/record/ares_dns_private.h b/lib/c-ares-1.34.6/src/lib/record/ares_dns_private.h similarity index 100% rename from lib/c-ares-1.34.4/src/lib/record/ares_dns_private.h rename to lib/c-ares-1.34.6/src/lib/record/ares_dns_private.h diff --git a/lib/c-ares-1.34.4/src/lib/record/ares_dns_record.c b/lib/c-ares-1.34.6/src/lib/record/ares_dns_record.c similarity index 100% rename from lib/c-ares-1.34.4/src/lib/record/ares_dns_record.c rename to lib/c-ares-1.34.6/src/lib/record/ares_dns_record.c diff --git a/lib/c-ares-1.34.4/src/lib/record/ares_dns_write.c b/lib/c-ares-1.34.6/src/lib/record/ares_dns_write.c similarity index 100% rename from lib/c-ares-1.34.4/src/lib/record/ares_dns_write.c rename to lib/c-ares-1.34.6/src/lib/record/ares_dns_write.c diff --git a/lib/c-ares-1.34.4/src/lib/str/ares_buf.c b/lib/c-ares-1.34.6/src/lib/str/ares_buf.c similarity index 100% rename from lib/c-ares-1.34.4/src/lib/str/ares_buf.c rename to lib/c-ares-1.34.6/src/lib/str/ares_buf.c diff --git a/lib/c-ares-1.34.4/src/lib/str/ares_str.c b/lib/c-ares-1.34.6/src/lib/str/ares_str.c similarity index 100% rename from lib/c-ares-1.34.4/src/lib/str/ares_str.c rename to lib/c-ares-1.34.6/src/lib/str/ares_str.c diff --git a/lib/c-ares-1.34.4/src/lib/str/ares_strsplit.c b/lib/c-ares-1.34.6/src/lib/str/ares_strsplit.c similarity index 100% rename from lib/c-ares-1.34.4/src/lib/str/ares_strsplit.c rename to lib/c-ares-1.34.6/src/lib/str/ares_strsplit.c diff --git a/lib/c-ares-1.34.4/src/lib/str/ares_strsplit.h b/lib/c-ares-1.34.6/src/lib/str/ares_strsplit.h similarity index 100% rename from lib/c-ares-1.34.4/src/lib/str/ares_strsplit.h rename to lib/c-ares-1.34.6/src/lib/str/ares_strsplit.h diff --git a/lib/c-ares-1.34.4/src/lib/thirdparty/apple/dnsinfo.h b/lib/c-ares-1.34.6/src/lib/thirdparty/apple/dnsinfo.h similarity index 100% rename from lib/c-ares-1.34.4/src/lib/thirdparty/apple/dnsinfo.h rename to lib/c-ares-1.34.6/src/lib/thirdparty/apple/dnsinfo.h diff --git a/lib/c-ares-1.34.4/src/lib/util/ares_iface_ips.c b/lib/c-ares-1.34.6/src/lib/util/ares_iface_ips.c similarity index 98% rename from lib/c-ares-1.34.4/src/lib/util/ares_iface_ips.c rename to lib/c-ares-1.34.6/src/lib/util/ares_iface_ips.c index 46cb291e300..c5f507f87e1 100644 --- a/lib/c-ares-1.34.4/src/lib/util/ares_iface_ips.c +++ b/lib/c-ares-1.34.6/src/lib/util/ares_iface_ips.c @@ -431,8 +431,14 @@ static ares_status_t ares_iface_ips_enumerate(ares_iface_ips_t *ips, } status = ares_iface_ips_add(ips, addrflag, ifname, &addr, +#if _WIN32_WINNT >= 0x0600 ipaddr->OnLinkPrefixLength /* netmask */, - address->Ipv6IfIndex /* ll_scope */); +#else + ipaddr->Address.lpSockaddr->sa_family + == AF_INET?32:128, +#endif + address->Ipv6IfIndex /* ll_scope */ + ); if (status != ARES_SUCCESS) { goto done; diff --git a/lib/c-ares-1.34.4/src/lib/util/ares_iface_ips.h b/lib/c-ares-1.34.6/src/lib/util/ares_iface_ips.h similarity index 100% rename from lib/c-ares-1.34.4/src/lib/util/ares_iface_ips.h rename to lib/c-ares-1.34.6/src/lib/util/ares_iface_ips.h diff --git a/lib/c-ares-1.34.4/src/lib/util/ares_math.c b/lib/c-ares-1.34.6/src/lib/util/ares_math.c similarity index 100% rename from lib/c-ares-1.34.4/src/lib/util/ares_math.c rename to lib/c-ares-1.34.6/src/lib/util/ares_math.c diff --git a/lib/c-ares-1.34.4/src/lib/util/ares_math.h b/lib/c-ares-1.34.6/src/lib/util/ares_math.h similarity index 78% rename from lib/c-ares-1.34.4/src/lib/util/ares_math.h rename to lib/c-ares-1.34.6/src/lib/util/ares_math.h index 52fa1facf01..3b60b00bdbb 100644 --- a/lib/c-ares-1.34.4/src/lib/util/ares_math.h +++ b/lib/c-ares-1.34.6/src/lib/util/ares_math.h @@ -26,13 +26,21 @@ #ifndef __ARES_MATH_H #define __ARES_MATH_H -#ifdef _MSC_VER -typedef __int64 ares_int64_t; -typedef unsigned __int64 ares_uint64_t; -#else -typedef long long ares_int64_t; -typedef unsigned long long ares_uint64_t; -#endif +#include "ares_setup.h" + +#ifdef HAVE_STDINT_H +# include + typedef int64_t ares_int64_t; + typedef uint64_t ares_uint64_t; +#else /* HAVE_STDINT_H */ +# ifdef _MSC_VER + typedef __int64 ares_int64_t; + typedef unsigned __int64 ares_uint64_t; +# else + typedef long long ares_int64_t; + typedef unsigned long long ares_uint64_t; +# endif /* _MSC_VER */ +#endif /* HAVE_STDINT_H */ ares_bool_t ares_is_64bit(void); size_t ares_round_up_pow2(size_t n); diff --git a/lib/c-ares-1.34.4/src/lib/util/ares_rand.c b/lib/c-ares-1.34.6/src/lib/util/ares_rand.c similarity index 98% rename from lib/c-ares-1.34.4/src/lib/util/ares_rand.c rename to lib/c-ares-1.34.6/src/lib/util/ares_rand.c index 408999951a7..367dfa21ab1 100644 --- a/lib/c-ares-1.34.4/src/lib/util/ares_rand.c +++ b/lib/c-ares-1.34.6/src/lib/util/ares_rand.c @@ -56,7 +56,7 @@ static unsigned int ares_u32_from_ptr(void *addr) { /* LCOV_EXCL_START: FallbackCode */ if (ares_is_64bit()) { - return (unsigned int)((((ares_uint64_t)addr >> 32) & 0xFFFFFFFF) | + return (unsigned int)((((ares_uint64_t)addr >> 32) & 0xFFFFFFFF) ^ ((ares_uint64_t)addr & 0xFFFFFFFF)); } return (unsigned int)((size_t)addr & 0xFFFFFFFF); @@ -94,12 +94,12 @@ static void ares_rc4_generate_key(ares_rand_rc4 *rc4_state, unsigned char *key, len += sizeof(data); ares_tvnow(&tv); - data = (unsigned int)((tv.sec | tv.usec) & 0xFFFFFFFF); + data = (unsigned int)((tv.sec ^ tv.usec) & 0xFFFFFFFF); memcpy(key + len, &data, sizeof(data)); len += sizeof(data); - srand(ares_u32_from_ptr(rc4_state) | ares_u32_from_ptr(&i) | - (unsigned int)((tv.sec | tv.usec) & 0xFFFFFFFF)); + srand(ares_u32_from_ptr(rc4_state) ^ ares_u32_from_ptr(&i) ^ + (unsigned int)((tv.sec ^ tv.usec) & 0xFFFFFFFF)); #endif for (i = len; i < key_len; i++) { diff --git a/lib/c-ares-1.34.4/src/lib/util/ares_rand.h b/lib/c-ares-1.34.6/src/lib/util/ares_rand.h similarity index 100% rename from lib/c-ares-1.34.4/src/lib/util/ares_rand.h rename to lib/c-ares-1.34.6/src/lib/util/ares_rand.h diff --git a/lib/c-ares-1.34.4/src/lib/util/ares_threads.c b/lib/c-ares-1.34.6/src/lib/util/ares_threads.c similarity index 100% rename from lib/c-ares-1.34.4/src/lib/util/ares_threads.c rename to lib/c-ares-1.34.6/src/lib/util/ares_threads.c diff --git a/lib/c-ares-1.34.4/src/lib/util/ares_threads.h b/lib/c-ares-1.34.6/src/lib/util/ares_threads.h similarity index 100% rename from lib/c-ares-1.34.4/src/lib/util/ares_threads.h rename to lib/c-ares-1.34.6/src/lib/util/ares_threads.h diff --git a/lib/c-ares-1.34.4/src/lib/util/ares_time.h b/lib/c-ares-1.34.6/src/lib/util/ares_time.h similarity index 100% rename from lib/c-ares-1.34.4/src/lib/util/ares_time.h rename to lib/c-ares-1.34.6/src/lib/util/ares_time.h diff --git a/lib/c-ares-1.34.4/src/lib/util/ares_timeval.c b/lib/c-ares-1.34.6/src/lib/util/ares_timeval.c similarity index 100% rename from lib/c-ares-1.34.4/src/lib/util/ares_timeval.c rename to lib/c-ares-1.34.6/src/lib/util/ares_timeval.c diff --git a/lib/c-ares-1.34.4/src/lib/util/ares_uri.c b/lib/c-ares-1.34.6/src/lib/util/ares_uri.c similarity index 99% rename from lib/c-ares-1.34.4/src/lib/util/ares_uri.c rename to lib/c-ares-1.34.6/src/lib/util/ares_uri.c index d656f8347f5..04bad0074a7 100644 --- a/lib/c-ares-1.34.4/src/lib/util/ares_uri.c +++ b/lib/c-ares-1.34.6/src/lib/util/ares_uri.c @@ -533,7 +533,7 @@ static char *ares_uri_path_normalize(const char *path) status = ares_buf_split_str_array(inpath, (const unsigned char *)"/", 1, ARES_BUF_SPLIT_TRIM, 0, &arr); if (status != ARES_SUCCESS) { - return NULL; + goto done; } for (i = 0; i < (ares_ssize_t)ares_array_len(arr); i++) { diff --git a/lib/c-ares-1.34.4/src/lib/util/ares_uri.h b/lib/c-ares-1.34.6/src/lib/util/ares_uri.h similarity index 99% rename from lib/c-ares-1.34.4/src/lib/util/ares_uri.h rename to lib/c-ares-1.34.6/src/lib/util/ares_uri.h index 6a703cba5b5..2d8138fdc3e 100644 --- a/lib/c-ares-1.34.4/src/lib/util/ares_uri.h +++ b/lib/c-ares-1.34.6/src/lib/util/ares_uri.h @@ -175,7 +175,7 @@ ares_status_t ares_uri_set_query_key(ares_uri_t *uri, const char *key, */ ares_status_t ares_uri_del_query_key(ares_uri_t *uri, const char *key); -/*! Retrieve the value associted with a query key. Keys are case-insensitive. +/*! Retrieve the value associated with a query key. Keys are case-insensitive. * * \param[in] uri Initialized URI object * \param[in] key Key to retrieve. diff --git a/lib/c-ares-1.34.4/src/lib/windows_port.c b/lib/c-ares-1.34.6/src/lib/windows_port.c similarity index 100% rename from lib/c-ares-1.34.4/src/lib/windows_port.c rename to lib/c-ares-1.34.6/src/lib/windows_port.c diff --git a/lib/c-ares-1.34.4/src/tools/CMakeLists.txt b/lib/c-ares-1.34.6/src/tools/CMakeLists.txt similarity index 100% rename from lib/c-ares-1.34.4/src/tools/CMakeLists.txt rename to lib/c-ares-1.34.6/src/tools/CMakeLists.txt diff --git a/lib/c-ares-1.34.4/src/tools/Makefile.am b/lib/c-ares-1.34.6/src/tools/Makefile.am similarity index 100% rename from lib/c-ares-1.34.4/src/tools/Makefile.am rename to lib/c-ares-1.34.6/src/tools/Makefile.am diff --git a/lib/c-ares-1.34.4/src/tools/Makefile.in b/lib/c-ares-1.34.6/src/tools/Makefile.in similarity index 99% rename from lib/c-ares-1.34.4/src/tools/Makefile.in rename to lib/c-ares-1.34.6/src/tools/Makefile.in index 19e99a25337..b3f8333f090 100644 --- a/lib/c-ares-1.34.4/src/tools/Makefile.in +++ b/lib/c-ares-1.34.6/src/tools/Makefile.in @@ -106,7 +106,6 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ares_check_user_namespace.m4 \ $(top_srcdir)/m4/ax_code_coverage.m4 \ $(top_srcdir)/m4/ax_compiler_vendor.m4 \ $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \ - $(top_srcdir)/m4/ax_cxx_compile_stdcxx_14.m4 \ $(top_srcdir)/m4/ax_file_escapes.m4 \ $(top_srcdir)/m4/ax_pthread.m4 \ $(top_srcdir)/m4/ax_require_defined.m4 \ @@ -264,14 +263,18 @@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ +FILECMD = @FILECMD@ GCOV = @GCOV@ GENHTML = @GENHTML@ GMOCK112_CFLAGS = @GMOCK112_CFLAGS@ GMOCK112_LIBS = @GMOCK112_LIBS@ +GMOCK117_CFLAGS = @GMOCK117_CFLAGS@ +GMOCK117_LIBS = @GMOCK117_LIBS@ GMOCK_CFLAGS = @GMOCK_CFLAGS@ GMOCK_LIBS = @GMOCK_LIBS@ GREP = @GREP@ HAVE_CXX14 = @HAVE_CXX14@ +HAVE_CXX17 = @HAVE_CXX17@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ diff --git a/lib/c-ares-1.34.4/src/tools/Makefile.inc b/lib/c-ares-1.34.6/src/tools/Makefile.inc similarity index 100% rename from lib/c-ares-1.34.4/src/tools/Makefile.inc rename to lib/c-ares-1.34.6/src/tools/Makefile.inc diff --git a/lib/c-ares-1.34.4/src/tools/adig.c b/lib/c-ares-1.34.6/src/tools/adig.c similarity index 100% rename from lib/c-ares-1.34.4/src/tools/adig.c rename to lib/c-ares-1.34.6/src/tools/adig.c diff --git a/lib/c-ares-1.34.4/src/tools/ahost.c b/lib/c-ares-1.34.6/src/tools/ahost.c similarity index 100% rename from lib/c-ares-1.34.4/src/tools/ahost.c rename to lib/c-ares-1.34.6/src/tools/ahost.c diff --git a/lib/c-ares-1.34.4/src/tools/ares_getopt.c b/lib/c-ares-1.34.6/src/tools/ares_getopt.c similarity index 100% rename from lib/c-ares-1.34.4/src/tools/ares_getopt.c rename to lib/c-ares-1.34.6/src/tools/ares_getopt.c diff --git a/lib/c-ares-1.34.4/src/tools/ares_getopt.h b/lib/c-ares-1.34.6/src/tools/ares_getopt.h similarity index 100% rename from lib/c-ares-1.34.4/src/tools/ares_getopt.h rename to lib/c-ares-1.34.6/src/tools/ares_getopt.h diff --git a/lib/c-ares-1.34.4/test/CMakeLists.txt b/lib/c-ares-1.34.6/test/CMakeLists.txt similarity index 97% rename from lib/c-ares-1.34.4/test/CMakeLists.txt rename to lib/c-ares-1.34.6/test/CMakeLists.txt index 13f637a83ac..88725b77e52 100644 --- a/lib/c-ares-1.34.4/test/CMakeLists.txt +++ b/lib/c-ares-1.34.6/test/CMakeLists.txt @@ -1,6 +1,8 @@ # Copyright (C) The c-ares project and its contributors # SPDX-License-Identifier: MIT +enable_language(CXX) + # Get rid of: warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc IF (MSVC) SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc") @@ -50,6 +52,7 @@ IF (CMAKE_VERSION VERSION_LESS "3.23.0") ELSE () target_link_libraries(arestest PRIVATE caresinternal GTest::gmock) ENDIF() +target_compile_features(arestest PRIVATE cxx_std_14) target_compile_definitions(arestest PRIVATE CARES_NO_DEPRECATED) IF (CARES_BUILD_CONTAINER_TESTS) @@ -75,6 +78,7 @@ set_target_properties(aresfuzzname PROPERTIES COMPILE_PDB_NAME aresfuzzname.pdb) add_executable(dnsdump ${DUMPSOURCES}) target_compile_definitions(dnsdump PRIVATE CARES_NO_DEPRECATED) +target_compile_features(dnsdump PRIVATE cxx_std_14) target_link_libraries(dnsdump PRIVATE caresinternal) # Avoid "fatal error C1041: cannot open program database" due to multiple # targets trying to use the same PDB. /FS does NOT resolve this issue. diff --git a/lib/c-ares-1.34.4/test/Makefile.am b/lib/c-ares-1.34.6/test/Makefile.am similarity index 100% rename from lib/c-ares-1.34.4/test/Makefile.am rename to lib/c-ares-1.34.6/test/Makefile.am diff --git a/lib/c-ares-1.34.4/test/Makefile.in b/lib/c-ares-1.34.6/test/Makefile.in similarity index 99% rename from lib/c-ares-1.34.4/test/Makefile.in rename to lib/c-ares-1.34.6/test/Makefile.in index 773b5189524..98f5df0f0a1 100644 --- a/lib/c-ares-1.34.4/test/Makefile.in +++ b/lib/c-ares-1.34.6/test/Makefile.in @@ -108,7 +108,6 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ares_check_user_namespace.m4 \ $(top_srcdir)/m4/ax_code_coverage.m4 \ $(top_srcdir)/m4/ax_compiler_vendor.m4 \ $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \ - $(top_srcdir)/m4/ax_cxx_compile_stdcxx_14.m4 \ $(top_srcdir)/m4/ax_file_escapes.m4 \ $(top_srcdir)/m4/ax_pthread.m4 \ $(top_srcdir)/m4/ax_require_defined.m4 \ @@ -547,14 +546,18 @@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ +FILECMD = @FILECMD@ GCOV = @GCOV@ GENHTML = @GENHTML@ GMOCK112_CFLAGS = @GMOCK112_CFLAGS@ GMOCK112_LIBS = @GMOCK112_LIBS@ +GMOCK117_CFLAGS = @GMOCK117_CFLAGS@ +GMOCK117_LIBS = @GMOCK117_LIBS@ GMOCK_CFLAGS = @GMOCK_CFLAGS@ GMOCK_LIBS = @GMOCK_LIBS@ GREP = @GREP@ HAVE_CXX14 = @HAVE_CXX14@ +HAVE_CXX17 = @HAVE_CXX17@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ diff --git a/lib/c-ares-1.34.4/test/Makefile.inc b/lib/c-ares-1.34.6/test/Makefile.inc similarity index 100% rename from lib/c-ares-1.34.4/test/Makefile.inc rename to lib/c-ares-1.34.6/test/Makefile.inc diff --git a/lib/c-ares-1.34.4/test/Makefile.m32 b/lib/c-ares-1.34.6/test/Makefile.m32 similarity index 96% rename from lib/c-ares-1.34.4/test/Makefile.m32 rename to lib/c-ares-1.34.6/test/Makefile.m32 index 5227f98fbb4..26ab0421a2e 100644 --- a/lib/c-ares-1.34.4/test/Makefile.m32 +++ b/lib/c-ares-1.34.6/test/Makefile.m32 @@ -10,6 +10,8 @@ CXX = g++ CC = gcc LD = g++ +WIN32_WINNT ?= 0x0602 + ifeq "$(GTEST_ROOT)" "" $(error missing GTEST_ROOT) endif @@ -19,7 +21,7 @@ ARES_SRC_DIR = .. # Where to find the built c-ares static library ARES_BLD_DIR = .. ARESLIB = $(ARES_BLD_DIR)/src/lib/libcares.a -CPPFLAGS = -I$(ARES_SRC_DIR)/include -I$(ARES_SRC_DIR)/src/lib -I$(ARES_SRC_DIR)/src/lib/include -I$(GTEST_ROOT)/include -DCARES_STATICLIB -DCARES_NO_DEPRECATED +CPPFLAGS = -I$(ARES_SRC_DIR)/include -I$(ARES_SRC_DIR)/src/lib -I$(ARES_SRC_DIR)/src/lib/include -I$(GTEST_ROOT)/include -DCARES_STATICLIB -DCARES_NO_DEPRECATED -D_WIN32_WINNT=$(WIN32_WINNT) CXXFLAGS = -Wall $(PTHREAD_CFLAGS) -std=gnu++14 LDFLAGS = LDLIBS = -lws2_32 -liphlpapi diff --git a/lib/c-ares-1.34.4/test/Makefile.msvc b/lib/c-ares-1.34.6/test/Makefile.msvc similarity index 100% rename from lib/c-ares-1.34.4/test/Makefile.msvc rename to lib/c-ares-1.34.6/test/Makefile.msvc diff --git a/lib/c-ares-1.34.4/test/README.md b/lib/c-ares-1.34.6/test/README.md similarity index 100% rename from lib/c-ares-1.34.4/test/README.md rename to lib/c-ares-1.34.6/test/README.md diff --git a/lib/c-ares-1.34.4/test/ares-fuzz.c b/lib/c-ares-1.34.6/test/ares-fuzz.c similarity index 99% rename from lib/c-ares-1.34.4/test/ares-fuzz.c rename to lib/c-ares-1.34.6/test/ares-fuzz.c index 8203d48da80..239f127dbf7 100644 --- a/lib/c-ares-1.34.4/test/ares-fuzz.c +++ b/lib/c-ares-1.34.6/test/ares-fuzz.c @@ -33,7 +33,7 @@ #include #include #include -#ifdef WIN32 +#ifdef _WIN32 # include #else # include diff --git a/lib/c-ares-1.34.4/test/ares-test-ai.h b/lib/c-ares-1.34.6/test/ares-test-ai.h similarity index 100% rename from lib/c-ares-1.34.4/test/ares-test-ai.h rename to lib/c-ares-1.34.6/test/ares-test-ai.h diff --git a/lib/c-ares-1.34.4/test/ares-test-fuzz-name.c b/lib/c-ares-1.34.6/test/ares-test-fuzz-name.c similarity index 100% rename from lib/c-ares-1.34.4/test/ares-test-fuzz-name.c rename to lib/c-ares-1.34.6/test/ares-test-fuzz-name.c diff --git a/lib/c-ares-1.34.4/test/ares-test-fuzz.c b/lib/c-ares-1.34.6/test/ares-test-fuzz.c similarity index 100% rename from lib/c-ares-1.34.4/test/ares-test-fuzz.c rename to lib/c-ares-1.34.6/test/ares-test-fuzz.c diff --git a/lib/c-ares-1.34.4/test/ares-test-init.cc b/lib/c-ares-1.34.6/test/ares-test-init.cc similarity index 100% rename from lib/c-ares-1.34.4/test/ares-test-init.cc rename to lib/c-ares-1.34.6/test/ares-test-init.cc diff --git a/lib/c-ares-1.34.4/test/ares-test-internal.cc b/lib/c-ares-1.34.6/test/ares-test-internal.cc similarity index 99% rename from lib/c-ares-1.34.4/test/ares-test-internal.cc rename to lib/c-ares-1.34.6/test/ares-test-internal.cc index 3e3760bf135..55f6832652c 100644 --- a/lib/c-ares-1.34.4/test/ares-test-internal.cc +++ b/lib/c-ares-1.34.6/test/ares-test-internal.cc @@ -299,6 +299,7 @@ TEST_F(LibraryTest, SlistMisuse) { EXPECT_EQ(NULL, ares_slist_node_claim(NULL)); } +#if !defined(_WIN32) || _WIN32_WINNT >= 0x0600 TEST_F(LibraryTest, IfaceIPs) { ares_status_t status; ares_iface_ips_t *ips = NULL; @@ -354,6 +355,7 @@ TEST_F(LibraryTest, IfaceIPs) { ares_iface_ips_destroy(ips); } +#endif TEST_F(LibraryTest, HtableMisuse) { EXPECT_EQ(NULL, ares_htable_create(NULL, NULL, NULL, NULL)); @@ -592,6 +594,18 @@ TEST_F(FileChannelTest, GetAddrInfoHostsIPV6) { EXPECT_EQ("{ipv6.com addr=[[0000:0000:0000:0000:0000:0000:0000:0001]]}", ss.str()); } +TEST_F(FileChannelTest, GetAddrInfoInvalidService) { + TempFile hostsfile("1.2.3.4 example.com"); + EnvValue with_env("CARES_HOSTS", hostsfile.filename()); + struct ares_addrinfo_hints hints{}; + AddrInfoResult result{}; + hints.ai_family = AF_INET; + hints.ai_flags = ARES_AI_CANONNAME | ARES_AI_ENVHOSTS | ARES_AI_NOSORT; + ares_getaddrinfo(channel_, "example.com", "invalid", &hints, AddrInfoCallback, &result); + Process(); + EXPECT_TRUE(result.done_); + EXPECT_EQ(result.status_, ARES_ESERVICE); +} TEST_F(FileChannelTest, GetAddrInfoAllocFail) { TempFile hostsfile("1.2.3.4 example.com alias1 alias2\n"); diff --git a/lib/c-ares-1.34.4/test/ares-test-live.cc b/lib/c-ares-1.34.6/test/ares-test-live.cc similarity index 89% rename from lib/c-ares-1.34.4/test/ares-test-live.cc rename to lib/c-ares-1.34.6/test/ares-test-live.cc index e23dadfe23a..557c485e366 100644 --- a/lib/c-ares-1.34.4/test/ares-test-live.cc +++ b/lib/c-ares-1.34.6/test/ares-test-live.cc @@ -669,115 +669,7 @@ VIRT_NONVIRT_TEST_F(DefaultChannelTest, LiveGetNameInfoAllocFail) { EXPECT_EQ(ARES_ENOMEM, result.status_); } -VIRT_NONVIRT_TEST_F(DefaultChannelTest, GetSock) { - ares_socket_t socks[3] = {ARES_SOCKET_BAD, ARES_SOCKET_BAD, ARES_SOCKET_BAD}; - int bitmask = ares_getsock(channel_, socks, 3); - EXPECT_EQ(0, bitmask); - bitmask = ares_getsock(channel_, nullptr, 0); - EXPECT_EQ(0, bitmask); - - // Ask again with a pending query. - HostResult result; - ares_gethostbyname(channel_, "www.google.com.", AF_INET, HostCallback, &result); - bitmask = ares_getsock(channel_, socks, 3); - EXPECT_NE(0, bitmask); - - size_t sock_cnt = 0; - for (size_t i=0; i<3; i++) { - if (ARES_GETSOCK_READABLE(bitmask, i) || ARES_GETSOCK_WRITABLE(bitmask, i)) { - EXPECT_NE(ARES_SOCKET_BAD, socks[i]); - if (socks[i] != ARES_SOCKET_BAD) - sock_cnt++; - } - } - EXPECT_NE((size_t)0, sock_cnt); - - bitmask = ares_getsock(channel_, nullptr, 0); - EXPECT_EQ(0, bitmask); - - Process(); -} - -TEST_F(LibraryTest, GetTCPSock) { - ares_channel_t *channel; - struct ares_options opts; - memset(&opts, 0, sizeof(opts)); - opts.tcp_port = 53; - opts.flags = ARES_FLAG_USEVC; - int optmask = ARES_OPT_TCP_PORT | ARES_OPT_FLAGS; - EXPECT_EQ(ARES_SUCCESS, ares_init_options(&channel, &opts, optmask)); - EXPECT_NE(nullptr, channel); - - ares_socket_t socks[3] = {ARES_SOCKET_BAD, ARES_SOCKET_BAD, ARES_SOCKET_BAD}; - int bitmask = ares_getsock(channel, socks, 3); - EXPECT_EQ(0, bitmask); - bitmask = ares_getsock(channel, nullptr, 0); - EXPECT_EQ(0, bitmask); - - // Ask again with a pending query. - HostResult result; - ares_gethostbyname(channel, "www.google.com.", AF_INET, HostCallback, &result); - bitmask = ares_getsock(channel, socks, 3); - EXPECT_NE(0, bitmask); - - size_t sock_cnt = 0; - for (size_t i=0; i<3; i++) { - if (ARES_GETSOCK_READABLE(bitmask, i) || ARES_GETSOCK_WRITABLE(bitmask, i)) { - EXPECT_NE(ARES_SOCKET_BAD, socks[i]); - if (socks[i] != ARES_SOCKET_BAD) - sock_cnt++; - } - } - EXPECT_NE((size_t)0, sock_cnt); - - bitmask = ares_getsock(channel, nullptr, 0); - EXPECT_EQ(0, bitmask); - - ProcessWork(channel, NoExtraFDs, nullptr); - ares_destroy(channel); -} - -TEST_F(DefaultChannelTest, VerifySocketFunctionCallback) { - VirtualizeIO vio(channel_); - - auto my_functions = VirtualizeIO::default_functions; - size_t count = 0; - - my_functions.asocket = [](int af, int type, int protocol, void * p) -> ares_socket_t { - EXPECT_NE(nullptr, p); - (*reinterpret_cast(p))++; - return ::socket(af, type, protocol); - }; - - ares_set_socket_functions(channel_, &my_functions, &count); - - { - count = 0; - HostResult result; - ares_gethostbyname(channel_, "www.google.com.", AF_INET, HostCallback, &result); - Process(); - - EXPECT_TRUE(result.done_); - EXPECT_NE((size_t)0, count); - } - - { - count = 0; - ares_channel_t *copy; - EXPECT_EQ(ARES_SUCCESS, ares_dup(©, channel_)); - - HostResult result; - ares_gethostbyname(copy, "www.google.com.", AF_INET, HostCallback, &result); - - ProcessWork(copy, NoExtraFDs, nullptr); - - EXPECT_TRUE(result.done_); - ares_destroy(copy); - EXPECT_NE((size_t)0, count); - } - -} TEST_F(DefaultChannelTest, LiveSetServers) { struct ares_addr_node server1; diff --git a/lib/c-ares-1.34.4/test/ares-test-main.cc b/lib/c-ares-1.34.6/test/ares-test-main.cc similarity index 100% rename from lib/c-ares-1.34.4/test/ares-test-main.cc rename to lib/c-ares-1.34.6/test/ares-test-main.cc diff --git a/lib/c-ares-1.34.4/test/ares-test-misc.cc b/lib/c-ares-1.34.6/test/ares-test-misc.cc similarity index 100% rename from lib/c-ares-1.34.4/test/ares-test-misc.cc rename to lib/c-ares-1.34.6/test/ares-test-misc.cc diff --git a/lib/c-ares-1.34.4/test/ares-test-mock-ai.cc b/lib/c-ares-1.34.6/test/ares-test-mock-ai.cc similarity index 76% rename from lib/c-ares-1.34.4/test/ares-test-mock-ai.cc rename to lib/c-ares-1.34.6/test/ares-test-mock-ai.cc index a36918cd64c..ae45c45527f 100644 --- a/lib/c-ares-1.34.4/test/ares-test-mock-ai.cc +++ b/lib/c-ares-1.34.6/test/ares-test-mock-ai.cc @@ -713,6 +713,132 @@ TEST_P(MockChannelTestAI, FamilyUnspecified) { EXPECT_THAT(result.ai_, IncludesV6Address("2121:0000:0000:0000:0000:0000:0000:0303")); } + +TEST_P(MockChannelTestAI, TriggerResendThenConnFailSERVFAIL) { + // Set up the server response. The server always returns SERVFAIL. + DNSPacket badrsp4; + badrsp4.set_response().set_aa().set_rcode(SERVFAIL) + .add_question(new DNSQuestion("www.google.com", T_A)); + DNSPacket goodrsp4; + goodrsp4.set_response().set_aa() + .add_question(new DNSQuestion("www.google.com", T_A)) + .add_answer(new DNSARR("www.google.com", 0x0100, {0x01, 0x02, 0x03, 0x04})); + + DNSPacket goodrsp6; + goodrsp6.set_response().set_aa() + .add_question(new DNSQuestion("www.google.com", T_AAAA)) + .add_answer(new DNSAaaaRR("www.google.com", 100, + {0x21, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03})); + + EXPECT_CALL(server_, OnRequest("www.google.com", T_A)) + .WillOnce(SetReplyAndFailSend(&server_, &badrsp4)) + .WillOnce(SetReply(&server_, &goodrsp4)); + + EXPECT_CALL(server_, OnRequest("www.google.com", T_AAAA)) + .WillRepeatedly(SetReply(&server_, &goodrsp6)); + + ares_socket_functions sock_funcs; + memset(&sock_funcs, 0, sizeof(sock_funcs)); + + sock_funcs.asendv = ares_sendv_fail; + + ares_set_socket_functions(channel_, &sock_funcs, NULL); + + AddrInfoResult result; + struct ares_addrinfo_hints hints = {0, 0, 0, 0}; + hints.ai_family = AF_UNSPEC; + hints.ai_flags = ARES_AI_NOSORT; + ares_getaddrinfo(channel_, "www.google.com.", NULL, &hints, + AddrInfoCallback, &result); + + Process(); + EXPECT_TRUE(result.done_); + EXPECT_TRUE(result.done_); + EXPECT_THAT(result.ai_, IncludesNumAddresses(2)); + EXPECT_THAT(result.ai_, IncludesV4Address("1.2.3.4")); + EXPECT_THAT(result.ai_, IncludesV6Address("2121:0000:0000:0000:0000:0000:0000:0303")); +} + +TEST_P(MockUDPChannelTestAI, TriggerResendThenConnFailEDNS) { + // Set up the server response to simulate an EDNS failure + DNSPacket badrsp4; + badrsp4.set_response().set_aa().set_rcode(FORMERR) + .add_question(new DNSQuestion("www.google.com", T_A)); + DNSPacket goodrsp4; + goodrsp4.set_response().set_aa() + .add_question(new DNSQuestion("www.google.com", T_A)) + .add_answer(new DNSARR("www.google.com", 0x0100, {0x01, 0x02, 0x03, 0x04})); + DNSPacket goodrsp6; + goodrsp6.set_response().set_aa() + .add_question(new DNSQuestion("www.google.com", T_AAAA)) + .add_answer(new DNSAaaaRR("www.google.com", 100, + {0x21, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03})); + + EXPECT_CALL(server_, OnRequest("www.google.com", T_A)) + .WillOnce(SetReplyAndFailSend(&server_, &badrsp4)) + .WillOnce(SetReply(&server_, &goodrsp4)); + + EXPECT_CALL(server_, OnRequest("www.google.com", T_AAAA)) + .WillRepeatedly(SetReply(&server_, &goodrsp6)); + + ares_socket_functions sock_funcs; + memset(&sock_funcs, 0, sizeof(sock_funcs)); + + sock_funcs.asendv = ares_sendv_fail; + + ares_set_socket_functions(channel_, &sock_funcs, NULL); + + AddrInfoResult result; + struct ares_addrinfo_hints hints = {0, 0, 0, 0}; + hints.ai_family = AF_UNSPEC; + hints.ai_flags = ARES_AI_NOSORT; + ares_getaddrinfo(channel_, "www.google.com.", NULL, &hints, + AddrInfoCallback, &result); + + Process(); + EXPECT_TRUE(result.done_); + EXPECT_TRUE(result.done_); + EXPECT_THAT(result.ai_, IncludesNumAddresses(2)); + EXPECT_THAT(result.ai_, IncludesV4Address("1.2.3.4")); + EXPECT_THAT(result.ai_, IncludesV6Address("2121:0000:0000:0000:0000:0000:0000:0303")); +} + +TEST_P(MockUDPChannelTestAI, ConnectionRefusedOnSearchDomainRetry) { + DNSPacket badrsp4; + badrsp4.set_response().set_aa() + .add_question(new DNSQuestion("www.google.com", T_A)) + .set_rcode(NXDOMAIN); + + EXPECT_CALL(server_, OnRequest("www.google.com", T_A)) + .WillOnce(SetReplyAndFailSend(&server_, &badrsp4)); + + DNSPacket goodrsp4; + goodrsp4.set_response().set_aa() + .add_question(new DNSQuestion("www.google.com.first.com", T_A)) + .add_answer(new DNSARR("www.google.com.first.com", 0x0100, {0x01, 0x02, 0x03, 0x04})); + + EXPECT_CALL(server_, OnRequest("www.google.com.first.com", T_A)) + .WillOnce(SetReply(&server_, &goodrsp4)); + + ares_socket_functions sock_funcs; + memset(&sock_funcs, 0, sizeof(sock_funcs)); + + sock_funcs.asendv = ares_sendv_fail; + + ares_set_socket_functions(channel_, &sock_funcs, NULL); + + AddrInfoResult result; + struct ares_addrinfo_hints hints = {0, 0, 0, 0}; + hints.ai_family = AF_INET; + hints.ai_flags = ARES_AI_NOSORT; + ares_getaddrinfo(channel_, "www.google.com", NULL, &hints, + AddrInfoCallback, &result); + + Process(); +} + class MockEDNSChannelTestAI : public MockFlagsChannelOptsTestAI { public: MockEDNSChannelTestAI() : MockFlagsChannelOptsTestAI(ARES_FLAG_EDNS) {} @@ -979,6 +1105,182 @@ TEST_P(MockChannelTestAI, FamilyV4ServiceName) { EXPECT_EQ("{addr=[1.1.1.1:80], addr=[2.2.2.2:80]}", ss.str()); } +#ifdef HAVE_CONTAINER + +class ContainedMockChannelAISysConfig + : public MockChannelOptsTest, + public ::testing::WithParamInterface> { + public: + ContainedMockChannelAISysConfig() + : MockChannelOptsTest(1, GetParam().first, GetParam().second, true, nullptr, 0) {} +}; + +static NameContentList files_no_ndots = { + {"/etc/resolv.conf", "nameserver 1.2.3.4\n" // Will be replaced + "search example.com example.org\n" + "options edns0 trust-ad\n"}, // ndots:1 is default + {"/etc/hosts", "3.4.5.6 ahostname.com\n"}, + {"/etc/nsswitch.conf", "hosts: files dns\n"}}; + +/* These tests should still work even with /etc/hosts not having any localhost + * entries */ +CONTAINED_TEST_P(ContainedMockChannelAISysConfig, NoHostsLocalHostv4, + "myhostname", "mydomainname.org", files_no_ndots) { + AddrInfoResult result = {}; + struct ares_addrinfo_hints hints = {0, 0, 0, 0}; + hints.ai_family = AF_INET; + hints.ai_flags = ARES_AI_NOSORT; + ares_getaddrinfo(channel_, "localhost", NULL, &hints, AddrInfoCallback, &result); + Process(); + EXPECT_TRUE(result.done_); + EXPECT_EQ(result.status_, ARES_SUCCESS); + EXPECT_THAT(result.ai_, IncludesNumAddresses(1)); + EXPECT_THAT(result.ai_, IncludesV4Address("127.0.0.1")); + return HasFailure(); +} + +CONTAINED_TEST_P(ContainedMockChannelAISysConfig, NoHostsLocalHostv6, + "myhostname", "mydomainname.org", files_no_ndots) { + AddrInfoResult result = {}; + struct ares_addrinfo_hints hints = {0, 0, 0, 0}; + hints.ai_family = AF_INET6; + hints.ai_flags = ARES_AI_NOSORT; + ares_getaddrinfo(channel_, "localhost", NULL, &hints, AddrInfoCallback, &result); + Process(); + EXPECT_TRUE(result.done_); + EXPECT_EQ(result.status_, ARES_SUCCESS); + EXPECT_THAT(result.ai_, IncludesNumAddresses(1)); + EXPECT_THAT(result.ai_, IncludesV6Address("0000:0000:0000:0000:0000:0000:0000:0001")); + return HasFailure(); +} + +CONTAINED_TEST_P(ContainedMockChannelAISysConfig, NoHostsLocalHostUnspec, + "myhostname", "mydomainname.org", files_no_ndots) { + AddrInfoResult result = {}; + struct ares_addrinfo_hints hints = {0, 0, 0, 0}; + hints.ai_family = AF_UNSPEC; + hints.ai_flags = ARES_AI_NOSORT; + ares_getaddrinfo(channel_, "localhost", NULL, &hints, AddrInfoCallback, &result); + Process(); + EXPECT_TRUE(result.done_); + EXPECT_EQ(result.status_, ARES_SUCCESS); + EXPECT_THAT(result.ai_, IncludesNumAddresses(2)); + EXPECT_THAT(result.ai_, IncludesV4Address("127.0.0.1")); + EXPECT_THAT(result.ai_, IncludesV6Address("0000:0000:0000:0000:0000:0000:0000:0001")); + return HasFailure(); +} + + +/* Issue #946 says if a v4 localhost entry exists, but not a v6 entry, v6 + * isn't output correctly. */ +static NameContentList files_localhost_v4localhostonly = { + {"/etc/resolv.conf", "nameserver 1.2.3.4\n" // Will be replaced + "search example.com example.org\n" + "options edns0 trust-ad\n"}, // ndots:1 is default + {"/etc/hosts", "127.0.0.1 localhost\n"}, + {"/etc/nsswitch.conf", "hosts: files dns\n"}}; +CONTAINED_TEST_P(ContainedMockChannelAISysConfig, v4OnlyLocalHostv4, + "myhostname", "mydomainname.org", files_localhost_v4localhostonly) { + AddrInfoResult result = {}; + struct ares_addrinfo_hints hints = {0, 0, 0, 0}; + hints.ai_family = AF_INET; + hints.ai_flags = ARES_AI_NOSORT; + ares_getaddrinfo(channel_, "localhost", NULL, &hints, AddrInfoCallback, &result); + Process(); + EXPECT_TRUE(result.done_); + EXPECT_EQ(result.status_, ARES_SUCCESS); + EXPECT_THAT(result.ai_, IncludesNumAddresses(1)); + EXPECT_THAT(result.ai_, IncludesV4Address("127.0.0.1")); + return HasFailure(); +} + +CONTAINED_TEST_P(ContainedMockChannelAISysConfig, v4OnlyLocalHostv6, + "myhostname", "mydomainname.org", files_localhost_v4localhostonly) { + AddrInfoResult result = {}; + struct ares_addrinfo_hints hints = {0, 0, 0, 0}; + hints.ai_family = AF_INET6; + hints.ai_flags = ARES_AI_NOSORT; + ares_getaddrinfo(channel_, "localhost", NULL, &hints, AddrInfoCallback, &result); + Process(); + EXPECT_TRUE(result.done_); + EXPECT_EQ(result.status_, ARES_SUCCESS); + EXPECT_THAT(result.ai_, IncludesNumAddresses(1)); + EXPECT_THAT(result.ai_, IncludesV6Address("0000:0000:0000:0000:0000:0000:0000:0001")); + return HasFailure(); +} + +CONTAINED_TEST_P(ContainedMockChannelAISysConfig, v4OnlyLocalHostUnspec, + "myhostname", "mydomainname.org", files_localhost_v4localhostonly) { + AddrInfoResult result = {}; + struct ares_addrinfo_hints hints = {0, 0, 0, 0}; + hints.ai_family = AF_UNSPEC; + hints.ai_flags = ARES_AI_NOSORT; + ares_getaddrinfo(channel_, "localhost", NULL, &hints, AddrInfoCallback, &result); + Process(); + EXPECT_TRUE(result.done_); + EXPECT_EQ(result.status_, ARES_SUCCESS); + EXPECT_THAT(result.ai_, IncludesNumAddresses(2)); + EXPECT_THAT(result.ai_, IncludesV4Address("127.0.0.1")); + EXPECT_THAT(result.ai_, IncludesV6Address("0000:0000:0000:0000:0000:0000:0000:0001")); + return HasFailure(); +} + + +static NameContentList files_localhost_v6localhostonly = { + {"/etc/resolv.conf", "nameserver 1.2.3.4\n" // Will be replaced + "search example.com example.org\n" + "options edns0 trust-ad\n"}, // ndots:1 is default + {"/etc/hosts", "::1 localhost\n"}, + {"/etc/nsswitch.conf", "hosts: files dns\n"}}; +CONTAINED_TEST_P(ContainedMockChannelAISysConfig, v6OnlyLocalHostv4, + "myhostname", "mydomainname.org", files_localhost_v6localhostonly) { + AddrInfoResult result = {}; + struct ares_addrinfo_hints hints = {0, 0, 0, 0}; + hints.ai_family = AF_INET; + hints.ai_flags = ARES_AI_NOSORT; + ares_getaddrinfo(channel_, "localhost", NULL, &hints, AddrInfoCallback, &result); + Process(); + EXPECT_TRUE(result.done_); + EXPECT_EQ(result.status_, ARES_SUCCESS); + EXPECT_THAT(result.ai_, IncludesNumAddresses(1)); + EXPECT_THAT(result.ai_, IncludesV4Address("127.0.0.1")); + return HasFailure(); +} + +CONTAINED_TEST_P(ContainedMockChannelAISysConfig, v6OnlyLocalHostv6, + "myhostname", "mydomainname.org", files_localhost_v6localhostonly) { + AddrInfoResult result = {}; + struct ares_addrinfo_hints hints = {0, 0, 0, 0}; + hints.ai_family = AF_INET6; + hints.ai_flags = ARES_AI_NOSORT; + ares_getaddrinfo(channel_, "localhost", NULL, &hints, AddrInfoCallback, &result); + Process(); + EXPECT_TRUE(result.done_); + EXPECT_EQ(result.status_, ARES_SUCCESS); + EXPECT_THAT(result.ai_, IncludesNumAddresses(1)); + EXPECT_THAT(result.ai_, IncludesV6Address("0000:0000:0000:0000:0000:0000:0000:0001")); + return HasFailure(); +} + +CONTAINED_TEST_P(ContainedMockChannelAISysConfig, v6OnlyLocalHostUnspec, + "myhostname", "mydomainname.org", files_localhost_v6localhostonly) { + AddrInfoResult result = {}; + struct ares_addrinfo_hints hints = {0, 0, 0, 0}; + hints.ai_family = AF_UNSPEC; + hints.ai_flags = ARES_AI_NOSORT; + ares_getaddrinfo(channel_, "localhost", NULL, &hints, AddrInfoCallback, &result); + Process(); + EXPECT_TRUE(result.done_); + EXPECT_EQ(result.status_, ARES_SUCCESS); + EXPECT_THAT(result.ai_, IncludesNumAddresses(2)); + EXPECT_THAT(result.ai_, IncludesV4Address("127.0.0.1")); + EXPECT_THAT(result.ai_, IncludesV6Address("0000:0000:0000:0000:0000:0000:0000:0001")); + return HasFailure(); +} + +INSTANTIATE_TEST_SUITE_P(AddressFamiliesAI, ContainedMockChannelAISysConfig, ::testing::ValuesIn(ares::test::families_modes), PrintFamilyMode); +#endif + INSTANTIATE_TEST_SUITE_P(AddressFamiliesAI, MockChannelTestAI, ::testing::ValuesIn(ares::test::families_modes), PrintFamilyMode); diff --git a/lib/c-ares-1.34.4/test/ares-test-mock-et.cc b/lib/c-ares-1.34.6/test/ares-test-mock-et.cc similarity index 95% rename from lib/c-ares-1.34.4/test/ares-test-mock-et.cc rename to lib/c-ares-1.34.6/test/ares-test-mock-et.cc index 22f80e890ca..b8cf5dd3cc4 100644 --- a/lib/c-ares-1.34.4/test/ares-test-mock-et.cc +++ b/lib/c-ares-1.34.6/test/ares-test-mock-et.cc @@ -112,6 +112,114 @@ TEST_P(MockUDPEventThreadTest, BadLoopbackServerNoTimeouts) { } } +static int noop_close(ares_socket_t sock, void *user_data) +{ + (void)user_data; +#if defined(HAVE_CLOSESOCKET) + return closesocket(sock); +#elif defined(HAVE_CLOSESOCKET_CAMEL) + return CloseSocket(sock); +#elif defined(HAVE_CLOSE_S) + return close_s(sock); +#else + return close(sock); +#endif + return 0; +} + +static ares_socket_t noop_socket(int domain, int type, int protocol, + void *user_data) +{ + (void)user_data; + return socket(domain, type, protocol); +} + +static int noop_setsockopt(ares_socket_t sock, ares_socket_opt_t opt, + const void *val, ares_socklen_t val_size, + void *user_data) +{ + (void)sock; + (void)opt; + (void)val; + (void)val_size; + (void)user_data; + return 0; +} + +static int noop_connect(ares_socket_t sock, const struct sockaddr *address, + ares_socklen_t address_len, unsigned int flags, + void *user_data) +{ + (void)sock; + (void)address; + (void)address_len; + (void)flags; + (void)user_data; + + return 0; +} + +static ares_ssize_t noop_recvfrom(ares_socket_t sock, void *buffer, + size_t length, int flags, + struct sockaddr *address, + ares_socklen_t *address_len, + void *user_data) +{ + (void)sock; + (void)buffer; + (void)length; + (void)flags; + (void)address; + (void)address_len; + (void)user_data; + + errno = EAGAIN; + return 0; +} + +static ares_ssize_t noop_sendto(ares_socket_t sock, const void *buffer, + size_t length, int flags, + const struct sockaddr *address, + ares_socklen_t address_len, void *user_data) +{ + (void)sock; + (void)buffer; + (void)flags; + (void)address; + (void)address_len; + (void)user_data; + /* Eat all data */ + return (ares_ssize_t)length; +} + +// Issue #1000 Event Thread stall on temporarily downed server. +TEST_P(MockUDPEventThreadTest, DownServer) { + struct ares_socket_functions_ex noop_sock_funcs; + memset(&noop_sock_funcs, 0, sizeof(noop_sock_funcs)); + noop_sock_funcs.version = 1; + noop_sock_funcs.asocket = noop_socket; + noop_sock_funcs.aclose = noop_close; + noop_sock_funcs.asetsockopt = noop_setsockopt; + noop_sock_funcs.aconnect = noop_connect; + noop_sock_funcs.arecvfrom = noop_recvfrom; + noop_sock_funcs.asendto = noop_sendto; + ares_set_socket_functions_ex(channel_, &noop_sock_funcs, NULL); + + QueryResult result; + ares_query_dnsrec(channel_, "www.google.com", ARES_CLASS_IN, ARES_REC_TYPE_A, QueryCallback, &result, NULL); + // no need to call Process() since we're not actually connecting + ares_queue_wait_empty(channel_, -1); + EXPECT_TRUE(result.done_); + EXPECT_NE(0, result.timeouts_); + + // Issue states second query stalls + ares_query_dnsrec(channel_, "www.google.com", ARES_CLASS_IN, ARES_REC_TYPE_A, QueryCallback, &result, NULL); + // no need to call Process() since we're not actually connecting + ares_queue_wait_empty(channel_, -1); + EXPECT_TRUE(result.done_); + EXPECT_NE(0, result.timeouts_); +} + // UDP to TCP specific test TEST_P(MockUDPEventThreadTest, TruncationRetry) { DNSPacket rsptruncated; diff --git a/lib/c-ares-1.34.4/test/ares-test-mock.cc b/lib/c-ares-1.34.6/test/ares-test-mock.cc similarity index 93% rename from lib/c-ares-1.34.4/test/ares-test-mock.cc rename to lib/c-ares-1.34.6/test/ares-test-mock.cc index d53d04d0760..4b60eee85de 100644 --- a/lib/c-ares-1.34.4/test/ares-test-mock.cc +++ b/lib/c-ares-1.34.6/test/ares-test-mock.cc @@ -850,7 +850,7 @@ class ContainedMockChannelSysConfig : MockChannelOptsTest(1, GetParam().first, GetParam().second, true, nullptr, 0) {} }; -NameContentList files_no_ndots = { +static NameContentList files_no_ndots = { {"/etc/resolv.conf", "nameserver 1.2.3.4\n" // Will be replaced "search example.com example.org\n" "options edns0 trust-ad\n"}, // ndots:1 is default @@ -875,7 +875,8 @@ CONTAINED_TEST_P(ContainedMockChannelSysConfig, SysConfigNdotsDefault, return HasFailure(); } -NameContentList files_ndots0 = { + +static NameContentList files_ndots0 = { {"/etc/resolv.conf", "nameserver 1.2.3.4\n" // Will be replaced "search example.com example.org\n" "options edns0 trust-ad ndots:0\n"}, // ndots:1 is default @@ -1661,6 +1662,195 @@ TEST_P(MockChannelTest, GetHostByAddrDestroy) { EXPECT_EQ(0, result.timeouts_); } +TEST_P(MockChannelTest, TriggerResendThenConnFailSERVFAIL) { + // Set up the server response. The server always returns SERVFAIL. + DNSPacket badrsp; + badrsp.set_response().set_aa().set_rcode(SERVFAIL) + .add_question(new DNSQuestion("www.google.com", T_A)); + DNSPacket goodrsp; + goodrsp.set_response().set_aa() + .add_question(new DNSQuestion("www.google.com", T_A)) + .add_answer(new DNSARR("www.google.com", 0x0100, {0x01, 0x02, 0x03, 0x04})); + EXPECT_CALL(server_, OnRequest("www.google.com", T_A)) + .WillOnce(SetReplyAndFailSend(&server_, &badrsp)) + .WillOnce(SetReply(&server_, &goodrsp)); + + ares_socket_functions sock_funcs; + memset(&sock_funcs, 0, sizeof(sock_funcs)); + + sock_funcs.asendv = ares_sendv_fail; + + ares_set_socket_functions(channel_, &sock_funcs, NULL); + + HostResult result; + ares_gethostbyname(channel_, "www.google.com.", AF_INET, HostCallback, + &result); + Process(); + EXPECT_TRUE(result.done_); + std::stringstream ss; + ss << result.host_; + EXPECT_EQ("{'www.google.com' aliases=[] addrs=[1.2.3.4]}", ss.str()); +} + +TEST_P(MockUDPChannelTest, TriggerResendThenConnFailEDNS) { + // Set up the server response to simulate an EDNS failure + DNSPacket badrsp; + badrsp.set_response().set_aa().set_rcode(FORMERR) + .add_question(new DNSQuestion("www.google.com", T_A)); + DNSPacket goodrsp; + goodrsp.set_response().set_aa() + .add_question(new DNSQuestion("www.google.com", T_A)) + .add_answer(new DNSARR("www.google.com", 0x0100, {0x01, 0x02, 0x03, 0x04})); + EXPECT_CALL(server_, OnRequest("www.google.com", T_A)) + .WillOnce(SetReplyAndFailSend(&server_, &badrsp)) + .WillOnce(SetReply(&server_, &goodrsp)); + + ares_socket_functions sock_funcs; + memset(&sock_funcs, 0, sizeof(sock_funcs)); + + sock_funcs.asendv = ares_sendv_fail; + + ares_set_socket_functions(channel_, &sock_funcs, NULL); + + HostResult result; + ares_gethostbyname(channel_, "www.google.com.", AF_INET, HostCallback, + &result); + Process(); + EXPECT_TRUE(result.done_); + std::stringstream ss; + ss << result.host_; + EXPECT_EQ("{'www.google.com' aliases=[] addrs=[1.2.3.4]}", ss.str()); +} + +TEST_P(MockUDPChannelTest, GetSock) { + DNSPacket reply; + reply.set_response().set_aa() + .add_question(new DNSQuestion("www.google.com", T_A)) + .add_answer(new DNSARR("www.google.com", 0x0100, {0x01, 0x02, 0x03, 0x04})); + ON_CALL(server_, OnRequest("www.google.com", T_A)) + .WillByDefault(SetReply(&server_, &reply)); + + ares_socket_t socks[3] = {ARES_SOCKET_BAD, ARES_SOCKET_BAD, ARES_SOCKET_BAD}; + int bitmask; + + bitmask = ares_getsock(channel_, socks, 3); + EXPECT_EQ(0, bitmask); + bitmask = ares_getsock(channel_, nullptr, 0); + EXPECT_EQ(0, bitmask); + + // Ask again with a pending query. + HostResult result; + ares_gethostbyname(channel_, "www.google.com.", AF_INET, HostCallback, &result); + bitmask = ares_getsock(channel_, socks, 3); + EXPECT_NE(0, bitmask); + + size_t sock_cnt = 0; + for (size_t i=0; i<3; i++) { + if (ARES_GETSOCK_READABLE(bitmask, i) || ARES_GETSOCK_WRITABLE(bitmask, i)) { + EXPECT_NE(ARES_SOCKET_BAD, socks[i]); + if (socks[i] != ARES_SOCKET_BAD) + sock_cnt++; + } + } + EXPECT_NE((size_t)0, sock_cnt); + + Process(); + + bitmask = ares_getsock(channel_, nullptr, 0); + EXPECT_EQ(0, bitmask); +} + +TEST_P(MockTCPChannelTest, GetSock) { + DNSPacket reply; + reply.set_response().set_aa() + .add_question(new DNSQuestion("www.google.com", T_A)) + .add_answer(new DNSARR("www.google.com", 0x0100, {0x01, 0x02, 0x03, 0x04})); + ON_CALL(server_, OnRequest("www.google.com", T_A)) + .WillByDefault(SetReply(&server_, &reply)); + + ares_socket_t socks[3] = {ARES_SOCKET_BAD, ARES_SOCKET_BAD, ARES_SOCKET_BAD}; + int bitmask; + + bitmask = ares_getsock(channel_, socks, 3); + EXPECT_EQ(0, bitmask); + bitmask = ares_getsock(channel_, nullptr, 0); + EXPECT_EQ(0, bitmask); + + // Ask again with a pending query. + HostResult result; + ares_gethostbyname(channel_, "www.google.com.", AF_INET, HostCallback, &result); + bitmask = ares_getsock(channel_, socks, 3); + EXPECT_NE(0, bitmask); + + size_t sock_cnt = 0; + for (size_t i=0; i<3; i++) { + if (ARES_GETSOCK_READABLE(bitmask, i) || ARES_GETSOCK_WRITABLE(bitmask, i)) { + EXPECT_NE(ARES_SOCKET_BAD, socks[i]); + if (socks[i] != ARES_SOCKET_BAD) + sock_cnt++; + } + } + EXPECT_NE((size_t)0, sock_cnt); + + Process(); + + bitmask = ares_getsock(channel_, nullptr, 0); + EXPECT_EQ(0, bitmask); +} + + +TEST_P(MockChannelTest, VerifySocketFunctionCallback) { + ares_socket_functions sock_funcs; + memset(&sock_funcs, 0, sizeof(sock_funcs)); + + DNSPacket reply; + reply.set_response().set_aa() + .add_question(new DNSQuestion("www.google.com", T_A)) + .add_answer(new DNSARR("www.google.com", 0x0100, {0x01, 0x02, 0x03, 0x04})); + ON_CALL(server_, OnRequest("www.google.com", T_A)) + .WillByDefault(SetReply(&server_, &reply)); + + size_t count = 0; + + sock_funcs.asocket = [](int af, int type, int protocol, void * p) -> ares_socket_t { + EXPECT_NE(nullptr, p); + (*reinterpret_cast(p))++; + return ::socket(af, type, protocol); + }; + + ares_set_socket_functions(channel_, &sock_funcs, &count); + + { + count = 0; + HostResult result; + ares_gethostbyname(channel_, "www.google.com.", AF_INET, HostCallback, &result); + Process(); + + EXPECT_TRUE(result.done_); + EXPECT_EQ(ARES_SUCCESS, result.status_); + EXPECT_EQ(0, result.timeouts_); + EXPECT_NE((size_t)0, count); + } + + { + count = 0; + ares_channel_t *copy; + EXPECT_EQ(ARES_SUCCESS, ares_dup(©, channel_)); + + HostResult result; + ares_gethostbyname(copy, "www.google.com.", AF_INET, HostCallback, &result); + + ProcessAltChannel(copy); + + EXPECT_TRUE(result.done_); + ares_destroy(copy); + EXPECT_NE((size_t)0, count); + EXPECT_EQ(ARES_SUCCESS, result.status_); + EXPECT_EQ(0, result.timeouts_); + } + +} + static const unsigned char * fetch_server_cookie(const ares_dns_record_t *dnsrec, size_t *len) { diff --git a/lib/c-ares-1.34.4/test/ares-test-ns.cc b/lib/c-ares-1.34.6/test/ares-test-ns.cc similarity index 100% rename from lib/c-ares-1.34.4/test/ares-test-ns.cc rename to lib/c-ares-1.34.6/test/ares-test-ns.cc diff --git a/lib/c-ares-1.34.4/test/ares-test-parse-a.cc b/lib/c-ares-1.34.6/test/ares-test-parse-a.cc similarity index 100% rename from lib/c-ares-1.34.4/test/ares-test-parse-a.cc rename to lib/c-ares-1.34.6/test/ares-test-parse-a.cc diff --git a/lib/c-ares-1.34.4/test/ares-test-parse-aaaa.cc b/lib/c-ares-1.34.6/test/ares-test-parse-aaaa.cc similarity index 100% rename from lib/c-ares-1.34.4/test/ares-test-parse-aaaa.cc rename to lib/c-ares-1.34.6/test/ares-test-parse-aaaa.cc diff --git a/lib/c-ares-1.34.4/test/ares-test-parse-caa.cc b/lib/c-ares-1.34.6/test/ares-test-parse-caa.cc similarity index 100% rename from lib/c-ares-1.34.4/test/ares-test-parse-caa.cc rename to lib/c-ares-1.34.6/test/ares-test-parse-caa.cc diff --git a/lib/c-ares-1.34.4/test/ares-test-parse-mx.cc b/lib/c-ares-1.34.6/test/ares-test-parse-mx.cc similarity index 100% rename from lib/c-ares-1.34.4/test/ares-test-parse-mx.cc rename to lib/c-ares-1.34.6/test/ares-test-parse-mx.cc diff --git a/lib/c-ares-1.34.4/test/ares-test-parse-naptr.cc b/lib/c-ares-1.34.6/test/ares-test-parse-naptr.cc similarity index 100% rename from lib/c-ares-1.34.4/test/ares-test-parse-naptr.cc rename to lib/c-ares-1.34.6/test/ares-test-parse-naptr.cc diff --git a/lib/c-ares-1.34.4/test/ares-test-parse-ns.cc b/lib/c-ares-1.34.6/test/ares-test-parse-ns.cc similarity index 100% rename from lib/c-ares-1.34.4/test/ares-test-parse-ns.cc rename to lib/c-ares-1.34.6/test/ares-test-parse-ns.cc diff --git a/lib/c-ares-1.34.4/test/ares-test-parse-ptr.cc b/lib/c-ares-1.34.6/test/ares-test-parse-ptr.cc similarity index 100% rename from lib/c-ares-1.34.4/test/ares-test-parse-ptr.cc rename to lib/c-ares-1.34.6/test/ares-test-parse-ptr.cc diff --git a/lib/c-ares-1.34.4/test/ares-test-parse-soa-any.cc b/lib/c-ares-1.34.6/test/ares-test-parse-soa-any.cc similarity index 100% rename from lib/c-ares-1.34.4/test/ares-test-parse-soa-any.cc rename to lib/c-ares-1.34.6/test/ares-test-parse-soa-any.cc diff --git a/lib/c-ares-1.34.4/test/ares-test-parse-soa.cc b/lib/c-ares-1.34.6/test/ares-test-parse-soa.cc similarity index 100% rename from lib/c-ares-1.34.4/test/ares-test-parse-soa.cc rename to lib/c-ares-1.34.6/test/ares-test-parse-soa.cc diff --git a/lib/c-ares-1.34.4/test/ares-test-parse-srv.cc b/lib/c-ares-1.34.6/test/ares-test-parse-srv.cc similarity index 100% rename from lib/c-ares-1.34.4/test/ares-test-parse-srv.cc rename to lib/c-ares-1.34.6/test/ares-test-parse-srv.cc diff --git a/lib/c-ares-1.34.4/test/ares-test-parse-txt.cc b/lib/c-ares-1.34.6/test/ares-test-parse-txt.cc similarity index 100% rename from lib/c-ares-1.34.4/test/ares-test-parse-txt.cc rename to lib/c-ares-1.34.6/test/ares-test-parse-txt.cc diff --git a/lib/c-ares-1.34.4/test/ares-test-parse-uri.cc b/lib/c-ares-1.34.6/test/ares-test-parse-uri.cc similarity index 100% rename from lib/c-ares-1.34.4/test/ares-test-parse-uri.cc rename to lib/c-ares-1.34.6/test/ares-test-parse-uri.cc diff --git a/lib/c-ares-1.34.4/test/ares-test-parse.cc b/lib/c-ares-1.34.6/test/ares-test-parse.cc similarity index 100% rename from lib/c-ares-1.34.4/test/ares-test-parse.cc rename to lib/c-ares-1.34.6/test/ares-test-parse.cc diff --git a/lib/c-ares-1.34.4/test/ares-test.cc b/lib/c-ares-1.34.6/test/ares-test.cc similarity index 98% rename from lib/c-ares-1.34.4/test/ares-test.cc rename to lib/c-ares-1.34.6/test/ares-test.cc index 99ab0a00858..076adbc5ec0 100644 --- a/lib/c-ares-1.34.4/test/ares-test.cc +++ b/lib/c-ares-1.34.6/test/ares-test.cc @@ -250,6 +250,7 @@ std::vector> families_modes = both_families_both_modes; unsigned long long LibraryTest::fails_ = 0; std::map LibraryTest::size_fails_; std::mutex LibraryTest::lock_; +bool LibraryTest::failsend_ = false; void ares_sleep_time(unsigned int ms) { @@ -340,7 +341,29 @@ void ProcessWork(ares_channel_t *channel, } +void LibraryTest::SetFailSend() { + failsend_ = true; +} + // static +ares_ssize_t LibraryTest::ares_sendv_fail(ares_socket_t socket, const struct iovec *vec, int len, void *user_data) +{ + (void)user_data; + + if (failsend_) { +#ifdef USE_WINSOCK + WSASetLastError(WSAECONNREFUSED); +#else + errno = ECONNREFUSED; +#endif + failsend_ = false; + return -1; + } + + return send(socket, (const char *)vec[0].iov_base, vec[0].iov_len, 0); +} + + void LibraryTest::SetAllocFail(int nth) { lock_.lock(); assert(nth > 0); @@ -684,6 +707,7 @@ void MockServer::ProcessRequest(ares_socket_t fd, struct sockaddr_storage* addr, /* DNS 0x20 will mix case, do case-insensitive matching of name in request */ char lower_name[256]; int flags = 0; + arestest_strtolower(lower_name, name, sizeof(lower_name)); // Before processing, let gMock know the request is happening. @@ -745,10 +769,11 @@ void MockServer::ProcessRequest(ares_socket_t fd, struct sockaddr_storage* addr, #endif ares_ssize_t rc = (ares_ssize_t)sendto(fd, BYTE_CAST reply.data(), (SEND_TYPE_ARG3)reply.size(), flags, - (struct sockaddr *)addr, addrlen); + (struct sockaddr *)addr, addrlen); if (rc < static_cast(reply.size())) { std::cerr << "Failed to send full reply, rc=" << rc << std::endl; } + } // static @@ -888,14 +913,18 @@ void MockChannelOptsTest::ProcessFD(ares_socket_t fd) { } } -void MockChannelOptsTest::Process(unsigned int cancel_ms) { +void MockChannelOptsTest::ProcessAltChannel(ares_channel_t *chan, unsigned int cancel_ms) { using namespace std::placeholders; - ProcessWork(channel_, + ProcessWork(chan, std::bind(&MockChannelOptsTest::fds, this), std::bind(&MockChannelOptsTest::ProcessFD, this, _1), cancel_ms); } +void MockChannelOptsTest::Process(unsigned int cancel_ms) { + ProcessAltChannel(channel_, cancel_ms); +} + void MockEventThreadOptsTest::Process(unsigned int cancel_ms) { std::set fds; diff --git a/lib/c-ares-1.34.4/test/ares-test.h b/lib/c-ares-1.34.6/test/ares-test.h similarity index 97% rename from lib/c-ares-1.34.4/test/ares-test.h rename to lib/c-ares-1.34.6/test/ares-test.h index 612759212a1..1cab18fbfa5 100644 --- a/lib/c-ares-1.34.4/test/ares-test.h +++ b/lib/c-ares-1.34.6/test/ares-test.h @@ -61,6 +61,16 @@ # define sclose(x) close(x) #endif +#ifndef HAVE_WRITEV +extern "C" { +/* Structure for scatter/gather I/O. */ +struct iovec { + void *iov_base; /* Pointer to data. */ + size_t iov_len; /* Length of data. */ +}; +}; +#endif + namespace ares { typedef unsigned char byte; @@ -140,11 +150,17 @@ class LibraryTest : public ::testing::Test { static void *arealloc(void *ptr, size_t size); static void afree(void *ptr); + static void SetFailSend(void); + static ares_ssize_t ares_sendv_fail(ares_socket_t socket, const struct iovec *vec, int len, + void *user_data); + + private: static bool ShouldAllocFail(size_t size); static unsigned long long fails_; static std::map size_fails_; static std::mutex lock_; + static bool failsend_; }; // Test fixture that uses a default channel. @@ -328,6 +344,7 @@ class MockChannelOptsTest : public LibraryTest { // Process all pending work on ares-owned and mock-server-owned file // descriptors. + void ProcessAltChannel(ares_channel_t *chan, unsigned int cancel_ms = 0); void Process(unsigned int cancel_ms = 0); protected: @@ -450,6 +467,12 @@ ACTION_P2(SetReplyData, mockserver, data) mockserver->SetReplyData(data); } +ACTION_P2(SetReplyAndFailSend, mockserver, reply) +{ + mockserver->SetReply(reply); + LibraryTest::SetFailSend(); +} + ACTION_P2(SetReply, mockserver, reply) { mockserver->SetReply(reply); diff --git a/lib/c-ares-1.34.4/test/ares_queryloop.c b/lib/c-ares-1.34.6/test/ares_queryloop.c similarity index 100% rename from lib/c-ares-1.34.4/test/ares_queryloop.c rename to lib/c-ares-1.34.6/test/ares_queryloop.c diff --git a/lib/c-ares-1.34.4/test/dns-dump.cc b/lib/c-ares-1.34.6/test/dns-dump.cc similarity index 100% rename from lib/c-ares-1.34.4/test/dns-dump.cc rename to lib/c-ares-1.34.6/test/dns-dump.cc diff --git a/lib/c-ares-1.34.4/test/dns-proto-test.cc b/lib/c-ares-1.34.6/test/dns-proto-test.cc similarity index 100% rename from lib/c-ares-1.34.4/test/dns-proto-test.cc rename to lib/c-ares-1.34.6/test/dns-proto-test.cc diff --git a/lib/c-ares-1.34.4/test/dns-proto.cc b/lib/c-ares-1.34.6/test/dns-proto.cc similarity index 100% rename from lib/c-ares-1.34.4/test/dns-proto.cc rename to lib/c-ares-1.34.6/test/dns-proto.cc diff --git a/lib/c-ares-1.34.4/test/dns-proto.h b/lib/c-ares-1.34.6/test/dns-proto.h similarity index 100% rename from lib/c-ares-1.34.4/test/dns-proto.h rename to lib/c-ares-1.34.6/test/dns-proto.h diff --git a/lib/c-ares-1.34.4/test/fuzzcheck.sh b/lib/c-ares-1.34.6/test/fuzzcheck.sh similarity index 100% rename from lib/c-ares-1.34.4/test/fuzzcheck.sh rename to lib/c-ares-1.34.6/test/fuzzcheck.sh diff --git a/lib/c-ares-1.34.4/test/fuzzinput/004a216d3cff18b0c5c6b68b807f1529 b/lib/c-ares-1.34.6/test/fuzzinput/004a216d3cff18b0c5c6b68b807f1529 similarity index 100% rename from lib/c-ares-1.34.4/test/fuzzinput/004a216d3cff18b0c5c6b68b807f1529 rename to lib/c-ares-1.34.6/test/fuzzinput/004a216d3cff18b0c5c6b68b807f1529 diff --git a/lib/c-ares-1.34.4/test/fuzzinput/00539467ca159b36aea95e61f9729115 b/lib/c-ares-1.34.6/test/fuzzinput/00539467ca159b36aea95e61f9729115 similarity index 100% rename from lib/c-ares-1.34.4/test/fuzzinput/00539467ca159b36aea95e61f9729115 rename to lib/c-ares-1.34.6/test/fuzzinput/00539467ca159b36aea95e61f9729115 diff --git a/lib/c-ares-1.34.4/test/fuzzinput/00e846db8f43f2f507cd1666ed5a753e b/lib/c-ares-1.34.6/test/fuzzinput/00e846db8f43f2f507cd1666ed5a753e similarity index 100% rename from lib/c-ares-1.34.4/test/fuzzinput/00e846db8f43f2f507cd1666ed5a753e rename to lib/c-ares-1.34.6/test/fuzzinput/00e846db8f43f2f507cd1666ed5a753e diff --git a/lib/c-ares-1.34.4/test/fuzzinput/0177b7566f08c013699eaea9a77abeb3 b/lib/c-ares-1.34.6/test/fuzzinput/0177b7566f08c013699eaea9a77abeb3 similarity index 100% rename from lib/c-ares-1.34.4/test/fuzzinput/0177b7566f08c013699eaea9a77abeb3 rename to lib/c-ares-1.34.6/test/fuzzinput/0177b7566f08c013699eaea9a77abeb3 diff --git a/lib/c-ares-1.34.4/test/fuzzinput/020a4fa317715bfdb236ed13751e6b65 b/lib/c-ares-1.34.6/test/fuzzinput/020a4fa317715bfdb236ed13751e6b65 similarity index 100% rename from lib/c-ares-1.34.4/test/fuzzinput/020a4fa317715bfdb236ed13751e6b65 rename to lib/c-ares-1.34.6/test/fuzzinput/020a4fa317715bfdb236ed13751e6b65 diff --git a/lib/c-ares-1.34.4/test/fuzzinput/0310f2e81bea31f4fe3f330872a877dd b/lib/c-ares-1.34.6/test/fuzzinput/0310f2e81bea31f4fe3f330872a877dd similarity index 100% rename from lib/c-ares-1.34.4/test/fuzzinput/0310f2e81bea31f4fe3f330872a877dd rename to lib/c-ares-1.34.6/test/fuzzinput/0310f2e81bea31f4fe3f330872a877dd diff --git a/lib/c-ares-1.34.4/test/fuzzinput/0449be67df1730b2d0887d412a9b7cc4 b/lib/c-ares-1.34.6/test/fuzzinput/0449be67df1730b2d0887d412a9b7cc4 similarity index 100% rename from lib/c-ares-1.34.4/test/fuzzinput/0449be67df1730b2d0887d412a9b7cc4 rename to lib/c-ares-1.34.6/test/fuzzinput/0449be67df1730b2d0887d412a9b7cc4 diff --git a/lib/c-ares-1.34.4/test/fuzzinput/0449dd14f7aa94bf0d716bfe09b287a8 b/lib/c-ares-1.34.6/test/fuzzinput/0449dd14f7aa94bf0d716bfe09b287a8 similarity index 100% rename from lib/c-ares-1.34.4/test/fuzzinput/0449dd14f7aa94bf0d716bfe09b287a8 rename to lib/c-ares-1.34.6/test/fuzzinput/0449dd14f7aa94bf0d716bfe09b287a8 diff --git a/lib/c-ares-1.34.4/test/fuzzinput/04c93cdf7208979aa4df80a3a0d5a2d8 b/lib/c-ares-1.34.6/test/fuzzinput/04c93cdf7208979aa4df80a3a0d5a2d8 similarity index 100% rename from lib/c-ares-1.34.4/test/fuzzinput/04c93cdf7208979aa4df80a3a0d5a2d8 rename to lib/c-ares-1.34.6/test/fuzzinput/04c93cdf7208979aa4df80a3a0d5a2d8 diff --git a/lib/c-ares-1.34.4/test/fuzzinput/0567e7171e08e75f3f91c4ca74c17adc b/lib/c-ares-1.34.6/test/fuzzinput/0567e7171e08e75f3f91c4ca74c17adc similarity index 100% rename from lib/c-ares-1.34.4/test/fuzzinput/0567e7171e08e75f3f91c4ca74c17adc rename to lib/c-ares-1.34.6/test/fuzzinput/0567e7171e08e75f3f91c4ca74c17adc diff --git a/lib/c-ares-1.34.4/test/fuzzinput/05ba948578a397e9cbc6a7b3e78622fa b/lib/c-ares-1.34.6/test/fuzzinput/05ba948578a397e9cbc6a7b3e78622fa similarity index 100% rename from lib/c-ares-1.34.4/test/fuzzinput/05ba948578a397e9cbc6a7b3e78622fa rename to lib/c-ares-1.34.6/test/fuzzinput/05ba948578a397e9cbc6a7b3e78622fa diff --git a/lib/c-ares-1.34.4/test/fuzzinput/060afe5ed25f3e2e86167e545f27edca b/lib/c-ares-1.34.6/test/fuzzinput/060afe5ed25f3e2e86167e545f27edca similarity index 100% rename from lib/c-ares-1.34.4/test/fuzzinput/060afe5ed25f3e2e86167e545f27edca rename to lib/c-ares-1.34.6/test/fuzzinput/060afe5ed25f3e2e86167e545f27edca diff --git a/lib/c-ares-1.34.4/test/fuzzinput/06d47d3681493f1b1d41236f460d896f b/lib/c-ares-1.34.6/test/fuzzinput/06d47d3681493f1b1d41236f460d896f similarity index 100% rename from lib/c-ares-1.34.4/test/fuzzinput/06d47d3681493f1b1d41236f460d896f rename to lib/c-ares-1.34.6/test/fuzzinput/06d47d3681493f1b1d41236f460d896f diff --git a/lib/c-ares-1.34.4/test/fuzzinput/0724a810b0e131c2fddb6de9003b9064 b/lib/c-ares-1.34.6/test/fuzzinput/0724a810b0e131c2fddb6de9003b9064 similarity index 100% rename from lib/c-ares-1.34.4/test/fuzzinput/0724a810b0e131c2fddb6de9003b9064 rename to lib/c-ares-1.34.6/test/fuzzinput/0724a810b0e131c2fddb6de9003b9064 diff --git a/lib/c-ares-1.34.4/test/fuzzinput/0b5279148826f5b962bcf1896bdb4ede b/lib/c-ares-1.34.6/test/fuzzinput/0b5279148826f5b962bcf1896bdb4ede similarity index 100% rename from lib/c-ares-1.34.4/test/fuzzinput/0b5279148826f5b962bcf1896bdb4ede rename to lib/c-ares-1.34.6/test/fuzzinput/0b5279148826f5b962bcf1896bdb4ede diff --git a/lib/c-ares-1.34.4/test/fuzzinput/114048c0f6b10bdc67ce9166405d195e b/lib/c-ares-1.34.6/test/fuzzinput/114048c0f6b10bdc67ce9166405d195e similarity index 100% rename from lib/c-ares-1.34.4/test/fuzzinput/114048c0f6b10bdc67ce9166405d195e rename to lib/c-ares-1.34.6/test/fuzzinput/114048c0f6b10bdc67ce9166405d195e diff --git a/lib/c-ares-1.34.4/test/fuzzinput/11b8464a0ef8735d202955c34c36b0c7 b/lib/c-ares-1.34.6/test/fuzzinput/11b8464a0ef8735d202955c34c36b0c7 similarity index 100% rename from lib/c-ares-1.34.4/test/fuzzinput/11b8464a0ef8735d202955c34c36b0c7 rename to lib/c-ares-1.34.6/test/fuzzinput/11b8464a0ef8735d202955c34c36b0c7 diff --git a/lib/c-ares-1.34.4/test/fuzzinput/11cb626f1668c7b41954ce7d768fe528 b/lib/c-ares-1.34.6/test/fuzzinput/11cb626f1668c7b41954ce7d768fe528 similarity index 100% rename from lib/c-ares-1.34.4/test/fuzzinput/11cb626f1668c7b41954ce7d768fe528 rename to lib/c-ares-1.34.6/test/fuzzinput/11cb626f1668c7b41954ce7d768fe528 diff --git a/lib/c-ares-1.34.4/test/fuzzinput/14b133bf18125b75a1976fa63a1df6b7 b/lib/c-ares-1.34.6/test/fuzzinput/14b133bf18125b75a1976fa63a1df6b7 similarity index 100% rename from lib/c-ares-1.34.4/test/fuzzinput/14b133bf18125b75a1976fa63a1df6b7 rename to lib/c-ares-1.34.6/test/fuzzinput/14b133bf18125b75a1976fa63a1df6b7 diff --git a/lib/c-ares-1.34.4/test/fuzzinput/153c6b3afa8faa03c8bc28f936a6d4cf b/lib/c-ares-1.34.6/test/fuzzinput/153c6b3afa8faa03c8bc28f936a6d4cf similarity index 100% rename from lib/c-ares-1.34.4/test/fuzzinput/153c6b3afa8faa03c8bc28f936a6d4cf rename to lib/c-ares-1.34.6/test/fuzzinput/153c6b3afa8faa03c8bc28f936a6d4cf diff --git a/lib/c-ares-1.34.4/test/fuzzinput/182cad2a342ed7317b7c21a5d17020d1 b/lib/c-ares-1.34.6/test/fuzzinput/182cad2a342ed7317b7c21a5d17020d1 similarity index 100% rename from lib/c-ares-1.34.4/test/fuzzinput/182cad2a342ed7317b7c21a5d17020d1 rename to lib/c-ares-1.34.6/test/fuzzinput/182cad2a342ed7317b7c21a5d17020d1 diff --git a/lib/c-ares-1.34.4/test/fuzzinput/1c61a61bb7057b52c5b15188345a5238 b/lib/c-ares-1.34.6/test/fuzzinput/1c61a61bb7057b52c5b15188345a5238 similarity index 100% rename from lib/c-ares-1.34.4/test/fuzzinput/1c61a61bb7057b52c5b15188345a5238 rename to lib/c-ares-1.34.6/test/fuzzinput/1c61a61bb7057b52c5b15188345a5238 diff --git a/lib/c-ares-1.34.4/test/fuzzinput/1dbe2cf62ed2e4fa1c3cb473f08710b5 b/lib/c-ares-1.34.6/test/fuzzinput/1dbe2cf62ed2e4fa1c3cb473f08710b5 similarity index 100% rename from lib/c-ares-1.34.4/test/fuzzinput/1dbe2cf62ed2e4fa1c3cb473f08710b5 rename to lib/c-ares-1.34.6/test/fuzzinput/1dbe2cf62ed2e4fa1c3cb473f08710b5 diff --git a/lib/c-ares-1.34.4/test/fuzzinput/21199be504fcfece5c7096ee0dbba507 b/lib/c-ares-1.34.6/test/fuzzinput/21199be504fcfece5c7096ee0dbba507 similarity index 100% rename from lib/c-ares-1.34.4/test/fuzzinput/21199be504fcfece5c7096ee0dbba507 rename to lib/c-ares-1.34.6/test/fuzzinput/21199be504fcfece5c7096ee0dbba507 diff --git a/lib/c-ares-1.34.4/test/fuzzinput/21891480074b5635dbbe7137bdcabccd b/lib/c-ares-1.34.6/test/fuzzinput/21891480074b5635dbbe7137bdcabccd similarity index 100% rename from lib/c-ares-1.34.4/test/fuzzinput/21891480074b5635dbbe7137bdcabccd rename to lib/c-ares-1.34.6/test/fuzzinput/21891480074b5635dbbe7137bdcabccd diff --git a/lib/c-ares-1.34.4/test/fuzzinput/233aea42e15aa73e131eefabf16088c9 b/lib/c-ares-1.34.6/test/fuzzinput/233aea42e15aa73e131eefabf16088c9 similarity index 100% rename from lib/c-ares-1.34.4/test/fuzzinput/233aea42e15aa73e131eefabf16088c9 rename to lib/c-ares-1.34.6/test/fuzzinput/233aea42e15aa73e131eefabf16088c9 diff --git a/lib/c-ares-1.34.4/test/fuzzinput/24660d4e7ac7aa21d600ea7a3d198bbb b/lib/c-ares-1.34.6/test/fuzzinput/24660d4e7ac7aa21d600ea7a3d198bbb similarity index 100% rename from lib/c-ares-1.34.4/test/fuzzinput/24660d4e7ac7aa21d600ea7a3d198bbb rename to lib/c-ares-1.34.6/test/fuzzinput/24660d4e7ac7aa21d600ea7a3d198bbb diff --git a/lib/c-ares-1.34.4/test/fuzzinput/25589deb55c08429345f289d1c9b0254 b/lib/c-ares-1.34.6/test/fuzzinput/25589deb55c08429345f289d1c9b0254 similarity index 100% rename from lib/c-ares-1.34.4/test/fuzzinput/25589deb55c08429345f289d1c9b0254 rename to lib/c-ares-1.34.6/test/fuzzinput/25589deb55c08429345f289d1c9b0254 diff --git a/lib/c-ares-1.34.4/test/fuzzinput/2573bd823e4da11f727a17f8e1f35c26 b/lib/c-ares-1.34.6/test/fuzzinput/2573bd823e4da11f727a17f8e1f35c26 similarity index 100% rename from lib/c-ares-1.34.4/test/fuzzinput/2573bd823e4da11f727a17f8e1f35c26 rename to lib/c-ares-1.34.6/test/fuzzinput/2573bd823e4da11f727a17f8e1f35c26 diff --git a/lib/c-ares-1.34.4/test/fuzzinput/276f12da56866273e76059ad0e7be97e b/lib/c-ares-1.34.6/test/fuzzinput/276f12da56866273e76059ad0e7be97e similarity index 100% rename from lib/c-ares-1.34.4/test/fuzzinput/276f12da56866273e76059ad0e7be97e rename to lib/c-ares-1.34.6/test/fuzzinput/276f12da56866273e76059ad0e7be97e diff --git a/lib/c-ares-1.34.4/test/fuzzinput/29198a2e380cb19babec9e02116d213e b/lib/c-ares-1.34.6/test/fuzzinput/29198a2e380cb19babec9e02116d213e similarity index 100% rename from lib/c-ares-1.34.4/test/fuzzinput/29198a2e380cb19babec9e02116d213e rename to lib/c-ares-1.34.6/test/fuzzinput/29198a2e380cb19babec9e02116d213e diff --git a/lib/c-ares-1.34.4/test/fuzzinput/2c94ba9434b1a1b9396fc5364f101363 b/lib/c-ares-1.34.6/test/fuzzinput/2c94ba9434b1a1b9396fc5364f101363 similarity index 100% rename from lib/c-ares-1.34.4/test/fuzzinput/2c94ba9434b1a1b9396fc5364f101363 rename to lib/c-ares-1.34.6/test/fuzzinput/2c94ba9434b1a1b9396fc5364f101363 diff --git a/lib/c-ares-1.34.4/test/fuzzinput/2d578c357dc2f5e02dc55cddb30641d1 b/lib/c-ares-1.34.6/test/fuzzinput/2d578c357dc2f5e02dc55cddb30641d1 similarity index 100% rename from lib/c-ares-1.34.4/test/fuzzinput/2d578c357dc2f5e02dc55cddb30641d1 rename to lib/c-ares-1.34.6/test/fuzzinput/2d578c357dc2f5e02dc55cddb30641d1 diff --git a/lib/c-ares-1.34.4/test/fuzzinput/2dff6cc5a223e67fde9e5e79af456992 b/lib/c-ares-1.34.6/test/fuzzinput/2dff6cc5a223e67fde9e5e79af456992 similarity index 100% rename from lib/c-ares-1.34.4/test/fuzzinput/2dff6cc5a223e67fde9e5e79af456992 rename to lib/c-ares-1.34.6/test/fuzzinput/2dff6cc5a223e67fde9e5e79af456992 diff --git a/lib/c-ares-1.34.4/test/fuzzinput/2f103b1f9477f2d8934bd84328d51c75 b/lib/c-ares-1.34.6/test/fuzzinput/2f103b1f9477f2d8934bd84328d51c75 similarity index 100% rename from lib/c-ares-1.34.4/test/fuzzinput/2f103b1f9477f2d8934bd84328d51c75 rename to lib/c-ares-1.34.6/test/fuzzinput/2f103b1f9477f2d8934bd84328d51c75 diff --git a/lib/c-ares-1.34.4/test/fuzzinput/31cd3a8413de13d9624adbb1613784bf b/lib/c-ares-1.34.6/test/fuzzinput/31cd3a8413de13d9624adbb1613784bf similarity index 100% rename from lib/c-ares-1.34.4/test/fuzzinput/31cd3a8413de13d9624adbb1613784bf rename to lib/c-ares-1.34.6/test/fuzzinput/31cd3a8413de13d9624adbb1613784bf diff --git a/lib/c-ares-1.34.4/test/fuzzinput/36415bdf1d180098fe6234b4186e69f3 b/lib/c-ares-1.34.6/test/fuzzinput/36415bdf1d180098fe6234b4186e69f3 similarity index 100% rename from lib/c-ares-1.34.4/test/fuzzinput/36415bdf1d180098fe6234b4186e69f3 rename to lib/c-ares-1.34.6/test/fuzzinput/36415bdf1d180098fe6234b4186e69f3 diff --git a/lib/c-ares-1.34.4/test/fuzzinput/3a04a80f0242e8dff0cd732e7c4767da b/lib/c-ares-1.34.6/test/fuzzinput/3a04a80f0242e8dff0cd732e7c4767da similarity index 100% rename from lib/c-ares-1.34.4/test/fuzzinput/3a04a80f0242e8dff0cd732e7c4767da rename to lib/c-ares-1.34.6/test/fuzzinput/3a04a80f0242e8dff0cd732e7c4767da diff --git a/lib/c-ares-1.34.4/test/fuzzinput/44d0f973b7b0fb3e4a07770c943dcd5a b/lib/c-ares-1.34.6/test/fuzzinput/44d0f973b7b0fb3e4a07770c943dcd5a similarity index 100% rename from lib/c-ares-1.34.4/test/fuzzinput/44d0f973b7b0fb3e4a07770c943dcd5a rename to lib/c-ares-1.34.6/test/fuzzinput/44d0f973b7b0fb3e4a07770c943dcd5a diff --git a/lib/c-ares-1.34.4/test/fuzzinput/50bc00daa0ddcd6cfb2b5d9f62c81f47 b/lib/c-ares-1.34.6/test/fuzzinput/50bc00daa0ddcd6cfb2b5d9f62c81f47 similarity index 100% rename from lib/c-ares-1.34.4/test/fuzzinput/50bc00daa0ddcd6cfb2b5d9f62c81f47 rename to lib/c-ares-1.34.6/test/fuzzinput/50bc00daa0ddcd6cfb2b5d9f62c81f47 diff --git a/lib/c-ares-1.34.4/test/fuzzinput/51ed2d1fb77b3078b54e94e85606b7df b/lib/c-ares-1.34.6/test/fuzzinput/51ed2d1fb77b3078b54e94e85606b7df similarity index 100% rename from lib/c-ares-1.34.4/test/fuzzinput/51ed2d1fb77b3078b54e94e85606b7df rename to lib/c-ares-1.34.6/test/fuzzinput/51ed2d1fb77b3078b54e94e85606b7df diff --git a/lib/c-ares-1.34.4/test/fuzzinput/5c5e0e899cf2e7d053a9e45fb76f6e5a b/lib/c-ares-1.34.6/test/fuzzinput/5c5e0e899cf2e7d053a9e45fb76f6e5a similarity index 100% rename from lib/c-ares-1.34.4/test/fuzzinput/5c5e0e899cf2e7d053a9e45fb76f6e5a rename to lib/c-ares-1.34.6/test/fuzzinput/5c5e0e899cf2e7d053a9e45fb76f6e5a diff --git a/lib/c-ares-1.34.4/test/fuzzinput/70152ed033f139443fbfb1b858bb3b1b b/lib/c-ares-1.34.6/test/fuzzinput/70152ed033f139443fbfb1b858bb3b1b similarity index 100% rename from lib/c-ares-1.34.4/test/fuzzinput/70152ed033f139443fbfb1b858bb3b1b rename to lib/c-ares-1.34.6/test/fuzzinput/70152ed033f139443fbfb1b858bb3b1b diff --git a/lib/c-ares-1.34.4/test/fuzzinput/7030ca2b24e5a7f9dd8f62096a48eb33 b/lib/c-ares-1.34.6/test/fuzzinput/7030ca2b24e5a7f9dd8f62096a48eb33 similarity index 100% rename from lib/c-ares-1.34.4/test/fuzzinput/7030ca2b24e5a7f9dd8f62096a48eb33 rename to lib/c-ares-1.34.6/test/fuzzinput/7030ca2b24e5a7f9dd8f62096a48eb33 diff --git a/lib/c-ares-1.34.4/test/fuzzinput/71eec1a0ef2d25bb9e2ef17f23be7e9e b/lib/c-ares-1.34.6/test/fuzzinput/71eec1a0ef2d25bb9e2ef17f23be7e9e similarity index 100% rename from lib/c-ares-1.34.4/test/fuzzinput/71eec1a0ef2d25bb9e2ef17f23be7e9e rename to lib/c-ares-1.34.6/test/fuzzinput/71eec1a0ef2d25bb9e2ef17f23be7e9e diff --git a/lib/c-ares-1.34.4/test/fuzzinput/7a6b0177210ea4ef40b254daf99393c5 b/lib/c-ares-1.34.6/test/fuzzinput/7a6b0177210ea4ef40b254daf99393c5 similarity index 100% rename from lib/c-ares-1.34.4/test/fuzzinput/7a6b0177210ea4ef40b254daf99393c5 rename to lib/c-ares-1.34.6/test/fuzzinput/7a6b0177210ea4ef40b254daf99393c5 diff --git a/lib/c-ares-1.34.4/test/fuzzinput/7f1567733711ffb61839621af0cbfa33 b/lib/c-ares-1.34.6/test/fuzzinput/7f1567733711ffb61839621af0cbfa33 similarity index 100% rename from lib/c-ares-1.34.4/test/fuzzinput/7f1567733711ffb61839621af0cbfa33 rename to lib/c-ares-1.34.6/test/fuzzinput/7f1567733711ffb61839621af0cbfa33 diff --git a/lib/c-ares-1.34.4/test/fuzzinput/850c6d57c5bb7be8205fc2438d14d7e5 b/lib/c-ares-1.34.6/test/fuzzinput/850c6d57c5bb7be8205fc2438d14d7e5 similarity index 100% rename from lib/c-ares-1.34.4/test/fuzzinput/850c6d57c5bb7be8205fc2438d14d7e5 rename to lib/c-ares-1.34.6/test/fuzzinput/850c6d57c5bb7be8205fc2438d14d7e5 diff --git a/lib/c-ares-1.34.4/test/fuzzinput/a5c8cd2784a5792b9e91c2d7895b3b34 b/lib/c-ares-1.34.6/test/fuzzinput/a5c8cd2784a5792b9e91c2d7895b3b34 similarity index 100% rename from lib/c-ares-1.34.4/test/fuzzinput/a5c8cd2784a5792b9e91c2d7895b3b34 rename to lib/c-ares-1.34.6/test/fuzzinput/a5c8cd2784a5792b9e91c2d7895b3b34 diff --git a/lib/c-ares-1.34.4/test/fuzzinput/a9135cdc7151d023300ff194bad90af9 b/lib/c-ares-1.34.6/test/fuzzinput/a9135cdc7151d023300ff194bad90af9 similarity index 100% rename from lib/c-ares-1.34.4/test/fuzzinput/a9135cdc7151d023300ff194bad90af9 rename to lib/c-ares-1.34.6/test/fuzzinput/a9135cdc7151d023300ff194bad90af9 diff --git a/lib/c-ares-1.34.4/test/fuzzinput/af2597e8ac7dec1e8b4a47518312912a b/lib/c-ares-1.34.6/test/fuzzinput/af2597e8ac7dec1e8b4a47518312912a similarity index 100% rename from lib/c-ares-1.34.4/test/fuzzinput/af2597e8ac7dec1e8b4a47518312912a rename to lib/c-ares-1.34.6/test/fuzzinput/af2597e8ac7dec1e8b4a47518312912a diff --git a/lib/c-ares-1.34.4/test/fuzzinput/answer_a b/lib/c-ares-1.34.6/test/fuzzinput/answer_a similarity index 100% rename from lib/c-ares-1.34.4/test/fuzzinput/answer_a rename to lib/c-ares-1.34.6/test/fuzzinput/answer_a diff --git a/lib/c-ares-1.34.4/test/fuzzinput/answer_aaaa b/lib/c-ares-1.34.6/test/fuzzinput/answer_aaaa similarity index 100% rename from lib/c-ares-1.34.4/test/fuzzinput/answer_aaaa rename to lib/c-ares-1.34.6/test/fuzzinput/answer_aaaa diff --git a/lib/c-ares-1.34.4/test/fuzzinput/b3f53ef826b831bb09dd25c7f5960249 b/lib/c-ares-1.34.6/test/fuzzinput/b3f53ef826b831bb09dd25c7f5960249 similarity index 100% rename from lib/c-ares-1.34.4/test/fuzzinput/b3f53ef826b831bb09dd25c7f5960249 rename to lib/c-ares-1.34.6/test/fuzzinput/b3f53ef826b831bb09dd25c7f5960249 diff --git a/lib/c-ares-1.34.4/test/fuzzinput/cda0f8751f5c4993974c2b549d29bcc8 b/lib/c-ares-1.34.6/test/fuzzinput/cda0f8751f5c4993974c2b549d29bcc8 similarity index 100% rename from lib/c-ares-1.34.4/test/fuzzinput/cda0f8751f5c4993974c2b549d29bcc8 rename to lib/c-ares-1.34.6/test/fuzzinput/cda0f8751f5c4993974c2b549d29bcc8 diff --git a/lib/c-ares-1.34.4/test/fuzzinput/ce6c26c0e469339873d0e7f616ab0945 b/lib/c-ares-1.34.6/test/fuzzinput/ce6c26c0e469339873d0e7f616ab0945 similarity index 100% rename from lib/c-ares-1.34.4/test/fuzzinput/ce6c26c0e469339873d0e7f616ab0945 rename to lib/c-ares-1.34.6/test/fuzzinput/ce6c26c0e469339873d0e7f616ab0945 diff --git a/lib/c-ares-1.34.4/test/fuzzinput/clusterfuzz-5637790584012800 b/lib/c-ares-1.34.6/test/fuzzinput/clusterfuzz-5637790584012800 similarity index 100% rename from lib/c-ares-1.34.4/test/fuzzinput/clusterfuzz-5637790584012800 rename to lib/c-ares-1.34.6/test/fuzzinput/clusterfuzz-5637790584012800 diff --git a/lib/c-ares-1.34.4/test/fuzzinput/clusterfuzz-5650695891451904 b/lib/c-ares-1.34.6/test/fuzzinput/clusterfuzz-5650695891451904 similarity index 100% rename from lib/c-ares-1.34.4/test/fuzzinput/clusterfuzz-5650695891451904 rename to lib/c-ares-1.34.6/test/fuzzinput/clusterfuzz-5650695891451904 diff --git a/lib/c-ares-1.34.4/test/fuzzinput/clusterfuzz-5651369832218624 b/lib/c-ares-1.34.6/test/fuzzinput/clusterfuzz-5651369832218624 similarity index 100% rename from lib/c-ares-1.34.4/test/fuzzinput/clusterfuzz-5651369832218624 rename to lib/c-ares-1.34.6/test/fuzzinput/clusterfuzz-5651369832218624 diff --git a/lib/c-ares-1.34.4/test/fuzzinput/clusterfuzz-5674462260756480 b/lib/c-ares-1.34.6/test/fuzzinput/clusterfuzz-5674462260756480 similarity index 100% rename from lib/c-ares-1.34.4/test/fuzzinput/clusterfuzz-5674462260756480 rename to lib/c-ares-1.34.6/test/fuzzinput/clusterfuzz-5674462260756480 diff --git a/lib/c-ares-1.34.4/test/fuzzinput/clusterfuzz-5680630672654336 b/lib/c-ares-1.34.6/test/fuzzinput/clusterfuzz-5680630672654336 similarity index 100% rename from lib/c-ares-1.34.4/test/fuzzinput/clusterfuzz-5680630672654336 rename to lib/c-ares-1.34.6/test/fuzzinput/clusterfuzz-5680630672654336 diff --git a/lib/c-ares-1.34.4/test/fuzzinput/clusterfuzz-5683497160671232 b/lib/c-ares-1.34.6/test/fuzzinput/clusterfuzz-5683497160671232 similarity index 100% rename from lib/c-ares-1.34.4/test/fuzzinput/clusterfuzz-5683497160671232 rename to lib/c-ares-1.34.6/test/fuzzinput/clusterfuzz-5683497160671232 diff --git a/lib/c-ares-1.34.4/test/fuzzinput/clusterfuzz-5687310655422464 b/lib/c-ares-1.34.6/test/fuzzinput/clusterfuzz-5687310655422464 similarity index 100% rename from lib/c-ares-1.34.4/test/fuzzinput/clusterfuzz-5687310655422464 rename to lib/c-ares-1.34.6/test/fuzzinput/clusterfuzz-5687310655422464 diff --git a/lib/c-ares-1.34.4/test/fuzzinput/clusterfuzz-5695341573177344 b/lib/c-ares-1.34.6/test/fuzzinput/clusterfuzz-5695341573177344 similarity index 100% rename from lib/c-ares-1.34.4/test/fuzzinput/clusterfuzz-5695341573177344 rename to lib/c-ares-1.34.6/test/fuzzinput/clusterfuzz-5695341573177344 diff --git a/lib/c-ares-1.34.4/test/fuzzinput/clusterfuzz-5697835103682560 b/lib/c-ares-1.34.6/test/fuzzinput/clusterfuzz-5697835103682560 similarity index 100% rename from lib/c-ares-1.34.4/test/fuzzinput/clusterfuzz-5697835103682560 rename to lib/c-ares-1.34.6/test/fuzzinput/clusterfuzz-5697835103682560 diff --git a/lib/c-ares-1.34.4/test/fuzzinput/clusterfuzz-5728518081609728 b/lib/c-ares-1.34.6/test/fuzzinput/clusterfuzz-5728518081609728 similarity index 100% rename from lib/c-ares-1.34.4/test/fuzzinput/clusterfuzz-5728518081609728 rename to lib/c-ares-1.34.6/test/fuzzinput/clusterfuzz-5728518081609728 diff --git a/lib/c-ares-1.34.4/test/fuzzinput/clusterfuzz-5732960017317888 b/lib/c-ares-1.34.6/test/fuzzinput/clusterfuzz-5732960017317888 similarity index 100% rename from lib/c-ares-1.34.4/test/fuzzinput/clusterfuzz-5732960017317888 rename to lib/c-ares-1.34.6/test/fuzzinput/clusterfuzz-5732960017317888 diff --git a/lib/c-ares-1.34.4/test/fuzzinput/e4dd7e7c2dd4ed7c2e17a6af5d04f9c9 b/lib/c-ares-1.34.6/test/fuzzinput/e4dd7e7c2dd4ed7c2e17a6af5d04f9c9 similarity index 100% rename from lib/c-ares-1.34.4/test/fuzzinput/e4dd7e7c2dd4ed7c2e17a6af5d04f9c9 rename to lib/c-ares-1.34.6/test/fuzzinput/e4dd7e7c2dd4ed7c2e17a6af5d04f9c9 diff --git a/lib/c-ares-1.34.4/test/fuzzinput/ed50ed8ee36230a5a69746ad830437e5 b/lib/c-ares-1.34.6/test/fuzzinput/ed50ed8ee36230a5a69746ad830437e5 similarity index 100% rename from lib/c-ares-1.34.4/test/fuzzinput/ed50ed8ee36230a5a69746ad830437e5 rename to lib/c-ares-1.34.6/test/fuzzinput/ed50ed8ee36230a5a69746ad830437e5 diff --git a/lib/c-ares-1.34.4/test/fuzzinput/f1b900d50806021953321c3b604ee497 b/lib/c-ares-1.34.6/test/fuzzinput/f1b900d50806021953321c3b604ee497 similarity index 100% rename from lib/c-ares-1.34.4/test/fuzzinput/f1b900d50806021953321c3b604ee497 rename to lib/c-ares-1.34.6/test/fuzzinput/f1b900d50806021953321c3b604ee497 diff --git a/lib/c-ares-1.34.4/test/fuzzinput/f6606f624be8c628328cea01d2cd07a9 b/lib/c-ares-1.34.6/test/fuzzinput/f6606f624be8c628328cea01d2cd07a9 similarity index 100% rename from lib/c-ares-1.34.4/test/fuzzinput/f6606f624be8c628328cea01d2cd07a9 rename to lib/c-ares-1.34.6/test/fuzzinput/f6606f624be8c628328cea01d2cd07a9 diff --git a/lib/c-ares-1.34.4/test/fuzzinput/f89f6c8176b564a7dd646f14305573ce b/lib/c-ares-1.34.6/test/fuzzinput/f89f6c8176b564a7dd646f14305573ce similarity index 100% rename from lib/c-ares-1.34.4/test/fuzzinput/f89f6c8176b564a7dd646f14305573ce rename to lib/c-ares-1.34.6/test/fuzzinput/f89f6c8176b564a7dd646f14305573ce diff --git a/lib/c-ares-1.34.4/test/fuzzinput/f9ad508d2dbd08d3aaaabc7d1174677d b/lib/c-ares-1.34.6/test/fuzzinput/f9ad508d2dbd08d3aaaabc7d1174677d similarity index 100% rename from lib/c-ares-1.34.4/test/fuzzinput/f9ad508d2dbd08d3aaaabc7d1174677d rename to lib/c-ares-1.34.6/test/fuzzinput/f9ad508d2dbd08d3aaaabc7d1174677d diff --git a/lib/c-ares-1.34.4/test/fuzzinput/multi-indir b/lib/c-ares-1.34.6/test/fuzzinput/multi-indir similarity index 100% rename from lib/c-ares-1.34.4/test/fuzzinput/multi-indir rename to lib/c-ares-1.34.6/test/fuzzinput/multi-indir diff --git a/lib/c-ares-1.34.4/test/fuzznames/name01 b/lib/c-ares-1.34.6/test/fuzznames/name01 similarity index 100% rename from lib/c-ares-1.34.4/test/fuzznames/name01 rename to lib/c-ares-1.34.6/test/fuzznames/name01 diff --git a/lib/c-ares-1.34.4/test/fuzznames/name02 b/lib/c-ares-1.34.6/test/fuzznames/name02 similarity index 100% rename from lib/c-ares-1.34.4/test/fuzznames/name02 rename to lib/c-ares-1.34.6/test/fuzznames/name02 diff --git a/lib/c-ares-1.34.4/test/fuzznames/name03 b/lib/c-ares-1.34.6/test/fuzznames/name03 similarity index 100% rename from lib/c-ares-1.34.4/test/fuzznames/name03 rename to lib/c-ares-1.34.6/test/fuzznames/name03 diff --git a/lib/c-ares-1.34.4/test/fuzznames/name04 b/lib/c-ares-1.34.6/test/fuzznames/name04 similarity index 100% rename from lib/c-ares-1.34.4/test/fuzznames/name04 rename to lib/c-ares-1.34.6/test/fuzznames/name04 diff --git a/lib/c-ares-1.34.4/test/fuzznames/name05 b/lib/c-ares-1.34.6/test/fuzznames/name05 similarity index 100% rename from lib/c-ares-1.34.4/test/fuzznames/name05 rename to lib/c-ares-1.34.6/test/fuzznames/name05 diff --git a/lib/c-ares-1.34.4/test/fuzznames/name06 b/lib/c-ares-1.34.6/test/fuzznames/name06 similarity index 100% rename from lib/c-ares-1.34.4/test/fuzznames/name06 rename to lib/c-ares-1.34.6/test/fuzznames/name06 diff --git a/lib/c-ares-1.34.4/test/fuzznames/name07 b/lib/c-ares-1.34.6/test/fuzznames/name07 similarity index 100% rename from lib/c-ares-1.34.4/test/fuzznames/name07 rename to lib/c-ares-1.34.6/test/fuzznames/name07 diff --git a/lib/c-ares-1.34.4/test/fuzznames/name08 b/lib/c-ares-1.34.6/test/fuzznames/name08 similarity index 100% rename from lib/c-ares-1.34.4/test/fuzznames/name08 rename to lib/c-ares-1.34.6/test/fuzznames/name08 diff --git a/lib/c-ares-1.34.4/test/fuzznames/name09 b/lib/c-ares-1.34.6/test/fuzznames/name09 similarity index 100% rename from lib/c-ares-1.34.4/test/fuzznames/name09 rename to lib/c-ares-1.34.6/test/fuzznames/name09 diff --git a/lib/c-ares-1.34.4/test/fuzznames/uri1 b/lib/c-ares-1.34.6/test/fuzznames/uri1 similarity index 100% rename from lib/c-ares-1.34.4/test/fuzznames/uri1 rename to lib/c-ares-1.34.6/test/fuzznames/uri1 diff --git a/lib/c-ares-1.34.4/test/fuzznames/uri10 b/lib/c-ares-1.34.6/test/fuzznames/uri10 similarity index 100% rename from lib/c-ares-1.34.4/test/fuzznames/uri10 rename to lib/c-ares-1.34.6/test/fuzznames/uri10 diff --git a/lib/c-ares-1.34.4/test/fuzznames/uri11 b/lib/c-ares-1.34.6/test/fuzznames/uri11 similarity index 100% rename from lib/c-ares-1.34.4/test/fuzznames/uri11 rename to lib/c-ares-1.34.6/test/fuzznames/uri11 diff --git a/lib/c-ares-1.34.4/test/fuzznames/uri12 b/lib/c-ares-1.34.6/test/fuzznames/uri12 similarity index 100% rename from lib/c-ares-1.34.4/test/fuzznames/uri12 rename to lib/c-ares-1.34.6/test/fuzznames/uri12 diff --git a/lib/c-ares-1.34.4/test/fuzznames/uri13 b/lib/c-ares-1.34.6/test/fuzznames/uri13 similarity index 100% rename from lib/c-ares-1.34.4/test/fuzznames/uri13 rename to lib/c-ares-1.34.6/test/fuzznames/uri13 diff --git a/lib/c-ares-1.34.4/test/fuzznames/uri14 b/lib/c-ares-1.34.6/test/fuzznames/uri14 similarity index 100% rename from lib/c-ares-1.34.4/test/fuzznames/uri14 rename to lib/c-ares-1.34.6/test/fuzznames/uri14 diff --git a/lib/c-ares-1.34.4/test/fuzznames/uri16 b/lib/c-ares-1.34.6/test/fuzznames/uri16 similarity index 100% rename from lib/c-ares-1.34.4/test/fuzznames/uri16 rename to lib/c-ares-1.34.6/test/fuzznames/uri16 diff --git a/lib/c-ares-1.34.4/test/fuzznames/uri17 b/lib/c-ares-1.34.6/test/fuzznames/uri17 similarity index 100% rename from lib/c-ares-1.34.4/test/fuzznames/uri17 rename to lib/c-ares-1.34.6/test/fuzznames/uri17 diff --git a/lib/c-ares-1.34.4/test/fuzznames/uri18 b/lib/c-ares-1.34.6/test/fuzznames/uri18 similarity index 100% rename from lib/c-ares-1.34.4/test/fuzznames/uri18 rename to lib/c-ares-1.34.6/test/fuzznames/uri18 diff --git a/lib/c-ares-1.34.4/test/fuzznames/uri19 b/lib/c-ares-1.34.6/test/fuzznames/uri19 similarity index 100% rename from lib/c-ares-1.34.4/test/fuzznames/uri19 rename to lib/c-ares-1.34.6/test/fuzznames/uri19 diff --git a/lib/c-ares-1.34.4/test/fuzznames/uri2 b/lib/c-ares-1.34.6/test/fuzznames/uri2 similarity index 100% rename from lib/c-ares-1.34.4/test/fuzznames/uri2 rename to lib/c-ares-1.34.6/test/fuzznames/uri2 diff --git a/lib/c-ares-1.34.4/test/fuzznames/uri20 b/lib/c-ares-1.34.6/test/fuzznames/uri20 similarity index 100% rename from lib/c-ares-1.34.4/test/fuzznames/uri20 rename to lib/c-ares-1.34.6/test/fuzznames/uri20 diff --git a/lib/c-ares-1.34.4/test/fuzznames/uri21 b/lib/c-ares-1.34.6/test/fuzznames/uri21 similarity index 100% rename from lib/c-ares-1.34.4/test/fuzznames/uri21 rename to lib/c-ares-1.34.6/test/fuzznames/uri21 diff --git a/lib/c-ares-1.34.4/test/fuzznames/uri22 b/lib/c-ares-1.34.6/test/fuzznames/uri22 similarity index 100% rename from lib/c-ares-1.34.4/test/fuzznames/uri22 rename to lib/c-ares-1.34.6/test/fuzznames/uri22 diff --git a/lib/c-ares-1.34.4/test/fuzznames/uri23 b/lib/c-ares-1.34.6/test/fuzznames/uri23 similarity index 100% rename from lib/c-ares-1.34.4/test/fuzznames/uri23 rename to lib/c-ares-1.34.6/test/fuzznames/uri23 diff --git a/lib/c-ares-1.34.4/test/fuzznames/uri24 b/lib/c-ares-1.34.6/test/fuzznames/uri24 similarity index 100% rename from lib/c-ares-1.34.4/test/fuzznames/uri24 rename to lib/c-ares-1.34.6/test/fuzznames/uri24 diff --git a/lib/c-ares-1.34.4/test/fuzznames/uri25 b/lib/c-ares-1.34.6/test/fuzznames/uri25 similarity index 100% rename from lib/c-ares-1.34.4/test/fuzznames/uri25 rename to lib/c-ares-1.34.6/test/fuzznames/uri25 diff --git a/lib/c-ares-1.34.4/test/fuzznames/uri26 b/lib/c-ares-1.34.6/test/fuzznames/uri26 similarity index 100% rename from lib/c-ares-1.34.4/test/fuzznames/uri26 rename to lib/c-ares-1.34.6/test/fuzznames/uri26 diff --git a/lib/c-ares-1.34.4/test/fuzznames/uri27 b/lib/c-ares-1.34.6/test/fuzznames/uri27 similarity index 100% rename from lib/c-ares-1.34.4/test/fuzznames/uri27 rename to lib/c-ares-1.34.6/test/fuzznames/uri27 diff --git a/lib/c-ares-1.34.4/test/fuzznames/uri28 b/lib/c-ares-1.34.6/test/fuzznames/uri28 similarity index 100% rename from lib/c-ares-1.34.4/test/fuzznames/uri28 rename to lib/c-ares-1.34.6/test/fuzznames/uri28 diff --git a/lib/c-ares-1.34.4/test/fuzznames/uri29 b/lib/c-ares-1.34.6/test/fuzznames/uri29 similarity index 100% rename from lib/c-ares-1.34.4/test/fuzznames/uri29 rename to lib/c-ares-1.34.6/test/fuzznames/uri29 diff --git a/lib/c-ares-1.34.4/test/fuzznames/uri3 b/lib/c-ares-1.34.6/test/fuzznames/uri3 similarity index 100% rename from lib/c-ares-1.34.4/test/fuzznames/uri3 rename to lib/c-ares-1.34.6/test/fuzznames/uri3 diff --git a/lib/c-ares-1.34.4/test/fuzznames/uri30 b/lib/c-ares-1.34.6/test/fuzznames/uri30 similarity index 100% rename from lib/c-ares-1.34.4/test/fuzznames/uri30 rename to lib/c-ares-1.34.6/test/fuzznames/uri30 diff --git a/lib/c-ares-1.34.4/test/fuzznames/uri31 b/lib/c-ares-1.34.6/test/fuzznames/uri31 similarity index 100% rename from lib/c-ares-1.34.4/test/fuzznames/uri31 rename to lib/c-ares-1.34.6/test/fuzznames/uri31 diff --git a/lib/c-ares-1.34.4/test/fuzznames/uri32 b/lib/c-ares-1.34.6/test/fuzznames/uri32 similarity index 100% rename from lib/c-ares-1.34.4/test/fuzznames/uri32 rename to lib/c-ares-1.34.6/test/fuzznames/uri32 diff --git a/lib/c-ares-1.34.4/test/fuzznames/uri33 b/lib/c-ares-1.34.6/test/fuzznames/uri33 similarity index 100% rename from lib/c-ares-1.34.4/test/fuzznames/uri33 rename to lib/c-ares-1.34.6/test/fuzznames/uri33 diff --git a/lib/c-ares-1.34.4/test/fuzznames/uri34 b/lib/c-ares-1.34.6/test/fuzznames/uri34 similarity index 100% rename from lib/c-ares-1.34.4/test/fuzznames/uri34 rename to lib/c-ares-1.34.6/test/fuzznames/uri34 diff --git a/lib/c-ares-1.34.4/test/fuzznames/uri35 b/lib/c-ares-1.34.6/test/fuzznames/uri35 similarity index 100% rename from lib/c-ares-1.34.4/test/fuzznames/uri35 rename to lib/c-ares-1.34.6/test/fuzznames/uri35 diff --git a/lib/c-ares-1.34.4/test/fuzznames/uri36 b/lib/c-ares-1.34.6/test/fuzznames/uri36 similarity index 100% rename from lib/c-ares-1.34.4/test/fuzznames/uri36 rename to lib/c-ares-1.34.6/test/fuzznames/uri36 diff --git a/lib/c-ares-1.34.4/test/fuzznames/uri37 b/lib/c-ares-1.34.6/test/fuzznames/uri37 similarity index 100% rename from lib/c-ares-1.34.4/test/fuzznames/uri37 rename to lib/c-ares-1.34.6/test/fuzznames/uri37 diff --git a/lib/c-ares-1.34.4/test/fuzznames/uri4 b/lib/c-ares-1.34.6/test/fuzznames/uri4 similarity index 100% rename from lib/c-ares-1.34.4/test/fuzznames/uri4 rename to lib/c-ares-1.34.6/test/fuzznames/uri4 diff --git a/lib/c-ares-1.34.4/test/fuzznames/uri5 b/lib/c-ares-1.34.6/test/fuzznames/uri5 similarity index 100% rename from lib/c-ares-1.34.4/test/fuzznames/uri5 rename to lib/c-ares-1.34.6/test/fuzznames/uri5 diff --git a/lib/c-ares-1.34.4/test/fuzznames/uri6 b/lib/c-ares-1.34.6/test/fuzznames/uri6 similarity index 100% rename from lib/c-ares-1.34.4/test/fuzznames/uri6 rename to lib/c-ares-1.34.6/test/fuzznames/uri6 diff --git a/lib/c-ares-1.34.4/test/fuzznames/uri7 b/lib/c-ares-1.34.6/test/fuzznames/uri7 similarity index 100% rename from lib/c-ares-1.34.4/test/fuzznames/uri7 rename to lib/c-ares-1.34.6/test/fuzznames/uri7 diff --git a/lib/c-ares-1.34.4/test/fuzznames/uri8 b/lib/c-ares-1.34.6/test/fuzznames/uri8 similarity index 100% rename from lib/c-ares-1.34.4/test/fuzznames/uri8 rename to lib/c-ares-1.34.6/test/fuzznames/uri8 diff --git a/lib/c-ares-1.34.4/test/fuzznames/uri9 b/lib/c-ares-1.34.6/test/fuzznames/uri9 similarity index 100% rename from lib/c-ares-1.34.4/test/fuzznames/uri9 rename to lib/c-ares-1.34.6/test/fuzznames/uri9 diff --git a/lib/cmetrics/.github/workflows/build.yaml b/lib/cmetrics/.github/workflows/build.yaml index 305a0133e8e..40f8432a8fc 100644 --- a/lib/cmetrics/.github/workflows/build.yaml +++ b/lib/cmetrics/.github/workflows/build.yaml @@ -15,11 +15,11 @@ jobs: strategy: fail-fast: false matrix: - os: [windows-latest, windows-2019] + os: [windows-latest, windows-2022] permissions: contents: read steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 with: submodules: true @@ -90,6 +90,9 @@ jobs: steps: - name: Set up base image dependencies run: | + # Update sources to use archive.debian.org (Buster reached end-of-life) + sed -i 's/deb.debian.org/archive.debian.org/g' /etc/apt/sources.list + sed -i 's/security.debian.org/archive.debian.org/g' /etc/apt/sources.list apt-get update apt-get install -y build-essential wget make gcc g++ git libcurl4-openssl-dev @@ -136,7 +139,7 @@ jobs: permissions: contents: read steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 with: submodules: true @@ -170,7 +173,7 @@ jobs: permissions: contents: read steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 with: submodules: true @@ -200,7 +203,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out the repository - uses: actions/checkout@v5 + uses: actions/checkout@v6 with: submodules: true diff --git a/lib/cmetrics/.github/workflows/lint.yaml b/lib/cmetrics/.github/workflows/lint.yaml index 7b23e8bb7dc..b0e49d650be 100644 --- a/lib/cmetrics/.github/workflows/lint.yaml +++ b/lib/cmetrics/.github/workflows/lint.yaml @@ -10,7 +10,7 @@ jobs: permissions: contents: read steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 - uses: ludeeus/action-shellcheck@master actionlint: @@ -19,7 +19,7 @@ jobs: permissions: contents: read steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 - run: | echo "::add-matcher::.github/actionlint-matcher.json" bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash) diff --git a/lib/cmetrics/.github/workflows/packages.yaml b/lib/cmetrics/.github/workflows/packages.yaml index ec02c4a2ce3..ee4fd0a4145 100644 --- a/lib/cmetrics/.github/workflows/packages.yaml +++ b/lib/cmetrics/.github/workflows/packages.yaml @@ -18,7 +18,7 @@ jobs: matrix: format: [ rpm, deb ] steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 with: submodules: true @@ -39,7 +39,7 @@ jobs: echo ${{ matrix.format }} | awk '{print toupper($0)}' | xargs -I{} cpack -G {} - name: Store the master package artifacts - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v6 with: name: ${{ matrix.format }}-arm64 path: | @@ -54,7 +54,7 @@ jobs: runs-on: [ ubuntu-latest ] steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 with: submodules: true @@ -64,7 +64,7 @@ jobs: echo ${{ matrix.format }} | awk '{print toupper($0)}' | xargs -I{} cpack -G {} - name: Store the master package artifacts - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v6 with: name: ${{ matrix.format }}-amd64 path: | @@ -81,7 +81,7 @@ jobs: ext: pkg runs-on: macos-14 steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 with: submodules: true @@ -91,7 +91,7 @@ jobs: echo ${{ matrix.config.format }} | xargs -I{} cpack -G {} - name: Store the master package artifacts - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v6 with: name: ${{ matrix.config.format }}-${{matrix.config.arch}} path: | @@ -109,7 +109,7 @@ jobs: contents: write steps: - name: Download all artefacts - uses: actions/download-artifact@v5 + uses: actions/download-artifact@v7 with: path: artifacts/ diff --git a/lib/cmetrics/CMakeLists.txt b/lib/cmetrics/CMakeLists.txt index 5421f8c80da..a5572c3048d 100644 --- a/lib/cmetrics/CMakeLists.txt +++ b/lib/cmetrics/CMakeLists.txt @@ -6,7 +6,7 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON) # CMetrics Version set(CMT_VERSION_MAJOR 1) set(CMT_VERSION_MINOR 0) -set(CMT_VERSION_PATCH 5) +set(CMT_VERSION_PATCH 6) set(CMT_VERSION_STR "${CMT_VERSION_MAJOR}.${CMT_VERSION_MINOR}.${CMT_VERSION_PATCH}") # Include helpers diff --git a/lib/cmetrics/src/cmt_cat.c b/lib/cmetrics/src/cmt_cat.c index dcd941bdb81..595225bbd40 100644 --- a/lib/cmetrics/src/cmt_cat.c +++ b/lib/cmetrics/src/cmt_cat.c @@ -96,19 +96,38 @@ static int copy_label_values(struct cmt_metric *metric, char **out) return i; } -static inline int cat_histogram_values(struct cmt_metric *metric_dst, struct cmt_histogram *histogram, - struct cmt_metric *metric_src) +static inline int cat_histogram_values(struct cmt_metric *metric_dst, struct cmt_histogram *histogram_src, + struct cmt_metric *metric_src, struct cmt_histogram *histogram_dst) { int i; + size_t bucket_count_src; + size_t bucket_count_dst; + /* Validate source histogram buckets exist */ + if (!metric_src->hist_buckets) { + /* Source has no bucket data, nothing to concatenate */ + return 0; + } + + bucket_count_src = histogram_src->buckets->count; + bucket_count_dst = histogram_dst->buckets->count; + + /* Validate that source and destination have matching bucket structures */ + if (bucket_count_src != bucket_count_dst) { + /* Histogram bucket structures don't match - cannot concatenate */ + return -1; + } + + /* Allocate destination buckets if needed */ if (!metric_dst->hist_buckets) { - metric_dst->hist_buckets = calloc(1, sizeof(uint64_t) * (histogram->buckets->count + 1)); + metric_dst->hist_buckets = calloc(1, sizeof(uint64_t) * (bucket_count_dst + 1)); if (!metric_dst->hist_buckets) { return -1; } } - for (i = 0; i < histogram->buckets->count; i++) { + /* Concatenate bucket values including +Inf bucket at index bucket_count_dst */ + for (i = 0; i <= bucket_count_dst; i++) { /* histogram buckets are always integers, no need to convert them */ metric_dst->hist_buckets[i] += metric_src->hist_buckets[i]; } @@ -165,7 +184,8 @@ int cmt_cat_copy_map(struct cmt_opts *opts, struct cmt_map *dst, struct cmt_map struct cmt_metric *metric_dst; struct cmt_metric *metric_src; struct cmt_summary *summary; - struct cmt_histogram *histogram; + struct cmt_histogram *histogram_src; + struct cmt_histogram *histogram_dst; /* Handle static metric (no labels case) */ if (src->metric_static_set) { @@ -176,8 +196,9 @@ int cmt_cat_copy_map(struct cmt_opts *opts, struct cmt_map *dst, struct cmt_map metric_src = &src->metric; if (src->type == CMT_HISTOGRAM) { - histogram = (struct cmt_histogram *) src->parent; - ret = cat_histogram_values(metric_dst, histogram, metric_src); + histogram_src = (struct cmt_histogram *) src->parent; + histogram_dst = (struct cmt_histogram *) dst->parent; + ret = cat_histogram_values(metric_dst, histogram_src, metric_src, histogram_dst); if (ret == -1) { return -1; } @@ -214,8 +235,9 @@ int cmt_cat_copy_map(struct cmt_opts *opts, struct cmt_map *dst, struct cmt_map } if (src->type == CMT_HISTOGRAM) { - histogram = (struct cmt_histogram *) src->parent; - ret = cat_histogram_values(metric_dst, histogram, metric_src); + histogram_src = (struct cmt_histogram *) src->parent; + histogram_dst = (struct cmt_histogram *) dst->parent; + ret = cat_histogram_values(metric_dst, histogram_src, metric_src, histogram_dst); if (ret == -1) { return -1; } diff --git a/lib/cmetrics/src/cmt_histogram.c b/lib/cmetrics/src/cmt_histogram.c index df4a5c8f4f0..61efa6e002b 100644 --- a/lib/cmetrics/src/cmt_histogram.c +++ b/lib/cmetrics/src/cmt_histogram.c @@ -36,7 +36,7 @@ struct cmt_histogram_buckets *cmt_histogram_buckets_create_size(double *bkts, si } /* besides buckets set by the user, we add an implicit bucket for +inf */ - upper_bounds = calloc(1, sizeof(double) * count + 1); + upper_bounds = calloc(1, sizeof(double) * (count + 1)); if (!upper_bounds) { cmt_errno(); return NULL; diff --git a/lib/cmetrics/tests/cat.c b/lib/cmetrics/tests/cat.c index a41d7945522..3ef59fca3e1 100644 --- a/lib/cmetrics/tests/cat.c +++ b/lib/cmetrics/tests/cat.c @@ -391,8 +391,232 @@ void test_duplicate_metrics() } +void test_histogram_empty_concatenation() +{ + int ret; + struct cmt *cmt1; + struct cmt *cmt2; + struct cmt_histogram *h; + struct cmt_histogram_buckets *buckets; + + /* Test concatenating an empty histogram (no observations, NULL hist_buckets) */ + cmt1 = cmt_create(); + TEST_CHECK(cmt1 != NULL); + + buckets = cmt_histogram_buckets_create(11, + 0.005, 0.01, 0.025, 0.05, + 0.1, 0.25, 0.5, 1.0, 2.5, + 5.0, 10.0); + TEST_CHECK(buckets != NULL); + + /* Create histogram but never observe - hist_buckets will be NULL */ + h = cmt_histogram_create(cmt1, + "test", "histogram", "empty", "Empty histogram test", + buckets, + 0, NULL); + TEST_CHECK(h != NULL); + + /* Create destination context */ + cmt2 = cmt_create(); + TEST_CHECK(cmt2 != NULL); + + /* Concatenate empty histogram - should handle NULL hist_buckets gracefully */ + ret = cmt_cat(cmt2, cmt1); + TEST_CHECK(ret == 0); + + cmt_destroy(cmt1); + cmt_destroy(cmt2); +} + +void test_histogram_mismatched_buckets() +{ + int ret; + int i; + double val; + uint64_t ts; + struct cmt *cmt1; + struct cmt *cmt2; + struct cmt_histogram *h1; + struct cmt_histogram *h2; + struct cmt_histogram_buckets *buckets1; + struct cmt_histogram_buckets *buckets2; + + /* Test concatenating histograms with different bucket structures */ + cmt1 = cmt_create(); + TEST_CHECK(cmt1 != NULL); + + /* Create histogram with 11 buckets */ + buckets1 = cmt_histogram_buckets_create(11, + 0.005, 0.01, 0.025, 0.05, + 0.1, 0.25, 0.5, 1.0, 2.5, + 5.0, 10.0); + TEST_CHECK(buckets1 != NULL); + + h1 = cmt_histogram_create(cmt1, + "test", "histogram", "mismatch", "Mismatched buckets test", + buckets1, + 0, NULL); + TEST_CHECK(h1 != NULL); + + ts = cfl_time_now(); + for (i = 0; i < sizeof(hist_observe_values)/(sizeof(double)); i++) { + val = hist_observe_values[i]; + cmt_histogram_observe(h1, ts, val, 0, NULL); + } + + /* Create second context with different bucket structure */ + cmt2 = cmt_create(); + TEST_CHECK(cmt2 != NULL); + + /* Create histogram with 5 buckets (different structure) */ + buckets2 = cmt_histogram_buckets_create(5, + 0.1, 0.5, 1.0, 5.0, 10.0); + TEST_CHECK(buckets2 != NULL); + + h2 = cmt_histogram_create(cmt2, + "test", "histogram", "mismatch", "Mismatched buckets test", + buckets2, + 0, NULL); + TEST_CHECK(h2 != NULL); + + ts = cfl_time_now(); + for (i = 0; i < sizeof(hist_observe_values)/(sizeof(double)); i++) { + val = hist_observe_values[i]; + cmt_histogram_observe(h2, ts, val, 0, NULL); + } + + /* Try to concatenate - should fail due to bucket mismatch */ + ret = cmt_cat(cmt1, cmt2); + TEST_CHECK(ret == -1); + + cmt_destroy(cmt1); + cmt_destroy(cmt2); +} + +void test_histogram_empty_to_populated() +{ + int ret; + int i; + double val; + uint64_t ts; + struct cmt *cmt1; + struct cmt *cmt2; + struct cmt_histogram *h; + struct cmt_histogram_buckets *buckets1; + struct cmt_histogram_buckets *buckets2; + + /* Test concatenating empty histogram to one with data */ + cmt1 = cmt_create(); + TEST_CHECK(cmt1 != NULL); + + buckets1 = cmt_histogram_buckets_create(11, + 0.005, 0.01, 0.025, 0.05, + 0.1, 0.25, 0.5, 1.0, 2.5, + 5.0, 10.0); + TEST_CHECK(buckets1 != NULL); + + /* Create empty histogram (no observations) */ + h = cmt_histogram_create(cmt1, + "test", "histogram", "empty_to_full", "Empty to populated test", + buckets1, + 0, NULL); + TEST_CHECK(h != NULL); + + /* Create second context with populated histogram */ + cmt2 = cmt_create(); + TEST_CHECK(cmt2 != NULL); + + buckets2 = cmt_histogram_buckets_create(11, + 0.005, 0.01, 0.025, 0.05, + 0.1, 0.25, 0.5, 1.0, 2.5, + 5.0, 10.0); + TEST_CHECK(buckets2 != NULL); + + h = cmt_histogram_create(cmt2, + "test", "histogram", "empty_to_full", "Empty to populated test", + buckets2, + 0, NULL); + TEST_CHECK(h != NULL); + + ts = cfl_time_now(); + for (i = 0; i < sizeof(hist_observe_values)/(sizeof(double)); i++) { + val = hist_observe_values[i]; + cmt_histogram_observe(h, ts, val, 0, NULL); + } + + /* Concatenate empty to populated - should succeed */ + ret = cmt_cat(cmt1, cmt2); + TEST_CHECK(ret == 0); + + cmt_destroy(cmt1); + cmt_destroy(cmt2); +} + +void test_histogram_populated_to_empty() +{ + int ret; + int i; + double val; + uint64_t ts; + struct cmt *cmt1; + struct cmt *cmt2; + struct cmt_histogram *h; + struct cmt_histogram_buckets *buckets1; + struct cmt_histogram_buckets *buckets2; + + /* Test concatenating populated histogram to empty one */ + cmt1 = cmt_create(); + TEST_CHECK(cmt1 != NULL); + + buckets1 = cmt_histogram_buckets_create(11, + 0.005, 0.01, 0.025, 0.05, + 0.1, 0.25, 0.5, 1.0, 2.5, + 5.0, 10.0); + TEST_CHECK(buckets1 != NULL); + + h = cmt_histogram_create(cmt1, + "test", "histogram", "full_to_empty", "Populated to empty test", + buckets1, + 0, NULL); + TEST_CHECK(h != NULL); + + ts = cfl_time_now(); + for (i = 0; i < sizeof(hist_observe_values)/(sizeof(double)); i++) { + val = hist_observe_values[i]; + cmt_histogram_observe(h, ts, val, 0, NULL); + } + + /* Create second context with empty histogram */ + cmt2 = cmt_create(); + TEST_CHECK(cmt2 != NULL); + + buckets2 = cmt_histogram_buckets_create(11, + 0.005, 0.01, 0.025, 0.05, + 0.1, 0.25, 0.5, 1.0, 2.5, + 5.0, 10.0); + TEST_CHECK(buckets2 != NULL); + + /* Create empty histogram (no observations) */ + h = cmt_histogram_create(cmt2, + "test", "histogram", "full_to_empty", "Populated to empty test", + buckets2, + 0, NULL); + TEST_CHECK(h != NULL); + + /* Concatenate populated to empty - should succeed */ + ret = cmt_cat(cmt1, cmt2); + TEST_CHECK(ret == 0); + + cmt_destroy(cmt1); + cmt_destroy(cmt2); +} + TEST_LIST = { {"cat", test_cat}, {"duplicate_metrics", test_duplicate_metrics}, + {"histogram_empty_concatenation", test_histogram_empty_concatenation}, + {"histogram_mismatched_buckets", test_histogram_mismatched_buckets}, + {"histogram_empty_to_populated", test_histogram_empty_to_populated}, + {"histogram_populated_to_empty", test_histogram_populated_to_empty}, { 0 } }; diff --git a/lib/luajit-04dca791/.relver b/lib/luajit-04dca791/.relver deleted file mode 100644 index 37baebc8e48..00000000000 --- a/lib/luajit-04dca791/.relver +++ /dev/null @@ -1 +0,0 @@ -1720049189 diff --git a/lib/luajit-04dca791/configure b/lib/luajit-04dca791/configure deleted file mode 100755 index e69de29bb2d..00000000000 diff --git a/lib/luajit-04dca791/.gitattributes b/lib/luajit-7152e154/.gitattributes similarity index 100% rename from lib/luajit-04dca791/.gitattributes rename to lib/luajit-7152e154/.gitattributes diff --git a/lib/luajit-04dca791/.gitignore b/lib/luajit-7152e154/.gitignore similarity index 100% rename from lib/luajit-04dca791/.gitignore rename to lib/luajit-7152e154/.gitignore diff --git a/lib/luajit-7152e154/.relver b/lib/luajit-7152e154/.relver new file mode 100644 index 00000000000..c0dbef3fe92 --- /dev/null +++ b/lib/luajit-7152e154/.relver @@ -0,0 +1 @@ +1765228720 diff --git a/lib/luajit-04dca791/COPYRIGHT b/lib/luajit-7152e154/COPYRIGHT similarity index 98% rename from lib/luajit-04dca791/COPYRIGHT rename to lib/luajit-7152e154/COPYRIGHT index d76203146a7..a192ae49daf 100644 --- a/lib/luajit-04dca791/COPYRIGHT +++ b/lib/luajit-7152e154/COPYRIGHT @@ -1,7 +1,7 @@ =============================================================================== LuaJIT -- a Just-In-Time Compiler for Lua. https://luajit.org/ -Copyright (C) 2005-2023 Mike Pall. All rights reserved. +Copyright (C) 2005-2025 Mike Pall. All rights reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/lib/luajit-04dca791/Makefile b/lib/luajit-7152e154/Makefile similarity index 94% rename from lib/luajit-04dca791/Makefile rename to lib/luajit-7152e154/Makefile index 6ae2c49de20..c41b3345dd1 100644 --- a/lib/luajit-04dca791/Makefile +++ b/lib/luajit-7152e154/Makefile @@ -10,7 +10,7 @@ # For MSVC, please follow the instructions given in src/msvcbuild.bat. # For MinGW and Cygwin, cd to src and run make with the Makefile there. # -# Copyright (C) 2005-2023 Mike Pall. See Copyright Notice in luajit.h +# Copyright (C) 2005-2025 Mike Pall. See Copyright Notice in luajit.h ############################################################################## MAJVER= 2 @@ -37,12 +37,13 @@ export MULTILIB= lib DPREFIX= $(DESTDIR)$(PREFIX) INSTALL_BIN= $(DPREFIX)/bin INSTALL_LIB= $(DPREFIX)/$(MULTILIB) -INSTALL_SHARE= $(DPREFIX)/share +INSTALL_SHARE_= $(PREFIX)/share +INSTALL_SHARE= $(DESTDIR)$(INSTALL_SHARE_) INSTALL_DEFINC= $(DPREFIX)/include/luajit-$(MMVERSION) INSTALL_INC= $(INSTALL_DEFINC) -INSTALL_LJLIBD= $(INSTALL_SHARE)/luajit-$(MMVERSION) -INSTALL_JITLIB= $(INSTALL_LJLIBD)/jit +export INSTALL_LJLIBD= $(INSTALL_SHARE_)/luajit-$(MMVERSION) +INSTALL_JITLIB= $(DESTDIR)$(INSTALL_LJLIBD)/jit INSTALL_LMODD= $(INSTALL_SHARE)/lua INSTALL_LMOD= $(INSTALL_LMODD)/$(ABIVER) INSTALL_CMODD= $(INSTALL_LIB)/lua @@ -71,7 +72,7 @@ INSTALL_PC= $(INSTALL_PKGCONFIG)/$(INSTALL_PCNAME) INSTALL_DIRS= $(INSTALL_BIN) $(INSTALL_LIB) $(INSTALL_INC) $(INSTALL_MAN) \ $(INSTALL_PKGCONFIG) $(INSTALL_JITLIB) $(INSTALL_LMOD) $(INSTALL_CMOD) -UNINSTALL_DIRS= $(INSTALL_JITLIB) $(INSTALL_LJLIBD) $(INSTALL_INC) \ +UNINSTALL_DIRS= $(INSTALL_JITLIB) $(DESTDIR)$(INSTALL_LJLIBD) $(INSTALL_INC) \ $(INSTALL_LMOD) $(INSTALL_LMODD) $(INSTALL_CMOD) $(INSTALL_CMODD) RM= rm -f @@ -109,7 +110,7 @@ else endif TARGET_SYS?= $(HOST_SYS) -ifeq (Darwin,$(TARGET_SYS)) +ifneq (,$(filter $(TARGET_SYS),Darwin iOS)) INSTALL_SONAME= $(INSTALL_DYLIBNAME) INSTALL_SOSHORT1= $(INSTALL_DYLIBSHORT1) INSTALL_SOSHORT2= $(INSTALL_DYLIBSHORT2) diff --git a/lib/luajit-04dca791/README b/lib/luajit-7152e154/README similarity index 89% rename from lib/luajit-04dca791/README rename to lib/luajit-7152e154/README index e4a692654dc..201f1b7272b 100644 --- a/lib/luajit-04dca791/README +++ b/lib/luajit-7152e154/README @@ -5,7 +5,7 @@ LuaJIT is a Just-In-Time (JIT) compiler for the Lua programming language. Project Homepage: https://luajit.org/ -LuaJIT is Copyright (C) 2005-2023 Mike Pall. +LuaJIT is Copyright (C) 2005-2025 Mike Pall. LuaJIT is free software, released under the MIT license. See full Copyright Notice in the COPYRIGHT file or in luajit.h. diff --git a/lib/luajit-04dca791/doc/bluequad-print.css b/lib/luajit-7152e154/doc/bluequad-print.css similarity index 98% rename from lib/luajit-04dca791/doc/bluequad-print.css rename to lib/luajit-7152e154/doc/bluequad-print.css index 4a1392789ed..5bfda5d323f 100644 --- a/lib/luajit-04dca791/doc/bluequad-print.css +++ b/lib/luajit-7152e154/doc/bluequad-print.css @@ -1,4 +1,4 @@ -/* Copyright (C) 2004-2023 Mike Pall. +/* Copyright (C) 2004-2025 Mike Pall. * * You are welcome to use the general ideas of this design for your own sites. * But please do not steal the stylesheet, the layout or the color scheme. diff --git a/lib/luajit-04dca791/doc/bluequad.css b/lib/luajit-7152e154/doc/bluequad.css similarity index 99% rename from lib/luajit-04dca791/doc/bluequad.css rename to lib/luajit-7152e154/doc/bluequad.css index 7399f62517f..5334a7596b7 100644 --- a/lib/luajit-04dca791/doc/bluequad.css +++ b/lib/luajit-7152e154/doc/bluequad.css @@ -1,4 +1,4 @@ -/* Copyright (C) 2004-2023 Mike Pall. +/* Copyright (C) 2004-2025 Mike Pall. * * You are welcome to use the general ideas of this design for your own sites. * But please do not steal the stylesheet, the layout or the color scheme. diff --git a/lib/luajit-04dca791/doc/contact.html b/lib/luajit-7152e154/doc/contact.html similarity index 95% rename from lib/luajit-04dca791/doc/contact.html rename to lib/luajit-7152e154/doc/contact.html index cc4d8c7235d..d8d34a69028 100644 --- a/lib/luajit-04dca791/doc/contact.html +++ b/lib/luajit-7152e154/doc/contact.html @@ -3,7 +3,7 @@ Contact - + @@ -94,7 +94,7 @@

Contact

Copyright

All documentation is -Copyright © 2005-2023 Mike Pall. +Copyright © 2005-2025 Mike Pall.

@@ -102,7 +102,7 @@

Copyright