Imported Upstream version 1.51.0
[platform/upstream/boost.git] / tools / build / v2 / kernel / bootstrap.py
1 # Copyright 2009 Vladimir Prus 
2 #
3 # Distributed under the Boost Software License, Version 1.0. 
4 # (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
5
6 import imp
7 import sys
8
9 def bootstrap(root_path):
10     """Performs python-side bootstrapping of Boost.Build/Python.
11
12     This function arranges for 'b2.whatever' package names to work, while also
13     allowing to put python files alongside corresponding jam modules.
14     """
15
16     m = imp.new_module("b2")
17     # Note that:
18     # 1. If __path__ is not list of strings, nothing will work
19     # 2. root_path is already list of strings.
20     m.__path__ = root_path
21     sys.modules["b2"] = m
22
23     import b2.build_system
24     return b2.build_system.main()
25