source: trunk/package/libpcap/Makefile @ 20909

Last change on this file since 20909 was 20909, checked in by nico, 6 years ago

package/libpcap: move configuration to submenu

  • Property svn:copyright set to Copyright (C) 2006 OpenWrt.org
  • Property svn:eol-style set to native
File size: 1.9 KB
Line 
1#
2# Copyright (C) 2006-2010 OpenWrt.org
3#
4# This is free software, licensed under the GNU General Public License v2.
5# See /LICENSE for more information.
6#
7
8include $(TOPDIR)/rules.mk
9
10PKG_NAME:=libpcap
11PKG_VERSION:=1.0.0
12PKG_RELEASE:=2
13
14PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15PKG_SOURCE_URL:=http://www.tcpdump.org/release/
16PKG_MD5SUM:=9ad1358c5dec48456405eac197a46d3d
17
18PKG_INSTALL:=1
19
20include $(INCLUDE_DIR)/package.mk
21include $(INCLUDE_DIR)/kernel.mk
22
23define Package/libpcap
24  SECTION:=libs
25  CATEGORY:=Libraries
26  TITLE:=Low-level packet capture library
27  URL:=http://www.tcpdump.org/
28  MENU:=1
29endef
30
31define Package/libpcap/description
32This package contains a system-independent library for user-level network packet
33capture.
34endef
35
36define Package/libpcap/config
37        source "$(SOURCE)/Config.in"
38endef
39
40TARGET_CFLAGS += \
41        -ffunction-sections \
42        -fdata-sections
43
44CONFIGURE_VARS += \
45        ac_cv_linux_vers=$(LINUX_VERSION)
46
47CONFIGURE_ARGS += \
48        --enable-shared \
49        --enable-static \
50        --disable-yydebug \
51        --enable-ipv6 \
52        --with-build-cc="$(HOSTCC)" \
53        --with-pcap=linux \
54        --without-septel \
55        --without-dag
56
57MAKE_FLAGS += \
58        CCOPT="$(TARGET_CFLAGS) -I$(BUILD_DIR)/linux/include"
59
60define Build/Configure
61        $(call Build/Configure/Default)
62        $(if $(CONFIG_PCAP_HAS_USB),,$(SED) '/^#define PCAP_SUPPORT_USB/D' $(PKG_BUILD_DIR)/config.h)
63        $(if $(CONFIG_PCAP_HAS_USB),,$(SED) 's/pcap-usb-linux.c *//' $(PKG_BUILD_DIR)/Makefile)
64        $(if $(CONFIG_PCAP_HAS_BT),,$(SED) '/^#define PCAP_SUPPORT_BT/D' $(PKG_BUILD_DIR)/config.h)
65        $(if $(CONFIG_PCAP_HAS_BT),,$(SED) 's/pcap-bt-linux.c *//' $(PKG_BUILD_DIR)/Makefile)
66endef
67
68define Build/InstallDev
69        $(INSTALL_DIR) $(1)/usr/include
70        $(CP) $(PKG_INSTALL_DIR)/usr/include/pcap* $(1)/usr/include/
71
72        $(INSTALL_DIR) $(1)/usr/lib
73        $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpcap.{a,so*} $(1)/usr/lib/
74endef
75
76define Package/libpcap/install
77        $(INSTALL_DIR) $(1)/usr/lib
78        $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpcap.so* $(1)/usr/lib/
79endef
80
81$(eval $(call BuildPackage,libpcap))
Note: See TracBrowser for help on using the repository browser.