libcurl.mk 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  1. ################################################################################
  2. #
  3. # libcurl
  4. #
  5. ################################################################################
  6. LIBCURL_VERSION = 8.13.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. # We disable NTLM delegation to winbinds ntlm_auth ('--disable-ntlm-wb')
  17. # support because it uses fork(), which doesn't work on non-MMU platforms.
  18. # Moreover, this authentication method is probably almost never used (see
  19. # https://curl.se/docs/manpage.html#--ntlm), so disable NTLM support overall.
  20. #
  21. # Likewise, there is no compiler on the target, so libcurl-option (to
  22. # generate C code) isn't very useful
  23. LIBCURL_CONF_OPTS = \
  24. --disable-manual \
  25. --disable-ntlm \
  26. --disable-ntlm-wb \
  27. --with-random=/dev/urandom \
  28. --disable-curldebug \
  29. --disable-libcurl-option \
  30. --disable-ldap \
  31. --disable-ldaps
  32. # Only affects Nest products.
  33. # https://nvd.nist.gov/vuln/detail/CVE-2024-32928
  34. LIBCURL_IGNORE_CVES += CVE-2024-32928
  35. ifeq ($(BR2_TOOLCHAIN_HAS_THREADS),y)
  36. LIBCURL_CONF_OPTS += --enable-threaded-resolver
  37. else
  38. LIBCURL_CONF_OPTS += --disable-threaded-resolver
  39. endif
  40. ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y)
  41. LIBCURL_CONF_OPTS += LIBS=-latomic
  42. endif
  43. ifeq ($(BR2_TOOLCHAIN_HAS_SYNC_1),)
  44. # Even though stdatomic.h does exist, link fails for __atomic_exchange_1
  45. # Work around this by pretending atomics aren't available.
  46. LIBCURL_CONF_ENV += ac_cv_header_stdatomic_h=no
  47. endif
  48. ifeq ($(BR2_PACKAGE_LIBCURL_VERBOSE),y)
  49. LIBCURL_CONF_OPTS += --enable-verbose
  50. else
  51. LIBCURL_CONF_OPTS += --disable-verbose
  52. endif
  53. LIBCURL_CONFIG_SCRIPTS = curl-config
  54. ifeq ($(BR2_PACKAGE_LIBCURL_TLS_NONE),y)
  55. LIBCURL_CONF_OPTS += --without-ssl
  56. endif
  57. ifeq ($(BR2_PACKAGE_LIBCURL_OPENSSL),y)
  58. LIBCURL_DEPENDENCIES += openssl
  59. LIBCURL_CONF_OPTS += --with-openssl=$(STAGING_DIR)/usr \
  60. --with-ca-path=/etc/ssl/certs
  61. else
  62. LIBCURL_CONF_OPTS += --without-openssl
  63. endif
  64. ifeq ($(BR2_PACKAGE_LIBCURL_BEARSSL),y)
  65. LIBCURL_CONF_OPTS += --with-bearssl=$(STAGING_DIR)/usr
  66. LIBCURL_DEPENDENCIES += bearssl
  67. else
  68. LIBCURL_CONF_OPTS += --without-bearssl
  69. endif
  70. ifeq ($(BR2_PACKAGE_LIBCURL_GNUTLS),y)
  71. LIBCURL_CONF_OPTS += --with-gnutls=$(STAGING_DIR)/usr \
  72. --with-ca-fallback
  73. LIBCURL_DEPENDENCIES += gnutls
  74. else
  75. LIBCURL_CONF_OPTS += --without-gnutls
  76. endif
  77. ifeq ($(BR2_PACKAGE_LIBCURL_MBEDTLS),y)
  78. LIBCURL_CONF_OPTS += --with-mbedtls=$(STAGING_DIR)/usr
  79. LIBCURL_DEPENDENCIES += mbedtls
  80. else
  81. LIBCURL_CONF_OPTS += --without-mbedtls
  82. endif
  83. ifeq ($(BR2_PACKAGE_LIBCURL_WOLFSSL),y)
  84. LIBCURL_CONF_OPTS += --with-wolfssl=$(STAGING_DIR)/usr
  85. LIBCURL_CONF_OPTS += --with-ca-bundle=/etc/ssl/certs/ca-certificates.crt
  86. LIBCURL_DEPENDENCIES += wolfssl
  87. else
  88. LIBCURL_CONF_OPTS += --without-wolfssl
  89. endif
  90. ifeq ($(BR2_PACKAGE_C_ARES),y)
  91. LIBCURL_DEPENDENCIES += c-ares
  92. LIBCURL_CONF_OPTS += --enable-ares
  93. else
  94. LIBCURL_CONF_OPTS += --disable-ares
  95. endif
  96. ifeq ($(BR2_PACKAGE_LIBIDN2),y)
  97. LIBCURL_DEPENDENCIES += libidn2
  98. LIBCURL_CONF_OPTS += --with-libidn2
  99. else
  100. LIBCURL_CONF_OPTS += --without-libidn2
  101. endif
  102. ifeq ($(BR2_PACKAGE_LIBPSL),y)
  103. LIBCURL_DEPENDENCIES += libpsl
  104. LIBCURL_CONF_OPTS += --with-libpsl
  105. else
  106. LIBCURL_CONF_OPTS += --without-libpsl
  107. endif
  108. # Configure curl to support libssh2
  109. ifeq ($(BR2_PACKAGE_LIBSSH2),y)
  110. LIBCURL_DEPENDENCIES += libssh2
  111. LIBCURL_CONF_OPTS += --with-libssh2
  112. else
  113. LIBCURL_CONF_OPTS += --without-libssh2
  114. endif
  115. ifeq ($(BR2_PACKAGE_BROTLI),y)
  116. LIBCURL_DEPENDENCIES += brotli
  117. LIBCURL_CONF_OPTS += --with-brotli
  118. else
  119. LIBCURL_CONF_OPTS += --without-brotli
  120. endif
  121. ifeq ($(BR2_PACKAGE_NGHTTP2),y)
  122. LIBCURL_DEPENDENCIES += nghttp2
  123. LIBCURL_CONF_OPTS += --with-nghttp2
  124. else
  125. LIBCURL_CONF_OPTS += --without-nghttp2
  126. endif
  127. ifeq ($(BR2_PACKAGE_LIBGSASL),y)
  128. LIBCURL_DEPENDENCIES += libgsasl
  129. LIBCURL_CONF_OPTS += --with-libgsasl
  130. else
  131. LIBCURL_CONF_OPTS += --without-libgsasl
  132. endif
  133. ifeq ($(BR2_PACKAGE_LIBCURL_COOKIES_SUPPORT),y)
  134. LIBCURL_CONF_OPTS += --enable-cookies
  135. else
  136. LIBCURL_CONF_OPTS += --disable-cookies
  137. endif
  138. ifeq ($(BR2_PACKAGE_LIBCURL_PROXY_SUPPORT),y)
  139. LIBCURL_CONF_OPTS += --enable-proxy
  140. else
  141. LIBCURL_CONF_OPTS += --disable-proxy
  142. endif
  143. ifeq ($(BR2_PACKAGE_LIBCURL_WEBSOCKETS_SUPPORT),y)
  144. LIBCURL_CONF_OPTS += --enable-websockets
  145. else
  146. LIBCURL_CONF_OPTS += --disable-websockets
  147. endif
  148. ifeq ($(BR2_PACKAGE_LIBCURL_EXTRA_PROTOCOLS_FEATURES),y)
  149. LIBCURL_CONF_OPTS += \
  150. --enable-dict \
  151. --enable-gopher \
  152. --enable-imap \
  153. --enable-pop3 \
  154. --enable-rtsp \
  155. --enable-smb \
  156. --enable-smtp \
  157. --enable-telnet \
  158. --enable-tftp
  159. else
  160. LIBCURL_CONF_OPTS += \
  161. --disable-dict \
  162. --disable-gopher \
  163. --disable-imap \
  164. --disable-pop3 \
  165. --disable-rtsp \
  166. --disable-smb \
  167. --disable-smtp \
  168. --disable-telnet \
  169. --disable-tftp
  170. endif
  171. ifeq ($(BR2_PACKAGE_LIBCURL_CURL),)
  172. define LIBCURL_TARGET_CLEANUP
  173. rm -rf $(TARGET_DIR)/usr/bin/curl
  174. endef
  175. LIBCURL_POST_INSTALL_TARGET_HOOKS += LIBCURL_TARGET_CLEANUP
  176. endif
  177. $(eval $(autotools-package))