OLD | NEW |
1 """SCons.Defaults | 1 """SCons.Defaults |
2 | 2 |
3 Builders and other things for the local site. Here's where we'll | 3 Builders and other things for the local site. Here's where we'll |
4 duplicate the functionality of autoconf until we move it into the | 4 duplicate the functionality of autoconf until we move it into the |
5 installation procedure or use something like qmconf. | 5 installation procedure or use something like qmconf. |
6 | 6 |
7 The code that reads the registry to find MSVC components was borrowed | 7 The code that reads the registry to find MSVC components was borrowed |
8 from distutils.msvccompiler. | 8 from distutils.msvccompiler. |
9 | 9 |
10 """ | 10 """ |
11 | 11 |
12 # | 12 # |
13 # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 The SCons Foundat
ion | 13 # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 The SCons F
oundation |
14 # | 14 # |
15 # Permission is hereby granted, free of charge, to any person obtaining | 15 # Permission is hereby granted, free of charge, to any person obtaining |
16 # a copy of this software and associated documentation files (the | 16 # a copy of this software and associated documentation files (the |
17 # "Software"), to deal in the Software without restriction, including | 17 # "Software"), to deal in the Software without restriction, including |
18 # without limitation the rights to use, copy, modify, merge, publish, | 18 # without limitation the rights to use, copy, modify, merge, publish, |
19 # distribute, sublicense, and/or sell copies of the Software, and to | 19 # distribute, sublicense, and/or sell copies of the Software, and to |
20 # permit persons to whom the Software is furnished to do so, subject to | 20 # permit persons to whom the Software is furnished to do so, subject to |
21 # the following conditions: | 21 # the following conditions: |
22 # | 22 # |
23 # The above copyright notice and this permission notice shall be included | 23 # The above copyright notice and this permission notice shall be included |
24 # in all copies or substantial portions of the Software. | 24 # in all copies or substantial portions of the Software. |
25 # | 25 # |
26 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY | 26 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY |
27 # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE | 27 # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE |
28 # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | 28 # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
29 # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE | 29 # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE |
30 # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION | 30 # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION |
31 # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION | 31 # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION |
32 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | 32 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
33 # | 33 # |
34 | 34 |
35 __revision__ = "src/engine/SCons/Defaults.py 3842 2008/12/20 22:59:52 scons" | 35 __revision__ = "src/engine/SCons/Defaults.py 3897 2009/01/13 06:45:54 scons" |
36 | 36 |
37 | 37 |
38 | 38 |
39 import os | 39 import os |
40 import os.path | 40 import os.path |
| 41 import errno |
41 import shutil | 42 import shutil |
42 import stat | 43 import stat |
43 import string | 44 import string |
44 import time | 45 import time |
45 import types | 46 import types |
46 import sys | 47 import sys |
47 | 48 |
48 import SCons.Action | 49 import SCons.Action |
49 import SCons.Builder | 50 import SCons.Builder |
50 import SCons.CacheDir | 51 import SCons.CacheDir |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 def delete_strfunc(dest, must_exist=0): | 214 def delete_strfunc(dest, must_exist=0): |
214 return 'Delete(%s)' % get_paths_str(dest) | 215 return 'Delete(%s)' % get_paths_str(dest) |
215 | 216 |
216 Delete = ActionFactory(delete_func, delete_strfunc) | 217 Delete = ActionFactory(delete_func, delete_strfunc) |
217 | 218 |
218 def mkdir_func(dest): | 219 def mkdir_func(dest): |
219 SCons.Node.FS.invalidate_node_memos(dest) | 220 SCons.Node.FS.invalidate_node_memos(dest) |
220 if not SCons.Util.is_List(dest): | 221 if not SCons.Util.is_List(dest): |
221 dest = [dest] | 222 dest = [dest] |
222 for entry in dest: | 223 for entry in dest: |
223 os.makedirs(str(entry)) | 224 try: |
| 225 os.makedirs(str(entry)) |
| 226 except os.error, e: |
| 227 p = str(entry) |
| 228 if e[0] == errno.EEXIST and os.path.isdir(str(entry)): |
| 229 pass # not an error if already exists |
| 230 else: |
| 231 raise |
224 | 232 |
225 Mkdir = ActionFactory(mkdir_func, | 233 Mkdir = ActionFactory(mkdir_func, |
226 lambda dir: 'Mkdir(%s)' % get_paths_str(dir)) | 234 lambda dir: 'Mkdir(%s)' % get_paths_str(dir)) |
227 | 235 |
228 def move_func(dest, src): | 236 def move_func(dest, src): |
229 SCons.Node.FS.invalidate_node_memos(dest) | 237 SCons.Node.FS.invalidate_node_memos(dest) |
230 SCons.Node.FS.invalidate_node_memos(src) | 238 SCons.Node.FS.invalidate_node_memos(src) |
231 os.rename(src, dest) | 239 os.rename(src, dest) |
232 | 240 |
233 Move = ActionFactory(move_func, | 241 Move = ActionFactory(move_func, |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
454 '_LIBFLAGS' : '${_concat(LIBLINKPREFIX, LIBS, LIBLINKSUFFIX, __env__)}', | 462 '_LIBFLAGS' : '${_concat(LIBLINKPREFIX, LIBS, LIBLINKSUFFIX, __env__)}', |
455 '_LIBDIRFLAGS' : '$( ${_concat(LIBDIRPREFIX, LIBPATH, LIBDIRSUFFIX, __env__
, RDirs, TARGET, SOURCE)} $)', | 463 '_LIBDIRFLAGS' : '$( ${_concat(LIBDIRPREFIX, LIBPATH, LIBDIRSUFFIX, __env__
, RDirs, TARGET, SOURCE)} $)', |
456 '_CPPINCFLAGS' : '$( ${_concat(INCPREFIX, CPPPATH, INCSUFFIX, __env__, RDir
s, TARGET, SOURCE)} $)', | 464 '_CPPINCFLAGS' : '$( ${_concat(INCPREFIX, CPPPATH, INCSUFFIX, __env__, RDir
s, TARGET, SOURCE)} $)', |
457 '_CPPDEFFLAGS' : '${_defines(CPPDEFPREFIX, CPPDEFINES, CPPDEFSUFFIX, __env_
_)}', | 465 '_CPPDEFFLAGS' : '${_defines(CPPDEFPREFIX, CPPDEFINES, CPPDEFSUFFIX, __env_
_)}', |
458 'TEMPFILE' : NullCmdGenerator, | 466 'TEMPFILE' : NullCmdGenerator, |
459 'Dir' : Variable_Method_Caller('TARGET', 'Dir'), | 467 'Dir' : Variable_Method_Caller('TARGET', 'Dir'), |
460 'Dirs' : Variable_Method_Caller('TARGET', 'Dirs'), | 468 'Dirs' : Variable_Method_Caller('TARGET', 'Dirs'), |
461 'File' : Variable_Method_Caller('TARGET', 'File'), | 469 'File' : Variable_Method_Caller('TARGET', 'File'), |
462 'RDirs' : Variable_Method_Caller('TARGET', 'RDirs'), | 470 'RDirs' : Variable_Method_Caller('TARGET', 'RDirs'), |
463 } | 471 } |
OLD | NEW |