Skip to content

Commit

Permalink
ucode: also link libresolv if ns_initparse() is not found
Browse files Browse the repository at this point in the history
Recent glibc versions require linking libresolv to obtain ns_initparse().

Fixes: #144
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
  • Loading branch information
jow- committed Mar 17, 2023
1 parent 8f78aff commit 51f4dba
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion CMakeLists.txt
Expand Up @@ -171,8 +171,9 @@ IF(RESOLV_SUPPORT)
SET_TARGET_PROPERTIES(resolv_lib PROPERTIES OUTPUT_NAME resolv PREFIX "")
TARGET_LINK_OPTIONS(resolv_lib PRIVATE ${UCODE_MODULE_LINK_OPTIONS})
CHECK_FUNCTION_EXISTS(res_mkquery RES_MKQUERY_FUNCTION_EXISTS)
CHECK_FUNCTION_EXISTS(ns_initparse NS_INITARSE_FUNCTION_EXISTS)
CHECK_FUNCTION_EXISTS(clock_gettime CLOCK_GETTIME_FUNCTION_EXISTS)
IF (NOT RES_MKQUERY_FUNCTION_EXISTS)
IF (NOT RES_MKQUERY_FUNCTION_EXISTS OR NOT NS_INITARSE_FUNCTION_EXISTS)
TARGET_LINK_LIBRARIES(resolv_lib resolv)
ENDIF()
IF (NOT CLOCK_GETTIME_FUNCTION_EXISTS)
Expand Down

0 comments on commit 51f4dba

Please sign in to comment.