From 958c9438ccb5e8c8864edf242b6b4ce3b1f058a4 Mon Sep 17 00:00:00 2001 From: Vicente Olivert Riera Date: Wed, 5 Mar 2014 12:19:37 +0000 Subject: [PATCH] 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 Tested-by: Baruch Siach Acked-by: Arnout Vandecappelle (Essensium/Mind) Tested-by: Arnout Vandecappelle (Essensium/Mind) Signed-off-by: Peter Korsgaard --- package/pkgconf/pkg-config.in | 2 +- package/pkgconf/pkgconf.mk | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) 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)) -- 2.30.2