我已经使用 buildroot 完成了一个特定的项目。我想让我的目标充当 ioTivity 网关,因此尝试将ioTivity-1.1.1添加为 buildroot/package。似乎官方对 iotivity 构建的支持仅在 Yocto 下,而不在 buildroot 下。我为 buildroot 创建了自己的iotivity.mk文件,如下所示:
IOTIVITY_VERSION_MAJOR = 1.1
IOTIVITY_VERSION = $(IOTIVITY_VERSION_MAJOR).1
IOTIVITY_RELEASE = 1
IOTIVITY_SOURCE = iotivity-${IOTIVITY_VERSION}.tar.gz
IOTIVITY_SITE = http://mirrors.kernel.org/iotivity/${IOTIVITY_VERSION}
IOTIVITY_LICENSE = Apache-2.0
IOTIVITY_LICENSE_FILES = LICENSE.md
IOTIVITY_DEPENDENCIES += scons boost sqlite mbedtls gtest cjson tinycbor libcurl host-pkgconf snappy openssl libcoap
IOTIVITY_CONF_OPTS += --enable-uuid
IOTIVITY_CONF_OPTS += --enable-curl
IOTIVITY_CXXFLAGS = CXXFLAGS = "$(TARGET_CXXFLAGS) -std=c++11 -fPIC"
IOTIVITY_CONF_ENV += CXXFLAGS = "$(TARGET_CXXFLAGS) -std=c++11"
IOTIVITY_CONF_OPTS += --with-curl
IOTIVITY_CONF_OPTS += --with-pthread
IOTIVITY_CONF_OPTS += --with-sqlite3
IOTIVITY_CONF_OPTS += LIBS=-lstdc++
IOTIVITY_LDFLAGS = "$(TARGET_LDFLAGS) -lpthread"
IOTIVITY_LDFLAGS = "$(TARGET_LDFLAGS) -lrt"
IOTIVITY_CONF_ENV = "LIBS = -lrt"
IOTIVITY_CONF_ENV = CFLAGS="$(TARGET_CFLAGS) -pthread" LIBS="-pthread"
EXTRA_CXXFLAGS += -std=gnu++11
IOTIVITY_INSTALL_STAGING = YES
SCONS_OPTIONS += \
TARGET_OS=linux \
TARGET_TRANSPORT=ALL \
TARGET_ARCH=arm64 \
STAGING_DIR=$(STAGING_DIR) \
WITH_ENV=True \
BUILD_SAMPLE=ON \
RD_MODE=CLIENT \
RELEASE=True \
SECURED=1 \
LOGGING=True \
VERBOSE=True
TARGET_CONFIGURE_OPTS = $(SCONS_OPTIONS)
IOTIVITY_MAKE_OPTS = $(TARGET_CONFIGURE_OPTS)
define IOTIVITY_BUILD_CMDS
$(TARGET_MAKE_ENV) $(MAKE) $(IOTIVITY_MAKE_OPTS) -C $(@D)
endef
define IOTIVITY_INSTALL_STAGING_CMDS
$(TARGET_MAKE_ENV) $(MAKE) $(IOTIVITY_MAKE_OPTS) -C $(@D) \
DESTDIR=$(STAGING_DIR) prefix=/usr install
endef
define IOTIVITY_INSTALL_TARGET_CMDS
$(TARGET_MAKE_ENV) $(MAKE) $(IOTIVITY_MAKE_OPTS) -C $(@D) \
DESTDIR=$(TARGET_DIR) prefix=/usr install
endef
$(eval $(generic-package))
和
经过 2 天的处理,这是我目前遇到的错误:
build/iotivity-1.1.1/out/linux/x86_64/debug/resource/csdk/connectivity/src/bt_le_adapter/linux/bluez-glue.c']
TypeError: argument of type 'NoneType' is not iterable:
File "build/iotivity-1.1.1/SConstruct", line 57: SConscript(build_dir + 'resource/SConscript')
File "/usr/local/lib/scons-2.5.0/SCons/Script/SConscript.py", line 604: return method(*args, **kw)
File "/usr/local/lib/scons-2.5.0/SCons/Script/SConscript.py", line 541: return _SConscript(self.fs, *files, **subst_kw)
File "/usr/local/lib/scons-2.5.0/SCons/Script/SConscript.py", line 250: exec _file_ in call_stack[-1].globals
File "build/iotivity-1.1.1/resource/SConscript", line 40:
SConscript('csdk/SConscript')
File "/usr/local/lib/scons-2.5.0/SCons/Script/SConscript.py", line 604: return method(*args, **kw)
File "/usr/local/lib/scons-2.5.0/SCons/Script/SConscript.py", line 541: return _SConscript(self.fs, *files, **subst_kw)
File "/usr/local/lib/scons-2.5.0/SCons/Script/SConscript.py", line 250: exec _file_ in call_stack[-1].globals
File "build/iotivity-1.1.1/resource/csdk/SConscript", line 39:
if 'CLIENT' in rd_mode or 'SERVER' in rd_mode:
*********** Unit test Stop *************