1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-12 14:14:48 +02:00

core: check if res_init requires linking with libresolv

This commit is contained in:
Albert Lee
2025-05-16 01:51:38 +00:00
committed by Sébastien Helleu
parent 69d3787b5e
commit e98a32373e
2 changed files with 11 additions and 5 deletions
+11
View File
@@ -208,6 +208,7 @@ include(FindPkgConfig)
include(CheckIncludeFiles)
include(CheckFunctionExists)
include(CheckSymbolExists)
include(CheckLibraryExists)
check_include_files("langinfo.h" HAVE_LANGINFO_CODESET)
check_include_files("sys/resource.h" HAVE_SYS_RESOURCE_H)
@@ -222,6 +223,16 @@ check_symbol_exists("htonll" "sys/types.h;netinet/in.h;inttypes.h" HAVE_HTONLL)
check_symbol_exists("eat_newline_glitch" "term.h" HAVE_EAT_NEWLINE_GLITCH)
# Check if res_init requires libresolv
check_function_exists(res_init, LIBC_HAS_RES_INIT)
if(NOT LIBC_HAS_RES_INIT)
find_library(RESOLV_LIBRARY resolv)
check_library_exists("${RESOLV_LIBRARY}" res_init "" LIBRESOLV_HAS_RES_INIT)
if(LIBRESOLV_HAS_RES_INIT)
list(APPEND EXTRA_LIBS ${RESOLV_LIBRARY})
endif()
endif()
# Check for Large File Support
if(ENABLE_LARGEFILE)
add_definitions(-D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -D_LARGE_FILES)
-5
View File
@@ -53,11 +53,6 @@ if(ENABLE_ZSTD)
list(APPEND EXTRA_LIBS ${LIBZSTD_LDFLAGS})
endif()
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
# link with resolv lib on macOS
list(APPEND EXTRA_LIBS "resolv")
endif()
if(ENABLE_NCURSES)
subdirs(normal)
endif()