]> git.saurik.com Git - apt.git/blobdiff - CMakeLists.txt
CMake: Do not use -lresolv if res_init exists in libc
[apt.git] / CMakeLists.txt
index 08e43174037760058274b6c0dbb3478903f8ebe1..8c41534adac0147d09dbcfa2afa698997f25a002 100644 (file)
@@ -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>")