libcurl.mk 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  1. ################################################################################
  2. #
  3. # libcurl
  4. #
  5. ################################################################################
  6. LIBCURL_VERSION = 8.14.1
  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_BEARSSL),y)
  60. LIBCURL_CONF_OPTS += --with-bearssl=$(STAGING_DIR)/usr
  61. LIBCURL_DEPENDENCIES += bearssl
  62. else
  63. LIBCURL_CONF_OPTS += --without-bearssl
  64. endif
  65. ifeq ($(BR2_PACKAGE_LIBCURL_GNUTLS),y)
  66. LIBCURL_CONF_OPTS += --with-gnutls=$(STAGING_DIR)/usr \
  67. --with-ca-fallback
  68. LIBCURL_DEPENDENCIES += gnutls
  69. else
  70. LIBCURL_CONF_OPTS += --without-gnutls
  71. endif
  72. ifeq ($(BR2_PACKAGE_LIBCURL_MBEDTLS),y)
  73. LIBCURL_CONF_OPTS += --with-mbedtls=$(STAGING_DIR)/usr
  74. LIBCURL_DEPENDENCIES += mbedtls
  75. else
  76. LIBCURL_CONF_OPTS += --without-mbedtls
  77. endif
  78. ifeq ($(BR2_PACKAGE_LIBCURL_WOLFSSL),y)
  79. LIBCURL_CONF_OPTS += --with-wolfssl=$(STAGING_DIR)/usr
  80. LIBCURL_CONF_OPTS += --with-ca-bundle=/etc/ssl/certs/ca-certificates.crt
  81. LIBCURL_DEPENDENCIES += wolfssl
  82. else
  83. LIBCURL_CONF_OPTS += --without-wolfssl
  84. endif
  85. ifeq ($(BR2_PACKAGE_C_ARES),y)
  86. LIBCURL_DEPENDENCIES += c-ares
  87. LIBCURL_CONF_OPTS += --enable-ares
  88. else
  89. LIBCURL_CONF_OPTS += --disable-ares
  90. endif
  91. ifeq ($(BR2_PACKAGE_LIBIDN2),y)
  92. LIBCURL_DEPENDENCIES += libidn2
  93. LIBCURL_CONF_OPTS += --with-libidn2
  94. else
  95. LIBCURL_CONF_OPTS += --without-libidn2
  96. endif
  97. ifeq ($(BR2_PACKAGE_LIBPSL),y)
  98. LIBCURL_DEPENDENCIES += libpsl
  99. LIBCURL_CONF_OPTS += --with-libpsl
  100. else
  101. LIBCURL_CONF_OPTS += --without-libpsl
  102. endif
  103. # Configure curl to support libssh2
  104. ifeq ($(BR2_PACKAGE_LIBSSH2),y)
  105. LIBCURL_DEPENDENCIES += libssh2
  106. LIBCURL_CONF_OPTS += --with-libssh2
  107. else
  108. LIBCURL_CONF_OPTS += --without-libssh2
  109. endif
  110. ifeq ($(BR2_PACKAGE_BROTLI),y)
  111. LIBCURL_DEPENDENCIES += brotli
  112. LIBCURL_CONF_OPTS += --with-brotli
  113. else
  114. LIBCURL_CONF_OPTS += --without-brotli
  115. endif
  116. ifeq ($(BR2_PACKAGE_NGHTTP2),y)
  117. LIBCURL_DEPENDENCIES += nghttp2
  118. LIBCURL_CONF_OPTS += --with-nghttp2
  119. else
  120. LIBCURL_CONF_OPTS += --without-nghttp2
  121. endif
  122. ifeq ($(BR2_PACKAGE_LIBGSASL),y)
  123. LIBCURL_DEPENDENCIES += libgsasl
  124. LIBCURL_CONF_OPTS += --with-libgsasl
  125. else
  126. LIBCURL_CONF_OPTS += --without-libgsasl
  127. endif
  128. ifeq ($(BR2_PACKAGE_LIBCURL_COOKIES_SUPPORT),y)
  129. LIBCURL_CONF_OPTS += --enable-cookies
  130. else
  131. LIBCURL_CONF_OPTS += --disable-cookies
  132. endif
  133. ifeq ($(BR2_PACKAGE_LIBCURL_PROXY_SUPPORT),y)
  134. LIBCURL_CONF_OPTS += --enable-proxy
  135. else
  136. LIBCURL_CONF_OPTS += --disable-proxy
  137. endif
  138. ifeq ($(BR2_PACKAGE_LIBCURL_WEBSOCKETS_SUPPORT),y)
  139. LIBCURL_CONF_OPTS += --enable-websockets
  140. else
  141. LIBCURL_CONF_OPTS += --disable-websockets
  142. endif
  143. ifeq ($(BR2_PACKAGE_LIBCURL_EXTRA_PROTOCOLS_FEATURES),y)
  144. LIBCURL_CONF_OPTS += \
  145. --enable-dict \
  146. --enable-gopher \
  147. --enable-imap \
  148. --enable-pop3 \
  149. --enable-rtsp \
  150. --enable-smb \
  151. --enable-smtp \
  152. --enable-telnet \
  153. --enable-tftp
  154. else
  155. LIBCURL_CONF_OPTS += \
  156. --disable-dict \
  157. --disable-gopher \
  158. --disable-imap \
  159. --disable-pop3 \
  160. --disable-rtsp \
  161. --disable-smb \
  162. --disable-smtp \
  163. --disable-telnet \
  164. --disable-tftp
  165. endif
  166. ifeq ($(BR2_PACKAGE_LIBCURL_CURL),)
  167. define LIBCURL_TARGET_CLEANUP
  168. rm -rf $(TARGET_DIR)/usr/bin/curl
  169. endef
  170. LIBCURL_POST_INSTALL_TARGET_HOOKS += LIBCURL_TARGET_CLEANUP
  171. endif
  172. $(eval $(autotools-package))