aboutsummaryrefslogtreecommitdiff
path: root/libs/libxml2
diff options
context:
space:
mode:
authorSebastian Kemper <sebastian_ml@gmx.net>2019-10-27 10:06:35 +0100
committerSebastian Kemper <sebastian_ml@gmx.net>2019-10-27 10:58:26 +0100
commitcf31c75e40a5fd7e52b18b0ff2160fa703549311 (patch)
tree1956f9294a66d52b7d3124cf303112af57dfadee /libs/libxml2
parentb6ec718b98a4edb1c90dd049723e51e4e722b595 (diff)
libxml2: install xml2-config with host triplet
Currently only xml2-config is installed, for both the normal libxml2 package as well as the host package. The problem with that is that due to multilib considerations the build host may have xml2-config installed with a host triplet prefix, like x86_64-pc-linux-gnu-xml2-config (and xml2-config as a symbolic link to it). Gentoo for instance sets it up like this. Packages may actually search for a prefixed xml2-config before searching for xml2-config. An example would be Asterisk: checking for x86_64-pc-linux-gnu-xml2-config... /usr/bin/x86_64-pc-linux-gnu-xml2-config This then introduces wrong information into the build, for instance bad includes: ~/tmp/openwrt $ /usr/bin/x86_64-pc-linux-gnu-xml2-config --cflags -I/usr/include/libxml2 When the intention is to use OpenWrt's own (host) libxml2 one would like to see this output used instead: ~/tmp/openwrt $ ./staging_dir/hostpkg/bin/xml2-config --cflags -I/home/sk/tmp/openwrt/staging_dir/hostpkg/include/libxml2 This commit addresses this by installing xml2-config with a suitable prefix and creating a symbolic link xml2-config. This is done for both the host package and the normal package. The latter also needs this fix because the target may use the same triplet as the host system (for instance x86_64 cross-compiling for x86_64). Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
Diffstat (limited to 'libs/libxml2')
-rw-r--r--libs/libxml2/Makefile15
1 files changed, 12 insertions, 3 deletions
diff --git a/libs/libxml2/Makefile b/libs/libxml2/Makefile
index 327d50e11..e97d54df8 100644
--- a/libs/libxml2/Makefile
+++ b/libs/libxml2/Makefile
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=libxml2
PKG_VERSION:=2.9.9
-PKG_RELEASE:=3
+PKG_RELEASE:=4
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://xmlsoft.org/sources/
@@ -136,8 +136,11 @@ HOST_CONFIGURE_ARGS += \
define Build/InstallDev
$(INSTALL_DIR) $(2)/bin
- $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/xml2-config $(2)/bin/
- $(SED) 's,^\(prefix\|exec_prefix\)=.*,\1=$(STAGING_DIR)/usr,g' $(2)/bin/xml2-config
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/xml2-config \
+ $(2)/bin/$(GNU_TARGET_NAME)-xml2-config
+ $(SED) 's,^\(prefix\|exec_prefix\)=.*,\1=$(STAGING_DIR)/usr,g' \
+ $(2)/bin/$(GNU_TARGET_NAME)-xml2-config
+ $(LN) $(GNU_TARGET_NAME)-xml2-config $(2)/bin/xml2-config
$(INSTALL_DIR) $(1)/usr/include
$(CP) $(PKG_INSTALL_DIR)/usr/include/libxml2 $(1)/usr/include/
@@ -156,6 +159,12 @@ define Build/InstallDev
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/aclocal/* $(2)/share/aclocal
endef
+define Host/Install
+ $(call Host/Install/Default)
+ mv $(1)/bin/xml2-config $(1)/bin/$(GNU_HOST_NAME)-xml2-config
+ $(LN) $(GNU_HOST_NAME)-xml2-config $(1)/bin/xml2-config
+endef
+
define Package/libxml2/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libxml2.so.* $(1)/usr/lib/