diff options
Diffstat (limited to 'tasks/toolchains/openwrt.rake')
| -rw-r--r-- | tasks/toolchains/openwrt.rake | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/tasks/toolchains/openwrt.rake b/tasks/toolchains/openwrt.rake index c376d96ec..d5763d8de 100644 --- a/tasks/toolchains/openwrt.rake +++ b/tasks/toolchains/openwrt.rake @@ -1,24 +1,19 @@ # usage of environmental variables to set the # cross compiling toolchain proper MRuby::Toolchain.new(:openwrt) do |conf| - [conf.cc, conf.objc, conf.asm].each do |cc| - cc.command = ENV['TARGET_CC'] - cc.flags = ENV['TARGET_CFLAGS'] - cc.include_paths = ["#{MRUBY_ROOT}/include"] + [conf.cc, conf.cxx, conf.objc, conf.asm].each do |cc| + if cc == conf.cxx + cc.command = ENV['TARGET_CXX'] + cc.flags = ENV['TARGET_CXXFLAGS'] + else + cc.command = ENV['TARGET_CC'] + cc.flags = ENV['TARGET_CFLAGS'] + end cc.option_include_path = %q[-I"%s"] cc.option_define = '-D%s' - cc.compile_options = %q[%{flags} -MMD -o "%{outfile}" -c "%{infile}"] + cc.compile_options = %q[%{flags} -MMD -MF "%{outfile}.d" -o "%{outfile}" -c "%{infile}"] end - [conf.cxx].each do |cxx| - cxx.command = ENV['TARGET_CXX'] - cxx.flags = ENV['TARGET_CXXFLAGS'] - cxx.include_paths = ["#{MRUBY_ROOT}/include"] - cxx.option_include_path = %q[-I"%s"] - cxx.option_define = '-D%s' - cxx.compile_options = %q[%{flags} -MMD -o "%{outfile}" -c "%{infile}"] - end - conf.linker do |linker| linker.command = ENV['TARGET_CC'] linker.flags = ENV['TARGET_LDFLAGS'] |
