Makefile 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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.7.4
  10. PKG_RELEASE:=1
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  12. PKG_SOURCE_URL:=http://www.tcpdump.org/release/
  13. PKG_MD5SUM:=b2e13142bbaba857ab1c6894aedaf547
  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. ac_cv_netfilter_can_compile=no
  42. CONFIGURE_ARGS += \
  43. --enable-shared \
  44. --disable-yydebug \
  45. --with-pcap=linux \
  46. --without-septel \
  47. --without-dag \
  48. --without-libnl \
  49. --without-snf \
  50. --disable-can \
  51. --disable-canusb \
  52. --disable-dbus \
  53. --disable-bluetooth
  54. ifeq ($(CONFIG_IPV6),y)
  55. CONFIGURE_ARGS += \
  56. --enable-ipv6
  57. endif
  58. MAKE_FLAGS += \
  59. CCOPT="$(TARGET_CFLAGS) -I$(BUILD_DIR)/linux/include"
  60. define Build/Configure
  61. $(call Build/Configure/Default)
  62. $(if $(CONFIG_PCAP_HAS_USB),,$(SED) '/^#define PCAP_SUPPORT_USB/D' $(PKG_BUILD_DIR)/config.h)
  63. $(if $(CONFIG_PCAP_HAS_USB),,$(SED) 's/pcap-usb-linux.c *//' $(PKG_BUILD_DIR)/Makefile)
  64. $(if $(CONFIG_PCAP_HAS_BT),,$(SED) '/^#define PCAP_SUPPORT_BT/D' $(PKG_BUILD_DIR)/config.h)
  65. $(if $(CONFIG_PCAP_HAS_BT),,$(SED) 's/pcap-bt-linux.c *//' $(PKG_BUILD_DIR)/Makefile)
  66. endef
  67. define Build/InstallDev
  68. $(INSTALL_DIR) $(1)/usr/include
  69. $(CP) $(PKG_INSTALL_DIR)/usr/include/pcap* $(1)/usr/include/
  70. $(INSTALL_DIR) $(1)/usr/lib
  71. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpcap.{a,so*} $(1)/usr/lib/
  72. endef
  73. define Package/libpcap/install
  74. $(INSTALL_DIR) $(1)/usr/lib
  75. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpcap.so* $(1)/usr/lib/
  76. endef
  77. $(eval $(call BuildPackage,libpcap))