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.57.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 boost_zip = env.URLDownload(boost_arch_name, boost_url)
38 boost_dir = env.UnpackAll(boost_bootstrap, boost_zip)
39 boost_b2 = env.BoostBootstrap(boost_b2_name, boost_dir)
41 dep_sys_root = env['DEP_SYS_ROOT']
42 dep_src_dir = dep_sys_root + os.sep + 'include'
43 dep_lib_dir = dep_sys_root + os.sep + 'lib'
46 os.path.join(dep_src_dir, 'boost', 'config.hpp'),
47 os.path.join(dep_src_dir, 'boost', 'variant.hpp'),
48 os.path.join(dep_src_dir, 'boost', 'program_options.hpp'),
49 os.path.join(dep_src_dir, 'libboost_thread.a'),
50 os.path.join(dep_src_dir, 'libboost_atomic.a'),
51 os.path.join(dep_src_dir, 'libboost_system.a'),
52 os.path.join(dep_src_dir, 'libboost_program_options.a')
55 boost_build = env.BoostBuild(boost_targets, boost_b2, PREFIX=dep_sys_root, MODULES=modules)