[macruby-changes] [3032] MacRuby/trunk/bin/rubyc

source_changes at macosforge.org source_changes at macosforge.org
Tue Nov 17 19:46:15 PST 2009


Revision: 3032
          http://trac.macosforge.org/projects/ruby/changeset/3032
Author:   martinlagardette at apple.com
Date:     2009-11-17 19:46:15 -0800 (Tue, 17 Nov 2009)
Log Message:
-----------

 - Make sure we can compile if the path contains spaces
{{{
TMPDIR=/tmp/a\ a macruby ~/Documents/Projets/MacRuby/bin/rubyc /tmp/a\ a/mandelbrot.rb
}}}

Modified Paths:
--------------
    MacRuby/trunk/bin/rubyc

Modified: MacRuby/trunk/bin/rubyc
===================================================================
--- MacRuby/trunk/bin/rubyc	2009-11-18 02:26:09 UTC (rev 3031)
+++ MacRuby/trunk/bin/rubyc	2009-11-18 03:46:15 UTC (rev 3032)
@@ -120,16 +120,19 @@
 
       # Compile the bitcode as assembly.
       asm = gen_tmpfile(base + arch, 's')
-      execute("#{@llc} -f #{bc} -o=#{asm} -march=#{llc_arch(arch)} -relocation-model=pic -enable-eh")
+      execute("#{@llc} -f \"#{bc}\" -o=\"#{asm}\" -march=#{llc_arch(arch)} -relocation-model=pic -enable-eh")
 
       # Compile the assembly.
       tmp_obj = gen_tmpfile(base + arch, 'o')
-      execute("#{@gcc} -c -arch #{arch} #{asm} -o #{tmp_obj}")
+      execute("#{@gcc} -c -arch #{arch} \"#{asm}\" -o \"#{tmp_obj}\"")
       tmp_objs << tmp_obj
     end
 
     # Link the architecture objects.
-    execute("#{@lipo} -create #{tmp_objs.join(' ')} -output #{output}")
+    cli_tmp_objs = tmp_objs.map do |obj|
+      '"' + obj + '"'
+    end
+    execute("#{@lipo} -create #{cli_tmp_objs.join(' ')} -output \"#{output}\"")
 
     [output, init_func]
   end
@@ -155,7 +158,7 @@
     File.open(main, 'w') { |io| io.write(main_txt) }
     linkf = @internal ? "-L. -lmacruby" : "-framework MacRuby"
     archf = @archs.map { |x| "-arch #{x}" }.join(' ')
-    execute("#{@gcxx} #{main} -dynamic -bundle -undefined suppress -flat_namespace #{archf} #{linkf} #{obj} -o #{output}")
+    execute("#{@gcxx} \"#{main}\" -dynamic -bundle -undefined suppress -flat_namespace #{archf} #{linkf} \"#{obj}\" -o \"#{output}\"")
   end
 
   def compile_executable(objs_data, output)
@@ -208,19 +211,19 @@
     File.open(main, 'w') { |io| io.write(main_txt) }
     main_o = gen_tmpfile('main', 'o')
     archf = @archs.map { |x| "-arch #{x}" }.join(' ')
-    execute("#{@gcxx} #{main} -c #{archf} -o #{main_o} -fobjc-gc")
+    execute("#{@gcxx} \"#{main}\" -c #{archf} -o \"#{main_o}\" -fobjc-gc")
     objs.unshift(main_o)
 
     # Link all objects into executable.
     linkf = @static ? 
       "-L#{RbConfig::CONFIG['libdir']} -lmacruby-static -framework Foundation -lobjc -lauto -lxml2" :
       "-framework MacRuby -lobjc"
-    line = "#{@gcxx} -o #{output} #{archf} #{linkf} "
+    line = "#{@gcxx} -o \"#{output}\" #{archf} #{linkf} "
     @frameworks.each { |f| line << "-framework #{f} " }
     if @static
       line << execute("llvm-config --ldflags --libs core jit nativecodegen interpreter bitwriter").gsub(/\n/, '')
     end
-    objs.each { |o| line << " #{o}" }
+    objs.each { |o| line << " \"#{o}\"" }
     execute(line)
   end
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20091117/13d59265/attachment-0001.html>


More information about the macruby-changes mailing list