diff options
author | eban <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2000-08-08 05:06:24 +0000 |
---|---|---|
committer | eban <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2000-08-08 05:06:24 +0000 |
commit | ce799ec3eabd2437e7cc7c64580668d239e74b7a (patch) | |
tree | 91b13ae1c00a67138eaba842466d59be9d83abb2 /ext/tcltklib/extconf.rb | |
parent | 5093c0496e4ddbb86d5a190163f54b21a4b60e39 (diff) |
eban
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@878 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/tcltklib/extconf.rb')
-rw-r--r-- | ext/tcltklib/extconf.rb | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/ext/tcltklib/extconf.rb b/ext/tcltklib/extconf.rb index 5f56d42a52..acc75b8cbc 100644 --- a/ext/tcltklib/extconf.rb +++ b/ext/tcltklib/extconf.rb @@ -2,7 +2,7 @@ require 'mkmf' -if RUBY_PLATFORM !~ /mswin32|mingw/ +if RUBY_PLATFORM !~ /mswin32|mingw|cygwin/ have_library("nsl", "t_open") have_library("socket", "socket") have_library("dl", "dlopen") @@ -15,10 +15,11 @@ dir_config("X11") tklib = with_config("tklib") tcllib = with_config("tcllib") +stubs = enable_config("tcltk_stubs") || with_config("tcltk_stubs") -def find_tcl(tcllib) +def find_tcl(tcllib, stubs) paths = ["/usr/local/lib", "/usr/pkg"] - func = "Tcl_FindExecutable" + func = stubs ? "Tcl_InitStubs" : "Tcl_FindExecutable" if tcllib find_library(tcllib, func, *paths) else @@ -30,9 +31,9 @@ def find_tcl(tcllib) end end -def find_tk(tklib) +def find_tk(tklib, stubs) paths = ["/usr/local/lib", "/usr/pkg"] - func = "Tk_Init" + func = stubs ? "Tk_InitStubs" : "Tk_Init" if tklib find_library(tklib, func, *paths) else @@ -47,7 +48,8 @@ end if have_header("tcl.h") && have_header("tk.h") && (/mswin32|mingw|cygwin/ =~ RUBY_PLATFORM || find_library("X11", "XOpenDisplay", "/usr/X11/lib", "/usr/X11R6/lib", "/usr/openwin/lib")) && - find_tcl(tcllib) && - find_tk(tklib) + find_tcl(tcllib, stubs) && + find_tk(tklib, stubs) + $CFLAGS += ' -DUSE_TCL_STUBS -DUSE_TK_STUBS' if stubs create_makefile("tcltklib") end |