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