libcurl.mk 2.5 KB

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