mbedtls: Update to mbedtls-2.4.2
[platform/upstream/iotivity.git] / resource / third_party_libs.scons
1 #******************************************************************
2 #
3 # Copyright 2014 Intel Mobile Communications GmbH All Rights Reserved.
4 #
5 #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
6 #
7 # Licensed under the Apache License, Version 2.0 (the "License");
8 # you may not use this file except in compliance with the License.
9 # You may obtain a copy of the License at
10 #
11 #      http://www.apache.org/licenses/LICENSE-2.0
12 #
13 # Unless required by applicable law or agreed to in writing, software
14 # distributed under the License is distributed on an "AS IS" BASIS,
15 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 # See the License for the specific language governing permissions and
17 # limitations under the License.
18 #
19 #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
20
21 ######################################################################
22 # This script manages third party libraries
23 #
24 # Note: The paths must keep consistent with oic-utilities
25 ######################################################################
26 import os
27 import platform
28
29 Import('env', 'lib_env')
30
31 target_os = env.get('TARGET_OS')
32 target_arch = env.get('TARGET_ARCH')
33 src_dir = env.get('SRC_DIR')
34
35 ######################################################################
36 # Check dependent packages (Linux only)
37 ######################################################################
38 if target_os in ['linux']:
39     if not env.GetOption('help') and not env.GetOption('clean'):
40         if target_arch != platform.machine() and \
41            not (target_arch == 'x86' and platform.machine() in ('i586', 'i686')):
42             print '''
43 *********************************** Warning **********************************
44 * You are trying cross build, please make sure cross (%s) libraries are
45 * installed!
46 ******************************************************************************
47 ''' % target_arch
48
49     conf = Configure(lib_env)
50     conf.Finish()
51
52 ######################################################################
53 # The path of third party libraries binary
54 ######################################################################
55 if target_os == 'android':
56     if target_arch == 'armeabi-v7a-hard':
57         target_arch = 'armeabi-v7a'
58
59     if target_arch not in ['x86', 'x86_64', 'armeabi', 'armeabi-v7a']:
60         if not env.GetOption('help') and not env.GetOption('clean'):
61             print '''
62 *********************************** Warning ***********************************
63 * currently only x86, x86_64, armeabi, armeabi-v7a libraries are available!
64 *******************************************************************************
65 '''
66     else:
67         # Boost warnings too noisy, suppress
68         lib_env.AppendUnique(CCFLAGS=['-w'])
69
70 elif target_os in ['windows']:
71     SConscript(os.path.join(src_dir, 'extlibs', 'boost', 'SConscript'))
72     boost_path = os.path.join(src_dir, 'extlibs', 'boost', 'boost')
73     lib_env.AppendUnique(CPPPATH=[boost_path])
74 elif target_os == 'ios':
75     lib_env.AppendUnique(FRAMEWORKPATH=[src_dir + '/extlibs/boost/ios/framework'])
76     lib_env.AppendUnique(FRAMEWORKS=['boost'])
77 elif target_os == 'darwin':
78     lib_env.AppendUnique(CPPPATH=['/usr/local/include'])
79     lib_env.AppendUnique(LIBPATH=['/usr/local/lib'])