fix for bug 3970
[blender-staging.git] / tools / scons / bs / bs_config.py
1 # configuration functions
2 import sys
3 import os
4
5 #import SCons.Script
6 import bs_globals
7
8 def checkPyVersion():
9         if hex(sys.hexversion) < 0x2030000:
10                 print ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
11                 print
12                 print "You need at least Python 2.3 to build Blender with SCons"
13                 print
14                 print ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
15                 sys.exit()
16
17 def parseOpts():
18         copyloc = ''
19         
20         all_args = sys.argv[1:]
21 #       parser =  SCons.Script.OptParser()
22 #       options, targets = parser.parse_args(all_args)
23         if ('clean' in bs_globals.targets):
24                 bs_globals.enable_clean = 1
25         
26         # User configurable options file. This can be controlled by the user by running
27         # scons with the following argument: CONFIG=user_config_options_file
28         bs_globals.config_file = bs_globals.arguments.get('CONFIG', 'config.opts')
29         bs_globals.root_build_dir = bs_globals.arguments.get('root_build_dir', '..' + os.sep + 'build' + os.sep + sys.platform + os.sep)
30         
31         copyloc = bs_globals.arguments.get('copyto', '0')
32         if copyloc == '0':
33                 bs_globals.docopy = 0;
34         else:
35                 bs_globals.docopy = 1;
36                 bs_globals.copyto = copyloc
37         
38