moved
[openwrt.git] / obsolete-buildroot / make / libpcap.mk
1 ## libpcap
2
3 LIBPCAP_VERSION:=0.8.3
4 LIBPCAP_RELEASE:=1
5
6 LIBPCAP_SOURCE:=libpcap-$(LIBPCAP_VERSION).tar.gz
7 LIBPCAP_SITE:=http://www.tcpdump.org/release/
8 LIBPCAP_DIR:=$(BUILD_DIR)/libpcap-$(LIBPCAP_VERSION)
9 LIBPCAP_CAT:=zcat
10
11 LIBPCAP_PATCH_DIR := $(SOURCE_DIR)/openwrt/patches/libpcap
12
13 LIBPCAP_BUILD_DIR := $(BUILD_DIR)/libpcap_$(LIBPCAP_VERSION)-$(LIBPCAP_RELEASE)
14 LIBPCAP_IPK_DIR := $(OPENWRT_IPK_DIR)/libpcap
15 LIBPCAP_IPK := $(LIBPCAP_BUILD_DIR)_$(ARCH).ipk
16
17
18 $(DL_DIR)/$(LIBPCAP_SOURCE):
19 $(WGET) -P $(DL_DIR) $(LIBPCAP_SITE)/$(LIBPCAP_SOURCE)
20
21
22 $(LIBPCAP_DIR)/.stamp-unpacked: $(DL_DIR)/$(LIBPCAP_SOURCE)
23 $(LIBPCAP_CAT) $(DL_DIR)/$(LIBPCAP_SOURCE) | tar -C $(BUILD_DIR) -xvf -
24
25 touch $(LIBPCAP_DIR)/.stamp-unpacked
26
27
28 $(LIBPCAP_DIR)/.stamp-patched: $(LIBPCAP_DIR)/.stamp-unpacked
29 $(SOURCE_DIR)/patch-kernel.sh $(LIBPCAP_DIR) $(LIBPCAP_PATCH_DIR)
30 $(SOURCE_DIR)/patch-kernel.sh $(LIBPCAP_DIR) $(LIBPCAP_DIR)/debian/patches *patch
31
32 touch $(LIBPCAP_DIR)/.stamp-patched
33
34
35 $(LIBPCAP_DIR)/.stamp-configured: $(LIBPCAP_DIR)/.stamp-patched
36 cd $(LIBPCAP_DIR) ; \
37 rm -rf config.cache ; \
38 $(TARGET_CONFIGURE_OPTS) \
39 CFLAGS="$(TARGET_CFLAGS)" \
40 ac_cv_linux_vers="2" \
41 ./configure \
42 --target=$(GNU_TARGET_NAME) \
43 --host=$(GNU_TARGET_NAME) \
44 --build=$(GNU_HOST_NAME) \
45 --prefix=/usr \
46 --exec-prefix=/usr \
47 --bindir=/usr/bin \
48 --sbindir=/usr/sbin \
49 --libexecdir=/usr/lib/locate \
50 --sysconfdir=/etc \
51 --datadir=/usr/share \
52 --localstatedir=/var/lib \
53 --mandir=/usr/share/man \
54 --infodir=/usr/share/info \
55 --includedir=/usr/include \
56 --libdir=/usr/lib \
57 $(DISABLE_NLS) \
58 --enable-shared \
59 --disable-static \
60 --with-pcap=linux \
61
62 touch $(LIBPCAP_DIR)/.stamp-configured
63
64
65 $(LIBPCAP_DIR)/.stamp-built: $(LIBPCAP_DIR)/.stamp-configured
66 cd $(LIBPCAP_DIR) ; \
67 $(MAKE) \
68 CC=$(TARGET_CC) \
69 CCOPT="$(TARGET_OPTIMIZATION)" \
70
71 touch $(LIBPCAP_DIR)/.stamp-built
72
73
74 $(LIBPCAP_DIR)/.stamp-installed: $(LIBPCAP_DIR)/.stamp-built
75 mkdir -p $(LIBPCAP_BUILD_DIR)
76 cd $(LIBPCAP_DIR) ; \
77 $(MAKE) \
78 DESTDIR="$(LIBPCAP_BUILD_DIR)" \
79 install \
80
81 install -m0644 $(LIBPCAP_BUILD_DIR)/usr/include/pcap*.h $(STAGING_DIR)/include/
82 install -m0644 $(LIBPCAP_BUILD_DIR)/usr/lib/libpcap.a $(STAGING_DIR)/lib/
83 install -m0755 $(LIBPCAP_BUILD_DIR)/usr/lib/libpcap.so* $(STAGING_DIR)/lib/
84
85 rm -rf $(LIBPCAP_BUILD_DIR)/usr/share
86 rm -rf $(LIBPCAP_BUILD_DIR)/usr/include
87 rm -rf $(LIBPCAP_BUILD_DIR)/usr/lib/*.a
88 rm -rf $(LIBPCAP_BUILD_DIR)/usr/lib/*.so
89
90 $(STRIP) $(LIBPCAP_BUILD_DIR)/usr/lib/libpcap.so.*
91
92 touch $(LIBPCAP_DIR)/.stamp-installed
93
94
95 $(LIBPCAP_IPK): $(LIBPCAP_DIR)/.stamp-installed
96 cp -a $(LIBPCAP_IPK_DIR)/CONTROL $(LIBPCAP_BUILD_DIR)/
97 perl -pi -e "s/^Vers.*:.*$$/Version: $(LIBPCAP_VERSION)-$(LIBPCAP_RELEASE)/" $(LIBPCAP_BUILD_DIR)/CONTROL/control
98 perl -pi -e "s/^Arch.*:.*$$/Architecture: $(ARCH)/" $(LIBPCAP_BUILD_DIR)/CONTROL/control
99 cd $(BUILD_DIR); $(IPKG_BUILD) $(LIBPCAP_BUILD_DIR)
100
101
102 libpcap-source: $(DL_DIR)/$(LIBPCAP_SOURCE)
103
104 libpcap-ipk: ipkg-utils $(LIBPCAP_IPK)
105
106 libpcap-clean:
107 $(MAKE) -C $(LIBPCAP_DIR) clean
108
109 libpcap-clean-all:
110 rm -rf $(LIBPCAP_DIR)
111 rm -rf $(LIBPCAP_BUILD_DIR)
112 rm -rf $(LIBPCAP_IPK)
113 rm -rf $(STAGING_DIR)/include/pcap*.h
114 rm -rf $(STAGING_DIR)/lib/libpcap.a
115 rm -rf $(STAGING_DIR)/lib/libpcap.so*
This page took 0.04673 seconds and 5 git commands to generate.