1 ######################################################################
2 # This script manages extra build options
4 ######################################################################
10 target_os = env.get('TARGET_OS')
11 target_arch = env.get('TARGET_ARCH')
12 src_dir = env.get('SRC_DIR')
14 # Add 'OIC_UTILS' build option for user to set oic-utilities project path
15 if target_os not in ['linux', 'darwin', 'arduino']:
16 default_dir = os.environ.get('OIC_UTILS')
18 default_dir = os.path.abspath(src_dir + '/../oic-utilities')
20 default_dir = os.path.abspath(default_dir)
22 if not os.path.exists(default_dir):
25 help_vars = Variables()
26 help_vars.Add(PathVariable('OIC_UTILS', 'oic-utilities project path', default_dir))
28 Help(help_vars.GenerateHelpText(env))
30 utils_path = env.get('OIC_UTILS', default_dir)
32 utils_path = os.path.abspath(utils_path)
34 if not utils_path or not os.path.exists(utils_path):
36 *********************************** Error: ************************************
37 * oic-utilities project directory isn't set properly, please set enviornment*
38 * variable OIC_UTILS or set it in command line: *
39 * # scons OIC_UTILS=<path to oic-utilities> ... *
40 *******************************************************************************
44 if target_os == 'arduino':
45 # Add 'NET' build option, let user select board network connection type
47 vars.Add(EnumVariable('NET', 'Network connection type', 'Ethernet', ['Ethernet', 'Wifi']))
49 Help(vars.GenerateHelpText(env))
51 # check 'cereal' library, temporarily put it here
52 if not os.path.exists(src_dir + '/extlibs/cereal'):
54 *********************************** Error: **************************************
55 * 'Cereal' library doesn't exist. please download cereal to extlibs directory *
56 * add apply the patch as following: *
57 * $ git clone https://github.com/USCiLab/cereal.git <src_dir>/extlibs/cereal*
58 * $ cd <src_dir>/extlibs/cereal *
59 * $ git reset --hard 7121e91e6ab8c3e6a6516d9d9c3e6804e6f65245 *
60 * $ git apply ../../resource/patches/cereal_gcc46.patch *
61 *********************************************************************************
65 env.AppendUnique(CPPPATH = [src_dir + '/extlibs/cereal/include'])