2009-03-26 22:56:47 +02:00
|
|
|
#
|
2010-05-23 17:34:54 +03:00
|
|
|
# Copyright (C) 2008-2010 OpenWrt.org
|
2009-03-26 22:56:47 +02: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 17:34:54 +03:00
|
|
|
PKG_RELEASE:=1
|
2009-03-26 22:56:47 +02:00
|
|
|
|
2009-05-06 14:51:16 +03:00
|
|
|
PKG_BUILD_DEPENDS:=PACKAGE_wprobe-export:libipfix
|
2009-03-26 22:56:47 +02:00
|
|
|
|
2009-04-27 18:53:00 +03:00
|
|
|
PKG_CONFIG_DEPENDS = \
|
2009-04-06 12:56:34 +03:00
|
|
|
CONFIG_PACKAGE_kmod-wprobe \
|
2009-04-27 18:53:00 +03:00
|
|
|
CONFIG_PACKAGE_wprobe-export \
|
2009-04-06 12:56:34 +03:00
|
|
|
|
2009-04-27 18:53:00 +03:00
|
|
|
include $(INCLUDE_DIR)/package.mk
|
2009-04-06 12:56:34 +03:00
|
|
|
|
2009-12-22 08:10:30 +02: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 12:51:10 +02:00
|
|
|
define Package/wprobe/Default
|
2009-12-22 08:10:30 +02:00
|
|
|
DEPENDS:=@LINUX_2_6 @(!(TARGET_ps3||TARGET_pxcab||cris)||BROKEN)
|
2009-12-18 12:51:10 +02:00
|
|
|
endef
|
|
|
|
|
2009-03-26 22:56:47 +02:00
|
|
|
define KernelPackage/wprobe
|
2009-12-18 12:51:10 +02:00
|
|
|
$(call Package/wprobe/Default)
|
2009-03-26 22:56:47 +02:00
|
|
|
SUBMENU:=Network Support
|
|
|
|
TITLE:=Wireless driver probe infrastructure
|
2010-01-31 14:24:55 +02:00
|
|
|
MAINTAINER:=Felix Fietkau <nbd@openwrt.org>
|
2009-03-26 22:56:47 +02:00
|
|
|
FILES:= \
|
|
|
|
$(PKG_BUILD_DIR)/kernel/wprobe.$(LINUX_KMOD_SUFFIX)
|
|
|
|
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 22:05:24 +03:00
|
|
|
define Package/wprobe-util
|
2009-12-18 12:51:10 +02:00
|
|
|
$(call Package/wprobe/Default)
|
2009-03-26 22:56:47 +02:00
|
|
|
SECTION:=net
|
|
|
|
CATEGORY:=Network
|
2009-12-18 12:51:10 +02:00
|
|
|
DEPENDS+=+kmod-wprobe +libnl-tiny
|
2009-03-26 22:56:47 +02:00
|
|
|
TITLE:=Wireless measurement utility
|
|
|
|
endef
|
|
|
|
|
2009-07-06 22:05:24 +03:00
|
|
|
define Package/wprobe-util/description
|
|
|
|
wprobe-util uses the wprobe kernel module to query
|
2009-03-26 22:56:47 +02:00
|
|
|
wireless driver measurement data from an interface
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/wprobe-export
|
2009-12-18 12:51:10 +02:00
|
|
|
$(call Package/wprobe/Default)
|
2009-03-26 22:56:47 +02:00
|
|
|
SECTION:=net
|
|
|
|
CATEGORY:=Network
|
2009-12-18 12:51:10 +02:00
|
|
|
DEPENDS+=+wprobe-util
|
2009-03-26 22:56:47 +02: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
|
|
|
|
|
|
|
|
define Build/Prepare
|
|
|
|
mkdir -p $(PKG_BUILD_DIR)
|
|
|
|
$(CP) src/* $(PKG_BUILD_DIR)/
|
|
|
|
endef
|
|
|
|
|
2009-05-06 16:54:42 +03:00
|
|
|
TARGET_CPPFLAGS := \
|
2009-09-26 22:01:50 +03:00
|
|
|
-D_GNU_SOURCE \
|
2009-05-06 14:51:16 +03:00
|
|
|
-I$(STAGING_DIR)/usr/include/libnl-tiny \
|
2009-05-06 16:54:42 +03:00
|
|
|
$(TARGET_CPPFLAGS)
|
2009-03-26 22:56:47 +02:00
|
|
|
|
2009-04-06 12:56:34 +03:00
|
|
|
ifdef CONFIG_PACKAGE_kmod-wprobe
|
|
|
|
define Build/Compile/kmod
|
2009-03-26 22:56:47 +02:00
|
|
|
$(MAKE) -C $(LINUX_DIR) \
|
2009-08-16 13:21:13 +03:00
|
|
|
CROSS_COMPILE="$(KERNEL_CROSS)" \
|
2009-03-26 22:56:47 +02: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 12:56:34 +03:00
|
|
|
endef
|
|
|
|
endif
|
2009-03-26 22:56:47 +02: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 22:05:24 +03:00
|
|
|
HOST_OS=Linux \
|
2009-05-06 14:51:16 +03:00
|
|
|
LIBNL="-lnl-tiny"
|
2009-03-26 22:56:47 +02:00
|
|
|
endef
|
|
|
|
|
2009-04-06 12:56:34 +03:00
|
|
|
ifdef CONFIG_PACKAGE_wprobe-export
|
|
|
|
define Build/Compile/exporter
|
2009-03-26 22:56:47 +02: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 14:51:16 +03: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 12:56:34 +03:00
|
|
|
endef
|
|
|
|
endif
|
2009-03-26 22:56:47 +02:00
|
|
|
|
|
|
|
define Build/Compile
|
|
|
|
$(Build/Compile/kmod)
|
|
|
|
$(Build/Compile/lib)
|
|
|
|
$(Build/Compile/exporter)
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Build/InstallDev
|
2009-04-23 17:55:11 +03:00
|
|
|
$(INSTALL_DIR) $(1)/usr/include/wprobe
|
|
|
|
$(CP) $(PKG_BUILD_DIR)/kernel/linux $(1)/usr/include/wprobe
|
2009-03-26 22:56:47 +02:00
|
|
|
endef
|
|
|
|
|
2009-07-06 22:05:24 +03:00
|
|
|
define Package/wprobe-util/install
|
2009-03-26 22:56:47 +02:00
|
|
|
$(INSTALL_DIR) $(1)/sbin
|
2009-07-06 22:05:24 +03:00
|
|
|
$(INSTALL_BIN) $(PKG_BUILD_DIR)/user/wprobe-util $(1)/sbin/
|
2009-03-26 22:56:47 +02:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/wprobe-export/install
|
2009-06-10 17:37:36 +03:00
|
|
|
$(INSTALL_DIR) $(1)/sbin $(1)/etc/init.d $(1)/etc/config
|
2009-07-07 06:03:43 +03:00
|
|
|
$(INSTALL_BIN) ./files/wprobe.init $(1)/etc/init.d/wprobe
|
2009-06-10 17:37:36 +03:00
|
|
|
$(INSTALL_BIN) ./files/wprobe.config $(1)/etc/config/wprobe
|
2009-03-26 22:56:47 +02:00
|
|
|
$(INSTALL_BIN) $(PKG_BUILD_DIR)/exporter/wprobe-export $(1)/sbin/
|
|
|
|
endef
|
|
|
|
|
|
|
|
$(eval $(call KernelPackage,wprobe))
|
2009-07-06 22:05:24 +03:00
|
|
|
$(eval $(call BuildPackage,wprobe-util))
|
2009-03-26 22:56:47 +02:00
|
|
|
$(eval $(call BuildPackage,wprobe-export))
|