summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt8
-rw-r--r--apt-pkg/CMakeLists.txt2
-rw-r--r--methods/CMakeLists.txt2
3 files changed, 10 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 08e431740..8c41534ad 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -143,6 +143,14 @@ if (NOT HAVE_SIGHANDLER_T)
endif()
endif()
+# Handle resolving
+check_function_exists(res_init HAVE_LIBC_RESOLV)
+if(HAVE_LIBC_RESOLV)
+ set(RESOLV_LIBRARIES)
+else()
+ set(RESOLV_LIBRARIES -lresolv)
+endif()
+
# Configure some variables like package, version and architecture.
set(PACKAGE ${PROJECT_NAME})
set(PACKAGE_MAIL "APT Development Team <deity@lists.debian.org>")
diff --git a/apt-pkg/CMakeLists.txt b/apt-pkg/CMakeLists.txt
index 9bbc6bd98..3f85bc143 100644
--- a/apt-pkg/CMakeLists.txt
+++ b/apt-pkg/CMakeLists.txt
@@ -30,7 +30,7 @@ target_include_directories(apt-pkg
${LZMA_INCLUDE_DIRS}
${LZ4_INCLUDE_DIRS})
target_link_libraries(apt-pkg
- PRIVATE -lutil ${CMAKE_DL_LIBS} -lresolv
+ PRIVATE -lutil ${CMAKE_DL_LIBS} ${RESOLV_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT}
${ZLIB_LIBRARIES}
${BZIP2_LIBRARIES}
diff --git a/methods/CMakeLists.txt b/methods/CMakeLists.txt
index 2417c4dc1..82ae70e7d 100644
--- a/methods/CMakeLists.txt
+++ b/methods/CMakeLists.txt
@@ -21,7 +21,7 @@ target_link_libraries(store apt-pkg)
target_link_libraries(gpgv apt-pkg)
target_link_libraries(cdrom apt-pkg)
target_link_libraries(http apt-pkg)
-target_link_libraries(mirror apt-pkg -lresolv)
+target_link_libraries(mirror apt-pkg ${RESOLV_LIBRARIES})
target_link_libraries(https apt-pkg ${CURL_LIBRARIES})
target_link_libraries(ftp apt-pkg)
target_link_libraries(rred apt-pkg)