Fix failed unit tests for CSDK stack.
[platform/upstream/iotivity.git] / resource / third_party_libs.scons
1 ######################################################################
2 # This script manages third party libraries
3 #
4 #Note: The paths must keep consistent with oic-utilities
5 ######################################################################
6 import os
7 import platform
8
9 Import('env', 'lib_env')
10
11 target_os = env.get('TARGET_OS')
12 target_arch = env.get('TARGET_ARCH')
13 src_dir = env.get('SRC_DIR')
14
15
16 ######################################################################
17 # Check dependent packages (Linux only)
18 ######################################################################
19 if target_os in ['linux', 'tizen']:
20         if not env.GetOption('help'):
21                 if not target_arch == platform.machine():
22                         print '''
23 *********************************** Warning ***********************************
24 * You are trying cross build, please make sure (%s) version libraries are
25 * installed!                                                                  *
26 *******************************************************************************
27 ''' % target_arch
28
29                 conf = Configure(lib_env)
30
31                 if not conf.CheckLib('boost_program_options'):
32                         print 'Did not find boost_program_options, exiting!'
33                         Exit(1)
34
35                 if not conf.CheckLib('glib-2.0'):
36                         print 'Install glib-2 on ubuntu with the following command'
37                         print 'sudo apt-get install libglib2.0-dev'
38                         Exit(1)
39
40                 conf.Finish()
41
42
43 ######################################################################
44 # The path of third party libraries binary
45 ######################################################################
46 if target_os == 'android':
47         if target_arch == 'armeabi-v7a-hard':
48                 target_arch = 'armeabi-v7a'
49
50         if target_arch not in ['x86', 'armeabi', 'armeabi-v7a']:
51                 if not env.GetOption('help') and not env.GetOption('clean'):
52                         print '''
53 *********************************** Warning ***********************************
54 * current only x86, armeabi, armeabi-v7a libraries are provided!              *
55 *******************************************************************************
56 '''
57         else:
58                 # Too much boost warning, suppress the warning
59                 lib_env.AppendUnique(CCFLAGS = ['-w'])
60
61 elif target_os == 'ios':
62         lib_env.AppendUnique(FRAMEWORKS = ['boost'])
63 elif target_os == 'darwin':
64         lib_env.AppendUnique(CPPPATH = ['/usr/local/include'])
65         lib_env.AppendUnique(LIBPATH = ['/usr/local/lib'])