Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

stunnel:

 * use magic (C|LD)FLAGS to reduce binary size


git-svn-id: file:///var/svn/freetz/trunk@11599 149334a1-2f27-0410-a3b9-fc62619ac1e6
  • Loading branch information...
commit 9b5974e8b8052c8f0fbfc3353318ee459579956f 1 parent 994b009
er13 authored
Showing with 13 additions and 5 deletions.
  1. +13 −5 make/stunnel/stunnel.mk
View
18 make/stunnel/stunnel.mk
@@ -9,10 +9,20 @@ $(PKG)_BINARY:=$($(PKG)_DIR)/src/$(pkg)
$(PKG)_TARGET_BINARY:=$($(PKG)_DEST_DIR)/usr/sbin/$(pkg)
$(PKG)_DEPENDS_ON := openssl zlib
+
$(PKG)_REBUILD_SUBOPTS += FREETZ_OPENSSL_SHLIB_VERSION
+$(PKG)_REBUILD_SUBOPTS += FREETZ_PACKAGE_STUNNEL_STATIC
+$(PKG)_REBUILD_SUBOPTS += FREETZ_TARGET_IPV6_SUPPORT
+
+# add EXTRA_CFLAGS, EXTRA_LDFLAGS variables to all Makefile.in's
+$(PKG)_CONFIGURE_PRE_CMDS += $(SED) -i -r -e 's,^((C|LD)FLAGS)[ \t]*=[ \t]*@\1@,& $$$$(EXTRA_\1),' `find . -name Makefile.in`;
+
+# reduce binary size by setting appropriate CFLAGS/LDFLAGS
+$(PKG)_EXTRA_CFLAGS += -ffunction-sections -fdata-sections
+$(PKG)_EXTRA_LDFLAGS += -Wl,--gc-sections
ifeq ($(strip $(FREETZ_PACKAGE_STUNNEL_STATIC)),y)
-$(PKG)_LDFLAGS := -all-static
+$(PKG)_EXTRA_LDFLAGS += -all-static
endif
$(PKG)_CONFIGURE_ENV += ac_cv_file__dev_ptmx=no
@@ -24,16 +34,14 @@ $(PKG)_CONFIGURE_OPTIONS += --with-threads=pthread
$(PKG)_CONFIGURE_OPTIONS += --with-ssl="$(TARGET_TOOLCHAIN_STAGING_DIR)/usr"
$(PKG)_CONFIGURE_OPTIONS += $(if $(FREETZ_TARGET_IPV6_SUPPORT),--enable-ipv6,--disable-ipv6)
-$(PKG)_REBUILD_SUBOPTS += FREETZ_PACKAGE_STUNNEL_STATIC
-$(PKG)_REBUILD_SUBOPTS += FREETZ_TARGET_IPV6_SUPPORT
-
$(PKG_SOURCE_DOWNLOAD)
$(PKG_UNPACKED)
$(PKG_CONFIGURED_CONFIGURE)
$($(PKG)_BINARY): $($(PKG)_DIR)/.configured
$(SUBMAKE) -C $(STUNNEL_DIR) \
- LDFLAGS="$(STUNNEL_LDFLAGS)"
+ EXTRA_CFLAGS="$(STUNNEL_EXTRA_CFLAGS)" \
+ EXTRA_LDFLAGS="$(STUNNEL_EXTRA_LDFLAGS)"
$($(PKG)_TARGET_BINARY): $($(PKG)_BINARY)
$(INSTALL_BINARY_STRIP)
Please sign in to comment.
Something went wrong with that request. Please try again.