add libpcap
[openwrt.git] / openwrt / package / libpcap / Makefile
1 include $(TOPDIR)/rules.mk
2
3 PKG_NAME := libpcap
4 PKG_VERSION := 0.8.3
5 PKG_RELEASE := 1
6
7 PKG_SOURCE_SITE := http://www.tcpdump.org/release
8 PKG_SOURCE_FILE := $(PKG_NAME)-$(PKG_VERSION).tar.gz
9 PKG_SOURCE_CAT := zcat
10 PKG_SOURCE_DIR := $(PKG_NAME)-$(PKG_VERSION)
11 PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_SOURCE_DIR)
12
13
14 $(DL_DIR)/$(PKG_SOURCE_FILE):
15 mkdir -p $(DL_DIR)
16 $(WGET) -P $(DL_DIR) $(PKG_SOURCE_SITE)/$(PKG_SOURCE_FILE)
17
18 $(PKG_BUILD_DIR)/.patched: $(DL_DIR)/$(PKG_SOURCE_FILE)
19 mkdir -p $(TOOL_BUILD_DIR)
20 $(PKG_SOURCE_CAT) $(DL_DIR)/$(PKG_SOURCE_FILE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
21 $(PATCH) $(PKG_BUILD_DIR) . ./patches
22 touch $(PKG_BUILD_DIR)/.patched
23
24 $(PKG_BUILD_DIR)/.configured: $(PKG_BUILD_DIR)/.patched
25 (cd $(PKG_BUILD_DIR); rm -rf config.cache; \
26 ac_cv_linux_vers=$(BR2_DEFAULT_KERNEL_HEADERS) \
27 BUILD_CC=$(TARGET_CC) HOSTCC=$(HOSTCC) \
28 $(TARGET_CONFIGURE_OPTS) \
29 CFLAGS="$(TARGET_CFLAGS)" \
30 ./configure \
31 --target=$(GNU_TARGET_NAME) \
32 --host=$(GNU_TARGET_NAME) \
33 --build=$(GNU_HOST_NAME) \
34 --with-build-cc=$(HOSTCC) \
35 --disable-yydebug \
36 --prefix=/usr \
37 --with-pcap=linux \
38 );
39 touch $(PKG_BUILD_DIR)/.configured
40
41 $(PKG_BUILD_DIR)/libpcap.a: $(PKG_BUILD_DIR)/.configured
42 $(MAKE) AR="$(TARGET_CROSS)ar" -C $(PKG_BUILD_DIR)
43
44 $(STAGING_DIR)/lib/libpcap.a: $(PKG_BUILD_DIR)/libpcap.a
45 $(MAKE) -C $(PKG_BUILD_DIR) \
46 prefix=$(STAGING_DIR) \
47 exec_prefix=$(STAGING_DIR) \
48 bindir=$(STAGING_DIR)/bin \
49 datadir=$(STAGING_DIR)/share \
50 install
51
52 source: $(DL_DIR)/$(PKG_SOURCE_FILE)
53 prepare: $(PKG_BUILD_DIR)/.patched
54 compile: $(STAGING_DIR)/lib/libpcap.a
55 install:
56
57 clean:
58 rm -rf $(PKG_BUILD_DIR)
59 rm -f $(STAGING_DIR)/lib/libpcap*
60
This page took 0.048378 seconds and 5 git commands to generate.