1 ################################################################################
5 ################################################################################
7 LIBCURL_VERSION = 7.56.1
8 LIBCURL_SOURCE = curl-$(LIBCURL_VERSION).tar.xz
9 LIBCURL_SITE = https://curl.haxx.se/download
10 LIBCURL_DEPENDENCIES = host-pkgconf \
11 $(if $(BR2_PACKAGE_ZLIB),zlib) \
12 $(if $(BR2_PACKAGE_LIBIDN),libidn) \
13 $(if $(BR2_PACKAGE_RTMPDUMP),rtmpdump)
14 LIBCURL_LICENSE = curl
15 LIBCURL_LICENSE_FILES = COPYING
16 LIBCURL_INSTALL_STAGING = YES
18 # We disable NTLM support because it uses fork(), which doesn't work
19 # on non-MMU platforms. Moreover, this authentication method is
20 # probably almost never used. See
21 # http://curl.haxx.se/docs/manpage.html#--ntlm.
22 LIBCURL_CONF_OPTS = --disable-manual --disable-ntlm-wb \
23 --enable-hidden-symbols --with-random=/dev/urandom --disable-curldebug
25 ifeq ($(BR2_TOOLCHAIN_HAS_THREADS),y)
26 LIBCURL_CONF_OPTS += --enable-threaded-resolver
28 LIBCURL_CONF_OPTS += --disable-threaded-resolver
31 ifeq ($(BR2_PACKAGE_LIBCURL_VERBOSE),y)
32 LIBCURL_CONF_OPTS += --enable-verbose
34 LIBCURL_CONF_OPTS += --disable-verbose
37 LIBCURL_CONFIG_SCRIPTS = curl-config
39 ifeq ($(BR2_PACKAGE_OPENSSL),y)
40 LIBCURL_DEPENDENCIES += openssl
41 LIBCURL_CONF_ENV += ac_cv_lib_crypto_CRYPTO_lock=yes
42 # configure adds the cross openssl dir to LD_LIBRARY_PATH which screws up
43 # native stuff during the rest of configure when target == host.
44 # Fix it by setting LD_LIBRARY_PATH to something sensible so those libs
46 LIBCURL_CONF_ENV += LD_LIBRARY_PATH=$(if $(LD_LIBRARY_PATH),$(LD_LIBRARY_PATH):)/lib:/usr/lib
47 LIBCURL_CONF_OPTS += --with-ssl=$(STAGING_DIR)/usr \
48 --with-ca-path=/etc/ssl/certs
49 else ifeq ($(BR2_PACKAGE_GNUTLS),y)
50 LIBCURL_CONF_OPTS += --with-gnutls=$(STAGING_DIR)/usr
51 LIBCURL_DEPENDENCIES += gnutls
52 else ifeq ($(BR2_PACKAGE_LIBNSS),y)
53 LIBCURL_CONF_OPTS += --with-nss=$(STAGING_DIR)/usr
54 LIBCURL_CONF_ENV += CPPFLAGS="$(TARGET_CPPFLAGS) `$(PKG_CONFIG_HOST_BINARY) nspr nss --cflags`"
55 LIBCURL_DEPENDENCIES += libnss
56 else ifeq ($(BR2_PACKAGE_MBEDTLS),y)
57 LIBCURL_CONF_OPTS += --with-mbedtls=$(STAGING_DIR)/usr
58 LIBCURL_DEPENDENCIES += mbedtls
60 LIBCURL_CONF_OPTS += --without-ssl --without-gnutls \
61 --without-polarssl --without-nss --without-mbedtls
64 ifeq ($(BR2_PACKAGE_C_ARES),y)
65 LIBCURL_DEPENDENCIES += c-ares
66 LIBCURL_CONF_OPTS += --enable-ares
68 LIBCURL_CONF_OPTS += --disable-ares
71 # Configure curl to support libssh2
72 ifeq ($(BR2_PACKAGE_LIBSSH2),y)
73 LIBCURL_DEPENDENCIES += libssh2
74 LIBCURL_CONF_OPTS += --with-libssh2
76 LIBCURL_CONF_OPTS += --without-libssh2
79 define LIBCURL_FIX_DOT_PC
80 printf 'Requires: openssl\n' >>$(@D)/libcurl.pc.in
82 LIBCURL_POST_PATCH_HOOKS += $(if $(BR2_PACKAGE_OPENSSL),LIBCURL_FIX_DOT_PC)
84 ifeq ($(BR2_PACKAGE_CURL),)
85 define LIBCURL_TARGET_CLEANUP
86 rm -rf $(TARGET_DIR)/usr/bin/curl
88 LIBCURL_POST_INSTALL_TARGET_HOOKS += LIBCURL_TARGET_CLEANUP
91 $(eval $(autotools-package))