text_ux 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +25 -0
- data/.rspec +2 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +51 -0
- data/Rakefile +18 -0
- data/ext/text_ux/extconf.rb +5 -0
- data/ext/text_ux/text_ux.cpp +252 -0
- data/lib/text_ux.rb +5 -0
- data/lib/text_ux/version.rb +3 -0
- data/spec/fixtures/test.ux +0 -0
- data/spec/spec_helper.rb +19 -0
- data/spec/text_ux_spec.rb +137 -0
- data/text_ux.gemspec +26 -0
- data/vendor/ux-trie/ux-0.1.9/.lock-waf_darwin_build +8 -0
- data/vendor/ux-trie/ux-0.1.9/.unittest-gtest/gtest-1.6.0/fused-src/gtest/gtest-all.cc +9118 -0
- data/vendor/ux-trie/ux-0.1.9/.unittest-gtest/gtest-1.6.0/fused-src/gtest/gtest.h +19537 -0
- data/vendor/ux-trie/ux-0.1.9/.unittest-gtest/gtest-1.6.0/fused-src/gtest/gtest_main.cc +39 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Build.py +733 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Build.pyc +0 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/ConfigSet.py +147 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/ConfigSet.pyc +0 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Configure.py +314 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Configure.pyc +0 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Context.py +298 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Context.pyc +0 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Errors.py +37 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Errors.pyc +0 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Logs.py +149 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Logs.pyc +0 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Node.py +500 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Node.pyc +0 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Options.py +130 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Options.pyc +0 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Runner.py +191 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Runner.pyc +0 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Scripting.py +358 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Scripting.pyc +0 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Task.py +669 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Task.pyc +0 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/TaskGen.py +341 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/TaskGen.pyc +0 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/__init__.py +4 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/__init__.pyc +0 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/ar.py +12 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/ar.pyc +0 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/asm.py +25 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/bison.py +29 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/c.py +27 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/c_aliases.py +56 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/c_aliases.pyc +0 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/c_config.py +708 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/c_config.pyc +0 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/c_osx.py +121 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/c_osx.pyc +0 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/c_preproc.py +606 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/c_preproc.pyc +0 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/c_tests.py +110 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/c_tests.pyc +0 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/ccroot.py +372 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/ccroot.pyc +0 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/compiler_c.py +39 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/compiler_cxx.py +39 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/compiler_cxx.pyc +0 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/compiler_d.py +30 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/compiler_fc.py +45 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/cs.py +98 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/cxx.py +27 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/cxx.pyc +0 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/d.py +51 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/d_config.py +47 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/d_scan.py +133 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/dbus.py +30 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/dmd.py +43 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/errcheck.py +153 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/fc.py +123 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/fc_config.py +271 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/fc_scan.py +68 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/flex.py +27 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/g95.py +55 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/gas.py +10 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/gcc.py +98 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/gdc.py +34 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/gfortran.py +69 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/glib2.py +174 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/gnu_dirs.py +65 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/gxx.py +98 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/gxx.pyc +0 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/icc.py +31 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/icpc.py +30 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/ifort.py +42 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/intltool.py +78 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/irixcc.py +49 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/javaw.py +272 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/kde4.py +49 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/lua.py +19 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/msvc.py +650 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/nasm.py +13 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/perl.py +78 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/python.py +303 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/qt4.py +424 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/ruby.py +104 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/suncc.py +54 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/suncxx.py +55 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/tex.py +222 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/vala.py +215 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/waf_unit_test.py +79 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/winres.py +34 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/xlc.py +46 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/xlcxx.py +46 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Utils.py +334 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Utils.pyc +0 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/__init__.py +4 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/__init__.pyc +0 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/ansiterm.py +173 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/ansiterm.pyc +0 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/extras/__init__.py +4 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/extras/__init__.pyc +0 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/extras/compat15.py +223 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/extras/compat15.pyc +0 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/fixpy2.py +50 -0
- data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/fixpy2.pyc +0 -0
- data/vendor/ux-trie/ux-0.1.9/src/bitVec.cpp +119 -0
- data/vendor/ux-trie/ux-0.1.9/src/bitVec.hpp +64 -0
- data/vendor/ux-trie/ux-0.1.9/src/bitVecTest.cpp +143 -0
- data/vendor/ux-trie/ux-0.1.9/src/cmdline.h +809 -0
- data/vendor/ux-trie/ux-0.1.9/src/rsDic.cpp +121 -0
- data/vendor/ux-trie/ux-0.1.9/src/rsDic.hpp +57 -0
- data/vendor/ux-trie/ux-0.1.9/src/ux.hpp +26 -0
- data/vendor/ux-trie/ux-0.1.9/src/uxMain.cpp +206 -0
- data/vendor/ux-trie/ux-0.1.9/src/uxMap.cpp +0 -0
- data/vendor/ux-trie/ux-0.1.9/src/uxMap.hpp +248 -0
- data/vendor/ux-trie/ux-0.1.9/src/uxMapTest.cpp +139 -0
- data/vendor/ux-trie/ux-0.1.9/src/uxTest.cpp +229 -0
- data/vendor/ux-trie/ux-0.1.9/src/uxTrie.cpp +529 -0
- data/vendor/ux-trie/ux-0.1.9/src/uxTrie.hpp +220 -0
- data/vendor/ux-trie/ux-0.1.9/src/uxUtil.cpp +92 -0
- data/vendor/ux-trie/ux-0.1.9/src/uxUtil.hpp +35 -0
- data/vendor/ux-trie/ux-0.1.9/src/wscript +43 -0
- data/vendor/ux-trie/ux-0.1.9/unittest_gtest.py +0 -0
- data/vendor/ux-trie/ux-0.1.9/unittest_gtest.pyc +0 -0
- data/vendor/ux-trie/ux-0.1.9/unittestt.py +166 -0
- data/vendor/ux-trie/ux-0.1.9/ux.pc.in +10 -0
- data/vendor/ux-trie/ux-0.1.9/waf +0 -0
- data/vendor/ux-trie/ux-0.1.9/wscript +32 -0
- metadata +249 -0
@@ -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
|
+
from waflib import Task,Errors
|
6
|
+
from waflib.TaskGen import taskgen_method,before_method
|
7
|
+
def add_dbus_file(self,filename,prefix,mode):
|
8
|
+
if not hasattr(self,'dbus_lst'):
|
9
|
+
self.dbus_lst=[]
|
10
|
+
if not'process_dbus'in self.meths:
|
11
|
+
self.meths.append('process_dbus')
|
12
|
+
self.dbus_lst.append([filename,prefix,mode])
|
13
|
+
def process_dbus(self):
|
14
|
+
for filename,prefix,mode in getattr(self,'dbus_lst',[]):
|
15
|
+
node=self.path.find_resource(filename)
|
16
|
+
if not node:
|
17
|
+
raise Errors.WafError('file not found '+filename)
|
18
|
+
tsk=self.create_task('dbus_binding_tool',node,node.change_ext('.h'))
|
19
|
+
tsk.env.DBUS_BINDING_TOOL_PREFIX=prefix
|
20
|
+
tsk.env.DBUS_BINDING_TOOL_MODE=mode
|
21
|
+
class dbus_binding_tool(Task.Task):
|
22
|
+
color='BLUE'
|
23
|
+
ext_out=['.h']
|
24
|
+
run_str='${DBUS_BINDING_TOOL} --prefix=${DBUS_BINDING_TOOL_PREFIX} --mode=${DBUS_BINDING_TOOL_MODE} --output=${TGT} ${SRC}'
|
25
|
+
shell=True
|
26
|
+
def configure(conf):
|
27
|
+
dbus_binding_tool=conf.find_program('dbus-binding-tool',var='DBUS_BINDING_TOOL')
|
28
|
+
|
29
|
+
taskgen_method(add_dbus_file)
|
30
|
+
before_method('apply_core')(process_dbus)
|
@@ -0,0 +1,43 @@
|
|
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_dmd(conf):
|
9
|
+
conf.find_program(['dmd','ldc'],var='D')
|
10
|
+
def common_flags_ldc(conf):
|
11
|
+
v=conf.env
|
12
|
+
v['DFLAGS']=['-d-version=Posix']
|
13
|
+
v['LINKFLAGS']=[]
|
14
|
+
v['DFLAGS_dshlib']=['-relocation-model=pic']
|
15
|
+
def common_flags_dmd(conf):
|
16
|
+
v=conf.env
|
17
|
+
v['D_SRC_F']=['-c']
|
18
|
+
v['D_TGT_F']='-of%s'
|
19
|
+
v['D_LINKER']=v['D']
|
20
|
+
v['DLNK_SRC_F']=''
|
21
|
+
v['DLNK_TGT_F']='-of%s'
|
22
|
+
v['DINC_ST']='-I%s'
|
23
|
+
v['DSHLIB_MARKER']=v['DSTLIB_MARKER']=''
|
24
|
+
v['DSTLIB_ST']=v['DSHLIB_ST']='-L-l%s'
|
25
|
+
v['DSTLIBPATH_ST']=v['DLIBPATH_ST']='-L-L%s'
|
26
|
+
v['LINKFLAGS_dprogram']=['-quiet']
|
27
|
+
v['DFLAGS_dshlib']=['-fPIC']
|
28
|
+
v['LINKFLAGS_dshlib']=['-L-shared']
|
29
|
+
v['DHEADER_ext']='.di'
|
30
|
+
v.DFLAGS_d_with_header=['-H','-Hf']
|
31
|
+
v['D_HDR_F']='%s'
|
32
|
+
def configure(conf):
|
33
|
+
conf.find_dmd()
|
34
|
+
conf.load('ar')
|
35
|
+
conf.load('d')
|
36
|
+
conf.common_flags_dmd()
|
37
|
+
conf.d_platform_flags()
|
38
|
+
if str(conf.env.D).find('ldc')>-1:
|
39
|
+
conf.common_flags_ldc()
|
40
|
+
|
41
|
+
conf(find_dmd)
|
42
|
+
conf(common_flags_ldc)
|
43
|
+
conf(common_flags_dmd)
|
data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/errcheck.py
ADDED
@@ -0,0 +1,153 @@
|
|
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
|
+
typos={'feature':'features','sources':'source','targets':'target','include':'includes','export_include':'export_includes','define':'defines','importpath':'includes','installpath':'install_path',}
|
8
|
+
meths_typos=['__call__','program','shlib','stlib','objects']
|
9
|
+
from waflib import Logs,Build,Node,Task,TaskGen,ConfigSet,Errors,Utils
|
10
|
+
import waflib.Tools.ccroot
|
11
|
+
def check_same_targets(self):
|
12
|
+
mp=Utils.defaultdict(list)
|
13
|
+
uids={}
|
14
|
+
def check_task(tsk):
|
15
|
+
if not isinstance(tsk,Task.Task):
|
16
|
+
return
|
17
|
+
for node in tsk.outputs:
|
18
|
+
mp[node].append(tsk)
|
19
|
+
try:
|
20
|
+
uids[tsk.uid()].append(tsk)
|
21
|
+
except:
|
22
|
+
uids[tsk.uid()]=[tsk]
|
23
|
+
for g in self.groups:
|
24
|
+
for tg in g:
|
25
|
+
try:
|
26
|
+
for tsk in tg.tasks:
|
27
|
+
check_task(tsk)
|
28
|
+
except AttributeError:
|
29
|
+
check_task(tg)
|
30
|
+
dupe=False
|
31
|
+
for(k,v)in mp.items():
|
32
|
+
if len(v)>1:
|
33
|
+
dupe=True
|
34
|
+
msg='* Node %r is created by more than once%s. The task generators are:'%(k,Logs.verbose==1 and" (full message on 'waf -v -v')"or"")
|
35
|
+
Logs.error(msg)
|
36
|
+
for x in v:
|
37
|
+
if Logs.verbose>1:
|
38
|
+
Logs.error(' %d. %r'%(1+v.index(x),x.generator))
|
39
|
+
else:
|
40
|
+
Logs.error(' %d. %r in %r'%(1+v.index(x),x.generator.name,getattr(x.generator,'path',None)))
|
41
|
+
if not dupe:
|
42
|
+
for(k,v)in uids.items():
|
43
|
+
if len(v)>1:
|
44
|
+
Logs.error('* Several tasks use the same identifier. Please check the information on\n http://waf.googlecode.com/git/docs/apidocs/Task.html#waflib.Task.Task.uid')
|
45
|
+
for tsk in v:
|
46
|
+
Logs.error(' - object %r (%r) defined in %r'%(tsk.__class__.__name__,tsk,tsk.generator))
|
47
|
+
def check_invalid_constraints(self):
|
48
|
+
feat=set([])
|
49
|
+
for x in list(TaskGen.feats.values()):
|
50
|
+
feat.union(set(x))
|
51
|
+
for(x,y)in TaskGen.task_gen.prec.items():
|
52
|
+
feat.add(x)
|
53
|
+
feat.union(set(y))
|
54
|
+
ext=set([])
|
55
|
+
for x in TaskGen.task_gen.mappings.values():
|
56
|
+
ext.add(x.__name__)
|
57
|
+
invalid=ext&feat
|
58
|
+
if invalid:
|
59
|
+
Logs.error('The methods %r have invalid annotations: @extension <-> @feature/@before_method/@after_method'%list(invalid))
|
60
|
+
for cls in list(Task.classes.values()):
|
61
|
+
for x in('before','after'):
|
62
|
+
for y in Utils.to_list(getattr(cls,x,[])):
|
63
|
+
if not Task.classes.get(y,None):
|
64
|
+
Logs.error('Erroneous order constraint %r=%r on task class %r'%(x,y,cls.__name__))
|
65
|
+
def replace(m):
|
66
|
+
oldcall=getattr(Build.BuildContext,m)
|
67
|
+
def call(self,*k,**kw):
|
68
|
+
ret=oldcall(self,*k,**kw)
|
69
|
+
for x in typos:
|
70
|
+
if x in kw:
|
71
|
+
err=True
|
72
|
+
Logs.error('Fix the typo %r -> %r on %r'%(x,typos[x],ret))
|
73
|
+
return ret
|
74
|
+
setattr(Build.BuildContext,m,call)
|
75
|
+
def enhance_lib():
|
76
|
+
for m in meths_typos:
|
77
|
+
replace(m)
|
78
|
+
old_ant_glob=Node.Node.ant_glob
|
79
|
+
def ant_glob(self,*k,**kw):
|
80
|
+
if k:
|
81
|
+
lst=Utils.to_list(k[0])
|
82
|
+
for pat in lst:
|
83
|
+
if'..'in pat.split('/'):
|
84
|
+
Logs.error("In ant_glob pattern %r: '..' means 'two dots', not 'parent directory'"%k[0])
|
85
|
+
return old_ant_glob(self,*k,**kw)
|
86
|
+
Node.Node.ant_glob=ant_glob
|
87
|
+
old=Task.is_before
|
88
|
+
def is_before(t1,t2):
|
89
|
+
ret=old(t1,t2)
|
90
|
+
if ret and old(t2,t1):
|
91
|
+
Logs.error('Contradictory order constraints in classes %r %r'%(t1,t2))
|
92
|
+
return ret
|
93
|
+
Task.is_before=is_before
|
94
|
+
def check_err_features(self):
|
95
|
+
lst=self.to_list(self.features)
|
96
|
+
if'shlib'in lst:
|
97
|
+
Logs.error('feature shlib -> cshlib, dshlib or cxxshlib')
|
98
|
+
for x in('c','cxx','d','fc'):
|
99
|
+
if not x in lst and lst and lst[0]in[x+y for y in('program','shlib','stlib')]:
|
100
|
+
Logs.error('%r features is probably missing %r'%(self,x))
|
101
|
+
TaskGen.feature('*')(check_err_features)
|
102
|
+
def check_err_order(self):
|
103
|
+
if not hasattr(self,'rule'):
|
104
|
+
for x in('before','after','ext_in','ext_out'):
|
105
|
+
if hasattr(self,x):
|
106
|
+
Logs.warn('Erroneous order constraint %r on non-rule based task generator %r'%(x,self))
|
107
|
+
else:
|
108
|
+
for x in('before','after'):
|
109
|
+
for y in self.to_list(getattr(self,x,[])):
|
110
|
+
if not Task.classes.get(y,None):
|
111
|
+
Logs.error('Erroneous order constraint %s=%r on %r'%(x,y,self))
|
112
|
+
TaskGen.feature('*')(check_err_order)
|
113
|
+
def check_compile(self):
|
114
|
+
check_invalid_constraints(self)
|
115
|
+
try:
|
116
|
+
ret=self.orig_compile()
|
117
|
+
finally:
|
118
|
+
check_same_targets(self)
|
119
|
+
return ret
|
120
|
+
Build.BuildContext.orig_compile=Build.BuildContext.compile
|
121
|
+
Build.BuildContext.compile=check_compile
|
122
|
+
def use_rec(self,name,**kw):
|
123
|
+
try:
|
124
|
+
y=self.bld.get_tgen_by_name(name)
|
125
|
+
except Errors.WafError:
|
126
|
+
pass
|
127
|
+
else:
|
128
|
+
idx=self.bld.get_group_idx(self)
|
129
|
+
odx=self.bld.get_group_idx(y)
|
130
|
+
if odx>idx:
|
131
|
+
msg="Invalid 'use' across build groups:"
|
132
|
+
if Logs.verbose>1:
|
133
|
+
msg+='\n target %r\n uses:\n %r'%(self,y)
|
134
|
+
else:
|
135
|
+
msg+=" %r uses %r (try 'waf -v -v' for the full error)"%(self.name,name)
|
136
|
+
raise Errors.WafError(msg)
|
137
|
+
self.orig_use_rec(name,**kw)
|
138
|
+
TaskGen.task_gen.orig_use_rec=TaskGen.task_gen.use_rec
|
139
|
+
TaskGen.task_gen.use_rec=use_rec
|
140
|
+
def getattri(self,name,default=None):
|
141
|
+
if name=='append'or name=='add':
|
142
|
+
raise Errors.WafError('env.append and env.add do not exist: use env.append_value/env.append_unique')
|
143
|
+
elif name=='prepend':
|
144
|
+
raise Errors.WafError('env.prepend does not exist: use env.prepend_value')
|
145
|
+
if name in self.__slots__:
|
146
|
+
return object.__getattr__(self,name,default)
|
147
|
+
else:
|
148
|
+
return self[name]
|
149
|
+
ConfigSet.ConfigSet.__getattr__=getattri
|
150
|
+
def options(opt):
|
151
|
+
enhance_lib()
|
152
|
+
def configure(conf):
|
153
|
+
pass
|
@@ -0,0 +1,123 @@
|
|
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 re
|
8
|
+
from waflib import Utils,Task,TaskGen,Logs
|
9
|
+
from waflib.Tools import ccroot,fc_config,fc_scan
|
10
|
+
from waflib.TaskGen import feature,before_method,after_method,extension
|
11
|
+
from waflib.Configure import conf
|
12
|
+
ccroot.USELIB_VARS['fc']=set(['FCFLAGS','DEFINES','INCLUDES'])
|
13
|
+
ccroot.USELIB_VARS['fcprogram_test']=ccroot.USELIB_VARS['fcprogram']=set(['LIB','STLIB','LIBPATH','STLIBPATH','LINKFLAGS','RPATH','LINKDEPS'])
|
14
|
+
ccroot.USELIB_VARS['fcshlib']=set(['LIB','STLIB','LIBPATH','STLIBPATH','LINKFLAGS','RPATH','LINKDEPS'])
|
15
|
+
ccroot.USELIB_VARS['fcstlib']=set(['ARFLAGS','LINKDEPS'])
|
16
|
+
def dummy(self):
|
17
|
+
pass
|
18
|
+
def fc_hook(self,node):
|
19
|
+
return self.create_compiled_task('fc',node)
|
20
|
+
def modfile(conf,name):
|
21
|
+
return{'lower':name.lower()+'.mod','lower.MOD':name.upper()+'.MOD','UPPER.mod':name.upper()+'.mod','UPPER':name.upper()+'.MOD'}[conf.env.FC_MOD_CAPITALIZATION or'lower']
|
22
|
+
def get_fortran_tasks(tsk):
|
23
|
+
bld=tsk.generator.bld
|
24
|
+
tasks=bld.get_tasks_group(bld.get_group_idx(tsk.generator))
|
25
|
+
return[x for x in tasks if isinstance(x,fc)and not getattr(x,'nomod',None)and not getattr(x,'mod_fortran_done',None)]
|
26
|
+
class fc(Task.Task):
|
27
|
+
color='GREEN'
|
28
|
+
run_str='${FC} ${FCFLAGS} ${FCINCPATH_ST:INCPATHS} ${FCDEFINES_ST:DEFINES} ${_FCMODOUTFLAGS} ${FC_TGT_F}${TGT[0].abspath()} ${FC_SRC_F}${SRC[0].abspath()}'
|
29
|
+
vars=["FORTRANMODPATHFLAG"]
|
30
|
+
def scan(self):
|
31
|
+
tmp=fc_scan.fortran_parser(self.generator.includes_nodes)
|
32
|
+
tmp.task=self
|
33
|
+
tmp.start(self.inputs[0])
|
34
|
+
if Logs.verbose:
|
35
|
+
Logs.debug('deps: deps for %r: %r; unresolved %r'%(self.inputs,tmp.nodes,tmp.names))
|
36
|
+
return(tmp.nodes,tmp.names)
|
37
|
+
def runnable_status(self):
|
38
|
+
if getattr(self,'mod_fortran_done',None):
|
39
|
+
return super(fc,self).runnable_status()
|
40
|
+
bld=self.generator.bld
|
41
|
+
lst=get_fortran_tasks(self)
|
42
|
+
for tsk in lst:
|
43
|
+
tsk.mod_fortran_done=True
|
44
|
+
for tsk in lst:
|
45
|
+
ret=tsk.runnable_status()
|
46
|
+
if ret==Task.ASK_LATER:
|
47
|
+
for x in lst:
|
48
|
+
x.mod_fortran_done=None
|
49
|
+
return Task.ASK_LATER
|
50
|
+
ins=Utils.defaultdict(set)
|
51
|
+
outs=Utils.defaultdict(set)
|
52
|
+
for tsk in lst:
|
53
|
+
key=tsk.uid()
|
54
|
+
for x in bld.raw_deps[key]:
|
55
|
+
if x.startswith('MOD@'):
|
56
|
+
name=bld.modfile(x.replace('MOD@',''))
|
57
|
+
node=bld.srcnode.find_or_declare(name)
|
58
|
+
tsk.set_outputs(node)
|
59
|
+
outs[id(node)].add(tsk)
|
60
|
+
for tsk in lst:
|
61
|
+
key=tsk.uid()
|
62
|
+
for x in bld.raw_deps[key]:
|
63
|
+
if x.startswith('USE@'):
|
64
|
+
name=bld.modfile(x.replace('USE@',''))
|
65
|
+
node=bld.srcnode.find_resource(name)
|
66
|
+
if node and node not in tsk.outputs:
|
67
|
+
if not node in bld.node_deps[key]:
|
68
|
+
bld.node_deps[key].append(node)
|
69
|
+
ins[id(node)].add(tsk)
|
70
|
+
for k in ins.keys():
|
71
|
+
for a in ins[k]:
|
72
|
+
a.run_after.update(outs[k])
|
73
|
+
tmp=[]
|
74
|
+
for t in outs[k]:
|
75
|
+
tmp.extend(t.outputs)
|
76
|
+
a.dep_nodes.extend(tmp)
|
77
|
+
try:
|
78
|
+
a.dep_nodes.sort(key=lambda x:x.abspath())
|
79
|
+
except:
|
80
|
+
a.dep_nodes.sort(lambda x,y:cmp(x.abspath(),y.abspath()))
|
81
|
+
for tsk in lst:
|
82
|
+
try:
|
83
|
+
delattr(tsk,'cache_sig')
|
84
|
+
except AttributeError:
|
85
|
+
pass
|
86
|
+
return super(fc,self).runnable_status()
|
87
|
+
class fcprogram(ccroot.link_task):
|
88
|
+
color='YELLOW'
|
89
|
+
run_str='${FC} ${LINKFLAGS} ${FCLNK_SRC_F}${SRC} ${FCLNK_TGT_F}${TGT[0].abspath()} ${RPATH_ST:RPATH} ${FCSTLIB_MARKER} ${FCSTLIBPATH_ST:STLIBPATH} ${FCSTLIB_ST:STLIB} ${FCSHLIB_MARKER} ${FCLIBPATH_ST:LIBPATH} ${FCLIB_ST:LIB}'
|
90
|
+
inst_to='${BINDIR}'
|
91
|
+
chmod=Utils.O755
|
92
|
+
class fcshlib(fcprogram):
|
93
|
+
inst_to='${LIBDIR}'
|
94
|
+
class fcprogram_test(fcprogram):
|
95
|
+
def can_retrieve_cache(self):
|
96
|
+
return False
|
97
|
+
def runnable_status(self):
|
98
|
+
ret=super(fcprogram_test,self).runnable_status()
|
99
|
+
if ret==Task.SKIP_ME:
|
100
|
+
ret=Task.RUN_ME
|
101
|
+
return ret
|
102
|
+
def exec_command(self,cmd,**kw):
|
103
|
+
bld=self.generator.bld
|
104
|
+
kw['shell']=isinstance(cmd,str)
|
105
|
+
kw['stdout']=kw['stderr']=Utils.subprocess.PIPE
|
106
|
+
kw['cwd']=bld.variant_dir
|
107
|
+
bld.out=bld.err=''
|
108
|
+
bld.to_log('command: %s\n'%cmd)
|
109
|
+
kw['output']=0
|
110
|
+
try:
|
111
|
+
(bld.out,bld.err)=bld.cmd_and_log(cmd,**kw)
|
112
|
+
except Exception ,e:
|
113
|
+
return-1
|
114
|
+
if bld.out:
|
115
|
+
bld.to_log("out: %s\n"%bld.out)
|
116
|
+
if bld.err:
|
117
|
+
bld.to_log("err: %s\n"%bld.err)
|
118
|
+
class fcstlib(ccroot.stlink_task):
|
119
|
+
pass
|
120
|
+
|
121
|
+
feature('fcprogram','fcshlib','fcstlib','fcprogram_test')(dummy)
|
122
|
+
extension('.f','.f90','.F','.F90','.for','.FOR')(fc_hook)
|
123
|
+
conf(modfile)
|
data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/fc_config.py
ADDED
@@ -0,0 +1,271 @@
|
|
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,shutil,os,sys,string,shlex
|
6
|
+
from waflib.Configure import conf
|
7
|
+
from waflib.TaskGen import feature,after_method,before_method
|
8
|
+
from waflib import Build,Utils
|
9
|
+
FC_FRAGMENT=' program main\n end program main\n'
|
10
|
+
FC_FRAGMENT2=' PROGRAM MAIN\n END\n'
|
11
|
+
def fc_flags(conf):
|
12
|
+
v=conf.env
|
13
|
+
v['FC_SRC_F']=[]
|
14
|
+
v['FC_TGT_F']=['-c','-o']
|
15
|
+
v['FCINCPATH_ST']='-I%s'
|
16
|
+
v['FCDEFINES_ST']='-D%s'
|
17
|
+
if not v['LINK_FC']:v['LINK_FC']=v['FC']
|
18
|
+
v['FCLNK_SRC_F']=[]
|
19
|
+
v['FCLNK_TGT_F']=['-o']
|
20
|
+
v['FCFLAGS_fcshlib']=['-fpic']
|
21
|
+
v['LINKFLAGS_fcshlib']=['-shared']
|
22
|
+
v['fcshlib_PATTERN']='lib%s.so'
|
23
|
+
v['fcstlib_PATTERN']='lib%s.a'
|
24
|
+
v['FCLIB_ST']='-l%s'
|
25
|
+
v['FCLIBPATH_ST']='-L%s'
|
26
|
+
v['FCSTLIB_ST']='-l%s'
|
27
|
+
v['FCSTLIBPATH_ST']='-L%s'
|
28
|
+
v['FCSTLIB_MARKER']='-Wl,-Bstatic'
|
29
|
+
v['FCSHLIB_MARKER']='-Wl,-Bdynamic'
|
30
|
+
v['SONAME_ST']='-Wl,-h,%s'
|
31
|
+
def check_fortran(self,*k,**kw):
|
32
|
+
self.check_cc(fragment=FC_FRAGMENT,compile_filename='test.f',features='fc fcprogram',msg='Compiling a simple fortran app')
|
33
|
+
def check_fc(self,*k,**kw):
|
34
|
+
kw['compiler']='fc'
|
35
|
+
if not'compile_mode'in kw:
|
36
|
+
kw['compile_mode']='fc'
|
37
|
+
if not'type'in kw:
|
38
|
+
kw['type']='fcprogram'
|
39
|
+
if not'compile_filename'in kw:
|
40
|
+
kw['compile_filename']='test.f90'
|
41
|
+
if not'code'in kw:
|
42
|
+
kw['code']=FC_FRAGMENT
|
43
|
+
return self.check(*k,**kw)
|
44
|
+
def fortran_modifier_darwin(conf):
|
45
|
+
v=conf.env
|
46
|
+
v['FCFLAGS_fcshlib']=['-fPIC','-compatibility_version','1','-current_version','1']
|
47
|
+
v['LINKFLAGS_fcshlib']=['-dynamiclib']
|
48
|
+
v['fcshlib_PATTERN']='lib%s.dylib'
|
49
|
+
v['FRAMEWORKPATH_ST']='-F%s'
|
50
|
+
v['FRAMEWORK_ST']='-framework %s'
|
51
|
+
v['LINKFLAGS_fcstlib']=[]
|
52
|
+
v['FCSHLIB_MARKER']=''
|
53
|
+
v['FCSTLIB_MARKER']=''
|
54
|
+
v['SONAME_ST']=''
|
55
|
+
def fortran_modifier_win32(conf):
|
56
|
+
v=conf.env
|
57
|
+
v['fcprogram_PATTERN']=v['fcprogram_test_PATTERN']='%s.exe'
|
58
|
+
v['fcshlib_PATTERN']='%s.dll'
|
59
|
+
v['implib_PATTERN']='lib%s.dll.a'
|
60
|
+
v['IMPLIB_ST']='-Wl,--out-implib,%s'
|
61
|
+
v['FCFLAGS_fcshlib']=[]
|
62
|
+
v.append_value('FCFLAGS_fcshlib',['-DDLL_EXPORT'])
|
63
|
+
v.append_value('LINKFLAGS',['-Wl,--enable-auto-import'])
|
64
|
+
def fortran_modifier_cygwin(conf):
|
65
|
+
fortran_modifier_win32(conf)
|
66
|
+
v=conf.env
|
67
|
+
v['fcshlib_PATTERN']='cyg%s.dll'
|
68
|
+
v.append_value('LINKFLAGS_fcshlib',['-Wl,--enable-auto-image-base'])
|
69
|
+
v['FCFLAGS_fcshlib']=[]
|
70
|
+
def check_fortran_dummy_main(self,*k,**kw):
|
71
|
+
if not self.env.CC:
|
72
|
+
self.fatal('A c compiler is required for check_fortran_dummy_main')
|
73
|
+
lst=['MAIN__','__MAIN','_MAIN','MAIN_','MAIN']
|
74
|
+
lst.extend([m.lower()for m in lst])
|
75
|
+
lst.append('')
|
76
|
+
self.start_msg('Detecting whether we need a dummy main')
|
77
|
+
for main in lst:
|
78
|
+
kw['fortran_main']=main
|
79
|
+
try:
|
80
|
+
self.check_cc(fragment='int %s() { return 0; }\n'%(main or'test'),features='c fcprogram',mandatory=True)
|
81
|
+
if not main:
|
82
|
+
self.env.FC_MAIN=-1
|
83
|
+
self.end_msg('no')
|
84
|
+
else:
|
85
|
+
self.env.FC_MAIN=main
|
86
|
+
self.end_msg('yes %s'%main)
|
87
|
+
break
|
88
|
+
except self.errors.ConfigurationError:
|
89
|
+
pass
|
90
|
+
else:
|
91
|
+
self.end_msg('not found')
|
92
|
+
self.fatal('could not detect whether fortran requires a dummy main, see the config.log')
|
93
|
+
GCC_DRIVER_LINE=re.compile('^Driving:')
|
94
|
+
POSIX_STATIC_EXT=re.compile('\S+\.a')
|
95
|
+
POSIX_LIB_FLAGS=re.compile('-l\S+')
|
96
|
+
def is_link_verbose(self,txt):
|
97
|
+
assert isinstance(txt,str)
|
98
|
+
for line in txt.splitlines():
|
99
|
+
if not GCC_DRIVER_LINE.search(line):
|
100
|
+
if POSIX_STATIC_EXT.search(line)or POSIX_LIB_FLAGS.search(line):
|
101
|
+
return True
|
102
|
+
return False
|
103
|
+
def check_fortran_verbose_flag(self,*k,**kw):
|
104
|
+
self.start_msg('fortran link verbose flag')
|
105
|
+
for x in['-v','--verbose','-verbose','-V']:
|
106
|
+
try:
|
107
|
+
self.check_cc(features='fc fcprogram_test',fragment=FC_FRAGMENT2,compile_filename='test.f',linkflags=[x],mandatory=True)
|
108
|
+
except self.errors.ConfigurationError:
|
109
|
+
pass
|
110
|
+
else:
|
111
|
+
if self.is_link_verbose(self.test_bld.err)or self.is_link_verbose(self.test_bld.out):
|
112
|
+
self.end_msg(x)
|
113
|
+
break
|
114
|
+
else:
|
115
|
+
self.end_msg('failure')
|
116
|
+
self.fatal('Could not obtain the fortran link verbose flag (see config.log)')
|
117
|
+
self.env.FC_VERBOSE_FLAG=x
|
118
|
+
return x
|
119
|
+
LINKFLAGS_IGNORED=[r'-lang*',r'-lcrt[a-zA-Z0-9\.]*\.o',r'-lc$',r'-lSystem',r'-libmil',r'-LIST:*',r'-LNO:*']
|
120
|
+
if os.name=='nt':
|
121
|
+
LINKFLAGS_IGNORED.extend([r'-lfrt*',r'-luser32',r'-lkernel32',r'-ladvapi32',r'-lmsvcrt',r'-lshell32',r'-lmingw',r'-lmoldname'])
|
122
|
+
else:
|
123
|
+
LINKFLAGS_IGNORED.append(r'-lgcc*')
|
124
|
+
RLINKFLAGS_IGNORED=[re.compile(f)for f in LINKFLAGS_IGNORED]
|
125
|
+
def _match_ignore(line):
|
126
|
+
for i in RLINKFLAGS_IGNORED:
|
127
|
+
if i.match(line):
|
128
|
+
return True
|
129
|
+
return False
|
130
|
+
def parse_fortran_link(lines):
|
131
|
+
final_flags=[]
|
132
|
+
for line in lines:
|
133
|
+
if not GCC_DRIVER_LINE.match(line):
|
134
|
+
_parse_flink_line(line,final_flags)
|
135
|
+
return final_flags
|
136
|
+
SPACE_OPTS=re.compile('^-[LRuYz]$')
|
137
|
+
NOSPACE_OPTS=re.compile('^-[RL]')
|
138
|
+
def _parse_flink_line(line,final_flags):
|
139
|
+
lexer=shlex.shlex(line,posix=True)
|
140
|
+
lexer.whitespace_split=True
|
141
|
+
t=lexer.get_token()
|
142
|
+
tmp_flags=[]
|
143
|
+
while t:
|
144
|
+
def parse(token):
|
145
|
+
if _match_ignore(token):
|
146
|
+
pass
|
147
|
+
elif token.startswith('-lkernel32')and sys.platform=='cygwin':
|
148
|
+
tmp_flags.append(token)
|
149
|
+
elif SPACE_OPTS.match(token):
|
150
|
+
t=lexer.get_token()
|
151
|
+
if t.startswith('P,'):
|
152
|
+
t=t[2:]
|
153
|
+
for opt in t.split(os.pathsep):
|
154
|
+
tmp_flags.append('-L%s'%opt)
|
155
|
+
elif NOSPACE_OPTS.match(token):
|
156
|
+
tmp_flags.append(token)
|
157
|
+
elif POSIX_LIB_FLAGS.match(token):
|
158
|
+
tmp_flags.append(token)
|
159
|
+
else:
|
160
|
+
pass
|
161
|
+
t=lexer.get_token()
|
162
|
+
return t
|
163
|
+
t=parse(t)
|
164
|
+
final_flags.extend(tmp_flags)
|
165
|
+
return final_flags
|
166
|
+
def check_fortran_clib(self,autoadd=True,*k,**kw):
|
167
|
+
if not self.env.FC_VERBOSE_FLAG:
|
168
|
+
self.fatal('env.FC_VERBOSE_FLAG is not set: execute check_fortran_verbose_flag?')
|
169
|
+
self.start_msg('Getting fortran runtime link flags')
|
170
|
+
try:
|
171
|
+
self.check_cc(fragment=FC_FRAGMENT2,compile_filename='test.f',features='fc fcprogram_test',linkflags=[self.env.FC_VERBOSE_FLAG])
|
172
|
+
except:
|
173
|
+
self.end_msg(False)
|
174
|
+
if kw.get('mandatory',True):
|
175
|
+
conf.fatal('Could not find the c library flags')
|
176
|
+
else:
|
177
|
+
out=self.test_bld.err
|
178
|
+
flags=parse_fortran_link(out.splitlines())
|
179
|
+
self.end_msg('ok (%s)'%' '.join(flags))
|
180
|
+
self.env.LINKFLAGS_CLIB=flags
|
181
|
+
return flags
|
182
|
+
return[]
|
183
|
+
def getoutput(conf,cmd,stdin=False):
|
184
|
+
try:
|
185
|
+
if stdin:
|
186
|
+
stdin=Utils.subprocess.PIPE
|
187
|
+
else:
|
188
|
+
stdin=None
|
189
|
+
p=Utils.subprocess.Popen(cmd,stdin=stdin,stdout=Utils.subprocess.PIPE,stderr=Utils.subprocess.PIPE)
|
190
|
+
if stdin:
|
191
|
+
p.stdin.write('\n')
|
192
|
+
stdout,stderr=p.communicate()
|
193
|
+
except:
|
194
|
+
conf.fatal('could not determine the compiler version %r'%cmd)
|
195
|
+
else:
|
196
|
+
if not isinstance(stdout,str):
|
197
|
+
stdout=stdout.decode(sys.stdout.encoding)
|
198
|
+
if not isinstance(stderr,str):
|
199
|
+
stderr=stderr.decode(sys.stdout.encoding)
|
200
|
+
return stdout,stderr
|
201
|
+
ROUTINES_CODE="""\
|
202
|
+
subroutine foobar()
|
203
|
+
return
|
204
|
+
end
|
205
|
+
subroutine foo_bar()
|
206
|
+
return
|
207
|
+
end
|
208
|
+
"""
|
209
|
+
MAIN_CODE="""
|
210
|
+
void %(dummy_func_nounder)s(void);
|
211
|
+
void %(dummy_func_under)s(void);
|
212
|
+
int %(main_func_name)s() {
|
213
|
+
%(dummy_func_nounder)s();
|
214
|
+
%(dummy_func_under)s();
|
215
|
+
return 0;
|
216
|
+
}
|
217
|
+
"""
|
218
|
+
def link_main_routines_tg_method(self):
|
219
|
+
def write_test_file(task):
|
220
|
+
task.outputs[0].write(task.generator.code)
|
221
|
+
bld=self.bld
|
222
|
+
bld(rule=write_test_file,target='main.c',code=MAIN_CODE%self.__dict__)
|
223
|
+
bld(rule=write_test_file,target='test.f',code=ROUTINES_CODE)
|
224
|
+
bld(features='fc fcstlib',source='test.f',target='test')
|
225
|
+
bld(features='c fcprogram',source='main.c',target='app',use='test')
|
226
|
+
def mangling_schemes():
|
227
|
+
for u in['_','']:
|
228
|
+
for du in['','_']:
|
229
|
+
for c in["lower","upper"]:
|
230
|
+
yield(u,du,c)
|
231
|
+
def mangle_name(u,du,c,name):
|
232
|
+
return getattr(name,c)()+u+(name.find('_')!=-1 and du or'')
|
233
|
+
def check_fortran_mangling(self,*k,**kw):
|
234
|
+
if not self.env.CC:
|
235
|
+
self.fatal('A c compiler is required for link_main_routines')
|
236
|
+
if not self.env.FC:
|
237
|
+
self.fatal('A fortran compiler is required for link_main_routines')
|
238
|
+
if not self.env.FC_MAIN:
|
239
|
+
self.fatal('Checking for mangling requires self.env.FC_MAIN (execute "check_fortran_dummy_main" first?)')
|
240
|
+
self.start_msg('Getting fortran mangling scheme')
|
241
|
+
for(u,du,c)in mangling_schemes():
|
242
|
+
try:
|
243
|
+
self.check_cc(compile_filename=[],features='link_main_routines_func',msg='nomsg',errmsg='nomsg',mandatory=True,dummy_func_nounder=mangle_name(u,du,c,"foobar"),dummy_func_under=mangle_name(u,du,c,"foo_bar"),main_func_name=self.env.FC_MAIN)
|
244
|
+
except self.errors.ConfigurationError:
|
245
|
+
pass
|
246
|
+
else:
|
247
|
+
self.end_msg("ok ('%s', '%s', '%s-case')"%(u,du,c))
|
248
|
+
self.env.FORTRAN_MANGLING=(u,du,c)
|
249
|
+
break
|
250
|
+
else:
|
251
|
+
self.end_msg(False)
|
252
|
+
self.fatal('mangler not found')
|
253
|
+
return(u,du,c)
|
254
|
+
def set_lib_pat(self):
|
255
|
+
self.env['fcshlib_PATTERN']=self.env['pyext_PATTERN']
|
256
|
+
|
257
|
+
conf(fc_flags)
|
258
|
+
conf(check_fortran)
|
259
|
+
conf(check_fc)
|
260
|
+
conf(fortran_modifier_darwin)
|
261
|
+
conf(fortran_modifier_win32)
|
262
|
+
conf(fortran_modifier_cygwin)
|
263
|
+
conf(check_fortran_dummy_main)
|
264
|
+
conf(is_link_verbose)
|
265
|
+
conf(check_fortran_verbose_flag)
|
266
|
+
conf(check_fortran_clib)
|
267
|
+
feature('link_main_routines_func')(link_main_routines_tg_method)
|
268
|
+
before_method('process_source')(link_main_routines_tg_method)
|
269
|
+
conf(check_fortran_mangling)
|
270
|
+
feature('pyext')(set_lib_pat)
|
271
|
+
before_method('propagate_uselib_vars','apply_link')(set_lib_pat)
|