kumquat-buildroot/package/pkgconf/pkgconf.mk
Thomas Petazzoni 3f6d39816b pkgconf: use relative path to STAGING_DIR instead of absolute path
The pkg-config wrapper script is currently generated with absolute
paths to $(STAGING_DIR). However, this will not work properly with
per-package SDK, and each package will be built with a different
STAGING_DIR value.

In order to fix this, we adjust how the pkg-config wrapper script is
generated, so that it uses a relative path to itself: the sysroot (i.e
STAGING_DIR) is always located in $(path of
pkg-config)/../$(STAGING_SUBDIR).

This change is independent from the per-package SDK work, and could be
applied independently from it.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-12-31 18:24:11 +01:00

45 lines
1.2 KiB
Makefile

################################################################################
#
# pkgconf
#
################################################################################
PKGCONF_VERSION = 0.9.12
PKGCONF_SITE = https://github.com/pkgconf/pkgconf/releases/download/pkgconf-$(PKGCONF_VERSION)
PKGCONF_SOURCE = pkgconf-$(PKGCONF_VERSION).tar.bz2
PKGCONF_LICENSE = pkgconf license
PKGCONF_LICENSE_FILES = COPYING
PKG_CONFIG_HOST_BINARY = $(HOST_DIR)/bin/pkg-config
define PKGCONF_LINK_PKGCONFIG
ln -sf pkgconf $(TARGET_DIR)/usr/bin/pkg-config
endef
define HOST_PKGCONF_INSTALL_WRAPPER
$(INSTALL) -m 0755 -D package/pkgconf/pkg-config.in \
$(HOST_DIR)/bin/pkg-config
$(SED) 's,@STAGING_SUBDIR@,$(STAGING_SUBDIR),g' \
$(HOST_DIR)/bin/pkg-config
endef
define HOST_PKGCONF_STATIC
$(SED) 's,@STATIC@,--static,' $(HOST_DIR)/bin/pkg-config
endef
define HOST_PKGCONF_SHARED
$(SED) 's,@STATIC@,,' $(HOST_DIR)/bin/pkg-config
endef
PKGCONF_POST_INSTALL_TARGET_HOOKS += PKGCONF_LINK_PKGCONFIG
HOST_PKGCONF_POST_INSTALL_HOOKS += HOST_PKGCONF_INSTALL_WRAPPER
ifeq ($(BR2_STATIC_LIBS),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))