Method: CGenerator::Library#extconf

Defined in:
lib/cgen/cgen.rb

#extconf {|a| ... } ⇒ Object

Override #extconf if you want to do more than just #create_makefile. Note that #create_makefile recognizes all .c files in the library directory, and generates a makefile that compiles them and links them into the dynamic library.

Yields the array of lines being constructed so that additional configuration can be added. See the ruby documentation on mkmf.

Yields:

  • (a)


1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
# File 'lib/cgen/cgen.rb', line 1036

def extconf # :yields: lines_array
  a = []
  a << "require 'mkmf'"
  a << "$CFLAGS = \"#$CFLAGS\"" if defined?($CFLAGS)
  include_dirs.each do |dir|
    a << %{$INCFLAGS << " -I#{dir}"}
  end
  yield a if block_given?
  a << "create_makefile '#{@name}'"
end