summaryrefslogtreecommitdiff
path: root/methods
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2016-08-27 00:31:03 +0200
committerJulian Andres Klode <jak@debian.org>2016-08-27 00:31:03 +0200
commit6a68315e938eb2611806658828ecea86805822e7 (patch)
tree5ff552cf0e6bac9a35bedaf544cb19332663fa70 /methods
parent75d238ba66576c04f257e9d7c0a6995721f1441d (diff)
parent01d207a5076b6fc37a064645b13f2c6550f58b94 (diff)
Merge branch 'portability/freebsd'
Diffstat (limited to 'methods')
-rw-r--r--methods/CMakeLists.txt2
-rw-r--r--methods/connect.cc2
2 files changed, 3 insertions, 1 deletions
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)
diff --git a/methods/connect.cc b/methods/connect.cc
index c819c1dfb..cb2f83588 100644
--- a/methods/connect.cc
+++ b/methods/connect.cc
@@ -180,8 +180,10 @@ static bool ConnectToHostname(std::string const &Host, int const Port,
memset(&Hints,0,sizeof(Hints));
Hints.ai_socktype = SOCK_STREAM;
Hints.ai_flags = 0;
+#ifdef AI_IDN
if (_config->FindB("Acquire::Connect::IDN", true) == true)
Hints.ai_flags |= AI_IDN;
+#endif
// see getaddrinfo(3): only return address if system has such a address configured
// useful if system is ipv4 only, to not get ipv6, but that fails if the system has
// no address configured: e.g. offline and trying to connect to localhost.