Class: CCompiler

Inherits:
Compiler show all
Defined in:
lib/makeconf/compiler.rb

Instance Attribute Summary collapse

Attributes inherited from Compiler

#ld, #output, #sysroot

Instance Method Summary collapse

Methods inherited from Compiler

#cflags, #check_header, #clone, #command, #compile, #default_flags, #flags, #flags=, #has_option, #link, #makefile, #object_files, #quiet=, #rule, #shared_library=, #sources=, #test_compile, #test_link

Constructor Details

#initialize(options = {}) ⇒ CCompiler

Returns a new instance of CCompiler.



325
326
327
328
329
330
331
332
# File 'lib/makeconf/compiler.rb', line 325

def initialize(options = {})
  @search_list = options.has_key?(:search) ? options[:search] : [ 'cc', 'gcc', 'clang', 'cl.exe']
  @search_list = [ @search_list ] unless @search_list.kind_of?(Array)
  @output_type = nil
  super('C', '.c')
  printf "checking for a C compiler.. "
  @path = search(@search_list)
end

Instance Attribute Details

#output_typeObject

Returns the value of attribute output_type.



322
323
324
# File 'lib/makeconf/compiler.rb', line 322

def output_type
  @output_type
end

#pathObject (readonly)

Returns the value of attribute path.



323
324
325
# File 'lib/makeconf/compiler.rb', line 323

def path
  @path
end

Instance Method Details

#is_mingw?Boolean

Returns true if the compiler is MinGW

Returns:

  • (Boolean)


335
336
337
# File 'lib/makeconf/compiler.rb', line 335

def is_mingw?
  @path =~ /mingw/        # Kludge
end