summaryrefslogtreecommitdiff
path: root/ext/tcltklib
diff options
context:
space:
mode:
authornagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-07-01 09:38:48 +0000
committernagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-07-01 09:38:48 +0000
commitffcedd79505ea2e99f859c7cea2fb2221c948d4c (patch)
tree02232516faf0e1959ecb5d5b7aca25a52f9f87ca /ext/tcltklib
parent73cf1d02bac2dbdd5d7f673a33d81444a00c865e (diff)
* ext/tk/lib/tcltklib : bug fix
* ext/tk/lib/tk : bug fix and add Tcl/Tk extension support libraries git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6559 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/tcltklib')
-rw-r--r--ext/tcltklib/MANIFEST1
-rw-r--r--ext/tcltklib/README.ActiveTcl42
-rw-r--r--ext/tcltklib/extconf.rb10
-rw-r--r--ext/tcltklib/tcltklib.c12
4 files changed, 63 insertions, 2 deletions
diff --git a/ext/tcltklib/MANIFEST b/ext/tcltklib/MANIFEST
index e408dc3ee8..92a6ed642b 100644
--- a/ext/tcltklib/MANIFEST
+++ b/ext/tcltklib/MANIFEST
@@ -1,5 +1,6 @@
MANIFEST
README.1st
+README.ActiveTcl
README.euc
MANUAL.euc
MANUAL.eng
diff --git a/ext/tcltklib/README.ActiveTcl b/ext/tcltklib/README.ActiveTcl
new file mode 100644
index 0000000000..c9cc691973
--- /dev/null
+++ b/ext/tcltklib/README.ActiveTcl
@@ -0,0 +1,42 @@
+ActiveTcl is ActiveState's quality-assured distribution of Tcl.
+
+# see <http://www.activestate.com/Products/ActiveTcl/>
+# <http://www.tcl.tk/>
+
+If you want to use ActiveTcl binary package as the Tcl/Tk libraries,
+please use the following configure options.
+
+ --with-tcl-dir=<ActiveTcl_root>
+ --with-tk-dir=<ActiveTcl_root>
+
+And use the followings if you need.
+
+ --with-tcllib=<libname>
+ --with-tklib=<libname>
+ --enable-tcltk-stubs
+
+For example, when you install ActiveTcl-8.4.x to '/usr/local/ActiveTcl',
+
+ configure --with-tcl-dir=/usr/local/ActiveTcl/ \
+ --with-tk-dir=/usr/local/ActiveTcl/ \
+ --with-tcllib=tcl8.4 \
+ --with-tklib=tk8.4 \
+ --enable-tcltk-stubs
+
+It depends on your environment that you have to add the directory of
+ActiveTcl's dynamic link libraries to your library path when execute
+Ruby/Tk.
+
+# For example, on Linux, one of the ways is to use LD_LIBRARY_PATH
+# environment variable.
+#
+# [bash]$ LD_LIBRARY_PATH=/usr/local/ActiveTcl/lib:$LD_LIBRARY_PATH \
+# ruby your-Ruby/Tk-script
+#
+# [bash]$ LD_LIBRARY_PATH=/usr/local/ActiveTcl/lib:$LD_LIBRARY_PATH irb
+
+Then, you'll be able to use Tcl/Tk extension libraries included in the
+ActiveTcl package (e.g. call TkPackage.require('BWidget'), and then,
+use functions/widgets of BWidget extention).
+
+ Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
diff --git a/ext/tcltklib/extconf.rb b/ext/tcltklib/extconf.rb
index 83b4a2ac31..ac48812d7a 100644
--- a/ext/tcltklib/extconf.rb
+++ b/ext/tcltklib/extconf.rb
@@ -5,6 +5,12 @@ require 'mkmf'
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/")
+
unless is_win32
have_library("nsl", "t_open")
have_library("socket", "socket")
@@ -210,7 +216,7 @@ EOF
end
end
-if is_macosx ||
+if mac_need_framework ||
(have_header("tcl.h") && have_header("tk.h") &&
(is_win32 || find_library("X11", "XOpenDisplay",
"/usr/X11/lib", "/usr/lib/X11", "/usr/X11R6/lib", "/usr/openwin/lib")) &&
@@ -219,7 +225,7 @@ if is_macosx ||
$CPPFLAGS += ' -DUSE_TCL_STUBS -DUSE_TK_STUBS' if stubs
$CPPFLAGS += ' -D_WIN32' if /cygwin/ =~ RUBY_PLATFORM
- if is_macosx
+ if mac_need_framework
$CPPFLAGS += ' -I/Library/Frameworks/Tcl.framework/headers -I/Library/Frameworks/Tk.framework/Headers'
$LDFLAGS += ' -framework Tk -framework Tcl'
end
diff --git a/ext/tcltklib/tcltklib.c b/ext/tcltklib/tcltklib.c
index cb3826ba9f..c68fe661e9 100644
--- a/ext/tcltklib/tcltklib.c
+++ b/ext/tcltklib/tcltklib.c
@@ -1201,12 +1201,15 @@ ip_ruby_eval(clientData, interp, argc, argv)
rb_thread_critical = thr_crit_bup;
if (eclass == eTkCallbackReturn) {
+ ip_set_exc_message(interp, res);
return TCL_RETURN;
} else if (eclass == eTkCallbackBreak) {
+ ip_set_exc_message(interp, res);
return TCL_BREAK;
} else if (eclass == eTkCallbackContinue) {
+ ip_set_exc_message(interp, res);
return TCL_CONTINUE;
} else if (eclass == rb_eSystemExit) {
@@ -1239,12 +1242,15 @@ ip_ruby_eval(clientData, interp, argc, argv)
}
if (SYM2ID(reason) == ID_return) {
+ ip_set_exc_message(interp, res);
return TCL_RETURN;
} else if (SYM2ID(reason) == ID_break) {
+ ip_set_exc_message(interp, res);
return TCL_BREAK;
} else if (SYM2ID(reason) == ID_next) {
+ ip_set_exc_message(interp, res);
return TCL_CONTINUE;
} else {
@@ -1572,12 +1578,15 @@ ip_ruby_cmd(clientData, interp, argc, argv)
rb_thread_critical = thr_crit_bup;
if (eclass == eTkCallbackReturn) {
+ ip_set_exc_message(interp, res);
return TCL_RETURN;
} else if (eclass == eTkCallbackBreak) {
+ ip_set_exc_message(interp, res);
return TCL_BREAK;
} else if (eclass == eTkCallbackContinue) {
+ ip_set_exc_message(interp, res);
return TCL_CONTINUE;
} else if (eclass == rb_eSystemExit) {
@@ -1609,12 +1618,15 @@ ip_ruby_cmd(clientData, interp, argc, argv)
}
if (SYM2ID(reason) == ID_return) {
+ ip_set_exc_message(interp, res);
return TCL_RETURN;
} else if (SYM2ID(reason) == ID_break) {
+ ip_set_exc_message(interp, res);
return TCL_BREAK;
} else if (SYM2ID(reason) == ID_next) {
+ ip_set_exc_message(interp, res);
return TCL_CONTINUE;
} else {