libcurl.mk 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. ################################################################################
  2. #
  3. # libcurl
  4. #
  5. ################################################################################
  6. LIBCURL_VERSION = 8.8.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. ifeq ($(BR2_TOOLCHAIN_HAS_THREADS),y)
  33. LIBCURL_CONF_OPTS += --enable-threaded-resolver
  34. else
  35. LIBCURL_CONF_OPTS += --disable-threaded-resolver
  36. endif
  37. ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y)
  38. LIBCURL_CONF_OPTS += LIBS=-latomic
  39. endif
  40. ifeq ($(BR2_TOOLCHAIN_HAS_SYNC_1),)
  41. # Even though stdatomic.h does exist, link fails for __atomic_exchange_1
  42. # Work around this by pretending atomics aren't available.
  43. LIBCURL_CONF_ENV += ac_cv_header_stdatomic_h=no
  44. endif
  45. ifeq ($(BR2_PACKAGE_LIBCURL_VERBOSE),y)
  46. LIBCURL_CONF_OPTS += --enable-verbose
  47. else
  48. LIBCURL_CONF_OPTS += --disable-verbose
  49. endif
  50. LIBCURL_CONFIG_SCRIPTS = curl-config
  51. ifeq ($(BR2_PACKAGE_LIBCURL_TLS_NONE),y)
  52. LIBCURL_CONF_OPTS += --without-ssl
  53. endif
  54. ifeq ($(BR2_PACKAGE_LIBCURL_OPENSSL),y)
  55. LIBCURL_DEPENDENCIES += openssl
  56. LIBCURL_CONF_OPTS += --with-openssl=$(STAGING_DIR)/usr \
  57. --with-ca-path=/etc/ssl/certs
  58. else
  59. LIBCURL_CONF_OPTS += --without-openssl
  60. endif
  61. ifeq ($(BR2_PACKAGE_LIBCURL_BEARSSL),y)
  62. LIBCURL_CONF_OPTS += --with-bearssl=$(STAGING_DIR)/usr
  63. LIBCURL_DEPENDENCIES += bearssl
  64. else
  65. LIBCURL_CONF_OPTS += --without-bearssl
  66. endif
  67. ifeq ($(BR2_PACKAGE_LIBCURL_GNUTLS),y)
  68. LIBCURL_CONF_OPTS += --with-gnutls=$(STAGING_DIR)/usr \
  69. --with-ca-fallback
  70. LIBCURL_DEPENDENCIES += gnutls
  71. else
  72. LIBCURL_CONF_OPTS += --without-gnutls
  73. endif
  74. ifeq ($(BR2_PACKAGE_LIBCURL_MBEDTLS),y)
  75. LIBCURL_CONF_OPTS += --with-mbedtls=$(STAGING_DIR)/usr
  76. LIBCURL_DEPENDENCIES += mbedtls
  77. else
  78. LIBCURL_CONF_OPTS += --without-mbedtls
  79. endif
  80. ifeq ($(BR2_PACKAGE_LIBCURL_WOLFSSL),y)
  81. LIBCURL_CONF_OPTS += --with-wolfssl=$(STAGING_DIR)/usr
  82. LIBCURL_CONF_OPTS += --with-ca-bundle=/etc/ssl/certs/ca-certificates.crt
  83. LIBCURL_DEPENDENCIES += wolfssl
  84. else
  85. LIBCURL_CONF_OPTS += --without-wolfssl
  86. endif
  87. ifeq ($(BR2_PACKAGE_C_ARES),y)
  88. LIBCURL_DEPENDENCIES += c-ares
  89. LIBCURL_CONF_OPTS += --enable-ares
  90. else
  91. LIBCURL_CONF_OPTS += --disable-ares
  92. endif
  93. ifeq ($(BR2_PACKAGE_LIBIDN2),y)
  94. LIBCURL_DEPENDENCIES += libidn2
  95. LIBCURL_CONF_OPTS += --with-libidn2
  96. else
  97. LIBCURL_CONF_OPTS += --without-libidn2
  98. endif
  99. ifeq ($(BR2_PACKAGE_LIBPSL),y)
  100. LIBCURL_DEPENDENCIES += libpsl
  101. LIBCURL_CONF_OPTS += --with-libpsl
  102. else
  103. LIBCURL_CONF_OPTS += --without-libpsl
  104. endif
  105. # Configure curl to support libssh2
  106. ifeq ($(BR2_PACKAGE_LIBSSH2),y)
  107. LIBCURL_DEPENDENCIES += libssh2
  108. LIBCURL_CONF_OPTS += --with-libssh2
  109. else
  110. LIBCURL_CONF_OPTS += --without-libssh2
  111. endif
  112. ifeq ($(BR2_PACKAGE_BROTLI),y)
  113. LIBCURL_DEPENDENCIES += brotli
  114. LIBCURL_CONF_OPTS += --with-brotli
  115. else
  116. LIBCURL_CONF_OPTS += --without-brotli
  117. endif
  118. ifeq ($(BR2_PACKAGE_NGHTTP2),y)
  119. LIBCURL_DEPENDENCIES += nghttp2
  120. LIBCURL_CONF_OPTS += --with-nghttp2
  121. else
  122. LIBCURL_CONF_OPTS += --without-nghttp2
  123. endif
  124. ifeq ($(BR2_PACKAGE_LIBGSASL),y)
  125. LIBCURL_DEPENDENCIES += libgsasl
  126. LIBCURL_CONF_OPTS += --with-libgsasl
  127. else
  128. LIBCURL_CONF_OPTS += --without-libgsasl
  129. endif
  130. ifeq ($(BR2_PACKAGE_LIBCURL_COOKIES_SUPPORT),y)
  131. LIBCURL_CONF_OPTS += --enable-cookies
  132. else
  133. LIBCURL_CONF_OPTS += --disable-cookies
  134. endif
  135. ifeq ($(BR2_PACKAGE_LIBCURL_PROXY_SUPPORT),y)
  136. LIBCURL_CONF_OPTS += --enable-proxy
  137. else
  138. LIBCURL_CONF_OPTS += --disable-proxy
  139. endif
  140. ifeq ($(BR2_PACKAGE_LIBCURL_WEBSOCKETS_SUPPORT),y)
  141. LIBCURL_CONF_OPTS += --enable-websockets
  142. else
  143. LIBCURL_CONF_OPTS += --disable-websockets
  144. endif
  145. ifeq ($(BR2_PACKAGE_LIBCURL_EXTRA_PROTOCOLS_FEATURES),y)
  146. LIBCURL_CONF_OPTS += \
  147. --enable-dict \
  148. --enable-gopher \
  149. --enable-imap \
  150. --enable-pop3 \
  151. --enable-rtsp \
  152. --enable-smb \
  153. --enable-smtp \
  154. --enable-telnet \
  155. --enable-tftp
  156. else
  157. LIBCURL_CONF_OPTS += \
  158. --disable-dict \
  159. --disable-gopher \
  160. --disable-imap \
  161. --disable-pop3 \
  162. --disable-rtsp \
  163. --disable-smb \
  164. --disable-smtp \
  165. --disable-telnet \
  166. --disable-tftp
  167. endif
  168. define LIBCURL_FIX_DOT_PC
  169. printf 'Requires: openssl\n' >>$(@D)/libcurl.pc.in
  170. endef
  171. LIBCURL_POST_PATCH_HOOKS += $(if $(BR2_PACKAGE_LIBCURL_OPENSSL),LIBCURL_FIX_DOT_PC)
  172. ifeq ($(BR2_PACKAGE_LIBCURL_CURL),)
  173. define LIBCURL_TARGET_CLEANUP
  174. rm -rf $(TARGET_DIR)/usr/bin/curl
  175. endef
  176. LIBCURL_POST_INSTALL_TARGET_HOOKS += LIBCURL_TARGET_CLEANUP
  177. endif
  178. $(eval $(autotools-package))