Revision
2799
Author
lsansonetti@apple.com
Date
2009-10-14 15:44:47 -0700 (Wed, 14 Oct 2009)

Log Message

locate llc inside the framework's bindir

Modified Paths

Diff

Modified: MacRuby/trunk/bin/rubyc (2798 => 2799)


--- MacRuby/trunk/bin/rubyc	2009-10-14 22:44:31 UTC (rev 2798)
+++ MacRuby/trunk/bin/rubyc	2009-10-14 22:44:47 UTC (rev 2799)
@@ -45,7 +45,7 @@
 
     # Locate necessary programs.
     @macruby = locate(@internal ? './miniruby' : 'macruby')
-    @llc = locate('llc')
+    @llc = locate('llc', !@internal)
     @gcc = locate('gcc')
     @gcxx = locate('g++')
     @nm = locate('nm')
@@ -217,9 +217,15 @@
     ret
   end
 
-  def locate(progname)
-    path = `which #{progname}`.strip
-    die "Can't locate program `#{progname}'" if path.empty?
+  def locate(progname, must_be_in_bindir=false)
+    path = File.join(Config::CONFIG['bindir'], progname)
+    unless File.exist?(path)
+      if must_be_in_bindir
+        die "Can't locate program `#{progname}' in #{Config::CONFIG['bindir']}"
+      end
+      path = `which #{progname}`.strip
+      die "Can't locate program `#{progname}'" if path.empty?
+    end
     path
   end