"gbs.conf" file is for downloading the packages by GBS for tizen platform.
"scons-2.1.0-3.1.slp.noarch" is added because of the repository used for
downloading dependent packages does not include scons package which is
required for building.
Currently these scripts works for WIFI and BT transport.
Change-Id: I0c40853bc929945aa88921436b4ff4d14efb4eb1
Signed-off-by: Harish Kumara Marappa <h.marappa@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/490
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Uze Choi <uzchoi@samsung.com>
# Map of os and allowed archs (os: allowed archs)
os_arch_map = {
'linux': ['x86', 'x86_64', 'arm', 'arm64'],
- 'tizen': ['x86', 'x86_64', 'arm', 'arm64'],
+ 'tizen': ['x86', 'x86_64', 'arm', 'arm64', 'armeabi-v7a'],
'android': ['x86', 'x86_64', 'armeabi', 'armeabi-v7a', 'armeabi-v7a-hard', 'arm64-v8a'],
'windows': ['x86', 'amd64', 'arm'],
'winrt': ['arm'],
env.ParseConfig("pkg-config glib-2.0 gthread-2.0 --cflags --libs")
+if env.get('TARGET_OS') == 'tizen':
+ env.AppendUnique(CFLAGS = ['-D__TIZEN__', '-DSLP_SDK_LOG', '-D_GNU_SOURCE', '-DTIZEN_DEBUG_ENABLE'])
+ env.ParseConfig("pkg-config dlog --cflags --libs")
+
# Set arch flags
target_arch = env.get('TARGET_ARCH')
if target_arch in ['x86']:
--- /dev/null
+#!/bin/sh
+
+spec=`ls tools/tizen/*.spec`
+version=`rpm --query --queryformat '%{version}\n' --specfile $spec`
+
+name=`echo $name|cut -d" " -f 1`
+version=`echo $version|cut -d" " -f 1`
+
+name=iotivity
+
+rm -rf $name-$version
+
+builddir=`pwd`
+sourcedir=`pwd`
+
+echo `pwd`
+
+mkdir ./tmp
+mkdir ./tmp/extlibs/
+mkdir ./tmp/packaging
+cp -R ./build_common $sourcedir/tmp
+cp -R ./examples $sourcedir/tmp
+cp -R ./extlibs/cereal $sourcedir/tmp/extlibs
+cp -R ./extlibs/cjson $sourcedir/tmp/extlibs
+cp -R ./extlibs/tinydtls $sourcedir/tmp/extlibs
+cp -R ./extlibs/timer $sourcedir/tmp/extlibs
+cp -R ./extlibs/rapidxml $sourcedir/tmp/extlibs
+cp -R ./resource $sourcedir/tmp
+cp -R ./service $sourcedir/tmp
+cp ./extra_options.scons $sourcedir/tmp
+cp ./tools/tizen/*.spec ./tmp/packaging
+cp ./SConstruct ./tmp
+cp ./tools/tizen/*.rpm ./tmp
+cp ./tools/tizen/.gbs.conf ./tmp
+cd $sourcedir/tmp
+
+echo `pwd`
+rm -rf ./extlibs/cereal/cereal/.git*
+
+# Initialize Git repository
+if [ ! -d .git ]; then
+ git init ./
+ git config user.email "you@example.com"
+ git config user.name "Your Name"
+ git add ./
+ git commit -m "Initial commit"
+fi
+
+echo "Calling core gbs build command"
+gbscommand="gbs build -A armv7l -B ~/GBS-ROOT --include-all --repository ./"
+echo $gbscommand
+if eval $gbscommand; then
+ echo "Build is successful"
+else
+ echo "Build failed!"
+fi
+
+cd $sourcedir
+rm -rf $sourcedir/tmp
print"Reading bt adapter script"
target_os = env.get('TARGET_OS')
+
+if target_os == 'tizen':
+ env.ParseConfig("pkg-config --cflags --libs capi-network-bluetooth")
+
src_dir = './bt_edr_adapter/'
#Source files to build common for all platforms
print"Reading ble adapter script"
target_os = env.get('TARGET_OS')
+
+if target_os == 'tizen':
+ env.ParseConfig("pkg-config --cflags --libs capi-network-bluetooth")
+
src_dir = './bt_le_adapter/'
#Source files to build common for all platforms
target_os = env.get('TARGET_OS')
src_dir = './wifi_adapter/'
+if target_os == 'tizen':
+ env.ParseConfig("pkg-config --cflags --libs capi-network-wifi")
+
#Source files to build common for all platforms
if target_os != 'arduino':
env.AppendUnique(CA_SRC=[src_dir+'cawifiadapter.c'])
# The code include pthread_cancel method, can't build on android
# MQTT requires openssl, forbid cross compile as it isn't ready
-if env.get('TARGET_OS') != 'android' and env.get('TARGET_ARCH') == platform.machine():
+#if env.get('TARGET_OS') != 'android' and env.get('TARGET_ARCH') == platform.machine():
+if env.get('TARGET_OS') != 'android':
SConscript('plugins/SConscript')
SConscript('sample-app/SConscript')
##
# things_manager project build script
##
-
+import os
Import('env')
# Add third party libraries
things_manager_env.AppendUnique(CPPPATH = ['../../extlibs/timer', 'sdk/inc', 'sdk/src'])
if target_os not in ['windows', 'winrt']:
- things_manager_env.AppendUnique(CXXFLAGS = ['-std=c++0x', '-Wall'])
- if target_os != 'android':
- things_manager_env.AppendUnique(CXXFLAGS = ['-pthread'])
+ things_manager_env.AppendUnique(CXXFLAGS = ['-std=c++0x', '-Wall'])
+ if target_os != 'android':
+ things_manager_env.AppendUnique(CXXFLAGS = ['-pthread'])
if target_os == 'android':
- things_manager_env.AppendUnique(CXXFLAGS = ['-frtti', '-fexceptions'])
+ things_manager_env.AppendUnique(CXXFLAGS = ['-frtti', '-fexceptions'])
+ things_manager_env.PrependUnique(LIBS = ['gnustl_shared', 'compatibility', 'log'])
######################################################################
# Source files and Targets
######################################################################
-# tgm_src = env.Glob(['sdk/src/*.cpp', '../../extlibs/timer/timer.c'])
-tgm_src = [
- 'sdk/src/GroupManager.cpp',
- 'sdk/src/ActionSet.cpp',
- 'sdk/src/GroupSynchronization.cpp',
- 'sdk/src/ThingsConfiguration.cpp',
- 'sdk/src/ThingsDiagnostics.cpp',
- 'sdk/src/ThingsManager.cpp']
-tgmsdk = things_manager_env.StaticLibrary('TGMSDKLibrary', tgm_src)
+tgm_src = env.Glob('sdk/src/*.cpp', '../../extlibs/timer/timer.c')
+tgmsdk_static = things_manager_env.StaticLibrary('TGMSDKLibrary', tgm_src)
+tgmsdk_shared = things_manager_env.SharedLibrary('TGMSDKLibrary', tgm_src)
-things_manager_env.InstallTarget(tgmsdk, 'libTGMSDK')
+things_manager_env.InstallTarget([tgmsdk_static,tgmsdk_shared], 'libTGMSDK')
#Go to build sample apps
SConscript('sampleapp/SConscript')
--- /dev/null
+[general]
+#Current profile name which should match a profile section name
+profile = profile.tizen
+
+[profile.tizen]
+#Common authentication info for whole profile
+#user =
+#CAUTION: please use the key name "passwd" to reset plaintext password
+#passwd =
+obs = obs.tizen
+#Comma separated list of repositories
+repos = repo.tizen_latest
+#repos = repo.tizen_main, repo.tizen_base
+#Build config for gbs build
+#buildconf = <patch/to/build-config-file>
+#Comma separated list of additional packages be excluded building
+#exclude_packages = libtool,gettext
+
+
+[obs.tizen]
+#OBS API URL pointing to a remote OBS.
+url = https://api.tizen.org
+#Optional user and password, set if differ from profile's user and password
+#user =
+#passwd =
+
+#Repo section example
+[repo.tizen_latest]
+#Build against repo's URL
+url = http://download.tizen.org/releases/2.3/2.3-mobile/tizen-2.3-mobile_20150206.1/repos/target/packages/
+#Optional user and password, set if differ from profile's user and password
+#user =
+#passwd =
+
+#Individual repo is also supported
+#[repo.tizen_base]
+#url = http://download.tizen.org/releases/daily/trunk/ivi/latest/repos/base/ia32/packages/
+#[repo.tizen_main]
+#url = http://download.tizen.org/releases/daily/trunk/ivi/latest/repos/ivi/ia32/packages/
BuildRequires: scons
BuildRequires: openssl-devel
BuildRequires: boost-devel
+BuildRequires: boost-thread
+BuildRequires: boost-system
+BuildRequires: boost-filesystem
+BuildRequires: pkgconfig(dlog)
+BuildRequires: pkgconfig(gthread-2.0)
+BuildRequires: pkgconfig(glib-2.0)
+BuildRequires: pkgconfig(capi-network-wifi)
+BuildRequires: pkgconfig(capi-network-bluetooth)
Requires(postun): /sbin/ldconfig
Requires(post): /sbin/ldconfig
%endif
-scons -j 4 TARGET_OS=tizen TARGET_ARCH=$RPM_ARCH
+scons -j 4 TARGET_OS=tizen TARGET_ARCH=$RPM_ARCH TARGET_TRANSPORT=WIFI
%install
rm -rf %{buildroot}
cp resource/csdk/stack/include/ocstack.h %{buildroot}%{_includedir}
cp resource/csdk/stack/include/ocstackconfig.h %{buildroot}%{_includedir}
-cp resource/csdk/ocsocket/include/ocsocket.h %{buildroot}%{_includedir}
+#cp resource/csdk/ocsocket/include/ocsocket.h %{buildroot}%{_includedir}
cp resource/oc_logger/include/oc_logger.hpp %{buildroot}%{_includedir}
cp resource/oc_logger/include/oc_log_stream.hpp %{buildroot}%{_includedir}
cp resource/oc_logger/include/oc_logger.h %{buildroot}%{_includedir}