1 ######################################################################
2 # This script manages third party libraries
4 #Note: The paths must keep consistent with oic-utilities
5 ######################################################################
8 Import('env', 'BUILD_TARGET', 'TARGET_CPU_ARCH', 'SRC_TOP_DIR')
10 # Add 'OIC_UTILS' build option for user to set oic-utilities project path
11 default_dir = os.path.abspath(SRC_TOP_DIR + '/../oic-utilities')
12 OIC_UTILS = ARGUMENTS.get('OIC_UTILS', default_dir)
13 if not os.path.exists(OIC_UTILS):
15 *********************************** Error: ************************************
16 * oic-utilities project directory(OIC_UTILS) isn't set properly, please set *
17 * enviornment variable OIC_UTILS or set it in command line: *
18 * # scons OIC_UTILS=<path to oic-utilities> ... *
19 *******************************************************************************
23 if env.get('OIC_UTILS') is None:
25 vars.Add(PathVariable('OIC_UTILS', 'oic-utilities project path', OIC_UTILS))
27 Help(vars.GenerateHelpText(env))
30 ######################################################################
31 # Check dependent packages (Linux)
32 ######################################################################
33 if BUILD_TARGET == 'linux':
34 # Delete the temp files of configuration
35 if env.GetOption('clean'):
36 if os.path.exists(SRC_TOP_DIR + 'config.log'):
37 Execute(Delete(SRC_TOP_DIR + 'config.log'))
38 Execute(Delete(SRC_TOP_DIR + '.sconsign.dblite'))
39 Execute(Delete(SRC_TOP_DIR + '.sconf_temp'))
40 elif not env.GetOption('help'):
43 if not conf.CheckLib('boost_program_options'):
44 print 'Did not find boost_program_options, exiting!'
49 ######################################################################
50 # The 'include' path of third party libraries
51 ######################################################################
53 if BUILD_TARGET == 'android':
54 env.AppendUnique(CPPPATH = [OIC_UTILS + '/android/boost/include'])
56 ######################################################################
57 # The path of third party libraries binary
58 ######################################################################
59 if BUILD_TARGET == 'android':
60 arch = TARGET_CPU_ARCH
61 if arch == 'armeabi-v7a-hard':
64 if arch not in ['x86', 'armeabi', 'armeabi-v7a']:
66 *********************************** Warning ***********************************
67 * current only x86, armeabi, armeabi-v7a libraries are offered! *
68 *******************************************************************************
71 env.AppendUnique(LIBPATH = [OIC_UTILS + '/android/boost/libs/' + arch])
73 elif BUILD_TARGET == 'ios':
74 env.AppendUnique(FRAMEWORKPATH = [OIC_UTILS + '/ios/frameworks/'])
75 env.AppendUnique(FRAMEWORKS = ['boost'])
76 elif BUILD_TARGET == 'darwin':
77 env.AppendUnique(CPPPATH = ['/usr/local/include'])
78 env.AppendUnique(LIBPATH = ['/usr/local/lib'])