Makefile 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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.5.3
  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:=7e7321fb3aff2f2bb05c8229f3795d4a
  14. PKG_FIXUP:=patch-libtool
  15. PKG_MAINTAINER:=Felix Fietkau <nbd@openwrt.org>
  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. --enable-static \
  45. --disable-yydebug \
  46. --with-build-cc="$(HOSTCC)" \
  47. --with-pcap=linux \
  48. --without-septel \
  49. --without-dag \
  50. --without-libnl \
  51. --without-snf \
  52. --disable-can \
  53. --disable-canusb \
  54. --disable-dbus \
  55. --disable-bluetooth
  56. ifeq ($(CONFIG_IPV6),y)
  57. CONFIGURE_ARGS += \
  58. --enable-ipv6
  59. endif
  60. MAKE_FLAGS += \
  61. CCOPT="$(TARGET_CFLAGS) -I$(BUILD_DIR)/linux/include"
  62. define Build/Configure
  63. $(call Build/Configure/Default)
  64. $(if $(CONFIG_PCAP_HAS_USB),,$(SED) '/^#define PCAP_SUPPORT_USB/D' $(PKG_BUILD_DIR)/config.h)
  65. $(if $(CONFIG_PCAP_HAS_USB),,$(SED) 's/pcap-usb-linux.c *//' $(PKG_BUILD_DIR)/Makefile)
  66. $(if $(CONFIG_PCAP_HAS_BT),,$(SED) '/^#define PCAP_SUPPORT_BT/D' $(PKG_BUILD_DIR)/config.h)
  67. $(if $(CONFIG_PCAP_HAS_BT),,$(SED) 's/pcap-bt-linux.c *//' $(PKG_BUILD_DIR)/Makefile)
  68. endef
  69. define Build/InstallDev
  70. $(INSTALL_DIR) $(1)/usr/include
  71. $(CP) $(PKG_INSTALL_DIR)/usr/include/pcap* $(1)/usr/include/
  72. $(INSTALL_DIR) $(1)/usr/lib
  73. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpcap.{a,so*} $(1)/usr/lib/
  74. endef
  75. define Package/libpcap/install
  76. $(INSTALL_DIR) $(1)/usr/lib
  77. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpcap.so* $(1)/usr/lib/
  78. endef
  79. $(eval $(call BuildPackage,libpcap))