root/floppyfw-3.0/makefiles/libpcap.mk

Revision 202, 2.9 KB (checked in by root, 5 years ago)

Cleaning up a little.

Line 
1#############################################################
2#
3# libpcap
4#
5#############################################################
6# Copyright (C) 2001-2003 by Erik Andersen <andersen@codepoet.org>
7# Copyright (C) 2002 by Tim Riker <Tim@Rikers.org>
8#
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.
13#
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.
18#
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
23
24LIBPCAP_VER:=0.9.4
25LIBPCAP_DIR:=$(BUILD_DIR)/libpcap-$(LIBPCAP_VER)
26LIBPCAP_SITE:=http://www.tcpdump.org/release
27LIBPCAP_SOURCE:=libpcap-$(LIBPCAP_VER).tar.gz
28LIBPCAP_CAT:=zcat
29
30$(DL_DIR)/$(LIBPCAP_SOURCE):
31         $(WGET) -P $(DL_DIR) $(LIBPCAP_SITE)/$(LIBPCAP_SOURCE)
32
33# We don't need any destdir for this.
34# I'll keep it for now anyway.
35LIBPCAP_DESTDIR=$(PACKAGES_DIR)/tcpdump
36
37libpcap-source: $(DL_DIR)/$(LIBPCAP_SOURCE)
38
39$(LIBPCAP_DIR)/.unpacked: $(DL_DIR)/$(LIBPCAP_SOURCE)
40        $(LIBPCAP_CAT) $(DL_DIR)/$(LIBPCAP_SOURCE) | tar -C $(BUILD_DIR) -xf -
41        # toolchain/patch-kernel.sh $(LIBPCAP_DIR) package/libpcap/ *.patch
42        touch $(LIBPCAP_DIR)/.unpacked
43
44$(LIBPCAP_DIR)/.configured: $(LIBPCAP_DIR)/.unpacked
45        ( \
46                cd $(LIBPCAP_DIR) ; \
47                ac_cv_linux_vers=$(LINUX_VERSION) \
48                BUILD_CC=$(TARGET_CC) HOSTCC="$(HOSTCC)" \
49                $(TARGET_CONFIGURE_OPTS) \
50                CFLAGS="$(TARGET_CFLAGS)" \
51                ./configure \
52                --build=$(GNU_HOST_NAME) \
53                --with-build-cc="$(HOSTCC)" \
54                --disable-yydebug \
55                --prefix=/usr \
56                --with-pcap=linux \
57        )
58        $(SED) "s/sed -e/perl -p -e/" $(LIBPCAP_DIR)/Makefile
59        $(SED) "s/-O2//" $(LIBPCAP_DIR)/Makefile
60        touch $(LIBPCAP_DIR)/.configured
61
62$(LIBPCAP_DIR)/libpcap.a: $(LIBPCAP_DIR)/.configured
63        $(MAKE) \
64                CC="$(TARGET_CC)" \
65                AR="$(TARGET_CROSS)ar" \
66                -C $(LIBPCAP_DIR)
67
68# The observant reader will find this not in use.
69$(LIBPCAP_DESTDIR)/usr/lib/libpcap.a: $(LIBPCAP_DIR)/libpcap.a
70        mkdir -p $(LIBPCAP_DESTDIR)
71        $(MAKE) \
72                -C $(LIBPCAP_DIR) \
73                DESTDIR=$(LIBPCAP_DESTDIR) \
74                install
75        rm -rf $(LIBPCAP_DESTDIR)/usr/man
76
77libpcap: uclibc $(LIBPCAP_DIR)/libpcap.a
78
79libpcap-clean:
80        rm -f $(LIBPCAP_DESTDIR)/include/pcap*.h $(LIBPCAP_DESTDIR)/lib/libpcap.a
81        -$(MAKE) -C $(LIBPCAP_DIR) clean
82
83libpcap-dirclean:
84        rm -rf $(LIBPCAP_DIR)
85#############################################################
86#
87# Toplevel Makefile options
88#
89#############################################################
90ifeq ($(strip $(BR2_PACKAGE_LIBPCAP)),y)
91TARGETS+=libpcap
92endif
Note: See TracBrowser for help on using the browser.