libv8-freebsd 3.3.10.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (703) hide show
  1. data/.gitignore +9 -0
  2. data/.gitmodules +3 -0
  3. data/Gemfile +4 -0
  4. data/README.md +75 -0
  5. data/Rakefile +115 -0
  6. data/ext/libv8/extconf.rb +27 -0
  7. data/lib/libv8.rb +15 -0
  8. data/lib/libv8/Makefile +39 -0
  9. data/lib/libv8/detect_cpu.rb +27 -0
  10. data/lib/libv8/fpic-on-freebsd-amd64.patch +16 -0
  11. data/lib/libv8/fpic-on-linux-amd64.patch +13 -0
  12. data/lib/libv8/scons/CHANGES.txt +5541 -0
  13. data/lib/libv8/scons/LICENSE.txt +20 -0
  14. data/lib/libv8/scons/MANIFEST +200 -0
  15. data/lib/libv8/scons/PKG-INFO +13 -0
  16. data/lib/libv8/scons/README.txt +243 -0
  17. data/lib/libv8/scons/RELEASE.txt +100 -0
  18. data/lib/libv8/scons/engine/SCons/Action.py +1257 -0
  19. data/lib/libv8/scons/engine/SCons/Builder.py +877 -0
  20. data/lib/libv8/scons/engine/SCons/CacheDir.py +216 -0
  21. data/lib/libv8/scons/engine/SCons/Conftest.py +793 -0
  22. data/lib/libv8/scons/engine/SCons/Debug.py +220 -0
  23. data/lib/libv8/scons/engine/SCons/Defaults.py +494 -0
  24. data/lib/libv8/scons/engine/SCons/Environment.py +2417 -0
  25. data/lib/libv8/scons/engine/SCons/Errors.py +205 -0
  26. data/lib/libv8/scons/engine/SCons/Executor.py +633 -0
  27. data/lib/libv8/scons/engine/SCons/Job.py +435 -0
  28. data/lib/libv8/scons/engine/SCons/Memoize.py +244 -0
  29. data/lib/libv8/scons/engine/SCons/Node/Alias.py +152 -0
  30. data/lib/libv8/scons/engine/SCons/Node/FS.py +3302 -0
  31. data/lib/libv8/scons/engine/SCons/Node/Python.py +128 -0
  32. data/lib/libv8/scons/engine/SCons/Node/__init__.py +1329 -0
  33. data/lib/libv8/scons/engine/SCons/Options/BoolOption.py +50 -0
  34. data/lib/libv8/scons/engine/SCons/Options/EnumOption.py +50 -0
  35. data/lib/libv8/scons/engine/SCons/Options/ListOption.py +50 -0
  36. data/lib/libv8/scons/engine/SCons/Options/PackageOption.py +50 -0
  37. data/lib/libv8/scons/engine/SCons/Options/PathOption.py +76 -0
  38. data/lib/libv8/scons/engine/SCons/Options/__init__.py +67 -0
  39. data/lib/libv8/scons/engine/SCons/PathList.py +231 -0
  40. data/lib/libv8/scons/engine/SCons/Platform/__init__.py +241 -0
  41. data/lib/libv8/scons/engine/SCons/Platform/aix.py +69 -0
  42. data/lib/libv8/scons/engine/SCons/Platform/cygwin.py +55 -0
  43. data/lib/libv8/scons/engine/SCons/Platform/darwin.py +70 -0
  44. data/lib/libv8/scons/engine/SCons/Platform/hpux.py +46 -0
  45. data/lib/libv8/scons/engine/SCons/Platform/irix.py +44 -0
  46. data/lib/libv8/scons/engine/SCons/Platform/os2.py +58 -0
  47. data/lib/libv8/scons/engine/SCons/Platform/posix.py +263 -0
  48. data/lib/libv8/scons/engine/SCons/Platform/sunos.py +50 -0
  49. data/lib/libv8/scons/engine/SCons/Platform/win32.py +385 -0
  50. data/lib/libv8/scons/engine/SCons/SConf.py +1030 -0
  51. data/lib/libv8/scons/engine/SCons/SConsign.py +389 -0
  52. data/lib/libv8/scons/engine/SCons/Scanner/C.py +132 -0
  53. data/lib/libv8/scons/engine/SCons/Scanner/D.py +73 -0
  54. data/lib/libv8/scons/engine/SCons/Scanner/Dir.py +109 -0
  55. data/lib/libv8/scons/engine/SCons/Scanner/Fortran.py +316 -0
  56. data/lib/libv8/scons/engine/SCons/Scanner/IDL.py +48 -0
  57. data/lib/libv8/scons/engine/SCons/Scanner/LaTeX.py +387 -0
  58. data/lib/libv8/scons/engine/SCons/Scanner/Prog.py +101 -0
  59. data/lib/libv8/scons/engine/SCons/Scanner/RC.py +55 -0
  60. data/lib/libv8/scons/engine/SCons/Scanner/__init__.py +413 -0
  61. data/lib/libv8/scons/engine/SCons/Script/Interactive.py +384 -0
  62. data/lib/libv8/scons/engine/SCons/Script/Main.py +1405 -0
  63. data/lib/libv8/scons/engine/SCons/Script/SConsOptions.py +939 -0
  64. data/lib/libv8/scons/engine/SCons/Script/SConscript.py +640 -0
  65. data/lib/libv8/scons/engine/SCons/Script/__init__.py +412 -0
  66. data/lib/libv8/scons/engine/SCons/Sig.py +63 -0
  67. data/lib/libv8/scons/engine/SCons/Subst.py +904 -0
  68. data/lib/libv8/scons/engine/SCons/Taskmaster.py +1025 -0
  69. data/lib/libv8/scons/engine/SCons/Tool/386asm.py +61 -0
  70. data/lib/libv8/scons/engine/SCons/Tool/BitKeeper.py +67 -0
  71. data/lib/libv8/scons/engine/SCons/Tool/CVS.py +73 -0
  72. data/lib/libv8/scons/engine/SCons/Tool/FortranCommon.py +263 -0
  73. data/lib/libv8/scons/engine/SCons/Tool/JavaCommon.py +323 -0
  74. data/lib/libv8/scons/engine/SCons/Tool/MSCommon/__init__.py +56 -0
  75. data/lib/libv8/scons/engine/SCons/Tool/MSCommon/arch.py +61 -0
  76. data/lib/libv8/scons/engine/SCons/Tool/MSCommon/common.py +240 -0
  77. data/lib/libv8/scons/engine/SCons/Tool/MSCommon/netframework.py +82 -0
  78. data/lib/libv8/scons/engine/SCons/Tool/MSCommon/sdk.py +391 -0
  79. data/lib/libv8/scons/engine/SCons/Tool/MSCommon/vc.py +459 -0
  80. data/lib/libv8/scons/engine/SCons/Tool/MSCommon/vs.py +526 -0
  81. data/lib/libv8/scons/engine/SCons/Tool/Perforce.py +103 -0
  82. data/lib/libv8/scons/engine/SCons/Tool/PharLapCommon.py +137 -0
  83. data/lib/libv8/scons/engine/SCons/Tool/RCS.py +64 -0
  84. data/lib/libv8/scons/engine/SCons/Tool/SCCS.py +64 -0
  85. data/lib/libv8/scons/engine/SCons/Tool/Subversion.py +71 -0
  86. data/lib/libv8/scons/engine/SCons/Tool/__init__.py +681 -0
  87. data/lib/libv8/scons/engine/SCons/Tool/aixc++.py +82 -0
  88. data/lib/libv8/scons/engine/SCons/Tool/aixcc.py +74 -0
  89. data/lib/libv8/scons/engine/SCons/Tool/aixf77.py +80 -0
  90. data/lib/libv8/scons/engine/SCons/Tool/aixlink.py +76 -0
  91. data/lib/libv8/scons/engine/SCons/Tool/applelink.py +71 -0
  92. data/lib/libv8/scons/engine/SCons/Tool/ar.py +63 -0
  93. data/lib/libv8/scons/engine/SCons/Tool/as.py +78 -0
  94. data/lib/libv8/scons/engine/SCons/Tool/bcc32.py +81 -0
  95. data/lib/libv8/scons/engine/SCons/Tool/c++.py +99 -0
  96. data/lib/libv8/scons/engine/SCons/Tool/cc.py +102 -0
  97. data/lib/libv8/scons/engine/SCons/Tool/cvf.py +58 -0
  98. data/lib/libv8/scons/engine/SCons/Tool/default.py +50 -0
  99. data/lib/libv8/scons/engine/SCons/Tool/dmd.py +240 -0
  100. data/lib/libv8/scons/engine/SCons/Tool/dvi.py +64 -0
  101. data/lib/libv8/scons/engine/SCons/Tool/dvipdf.py +125 -0
  102. data/lib/libv8/scons/engine/SCons/Tool/dvips.py +95 -0
  103. data/lib/libv8/scons/engine/SCons/Tool/f03.py +63 -0
  104. data/lib/libv8/scons/engine/SCons/Tool/f77.py +62 -0
  105. data/lib/libv8/scons/engine/SCons/Tool/f90.py +62 -0
  106. data/lib/libv8/scons/engine/SCons/Tool/f95.py +63 -0
  107. data/lib/libv8/scons/engine/SCons/Tool/filesystem.py +98 -0
  108. data/lib/libv8/scons/engine/SCons/Tool/fortran.py +62 -0
  109. data/lib/libv8/scons/engine/SCons/Tool/g++.py +90 -0
  110. data/lib/libv8/scons/engine/SCons/Tool/g77.py +73 -0
  111. data/lib/libv8/scons/engine/SCons/Tool/gas.py +53 -0
  112. data/lib/libv8/scons/engine/SCons/Tool/gcc.py +80 -0
  113. data/lib/libv8/scons/engine/SCons/Tool/gfortran.py +64 -0
  114. data/lib/libv8/scons/engine/SCons/Tool/gnulink.py +62 -0
  115. data/lib/libv8/scons/engine/SCons/Tool/gs.py +81 -0
  116. data/lib/libv8/scons/engine/SCons/Tool/hpc++.py +84 -0
  117. data/lib/libv8/scons/engine/SCons/Tool/hpcc.py +53 -0
  118. data/lib/libv8/scons/engine/SCons/Tool/hplink.py +77 -0
  119. data/lib/libv8/scons/engine/SCons/Tool/icc.py +59 -0
  120. data/lib/libv8/scons/engine/SCons/Tool/icl.py +52 -0
  121. data/lib/libv8/scons/engine/SCons/Tool/ifl.py +72 -0
  122. data/lib/libv8/scons/engine/SCons/Tool/ifort.py +88 -0
  123. data/lib/libv8/scons/engine/SCons/Tool/ilink.py +59 -0
  124. data/lib/libv8/scons/engine/SCons/Tool/ilink32.py +60 -0
  125. data/lib/libv8/scons/engine/SCons/Tool/install.py +283 -0
  126. data/lib/libv8/scons/engine/SCons/Tool/intelc.py +522 -0
  127. data/lib/libv8/scons/engine/SCons/Tool/ipkg.py +67 -0
  128. data/lib/libv8/scons/engine/SCons/Tool/jar.py +116 -0
  129. data/lib/libv8/scons/engine/SCons/Tool/javac.py +230 -0
  130. data/lib/libv8/scons/engine/SCons/Tool/javah.py +137 -0
  131. data/lib/libv8/scons/engine/SCons/Tool/latex.py +80 -0
  132. data/lib/libv8/scons/engine/SCons/Tool/lex.py +97 -0
  133. data/lib/libv8/scons/engine/SCons/Tool/link.py +122 -0
  134. data/lib/libv8/scons/engine/SCons/Tool/linkloc.py +112 -0
  135. data/lib/libv8/scons/engine/SCons/Tool/m4.py +63 -0
  136. data/lib/libv8/scons/engine/SCons/Tool/masm.py +77 -0
  137. data/lib/libv8/scons/engine/SCons/Tool/midl.py +88 -0
  138. data/lib/libv8/scons/engine/SCons/Tool/mingw.py +179 -0
  139. data/lib/libv8/scons/engine/SCons/Tool/mslib.py +64 -0
  140. data/lib/libv8/scons/engine/SCons/Tool/mslink.py +318 -0
  141. data/lib/libv8/scons/engine/SCons/Tool/mssdk.py +50 -0
  142. data/lib/libv8/scons/engine/SCons/Tool/msvc.py +278 -0
  143. data/lib/libv8/scons/engine/SCons/Tool/msvs.py +1806 -0
  144. data/lib/libv8/scons/engine/SCons/Tool/mwcc.py +207 -0
  145. data/lib/libv8/scons/engine/SCons/Tool/mwld.py +107 -0
  146. data/lib/libv8/scons/engine/SCons/Tool/nasm.py +72 -0
  147. data/lib/libv8/scons/engine/SCons/Tool/packaging/__init__.py +312 -0
  148. data/lib/libv8/scons/engine/SCons/Tool/packaging/ipk.py +185 -0
  149. data/lib/libv8/scons/engine/SCons/Tool/packaging/msi.py +527 -0
  150. data/lib/libv8/scons/engine/SCons/Tool/packaging/rpm.py +365 -0
  151. data/lib/libv8/scons/engine/SCons/Tool/packaging/src_tarbz2.py +43 -0
  152. data/lib/libv8/scons/engine/SCons/Tool/packaging/src_targz.py +43 -0
  153. data/lib/libv8/scons/engine/SCons/Tool/packaging/src_zip.py +43 -0
  154. data/lib/libv8/scons/engine/SCons/Tool/packaging/tarbz2.py +44 -0
  155. data/lib/libv8/scons/engine/SCons/Tool/packaging/targz.py +44 -0
  156. data/lib/libv8/scons/engine/SCons/Tool/packaging/zip.py +44 -0
  157. data/lib/libv8/scons/engine/SCons/Tool/pdf.py +78 -0
  158. data/lib/libv8/scons/engine/SCons/Tool/pdflatex.py +84 -0
  159. data/lib/libv8/scons/engine/SCons/Tool/pdftex.py +109 -0
  160. data/lib/libv8/scons/engine/SCons/Tool/qt.py +336 -0
  161. data/lib/libv8/scons/engine/SCons/Tool/rmic.py +126 -0
  162. data/lib/libv8/scons/engine/SCons/Tool/rpcgen.py +70 -0
  163. data/lib/libv8/scons/engine/SCons/Tool/rpm.py +132 -0
  164. data/lib/libv8/scons/engine/SCons/Tool/sgiar.py +68 -0
  165. data/lib/libv8/scons/engine/SCons/Tool/sgic++.py +58 -0
  166. data/lib/libv8/scons/engine/SCons/Tool/sgicc.py +53 -0
  167. data/lib/libv8/scons/engine/SCons/Tool/sgilink.py +62 -0
  168. data/lib/libv8/scons/engine/SCons/Tool/sunar.py +67 -0
  169. data/lib/libv8/scons/engine/SCons/Tool/sunc++.py +142 -0
  170. data/lib/libv8/scons/engine/SCons/Tool/suncc.py +58 -0
  171. data/lib/libv8/scons/engine/SCons/Tool/sunf77.py +63 -0
  172. data/lib/libv8/scons/engine/SCons/Tool/sunf90.py +64 -0
  173. data/lib/libv8/scons/engine/SCons/Tool/sunf95.py +64 -0
  174. data/lib/libv8/scons/engine/SCons/Tool/sunlink.py +76 -0
  175. data/lib/libv8/scons/engine/SCons/Tool/swig.py +183 -0
  176. data/lib/libv8/scons/engine/SCons/Tool/tar.py +73 -0
  177. data/lib/libv8/scons/engine/SCons/Tool/tex.py +866 -0
  178. data/lib/libv8/scons/engine/SCons/Tool/textfile.py +175 -0
  179. data/lib/libv8/scons/engine/SCons/Tool/tlib.py +53 -0
  180. data/lib/libv8/scons/engine/SCons/Tool/wix.py +99 -0
  181. data/lib/libv8/scons/engine/SCons/Tool/yacc.py +140 -0
  182. data/lib/libv8/scons/engine/SCons/Tool/zip.py +99 -0
  183. data/lib/libv8/scons/engine/SCons/Util.py +1492 -0
  184. data/lib/libv8/scons/engine/SCons/Variables/BoolVariable.py +89 -0
  185. data/lib/libv8/scons/engine/SCons/Variables/EnumVariable.py +103 -0
  186. data/lib/libv8/scons/engine/SCons/Variables/ListVariable.py +135 -0
  187. data/lib/libv8/scons/engine/SCons/Variables/PackageVariable.py +106 -0
  188. data/lib/libv8/scons/engine/SCons/Variables/PathVariable.py +147 -0
  189. data/lib/libv8/scons/engine/SCons/Variables/__init__.py +312 -0
  190. data/lib/libv8/scons/engine/SCons/Warnings.py +246 -0
  191. data/lib/libv8/scons/engine/SCons/__init__.py +49 -0
  192. data/lib/libv8/scons/engine/SCons/compat/__init__.py +237 -0
  193. data/lib/libv8/scons/engine/SCons/compat/_scons_builtins.py +150 -0
  194. data/lib/libv8/scons/engine/SCons/compat/_scons_collections.py +45 -0
  195. data/lib/libv8/scons/engine/SCons/compat/_scons_dbm.py +45 -0
  196. data/lib/libv8/scons/engine/SCons/compat/_scons_hashlib.py +76 -0
  197. data/lib/libv8/scons/engine/SCons/compat/_scons_io.py +45 -0
  198. data/lib/libv8/scons/engine/SCons/compat/_scons_sets.py +563 -0
  199. data/lib/libv8/scons/engine/SCons/compat/_scons_subprocess.py +1281 -0
  200. data/lib/libv8/scons/engine/SCons/cpp.py +589 -0
  201. data/lib/libv8/scons/engine/SCons/dblite.py +254 -0
  202. data/lib/libv8/scons/engine/SCons/exitfuncs.py +77 -0
  203. data/lib/libv8/scons/os_spawnv_fix.diff +83 -0
  204. data/lib/libv8/scons/scons-time.1 +1017 -0
  205. data/lib/libv8/scons/scons.1 +15225 -0
  206. data/lib/libv8/scons/sconsign.1 +208 -0
  207. data/lib/libv8/scons/script/scons +196 -0
  208. data/lib/libv8/scons/script/scons-time +1544 -0
  209. data/lib/libv8/scons/script/scons.bat +34 -0
  210. data/lib/libv8/scons/script/sconsign +514 -0
  211. data/lib/libv8/scons/setup.cfg +5 -0
  212. data/lib/libv8/scons/setup.py +423 -0
  213. data/lib/libv8/v8/.gitignore +35 -0
  214. data/lib/libv8/v8/AUTHORS +44 -0
  215. data/lib/libv8/v8/ChangeLog +2839 -0
  216. data/lib/libv8/v8/LICENSE +52 -0
  217. data/lib/libv8/v8/LICENSE.strongtalk +29 -0
  218. data/lib/libv8/v8/LICENSE.v8 +26 -0
  219. data/lib/libv8/v8/LICENSE.valgrind +45 -0
  220. data/lib/libv8/v8/SConstruct +1478 -0
  221. data/lib/libv8/v8/build/README.txt +49 -0
  222. data/lib/libv8/v8/build/all.gyp +18 -0
  223. data/lib/libv8/v8/build/armu.gypi +32 -0
  224. data/lib/libv8/v8/build/common.gypi +144 -0
  225. data/lib/libv8/v8/build/gyp_v8 +145 -0
  226. data/lib/libv8/v8/include/v8-debug.h +395 -0
  227. data/lib/libv8/v8/include/v8-preparser.h +117 -0
  228. data/lib/libv8/v8/include/v8-profiler.h +505 -0
  229. data/lib/libv8/v8/include/v8-testing.h +104 -0
  230. data/lib/libv8/v8/include/v8.h +4124 -0
  231. data/lib/libv8/v8/include/v8stdint.h +53 -0
  232. data/lib/libv8/v8/preparser/SConscript +38 -0
  233. data/lib/libv8/v8/preparser/preparser-process.cc +379 -0
  234. data/lib/libv8/v8/src/SConscript +368 -0
  235. data/lib/libv8/v8/src/accessors.cc +767 -0
  236. data/lib/libv8/v8/src/accessors.h +123 -0
  237. data/lib/libv8/v8/src/allocation-inl.h +49 -0
  238. data/lib/libv8/v8/src/allocation.cc +122 -0
  239. data/lib/libv8/v8/src/allocation.h +143 -0
  240. data/lib/libv8/v8/src/api.cc +5845 -0
  241. data/lib/libv8/v8/src/api.h +574 -0
  242. data/lib/libv8/v8/src/apinatives.js +110 -0
  243. data/lib/libv8/v8/src/apiutils.h +73 -0
  244. data/lib/libv8/v8/src/arguments.h +118 -0
  245. data/lib/libv8/v8/src/arm/assembler-arm-inl.h +353 -0
  246. data/lib/libv8/v8/src/arm/assembler-arm.cc +2661 -0
  247. data/lib/libv8/v8/src/arm/assembler-arm.h +1375 -0
  248. data/lib/libv8/v8/src/arm/builtins-arm.cc +1658 -0
  249. data/lib/libv8/v8/src/arm/code-stubs-arm.cc +6398 -0
  250. data/lib/libv8/v8/src/arm/code-stubs-arm.h +673 -0
  251. data/lib/libv8/v8/src/arm/codegen-arm.cc +52 -0
  252. data/lib/libv8/v8/src/arm/codegen-arm.h +91 -0
  253. data/lib/libv8/v8/src/arm/constants-arm.cc +152 -0
  254. data/lib/libv8/v8/src/arm/constants-arm.h +775 -0
  255. data/lib/libv8/v8/src/arm/cpu-arm.cc +120 -0
  256. data/lib/libv8/v8/src/arm/debug-arm.cc +317 -0
  257. data/lib/libv8/v8/src/arm/deoptimizer-arm.cc +754 -0
  258. data/lib/libv8/v8/src/arm/disasm-arm.cc +1506 -0
  259. data/lib/libv8/v8/src/arm/frames-arm.cc +45 -0
  260. data/lib/libv8/v8/src/arm/frames-arm.h +168 -0
  261. data/lib/libv8/v8/src/arm/full-codegen-arm.cc +4375 -0
  262. data/lib/libv8/v8/src/arm/ic-arm.cc +1562 -0
  263. data/lib/libv8/v8/src/arm/lithium-arm.cc +2206 -0
  264. data/lib/libv8/v8/src/arm/lithium-arm.h +2348 -0
  265. data/lib/libv8/v8/src/arm/lithium-codegen-arm.cc +4526 -0
  266. data/lib/libv8/v8/src/arm/lithium-codegen-arm.h +403 -0
  267. data/lib/libv8/v8/src/arm/lithium-gap-resolver-arm.cc +305 -0
  268. data/lib/libv8/v8/src/arm/lithium-gap-resolver-arm.h +84 -0
  269. data/lib/libv8/v8/src/arm/macro-assembler-arm.cc +3163 -0
  270. data/lib/libv8/v8/src/arm/macro-assembler-arm.h +1126 -0
  271. data/lib/libv8/v8/src/arm/regexp-macro-assembler-arm.cc +1287 -0
  272. data/lib/libv8/v8/src/arm/regexp-macro-assembler-arm.h +253 -0
  273. data/lib/libv8/v8/src/arm/simulator-arm.cc +3424 -0
  274. data/lib/libv8/v8/src/arm/simulator-arm.h +431 -0
  275. data/lib/libv8/v8/src/arm/stub-cache-arm.cc +4243 -0
  276. data/lib/libv8/v8/src/array.js +1366 -0
  277. data/lib/libv8/v8/src/assembler.cc +1207 -0
  278. data/lib/libv8/v8/src/assembler.h +858 -0
  279. data/lib/libv8/v8/src/ast-inl.h +112 -0
  280. data/lib/libv8/v8/src/ast.cc +1146 -0
  281. data/lib/libv8/v8/src/ast.h +2188 -0
  282. data/lib/libv8/v8/src/atomicops.h +167 -0
  283. data/lib/libv8/v8/src/atomicops_internals_arm_gcc.h +145 -0
  284. data/lib/libv8/v8/src/atomicops_internals_mips_gcc.h +169 -0
  285. data/lib/libv8/v8/src/atomicops_internals_x86_gcc.cc +133 -0
  286. data/lib/libv8/v8/src/atomicops_internals_x86_gcc.h +287 -0
  287. data/lib/libv8/v8/src/atomicops_internals_x86_macosx.h +301 -0
  288. data/lib/libv8/v8/src/atomicops_internals_x86_msvc.h +203 -0
  289. data/lib/libv8/v8/src/bignum-dtoa.cc +655 -0
  290. data/lib/libv8/v8/src/bignum-dtoa.h +81 -0
  291. data/lib/libv8/v8/src/bignum.cc +768 -0
  292. data/lib/libv8/v8/src/bignum.h +140 -0
  293. data/lib/libv8/v8/src/bootstrapper.cc +2184 -0
  294. data/lib/libv8/v8/src/bootstrapper.h +188 -0
  295. data/lib/libv8/v8/src/builtins.cc +1707 -0
  296. data/lib/libv8/v8/src/builtins.h +371 -0
  297. data/lib/libv8/v8/src/bytecodes-irregexp.h +105 -0
  298. data/lib/libv8/v8/src/cached-powers.cc +177 -0
  299. data/lib/libv8/v8/src/cached-powers.h +65 -0
  300. data/lib/libv8/v8/src/char-predicates-inl.h +94 -0
  301. data/lib/libv8/v8/src/char-predicates.h +67 -0
  302. data/lib/libv8/v8/src/checks.cc +110 -0
  303. data/lib/libv8/v8/src/checks.h +296 -0
  304. data/lib/libv8/v8/src/circular-queue-inl.h +53 -0
  305. data/lib/libv8/v8/src/circular-queue.cc +122 -0
  306. data/lib/libv8/v8/src/circular-queue.h +103 -0
  307. data/lib/libv8/v8/src/code-stubs.cc +267 -0
  308. data/lib/libv8/v8/src/code-stubs.h +1011 -0
  309. data/lib/libv8/v8/src/code.h +70 -0
  310. data/lib/libv8/v8/src/codegen.cc +231 -0
  311. data/lib/libv8/v8/src/codegen.h +84 -0
  312. data/lib/libv8/v8/src/compilation-cache.cc +540 -0
  313. data/lib/libv8/v8/src/compilation-cache.h +287 -0
  314. data/lib/libv8/v8/src/compiler.cc +786 -0
  315. data/lib/libv8/v8/src/compiler.h +312 -0
  316. data/lib/libv8/v8/src/contexts.cc +347 -0
  317. data/lib/libv8/v8/src/contexts.h +391 -0
  318. data/lib/libv8/v8/src/conversions-inl.h +106 -0
  319. data/lib/libv8/v8/src/conversions.cc +1131 -0
  320. data/lib/libv8/v8/src/conversions.h +135 -0
  321. data/lib/libv8/v8/src/counters.cc +93 -0
  322. data/lib/libv8/v8/src/counters.h +254 -0
  323. data/lib/libv8/v8/src/cpu-profiler-inl.h +101 -0
  324. data/lib/libv8/v8/src/cpu-profiler.cc +609 -0
  325. data/lib/libv8/v8/src/cpu-profiler.h +302 -0
  326. data/lib/libv8/v8/src/cpu.h +69 -0
  327. data/lib/libv8/v8/src/d8-debug.cc +367 -0
  328. data/lib/libv8/v8/src/d8-debug.h +158 -0
  329. data/lib/libv8/v8/src/d8-posix.cc +695 -0
  330. data/lib/libv8/v8/src/d8-readline.cc +130 -0
  331. data/lib/libv8/v8/src/d8-windows.cc +42 -0
  332. data/lib/libv8/v8/src/d8.cc +803 -0
  333. data/lib/libv8/v8/src/d8.gyp +91 -0
  334. data/lib/libv8/v8/src/d8.h +235 -0
  335. data/lib/libv8/v8/src/d8.js +2798 -0
  336. data/lib/libv8/v8/src/data-flow.cc +66 -0
  337. data/lib/libv8/v8/src/data-flow.h +205 -0
  338. data/lib/libv8/v8/src/date.js +1103 -0
  339. data/lib/libv8/v8/src/dateparser-inl.h +127 -0
  340. data/lib/libv8/v8/src/dateparser.cc +178 -0
  341. data/lib/libv8/v8/src/dateparser.h +266 -0
  342. data/lib/libv8/v8/src/debug-agent.cc +447 -0
  343. data/lib/libv8/v8/src/debug-agent.h +129 -0
  344. data/lib/libv8/v8/src/debug-debugger.js +2569 -0
  345. data/lib/libv8/v8/src/debug.cc +3165 -0
  346. data/lib/libv8/v8/src/debug.h +1057 -0
  347. data/lib/libv8/v8/src/deoptimizer.cc +1256 -0
  348. data/lib/libv8/v8/src/deoptimizer.h +602 -0
  349. data/lib/libv8/v8/src/disasm.h +80 -0
  350. data/lib/libv8/v8/src/disassembler.cc +343 -0
  351. data/lib/libv8/v8/src/disassembler.h +58 -0
  352. data/lib/libv8/v8/src/diy-fp.cc +58 -0
  353. data/lib/libv8/v8/src/diy-fp.h +117 -0
  354. data/lib/libv8/v8/src/double.h +238 -0
  355. data/lib/libv8/v8/src/dtoa.cc +103 -0
  356. data/lib/libv8/v8/src/dtoa.h +85 -0
  357. data/lib/libv8/v8/src/execution.cc +849 -0
  358. data/lib/libv8/v8/src/execution.h +297 -0
  359. data/lib/libv8/v8/src/extensions/experimental/break-iterator.cc +250 -0
  360. data/lib/libv8/v8/src/extensions/experimental/break-iterator.h +89 -0
  361. data/lib/libv8/v8/src/extensions/experimental/collator.cc +218 -0
  362. data/lib/libv8/v8/src/extensions/experimental/collator.h +69 -0
  363. data/lib/libv8/v8/src/extensions/experimental/experimental.gyp +94 -0
  364. data/lib/libv8/v8/src/extensions/experimental/i18n-extension.cc +78 -0
  365. data/lib/libv8/v8/src/extensions/experimental/i18n-extension.h +54 -0
  366. data/lib/libv8/v8/src/extensions/experimental/i18n-locale.cc +112 -0
  367. data/lib/libv8/v8/src/extensions/experimental/i18n-locale.h +60 -0
  368. data/lib/libv8/v8/src/extensions/experimental/i18n-utils.cc +43 -0
  369. data/lib/libv8/v8/src/extensions/experimental/i18n-utils.h +49 -0
  370. data/lib/libv8/v8/src/extensions/experimental/i18n.js +180 -0
  371. data/lib/libv8/v8/src/extensions/experimental/language-matcher.cc +251 -0
  372. data/lib/libv8/v8/src/extensions/experimental/language-matcher.h +95 -0
  373. data/lib/libv8/v8/src/extensions/externalize-string-extension.cc +141 -0
  374. data/lib/libv8/v8/src/extensions/externalize-string-extension.h +50 -0
  375. data/lib/libv8/v8/src/extensions/gc-extension.cc +58 -0
  376. data/lib/libv8/v8/src/extensions/gc-extension.h +49 -0
  377. data/lib/libv8/v8/src/factory.cc +1222 -0
  378. data/lib/libv8/v8/src/factory.h +442 -0
  379. data/lib/libv8/v8/src/fast-dtoa.cc +736 -0
  380. data/lib/libv8/v8/src/fast-dtoa.h +83 -0
  381. data/lib/libv8/v8/src/fixed-dtoa.cc +405 -0
  382. data/lib/libv8/v8/src/fixed-dtoa.h +55 -0
  383. data/lib/libv8/v8/src/flag-definitions.h +560 -0
  384. data/lib/libv8/v8/src/flags.cc +551 -0
  385. data/lib/libv8/v8/src/flags.h +79 -0
  386. data/lib/libv8/v8/src/frames-inl.h +247 -0
  387. data/lib/libv8/v8/src/frames.cc +1243 -0
  388. data/lib/libv8/v8/src/frames.h +870 -0
  389. data/lib/libv8/v8/src/full-codegen.cc +1374 -0
  390. data/lib/libv8/v8/src/full-codegen.h +771 -0
  391. data/lib/libv8/v8/src/func-name-inferrer.cc +92 -0
  392. data/lib/libv8/v8/src/func-name-inferrer.h +111 -0
  393. data/lib/libv8/v8/src/gdb-jit.cc +1555 -0
  394. data/lib/libv8/v8/src/gdb-jit.h +143 -0
  395. data/lib/libv8/v8/src/global-handles.cc +665 -0
  396. data/lib/libv8/v8/src/global-handles.h +284 -0
  397. data/lib/libv8/v8/src/globals.h +325 -0
  398. data/lib/libv8/v8/src/handles-inl.h +177 -0
  399. data/lib/libv8/v8/src/handles.cc +987 -0
  400. data/lib/libv8/v8/src/handles.h +382 -0
  401. data/lib/libv8/v8/src/hashmap.cc +230 -0
  402. data/lib/libv8/v8/src/hashmap.h +123 -0
  403. data/lib/libv8/v8/src/heap-inl.h +704 -0
  404. data/lib/libv8/v8/src/heap-profiler.cc +1173 -0
  405. data/lib/libv8/v8/src/heap-profiler.h +397 -0
  406. data/lib/libv8/v8/src/heap.cc +5930 -0
  407. data/lib/libv8/v8/src/heap.h +2268 -0
  408. data/lib/libv8/v8/src/hydrogen-instructions.cc +1769 -0
  409. data/lib/libv8/v8/src/hydrogen-instructions.h +3971 -0
  410. data/lib/libv8/v8/src/hydrogen.cc +6239 -0
  411. data/lib/libv8/v8/src/hydrogen.h +1202 -0
  412. data/lib/libv8/v8/src/ia32/assembler-ia32-inl.h +446 -0
  413. data/lib/libv8/v8/src/ia32/assembler-ia32.cc +2487 -0
  414. data/lib/libv8/v8/src/ia32/assembler-ia32.h +1144 -0
  415. data/lib/libv8/v8/src/ia32/builtins-ia32.cc +1621 -0
  416. data/lib/libv8/v8/src/ia32/code-stubs-ia32.cc +6198 -0
  417. data/lib/libv8/v8/src/ia32/code-stubs-ia32.h +517 -0
  418. data/lib/libv8/v8/src/ia32/codegen-ia32.cc +265 -0
  419. data/lib/libv8/v8/src/ia32/codegen-ia32.h +79 -0
  420. data/lib/libv8/v8/src/ia32/cpu-ia32.cc +88 -0
  421. data/lib/libv8/v8/src/ia32/debug-ia32.cc +312 -0
  422. data/lib/libv8/v8/src/ia32/deoptimizer-ia32.cc +774 -0
  423. data/lib/libv8/v8/src/ia32/disasm-ia32.cc +1628 -0
  424. data/lib/libv8/v8/src/ia32/frames-ia32.cc +45 -0
  425. data/lib/libv8/v8/src/ia32/frames-ia32.h +142 -0
  426. data/lib/libv8/v8/src/ia32/full-codegen-ia32.cc +4338 -0
  427. data/lib/libv8/v8/src/ia32/ic-ia32.cc +1597 -0
  428. data/lib/libv8/v8/src/ia32/lithium-codegen-ia32.cc +4461 -0
  429. data/lib/libv8/v8/src/ia32/lithium-codegen-ia32.h +375 -0
  430. data/lib/libv8/v8/src/ia32/lithium-gap-resolver-ia32.cc +475 -0
  431. data/lib/libv8/v8/src/ia32/lithium-gap-resolver-ia32.h +110 -0
  432. data/lib/libv8/v8/src/ia32/lithium-ia32.cc +2261 -0
  433. data/lib/libv8/v8/src/ia32/lithium-ia32.h +2396 -0
  434. data/lib/libv8/v8/src/ia32/macro-assembler-ia32.cc +2136 -0
  435. data/lib/libv8/v8/src/ia32/macro-assembler-ia32.h +775 -0
  436. data/lib/libv8/v8/src/ia32/regexp-macro-assembler-ia32.cc +1263 -0
  437. data/lib/libv8/v8/src/ia32/regexp-macro-assembler-ia32.h +216 -0
  438. data/lib/libv8/v8/src/ia32/simulator-ia32.cc +30 -0
  439. data/lib/libv8/v8/src/ia32/simulator-ia32.h +74 -0
  440. data/lib/libv8/v8/src/ia32/stub-cache-ia32.cc +3847 -0
  441. data/lib/libv8/v8/src/ic-inl.h +130 -0
  442. data/lib/libv8/v8/src/ic.cc +2577 -0
  443. data/lib/libv8/v8/src/ic.h +736 -0
  444. data/lib/libv8/v8/src/inspector.cc +63 -0
  445. data/lib/libv8/v8/src/inspector.h +62 -0
  446. data/lib/libv8/v8/src/interpreter-irregexp.cc +659 -0
  447. data/lib/libv8/v8/src/interpreter-irregexp.h +49 -0
  448. data/lib/libv8/v8/src/isolate-inl.h +50 -0
  449. data/lib/libv8/v8/src/isolate.cc +1869 -0
  450. data/lib/libv8/v8/src/isolate.h +1382 -0
  451. data/lib/libv8/v8/src/json-parser.cc +504 -0
  452. data/lib/libv8/v8/src/json-parser.h +161 -0
  453. data/lib/libv8/v8/src/json.js +342 -0
  454. data/lib/libv8/v8/src/jsregexp.cc +5385 -0
  455. data/lib/libv8/v8/src/jsregexp.h +1492 -0
  456. data/lib/libv8/v8/src/list-inl.h +212 -0
  457. data/lib/libv8/v8/src/list.h +174 -0
  458. data/lib/libv8/v8/src/lithium-allocator-inl.h +142 -0
  459. data/lib/libv8/v8/src/lithium-allocator.cc +2123 -0
  460. data/lib/libv8/v8/src/lithium-allocator.h +630 -0
  461. data/lib/libv8/v8/src/lithium.cc +190 -0
  462. data/lib/libv8/v8/src/lithium.h +597 -0
  463. data/lib/libv8/v8/src/liveedit-debugger.js +1082 -0
  464. data/lib/libv8/v8/src/liveedit.cc +1691 -0
  465. data/lib/libv8/v8/src/liveedit.h +180 -0
  466. data/lib/libv8/v8/src/liveobjectlist-inl.h +126 -0
  467. data/lib/libv8/v8/src/liveobjectlist.cc +2589 -0
  468. data/lib/libv8/v8/src/liveobjectlist.h +322 -0
  469. data/lib/libv8/v8/src/log-inl.h +59 -0
  470. data/lib/libv8/v8/src/log-utils.cc +428 -0
  471. data/lib/libv8/v8/src/log-utils.h +231 -0
  472. data/lib/libv8/v8/src/log.cc +1993 -0
  473. data/lib/libv8/v8/src/log.h +476 -0
  474. data/lib/libv8/v8/src/macro-assembler.h +120 -0
  475. data/lib/libv8/v8/src/macros.py +178 -0
  476. data/lib/libv8/v8/src/mark-compact.cc +3143 -0
  477. data/lib/libv8/v8/src/mark-compact.h +506 -0
  478. data/lib/libv8/v8/src/math.js +264 -0
  479. data/lib/libv8/v8/src/messages.cc +179 -0
  480. data/lib/libv8/v8/src/messages.h +113 -0
  481. data/lib/libv8/v8/src/messages.js +1096 -0
  482. data/lib/libv8/v8/src/mips/assembler-mips-inl.h +312 -0
  483. data/lib/libv8/v8/src/mips/assembler-mips.cc +1960 -0
  484. data/lib/libv8/v8/src/mips/assembler-mips.h +1138 -0
  485. data/lib/libv8/v8/src/mips/builtins-mips.cc +1628 -0
  486. data/lib/libv8/v8/src/mips/code-stubs-mips.cc +6656 -0
  487. data/lib/libv8/v8/src/mips/code-stubs-mips.h +682 -0
  488. data/lib/libv8/v8/src/mips/codegen-mips.cc +52 -0
  489. data/lib/libv8/v8/src/mips/codegen-mips.h +98 -0
  490. data/lib/libv8/v8/src/mips/constants-mips.cc +352 -0
  491. data/lib/libv8/v8/src/mips/constants-mips.h +739 -0
  492. data/lib/libv8/v8/src/mips/cpu-mips.cc +96 -0
  493. data/lib/libv8/v8/src/mips/debug-mips.cc +308 -0
  494. data/lib/libv8/v8/src/mips/deoptimizer-mips.cc +91 -0
  495. data/lib/libv8/v8/src/mips/disasm-mips.cc +1050 -0
  496. data/lib/libv8/v8/src/mips/frames-mips.cc +47 -0
  497. data/lib/libv8/v8/src/mips/frames-mips.h +219 -0
  498. data/lib/libv8/v8/src/mips/full-codegen-mips.cc +4388 -0
  499. data/lib/libv8/v8/src/mips/ic-mips.cc +1580 -0
  500. data/lib/libv8/v8/src/mips/lithium-codegen-mips.h +65 -0
  501. data/lib/libv8/v8/src/mips/lithium-mips.h +307 -0
  502. data/lib/libv8/v8/src/mips/macro-assembler-mips.cc +4056 -0
  503. data/lib/libv8/v8/src/mips/macro-assembler-mips.h +1214 -0
  504. data/lib/libv8/v8/src/mips/regexp-macro-assembler-mips.cc +1251 -0
  505. data/lib/libv8/v8/src/mips/regexp-macro-assembler-mips.h +252 -0
  506. data/lib/libv8/v8/src/mips/simulator-mips.cc +2621 -0
  507. data/lib/libv8/v8/src/mips/simulator-mips.h +401 -0
  508. data/lib/libv8/v8/src/mips/stub-cache-mips.cc +4285 -0
  509. data/lib/libv8/v8/src/mirror-debugger.js +2382 -0
  510. data/lib/libv8/v8/src/mksnapshot.cc +328 -0
  511. data/lib/libv8/v8/src/natives.h +64 -0
  512. data/lib/libv8/v8/src/objects-debug.cc +738 -0
  513. data/lib/libv8/v8/src/objects-inl.h +4323 -0
  514. data/lib/libv8/v8/src/objects-printer.cc +829 -0
  515. data/lib/libv8/v8/src/objects-visiting.cc +148 -0
  516. data/lib/libv8/v8/src/objects-visiting.h +424 -0
  517. data/lib/libv8/v8/src/objects.cc +10585 -0
  518. data/lib/libv8/v8/src/objects.h +6838 -0
  519. data/lib/libv8/v8/src/parser.cc +4997 -0
  520. data/lib/libv8/v8/src/parser.h +765 -0
  521. data/lib/libv8/v8/src/platform-cygwin.cc +779 -0
  522. data/lib/libv8/v8/src/platform-freebsd.cc +826 -0
  523. data/lib/libv8/v8/src/platform-linux.cc +1149 -0
  524. data/lib/libv8/v8/src/platform-macos.cc +830 -0
  525. data/lib/libv8/v8/src/platform-nullos.cc +479 -0
  526. data/lib/libv8/v8/src/platform-openbsd.cc +640 -0
  527. data/lib/libv8/v8/src/platform-posix.cc +424 -0
  528. data/lib/libv8/v8/src/platform-solaris.cc +762 -0
  529. data/lib/libv8/v8/src/platform-tls-mac.h +62 -0
  530. data/lib/libv8/v8/src/platform-tls-win32.h +62 -0
  531. data/lib/libv8/v8/src/platform-tls.h +50 -0
  532. data/lib/libv8/v8/src/platform-win32.cc +2021 -0
  533. data/lib/libv8/v8/src/platform.h +667 -0
  534. data/lib/libv8/v8/src/preparse-data-format.h +62 -0
  535. data/lib/libv8/v8/src/preparse-data.cc +183 -0
  536. data/lib/libv8/v8/src/preparse-data.h +225 -0
  537. data/lib/libv8/v8/src/preparser-api.cc +220 -0
  538. data/lib/libv8/v8/src/preparser.cc +1450 -0
  539. data/lib/libv8/v8/src/preparser.h +493 -0
  540. data/lib/libv8/v8/src/prettyprinter.cc +1493 -0
  541. data/lib/libv8/v8/src/prettyprinter.h +223 -0
  542. data/lib/libv8/v8/src/profile-generator-inl.h +128 -0
  543. data/lib/libv8/v8/src/profile-generator.cc +3098 -0
  544. data/lib/libv8/v8/src/profile-generator.h +1126 -0
  545. data/lib/libv8/v8/src/property.cc +105 -0
  546. data/lib/libv8/v8/src/property.h +365 -0
  547. data/lib/libv8/v8/src/proxy.js +83 -0
  548. data/lib/libv8/v8/src/regexp-macro-assembler-irregexp-inl.h +78 -0
  549. data/lib/libv8/v8/src/regexp-macro-assembler-irregexp.cc +471 -0
  550. data/lib/libv8/v8/src/regexp-macro-assembler-irregexp.h +142 -0
  551. data/lib/libv8/v8/src/regexp-macro-assembler-tracer.cc +373 -0
  552. data/lib/libv8/v8/src/regexp-macro-assembler-tracer.h +104 -0
  553. data/lib/libv8/v8/src/regexp-macro-assembler.cc +267 -0
  554. data/lib/libv8/v8/src/regexp-macro-assembler.h +243 -0
  555. data/lib/libv8/v8/src/regexp-stack.cc +111 -0
  556. data/lib/libv8/v8/src/regexp-stack.h +147 -0
  557. data/lib/libv8/v8/src/regexp.js +483 -0
  558. data/lib/libv8/v8/src/rewriter.cc +360 -0
  559. data/lib/libv8/v8/src/rewriter.h +50 -0
  560. data/lib/libv8/v8/src/runtime-profiler.cc +489 -0
  561. data/lib/libv8/v8/src/runtime-profiler.h +201 -0
  562. data/lib/libv8/v8/src/runtime.cc +12227 -0
  563. data/lib/libv8/v8/src/runtime.h +652 -0
  564. data/lib/libv8/v8/src/runtime.js +649 -0
  565. data/lib/libv8/v8/src/safepoint-table.cc +256 -0
  566. data/lib/libv8/v8/src/safepoint-table.h +270 -0
  567. data/lib/libv8/v8/src/scanner-base.cc +952 -0
  568. data/lib/libv8/v8/src/scanner-base.h +670 -0
  569. data/lib/libv8/v8/src/scanner.cc +345 -0
  570. data/lib/libv8/v8/src/scanner.h +146 -0
  571. data/lib/libv8/v8/src/scopeinfo.cc +646 -0
  572. data/lib/libv8/v8/src/scopeinfo.h +254 -0
  573. data/lib/libv8/v8/src/scopes.cc +1150 -0
  574. data/lib/libv8/v8/src/scopes.h +507 -0
  575. data/lib/libv8/v8/src/serialize.cc +1574 -0
  576. data/lib/libv8/v8/src/serialize.h +589 -0
  577. data/lib/libv8/v8/src/shell.h +55 -0
  578. data/lib/libv8/v8/src/simulator.h +43 -0
  579. data/lib/libv8/v8/src/small-pointer-list.h +163 -0
  580. data/lib/libv8/v8/src/smart-pointer.h +109 -0
  581. data/lib/libv8/v8/src/snapshot-common.cc +83 -0
  582. data/lib/libv8/v8/src/snapshot-empty.cc +54 -0
  583. data/lib/libv8/v8/src/snapshot.h +91 -0
  584. data/lib/libv8/v8/src/spaces-inl.h +529 -0
  585. data/lib/libv8/v8/src/spaces.cc +3145 -0
  586. data/lib/libv8/v8/src/spaces.h +2369 -0
  587. data/lib/libv8/v8/src/splay-tree-inl.h +310 -0
  588. data/lib/libv8/v8/src/splay-tree.h +205 -0
  589. data/lib/libv8/v8/src/string-search.cc +41 -0
  590. data/lib/libv8/v8/src/string-search.h +568 -0
  591. data/lib/libv8/v8/src/string-stream.cc +592 -0
  592. data/lib/libv8/v8/src/string-stream.h +191 -0
  593. data/lib/libv8/v8/src/string.js +994 -0
  594. data/lib/libv8/v8/src/strtod.cc +440 -0
  595. data/lib/libv8/v8/src/strtod.h +40 -0
  596. data/lib/libv8/v8/src/stub-cache.cc +1965 -0
  597. data/lib/libv8/v8/src/stub-cache.h +924 -0
  598. data/lib/libv8/v8/src/third_party/valgrind/valgrind.h +3925 -0
  599. data/lib/libv8/v8/src/token.cc +63 -0
  600. data/lib/libv8/v8/src/token.h +288 -0
  601. data/lib/libv8/v8/src/type-info.cc +507 -0
  602. data/lib/libv8/v8/src/type-info.h +272 -0
  603. data/lib/libv8/v8/src/unbound-queue-inl.h +95 -0
  604. data/lib/libv8/v8/src/unbound-queue.h +69 -0
  605. data/lib/libv8/v8/src/unicode-inl.h +238 -0
  606. data/lib/libv8/v8/src/unicode.cc +1624 -0
  607. data/lib/libv8/v8/src/unicode.h +280 -0
  608. data/lib/libv8/v8/src/uri.js +408 -0
  609. data/lib/libv8/v8/src/utils-inl.h +48 -0
  610. data/lib/libv8/v8/src/utils.cc +371 -0
  611. data/lib/libv8/v8/src/utils.h +800 -0
  612. data/lib/libv8/v8/src/v8-counters.cc +62 -0
  613. data/lib/libv8/v8/src/v8-counters.h +314 -0
  614. data/lib/libv8/v8/src/v8.cc +213 -0
  615. data/lib/libv8/v8/src/v8.h +131 -0
  616. data/lib/libv8/v8/src/v8checks.h +64 -0
  617. data/lib/libv8/v8/src/v8dll-main.cc +44 -0
  618. data/lib/libv8/v8/src/v8globals.h +512 -0
  619. data/lib/libv8/v8/src/v8memory.h +82 -0
  620. data/lib/libv8/v8/src/v8natives.js +1310 -0
  621. data/lib/libv8/v8/src/v8preparserdll-main.cc +39 -0
  622. data/lib/libv8/v8/src/v8threads.cc +464 -0
  623. data/lib/libv8/v8/src/v8threads.h +165 -0
  624. data/lib/libv8/v8/src/v8utils.h +319 -0
  625. data/lib/libv8/v8/src/variables.cc +114 -0
  626. data/lib/libv8/v8/src/variables.h +167 -0
  627. data/lib/libv8/v8/src/version.cc +116 -0
  628. data/lib/libv8/v8/src/version.h +68 -0
  629. data/lib/libv8/v8/src/vm-state-inl.h +138 -0
  630. data/lib/libv8/v8/src/vm-state.h +71 -0
  631. data/lib/libv8/v8/src/win32-headers.h +96 -0
  632. data/lib/libv8/v8/src/x64/assembler-x64-inl.h +462 -0
  633. data/lib/libv8/v8/src/x64/assembler-x64.cc +3027 -0
  634. data/lib/libv8/v8/src/x64/assembler-x64.h +1633 -0
  635. data/lib/libv8/v8/src/x64/builtins-x64.cc +1520 -0
  636. data/lib/libv8/v8/src/x64/code-stubs-x64.cc +5132 -0
  637. data/lib/libv8/v8/src/x64/code-stubs-x64.h +514 -0
  638. data/lib/libv8/v8/src/x64/codegen-x64.cc +146 -0
  639. data/lib/libv8/v8/src/x64/codegen-x64.h +76 -0
  640. data/lib/libv8/v8/src/x64/cpu-x64.cc +88 -0
  641. data/lib/libv8/v8/src/x64/debug-x64.cc +319 -0
  642. data/lib/libv8/v8/src/x64/deoptimizer-x64.cc +815 -0
  643. data/lib/libv8/v8/src/x64/disasm-x64.cc +1832 -0
  644. data/lib/libv8/v8/src/x64/frames-x64.cc +45 -0
  645. data/lib/libv8/v8/src/x64/frames-x64.h +130 -0
  646. data/lib/libv8/v8/src/x64/full-codegen-x64.cc +4318 -0
  647. data/lib/libv8/v8/src/x64/ic-x64.cc +1608 -0
  648. data/lib/libv8/v8/src/x64/lithium-codegen-x64.cc +4267 -0
  649. data/lib/libv8/v8/src/x64/lithium-codegen-x64.h +367 -0
  650. data/lib/libv8/v8/src/x64/lithium-gap-resolver-x64.cc +320 -0
  651. data/lib/libv8/v8/src/x64/lithium-gap-resolver-x64.h +74 -0
  652. data/lib/libv8/v8/src/x64/lithium-x64.cc +2202 -0
  653. data/lib/libv8/v8/src/x64/lithium-x64.h +2333 -0
  654. data/lib/libv8/v8/src/x64/macro-assembler-x64.cc +3745 -0
  655. data/lib/libv8/v8/src/x64/macro-assembler-x64.h +1290 -0
  656. data/lib/libv8/v8/src/x64/regexp-macro-assembler-x64.cc +1398 -0
  657. data/lib/libv8/v8/src/x64/regexp-macro-assembler-x64.h +282 -0
  658. data/lib/libv8/v8/src/x64/simulator-x64.cc +27 -0
  659. data/lib/libv8/v8/src/x64/simulator-x64.h +72 -0
  660. data/lib/libv8/v8/src/x64/stub-cache-x64.cc +3610 -0
  661. data/lib/libv8/v8/src/zone-inl.h +140 -0
  662. data/lib/libv8/v8/src/zone.cc +196 -0
  663. data/lib/libv8/v8/src/zone.h +240 -0
  664. data/lib/libv8/v8/tools/codemap.js +265 -0
  665. data/lib/libv8/v8/tools/consarray.js +93 -0
  666. data/lib/libv8/v8/tools/csvparser.js +78 -0
  667. data/lib/libv8/v8/tools/disasm.py +92 -0
  668. data/lib/libv8/v8/tools/freebsd-tick-processor +10 -0
  669. data/lib/libv8/v8/tools/gc-nvp-trace-processor.py +342 -0
  670. data/lib/libv8/v8/tools/gcmole/README +62 -0
  671. data/lib/libv8/v8/tools/gcmole/gccause.lua +60 -0
  672. data/lib/libv8/v8/tools/gcmole/gcmole.cc +1261 -0
  673. data/lib/libv8/v8/tools/gcmole/gcmole.lua +378 -0
  674. data/lib/libv8/v8/tools/generate-ten-powers.scm +286 -0
  675. data/lib/libv8/v8/tools/grokdump.py +841 -0
  676. data/lib/libv8/v8/tools/gyp/v8.gyp +995 -0
  677. data/lib/libv8/v8/tools/js2c.py +364 -0
  678. data/lib/libv8/v8/tools/jsmin.py +280 -0
  679. data/lib/libv8/v8/tools/linux-tick-processor +35 -0
  680. data/lib/libv8/v8/tools/ll_prof.py +942 -0
  681. data/lib/libv8/v8/tools/logreader.js +185 -0
  682. data/lib/libv8/v8/tools/mac-nm +18 -0
  683. data/lib/libv8/v8/tools/mac-tick-processor +6 -0
  684. data/lib/libv8/v8/tools/oom_dump/README +31 -0
  685. data/lib/libv8/v8/tools/oom_dump/SConstruct +42 -0
  686. data/lib/libv8/v8/tools/oom_dump/oom_dump.cc +288 -0
  687. data/lib/libv8/v8/tools/presubmit.py +305 -0
  688. data/lib/libv8/v8/tools/process-heap-prof.py +120 -0
  689. data/lib/libv8/v8/tools/profile.js +751 -0
  690. data/lib/libv8/v8/tools/profile_view.js +219 -0
  691. data/lib/libv8/v8/tools/run-valgrind.py +77 -0
  692. data/lib/libv8/v8/tools/splaytree.js +316 -0
  693. data/lib/libv8/v8/tools/stats-viewer.py +468 -0
  694. data/lib/libv8/v8/tools/test.py +1510 -0
  695. data/lib/libv8/v8/tools/tickprocessor-driver.js +59 -0
  696. data/lib/libv8/v8/tools/tickprocessor.js +877 -0
  697. data/lib/libv8/v8/tools/utils.py +96 -0
  698. data/lib/libv8/v8/tools/visual_studio/README.txt +12 -0
  699. data/lib/libv8/v8/tools/windows-tick-processor.bat +30 -0
  700. data/lib/libv8/version.rb +6 -0
  701. data/libv8.gemspec +36 -0
  702. data/thefrontside.png +0 -0
  703. metadata +776 -0
@@ -0,0 +1,384 @@
1
+ #
2
+ # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 The SCons Foundation
3
+ #
4
+ # Permission is hereby granted, free of charge, to any person obtaining
5
+ # a copy of this software and associated documentation files (the
6
+ # "Software"), to deal in the Software without restriction, including
7
+ # without limitation the rights to use, copy, modify, merge, publish,
8
+ # distribute, sublicense, and/or sell copies of the Software, and to
9
+ # permit persons to whom the Software is furnished to do so, subject to
10
+ # the following conditions:
11
+ #
12
+ # The above copyright notice and this permission notice shall be included
13
+ # in all copies or substantial portions of the Software.
14
+ #
15
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
16
+ # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
17
+ # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18
+ # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
19
+ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
20
+ # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21
+ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
+
23
+ __revision__ = "src/engine/SCons/Script/Interactive.py 5357 2011/09/09 21:31:03 bdeegan"
24
+
25
+ __doc__ = """
26
+ SCons interactive mode
27
+ """
28
+
29
+ # TODO:
30
+ #
31
+ # This has the potential to grow into something with a really big life
32
+ # of its own, which might or might not be a good thing. Nevertheless,
33
+ # here are some enhancements that will probably be requested some day
34
+ # and are worth keeping in mind (assuming this takes off):
35
+ #
36
+ # - A command to re-read / re-load the SConscript files. This may
37
+ # involve allowing people to specify command-line options (e.g. -f,
38
+ # -I, --no-site-dir) that affect how the SConscript files are read.
39
+ #
40
+ # - Additional command-line options on the "build" command.
41
+ #
42
+ # Of the supported options that seemed to make sense (after a quick
43
+ # pass through the list), the ones that seemed likely enough to be
44
+ # used are listed in the man page and have explicit test scripts.
45
+ #
46
+ # These had code changed in Script/Main.py to support them, but didn't
47
+ # seem likely to be used regularly, so had no test scripts added:
48
+ #
49
+ # build --diskcheck=*
50
+ # build --implicit-cache=*
51
+ # build --implicit-deps-changed=*
52
+ # build --implicit-deps-unchanged=*
53
+ #
54
+ # These look like they should "just work" with no changes to the
55
+ # existing code, but like those above, look unlikely to be used and
56
+ # therefore had no test scripts added:
57
+ #
58
+ # build --random
59
+ #
60
+ # These I'm not sure about. They might be useful for individual
61
+ # "build" commands, and may even work, but they seem unlikely enough
62
+ # that we'll wait until they're requested before spending any time on
63
+ # writing test scripts for them, or investigating whether they work.
64
+ #
65
+ # build -q [??? is there a useful analog to the exit status?]
66
+ # build --duplicate=
67
+ # build --profile=
68
+ # build --max-drift=
69
+ # build --warn=*
70
+ # build --Y
71
+ #
72
+ # - Most of the SCons command-line options that the "build" command
73
+ # supports should be settable as default options that apply to all
74
+ # subsequent "build" commands. Maybe a "set {option}" command that
75
+ # maps to "SetOption('{option}')".
76
+ #
77
+ # - Need something in the 'help' command that prints the -h output.
78
+ #
79
+ # - A command to run the configure subsystem separately (must see how
80
+ # this interacts with the new automake model).
81
+ #
82
+ # - Command-line completion of target names; maybe even of SCons options?
83
+ # Completion is something that's supported by the Python cmd module,
84
+ # so this should be doable without too much trouble.
85
+ #
86
+
87
+ import cmd
88
+ import copy
89
+ import os
90
+ import re
91
+ import shlex
92
+ import sys
93
+
94
+ try:
95
+ import readline
96
+ except ImportError:
97
+ pass
98
+
99
+ class SConsInteractiveCmd(cmd.Cmd):
100
+ """\
101
+ build [TARGETS] Build the specified TARGETS and their dependencies.
102
+ 'b' is a synonym.
103
+ clean [TARGETS] Clean (remove) the specified TARGETS and their
104
+ dependencies. 'c' is a synonym.
105
+ exit Exit SCons interactive mode.
106
+ help [COMMAND] Prints help for the specified COMMAND. 'h' and
107
+ '?' are synonyms.
108
+ shell [COMMANDLINE] Execute COMMANDLINE in a subshell. 'sh' and '!'
109
+ are synonyms.
110
+ version Prints SCons version information.
111
+ """
112
+
113
+ synonyms = {
114
+ 'b' : 'build',
115
+ 'c' : 'clean',
116
+ 'h' : 'help',
117
+ 'scons' : 'build',
118
+ 'sh' : 'shell',
119
+ }
120
+
121
+ def __init__(self, **kw):
122
+ cmd.Cmd.__init__(self)
123
+ for key, val in kw.items():
124
+ setattr(self, key, val)
125
+
126
+ if sys.platform == 'win32':
127
+ self.shell_variable = 'COMSPEC'
128
+ else:
129
+ self.shell_variable = 'SHELL'
130
+
131
+ def default(self, argv):
132
+ print "*** Unknown command: %s" % argv[0]
133
+
134
+ def onecmd(self, line):
135
+ line = line.strip()
136
+ if not line:
137
+ print self.lastcmd
138
+ return self.emptyline()
139
+ self.lastcmd = line
140
+ if line[0] == '!':
141
+ line = 'shell ' + line[1:]
142
+ elif line[0] == '?':
143
+ line = 'help ' + line[1:]
144
+ if os.sep == '\\':
145
+ line = line.replace('\\', '\\\\')
146
+ argv = shlex.split(line)
147
+ argv[0] = self.synonyms.get(argv[0], argv[0])
148
+ if not argv[0]:
149
+ return self.default(line)
150
+ else:
151
+ try:
152
+ func = getattr(self, 'do_' + argv[0])
153
+ except AttributeError:
154
+ return self.default(argv)
155
+ return func(argv)
156
+
157
+ def do_build(self, argv):
158
+ """\
159
+ build [TARGETS] Build the specified TARGETS and their
160
+ dependencies. 'b' is a synonym.
161
+ """
162
+ import SCons.Node
163
+ import SCons.SConsign
164
+ import SCons.Script.Main
165
+
166
+ options = copy.deepcopy(self.options)
167
+
168
+ options, targets = self.parser.parse_args(argv[1:], values=options)
169
+
170
+ SCons.Script.COMMAND_LINE_TARGETS = targets
171
+
172
+ if targets:
173
+ SCons.Script.BUILD_TARGETS = targets
174
+ else:
175
+ # If the user didn't specify any targets on the command line,
176
+ # use the list of default targets.
177
+ SCons.Script.BUILD_TARGETS = SCons.Script._build_plus_default
178
+
179
+ nodes = SCons.Script.Main._build_targets(self.fs,
180
+ options,
181
+ targets,
182
+ self.target_top)
183
+
184
+ if not nodes:
185
+ return
186
+
187
+ # Call each of the Node's alter_targets() methods, which may
188
+ # provide additional targets that ended up as part of the build
189
+ # (the canonical example being a VariantDir() when we're building
190
+ # from a source directory) and which we therefore need their
191
+ # state cleared, too.
192
+ x = []
193
+ for n in nodes:
194
+ x.extend(n.alter_targets()[0])
195
+ nodes.extend(x)
196
+
197
+ # Clean up so that we can perform the next build correctly.
198
+ #
199
+ # We do this by walking over all the children of the targets,
200
+ # and clearing their state.
201
+ #
202
+ # We currently have to re-scan each node to find their
203
+ # children, because built nodes have already been partially
204
+ # cleared and don't remember their children. (In scons
205
+ # 0.96.1 and earlier, this wasn't the case, and we didn't
206
+ # have to re-scan the nodes.)
207
+ #
208
+ # Because we have to re-scan each node, we can't clear the
209
+ # nodes as we walk over them, because we may end up rescanning
210
+ # a cleared node as we scan a later node. Therefore, only
211
+ # store the list of nodes that need to be cleared as we walk
212
+ # the tree, and clear them in a separate pass.
213
+ #
214
+ # XXX: Someone more familiar with the inner workings of scons
215
+ # may be able to point out a more efficient way to do this.
216
+
217
+ SCons.Script.Main.progress_display("scons: Clearing cached node information ...")
218
+
219
+ seen_nodes = {}
220
+
221
+ def get_unseen_children(node, parent, seen_nodes=seen_nodes):
222
+ def is_unseen(node, seen_nodes=seen_nodes):
223
+ return node not in seen_nodes
224
+ return list(filter(is_unseen, node.children(scan=1)))
225
+
226
+ def add_to_seen_nodes(node, parent, seen_nodes=seen_nodes):
227
+ seen_nodes[node] = 1
228
+
229
+ # If this file is in a VariantDir and has a
230
+ # corresponding source file in the source tree, remember the
231
+ # node in the source tree, too. This is needed in
232
+ # particular to clear cached implicit dependencies on the
233
+ # source file, since the scanner will scan it if the
234
+ # VariantDir was created with duplicate=0.
235
+ try:
236
+ rfile_method = node.rfile
237
+ except AttributeError:
238
+ return
239
+ else:
240
+ rfile = rfile_method()
241
+ if rfile != node:
242
+ seen_nodes[rfile] = 1
243
+
244
+ for node in nodes:
245
+ walker = SCons.Node.Walker(node,
246
+ kids_func=get_unseen_children,
247
+ eval_func=add_to_seen_nodes)
248
+ n = walker.get_next()
249
+ while n:
250
+ n = walker.get_next()
251
+
252
+ for node in seen_nodes.keys():
253
+ # Call node.clear() to clear most of the state
254
+ node.clear()
255
+ # node.clear() doesn't reset node.state, so call
256
+ # node.set_state() to reset it manually
257
+ node.set_state(SCons.Node.no_state)
258
+ node.implicit = None
259
+
260
+ # Debug: Uncomment to verify that all Taskmaster reference
261
+ # counts have been reset to zero.
262
+ #if node.ref_count != 0:
263
+ # from SCons.Debug import Trace
264
+ # Trace('node %s, ref_count %s !!!\n' % (node, node.ref_count))
265
+
266
+ SCons.SConsign.Reset()
267
+ SCons.Script.Main.progress_display("scons: done clearing node information.")
268
+
269
+ def do_clean(self, argv):
270
+ """\
271
+ clean [TARGETS] Clean (remove) the specified TARGETS
272
+ and their dependencies. 'c' is a synonym.
273
+ """
274
+ return self.do_build(['build', '--clean'] + argv[1:])
275
+
276
+ def do_EOF(self, argv):
277
+ print
278
+ self.do_exit(argv)
279
+
280
+ def _do_one_help(self, arg):
281
+ try:
282
+ # If help_<arg>() exists, then call it.
283
+ func = getattr(self, 'help_' + arg)
284
+ except AttributeError:
285
+ try:
286
+ func = getattr(self, 'do_' + arg)
287
+ except AttributeError:
288
+ doc = None
289
+ else:
290
+ doc = self._doc_to_help(func)
291
+ if doc:
292
+ sys.stdout.write(doc + '\n')
293
+ sys.stdout.flush()
294
+ else:
295
+ doc = self.strip_initial_spaces(func())
296
+ if doc:
297
+ sys.stdout.write(doc + '\n')
298
+ sys.stdout.flush()
299
+
300
+ def _doc_to_help(self, obj):
301
+ doc = obj.__doc__
302
+ if doc is None:
303
+ return ''
304
+ return self._strip_initial_spaces(doc)
305
+
306
+ def _strip_initial_spaces(self, s):
307
+ #lines = s.split('\n')
308
+ lines = s.split('\n')
309
+ spaces = re.match(' *', lines[0]).group(0)
310
+ #def strip_spaces(l):
311
+ # if l.startswith(spaces):
312
+ # l = l[len(spaces):]
313
+ # return l
314
+ #return '\n'.join([ strip_spaces(l) for l in lines ])
315
+ def strip_spaces(l, spaces=spaces):
316
+ if l[:len(spaces)] == spaces:
317
+ l = l[len(spaces):]
318
+ return l
319
+ lines = list(map(strip_spaces, lines))
320
+ return '\n'.join(lines)
321
+
322
+ def do_exit(self, argv):
323
+ """\
324
+ exit Exit SCons interactive mode.
325
+ """
326
+ sys.exit(0)
327
+
328
+ def do_help(self, argv):
329
+ """\
330
+ help [COMMAND] Prints help for the specified COMMAND. 'h'
331
+ and '?' are synonyms.
332
+ """
333
+ if argv[1:]:
334
+ for arg in argv[1:]:
335
+ if self._do_one_help(arg):
336
+ break
337
+ else:
338
+ # If bare 'help' is called, print this class's doc
339
+ # string (if it has one).
340
+ doc = self._doc_to_help(self.__class__)
341
+ if doc:
342
+ sys.stdout.write(doc + '\n')
343
+ sys.stdout.flush()
344
+
345
+ def do_shell(self, argv):
346
+ """\
347
+ shell [COMMANDLINE] Execute COMMANDLINE in a subshell. 'sh' and
348
+ '!' are synonyms.
349
+ """
350
+ import subprocess
351
+ argv = argv[1:]
352
+ if not argv:
353
+ argv = os.environ[self.shell_variable]
354
+ try:
355
+ # Per "[Python-Dev] subprocess insufficiently platform-independent?"
356
+ # http://mail.python.org/pipermail/python-dev/2008-August/081979.html "+
357
+ # Doing the right thing with an argument list currently
358
+ # requires different shell= values on Windows and Linux.
359
+ p = subprocess.Popen(argv, shell=(sys.platform=='win32'))
360
+ except EnvironmentError, e:
361
+ sys.stderr.write('scons: %s: %s\n' % (argv[0], e.strerror))
362
+ else:
363
+ p.wait()
364
+
365
+ def do_version(self, argv):
366
+ """\
367
+ version Prints SCons version information.
368
+ """
369
+ sys.stdout.write(self.parser.version + '\n')
370
+
371
+ def interact(fs, parser, options, targets, target_top):
372
+ c = SConsInteractiveCmd(prompt = 'scons>>> ',
373
+ fs = fs,
374
+ parser = parser,
375
+ options = options,
376
+ targets = targets,
377
+ target_top = target_top)
378
+ c.cmdloop()
379
+
380
+ # Local Variables:
381
+ # tab-width:4
382
+ # indent-tabs-mode:nil
383
+ # End:
384
+ # vim: set expandtab tabstop=4 shiftwidth=4:
@@ -0,0 +1,1405 @@
1
+ """SCons.Script
2
+
3
+ This file implements the main() function used by the scons script.
4
+
5
+ Architecturally, this *is* the scons script, and will likely only be
6
+ called from the external "scons" wrapper. Consequently, anything here
7
+ should not be, or be considered, part of the build engine. If it's
8
+ something that we expect other software to want to use, it should go in
9
+ some other module. If it's specific to the "scons" script invocation,
10
+ it goes here.
11
+ """
12
+
13
+ unsupported_python_version = (2, 3, 0)
14
+ deprecated_python_version = (2, 4, 0)
15
+
16
+ # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 The SCons Foundation
17
+ #
18
+ # Permission is hereby granted, free of charge, to any person obtaining
19
+ # a copy of this software and associated documentation files (the
20
+ # "Software"), to deal in the Software without restriction, including
21
+ # without limitation the rights to use, copy, modify, merge, publish,
22
+ # distribute, sublicense, and/or sell copies of the Software, and to
23
+ # permit persons to whom the Software is furnished to do so, subject to
24
+ # the following conditions:
25
+ #
26
+ # The above copyright notice and this permission notice shall be included
27
+ # in all copies or substantial portions of the Software.
28
+ #
29
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
30
+ # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
31
+ # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
32
+ # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
33
+ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
34
+ # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
35
+ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
36
+
37
+ __revision__ = "src/engine/SCons/Script/Main.py 5357 2011/09/09 21:31:03 bdeegan"
38
+
39
+ import SCons.compat
40
+
41
+ import os
42
+ import sys
43
+ import time
44
+ import traceback
45
+
46
+ # Strip the script directory from sys.path() so on case-insensitive
47
+ # (Windows) systems Python doesn't think that the "scons" script is the
48
+ # "SCons" package. Replace it with our own version directory so, if
49
+ # if they're there, we pick up the right version of the build engine
50
+ # modules.
51
+ #sys.path = [os.path.join(sys.prefix,
52
+ # 'lib',
53
+ # 'scons-%d' % SCons.__version__)] + sys.path[1:]
54
+
55
+ import SCons.CacheDir
56
+ import SCons.Debug
57
+ import SCons.Defaults
58
+ import SCons.Environment
59
+ import SCons.Errors
60
+ import SCons.Job
61
+ import SCons.Node
62
+ import SCons.Node.FS
63
+ import SCons.Platform
64
+ import SCons.SConf
65
+ import SCons.Script
66
+ import SCons.Taskmaster
67
+ import SCons.Util
68
+ import SCons.Warnings
69
+
70
+ import SCons.Script.Interactive
71
+
72
+ def fetch_win32_parallel_msg():
73
+ # A subsidiary function that exists solely to isolate this import
74
+ # so we don't have to pull it in on all platforms, and so that an
75
+ # in-line "import" statement in the _main() function below doesn't
76
+ # cause warnings about local names shadowing use of the 'SCons'
77
+ # globl in nest scopes and UnboundLocalErrors and the like in some
78
+ # versions (2.1) of Python.
79
+ import SCons.Platform.win32
80
+ return SCons.Platform.win32.parallel_msg
81
+
82
+ #
83
+
84
+ class SConsPrintHelpException(Exception):
85
+ pass
86
+
87
+ display = SCons.Util.display
88
+ progress_display = SCons.Util.DisplayEngine()
89
+
90
+ first_command_start = None
91
+ last_command_end = None
92
+
93
+ class Progressor(object):
94
+ prev = ''
95
+ count = 0
96
+ target_string = '$TARGET'
97
+
98
+ def __init__(self, obj, interval=1, file=None, overwrite=False):
99
+ if file is None:
100
+ file = sys.stdout
101
+
102
+ self.obj = obj
103
+ self.file = file
104
+ self.interval = interval
105
+ self.overwrite = overwrite
106
+
107
+ if callable(obj):
108
+ self.func = obj
109
+ elif SCons.Util.is_List(obj):
110
+ self.func = self.spinner
111
+ elif obj.find(self.target_string) != -1:
112
+ self.func = self.replace_string
113
+ else:
114
+ self.func = self.string
115
+
116
+ def write(self, s):
117
+ self.file.write(s)
118
+ self.file.flush()
119
+ self.prev = s
120
+
121
+ def erase_previous(self):
122
+ if self.prev:
123
+ length = len(self.prev)
124
+ if self.prev[-1] in ('\n', '\r'):
125
+ length = length - 1
126
+ self.write(' ' * length + '\r')
127
+ self.prev = ''
128
+
129
+ def spinner(self, node):
130
+ self.write(self.obj[self.count % len(self.obj)])
131
+
132
+ def string(self, node):
133
+ self.write(self.obj)
134
+
135
+ def replace_string(self, node):
136
+ self.write(self.obj.replace(self.target_string, str(node)))
137
+
138
+ def __call__(self, node):
139
+ self.count = self.count + 1
140
+ if (self.count % self.interval) == 0:
141
+ if self.overwrite:
142
+ self.erase_previous()
143
+ self.func(node)
144
+
145
+ ProgressObject = SCons.Util.Null()
146
+
147
+ def Progress(*args, **kw):
148
+ global ProgressObject
149
+ ProgressObject = Progressor(*args, **kw)
150
+
151
+ # Task control.
152
+ #
153
+
154
+ _BuildFailures = []
155
+
156
+ def GetBuildFailures():
157
+ return _BuildFailures
158
+
159
+ class BuildTask(SCons.Taskmaster.OutOfDateTask):
160
+ """An SCons build task."""
161
+ progress = ProgressObject
162
+
163
+ def display(self, message):
164
+ display('scons: ' + message)
165
+
166
+ def prepare(self):
167
+ self.progress(self.targets[0])
168
+ return SCons.Taskmaster.OutOfDateTask.prepare(self)
169
+
170
+ def needs_execute(self):
171
+ if SCons.Taskmaster.OutOfDateTask.needs_execute(self):
172
+ return True
173
+ if self.top and self.targets[0].has_builder():
174
+ display("scons: `%s' is up to date." % str(self.node))
175
+ return False
176
+
177
+ def execute(self):
178
+ if print_time:
179
+ start_time = time.time()
180
+ global first_command_start
181
+ if first_command_start is None:
182
+ first_command_start = start_time
183
+ SCons.Taskmaster.OutOfDateTask.execute(self)
184
+ if print_time:
185
+ global cumulative_command_time
186
+ global last_command_end
187
+ finish_time = time.time()
188
+ last_command_end = finish_time
189
+ cumulative_command_time = cumulative_command_time+finish_time-start_time
190
+ sys.stdout.write("Command execution time: %f seconds\n"%(finish_time-start_time))
191
+
192
+ def do_failed(self, status=2):
193
+ _BuildFailures.append(self.exception[1])
194
+ global exit_status
195
+ global this_build_status
196
+ if self.options.ignore_errors:
197
+ SCons.Taskmaster.OutOfDateTask.executed(self)
198
+ elif self.options.keep_going:
199
+ SCons.Taskmaster.OutOfDateTask.fail_continue(self)
200
+ exit_status = status
201
+ this_build_status = status
202
+ else:
203
+ SCons.Taskmaster.OutOfDateTask.fail_stop(self)
204
+ exit_status = status
205
+ this_build_status = status
206
+
207
+ def executed(self):
208
+ t = self.targets[0]
209
+ if self.top and not t.has_builder() and not t.side_effect:
210
+ if not t.exists():
211
+ if t.__class__.__name__ in ('File', 'Dir', 'Entry'):
212
+ errstr="Do not know how to make %s target `%s' (%s)." % (t.__class__.__name__, t, t.abspath)
213
+ else: # Alias or Python or ...
214
+ errstr="Do not know how to make %s target `%s'." % (t.__class__.__name__, t)
215
+ sys.stderr.write("scons: *** " + errstr)
216
+ if not self.options.keep_going:
217
+ sys.stderr.write(" Stop.")
218
+ sys.stderr.write("\n")
219
+ try:
220
+ raise SCons.Errors.BuildError(t, errstr)
221
+ except KeyboardInterrupt:
222
+ raise
223
+ except:
224
+ self.exception_set()
225
+ self.do_failed()
226
+ else:
227
+ print "scons: Nothing to be done for `%s'." % t
228
+ SCons.Taskmaster.OutOfDateTask.executed(self)
229
+ else:
230
+ SCons.Taskmaster.OutOfDateTask.executed(self)
231
+
232
+ def failed(self):
233
+ # Handle the failure of a build task. The primary purpose here
234
+ # is to display the various types of Errors and Exceptions
235
+ # appropriately.
236
+ exc_info = self.exc_info()
237
+ try:
238
+ t, e, tb = exc_info
239
+ except ValueError:
240
+ t, e = exc_info
241
+ tb = None
242
+
243
+ if t is None:
244
+ # The Taskmaster didn't record an exception for this Task;
245
+ # see if the sys module has one.
246
+ try:
247
+ t, e, tb = sys.exc_info()[:]
248
+ except ValueError:
249
+ t, e = exc_info
250
+ tb = None
251
+
252
+ # Deprecated string exceptions will have their string stored
253
+ # in the first entry of the tuple.
254
+ if e is None:
255
+ e = t
256
+
257
+ buildError = SCons.Errors.convert_to_BuildError(e)
258
+ if not buildError.node:
259
+ buildError.node = self.node
260
+
261
+ node = buildError.node
262
+ if not SCons.Util.is_List(node):
263
+ node = [ node ]
264
+ nodename = ', '.join(map(str, node))
265
+
266
+ errfmt = "scons: *** [%s] %s\n"
267
+ sys.stderr.write(errfmt % (nodename, buildError))
268
+
269
+ if (buildError.exc_info[2] and buildError.exc_info[1] and
270
+ not isinstance(
271
+ buildError.exc_info[1],
272
+ (EnvironmentError, SCons.Errors.StopError,
273
+ SCons.Errors.UserError))):
274
+ type, value, trace = buildError.exc_info
275
+ traceback.print_exception(type, value, trace)
276
+ elif tb and print_stacktrace:
277
+ sys.stderr.write("scons: internal stack trace:\n")
278
+ traceback.print_tb(tb, file=sys.stderr)
279
+
280
+ self.exception = (e, buildError, tb) # type, value, traceback
281
+ self.do_failed(buildError.exitstatus)
282
+
283
+ self.exc_clear()
284
+
285
+ def postprocess(self):
286
+ if self.top:
287
+ t = self.targets[0]
288
+ for tp in self.options.tree_printers:
289
+ tp.display(t)
290
+ if self.options.debug_includes:
291
+ tree = t.render_include_tree()
292
+ if tree:
293
+ print
294
+ print tree
295
+ SCons.Taskmaster.OutOfDateTask.postprocess(self)
296
+
297
+ def make_ready(self):
298
+ """Make a task ready for execution"""
299
+ SCons.Taskmaster.OutOfDateTask.make_ready(self)
300
+ if self.out_of_date and self.options.debug_explain:
301
+ explanation = self.out_of_date[0].explain()
302
+ if explanation:
303
+ sys.stdout.write("scons: " + explanation)
304
+
305
+ class CleanTask(SCons.Taskmaster.AlwaysTask):
306
+ """An SCons clean task."""
307
+ def fs_delete(self, path, pathstr, remove=1):
308
+ try:
309
+ if os.path.lexists(path):
310
+ if os.path.isfile(path) or os.path.islink(path):
311
+ if remove: os.unlink(path)
312
+ display("Removed " + pathstr)
313
+ elif os.path.isdir(path) and not os.path.islink(path):
314
+ # delete everything in the dir
315
+ for e in sorted(os.listdir(path)):
316
+ p = os.path.join(path, e)
317
+ s = os.path.join(pathstr, e)
318
+ if os.path.isfile(p):
319
+ if remove: os.unlink(p)
320
+ display("Removed " + s)
321
+ else:
322
+ self.fs_delete(p, s, remove)
323
+ # then delete dir itself
324
+ if remove: os.rmdir(path)
325
+ display("Removed directory " + pathstr)
326
+ else:
327
+ errstr = "Path '%s' exists but isn't a file or directory."
328
+ raise SCons.Errors.UserError(errstr % (pathstr))
329
+ except SCons.Errors.UserError, e:
330
+ print e
331
+ except (IOError, OSError), e:
332
+ print "scons: Could not remove '%s':" % pathstr, e.strerror
333
+
334
+ def show(self):
335
+ target = self.targets[0]
336
+ if (target.has_builder() or target.side_effect) and not target.noclean:
337
+ for t in self.targets:
338
+ if not t.isdir():
339
+ display("Removed " + str(t))
340
+ if target in SCons.Environment.CleanTargets:
341
+ files = SCons.Environment.CleanTargets[target]
342
+ for f in files:
343
+ self.fs_delete(f.abspath, str(f), 0)
344
+
345
+ def remove(self):
346
+ target = self.targets[0]
347
+ if (target.has_builder() or target.side_effect) and not target.noclean:
348
+ for t in self.targets:
349
+ try:
350
+ removed = t.remove()
351
+ except OSError, e:
352
+ # An OSError may indicate something like a permissions
353
+ # issue, an IOError would indicate something like
354
+ # the file not existing. In either case, print a
355
+ # message and keep going to try to remove as many
356
+ # targets aa possible.
357
+ print "scons: Could not remove '%s':" % str(t), e.strerror
358
+ else:
359
+ if removed:
360
+ display("Removed " + str(t))
361
+ if target in SCons.Environment.CleanTargets:
362
+ files = SCons.Environment.CleanTargets[target]
363
+ for f in files:
364
+ self.fs_delete(f.abspath, str(f))
365
+
366
+ execute = remove
367
+
368
+ # We want the Taskmaster to update the Node states (and therefore
369
+ # handle reference counts, etc.), but we don't want to call
370
+ # back to the Node's post-build methods, which would do things
371
+ # we don't want, like store .sconsign information.
372
+ executed = SCons.Taskmaster.Task.executed_without_callbacks
373
+
374
+ # Have the taskmaster arrange to "execute" all of the targets, because
375
+ # we'll figure out ourselves (in remove() or show() above) whether
376
+ # anything really needs to be done.
377
+ make_ready = SCons.Taskmaster.Task.make_ready_all
378
+
379
+ def prepare(self):
380
+ pass
381
+
382
+ class QuestionTask(SCons.Taskmaster.AlwaysTask):
383
+ """An SCons task for the -q (question) option."""
384
+ def prepare(self):
385
+ pass
386
+
387
+ def execute(self):
388
+ if self.targets[0].get_state() != SCons.Node.up_to_date or \
389
+ (self.top and not self.targets[0].exists()):
390
+ global exit_status
391
+ global this_build_status
392
+ exit_status = 1
393
+ this_build_status = 1
394
+ self.tm.stop()
395
+
396
+ def executed(self):
397
+ pass
398
+
399
+
400
+ class TreePrinter(object):
401
+ def __init__(self, derived=False, prune=False, status=False):
402
+ self.derived = derived
403
+ self.prune = prune
404
+ self.status = status
405
+ def get_all_children(self, node):
406
+ return node.all_children()
407
+ def get_derived_children(self, node):
408
+ children = node.all_children(None)
409
+ return [x for x in children if x.has_builder()]
410
+ def display(self, t):
411
+ if self.derived:
412
+ func = self.get_derived_children
413
+ else:
414
+ func = self.get_all_children
415
+ s = self.status and 2 or 0
416
+ SCons.Util.print_tree(t, func, prune=self.prune, showtags=s)
417
+
418
+
419
+ def python_version_string():
420
+ return sys.version.split()[0]
421
+
422
+ def python_version_unsupported(version=sys.version_info):
423
+ return version < unsupported_python_version
424
+
425
+ def python_version_deprecated(version=sys.version_info):
426
+ return version < deprecated_python_version
427
+
428
+
429
+ # Global variables
430
+
431
+ print_objects = 0
432
+ print_memoizer = 0
433
+ print_stacktrace = 0
434
+ print_time = 0
435
+ sconscript_time = 0
436
+ cumulative_command_time = 0
437
+ exit_status = 0 # final exit status, assume success by default
438
+ this_build_status = 0 # "exit status" of an individual build
439
+ num_jobs = None
440
+ delayed_warnings = []
441
+
442
+ class FakeOptionParser(object):
443
+ """
444
+ A do-nothing option parser, used for the initial OptionsParser variable.
445
+
446
+ During normal SCons operation, the OptionsParser is created right
447
+ away by the main() function. Certain tests scripts however, can
448
+ introspect on different Tool modules, the initialization of which
449
+ can try to add a new, local option to an otherwise uninitialized
450
+ OptionsParser object. This allows that introspection to happen
451
+ without blowing up.
452
+
453
+ """
454
+ class FakeOptionValues(object):
455
+ def __getattr__(self, attr):
456
+ return None
457
+ values = FakeOptionValues()
458
+ def add_local_option(self, *args, **kw):
459
+ pass
460
+
461
+ OptionsParser = FakeOptionParser()
462
+
463
+ def AddOption(*args, **kw):
464
+ if 'default' not in kw:
465
+ kw['default'] = None
466
+ result = OptionsParser.add_local_option(*args, **kw)
467
+ return result
468
+
469
+ def GetOption(name):
470
+ return getattr(OptionsParser.values, name)
471
+
472
+ def SetOption(name, value):
473
+ return OptionsParser.values.set_option(name, value)
474
+
475
+ #
476
+ class Stats(object):
477
+ def __init__(self):
478
+ self.stats = []
479
+ self.labels = []
480
+ self.append = self.do_nothing
481
+ self.print_stats = self.do_nothing
482
+ def enable(self, outfp):
483
+ self.outfp = outfp
484
+ self.append = self.do_append
485
+ self.print_stats = self.do_print
486
+ def do_nothing(self, *args, **kw):
487
+ pass
488
+
489
+ class CountStats(Stats):
490
+ def do_append(self, label):
491
+ self.labels.append(label)
492
+ self.stats.append(SCons.Debug.fetchLoggedInstances())
493
+ def do_print(self):
494
+ stats_table = {}
495
+ for s in self.stats:
496
+ for n in [t[0] for t in s]:
497
+ stats_table[n] = [0, 0, 0, 0]
498
+ i = 0
499
+ for s in self.stats:
500
+ for n, c in s:
501
+ stats_table[n][i] = c
502
+ i = i + 1
503
+ self.outfp.write("Object counts:\n")
504
+ pre = [" "]
505
+ post = [" %s\n"]
506
+ l = len(self.stats)
507
+ fmt1 = ''.join(pre + [' %7s']*l + post)
508
+ fmt2 = ''.join(pre + [' %7d']*l + post)
509
+ labels = self.labels[:l]
510
+ labels.append(("", "Class"))
511
+ self.outfp.write(fmt1 % tuple([x[0] for x in labels]))
512
+ self.outfp.write(fmt1 % tuple([x[1] for x in labels]))
513
+ for k in sorted(stats_table.keys()):
514
+ r = stats_table[k][:l] + [k]
515
+ self.outfp.write(fmt2 % tuple(r))
516
+
517
+ count_stats = CountStats()
518
+
519
+ class MemStats(Stats):
520
+ def do_append(self, label):
521
+ self.labels.append(label)
522
+ self.stats.append(SCons.Debug.memory())
523
+ def do_print(self):
524
+ fmt = 'Memory %-32s %12d\n'
525
+ for label, stats in zip(self.labels, self.stats):
526
+ self.outfp.write(fmt % (label, stats))
527
+
528
+ memory_stats = MemStats()
529
+
530
+ # utility functions
531
+
532
+ def _scons_syntax_error(e):
533
+ """Handle syntax errors. Print out a message and show where the error
534
+ occurred.
535
+ """
536
+ etype, value, tb = sys.exc_info()
537
+ lines = traceback.format_exception_only(etype, value)
538
+ for line in lines:
539
+ sys.stderr.write(line+'\n')
540
+ sys.exit(2)
541
+
542
+ def find_deepest_user_frame(tb):
543
+ """
544
+ Find the deepest stack frame that is not part of SCons.
545
+
546
+ Input is a "pre-processed" stack trace in the form
547
+ returned by traceback.extract_tb() or traceback.extract_stack()
548
+ """
549
+
550
+ tb.reverse()
551
+
552
+ # find the deepest traceback frame that is not part
553
+ # of SCons:
554
+ for frame in tb:
555
+ filename = frame[0]
556
+ if filename.find(os.sep+'SCons'+os.sep) == -1:
557
+ return frame
558
+ return tb[0]
559
+
560
+ def _scons_user_error(e):
561
+ """Handle user errors. Print out a message and a description of the
562
+ error, along with the line number and routine where it occured.
563
+ The file and line number will be the deepest stack frame that is
564
+ not part of SCons itself.
565
+ """
566
+ global print_stacktrace
567
+ etype, value, tb = sys.exc_info()
568
+ if print_stacktrace:
569
+ traceback.print_exception(etype, value, tb)
570
+ filename, lineno, routine, dummy = find_deepest_user_frame(traceback.extract_tb(tb))
571
+ sys.stderr.write("\nscons: *** %s\n" % value)
572
+ sys.stderr.write('File "%s", line %d, in %s\n' % (filename, lineno, routine))
573
+ sys.exit(2)
574
+
575
+ def _scons_user_warning(e):
576
+ """Handle user warnings. Print out a message and a description of
577
+ the warning, along with the line number and routine where it occured.
578
+ The file and line number will be the deepest stack frame that is
579
+ not part of SCons itself.
580
+ """
581
+ etype, value, tb = sys.exc_info()
582
+ filename, lineno, routine, dummy = find_deepest_user_frame(traceback.extract_tb(tb))
583
+ sys.stderr.write("\nscons: warning: %s\n" % e)
584
+ sys.stderr.write('File "%s", line %d, in %s\n' % (filename, lineno, routine))
585
+
586
+ def _scons_internal_warning(e):
587
+ """Slightly different from _scons_user_warning in that we use the
588
+ *current call stack* rather than sys.exc_info() to get our stack trace.
589
+ This is used by the warnings framework to print warnings."""
590
+ filename, lineno, routine, dummy = find_deepest_user_frame(traceback.extract_stack())
591
+ sys.stderr.write("\nscons: warning: %s\n" % e.args[0])
592
+ sys.stderr.write('File "%s", line %d, in %s\n' % (filename, lineno, routine))
593
+
594
+ def _scons_internal_error():
595
+ """Handle all errors but user errors. Print out a message telling
596
+ the user what to do in this case and print a normal trace.
597
+ """
598
+ print 'internal error'
599
+ traceback.print_exc()
600
+ sys.exit(2)
601
+
602
+ def _SConstruct_exists(dirname='', repositories=[], filelist=None):
603
+ """This function checks that an SConstruct file exists in a directory.
604
+ If so, it returns the path of the file. By default, it checks the
605
+ current directory.
606
+ """
607
+ if not filelist:
608
+ filelist = ['SConstruct', 'Sconstruct', 'sconstruct']
609
+ for file in filelist:
610
+ sfile = os.path.join(dirname, file)
611
+ if os.path.isfile(sfile):
612
+ return sfile
613
+ if not os.path.isabs(sfile):
614
+ for rep in repositories:
615
+ if os.path.isfile(os.path.join(rep, sfile)):
616
+ return sfile
617
+ return None
618
+
619
+ def _set_debug_values(options):
620
+ global print_memoizer, print_objects, print_stacktrace, print_time
621
+
622
+ debug_values = options.debug
623
+
624
+ if "count" in debug_values:
625
+ # All of the object counts are within "if __debug__:" blocks,
626
+ # which get stripped when running optimized (with python -O or
627
+ # from compiled *.pyo files). Provide a warning if __debug__ is
628
+ # stripped, so it doesn't just look like --debug=count is broken.
629
+ enable_count = False
630
+ if __debug__: enable_count = True
631
+ if enable_count:
632
+ count_stats.enable(sys.stdout)
633
+ else:
634
+ msg = "--debug=count is not supported when running SCons\n" + \
635
+ "\twith the python -O option or optimized (.pyo) modules."
636
+ SCons.Warnings.warn(SCons.Warnings.NoObjectCountWarning, msg)
637
+ if "dtree" in debug_values:
638
+ options.tree_printers.append(TreePrinter(derived=True))
639
+ options.debug_explain = ("explain" in debug_values)
640
+ if "findlibs" in debug_values:
641
+ SCons.Scanner.Prog.print_find_libs = "findlibs"
642
+ options.debug_includes = ("includes" in debug_values)
643
+ print_memoizer = ("memoizer" in debug_values)
644
+ if "memory" in debug_values:
645
+ memory_stats.enable(sys.stdout)
646
+ print_objects = ("objects" in debug_values)
647
+ if "presub" in debug_values:
648
+ SCons.Action.print_actions_presub = 1
649
+ if "stacktrace" in debug_values:
650
+ print_stacktrace = 1
651
+ if "stree" in debug_values:
652
+ options.tree_printers.append(TreePrinter(status=True))
653
+ if "time" in debug_values:
654
+ print_time = 1
655
+ if "tree" in debug_values:
656
+ options.tree_printers.append(TreePrinter())
657
+ if "prepare" in debug_values:
658
+ SCons.Taskmaster.print_prepare = 1
659
+ if "duplicate" in debug_values:
660
+ SCons.Node.FS.print_duplicate = 1
661
+
662
+ def _create_path(plist):
663
+ path = '.'
664
+ for d in plist:
665
+ if os.path.isabs(d):
666
+ path = d
667
+ else:
668
+ path = path + '/' + d
669
+ return path
670
+
671
+ def _load_site_scons_dir(topdir, site_dir_name=None):
672
+ """Load the site_scons dir under topdir.
673
+ Prepends site_scons to sys.path, imports site_scons/site_init.py,
674
+ and prepends site_scons/site_tools to default toolpath."""
675
+ if site_dir_name:
676
+ err_if_not_found = True # user specified: err if missing
677
+ else:
678
+ site_dir_name = "site_scons"
679
+ err_if_not_found = False
680
+
681
+ site_dir = os.path.join(topdir, site_dir_name)
682
+ if not os.path.exists(site_dir):
683
+ if err_if_not_found:
684
+ raise SCons.Errors.UserError("site dir %s not found."%site_dir)
685
+ return
686
+
687
+ site_init_filename = "site_init.py"
688
+ site_init_modname = "site_init"
689
+ site_tools_dirname = "site_tools"
690
+ # prepend to sys.path
691
+ sys.path = [os.path.abspath(site_dir)] + sys.path
692
+ site_init_file = os.path.join(site_dir, site_init_filename)
693
+ site_tools_dir = os.path.join(site_dir, site_tools_dirname)
694
+ if os.path.exists(site_init_file):
695
+ import imp, re
696
+ # TODO(2.4): turn this into try:-except:-finally:
697
+ try:
698
+ try:
699
+ fp, pathname, description = imp.find_module(site_init_modname,
700
+ [site_dir])
701
+ # Load the file into SCons.Script namespace. This is
702
+ # opaque and clever; m is the module object for the
703
+ # SCons.Script module, and the exec ... in call executes a
704
+ # file (or string containing code) in the context of the
705
+ # module's dictionary, so anything that code defines ends
706
+ # up adding to that module. This is really short, but all
707
+ # the error checking makes it longer.
708
+ try:
709
+ m = sys.modules['SCons.Script']
710
+ except Exception, e:
711
+ fmt = 'cannot import site_init.py: missing SCons.Script module %s'
712
+ raise SCons.Errors.InternalError(fmt % repr(e))
713
+ try:
714
+ sfx = description[0]
715
+ modname = os.path.basename(pathname)[:-len(sfx)]
716
+ site_m = {"__file__": pathname, "__name__": modname, "__doc__": None}
717
+ re_special = re.compile("__[^_]+__")
718
+ for k in m.__dict__.keys():
719
+ if not re_special.match(k):
720
+ site_m[k] = m.__dict__[k]
721
+
722
+ # This is the magic.
723
+ exec fp in site_m
724
+ except KeyboardInterrupt:
725
+ raise
726
+ except Exception, e:
727
+ fmt = '*** Error loading site_init file %s:\n'
728
+ sys.stderr.write(fmt % repr(site_init_file))
729
+ raise
730
+ else:
731
+ for k in site_m:
732
+ if not re_special.match(k):
733
+ m.__dict__[k] = site_m[k]
734
+ except KeyboardInterrupt:
735
+ raise
736
+ except ImportError, e:
737
+ fmt = '*** cannot import site init file %s:\n'
738
+ sys.stderr.write(fmt % repr(site_init_file))
739
+ raise
740
+ finally:
741
+ if fp:
742
+ fp.close()
743
+ if os.path.exists(site_tools_dir):
744
+ # prepend to DefaultToolpath
745
+ SCons.Tool.DefaultToolpath.insert(0, os.path.abspath(site_tools_dir))
746
+
747
+ def _load_all_site_scons_dirs(topdir, verbose=None):
748
+ """Load all of the predefined site_scons dir.
749
+ Order is significant; we load them in order from most generic
750
+ (machine-wide) to most specific (topdir).
751
+ The verbose argument is only for testing.
752
+ """
753
+ platform = SCons.Platform.platform_default()
754
+
755
+ def homedir(d):
756
+ return os.path.expanduser('~/'+d)
757
+
758
+ if platform == 'win32' or platform == 'cygwin':
759
+ # Note we use $ here instead of %...% because older
760
+ # pythons (prior to 2.6?) didn't expand %...% on Windows.
761
+ # This set of dirs should work on XP, Vista, 7 and later.
762
+ sysdirs=[
763
+ os.path.expandvars('$ALLUSERSPROFILE\\Application Data\\scons'),
764
+ os.path.expandvars('$USERPROFILE\\Local Settings\\Application Data\\scons')]
765
+ appdatadir = os.path.expandvars('$APPDATA\\scons')
766
+ if appdatadir not in sysdirs:
767
+ sysdirs.append(appdatadir)
768
+ sysdirs.append(homedir('.scons'))
769
+
770
+ elif platform == 'darwin': # MacOS X
771
+ sysdirs=['/Library/Application Support/SCons',
772
+ '/opt/local/share/scons', # (for MacPorts)
773
+ '/sw/share/scons', # (for Fink)
774
+ homedir('Library/Application Support/SCons'),
775
+ homedir('.scons')]
776
+ elif platform == 'sunos': # Solaris
777
+ sysdirs=['/opt/sfw/scons',
778
+ '/usr/share/scons',
779
+ homedir('.scons')]
780
+ else: # Linux, HPUX, etc.
781
+ # assume posix-like, i.e. platform == 'posix'
782
+ sysdirs=['/usr/share/scons',
783
+ homedir('.scons')]
784
+
785
+ dirs=sysdirs + [topdir]
786
+ for d in dirs:
787
+ if verbose: # this is used by unit tests.
788
+ print "Loading site dir ", d
789
+ _load_site_scons_dir(d)
790
+
791
+ def test_load_all_site_scons_dirs(d):
792
+ _load_all_site_scons_dirs(d, True)
793
+
794
+ def version_string(label, module):
795
+ version = module.__version__
796
+ build = module.__build__
797
+ if build:
798
+ if build[0] != '.':
799
+ build = '.' + build
800
+ version = version + build
801
+ fmt = "\t%s: v%s, %s, by %s on %s\n"
802
+ return fmt % (label,
803
+ version,
804
+ module.__date__,
805
+ module.__developer__,
806
+ module.__buildsys__)
807
+
808
+ def path_string(label, module):
809
+ path = module.__path__
810
+ return "\t%s path: %s\n"%(label,path)
811
+
812
+ def _main(parser):
813
+ global exit_status
814
+ global this_build_status
815
+
816
+ options = parser.values
817
+
818
+ # Here's where everything really happens.
819
+
820
+ # First order of business: set up default warnings and then
821
+ # handle the user's warning options, so that we can issue (or
822
+ # suppress) appropriate warnings about anything that might happen,
823
+ # as configured by the user.
824
+
825
+ default_warnings = [ SCons.Warnings.WarningOnByDefault,
826
+ SCons.Warnings.DeprecatedWarning,
827
+ ]
828
+
829
+ for warning in default_warnings:
830
+ SCons.Warnings.enableWarningClass(warning)
831
+ SCons.Warnings._warningOut = _scons_internal_warning
832
+ SCons.Warnings.process_warn_strings(options.warn)
833
+
834
+ # Now that we have the warnings configuration set up, we can actually
835
+ # issue (or suppress) any warnings about warning-worthy things that
836
+ # occurred while the command-line options were getting parsed.
837
+ try:
838
+ dw = options.delayed_warnings
839
+ except AttributeError:
840
+ pass
841
+ else:
842
+ delayed_warnings.extend(dw)
843
+ for warning_type, message in delayed_warnings:
844
+ SCons.Warnings.warn(warning_type, message)
845
+
846
+ if options.diskcheck:
847
+ SCons.Node.FS.set_diskcheck(options.diskcheck)
848
+
849
+ # Next, we want to create the FS object that represents the outside
850
+ # world's file system, as that's central to a lot of initialization.
851
+ # To do this, however, we need to be in the directory from which we
852
+ # want to start everything, which means first handling any relevant
853
+ # options that might cause us to chdir somewhere (-C, -D, -U, -u).
854
+ if options.directory:
855
+ script_dir = os.path.abspath(_create_path(options.directory))
856
+ else:
857
+ script_dir = os.getcwd()
858
+
859
+ target_top = None
860
+ if options.climb_up:
861
+ target_top = '.' # directory to prepend to targets
862
+ while script_dir and not _SConstruct_exists(script_dir,
863
+ options.repository,
864
+ options.file):
865
+ script_dir, last_part = os.path.split(script_dir)
866
+ if last_part:
867
+ target_top = os.path.join(last_part, target_top)
868
+ else:
869
+ script_dir = ''
870
+
871
+ if script_dir and script_dir != os.getcwd():
872
+ display("scons: Entering directory `%s'" % script_dir)
873
+ try:
874
+ os.chdir(script_dir)
875
+ except OSError:
876
+ sys.stderr.write("Could not change directory to %s\n" % script_dir)
877
+
878
+ # Now that we're in the top-level SConstruct directory, go ahead
879
+ # and initialize the FS object that represents the file system,
880
+ # and make it the build engine default.
881
+ fs = SCons.Node.FS.get_default_fs()
882
+
883
+ for rep in options.repository:
884
+ fs.Repository(rep)
885
+
886
+ # Now that we have the FS object, the next order of business is to
887
+ # check for an SConstruct file (or other specified config file).
888
+ # If there isn't one, we can bail before doing any more work.
889
+ scripts = []
890
+ if options.file:
891
+ scripts.extend(options.file)
892
+ if not scripts:
893
+ sfile = _SConstruct_exists(repositories=options.repository,
894
+ filelist=options.file)
895
+ if sfile:
896
+ scripts.append(sfile)
897
+
898
+ if not scripts:
899
+ if options.help:
900
+ # There's no SConstruct, but they specified -h.
901
+ # Give them the options usage now, before we fail
902
+ # trying to read a non-existent SConstruct file.
903
+ raise SConsPrintHelpException
904
+ raise SCons.Errors.UserError("No SConstruct file found.")
905
+
906
+ if scripts[0] == "-":
907
+ d = fs.getcwd()
908
+ else:
909
+ d = fs.File(scripts[0]).dir
910
+ fs.set_SConstruct_dir(d)
911
+
912
+ _set_debug_values(options)
913
+ SCons.Node.implicit_cache = options.implicit_cache
914
+ SCons.Node.implicit_deps_changed = options.implicit_deps_changed
915
+ SCons.Node.implicit_deps_unchanged = options.implicit_deps_unchanged
916
+
917
+ if options.no_exec:
918
+ SCons.SConf.dryrun = 1
919
+ SCons.Action.execute_actions = None
920
+ if options.question:
921
+ SCons.SConf.dryrun = 1
922
+ if options.clean:
923
+ SCons.SConf.SetBuildType('clean')
924
+ if options.help:
925
+ SCons.SConf.SetBuildType('help')
926
+ SCons.SConf.SetCacheMode(options.config)
927
+ SCons.SConf.SetProgressDisplay(progress_display)
928
+
929
+ if options.no_progress or options.silent:
930
+ progress_display.set_mode(0)
931
+
932
+ if options.site_dir:
933
+ _load_site_scons_dir(d.path, options.site_dir)
934
+ elif not options.no_site_dir:
935
+ _load_all_site_scons_dirs(d.path)
936
+
937
+ if options.include_dir:
938
+ sys.path = options.include_dir + sys.path
939
+
940
+ # That should cover (most of) the options. Next, set up the variables
941
+ # that hold command-line arguments, so the SConscript files that we
942
+ # read and execute have access to them.
943
+ targets = []
944
+ xmit_args = []
945
+ for a in parser.largs:
946
+ if a[:1] == '-':
947
+ continue
948
+ if '=' in a:
949
+ xmit_args.append(a)
950
+ else:
951
+ targets.append(a)
952
+ SCons.Script._Add_Targets(targets + parser.rargs)
953
+ SCons.Script._Add_Arguments(xmit_args)
954
+
955
+ # If stdout is not a tty, replace it with a wrapper object to call flush
956
+ # after every write.
957
+ #
958
+ # Tty devices automatically flush after every newline, so the replacement
959
+ # isn't necessary. Furthermore, if we replace sys.stdout, the readline
960
+ # module will no longer work. This affects the behavior during
961
+ # --interactive mode. --interactive should only be used when stdin and
962
+ # stdout refer to a tty.
963
+ if not hasattr(sys.stdout, 'isatty') or not sys.stdout.isatty():
964
+ sys.stdout = SCons.Util.Unbuffered(sys.stdout)
965
+ if not hasattr(sys.stderr, 'isatty') or not sys.stderr.isatty():
966
+ sys.stderr = SCons.Util.Unbuffered(sys.stderr)
967
+
968
+ memory_stats.append('before reading SConscript files:')
969
+ count_stats.append(('pre-', 'read'))
970
+
971
+ # And here's where we (finally) read the SConscript files.
972
+
973
+ progress_display("scons: Reading SConscript files ...")
974
+
975
+ start_time = time.time()
976
+ try:
977
+ for script in scripts:
978
+ SCons.Script._SConscript._SConscript(fs, script)
979
+ except SCons.Errors.StopError, e:
980
+ # We had problems reading an SConscript file, such as it
981
+ # couldn't be copied in to the VariantDir. Since we're just
982
+ # reading SConscript files and haven't started building
983
+ # things yet, stop regardless of whether they used -i or -k
984
+ # or anything else.
985
+ sys.stderr.write("scons: *** %s Stop.\n" % e)
986
+ exit_status = 2
987
+ sys.exit(exit_status)
988
+ global sconscript_time
989
+ sconscript_time = time.time() - start_time
990
+
991
+ progress_display("scons: done reading SConscript files.")
992
+
993
+ memory_stats.append('after reading SConscript files:')
994
+ count_stats.append(('post-', 'read'))
995
+
996
+ # Re-{enable,disable} warnings in case they disabled some in
997
+ # the SConscript file.
998
+ #
999
+ # We delay enabling the PythonVersionWarning class until here so that,
1000
+ # if they explicity disabled it in either in the command line or in
1001
+ # $SCONSFLAGS, or in the SConscript file, then the search through
1002
+ # the list of deprecated warning classes will find that disabling
1003
+ # first and not issue the warning.
1004
+ #SCons.Warnings.enableWarningClass(SCons.Warnings.PythonVersionWarning)
1005
+ SCons.Warnings.process_warn_strings(options.warn)
1006
+
1007
+ # Now that we've read the SConscript files, we can check for the
1008
+ # warning about deprecated Python versions--delayed until here
1009
+ # in case they disabled the warning in the SConscript files.
1010
+ if python_version_deprecated():
1011
+ msg = "Support for pre-2.4 Python (%s) is deprecated.\n" + \
1012
+ " If this will cause hardship, contact dev@scons.tigris.org."
1013
+ SCons.Warnings.warn(SCons.Warnings.PythonVersionWarning,
1014
+ msg % python_version_string())
1015
+
1016
+ if not options.help:
1017
+ SCons.SConf.CreateConfigHBuilder(SCons.Defaults.DefaultEnvironment())
1018
+
1019
+ # Now re-parse the command-line options (any to the left of a '--'
1020
+ # argument, that is) with any user-defined command-line options that
1021
+ # the SConscript files may have added to the parser object. This will
1022
+ # emit the appropriate error message and exit if any unknown option
1023
+ # was specified on the command line.
1024
+
1025
+ parser.preserve_unknown_options = False
1026
+ parser.parse_args(parser.largs, options)
1027
+
1028
+ if options.help:
1029
+ help_text = SCons.Script.help_text
1030
+ if help_text is None:
1031
+ # They specified -h, but there was no Help() inside the
1032
+ # SConscript files. Give them the options usage.
1033
+ raise SConsPrintHelpException
1034
+ else:
1035
+ print help_text
1036
+ print "Use scons -H for help about command-line options."
1037
+ exit_status = 0
1038
+ return
1039
+
1040
+ # Change directory to the top-level SConstruct directory, then tell
1041
+ # the Node.FS subsystem that we're all done reading the SConscript
1042
+ # files and calling Repository() and VariantDir() and changing
1043
+ # directories and the like, so it can go ahead and start memoizing
1044
+ # the string values of file system nodes.
1045
+
1046
+ fs.chdir(fs.Top)
1047
+
1048
+ SCons.Node.FS.save_strings(1)
1049
+
1050
+ # Now that we've read the SConscripts we can set the options
1051
+ # that are SConscript settable:
1052
+ SCons.Node.implicit_cache = options.implicit_cache
1053
+ SCons.Node.FS.set_duplicate(options.duplicate)
1054
+ fs.set_max_drift(options.max_drift)
1055
+
1056
+ SCons.Job.explicit_stack_size = options.stack_size
1057
+
1058
+ if options.md5_chunksize:
1059
+ SCons.Node.FS.File.md5_chunksize = options.md5_chunksize
1060
+
1061
+ platform = SCons.Platform.platform_module()
1062
+
1063
+ if options.interactive:
1064
+ SCons.Script.Interactive.interact(fs, OptionsParser, options,
1065
+ targets, target_top)
1066
+
1067
+ else:
1068
+
1069
+ # Build the targets
1070
+ nodes = _build_targets(fs, options, targets, target_top)
1071
+ if not nodes:
1072
+ exit_status = 2
1073
+
1074
+ def _build_targets(fs, options, targets, target_top):
1075
+
1076
+ global this_build_status
1077
+ this_build_status = 0
1078
+
1079
+ progress_display.set_mode(not (options.no_progress or options.silent))
1080
+ display.set_mode(not options.silent)
1081
+ SCons.Action.print_actions = not options.silent
1082
+ SCons.Action.execute_actions = not options.no_exec
1083
+ SCons.Node.FS.do_store_info = not options.no_exec
1084
+ SCons.SConf.dryrun = options.no_exec
1085
+
1086
+ if options.diskcheck:
1087
+ SCons.Node.FS.set_diskcheck(options.diskcheck)
1088
+
1089
+ SCons.CacheDir.cache_enabled = not options.cache_disable
1090
+ SCons.CacheDir.cache_debug = options.cache_debug
1091
+ SCons.CacheDir.cache_force = options.cache_force
1092
+ SCons.CacheDir.cache_show = options.cache_show
1093
+
1094
+ if options.no_exec:
1095
+ CleanTask.execute = CleanTask.show
1096
+ else:
1097
+ CleanTask.execute = CleanTask.remove
1098
+
1099
+ lookup_top = None
1100
+ if targets or SCons.Script.BUILD_TARGETS != SCons.Script._build_plus_default:
1101
+ # They specified targets on the command line or modified
1102
+ # BUILD_TARGETS in the SConscript file(s), so if they used -u,
1103
+ # -U or -D, we have to look up targets relative to the top,
1104
+ # but we build whatever they specified.
1105
+ if target_top:
1106
+ lookup_top = fs.Dir(target_top)
1107
+ target_top = None
1108
+
1109
+ targets = SCons.Script.BUILD_TARGETS
1110
+ else:
1111
+ # There are no targets specified on the command line,
1112
+ # so if they used -u, -U or -D, we may have to restrict
1113
+ # what actually gets built.
1114
+ d = None
1115
+ if target_top:
1116
+ if options.climb_up == 1:
1117
+ # -u, local directory and below
1118
+ target_top = fs.Dir(target_top)
1119
+ lookup_top = target_top
1120
+ elif options.climb_up == 2:
1121
+ # -D, all Default() targets
1122
+ target_top = None
1123
+ lookup_top = None
1124
+ elif options.climb_up == 3:
1125
+ # -U, local SConscript Default() targets
1126
+ target_top = fs.Dir(target_top)
1127
+ def check_dir(x, target_top=target_top):
1128
+ if hasattr(x, 'cwd') and not x.cwd is None:
1129
+ cwd = x.cwd.srcnode()
1130
+ return cwd == target_top
1131
+ else:
1132
+ # x doesn't have a cwd, so it's either not a target,
1133
+ # or not a file, so go ahead and keep it as a default
1134
+ # target and let the engine sort it out:
1135
+ return 1
1136
+ d = list(filter(check_dir, SCons.Script.DEFAULT_TARGETS))
1137
+ SCons.Script.DEFAULT_TARGETS[:] = d
1138
+ target_top = None
1139
+ lookup_top = None
1140
+
1141
+ targets = SCons.Script._Get_Default_Targets(d, fs)
1142
+
1143
+ if not targets:
1144
+ sys.stderr.write("scons: *** No targets specified and no Default() targets found. Stop.\n")
1145
+ return None
1146
+
1147
+ def Entry(x, ltop=lookup_top, ttop=target_top, fs=fs):
1148
+ if isinstance(x, SCons.Node.Node):
1149
+ node = x
1150
+ else:
1151
+ node = None
1152
+ # Why would ltop be None? Unfortunately this happens.
1153
+ if ltop is None: ltop = ''
1154
+ # Curdir becomes important when SCons is called with -u, -C,
1155
+ # or similar option that changes directory, and so the paths
1156
+ # of targets given on the command line need to be adjusted.
1157
+ curdir = os.path.join(os.getcwd(), str(ltop))
1158
+ for lookup in SCons.Node.arg2nodes_lookups:
1159
+ node = lookup(x, curdir=curdir)
1160
+ if node is not None:
1161
+ break
1162
+ if node is None:
1163
+ node = fs.Entry(x, directory=ltop, create=1)
1164
+ if ttop and not node.is_under(ttop):
1165
+ if isinstance(node, SCons.Node.FS.Dir) and ttop.is_under(node):
1166
+ node = ttop
1167
+ else:
1168
+ node = None
1169
+ return node
1170
+
1171
+ nodes = [_f for _f in map(Entry, targets) if _f]
1172
+
1173
+ task_class = BuildTask # default action is to build targets
1174
+ opening_message = "Building targets ..."
1175
+ closing_message = "done building targets."
1176
+ if options.keep_going:
1177
+ failure_message = "done building targets (errors occurred during build)."
1178
+ else:
1179
+ failure_message = "building terminated because of errors."
1180
+ if options.question:
1181
+ task_class = QuestionTask
1182
+ try:
1183
+ if options.clean:
1184
+ task_class = CleanTask
1185
+ opening_message = "Cleaning targets ..."
1186
+ closing_message = "done cleaning targets."
1187
+ if options.keep_going:
1188
+ failure_message = "done cleaning targets (errors occurred during clean)."
1189
+ else:
1190
+ failure_message = "cleaning terminated because of errors."
1191
+ except AttributeError:
1192
+ pass
1193
+
1194
+ task_class.progress = ProgressObject
1195
+
1196
+ if options.random:
1197
+ def order(dependencies):
1198
+ """Randomize the dependencies."""
1199
+ import random
1200
+ # This is cribbed from the implementation of
1201
+ # random.shuffle() in Python 2.X.
1202
+ d = dependencies
1203
+ for i in range(len(d)-1, 0, -1):
1204
+ j = int(random.random() * (i+1))
1205
+ d[i], d[j] = d[j], d[i]
1206
+ return d
1207
+ else:
1208
+ def order(dependencies):
1209
+ """Leave the order of dependencies alone."""
1210
+ return dependencies
1211
+
1212
+ if options.taskmastertrace_file == '-':
1213
+ tmtrace = sys.stdout
1214
+ elif options.taskmastertrace_file:
1215
+ tmtrace = open(options.taskmastertrace_file, 'wb')
1216
+ else:
1217
+ tmtrace = None
1218
+ taskmaster = SCons.Taskmaster.Taskmaster(nodes, task_class, order, tmtrace)
1219
+
1220
+ # Let the BuildTask objects get at the options to respond to the
1221
+ # various print_* settings, tree_printer list, etc.
1222
+ BuildTask.options = options
1223
+
1224
+ global num_jobs
1225
+ num_jobs = options.num_jobs
1226
+ jobs = SCons.Job.Jobs(num_jobs, taskmaster)
1227
+ if num_jobs > 1:
1228
+ msg = None
1229
+ if jobs.num_jobs == 1:
1230
+ msg = "parallel builds are unsupported by this version of Python;\n" + \
1231
+ "\tignoring -j or num_jobs option.\n"
1232
+ elif sys.platform == 'win32':
1233
+ msg = fetch_win32_parallel_msg()
1234
+ if msg:
1235
+ SCons.Warnings.warn(SCons.Warnings.NoParallelSupportWarning, msg)
1236
+
1237
+ memory_stats.append('before building targets:')
1238
+ count_stats.append(('pre-', 'build'))
1239
+
1240
+ def jobs_postfunc(
1241
+ jobs=jobs,
1242
+ options=options,
1243
+ closing_message=closing_message,
1244
+ failure_message=failure_message
1245
+ ):
1246
+ if jobs.were_interrupted():
1247
+ if not options.no_progress and not options.silent:
1248
+ sys.stderr.write("scons: Build interrupted.\n")
1249
+ global exit_status
1250
+ global this_build_status
1251
+ exit_status = 2
1252
+ this_build_status = 2
1253
+
1254
+ if this_build_status:
1255
+ progress_display("scons: " + failure_message)
1256
+ else:
1257
+ progress_display("scons: " + closing_message)
1258
+ if not options.no_exec:
1259
+ if jobs.were_interrupted():
1260
+ progress_display("scons: writing .sconsign file.")
1261
+ SCons.SConsign.write()
1262
+
1263
+ progress_display("scons: " + opening_message)
1264
+ jobs.run(postfunc = jobs_postfunc)
1265
+
1266
+ memory_stats.append('after building targets:')
1267
+ count_stats.append(('post-', 'build'))
1268
+
1269
+ return nodes
1270
+
1271
+ def _exec_main(parser, values):
1272
+ sconsflags = os.environ.get('SCONSFLAGS', '')
1273
+ all_args = sconsflags.split() + sys.argv[1:]
1274
+
1275
+ options, args = parser.parse_args(all_args, values)
1276
+
1277
+ if isinstance(options.debug, list) and "pdb" in options.debug:
1278
+ import pdb
1279
+ pdb.Pdb().runcall(_main, parser)
1280
+ elif options.profile_file:
1281
+ # compat layer imports "cProfile" for us if it's available.
1282
+ from profile import Profile
1283
+
1284
+ # Some versions of Python 2.4 shipped a profiler that had the
1285
+ # wrong 'c_exception' entry in its dispatch table. Make sure
1286
+ # we have the right one. (This may put an unnecessary entry
1287
+ # in the table in earlier versions of Python, but its presence
1288
+ # shouldn't hurt anything).
1289
+ try:
1290
+ dispatch = Profile.dispatch
1291
+ except AttributeError:
1292
+ pass
1293
+ else:
1294
+ dispatch['c_exception'] = Profile.trace_dispatch_return
1295
+
1296
+ prof = Profile()
1297
+ try:
1298
+ prof.runcall(_main, parser)
1299
+ except SConsPrintHelpException, e:
1300
+ prof.dump_stats(options.profile_file)
1301
+ raise e
1302
+ except SystemExit:
1303
+ pass
1304
+ prof.dump_stats(options.profile_file)
1305
+ else:
1306
+ _main(parser)
1307
+
1308
+ def main():
1309
+ global OptionsParser
1310
+ global exit_status
1311
+ global first_command_start
1312
+
1313
+ # Check up front for a Python version we do not support. We
1314
+ # delay the check for deprecated Python versions until later,
1315
+ # after the SConscript files have been read, in case they
1316
+ # disable that warning.
1317
+ if python_version_unsupported():
1318
+ msg = "scons: *** SCons version %s does not run under Python version %s.\n"
1319
+ sys.stderr.write(msg % (SCons.__version__, python_version_string()))
1320
+ sys.exit(1)
1321
+
1322
+ parts = ["SCons by Steven Knight et al.:\n"]
1323
+ try:
1324
+ import __main__
1325
+ parts.append(version_string("script", __main__))
1326
+ except (ImportError, AttributeError):
1327
+ # On Windows there is no scons.py, so there is no
1328
+ # __main__.__version__, hence there is no script version.
1329
+ pass
1330
+ parts.append(version_string("engine", SCons))
1331
+ parts.append(path_string("engine", SCons))
1332
+ parts.append("Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 The SCons Foundation")
1333
+ version = ''.join(parts)
1334
+
1335
+ import SConsOptions
1336
+ parser = SConsOptions.Parser(version)
1337
+ values = SConsOptions.SConsValues(parser.get_default_values())
1338
+
1339
+ OptionsParser = parser
1340
+
1341
+ try:
1342
+ _exec_main(parser, values)
1343
+ except SystemExit, s:
1344
+ if s:
1345
+ exit_status = s
1346
+ except KeyboardInterrupt:
1347
+ print("scons: Build interrupted.")
1348
+ sys.exit(2)
1349
+ except SyntaxError, e:
1350
+ _scons_syntax_error(e)
1351
+ except SCons.Errors.InternalError:
1352
+ _scons_internal_error()
1353
+ except SCons.Errors.UserError, e:
1354
+ _scons_user_error(e)
1355
+ except SConsPrintHelpException:
1356
+ parser.print_help()
1357
+ exit_status = 0
1358
+ except SCons.Errors.BuildError, e:
1359
+ exit_status = e.exitstatus
1360
+ except:
1361
+ # An exception here is likely a builtin Python exception Python
1362
+ # code in an SConscript file. Show them precisely what the
1363
+ # problem was and where it happened.
1364
+ SCons.Script._SConscript.SConscript_exception()
1365
+ sys.exit(2)
1366
+
1367
+ memory_stats.print_stats()
1368
+ count_stats.print_stats()
1369
+
1370
+ if print_objects:
1371
+ SCons.Debug.listLoggedInstances('*')
1372
+ #SCons.Debug.dumpLoggedInstances('*')
1373
+
1374
+ if print_memoizer:
1375
+ SCons.Memoize.Dump("Memoizer (memory cache) hits and misses:")
1376
+
1377
+ # Dump any development debug info that may have been enabled.
1378
+ # These are purely for internal debugging during development, so
1379
+ # there's no need to control them with --debug= options; they're
1380
+ # controlled by changing the source code.
1381
+ SCons.Debug.dump_caller_counts()
1382
+ SCons.Taskmaster.dump_stats()
1383
+
1384
+ if print_time:
1385
+ total_time = time.time() - SCons.Script.start_time
1386
+ if num_jobs == 1:
1387
+ ct = cumulative_command_time
1388
+ else:
1389
+ if last_command_end is None or first_command_start is None:
1390
+ ct = 0.0
1391
+ else:
1392
+ ct = last_command_end - first_command_start
1393
+ scons_time = total_time - sconscript_time - ct
1394
+ print "Total build time: %f seconds"%total_time
1395
+ print "Total SConscript file execution time: %f seconds"%sconscript_time
1396
+ print "Total SCons execution time: %f seconds"%scons_time
1397
+ print "Total command execution time: %f seconds"%ct
1398
+
1399
+ sys.exit(exit_status)
1400
+
1401
+ # Local Variables:
1402
+ # tab-width:4
1403
+ # indent-tabs-mode:nil
1404
+ # End:
1405
+ # vim: set expandtab tabstop=4 shiftwidth=4: