Makefile 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  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.9.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:=2edb88808e5913fdaa8e9c1fcaf272e19b2485338742b5074b9fe44d68f37019
  15. PKG_FIXUP:=patch-libtool
  16. PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
  17. PKG_INSTALL:=1
  18. PKG_BUILD_PARALLEL:=1
  19. PKG_LICENSE:=BSD-3-Clause
  20. include $(INCLUDE_DIR)/package.mk
  21. include $(INCLUDE_DIR)/kernel.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. 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. TARGET_CFLAGS += \
  37. -ffunction-sections \
  38. -fdata-sections
  39. CONFIGURE_VARS += \
  40. ac_cv_linux_vers=$(LINUX_VERSION) \
  41. ac_cv_header_libusb_1_0_libusb_h=no
  42. ifeq ($(CONFIG_PCAP_HAS_NETFILTER),)
  43. CONFIGURE_VARS += \
  44. ac_cv_netfilter_can_compile=no
  45. endif
  46. CONFIGURE_ARGS += \
  47. --enable-shared \
  48. --disable-yydebug \
  49. --with-pcap=linux \
  50. --without-septel \
  51. --without-dag \
  52. --without-libnl \
  53. --without-snf \
  54. --disable-can \
  55. --disable-canusb \
  56. --disable-dbus \
  57. --disable-bluetooth
  58. ifeq ($(CONFIG_IPV6),y)
  59. CONFIGURE_ARGS += \
  60. --enable-ipv6
  61. endif
  62. MAKE_FLAGS += \
  63. CCOPT="$(TARGET_CFLAGS) -I$(BUILD_DIR)/linux/include"
  64. define Build/Configure
  65. $(call Build/Configure/Default)
  66. $(if $(CONFIG_PCAP_HAS_USB),,$(SED) '/^#define PCAP_SUPPORT_USB/D' $(PKG_BUILD_DIR)/config.h)
  67. $(if $(CONFIG_PCAP_HAS_USB),,$(SED) 's/pcap-usb-linux.c *//' $(PKG_BUILD_DIR)/Makefile)
  68. $(if $(CONFIG_PCAP_HAS_BT),,$(SED) '/^#define PCAP_SUPPORT_BT/D' $(PKG_BUILD_DIR)/config.h)
  69. $(if $(CONFIG_PCAP_HAS_BT),,$(SED) 's/pcap-bt-linux.c *//' $(PKG_BUILD_DIR)/Makefile)
  70. endef
  71. define Build/InstallDev
  72. $(INSTALL_DIR) $(1)/usr/include
  73. $(CP) $(PKG_INSTALL_DIR)/usr/include/pcap* $(1)/usr/include/
  74. $(INSTALL_DIR) $(1)/usr/lib
  75. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpcap.{a,so*} $(1)/usr/lib/
  76. endef
  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. $(eval $(call BuildPackage,libpcap))