1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* ext/tk/extconf.rb: Framework support on MacOS X Tiger.

* ext/tk/README.tcltklib: add description of Framework support options.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8507 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nagai 2005-05-23 07:27:08 +00:00
parent 34075ed209
commit 94aa5943bb
3 changed files with 66 additions and 13 deletions

View file

@ -1,3 +1,9 @@
Mon May 23 16:23:06 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tk/extconf.rb: Framework support on MacOS X Tiger.
* ext/tk/README.tcltklib: add description of Framework support options.
Mon May 23 15:07:34 2005 NAKAMURA Usaku <usa@ruby-lang.org> Mon May 23 15:07:34 2005 NAKAMURA Usaku <usa@ruby-lang.org>
* win32/Makefile.sub ($(PROGRAM)): add dependency on $(LIBRUBY_SO). * win32/Makefile.sub ($(PROGRAM)): add dependency on $(LIBRUBY_SO).

View file

@ -22,7 +22,24 @@ some or all of the following options.
--with-tcl-lib=<dir> the directry containts 'libtcl<version>.so' --with-tcl-lib=<dir> the directry containts 'libtcl<version>.so'
--with-tk-lib=<dir> the directry containts 'libtk<version>.so' --with-tk-lib=<dir> the directry containts 'libtk<version>.so'
--enable-mac-tcltk-framework (Mac OSX only) use Tcl/Tk framework --enable-mac-tcltk-framework (MacOS X) use Tcl/Tk framework
(Obsolete. Please use '--enable-tcltk-framework'.)
--enable-tcltk-framework use Tcl/Tk framework
--with-tcltk-framework=<dir> the directory containts Tcl/Tk framework;
"<dir>/Tcl.framework" and "<dir>/Tk.framework".
When this option is given, it is assumed that
--enable-tcltk-framework option is given also.
--with-tcl-framework-header=<dir>
Tcl framework headers directory
(e.g. "/Library/Frameworks/Tcl.framework/Headers")
--with-tk-framework-header=<dir>
Tk framework headers directory
(e.g. "/Library/Frameworks/Tk.framework/Headers")
If you forgot to give the options when do 'configure' on toplevel If you forgot to give the options when do 'configure' on toplevel
directry of Ruby sources, please try something like as the followings. directry of Ruby sources, please try something like as the followings.

View file

@ -3,13 +3,34 @@
require 'mkmf' require 'mkmf'
is_win32 = (/mswin32|mingw|cygwin|bccwin32/ =~ RUBY_PLATFORM) is_win32 = (/mswin32|mingw|cygwin|bccwin32/ =~ RUBY_PLATFORM)
is_macosx = (/darwin/ =~ RUBY_PLATFORM) #is_macosx = (/darwin/ =~ RUBY_PLATFORM)
mac_need_framework = def find_framework(tcl_hdr, tk_hdr)
is_macosx && if framework_dir = with_config("tcltk-framework")
enable_config("mac-tcltk-framework", false) && paths = [framework_dir]
FileTest.directory?("/Library/Frameworks/Tcl.framework/") && else
FileTest.directory?("/Library/Frameworks/Tk.framework/") unless tcl_hdr || tk_hdr ||
enable_config("tcltk-framework", false) ||
enable_config("mac-tcltk-framework", false)
return false
end
paths = ["/Library/Frameworks", "/System/Library/Frameworks"]
end
checking_for('Tcl/Tk Framework') {
paths.find{|dir|
dir.strip!
dir.chomp!('/')
(tcl_hdr || FileTest.directory?(dir + "/Tcl.framework/") ) &&
(tk_hdr || FileTest.directory?(dir + "/Tk.framework/") )
}
}
end
tcl_framework_header = with_config("tcl-framework-header")
tk_framework_header = with_config("tk-framework-header")
tcltk_framework = find_framework(tcl_framework_header, tk_framework_header)
unless is_win32 unless is_win32
have_library("nsl", "t_open") have_library("nsl", "t_open")
@ -79,10 +100,8 @@ def pthread_check()
# Is tcl-thread given by user ? # Is tcl-thread given by user ?
case enable_config("tcl-thread") case enable_config("tcl-thread")
when true when true
$CPPFLAGS += ' -DFORCE_TCL_THREAD=1'
tcl_enable_thread = true tcl_enable_thread = true
when false when false
$CPPFLAGS += ' -DFORCE_TCL_THREAD=1'
tcl_enable_thread = false tcl_enable_thread = false
else else
tcl_enable_thread = nil tcl_enable_thread = nil
@ -251,7 +270,7 @@ EOF
end end
end end
if mac_need_framework || if tcltk_framework ||
(have_header("tcl.h") && have_header("tk.h") && (have_header("tcl.h") && have_header("tk.h") &&
(is_win32 || find_library("X11", "XOpenDisplay", (is_win32 || find_library("X11", "XOpenDisplay",
"/usr/X11/lib", "/usr/lib/X11", "/usr/X11R6/lib", "/usr/openwin/lib")) && "/usr/X11/lib", "/usr/lib/X11", "/usr/X11R6/lib", "/usr/openwin/lib")) &&
@ -260,8 +279,19 @@ if mac_need_framework ||
$CPPFLAGS += ' -DUSE_TCL_STUBS -DUSE_TK_STUBS' if stubs $CPPFLAGS += ' -DUSE_TCL_STUBS -DUSE_TK_STUBS' if stubs
$CPPFLAGS += ' -D_WIN32' if /cygwin/ =~ RUBY_PLATFORM $CPPFLAGS += ' -D_WIN32' if /cygwin/ =~ RUBY_PLATFORM
if mac_need_framework if tcltk_framework
$CPPFLAGS += ' -I/Library/Frameworks/Tcl.framework/headers -I/Library/Frameworks/Tk.framework/Headers' if tcl_framework_header
$CPPFLAGS += " -I#{tcl_framework_header}"
else
$CPPFLAGS += " -I#{tcltk_framework}/Tcl.framework/Headers"
end
if tk_framework_header
$CPPFLAGS += " -I#{tk_framework_header}"
else
$CPPFLAGS += " -I#{tcltk_framework}/Tk.framework/Headers"
end
$LDFLAGS += ' -framework Tk -framework Tcl' $LDFLAGS += ' -framework Tk -framework Tcl'
end end