Makefile 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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. PKG_BUILD_PARALLEL:=1
  20. include $(INCLUDE_DIR)/package.mk
  21. include $(INCLUDE_DIR)/cmake.mk
  22. define Package/libpcap
  23. SECTION:=libs
  24. CATEGORY:=Libraries
  25. TITLE:=Low-level packet capture library
  26. URL:=http://www.tcpdump.org/
  27. MENU:=1
  28. ABI_VERSION:=1
  29. endef
  30. define Package/libpcap/description
  31. This package contains a system-independent library for user-level network packet
  32. capture.
  33. endef
  34. define Package/libpcap/config
  35. source "$(SOURCE)/Config.in"
  36. endef
  37. CMAKE_OPTIONS += \
  38. -DBUILD_SHARED_LIBS=ON \
  39. -DBUILD_WITH_LIBNL=OFF \
  40. -DINET6=O$(if $(CONFIG_IPV6),N,FF) \
  41. -DPCAP_SUPPORT_NETFILTER=O$(if $(CONFIG_PCAP_HAS_NETFILTER),N,FF)
  42. # grep 'option(DISABLE_' CMakeLists.txt | cut -f2 -d'(' | cut -f1 -d' ' | sort --unique
  43. CMAKE_OPTIONS += \
  44. -DDISABLE_BLUETOOTH=O$(if $(CONFIG_PCAP_HAS_BT),FF,N) \
  45. -DDISABLE_DAG=ON \
  46. -DDISABLE_DBUS=ON \
  47. -DDISABLE_DPDK=ON \
  48. -DDISABLE_LINUX_USBMON=O$(if $(CONFIG_PCAP_HAS_USB),FF,N) \
  49. -DDISABLE_NETMAP=ON \
  50. -DDISABLE_RDMA=ON \
  51. -DDISABLE_SEPTEL=ON \
  52. -DDISABLE_SNF=ON \
  53. -DDISABLE_TC=ON \
  54. # Debugging options
  55. CMAKE_OPTIONS += \
  56. -DBDEBUG=OFF \
  57. -DYYDEBUG=OFF \
  58. define Build/InstallDev
  59. $(call Build/InstallDev/cmake,$(1))
  60. $(SED) \
  61. 's,^\(prefix\|exec_prefix\)=.*,\1=$(STAGING_DIR)/usr,g' \
  62. $(1)/usr/bin/pcap-config
  63. $(INSTALL_DIR) $(2)/bin
  64. $(LN) ../../usr/bin/pcap-config $(2)/bin/pcap-config
  65. endef
  66. define Package/libpcap/install
  67. $(INSTALL_DIR) $(1)/usr/lib
  68. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpcap.so.* $(1)/usr/lib/
  69. endef
  70. $(eval $(call BuildPackage,libpcap))