Remove oic-utilities as a requirement
[platform/upstream/iotivity.git] / service / third_party_libs.scons
1 ######################################################################
2 # This script manages third party libraries
3 #
4 #Note: The paths must keep consistent with oic-resource
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 resource_path = src_dir + '/resource'
16
17 ######################################################################
18 # Check dependent packages (Linux only)
19 ######################################################################
20 if target_os == 'linux':
21         if not env.GetOption('help'):
22                 if not target_arch == platform.machine():
23                         print '''
24 *********************************** Warning ***********************************
25 * You are trying cross build, please make sure (%s) version libraries are
26 * installed!                                                                  *
27 *******************************************************************************
28 ''' % target_arch
29
30                 conf = Configure(lib_env)
31
32                 if not conf.CheckLib('boost_thread'):
33                         print 'Did not find boost_thread, exiting!'
34                         Exit(1)
35
36                 if not conf.CheckLib('boost_system'):
37                         print 'Did not find boost_system, exiting!'
38                         Exit(1)
39
40                 conf.Finish()
41
42 ######################################################################
43 # The 'include' path of external libraries
44 ######################################################################
45 lib_env.AppendUnique(CPPPATH = [
46                 resource_path ,
47                 resource_path + '/include' ,
48                 resource_path + '/oc_logger/include',
49                 resource_path + '/csdk/stack/include',
50                 resource_path + '/csdk/ocsocket/include',
51                 resource_path + '/csdk/ocrandom/include',
52                 resource_path + '/csdk/logger/include'
53                 ])
54
55 ######################################################################
56 # The path of third party libraries binary
57 ######################################################################
58 if target_os == 'android':
59         if target_arch == 'armeabi-v7a-hard':
60                 target_arch = 'armeabi-v7a'
61
62         if target_arch not in ['x86', 'armeabi', 'armeabi-v7a']:
63                 if not env.GetOption('help') and not env.GetOption('clean'):
64                         print '''
65 *********************************** Warning ***********************************
66 * current only x86, armeabi, armeabi-v7a libraries are provided!              *
67 *******************************************************************************
68 '''
69         else:
70                 # Too much boost warning, suppress the warning
71                 lib_env.AppendUnique(CCFLAGS = ['-w'])
72
73 elif target_os == 'ios':
74         lib_env.AppendUnique(FRAMEWORKS = ['boost', 'expat', 'openssl'])
75 elif target_os == 'darwin':
76         lib_env.AppendUnique(CPPPATH = ['/usr/local/include'])
77         lib_env.AppendUnique(LIBPATH = ['/usr/local/lib'])
78
79 Import('env')
80 lib_env.AppendUnique(LIBPATH = env.get('BUILD_DIR'))