extconf.rb.in   [plain text]


require 'rbconfig'
# Xcode 2.2 moved ruby.h 
unless File.exist? File.join(Config::CONFIG['archdir'], 'ruby.h')
  Config::CONFIG['archdir'] = Config::CONFIG['archdir'].sub(/powerpc/, 'universal')
end

require 'mkmf'

def command(cmd)
  $stderr.puts "execute '#{cmd}' ..."
  raise(RuntimeError, cmd) unless system(cmd)
  $stderr.puts "execute '#{cmd}' done"
end

$CFLAGS = "-F../../framework/%%%build_dir%%% #{ENV['RC_CFLAGS']}"
$LDFLAGS  = '-F../../framework/%%%build_dir%%% -framework RubyCocoa'

$CFLAGS << ' %%%other_cflags%%% %%%arch_flags%%%'
$LDFLAGS << ' %%%other_ldflags%%% %%%arch_flags%%%'

create_makefile('rubycocoa')
command "mv -f Makefile Makefile.bak"
command "sed -e 's/-no-cpp-precomp//' -e 's/-no-precomp//' Makefile.bak > Makefile"