[tcpdump] fix parallel build thanks Raphael HUCK
[openwrt/svn-archive/archive.git] / net / tcpdump / Makefile
1 #
2 # Copyright (C) 2007-2010 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=tcpdump
11 PKG_VERSION:=4.0.0
12 PKG_RELEASE:=2
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:=http://www.tcpdump.org/release/ \
16 http://ftp.gwdg.de/pub/misc/tcpdump/ \
17 http://www.at.tcpdump.org/ \
18 http://www.br.tcpdump.org/
19 PKG_MD5SUM:=b22ca72890df2301d922c9f2d17867f9
20
21 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
22
23 PKG_INSTALL:=1
24
25 include $(INCLUDE_DIR)/package.mk
26
27 define Package/tcpdump/default
28 SECTION:=net
29 CATEGORY:=Network
30 DEPENDS:=+libpcap
31 TITLE:=Network monitoring and data acquisition tool
32 URL:=http://www.tcpdump.org/
33 endef
34
35 define Package/tcpdump
36 $(Package/tcpdump/default)
37 VARIANT:=full
38 endef
39
40 define Package/tcpdump-mini
41 $(Package/tcpdump/default)
42 TITLE+= (minimal version)
43 VARIANT:=mini
44 endef
45
46 CONFIGURE_ARGS += --without-crypto
47
48 CONFIGURE_VARS += \
49 BUILD_CC="$(TARGET_CC)" \
50 HOSTCC="$(HOSTCC)" \
51 td_cv_buggygetaddrinfo="no"
52
53 MAKE_FLAGS := \
54 CCOPT="$(TARGET_CFLAGS)" INCLS="-I. $(TARGET_CPPFLAGS)"
55
56 ifeq ($(BUILD_VARIANT),mini)
57 TARGET_CFLAGS += -DTCPDUMP_MINI
58 CONFIGURE_ARGS += --disable-smb
59 MAKE_FLAGS += TCPDUMP_MINI=1
60 endif
61
62 define Package/tcpdump/install
63 $(INSTALL_DIR) $(1)/usr/sbin
64 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/tcpdump $(1)/usr/sbin/
65 endef
66
67 Package/tcpdump-mini/install = $(Package/tcpdump/install)
68
69 $(eval $(call BuildPackage,tcpdump))
70 $(eval $(call BuildPackage,tcpdump-mini))