-
Notifications
You must be signed in to change notification settings - Fork 3.9k
curl: provide build-variants for each TLS implementation #29266
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
| @@ -1,5 +1,3 @@ | ||||||||
| if PACKAGE_libcurl | ||||||||
|
|
||||||||
| comment "SSL support" | ||||||||
|
|
||||||||
| choice | ||||||||
|
|
@@ -8,18 +6,23 @@ choice | |||||||
|
|
||||||||
| config LIBCURL_MBEDTLS | ||||||||
| bool "mbed TLS" | ||||||||
| depends on PACKAGE_libcurl-mbedtls | ||||||||
|
|
||||||||
| config LIBCURL_WOLFSSL | ||||||||
| bool "wolfSSL" | ||||||||
| depends on PACKAGE_libcurl-wolfssl | ||||||||
|
|
||||||||
| config LIBCURL_OPENSSL | ||||||||
| bool "OpenSSL" | ||||||||
| depends on PACKAGE_libcurl-openssl | ||||||||
|
|
||||||||
| config LIBCURL_GNUTLS | ||||||||
| bool "GNUTLS" | ||||||||
| depends on PACKAGE_libcurl-gnutls | ||||||||
|
|
||||||||
| config LIBCURL_NOSSL | ||||||||
| bool "No SSL support" | ||||||||
| depends on PACKAGE_libcurl-nossl | ||||||||
|
|
||||||||
| endchoice | ||||||||
|
|
||||||||
|
|
@@ -64,7 +67,7 @@ config LIBCURL_LDAP | |||||||
|
|
||||||||
| config LIBCURL_LDAPS | ||||||||
| bool "Enable LDAPS support" | ||||||||
| depends on LIBCURL_LDAP && !LIBCURL_NOSSL | ||||||||
| depends on LIBCURL_LDAP | ||||||||
| default y | ||||||||
|
|
||||||||
| config LIBCURL_POP3 | ||||||||
|
|
@@ -75,23 +78,19 @@ config LIBCURL_RTSP | |||||||
| bool "RTSP protocol" | ||||||||
| depends on LIBCURL_HTTP | ||||||||
| default n | ||||||||
| config LIBCURL_NO_RTSP | ||||||||
| string "RTSP require HTTP protocol" | ||||||||
| depends on !LIBCURL_HTTP | ||||||||
| default "!" | ||||||||
| help | ||||||||
| RTSP require HTTP protocol | ||||||||
|
||||||||
| RTSP require HTTP protocol | |
| RTSP requires HTTP protocol |
Copilot
AI
May 1, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SMB can be enabled in Kconfig for TLS backends where it won’t be built (the Makefile later gates SMB to gnutls/openssl via LIBCURL_WITH_SMB). Consider reinstating a dependency that reflects that requirement (e.g., depends on (LIBCURL_GNUTLS || LIBCURL_OPENSSL)) so the menu matches actual capability.
| depends on LIBCURL_CRYPTO_AUTH | |
| depends on LIBCURL_CRYPTO_AUTH && (LIBCURL_GNUTLS || LIBCURL_OPENSSL) |
Copilot
AI
May 1, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix grammar: change 'require' to 'requires' in the SMB help text.
| SMB require 'cryptographic authentication' and either 'GnuTLS' or 'OpenSSL' | |
| SMB requires 'cryptographic authentication' and either 'GnuTLS' or 'OpenSSL' |
Copilot
AI
May 1, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LIBCURL_HTTP3 is now selectable for non-OpenSSL variants, but the Makefile only enables HTTP/3 when $(BUILD_VARIANT) is openssl. Please restore an appropriate dependency (e.g., depends on LIBCURL_OPENSSL) to prevent configurations that cannot take effect.
| bool "HTTP/3 protocol" | |
| bool "HTTP/3 protocol" | |
| depends on LIBCURL_OPENSSL |
Copilot
AI
May 1, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar to LDAPS/SMB/HTTP3, NTLM can now be enabled for the nossl variant even though the Makefile later forces -DCURL_DISABLE_NTLM when LIBCURL_WITH_NTLM is unset. Re-adding the !LIBCURL_NOSSL dependency would keep Kconfig and the build behavior aligned.
| depends on LIBCURL_CRYPTO_AUTH | |
| depends on LIBCURL_CRYPTO_AUTH && !LIBCURL_NOSSL |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -50,9 +50,7 @@ PKG_CONFIG_DEPENDS:= \ | |
| CONFIG_LIBCURL_LDAPS \ | ||
| CONFIG_LIBCURL_POP3 \ | ||
| CONFIG_LIBCURL_RTSP \ | ||
| CONFIG_LIBCURL_NO_RTSP \ | ||
| CONFIG_LIBCURL_SMB \ | ||
| CONFIG_LIBCURL_NO_SMB \ | ||
| CONFIG_LIBCURL_SMTP \ | ||
| CONFIG_LIBCURL_TELNET \ | ||
| CONFIG_LIBCURL_TFTP \ | ||
|
|
@@ -69,45 +67,117 @@ PKG_CONFIG_DEPENDS:= \ | |
| CONFIG_LIBCURL_UNIX_SOCKETS \ | ||
| CONFIG_LIBCURL_VERBOSE \ | ||
| CONFIG_LIBCURL_NTLM \ | ||
| $(if $(CONFIG_LIBCURL_OPENSSL), \ | ||
| $(if $(filter openssl,$(BUILD_VARIANT)), \ | ||
| CONFIG_OPENSSL_ENGINE \ | ||
| CONFIG_OPENSSL_WITH_COMPRESSION \ | ||
| CONFIG_OPENSSL_WITH_NPN) | ||
|
|
||
| include $(INCLUDE_DIR)/package.mk | ||
|
|
||
| define Package/curl/Default | ||
| define Package/curl | ||
| SECTION:=net | ||
| CATEGORY:=Network | ||
| URL:=https://curl.se/ | ||
| MAINTAINER:= | ||
| endef | ||
|
|
||
| define Package/curl | ||
| $(call Package/curl/Default) | ||
| SUBMENU:=File Transfer | ||
| DEPENDS:=+libcurl | ||
| TITLE:=A client-side URL transfer utility | ||
| endef | ||
|
|
||
| define Package/libcurl | ||
| $(call Package/curl/Default) | ||
| define Package/libcurl/Default | ||
| SECTION:=libs | ||
| CATEGORY:=Libraries | ||
| DEPENDS:= +LIBCURL_WOLFSSL:libwolfssl +LIBCURL_OPENSSL:libopenssl +LIBCURL_GNUTLS:libgnutls +LIBCURL_MBEDTLS:libmbedtls | ||
| DEPENDS += +LIBCURL_ZLIB:zlib +LIBCURL_ZSTD:libzstd +LIBCURL_THREADED_RESOLVER:libpthread +LIBCURL_LDAP:libopenldap | ||
| DEPENDS += +LIBCURL_LIBIDN2:libidn2 +LIBCURL_SSH2:libssh2 +LIBCURL_HTTP2:libnghttp2 +LIBCURL_HTTP3:libnghttp3 +LIBCURL_HTTP3:libngtcp2 +ca-bundle | ||
| MAINTAINER:= | ||
| DEPENDS:= +LIBCURL_ZLIB:zlib \ | ||
| +LIBCURL_ZSTD:libzstd \ | ||
| +LIBCURL_THREADED_RESOLVER:libpthread \ | ||
| +LIBCURL_LDAP:libopenldap \ | ||
| +LIBCURL_LIBIDN2:libidn2 \ | ||
| +LIBCURL_SSH2:libssh2 \ | ||
| +LIBCURL_HTTP2:libnghttp2 \ | ||
| +ca-bundle | ||
| TITLE:=A client-side URL transfer library | ||
| MENU:=1 | ||
| ABI_VERSION:=4 | ||
| endef | ||
|
|
||
| define Package/libcurl/config | ||
| source "$(SOURCE)/Config.in" | ||
| define Package/libcurl-nossl | ||
| $(call Package/libcurl/Default) | ||
| PROVIDES:=libcurl | ||
| VARIANT:=nossl | ||
| TITLE+= (No SSL) | ||
| endef | ||
|
Comment on lines
+104
to
+109
|
||
|
|
||
| define Package/libcurl-nossl/config | ||
| if PACKAGE_libcurl-nossl | ||
| source "$(SOURCE)/Config.in" | ||
| endif | ||
| endef | ||
|
|
||
| define Package/libcurl-wolfssl | ||
| $(call Package/libcurl/Default) | ||
| DEPENDS+= +libwolfssl | ||
| PROVIDES:=libcurl | ||
| VARIANT:=wolfssl | ||
| TITLE+= (wolfSSL) | ||
| endef | ||
|
Comment on lines
+117
to
+123
|
||
|
|
||
| define Package/libcurl-wolfssl/config | ||
| if PACKAGE_libcurl-wolfssl | ||
| source "$(SOURCE)/Config.in" | ||
| endif | ||
| endef | ||
|
|
||
| define Package/libcurl-gnutls | ||
| $(call Package/libcurl/Default) | ||
| DEPENDS+= +libgnutls | ||
| PROVIDES:=libcurl | ||
| VARIANT:=gnutls | ||
| TITLE+= (GnuTLS) | ||
| endef | ||
|
Comment on lines
+131
to
137
|
||
|
|
||
| define Package/libcurl-gnutls/config | ||
| if PACKAGE_libcurl-gnutls | ||
| source "$(SOURCE)/Config.in" | ||
| endif | ||
| endef | ||
|
|
||
| define Package/libcurl-openssl | ||
| $(call Package/libcurl/Default) | ||
| DEPENDS+= +libopenssl +LIBCURL_HTTP3:libnghttp3 +LIBCURL_HTTP3:libngtcp2 | ||
| PROVIDES:=libcurl | ||
| VARIANT:=openssl | ||
| TITLE+= (OpenSSL) | ||
| endef | ||
|
Comment on lines
+145
to
+151
|
||
|
|
||
| define Package/libcurl-openssl/config | ||
| if PACKAGE_libcurl-openssl | ||
| source "$(SOURCE)/Config.in" | ||
| endif | ||
| endef | ||
|
|
||
| define Package/libcurl-mbedtls | ||
| $(call Package/libcurl/Default) | ||
| DEPENDS+= +libmbedtls | ||
| PROVIDES:=libcurl | ||
| VARIANT:=mbedtls | ||
| DEFAULT_VARIANT:=1 | ||
| TITLE+= (mbedTLS) | ||
| endef | ||
|
Comment on lines
+104
to
+166
|
||
|
|
||
| define Package/libcurl-mbedtls/config | ||
| if PACKAGE_libcurl-mbedtls | ||
| source "$(SOURCE)/Config.in" | ||
| endif | ||
| endef | ||
|
|
||
| LIBCURL_WITH_HTTP3 := $(if $(filter openssl,$(BUILD_VARIANT)),$(CONFIG_LIBCURL_HTTP3)) | ||
| LIBCURL_WITH_LDAPS := $(if $(filter-out nossl,$(BUILD_VARIANT)),$(CONFIG_LIBCURL_LDAPS)) | ||
| LIBCURL_WITH_SMB := $(if $(filter gnutls openssl,$(BUILD_VARIANT)),$(CONFIG_LIBCURL_SMB)) | ||
| LIBCURL_WITH_NTLM := $(if $(filter-out nossl,$(BUILD_VARIANT)),$(CONFIG_LIBCURL_NTLM)) | ||
|
|
||
| TARGET_CFLAGS += $(FPIC) | ||
| TARGET_CPPFLAGS += $(if $(CONFIG_LIBCURL_NTLM),,-DCURL_DISABLE_NTLM) | ||
| TARGET_CPPFLAGS += $(if $(LIBCURL_WITH_NTLM),,-DCURL_DISABLE_NTLM) | ||
| TARGET_LDFLAGS += -Wl,--gc-sections | ||
|
|
||
| CONFIGURE_ARGS += \ | ||
|
|
@@ -127,18 +197,18 @@ CONFIGURE_ARGS += \ | |
| \ | ||
| $(call autoconf_bool,CONFIG_IPV6,ipv6) \ | ||
| \ | ||
| $(if $(CONFIG_LIBCURL_WOLFSSL)$(CONFIG_LIBCURL_GNUTLS)$(CONFIG_LIBCURL_OPENSSL)$(CONFIG_LIBCURL_MBEDTLS),,--without-ssl) \ | ||
| $(if $(CONFIG_LIBCURL_WOLFSSL),--with-wolfssl="$(STAGING_DIR)/usr",--without-wolfssl) \ | ||
| $(if $(CONFIG_LIBCURL_GNUTLS),--with-gnutls="$(STAGING_DIR)/usr",--without-gnutls) \ | ||
| $(if $(CONFIG_LIBCURL_OPENSSL),--with-openssl="$(STAGING_DIR)/usr",--without-openssl) \ | ||
| $(if $(CONFIG_LIBCURL_MBEDTLS),--with-mbedtls="$(STAGING_DIR)/usr",--without-mbedtls) \ | ||
| $(if $(filter nossl,$(BUILD_VARIANT)),--without-ssl) \ | ||
| $(if $(filter wolfssl,$(BUILD_VARIANT)),--with-wolfssl="$(STAGING_DIR)/usr",--without-wolfssl) \ | ||
| $(if $(filter gnutls,$(BUILD_VARIANT)),--with-gnutls="$(STAGING_DIR)/usr",--without-gnutls) \ | ||
| $(if $(filter openssl,$(BUILD_VARIANT)),--with-openssl="$(STAGING_DIR)/usr",--without-openssl) \ | ||
| $(if $(filter mbedtls,$(BUILD_VARIANT)),--with-mbedtls="$(STAGING_DIR)/usr",--without-mbedtls) \ | ||
| \ | ||
| $(if $(CONFIG_LIBCURL_LIBIDN2),--with-libidn2="$(STAGING_DIR)/usr",--without-libidn2) \ | ||
| $(if $(CONFIG_LIBCURL_SSH2),--with-libssh2="$(STAGING_DIR)/usr",--without-libssh2) \ | ||
| $(if $(CONFIG_LIBCURL_ZLIB),--with-zlib="$(STAGING_DIR)/usr",--without-zlib) \ | ||
| $(if $(CONFIG_LIBCURL_ZSTD),--with-zstd="$(STAGING_DIR)/usr",--without-zstd) \ | ||
| $(if $(CONFIG_LIBCURL_HTTP2),--with-nghttp2="$(STAGING_DIR)/usr",--without-nghttp2) \ | ||
| $(if $(CONFIG_LIBCURL_HTTP3),--with-nghttp3="$(STAGING_DIR)/usr" --with-ngtcp2="$(STAGING_DIR)/usr",--without-nghttp3 --without-ngtcp2) \ | ||
| $(if $(LIBCURL_WITH_HTTP3),--with-nghttp3="$(STAGING_DIR)/usr" --with-ngtcp2="$(STAGING_DIR)/usr",--without-nghttp3 --without-ngtcp2) \ | ||
| \ | ||
| $(call autoconf_bool,CONFIG_LIBCURL_DICT,dict) \ | ||
| $(call autoconf_bool,CONFIG_LIBCURL_FILE,file) \ | ||
|
|
@@ -147,10 +217,10 @@ CONFIGURE_ARGS += \ | |
| $(call autoconf_bool,CONFIG_LIBCURL_HTTP,http) \ | ||
| $(call autoconf_bool,CONFIG_LIBCURL_IMAP,imap) \ | ||
| $(call autoconf_bool,CONFIG_LIBCURL_LDAP,ldap) \ | ||
| $(call autoconf_bool,CONFIG_LIBCURL_LDAPS,ldaps) \ | ||
| $(call autoconf_bool,LIBCURL_WITH_LDAPS,ldaps) \ | ||
| $(call autoconf_bool,CONFIG_LIBCURL_POP3,pop3) \ | ||
| $(call autoconf_bool,CONFIG_LIBCURL_RTSP,rtsp) \ | ||
| $(call autoconf_bool,CONFIG_LIBCURL_SMB,smb) \ | ||
| $(call autoconf_bool,LIBCURL_WITH_SMB,smb) \ | ||
| $(call autoconf_bool,CONFIG_LIBCURL_SMTP,smtp) \ | ||
| $(call autoconf_bool,CONFIG_LIBCURL_TELNET,telnet) \ | ||
| $(call autoconf_bool,CONFIG_LIBCURL_TFTP,tftp) \ | ||
|
|
@@ -187,5 +257,15 @@ define Package/libcurl/install | |
| $(CP) $(PKG_INSTALL_DIR)/usr/lib/libcurl.so.* $(1)/usr/lib/ | ||
| endef | ||
|
|
||
| $(eval $(call BuildPackage,libcurl)) | ||
| Package/libcurl-nossl/install = $(Package/libcurl/install) | ||
| Package/libcurl-wolfssl/install = $(Package/libcurl/install) | ||
| Package/libcurl-gnutls/install = $(Package/libcurl/install) | ||
| Package/libcurl-openssl/install = $(Package/libcurl/install) | ||
| Package/libcurl-mbedtls/install = $(Package/libcurl/install) | ||
|
|
||
| $(eval $(call BuildPackage,libcurl-nossl)) | ||
| $(eval $(call BuildPackage,libcurl-wolfssl)) | ||
| $(eval $(call BuildPackage,libcurl-gnutls)) | ||
| $(eval $(call BuildPackage,libcurl-openssl)) | ||
| $(eval $(call BuildPackage,libcurl-mbedtls)) | ||
| $(eval $(call BuildPackage,curl)) | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LIBCURL_LDAPScan now be enabled even when thelibcurl-nosslvariant is selected, but the Makefile later silently gates LDAPS off fornosslviaLIBCURL_WITH_LDAPS. Restoring the!LIBCURL_NOSSLdependency (or an equivalent constraint) would keep Kconfig consistent with actual build output and avoid “enabled in config but not built” surprises.