From: <dat...@us...> - 2006-10-29 23:28:58
|
Revision: 17620 http://svn.sourceforge.net/gaim/?rev=17620&view=rev Author: datallah Date: 2006-10-29 15:28:37 -0800 (Sun, 29 Oct 2006) Log Message: ----------- A couple patches from Lee Roach. -Delete the Perl loader link library when making clean. -Force the Tcl loader plugin to use the ActiveTcl installation. This will prevent 99.99% of the cygwin "hang on start" issues, at the cost of having the Tcl loader not work for some people - if you're one of the 5 or so people using the Tcl loader on win32, you can figure out how to fix it - maybe we'll add a faq entry. This should cut down on the frequent bug reports of gaim failing to start. Modified Paths: -------------- trunk/COPYRIGHT trunk/libgaim/plugins/perl/Makefile.mingw trunk/libgaim/plugins/tcl/tcl.c Modified: trunk/COPYRIGHT =================================================================== --- trunk/COPYRIGHT 2006-10-29 15:59:05 UTC (rev 17619) +++ trunk/COPYRIGHT 2006-10-29 23:28:37 UTC (rev 17620) @@ -243,6 +243,7 @@ Pekka Riikonen Tim Ringenbach Dennis Ristuccia +Lee Roach Rhett Robinson Luciano Miguel Ferreira Rocha Andrew Rodland Modified: trunk/libgaim/plugins/perl/Makefile.mingw =================================================================== --- trunk/libgaim/plugins/perl/Makefile.mingw 2006-10-29 15:59:05 UTC (rev 17619) +++ trunk/libgaim/plugins/perl/Makefile.mingw 2006-10-29 23:28:37 UTC (rev 17620) @@ -76,7 +76,7 @@ ## clean: rm -rf $(OBJECTS) - rm -rf $(TARGET).dll + rm -rf $(TARGET).dll $(TARGET).dll.a $(MAKE) -C ./common -f $(GAIM_WIN32_MAKEFILE) clean include $(GAIM_COMMON_TARGETS) Modified: trunk/libgaim/plugins/tcl/tcl.c =================================================================== --- trunk/libgaim/plugins/tcl/tcl.c 2006-10-29 15:59:05 UTC (rev 17619) +++ trunk/libgaim/plugins/tcl/tcl.c 2006-10-29 23:28:37 UTC (rev 17620) @@ -437,36 +437,50 @@ #define Tk_Init wtk_Init static gboolean tcl_win32_init() { - gaim_debug(GAIM_DEBUG_INFO, "tcl", - "Initializing the Tcl runtime. If Gaim doesn't load, it is " - "most likely because you have cygwin in your PATH and you " - "should remove it. See http://gaim.sf.net/win32 for more " - "information\n"); + const char regkey[] = "SOFTWARE\\ActiveState\\ActiveTcl\\"; + char *version = NULL; + gboolean retval = FALSE; - if(!(wtcl_CreateInterp = (LPFNTCLCREATEINTERP) wgaim_find_and_loadproc("tcl84.dll", "Tcl_CreateInterp"))) { - gaim_debug(GAIM_DEBUG_INFO, "tcl", "tcl_win32_init error loading Tcl_CreateInterp\n"); - return FALSE; - } + if ((version = wgaim_read_reg_string(HKEY_LOCAL_MACHINE, regkey, "CurrentVersion")) + || (version = wgaim_read_reg_string(HKEY_CURRENT_USER, regkey, "CurrentVersion"))) { + char *path; + char *regkey2; - if(!(wtk_Init = (LPFNTKINIT) wgaim_find_and_loadproc("tk84.dll", "Tk_Init"))) { - HMODULE mod; - gaim_debug(GAIM_DEBUG_INFO, "tcl", "tcl_win32_init error loading Tk_Init\n"); - if((mod = GetModuleHandle("tcl84.dll"))) - FreeLibrary(mod); - return FALSE; - } + regkey2 = g_strdup_printf("%s%s\\", regkey, version); + if ((path = wgaim_read_reg_string(HKEY_LOCAL_MACHINE, regkey2, NULL)) || (path = wgaim_read_reg_string(HKEY_CURRENT_USER, regkey2, NULL))) { + char *tclpath; + char *tkpath; - if (GetModuleHandle("cygwin1.dll")) { - HMODULE mod; - gaim_debug(GAIM_DEBUG_INFO, "tcl", "Cygwin has been loaded by tcl84.dll and/or tk84.dll. Disabling Tcl support to avoid problems.\n"); - if((mod = GetModuleHandle("tcl84.dll"))) - FreeLibrary(mod); - if((mod = GetModuleHandle("tk84.dll"))) - FreeLibrary(mod); - return FALSE; + gaim_debug(GAIM_DEBUG_INFO, "tcl", "Loading ActiveTCL version %s from \"%s\"\n", version, path); + + tclpath = g_build_filename(path, "bin", "tcl84.dll", NULL); + tkpath = g_build_filename(path, "bin", "tk84.dll", NULL); + + if(!(wtcl_CreateInterp = (LPFNTCLCREATEINTERP) wgaim_find_and_loadproc(tclpath, "Tcl_CreateInterp"))) { + gaim_debug(GAIM_DEBUG_INFO, "tcl", "tcl_win32_init error loading Tcl_CreateInterp\n"); + } else { + if(!(wtk_Init = (LPFNTKINIT) wgaim_find_and_loadproc(tkpath, "Tk_Init"))) { + HMODULE mod; + gaim_debug(GAIM_DEBUG_INFO, "tcl", "tcl_win32_init error loading Tk_Init\n"); + if((mod = GetModuleHandle("tcl84.dll"))) + FreeLibrary(mod); + } else { + retval = TRUE; + } + } + g_free(tclpath); + g_free(tkpath); + } + g_free(path); + g_free(regkey2); } - return TRUE; + g_free(version); + + if (!retval) + gaim_debug(GAIM_DEBUG_INFO, "tcl", _("Unable to detect ActiveTCL installation. If you wish to use TCL plugins, install ActiveTCL from http://www.activestate.com\n")); + + return retval; } #endif /* _WIN32 */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |