text_ux 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
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,68 @@
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,Task,TaskGen,Logs
7
+ from waflib.TaskGen import feature,before_method,after_method,extension
8
+ from waflib.Configure import conf
9
+ INC_REGEX="""(?:^|['">]\s*;)\s*INCLUDE\s+(?:\w+_)?[<"'](.+?)(?=["'>])"""
10
+ USE_REGEX="""(?:^|;)\s*USE(?:\s+|(?:(?:\s*,\s*(?:NON_)?INTRINSIC)?\s*::))\s*(\w+)"""
11
+ MOD_REGEX="""(?:^|;)\s*MODULE(?!\s*PROCEDURE)(?:\s+|(?:(?:\s*,\s*(?:NON_)?INTRINSIC)?\s*::))\s*(\w+)"""
12
+ re_inc=re.compile(INC_REGEX,re.I)
13
+ re_use=re.compile(USE_REGEX,re.I)
14
+ re_mod=re.compile(MOD_REGEX,re.I)
15
+ class fortran_parser(object):
16
+ def __init__(self,incpaths):
17
+ self.seen=[]
18
+ self.nodes=[]
19
+ self.names=[]
20
+ self.incpaths=incpaths
21
+ def find_deps(self,node):
22
+ txt=node.read()
23
+ incs=[]
24
+ uses=[]
25
+ mods=[]
26
+ for line in txt.splitlines():
27
+ m=re_inc.search(line)
28
+ if m:
29
+ incs.append(m.group(1))
30
+ m=re_use.search(line)
31
+ if m:
32
+ uses.append(m.group(1))
33
+ m=re_mod.search(line)
34
+ if m:
35
+ mods.append(m.group(1))
36
+ return(incs,uses,mods)
37
+ def start(self,node):
38
+ self.waiting=[node]
39
+ while self.waiting:
40
+ nd=self.waiting.pop(0)
41
+ self.iter(nd)
42
+ def iter(self,node):
43
+ path=node.abspath()
44
+ incs,uses,mods=self.find_deps(node)
45
+ for x in incs:
46
+ if x in self.seen:
47
+ continue
48
+ self.seen.append(x)
49
+ self.tryfind_header(x)
50
+ for x in uses:
51
+ name="USE@%s"%x
52
+ if not name in self.names:
53
+ self.names.append(name)
54
+ for x in mods:
55
+ name="MOD@%s"%x
56
+ if not name in self.names:
57
+ self.names.append(name)
58
+ def tryfind_header(self,filename):
59
+ found=None
60
+ for n in self.incpaths:
61
+ found=n.find_resource(filename)
62
+ if found:
63
+ self.nodes.append(found)
64
+ self.waiting.append(found)
65
+ break
66
+ if not found:
67
+ if not filename in self.names:
68
+ self.names.append(filename)
@@ -0,0 +1,27 @@
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 waflib.TaskGen
6
+ def decide_ext(self,node):
7
+ if'cxx'in self.features:
8
+ return['.lex.cc']
9
+ return['.lex.c']
10
+ def flexfun(tsk):
11
+ env=tsk.env
12
+ bld=tsk.generator.bld
13
+ wd=bld.variant_dir
14
+ def to_list(xx):
15
+ if isinstance(xx,str):return[xx]
16
+ return xx
17
+ tsk.last_cmd=lst=[]
18
+ lst.extend(to_list(env['FLEX']))
19
+ lst.extend(to_list(env['FLEXFLAGS']))
20
+ lst.extend([a.path_from(bld.bldnode)for a in tsk.inputs])
21
+ lst=[x for x in lst if x]
22
+ txt=bld.cmd_and_log(lst,cwd=wd,env=env.env or None,quiet=0)
23
+ tsk.outputs[0].write(txt)
24
+ waflib.TaskGen.declare_chain(name='flex',rule=flexfun,ext_in='.l',decider=decide_ext,)
25
+ def configure(conf):
26
+ conf.find_program('flex',var='FLEX')
27
+ conf.env.FLEXFLAGS=['-t']
@@ -0,0 +1,55 @@
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_g95(conf):
10
+ fc=conf.find_program('g95',var='FC')
11
+ fc=conf.cmd_to_list(fc)
12
+ conf.get_g95_version(fc)
13
+ conf.env.FC_NAME='G95'
14
+ def g95_flags(conf):
15
+ v=conf.env
16
+ v['FCFLAGS_fcshlib']=['-fPIC']
17
+ v['FORTRANMODFLAG']=['-fmod=','']
18
+ v['FCFLAGS_DEBUG']=['-Werror']
19
+ def g95_modifier_win32(conf):
20
+ fc_config.fortran_modifier_win32(conf)
21
+ def g95_modifier_cygwin(conf):
22
+ fc_config.fortran_modifier_cygwin(conf)
23
+ def g95_modifier_darwin(conf):
24
+ fc_config.fortran_modifier_darwin(conf)
25
+ def g95_modifier_platform(conf):
26
+ dest_os=conf.env['DEST_OS']or Utils.unversioned_sys_platform()
27
+ g95_modifier_func=getattr(conf,'g95_modifier_'+dest_os,None)
28
+ if g95_modifier_func:
29
+ g95_modifier_func()
30
+ def get_g95_version(conf,fc):
31
+ version_re=re.compile(r"g95\s*(?P<major>\d*)\.(?P<minor>\d*)").search
32
+ cmd=fc+['--version']
33
+ out,err=fc_config.getoutput(conf,cmd,stdin=False)
34
+ if out:
35
+ match=version_re(out)
36
+ else:
37
+ match=version_re(err)
38
+ if not match:
39
+ conf.fatal('cannot determine g95 version')
40
+ k=match.groupdict()
41
+ conf.env['FC_VERSION']=(k['major'],k['minor'])
42
+ def configure(conf):
43
+ conf.find_g95()
44
+ conf.find_ar()
45
+ conf.fc_flags()
46
+ conf.g95_flags()
47
+ conf.g95_modifier_platform()
48
+
49
+ conf(find_g95)
50
+ conf(g95_flags)
51
+ conf(g95_modifier_win32)
52
+ conf(g95_modifier_cygwin)
53
+ conf(g95_modifier_darwin)
54
+ conf(g95_modifier_platform)
55
+ conf(get_g95_version)
@@ -0,0 +1,10 @@
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 waflib.Tools.asm
6
+ from waflib.Tools import ar
7
+ def configure(conf):
8
+ conf.find_program(['gas','as','gcc'],var='AS')
9
+ conf.env.AS_TGT_F='-o'
10
+ conf.find_ar()
@@ -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_gcc(conf):
10
+ cc=conf.find_program(['gcc','cc'],var='CC')
11
+ cc=conf.cmd_to_list(cc)
12
+ conf.get_cc_version(cc,gcc=True)
13
+ conf.env.CC_NAME='gcc'
14
+ conf.env.CC=cc
15
+ def gcc_common_flags(conf):
16
+ v=conf.env
17
+ v['CC_SRC_F']=[]
18
+ v['CC_TGT_F']=['-c','-o']
19
+ if not v['LINK_CC']:v['LINK_CC']=v['CC']
20
+ v['CCLNK_SRC_F']=[]
21
+ v['CCLNK_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['cprogram_PATTERN']='%s'
33
+ v['CFLAGS_cshlib']=['-fPIC']
34
+ v['LINKFLAGS_cshlib']=['-shared']
35
+ v['cshlib_PATTERN']='lib%s.so'
36
+ v['LINKFLAGS_cstlib']=['-Wl,-Bstatic']
37
+ v['cstlib_PATTERN']='lib%s.a'
38
+ v['LINKFLAGS_MACBUNDLE']=['-bundle','-undefined','dynamic_lookup']
39
+ v['CFLAGS_MACBUNDLE']=['-fPIC']
40
+ v['macbundle_PATTERN']='%s.bundle'
41
+ def gcc_modifier_win32(conf):
42
+ v=conf.env
43
+ v['cprogram_PATTERN']='%s.exe'
44
+ v['cshlib_PATTERN']='%s.dll'
45
+ v['implib_PATTERN']='lib%s.dll.a'
46
+ v['IMPLIB_ST']='-Wl,--out-implib,%s'
47
+ v['CFLAGS_cshlib']=[]
48
+ v.append_value('CFLAGS_cshlib',['-DDLL_EXPORT'])
49
+ v.append_value('LINKFLAGS',['-Wl,--enable-auto-import'])
50
+ def gcc_modifier_cygwin(conf):
51
+ gcc_modifier_win32(conf)
52
+ v=conf.env
53
+ v['cshlib_PATTERN']='cyg%s.dll'
54
+ v.append_value('LINKFLAGS_cshlib',['-Wl,--enable-auto-image-base'])
55
+ v['CFLAGS_cshlib']=[]
56
+ def gcc_modifier_darwin(conf):
57
+ v=conf.env
58
+ v['CFLAGS_cshlib']=['-fPIC','-compatibility_version','1','-current_version','1']
59
+ v['LINKFLAGS_cshlib']=['-dynamiclib']
60
+ v['cshlib_PATTERN']='lib%s.dylib'
61
+ v['FRAMEWORKPATH_ST']='-F%s'
62
+ v['FRAMEWORK_ST']=['-framework']
63
+ v['ARCH_ST']=['-arch']
64
+ v['LINKFLAGS_cstlib']=[]
65
+ v['SHLIB_MARKER']=[]
66
+ v['STLIB_MARKER']=[]
67
+ v['SONAME_ST']=[]
68
+ def gcc_modifier_aix(conf):
69
+ v=conf.env
70
+ v['LINKFLAGS_cprogram']=['-Wl,-brtl']
71
+ v['LINKFLAGS_cshlib']=['-shared','-Wl,-brtl,-bexpfull']
72
+ v['SHLIB_MARKER']=[]
73
+ def gcc_modifier_hpux(conf):
74
+ v=conf.env
75
+ v['SHLIB_MARKER']=[]
76
+ v['CFLAGS_cshlib']=['-fPIC','-DPIC']
77
+ v['cshlib_PATTERN']='lib%s.sl'
78
+ def gcc_modifier_platform(conf):
79
+ gcc_modifier_func=getattr(conf,'gcc_modifier_'+conf.env.DEST_OS,None)
80
+ if gcc_modifier_func:
81
+ gcc_modifier_func()
82
+ def configure(conf):
83
+ conf.find_gcc()
84
+ conf.find_ar()
85
+ conf.gcc_common_flags()
86
+ conf.gcc_modifier_platform()
87
+ conf.cc_load_tools()
88
+ conf.cc_add_flags()
89
+ conf.link_add_flags()
90
+
91
+ conf(find_gcc)
92
+ conf(gcc_common_flags)
93
+ conf(gcc_modifier_win32)
94
+ conf(gcc_modifier_cygwin)
95
+ conf(gcc_modifier_darwin)
96
+ conf(gcc_modifier_aix)
97
+ conf(gcc_modifier_hpux)
98
+ conf(gcc_modifier_platform)
@@ -0,0 +1,34 @@
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
+ from waflib.Tools import ar,d
7
+ from waflib.Configure import conf
8
+ def find_gdc(conf):
9
+ conf.find_program('gdc',var='D')
10
+ def common_flags_gdc(conf):
11
+ v=conf.env
12
+ v['DFLAGS']=[]
13
+ v['D_SRC_F']=['-c']
14
+ v['D_TGT_F']='-o%s'
15
+ v['D_LINKER']=v['D']
16
+ v['DLNK_SRC_F']=''
17
+ v['DLNK_TGT_F']='-o%s'
18
+ v['DINC_ST']='-I%s'
19
+ v['DSHLIB_MARKER']=v['DSTLIB_MARKER']=''
20
+ v['DSTLIB_ST']=v['DSHLIB_ST']='-l%s'
21
+ v['DSTLIBPATH_ST']=v['DLIBPATH_ST']='-L%s'
22
+ v['LINKFLAGS_dshlib']=['-shared']
23
+ v['DHEADER_ext']='.di'
24
+ v.DFLAGS_d_with_header='-fintfc'
25
+ v['D_HDR_F']='-fintfc-file=%s'
26
+ def configure(conf):
27
+ conf.find_gdc()
28
+ conf.load('ar')
29
+ conf.load('d')
30
+ conf.common_flags_gdc()
31
+ conf.d_platform_flags()
32
+
33
+ conf(find_gdc)
34
+ conf(common_flags_gdc)
@@ -0,0 +1,69 @@
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_gfortran(conf):
10
+ fc=conf.find_program(['gfortran','g77'],var='FC')
11
+ fc=conf.cmd_to_list(fc)
12
+ conf.get_gfortran_version(fc)
13
+ conf.env.FC_NAME='GFORTRAN'
14
+ def gfortran_flags(conf):
15
+ v=conf.env
16
+ v['FCFLAGS_fcshlib']=['-fPIC']
17
+ v['FORTRANMODFLAG']=['-J','']
18
+ v['FCFLAGS_DEBUG']=['-Werror']
19
+ def gfortran_modifier_win32(conf):
20
+ fc_config.fortran_modifier_win32(conf)
21
+ def gfortran_modifier_cygwin(conf):
22
+ fc_config.fortran_modifier_cygwin(conf)
23
+ def gfortran_modifier_darwin(conf):
24
+ fc_config.fortran_modifier_darwin(conf)
25
+ def gfortran_modifier_platform(conf):
26
+ dest_os=conf.env['DEST_OS']or Utils.unversioned_sys_platform()
27
+ gfortran_modifier_func=getattr(conf,'gfortran_modifier_'+dest_os,None)
28
+ if gfortran_modifier_func:
29
+ gfortran_modifier_func()
30
+ def get_gfortran_version(conf,fc):
31
+ version_re=re.compile(r"GNU\s*Fortran",re.I).search
32
+ cmd=fc+['--version']
33
+ out,err=fc_config.getoutput(conf,cmd,stdin=False)
34
+ if out:match=version_re(out)
35
+ else:match=version_re(err)
36
+ if not match:
37
+ conf.fatal('Could not determine the compiler type')
38
+ cmd=fc+['-dM','-E','-']
39
+ out,err=fc_config.getoutput(conf,cmd,stdin=True)
40
+ if out.find('__GNUC__')<0:
41
+ conf.fatal('Could not determine the compiler type')
42
+ k={}
43
+ out=out.split('\n')
44
+ import shlex
45
+ for line in out:
46
+ lst=shlex.split(line)
47
+ if len(lst)>2:
48
+ key=lst[1]
49
+ val=lst[2]
50
+ k[key]=val
51
+ def isD(var):
52
+ return var in k
53
+ def isT(var):
54
+ return var in k and k[var]!='0'
55
+ conf.env['FC_VERSION']=(k['__GNUC__'],k['__GNUC_MINOR__'],k['__GNUC_PATCHLEVEL__'])
56
+ def configure(conf):
57
+ conf.find_gfortran()
58
+ conf.find_ar()
59
+ conf.fc_flags()
60
+ conf.gfortran_flags()
61
+ conf.gfortran_modifier_platform()
62
+
63
+ conf(find_gfortran)
64
+ conf(gfortran_flags)
65
+ conf(gfortran_modifier_win32)
66
+ conf(gfortran_modifier_cygwin)
67
+ conf(gfortran_modifier_darwin)
68
+ conf(gfortran_modifier_platform)
69
+ conf(get_gfortran_version)
@@ -0,0 +1,174 @@
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 Task,Utils,Options,Errors,Logs
7
+ from waflib.TaskGen import taskgen_method,before_method,after_method,feature
8
+ def add_marshal_file(self,filename,prefix):
9
+ if not hasattr(self,'marshal_list'):
10
+ self.marshal_list=[]
11
+ self.meths.append('process_marshal')
12
+ self.marshal_list.append((filename,prefix))
13
+ def process_marshal(self):
14
+ for f,prefix in getattr(self,'marshal_list',[]):
15
+ node=self.path.find_resource(f)
16
+ if not node:
17
+ raise Errors.WafError('file not found %r'%f)
18
+ h_node=node.change_ext('.h')
19
+ c_node=node.change_ext('.c')
20
+ task=self.create_task('glib_genmarshal',node,[h_node,c_node])
21
+ task.env.GLIB_GENMARSHAL_PREFIX=prefix
22
+ self.source=self.to_nodes(getattr(self,'source',[]))
23
+ self.source.append(c_node)
24
+ class glib_genmarshal(Task.Task):
25
+ def run(self):
26
+ bld=self.inputs[0].__class__.ctx
27
+ get=self.env.get_flat
28
+ cmd1="%s %s --prefix=%s --header > %s"%(get('GLIB_GENMARSHAL'),self.inputs[0].srcpath(),get('GLIB_GENMARSHAL_PREFIX'),self.outputs[0].abspath())
29
+ ret=bld.exec_command(cmd1)
30
+ if ret:return ret
31
+ c='''#include "%s"\n'''%self.outputs[0].name
32
+ self.outputs[1].write(c)
33
+ cmd2="%s %s --prefix=%s --body >> %s"%(get('GLIB_GENMARSHAL'),self.inputs[0].srcpath(),get('GLIB_GENMARSHAL_PREFIX'),self.outputs[1].abspath())
34
+ return bld.exec_command(cmd2)
35
+ vars=['GLIB_GENMARSHAL_PREFIX','GLIB_GENMARSHAL']
36
+ color='BLUE'
37
+ ext_out=['.h']
38
+ def add_enums_from_template(self,source='',target='',template='',comments=''):
39
+ if not hasattr(self,'enums_list'):
40
+ self.enums_list=[]
41
+ self.meths.append('process_enums')
42
+ self.enums_list.append({'source':source,'target':target,'template':template,'file-head':'','file-prod':'','file-tail':'','enum-prod':'','value-head':'','value-prod':'','value-tail':'','comments':comments})
43
+ def add_enums(self,source='',target='',file_head='',file_prod='',file_tail='',enum_prod='',value_head='',value_prod='',value_tail='',comments=''):
44
+ if not hasattr(self,'enums_list'):
45
+ self.enums_list=[]
46
+ self.meths.append('process_enums')
47
+ self.enums_list.append({'source':source,'template':'','target':target,'file-head':file_head,'file-prod':file_prod,'file-tail':file_tail,'enum-prod':enum_prod,'value-head':value_head,'value-prod':value_prod,'value-tail':value_tail,'comments':comments})
48
+ def process_enums(self):
49
+ for enum in getattr(self,'enums_list',[]):
50
+ task=self.create_task('glib_mkenums')
51
+ env=task.env
52
+ inputs=[]
53
+ source_list=self.to_list(enum['source'])
54
+ if not source_list:
55
+ raise Errors.WafError('missing source '+str(enum))
56
+ source_list=[self.path.find_resource(k)for k in source_list]
57
+ inputs+=source_list
58
+ env['GLIB_MKENUMS_SOURCE']=[k.abspath()for k in source_list]
59
+ if not enum['target']:
60
+ raise Errors.WafError('missing target '+str(enum))
61
+ tgt_node=self.path.find_or_declare(enum['target'])
62
+ if tgt_node.name.endswith('.c'):
63
+ self.source.append(tgt_node)
64
+ env['GLIB_MKENUMS_TARGET']=tgt_node.abspath()
65
+ options=[]
66
+ if enum['template']:
67
+ template_node=self.path.find_resource(enum['template'])
68
+ options.append('--template %s'%(template_node.abspath()))
69
+ inputs.append(template_node)
70
+ params={'file-head':'--fhead','file-prod':'--fprod','file-tail':'--ftail','enum-prod':'--eprod','value-head':'--vhead','value-prod':'--vprod','value-tail':'--vtail','comments':'--comments'}
71
+ for param,option in params.items():
72
+ if enum[param]:
73
+ options.append('%s %r'%(option,enum[param]))
74
+ env['GLIB_MKENUMS_OPTIONS']=' '.join(options)
75
+ task.set_inputs(inputs)
76
+ task.set_outputs(tgt_node)
77
+ class glib_mkenums(Task.Task):
78
+ run_str='${GLIB_MKENUMS} ${GLIB_MKENUMS_OPTIONS} ${GLIB_MKENUMS_SOURCE} > ${GLIB_MKENUMS_TARGET}'
79
+ color='PINK'
80
+ ext_out=['.h']
81
+ def add_settings_schemas(self,filename_list):
82
+ if not hasattr(self,'settings_schema_files'):
83
+ self.settings_schema_files=[]
84
+ if not isinstance(filename_list,list):
85
+ filename_list=[filename_list]
86
+ self.settings_schema_files.extend(filename_list)
87
+ def add_settings_enums(self,namespace,filename_list):
88
+ if hasattr(self,'settings_enum_namespace'):
89
+ raise Errors.WafError("Tried to add gsettings enums to '%s' more than once"%self.name)
90
+ self.settings_enum_namespace=namespace
91
+ if type(filename_list)!='list':
92
+ filename_list=[filename_list]
93
+ self.settings_enum_files=filename_list
94
+ def r_change_ext(self,ext):
95
+ name=self.name
96
+ k=name.rfind('.')
97
+ if k>=0:
98
+ name=name[:k]+ext
99
+ else:
100
+ name=name+ext
101
+ return self.parent.find_or_declare([name])
102
+ def process_settings(self):
103
+ enums_tgt_node=[]
104
+ install_files=[]
105
+ settings_schema_files=getattr(self,'settings_schema_files',[])
106
+ if settings_schema_files and not self.env['GLIB_COMPILE_SCHEMAS']:
107
+ raise Errors.WafError("Unable to process GSettings schemas - glib-compile-schemas was not found during configure")
108
+ if hasattr(self,'settings_enum_files'):
109
+ enums_task=self.create_task('glib_mkenums')
110
+ source_list=self.settings_enum_files
111
+ source_list=[self.path.find_resource(k)for k in source_list]
112
+ enums_task.set_inputs(source_list)
113
+ enums_task.env['GLIB_MKENUMS_SOURCE']=[k.abspath()for k in source_list]
114
+ target=self.settings_enum_namespace+'.enums.xml'
115
+ tgt_node=self.path.find_or_declare(target)
116
+ enums_task.set_outputs(tgt_node)
117
+ enums_task.env['GLIB_MKENUMS_TARGET']=tgt_node.abspath()
118
+ enums_tgt_node=[tgt_node]
119
+ install_files.append(tgt_node)
120
+ options='--comments "<!-- @comment@ -->" --fhead "<schemalist>" --vhead " <@type@ id=\\"%s.@EnumName@\\">" --vprod " <value nick=\\"@valuenick@\\" value=\\"@valuenum@\\"/>" --vtail " </@type@>" --ftail "</schemalist>" '%(self.settings_enum_namespace)
121
+ enums_task.env['GLIB_MKENUMS_OPTIONS']=options
122
+ for schema in settings_schema_files:
123
+ schema_task=self.create_task('glib_validate_schema')
124
+ schema_node=self.path.find_resource(schema)
125
+ if not schema_node:
126
+ raise Errors.WafError("Cannot find the schema file '%s'"%schema)
127
+ install_files.append(schema_node)
128
+ source_list=enums_tgt_node+[schema_node]
129
+ schema_task.set_inputs(source_list)
130
+ schema_task.env['GLIB_COMPILE_SCHEMAS_OPTIONS']=[("--schema-file="+k.abspath())for k in source_list]
131
+ target_node=r_change_ext(schema_node,'.xml.valid')
132
+ schema_task.set_outputs(target_node)
133
+ schema_task.env['GLIB_VALIDATE_SCHEMA_OUTPUT']=target_node.abspath()
134
+ def compile_schemas_callback(bld):
135
+ if not bld.is_install:return
136
+ Logs.pprint('YELLOW','Updating GSettings schema cache')
137
+ command=Utils.subst_vars("${GLIB_COMPILE_SCHEMAS} ${GSETTINGSSCHEMADIR}",bld.env)
138
+ ret=self.bld.exec_command(command)
139
+ if self.bld.is_install:
140
+ if not self.env['GSETTINGSSCHEMADIR']:
141
+ raise Errors.WafError('GSETTINGSSCHEMADIR not defined (should have been set up automatically during configure)')
142
+ if install_files:
143
+ self.bld.install_files(self.env['GSETTINGSSCHEMADIR'],install_files)
144
+ if not hasattr(self.bld,'_compile_schemas_registered'):
145
+ self.bld.add_post_fun(compile_schemas_callback)
146
+ self.bld._compile_schemas_registered=True
147
+ class glib_validate_schema(Task.Task):
148
+ run_str='rm -f ${GLIB_VALIDATE_SCHEMA_OUTPUT} && ${GLIB_COMPILE_SCHEMAS} --dry-run ${GLIB_COMPILE_SCHEMAS_OPTIONS} && touch ${GLIB_VALIDATE_SCHEMA_OUTPUT}'
149
+ color='PINK'
150
+ def configure(conf):
151
+ conf.find_program('glib-genmarshal',var='GLIB_GENMARSHAL')
152
+ conf.find_perl_program('glib-mkenums',var='GLIB_MKENUMS')
153
+ conf.find_program('glib-compile-schemas',var='GLIB_COMPILE_SCHEMAS',mandatory=False)
154
+ def getstr(varname):
155
+ return getattr(Options.options,varname,getattr(conf.env,varname,''))
156
+ gsettingsschemadir=getstr('GSETTINGSSCHEMADIR')
157
+ if not gsettingsschemadir:
158
+ datadir=getstr('DATADIR')
159
+ if not datadir:
160
+ prefix=conf.env['PREFIX']
161
+ datadir=os.path.join(prefix,'share')
162
+ gsettingsschemadir=os.path.join(datadir,'glib-2.0','schemas')
163
+ conf.env['GSETTINGSSCHEMADIR']=gsettingsschemadir
164
+ def options(opt):
165
+ opt.add_option('--gsettingsschemadir',help='GSettings schema location [Default: ${datadir}/glib-2.0/schemas]',default='',dest='GSETTINGSSCHEMADIR')
166
+
167
+ taskgen_method(add_marshal_file)
168
+ before_method('process_source')(process_marshal)
169
+ taskgen_method(add_enums_from_template)
170
+ taskgen_method(add_enums)
171
+ before_method('process_source')(process_enums)
172
+ taskgen_method(add_settings_schemas)
173
+ taskgen_method(add_settings_enums)
174
+ feature('glib2')(process_settings)