diff --git a/bbk_cli/Makefile b/bbk_cli/Makefile new file mode 100644 index 000000000..04cbe819f --- /dev/null +++ b/bbk_cli/Makefile @@ -0,0 +1,42 @@ +# +# Copright (C) 2018 The Internet Foundation In Sweden +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=bbk_cli +PKG_SOURCE_VERSION:=7b810a696c78b746185c11282bdbe3fb7f8c5d4b +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=https://github.com/dotse/bbk.git + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz +PKG_SOURCE_SUBDIR:=$(PKG_NAME) +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME) + +PKG_LICENSE:=GPLv2 +PKG_LICENSE_FILES:=LICENSE + +include $(INCLUDE_DIR)/package.mk + +define Package/bbk_cli + CATEGORY:=Utilities + DEPENDS:=+libpthread +libstdcpp + TITLE:=Bredbandskollen CLI - A bandwidth measurement tool +endef + +define Package/bbk_cli/description + To measure connection speed in an environment that is missing a web browser, + for example, in a server, you can use our command line interface bbk_cli, + which is available for some of the most common operating systems. +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR)/src/cli CROSS_COMPILE="$(TARGET_CROSS)" +endef + +define Package/bbk_cli/install + $(INSTALL_DIR) $(1)/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/cli/cli $(1)/sbin/bbk_cli +endef + +$(eval $(call BuildPackage,bbk_cli)) diff --git a/bbk_cli/patches/0001-add-openwrt-cross-compile-support.patch b/bbk_cli/patches/0001-add-openwrt-cross-compile-support.patch new file mode 100644 index 000000000..60577030d --- /dev/null +++ b/bbk_cli/patches/0001-add-openwrt-cross-compile-support.patch @@ -0,0 +1,25 @@ +diff --git a/src/framework/engine.h b/src/framework/engine.h +index 57a48ad..9e1bc36 100644 +--- a/src/framework/engine.h ++++ b/src/framework/engine.h +@@ -10,6 +10,7 @@ + #include + #include + #include ++#include + + #include "logger.h" + +diff --git a/src/framework/mk.inc b/src/framework/mk.inc +index 793e211..13275be 100644 +--- a/src/framework/mk.inc ++++ b/src/framework/mk.inc +@@ -7,7 +7,7 @@ OS:=$(shell uname) + CXXFLAGS += -O2 -W -Wall -I$(DIRLEVEL) + + ifeq ($(OS),Linux) +-CXX = g++ ++CXX = $(CROSS_COMPILE)g++ + endif + + ifeq ($(OS),Darwin)