module L::LD::LinkerGCC
Public Class Methods
available?()
click to toggle source
# File lib/rub/l/ld/linker/gcc.rb, line 32 def self.available? !!find end
find()
click to toggle source
Find the linker executable. @return [Pathname,nil] The path of the executable.
# File lib/rub/l/ld/linker/gcc.rb, line 38 def self.find C.find_command 'gcc' end
link_command(opt, files, libs, out, format)
click to toggle source
# File lib/rub/l/ld/linker/gcc.rb, line 42 def self.link_command(opt, files, libs, out, format) files = R::Tool.make_set_paths files libs = R::Tool.make_set libs out = C.path(out) c = [find, "-o#{out}"] c << opt.args c << case format when :exe [] when :shared ['-shared'] else raise "Unknown/unsupported output #{format}." end c << case opt.optimize when :none D:debug ? '-Og' : '-O0' when :some '-O1' when :full '-O2' when :max '-O3' else raise "Invalid optimization level #{opt.optimize}." end c << if opt.static '-static' else [] end c << opt.library_dirs.map{|d| "-L#{d}"} #c << libs.map{|l| "-l#{l}" } c << libs.map{|l| "#{l}" } c << files.to_a c.flatten end
name()
click to toggle source
# File lib/rub/l/ld/linker/gcc.rb, line 28 def self.name :gcc end