host-pkgconf: use --static option for static builds
authorVicente Olivert Riera <Vincent.Riera@imgtec.com>
Wed, 5 Mar 2014 12:19:37 +0000 (12:19 +0000)
committerPeter Korsgaard <peter@korsgaard.com>
Wed, 7 May 2014 20:39:33 +0000 (22:39 +0200)
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: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
Tested-by: Baruch Siach <baruch@tkos.co.il>
Acked-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Tested-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
package/pkgconf/pkg-config.in
package/pkgconf/pkgconf.mk

index 25a536b0e68722a9f2b2dabd519588b9076affaa..4dec48789a81537c13c57dbb038eb3414bbacf66 100644 (file)
@@ -1,2 +1,2 @@
 #!/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@ $@
index f3f6526c68c16d61e9e99141340af6c588ed1ac2..96413718a91c18ebdaaa54de8aa7198ea5bafc33 100644 (file)
@@ -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))