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:
committed by
Sébastien Helleu
parent
69d3787b5e
commit
e98a32373e
@@ -208,6 +208,7 @@ include(FindPkgConfig)
|
|||||||
include(CheckIncludeFiles)
|
include(CheckIncludeFiles)
|
||||||
include(CheckFunctionExists)
|
include(CheckFunctionExists)
|
||||||
include(CheckSymbolExists)
|
include(CheckSymbolExists)
|
||||||
|
include(CheckLibraryExists)
|
||||||
|
|
||||||
check_include_files("langinfo.h" HAVE_LANGINFO_CODESET)
|
check_include_files("langinfo.h" HAVE_LANGINFO_CODESET)
|
||||||
check_include_files("sys/resource.h" HAVE_SYS_RESOURCE_H)
|
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_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
|
# Check for Large File Support
|
||||||
if(ENABLE_LARGEFILE)
|
if(ENABLE_LARGEFILE)
|
||||||
add_definitions(-D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -D_LARGE_FILES)
|
add_definitions(-D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -D_LARGE_FILES)
|
||||||
|
|||||||
@@ -53,11 +53,6 @@ if(ENABLE_ZSTD)
|
|||||||
list(APPEND EXTRA_LIBS ${LIBZSTD_LDFLAGS})
|
list(APPEND EXTRA_LIBS ${LIBZSTD_LDFLAGS})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
|
||||||
# link with resolv lib on macOS
|
|
||||||
list(APPEND EXTRA_LIBS "resolv")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(ENABLE_NCURSES)
|
if(ENABLE_NCURSES)
|
||||||
subdirs(normal)
|
subdirs(normal)
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
Reference in New Issue
Block a user