This repository has been archived by the owner on Jan 31, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathlibxml.mk
90 lines (65 loc) · 2.36 KB
/
libxml.mk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#####################################################
# libxml for the Blackfin
# Based on Astfin2 libxml.mk
#####################################################
include rules.mk
LIBXML_SITE=ftp://xmlsoft.org/libxml2
LIBXML_VERSION=2.7.3
LIBXML_SOURCE=libxml2-sources-$(LIBXML_VERSION).tar.gz
LIBXML_UNZIP=zcat
LIBXML_CONFIGURE_OPTS=--host=bfin-linux-uclibc --build=i686-linux \
--without-python --prefix=$(TARGET_DIR) \
--libdir=$(STAGING_DIR)/usr/lib
LIBXML_DIR=$(BUILD_DIR)/libxml2-$(LIBXML_VERSION)
TARGET_DIR=$(BUILD_DIR)/tmp/libxml/ipkg/libxml
PKG_NAME:=libxml
PKG_VERSION:=$(LIBXML_VERSION)
PKG_RELEASE:=1
PKG_BUILD_DIR:=$(BUILD_DIR)/tmp/libxml
export CC=bfin-linux-uclibc-gcc
$(DL_DIR)/$(LIBXML_SOURCE):
$(WGET) -P $(DL_DIR) $(LIBXML_SITE)/$(LIBXML_SOURCE)
libxml-source: $(DL_DIR)/$(LIBXML_SOURCE)
$(LIBXML_DIR)/.unpacked: $(DL_DIR)/$(LIBXML_SOURCE)
$(LIBXML_UNZIP) $(DL_DIR)/$(LIBXML_SOURCE) | \
tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
touch $(LIBXML_DIR)/.unpacked
$(LIBXML_DIR)/.configured: $(LIBXML_DIR)/.unpacked
export CC=bfin-linux-uclibc-gcc
cd $(LIBXML_DIR); ./configure $(LIBXML_CONFIGURE_OPTS)
touch $(LIBXML_DIR)/.configured
libxml: $(LIBXML_DIR)/.configured
make -C $(LIBXML_DIR)
make -C $(LIBXML_DIR) install
# NOTE --libdir option above means libs are automatically
# installed in the staging dir, also means .la has correct
# path to staging dir. So now we set up libs on target:
rm -Rf $(TARGET_DIR)
mkdir -p $(TARGET_DIR)/lib
cp $(STAGING_DIR)/usr/lib/libxml2.so.2.7.3 $(TARGET_DIR)/lib
ln -sf libxml2.so.2.7.3 $(TARGET_DIR)/lib/libxml2.so
ln -sf libxml2.so.2.7.3 $(TARGET_DIR)/lib/libxml2.so.2
# strip is very effective - reduces .so size from 3M to 1M
$(STRIP) $(TARGET_DIR)/lib/libxml2.so.2.7.3
# remove other junk to save room on target
cd $(TARGET_DIR); rm -Rf bin include share
touch $(PKG_BUILD_DIR)/.built
all: libxml
libxml-dirclean:
rm -rf $(LIBXML_DIR)
define Package/libxml
SECTION:=libs
CATEGORY:=Libraries
TITLE:=Gnome XML library
DESCRIPTION:=\
A library for manipulating XML and HTML resources.
URL:=http://xmlsoft.org/
endef
#post installation - do nothing
define Package/$(PKG_NAME)/postinst
endef
#pre-remove
define Package/$(PKG_NAME)/prerm
endef
$(eval $(call BuildPackage,$(PKG_NAME)))
libxml-package: libxml $(PACKAGE_DIR)/$(PKG_NAME)_$(VERSION)_$(PKGARCH).ipk