Update nmap to latest version
[gumsense-br.git] / package / libpcap / libpcap.mk
blob3f62363b567fd2c6e84c3a314aff46a6cea242c9
1 #############################################################
3 # libpcap
5 #############################################################
6 # Copyright (C) 2001-2003 by Erik Andersen <andersen@codepoet.org>
7 # Copyright (C) 2002 by Tim Riker <Tim@Rikers.org>
9 # This program is free software; you can redistribute it and/or modify
10 # it under the terms of the GNU Library General Public License as
11 # published by the Free Software Foundation; either version 2 of the
12 # License, or (at your option) any later version.
14 # This program is distributed in the hope that it will be useful, but
15 # WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 # Library General Public License for more details.
19 # You should have received a copy of the GNU Library General Public
20 # License along with this program; if not, write to the Free Software
21 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
22 # USA
24 LIBPCAP_VER:=0.9.4
25 LIBPCAP_DIR:=$(BUILD_DIR)/libpcap-$(LIBPCAP_VER)
26 LIBPCAP_SITE:=http://www.tcpdump.org/release
27 LIBPCAP_SOURCE:=libpcap-$(LIBPCAP_VER).tar.gz
28 LIBPCAP_CAT:=zcat
30 $(DL_DIR)/$(LIBPCAP_SOURCE):
31 $(WGET) -P $(DL_DIR) $(LIBPCAP_SITE)/$(LIBPCAP_SOURCE)
33 libpcap-source: $(DL_DIR)/$(LIBPCAP_SOURCE)
35 $(LIBPCAP_DIR)/.unpacked: $(DL_DIR)/$(LIBPCAP_SOURCE)
36 $(LIBPCAP_CAT) $(DL_DIR)/$(LIBPCAP_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
37 toolchain/patch-kernel.sh $(LIBPCAP_DIR) package/libpcap/ *.patch
38 touch $(LIBPCAP_DIR)/.unpacked
40 $(LIBPCAP_DIR)/.configured: $(LIBPCAP_DIR)/.unpacked
41 ( \
42 cd $(LIBPCAP_DIR) ; \
43 ac_cv_linux_vers=$(BR2_DEFAULT_KERNEL_HEADERS) \
44 BUILD_CC=$(TARGET_CC) HOSTCC="$(HOSTCC)" \
45 $(TARGET_CONFIGURE_OPTS) \
46 CFLAGS="$(TARGET_CFLAGS)" \
47 ./configure \
48 --target=$(GNU_TARGET_NAME) \
49 --host=$(GNU_TARGET_NAME) \
50 --build=$(GNU_HOST_NAME) \
51 --with-build-cc="$(HOSTCC)" \
52 --disable-yydebug \
53 --prefix=/usr \
54 --with-pcap=linux \
56 touch $(LIBPCAP_DIR)/.configured
58 $(LIBPCAP_DIR)/libpcap.a: $(LIBPCAP_DIR)/.configured
59 $(MAKE) \
60 CC="$(TARGET_CC)" \
61 AR="$(TARGET_CROSS)ar" \
62 -C $(LIBPCAP_DIR)
64 $(STAGING_DIR)/lib/libpcap.a: $(LIBPCAP_DIR)/libpcap.a
65 $(MAKE) \
66 -C $(LIBPCAP_DIR) \
67 prefix=$(STAGING_DIR) \
68 exec_prefix=$(STAGING_DIR) \
69 bindir=$(STAGING_DIR)/bin \
70 datadir=$(STAGING_DIR)/share \
71 install
73 libpcap: uclibc zlib $(STAGING_DIR)/lib/libpcap.a
75 libpcap-clean:
76 rm -f $(STAGING_DIR)/include/pcap*.h $(STAGING_DIR)/lib/libpcap.a
77 -$(MAKE) -C $(LIBPCAP_DIR) clean
79 libpcap-dirclean:
80 rm -rf $(LIBPCAP_DIR)
81 #############################################################
83 # Toplevel Makefile options
85 #############################################################
86 ifeq ($(strip $(BR2_PACKAGE_LIBPCAP)),y)
87 TARGETS+=libpcap
88 endif