wprobe: fix up data lengths in the ipfix exporter
[openwrt.git] / package / wprobe / Makefile
1 #
2 # Copyright (C) 2008 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 include $(INCLUDE_DIR)/kernel.mk
9
10 PKG_NAME:=wprobe
11 PKG_VERSION:=1
12
13 PKG_BUILD_DEPENDS:=PACKAGE_wprobe-export:libipfix
14
15 PKG_CONFIG_DEPENDS = \
16 CONFIG_PACKAGE_kmod-wprobe \
17 CONFIG_PACKAGE_wprobe-export \
18
19 include $(INCLUDE_DIR)/package.mk
20
21 # XXX: build failure on cris
22 # wprobe-lib.c:145: error: 'packed' attribute ignored for field of type 'struct <anonymous>'
23 # wprobe-lib.c:149: error: 'packed' attribute ignored for field of type 'struct <anonymous>'
24
25 define Package/wprobe/Default
26 DEPENDS:=@LINUX_2_6 @(!(TARGET_ps3||TARGET_pxcab||cris)||BROKEN)
27 endef
28
29 define KernelPackage/wprobe
30 $(call Package/wprobe/Default)
31 SUBMENU:=Network Support
32 TITLE:=Wireless driver probe infrastructure
33 FILES:= \
34 $(PKG_BUILD_DIR)/kernel/wprobe.$(LINUX_KMOD_SUFFIX)
35 AUTOLOAD:=$(call AutoLoad,01,wprobe)
36 endef
37
38 define KernelPackage/wprobe/description
39 A module that exports measurement data from wireless driver to user space
40 endef
41
42 define Package/wprobe-util
43 $(call Package/wprobe/Default)
44 SECTION:=net
45 CATEGORY:=Network
46 DEPENDS+=+kmod-wprobe +libnl-tiny
47 TITLE:=Wireless measurement utility
48 endef
49
50 define Package/wprobe-util/description
51 wprobe-util uses the wprobe kernel module to query
52 wireless driver measurement data from an interface
53 endef
54
55 define Package/wprobe-export
56 $(call Package/wprobe/Default)
57 SECTION:=net
58 CATEGORY:=Network
59 DEPENDS+=+wprobe-util
60 TITLE:=Wireless measurement data exporter
61 endef
62
63 define Package/wprobe-export/description
64 wprobe-export uses the wprobe kernel module to export
65 wireless driver measurement data via the IPFIX protocol
66 endef
67
68 define Build/Prepare
69 mkdir -p $(PKG_BUILD_DIR)
70 $(CP) src/* $(PKG_BUILD_DIR)/
71 endef
72
73 TARGET_CPPFLAGS := \
74 -D_GNU_SOURCE \
75 -I$(STAGING_DIR)/usr/include/libnl-tiny \
76 $(TARGET_CPPFLAGS)
77
78 ifdef CONFIG_PACKAGE_kmod-wprobe
79 define Build/Compile/kmod
80 $(MAKE) -C $(LINUX_DIR) \
81 CROSS_COMPILE="$(KERNEL_CROSS)" \
82 ARCH="$(LINUX_KARCH)" \
83 SUBDIRS="$(PKG_BUILD_DIR)/kernel" \
84 KERNELDIR=$(LINUX_DIR) \
85 CC="$(TARGET_CC)" \
86 EXTRA_CFLAGS="-I$(PKG_BUILD_DIR)/kernel" \
87 modules
88 endef
89 endif
90
91 define Build/Compile/lib
92 $(MAKE) -C $(PKG_BUILD_DIR)/user \
93 $(TARGET_CONFIGURE_OPTS) \
94 CFLAGS="$(TARGET_CFLAGS)" \
95 CPPFLAGS="$(TARGET_CPPFLAGS) -I$(PKG_BUILD_DIR)/kernel" \
96 LDFLAGS="$(TARGET_LDFLAGS)" \
97 HOST_OS=Linux \
98 LIBNL="-lnl-tiny"
99 endef
100
101 ifdef CONFIG_PACKAGE_wprobe-export
102 define Build/Compile/exporter
103 $(MAKE) -C $(PKG_BUILD_DIR)/exporter \
104 $(TARGET_CONFIGURE_OPTS) \
105 CFLAGS="$(TARGET_CFLAGS)" \
106 CPPFLAGS="$(TARGET_CPPFLAGS) -I$(PKG_BUILD_DIR)/kernel -I$(PKG_BUILD_DIR)/user" \
107 LDFLAGS="$(TARGET_LDFLAGS)" \
108 LIBS="$(PKG_BUILD_DIR)/user/libwprobe.a $(STAGING_DIR)/usr/lib/libipfix.a $(STAGING_DIR)/usr/lib/libmisc.a -lnl-tiny -lm"
109 endef
110 endif
111
112 define Build/Compile
113 $(Build/Compile/kmod)
114 $(Build/Compile/lib)
115 $(Build/Compile/exporter)
116 endef
117
118 define Build/InstallDev
119 $(INSTALL_DIR) $(1)/usr/include/wprobe
120 $(CP) $(PKG_BUILD_DIR)/kernel/linux $(1)/usr/include/wprobe
121 endef
122
123 define Package/wprobe-util/install
124 $(INSTALL_DIR) $(1)/sbin
125 $(INSTALL_BIN) $(PKG_BUILD_DIR)/user/wprobe-util $(1)/sbin/
126 endef
127
128 define Package/wprobe-export/install
129 $(INSTALL_DIR) $(1)/sbin $(1)/etc/init.d $(1)/etc/config
130 $(INSTALL_BIN) ./files/wprobe.init $(1)/etc/init.d/wprobe
131 $(INSTALL_BIN) ./files/wprobe.config $(1)/etc/config/wprobe
132 $(INSTALL_BIN) $(PKG_BUILD_DIR)/exporter/wprobe-export $(1)/sbin/
133 endef
134
135 $(eval $(call KernelPackage,wprobe))
136 $(eval $(call BuildPackage,wprobe-util))
137 $(eval $(call BuildPackage,wprobe-export))
This page took 0.058851 seconds and 5 git commands to generate.