text_ux 0.0.1

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 (147) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +25 -0
  3. data/.rspec +2 -0
  4. data/Gemfile +4 -0
  5. data/LICENSE.txt +22 -0
  6. data/README.md +51 -0
  7. data/Rakefile +18 -0
  8. data/ext/text_ux/extconf.rb +5 -0
  9. data/ext/text_ux/text_ux.cpp +252 -0
  10. data/lib/text_ux.rb +5 -0
  11. data/lib/text_ux/version.rb +3 -0
  12. data/spec/fixtures/test.ux +0 -0
  13. data/spec/spec_helper.rb +19 -0
  14. data/spec/text_ux_spec.rb +137 -0
  15. data/text_ux.gemspec +26 -0
  16. data/vendor/ux-trie/ux-0.1.9/.lock-waf_darwin_build +8 -0
  17. data/vendor/ux-trie/ux-0.1.9/.unittest-gtest/gtest-1.6.0/fused-src/gtest/gtest-all.cc +9118 -0
  18. data/vendor/ux-trie/ux-0.1.9/.unittest-gtest/gtest-1.6.0/fused-src/gtest/gtest.h +19537 -0
  19. data/vendor/ux-trie/ux-0.1.9/.unittest-gtest/gtest-1.6.0/fused-src/gtest/gtest_main.cc +39 -0
  20. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Build.py +733 -0
  21. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Build.pyc +0 -0
  22. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/ConfigSet.py +147 -0
  23. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/ConfigSet.pyc +0 -0
  24. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Configure.py +314 -0
  25. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Configure.pyc +0 -0
  26. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Context.py +298 -0
  27. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Context.pyc +0 -0
  28. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Errors.py +37 -0
  29. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Errors.pyc +0 -0
  30. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Logs.py +149 -0
  31. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Logs.pyc +0 -0
  32. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Node.py +500 -0
  33. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Node.pyc +0 -0
  34. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Options.py +130 -0
  35. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Options.pyc +0 -0
  36. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Runner.py +191 -0
  37. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Runner.pyc +0 -0
  38. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Scripting.py +358 -0
  39. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Scripting.pyc +0 -0
  40. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Task.py +669 -0
  41. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Task.pyc +0 -0
  42. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/TaskGen.py +341 -0
  43. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/TaskGen.pyc +0 -0
  44. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/__init__.py +4 -0
  45. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/__init__.pyc +0 -0
  46. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/ar.py +12 -0
  47. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/ar.pyc +0 -0
  48. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/asm.py +25 -0
  49. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/bison.py +29 -0
  50. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/c.py +27 -0
  51. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/c_aliases.py +56 -0
  52. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/c_aliases.pyc +0 -0
  53. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/c_config.py +708 -0
  54. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/c_config.pyc +0 -0
  55. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/c_osx.py +121 -0
  56. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/c_osx.pyc +0 -0
  57. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/c_preproc.py +606 -0
  58. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/c_preproc.pyc +0 -0
  59. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/c_tests.py +110 -0
  60. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/c_tests.pyc +0 -0
  61. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/ccroot.py +372 -0
  62. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/ccroot.pyc +0 -0
  63. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/compiler_c.py +39 -0
  64. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/compiler_cxx.py +39 -0
  65. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/compiler_cxx.pyc +0 -0
  66. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/compiler_d.py +30 -0
  67. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/compiler_fc.py +45 -0
  68. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/cs.py +98 -0
  69. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/cxx.py +27 -0
  70. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/cxx.pyc +0 -0
  71. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/d.py +51 -0
  72. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/d_config.py +47 -0
  73. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/d_scan.py +133 -0
  74. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/dbus.py +30 -0
  75. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/dmd.py +43 -0
  76. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/errcheck.py +153 -0
  77. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/fc.py +123 -0
  78. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/fc_config.py +271 -0
  79. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/fc_scan.py +68 -0
  80. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/flex.py +27 -0
  81. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/g95.py +55 -0
  82. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/gas.py +10 -0
  83. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/gcc.py +98 -0
  84. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/gdc.py +34 -0
  85. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/gfortran.py +69 -0
  86. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/glib2.py +174 -0
  87. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/gnu_dirs.py +65 -0
  88. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/gxx.py +98 -0
  89. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/gxx.pyc +0 -0
  90. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/icc.py +31 -0
  91. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/icpc.py +30 -0
  92. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/ifort.py +42 -0
  93. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/intltool.py +78 -0
  94. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/irixcc.py +49 -0
  95. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/javaw.py +272 -0
  96. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/kde4.py +49 -0
  97. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/lua.py +19 -0
  98. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/msvc.py +650 -0
  99. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/nasm.py +13 -0
  100. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/perl.py +78 -0
  101. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/python.py +303 -0
  102. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/qt4.py +424 -0
  103. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/ruby.py +104 -0
  104. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/suncc.py +54 -0
  105. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/suncxx.py +55 -0
  106. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/tex.py +222 -0
  107. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/vala.py +215 -0
  108. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/waf_unit_test.py +79 -0
  109. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/winres.py +34 -0
  110. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/xlc.py +46 -0
  111. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/xlcxx.py +46 -0
  112. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Utils.py +334 -0
  113. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Utils.pyc +0 -0
  114. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/__init__.py +4 -0
  115. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/__init__.pyc +0 -0
  116. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/ansiterm.py +173 -0
  117. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/ansiterm.pyc +0 -0
  118. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/extras/__init__.py +4 -0
  119. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/extras/__init__.pyc +0 -0
  120. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/extras/compat15.py +223 -0
  121. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/extras/compat15.pyc +0 -0
  122. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/fixpy2.py +50 -0
  123. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/fixpy2.pyc +0 -0
  124. data/vendor/ux-trie/ux-0.1.9/src/bitVec.cpp +119 -0
  125. data/vendor/ux-trie/ux-0.1.9/src/bitVec.hpp +64 -0
  126. data/vendor/ux-trie/ux-0.1.9/src/bitVecTest.cpp +143 -0
  127. data/vendor/ux-trie/ux-0.1.9/src/cmdline.h +809 -0
  128. data/vendor/ux-trie/ux-0.1.9/src/rsDic.cpp +121 -0
  129. data/vendor/ux-trie/ux-0.1.9/src/rsDic.hpp +57 -0
  130. data/vendor/ux-trie/ux-0.1.9/src/ux.hpp +26 -0
  131. data/vendor/ux-trie/ux-0.1.9/src/uxMain.cpp +206 -0
  132. data/vendor/ux-trie/ux-0.1.9/src/uxMap.cpp +0 -0
  133. data/vendor/ux-trie/ux-0.1.9/src/uxMap.hpp +248 -0
  134. data/vendor/ux-trie/ux-0.1.9/src/uxMapTest.cpp +139 -0
  135. data/vendor/ux-trie/ux-0.1.9/src/uxTest.cpp +229 -0
  136. data/vendor/ux-trie/ux-0.1.9/src/uxTrie.cpp +529 -0
  137. data/vendor/ux-trie/ux-0.1.9/src/uxTrie.hpp +220 -0
  138. data/vendor/ux-trie/ux-0.1.9/src/uxUtil.cpp +92 -0
  139. data/vendor/ux-trie/ux-0.1.9/src/uxUtil.hpp +35 -0
  140. data/vendor/ux-trie/ux-0.1.9/src/wscript +43 -0
  141. data/vendor/ux-trie/ux-0.1.9/unittest_gtest.py +0 -0
  142. data/vendor/ux-trie/ux-0.1.9/unittest_gtest.pyc +0 -0
  143. data/vendor/ux-trie/ux-0.1.9/unittestt.py +166 -0
  144. data/vendor/ux-trie/ux-0.1.9/ux.pc.in +10 -0
  145. data/vendor/ux-trie/ux-0.1.9/waf +0 -0
  146. data/vendor/ux-trie/ux-0.1.9/wscript +32 -0
  147. metadata +249 -0
@@ -0,0 +1,65 @@
1
+ #! /usr/bin/env python
2
+ # encoding: utf-8
3
+ # WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
4
+
5
+ import os
6
+ from waflib import Utils,Options,Context
7
+ _options=[x.split(', ')for x in'''
8
+ bindir, user executables, ${EXEC_PREFIX}/bin
9
+ sbindir, system admin executables, ${EXEC_PREFIX}/sbin
10
+ libexecdir, program executables, ${EXEC_PREFIX}/libexec
11
+ sysconfdir, read-only single-machine data, ${PREFIX}/etc
12
+ sharedstatedir, modifiable architecture-independent data, ${PREFIX}/com
13
+ localstatedir, modifiable single-machine data, ${PREFIX}/var
14
+ libdir, object code libraries, ${EXEC_PREFIX}/lib
15
+ includedir, C header files, ${PREFIX}/include
16
+ oldincludedir, C header files for non-gcc, /usr/include
17
+ datarootdir, read-only arch.-independent data root, ${PREFIX}/share
18
+ datadir, read-only architecture-independent data, ${DATAROOTDIR}
19
+ infodir, info documentation, ${DATAROOTDIR}/info
20
+ localedir, locale-dependent data, ${DATAROOTDIR}/locale
21
+ mandir, man documentation, ${DATAROOTDIR}/man
22
+ docdir, documentation root, ${DATAROOTDIR}/doc/${PACKAGE}
23
+ htmldir, html documentation, ${DOCDIR}
24
+ dvidir, dvi documentation, ${DOCDIR}
25
+ pdfdir, pdf documentation, ${DOCDIR}
26
+ psdir, ps documentation, ${DOCDIR}
27
+ '''.split('\n')if x]
28
+ def configure(conf):
29
+ def get_param(varname,default):
30
+ return getattr(Options.options,varname,'')or default
31
+ env=conf.env
32
+ conf.env.LIBDIR=conf.env.BINDIR=[]
33
+ env['EXEC_PREFIX']=get_param('EXEC_PREFIX',env['PREFIX'])
34
+ env['PACKAGE']=getattr(Context.g_module,'APPNAME',None)or env['PACKAGE']
35
+ complete=False
36
+ iter=0
37
+ while not complete and iter<len(_options)+1:
38
+ iter+=1
39
+ complete=True
40
+ for name,help,default in _options:
41
+ name=name.upper()
42
+ if not env[name]:
43
+ try:
44
+ env[name]=Utils.subst_vars(get_param(name,default).replace('/',os.sep),env)
45
+ except TypeError:
46
+ complete=False
47
+ if not complete:
48
+ lst=[name for name,_,_ in _options if not env[name.upper()]]
49
+ raise conf.errors.WafError('Variable substitution failure %r'%lst)
50
+ def options(opt):
51
+ inst_dir=opt.add_option_group('Installation directories','By default, "waf install" will put the files in\
52
+ "/usr/local/bin", "/usr/local/lib" etc. An installation prefix other\
53
+ than "/usr/local" can be given using "--prefix", for example "--prefix=$HOME"')
54
+ for k in('--prefix','--destdir'):
55
+ option=opt.parser.get_option(k)
56
+ if option:
57
+ opt.parser.remove_option(k)
58
+ inst_dir.add_option(option)
59
+ inst_dir.add_option('--exec-prefix',help='installation prefix [Default: ${PREFIX}]',default='',dest='EXEC_PREFIX')
60
+ dirs_options=opt.add_option_group('Pre-defined installation directories','')
61
+ for name,help,default in _options:
62
+ option_name='--'+name
63
+ str_default=default
64
+ str_help='%s [Default: %s]'%(help,str_default)
65
+ dirs_options.add_option(option_name,help=str_help,default='',dest=name.upper())
@@ -0,0 +1,98 @@
1
+ #! /usr/bin/env python
2
+ # encoding: utf-8
3
+ # WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
4
+
5
+ import os,sys
6
+ from waflib import Configure,Options,Utils
7
+ from waflib.Tools import ccroot,ar
8
+ from waflib.Configure import conf
9
+ def find_gxx(conf):
10
+ cxx=conf.find_program(['g++','c++'],var='CXX')
11
+ cxx=conf.cmd_to_list(cxx)
12
+ conf.get_cc_version(cxx,gcc=True)
13
+ conf.env.CXX_NAME='gcc'
14
+ conf.env.CXX=cxx
15
+ def gxx_common_flags(conf):
16
+ v=conf.env
17
+ v['CXX_SRC_F']=[]
18
+ v['CXX_TGT_F']=['-c','-o']
19
+ if not v['LINK_CXX']:v['LINK_CXX']=v['CXX']
20
+ v['CXXLNK_SRC_F']=[]
21
+ v['CXXLNK_TGT_F']=['-o']
22
+ v['CPPPATH_ST']='-I%s'
23
+ v['DEFINES_ST']='-D%s'
24
+ v['LIB_ST']='-l%s'
25
+ v['LIBPATH_ST']='-L%s'
26
+ v['STLIB_ST']='-l%s'
27
+ v['STLIBPATH_ST']='-L%s'
28
+ v['RPATH_ST']='-Wl,-rpath,%s'
29
+ v['SONAME_ST']='-Wl,-h,%s'
30
+ v['SHLIB_MARKER']='-Wl,-Bdynamic'
31
+ v['STLIB_MARKER']='-Wl,-Bstatic'
32
+ v['cxxprogram_PATTERN']='%s'
33
+ v['CXXFLAGS_cxxshlib']=['-fPIC']
34
+ v['LINKFLAGS_cxxshlib']=['-shared']
35
+ v['cxxshlib_PATTERN']='lib%s.so'
36
+ v['LINKFLAGS_cxxstlib']=['-Wl,-Bstatic']
37
+ v['cxxstlib_PATTERN']='lib%s.a'
38
+ v['LINKFLAGS_MACBUNDLE']=['-bundle','-undefined','dynamic_lookup']
39
+ v['CXXFLAGS_MACBUNDLE']=['-fPIC']
40
+ v['macbundle_PATTERN']='%s.bundle'
41
+ def gxx_modifier_win32(conf):
42
+ v=conf.env
43
+ v['cxxprogram_PATTERN']='%s.exe'
44
+ v['cxxshlib_PATTERN']='%s.dll'
45
+ v['implib_PATTERN']='lib%s.dll.a'
46
+ v['IMPLIB_ST']='-Wl,--out-implib,%s'
47
+ v['CXXFLAGS_cxxshlib']=[]
48
+ v.append_value('CXXFLAGS_cxxshlib',['-DDLL_EXPORT'])
49
+ v.append_value('LINKFLAGS',['-Wl,--enable-auto-import'])
50
+ def gxx_modifier_cygwin(conf):
51
+ gxx_modifier_win32(conf)
52
+ v=conf.env
53
+ v['cxxshlib_PATTERN']='cyg%s.dll'
54
+ v.append_value('LINKFLAGS_cxxshlib',['-Wl,--enable-auto-image-base'])
55
+ v['CXXFLAGS_cxxshlib']=[]
56
+ def gxx_modifier_darwin(conf):
57
+ v=conf.env
58
+ v['CXXFLAGS_cxxshlib']=['-fPIC','-compatibility_version','1','-current_version','1']
59
+ v['LINKFLAGS_cxxshlib']=['-dynamiclib']
60
+ v['cxxshlib_PATTERN']='lib%s.dylib'
61
+ v['FRAMEWORKPATH_ST']='-F%s'
62
+ v['FRAMEWORK_ST']=['-framework']
63
+ v['ARCH_ST']=['-arch']
64
+ v['LINKFLAGS_cxxstlib']=[]
65
+ v['SHLIB_MARKER']=[]
66
+ v['STLIB_MARKER']=[]
67
+ v['SONAME_ST']=[]
68
+ def gxx_modifier_aix(conf):
69
+ v=conf.env
70
+ v['LINKFLAGS_cxxprogram']=['-Wl,-brtl']
71
+ v['LINKFLAGS_cxxshlib']=['-shared','-Wl,-brtl,-bexpfull']
72
+ v['SHLIB_MARKER']=[]
73
+ def gxx_modifier_hpux(conf):
74
+ v=conf.env
75
+ v['SHLIB_MARKER']=[]
76
+ v['CFLAGS_cxxshlib']=['-fPIC','-DPIC']
77
+ v['cxxshlib_PATTERN']='lib%s.sl'
78
+ def gxx_modifier_platform(conf):
79
+ gxx_modifier_func=getattr(conf,'gxx_modifier_'+conf.env.DEST_OS,None)
80
+ if gxx_modifier_func:
81
+ gxx_modifier_func()
82
+ def configure(conf):
83
+ conf.find_gxx()
84
+ conf.find_ar()
85
+ conf.gxx_common_flags()
86
+ conf.gxx_modifier_platform()
87
+ conf.cxx_load_tools()
88
+ conf.cxx_add_flags()
89
+ conf.link_add_flags()
90
+
91
+ conf(find_gxx)
92
+ conf(gxx_common_flags)
93
+ conf(gxx_modifier_win32)
94
+ conf(gxx_modifier_cygwin)
95
+ conf(gxx_modifier_darwin)
96
+ conf(gxx_modifier_aix)
97
+ conf(gxx_modifier_hpux)
98
+ conf(gxx_modifier_platform)
@@ -0,0 +1,31 @@
1
+ #! /usr/bin/env python
2
+ # encoding: utf-8
3
+ # WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
4
+
5
+ import os,sys
6
+ from waflib.Tools import ccroot,ar,gcc
7
+ from waflib.Configure import conf
8
+ def find_icc(conf):
9
+ if sys.platform=='cygwin':
10
+ conf.fatal('The Intel compiler does not work on Cygwin')
11
+ v=conf.env
12
+ cc=None
13
+ if v['CC']:cc=v['CC']
14
+ elif'CC'in conf.environ:cc=conf.environ['CC']
15
+ if not cc:cc=conf.find_program('icc',var='CC')
16
+ if not cc:cc=conf.find_program('ICL',var='CC')
17
+ if not cc:conf.fatal('Intel C Compiler (icc) was not found')
18
+ cc=conf.cmd_to_list(cc)
19
+ conf.get_cc_version(cc,icc=True)
20
+ v['CC']=cc
21
+ v['CC_NAME']='icc'
22
+ def configure(conf):
23
+ conf.find_icc()
24
+ conf.find_ar()
25
+ conf.gcc_common_flags()
26
+ conf.gcc_modifier_platform()
27
+ conf.cc_load_tools()
28
+ conf.cc_add_flags()
29
+ conf.link_add_flags()
30
+
31
+ conf(find_icc)
@@ -0,0 +1,30 @@
1
+ #! /usr/bin/env python
2
+ # encoding: utf-8
3
+ # WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
4
+
5
+ import os,sys
6
+ from waflib.Tools import ccroot,ar,gxx
7
+ from waflib.Configure import conf
8
+ def find_icpc(conf):
9
+ if sys.platform=='cygwin':
10
+ conf.fatal('The Intel compiler does not work on Cygwin')
11
+ v=conf.env
12
+ cxx=None
13
+ if v['CXX']:cxx=v['CXX']
14
+ elif'CXX'in conf.environ:cxx=conf.environ['CXX']
15
+ if not cxx:cxx=conf.find_program('icpc',var='CXX')
16
+ if not cxx:conf.fatal('Intel C++ Compiler (icpc) was not found')
17
+ cxx=conf.cmd_to_list(cxx)
18
+ conf.get_cc_version(cxx,icc=True)
19
+ v['CXX']=cxx
20
+ v['CXX_NAME']='icc'
21
+ def configure(conf):
22
+ conf.find_icpc()
23
+ conf.find_ar()
24
+ conf.gxx_common_flags()
25
+ conf.gxx_modifier_platform()
26
+ conf.cxx_load_tools()
27
+ conf.cxx_add_flags()
28
+ conf.link_add_flags()
29
+
30
+ conf(find_icpc)
@@ -0,0 +1,42 @@
1
+ #! /usr/bin/env python
2
+ # encoding: utf-8
3
+ # WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
4
+
5
+ import re
6
+ from waflib import Utils
7
+ from waflib.Tools import fc,fc_config,fc_scan
8
+ from waflib.Configure import conf
9
+ def find_ifort(conf):
10
+ fc=conf.find_program('ifort',var='FC')
11
+ fc=conf.cmd_to_list(fc)
12
+ conf.get_ifort_version(fc)
13
+ conf.env.FC_NAME='IFORT'
14
+ def ifort_modifier_cygwin(conf):
15
+ raise NotImplementedError("Ifort on cygwin not yet implemented")
16
+ def ifort_modifier_platform(conf):
17
+ dest_os=conf.env['DEST_OS']or Utils.unversioned_sys_platform()
18
+ ifort_modifier_func=getattr(conf,'ifort_modifier_'+dest_os,None)
19
+ if ifort_modifier_func:
20
+ ifort_modifier_func()
21
+ def get_ifort_version(conf,fc):
22
+ version_re=re.compile(r"ifort\s*\(IFORT\)\s*(?P<major>\d*)\.(?P<minor>\d*)",re.I).search
23
+ cmd=fc+['--version']
24
+ out,err=fc_config.getoutput(conf,cmd,stdin=False)
25
+ if out:
26
+ match=version_re(out)
27
+ else:
28
+ match=version_re(err)
29
+ if not match:
30
+ conf.fatal('cannot determine ifort version.')
31
+ k=match.groupdict()
32
+ conf.env['FC_VERSION']=(k['major'],k['minor'])
33
+ def configure(conf):
34
+ conf.find_ifort()
35
+ conf.find_ar()
36
+ conf.fc_flags()
37
+ conf.ifort_modifier_platform()
38
+
39
+ conf(find_ifort)
40
+ conf(ifort_modifier_cygwin)
41
+ conf(ifort_modifier_platform)
42
+ conf(get_ifort_version)
@@ -0,0 +1,78 @@
1
+ #! /usr/bin/env python
2
+ # encoding: utf-8
3
+ # WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
4
+
5
+ import os,re
6
+ from waflib import Configure,TaskGen,Task,Utils,Runner,Options,Build,Logs
7
+ import waflib.Tools.ccroot
8
+ from waflib.TaskGen import feature,before_method
9
+ from waflib.Logs import error
10
+ def apply_intltool_in_f(self):
11
+ try:self.meths.remove('process_source')
12
+ except ValueError:pass
13
+ if not self.env.LOCALEDIR:
14
+ self.env.LOCALEDIR=self.env.PREFIX+'/share/locale'
15
+ for i in self.to_list(self.source):
16
+ node=self.path.find_resource(i)
17
+ podir=getattr(self,'podir','po')
18
+ podirnode=self.path.find_dir(podir)
19
+ if not podirnode:
20
+ error("could not find the podir %r"%podir)
21
+ continue
22
+ cache=getattr(self,'intlcache','.intlcache')
23
+ self.env['INTLCACHE']=os.path.join(self.path.bldpath(),podir,cache)
24
+ self.env['INTLPODIR']=podirnode.bldpath()
25
+ self.env['INTLFLAGS']=getattr(self,'flags',['-q','-u','-c'])
26
+ task=self.create_task('intltool',node,node.change_ext(''))
27
+ inst=getattr(self,'install_path','${LOCALEDIR}')
28
+ if inst:
29
+ self.bld.install_files(inst,task.outputs)
30
+ def apply_intltool_po(self):
31
+ try:self.meths.remove('process_source')
32
+ except ValueError:pass
33
+ if not self.env.LOCALEDIR:
34
+ self.env.LOCALEDIR=self.env.PREFIX+'/share/locale'
35
+ appname=getattr(self,'appname','set_your_app_name')
36
+ podir=getattr(self,'podir','')
37
+ inst=getattr(self,'install_path','${LOCALEDIR}')
38
+ linguas=self.path.find_node(os.path.join(podir,'LINGUAS'))
39
+ if linguas:
40
+ file=open(linguas.abspath())
41
+ langs=[]
42
+ for line in file.readlines():
43
+ if not line.startswith('#'):
44
+ langs+=line.split()
45
+ file.close()
46
+ re_linguas=re.compile('[-a-zA-Z_@.]+')
47
+ for lang in langs:
48
+ if re_linguas.match(lang):
49
+ node=self.path.find_resource(os.path.join(podir,re_linguas.match(lang).group()+'.po'))
50
+ task=self.create_task('po',node,node.change_ext('.mo'))
51
+ if inst:
52
+ filename=task.outputs[0].name
53
+ (langname,ext)=os.path.splitext(filename)
54
+ inst_file=inst+os.sep+langname+os.sep+'LC_MESSAGES'+os.sep+appname+'.mo'
55
+ self.bld.install_as(inst_file,task.outputs[0],chmod=getattr(self,'chmod',Utils.O644),env=task.env)
56
+ else:
57
+ Logs.pprint('RED',"Error no LINGUAS file found in po directory")
58
+ class po(Task.Task):
59
+ run_str='${MSGFMT} -o ${TGT} ${SRC}'
60
+ color='BLUE'
61
+ class intltool(Task.Task):
62
+ run_str='${INTLTOOL} ${INTLFLAGS} ${INTLCACHE} ${INTLPODIR} ${SRC} ${TGT}'
63
+ color='BLUE'
64
+ def configure(conf):
65
+ conf.find_program('msgfmt',var='MSGFMT')
66
+ conf.find_perl_program('intltool-merge',var='INTLTOOL')
67
+ prefix=conf.env.PREFIX
68
+ datadir=conf.env.DATADIR
69
+ if not datadir:
70
+ datadir=os.path.join(prefix,'share')
71
+ conf.define('LOCALEDIR',os.path.join(datadir,'locale').replace('\\','\\\\'))
72
+ conf.define('DATADIR',datadir.replace('\\','\\\\'))
73
+ if conf.env.CC or conf.env.CXX:
74
+ conf.check(header_name='locale.h')
75
+
76
+ before_method('process_source')(apply_intltool_in_f)
77
+ feature('intltool_in')(apply_intltool_in_f)
78
+ feature('intltool_po')(apply_intltool_po)
@@ -0,0 +1,49 @@
1
+ #! /usr/bin/env python
2
+ # encoding: utf-8
3
+ # WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
4
+
5
+ import os
6
+ from waflib import Utils
7
+ from waflib.Tools import ccroot,ar
8
+ from waflib.Configure import conf
9
+ def find_irixcc(conf):
10
+ v=conf.env
11
+ cc=None
12
+ if v['CC']:cc=v['CC']
13
+ elif'CC'in conf.environ:cc=conf.environ['CC']
14
+ if not cc:cc=conf.find_program('cc',var='CC')
15
+ if not cc:conf.fatal('irixcc was not found')
16
+ cc=conf.cmd_to_list(cc)
17
+ try:
18
+ conf.cmd_and_log(cc+['-version'])
19
+ except:
20
+ conf.fatal('%r -version could not be executed'%cc)
21
+ v['CC']=cc
22
+ v['CC_NAME']='irix'
23
+ def irixcc_common_flags(conf):
24
+ v=conf.env
25
+ v['CC_SRC_F']=''
26
+ v['CC_TGT_F']=['-c','-o']
27
+ v['CPPPATH_ST']='-I%s'
28
+ v['DEFINES_ST']='-D%s'
29
+ if not v['LINK_CC']:v['LINK_CC']=v['CC']
30
+ v['CCLNK_SRC_F']=''
31
+ v['CCLNK_TGT_F']=['-o']
32
+ v['LIB_ST']='-l%s'
33
+ v['LIBPATH_ST']='-L%s'
34
+ v['STLIB_ST']='-l%s'
35
+ v['STLIBPATH_ST']='-L%s'
36
+ v['cprogram_PATTERN']='%s'
37
+ v['cshlib_PATTERN']='lib%s.so'
38
+ v['cstlib_PATTERN']='lib%s.a'
39
+ def configure(conf):
40
+ conf.find_irixcc()
41
+ conf.find_cpp()
42
+ conf.find_ar()
43
+ conf.irixcc_common_flags()
44
+ conf.cc_load_tools()
45
+ conf.cc_add_flags()
46
+ conf.link_add_flags()
47
+
48
+ conf(find_irixcc)
49
+ conf(irixcc_common_flags)
@@ -0,0 +1,272 @@
1
+ #! /usr/bin/env python
2
+ # encoding: utf-8
3
+ # WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
4
+
5
+ import sys
6
+ if sys.hexversion < 0x020400f0: from sets import Set as set
7
+ import os,re
8
+ from waflib.Configure import conf
9
+ from waflib import TaskGen,Task,Utils,Options,Build,Errors,Node
10
+ from waflib.TaskGen import feature,before_method,after_method
11
+ from waflib.Tools import ccroot
12
+ ccroot.USELIB_VARS['javac']=set(['CLASSPATH','JAVACFLAGS'])
13
+ SOURCE_RE='**/*.java'
14
+ JAR_RE='**/*'
15
+ re_verbose=re.compile(r'^\[.*?\]\n*',re.M)
16
+ re_classes=re.compile(r'\[wrote (?:RegularFileObject\[)*(.*?\.class)\]')
17
+ class_check_source='''
18
+ public class Test {
19
+ public static void main(String[] argv) {
20
+ Class lib;
21
+ if (argv.length < 1) {
22
+ System.err.println("Missing argument");
23
+ System.exit(77);
24
+ }
25
+ try {
26
+ lib = Class.forName(argv[0]);
27
+ } catch (ClassNotFoundException e) {
28
+ System.err.println("ClassNotFoundException");
29
+ System.exit(1);
30
+ }
31
+ lib = null;
32
+ System.exit(0);
33
+ }
34
+ }
35
+ '''
36
+ def apply_java(self):
37
+ Utils.def_attrs(self,jarname='',classpath='',sourcepath='.',srcdir='.',jar_mf_attributes={},jar_mf_classpath=[])
38
+ nodes_lst=[]
39
+ outdir=getattr(self,'outdir',None)
40
+ if outdir:
41
+ if not isinstance(outdir,Node.Node):
42
+ outdir=self.path.get_bld().make_node(self.outdir)
43
+ else:
44
+ outdir=self.path.get_bld()
45
+ outdir.mkdir()
46
+ self.env['OUTDIR']=outdir.abspath()
47
+ self.javac_task=tsk=self.create_task('javac')
48
+ tmp=[]
49
+ srcdir=getattr(self,'srcdir','')
50
+ if isinstance(srcdir,Node.Node):
51
+ srcdir=[srcdir]
52
+ for x in Utils.to_list(srcdir):
53
+ if isinstance(x,Node.Node):
54
+ y=x
55
+ else:
56
+ y=self.path.find_dir(x)
57
+ if not y:
58
+ self.bld.fatal('Could not find the folder %s from %s'%(x,self.path))
59
+ tmp.append(y)
60
+ tsk.srcdir=tmp
61
+ if getattr(self,'compat',None):
62
+ tsk.env.append_value('JAVACFLAGS',['-source',self.compat])
63
+ if hasattr(self,'sourcepath'):
64
+ fold=[isinstance(x,Node.Node)and x or self.path.find_dir(x)for x in self.to_list(self.sourcepath)]
65
+ names=os.pathsep.join([x.srcpath()for x in fold])
66
+ else:
67
+ names=[x.srcpath()for x in tsk.srcdir]
68
+ if names:
69
+ tsk.env.append_value('JAVACFLAGS',['-sourcepath',names])
70
+ def use_javac_files(self):
71
+ lst=[]
72
+ self.uselib=self.to_list(getattr(self,'uselib',[]))
73
+ names=self.to_list(getattr(self,'use',[]))
74
+ get=self.bld.get_tgen_by_name
75
+ for x in names:
76
+ try:
77
+ y=get(x)
78
+ except:
79
+ self.uselib.append(x)
80
+ else:
81
+ y.post()
82
+ lst.append(y.jar_task.outputs[0].abspath())
83
+ self.javac_task.set_run_after(y.jar_task)
84
+ if lst:
85
+ self.env.append_value('CLASSPATH',lst)
86
+ def set_classpath(self):
87
+ self.env.append_value('CLASSPATH',getattr(self,'classpath',[]))
88
+ for x in self.tasks:
89
+ x.env.CLASSPATH=os.pathsep.join(self.env.CLASSPATH)+os.pathsep
90
+ def jar_files(self):
91
+ destfile=getattr(self,'destfile','test.jar')
92
+ jaropts=getattr(self,'jaropts',[])
93
+ manifest=getattr(self,'manifest',None)
94
+ basedir=getattr(self,'basedir',None)
95
+ if basedir:
96
+ if not isinstance(self.basedir,Node.Node):
97
+ basedir=self.path.get_bld().make_node(basedir)
98
+ else:
99
+ basedir=self.path.get_bld()
100
+ if not basedir:
101
+ self.bld.fatal('Could not find the basedir %r for %r'%(self.basedir,self))
102
+ self.jar_task=tsk=self.create_task('jar_create')
103
+ if manifest:
104
+ jarcreate=getattr(self,'jarcreate','cfm')
105
+ node=self.path.find_node(manifest)
106
+ tsk.dep_nodes.append(node)
107
+ jaropts.insert(0,node.abspath())
108
+ else:
109
+ jarcreate=getattr(self,'jarcreate','cf')
110
+ if not isinstance(destfile,Node.Node):
111
+ destfile=self.path.find_or_declare(destfile)
112
+ if not destfile:
113
+ self.bld.fatal('invalid destfile %r for %r'%(destfile,self))
114
+ tsk.set_outputs(destfile)
115
+ tsk.basedir=basedir
116
+ jaropts.append('-C')
117
+ jaropts.append(basedir.bldpath())
118
+ jaropts.append('.')
119
+ tsk.env['JAROPTS']=jaropts
120
+ tsk.env['JARCREATE']=jarcreate
121
+ if getattr(self,'javac_task',None):
122
+ tsk.set_run_after(self.javac_task)
123
+ def use_jar_files(self):
124
+ lst=[]
125
+ self.uselib=self.to_list(getattr(self,'uselib',[]))
126
+ names=self.to_list(getattr(self,'use',[]))
127
+ get=self.bld.get_tgen_by_name
128
+ for x in names:
129
+ try:
130
+ y=get(x)
131
+ except:
132
+ self.uselib.append(x)
133
+ else:
134
+ y.post()
135
+ self.jar_task.run_after.update(y.tasks)
136
+ class jar_create(Task.Task):
137
+ color='GREEN'
138
+ run_str='${JAR} ${JARCREATE} ${TGT} ${JAROPTS}'
139
+ def runnable_status(self):
140
+ for t in self.run_after:
141
+ if not t.hasrun:
142
+ return Task.ASK_LATER
143
+ if not self.inputs:
144
+ global JAR_RE
145
+ try:
146
+ self.inputs=[x for x in self.basedir.ant_glob(JAR_RE,remove=False)if id(x)!=id(self.outputs[0])]
147
+ except:
148
+ raise Errors.WafError('Could not find the basedir %r for %r'%(self.basedir,self))
149
+ return super(jar_create,self).runnable_status()
150
+ class javac(Task.Task):
151
+ color='BLUE'
152
+ nocache=True
153
+ vars=['CLASSPATH','JAVACFLAGS','JAVAC','OUTDIR']
154
+ def runnable_status(self):
155
+ for t in self.run_after:
156
+ if not t.hasrun:
157
+ return Task.ASK_LATER
158
+ if not self.inputs:
159
+ global SOURCE_RE
160
+ self.inputs=[]
161
+ for x in self.srcdir:
162
+ self.inputs.extend(x.ant_glob(SOURCE_RE,remove=False))
163
+ return super(javac,self).runnable_status()
164
+ def run(self):
165
+ env=self.env
166
+ gen=self.generator
167
+ bld=gen.bld
168
+ wd=bld.bldnode.abspath()
169
+ def to_list(xx):
170
+ if isinstance(xx,str):return[xx]
171
+ return xx
172
+ self.last_cmd=lst=[]
173
+ lst.extend(to_list(env['JAVAC']))
174
+ lst.extend(['-classpath'])
175
+ lst.extend(to_list(env['CLASSPATH']))
176
+ lst.extend(['-d'])
177
+ lst.extend(to_list(env['OUTDIR']))
178
+ lst.extend(to_list(env['JAVACFLAGS']))
179
+ lst.extend([a.path_from(bld.bldnode)for a in self.inputs])
180
+ lst=[x for x in lst if x]
181
+ try:
182
+ self.out=self.generator.bld.cmd_and_log(lst,cwd=wd,env=env.env or None,output=0,quiet=0)[1]
183
+ except:
184
+ self.generator.bld.cmd_and_log(lst,cwd=wd,env=env.env or None)
185
+ def post_run(self):
186
+ for x in re_classes.findall(self.out):
187
+ if os.path.isabs(x):
188
+ n=self.generator.bld.root.find_node(x)
189
+ else:
190
+ n=self.generator.bld.bldnode.find_node(x)
191
+ if not n:
192
+ raise ValueError('cannot find %r in %r'%(x,self.generator.bld.bldnode.abspath()))
193
+ n.sig=Utils.h_file(n.abspath())
194
+ self.generator.bld.task_sigs[self.uid()]=self.cache_sig
195
+ out=re_verbose.sub('',self.out).strip()
196
+ if out:
197
+ self.generator.bld.to_log(out+'\n')
198
+ def configure(self):
199
+ java_path=self.environ['PATH'].split(os.pathsep)
200
+ v=self.env
201
+ if'JAVA_HOME'in self.environ:
202
+ java_path=[os.path.join(self.environ['JAVA_HOME'],'bin')]+java_path
203
+ self.env['JAVA_HOME']=[self.environ['JAVA_HOME']]
204
+ for x in'javac java jar'.split():
205
+ self.find_program(x,var=x.upper(),path_list=java_path)
206
+ self.env[x.upper()]=self.cmd_to_list(self.env[x.upper()])
207
+ if'CLASSPATH'in self.environ:
208
+ v['CLASSPATH']=self.environ['CLASSPATH']
209
+ if not v['JAR']:self.fatal('jar is required for making java packages')
210
+ if not v['JAVAC']:self.fatal('javac is required for compiling java classes')
211
+ v['JARCREATE']='cf'
212
+ v['JAVACFLAGS']=['-verbose']
213
+ def check_java_class(self,classname,with_classpath=None):
214
+ import shutil
215
+ javatestdir='.waf-javatest'
216
+ classpath=javatestdir
217
+ if self.env['CLASSPATH']:
218
+ classpath+=os.pathsep+self.env['CLASSPATH']
219
+ if isinstance(with_classpath,str):
220
+ classpath+=os.pathsep+with_classpath
221
+ shutil.rmtree(javatestdir,True)
222
+ os.mkdir(javatestdir)
223
+ java_file=open(os.path.join(javatestdir,'Test.java'),'w')
224
+ java_file.write(class_check_source)
225
+ java_file.close()
226
+ self.exec_command(self.env['JAVAC']+[os.path.join(javatestdir,'Test.java')],shell=False)
227
+ cmd=self.env['JAVA']+['-cp',classpath,'Test',classname]
228
+ self.to_log("%s\n"%str(cmd))
229
+ found=self.exec_command(cmd,shell=False)
230
+ self.msg('Checking for java class %s'%classname,not found)
231
+ shutil.rmtree(javatestdir,True)
232
+ return found
233
+ def check_jni_headers(conf):
234
+ if not conf.env.CC_NAME and not conf.env.CXX_NAME:
235
+ conf.fatal('load a compiler first (gcc, g++, ..)')
236
+ if not conf.env.JAVA_HOME:
237
+ conf.fatal('set JAVA_HOME in the system environment')
238
+ javaHome=conf.env['JAVA_HOME'][0]
239
+ dir=conf.root.find_dir(conf.env.JAVA_HOME[0]+'/include')
240
+ if dir is None:
241
+ conf.fatal('JAVA_HOME does not seem to be set properly')
242
+ f=dir.ant_glob('**/(jni|jni_md).h')
243
+ incDirs=[x.parent.abspath()for x in f]
244
+ dir=conf.root.find_dir(conf.env.JAVA_HOME[0])
245
+ f=dir.ant_glob('**/*jvm.(so|dll|dylib)')
246
+ libDirs=[x.parent.abspath()for x in f]or[javaHome]
247
+ f=dir.ant_glob('**/*jvm.(lib)')
248
+ if f:
249
+ libDirs=[[x,y.parent.abspath()]for x in libDirs for y in f]
250
+ for d in libDirs:
251
+ try:
252
+ conf.check(header_name='jni.h',define_name='HAVE_JNI_H',lib='jvm',libpath=d,includes=incDirs,uselib_store='JAVA',uselib='JAVA')
253
+ except:
254
+ pass
255
+ else:
256
+ break
257
+ else:
258
+ conf.fatal('could not find lib jvm in %r (see config.log)'%libDirs)
259
+
260
+ feature('javac')(apply_java)
261
+ before_method('process_source')(apply_java)
262
+ feature('javac')(use_javac_files)
263
+ after_method('apply_java')(use_javac_files)
264
+ feature('javac')(set_classpath)
265
+ after_method('apply_java','propagate_uselib_vars','use_javac_files')(set_classpath)
266
+ feature('jar')(jar_files)
267
+ after_method('apply_java','use_javac_files')(jar_files)
268
+ before_method('process_source')(jar_files)
269
+ feature('jar')(use_jar_files)
270
+ after_method('jar_files')(use_jar_files)
271
+ conf(check_java_class)
272
+ conf(check_jni_headers)