From d6fe15a85c4690f34a73af77c6cf6f316acf75b6 Mon Sep 17 00:00:00 2001 From: Marcin Jurkowski Date: Wed, 6 Mar 2013 09:31:17 +0000 Subject: owfs: make libow features configurable Owfs shared library is quite large (700+ kB) by embedded devices standards. The code for many different bus master and slave devices is compiled into single big .so library. Had it been designed as modular, dynamic-loadable plugins, we could split them into separate packages, allowing user to install only the plugins he needs. It's however possible to enable or disable libow features at compile time. Here are some examples how much space can be saved turning off support for unneeded devices and features: - By disabling USB adapter support libusb and libusb-compat is no longer needed, saving ~70kB of space. Bus masters using usbserial.ko kernel driver don't need this. - By disabling debug messages it's possible to reduce shared library size by 130kB. This patch adds a menu allowing user to select libow features one wants built in: - Bus master support: USB adapters through libusb, i2c adapters, kernel w1 adapters - General features: zeroconf device announcement, debug messages, owtraffic bus reports Default config options preserve previous library configuration i.e. everything is selected except for owtraffic (which was disabled) and kernel w1 driver (whose netlink interface has been broken since 2011). Signed-off-by: Marcin Jurkowski --- utils/owfs/Makefile | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) (limited to 'utils/owfs/Makefile') diff --git a/utils/owfs/Makefile b/utils/owfs/Makefile index b939d618e..d4cc4cb24 100644 --- a/utils/owfs/Makefile +++ b/utils/owfs/Makefile @@ -20,6 +20,14 @@ PKG_LICENSE:=GPL-2.0 PKG_FIXUP:=autoreconf PKG_INSTALL:=1 +PKG_CONFIG_DEPENDS:= \ + CONFIG_LIBOW_MASTER_USB \ + CONFIG_LIBOW_MASTER_I2C \ + CONFIG_LIBOW_MASTER_W1 \ + CONFIG_LIBOW_ZEROCONF \ + CONFIG_LIBOW_DEBUG \ + CONFIG_LIBOW_OWTRAFFIC + include $(INCLUDE_DIR)/package.mk # @@ -74,10 +82,17 @@ endef define Package/libow $(call Package/owfs/Library) - DEPENDS:=+libusb-compat +libpthread + DEPENDS:= \ + +libpthread \ + +LIBOW_MASTER_USB:libusb-compat \ + +LIBOW_MASTER_W1:kmod-w1 TITLE:=OWFS - common shared library endef +define Package/libow/config + source "$(SOURCE)/Config.in" +endef + define Package/libow/description $(call Package/$(PKG_NAME)/Default/description) @@ -170,13 +185,18 @@ CONFIGURE_ARGS += \ --with-fuseinclude="$(STAGING_DIR)/usr/include" \ --with-fuselib="$(STAGING_DIR)/usr/lib" \ --enable-shared \ - --enable-zero \ --disable-parport \ --disable-ownet \ --disable-owpython \ --disable-owphp \ --disable-owtcl \ --disable-swig \ + $(if $(CONFIG_LIBOW_MASTER_USB),--enable-usb,--disable-usb) \ + $(if $(CONFIG_LIBOW_MASTER_W1),--enable-w1,--disable-w1) \ + $(if $(CONFIG_LIBOW_MASTER_I2C),--enable-i2c,--disable-i2c) \ + $(if $(CONFIG_LIBOW_ZEROCONF),--enable-zero,--disable-zero) \ + $(if $(CONFIG_LIBOW_DEBUG),--enable-debug,--disable-debug) \ + $(if $(CONFIG_LIBOW_OWTRAFFIC),--enable-owtraffic,--disable-owtraffic) CONFIGURE_VARS += \ LDFLAGS="$(TARGET_LDFLAGS) -Wl,-rpath-link=$(STAGING_DIR)/usr/lib -Wl,-rpath-link=$(TOOLCHAIN_DIR)/usr/lib" \ -- cgit v1.2.3