-4

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 Answers1

0

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.

Mats Wichmann
  • 800
  • 6
  • 6
  • I want to make my target to behave as a ioTivity Gateway and hence trying to add ioTivity-1.1.1 as buildroot/package. (Some specific reasons made me to choose iotivity-1.1.1 Version by Knowing it as older version) – Linux Edwin K Jul 26 '17 at 07:21
  • I did try to build ioTivity-1.1.1 with two methods : 1. buildroot 2. cross-compilation via aarch64-linux-gnu-cpp Cross-Compilation with these following options : iotivity-1.1-rel$ scons TARGET_OS=linux TARGET_ARCH=aarch64 TARGET_TRANSPORT=ALL WITH_ENV=True BUILD_JAVA=False BUILD_SAMPLE=ON SECURED=1 SIMULATOR=False VERBOSE=True RD_MODE=SERVER TC_PREFIX=/usr/bin/aarch64-linux-gnu-cpp install scons: Reading SConscript files ... scons: *** Invalid value for option TARGET_ARCH: aarch64. Valid values are: ['x86', 'x86_64', 'arm', 'arm-v7a', 'armeabi-v7a', 'arm64'] – Linux Edwin K Jul 26 '17 at 12:08
  • >> I am able to install these following dependencies via buildroot : >> scons, boost, sqlite, mbedtls, gtest, cjson, tinycbor, libcurl, openssl, libcoap >> But getting loop of errors in building iotivity package >> According to my observation, the basic architecture of ioTivity package flows as: >> TARGET_OS = linux: only options: linux, android, arduino, yocto, tizen >> TARGET_ARCH = aarch64: Only if the TARGET_OS = yocto >> TARGET_ARCH = arm64: if the TARGET_OS = linux >> ** My Target is aarch64 based linux ** – Linux Edwin K Jul 26 '17 at 12:14
  • I'm suspicious this is going to fail. My cross-building experiments on current (1.3/master) fail pretty quickly - dependency checks like boost, googletest aren't set up for cross-building, _except_ in the very specific case of building for Android, which uses the Android toolchains (sdk, ndk) which are set up for that. The Yocto build has been debugged as well. One note: TC_PREFIX should just be name prefix, like 'arm-none-eabi-', use TC_PATH for the path to the toolchain. – Mats Wichmann Jul 26 '17 at 14:55
  • I am going to try with your Note given. I will post the corresponding result. Thanks for your support. P.S. :- Also I have sent a mail to buildroot@busybox.net and got some response saying : >> to add a new Buildroot package for iotivity, you can take package/mongodb/mongodb.mk as an example, as this package also uses SCons. I am going to try this too and post here. – Linux Edwin K Jul 27 '17 at 06:17
  • Another Update, * * I was able to generate boost_thread library (for both arm / aarch64) via Cross-Compilation and any other components related to Boost_C++ Library are possible /usr/lib/aarch64/lib/libboost_thread.so.1.55.0: ELF 64-bit LSB shared object, ARM aarch64, version 1 (GNU/Linux), dynamically linked, not stripped I am trying to fix the boost libraries path issue Because still its giving same error as follows : in both iotivity-1.1.1 & iotivity-1.3.0 for aarch64 :- Checking for C++ library boost_thread... no Did not find boost_thread, exiting..! – Linux Edwin K Aug 01 '17 at 05:05
  • This is pretty much what I was expecting in my earlier comment. The way the configure-style checks is done doesn't work for cross-building, which iotivity has avoided by just not doing it in known cases: android target doesn't CheckLib, nor does tizen target. You'd have to add another exclusion (at least in service/third_party_libs.scons). There's an old bug on this which helpfully ended up "wontfix". – Mats Wichmann Aug 02 '17 at 12:17
  • Why don't you join us on iotivity mailing list, looks like you'll just collect downvotes here. – Mats Wichmann Aug 02 '17 at 12:31
  • Sure. I am happy to join. So following is the link ? [link](https://lists.iotivity.org/mailman/listinfo/iotivity-dev) – Linux Edwin K Aug 02 '17 at 13:05
  • Yes, that is the place. – Mats Wichmann Aug 02 '17 at 18:43