libpcap.mk 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. #############################################################
  2. #
  3. # libpcap
  4. #
  5. #############################################################
  6. # Copyright (C) 2001-2003 by Erik Andersen <andersen@codepoet.org>
  7. # Copyright (C) 2002 by Tim Riker <Tim@Rikers.org>
  8. #
  9. # This program is free software; you can redistribute it and/or modify
  10. # it under the terms of the GNU Library General Public License as
  11. # published by the Free Software Foundation; either version 2 of the
  12. # License, or (at your option) any later version.
  13. #
  14. # This program is distributed in the hope that it will be useful, but
  15. # WITHOUT ANY WARRANTY; without even the implied warranty of
  16. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  17. # Library General Public License for more details.
  18. #
  19. # You should have received a copy of the GNU Library General Public
  20. # License along with this program; if not, write to the Free Software
  21. # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
  22. # USA
  23. LIBPCAP_VERSION:=0.9.8
  24. LIBPCAP_DIR:=$(BUILD_DIR)/libpcap-$(LIBPCAP_VERSION)
  25. LIBPCAP_SITE:=http://www.tcpdump.org/release
  26. LIBPCAP_SOURCE:=libpcap-$(LIBPCAP_VERSION).tar.gz
  27. LIBPCAP_CAT:=$(ZCAT)
  28. $(DL_DIR)/$(LIBPCAP_SOURCE):
  29. $(call DOWNLOAD,$(LIBPCAP_SITE),$(LIBPCAP_SOURCE))
  30. libpcap-source: $(DL_DIR)/$(LIBPCAP_SOURCE)
  31. $(LIBPCAP_DIR)/.unpacked: $(DL_DIR)/$(LIBPCAP_SOURCE)
  32. $(LIBPCAP_CAT) $(DL_DIR)/$(LIBPCAP_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
  33. rm -f $(LIBPCAP_DIR)/gencode.c.rej
  34. toolchain/patch-kernel.sh $(LIBPCAP_DIR) package/libpcap/ \*.patch
  35. $(CONFIG_UPDATE) $(LIBPCAP_DIR)
  36. touch $@
  37. $(LIBPCAP_DIR)/.configured: $(LIBPCAP_DIR)/.unpacked
  38. (cd $(LIBPCAP_DIR); rm -rf config.cache; \
  39. ac_cv_linux_vers=$(BR2_DEFAULT_KERNEL_HEADERS) \
  40. BUILD_CC=$(TARGET_CC) HOSTCC="$(HOSTCC)" \
  41. $(TARGET_CONFIGURE_OPTS) \
  42. $(TARGET_CONFIGURE_ARGS) \
  43. ./configure \
  44. --target=$(GNU_TARGET_NAME) \
  45. --host=$(GNU_TARGET_NAME) \
  46. --build=$(GNU_HOST_NAME) \
  47. --prefix=/usr \
  48. --localstatedir=/var \
  49. --mandir=/usr/share/man \
  50. --infodir=/usr/share/info \
  51. --disable-yydebug \
  52. --with-pcap=linux \
  53. $(DISABLE_IPV6) \
  54. )
  55. touch $@
  56. $(LIBPCAP_DIR)/libpcap.a: $(LIBPCAP_DIR)/.configured
  57. $(MAKE) AR=$(TARGET_CROSS)ar -C $(LIBPCAP_DIR)
  58. $(STAGING_DIR)/usr/lib/libpcap.a: $(LIBPCAP_DIR)/libpcap.a
  59. $(MAKE) DESTDIR=$(STAGING_DIR) -C $(LIBPCAP_DIR) install
  60. libpcap: uclibc zlib $(STAGING_DIR)/usr/lib/libpcap.a
  61. libpcap-clean:
  62. rm -f $(addprefix $(STAGING_DIR)/usr/,include/pcap*.h \
  63. lib/libpcap.a \
  64. share/man/man?/pcap.*)
  65. -$(MAKE) -C $(LIBPCAP_DIR) clean
  66. libpcap-dirclean:
  67. rm -rf $(LIBPCAP_DIR)
  68. #############################################################
  69. #
  70. # Toplevel Makefile options
  71. #
  72. #############################################################
  73. ifeq ($(BR2_PACKAGE_LIBPCAP),y)
  74. TARGETS+=libpcap
  75. endif