From: Brian Wisti Date: 2003-08-09T04:17:20+09:00 Subject: Re: tk out-of-box on Mac OS X [PATCH] Hi Elliott, Do you think you could post this to ruby-talk as well? It would be good to get a few more eyes on this. I'm going to forward it to the Seattle.rb list, since there are a disproportionate number of OS X freaks there :-) - Brian W http://coolnamehere.com/ Elliott Hughes wrote: >In case Apple decides to go to Ruby 1.8.0 for Mac OS X 10.3, it might be >nice to have tk "just work". There are three problems: > >1. Mac OS X 10.2 doesn't come with tcl/tk, you have to download it from >Apple. Hopefully they'll fix this. >2. Mac OS X doesn't keep tcl/tk where other Unixes do. Hopefully they won't >fix this if they want to use this patch ;-) >3. Tk only works if started from a .app bundle. Hopefully they'll fix this. > >I've posted detailed copy-and-pasteable information about getting around >point 3 here: > > http://www.rubygarden.com/ruby?RubyTkOnOSX > >where you can also see an earlier patch I don't think I like as much as the >one here. What does the panel think? > > --elliott > >Index: ext/tcltklib/extconf.rb >=================================================================== >RCS file: /src/ruby/ext/tcltklib/extconf.rb,v >retrieving revision 1.15 >diff -u -r1.15 extconf.rb >--- ext/tcltklib/extconf.rb 20 Mar 2003 06:27:16 -0000 1.15 >+++ ext/tcltklib/extconf.rb 8 Aug 2003 09:36:26 -0000 >@@ -47,11 +47,23 @@ > end > end > >-if have_header("tcl.h") && have_header("tk.h") && >+mac_os_x_tcl_framework_headers = >"/Library/Frameworks/Tcl.framework/headers" >+mac_os_x_tk_framework_headers = "/Library/Frameworks/Tk.framework/headers" >+use_mac_os_x_tk = false >+ >+if RUBY_PLATFORM =~ /darwin/ && >+ File.exists?(mac_os_x_tcl_framework_headers) && >+ File.exists?(mac_os_x_tk_framework_headers) >+ $CPPFLAGS += " -I#{mac_os_x_tcl_framework_headers} >-I#{mac_os_x_tk_framework_headers}" >+ $LDFLAGS += ' -framework Tk -framework Tcl' >+ use_mac_os_x_tk = true >+end >+ >+if (have_header("tcl.h") && have_header("tk.h") && > (/mswin32|mingw|cygwin|bccwin32/ =~ RUBY_PLATFORM || >find_library("X11", "XOpenDisplay", > "/usr/X11/lib", "/usr/lib/X11", "/usr/X11R6/lib", >"/usr/openwin/lib")) && > find_tcl(tcllib, stubs) && >- find_tk(tklib, stubs) >+ find_tk(tklib, stubs)) || use_mac_os_x_tk > $CPPFLAGS += ' -DUSE_TCL_STUBS -DUSE_TK_STUBS' if stubs > $CPPFLAGS += ' -D_WIN32' if /cygwin/ =~ RUBY_PLATFORM > create_makefile("tcltklib") > > > >********************************************************************* >This e-mail and any attachment is confidential. It may only be read, copied and used by the intended recipient(s). If you are not the intended recipient(s), you may not copy, use, distribute, forward, store or disclose this e-mail or any attachment. If you are not the intended recipient(s) or have otherwise received this e-mail in error, you should destroy it and any attachment and notify the sender by reply e-mail or send a message to sysadmin@bluearc.com >********************************************************************* > > >