port libxml2 to buildroot-ng
[openwrt/svn-archive/archive.git] / libs / libxml2 / Makefile
1 #
2 # Copyright (C) 2006 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7 # $Id$
8
9 include $(TOPDIR)/rules.mk
10
11 PKG_NAME:=libxml2
12 PKG_VERSION:=2.6.20
13 PKG_RELEASE:=1
14
15 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
16 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
17 PKG_SOURCE_URL:=http://xmlsoft.org/sources/ \
18 ftp://fr.rpmfind.net/pub/libxml/
19 PKG_MD5SUM:=8f0b3ce721bda11401e656b90ba4e78c
20 PKG_CAT:=zcat
21
22 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
23
24 include $(INCLUDE_DIR)/package.mk
25
26 define Package/libxml2
27 SECTION:=libs
28 CATEGORY:=Libraries
29 DEPENDS:=+libpthread +zlib
30 TITLE:=Gnome XML library
31 DESCRIPTION:=A library for manipulating XML and HTML resources.
32 URL:=http://xmlsoft.org/
33 endef
34
35 define Build/Configure
36 (cd $(PKG_BUILD_DIR); rm -f config.cache; \
37 $(TARGET_CONFIGURE_OPTS) \
38 CFLAGS="$(strip $(TARGET_CFLAGS))" \
39 CPPFLAGS="-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include" \
40 LDFLAGS="-L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib" \
41 ./configure \
42 --target=$(GNU_TARGET_NAME) \
43 --host=$(GNU_TARGET_NAME) \
44 --build=$(GNU_HOST_NAME) \
45 --program-prefix="" \
46 --program-suffix="" \
47 --prefix=/usr \
48 --exec-prefix=/usr \
49 --bindir=/usr/bin \
50 --datadir=/usr/share \
51 --includedir=/usr/include \
52 --infodir=/usr/share/info \
53 --libdir=/usr/lib \
54 --libexecdir=/usr/lib \
55 --localstatedir=/var \
56 --mandir=/usr/share/man \
57 --sbindir=/usr/sbin \
58 --sysconfdir=/etc \
59 $(DISABLE_LARGEFILE) \
60 $(DISABLE_NLS) \
61 --enable-shared \
62 --enable-static \
63 --disable-rpath \
64 --with-gnu-ld \
65 --without-c14n \
66 --without-catalog \
67 --without-debug \
68 --without-docbook \
69 --with-html \
70 --without-ftp \
71 --without-http \
72 --without-iconv \
73 --without-iso8859x \
74 --without-legacy \
75 --with-output \
76 --without-pattern \
77 --without-push \
78 --without-python \
79 --with-reader \
80 --without-readline \
81 --without-regexps \
82 --with-sax1 \
83 --with-schemas \
84 --with-threads \
85 --with-tree \
86 --with-valid \
87 --with-writer \
88 --with-xinclude \
89 --with-xpath \
90 --with-xptr \
91 --with-zlib \
92 );
93 endef
94
95 define Build/Compile
96 rm -rf $(PKG_INSTALL_DIR)
97 mkdir -p $(PKG_INSTALL_DIR)
98 $(MAKE) -C $(PKG_BUILD_DIR) \
99 DESTDIR="$(PKG_INSTALL_DIR)" \
100 all install
101 endef
102
103 define Package/libxml2/install
104 install -m0755 -d $(1)/usr/lib
105 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libxml2.so.* $(1)/usr/lib/
106 endef
107
108 define Build/InstallDev
109 mkdir -p $(STAGING_DIR)/usr/bin
110 $(CP) $(PKG_INSTALL_DIR)/usr/bin/xml2-config $(STAGING_DIR)/usr/bin/
111 mkdir -p $(STAGING_DIR)/usr/include
112 $(CP) $(PKG_INSTALL_DIR)/usr/include/libxml2 $(STAGING_DIR)/usr/include/
113 mkdir -p $(STAGING_DIR)/usr/lib
114 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libxml2.{a,so*} $(STAGING_DIR)/usr/lib/
115 mkdir -p $(STAGING_DIR)/usr/lib/pkgconfig
116 $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libxml-2.0.pc $(STAGING_DIR)/usr/lib/pkgconfig/
117 $(SED) 's,-I$$$${includedir}/libxml2,,g' $(STAGING_DIR)/usr/bin/xml2-config
118 $(SED) 's,-I$$$${includedir},,g' $(STAGING_DIR)/usr/bin/xml2-config
119 $(SED) 's,-I$(STAGING_DIR)/usr/include,,g' $(STAGING_DIR)/usr/bin/xml2-config
120 $(SED) 's,-L$$$${libdir},,g' $(STAGING_DIR)/usr/bin/xml2-config
121 $(SED) 's,-L$(STAGING_DIR)/usr/lib,,g' $(STAGING_DIR)/usr/bin/xml2-config
122 $(SED) 's,-I$$$${includedir}/libxml2,,g' $(STAGING_DIR)/usr/lib/pkgconfig/libxml-2.0.pc
123 $(SED) 's,-L$$$${libdir},,g' $(STAGING_DIR)/usr/lib/pkgconfig/libxml-2.0.pc
124 endef
125
126 define Build/UninstallDev
127 rm -rf \
128 $(STAGING_DIR)/usr/bin/xml2-config \
129 $(STAGING_DIR)/usr/include/libxml2 \
130 $(STAGING_DIR)/usr/lib/libxml2.{a,so*} \
131 $(STAGING_DIR)/usr/lib/pkgconfig/libxml-2.0.pc
132 endef
133
134 $(eval $(call BuildPackage,libxml2))