1 import os, string, sys, subprocess
5 boost_env = env.Clone()
7 modules = ['thread','program_options']
9 target_os = env.get('TARGET_OS')
10 target_arch = env.get('TARGET_ARCH')
12 if 'linux' == target_os :
13 # Check for Boost libraries in /usr/boost
14 print 'TODO: Perform platform check for linux'
15 raise SCons.Errors.EnvironmentError('Unsupported platform')
17 if 'android' == target_os :
18 env.Tool('URLDownload', toolpath=['../../tools/scons'])
19 env.Tool('UnpackAll', toolpath=['../../tools/scons'])
20 env.Tool('BoostBootstrap', toolpath=['../../tools/scons'])
21 env.Tool('BoostBuild', toolpath=['../../tools/scons'])
23 boost_version = '1.58.0'
24 boost_base_name = 'boost_'+string.replace(boost_version,'.','_')
25 boost_arch_name = boost_base_name+'.zip'
26 boost_url = 'http://downloads.sourceforge.net/project/boost/boost/'+boost_version+'/'+boost_arch_name+'?r=&ts=1421801329&use_mirror=iweb'
28 host_os = sys.platform
30 if host_os == 'linux2' :
31 boost_bootstrap = boost_base_name+os.sep+'bootstrap.sh'
32 boost_b2_name = boost_base_name+os.sep+'b2'
34 msg="Host platform (%s) is currently not supported for boost builds" % host_os
35 raise SCons.Errors.EnvironmentError(msg)
37 if not os.path.exists(boost_arch_name):
38 boost_arch_name = env.URLDownload(boost_arch_name, boost_url)
40 if not os.path.exists(boost_base_name):
41 boost_arch_name = env.UnpackAll(boost_bootstrap, boost_arch_name)
43 boost_b2 = env.BoostBootstrap(boost_b2_name, boost_arch_name)
45 dep_sys_root = env['DEP_SYS_ROOT']
46 dep_src_dir = dep_sys_root + os.sep + 'include'
47 dep_lib_dir = dep_sys_root + os.sep + 'lib'
50 os.path.join(dep_src_dir, 'boost', 'config.hpp'),
51 os.path.join(dep_src_dir, 'boost', 'variant.hpp'),
52 os.path.join(dep_src_dir, 'boost', 'program_options.hpp'),
53 os.path.join(dep_src_dir, 'libboost_thread.a'),
54 os.path.join(dep_src_dir, 'libboost_atomic.a'),
55 os.path.join(dep_src_dir, 'libboost_system.a'),
56 os.path.join(dep_src_dir, 'libboost_program_options.a')
59 boost_build = env.BoostBuild(boost_targets, boost_b2, PREFIX=dep_sys_root, MODULES=modules)