Added workaround to enable security in CA branch
[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('glib-2.0'):
32                         print 'Install glib-2 on ubuntu with the following command'
33                         print 'sudo apt-get install libglib2.0-dev'
34                         Exit(1)
35
36                 conf.Finish()
37
38
39 ######################################################################
40 # The path of third party libraries binary
41 ######################################################################
42 if target_os == 'android':
43         if target_arch == 'armeabi-v7a-hard':
44                 target_arch = 'armeabi-v7a'
45
46         if target_arch not in ['x86', 'armeabi', 'armeabi-v7a']:
47                 if not env.GetOption('help') and not env.GetOption('clean'):
48                         print '''
49 *********************************** Warning ***********************************
50 * current only x86, armeabi, armeabi-v7a libraries are provided!              *
51 *******************************************************************************
52 '''
53         else:
54                 # Too much boost warning, suppress the warning
55                 lib_env.AppendUnique(CCFLAGS = ['-w'])
56
57 elif target_os == 'ios':
58         lib_env.AppendUnique(FRAMEWORKS = ['boost'])
59 elif target_os == 'darwin':
60         lib_env.AppendUnique(CPPPATH = ['/usr/local/include'])
61         lib_env.AppendUnique(LIBPATH = ['/usr/local/lib'])