Skip to content

Commit

Permalink
deps: update c-ares to v1.33.0
Browse files Browse the repository at this point in the history
PR-URL: #54198
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
  • Loading branch information
nodejs-github-bot authored and targos committed Aug 14, 2024
1 parent 911de7d commit 869da20
Show file tree
Hide file tree
Showing 120 changed files with 4,919 additions and 2,705 deletions.
35 changes: 32 additions & 3 deletions deps/cares/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ INCLUDE (CheckCSourceCompiles)
INCLUDE (CheckStructHasMember)
INCLUDE (CheckLibraryExists)

PROJECT (c-ares LANGUAGES C VERSION "1.32.3" )
PROJECT (c-ares LANGUAGES C VERSION "1.33.0" )

# Set this version before release
SET (CARES_VERSION "${PROJECT_VERSION}")
Expand All @@ -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 "19:3:17")
SET (CARES_LIB_VERSIONINFO "20:0:18")


OPTION (CARES_STATIC "Build as a static library" OFF)
Expand All @@ -42,6 +42,7 @@ OPTION (CARES_BUILD_CONTAINER_TESTS "Build and run container tests (implies CARE
OPTION (CARES_BUILD_TOOLS "Build tools" ON)
OPTION (CARES_SYMBOL_HIDING "Hide private symbols in shared libraries" OFF)
OPTION (CARES_THREADS "Build with thread-safety support" ON)
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")


Expand Down Expand Up @@ -265,7 +266,7 @@ IF (CMAKE_SYSTEM_NAME STREQUAL "Darwin")
ELSEIF (CMAKE_SYSTEM_NAME STREQUAL "Linux")
LIST (APPEND SYSFLAGS -D_GNU_SOURCE -D_POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE=700)
ELSEIF (CMAKE_SYSTEM_NAME STREQUAL "SunOS")
LIST (APPEND SYSFLAGS -D__EXTENSIONS__ -D_REENTRANT -D_XOPEN_SOURCE=700)
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")
Expand Down Expand Up @@ -409,6 +410,7 @@ CHECK_STRUCT_HAS_MEMBER("struct sockaddr_in6" sin6_scope_id "${CMAKE_EXTRA_INCLU
CHECK_SYMBOL_EXISTS (closesocket "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_CLOSESOCKET)
CHECK_SYMBOL_EXISTS (CloseSocket "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_CLOSESOCKET_CAMEL)
CHECK_SYMBOL_EXISTS (connect "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_CONNECT)
CHECK_SYMBOL_EXISTS (connectx "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_CONNECTX)
CHECK_SYMBOL_EXISTS (fcntl "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_FCNTL)
CHECK_SYMBOL_EXISTS (freeaddrinfo "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_FREEADDRINFO)
CHECK_SYMBOL_EXISTS (getaddrinfo "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_GETADDRINFO)
Expand All @@ -423,6 +425,10 @@ CHECK_SYMBOL_EXISTS (if_indextoname "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_IF_INDE
CHECK_SYMBOL_EXISTS (if_nametoindex "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_IF_NAMETOINDEX)
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)
CHECK_SYMBOL_EXISTS (RegisterWaitForSingleObject "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_REGISTERWAITFORSINGLEOBJECT)


CHECK_SYMBOL_EXISTS (inet_net_pton "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_INET_NET_PTON)
IF (NOT WIN32)
# Disabled on Windows, because these functions are only really supported on Windows
Expand Down Expand Up @@ -682,6 +688,27 @@ IF (HAVE_ARPA_NAMESER_COMPAT_H)
SET (CARES_HAVE_ARPA_NAMESER_COMPAT_H 1)
ENDIF()


# Coverage
IF (CARES_COVERAGE)
# set compiler flags
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ftest-coverage -fprofile-arcs")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ftest-coverage -fprofile-arcs")

# find required tools
FIND_PROGRAM(LCOV lcov REQUIRED)
FIND_PROGRAM(GENHTML genhtml REQUIRED)

# add coverage target
ADD_CUSTOM_TARGET(coverage
# gather data
COMMAND ${LCOV} --directory . --capture --output-file coverage.info
# generate report
COMMAND ${GENHTML} --demangle-cpp -o coverage coverage.info
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
)
ENDIF()

# TRANSFORM_MAKEFILE_INC
#
# This function consumes the "Makefile.inc" autotools file, and converts it into
Expand Down Expand Up @@ -729,6 +756,8 @@ IF (CARES_BUILD_TESTS OR CARES_BUILD_CONTAINER_TESTS)
ENDIF ()




# Export targets
IF (CARES_INSTALL)
SET (CMAKECONFIG_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}")
Expand Down
2 changes: 0 additions & 2 deletions deps/cares/LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# c-ares license

MIT License

Copyright (c) 1998 Massachusetts Institute of Technology
Expand Down
72 changes: 72 additions & 0 deletions deps/cares/Makefile.Watcom
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,19 @@ all: $(ARESBUILDH) $(OBJ_BASE) $(TARGETS) $(DEMOS) .SYMBOLIC
$(OBJ_BASE):
-$(MD) $^@
-$(MD) $^@\stat
-$(MD) $^@\stat\dsa
-$(MD) $^@\stat\event
-$(MD) $^@\stat\legacy
-$(MD) $^@\stat\record
-$(MD) $^@\stat\str
-$(MD) $^@\stat\util
-$(MD) $^@\dyn
-$(MD) $^@\dyn\dsa
-$(MD) $^@\dyn\event
-$(MD) $^@\dyn\legacy
-$(MD) $^@\dyn\record
-$(MD) $^@\dyn\str
-$(MD) $^@\dyn\util
-$(MD) $^@\tools

$(ARESBUILDH): .EXISTSONLY
Expand Down Expand Up @@ -129,7 +141,19 @@ vclean realclean: clean .SYMBOLIC
-$(RM) $(TARGETS) $(LIBNAME).map
-$(RM) $(DEMOS) $(DEMOS:.exe=.map)
-$(RD) $(OBJ_BASE)\stat
-$(RD) $(OBJ_BASE)\stat\dsa
-$(RD) $(OBJ_BASE)\stat\event
-$(RD) $(OBJ_BASE)\stat\legacy
-$(RD) $(OBJ_BASE)\stat\record
-$(RD) $(OBJ_BASE)\stat\str
-$(RD) $(OBJ_BASE)\stat\util
-$(RD) $(OBJ_BASE)\dyn
-$(RD) $(OBJ_BASE)\dyn\dsa
-$(RD) $(OBJ_BASE)\dyn\event
-$(RD) $(OBJ_BASE)\dyn\legacy
-$(RD) $(OBJ_BASE)\dyn\record
-$(RD) $(OBJ_BASE)\dyn\str
-$(RD) $(OBJ_BASE)\dyn\util
-$(RD) $(OBJ_BASE)\tools
-$(RD) $(OBJ_BASE)

Expand All @@ -144,10 +168,58 @@ $(RESOURCE): src\lib\cares.rc .AUTODEPEND
.c{$(OBJ_BASE)\dyn}.obj:
$(CC) $(CFLAGS) -bd .\src\lib\$^& -fo=$^@

.ERASE
{dsa}.c{$(OBJ_BASE)\dyn\dsa}.obj:
$(CC) $(CFLAGS) -bd .\src\lib\dsa\$^& -fo=$^@

.ERASE
{event}.c{$(OBJ_BASE)\dyn\event}.obj:
$(CC) $(CFLAGS) -bd .\src\lib\event\$^& -fo=$^@

.ERASE
{legacy}.c{$(OBJ_BASE)\dyn\legacy}.obj:
$(CC) $(CFLAGS) -bd .\src\lib\legacy\$^& -fo=$^@

.ERASE
{record}.c{$(OBJ_BASE)\dyn\record}.obj:
$(CC) $(CFLAGS) -bd .\src\lib\record\$^& -fo=$^@

.ERASE
{str}.c{$(OBJ_BASE)\dyn\str}.obj:
$(CC) $(CFLAGS) -bd .\src\lib\str\$^& -fo=$^@

.ERASE
{util}.c{$(OBJ_BASE)\dyn\util}.obj:
$(CC) $(CFLAGS) -bd .\src\lib\util\$^& -fo=$^@

.ERASE
.c{$(OBJ_BASE)\stat}.obj:
$(CC) $(CFLAGS) -DCARES_STATICLIB .\src\lib\$^& -fo=$^@

.ERASE
{dsa}.c{$(OBJ_BASE)\stat\dsa}.obj:
$(CC) $(CFLAGS) -DCARES_STATICLIB .\src\lib\dsa\$^& -fo=$^@

.ERASE
{event}.c{$(OBJ_BASE)\stat\event}.obj:
$(CC) $(CFLAGS) -DCARES_STATICLIB .\src\lib\event\$^& -fo=$^@

.ERASE
{legacy}.c{$(OBJ_BASE)\stat\legacy}.obj:
$(CC) $(CFLAGS) -DCARES_STATICLIB .\src\lib\legacy\$^& -fo=$^@

.ERASE
{record}.c{$(OBJ_BASE)\stat\record}.obj:
$(CC) $(CFLAGS) -DCARES_STATICLIB .\src\lib\record\$^& -fo=$^@

.ERASE
{str}.c{$(OBJ_BASE)\stat\str}.obj:
$(CC) $(CFLAGS) -DCARES_STATICLIB .\src\lib\str\$^& -fo=$^@

.ERASE
{util}.c{$(OBJ_BASE)\stat\util}.obj:
$(CC) $(CFLAGS) -DCARES_STATICLIB .\src\lib\util\$^& -fo=$^@

$(LINK_ARG): $(__MAKEFILES__)
%create $^@
@%append $^@ system nt dll
Expand Down
2 changes: 1 addition & 1 deletion deps/cares/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
AUTOMAKE_OPTIONS = foreign nostdinc 1.9.6
ACLOCAL_AMFLAGS = -I m4 --install

MSVCFILES = msvc_ver.inc buildconf.bat
MSVCFILES = buildconf.bat

# adig and ahost are just sample programs and thus not mentioned with the
# regular sources and headers
Expand Down
29 changes: 17 additions & 12 deletions deps/cares/Makefile.dj
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,14 @@
#
include src/lib/Makefile.inc

CSOURCES := $(addprefix src/lib/, $(CSOURCES))
CSOURCES := $(filter-out src/lib/windows_port.c, $(CSOURCES))
OBJ_DIR = djgpp
OBJECTS = $(addprefix $(OBJ_DIR)/, \
$(CSOURCES:.c=.o))

CSRC = $(addprefix src/lib/, $(CSOURCES))
#CSRC := $(filter-out src/lib/windows_port.c, $(CSOURCES))

OBJ_SUBDIRS = $(OBJ_DIR)/dsa $(OBJ_DIR)/event $(OBJ_DIR)/legacy $(OBJ_DIR)/record $(OBJ_DIR)/str $(OBJ_DIR)/util

VPATH = src/lib src/tools

Expand All @@ -17,8 +23,6 @@ VPATH = src/lib src/tools
WATT32_ROOT = $(realpath $(WATT_ROOT))
WATT32_LIB = $(WATT32_ROOT)/lib/libwatt.a

OBJ_DIR = djgpp

CFLAGS = -g -O2 -I./include -I./src/lib \
-I$(WATT32_ROOT)/inc \
-Wall \
Expand Down Expand Up @@ -82,17 +86,14 @@ else
CC = gcc
endif

OBJECTS = $(addprefix $(OBJ_DIR)/, \
$(notdir $(CSOURCES:.c=.o)))

GENERATED = src/lib/ares_config.h \
include/ares_build.h

TARGETS = libcares.a adig.exe ahost.exe

.SECONDARY: $(OBJ_DIR)/ares_getopt.o

all: $(OBJ_DIR) $(GENERATED) $(TARGETS)
all: $(OBJ_DIR) $(OBJ_SUBDIRS) $(GENERATED) $(TARGETS)
@echo Welcome to c-ares.

libcares.a: $(OBJECTS)
Expand All @@ -111,15 +112,19 @@ include/ares_build.h: include/ares_build.h.dist
#
clean:
- rm -f depend.dj $(GENERATED) $(OBJ_DIR)/*.o
- rmdir $(OBJ_DIR)
- rmdir $(OBJ_SUBDIRS)

# Clean everything
#
realclean vclean: clean
- rm -f $(TARGETS) $(TARGETS:.exe=.map)

$(OBJ_DIR):
- mkdir $@
.PHONY: obj_subdirs $(OBJ_SUBDIRS)

obj_subdirs: $(OBJ_SUBDIRS)

$(OBJ_SUBDIRS):
mkdir $@

$(OBJ_DIR)/%.o: %.c
$(CC) $(CFLAGS) -o $@ -c $<
Expand All @@ -138,7 +143,7 @@ DEP_REPLACE = sed -e 's@\(.*\)\.o: @\n$$(OBJ_DIR)\/\1.o: @' \
# a foreign 'curl_config.h' is making trouble.
#
depend: $(GENERATED) Makefile.dj
$(CC) -MM $(CFLAGS) $(CSOURCES) | $(DEP_REPLACE) > depend.dj
$(CC) -MM $(CFLAGS) $(CSRC) | $(DEP_REPLACE) > depend.dj

-include depend.dj

Loading

0 comments on commit 869da20

Please sign in to comment.