Merge "Added style formatting config files for iotivity coding standards"
[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                 conf.Finish()
36
37
38 ######################################################################
39 # The path of third party libraries binary
40 ######################################################################
41 if target_os == 'android':
42         if target_arch == 'armeabi-v7a-hard':
43                 target_arch = 'armeabi-v7a'
44
45         if target_arch not in ['x86', 'armeabi', 'armeabi-v7a']:
46                 if not env.GetOption('help') and not env.GetOption('clean'):
47                         print '''
48 *********************************** Warning ***********************************
49 * current only x86, armeabi, armeabi-v7a libraries are provided!              *
50 *******************************************************************************
51 '''
52         else:
53                 # Too much boost warning, suppress the warning
54                 lib_env.AppendUnique(CCFLAGS = ['-w'])
55
56 elif target_os == 'ios':
57         lib_env.AppendUnique(FRAMEWORKS = ['boost'])
58 elif target_os == 'darwin':
59         lib_env.AppendUnique(CPPPATH = ['/usr/local/include'])
60         lib_env.AppendUnique(LIBPATH = ['/usr/local/lib'])