Sha256: 5c44c99136e9c708c3de45c8d90943a63ab472d7c516a1363af7e8e8da836a7f

Contents?: true

Size: 763 Bytes

Versions: 1

Compression:

Stored size: 763 Bytes

Contents

require 'mkmf'

# Miscellaneous
def error(message)
  abort "[ERROR] #{message}"
end

$CFLAGS << ' -ggdb -O0 -Wextra'

# Check for headers

error 'Missing ruby header' unless have_header 'ruby.h'

# Allow configuration of openal directory
dir_config 'openal'

if have_header('OpenAL/alc.h')
  # yay, probably mac os!
elsif have_header('AL/alc.h')
  # woot, probably everybody else!
else
  error 'Missing openal headers'
end

# Add library
if RUBY_PLATFORM =~ /darwin/
  $LDFLAGS << ' -framework OpenAL '
elsif have_library('openal', 'alSourceQueueBuffers')
  $LDFLAGS << ' -lopenal '
else
  error 'Missing openal library'
end

%w[alcOpenDevice alGetError].each do |func|
  abort "Missing function #{func}" unless have_func(func)
end

create_makefile('openal_ext')

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
hallon-openal-1.0.0 ext/hallon/extconf.rb