Browse Source

shadowsocks-libev: size optimizations

Use link-time optimization and --gc-sections --as-needed ldflags
Reduces ipk size by 20%

Remove unnecessary dependencies

Signed-off-by: Deng Qingfang <dengqf6@mail2.sysu.edu.cn>
lilik-openwrt-22.03
Deng Qingfang 6 years ago
committed by Yousong Zhou
parent
commit
c54a826086
1 changed files with 9 additions and 2 deletions
  1. +9
    -2
      net/shadowsocks-libev/Makefile

+ 9
- 2
net/shadowsocks-libev/Makefile View File

@ -14,7 +14,7 @@ include $(TOPDIR)/rules.mk
# #
PKG_NAME:=shadowsocks-libev PKG_NAME:=shadowsocks-libev
PKG_VERSION:=3.2.5 PKG_VERSION:=3.2.5
PKG_RELEASE:=3
PKG_RELEASE:=4
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://github.com/shadowsocks/shadowsocks-libev/releases/download/v$(PKG_VERSION) PKG_SOURCE_URL:=https://github.com/shadowsocks/shadowsocks-libev/releases/download/v$(PKG_VERSION)
@ -29,6 +29,7 @@ PKG_FIXUP:=autoreconf
PKG_INSTALL:=1 PKG_INSTALL:=1
PKG_USE_MIPS16:=0 PKG_USE_MIPS16:=0
PKG_BUILD_PARALLEL:=1 PKG_BUILD_PARALLEL:=1
PKG_BUILD_DEPENDS:=c-ares pcre
include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/package.mk
@ -56,7 +57,7 @@ define Package/shadowsocks-libev/Default
SUBMENU:=Web Servers/Proxies SUBMENU:=Web Servers/Proxies
TITLE:=shadowsocks-libev $(1) TITLE:=shadowsocks-libev $(1)
URL:=https://github.com/shadowsocks/shadowsocks-libev URL:=https://github.com/shadowsocks/shadowsocks-libev
DEPENDS:=+libcares +libev +libmbedtls +libpcre +libpthread +libsodium +shadowsocks-libev-config +zlib
DEPENDS:=+libev +libmbedtls +libpthread +libsodium +shadowsocks-libev-config $(DEPENDS_$(1))
endef endef
define Package/shadowsocks-libev-$(1)/install define Package/shadowsocks-libev-$(1)/install
@ -66,6 +67,9 @@ define Package/shadowsocks-libev/Default
endef endef
DEPENDS_ss-local = +libpcre
DEPENDS_ss-server = +libcares +libpcre
SHADOWSOCKS_COMPONENTS:=ss-local ss-redir ss-tunnel ss-server SHADOWSOCKS_COMPONENTS:=ss-local ss-redir ss-tunnel ss-server
define shadowsocks-libev/templates define shadowsocks-libev/templates
$(foreach component,$(SHADOWSOCKS_COMPONENTS), $(foreach component,$(SHADOWSOCKS_COMPONENTS),
@ -118,6 +122,9 @@ CONFIGURE_ARGS += \
--disable-assert \ --disable-assert \
--disable-ssp \ --disable-ssp \
TARGET_CFLAGS += -flto
TARGET_LDFLAGS += -Wl,--gc-sections,--as-needed
$(eval $(call BuildPackage,shadowsocks-libev-config)) $(eval $(call BuildPackage,shadowsocks-libev-config))
$(eval $(call BuildPackage,shadowsocks-libev-ss-rules)) $(eval $(call BuildPackage,shadowsocks-libev-ss-rules))
$(foreach component,$(SHADOWSOCKS_COMPONENTS), \ $(foreach component,$(SHADOWSOCKS_COMPONENTS), \


Loading…
Cancel
Save