Skip to content

Commit

Permalink
package/pkgconf: make the pkg-config wrapper relocatable
Browse files Browse the repository at this point in the history
This change refactors the pkg-config wrapper template and the way it is filled
in a way there is no longer hard-coded paths to the staging directory; so it
is now fully relocatable.
  • Loading branch information
tSed committed Mar 6, 2016
1 parent a098a54 commit cebeb4f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 3 additions & 1 deletion package/pkgconf/pkg-config.in
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
#!/bin/sh
PKG_CONFIG_LIBDIR=${PKG_CONFIG_LIBDIR:-@PKG_CONFIG_LIBDIR@} PKG_CONFIG_SYSROOT_DIR=${PKG_CONFIG_SYSROOT_DIR:-@STAGING_DIR@} $(dirname $0)/pkgconf @STATIC@ $@
STAGING_DIR="$(readlink -f "$(dirname "$0")/../..")/@STAGING_SUBDIR@"
TARGET_PKG_CONFIG_LIBDIR="$( echo @PKG_CONFIG_LIBDIR@ | sed -e "s@^@${STAGING_DIR}/@ ; s@:@:${STAGING_DIR}/@g" )"
PKG_CONFIG_LIBDIR=${PKG_CONFIG_LIBDIR:-${TARGET_PKG_CONFIG_LIBDIR}} PKG_CONFIG_SYSROOT_DIR=${PKG_CONFIG_SYSROOT_DIR:-${STAGING_DIR}} $(dirname $0)/pkgconf @STATIC@ $@
8 changes: 6 additions & 2 deletions package/pkgconf/pkgconf.mk
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,12 @@ endef
define HOST_PKGCONF_INSTALL_WRAPPER
$(INSTALL) -m 0755 -D package/pkgconf/pkg-config.in \
$(HOST_DIR)/usr/bin/pkg-config
$(SED) 's,@PKG_CONFIG_LIBDIR@,$(STAGING_DIR)/usr/lib/pkgconfig:$(STAGING_DIR)/usr/share/pkgconfig,' \
-e 's,@STAGING_DIR@,$(STAGING_DIR),' \
# @PKG_CONFIG_LIBDIR@ is a colon-separated list of paths to search.
# These paths are relative to the root of the staging directory; they will
# be automatically prefixed with the staging directory path by the wrapper
# at runtime to ensure its relocatability.
$(SED) 's,@PKG_CONFIG_LIBDIR@,/usr/lib/pkgconfig:/usr/share/pkgconfig,' \
-e 's,@STAGING_SUBDIR@,$(STAGING_SUBDIR),' \
$(HOST_DIR)/usr/bin/pkg-config
endef

Expand Down

0 comments on commit cebeb4f

Please sign in to comment.