libv8 3.3.10.2

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 (700) hide show
  1. data/.gitignore +8 -0
  2. data/.gitmodules +3 -0
  3. data/Gemfile +4 -0
  4. data/README.md +44 -0
  5. data/Rakefile +73 -0
  6. data/ext/libv8/extconf.rb +9 -0
  7. data/lib/libv8.rb +15 -0
  8. data/lib/libv8/Makefile +38 -0
  9. data/lib/libv8/detect_cpu.rb +27 -0
  10. data/lib/libv8/fpic-on-linux-amd64.patch +13 -0
  11. data/lib/libv8/scons/CHANGES.txt +5334 -0
  12. data/lib/libv8/scons/LICENSE.txt +20 -0
  13. data/lib/libv8/scons/MANIFEST +199 -0
  14. data/lib/libv8/scons/PKG-INFO +13 -0
  15. data/lib/libv8/scons/README.txt +243 -0
  16. data/lib/libv8/scons/RELEASE.txt +98 -0
  17. data/lib/libv8/scons/engine/SCons/Action.py +1241 -0
  18. data/lib/libv8/scons/engine/SCons/Builder.py +877 -0
  19. data/lib/libv8/scons/engine/SCons/CacheDir.py +216 -0
  20. data/lib/libv8/scons/engine/SCons/Conftest.py +793 -0
  21. data/lib/libv8/scons/engine/SCons/Debug.py +220 -0
  22. data/lib/libv8/scons/engine/SCons/Defaults.py +480 -0
  23. data/lib/libv8/scons/engine/SCons/Environment.py +2318 -0
  24. data/lib/libv8/scons/engine/SCons/Errors.py +205 -0
  25. data/lib/libv8/scons/engine/SCons/Executor.py +633 -0
  26. data/lib/libv8/scons/engine/SCons/Job.py +435 -0
  27. data/lib/libv8/scons/engine/SCons/Memoize.py +244 -0
  28. data/lib/libv8/scons/engine/SCons/Node/Alias.py +152 -0
  29. data/lib/libv8/scons/engine/SCons/Node/FS.py +3142 -0
  30. data/lib/libv8/scons/engine/SCons/Node/Python.py +128 -0
  31. data/lib/libv8/scons/engine/SCons/Node/__init__.py +1328 -0
  32. data/lib/libv8/scons/engine/SCons/Options/BoolOption.py +50 -0
  33. data/lib/libv8/scons/engine/SCons/Options/EnumOption.py +50 -0
  34. data/lib/libv8/scons/engine/SCons/Options/ListOption.py +50 -0
  35. data/lib/libv8/scons/engine/SCons/Options/PackageOption.py +50 -0
  36. data/lib/libv8/scons/engine/SCons/Options/PathOption.py +76 -0
  37. data/lib/libv8/scons/engine/SCons/Options/__init__.py +67 -0
  38. data/lib/libv8/scons/engine/SCons/PathList.py +231 -0
  39. data/lib/libv8/scons/engine/SCons/Platform/__init__.py +241 -0
  40. data/lib/libv8/scons/engine/SCons/Platform/aix.py +69 -0
  41. data/lib/libv8/scons/engine/SCons/Platform/cygwin.py +55 -0
  42. data/lib/libv8/scons/engine/SCons/Platform/darwin.py +46 -0
  43. data/lib/libv8/scons/engine/SCons/Platform/hpux.py +46 -0
  44. data/lib/libv8/scons/engine/SCons/Platform/irix.py +44 -0
  45. data/lib/libv8/scons/engine/SCons/Platform/os2.py +58 -0
  46. data/lib/libv8/scons/engine/SCons/Platform/posix.py +263 -0
  47. data/lib/libv8/scons/engine/SCons/Platform/sunos.py +50 -0
  48. data/lib/libv8/scons/engine/SCons/Platform/win32.py +385 -0
  49. data/lib/libv8/scons/engine/SCons/SConf.py +1030 -0
  50. data/lib/libv8/scons/engine/SCons/SConsign.py +383 -0
  51. data/lib/libv8/scons/engine/SCons/Scanner/C.py +132 -0
  52. data/lib/libv8/scons/engine/SCons/Scanner/D.py +73 -0
  53. data/lib/libv8/scons/engine/SCons/Scanner/Dir.py +109 -0
  54. data/lib/libv8/scons/engine/SCons/Scanner/Fortran.py +316 -0
  55. data/lib/libv8/scons/engine/SCons/Scanner/IDL.py +48 -0
  56. data/lib/libv8/scons/engine/SCons/Scanner/LaTeX.py +384 -0
  57. data/lib/libv8/scons/engine/SCons/Scanner/Prog.py +101 -0
  58. data/lib/libv8/scons/engine/SCons/Scanner/RC.py +55 -0
  59. data/lib/libv8/scons/engine/SCons/Scanner/__init__.py +413 -0
  60. data/lib/libv8/scons/engine/SCons/Script/Interactive.py +384 -0
  61. data/lib/libv8/scons/engine/SCons/Script/Main.py +1334 -0
  62. data/lib/libv8/scons/engine/SCons/Script/SConsOptions.py +939 -0
  63. data/lib/libv8/scons/engine/SCons/Script/SConscript.py +640 -0
  64. data/lib/libv8/scons/engine/SCons/Script/__init__.py +412 -0
  65. data/lib/libv8/scons/engine/SCons/Sig.py +63 -0
  66. data/lib/libv8/scons/engine/SCons/Subst.py +904 -0
  67. data/lib/libv8/scons/engine/SCons/Taskmaster.py +1017 -0
  68. data/lib/libv8/scons/engine/SCons/Tool/386asm.py +61 -0
  69. data/lib/libv8/scons/engine/SCons/Tool/BitKeeper.py +67 -0
  70. data/lib/libv8/scons/engine/SCons/Tool/CVS.py +73 -0
  71. data/lib/libv8/scons/engine/SCons/Tool/FortranCommon.py +246 -0
  72. data/lib/libv8/scons/engine/SCons/Tool/JavaCommon.py +323 -0
  73. data/lib/libv8/scons/engine/SCons/Tool/MSCommon/__init__.py +56 -0
  74. data/lib/libv8/scons/engine/SCons/Tool/MSCommon/arch.py +61 -0
  75. data/lib/libv8/scons/engine/SCons/Tool/MSCommon/common.py +240 -0
  76. data/lib/libv8/scons/engine/SCons/Tool/MSCommon/netframework.py +82 -0
  77. data/lib/libv8/scons/engine/SCons/Tool/MSCommon/sdk.py +391 -0
  78. data/lib/libv8/scons/engine/SCons/Tool/MSCommon/vc.py +456 -0
  79. data/lib/libv8/scons/engine/SCons/Tool/MSCommon/vs.py +499 -0
  80. data/lib/libv8/scons/engine/SCons/Tool/Perforce.py +103 -0
  81. data/lib/libv8/scons/engine/SCons/Tool/PharLapCommon.py +137 -0
  82. data/lib/libv8/scons/engine/SCons/Tool/RCS.py +64 -0
  83. data/lib/libv8/scons/engine/SCons/Tool/SCCS.py +64 -0
  84. data/lib/libv8/scons/engine/SCons/Tool/Subversion.py +71 -0
  85. data/lib/libv8/scons/engine/SCons/Tool/__init__.py +681 -0
  86. data/lib/libv8/scons/engine/SCons/Tool/aixc++.py +82 -0
  87. data/lib/libv8/scons/engine/SCons/Tool/aixcc.py +74 -0
  88. data/lib/libv8/scons/engine/SCons/Tool/aixf77.py +80 -0
  89. data/lib/libv8/scons/engine/SCons/Tool/aixlink.py +76 -0
  90. data/lib/libv8/scons/engine/SCons/Tool/applelink.py +71 -0
  91. data/lib/libv8/scons/engine/SCons/Tool/ar.py +63 -0
  92. data/lib/libv8/scons/engine/SCons/Tool/as.py +78 -0
  93. data/lib/libv8/scons/engine/SCons/Tool/bcc32.py +81 -0
  94. data/lib/libv8/scons/engine/SCons/Tool/c++.py +99 -0
  95. data/lib/libv8/scons/engine/SCons/Tool/cc.py +102 -0
  96. data/lib/libv8/scons/engine/SCons/Tool/cvf.py +58 -0
  97. data/lib/libv8/scons/engine/SCons/Tool/default.py +50 -0
  98. data/lib/libv8/scons/engine/SCons/Tool/dmd.py +223 -0
  99. data/lib/libv8/scons/engine/SCons/Tool/dvi.py +64 -0
  100. data/lib/libv8/scons/engine/SCons/Tool/dvipdf.py +124 -0
  101. data/lib/libv8/scons/engine/SCons/Tool/dvips.py +94 -0
  102. data/lib/libv8/scons/engine/SCons/Tool/f77.py +62 -0
  103. data/lib/libv8/scons/engine/SCons/Tool/f90.py +62 -0
  104. data/lib/libv8/scons/engine/SCons/Tool/f95.py +63 -0
  105. data/lib/libv8/scons/engine/SCons/Tool/filesystem.py +98 -0
  106. data/lib/libv8/scons/engine/SCons/Tool/fortran.py +62 -0
  107. data/lib/libv8/scons/engine/SCons/Tool/g++.py +90 -0
  108. data/lib/libv8/scons/engine/SCons/Tool/g77.py +73 -0
  109. data/lib/libv8/scons/engine/SCons/Tool/gas.py +53 -0
  110. data/lib/libv8/scons/engine/SCons/Tool/gcc.py +80 -0
  111. data/lib/libv8/scons/engine/SCons/Tool/gfortran.py +64 -0
  112. data/lib/libv8/scons/engine/SCons/Tool/gnulink.py +63 -0
  113. data/lib/libv8/scons/engine/SCons/Tool/gs.py +81 -0
  114. data/lib/libv8/scons/engine/SCons/Tool/hpc++.py +84 -0
  115. data/lib/libv8/scons/engine/SCons/Tool/hpcc.py +53 -0
  116. data/lib/libv8/scons/engine/SCons/Tool/hplink.py +77 -0
  117. data/lib/libv8/scons/engine/SCons/Tool/icc.py +59 -0
  118. data/lib/libv8/scons/engine/SCons/Tool/icl.py +52 -0
  119. data/lib/libv8/scons/engine/SCons/Tool/ifl.py +72 -0
  120. data/lib/libv8/scons/engine/SCons/Tool/ifort.py +88 -0
  121. data/lib/libv8/scons/engine/SCons/Tool/ilink.py +59 -0
  122. data/lib/libv8/scons/engine/SCons/Tool/ilink32.py +60 -0
  123. data/lib/libv8/scons/engine/SCons/Tool/install.py +229 -0
  124. data/lib/libv8/scons/engine/SCons/Tool/intelc.py +482 -0
  125. data/lib/libv8/scons/engine/SCons/Tool/ipkg.py +67 -0
  126. data/lib/libv8/scons/engine/SCons/Tool/jar.py +110 -0
  127. data/lib/libv8/scons/engine/SCons/Tool/javac.py +230 -0
  128. data/lib/libv8/scons/engine/SCons/Tool/javah.py +137 -0
  129. data/lib/libv8/scons/engine/SCons/Tool/latex.py +79 -0
  130. data/lib/libv8/scons/engine/SCons/Tool/lex.py +97 -0
  131. data/lib/libv8/scons/engine/SCons/Tool/link.py +121 -0
  132. data/lib/libv8/scons/engine/SCons/Tool/linkloc.py +112 -0
  133. data/lib/libv8/scons/engine/SCons/Tool/m4.py +63 -0
  134. data/lib/libv8/scons/engine/SCons/Tool/masm.py +77 -0
  135. data/lib/libv8/scons/engine/SCons/Tool/midl.py +88 -0
  136. data/lib/libv8/scons/engine/SCons/Tool/mingw.py +158 -0
  137. data/lib/libv8/scons/engine/SCons/Tool/mslib.py +64 -0
  138. data/lib/libv8/scons/engine/SCons/Tool/mslink.py +266 -0
  139. data/lib/libv8/scons/engine/SCons/Tool/mssdk.py +50 -0
  140. data/lib/libv8/scons/engine/SCons/Tool/msvc.py +268 -0
  141. data/lib/libv8/scons/engine/SCons/Tool/msvs.py +1388 -0
  142. data/lib/libv8/scons/engine/SCons/Tool/mwcc.py +207 -0
  143. data/lib/libv8/scons/engine/SCons/Tool/mwld.py +107 -0
  144. data/lib/libv8/scons/engine/SCons/Tool/nasm.py +72 -0
  145. data/lib/libv8/scons/engine/SCons/Tool/packaging/__init__.py +312 -0
  146. data/lib/libv8/scons/engine/SCons/Tool/packaging/ipk.py +185 -0
  147. data/lib/libv8/scons/engine/SCons/Tool/packaging/msi.py +527 -0
  148. data/lib/libv8/scons/engine/SCons/Tool/packaging/rpm.py +365 -0
  149. data/lib/libv8/scons/engine/SCons/Tool/packaging/src_tarbz2.py +43 -0
  150. data/lib/libv8/scons/engine/SCons/Tool/packaging/src_targz.py +43 -0
  151. data/lib/libv8/scons/engine/SCons/Tool/packaging/src_zip.py +43 -0
  152. data/lib/libv8/scons/engine/SCons/Tool/packaging/tarbz2.py +44 -0
  153. data/lib/libv8/scons/engine/SCons/Tool/packaging/targz.py +44 -0
  154. data/lib/libv8/scons/engine/SCons/Tool/packaging/zip.py +44 -0
  155. data/lib/libv8/scons/engine/SCons/Tool/pdf.py +78 -0
  156. data/lib/libv8/scons/engine/SCons/Tool/pdflatex.py +83 -0
  157. data/lib/libv8/scons/engine/SCons/Tool/pdftex.py +108 -0
  158. data/lib/libv8/scons/engine/SCons/Tool/qt.py +336 -0
  159. data/lib/libv8/scons/engine/SCons/Tool/rmic.py +120 -0
  160. data/lib/libv8/scons/engine/SCons/Tool/rpcgen.py +70 -0
  161. data/lib/libv8/scons/engine/SCons/Tool/rpm.py +132 -0
  162. data/lib/libv8/scons/engine/SCons/Tool/sgiar.py +68 -0
  163. data/lib/libv8/scons/engine/SCons/Tool/sgic++.py +58 -0
  164. data/lib/libv8/scons/engine/SCons/Tool/sgicc.py +53 -0
  165. data/lib/libv8/scons/engine/SCons/Tool/sgilink.py +63 -0
  166. data/lib/libv8/scons/engine/SCons/Tool/sunar.py +67 -0
  167. data/lib/libv8/scons/engine/SCons/Tool/sunc++.py +142 -0
  168. data/lib/libv8/scons/engine/SCons/Tool/suncc.py +58 -0
  169. data/lib/libv8/scons/engine/SCons/Tool/sunf77.py +63 -0
  170. data/lib/libv8/scons/engine/SCons/Tool/sunf90.py +64 -0
  171. data/lib/libv8/scons/engine/SCons/Tool/sunf95.py +64 -0
  172. data/lib/libv8/scons/engine/SCons/Tool/sunlink.py +77 -0
  173. data/lib/libv8/scons/engine/SCons/Tool/swig.py +182 -0
  174. data/lib/libv8/scons/engine/SCons/Tool/tar.py +73 -0
  175. data/lib/libv8/scons/engine/SCons/Tool/tex.py +813 -0
  176. data/lib/libv8/scons/engine/SCons/Tool/textfile.py +175 -0
  177. data/lib/libv8/scons/engine/SCons/Tool/tlib.py +53 -0
  178. data/lib/libv8/scons/engine/SCons/Tool/wix.py +99 -0
  179. data/lib/libv8/scons/engine/SCons/Tool/yacc.py +130 -0
  180. data/lib/libv8/scons/engine/SCons/Tool/zip.py +99 -0
  181. data/lib/libv8/scons/engine/SCons/Util.py +1492 -0
  182. data/lib/libv8/scons/engine/SCons/Variables/BoolVariable.py +89 -0
  183. data/lib/libv8/scons/engine/SCons/Variables/EnumVariable.py +103 -0
  184. data/lib/libv8/scons/engine/SCons/Variables/ListVariable.py +135 -0
  185. data/lib/libv8/scons/engine/SCons/Variables/PackageVariable.py +106 -0
  186. data/lib/libv8/scons/engine/SCons/Variables/PathVariable.py +147 -0
  187. data/lib/libv8/scons/engine/SCons/Variables/__init__.py +312 -0
  188. data/lib/libv8/scons/engine/SCons/Warnings.py +246 -0
  189. data/lib/libv8/scons/engine/SCons/__init__.py +49 -0
  190. data/lib/libv8/scons/engine/SCons/compat/__init__.py +237 -0
  191. data/lib/libv8/scons/engine/SCons/compat/_scons_builtins.py +150 -0
  192. data/lib/libv8/scons/engine/SCons/compat/_scons_collections.py +45 -0
  193. data/lib/libv8/scons/engine/SCons/compat/_scons_dbm.py +45 -0
  194. data/lib/libv8/scons/engine/SCons/compat/_scons_hashlib.py +76 -0
  195. data/lib/libv8/scons/engine/SCons/compat/_scons_io.py +45 -0
  196. data/lib/libv8/scons/engine/SCons/compat/_scons_sets.py +563 -0
  197. data/lib/libv8/scons/engine/SCons/compat/_scons_subprocess.py +1281 -0
  198. data/lib/libv8/scons/engine/SCons/cpp.py +589 -0
  199. data/lib/libv8/scons/engine/SCons/dblite.py +251 -0
  200. data/lib/libv8/scons/engine/SCons/exitfuncs.py +77 -0
  201. data/lib/libv8/scons/os_spawnv_fix.diff +83 -0
  202. data/lib/libv8/scons/scons-time.1 +1017 -0
  203. data/lib/libv8/scons/scons.1 +15219 -0
  204. data/lib/libv8/scons/sconsign.1 +208 -0
  205. data/lib/libv8/scons/script/scons +196 -0
  206. data/lib/libv8/scons/script/scons-time +1544 -0
  207. data/lib/libv8/scons/script/scons.bat +31 -0
  208. data/lib/libv8/scons/script/sconsign +513 -0
  209. data/lib/libv8/scons/setup.cfg +6 -0
  210. data/lib/libv8/scons/setup.py +425 -0
  211. data/lib/libv8/v8/.gitignore +35 -0
  212. data/lib/libv8/v8/AUTHORS +44 -0
  213. data/lib/libv8/v8/ChangeLog +2839 -0
  214. data/lib/libv8/v8/LICENSE +52 -0
  215. data/lib/libv8/v8/LICENSE.strongtalk +29 -0
  216. data/lib/libv8/v8/LICENSE.v8 +26 -0
  217. data/lib/libv8/v8/LICENSE.valgrind +45 -0
  218. data/lib/libv8/v8/SConstruct +1478 -0
  219. data/lib/libv8/v8/build/README.txt +49 -0
  220. data/lib/libv8/v8/build/all.gyp +18 -0
  221. data/lib/libv8/v8/build/armu.gypi +32 -0
  222. data/lib/libv8/v8/build/common.gypi +144 -0
  223. data/lib/libv8/v8/build/gyp_v8 +145 -0
  224. data/lib/libv8/v8/include/v8-debug.h +395 -0
  225. data/lib/libv8/v8/include/v8-preparser.h +117 -0
  226. data/lib/libv8/v8/include/v8-profiler.h +505 -0
  227. data/lib/libv8/v8/include/v8-testing.h +104 -0
  228. data/lib/libv8/v8/include/v8.h +4124 -0
  229. data/lib/libv8/v8/include/v8stdint.h +53 -0
  230. data/lib/libv8/v8/preparser/SConscript +38 -0
  231. data/lib/libv8/v8/preparser/preparser-process.cc +379 -0
  232. data/lib/libv8/v8/src/SConscript +368 -0
  233. data/lib/libv8/v8/src/accessors.cc +767 -0
  234. data/lib/libv8/v8/src/accessors.h +123 -0
  235. data/lib/libv8/v8/src/allocation-inl.h +49 -0
  236. data/lib/libv8/v8/src/allocation.cc +122 -0
  237. data/lib/libv8/v8/src/allocation.h +143 -0
  238. data/lib/libv8/v8/src/api.cc +5845 -0
  239. data/lib/libv8/v8/src/api.h +574 -0
  240. data/lib/libv8/v8/src/apinatives.js +110 -0
  241. data/lib/libv8/v8/src/apiutils.h +73 -0
  242. data/lib/libv8/v8/src/arguments.h +118 -0
  243. data/lib/libv8/v8/src/arm/assembler-arm-inl.h +353 -0
  244. data/lib/libv8/v8/src/arm/assembler-arm.cc +2661 -0
  245. data/lib/libv8/v8/src/arm/assembler-arm.h +1375 -0
  246. data/lib/libv8/v8/src/arm/builtins-arm.cc +1658 -0
  247. data/lib/libv8/v8/src/arm/code-stubs-arm.cc +6398 -0
  248. data/lib/libv8/v8/src/arm/code-stubs-arm.h +673 -0
  249. data/lib/libv8/v8/src/arm/codegen-arm.cc +52 -0
  250. data/lib/libv8/v8/src/arm/codegen-arm.h +91 -0
  251. data/lib/libv8/v8/src/arm/constants-arm.cc +152 -0
  252. data/lib/libv8/v8/src/arm/constants-arm.h +775 -0
  253. data/lib/libv8/v8/src/arm/cpu-arm.cc +120 -0
  254. data/lib/libv8/v8/src/arm/debug-arm.cc +317 -0
  255. data/lib/libv8/v8/src/arm/deoptimizer-arm.cc +754 -0
  256. data/lib/libv8/v8/src/arm/disasm-arm.cc +1506 -0
  257. data/lib/libv8/v8/src/arm/frames-arm.cc +45 -0
  258. data/lib/libv8/v8/src/arm/frames-arm.h +168 -0
  259. data/lib/libv8/v8/src/arm/full-codegen-arm.cc +4375 -0
  260. data/lib/libv8/v8/src/arm/ic-arm.cc +1562 -0
  261. data/lib/libv8/v8/src/arm/lithium-arm.cc +2206 -0
  262. data/lib/libv8/v8/src/arm/lithium-arm.h +2348 -0
  263. data/lib/libv8/v8/src/arm/lithium-codegen-arm.cc +4526 -0
  264. data/lib/libv8/v8/src/arm/lithium-codegen-arm.h +403 -0
  265. data/lib/libv8/v8/src/arm/lithium-gap-resolver-arm.cc +305 -0
  266. data/lib/libv8/v8/src/arm/lithium-gap-resolver-arm.h +84 -0
  267. data/lib/libv8/v8/src/arm/macro-assembler-arm.cc +3163 -0
  268. data/lib/libv8/v8/src/arm/macro-assembler-arm.h +1126 -0
  269. data/lib/libv8/v8/src/arm/regexp-macro-assembler-arm.cc +1287 -0
  270. data/lib/libv8/v8/src/arm/regexp-macro-assembler-arm.h +253 -0
  271. data/lib/libv8/v8/src/arm/simulator-arm.cc +3424 -0
  272. data/lib/libv8/v8/src/arm/simulator-arm.h +431 -0
  273. data/lib/libv8/v8/src/arm/stub-cache-arm.cc +4243 -0
  274. data/lib/libv8/v8/src/array.js +1366 -0
  275. data/lib/libv8/v8/src/assembler.cc +1207 -0
  276. data/lib/libv8/v8/src/assembler.h +858 -0
  277. data/lib/libv8/v8/src/ast-inl.h +112 -0
  278. data/lib/libv8/v8/src/ast.cc +1146 -0
  279. data/lib/libv8/v8/src/ast.h +2188 -0
  280. data/lib/libv8/v8/src/atomicops.h +167 -0
  281. data/lib/libv8/v8/src/atomicops_internals_arm_gcc.h +145 -0
  282. data/lib/libv8/v8/src/atomicops_internals_mips_gcc.h +169 -0
  283. data/lib/libv8/v8/src/atomicops_internals_x86_gcc.cc +133 -0
  284. data/lib/libv8/v8/src/atomicops_internals_x86_gcc.h +287 -0
  285. data/lib/libv8/v8/src/atomicops_internals_x86_macosx.h +301 -0
  286. data/lib/libv8/v8/src/atomicops_internals_x86_msvc.h +203 -0
  287. data/lib/libv8/v8/src/bignum-dtoa.cc +655 -0
  288. data/lib/libv8/v8/src/bignum-dtoa.h +81 -0
  289. data/lib/libv8/v8/src/bignum.cc +768 -0
  290. data/lib/libv8/v8/src/bignum.h +140 -0
  291. data/lib/libv8/v8/src/bootstrapper.cc +2184 -0
  292. data/lib/libv8/v8/src/bootstrapper.h +188 -0
  293. data/lib/libv8/v8/src/builtins.cc +1707 -0
  294. data/lib/libv8/v8/src/builtins.h +371 -0
  295. data/lib/libv8/v8/src/bytecodes-irregexp.h +105 -0
  296. data/lib/libv8/v8/src/cached-powers.cc +177 -0
  297. data/lib/libv8/v8/src/cached-powers.h +65 -0
  298. data/lib/libv8/v8/src/char-predicates-inl.h +94 -0
  299. data/lib/libv8/v8/src/char-predicates.h +67 -0
  300. data/lib/libv8/v8/src/checks.cc +110 -0
  301. data/lib/libv8/v8/src/checks.h +296 -0
  302. data/lib/libv8/v8/src/circular-queue-inl.h +53 -0
  303. data/lib/libv8/v8/src/circular-queue.cc +122 -0
  304. data/lib/libv8/v8/src/circular-queue.h +103 -0
  305. data/lib/libv8/v8/src/code-stubs.cc +267 -0
  306. data/lib/libv8/v8/src/code-stubs.h +1011 -0
  307. data/lib/libv8/v8/src/code.h +70 -0
  308. data/lib/libv8/v8/src/codegen.cc +231 -0
  309. data/lib/libv8/v8/src/codegen.h +84 -0
  310. data/lib/libv8/v8/src/compilation-cache.cc +540 -0
  311. data/lib/libv8/v8/src/compilation-cache.h +287 -0
  312. data/lib/libv8/v8/src/compiler.cc +786 -0
  313. data/lib/libv8/v8/src/compiler.h +312 -0
  314. data/lib/libv8/v8/src/contexts.cc +347 -0
  315. data/lib/libv8/v8/src/contexts.h +391 -0
  316. data/lib/libv8/v8/src/conversions-inl.h +106 -0
  317. data/lib/libv8/v8/src/conversions.cc +1131 -0
  318. data/lib/libv8/v8/src/conversions.h +135 -0
  319. data/lib/libv8/v8/src/counters.cc +93 -0
  320. data/lib/libv8/v8/src/counters.h +254 -0
  321. data/lib/libv8/v8/src/cpu-profiler-inl.h +101 -0
  322. data/lib/libv8/v8/src/cpu-profiler.cc +609 -0
  323. data/lib/libv8/v8/src/cpu-profiler.h +302 -0
  324. data/lib/libv8/v8/src/cpu.h +69 -0
  325. data/lib/libv8/v8/src/d8-debug.cc +367 -0
  326. data/lib/libv8/v8/src/d8-debug.h +158 -0
  327. data/lib/libv8/v8/src/d8-posix.cc +695 -0
  328. data/lib/libv8/v8/src/d8-readline.cc +130 -0
  329. data/lib/libv8/v8/src/d8-windows.cc +42 -0
  330. data/lib/libv8/v8/src/d8.cc +803 -0
  331. data/lib/libv8/v8/src/d8.gyp +91 -0
  332. data/lib/libv8/v8/src/d8.h +235 -0
  333. data/lib/libv8/v8/src/d8.js +2798 -0
  334. data/lib/libv8/v8/src/data-flow.cc +66 -0
  335. data/lib/libv8/v8/src/data-flow.h +205 -0
  336. data/lib/libv8/v8/src/date.js +1103 -0
  337. data/lib/libv8/v8/src/dateparser-inl.h +127 -0
  338. data/lib/libv8/v8/src/dateparser.cc +178 -0
  339. data/lib/libv8/v8/src/dateparser.h +266 -0
  340. data/lib/libv8/v8/src/debug-agent.cc +447 -0
  341. data/lib/libv8/v8/src/debug-agent.h +129 -0
  342. data/lib/libv8/v8/src/debug-debugger.js +2569 -0
  343. data/lib/libv8/v8/src/debug.cc +3165 -0
  344. data/lib/libv8/v8/src/debug.h +1057 -0
  345. data/lib/libv8/v8/src/deoptimizer.cc +1256 -0
  346. data/lib/libv8/v8/src/deoptimizer.h +602 -0
  347. data/lib/libv8/v8/src/disasm.h +80 -0
  348. data/lib/libv8/v8/src/disassembler.cc +343 -0
  349. data/lib/libv8/v8/src/disassembler.h +58 -0
  350. data/lib/libv8/v8/src/diy-fp.cc +58 -0
  351. data/lib/libv8/v8/src/diy-fp.h +117 -0
  352. data/lib/libv8/v8/src/double.h +238 -0
  353. data/lib/libv8/v8/src/dtoa.cc +103 -0
  354. data/lib/libv8/v8/src/dtoa.h +85 -0
  355. data/lib/libv8/v8/src/execution.cc +849 -0
  356. data/lib/libv8/v8/src/execution.h +297 -0
  357. data/lib/libv8/v8/src/extensions/experimental/break-iterator.cc +250 -0
  358. data/lib/libv8/v8/src/extensions/experimental/break-iterator.h +89 -0
  359. data/lib/libv8/v8/src/extensions/experimental/collator.cc +218 -0
  360. data/lib/libv8/v8/src/extensions/experimental/collator.h +69 -0
  361. data/lib/libv8/v8/src/extensions/experimental/experimental.gyp +94 -0
  362. data/lib/libv8/v8/src/extensions/experimental/i18n-extension.cc +78 -0
  363. data/lib/libv8/v8/src/extensions/experimental/i18n-extension.h +54 -0
  364. data/lib/libv8/v8/src/extensions/experimental/i18n-locale.cc +112 -0
  365. data/lib/libv8/v8/src/extensions/experimental/i18n-locale.h +60 -0
  366. data/lib/libv8/v8/src/extensions/experimental/i18n-utils.cc +43 -0
  367. data/lib/libv8/v8/src/extensions/experimental/i18n-utils.h +49 -0
  368. data/lib/libv8/v8/src/extensions/experimental/i18n.js +180 -0
  369. data/lib/libv8/v8/src/extensions/experimental/language-matcher.cc +251 -0
  370. data/lib/libv8/v8/src/extensions/experimental/language-matcher.h +95 -0
  371. data/lib/libv8/v8/src/extensions/externalize-string-extension.cc +141 -0
  372. data/lib/libv8/v8/src/extensions/externalize-string-extension.h +50 -0
  373. data/lib/libv8/v8/src/extensions/gc-extension.cc +58 -0
  374. data/lib/libv8/v8/src/extensions/gc-extension.h +49 -0
  375. data/lib/libv8/v8/src/factory.cc +1222 -0
  376. data/lib/libv8/v8/src/factory.h +442 -0
  377. data/lib/libv8/v8/src/fast-dtoa.cc +736 -0
  378. data/lib/libv8/v8/src/fast-dtoa.h +83 -0
  379. data/lib/libv8/v8/src/fixed-dtoa.cc +405 -0
  380. data/lib/libv8/v8/src/fixed-dtoa.h +55 -0
  381. data/lib/libv8/v8/src/flag-definitions.h +560 -0
  382. data/lib/libv8/v8/src/flags.cc +551 -0
  383. data/lib/libv8/v8/src/flags.h +79 -0
  384. data/lib/libv8/v8/src/frames-inl.h +247 -0
  385. data/lib/libv8/v8/src/frames.cc +1243 -0
  386. data/lib/libv8/v8/src/frames.h +870 -0
  387. data/lib/libv8/v8/src/full-codegen.cc +1374 -0
  388. data/lib/libv8/v8/src/full-codegen.h +771 -0
  389. data/lib/libv8/v8/src/func-name-inferrer.cc +92 -0
  390. data/lib/libv8/v8/src/func-name-inferrer.h +111 -0
  391. data/lib/libv8/v8/src/gdb-jit.cc +1555 -0
  392. data/lib/libv8/v8/src/gdb-jit.h +143 -0
  393. data/lib/libv8/v8/src/global-handles.cc +665 -0
  394. data/lib/libv8/v8/src/global-handles.h +284 -0
  395. data/lib/libv8/v8/src/globals.h +325 -0
  396. data/lib/libv8/v8/src/handles-inl.h +177 -0
  397. data/lib/libv8/v8/src/handles.cc +987 -0
  398. data/lib/libv8/v8/src/handles.h +382 -0
  399. data/lib/libv8/v8/src/hashmap.cc +230 -0
  400. data/lib/libv8/v8/src/hashmap.h +123 -0
  401. data/lib/libv8/v8/src/heap-inl.h +704 -0
  402. data/lib/libv8/v8/src/heap-profiler.cc +1173 -0
  403. data/lib/libv8/v8/src/heap-profiler.h +397 -0
  404. data/lib/libv8/v8/src/heap.cc +5930 -0
  405. data/lib/libv8/v8/src/heap.h +2268 -0
  406. data/lib/libv8/v8/src/hydrogen-instructions.cc +1769 -0
  407. data/lib/libv8/v8/src/hydrogen-instructions.h +3971 -0
  408. data/lib/libv8/v8/src/hydrogen.cc +6239 -0
  409. data/lib/libv8/v8/src/hydrogen.h +1202 -0
  410. data/lib/libv8/v8/src/ia32/assembler-ia32-inl.h +446 -0
  411. data/lib/libv8/v8/src/ia32/assembler-ia32.cc +2487 -0
  412. data/lib/libv8/v8/src/ia32/assembler-ia32.h +1144 -0
  413. data/lib/libv8/v8/src/ia32/builtins-ia32.cc +1621 -0
  414. data/lib/libv8/v8/src/ia32/code-stubs-ia32.cc +6198 -0
  415. data/lib/libv8/v8/src/ia32/code-stubs-ia32.h +517 -0
  416. data/lib/libv8/v8/src/ia32/codegen-ia32.cc +265 -0
  417. data/lib/libv8/v8/src/ia32/codegen-ia32.h +79 -0
  418. data/lib/libv8/v8/src/ia32/cpu-ia32.cc +88 -0
  419. data/lib/libv8/v8/src/ia32/debug-ia32.cc +312 -0
  420. data/lib/libv8/v8/src/ia32/deoptimizer-ia32.cc +774 -0
  421. data/lib/libv8/v8/src/ia32/disasm-ia32.cc +1628 -0
  422. data/lib/libv8/v8/src/ia32/frames-ia32.cc +45 -0
  423. data/lib/libv8/v8/src/ia32/frames-ia32.h +142 -0
  424. data/lib/libv8/v8/src/ia32/full-codegen-ia32.cc +4338 -0
  425. data/lib/libv8/v8/src/ia32/ic-ia32.cc +1597 -0
  426. data/lib/libv8/v8/src/ia32/lithium-codegen-ia32.cc +4461 -0
  427. data/lib/libv8/v8/src/ia32/lithium-codegen-ia32.h +375 -0
  428. data/lib/libv8/v8/src/ia32/lithium-gap-resolver-ia32.cc +475 -0
  429. data/lib/libv8/v8/src/ia32/lithium-gap-resolver-ia32.h +110 -0
  430. data/lib/libv8/v8/src/ia32/lithium-ia32.cc +2261 -0
  431. data/lib/libv8/v8/src/ia32/lithium-ia32.h +2396 -0
  432. data/lib/libv8/v8/src/ia32/macro-assembler-ia32.cc +2136 -0
  433. data/lib/libv8/v8/src/ia32/macro-assembler-ia32.h +775 -0
  434. data/lib/libv8/v8/src/ia32/regexp-macro-assembler-ia32.cc +1263 -0
  435. data/lib/libv8/v8/src/ia32/regexp-macro-assembler-ia32.h +216 -0
  436. data/lib/libv8/v8/src/ia32/simulator-ia32.cc +30 -0
  437. data/lib/libv8/v8/src/ia32/simulator-ia32.h +74 -0
  438. data/lib/libv8/v8/src/ia32/stub-cache-ia32.cc +3847 -0
  439. data/lib/libv8/v8/src/ic-inl.h +130 -0
  440. data/lib/libv8/v8/src/ic.cc +2577 -0
  441. data/lib/libv8/v8/src/ic.h +736 -0
  442. data/lib/libv8/v8/src/inspector.cc +63 -0
  443. data/lib/libv8/v8/src/inspector.h +62 -0
  444. data/lib/libv8/v8/src/interpreter-irregexp.cc +659 -0
  445. data/lib/libv8/v8/src/interpreter-irregexp.h +49 -0
  446. data/lib/libv8/v8/src/isolate-inl.h +50 -0
  447. data/lib/libv8/v8/src/isolate.cc +1869 -0
  448. data/lib/libv8/v8/src/isolate.h +1382 -0
  449. data/lib/libv8/v8/src/json-parser.cc +504 -0
  450. data/lib/libv8/v8/src/json-parser.h +161 -0
  451. data/lib/libv8/v8/src/json.js +342 -0
  452. data/lib/libv8/v8/src/jsregexp.cc +5385 -0
  453. data/lib/libv8/v8/src/jsregexp.h +1492 -0
  454. data/lib/libv8/v8/src/list-inl.h +212 -0
  455. data/lib/libv8/v8/src/list.h +174 -0
  456. data/lib/libv8/v8/src/lithium-allocator-inl.h +142 -0
  457. data/lib/libv8/v8/src/lithium-allocator.cc +2123 -0
  458. data/lib/libv8/v8/src/lithium-allocator.h +630 -0
  459. data/lib/libv8/v8/src/lithium.cc +190 -0
  460. data/lib/libv8/v8/src/lithium.h +597 -0
  461. data/lib/libv8/v8/src/liveedit-debugger.js +1082 -0
  462. data/lib/libv8/v8/src/liveedit.cc +1691 -0
  463. data/lib/libv8/v8/src/liveedit.h +180 -0
  464. data/lib/libv8/v8/src/liveobjectlist-inl.h +126 -0
  465. data/lib/libv8/v8/src/liveobjectlist.cc +2589 -0
  466. data/lib/libv8/v8/src/liveobjectlist.h +322 -0
  467. data/lib/libv8/v8/src/log-inl.h +59 -0
  468. data/lib/libv8/v8/src/log-utils.cc +428 -0
  469. data/lib/libv8/v8/src/log-utils.h +231 -0
  470. data/lib/libv8/v8/src/log.cc +1993 -0
  471. data/lib/libv8/v8/src/log.h +476 -0
  472. data/lib/libv8/v8/src/macro-assembler.h +120 -0
  473. data/lib/libv8/v8/src/macros.py +178 -0
  474. data/lib/libv8/v8/src/mark-compact.cc +3143 -0
  475. data/lib/libv8/v8/src/mark-compact.h +506 -0
  476. data/lib/libv8/v8/src/math.js +264 -0
  477. data/lib/libv8/v8/src/messages.cc +179 -0
  478. data/lib/libv8/v8/src/messages.h +113 -0
  479. data/lib/libv8/v8/src/messages.js +1096 -0
  480. data/lib/libv8/v8/src/mips/assembler-mips-inl.h +312 -0
  481. data/lib/libv8/v8/src/mips/assembler-mips.cc +1960 -0
  482. data/lib/libv8/v8/src/mips/assembler-mips.h +1138 -0
  483. data/lib/libv8/v8/src/mips/builtins-mips.cc +1628 -0
  484. data/lib/libv8/v8/src/mips/code-stubs-mips.cc +6656 -0
  485. data/lib/libv8/v8/src/mips/code-stubs-mips.h +682 -0
  486. data/lib/libv8/v8/src/mips/codegen-mips.cc +52 -0
  487. data/lib/libv8/v8/src/mips/codegen-mips.h +98 -0
  488. data/lib/libv8/v8/src/mips/constants-mips.cc +352 -0
  489. data/lib/libv8/v8/src/mips/constants-mips.h +739 -0
  490. data/lib/libv8/v8/src/mips/cpu-mips.cc +96 -0
  491. data/lib/libv8/v8/src/mips/debug-mips.cc +308 -0
  492. data/lib/libv8/v8/src/mips/deoptimizer-mips.cc +91 -0
  493. data/lib/libv8/v8/src/mips/disasm-mips.cc +1050 -0
  494. data/lib/libv8/v8/src/mips/frames-mips.cc +47 -0
  495. data/lib/libv8/v8/src/mips/frames-mips.h +219 -0
  496. data/lib/libv8/v8/src/mips/full-codegen-mips.cc +4388 -0
  497. data/lib/libv8/v8/src/mips/ic-mips.cc +1580 -0
  498. data/lib/libv8/v8/src/mips/lithium-codegen-mips.h +65 -0
  499. data/lib/libv8/v8/src/mips/lithium-mips.h +307 -0
  500. data/lib/libv8/v8/src/mips/macro-assembler-mips.cc +4056 -0
  501. data/lib/libv8/v8/src/mips/macro-assembler-mips.h +1214 -0
  502. data/lib/libv8/v8/src/mips/regexp-macro-assembler-mips.cc +1251 -0
  503. data/lib/libv8/v8/src/mips/regexp-macro-assembler-mips.h +252 -0
  504. data/lib/libv8/v8/src/mips/simulator-mips.cc +2621 -0
  505. data/lib/libv8/v8/src/mips/simulator-mips.h +401 -0
  506. data/lib/libv8/v8/src/mips/stub-cache-mips.cc +4285 -0
  507. data/lib/libv8/v8/src/mirror-debugger.js +2382 -0
  508. data/lib/libv8/v8/src/mksnapshot.cc +328 -0
  509. data/lib/libv8/v8/src/natives.h +64 -0
  510. data/lib/libv8/v8/src/objects-debug.cc +738 -0
  511. data/lib/libv8/v8/src/objects-inl.h +4323 -0
  512. data/lib/libv8/v8/src/objects-printer.cc +829 -0
  513. data/lib/libv8/v8/src/objects-visiting.cc +148 -0
  514. data/lib/libv8/v8/src/objects-visiting.h +424 -0
  515. data/lib/libv8/v8/src/objects.cc +10585 -0
  516. data/lib/libv8/v8/src/objects.h +6838 -0
  517. data/lib/libv8/v8/src/parser.cc +4997 -0
  518. data/lib/libv8/v8/src/parser.h +765 -0
  519. data/lib/libv8/v8/src/platform-cygwin.cc +779 -0
  520. data/lib/libv8/v8/src/platform-freebsd.cc +826 -0
  521. data/lib/libv8/v8/src/platform-linux.cc +1149 -0
  522. data/lib/libv8/v8/src/platform-macos.cc +830 -0
  523. data/lib/libv8/v8/src/platform-nullos.cc +479 -0
  524. data/lib/libv8/v8/src/platform-openbsd.cc +640 -0
  525. data/lib/libv8/v8/src/platform-posix.cc +424 -0
  526. data/lib/libv8/v8/src/platform-solaris.cc +762 -0
  527. data/lib/libv8/v8/src/platform-tls-mac.h +62 -0
  528. data/lib/libv8/v8/src/platform-tls-win32.h +62 -0
  529. data/lib/libv8/v8/src/platform-tls.h +50 -0
  530. data/lib/libv8/v8/src/platform-win32.cc +2021 -0
  531. data/lib/libv8/v8/src/platform.h +667 -0
  532. data/lib/libv8/v8/src/preparse-data-format.h +62 -0
  533. data/lib/libv8/v8/src/preparse-data.cc +183 -0
  534. data/lib/libv8/v8/src/preparse-data.h +225 -0
  535. data/lib/libv8/v8/src/preparser-api.cc +220 -0
  536. data/lib/libv8/v8/src/preparser.cc +1450 -0
  537. data/lib/libv8/v8/src/preparser.h +493 -0
  538. data/lib/libv8/v8/src/prettyprinter.cc +1493 -0
  539. data/lib/libv8/v8/src/prettyprinter.h +223 -0
  540. data/lib/libv8/v8/src/profile-generator-inl.h +128 -0
  541. data/lib/libv8/v8/src/profile-generator.cc +3098 -0
  542. data/lib/libv8/v8/src/profile-generator.h +1126 -0
  543. data/lib/libv8/v8/src/property.cc +105 -0
  544. data/lib/libv8/v8/src/property.h +365 -0
  545. data/lib/libv8/v8/src/proxy.js +83 -0
  546. data/lib/libv8/v8/src/regexp-macro-assembler-irregexp-inl.h +78 -0
  547. data/lib/libv8/v8/src/regexp-macro-assembler-irregexp.cc +471 -0
  548. data/lib/libv8/v8/src/regexp-macro-assembler-irregexp.h +142 -0
  549. data/lib/libv8/v8/src/regexp-macro-assembler-tracer.cc +373 -0
  550. data/lib/libv8/v8/src/regexp-macro-assembler-tracer.h +104 -0
  551. data/lib/libv8/v8/src/regexp-macro-assembler.cc +267 -0
  552. data/lib/libv8/v8/src/regexp-macro-assembler.h +243 -0
  553. data/lib/libv8/v8/src/regexp-stack.cc +111 -0
  554. data/lib/libv8/v8/src/regexp-stack.h +147 -0
  555. data/lib/libv8/v8/src/regexp.js +483 -0
  556. data/lib/libv8/v8/src/rewriter.cc +360 -0
  557. data/lib/libv8/v8/src/rewriter.h +50 -0
  558. data/lib/libv8/v8/src/runtime-profiler.cc +489 -0
  559. data/lib/libv8/v8/src/runtime-profiler.h +201 -0
  560. data/lib/libv8/v8/src/runtime.cc +12227 -0
  561. data/lib/libv8/v8/src/runtime.h +652 -0
  562. data/lib/libv8/v8/src/runtime.js +649 -0
  563. data/lib/libv8/v8/src/safepoint-table.cc +256 -0
  564. data/lib/libv8/v8/src/safepoint-table.h +270 -0
  565. data/lib/libv8/v8/src/scanner-base.cc +952 -0
  566. data/lib/libv8/v8/src/scanner-base.h +670 -0
  567. data/lib/libv8/v8/src/scanner.cc +345 -0
  568. data/lib/libv8/v8/src/scanner.h +146 -0
  569. data/lib/libv8/v8/src/scopeinfo.cc +646 -0
  570. data/lib/libv8/v8/src/scopeinfo.h +254 -0
  571. data/lib/libv8/v8/src/scopes.cc +1150 -0
  572. data/lib/libv8/v8/src/scopes.h +507 -0
  573. data/lib/libv8/v8/src/serialize.cc +1574 -0
  574. data/lib/libv8/v8/src/serialize.h +589 -0
  575. data/lib/libv8/v8/src/shell.h +55 -0
  576. data/lib/libv8/v8/src/simulator.h +43 -0
  577. data/lib/libv8/v8/src/small-pointer-list.h +163 -0
  578. data/lib/libv8/v8/src/smart-pointer.h +109 -0
  579. data/lib/libv8/v8/src/snapshot-common.cc +83 -0
  580. data/lib/libv8/v8/src/snapshot-empty.cc +54 -0
  581. data/lib/libv8/v8/src/snapshot.h +91 -0
  582. data/lib/libv8/v8/src/spaces-inl.h +529 -0
  583. data/lib/libv8/v8/src/spaces.cc +3145 -0
  584. data/lib/libv8/v8/src/spaces.h +2369 -0
  585. data/lib/libv8/v8/src/splay-tree-inl.h +310 -0
  586. data/lib/libv8/v8/src/splay-tree.h +205 -0
  587. data/lib/libv8/v8/src/string-search.cc +41 -0
  588. data/lib/libv8/v8/src/string-search.h +568 -0
  589. data/lib/libv8/v8/src/string-stream.cc +592 -0
  590. data/lib/libv8/v8/src/string-stream.h +191 -0
  591. data/lib/libv8/v8/src/string.js +994 -0
  592. data/lib/libv8/v8/src/strtod.cc +440 -0
  593. data/lib/libv8/v8/src/strtod.h +40 -0
  594. data/lib/libv8/v8/src/stub-cache.cc +1965 -0
  595. data/lib/libv8/v8/src/stub-cache.h +924 -0
  596. data/lib/libv8/v8/src/third_party/valgrind/valgrind.h +3925 -0
  597. data/lib/libv8/v8/src/token.cc +63 -0
  598. data/lib/libv8/v8/src/token.h +288 -0
  599. data/lib/libv8/v8/src/type-info.cc +507 -0
  600. data/lib/libv8/v8/src/type-info.h +272 -0
  601. data/lib/libv8/v8/src/unbound-queue-inl.h +95 -0
  602. data/lib/libv8/v8/src/unbound-queue.h +69 -0
  603. data/lib/libv8/v8/src/unicode-inl.h +238 -0
  604. data/lib/libv8/v8/src/unicode.cc +1624 -0
  605. data/lib/libv8/v8/src/unicode.h +280 -0
  606. data/lib/libv8/v8/src/uri.js +408 -0
  607. data/lib/libv8/v8/src/utils-inl.h +48 -0
  608. data/lib/libv8/v8/src/utils.cc +371 -0
  609. data/lib/libv8/v8/src/utils.h +800 -0
  610. data/lib/libv8/v8/src/v8-counters.cc +62 -0
  611. data/lib/libv8/v8/src/v8-counters.h +314 -0
  612. data/lib/libv8/v8/src/v8.cc +213 -0
  613. data/lib/libv8/v8/src/v8.h +131 -0
  614. data/lib/libv8/v8/src/v8checks.h +64 -0
  615. data/lib/libv8/v8/src/v8dll-main.cc +44 -0
  616. data/lib/libv8/v8/src/v8globals.h +512 -0
  617. data/lib/libv8/v8/src/v8memory.h +82 -0
  618. data/lib/libv8/v8/src/v8natives.js +1310 -0
  619. data/lib/libv8/v8/src/v8preparserdll-main.cc +39 -0
  620. data/lib/libv8/v8/src/v8threads.cc +464 -0
  621. data/lib/libv8/v8/src/v8threads.h +165 -0
  622. data/lib/libv8/v8/src/v8utils.h +319 -0
  623. data/lib/libv8/v8/src/variables.cc +114 -0
  624. data/lib/libv8/v8/src/variables.h +167 -0
  625. data/lib/libv8/v8/src/version.cc +116 -0
  626. data/lib/libv8/v8/src/version.h +68 -0
  627. data/lib/libv8/v8/src/vm-state-inl.h +138 -0
  628. data/lib/libv8/v8/src/vm-state.h +71 -0
  629. data/lib/libv8/v8/src/win32-headers.h +96 -0
  630. data/lib/libv8/v8/src/x64/assembler-x64-inl.h +462 -0
  631. data/lib/libv8/v8/src/x64/assembler-x64.cc +3027 -0
  632. data/lib/libv8/v8/src/x64/assembler-x64.h +1633 -0
  633. data/lib/libv8/v8/src/x64/builtins-x64.cc +1520 -0
  634. data/lib/libv8/v8/src/x64/code-stubs-x64.cc +5132 -0
  635. data/lib/libv8/v8/src/x64/code-stubs-x64.h +514 -0
  636. data/lib/libv8/v8/src/x64/codegen-x64.cc +146 -0
  637. data/lib/libv8/v8/src/x64/codegen-x64.h +76 -0
  638. data/lib/libv8/v8/src/x64/cpu-x64.cc +88 -0
  639. data/lib/libv8/v8/src/x64/debug-x64.cc +319 -0
  640. data/lib/libv8/v8/src/x64/deoptimizer-x64.cc +815 -0
  641. data/lib/libv8/v8/src/x64/disasm-x64.cc +1832 -0
  642. data/lib/libv8/v8/src/x64/frames-x64.cc +45 -0
  643. data/lib/libv8/v8/src/x64/frames-x64.h +130 -0
  644. data/lib/libv8/v8/src/x64/full-codegen-x64.cc +4318 -0
  645. data/lib/libv8/v8/src/x64/ic-x64.cc +1608 -0
  646. data/lib/libv8/v8/src/x64/lithium-codegen-x64.cc +4267 -0
  647. data/lib/libv8/v8/src/x64/lithium-codegen-x64.h +367 -0
  648. data/lib/libv8/v8/src/x64/lithium-gap-resolver-x64.cc +320 -0
  649. data/lib/libv8/v8/src/x64/lithium-gap-resolver-x64.h +74 -0
  650. data/lib/libv8/v8/src/x64/lithium-x64.cc +2202 -0
  651. data/lib/libv8/v8/src/x64/lithium-x64.h +2333 -0
  652. data/lib/libv8/v8/src/x64/macro-assembler-x64.cc +3745 -0
  653. data/lib/libv8/v8/src/x64/macro-assembler-x64.h +1290 -0
  654. data/lib/libv8/v8/src/x64/regexp-macro-assembler-x64.cc +1398 -0
  655. data/lib/libv8/v8/src/x64/regexp-macro-assembler-x64.h +282 -0
  656. data/lib/libv8/v8/src/x64/simulator-x64.cc +27 -0
  657. data/lib/libv8/v8/src/x64/simulator-x64.h +72 -0
  658. data/lib/libv8/v8/src/x64/stub-cache-x64.cc +3610 -0
  659. data/lib/libv8/v8/src/zone-inl.h +140 -0
  660. data/lib/libv8/v8/src/zone.cc +196 -0
  661. data/lib/libv8/v8/src/zone.h +240 -0
  662. data/lib/libv8/v8/tools/codemap.js +265 -0
  663. data/lib/libv8/v8/tools/consarray.js +93 -0
  664. data/lib/libv8/v8/tools/csvparser.js +78 -0
  665. data/lib/libv8/v8/tools/disasm.py +92 -0
  666. data/lib/libv8/v8/tools/freebsd-tick-processor +10 -0
  667. data/lib/libv8/v8/tools/gc-nvp-trace-processor.py +342 -0
  668. data/lib/libv8/v8/tools/gcmole/README +62 -0
  669. data/lib/libv8/v8/tools/gcmole/gccause.lua +60 -0
  670. data/lib/libv8/v8/tools/gcmole/gcmole.cc +1261 -0
  671. data/lib/libv8/v8/tools/gcmole/gcmole.lua +378 -0
  672. data/lib/libv8/v8/tools/generate-ten-powers.scm +286 -0
  673. data/lib/libv8/v8/tools/grokdump.py +841 -0
  674. data/lib/libv8/v8/tools/gyp/v8.gyp +995 -0
  675. data/lib/libv8/v8/tools/js2c.py +364 -0
  676. data/lib/libv8/v8/tools/jsmin.py +280 -0
  677. data/lib/libv8/v8/tools/linux-tick-processor +35 -0
  678. data/lib/libv8/v8/tools/ll_prof.py +942 -0
  679. data/lib/libv8/v8/tools/logreader.js +185 -0
  680. data/lib/libv8/v8/tools/mac-nm +18 -0
  681. data/lib/libv8/v8/tools/mac-tick-processor +6 -0
  682. data/lib/libv8/v8/tools/oom_dump/README +31 -0
  683. data/lib/libv8/v8/tools/oom_dump/SConstruct +42 -0
  684. data/lib/libv8/v8/tools/oom_dump/oom_dump.cc +288 -0
  685. data/lib/libv8/v8/tools/presubmit.py +305 -0
  686. data/lib/libv8/v8/tools/process-heap-prof.py +120 -0
  687. data/lib/libv8/v8/tools/profile.js +751 -0
  688. data/lib/libv8/v8/tools/profile_view.js +219 -0
  689. data/lib/libv8/v8/tools/run-valgrind.py +77 -0
  690. data/lib/libv8/v8/tools/splaytree.js +316 -0
  691. data/lib/libv8/v8/tools/stats-viewer.py +468 -0
  692. data/lib/libv8/v8/tools/test.py +1510 -0
  693. data/lib/libv8/v8/tools/tickprocessor-driver.js +59 -0
  694. data/lib/libv8/v8/tools/tickprocessor.js +877 -0
  695. data/lib/libv8/v8/tools/utils.py +96 -0
  696. data/lib/libv8/v8/tools/visual_studio/README.txt +12 -0
  697. data/lib/libv8/v8/tools/windows-tick-processor.bat +30 -0
  698. data/lib/libv8/version.rb +4 -0
  699. data/libv8.gemspec +31 -0
  700. metadata +800 -0
@@ -0,0 +1,50 @@
1
+ #
2
+ # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 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
+
24
+ __revision__ = "src/engine/SCons/Tool/mssdk.py 5134 2010/08/16 23:02:40 bdeegan"
25
+
26
+ """engine.SCons.Tool.mssdk
27
+
28
+ Tool-specific initialization for Microsoft SDKs, both Platform
29
+ SDKs and Windows SDKs.
30
+
31
+ There normally shouldn't be any need to import this module directly.
32
+ It will usually be imported through the generic SCons.Tool.Tool()
33
+ selection method.
34
+ """
35
+
36
+ from MSCommon import mssdk_exists, \
37
+ mssdk_setup_env
38
+
39
+ def generate(env):
40
+ """Add construction variables for an MS SDK to an Environment."""
41
+ mssdk_setup_env(env)
42
+
43
+ def exists(env):
44
+ return mssdk_exists()
45
+
46
+ # Local Variables:
47
+ # tab-width:4
48
+ # indent-tabs-mode:nil
49
+ # End:
50
+ # vim: set expandtab tabstop=4 shiftwidth=4:
@@ -0,0 +1,268 @@
1
+ """engine.SCons.Tool.msvc
2
+
3
+ Tool-specific initialization for Microsoft Visual C/C++.
4
+
5
+ There normally shouldn't be any need to import this module directly.
6
+ It will usually be imported through the generic SCons.Tool.Tool()
7
+ selection method.
8
+
9
+ """
10
+
11
+ #
12
+ # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation
13
+ #
14
+ # Permission is hereby granted, free of charge, to any person obtaining
15
+ # a copy of this software and associated documentation files (the
16
+ # "Software"), to deal in the Software without restriction, including
17
+ # without limitation the rights to use, copy, modify, merge, publish,
18
+ # distribute, sublicense, and/or sell copies of the Software, and to
19
+ # permit persons to whom the Software is furnished to do so, subject to
20
+ # the following conditions:
21
+ #
22
+ # The above copyright notice and this permission notice shall be included
23
+ # in all copies or substantial portions of the Software.
24
+ #
25
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
26
+ # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
27
+ # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
28
+ # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
29
+ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
30
+ # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
31
+ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
32
+ #
33
+
34
+ __revision__ = "src/engine/SCons/Tool/msvc.py 5134 2010/08/16 23:02:40 bdeegan"
35
+
36
+ import os.path
37
+ import re
38
+ import sys
39
+
40
+ import SCons.Action
41
+ import SCons.Builder
42
+ import SCons.Errors
43
+ import SCons.Platform.win32
44
+ import SCons.Tool
45
+ import SCons.Tool.msvs
46
+ import SCons.Util
47
+ import SCons.Warnings
48
+ import SCons.Scanner.RC
49
+
50
+ from MSCommon import msvc_exists, msvc_setup_env_once
51
+
52
+ CSuffixes = ['.c', '.C']
53
+ CXXSuffixes = ['.cc', '.cpp', '.cxx', '.c++', '.C++']
54
+
55
+ def validate_vars(env):
56
+ """Validate the PCH and PCHSTOP construction variables."""
57
+ if 'PCH' in env and env['PCH']:
58
+ if 'PCHSTOP' not in env:
59
+ raise SCons.Errors.UserError("The PCHSTOP construction must be defined if PCH is defined.")
60
+ if not SCons.Util.is_String(env['PCHSTOP']):
61
+ raise SCons.Errors.UserError("The PCHSTOP construction variable must be a string: %r"%env['PCHSTOP'])
62
+
63
+ def pch_emitter(target, source, env):
64
+ """Adds the object file target."""
65
+
66
+ validate_vars(env)
67
+
68
+ pch = None
69
+ obj = None
70
+
71
+ for t in target:
72
+ if SCons.Util.splitext(str(t))[1] == '.pch':
73
+ pch = t
74
+ if SCons.Util.splitext(str(t))[1] == '.obj':
75
+ obj = t
76
+
77
+ if not obj:
78
+ obj = SCons.Util.splitext(str(pch))[0]+'.obj'
79
+
80
+ target = [pch, obj] # pch must be first, and obj second for the PCHCOM to work
81
+
82
+ return (target, source)
83
+
84
+ def object_emitter(target, source, env, parent_emitter):
85
+ """Sets up the PCH dependencies for an object file."""
86
+
87
+ validate_vars(env)
88
+
89
+ parent_emitter(target, source, env)
90
+
91
+ # Add a dependency, but only if the target (e.g. 'Source1.obj')
92
+ # doesn't correspond to the pre-compiled header ('Source1.pch').
93
+ # If the basenames match, then this was most likely caused by
94
+ # someone adding the source file to both the env.PCH() and the
95
+ # env.Program() calls, and adding the explicit dependency would
96
+ # cause a cycle on the .pch file itself.
97
+ #
98
+ # See issue #2505 for a discussion of what to do if it turns
99
+ # out this assumption causes trouble in the wild:
100
+ # http://scons.tigris.org/issues/show_bug.cgi?id=2505
101
+ if 'PCH' in env:
102
+ pch = env['PCH']
103
+ if str(target[0]) != SCons.Util.splitext(str(pch))[0] + '.obj':
104
+ env.Depends(target, pch)
105
+
106
+ return (target, source)
107
+
108
+ def static_object_emitter(target, source, env):
109
+ return object_emitter(target, source, env,
110
+ SCons.Defaults.StaticObjectEmitter)
111
+
112
+ def shared_object_emitter(target, source, env):
113
+ return object_emitter(target, source, env,
114
+ SCons.Defaults.SharedObjectEmitter)
115
+
116
+ pch_action = SCons.Action.Action('$PCHCOM', '$PCHCOMSTR')
117
+ pch_builder = SCons.Builder.Builder(action=pch_action, suffix='.pch',
118
+ emitter=pch_emitter,
119
+ source_scanner=SCons.Tool.SourceFileScanner)
120
+
121
+
122
+ # Logic to build .rc files into .res files (resource files)
123
+ res_scanner = SCons.Scanner.RC.RCScan()
124
+ res_action = SCons.Action.Action('$RCCOM', '$RCCOMSTR')
125
+ res_builder = SCons.Builder.Builder(action=res_action,
126
+ src_suffix='.rc',
127
+ suffix='.res',
128
+ src_builder=[],
129
+ source_scanner=res_scanner)
130
+
131
+ def msvc_batch_key(action, env, target, source):
132
+ """
133
+ Returns a key to identify unique batches of sources for compilation.
134
+
135
+ If batching is enabled (via the $MSVC_BATCH setting), then all
136
+ target+source pairs that use the same action, defined by the same
137
+ environment, and have the same target and source directories, will
138
+ be batched.
139
+
140
+ Returning None specifies that the specified target+source should not
141
+ be batched with other compilations.
142
+ """
143
+ b = env.subst('$MSVC_BATCH')
144
+ if b in (None, '', '0'):
145
+ # We're not using batching; return no key.
146
+ return None
147
+ t = target[0]
148
+ s = source[0]
149
+ if os.path.splitext(t.name)[0] != os.path.splitext(s.name)[0]:
150
+ # The base names are different, so this *must* be compiled
151
+ # separately; return no key.
152
+ return None
153
+ return (id(action), id(env), t.dir, s.dir)
154
+
155
+ def msvc_output_flag(target, source, env, for_signature):
156
+ """
157
+ Returns the correct /Fo flag for batching.
158
+
159
+ If batching is disabled or there's only one source file, then we
160
+ return an /Fo string that specifies the target explicitly. Otherwise,
161
+ we return an /Fo string that just specifies the first target's
162
+ directory (where the Visual C/C++ compiler will put the .obj files).
163
+ """
164
+ b = env.subst('$MSVC_BATCH')
165
+ if b in (None, '', '0') or len(source) == 1:
166
+ return '/Fo$TARGET'
167
+ else:
168
+ # The Visual C/C++ compiler requires a \ at the end of the /Fo
169
+ # option to indicate an output directory. We use os.sep here so
170
+ # that the test(s) for this can be run on non-Windows systems
171
+ # without having a hard-coded backslash mess up command-line
172
+ # argument parsing.
173
+ return '/Fo${TARGET.dir}' + os.sep
174
+
175
+ CAction = SCons.Action.Action("$CCCOM", "$CCCOMSTR",
176
+ batch_key=msvc_batch_key,
177
+ targets='$CHANGED_TARGETS')
178
+ ShCAction = SCons.Action.Action("$SHCCCOM", "$SHCCCOMSTR",
179
+ batch_key=msvc_batch_key,
180
+ targets='$CHANGED_TARGETS')
181
+ CXXAction = SCons.Action.Action("$CXXCOM", "$CXXCOMSTR",
182
+ batch_key=msvc_batch_key,
183
+ targets='$CHANGED_TARGETS')
184
+ ShCXXAction = SCons.Action.Action("$SHCXXCOM", "$SHCXXCOMSTR",
185
+ batch_key=msvc_batch_key,
186
+ targets='$CHANGED_TARGETS')
187
+
188
+ def generate(env):
189
+ """Add Builders and construction variables for MSVC++ to an Environment."""
190
+ static_obj, shared_obj = SCons.Tool.createObjBuilders(env)
191
+
192
+ # TODO(batch): shouldn't reach in to cmdgen this way; necessary
193
+ # for now to bypass the checks in Builder.DictCmdGenerator.__call__()
194
+ # and allow .cc and .cpp to be compiled in the same command line.
195
+ static_obj.cmdgen.source_ext_match = False
196
+ shared_obj.cmdgen.source_ext_match = False
197
+
198
+ for suffix in CSuffixes:
199
+ static_obj.add_action(suffix, CAction)
200
+ shared_obj.add_action(suffix, ShCAction)
201
+ static_obj.add_emitter(suffix, static_object_emitter)
202
+ shared_obj.add_emitter(suffix, shared_object_emitter)
203
+
204
+ for suffix in CXXSuffixes:
205
+ static_obj.add_action(suffix, CXXAction)
206
+ shared_obj.add_action(suffix, ShCXXAction)
207
+ static_obj.add_emitter(suffix, static_object_emitter)
208
+ shared_obj.add_emitter(suffix, shared_object_emitter)
209
+
210
+ env['CCPDBFLAGS'] = SCons.Util.CLVar(['${(PDB and "/Z7") or ""}'])
211
+ env['CCPCHFLAGS'] = SCons.Util.CLVar(['${(PCH and "/Yu%s /Fp%s"%(PCHSTOP or "",File(PCH))) or ""}'])
212
+ env['_MSVC_OUTPUT_FLAG'] = msvc_output_flag
213
+ env['_CCCOMCOM'] = '$CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS $CCPCHFLAGS $CCPDBFLAGS'
214
+ env['CC'] = 'cl'
215
+ env['CCFLAGS'] = SCons.Util.CLVar('/nologo')
216
+ env['CFLAGS'] = SCons.Util.CLVar('')
217
+ env['CCCOM'] = '$CC $_MSVC_OUTPUT_FLAG /c $CHANGED_SOURCES $CFLAGS $CCFLAGS $_CCCOMCOM'
218
+ env['SHCC'] = '$CC'
219
+ env['SHCCFLAGS'] = SCons.Util.CLVar('$CCFLAGS')
220
+ env['SHCFLAGS'] = SCons.Util.CLVar('$CFLAGS')
221
+ env['SHCCCOM'] = '$SHCC $_MSVC_OUTPUT_FLAG /c $CHANGED_SOURCES $SHCFLAGS $SHCCFLAGS $_CCCOMCOM'
222
+ env['CXX'] = '$CC'
223
+ env['CXXFLAGS'] = SCons.Util.CLVar('$( /TP $)')
224
+ env['CXXCOM'] = '$CXX $_MSVC_OUTPUT_FLAG /c $CHANGED_SOURCES $CXXFLAGS $CCFLAGS $_CCCOMCOM'
225
+ env['SHCXX'] = '$CXX'
226
+ env['SHCXXFLAGS'] = SCons.Util.CLVar('$CXXFLAGS')
227
+ env['SHCXXCOM'] = '$SHCXX $_MSVC_OUTPUT_FLAG /c $CHANGED_SOURCES $SHCXXFLAGS $SHCCFLAGS $_CCCOMCOM'
228
+ env['CPPDEFPREFIX'] = '/D'
229
+ env['CPPDEFSUFFIX'] = ''
230
+ env['INCPREFIX'] = '/I'
231
+ env['INCSUFFIX'] = ''
232
+ # env.Append(OBJEMITTER = [static_object_emitter])
233
+ # env.Append(SHOBJEMITTER = [shared_object_emitter])
234
+ env['STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME'] = 1
235
+
236
+ env['RC'] = 'rc'
237
+ env['RCFLAGS'] = SCons.Util.CLVar('')
238
+ env['RCSUFFIXES']=['.rc','.rc2']
239
+ env['RCCOM'] = '$RC $_CPPDEFFLAGS $_CPPINCFLAGS $RCFLAGS /fo$TARGET $SOURCES'
240
+ env['BUILDERS']['RES'] = res_builder
241
+ env['OBJPREFIX'] = ''
242
+ env['OBJSUFFIX'] = '.obj'
243
+ env['SHOBJPREFIX'] = '$OBJPREFIX'
244
+ env['SHOBJSUFFIX'] = '$OBJSUFFIX'
245
+
246
+ # Set-up ms tools paths
247
+ msvc_setup_env_once(env)
248
+
249
+ env['CFILESUFFIX'] = '.c'
250
+ env['CXXFILESUFFIX'] = '.cc'
251
+
252
+ env['PCHPDBFLAGS'] = SCons.Util.CLVar(['${(PDB and "/Yd") or ""}'])
253
+ env['PCHCOM'] = '$CXX /Fo${TARGETS[1]} $CXXFLAGS $CCFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS /c $SOURCES /Yc$PCHSTOP /Fp${TARGETS[0]} $CCPDBFLAGS $PCHPDBFLAGS'
254
+ env['BUILDERS']['PCH'] = pch_builder
255
+
256
+ if 'ENV' not in env:
257
+ env['ENV'] = {}
258
+ if 'SystemRoot' not in env['ENV']: # required for dlls in the winsxs folders
259
+ env['ENV']['SystemRoot'] = SCons.Platform.win32.get_system_root()
260
+
261
+ def exists(env):
262
+ return msvc_exists()
263
+
264
+ # Local Variables:
265
+ # tab-width:4
266
+ # indent-tabs-mode:nil
267
+ # End:
268
+ # vim: set expandtab tabstop=4 shiftwidth=4:
@@ -0,0 +1,1388 @@
1
+ """SCons.Tool.msvs
2
+
3
+ Tool-specific initialization for Microsoft Visual Studio project files.
4
+
5
+ There normally shouldn't be any need to import this module directly.
6
+ It will usually be imported through the generic SCons.Tool.Tool()
7
+ selection method.
8
+
9
+ """
10
+
11
+ #
12
+ # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation
13
+ #
14
+ # Permission is hereby granted, free of charge, to any person obtaining
15
+ # a copy of this software and associated documentation files (the
16
+ # "Software"), to deal in the Software without restriction, including
17
+ # without limitation the rights to use, copy, modify, merge, publish,
18
+ # distribute, sublicense, and/or sell copies of the Software, and to
19
+ # permit persons to whom the Software is furnished to do so, subject to
20
+ # the following conditions:
21
+ #
22
+ # The above copyright notice and this permission notice shall be included
23
+ # in all copies or substantial portions of the Software.
24
+ #
25
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
26
+ # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
27
+ # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
28
+ # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
29
+ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
30
+ # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
31
+ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
32
+
33
+ __revision__ = "src/engine/SCons/Tool/msvs.py 5134 2010/08/16 23:02:40 bdeegan"
34
+
35
+ import SCons.compat
36
+
37
+ import base64
38
+ import hashlib
39
+ import ntpath
40
+ import os
41
+ # compat layer imports "cPickle" for us if it's available.
42
+ import pickle
43
+ import re
44
+ import sys
45
+
46
+ import SCons.Builder
47
+ import SCons.Node.FS
48
+ import SCons.Platform.win32
49
+ import SCons.Script.SConscript
50
+ import SCons.Util
51
+ import SCons.Warnings
52
+
53
+ from MSCommon import msvc_exists, msvc_setup_env_once
54
+ from SCons.Defaults import processDefines
55
+
56
+ ##############################################################################
57
+ # Below here are the classes and functions for generation of
58
+ # DSP/DSW/SLN/VCPROJ files.
59
+ ##############################################################################
60
+
61
+ def xmlify(s):
62
+ s = s.replace("&", "&") # do this first
63
+ s = s.replace("'", "'")
64
+ s = s.replace('"', """)
65
+ return s
66
+
67
+ external_makefile_guid = '{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}'
68
+
69
+ def _generateGUID(slnfile, name):
70
+ """This generates a dummy GUID for the sln file to use. It is
71
+ based on the MD5 signatures of the sln filename plus the name of
72
+ the project. It basically just needs to be unique, and not
73
+ change with each invocation."""
74
+ m = hashlib.md5()
75
+ # Normalize the slnfile path to a Windows path (\ separators) so
76
+ # the generated file has a consistent GUID even if we generate
77
+ # it on a non-Windows platform.
78
+ m.update(ntpath.normpath(str(slnfile)) + str(name))
79
+ solution = m.hexdigest().upper()
80
+ # convert most of the signature to GUID form (discard the rest)
81
+ solution = "{" + solution[:8] + "-" + solution[8:12] + "-" + solution[12:16] + "-" + solution[16:20] + "-" + solution[20:32] + "}"
82
+ return solution
83
+
84
+ version_re = re.compile(r'(\d+\.\d+)(.*)')
85
+
86
+ def msvs_parse_version(s):
87
+ """
88
+ Split a Visual Studio version, which may in fact be something like
89
+ '7.0Exp', into is version number (returned as a float) and trailing
90
+ "suite" portion.
91
+ """
92
+ num, suite = version_re.match(s).groups()
93
+ return float(num), suite
94
+
95
+ # This is how we re-invoke SCons from inside MSVS Project files.
96
+ # The problem is that we might have been invoked as either scons.bat
97
+ # or scons.py. If we were invoked directly as scons.py, then we could
98
+ # use sys.argv[0] to find the SCons "executable," but that doesn't work
99
+ # if we were invoked as scons.bat, which uses "python -c" to execute
100
+ # things and ends up with "-c" as sys.argv[0]. Consequently, we have
101
+ # the MSVS Project file invoke SCons the same way that scons.bat does,
102
+ # which works regardless of how we were invoked.
103
+ def getExecScriptMain(env, xml=None):
104
+ scons_home = env.get('SCONS_HOME')
105
+ if not scons_home and 'SCONS_LIB_DIR' in os.environ:
106
+ scons_home = os.environ['SCONS_LIB_DIR']
107
+ if scons_home:
108
+ exec_script_main = "from os.path import join; import sys; sys.path = [ r'%s' ] + sys.path; import SCons.Script; SCons.Script.main()" % scons_home
109
+ else:
110
+ version = SCons.__version__
111
+ exec_script_main = "from os.path import join; import sys; sys.path = [ join(sys.prefix, 'Lib', 'site-packages', 'scons-%(version)s'), join(sys.prefix, 'scons-%(version)s'), join(sys.prefix, 'Lib', 'site-packages', 'scons'), join(sys.prefix, 'scons') ] + sys.path; import SCons.Script; SCons.Script.main()" % locals()
112
+ if xml:
113
+ exec_script_main = xmlify(exec_script_main)
114
+ return exec_script_main
115
+
116
+ # The string for the Python executable we tell the Project file to use
117
+ # is either sys.executable or, if an external PYTHON_ROOT environment
118
+ # variable exists, $(PYTHON)ROOT\\python.exe (generalized a little to
119
+ # pluck the actual executable name from sys.executable).
120
+ try:
121
+ python_root = os.environ['PYTHON_ROOT']
122
+ except KeyError:
123
+ python_executable = sys.executable
124
+ else:
125
+ python_executable = os.path.join('$$(PYTHON_ROOT)',
126
+ os.path.split(sys.executable)[1])
127
+
128
+ class Config(object):
129
+ pass
130
+
131
+ def splitFully(path):
132
+ dir, base = os.path.split(path)
133
+ if dir and dir != '' and dir != path:
134
+ return splitFully(dir)+[base]
135
+ if base == '':
136
+ return []
137
+ return [base]
138
+
139
+ def makeHierarchy(sources):
140
+ '''Break a list of files into a hierarchy; for each value, if it is a string,
141
+ then it is a file. If it is a dictionary, it is a folder. The string is
142
+ the original path of the file.'''
143
+
144
+ hierarchy = {}
145
+ for file in sources:
146
+ path = splitFully(file)
147
+ if len(path):
148
+ dict = hierarchy
149
+ for part in path[:-1]:
150
+ if part not in dict:
151
+ dict[part] = {}
152
+ dict = dict[part]
153
+ dict[path[-1]] = file
154
+ #else:
155
+ # print 'Warning: failed to decompose path for '+str(file)
156
+ return hierarchy
157
+
158
+ class _DSPGenerator(object):
159
+ """ Base class for DSP generators """
160
+
161
+ srcargs = [
162
+ 'srcs',
163
+ 'incs',
164
+ 'localincs',
165
+ 'resources',
166
+ 'misc']
167
+
168
+ def __init__(self, dspfile, source, env):
169
+ self.dspfile = str(dspfile)
170
+ try:
171
+ get_abspath = dspfile.get_abspath
172
+ except AttributeError:
173
+ self.dspabs = os.path.abspath(dspfile)
174
+ else:
175
+ self.dspabs = get_abspath()
176
+
177
+ if 'variant' not in env:
178
+ raise SCons.Errors.InternalError("You must specify a 'variant' argument (i.e. 'Debug' or " +\
179
+ "'Release') to create an MSVSProject.")
180
+ elif SCons.Util.is_String(env['variant']):
181
+ variants = [env['variant']]
182
+ elif SCons.Util.is_List(env['variant']):
183
+ variants = env['variant']
184
+
185
+ if 'buildtarget' not in env or env['buildtarget'] == None:
186
+ buildtarget = ['']
187
+ elif SCons.Util.is_String(env['buildtarget']):
188
+ buildtarget = [env['buildtarget']]
189
+ elif SCons.Util.is_List(env['buildtarget']):
190
+ if len(env['buildtarget']) != len(variants):
191
+ raise SCons.Errors.InternalError("Sizes of 'buildtarget' and 'variant' lists must be the same.")
192
+ buildtarget = []
193
+ for bt in env['buildtarget']:
194
+ if SCons.Util.is_String(bt):
195
+ buildtarget.append(bt)
196
+ else:
197
+ buildtarget.append(bt.get_abspath())
198
+ else:
199
+ buildtarget = [env['buildtarget'].get_abspath()]
200
+ if len(buildtarget) == 1:
201
+ bt = buildtarget[0]
202
+ buildtarget = []
203
+ for _ in variants:
204
+ buildtarget.append(bt)
205
+
206
+ if 'outdir' not in env or env['outdir'] == None:
207
+ outdir = ['']
208
+ elif SCons.Util.is_String(env['outdir']):
209
+ outdir = [env['outdir']]
210
+ elif SCons.Util.is_List(env['outdir']):
211
+ if len(env['outdir']) != len(variants):
212
+ raise SCons.Errors.InternalError("Sizes of 'outdir' and 'variant' lists must be the same.")
213
+ outdir = []
214
+ for s in env['outdir']:
215
+ if SCons.Util.is_String(s):
216
+ outdir.append(s)
217
+ else:
218
+ outdir.append(s.get_abspath())
219
+ else:
220
+ outdir = [env['outdir'].get_abspath()]
221
+ if len(outdir) == 1:
222
+ s = outdir[0]
223
+ outdir = []
224
+ for v in variants:
225
+ outdir.append(s)
226
+
227
+ if 'runfile' not in env or env['runfile'] == None:
228
+ runfile = buildtarget[-1:]
229
+ elif SCons.Util.is_String(env['runfile']):
230
+ runfile = [env['runfile']]
231
+ elif SCons.Util.is_List(env['runfile']):
232
+ if len(env['runfile']) != len(variants):
233
+ raise SCons.Errors.InternalError("Sizes of 'runfile' and 'variant' lists must be the same.")
234
+ runfile = []
235
+ for s in env['runfile']:
236
+ if SCons.Util.is_String(s):
237
+ runfile.append(s)
238
+ else:
239
+ runfile.append(s.get_abspath())
240
+ else:
241
+ runfile = [env['runfile'].get_abspath()]
242
+ if len(runfile) == 1:
243
+ s = runfile[0]
244
+ runfile = []
245
+ for v in variants:
246
+ runfile.append(s)
247
+
248
+ self.sconscript = env['MSVSSCONSCRIPT']
249
+
250
+ cmdargs = env.get('cmdargs', '')
251
+
252
+ self.env = env
253
+
254
+ if 'name' in self.env:
255
+ self.name = self.env['name']
256
+ else:
257
+ self.name = os.path.basename(SCons.Util.splitext(self.dspfile)[0])
258
+ self.name = self.env.subst(self.name)
259
+
260
+ sourcenames = [
261
+ 'Source Files',
262
+ 'Header Files',
263
+ 'Local Headers',
264
+ 'Resource Files',
265
+ 'Other Files']
266
+
267
+ self.sources = {}
268
+ for n in sourcenames:
269
+ self.sources[n] = []
270
+
271
+ self.configs = {}
272
+
273
+ self.nokeep = 0
274
+ if 'nokeep' in env and env['variant'] != 0:
275
+ self.nokeep = 1
276
+
277
+ if self.nokeep == 0 and os.path.exists(self.dspabs):
278
+ self.Parse()
279
+
280
+ for t in zip(sourcenames,self.srcargs):
281
+ if t[1] in self.env:
282
+ if SCons.Util.is_List(self.env[t[1]]):
283
+ for i in self.env[t[1]]:
284
+ if not i in self.sources[t[0]]:
285
+ self.sources[t[0]].append(i)
286
+ else:
287
+ if not self.env[t[1]] in self.sources[t[0]]:
288
+ self.sources[t[0]].append(self.env[t[1]])
289
+
290
+ for n in sourcenames:
291
+ #TODO 2.4: compat layer supports sorted(key=) but not sort(key=)
292
+ #TODO 2.4: self.sources[n].sort(key=lambda a: a.lower())
293
+ self.sources[n] = sorted(self.sources[n], key=lambda a: a.lower())
294
+
295
+ def AddConfig(self, variant, buildtarget, outdir, runfile, cmdargs, dspfile=dspfile):
296
+ config = Config()
297
+ config.buildtarget = buildtarget
298
+ config.outdir = outdir
299
+ config.cmdargs = cmdargs
300
+ config.runfile = runfile
301
+
302
+ match = re.match('(.*)\|(.*)', variant)
303
+ if match:
304
+ config.variant = match.group(1)
305
+ config.platform = match.group(2)
306
+ else:
307
+ config.variant = variant
308
+ config.platform = 'Win32'
309
+
310
+ self.configs[variant] = config
311
+ print "Adding '" + self.name + ' - ' + config.variant + '|' + config.platform + "' to '" + str(dspfile) + "'"
312
+
313
+ for i in range(len(variants)):
314
+ AddConfig(self, variants[i], buildtarget[i], outdir[i], runfile[i], cmdargs)
315
+
316
+ self.platforms = []
317
+ for key in self.configs.keys():
318
+ platform = self.configs[key].platform
319
+ if not platform in self.platforms:
320
+ self.platforms.append(platform)
321
+
322
+ def Build(self):
323
+ pass
324
+
325
+ V6DSPHeader = """\
326
+ # Microsoft Developer Studio Project File - Name="%(name)s" - Package Owner=<4>
327
+ # Microsoft Developer Studio Generated Build File, Format Version 6.00
328
+ # ** DO NOT EDIT **
329
+
330
+ # TARGTYPE "Win32 (x86) External Target" 0x0106
331
+
332
+ CFG=%(name)s - Win32 %(confkey)s
333
+ !MESSAGE This is not a valid makefile. To build this project using NMAKE,
334
+ !MESSAGE use the Export Makefile command and run
335
+ !MESSAGE
336
+ !MESSAGE NMAKE /f "%(name)s.mak".
337
+ !MESSAGE
338
+ !MESSAGE You can specify a configuration when running NMAKE
339
+ !MESSAGE by defining the macro CFG on the command line. For example:
340
+ !MESSAGE
341
+ !MESSAGE NMAKE /f "%(name)s.mak" CFG="%(name)s - Win32 %(confkey)s"
342
+ !MESSAGE
343
+ !MESSAGE Possible choices for configuration are:
344
+ !MESSAGE
345
+ """
346
+
347
+ class _GenerateV6DSP(_DSPGenerator):
348
+ """Generates a Project file for MSVS 6.0"""
349
+
350
+ def PrintHeader(self):
351
+ # pick a default config
352
+ confkeys = sorted(self.configs.keys())
353
+
354
+ name = self.name
355
+ confkey = confkeys[0]
356
+
357
+ self.file.write(V6DSPHeader % locals())
358
+
359
+ for kind in confkeys:
360
+ self.file.write('!MESSAGE "%s - Win32 %s" (based on "Win32 (x86) External Target")\n' % (name, kind))
361
+
362
+ self.file.write('!MESSAGE \n\n')
363
+
364
+ def PrintProject(self):
365
+ name = self.name
366
+ self.file.write('# Begin Project\n'
367
+ '# PROP AllowPerConfigDependencies 0\n'
368
+ '# PROP Scc_ProjName ""\n'
369
+ '# PROP Scc_LocalPath ""\n\n')
370
+
371
+ first = 1
372
+ confkeys = sorted(self.configs.keys())
373
+ for kind in confkeys:
374
+ outdir = self.configs[kind].outdir
375
+ buildtarget = self.configs[kind].buildtarget
376
+ if first == 1:
377
+ self.file.write('!IF "$(CFG)" == "%s - Win32 %s"\n\n' % (name, kind))
378
+ first = 0
379
+ else:
380
+ self.file.write('\n!ELSEIF "$(CFG)" == "%s - Win32 %s"\n\n' % (name, kind))
381
+
382
+ env_has_buildtarget = 'MSVSBUILDTARGET' in self.env
383
+ if not env_has_buildtarget:
384
+ self.env['MSVSBUILDTARGET'] = buildtarget
385
+
386
+ # have to write this twice, once with the BASE settings, and once without
387
+ for base in ("BASE ",""):
388
+ self.file.write('# PROP %sUse_MFC 0\n'
389
+ '# PROP %sUse_Debug_Libraries ' % (base, base))
390
+ if kind.lower().find('debug') < 0:
391
+ self.file.write('0\n')
392
+ else:
393
+ self.file.write('1\n')
394
+ self.file.write('# PROP %sOutput_Dir "%s"\n'
395
+ '# PROP %sIntermediate_Dir "%s"\n' % (base,outdir,base,outdir))
396
+ cmd = 'echo Starting SCons && ' + self.env.subst('$MSVSBUILDCOM', 1)
397
+ self.file.write('# PROP %sCmd_Line "%s"\n'
398
+ '# PROP %sRebuild_Opt "-c && %s"\n'
399
+ '# PROP %sTarget_File "%s"\n'
400
+ '# PROP %sBsc_Name ""\n'
401
+ '# PROP %sTarget_Dir ""\n'\
402
+ %(base,cmd,base,cmd,base,buildtarget,base,base))
403
+
404
+ if not env_has_buildtarget:
405
+ del self.env['MSVSBUILDTARGET']
406
+
407
+ self.file.write('\n!ENDIF\n\n'
408
+ '# Begin Target\n\n')
409
+ for kind in confkeys:
410
+ self.file.write('# Name "%s - Win32 %s"\n' % (name,kind))
411
+ self.file.write('\n')
412
+ first = 0
413
+ for kind in confkeys:
414
+ if first == 0:
415
+ self.file.write('!IF "$(CFG)" == "%s - Win32 %s"\n\n' % (name,kind))
416
+ first = 1
417
+ else:
418
+ self.file.write('!ELSEIF "$(CFG)" == "%s - Win32 %s"\n\n' % (name,kind))
419
+ self.file.write('!ENDIF \n\n')
420
+ self.PrintSourceFiles()
421
+ self.file.write('# End Target\n'
422
+ '# End Project\n')
423
+
424
+ if self.nokeep == 0:
425
+ # now we pickle some data and add it to the file -- MSDEV will ignore it.
426
+ pdata = pickle.dumps(self.configs,1)
427
+ pdata = base64.encodestring(pdata)
428
+ self.file.write(pdata + '\n')
429
+ pdata = pickle.dumps(self.sources,1)
430
+ pdata = base64.encodestring(pdata)
431
+ self.file.write(pdata + '\n')
432
+
433
+ def PrintSourceFiles(self):
434
+ categories = {'Source Files': 'cpp|c|cxx|l|y|def|odl|idl|hpj|bat',
435
+ 'Header Files': 'h|hpp|hxx|hm|inl',
436
+ 'Local Headers': 'h|hpp|hxx|hm|inl',
437
+ 'Resource Files': 'r|rc|ico|cur|bmp|dlg|rc2|rct|bin|cnt|rtf|gif|jpg|jpeg|jpe',
438
+ 'Other Files': ''}
439
+
440
+ for kind in sorted(categories.keys(), key=lambda a: a.lower()):
441
+ if not self.sources[kind]:
442
+ continue # skip empty groups
443
+
444
+ self.file.write('# Begin Group "' + kind + '"\n\n')
445
+ typelist = categories[kind].replace('|', ';')
446
+ self.file.write('# PROP Default_Filter "' + typelist + '"\n')
447
+
448
+ for file in self.sources[kind]:
449
+ file = os.path.normpath(file)
450
+ self.file.write('# Begin Source File\n\n'
451
+ 'SOURCE="' + file + '"\n'
452
+ '# End Source File\n')
453
+ self.file.write('# End Group\n')
454
+
455
+ # add the SConscript file outside of the groups
456
+ self.file.write('# Begin Source File\n\n'
457
+ 'SOURCE="' + str(self.sconscript) + '"\n'
458
+ '# End Source File\n')
459
+
460
+ def Parse(self):
461
+ try:
462
+ dspfile = open(self.dspabs,'r')
463
+ except IOError:
464
+ return # doesn't exist yet, so can't add anything to configs.
465
+
466
+ line = dspfile.readline()
467
+ while line:
468
+ if line.find("# End Project") > -1:
469
+ break
470
+ line = dspfile.readline()
471
+
472
+ line = dspfile.readline()
473
+ datas = line
474
+ while line and line != '\n':
475
+ line = dspfile.readline()
476
+ datas = datas + line
477
+
478
+ # OK, we've found our little pickled cache of data.
479
+ try:
480
+ datas = base64.decodestring(datas)
481
+ data = pickle.loads(datas)
482
+ except KeyboardInterrupt:
483
+ raise
484
+ except:
485
+ return # unable to unpickle any data for some reason
486
+
487
+ self.configs.update(data)
488
+
489
+ data = None
490
+ line = dspfile.readline()
491
+ datas = line
492
+ while line and line != '\n':
493
+ line = dspfile.readline()
494
+ datas = datas + line
495
+
496
+ # OK, we've found our little pickled cache of data.
497
+ # it has a "# " in front of it, so we strip that.
498
+ try:
499
+ datas = base64.decodestring(datas)
500
+ data = pickle.loads(datas)
501
+ except KeyboardInterrupt:
502
+ raise
503
+ except:
504
+ return # unable to unpickle any data for some reason
505
+
506
+ self.sources.update(data)
507
+
508
+ def Build(self):
509
+ try:
510
+ self.file = open(self.dspabs,'w')
511
+ except IOError, detail:
512
+ raise SCons.Errors.InternalError('Unable to open "' + self.dspabs + '" for writing:' + str(detail))
513
+ else:
514
+ self.PrintHeader()
515
+ self.PrintProject()
516
+ self.file.close()
517
+
518
+ V7DSPHeader = """\
519
+ <?xml version="1.0" encoding = "%(encoding)s"?>
520
+ <VisualStudioProject
521
+ \tProjectType="Visual C++"
522
+ \tVersion="%(versionstr)s"
523
+ \tName="%(name)s"
524
+ %(scc_attrs)s
525
+ \tKeyword="MakeFileProj">
526
+ """
527
+
528
+ V7DSPConfiguration = """\
529
+ \t\t<Configuration
530
+ \t\t\tName="%(variant)s|%(platform)s"
531
+ \t\t\tOutputDirectory="%(outdir)s"
532
+ \t\t\tIntermediateDirectory="%(outdir)s"
533
+ \t\t\tConfigurationType="0"
534
+ \t\t\tUseOfMFC="0"
535
+ \t\t\tATLMinimizesCRunTimeLibraryUsage="FALSE">
536
+ \t\t\t<Tool
537
+ \t\t\t\tName="VCNMakeTool"
538
+ \t\t\t\tBuildCommandLine="%(buildcmd)s"
539
+ \t\t\t\tCleanCommandLine="%(cleancmd)s"
540
+ \t\t\t\tRebuildCommandLine="%(rebuildcmd)s"
541
+ \t\t\t\tOutput="%(runfile)s"/>
542
+ \t\t</Configuration>
543
+ """
544
+
545
+ V8DSPHeader = """\
546
+ <?xml version="1.0" encoding="%(encoding)s"?>
547
+ <VisualStudioProject
548
+ \tProjectType="Visual C++"
549
+ \tVersion="%(versionstr)s"
550
+ \tName="%(name)s"
551
+ %(scc_attrs)s
552
+ \tRootNamespace="%(name)s"
553
+ \tKeyword="MakeFileProj">
554
+ """
555
+
556
+ V8DSPConfiguration = """\
557
+ \t\t<Configuration
558
+ \t\t\tName="%(variant)s|%(platform)s"
559
+ \t\t\tConfigurationType="0"
560
+ \t\t\tUseOfMFC="0"
561
+ \t\t\tATLMinimizesCRunTimeLibraryUsage="false"
562
+ \t\t\t>
563
+ \t\t\t<Tool
564
+ \t\t\t\tName="VCNMakeTool"
565
+ \t\t\t\tBuildCommandLine="%(buildcmd)s"
566
+ \t\t\t\tReBuildCommandLine="%(rebuildcmd)s"
567
+ \t\t\t\tCleanCommandLine="%(cleancmd)s"
568
+ \t\t\t\tOutput="%(runfile)s"
569
+ \t\t\t\tPreprocessorDefinitions="%(preprocdefs)s"
570
+ \t\t\t\tIncludeSearchPath="%(includepath)s"
571
+ \t\t\t\tForcedIncludes=""
572
+ \t\t\t\tAssemblySearchPath=""
573
+ \t\t\t\tForcedUsingAssemblies=""
574
+ \t\t\t\tCompileAsManaged=""
575
+ \t\t\t/>
576
+ \t\t</Configuration>
577
+ """
578
+ class _GenerateV7DSP(_DSPGenerator):
579
+ """Generates a Project file for MSVS .NET"""
580
+
581
+ def __init__(self, dspfile, source, env):
582
+ _DSPGenerator.__init__(self, dspfile, source, env)
583
+ self.version = env['MSVS_VERSION']
584
+ self.version_num, self.suite = msvs_parse_version(self.version)
585
+ if self.version_num >= 8.0:
586
+ self.versionstr = '8.00'
587
+ self.dspheader = V8DSPHeader
588
+ self.dspconfiguration = V8DSPConfiguration
589
+ else:
590
+ if self.version_num >= 7.1:
591
+ self.versionstr = '7.10'
592
+ else:
593
+ self.versionstr = '7.00'
594
+ self.dspheader = V7DSPHeader
595
+ self.dspconfiguration = V7DSPConfiguration
596
+ self.file = None
597
+
598
+ def PrintHeader(self):
599
+ env = self.env
600
+ versionstr = self.versionstr
601
+ name = self.name
602
+ encoding = self.env.subst('$MSVSENCODING')
603
+ scc_provider = env.get('MSVS_SCC_PROVIDER', '')
604
+ scc_project_name = env.get('MSVS_SCC_PROJECT_NAME', '')
605
+ scc_aux_path = env.get('MSVS_SCC_AUX_PATH', '')
606
+ scc_local_path = env.get('MSVS_SCC_LOCAL_PATH', '')
607
+ project_guid = env.get('MSVS_PROJECT_GUID', '')
608
+ if self.version_num >= 8.0 and not project_guid:
609
+ project_guid = _generateGUID(self.dspfile, '')
610
+ if scc_provider != '':
611
+ scc_attrs = ('\tProjectGUID="%s"\n'
612
+ '\tSccProjectName="%s"\n'
613
+ '\tSccAuxPath="%s"\n'
614
+ '\tSccLocalPath="%s"\n'
615
+ '\tSccProvider="%s"' % (project_guid, scc_project_name, scc_aux_path, scc_local_path, scc_provider))
616
+ else:
617
+ scc_attrs = ('\tProjectGUID="%s"\n'
618
+ '\tSccProjectName="%s"\n'
619
+ '\tSccLocalPath="%s"' % (project_guid, scc_project_name, scc_local_path))
620
+
621
+ self.file.write(self.dspheader % locals())
622
+
623
+ self.file.write('\t<Platforms>\n')
624
+ for platform in self.platforms:
625
+ self.file.write(
626
+ '\t\t<Platform\n'
627
+ '\t\t\tName="%s"/>\n' % platform)
628
+ self.file.write('\t</Platforms>\n')
629
+
630
+ if self.version_num >= 8.0:
631
+ self.file.write('\t<ToolFiles>\n'
632
+ '\t</ToolFiles>\n')
633
+
634
+ def PrintProject(self):
635
+ self.file.write('\t<Configurations>\n')
636
+
637
+ confkeys = sorted(self.configs.keys())
638
+ for kind in confkeys:
639
+ variant = self.configs[kind].variant
640
+ platform = self.configs[kind].platform
641
+ outdir = self.configs[kind].outdir
642
+ buildtarget = self.configs[kind].buildtarget
643
+ runfile = self.configs[kind].runfile
644
+ cmdargs = self.configs[kind].cmdargs
645
+
646
+ env_has_buildtarget = 'MSVSBUILDTARGET' in self.env
647
+ if not env_has_buildtarget:
648
+ self.env['MSVSBUILDTARGET'] = buildtarget
649
+
650
+ starting = 'echo Starting SCons && '
651
+ if cmdargs:
652
+ cmdargs = ' ' + cmdargs
653
+ else:
654
+ cmdargs = ''
655
+ buildcmd = xmlify(starting + self.env.subst('$MSVSBUILDCOM', 1) + cmdargs)
656
+ rebuildcmd = xmlify(starting + self.env.subst('$MSVSREBUILDCOM', 1) + cmdargs)
657
+ cleancmd = xmlify(starting + self.env.subst('$MSVSCLEANCOM', 1) + cmdargs)
658
+
659
+ preprocdefs = xmlify(';'.join(processDefines(self.env.get('CPPDEFINES', []))))
660
+ includepath = xmlify(';'.join(self.env.get('CPPPATH', [])))
661
+
662
+ if not env_has_buildtarget:
663
+ del self.env['MSVSBUILDTARGET']
664
+
665
+ self.file.write(self.dspconfiguration % locals())
666
+
667
+ self.file.write('\t</Configurations>\n')
668
+
669
+ if self.version_num >= 7.1:
670
+ self.file.write('\t<References>\n'
671
+ '\t</References>\n')
672
+
673
+ self.PrintSourceFiles()
674
+
675
+ self.file.write('</VisualStudioProject>\n')
676
+
677
+ if self.nokeep == 0:
678
+ # now we pickle some data and add it to the file -- MSDEV will ignore it.
679
+ pdata = pickle.dumps(self.configs,1)
680
+ pdata = base64.encodestring(pdata)
681
+ self.file.write('<!-- SCons Data:\n' + pdata + '\n')
682
+ pdata = pickle.dumps(self.sources,1)
683
+ pdata = base64.encodestring(pdata)
684
+ self.file.write(pdata + '-->\n')
685
+
686
+ def printSources(self, hierarchy, commonprefix):
687
+ sorteditems = sorted(hierarchy.items(), key=lambda a: a[0].lower())
688
+
689
+ # First folders, then files
690
+ for key, value in sorteditems:
691
+ if SCons.Util.is_Dict(value):
692
+ self.file.write('\t\t\t<Filter\n'
693
+ '\t\t\t\tName="%s"\n'
694
+ '\t\t\t\tFilter="">\n' % (key))
695
+ self.printSources(value, commonprefix)
696
+ self.file.write('\t\t\t</Filter>\n')
697
+
698
+ for key, value in sorteditems:
699
+ if SCons.Util.is_String(value):
700
+ file = value
701
+ if commonprefix:
702
+ file = os.path.join(commonprefix, value)
703
+ file = os.path.normpath(file)
704
+ self.file.write('\t\t\t<File\n'
705
+ '\t\t\t\tRelativePath="%s">\n'
706
+ '\t\t\t</File>\n' % (file))
707
+
708
+ def PrintSourceFiles(self):
709
+ categories = {'Source Files': 'cpp;c;cxx;l;y;def;odl;idl;hpj;bat',
710
+ 'Header Files': 'h;hpp;hxx;hm;inl',
711
+ 'Local Headers': 'h;hpp;hxx;hm;inl',
712
+ 'Resource Files': 'r;rc;ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe',
713
+ 'Other Files': ''}
714
+
715
+ self.file.write('\t<Files>\n')
716
+
717
+ cats = sorted([k for k in categories.keys() if self.sources[k]],
718
+ key=lambda a: a.lower())
719
+ for kind in cats:
720
+ if len(cats) > 1:
721
+ self.file.write('\t\t<Filter\n'
722
+ '\t\t\tName="%s"\n'
723
+ '\t\t\tFilter="%s">\n' % (kind, categories[kind]))
724
+
725
+ sources = self.sources[kind]
726
+
727
+ # First remove any common prefix
728
+ commonprefix = None
729
+ if len(sources) > 1:
730
+ s = list(map(os.path.normpath, sources))
731
+ # take the dirname because the prefix may include parts
732
+ # of the filenames (e.g. if you have 'dir\abcd' and
733
+ # 'dir\acde' then the cp will be 'dir\a' )
734
+ cp = os.path.dirname( os.path.commonprefix(s) )
735
+ if cp and s[0][len(cp)] == os.sep:
736
+ # +1 because the filename starts after the separator
737
+ sources = [s[len(cp)+1:] for s in sources]
738
+ commonprefix = cp
739
+ elif len(sources) == 1:
740
+ commonprefix = os.path.dirname( sources[0] )
741
+ sources[0] = os.path.basename( sources[0] )
742
+
743
+ hierarchy = makeHierarchy(sources)
744
+ self.printSources(hierarchy, commonprefix=commonprefix)
745
+
746
+ if len(cats)>1:
747
+ self.file.write('\t\t</Filter>\n')
748
+
749
+ # add the SConscript file outside of the groups
750
+ self.file.write('\t\t<File\n'
751
+ '\t\t\tRelativePath="%s">\n'
752
+ '\t\t</File>\n' % str(self.sconscript))
753
+
754
+ self.file.write('\t</Files>\n'
755
+ '\t<Globals>\n'
756
+ '\t</Globals>\n')
757
+
758
+ def Parse(self):
759
+ try:
760
+ dspfile = open(self.dspabs,'r')
761
+ except IOError:
762
+ return # doesn't exist yet, so can't add anything to configs.
763
+
764
+ line = dspfile.readline()
765
+ while line:
766
+ if line.find('<!-- SCons Data:') > -1:
767
+ break
768
+ line = dspfile.readline()
769
+
770
+ line = dspfile.readline()
771
+ datas = line
772
+ while line and line != '\n':
773
+ line = dspfile.readline()
774
+ datas = datas + line
775
+
776
+ # OK, we've found our little pickled cache of data.
777
+ try:
778
+ datas = base64.decodestring(datas)
779
+ data = pickle.loads(datas)
780
+ except KeyboardInterrupt:
781
+ raise
782
+ except:
783
+ return # unable to unpickle any data for some reason
784
+
785
+ self.configs.update(data)
786
+
787
+ data = None
788
+ line = dspfile.readline()
789
+ datas = line
790
+ while line and line != '\n':
791
+ line = dspfile.readline()
792
+ datas = datas + line
793
+
794
+ # OK, we've found our little pickled cache of data.
795
+ try:
796
+ datas = base64.decodestring(datas)
797
+ data = pickle.loads(datas)
798
+ except KeyboardInterrupt:
799
+ raise
800
+ except:
801
+ return # unable to unpickle any data for some reason
802
+
803
+ self.sources.update(data)
804
+
805
+ def Build(self):
806
+ try:
807
+ self.file = open(self.dspabs,'w')
808
+ except IOError, detail:
809
+ raise SCons.Errors.InternalError('Unable to open "' + self.dspabs + '" for writing:' + str(detail))
810
+ else:
811
+ self.PrintHeader()
812
+ self.PrintProject()
813
+ self.file.close()
814
+
815
+ class _DSWGenerator(object):
816
+ """ Base class for DSW generators """
817
+ def __init__(self, dswfile, source, env):
818
+ self.dswfile = os.path.normpath(str(dswfile))
819
+ self.env = env
820
+
821
+ if 'projects' not in env:
822
+ raise SCons.Errors.UserError("You must specify a 'projects' argument to create an MSVSSolution.")
823
+ projects = env['projects']
824
+ if not SCons.Util.is_List(projects):
825
+ raise SCons.Errors.InternalError("The 'projects' argument must be a list of nodes.")
826
+ projects = SCons.Util.flatten(projects)
827
+ if len(projects) < 1:
828
+ raise SCons.Errors.UserError("You must specify at least one project to create an MSVSSolution.")
829
+ self.dspfiles = list(map(str, projects))
830
+
831
+ if 'name' in self.env:
832
+ self.name = self.env['name']
833
+ else:
834
+ self.name = os.path.basename(SCons.Util.splitext(self.dswfile)[0])
835
+ self.name = self.env.subst(self.name)
836
+
837
+ def Build(self):
838
+ pass
839
+
840
+ class _GenerateV7DSW(_DSWGenerator):
841
+ """Generates a Solution file for MSVS .NET"""
842
+ def __init__(self, dswfile, source, env):
843
+ _DSWGenerator.__init__(self, dswfile, source, env)
844
+
845
+ self.file = None
846
+ self.version = self.env['MSVS_VERSION']
847
+ self.version_num, self.suite = msvs_parse_version(self.version)
848
+ self.versionstr = '7.00'
849
+ if self.version_num >= 8.0:
850
+ self.versionstr = '9.00'
851
+ elif self.version_num >= 7.1:
852
+ self.versionstr = '8.00'
853
+ if self.version_num >= 8.0:
854
+ self.versionstr = '9.00'
855
+
856
+ if 'slnguid' in env and env['slnguid']:
857
+ self.slnguid = env['slnguid']
858
+ else:
859
+ self.slnguid = _generateGUID(dswfile, self.name)
860
+
861
+ self.configs = {}
862
+
863
+ self.nokeep = 0
864
+ if 'nokeep' in env and env['variant'] != 0:
865
+ self.nokeep = 1
866
+
867
+ if self.nokeep == 0 and os.path.exists(self.dswfile):
868
+ self.Parse()
869
+
870
+ def AddConfig(self, variant, dswfile=dswfile):
871
+ config = Config()
872
+
873
+ match = re.match('(.*)\|(.*)', variant)
874
+ if match:
875
+ config.variant = match.group(1)
876
+ config.platform = match.group(2)
877
+ else:
878
+ config.variant = variant
879
+ config.platform = 'Win32'
880
+
881
+ self.configs[variant] = config
882
+ print "Adding '" + self.name + ' - ' + config.variant + '|' + config.platform + "' to '" + str(dswfile) + "'"
883
+
884
+ if 'variant' not in env:
885
+ raise SCons.Errors.InternalError("You must specify a 'variant' argument (i.e. 'Debug' or " +\
886
+ "'Release') to create an MSVS Solution File.")
887
+ elif SCons.Util.is_String(env['variant']):
888
+ AddConfig(self, env['variant'])
889
+ elif SCons.Util.is_List(env['variant']):
890
+ for variant in env['variant']:
891
+ AddConfig(self, variant)
892
+
893
+ self.platforms = []
894
+ for key in self.configs.keys():
895
+ platform = self.configs[key].platform
896
+ if not platform in self.platforms:
897
+ self.platforms.append(platform)
898
+
899
+ def Parse(self):
900
+ try:
901
+ dswfile = open(self.dswfile,'r')
902
+ except IOError:
903
+ return # doesn't exist yet, so can't add anything to configs.
904
+
905
+ line = dswfile.readline()
906
+ while line:
907
+ if line[:9] == "EndGlobal":
908
+ break
909
+ line = dswfile.readline()
910
+
911
+ line = dswfile.readline()
912
+ datas = line
913
+ while line:
914
+ line = dswfile.readline()
915
+ datas = datas + line
916
+
917
+ # OK, we've found our little pickled cache of data.
918
+ try:
919
+ datas = base64.decodestring(datas)
920
+ data = pickle.loads(datas)
921
+ except KeyboardInterrupt:
922
+ raise
923
+ except:
924
+ return # unable to unpickle any data for some reason
925
+
926
+ self.configs.update(data)
927
+
928
+ def PrintSolution(self):
929
+ """Writes a solution file"""
930
+ self.file.write('Microsoft Visual Studio Solution File, Format Version %s\n' % self.versionstr )
931
+ if self.version_num >= 8.0:
932
+ self.file.write('# Visual Studio 2005\n')
933
+ for p in self.dspfiles:
934
+ name = os.path.basename(p)
935
+ base, suffix = SCons.Util.splitext(name)
936
+ if suffix == '.vcproj':
937
+ name = base
938
+ guid = _generateGUID(p, '')
939
+ self.file.write('Project("%s") = "%s", "%s", "%s"\n'
940
+ % ( external_makefile_guid, name, p, guid ) )
941
+ if self.version_num >= 7.1 and self.version_num < 8.0:
942
+ self.file.write('\tProjectSection(ProjectDependencies) = postProject\n'
943
+ '\tEndProjectSection\n')
944
+ self.file.write('EndProject\n')
945
+
946
+ self.file.write('Global\n')
947
+
948
+ env = self.env
949
+ if 'MSVS_SCC_PROVIDER' in env:
950
+ dspfile_base = os.path.basename(self.dspfile)
951
+ slnguid = self.slnguid
952
+ scc_provider = env.get('MSVS_SCC_PROVIDER', '')
953
+ scc_provider = scc_provider.replace(' ', r'\u0020')
954
+ scc_project_name = env.get('MSVS_SCC_PROJECT_NAME', '')
955
+ # scc_aux_path = env.get('MSVS_SCC_AUX_PATH', '')
956
+ scc_local_path = env.get('MSVS_SCC_LOCAL_PATH', '')
957
+ scc_project_base_path = env.get('MSVS_SCC_PROJECT_BASE_PATH', '')
958
+ # project_guid = env.get('MSVS_PROJECT_GUID', '')
959
+
960
+ self.file.write('\tGlobalSection(SourceCodeControl) = preSolution\n'
961
+ '\t\tSccNumberOfProjects = 2\n'
962
+ '\t\tSccProjectUniqueName0 = %(dspfile_base)s\n'
963
+ '\t\tSccLocalPath0 = %(scc_local_path)s\n'
964
+ '\t\tCanCheckoutShared = true\n'
965
+ '\t\tSccProjectFilePathRelativizedFromConnection0 = %(scc_project_base_path)s\n'
966
+ '\t\tSccProjectName1 = %(scc_project_name)s\n'
967
+ '\t\tSccLocalPath1 = %(scc_local_path)s\n'
968
+ '\t\tSccProvider1 = %(scc_provider)s\n'
969
+ '\t\tCanCheckoutShared = true\n'
970
+ '\t\tSccProjectFilePathRelativizedFromConnection1 = %(scc_project_base_path)s\n'
971
+ '\t\tSolutionUniqueID = %(slnguid)s\n'
972
+ '\tEndGlobalSection\n' % locals())
973
+
974
+ if self.version_num >= 8.0:
975
+ self.file.write('\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\n')
976
+ else:
977
+ self.file.write('\tGlobalSection(SolutionConfiguration) = preSolution\n')
978
+
979
+ confkeys = sorted(self.configs.keys())
980
+ cnt = 0
981
+ for name in confkeys:
982
+ variant = self.configs[name].variant
983
+ platform = self.configs[name].platform
984
+ if self.version_num >= 8.0:
985
+ self.file.write('\t\t%s|%s = %s|%s\n' % (variant, platform, variant, platform))
986
+ else:
987
+ self.file.write('\t\tConfigName.%d = %s\n' % (cnt, variant))
988
+ cnt = cnt + 1
989
+ self.file.write('\tEndGlobalSection\n')
990
+ if self.version_num < 7.1:
991
+ self.file.write('\tGlobalSection(ProjectDependencies) = postSolution\n'
992
+ '\tEndGlobalSection\n')
993
+ if self.version_num >= 8.0:
994
+ self.file.write('\tGlobalSection(ProjectConfigurationPlatforms) = postSolution\n')
995
+ else:
996
+ self.file.write('\tGlobalSection(ProjectConfiguration) = postSolution\n')
997
+
998
+ for name in confkeys:
999
+ variant = self.configs[name].variant
1000
+ platform = self.configs[name].platform
1001
+ if self.version_num >= 8.0:
1002
+ for p in self.dspfiles:
1003
+ guid = _generateGUID(p, '')
1004
+ self.file.write('\t\t%s.%s|%s.ActiveCfg = %s|%s\n'
1005
+ '\t\t%s.%s|%s.Build.0 = %s|%s\n' % (guid,variant,platform,variant,platform,guid,variant,platform,variant,platform))
1006
+ else:
1007
+ for p in self.dspfiles:
1008
+ guid = _generateGUID(p, '')
1009
+ self.file.write('\t\t%s.%s.ActiveCfg = %s|%s\n'
1010
+ '\t\t%s.%s.Build.0 = %s|%s\n' %(guid,variant,variant,platform,guid,variant,variant,platform))
1011
+
1012
+ self.file.write('\tEndGlobalSection\n')
1013
+
1014
+ if self.version_num >= 8.0:
1015
+ self.file.write('\tGlobalSection(SolutionProperties) = preSolution\n'
1016
+ '\t\tHideSolutionNode = FALSE\n'
1017
+ '\tEndGlobalSection\n')
1018
+ else:
1019
+ self.file.write('\tGlobalSection(ExtensibilityGlobals) = postSolution\n'
1020
+ '\tEndGlobalSection\n'
1021
+ '\tGlobalSection(ExtensibilityAddIns) = postSolution\n'
1022
+ '\tEndGlobalSection\n')
1023
+ self.file.write('EndGlobal\n')
1024
+ if self.nokeep == 0:
1025
+ pdata = pickle.dumps(self.configs,1)
1026
+ pdata = base64.encodestring(pdata)
1027
+ self.file.write(pdata + '\n')
1028
+
1029
+ def Build(self):
1030
+ try:
1031
+ self.file = open(self.dswfile,'w')
1032
+ except IOError, detail:
1033
+ raise SCons.Errors.InternalError('Unable to open "' + self.dswfile + '" for writing:' + str(detail))
1034
+ else:
1035
+ self.PrintSolution()
1036
+ self.file.close()
1037
+
1038
+ V6DSWHeader = """\
1039
+ Microsoft Developer Studio Workspace File, Format Version 6.00
1040
+ # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
1041
+
1042
+ ###############################################################################
1043
+
1044
+ Project: "%(name)s"="%(dspfile)s" - Package Owner=<4>
1045
+
1046
+ Package=<5>
1047
+ {{{
1048
+ }}}
1049
+
1050
+ Package=<4>
1051
+ {{{
1052
+ }}}
1053
+
1054
+ ###############################################################################
1055
+
1056
+ Global:
1057
+
1058
+ Package=<5>
1059
+ {{{
1060
+ }}}
1061
+
1062
+ Package=<3>
1063
+ {{{
1064
+ }}}
1065
+
1066
+ ###############################################################################
1067
+ """
1068
+
1069
+ class _GenerateV6DSW(_DSWGenerator):
1070
+ """Generates a Workspace file for MSVS 6.0"""
1071
+
1072
+ def PrintWorkspace(self):
1073
+ """ writes a DSW file """
1074
+ name = self.name
1075
+ dspfile = self.dspfiles[0]
1076
+ self.file.write(V6DSWHeader % locals())
1077
+
1078
+ def Build(self):
1079
+ try:
1080
+ self.file = open(self.dswfile,'w')
1081
+ except IOError, detail:
1082
+ raise SCons.Errors.InternalError('Unable to open "' + self.dswfile + '" for writing:' + str(detail))
1083
+ else:
1084
+ self.PrintWorkspace()
1085
+ self.file.close()
1086
+
1087
+
1088
+ def GenerateDSP(dspfile, source, env):
1089
+ """Generates a Project file based on the version of MSVS that is being used"""
1090
+
1091
+ version_num = 6.0
1092
+ if 'MSVS_VERSION' in env:
1093
+ version_num, suite = msvs_parse_version(env['MSVS_VERSION'])
1094
+ if version_num >= 7.0:
1095
+ g = _GenerateV7DSP(dspfile, source, env)
1096
+ g.Build()
1097
+ else:
1098
+ g = _GenerateV6DSP(dspfile, source, env)
1099
+ g.Build()
1100
+
1101
+ def GenerateDSW(dswfile, source, env):
1102
+ """Generates a Solution/Workspace file based on the version of MSVS that is being used"""
1103
+
1104
+ version_num = 6.0
1105
+ if 'MSVS_VERSION' in env:
1106
+ version_num, suite = msvs_parse_version(env['MSVS_VERSION'])
1107
+ if version_num >= 7.0:
1108
+ g = _GenerateV7DSW(dswfile, source, env)
1109
+ g.Build()
1110
+ else:
1111
+ g = _GenerateV6DSW(dswfile, source, env)
1112
+ g.Build()
1113
+
1114
+
1115
+ ##############################################################################
1116
+ # Above here are the classes and functions for generation of
1117
+ # DSP/DSW/SLN/VCPROJ files.
1118
+ ##############################################################################
1119
+
1120
+ def GetMSVSProjectSuffix(target, source, env, for_signature):
1121
+ return env['MSVS']['PROJECTSUFFIX']
1122
+
1123
+ def GetMSVSSolutionSuffix(target, source, env, for_signature):
1124
+ return env['MSVS']['SOLUTIONSUFFIX']
1125
+
1126
+ def GenerateProject(target, source, env):
1127
+ # generate the dsp file, according to the version of MSVS.
1128
+ builddspfile = target[0]
1129
+ dspfile = builddspfile.srcnode()
1130
+
1131
+ # this detects whether or not we're using a VariantDir
1132
+ if not dspfile is builddspfile:
1133
+ try:
1134
+ bdsp = open(str(builddspfile), "w+")
1135
+ except IOError, detail:
1136
+ print 'Unable to open "' + str(dspfile) + '" for writing:',detail,'\n'
1137
+ raise
1138
+
1139
+ bdsp.write("This is just a placeholder file.\nThe real project file is here:\n%s\n" % dspfile.get_abspath())
1140
+
1141
+ GenerateDSP(dspfile, source, env)
1142
+
1143
+ if env.get('auto_build_solution', 1):
1144
+ builddswfile = target[1]
1145
+ dswfile = builddswfile.srcnode()
1146
+
1147
+ if not dswfile is builddswfile:
1148
+
1149
+ try:
1150
+ bdsw = open(str(builddswfile), "w+")
1151
+ except IOError, detail:
1152
+ print 'Unable to open "' + str(dspfile) + '" for writing:',detail,'\n'
1153
+ raise
1154
+
1155
+ bdsw.write("This is just a placeholder file.\nThe real workspace file is here:\n%s\n" % dswfile.get_abspath())
1156
+
1157
+ GenerateDSW(dswfile, source, env)
1158
+
1159
+ def GenerateSolution(target, source, env):
1160
+ GenerateDSW(target[0], source, env)
1161
+
1162
+ def projectEmitter(target, source, env):
1163
+ """Sets up the DSP dependencies."""
1164
+
1165
+ # todo: Not sure what sets source to what user has passed as target,
1166
+ # but this is what happens. When that is fixed, we also won't have
1167
+ # to make the user always append env['MSVSPROJECTSUFFIX'] to target.
1168
+ if source[0] == target[0]:
1169
+ source = []
1170
+
1171
+ # make sure the suffix is correct for the version of MSVS we're running.
1172
+ (base, suff) = SCons.Util.splitext(str(target[0]))
1173
+ suff = env.subst('$MSVSPROJECTSUFFIX')
1174
+ target[0] = base + suff
1175
+
1176
+ if not source:
1177
+ source = 'prj_inputs:'
1178
+ source = source + env.subst('$MSVSSCONSCOM', 1)
1179
+ source = source + env.subst('$MSVSENCODING', 1)
1180
+
1181
+ if 'buildtarget' in env and env['buildtarget'] != None:
1182
+ if SCons.Util.is_String(env['buildtarget']):
1183
+ source = source + ' "%s"' % env['buildtarget']
1184
+ elif SCons.Util.is_List(env['buildtarget']):
1185
+ for bt in env['buildtarget']:
1186
+ if SCons.Util.is_String(bt):
1187
+ source = source + ' "%s"' % bt
1188
+ else:
1189
+ try: source = source + ' "%s"' % bt.get_abspath()
1190
+ except AttributeError: raise SCons.Errors.InternalError("buildtarget can be a string, a node, a list of strings or nodes, or None")
1191
+ else:
1192
+ try: source = source + ' "%s"' % env['buildtarget'].get_abspath()
1193
+ except AttributeError: raise SCons.Errors.InternalError("buildtarget can be a string, a node, a list of strings or nodes, or None")
1194
+
1195
+ if 'outdir' in env and env['outdir'] != None:
1196
+ if SCons.Util.is_String(env['outdir']):
1197
+ source = source + ' "%s"' % env['outdir']
1198
+ elif SCons.Util.is_List(env['outdir']):
1199
+ for s in env['outdir']:
1200
+ if SCons.Util.is_String(s):
1201
+ source = source + ' "%s"' % s
1202
+ else:
1203
+ try: source = source + ' "%s"' % s.get_abspath()
1204
+ except AttributeError: raise SCons.Errors.InternalError("outdir can be a string, a node, a list of strings or nodes, or None")
1205
+ else:
1206
+ try: source = source + ' "%s"' % env['outdir'].get_abspath()
1207
+ except AttributeError: raise SCons.Errors.InternalError("outdir can be a string, a node, a list of strings or nodes, or None")
1208
+
1209
+ if 'name' in env:
1210
+ if SCons.Util.is_String(env['name']):
1211
+ source = source + ' "%s"' % env['name']
1212
+ else:
1213
+ raise SCons.Errors.InternalError("name must be a string")
1214
+
1215
+ if 'variant' in env:
1216
+ if SCons.Util.is_String(env['variant']):
1217
+ source = source + ' "%s"' % env['variant']
1218
+ elif SCons.Util.is_List(env['variant']):
1219
+ for variant in env['variant']:
1220
+ if SCons.Util.is_String(variant):
1221
+ source = source + ' "%s"' % variant
1222
+ else:
1223
+ raise SCons.Errors.InternalError("name must be a string or a list of strings")
1224
+ else:
1225
+ raise SCons.Errors.InternalError("variant must be a string or a list of strings")
1226
+ else:
1227
+ raise SCons.Errors.InternalError("variant must be specified")
1228
+
1229
+ for s in _DSPGenerator.srcargs:
1230
+ if s in env:
1231
+ if SCons.Util.is_String(env[s]):
1232
+ source = source + ' "%s' % env[s]
1233
+ elif SCons.Util.is_List(env[s]):
1234
+ for t in env[s]:
1235
+ if SCons.Util.is_String(t):
1236
+ source = source + ' "%s"' % t
1237
+ else:
1238
+ raise SCons.Errors.InternalError(s + " must be a string or a list of strings")
1239
+ else:
1240
+ raise SCons.Errors.InternalError(s + " must be a string or a list of strings")
1241
+
1242
+ source = source + ' "%s"' % str(target[0])
1243
+ source = [SCons.Node.Python.Value(source)]
1244
+
1245
+ targetlist = [target[0]]
1246
+ sourcelist = source
1247
+
1248
+ if env.get('auto_build_solution', 1):
1249
+ env['projects'] = targetlist
1250
+ t, s = solutionEmitter(target, target, env)
1251
+ targetlist = targetlist + t
1252
+
1253
+ return (targetlist, sourcelist)
1254
+
1255
+ def solutionEmitter(target, source, env):
1256
+ """Sets up the DSW dependencies."""
1257
+
1258
+ # todo: Not sure what sets source to what user has passed as target,
1259
+ # but this is what happens. When that is fixed, we also won't have
1260
+ # to make the user always append env['MSVSSOLUTIONSUFFIX'] to target.
1261
+ if source[0] == target[0]:
1262
+ source = []
1263
+
1264
+ # make sure the suffix is correct for the version of MSVS we're running.
1265
+ (base, suff) = SCons.Util.splitext(str(target[0]))
1266
+ suff = env.subst('$MSVSSOLUTIONSUFFIX')
1267
+ target[0] = base + suff
1268
+
1269
+ if not source:
1270
+ source = 'sln_inputs:'
1271
+
1272
+ if 'name' in env:
1273
+ if SCons.Util.is_String(env['name']):
1274
+ source = source + ' "%s"' % env['name']
1275
+ else:
1276
+ raise SCons.Errors.InternalError("name must be a string")
1277
+
1278
+ if 'variant' in env:
1279
+ if SCons.Util.is_String(env['variant']):
1280
+ source = source + ' "%s"' % env['variant']
1281
+ elif SCons.Util.is_List(env['variant']):
1282
+ for variant in env['variant']:
1283
+ if SCons.Util.is_String(variant):
1284
+ source = source + ' "%s"' % variant
1285
+ else:
1286
+ raise SCons.Errors.InternalError("name must be a string or a list of strings")
1287
+ else:
1288
+ raise SCons.Errors.InternalError("variant must be a string or a list of strings")
1289
+ else:
1290
+ raise SCons.Errors.InternalError("variant must be specified")
1291
+
1292
+ if 'slnguid' in env:
1293
+ if SCons.Util.is_String(env['slnguid']):
1294
+ source = source + ' "%s"' % env['slnguid']
1295
+ else:
1296
+ raise SCons.Errors.InternalError("slnguid must be a string")
1297
+
1298
+ if 'projects' in env:
1299
+ if SCons.Util.is_String(env['projects']):
1300
+ source = source + ' "%s"' % env['projects']
1301
+ elif SCons.Util.is_List(env['projects']):
1302
+ for t in env['projects']:
1303
+ if SCons.Util.is_String(t):
1304
+ source = source + ' "%s"' % t
1305
+
1306
+ source = source + ' "%s"' % str(target[0])
1307
+ source = [SCons.Node.Python.Value(source)]
1308
+
1309
+ return ([target[0]], source)
1310
+
1311
+ projectAction = SCons.Action.Action(GenerateProject, None)
1312
+
1313
+ solutionAction = SCons.Action.Action(GenerateSolution, None)
1314
+
1315
+ projectBuilder = SCons.Builder.Builder(action = '$MSVSPROJECTCOM',
1316
+ suffix = '$MSVSPROJECTSUFFIX',
1317
+ emitter = projectEmitter)
1318
+
1319
+ solutionBuilder = SCons.Builder.Builder(action = '$MSVSSOLUTIONCOM',
1320
+ suffix = '$MSVSSOLUTIONSUFFIX',
1321
+ emitter = solutionEmitter)
1322
+
1323
+ default_MSVS_SConscript = None
1324
+
1325
+ def generate(env):
1326
+ """Add Builders and construction variables for Microsoft Visual
1327
+ Studio project files to an Environment."""
1328
+ try:
1329
+ env['BUILDERS']['MSVSProject']
1330
+ except KeyError:
1331
+ env['BUILDERS']['MSVSProject'] = projectBuilder
1332
+
1333
+ try:
1334
+ env['BUILDERS']['MSVSSolution']
1335
+ except KeyError:
1336
+ env['BUILDERS']['MSVSSolution'] = solutionBuilder
1337
+
1338
+ env['MSVSPROJECTCOM'] = projectAction
1339
+ env['MSVSSOLUTIONCOM'] = solutionAction
1340
+
1341
+ if SCons.Script.call_stack:
1342
+ # XXX Need to find a way to abstract this; the build engine
1343
+ # shouldn't depend on anything in SCons.Script.
1344
+ env['MSVSSCONSCRIPT'] = SCons.Script.call_stack[0].sconscript
1345
+ else:
1346
+ global default_MSVS_SConscript
1347
+ if default_MSVS_SConscript is None:
1348
+ default_MSVS_SConscript = env.File('SConstruct')
1349
+ env['MSVSSCONSCRIPT'] = default_MSVS_SConscript
1350
+
1351
+ env['MSVSSCONS'] = '"%s" -c "%s"' % (python_executable, getExecScriptMain(env))
1352
+ env['MSVSSCONSFLAGS'] = '-C "${MSVSSCONSCRIPT.dir.abspath}" -f ${MSVSSCONSCRIPT.name}'
1353
+ env['MSVSSCONSCOM'] = '$MSVSSCONS $MSVSSCONSFLAGS'
1354
+ env['MSVSBUILDCOM'] = '$MSVSSCONSCOM "$MSVSBUILDTARGET"'
1355
+ env['MSVSREBUILDCOM'] = '$MSVSSCONSCOM "$MSVSBUILDTARGET"'
1356
+ env['MSVSCLEANCOM'] = '$MSVSSCONSCOM -c "$MSVSBUILDTARGET"'
1357
+ env['MSVSENCODING'] = 'Windows-1252'
1358
+
1359
+ # Set-up ms tools paths for default version
1360
+ msvc_setup_env_once(env)
1361
+
1362
+ if 'MSVS_VERSION' in env:
1363
+ version_num, suite = msvs_parse_version(env['MSVS_VERSION'])
1364
+ else:
1365
+ (version_num, suite) = (7.0, None) # guess at a default
1366
+ if 'MSVS' not in env:
1367
+ env['MSVS'] = {}
1368
+ if (version_num < 7.0):
1369
+ env['MSVS']['PROJECTSUFFIX'] = '.dsp'
1370
+ env['MSVS']['SOLUTIONSUFFIX'] = '.dsw'
1371
+ else:
1372
+ env['MSVS']['PROJECTSUFFIX'] = '.vcproj'
1373
+ env['MSVS']['SOLUTIONSUFFIX'] = '.sln'
1374
+
1375
+ env['GET_MSVSPROJECTSUFFIX'] = GetMSVSProjectSuffix
1376
+ env['GET_MSVSSOLUTIONSUFFIX'] = GetMSVSSolutionSuffix
1377
+ env['MSVSPROJECTSUFFIX'] = '${GET_MSVSPROJECTSUFFIX}'
1378
+ env['MSVSSOLUTIONSUFFIX'] = '${GET_MSVSSOLUTIONSUFFIX}'
1379
+ env['SCONS_HOME'] = os.environ.get('SCONS_HOME')
1380
+
1381
+ def exists(env):
1382
+ return msvc_exists()
1383
+
1384
+ # Local Variables:
1385
+ # tab-width:4
1386
+ # indent-tabs-mode:nil
1387
+ # End:
1388
+ # vim: set expandtab tabstop=4 shiftwidth=4: