aboutsummaryrefslogtreecommitdiff
path: root/package/libxml2
diff options
context:
space:
mode:
authorGravatar Thomas Petazzoni <thomas.petazzoni@free-electrons.com>2009-04-29 07:13:20 +0000
committerGravatar Thomas Petazzoni <thomas.petazzoni@free-electrons.com>2009-04-29 07:13:20 +0000
commitb7c3eb7aa732fb04cd86acd42eb0ed2b8c15370d (patch)
treef42697f930bf71726514e4a38f0fa33333f2a771 /package/libxml2
parentc9adae97af0f71289da0c1c543de4f52ea8a5b64 (diff)
downloadbuildroot-b7c3eb7aa732fb04cd86acd42eb0ed2b8c15370d.tar.gz
buildroot-b7c3eb7aa732fb04cd86acd42eb0ed2b8c15370d.tar.bz2
Add libxml2 for the host
Some other packages, such as shared-mime-info, might need libxml2 and related tools (xmllint, etc.) to be available on the host. This patch modifies tthe libxml2 Makefile to compile libxml2 for the host, in $(HOST_DIR). Patch from Sven Neumann <s.neumann@raumfeld.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Diffstat (limited to 'package/libxml2')
-rw-r--r--package/libxml2/libxml2.mk46
1 files changed, 46 insertions, 0 deletions
diff --git a/package/libxml2/libxml2.mk b/package/libxml2/libxml2.mk
index e183de50da..eca96ea89c 100644
--- a/package/libxml2/libxml2.mk
+++ b/package/libxml2/libxml2.mk
@@ -34,3 +34,49 @@ $(LIBXML2_HOOK_POST_INSTALL):
$(TARGET_DIR)/usr/share/doc/libxml2-$(LIBXML2_VERSION) \
$(TARGET_DIR)/usr/share/gtk-doc
touch $@
+
+# libxml2 for the host
+LIBXML2_HOST_DIR:=$(BUILD_DIR)/libxml2-$(LIBXML2_VERSION)-host
+LIBXML2_HOST_BINARY:=$(HOST_DIR)/usr/bin/xmllint
+
+$(DL_DIR)/$(LIBXML2_SOURCE):
+ $(call DOWNLOAD,$(LIBXML2_SITE),$(LIBXML2_SOURCE))
+
+$(STAMP_DIR)/host_libxml2_unpacked: $(DL_DIR)/$(LIBXML2_SOURCE)
+ mkdir -p $(LIBXML2_HOST_DIR)
+ $(INFLATE$(suffix $(LIBXML2_SOURCE))) $< | \
+ $(TAR) $(TAR_STRIP_COMPONENTS)=1 -C $(LIBXML2_HOST_DIR) $(TAR_OPTIONS) -
+ touch $@
+
+$(STAMP_DIR)/host_libxml2_configured: $(STAMP_DIR)/host_libxml2_unpacked $(STAMP_DIR)/host_pkgconfig_installed
+ (cd $(LIBXML2_HOST_DIR); rm -rf config.cache; \
+ $(HOST_CONFIGURE_OPTS) \
+ CFLAGS="$(HOST_CFLAGS)" \
+ LDFLAGS="$(HOST_LDFLAGS)" \
+ ./configure \
+ --prefix="$(HOST_DIR)/usr" \
+ --sysconfdir="$(HOST_DIR)/etc" \
+ --enable-shared --without-debugging --without-python \
+ --without-threads \
+ )
+ touch $@
+
+$(STAMP_DIR)/host_libxml2_compiled: $(STAMP_DIR)/host_libxml2_configured
+ $(MAKE) -C $(LIBXML2_HOST_DIR)
+ touch $@
+
+$(STAMP_DIR)/host_libxml2_installed: $(STAMP_DIR)/host_libxml2_compiled
+ $(HOST_MAKE_ENV) $(MAKE) -C $(LIBXML2_HOST_DIR) install
+ touch $@
+
+host-libxml2: $(STAMP_DIR)/host_libxml2_installed
+
+host-libxml2-source: libxml2-source
+
+host-libxml2-clean:
+ rm -f $(addprefix $(STAMP_DIR)/host_libxml2_,unpacked configured compiled installed)
+ -$(MAKE) -C $(LIBXML2_HOST_DIR) uninstall
+ -$(MAKE) -C $(LIBXML2_HOST_DIR) clean
+
+host-libxml2-dirclean:
+ rm -rf $(LIBXML2_HOST_DIR)