Commit 958c9438 authored by Vicente Olivert Riera's avatar Vicente Olivert Riera Committed by Peter Korsgaard
Browse files

host-pkgconf: use --static option for static builds

Detect when BR2_PREFER_STATIC_LIBS is selected and modify the host
pkg-config wrapper to append the --static option in that case.

Fixes:
   http://autobuild.buildroot.net/results/161/161446dde7e8e774773eb2b34fd555f5ac22dd02/



Signed-off-by: default avatarVicente Olivert Riera <Vincent.Riera@imgtec.com>
Tested-by: default avatarBaruch Siach <baruch@tkos.co.il>
Acked-by: default avatarArnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Tested-by: default avatarArnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: default avatarPeter Korsgaard <peter@korsgaard.com>
parent fcb5b619
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
#!/bin/sh
PKG_CONFIG_LIBDIR=${PKG_CONFIG_LIBDIR:-@PKG_CONFIG_LIBDIR@} PKG_CONFIG_SYSROOT_DIR=${PKG_CONFIG_SYSROOT_DIR:-@STAGING_DIR@} $(dirname $0)/pkgconf $@
PKG_CONFIG_LIBDIR=${PKG_CONFIG_LIBDIR:-@PKG_CONFIG_LIBDIR@} PKG_CONFIG_SYSROOT_DIR=${PKG_CONFIG_SYSROOT_DIR:-@STAGING_DIR@} $(dirname $0)/pkgconf @STATIC@ $@
+14 −0
Original line number Diff line number Diff line
@@ -24,8 +24,22 @@ define HOST_PKGCONF_INSTALL_WRAPPER
		$(HOST_DIR)/usr/bin/pkg-config
endef

define HOST_PKGCONF_STATIC
	$(SED) 's,@STATIC@,--static,' $(HOST_DIR)/usr/bin/pkg-config
endef

define HOST_PKGCONF_SHARED
	$(SED) 's,@STATIC@,,' $(HOST_DIR)/usr/bin/pkg-config
endef

PKGCONF_POST_INSTALL_TARGET_HOOKS += PKGCONF_LINK_PKGCONFIG
HOST_PKGCONF_POST_INSTALL_HOOKS += HOST_PKGCONF_INSTALL_WRAPPER

ifeq ($(BR2_PREFER_STATIC_LIB),y)
	HOST_PKGCONF_POST_INSTALL_HOOKS += HOST_PKGCONF_STATIC
else
	HOST_PKGCONF_POST_INSTALL_HOOKS += HOST_PKGCONF_SHARED
endif

$(eval $(autotools-package))
$(eval $(host-autotools-package))