ext/accessibility/extras/extconf.rb
require 'mkmf'
$CFLAGS << ' -std=c99 -Wall -Werror -pedantic -ObjC'
$LIBS << ' -framework CoreFoundation -framework Cocoa -framework IOKit'
unless RbConfig::CONFIG["CC"].match(/clang/)
clang = `which clang`.chomp
if clang.empty?
raise "Clang not installed. Cannot build C extension"
else
RbConfig::MAKEFILE_CONFIG["CC"] = clang
RbConfig::MAKEFILE_CONFIG["CXX"] = clang
end
end
create_makefile 'accessibility/extras/extras'
# modify the bugger so we can depend on bridge.h properly
makefile = File.read 'Makefile'
makefile.gsub! '$(DLLIB): $(OBJS) Makefile', '$(DLLIB): $(OBJS) Makefile ../bridge/bridge.o'
makefile.gsub! '$(LDSHARED) -o $@', ' $(LDSHARED) -o $@ ../bridge/bridge.o'
File.open('Makefile', 'w') { |f| f.write makefile }