diff --git a/ChangeLog b/ChangeLog index a0b9b91d1d..2602fb0eb1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +Thu Dec 23 13:13:33 2004 Hidetoshi NAGAI + + * ext/tcltklib/tcltklib.c: define TclTkLib::COMPILE_INFO and + RELEASE_DATE + + * ext/tcltklib/extconf.rb: ditto + + * ext/tk/tkutil.c: define TkUtil::RELEASE_DATE + + * ext/tk/lib/tk.rb: define Tk::RELEASE_DATE + Thu Dec 23 00:16:32 2004 Nobuyoshi Nakada * configure.in (bsdi): use $(CC) for LDSHARED. fixed [ruby-dev:25270] diff --git a/ext/tcltklib/extconf.rb b/ext/tcltklib/extconf.rb index 0635eea9e0..201768cb0d 100644 --- a/ext/tcltklib/extconf.rb +++ b/ext/tcltklib/extconf.rb @@ -202,6 +202,12 @@ EOF end # ruby -> enable && tcl -> enable/disable + if tcl_enable_thread + $CPPFLAGS += ' -DWITH_TCL_ENABLE_THREAD=1' + else + $CPPFLAGS += ' -DWITH_TCL_ENABLE_THREAD=0' + end + return true else @@ -224,9 +230,11 @@ EOF ** ***************************************************************************** ') + $CPPFLAGS += ' -DWITH_TCL_ENABLE_THREAD=0' return false else # ruby -> disable && tcl -> disable + $CPPFLAGS += ' -DWITH_TCL_ENABLE_THREAD=1' return true end end diff --git a/ext/tcltklib/tcltklib.c b/ext/tcltklib/tcltklib.c index a80b4530f1..6184d73880 100644 --- a/ext/tcltklib/tcltklib.c +++ b/ext/tcltklib/tcltklib.c @@ -4,8 +4,11 @@ * Oct. 24, 1997 Y. Matsumoto */ +#define TCLTKLIB_RELEASE_DATE "2004-12-23" + #include "ruby.h" #include "rubysig.h" +#include "version.h" #undef EXTERN /* avoid conflict with tcl.h of tcl8.2 or before */ #include #ifdef HAVE_STDARG_PROTOTYPES @@ -64,6 +67,9 @@ fprintf(stderr, ARG1, ARG2); fprintf(stderr, "\n"); fflush(stderr); } #define DUMP2(ARG1, ARG2) */ +/* release date */ +const char tcltklib_release_date[] = TCLTKLIB_RELEASE_DATE; + /*finalize_proc_name */ static char *finalize_hook_name = "INTERP_FINALIZE_HOOK"; @@ -6178,6 +6184,66 @@ _macinit() } #endif +static VALUE +tcltklib_compile_info() +{ + volatile VALUE ret; + int size; + char form[] + = "tcltklib %s :: Ruby%s (%s) %s pthread :: Tcl%s(%s)/Tk%s(%s) %s"; + char *info; + + size = strlen(form) + + strlen(TCLTKLIB_RELEASE_DATE) + + strlen(RUBY_VERSION) + + strlen(RUBY_RELEASE_DATE) + + strlen("without") + + strlen(TCL_PATCH_LEVEL) + + strlen("without stub") + + strlen(TK_PATCH_LEVEL) + + strlen("without stub") + + strlen("unknown tcl_threads"); + + info = ALLOC_N(char, size); + + sprintf(info, form, + TCLTKLIB_RELEASE_DATE, + RUBY_VERSION, RUBY_RELEASE_DATE, +#ifdef HAVE_NATIVETHREAD + "with", +#else + "without", +#endif + TCL_PATCH_LEVEL, +#ifdef USE_TCL_STUBS + "with stub", +#else + "without stub", +#endif + TK_PATCH_LEVEL, +#ifdef USE_TK_STUBS + "with stub", +#else + "without stub", +#endif +#ifdef WITH_TCL_ENABLE_THREAD +# if WITH_TCL_ENABLE_THREAD + "with tcl_threads" +# else + "without tcl_threads" +# endif +#else + "unknown tcl_threads" +#endif + ); + + ret = rb_obj_freeze(rb_str_new2(info)); + + free(info); + + return ret; +} + /*---- initialization ----*/ void Init_tcltklib() @@ -6211,6 +6277,11 @@ Init_tcltklib() /* --------------------------------------------------------------- */ + rb_define_const(lib, "COMPILE_INFO", tcltklib_compile_info()); + + rb_define_const(lib, "RELEASE_DATE", + rb_obj_freeze(rb_str_new2(tcltklib_release_date))); + rb_define_const(lib, "FINALIZE_PROC_NAME", rb_str_new2(finalize_hook_name)); diff --git a/ext/tk/lib/tk.rb b/ext/tk/lib/tk.rb index 97535af124..69f2b4f2f7 100644 --- a/ext/tk/lib/tk.rb +++ b/ext/tk/lib/tk.rb @@ -3940,6 +3940,8 @@ end #Tk.freeze module Tk + RELEASE_DATE = '2004-12-23'.freeze + autoload :AUTO_PATH, 'tk/variable' autoload :TCL_PACKAGE_PATH, 'tk/variable' autoload :PACKAGE_PATH, 'tk/variable' diff --git a/ext/tk/tkutil.c b/ext/tk/tkutil.c index 04d276cca2..e36f92af04 100644 --- a/ext/tk/tkutil.c +++ b/ext/tk/tkutil.c @@ -8,6 +8,8 @@ ************************************************/ +#define TKUTIL_RELEASE_DATE "2004-12-23" + #include "ruby.h" #include "rubysig.h" #include "st.h" @@ -1239,6 +1241,8 @@ tkobj_path(self) } /*************************************/ +/* release date */ +const char tkutil_release_date[] = TKUTIL_RELEASE_DATE; void Init_tkutil() @@ -1248,6 +1252,11 @@ Init_tkutil() VALUE cTK = rb_define_class("TkKernel", rb_cObject); VALUE mTK = rb_define_module("TkUtil"); + /* --------------------- */ + + rb_define_const(mTK, "RELEASE_DATE", + rb_obj_freeze(rb_str_new2(tkutil_release_date))); + /* --------------------- */ rb_global_variable(&cMethod); cMethod = rb_const_get(rb_cObject, rb_intern("Method"));