# File lib/mkrf/generator.rb, line 73
    def initialize(extension_name, source_patterns = ["*.c"], availability_options = {})
      @sources = source_patterns
      @extension_name = extension_name + ".#{CONFIG['DLEXT']}"
      @available = Mkrf::Availability.new(availability_options)
      @defines = []
      if @sources[0] =~ /cpp/
        @cc = 'g++' # should be in CONFIG['C++'] but is not.
        @source_extension = 'cpp'
      else
        @cc = CONFIG['CC']
        @source_extension = 'c'
      end
      
      @objects  = ''
      @ldshared = ''
      @cflags   = "#{CONFIG['CCDLFLAGS']} #{CONFIG['CFLAGS']} #{CONFIG['ARCH_FLAG']}"
      
      yield self if block_given?
      write_rakefile
    end