source: trunk/package/libpcap/Makefile @ 19997

Last change on this file since 19997 was 19997, checked in by thepeople, 7 years ago

this patch uses PKG_INSTALL:=1 and simplifies the Makefile,
separates the menuconfig options in a separates Config.in file,
adds a new patch to disable man pages (there was an error with QUILT=1
without this patch, as ln was used without -f),
renames patches to be more explicit (and 1xx for Makefile patches and
2xx for source patches)

-Raphael

  • 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/
28endef
29
30define Package/libpcap/description
31This package contains a system-independent library for user-level network packet
32capture.
33endef
34
35define Package/libpcap/config
36source "$(SOURCE)/Config.in"
37endef
38
39TARGET_CFLAGS += \
40        -ffunction-sections \
41        -fdata-sections
42
43CONFIGURE_VARS += \
44        ac_cv_linux_vers=$(LINUX_VERSION)
45
46CONFIGURE_ARGS += \
47        --enable-shared \
48        --enable-static \
49        --disable-yydebug \
50        --enable-ipv6 \
51        --with-build-cc="$(HOSTCC)" \
52        --with-pcap=linux \
53        --without-septel \
54        --without-dag
55
56MAKE_FLAGS += \
57        CCOPT="$(TARGET_CFLAGS) -I$(BUILD_DIR)/linux/include"
58
59define 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)
65endef
66
67define Build/InstallDev
68        $(INSTALL_DIR) $(1)/usr/include
69        $(CP) $(PKG_INSTALL_DIR)/usr/include/pcap* $(1)/usr/include/
70
71        $(INSTALL_DIR) $(1)/usr/lib
72        $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpcap.{a,so*} $(1)/usr/lib/
73endef
74
75define Package/libpcap/install
76        $(INSTALL_DIR) $(1)/usr/lib
77        $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpcap.so* $(1)/usr/lib/
78endef
79
80$(eval $(call BuildPackage,libpcap))
Note: See TracBrowser for help on using the repository browser.