diff --git a/bin/rubyc b/bin/rubyc index 7d16858cb..5f83930ce 100644 --- a/bin/rubyc +++ b/bin/rubyc @@ -135,7 +135,8 @@ EOS main = gen_tmpfile('main', 'c') File.open(main, 'w') { |io| io.write(main_txt) } - execute("#{@gcxx} #{main} -dynamic -bundle -undefined suppress -flat_namespace -arch x86_64 -framework MacRuby #{obj} -o #{output}") + link = @internal ? "-L. -lmacruby" : "-framework MacRuby" + execute("#{@gcxx} #{main} -dynamic -bundle -undefined suppress -flat_namespace -arch x86_64 #{link} #{obj} -o #{output}") end def compile_executable(objs, output) diff --git a/rakelib/builder.rake b/rakelib/builder.rake index dce9580d4..6dbaee9ef 100644 --- a/rakelib/builder.rake +++ b/rakelib/builder.rake @@ -348,7 +348,7 @@ end AOT_STDLIB = ['rbconfig.rb', 'lib/irb.rb', 'lib/irb/**/*.rb', 'lib/fileutils.rb'] desc "AOT compile parts of the stdlib" -task :aot_compile_stdlib => [:miniruby] do +task :aot_compile_stdlib => [:miniruby, 'macruby:dylib'] do AOT_STDLIB.each do |pat| Dir.glob(pat).each do |path| out = File.join(File.dirname(path), File.basename(path, '.rb') + '.rbo')