Revision
174
Author
lsansonetti@apple.com
Date
2008-04-25 17:28:19 -0700 (Fri, 25 Apr 2008)

Log Message

work around string#tr temporary limitation

Modified Paths

Diff

Modified: MacRuby/trunk/lib/mkmf.rb (173 => 174)


--- MacRuby/trunk/lib/mkmf.rb	2008-04-26 00:28:10 UTC (rev 173)
+++ MacRuby/trunk/lib/mkmf.rb	2008-04-26 00:28:19 UTC (rev 174)
@@ -763,7 +763,10 @@
 def have_header(header, &b)
   checking_for header do
     if try_cpp(cpp_include(header), &b)
-      $defs.push(format("-DHAVE_%s", header.tr("a-z./\055", "A-Z___")))
+      # FIXME: cannot use this in MacRuby yet
+      #$defs.push(format("-DHAVE_%s", header.tr("a-z./\055", "A-Z___")))
+      str = header.tr("a-z", "A-Z").tr("./\055", "_")
+      $defs.push(format("-DHAVE_%s", str))
       true
     else
       false
@@ -1071,7 +1074,9 @@
 
 def create_header(header = "extconf.h")
   message "creating %s\n", header
-    sym = header.tr("a-z./\055", "A-Z___")
+    # FIXME: cannot use this in MacRuby yet
+    #sym = header.tr("a-z./\055", "A-Z___")
+    sym = header.tr("a-z", "A-Z").tr("./\055", "_")
   hdr = ["#ifndef #{sym}\n#define #{sym}\n"]
       for line in $defs
 	case line