use HOST_STATIC_LINKING instead of hardcoding -static
authorJo-Philipp Wich <jow@openwrt.org>
Sun, 12 Aug 2012 12:34:30 +0000 (12:34 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Sun, 12 Aug 2012 12:34:30 +0000 (12:34 +0000)
SVN-Revision: 33140

23 files changed:
tools/bison/Makefile
tools/ccache/Makefile
tools/dosfstools/Makefile
tools/e2fsprogs/Makefile
tools/firmware-utils/Makefile
tools/flex/Makefile
tools/flock/Makefile
tools/genext2fs/Makefile
tools/m4/Makefile
tools/mklibs/Makefile
tools/mtd-utils/Makefile
tools/mtools/Makefile
tools/patch-cmdline/Makefile
tools/pkg-config/Makefile
tools/qemu/Makefile
tools/sdcc/Makefile
tools/squashfs/Makefile
tools/sstrip/Makefile
tools/upslug2/Makefile
tools/upx/Makefile
tools/wrt350nv2-builder/Makefile
tools/xz/Makefile
tools/yaffs2/Makefile

index b7fdf25..b48862a 100644 (file)
@@ -16,7 +16,7 @@ PKG_CAT:=bzcat
 
 include $(INCLUDE_DIR)/host-build.mk
 
-HOST_LDFLAGS += -static
+HOST_LDFLAGS += $(HOST_STATIC_LINKING)
 
 define Host/Clean
        -$(MAKE) -C $(HOST_BUILD_DIR) uninstall
index 5d464e7..9020c9c 100644 (file)
@@ -16,7 +16,7 @@ PKG_MD5SUM:=80a698c22d0b06b19c88ac58e8d8b632
 
 include $(INCLUDE_DIR)/host-build.mk
 
-HOST_LDFLAGS += -static
+HOST_LDFLAGS += $(HOST_STATIC_LINKING)
 HOST_CONFIGURE_VARS += CC="$(HOSTCC_NOCACHE)"
 
 define Host/Install/ccache
index 73d8e2a..c582489 100644 (file)
@@ -16,7 +16,7 @@ PKG_CAT:=zcat
 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
index dc4dc70..665ca0d 100644 (file)
@@ -18,7 +18,7 @@ PKG_SOURCE_URL:=@SF/e2fsprogs
 include $(INCLUDE_DIR)/host-build.mk
 
 HOST_CFLAGS += $(FPIC)
-HOST_LDFLAGS += -static
+HOST_LDFLAGS += $(HOST_STATIC_LINKING)
 
 HOST_CONFIGURE_ARGS += \
        --disable-shared \
index 640dd23..2994660 100644 (file)
@@ -12,7 +12,7 @@ include $(INCLUDE_DIR)/host-build.mk
 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
index 8e32ace..659324a 100644 (file)
@@ -16,7 +16,7 @@ PKG_CAT:=bzcat
 
 include $(INCLUDE_DIR)/host-build.mk
 
-HOST_LDFLAGS += -static
+HOST_LDFLAGS += $(HOST_STATIC_LINKING)
 
 define Host/Clean
        -$(MAKE) -C $(HOST_BUILD_DIR) uninstall
index ead98e7..f5e13cd 100644 (file)
@@ -12,7 +12,7 @@ include $(INCLUDE_DIR)/host-build.mk
 
 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
index 2462b8c..57e8d35 100644 (file)
@@ -36,7 +36,7 @@ HOST_CONFIGURE_ARGS = \
 define Host/Compile
        $(MAKE) -C $(HOST_BUILD_DIR) \
                CFLAGS="$(HOST_CFLAGS)" \
-               LDFLAGS="$(HOST_LDFLAGS) -static" \
+               LDFLAGS="$(HOST_LDFLAGS) $(HOST_STATIC_LINKING)" \
                all
 endef
 
index 91efb5b..6470a54 100644 (file)
@@ -16,7 +16,7 @@ PKG_CAT:=zcat
 
 include $(INCLUDE_DIR)/host-build.mk
 
-HOST_LDFLAGS += -static
+HOST_LDFLAGS += $(HOST_STATIC_LINKING)
 
 define Host/Clean
        -$(MAKE) -C $(HOST_BUILD_DIR) uninstall
index 0858ad3..fd3d233 100644 (file)
@@ -16,7 +16,7 @@ PKG_MD5SUM:=afe0ed527ba96b8a882b5de350603007
 include $(INCLUDE_DIR)/host-build.mk
 
 HOST_CFLAGS += -I$(CURDIR)/include
-HOST_LDFLAGS += -static
+HOST_LDFLAGS += $(HOST_STATIC_LINKING)
 
 define Host/Install
        $(INSTALL_BIN) \
index 9a639fe..3dccb59 100644 (file)
@@ -28,7 +28,7 @@ endif
 
 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="" \
index 36f6adc..8d227c1 100644 (file)
@@ -16,7 +16,7 @@ PKG_CAT:=zcat
 
 include $(INCLUDE_DIR)/host-build.mk
 
-HOST_LDFLAGS += -static
+HOST_LDFLAGS += $(HOST_STATIC_LINKING)
 
 define Host/Compile
        $(MAKE) -C $(HOST_BUILD_DIR) mcopy
index a75ba83..a952639 100644 (file)
@@ -11,7 +11,7 @@ PKG_NAME:=patch-cmdline
 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
index fbdc1d0..01bfdb0 100644 (file)
@@ -15,10 +15,11 @@ PKG_MD5SUM:=a3270bab3f4b69b7dc6dbdacbcae9745
 
 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
index 92f0304..45d42d4 100644 (file)
@@ -17,7 +17,7 @@ PKG_MD5SUM:=b6c713a8db638e173af53a62d5178640
 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); \
index abedc3c..3210bb3 100644 (file)
@@ -17,7 +17,7 @@ HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/$(PKG_NAME)
 
 include $(INCLUDE_DIR)/host-build.mk
 
-HOST_LDFLAGS += -static
+HOST_LDFLAGS += $(HOST_STATIC_LINKING)
 HOST_CONFIGURE_ARGS += \
        --disable-ucsim \
        --enable-packihx \
index f4a5460..6dc27d6 100644 (file)
@@ -21,7 +21,7 @@ include $(INCLUDE_DIR)/host-build.mk
 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
index b10a252..ea4c3e8 100644 (file)
@@ -11,7 +11,7 @@ PKG_NAME:=sstrip
 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
index 19d160c..e80cef0 100644 (file)
@@ -18,7 +18,7 @@ PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 include $(INCLUDE_DIR)/host-build.mk
 
 unexport CFLAGS
-HOST_LDFLAGS += -static
+HOST_LDFLAGS += $(HOST_STATIC_LINKING)
 
 define Host/Configure
        (cd $(HOST_BUILD_DIR); \
index 339c611..3e76232 100644 (file)
@@ -21,7 +21,7 @@ include $(INCLUDE_DIR)/host-build.mk
 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
index f471df1..da2bd6b 100644 (file)
@@ -18,7 +18,7 @@ define Host/Compile
        $(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
 
index 41894e0..b1698be 100644 (file)
@@ -15,10 +15,11 @@ PKG_MD5SUM:=8d900b742b94fa9e708ca4f5a4b29003
 
 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))
index 8615fd3..afa9ab9 100644 (file)
@@ -22,7 +22,7 @@ include $(INCLUDE_DIR)/host-build.mk
 
 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