1998-01-16 07:19:09 -05:00
|
|
|
# extconf.rb for tcltklib
|
|
|
|
|
1999-01-19 23:59:39 -05:00
|
|
|
require 'mkmf'
|
|
|
|
|
|
|
|
have_library("nsl", "t_open")
|
1998-01-16 07:19:09 -05:00
|
|
|
have_library("socket", "socket")
|
1999-01-19 23:59:39 -05:00
|
|
|
have_library("dl", "dlopen")
|
|
|
|
have_library("m", "log")
|
1998-01-16 07:19:09 -05:00
|
|
|
|
1999-08-13 01:37:52 -04:00
|
|
|
dir_config("tk")
|
|
|
|
dir_config("tcl")
|
|
|
|
dir_config("X11")
|
1998-01-16 07:19:09 -05:00
|
|
|
|
1999-08-13 01:37:52 -04:00
|
|
|
tklib = with_config("tklib")
|
|
|
|
tcllib = with_config("tcllib")
|
1998-01-16 07:19:09 -05:00
|
|
|
|
1999-08-13 01:37:52 -04:00
|
|
|
def find_tcl(tcllib)
|
|
|
|
paths = ["/usr/local/lib", "/usr/pkg"]
|
|
|
|
func = "Tcl_FindExecutable"
|
|
|
|
if tcllib
|
|
|
|
find_library(tcllib, func, *paths)
|
|
|
|
else
|
|
|
|
find_library("tcl", func, *paths) or
|
|
|
|
find_library("tcl8.0", func, *paths) or
|
|
|
|
find_library("tcl7.6", func, *paths)
|
|
|
|
end
|
|
|
|
end
|
1998-01-16 07:19:09 -05:00
|
|
|
|
1999-08-13 01:37:52 -04:00
|
|
|
def find_tk(tklib)
|
|
|
|
paths = ["/usr/local/lib", "/usr/pkg"]
|
|
|
|
func = "Tk_Init"
|
|
|
|
if tklib
|
|
|
|
find_library(tklib, func, *paths)
|
|
|
|
else
|
|
|
|
find_library("tk", func, *paths) or
|
|
|
|
find_library("tk8.0", func, *paths) or
|
|
|
|
find_library("tk4.2", func, *paths)
|
1999-01-19 23:59:39 -05:00
|
|
|
end
|
1998-01-16 07:19:09 -05:00
|
|
|
end
|
|
|
|
|
1999-01-19 23:59:39 -05:00
|
|
|
if have_header("tcl.h") && have_header("tk.h") &&
|
1999-08-13 01:37:52 -04:00
|
|
|
(/mswin32/ =~ RUBY_PLATFORM || find_library("X11", "XOpenDisplay",
|
|
|
|
"/usr/X11/lib", "/usr/X11R6/lib", "/usr/openwin/lib")) &&
|
|
|
|
find_tcl(tcllib) &&
|
|
|
|
find_tk(tklib)
|
1998-01-16 07:19:09 -05:00
|
|
|
create_makefile("tcltklib")
|
|
|
|
end
|