aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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))