2
0

Makefile 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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.10.0
  10. PKG_RELEASE:=1
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  12. PKG_SOURCE_URL:=http://www.us.tcpdump.org/release/ \
  13. http://www.tcpdump.org/release/
  14. PKG_HASH:=8d12b42623eeefee872f123bd0dc85d535b00df4d42e865f993c40f7bfc92b1e
  15. PKG_MAINTAINER:=Felix Fietkau <[email protected]>
  16. PKG_LICENSE:=BSD-3-Clause
  17. PKG_LICENSE_FILES:=LICENSE
  18. PKG_ASLR_PIE_REGULAR:=1
  19. include $(INCLUDE_DIR)/package.mk
  20. include $(INCLUDE_DIR)/cmake.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. ABI_VERSION:=1
  28. endef
  29. define Package/libpcap/description
  30. This package contains a system-independent library for user-level network packet
  31. capture.
  32. endef
  33. define Package/libpcap/config
  34. source "$(SOURCE)/Config.in"
  35. endef
  36. CMAKE_OPTIONS += \
  37. -DBUILD_SHARED_LIBS=ON \
  38. -DBUILD_WITH_LIBNL=OFF \
  39. -DINET6=O$(if $(CONFIG_IPV6),N,FF) \
  40. -DPCAP_SUPPORT_NETFILTER=O$(if $(CONFIG_PCAP_HAS_NETFILTER),N,FF)
  41. # grep 'option(DISABLE_' CMakeLists.txt | cut -f2 -d'(' | cut -f1 -d' ' | sort --unique
  42. CMAKE_OPTIONS += \
  43. -DDISABLE_BLUETOOTH=O$(if $(CONFIG_PCAP_HAS_BT),FF,N) \
  44. -DDISABLE_DAG=ON \
  45. -DDISABLE_DBUS=ON \
  46. -DDISABLE_DPDK=ON \
  47. -DDISABLE_LINUX_USBMON=O$(if $(CONFIG_PCAP_HAS_USB),FF,N) \
  48. -DDISABLE_NETMAP=ON \
  49. -DDISABLE_RDMA=ON \
  50. -DDISABLE_SEPTEL=ON \
  51. -DDISABLE_SNF=ON \
  52. -DDISABLE_TC=ON \
  53. # Debugging options
  54. CMAKE_OPTIONS += \
  55. -DBDEBUG=OFF \
  56. -DYYDEBUG=OFF \
  57. define Build/InstallDev
  58. $(call Build/InstallDev/cmake,$(1))
  59. $(SED) \
  60. 's,^\(prefix\|exec_prefix\)=.*,\1=$(STAGING_DIR)/usr,g' \
  61. $(1)/usr/bin/pcap-config
  62. $(INSTALL_DIR) $(2)/bin
  63. $(LN) ../../usr/bin/pcap-config $(2)/bin/pcap-config
  64. endef
  65. define Package/libpcap/install
  66. $(INSTALL_DIR) $(1)/usr/lib
  67. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpcap.so.* $(1)/usr/lib/
  68. endef
  69. $(eval $(call BuildPackage,libpcap))