summaryrefslogtreecommitdiffstats
path: root/package
diff options
context:
space:
mode:
authorStefan Fröberg <stefan.froberg@petroprogram.com>2013-01-30 02:46:40 +0000
committerPeter Korsgaard <jacmet@sunsite.dk>2013-02-04 23:47:34 +0100
commit834f9311aacb5297d563292e69bc144f24e90187 (patch)
treefc9e3de302e0b4df2b0dbac3d25f979c158725eb /package
parent9a70663904fc2e9acad4e32a7da945c7603a0222 (diff)
downloadbuildroot-novena-834f9311aacb5297d563292e69bc144f24e90187.tar.gz
buildroot-novena-834f9311aacb5297d563292e69bc144f24e90187.zip
pkg-infra: add <pkg>_CONFIG_FIXUP to fix *-config files
This patch will add <pkg>_CONFIG_FIXUP variable to buildroot infra. It's purpose is to inform buildroot that the package in question contains some $(STAGING_DIR)/usr/bin/*-config files and that we want to automatically fix prefixes of such files. It is often the case that many packages call these files during their configuration step to determine 3rd party library package locations and any flags needed to link against them. For example: Some package might try to check the existense and linking flags of NSPR package by calling $(STAGING_DIR)/usr/bin/nspr-config --prefix. Without this fix. NSPR would return /usr/ as it's prefix which is wrong when cross-compiling. Correct would be $(STAGING_DIR)/usr. All packages that have <pkg>_INSTALL_STAGING = YES defined and also install some config file(s) into $(STAGING_DIR)/usr/bin must hereafter also define <pkg>_CONFIG_FIXUP with the correspondig filename(s). For example: DIVINE_CONFIG_FIXUP = divine-config or for multiple files: IMAGEMAGICK_CONFIG_FIXUP = Magick-config Wand-config Signed-off-by: Stefan Fröberg <stefan.froberg@petroprogram.com> Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Diffstat (limited to 'package')
-rw-r--r--package/pkg-generic.mk7
1 files changed, 7 insertions, 0 deletions
diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
index 59de0f0d1..19a115ecd 100644
--- a/package/pkg-generic.mk
+++ b/package/pkg-generic.mk
@@ -128,6 +128,13 @@ $(BUILD_DIR)/%/.stamp_staging_installed:
@$(call MESSAGE,"Installing to staging directory")
$($(PKG)_INSTALL_STAGING_CMDS)
$(foreach hook,$($(PKG)_POST_INSTALL_STAGING_HOOKS),$(call $(hook))$(sep))
+ $(Q)if test -n "$($(PKG)_CONFIG_FIXUP)" ; then \
+ $(call MESSAGE,"Fixing package configuration files") ;\
+ $(SED) "s,^\(exec_\)\?prefix=.*,\1prefix=$(STAGING_DIR)/usr,g" \
+ -e "s,-I/usr/,-I$(STAGING_DIR)/usr/,g" \
+ -e "s,-L/usr/,-L$(STAGING_DIR)/usr/,g" \
+ $(addprefix $(STAGING_DIR)/usr/bin/,$($(PKG)_CONFIG_FIXUP)) ;\
+ fi
$(Q)touch $@
# Install to images dir