libcurl.mk 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. ################################################################################
  2. #
  3. # libcurl
  4. #
  5. ################################################################################
  6. LIBCURL_VERSION = 8.15.0
  7. LIBCURL_SOURCE = curl-$(LIBCURL_VERSION).tar.xz
  8. LIBCURL_SITE = https://curl.se/download
  9. LIBCURL_DEPENDENCIES = host-pkgconf \
  10. $(if $(BR2_PACKAGE_ZLIB),zlib) \
  11. $(if $(BR2_PACKAGE_RTMPDUMP),rtmpdump)
  12. LIBCURL_LICENSE = curl
  13. LIBCURL_LICENSE_FILES = COPYING
  14. LIBCURL_CPE_ID_VENDOR = haxx
  15. LIBCURL_INSTALL_STAGING = YES
  16. # Likewise, there is no compiler on the target, so libcurl-option (to
  17. # generate C code) isn't very useful
  18. LIBCURL_CONF_OPTS = \
  19. --disable-manual \
  20. --disable-ntlm \
  21. --disable-curldebug \
  22. --disable-libcurl-option \
  23. --disable-ldap \
  24. --disable-ldaps
  25. # Only affects Nest products.
  26. # https://nvd.nist.gov/vuln/detail/CVE-2024-32928
  27. LIBCURL_IGNORE_CVES += CVE-2024-32928
  28. # threaded resolver cannot be used with c-ares
  29. # https://github.com/curl/curl/commit/d364f1347f05c53eea5d25a15b4ad8a62ecc85b8
  30. ifeq ($(BR2_TOOLCHAIN_HAS_THREADS)x$(BR2_PACKAGE_C_ARES),yx)
  31. LIBCURL_CONF_OPTS += --enable-threaded-resolver
  32. else
  33. LIBCURL_CONF_OPTS += --disable-threaded-resolver
  34. endif
  35. ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y)
  36. LIBCURL_CONF_OPTS += LIBS=-latomic
  37. endif
  38. ifeq ($(BR2_TOOLCHAIN_HAS_SYNC_1),)
  39. # Even though stdatomic.h does exist, link fails for __atomic_exchange_1
  40. # Work around this by pretending atomics aren't available.
  41. LIBCURL_CONF_ENV += ac_cv_header_stdatomic_h=no
  42. endif
  43. ifeq ($(BR2_PACKAGE_LIBCURL_VERBOSE),y)
  44. LIBCURL_CONF_OPTS += --enable-verbose
  45. else
  46. LIBCURL_CONF_OPTS += --disable-verbose
  47. endif
  48. LIBCURL_CONFIG_SCRIPTS = curl-config
  49. ifeq ($(BR2_PACKAGE_LIBCURL_TLS_NONE),y)
  50. LIBCURL_CONF_OPTS += --without-ssl
  51. endif
  52. ifeq ($(BR2_PACKAGE_LIBCURL_OPENSSL),y)
  53. LIBCURL_DEPENDENCIES += openssl
  54. LIBCURL_CONF_OPTS += --with-openssl=$(STAGING_DIR)/usr \
  55. --with-ca-path=/etc/ssl/certs
  56. else
  57. LIBCURL_CONF_OPTS += --without-openssl
  58. endif
  59. ifeq ($(BR2_PACKAGE_LIBCURL_GNUTLS),y)
  60. LIBCURL_CONF_OPTS += --with-gnutls=$(STAGING_DIR)/usr \
  61. --with-ca-fallback
  62. LIBCURL_DEPENDENCIES += gnutls
  63. else
  64. LIBCURL_CONF_OPTS += --without-gnutls
  65. endif
  66. ifeq ($(BR2_PACKAGE_LIBCURL_MBEDTLS),y)
  67. LIBCURL_CONF_OPTS += --with-mbedtls=$(STAGING_DIR)/usr
  68. LIBCURL_DEPENDENCIES += mbedtls
  69. else
  70. LIBCURL_CONF_OPTS += --without-mbedtls
  71. endif
  72. ifeq ($(BR2_PACKAGE_LIBCURL_WOLFSSL),y)
  73. LIBCURL_CONF_OPTS += --with-wolfssl=$(STAGING_DIR)/usr
  74. LIBCURL_CONF_OPTS += --with-ca-bundle=/etc/ssl/certs/ca-certificates.crt
  75. LIBCURL_DEPENDENCIES += wolfssl
  76. else
  77. LIBCURL_CONF_OPTS += --without-wolfssl
  78. endif
  79. ifeq ($(BR2_PACKAGE_C_ARES),y)
  80. LIBCURL_DEPENDENCIES += c-ares
  81. LIBCURL_CONF_OPTS += --enable-ares
  82. else
  83. LIBCURL_CONF_OPTS += --disable-ares
  84. endif
  85. ifeq ($(BR2_PACKAGE_LIBIDN2),y)
  86. LIBCURL_DEPENDENCIES += libidn2
  87. LIBCURL_CONF_OPTS += --with-libidn2
  88. else
  89. LIBCURL_CONF_OPTS += --without-libidn2
  90. endif
  91. ifeq ($(BR2_PACKAGE_LIBPSL),y)
  92. LIBCURL_DEPENDENCIES += libpsl
  93. LIBCURL_CONF_OPTS += --with-libpsl
  94. else
  95. LIBCURL_CONF_OPTS += --without-libpsl
  96. endif
  97. # Configure curl to support libssh2
  98. ifeq ($(BR2_PACKAGE_LIBSSH2),y)
  99. LIBCURL_DEPENDENCIES += libssh2
  100. LIBCURL_CONF_OPTS += --with-libssh2
  101. else
  102. LIBCURL_CONF_OPTS += --without-libssh2
  103. endif
  104. ifeq ($(BR2_PACKAGE_BROTLI),y)
  105. LIBCURL_DEPENDENCIES += brotli
  106. LIBCURL_CONF_OPTS += --with-brotli
  107. else
  108. LIBCURL_CONF_OPTS += --without-brotli
  109. endif
  110. ifeq ($(BR2_PACKAGE_NGHTTP2),y)
  111. LIBCURL_DEPENDENCIES += nghttp2
  112. LIBCURL_CONF_OPTS += --with-nghttp2
  113. else
  114. LIBCURL_CONF_OPTS += --without-nghttp2
  115. endif
  116. ifeq ($(BR2_PACKAGE_LIBGSASL),y)
  117. LIBCURL_DEPENDENCIES += libgsasl
  118. LIBCURL_CONF_OPTS += --with-libgsasl
  119. else
  120. LIBCURL_CONF_OPTS += --without-libgsasl
  121. endif
  122. ifeq ($(BR2_PACKAGE_LIBCURL_COOKIES_SUPPORT),y)
  123. LIBCURL_CONF_OPTS += --enable-cookies
  124. else
  125. LIBCURL_CONF_OPTS += --disable-cookies
  126. endif
  127. ifeq ($(BR2_PACKAGE_LIBCURL_PROXY_SUPPORT),y)
  128. LIBCURL_CONF_OPTS += --enable-proxy
  129. else
  130. LIBCURL_CONF_OPTS += --disable-proxy
  131. endif
  132. ifeq ($(BR2_PACKAGE_LIBCURL_WEBSOCKETS_SUPPORT),y)
  133. LIBCURL_CONF_OPTS += --enable-websockets
  134. else
  135. LIBCURL_CONF_OPTS += --disable-websockets
  136. endif
  137. ifeq ($(BR2_PACKAGE_LIBCURL_EXTRA_PROTOCOLS_FEATURES),y)
  138. LIBCURL_CONF_OPTS += \
  139. --enable-dict \
  140. --enable-gopher \
  141. --enable-imap \
  142. --enable-pop3 \
  143. --enable-rtsp \
  144. --enable-smb \
  145. --enable-smtp \
  146. --enable-telnet \
  147. --enable-tftp
  148. else
  149. LIBCURL_CONF_OPTS += \
  150. --disable-dict \
  151. --disable-gopher \
  152. --disable-imap \
  153. --disable-pop3 \
  154. --disable-rtsp \
  155. --disable-smb \
  156. --disable-smtp \
  157. --disable-telnet \
  158. --disable-tftp
  159. endif
  160. ifeq ($(BR2_PACKAGE_LIBCURL_CURL),)
  161. define LIBCURL_TARGET_CLEANUP
  162. rm -rf $(TARGET_DIR)/usr/bin/curl
  163. endef
  164. LIBCURL_POST_INSTALL_TARGET_HOOKS += LIBCURL_TARGET_CLEANUP
  165. endif
  166. $(eval $(autotools-package))