rubyosa19 0.5.4 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -29,26 +29,18 @@ require 'mkmf'
29
29
  $CFLAGS << ' -Wall '
30
30
  $LDFLAGS = '-framework Carbon -framework ApplicationServices'
31
31
 
32
- if RUBY_VERSION =~ /^1.9/ then
33
- $CPPFLAGS += " -DRUBY_19"
34
- end
35
-
36
32
  exit 1 unless have_func('OSACopyScriptingDefinition')
37
33
  exit 1 unless have_func('LSFindApplicationForInfo')
38
34
 
39
35
  # Avoid `ID' and `T_DATA' symbol collisions between Ruby and Carbon.
40
36
  # (adapted code from RubyAEOSA - FUJIMOTO Hisakuni <hisa@fobj.com>)
41
- if RUBY_VERSION =~ /^1.9/ then
42
- ruby_h = "#{Config::CONFIG['rubyhdrdir']}/ruby.h"
43
- intern_h = "#{Config::CONFIG['rubyhdrdir']}/ruby/intern.h"
44
- else
45
- ruby_h = "#{Config::CONFIG['archdir']}/ruby.h"
46
- intern_h = "#{Config::CONFIG['archdir']}/intern.h"
47
- end
37
+ ruby_h = "#{RbConfig::CONFIG['rubyhdrdir']}/ruby.h"
38
+ intern_h = "#{RbConfig::CONFIG['rubyhdrdir']}/ruby/intern.h"
48
39
  new_filename_prefix = 'osx_'
49
40
  [ ruby_h, intern_h ].each do |src_path|
50
- dst_fname = File.join('./src', new_filename_prefix + File.basename(src_path))
41
+ dst_fname = File.join('./', new_filename_prefix + File.basename(src_path))
51
42
  $stderr.puts "create #{File.expand_path(dst_fname)} ..."
43
+ $stderr.puts "path: #{`pwd`}"
52
44
  File.open(dst_fname, 'w') do |dstfile|
53
45
  IO.foreach(src_path) do |line|
54
46
  line = line.gsub(/\bID\b/, 'RB_ID')
@@ -60,9 +52,4 @@ new_filename_prefix = 'osx_'
60
52
  end
61
53
 
62
54
  # Generate the Makefile
63
- create_makefile('osa', 'src')
64
-
65
- # Tweak the Makefile to add an extra install task.
66
- text = File.read('Makefile')
67
- text << "\n\ninstall-extras: post-install.rb\n\t@$(RUBY) post-install.rb\n\n"
68
- File.open('Makefile', 'w') { |io| io.write(text) }
55
+ create_makefile('rubyosa/osa')