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

source_changes at macosforge.org source_changes at macosforge.org
Wed Oct 14 15:44:48 PDT 2009


Revision: 2799
          http://trac.macosforge.org/projects/ruby/changeset/2799
Author:   lsansonetti at 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:
--------------
    MacRuby/trunk/bin/rubyc

Modified: MacRuby/trunk/bin/rubyc
===================================================================
--- 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
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20091014/1b5e446b/attachment.html>


More information about the macruby-changes mailing list