Disabling unused protocols in libcurl can save more then 100K, hence add
some build time config options to enable/disable protocols.

Signed-off-by: Helmut Schaa <[email protected]>
---
 libs/curl/Config.in |   60 +++++++++++++++++++++++++++++++++++++++++++++++++++
 libs/curl/Makefile  |   28 ++++++++++++++++--------
 2 files changed, 79 insertions(+), 9 deletions(-)
 create mode 100644 libs/curl/Config.in

diff --git a/libs/curl/Config.in b/libs/curl/Config.in
new file mode 100644
index 0000000..b47286a
--- /dev/null
+++ b/libs/curl/Config.in
@@ -0,0 +1,60 @@
+menu "Configuration"
+       depends on PACKAGE_libcurl
+
+config LIBCURL_ENABLE_FILE
+       bool "Enable FILE support"
+       default y
+
+config LIBCURL_ENABLE_HTTP
+       bool "Enable HTTP support"
+       default y
+
+config LIBCURL_ENABLE_FTP
+       bool "Enable FTP support"
+       default y
+
+config LIBCURL_ENABLE_TFTP
+       bool "Enable TFTP support"
+       default y
+
+config LIBCURL_ENABLE_POP3
+       bool "Enable POP3 support"
+       default n
+
+config LIBCURL_ENABLE_IMAP
+       bool "Enable IMAP support"
+       default n
+
+config LIBCURL_ENABLE_SMTP
+       bool "Enable IMAP support"
+       default n
+
+config LIBCURL_ENABLE_RTSP
+       bool "Enable RTSP support"
+       default n
+
+config LIBCURL_ENABLE_LDAP
+       bool "Enable LDAP support"
+       default n
+
+config LIBCURL_ENABLE_GOPHER
+       bool "Enable Gopher support"
+       default n
+
+config LIBCURL_ENABLE_DICT
+       bool "Enable Dict support"
+       default n
+
+config LIBCURL_ENABLE_TELNET
+       bool "Enable Telnet support"
+       default n
+
+config LIBCURL_ENABLE_SSPI
+       bool "Enable SSPI support"
+       default n
+
+config LIBCURL_ENABLE_PROXY
+       bool "Enable Proxy support"
+       default n
+
+endmenu
diff --git a/libs/curl/Makefile b/libs/curl/Makefile
index e8d0276..b0e3279 100644
--- a/libs/curl/Makefile
+++ b/libs/curl/Makefile
@@ -48,6 +48,11 @@ define Package/libcurl
   CATEGORY:=Libraries
   DEPENDS:=+libopenssl +zlib
   TITLE:=A client-side URL transfer library
+  MENU:=1
+endef
+
+define Package/libcurl/config
+  source "$(SOURCE)/Config.in"
 endef
 
 TARGET_CFLAGS += $(FPIC)
@@ -59,18 +64,9 @@ CONFIGURE_ARGS += \
        --enable-cookies \
        --enable-crypto-auth \
        --enable-nonblocking \
-       --enable-file \
-       --enable-ftp \
-       --enable-http \
        --disable-ares \
        --disable-debug \
-       --disable-dict \
-       --disable-gopher \
-       --disable-ldap \
        --disable-manual \
-       --disable-sspi \
-       --disable-telnet \
-       --enable-tftp \
        --disable-verbose \
        --with-random="/dev/urandom" \
        --with-ssl="$(STAGING_DIR)/usr" \
@@ -82,6 +78,20 @@ CONFIGURE_ARGS += \
        --without-libssh2 \
        --with-zlib="$(STAGING_DIR)/usr" \
        $(call autoconf_bool,CONFIG_IPV6,ipv6) \
+       $(call autoconf_bool,CONFIG_LIBCURL_ENABLE_FILE,file) \
+       $(call autoconf_bool,CONFIG_LIBCURL_ENABLE_HTTP,http) \
+       $(call autoconf_bool,CONFIG_LIBCURL_ENABLE_FTP,ftp) \
+       $(call autoconf_bool,CONFIG_LIBCURL_ENABLE_TFTP,tftp) \
+       $(call autoconf_bool,CONFIG_LIBCURL_ENABLE_POP3,pop3) \
+       $(call autoconf_bool,CONFIG_LIBCURL_ENABLE_IMAP,imap) \
+       $(call autoconf_bool,CONFIG_LIBCURL_ENABLE_SMTP,smtp) \
+       $(call autoconf_bool,CONFIG_LIBCURL_ENABLE_RTSP,rtsp) \
+       $(call autoconf_bool,CONFIG_LIBCURL_ENABLE_LDAP,ldap) \
+       $(call autoconf_bool,CONFIG_LIBCURL_ENABLE_GOPHER,gopher) \
+       $(call autoconf_bool,CONFIG_LIBCURL_ENABLE_DICT,dict) \
+       $(call autoconf_bool,CONFIG_LIBCURL_ENABLE_TELNET,telnet) \
+       $(call autoconf_bool,CONFIG_LIBCURL_ENABLE_SSPI,sspi) \
+       $(call autoconf_bool,CONFIG_LIBCURL_ENABLE_PROXY,proxy) \
 
 CONFIGURE_VARS += \
        LIBS="-lcrypto -lssl -lz" \
-- 
1.7.10.4

_______________________________________________
openwrt-devel mailing list
[email protected]
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to