libcurl: use c-ares if available
authorJohn Keeping <john@keeping.me.uk>
Sat, 2 May 2015 10:58:18 +0000 (11:58 +0100)
committerPeter Korsgaard <peter@korsgaard.com>
Sun, 3 May 2015 17:25:24 +0000 (19:25 +0200)
By default libcurl uses the C library's DNS resolver which is
synchronous, even if an application is using libcurl's non-blocking mode
of operation.

Configure libcurl to use c-ares if it is selected so that it can resolve
addresses asynchronously if required.

[Peter: explicitly disable c-ares support if not enabled]
Signed-off-by: John Keeping <john@keeping.me.uk>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
package/libcurl/libcurl.mk

index f0d7bacaaa1c6eeb2f0d431b5ce744f29ae15b64..0ce2dfd7deab7fa5c2b1a0255ca642c0cd2701d9 100644 (file)
@@ -46,6 +46,13 @@ LIBCURL_CONF_OPTS += --without-ssl --without-gnutls \
        --without-polarssl --without-nss
 endif
 
+ifeq ($(BR2_PACKAGE_C_ARES),y)
+LIBCURL_DEPENDENCIES += c-ares
+LIBCURL_CONF_OPTS += --enable-ares
+else
+LIBCURL_CONF_OPTS += --disable-ares
+endif
+
 # Configure curl to support libssh2
 ifeq ($(BR2_PACKAGE_LIBSSH2),y)
 LIBCURL_DEPENDENCIES += libssh2