Sha256: 1b36bad2b6d376d6b3e448376d139ae22de79aaffc4db29be623a7bc72763115

Contents?: true

Size: 991 Bytes

Versions: 1

Compression:

Stored size: 991 Bytes

Contents

require 'mkmf'

$CFLAGS << " " << "-ObjC"

unless defined?(have_framework)
  def have_framework(fw, &b)
    checking_for fw do
      src = cpp_include("#{fw}/#{fw}.h") << "\n" "int main(void){return 0;}"
      if try_link(src, opt = "-ObjC -framework #{fw}", &b)
        $defs.push(format("-DHAVE_FRAMEWORK_%s", fw.tr_cpp))
        $LDFLAGS << " " << opt
        true
      else
        false
      end
    end
  end
end

dir_config("coreaudio")
if have_framework("CoreAudio") and
   have_framework("AudioToolBox") and
   have_framework("CoreFoundation") and
   have_framework("Cocoa")

  # check ruby API
  have_func("rb_alloc_tmp_buffer", "ruby.h")
  have_func("rb_free_tmp_buffer", "ruby.h")

  create_header

  # create Makefile
  create_makefile("coreaudio/coreaudio_ext")

  # workaround for mkmf.rb in 1.9.2
  if RUBY_VERSION < "1.9.3"
    open("Makefile", "a") do |f|
      f.puts <<-EOS
.m.o:
	$(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -c $<
      EOS
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
coreaudio-0.0.3 ext/extconf.rb