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 b7fdf254a27b10bf85e9ae4a07b9bb62866cefc1..b48862a3dea99f07a29071ebead4b1e35d8df3dd 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 5d464e7ded5f75acba2c0be67b2de4d558076452..9020c9c47b64d81c6ee0f9ca7c77dbfdb10fcfef 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 73d8e2a36a101bd6d8b2ca3fc78675d7aacb9e61..c58248910b9faac47d282e89cfcd3143fb4532a7 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 dc4dc70aee9b4c978687d6c990141be0abbb655e..665ca0dcd42a3ee20ab563792fe0bdc266e27c47 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 640dd23ee539f35429a1470ba671af43ea876d1a..29946607601807f16ffef0abc7450587bd2900e3 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 8e32ace854e6c5cc500f4e59bea82b59d8281134..659324a647e2095268e5a0b9f71c2989e25ba9eb 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 ead98e7329073e746cc9b6956513c4d6258fcaa1..f5e13cd9117add9c51de27bcca7ae048a9a15958 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 2462b8cd8afe502f66cec4eaf6d8bdc8b51911c1..57e8d35b51995c1470dca0735ec9d0276c5f485b 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 91efb5b0d5444fbe6df364f43438aa0d04b717b2..6470a549a59a3e128b4f2397ce7a73a4fde1d0ec 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 0858ad3d501739f0dffaba932fc43b5b74d446bb..fd3d233c4700600526c7d195ebcbec3e51e2be53 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 9a639fea411a2a0ea6aa6537c1a8fb7febb5365c..3dccb591f50e098ba982b73135481f72a5b9294d 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 36f6adc86bb3f8de302317117929b97e264cc643..8d227c147779383d4fc75e55ca1c49545482e811 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 a75ba83b381fe47cbc9659c2af3143d2265eec9d..a9526397f1327d1388471a0ad29808df4bb19607 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 fbdc1d0db7cf288f8bed862f528c2cdffddc2294..01bfdb0d68136df6b7dd200ac8cedf5c7cb40f7c 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 92f0304ea8bc3844ad44db34194cf8f767988542..45d42d488329f4b0d0c4262683a356c73a68df4c 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 abedc3ca71043f1118c1695ad81e59301a216ea9..3210bb3e763791e7f8d044918d70e862b319a4a3 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 f4a546013551d05b1d492e927fe0b909c65e4c48..6dc27d6750451b4182a5863f28c1f167e45ce1fa 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 b10a2523c3dd702890b743a5e959af49b922d11d..ea4c3e880f056ff3bb58da76d101c8e7e849dbde 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 19d160c337e3747554c1827e50d2e80414cacc34..e80cef0eb4bd441e8de640de05395a7ff4abd3f3 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 339c611154aed18b064bb81bf028d62d0f68b3bb..3e76232012d0267192016cd8048233d70a3defb1 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 f471df1c573a0d6ee7bc651c21a3587a2891623e..da2bd6bc7990aab988873a83183aaafe705f6570 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 41894e073cadf4b76d68bf82d6be4405e6a21ba2..b1698be99e063e216c2001a4318a2f8c7b62cb66 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 8615fd30e9fc7c888d60964498ea31e0dcbb0fec..afa9ab9985b51299a4b5859731889c127366392a 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