2 # Copyright (C) 2006-2010 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 include $(TOPDIR
)/rules.mk
14 PKG_SOURCE
:=$(PKG_NAME
)-$(PKG_VERSION
).
tar.gz
15 PKG_SOURCE_URL
:=http
://www.tcpdump.org
/release
/
16 PKG_MD5SUM
:=9ad1358c5dec48456405eac197a46d3d
20 include $(INCLUDE_DIR
)/package.mk
21 include $(INCLUDE_DIR
)/kernel.mk
23 define Package
/libpcap
26 TITLE
:=Low-level packet capture library
27 URL
:=http
://www.tcpdump.org
/
30 define Package
/libpcap
/description
31 This package contains a system-independent library for user-level network packet
35 define Package
/libpcap
/config
36 source
"$(SOURCE)/Config.in"
44 ac_cv_linux_vers
=$(LINUX_VERSION
)
51 --with-build-cc
="$(HOSTCC)" \
57 CCOPT
="$(TARGET_CFLAGS) -I$(BUILD_DIR)/linux/include"
59 define Build
/Configure
60 $(call Build
/Configure
/Default
)
61 $(if
$(CONFIG_PCAP_HAS_USB
),,$(SED
) '/^#define PCAP_SUPPORT_USB/D' $(PKG_BUILD_DIR
)/config.h
)
62 $(if
$(CONFIG_PCAP_HAS_USB
),,$(SED
) 's/pcap-usb-linux.c *//' $(PKG_BUILD_DIR
)/Makefile
)
63 $(if
$(CONFIG_PCAP_HAS_BT
),,$(SED
) '/^#define PCAP_SUPPORT_BT/D' $(PKG_BUILD_DIR
)/config.h
)
64 $(if
$(CONFIG_PCAP_HAS_BT
),,$(SED
) 's/pcap-bt-linux.c *//' $(PKG_BUILD_DIR
)/Makefile
)
67 define Build
/InstallDev
68 $(INSTALL_DIR
) $(1)/usr
/include
69 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/pcap
* $(1)/usr
/include/
71 $(INSTALL_DIR
) $(1)/usr
/lib
72 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libpcap.
{a
,so
*} $(1)/usr
/lib
/
75 define Package
/libpcap
/install
76 $(INSTALL_DIR
) $(1)/usr
/lib
77 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libpcap.so
* $(1)/usr
/lib
/
80 $(eval
$(call BuildPackage
,libpcap
))