include $(INCLUDE_DIR)/host-build.mk
-HOST_LDFLAGS += -static
+HOST_LDFLAGS += $(HOST_STATIC_LINKING)
define Host/Clean
-$(MAKE) -C $(HOST_BUILD_DIR) uninstall
include $(INCLUDE_DIR)/host-build.mk
-HOST_LDFLAGS += -static
+HOST_LDFLAGS += $(HOST_STATIC_LINKING)
HOST_CONFIGURE_VARS += CC="$(HOSTCC_NOCACHE)"
define Host/Install/ccache
include $(INCLUDE_DIR)/host-build.mk
define Host/Compile
- $(MAKE) -C $(HOST_BUILD_DIR) SHELL="$(BASH)" LDFLAGS="$(HOST_LDFLAGS) -static"
+ $(MAKE) -C $(HOST_BUILD_DIR) SHELL="$(BASH)" LDFLAGS="$(HOST_LDFLAGS) $(HOST_STATIC_LINKING)"
endef
define Host/Install
include $(INCLUDE_DIR)/host-build.mk
HOST_CFLAGS += $(FPIC)
-HOST_LDFLAGS += -static
+HOST_LDFLAGS += $(HOST_STATIC_LINKING)
HOST_CONFIGURE_ARGS += \
--disable-shared \
include $(INCLUDE_DIR)/kernel.mk
define cc
- $(HOSTCC) $(HOST_CFLAGS) -include endian.h -static -o $(HOST_BUILD_DIR)/bin/$(firstword $(1)) $(foreach src,$(1),src/$(src).c) $(2)
+ $(HOSTCC) $(HOST_CFLAGS) -include endian.h $(HOST_STATIC_LINKING) -o $(HOST_BUILD_DIR)/bin/$(firstword $(1)) $(foreach src,$(1),src/$(src).c) $(2)
endef
define Host/Compile
include $(INCLUDE_DIR)/host-build.mk
-HOST_LDFLAGS += -static
+HOST_LDFLAGS += $(HOST_STATIC_LINKING)
define Host/Clean
-$(MAKE) -C $(HOST_BUILD_DIR) uninstall
define Host/Compile
mkdir -p $(HOST_BUILD_DIR)
- $(HOSTCC) $(HOST_CFLAGS) -static -o $(HOST_BUILD_DIR)/flock src/flock.c
+ $(HOSTCC) $(HOST_CFLAGS) $(HOST_STATIC_LINKING) -o $(HOST_BUILD_DIR)/flock src/flock.c
endef
define Host/Install
define Host/Compile
$(MAKE) -C $(HOST_BUILD_DIR) \
CFLAGS="$(HOST_CFLAGS)" \
- LDFLAGS="$(HOST_LDFLAGS) -static" \
+ LDFLAGS="$(HOST_LDFLAGS) $(HOST_STATIC_LINKING)" \
all
endef
include $(INCLUDE_DIR)/host-build.mk
-HOST_LDFLAGS += -static
+HOST_LDFLAGS += $(HOST_STATIC_LINKING)
define Host/Clean
-$(MAKE) -C $(HOST_BUILD_DIR) uninstall
include $(INCLUDE_DIR)/host-build.mk
HOST_CFLAGS += -I$(CURDIR)/include
-HOST_LDFLAGS += -static
+HOST_LDFLAGS += $(HOST_STATIC_LINKING)
define Host/Install
$(INSTALL_BIN) \
MTD_MAKEOPTS = \
CFLAGS="$(CFLAGS)" \
- LDFLAGS="$(HOST_LDFLAGS) -static" \
+ LDFLAGS="$(HOST_LDFLAGS) $(HOST_STATIC_LINKING)" \
WITHOUT_LZO=1 WITHOUT_XATTR=1 \
LZMA_STATIC_LIB="$(STAGING_DIR_HOST)/lib/liblzma.a" \
SUBDIRS="" \
include $(INCLUDE_DIR)/host-build.mk
-HOST_LDFLAGS += -static
+HOST_LDFLAGS += $(HOST_STATIC_LINKING)
define Host/Compile
$(MAKE) -C $(HOST_BUILD_DIR) mcopy
include $(INCLUDE_DIR)/host-build.mk
define Host/Compile
- $(HOSTCC) $(HOST_CFLAGS) -include endian.h -static -o $(HOST_BUILD_DIR)/$(PKG_NAME) src/$(PKG_NAME).c
+ $(HOSTCC) $(HOST_CFLAGS) -include endian.h $(HOST_STATIC_LINKING) -o $(HOST_BUILD_DIR)/$(PKG_NAME) src/$(PKG_NAME).c
endef
define Host/Install
include $(INCLUDE_DIR)/host-build.mk
-HOST_LDFLAGS += -static
+HOST_LDFLAGS += $(HOST_STATIC_LINKING)
define Host/Install
- $(MAKE) -C $(HOST_BUILD_DIR) install AM_LDFLAGS="-all-static"
+ $(MAKE) -C $(HOST_BUILD_DIR) install \
+ AM_LDFLAGS="$(if $(HOST_STATIC_LINKING),-all-static)"
mv $(STAGING_DIR_HOST)/bin/pkg-config $(STAGING_DIR_HOST)/bin/pkg-config.real
$(INSTALL_BIN) ./files/pkg-config $(STAGING_DIR_HOST)/bin/pkg-config
endef
include $(INCLUDE_DIR)/host-build.mk
HOST_CFLAGS += -I$(STAGING_DIR_HOST)/include/e2fsprogs
-HOST_LDFLAGS += -static
+HOST_LDFLAGS += $(HOST_STATIC_LINKING)
define Host/Configure
(cd $(HOST_BUILD_DIR); \
include $(INCLUDE_DIR)/host-build.mk
-HOST_LDFLAGS += -static
+HOST_LDFLAGS += $(HOST_STATIC_LINKING)
HOST_CONFIGURE_ARGS += \
--disable-ucsim \
--enable-packihx \
define Host/Compile
$(MAKE) -C $(HOST_BUILD_DIR)/squashfs-tools \
CC="$(HOSTCC)" \
- CXX="$(CXX) -static" \
+ CXX="$(CXX) $(HOST_STATIC_LINKING)" \
LZMAPATH=$(STAGING_DIR_HOST)/lib \
mksquashfs-lzma unsquashfs-lzma
endef
include $(INCLUDE_DIR)/host-build.mk
define Host/Compile
- $(HOSTCC) $(HOST_CFLAGS) -I./include -include endian.h -static -o $(HOST_BUILD_DIR)/sstrip src/sstrip.c
+ $(HOSTCC) $(HOST_CFLAGS) -I./include -include endian.h $(HOST_STATIC_LINKING) -o $(HOST_BUILD_DIR)/sstrip src/sstrip.c
endef
define Host/Install
include $(INCLUDE_DIR)/host-build.mk
unexport CFLAGS
-HOST_LDFLAGS += -static
+HOST_LDFLAGS += $(HOST_STATIC_LINKING)
define Host/Configure
(cd $(HOST_BUILD_DIR); \
define Host/Compile
rm -f $(HOST_BUILD_DIR)/src/.depend
$(MAKE) UPX_LZMADIR="$(BUILD_DIR_HOST)/lzma-4.65" -C $(HOST_BUILD_DIR)/src \
- CXXFLAGS_WERROR="" LDFLAGS="$(HOST_LDFLAGS) -static"
+ CXXFLAGS_WERROR="" LDFLAGS="$(HOST_LDFLAGS) $(HOST_STATIC_LINKING)"
endef
define Host/Install
$(HOSTCC) $(HOST_CFLAGS) -c src/md5.c -o $(HOST_BUILD_DIR)/md5.o
$(HOSTCC) $(HOST_CFLAGS) -c src/ioapi.c -o $(HOST_BUILD_DIR)/ioapi.o
$(HOSTCC) $(HOST_CFLAGS) -c src/wrt350nv2-builder.c -o $(HOST_BUILD_DIR)/wrt350nv2-builder.o
- $(HOSTCC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -static -o $(HOST_BUILD_DIR)/wrt350nv2-builder \
+ $(HOSTCC) $(HOST_CFLAGS) $(HOST_LDFLAGS) $(HOST_STATIC_LINKING) -o $(HOST_BUILD_DIR)/wrt350nv2-builder \
$(HOST_BUILD_DIR)/wrt350nv2-builder.o $(HOST_BUILD_DIR)/md5.o $(HOST_BUILD_DIR)/ioapi.o
endef
include $(INCLUDE_DIR)/host-build.mk
-HOST_LDFLAGS += -static
+HOST_LDFLAGS += $(HOST_STATIC_LINKING)
define Host/Install
- $(MAKE) -C $(HOST_BUILD_DIR) install xzlinks="unxz xzcat" AM_LDFLAGS="-all-static"
+ $(MAKE) -C $(HOST_BUILD_DIR) install xzlinks="unxz xzcat" \
+ AM_LDFLAGS="$(if $(HOST_STATIC_LINKING),-all-static)"
endef
$(eval $(call HostBuild))
define Host/Compile
$(MAKE) -C $(HOST_BUILD_DIR)/yaffs2/utils \
- CC="$(HOSTCC) -static" \
+ CC="$(HOSTCC) $(HOST_STATIC_LINKING)" \
CFLAGS="$(HOST_CFLAGS) -include endian.h" \
mkyaffs2image
endef