aboutsummaryrefslogtreecommitdiff
path: root/package/pkgconf
diff options
context:
space:
mode:
authorGravatar Vicente Olivert Riera <Vincent.Riera@imgtec.com>2014-03-05 12:19:37 +0000
committerGravatar Peter Korsgaard <peter@korsgaard.com>2014-05-07 22:39:33 +0200
commit958c9438ccb5e8c8864edf242b6b4ce3b1f058a4 (patch)
treef676957269811216600c392a601694bbdfe4423f /package/pkgconf
parentfcb5b619f8ad6a58f4afa88c46941848a58e40e0 (diff)
downloadbuildroot-958c9438ccb5e8c8864edf242b6b4ce3b1f058a4.tar.gz
buildroot-958c9438ccb5e8c8864edf242b6b4ce3b1f058a4.tar.bz2
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: 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>
Diffstat (limited to 'package/pkgconf')
-rw-r--r--package/pkgconf/pkg-config.in2
-rw-r--r--package/pkgconf/pkgconf.mk14
2 files changed, 15 insertions, 1 deletions
diff --git a/package/pkgconf/pkg-config.in b/package/pkgconf/pkg-config.in
index 25a536b0e6..4dec48789a 100644
--- a/package/pkgconf/pkg-config.in
+++ b/package/pkgconf/pkg-config.in
@@ -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@ $@
diff --git a/package/pkgconf/pkgconf.mk b/package/pkgconf/pkgconf.mk
index f3f6526c68..96413718a9 100644
--- a/package/pkgconf/pkgconf.mk
+++ b/package/pkgconf/pkgconf.mk
@@ -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))