Removed glib package dependency and added uuid package dependency.
Change-Id: I31ab7b2946dea000a499248276160fb20cd2214d
Signed-off-by: Harish Kumara Marappa <h.marappa@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/1066
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Uze Choi <uzchoi@samsung.com>
so you don't need to add it in command line each time. The build script will
guide you to do that.)
+Tizen:
+To build for tizen platform cereal library is needed.
+Please download cereal if it is not present in extlibs/cereal folder
+and apply the patch as following:
+ $ git clone https://github.com/USCiLab/cereal.git extlibs/cereal/cereal
+ $ cd extlibs/cereal/cereal
+ $ git reset --hard 7121e91e6ab8c3e6a6516d9d9c3e6804e6f65245
+ $ git apply ../../../resource/patches/cereal_gcc46.patch
+
+
* 3. External libraries
IoTivity project depends on some external libraries, such as boost, expat ...
During building, the existence of external library will be checked, if it doesn't
4. Build Iotivity project for Tizen
$ cd <top directory of the project>
- $ gbs build -A xxx --packaging-dir tools/tizen/
-(xxx can be i586 or armv7l, we provide the spec file required by gbs tool at
-toools/tizen directory. gbs is default build tool for Tizen platfrom, we can
-refer the following wiki to setup Tizen development environment:
+ $ sh gbsbuild.sh
+(we provide the spec file required by gbs tool at toools/tizen directory.
+gbs is default build tool for Tizen platfrom, we can refer the following
+wiki to setup Tizen development environment:
https://source.tizen.org/documentation/developer-guide/getting-started-guide)
=== Build IoTivity project on Android ===
If target_os is not Yocto, continue with the regular build process
'''
# Load config of target os
- if target_os in ['linux', 'tizen']:
- env.SConscript('linux/SConscript')
- else:
- env.SConscript(target_os + '/SConscript')
+ env.SConscript(target_os + '/SConscript')
# Delete the temp files of configuration
if env.GetOption('clean'):
env.AppendUnique(LIBS = ['uuid'])
env.AppendUnique(LINKFLAGS = ['-ldl', '-lpthread'])
-if env.get('TARGET_OS') == 'tizen':
- env.AppendUnique(CCFLAGS = ['-D__TIZEN__', '-DSLP_SDK_LOG', '-D_GNU_SOURCE', '-DTIZEN_DEBUG_ENABLE'])
- env.ParseConfig("pkg-config glib-2.0 gthread-2.0 --cflags --libs")
- env.ParseConfig("pkg-config dlog --cflags --libs")
-
# Set arch flags
target_arch = env.get('TARGET_ARCH')
if target_arch in ['x86']:
--- /dev/null
+##
+# This script set linux specific flags (GNU GCC)
+#
+##
+Import('env')
+
+print "Reading linux configuration script"
+
+# Set release/debug flags
+if env.get('RELEASE'):
+ env.AppendUnique(CCFLAGS = ['-Os'])
+ env.AppendUnique(CPPDEFINES = ['NDEBUG'])
+else:
+ env.AppendUnique(CCFLAGS = ['-g'])
+
+if env.get('LOGGING'):
+ env.AppendUnique(CPPDEFINES = ['-DTB_LOG'])
+
+env.AppendUnique(CPPDEFINES = ['WITH_POSIX', '__linux__'])
+env.AppendUnique(CFLAGS = ['-std=gnu99'])
+env.AppendUnique(CCFLAGS = ['-Wall', '-fPIC'])
+env.AppendUnique(LINKFLAGS = ['-ldl', '-lpthread'])
+
+if env.get('TARGET_OS') == 'tizen':
+ env.AppendUnique(CCFLAGS = ['-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']:
+ env.AppendUnique(CCFLAGS = ['-m32'])
+ env.AppendUnique(LINKFLAGS = ['-m32'])
+elif target_arch in ['x86_64']:
+ env.AppendUnique(CCFLAGS = ['-m64'])
+ env.AppendUnique(LINKFLAGS = ['-m64'])
+elif target_arch.find('v7a-hard') > 0:
+ env.AppendUnique(CPPFLAGS = ['-march=armv7-a'])
+ env.AppendUnique(CPPFLAGS = ['-mfloat-abi=hard'])
+ env.AppendUnique(CCFLAGS = ['-mfloat-abi=hard'])
+ env.AppendUnique(LINKFLAGS = ['-mfloat-abi=hard'])
+elif target_arch.find('v7a') > 0:
+ env.AppendUnique(CPPFLAGS = ['-march=armv7-a'])
+elif target_arch.find('arm64') >= 0:
+ env.AppendUnique(CPPFLAGS = ['-march=armv8-a'])
+else:
+ env.AppendUnique(CPPFLAGS = ['-march=armv5te'])
liboctbstack_env.AppendUnique(LIBPATH = [env.get('BUILD_DIR')])
-if target_os in ['android', 'linux']:
+if target_os in ['android', 'linux', 'tizen']:
liboctbstack_env.AppendUnique(LIBS = ['connectivity_abstraction'])
liboctbstack_env.AppendUnique(LIBS = ['coap', 'm'])
+if target_os == 'tizen':
+ liboctbstack_env.ParseConfig("pkg-config --cflags --libs uuid")
+
if target_os not in ['android', 'arduino', 'windows', 'winrt']:
liboctbstack_env.AppendUnique(LIBS = ['pthread'])
inc_files = env.get('CPPPATH')
src_dir = './ip_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+'caipadapter_singlethread.c'])
''' % target_arch
conf = Configure(lib_env)
-
- if target_os in ['tizen'] and not conf.CheckLib('glib-2.0'):
- print 'Install glib-2.0 to compile on Tizen platforms'
- Exit(1)
-
conf.Finish()
ssmcore_env.AppendUnique(LIBS = ['oc', 'octbstack', 'oc_logger',
'connectivity_abstraction', 'coap'])
-if target_os in ['tizen']:
- ssmcore_env.ParseConfig('pkg-config --libs glib-2.0');
-
shared_libssmcore = ssmcore_env.SharedLibrary(
target = 'SSMCore',
source = [ssm_core_cpp_src, ssm_core_c_src]
conf = Configure(lib_env)
- if not conf.CheckLib('boost_thread', language='C++'):
+ if target_os not in ['tizen'] and not conf.CheckLib('boost_thread', language='C++'):
print 'Did not find boost_thread, exiting!'
Exit(1)
- if not conf.CheckLib('boost_system', language='C++'):
+ if target_os not in ['tizen'] and not conf.CheckLib('boost_system', language='C++'):
print 'Did not find boost_system, exiting!'
Exit(1)
BuildRequires: boost-system
BuildRequires: boost-filesystem
BuildRequires: pkgconfig(dlog)
-BuildRequires: pkgconfig(gthread-2.0)
-BuildRequires: pkgconfig(glib-2.0)
+BuildRequires: pkgconfig(uuid)
BuildRequires: pkgconfig(capi-network-wifi)
BuildRequires: pkgconfig(capi-network-bluetooth)
Requires(postun): /sbin/ldconfig
%endif
-scons -j 4 TARGET_OS=tizen TARGET_ARCH=$RPM_ARCH TARGET_TRANSPORT=WIFI
+scons -j 4 TARGET_OS=tizen TARGET_ARCH=$RPM_ARCH TARGET_TRANSPORT=IP
%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/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}