1 ###########################################################################
3 # Copyright 2016 Samsung Electronics All Rights Reserved.
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
9 # http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing,
12 # software distributed under the License is distributed on an
13 # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
14 # either express or implied. See the License for the specific
15 # language governing permissions and limitations under the License.
17 ###########################################################################
20 # This script includes tizenrt specific config
27 print "Reading tizenrt configuration script"
29 host = platform.system().lower()
31 default_os_dir = env.GetLaunchDir() + '/../../../os'
33 # TIZENRT_OS_DIR build option
34 if env.get('TIZENRT_OS_DIR'):
35 tizenrt_os_dir = ARGUMENTS.get('TIZENRT_OS_DIR',default_os_dir)
36 print 'TIZENRT_OS_DIR = ' + tizenrt_os_dir
39 *************************************** Info **********************************
40 * Environment variable TIZENRT_OS_DIR must be set to absolute path of *
41 * tizenrt os directory. To set, please specify TIZENRT_OS_DIR as follows: *
42 * scons TIZENRT_OS_DIR= <path to tizenrt os directory> *
43 *******************************************************************************
46 target_arch = env.get('TARGET_ARCH')
48 env.AppendUnique(CCFLAGS = ['-fno-builtin'])
49 # Set release/debug flags
50 if env.get('RELEASE') == 1:
51 env.AppendUnique(CCFLAGS = ['-Os'])
52 env.AppendUnique(CPPDEFINES = ['NDEBUG'])
54 env.AppendUnique(CCFLAGS = ['-g'])
56 # we have variety of macros for tizenrt!!
57 #env.AppendUnique(CPPDEFINES = ['CONFIG_CLOCK_MONOTONIC'])
58 env.AppendUnique(CPPDEFINES = ['WITH_POSIX', '__TIZENRT__'])
59 # Set device name to __OIC_DEVICE_NAME__
60 env.AppendUnique(CPPDEFINES = ['-D__OIC_DEVICE_NAME__=' + "\'\"" + env.get('DEVICE_NAME') + "\"\'"])
61 if env.get('LOGGING'):
62 print 'LOGGING is enabled'
63 env.AppendUnique(CPPDEFINES = ['TB_LOG'])
66 # Determine dependency for tizenrt_os_dir
68 dep_src_dir1 = os.path.join(tizenrt_os_dir, 'include')
69 dep_src_dir2 = os.path.join(tizenrt_os_dir, 'include/tinyara')
70 dep_lib_dir = '/usr/lib/arm-none-eabi/include'
73 # Add directories to search for header files and external libraries
74 env.AppendUnique(CPPPATH = [ dep_src_dir1, dep_src_dir2 ])
75 env.AppendUnique(LIBPATH = [ dep_lib_dir ])
77 print env.get('CPPPATH')