1
0

Makefile 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. #
  2. # Copyright (C) 2006-2013 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. include $(TOPDIR)/rules.mk
  8. PKG_NAME:=libpcap
  9. PKG_VERSION:=1.8.1
  10. PKG_RELEASE:=1
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  12. PKG_SOURCE_URL:=http://www.tcpdump.org/release/
  13. PKG_HASH:=673dbc69fdc3f5a86fb5759ab19899039a8e5e6c631749e48dcd9c6f0c83541e
  14. PKG_FIXUP:=patch-libtool
  15. PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
  16. PKG_INSTALL:=1
  17. PKG_BUILD_PARALLEL:=1
  18. PKG_LICENSE:=BSD-3-Clause
  19. include $(INCLUDE_DIR)/package.mk
  20. include $(INCLUDE_DIR)/kernel.mk
  21. define Package/libpcap
  22. SECTION:=libs
  23. CATEGORY:=Libraries
  24. TITLE:=Low-level packet capture library
  25. URL:=http://www.tcpdump.org/
  26. MENU:=1
  27. endef
  28. define Package/libpcap/description
  29. This package contains a system-independent library for user-level network packet
  30. capture.
  31. endef
  32. define Package/libpcap/config
  33. source "$(SOURCE)/Config.in"
  34. endef
  35. TARGET_CFLAGS += \
  36. -ffunction-sections \
  37. -fdata-sections
  38. CONFIGURE_VARS += \
  39. ac_cv_linux_vers=$(LINUX_VERSION) \
  40. ac_cv_header_libusb_1_0_libusb_h=no
  41. ifeq ($(CONFIG_PCAP_HAS_NETFILTER),)
  42. CONFIGURE_VARS += \
  43. ac_cv_netfilter_can_compile=no
  44. endif
  45. CONFIGURE_ARGS += \
  46. --enable-shared \
  47. --disable-yydebug \
  48. --with-pcap=linux \
  49. --without-septel \
  50. --without-dag \
  51. --without-libnl \
  52. --without-snf \
  53. --disable-can \
  54. --disable-canusb \
  55. --disable-dbus \
  56. --disable-bluetooth
  57. ifeq ($(CONFIG_IPV6),y)
  58. CONFIGURE_ARGS += \
  59. --enable-ipv6
  60. endif
  61. MAKE_FLAGS += \
  62. CCOPT="$(TARGET_CFLAGS) -I$(BUILD_DIR)/linux/include"
  63. define Build/Configure
  64. $(call Build/Configure/Default)
  65. $(if $(CONFIG_PCAP_HAS_USB),,$(SED) '/^#define PCAP_SUPPORT_USB/D' $(PKG_BUILD_DIR)/config.h)
  66. $(if $(CONFIG_PCAP_HAS_USB),,$(SED) 's/pcap-usb-linux.c *//' $(PKG_BUILD_DIR)/Makefile)
  67. $(if $(CONFIG_PCAP_HAS_BT),,$(SED) '/^#define PCAP_SUPPORT_BT/D' $(PKG_BUILD_DIR)/config.h)
  68. $(if $(CONFIG_PCAP_HAS_BT),,$(SED) 's/pcap-bt-linux.c *//' $(PKG_BUILD_DIR)/Makefile)
  69. endef
  70. define Build/InstallDev
  71. $(INSTALL_DIR) $(1)/usr/include
  72. $(CP) $(PKG_INSTALL_DIR)/usr/include/pcap* $(1)/usr/include/
  73. $(INSTALL_DIR) $(1)/usr/lib
  74. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpcap.{a,so*} $(1)/usr/lib/
  75. endef
  76. define Package/libpcap/install
  77. $(INSTALL_DIR) $(1)/usr/lib
  78. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpcap.so* $(1)/usr/lib/
  79. endef
  80. $(eval $(call BuildPackage,libpcap))