move from ./tools/tizen to ./packaging
[platform/upstream/iotivity.git] / extra_options.scons
1 ######################################################################
2 # This script manages extra build options
3 #
4 ######################################################################
5 import os
6 import platform
7
8 Import('env')
9
10 target_os = env.get('TARGET_OS')
11 target_arch = env.get('TARGET_ARCH')
12 src_dir = env.get('SRC_DIR')
13
14 if target_os == 'arduino':
15         # Add 'NET' build option, let user select board network connection type
16         vars = Variables()
17         vars.Add(EnumVariable('NET', 'Network connection type', 'Ethernet', ['Ethernet', 'Wifi']))
18         vars.Update(env)
19         Help(vars.GenerateHelpText(env))
20
21 # check 'cereal' library, temporarily put it here
22 if not os.path.exists(src_dir + '/extlibs/cereal'):
23         print '''
24 *********************************** Error: **************************************
25 *  'Cereal' library doesn't exist. please download cereal to extlibs directory  *
26 * add apply the patch as following:                                             *
27 *     $ git clone https://github.com/USCiLab/cereal.git <src_dir>/extlibs/cereal*
28 *     $ cd <src_dir>/extlibs/cereal                                             *
29 *     $ git reset --hard 7121e91e6ab8c3e6a6516d9d9c3e6804e6f65245               *
30 *     $ git apply ../../resource/patches/cereal_gcc46.patch                     *
31 *********************************************************************************
32 '''
33         Exit(1)
34 else:
35         env.AppendUnique(CPPPATH = [src_dir + '/extlibs/cereal/include'])