1 ######################################################################
2 # This script manages third party libraries
4 #Note: The paths must keep consistent with oic-resource
5 ######################################################################
9 Import('env', 'lib_env')
11 target_os = env.get('TARGET_OS')
12 target_arch = env.get('TARGET_ARCH')
13 src_dir = env.get('SRC_DIR')
15 resource_path = src_dir + '/resource'
17 ######################################################################
18 # Check dependent packages (Linux only)
19 ######################################################################
20 if target_os in ['linux', 'tizen']:
21 if not env.GetOption('help'):
22 if not target_arch == platform.machine():
24 *********************************** Warning ***********************************
25 * You are trying cross build, please make sure (%s) version libraries are
27 *******************************************************************************
30 conf = Configure(lib_env)
32 if not conf.CheckLib('boost_thread'):
33 print 'Did not find boost_thread, exiting!'
36 if not conf.CheckLib('boost_system'):
37 print 'Did not find boost_system, exiting!'
42 ######################################################################
43 # The 'include' path of external libraries
44 ######################################################################
45 lib_env.AppendUnique(CPPPATH = [
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'
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'
62 if target_arch not in ['x86', 'armeabi', 'armeabi-v7a']:
63 if not env.GetOption('help') and not env.GetOption('clean'):
65 *********************************** Warning ***********************************
66 * current only x86, armeabi, armeabi-v7a libraries are provided! *
67 *******************************************************************************
70 # Too much boost warning, suppress the warning
71 lib_env.AppendUnique(CCFLAGS = ['-w'])
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'])
80 lib_env.AppendUnique(LIBPATH = env.get('BUILD_DIR'))