Makefile 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. #
  2. # Copyright (C) 2006 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. # $Id$
  8. include $(TOPDIR)/rules.mk
  9. PKG_NAME:=libpcap
  10. PKG_VERSION:=0.9.8
  11. PKG_RELEASE:=1
  12. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  13. PKG_SOURCE_URL:=http://www.tcpdump.org/release/
  14. PKG_MD5SUM:=5208f24d0328ee7c20b52c43eaa9aa0e
  15. include $(INCLUDE_DIR)/package.mk
  16. define Package/libpcap
  17. SECTION:=libs
  18. CATEGORY:=Libraries
  19. TITLE:=Low-level packet capture library
  20. URL:=http://www.tcpdump.org/
  21. endef
  22. define Package/libpcap/description
  23. This package contains a system-independent library for user-level network
  24. packet capture.
  25. endef
  26. TARGET_CFLAGS += \
  27. -ffunction-sections -fdata-sections
  28. CONFIGURE_ARGS += \
  29. --enable-shared \
  30. --enable-static \
  31. --disable-yydebug \
  32. --enable-ipv6 \
  33. --with-build-cc="$(HOSTCC)" \
  34. --with-pcap=linux
  35. define Build/Compile
  36. $(MAKE) -C $(PKG_BUILD_DIR) \
  37. CCOPT="$(TARGET_CFLAGS) -I$(BUILD_DIR)/linux/include" \
  38. DESTDIR="$(PKG_INSTALL_DIR)" \
  39. all install
  40. endef
  41. define Build/InstallDev
  42. mkdir -p $(1)/usr/include
  43. $(CP) $(PKG_INSTALL_DIR)/usr/include/pcap{,-bpf,-namedb}.h \
  44. $(1)/usr/include/
  45. mkdir -p $(1)/usr/lib
  46. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpcap.{a,so*} \
  47. $(1)/usr/lib/
  48. endef
  49. define Package/libpcap/install
  50. $(INSTALL_DIR) $(1)/usr/lib
  51. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpcap.so.* $(1)/usr/lib/
  52. endef
  53. $(eval $(call BuildPackage,libpcap))