From 6e5977094ecc616558d46fea5bfea9df1934d3da Mon Sep 17 00:00:00 2001 From: Sebastian Kemper Date: Tue, 22 Oct 2019 23:58:12 +0200 Subject: [PATCH 1/2] libxml2/host: revert xml2-config prefix fix Commit 218f0229a4594b32d9db6ad0678cdce7e2663e27 added a workaround for a problem. The host compile overwrote xml2-config in "$(STAGING_DIR)/host/bin". The workaround fixed the issue for regular target packages. But it didn't leave a proper xml2-config script for host packages. Times have changed. Host packages are now installed in "$(STAGING_DIR_HOSTPKG). So there is no longer any danger of the host package overwriting the xml2-config script for target packages. So revert the mentioned commit, leaving us with two proper xml2-config scripts, one for target package builds and one for host package builds. Signed-off-by: Sebastian Kemper --- libs/libxml2/Makefile | 5 ----- 1 file changed, 5 deletions(-) diff --git a/libs/libxml2/Makefile b/libs/libxml2/Makefile index 445044e10..328baa643 100644 --- a/libs/libxml2/Makefile +++ b/libs/libxml2/Makefile @@ -133,10 +133,5 @@ define Package/libxml2/install $(CP) $(PKG_INSTALL_DIR)/usr/lib/libxml2.so* $(1)/usr/lib/ endef -define Host/Install - $(SED) 's,^\(prefix\|exec_prefix\)=.*,\1=$(STAGING_DIR)/usr,g' $(HOST_BUILD_DIR)/xml2-config - $(call Host/Install/Default) -endef - $(eval $(call HostBuild)) $(eval $(call BuildPackage,libxml2)) From 0eb7b3e4ed045757e7c019b2a3a18cf92906ab87 Mon Sep 17 00:00:00 2001 From: Sebastian Kemper Date: Sun, 27 Oct 2019 10:06:35 +0100 Subject: [PATCH 2/2] 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 --- libs/libxml2/Makefile | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/libs/libxml2/Makefile b/libs/libxml2/Makefile index 328baa643..7ec48524a 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:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=http://xmlsoft.org/sources/ @@ -108,8 +108,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/ @@ -128,6 +131,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/