port expat to buildroot-ng
[openwrt/svn-archive/archive.git] / libs / expat / 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:=expat
12 PKG_VERSION:=1.95.8
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_MD5SUM:=aff487543845a82fe262e6e2922b4c8e
18 PKG_SOURCE_URL:=@SF/expat
19 PKG_CAT:=zcat
20
21 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
22
23 include $(INCLUDE_DIR)/package.mk
24
25 define Package/libexpat
26 SECTION:=libs
27 CATEGORY:=Libraries
28 TITLE:=An XML parsing library
29 DESCRIPTION:=A fast, non-validating, stream-oriented XML parsing library.
30 URL:=http://expat.sourceforge.net/
31 endef
32
33 define Build/Configure
34 (cd $(PKG_BUILD_DIR); rm -f config.cache; \
35 $(TARGET_CONFIGURE_OPTS) \
36 CFLAGS="$(TARGET_CFLAGS)" \
37 CPPFLAGS="-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include" \
38 LDFLAGS="-L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib" \
39 ./configure \
40 --target=$(GNU_TARGET_NAME) \
41 --host=$(GNU_TARGET_NAME) \
42 --build=$(GNU_HOST_NAME) \
43 --program-prefix="" \
44 --program-suffix="" \
45 --prefix=/usr \
46 --exec-prefix=/usr \
47 --bindir=/usr/bin \
48 --datadir=/usr/share \
49 --includedir=/usr/include \
50 --infodir=/usr/share/info \
51 --libdir=/usr/lib \
52 --libexecdir=/usr/lib \
53 --localstatedir=/var \
54 --mandir=/usr/share/man \
55 --sbindir=/usr/sbin \
56 --sysconfdir=/etc \
57 $(DISABLE_NLS) \
58 $(DISABLE_LARGEFILE) \
59 --enable-shared \
60 --enable-static \
61 );
62 endef
63
64 define Build/Compile
65 rm -rf $(PKG_INSTALL_DIR)
66 mkdir -p $(PKG_INSTALL_DIR)
67 $(MAKE) -C $(PKG_BUILD_DIR) \
68 DESTDIR="$(PKG_INSTALL_DIR)" \
69 all install
70 endef
71
72 define Package/libexpat/install
73 install -m0755 -d $(1)/usr/lib
74 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libexpat.so.* $(1)/usr/lib/
75 endef
76
77 define Build/InstallDev
78 mkdir -p $(STAGING_DIR)/usr/bin
79 $(CP) $(PKG_INSTALL_DIR)/usr/bin/xmlwf $(STAGING_DIR)/usr/bin/
80 mkdir -p $(STAGING_DIR)/usr/include
81 $(CP) $(PKG_INSTALL_DIR)/usr/include/expat*.h $(STAGING_DIR)/usr/include/
82 mkdir -p $(STAGING_DIR)/usr/lib
83 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libexpat.{a,so*} $(STAGING_DIR)/usr/lib/
84 endef
85
86 define Build/UninstallDev
87 rm -rf \
88 $(STAGING_DIR)/usr/bin/xmlwf \
89 $(STAGING_DIR)/usr/include/expat*.h \
90 $(STAGING_DIR)/usr/lib/libexpat.{a,so*}
91 endef
92
93 $(eval $(call BuildPackage,libexpat))