Makefile for iotivity compilation under buildroot

333 views Asked by At

I have done a specific project using buildroot. I want to make my target to behave as a ioTivity Gateway and hence trying to add ioTivity-1.1.1 as buildroot/package. It Seems official support for iotivity build is only under Yocto and Not under buildroot. I have created my own iotivity.mk file for buildroot as follows :

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))

and

After 2 days of proceeding, this is my presently encountered error :

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 *************
1

There are 1 answers

10
Mats Wichmann On

First, it's probably not a good idea to use such an old version of IoTivity. Second, I'm having a hard time understanding what you are attempting: "Either OCF or buildroot were not given official support for iotivity build under buildroot" - what is the objective, and what are the commands you are trying?

The googletest build failed, but there's not enough information to see what really went wrong. The iotivity scons script which drives the googletest build has greatly improved since 1.1.