2010-10-05 17:33:17 +00:00
|
|
|
#
|
2010-05-23 14:09:25 +00:00
|
|
|
# Copyright (C) 2008-2010 OpenWrt.org
|
2009-03-26 20:56:47 +00:00
|
|
|
#
|
|
|
|
# This is free software, licensed under the GNU General Public License v2.
|
|
|
|
# See /LICENSE for more information.
|
|
|
|
|
|
|
|
include $(TOPDIR)/rules.mk
|
|
|
|
include $(INCLUDE_DIR)/kernel.mk
|
|
|
|
|
|
|
|
PKG_NAME:=wprobe
|
|
|
|
PKG_VERSION:=1
|
2010-05-23 14:09:25 +00:00
|
|
|
PKG_RELEASE:=1
|
2009-03-26 20:56:47 +00:00
|
|
|
|
2009-05-06 11:51:16 +00:00
|
|
|
PKG_BUILD_DEPENDS:=PACKAGE_wprobe-export:libipfix
|
2009-03-26 20:56:47 +00:00
|
|
|
|
2009-04-27 15:53:00 +00:00
|
|
|
PKG_CONFIG_DEPENDS = \
|
2009-04-06 09:56:34 +00:00
|
|
|
CONFIG_PACKAGE_kmod-wprobe \
|
2009-04-27 15:53:00 +00:00
|
|
|
CONFIG_PACKAGE_wprobe-export \
|
2009-04-06 09:56:34 +00:00
|
|
|
|
2009-04-27 15:53:00 +00:00
|
|
|
include $(INCLUDE_DIR)/package.mk
|
2009-04-06 09:56:34 +00:00
|
|
|
|
2009-12-22 06:10:30 +00:00
|
|
|
# XXX: build failure on cris
|
|
|
|
# wprobe-lib.c:145: error: 'packed' attribute ignored for field of type 'struct <anonymous>'
|
|
|
|
# wprobe-lib.c:149: error: 'packed' attribute ignored for field of type 'struct <anonymous>'
|
|
|
|
|
2009-12-18 10:51:10 +00:00
|
|
|
define Package/wprobe/Default
|
2010-06-26 20:44:28 +00:00
|
|
|
DEPENDS:=@(!(TARGET_ps3||TARGET_pxcab||cris)||BROKEN)
|
2009-12-18 10:51:10 +00:00
|
|
|
endef
|
|
|
|
|
2009-03-26 20:56:47 +00:00
|
|
|
define KernelPackage/wprobe
|
2009-12-18 10:51:10 +00:00
|
|
|
$(call Package/wprobe/Default)
|
2009-03-26 20:56:47 +00:00
|
|
|
SUBMENU:=Network Support
|
|
|
|
TITLE:=Wireless driver probe infrastructure
|
2010-01-31 12:24:55 +00:00
|
|
|
MAINTAINER:=Felix Fietkau <nbd@openwrt.org>
|
2009-03-26 20:56:47 +00:00
|
|
|
FILES:= \
|
2010-07-12 14:06:13 +00:00
|
|
|
$(PKG_BUILD_DIR)/kernel/wprobe.ko
|
2009-03-26 20:56:47 +00:00
|
|
|
AUTOLOAD:=$(call AutoLoad,01,wprobe)
|
|
|
|
endef
|
|
|
|
|
|
|
|
define KernelPackage/wprobe/description
|
|
|
|
A module that exports measurement data from wireless driver to user space
|
|
|
|
endef
|
|
|
|
|
2009-07-06 19:05:24 +00:00
|
|
|
define Package/wprobe-util
|
2009-12-18 10:51:10 +00:00
|
|
|
$(call Package/wprobe/Default)
|
2009-03-26 20:56:47 +00:00
|
|
|
SECTION:=net
|
|
|
|
CATEGORY:=Network
|
2009-12-18 10:51:10 +00:00
|
|
|
DEPENDS+=+kmod-wprobe +libnl-tiny
|
2009-03-26 20:56:47 +00:00
|
|
|
TITLE:=Wireless measurement utility
|
|
|
|
endef
|
|
|
|
|
2009-07-06 19:05:24 +00:00
|
|
|
define Package/wprobe-util/description
|
|
|
|
wprobe-util uses the wprobe kernel module to query
|
2009-03-26 20:56:47 +00:00
|
|
|
wireless driver measurement data from an interface
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/wprobe-export
|
2009-12-18 10:51:10 +00:00
|
|
|
$(call Package/wprobe/Default)
|
2009-03-26 20:56:47 +00:00
|
|
|
SECTION:=net
|
|
|
|
CATEGORY:=Network
|
2009-12-18 10:51:10 +00:00
|
|
|
DEPENDS+=+wprobe-util
|
2009-03-26 20:56:47 +00:00
|
|
|
TITLE:=Wireless measurement data exporter
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/wprobe-export/description
|
|
|
|
wprobe-export uses the wprobe kernel module to export
|
|
|
|
wireless driver measurement data via the IPFIX protocol
|
|
|
|
endef
|
|
|
|
|
2010-10-05 17:33:17 +00:00
|
|
|
define Package/wprobe-export/conffiles
|
|
|
|
/etc/config/wprobe
|
|
|
|
endef
|
|
|
|
|
2009-03-26 20:56:47 +00:00
|
|
|
define Build/Prepare
|
|
|
|
mkdir -p $(PKG_BUILD_DIR)
|
|
|
|
$(CP) src/* $(PKG_BUILD_DIR)/
|
|
|
|
endef
|
|
|
|
|
2009-05-06 13:54:42 +00:00
|
|
|
TARGET_CPPFLAGS := \
|
2009-09-26 19:01:50 +00:00
|
|
|
-D_GNU_SOURCE \
|
2009-05-06 11:51:16 +00:00
|
|
|
-I$(STAGING_DIR)/usr/include/libnl-tiny \
|
2009-05-06 13:54:42 +00:00
|
|
|
$(TARGET_CPPFLAGS)
|
2009-03-26 20:56:47 +00:00
|
|
|
|
2009-04-06 09:56:34 +00:00
|
|
|
ifdef CONFIG_PACKAGE_kmod-wprobe
|
|
|
|
define Build/Compile/kmod
|
2009-03-26 20:56:47 +00:00
|
|
|
$(MAKE) -C $(LINUX_DIR) \
|
2009-08-16 10:21:13 +00:00
|
|
|
CROSS_COMPILE="$(KERNEL_CROSS)" \
|
2009-03-26 20:56:47 +00:00
|
|
|
ARCH="$(LINUX_KARCH)" \
|
|
|
|
SUBDIRS="$(PKG_BUILD_DIR)/kernel" \
|
|
|
|
KERNELDIR=$(LINUX_DIR) \
|
|
|
|
CC="$(TARGET_CC)" \
|
|
|
|
EXTRA_CFLAGS="-I$(PKG_BUILD_DIR)/kernel" \
|
|
|
|
modules
|
2009-04-06 09:56:34 +00:00
|
|
|
endef
|
|
|
|
endif
|
2009-03-26 20:56:47 +00:00
|
|
|
|
|
|
|
define Build/Compile/lib
|
|
|
|
$(MAKE) -C $(PKG_BUILD_DIR)/user \
|
|
|
|
$(TARGET_CONFIGURE_OPTS) \
|
|
|
|
CFLAGS="$(TARGET_CFLAGS)" \
|
|
|
|
CPPFLAGS="$(TARGET_CPPFLAGS) -I$(PKG_BUILD_DIR)/kernel" \
|
|
|
|
LDFLAGS="$(TARGET_LDFLAGS)" \
|
2009-07-06 19:05:24 +00:00
|
|
|
HOST_OS=Linux \
|
2009-05-06 11:51:16 +00:00
|
|
|
LIBNL="-lnl-tiny"
|
2009-03-26 20:56:47 +00:00
|
|
|
endef
|
|
|
|
|
2009-04-06 09:56:34 +00:00
|
|
|
ifdef CONFIG_PACKAGE_wprobe-export
|
|
|
|
define Build/Compile/exporter
|
2009-03-26 20:56:47 +00:00
|
|
|
$(MAKE) -C $(PKG_BUILD_DIR)/exporter \
|
|
|
|
$(TARGET_CONFIGURE_OPTS) \
|
|
|
|
CFLAGS="$(TARGET_CFLAGS)" \
|
|
|
|
CPPFLAGS="$(TARGET_CPPFLAGS) -I$(PKG_BUILD_DIR)/kernel -I$(PKG_BUILD_DIR)/user" \
|
|
|
|
LDFLAGS="$(TARGET_LDFLAGS)" \
|
2009-05-06 11:51:16 +00:00
|
|
|
LIBS="$(PKG_BUILD_DIR)/user/libwprobe.a $(STAGING_DIR)/usr/lib/libipfix.a $(STAGING_DIR)/usr/lib/libmisc.a -lnl-tiny -lm"
|
2009-04-06 09:56:34 +00:00
|
|
|
endef
|
|
|
|
endif
|
2009-03-26 20:56:47 +00:00
|
|
|
|
|
|
|
define Build/Compile
|
|
|
|
$(Build/Compile/kmod)
|
|
|
|
$(Build/Compile/lib)
|
|
|
|
$(Build/Compile/exporter)
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Build/InstallDev
|
2009-04-23 14:55:11 +00:00
|
|
|
$(INSTALL_DIR) $(1)/usr/include/wprobe
|
|
|
|
$(CP) $(PKG_BUILD_DIR)/kernel/linux $(1)/usr/include/wprobe
|
2009-03-26 20:56:47 +00:00
|
|
|
endef
|
|
|
|
|
2009-07-06 19:05:24 +00:00
|
|
|
define Package/wprobe-util/install
|
2009-03-26 20:56:47 +00:00
|
|
|
$(INSTALL_DIR) $(1)/sbin
|
2009-07-06 19:05:24 +00:00
|
|
|
$(INSTALL_BIN) $(PKG_BUILD_DIR)/user/wprobe-util $(1)/sbin/
|
2009-03-26 20:56:47 +00:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/wprobe-export/install
|
2009-06-10 14:37:36 +00:00
|
|
|
$(INSTALL_DIR) $(1)/sbin $(1)/etc/init.d $(1)/etc/config
|
2009-07-07 03:03:43 +00:00
|
|
|
$(INSTALL_BIN) ./files/wprobe.init $(1)/etc/init.d/wprobe
|
2009-06-10 14:37:36 +00:00
|
|
|
$(INSTALL_BIN) ./files/wprobe.config $(1)/etc/config/wprobe
|
2009-03-26 20:56:47 +00:00
|
|
|
$(INSTALL_BIN) $(PKG_BUILD_DIR)/exporter/wprobe-export $(1)/sbin/
|
|
|
|
endef
|
|
|
|
|
|
|
|
$(eval $(call KernelPackage,wprobe))
|
2009-07-06 19:05:24 +00:00
|
|
|
$(eval $(call BuildPackage,wprobe-util))
|
2009-03-26 20:56:47 +00:00
|
|
|
$(eval $(call BuildPackage,wprobe-export))
|