From: Goran Stankovic <goran2 / swbell.net>
Subject: Re: Ruby/TK on Mac OS X Tiger?
Date: Fri, 20 May 2005 02:04:29 +0900
Message-ID: <20050519170423.59440.qmail / web81410.mail.yahoo.com>
> That is correct. I used:
> 
>   $ ./configure --enable-mac-tcltk-framework
> 
> and I don't need X11 library to run RubyTk.

Thank you for your report. 
However, I got a report that frameworks directory is changed 
on MacOS X Tiger.
If you don't mind, please test the following patch of 
ext/tcltklib/extconf.rb whether it has no trouble on your
environment.

Index: extconf.rb
===================================================================
RCS file: /var/cvs/src/ruby/ext/tcltklib/Attic/extconf.rb,v
retrieving revision 1.15.2.9
diff -u -r1.15.2.9 extconf.rb
--- extconf.rb	25 Jan 2005 05:08:21 -0000	1.15.2.9
+++ extconf.rb	20 May 2005 01:33:34 -0000
@@ -5,11 +5,23 @@
 is_win32 = (/mswin32|mingw|cygwin|bccwin32/ =~ RUBY_PLATFORM)
 is_macosx = (/darwin/ =~ RUBY_PLATFORM)
 
-mac_need_framework = 
-  is_macosx &&
-  enable_config("mac-tcltk-framework", false) &&
-  FileTest.directory?("/Library/Frameworks/Tcl.framework/") &&
-  FileTest.directory?("/Library/Frameworks/Tk.framework/")
+def find_mac_framework
+  if macosx_frameworks = with_config("mac-tcltk-framework")
+    paths = [macosx_frameworks]
+  else
+    return false unless enable_config("mac-tcltk-framework", false)
+    paths = ["/Library/Frameworks", "/System/Library/Frameworks"]
+  end
+
+  paths.find{|dir|
+    dir.strip!
+    dir.chomp!('/')
+    FileTest.directory?(dir + "/Tcl.framework/") &&
+      FileTest.directory?(dir + "/Tk.framework/")
+  }
+end
+
+mac_need_framework = is_macosx && find_mac_framework()
 
 unless is_win32
   have_library("nsl", "t_open")
@@ -259,7 +271,8 @@
   $CPPFLAGS += ' -D_WIN32' if /cygwin/ =~ RUBY_PLATFORM
 
   if mac_need_framework
-    $CPPFLAGS += ' -I/Library/Frameworks/Tcl.framework/headers -I/Library/Frameworks/Tk.framework/Headers'
+    $CPPFLAGS += " -I#{mac_need_framework}/Tcl.framework/headers"
+    $CPPFLAGS += " -I#{mac_need_framework}/Tk.framework/Headers"
     $LDFLAGS += ' -framework Tk -framework Tcl'
   end
 

-- 
Hidetoshi NAGAI (nagai / ai.kyutech.ac.jp)