Merge branch 'master' of git://repo.or.cz/buildroot
[buildroot.git] / package / libxml2 / libxml2.mk
blobcc2f225d88255ca51487e634ce50a01b5d90a33d
1 #############################################################
3 # libxml2
5 #############################################################
7 LIBXML2_VERSION=2.6.29
8 LIBXML2_SOURCE=libxml2-sources-$(LIBXML2_VERSION).tar.gz
9 LIBXML2_SITE=ftp://xmlsoft.org/libxml2
10 LIBXML2_DIR=$(BUILD_DIR)/libxml2-$(LIBXML2_VERSION)
11 LIBXML2_CAT:=$(ZCAT)
13 $(DL_DIR)/$(LIBXML2_SOURCE):
14 $(WGET) -P $(DL_DIR) $(LIBXML2_SITE)/$(LIBXML2_SOURCE)
16 $(LIBXML2_DIR)/.unpacked: $(DL_DIR)/$(LIBXML2_SOURCE)
17 $(LIBXML2_CAT) $(DL_DIR)/$(LIBXML2_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
18 touch $(LIBXML2_DIR)/.unpacked
20 $(LIBXML2_DIR)/.configured: $(LIBXML2_DIR)/.unpacked
21 (cd $(LIBXML2_DIR); rm -rf config.cache; \
22 $(TARGET_CONFIGURE_OPTS) \
23 $(TARGET_CONFIGURE_ARGS) \
24 ./configure \
25 --target=$(GNU_TARGET_NAME) \
26 --host=$(GNU_TARGET_NAME) \
27 --build=$(GNU_HOST_NAME) \
28 --prefix=/usr \
29 --exec-prefix=/usr \
30 --bindir=/usr/bin \
31 --sbindir=/usr/sbin \
32 --libexecdir=/usr/lib \
33 --sysconfdir=/etc \
34 --datadir=/usr/share \
35 --localstatedir=/var \
36 --mandir=/usr/man \
37 --infodir=/usr/info \
38 --includedir=/usr/include \
39 --with-gnu-ld \
40 --enable-shared \
41 --enable-static \
42 --enable-ipv6=no \
43 --without-debugging \
44 --without-python \
45 --without-threads \
46 $(DISABLE_NLS) \
48 touch $(LIBXML2_DIR)/.configured
50 $(STAGING_DIR)/usr/lib/libxml2.so: $(LIBXML2_DIR)/.configured
51 $(MAKE) CC=$(TARGET_CC) -C $(LIBXML2_DIR)
52 $(MAKE) DESTDIR=$(STAGING_DIR) -C $(LIBXML2_DIR) install
53 rm -f $(STAGING_DIR)/usr/lib/libxml2.la
54 $(SED) 's:prefix=/usr:prefix=$(STAGING_DIR)/usr:' \
55 -e 's:includedir=/usr/include:includedir=$(STAGING_DIR)/usr/include:' \
56 $(STAGING_DIR)/usr/bin/xml2-config
58 $(TARGET_DIR)/usr/lib/libxml2.so: $(STAGING_DIR)/usr/lib/libxml2.so
59 mkdir -p $(TARGET_DIR)/usr/include $(TARGET_DIR)/usr/lib
60 cp -dpf $(STAGING_DIR)/usr/lib/libxml2.so* $(TARGET_DIR)/usr/lib/
61 $(STRIPCMD) $(STRIP_STRIP_UNNEEDED) $(TARGET_DIR)/usr/lib/libxml2.so*
63 $(TARGET_DIR)/usr/lib/libxml2.a: $(STAGING_DIR)/usr/lib/libxml2.so
64 cp -dpf $(STAGING_DIR)/usr/lib/libxml2.*a $(TARGET_DIR)/usr/lib/
66 libxml2: uclibc $(TARGET_DIR)/usr/lib/libxml2.so libxml2-headers
68 $(STAGING_DIR)/usr/include/libxml2: $(TARGET_DIR)/usr/lib/libxml2.so
69 cp -af $(LIBXML2_DIR)/include/libxml $(STAGING_DIR)/usr/include/libxml2
70 touch -c $@
72 $(TARGET_DIR)/usr/include/libxml2: libxml2-headers
73 cp -af $(LIBXML2_DIR)/usr/include/libxml2 $(TARGET_DIR)/usr/include/libxml2
74 touch -c $@
76 $(TARGET_DIR)/usr/include/libxml: libxml2-headers
77 ln -s libxml2/libxml $(LIBXML2_DIR)/usr/include/libxml
78 touch -c $@
80 libxml2-headers: $(STAGING_DIR)/usr/include/libxml2
82 libxml2-target-headers: $(TARGET_DIR)/usr/include/libxml2 \
83 $(TARGET_DIR)/usr/include/libxml2 \
84 $(TARGET_DIR)/usr/lib/libxml2.a
86 libxml2-source: $(DL_DIR)/$(LIBXML2_SOURCE)
88 libxml2-clean:
89 @if [ -d $(LIBXML2_DIR)/Makefile ]; then \
90 -$(MAKE) -C $(LIBXML2_DIR) clean; \
92 rm -f $(STAGING_DIR)/usr/lib/libxml2.*
93 rm -f $(TARGET_DIR)/usr/lib/libxml2.*
96 libxml2-dirclean:
97 rm -rf $(LIBXML2_DIR)
99 .PHONY: libxml2-headers libxml2-target-headers
100 #############################################################
102 # Toplevel Makefile options
104 #############################################################
105 ifeq ($(BR2_PACKAGE_LIBXML2),y)
106 TARGETS+=libxml2
107 endif
108 ifeq ($(BR2_PACKAGE_LIBXML2_TARGET_HEADERS),y)
109 TARGETS+=libxml2-target-headers
110 endif