From 6da8b413c4b3bf6801bd9935bce44a7764ab85f6 Mon Sep 17 00:00:00 2001 From: nijtmans Date: Thu, 9 Sep 2010 14:59:24 +0000 Subject: win/rules.vc: (sync with tcl version) mingw should always link with -ladvapi32 Remove ascii variant of tkWinPocs table, it is no longer necessary. --- ChangeLog | 10 ++++++++++ win/configure | 2 +- win/makefile.vc | 10 +++++----- win/rules.vc | 42 +++++++++++++++++++++++++++++++++++------- win/tcl.m4 | 30 +++++++++++++++--------------- win/tkWinInt.h | 4 ++-- win/tkWinTest.c | 24 ++---------------------- win/tkWinX.c | 26 ++------------------------ 8 files changed, 72 insertions(+), 76 deletions(-) diff --git a/ChangeLog b/ChangeLog index a2fdce4..0c6e127 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2010-09-09 Jan Nijtmans + + * win/rules.vc: (sync with tcl version) + * win/makefile.vc: mingw should always link with -ladvapi32 + * win/tcl.m4: + * win/configure: (regenerated) + * win/tkWinInt.h: Remove ascii variant of tkWinPocs table, + * win/tkWinX.c: it is no longer necessary. + * win/tkWinTest.c: + 2010-09-08 Joe English * generic/ttk/ttkTreeview.c(TreeviewSeeCommand): diff --git a/win/configure b/win/configure index 72f0ea6..6b2e109 100755 --- a/win/configure +++ b/win/configure @@ -3287,7 +3287,7 @@ echo "$as_me: WARNING: 64bit mode not supported with GCC on Windows" >&2;} fi SHLIB_LD="" SHLIB_LD_LIBS='${LIBS}' - LIBS="-lws2_32" + LIBS="-lkernel32 -luser32 -ladvapi32 -lws2_32" # mingw needs to link ole32 and oleaut32 for [send], but MSVC doesn't LIBS_GUI="-lgdi32 -lcomdlg32 -limm32 -lcomctl32 -lshell32 -luuid -lole32 -loleaut32" STLIB_LD='${AR} cr' diff --git a/win/makefile.vc b/win/makefile.vc index 82bbaf8..5f90d96 100644 --- a/win/makefile.vc +++ b/win/makefile.vc @@ -5,7 +5,7 @@ # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. -# +# # Copyright (c) 1995-1996 Sun Microsystems, Inc. # Copyright (c) 1998-2000 Ajuba Solutions. # Copyright (c) 2001-2005 ActiveState Corporation. @@ -13,7 +13,7 @@ # Copyright (c) 2003-2008 Pat Thoyts. # #------------------------------------------------------------------------------ -# RCS: @(#) $Id: makefile.vc,v 1.130 2010/03/12 15:23:39 nijtmans Exp $ +# RCS: @(#) $Id: makefile.vc,v 1.131 2010/09/09 14:59:24 nijtmans Exp $ #------------------------------------------------------------------------------ # Check to see we are configured to build with MSVC (MSDEVDIR or MSVCDIR) @@ -117,7 +117,7 @@ the build instructions. # Sets special macros for checking compatability. # # nodep = Turns off compatability macros to ensure Tk isn't -# being built with deprecated functions. +# being built with deprecated functions. # fullwarn = Builds with full compiler and link warnings enabled. # Very verbose. # @@ -130,7 +130,7 @@ the build instructions. # TMP_DIR= # OUT_DIR= # Hooks to allow the intermediate and output directories to be -# changed. $(OUT_DIR) is assumed to be +# changed. $(OUT_DIR) is assumed to be # $(BINROOT)\(Release|Debug) based on if symbols are requested. # $(TMP_DIR) will de $(OUT_DIR)\ by default. # @@ -521,7 +521,7 @@ tcllibs = $(TCLIMPLIB) tcllibs = $(TCLSTUBLIB) $(tcllibs) !endif -baselibs = kernel32.lib user32.lib ws2_32.lib +baselibs = kernel32.lib user32.lib advapi32.lib ws2_32.lib # Avoid 'unresolved external symbol __security_cookie' errors. # c.f. http://support.microsoft.com/?id=894573 !if "$(MACHINE)" == "IA64" || "$(MACHINE)" == "AMD64" diff --git a/win/rules.vc b/win/rules.vc index c9ee97a..fab8118 100644 --- a/win/rules.vc +++ b/win/rules.vc @@ -11,7 +11,7 @@ # Copyright (c) 2003-2007 Patrick Thoyts # #------------------------------------------------------------------------------ -# RCS: @(#) $Id: rules.vc,v 1.26 2010/07/01 21:31:26 nijtmans Exp $ +# RCS: @(#) $Id: rules.vc,v 1.27 2010/09/09 14:59:24 nijtmans Exp $ #------------------------------------------------------------------------------ !ifndef _RULES_VC @@ -143,7 +143,7 @@ OPTIMIZATIONS = $(OPTIMIZATIONS) -YX ### test for pentium errata !if [nmakehlp -c -QI0f] !message *** Compiler has 'Pentium 0x0f fix' -COMPILERFLAGS = $(COMPILERFLAGSS) -QI0f +COMPILERFLAGS = $(COMPILERFLAGS) -QI0f !else !message *** Compiler does not have 'Pentium 0x0f fix' !endif @@ -212,14 +212,15 @@ _VC_MANIFEST_EMBED_DLL=if exist $@.manifest mt -nologo -manifest $@.manifest -ou !if "$(OPTS)" == "" || [nmakehlp -f "$(OPTS)" "none"] STATIC_BUILD = 0 -TCL_THREADS = 0 +TCL_THREADS = 1 DEBUG = 0 SYMBOLS = 0 PROFILE = 0 +PGO = 0 MSVCRT = 0 LOIMPACT = 0 TCL_USE_STATIC_PACKAGES = 0 -USE_THREAD_ALLOC = 0 +USE_THREAD_ALLOC = 1 UNCHECKED = 0 !else !if [nmakehlp -f $(OPTS) "static"] @@ -240,12 +241,12 @@ TCL_USE_STATIC_PACKAGES = 1 !else TCL_USE_STATIC_PACKAGES = 0 !endif -!if [nmakehlp -f $(OPTS) "threads"] +!if [nmakehlp -f $(OPTS) "nothreads"] +TCL_THREADS = 0 +!else !message *** Doing threads TCL_THREADS = 1 USE_THREAD_ALLOC= 1 -!else -TCL_THREADS = 0 !endif !if [nmakehlp -f $(OPTS) "symbols"] !message *** Doing symbols @@ -265,6 +266,15 @@ PROFILE = 1 !else PROFILE = 0 !endif +!if [nmakehlp -f $(OPTS) "pgi"] +!message *** Doing profile guided optimization instrumentation +PGO = 1 +!elseif [nmakehlp -f $(OPTS) "pgo"] +!message *** Doing profile guided optimization +PGO = 2 +!else +PGO = 0 +!endif !if [nmakehlp -f $(OPTS) "loimpact"] !message *** Doing loimpact LOIMPACT = 1 @@ -419,6 +429,24 @@ WARNINGS = $(WARNINGS) -Wp64 !endif !endif +!if $(PGO) > 1 +!if [nmakehlp -l -ltcg:pgoptimize] +LINKERFLAGS = $(LINKERFLAGS:-ltcg=) -ltcg:pgoptimize +!else +MSG=^ +This compiler does not support profile guided optimization. +!error $(MSG) +!endif +!elseif $(PGO) > 0 +!if [nmakehlp -l -ltcg:pginstrument] +LINKERFLAGS = $(LINKERFLAGS:-ltcg=) -ltcg:pginstrument +!else +MSG=^ +This compiler does not support profile guided optimization. +!error $(MSG) +!endif +!endif + #---------------------------------------------------------- # Set our defines now armed with our options. #---------------------------------------------------------- diff --git a/win/tcl.m4 b/win/tcl.m4 index 33762cf..9faef88 100644 --- a/win/tcl.m4 +++ b/win/tcl.m4 @@ -27,7 +27,7 @@ AC_DEFUN([SC_PATH_TCLCONFIG], [ else TCL_BIN_DIR_DEFAULT=../../tcl/win fi - + AC_ARG_WITH(tcl, [ --with-tcl=DIR use Tcl 8.6 binaries from DIR], TCL_BIN_DIR=$withval, TCL_BIN_DIR=`cd $TCL_BIN_DIR_DEFAULT; pwd`) if test ! -d $TCL_BIN_DIR; then @@ -67,7 +67,7 @@ AC_DEFUN([SC_PATH_TKCONFIG], [ else TK_BIN_DIR_DEFAULT=../../tk/win fi - + AC_ARG_WITH(tk, [ --with-tk=DIR use Tk 8.6 binaries from DIR], TK_BIN_DIR=$withval, TK_BIN_DIR=`cd $TK_BIN_DIR_DEFAULT; pwd`) if test ! -d $TK_BIN_DIR; then @@ -86,7 +86,7 @@ AC_DEFUN([SC_PATH_TKCONFIG], [ # Load the tclConfig.sh file. # # Arguments: -# +# # Requires the following vars to be set: # TCL_BIN_DIR # @@ -158,7 +158,7 @@ AC_DEFUN([SC_LOAD_TCLCONFIG], [ # Currently a no-op for Windows # # Arguments: -# +# # Requires the following vars to be set: # TK_BIN_DIR # @@ -191,7 +191,7 @@ AC_DEFUN([SC_LOAD_TKCONFIG], [ # # Arguments: # none -# +# # Results: # # Adds the following arguments to configure: @@ -235,7 +235,7 @@ AC_DEFUN([SC_ENABLE_SHARED], [ # # Arguments: # none -# +# # Results: # # Adds the following arguments to configure: @@ -273,11 +273,11 @@ AC_DEFUN([SC_ENABLE_THREADS], [ # # Arguments: # none -# +# # Requires the following vars to be set in the Makefile: # CFLAGS_DEBUG # CFLAGS_OPTIMIZE -# +# # Results: # # Adds the following arguments to configure: @@ -463,7 +463,7 @@ file for information about building with Mingw.]) fi SHLIB_LD="" SHLIB_LD_LIBS='${LIBS}' - LIBS="-lws2_32" + LIBS="-lkernel32 -luser32 -ladvapi32 -lws2_32" # mingw needs to link ole32 and oleaut32 for [send], but MSVC doesn't LIBS_GUI="-lgdi32 -lcomdlg32 -limm32 -lcomctl32 -lshell32 -luuid -lole32 -loleaut32" STLIB_LD='${AR} cr' @@ -543,7 +543,7 @@ file for information about building with Mingw.]) CC_OBJNAME="-o \[$]@" CC_EXENAME="-o \[$]@" - # Specify linker flags depending on the type of app being + # Specify linker flags depending on the type of app being # built -- Console vs. Window. # # ORIGINAL COMMENT: @@ -554,7 +554,7 @@ file for information about building with Mingw.]) # cross compiling. Remove this -e workaround once we # require a gcc that does not have this bug. # - # MK NOTE: Tk should use a different mechanism. This causes + # MK NOTE: Tk should use a different mechanism. This causes # interesting problems, such as wish dying at startup. #LDFLAGS_WINDOW="-mwindows -e _WinMain@16 ${extra_ldflags}" LDFLAGS_CONSOLE="-mconsole ${extra_ldflags}" @@ -615,7 +615,7 @@ file for information about building with Mingw.]) fi fi - LIBS="user32.lib advapi32.lib ws2_32.lib" + LIBS="kernel32.lib user32.lib advapi32.lib ws2_32.lib" if test "$do64bit" != "no" ; then # The space-based-path will work for the Makefile, but will # not work if AC_TRY_COMPILE is called. TEA has the @@ -760,12 +760,12 @@ file for information about building with Mingw.]) CFLAGS_WARNING="-W3" LDFLAGS_DEBUG="-debug:full" LDFLAGS_OPTIMIZE="-release" - + # Specify the CC output file names based on the target name CC_OBJNAME="-Fo\[$]@" CC_EXENAME="-Fe\"\$(shell \$(CYGPATH) '\[$]@')\"" - # Specify linker flags depending on the type of app being + # Specify linker flags depending on the type of app being # built -- Console vs. Window. if test "$doWince" != "no" -a "${TARGETCPU}" != "X86"; then LDFLAGS_CONSOLE="-link ${lflags}" @@ -810,7 +810,7 @@ AC_DEFUN([SC_WITH_TCL], [ else TCL_BIN_DEFAULT=../../tcl8.6/win fi - + AC_ARG_WITH(tcl, [ --with-tcl=DIR use Tcl 8.6 binaries from DIR], TCL_BIN_DIR=$withval, TCL_BIN_DIR=`cd $TCL_BIN_DEFAULT; pwd`) if test ! -d $TCL_BIN_DIR; then diff --git a/win/tkWinInt.h b/win/tkWinInt.h index 559d528..1014ec8 100644 --- a/win/tkWinInt.h +++ b/win/tkWinInt.h @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkWinInt.h,v 1.36 2010/04/29 15:28:04 nijtmans Exp $ + * RCS: @(#) $Id: tkWinInt.h,v 1.37 2010/09/09 14:59:24 nijtmans Exp $ */ #ifndef _TKWININT @@ -196,7 +196,7 @@ typedef struct TkWinProcs { int (WINAPI *getClassName)(HWND, LPTSTR, int); } TkWinProcs; -MODULE_SCOPE const TkWinProcs *tkWinProcs; +MODULE_SCOPE const TkWinProcs *const tkWinProcs; /* * The following allows us to cache these encoding for multiple functions. diff --git a/win/tkWinTest.c b/win/tkWinTest.c index 70ab646..edd3338 100644 --- a/win/tkWinTest.c +++ b/win/tkWinTest.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkWinTest.c,v 1.31 2010/03/04 22:59:28 nijtmans Exp $ + * RCS: @(#) $Id: tkWinTest.c,v 1.32 2010/09/09 14:59:24 nijtmans Exp $ */ #ifndef USE_TCL_STUBS @@ -45,20 +45,6 @@ static int TestwinlocaleObjCmd(ClientData clientData, static Tk_GetSelProc SetSelectionResult; -static const TkWinProcs asciiProcs = { - 0, - (LRESULT (WINAPI *)(WNDPROC, HWND, UINT, WPARAM, LPARAM)) CallWindowProcA, - (LRESULT (WINAPI *)(HWND, UINT, WPARAM, LPARAM)) DefWindowProcA, - (ATOM (WINAPI *)(const WNDCLASS *)) RegisterClassA, - (BOOL (WINAPI *)(HWND, LPCTSTR)) SetWindowTextA, - (HWND (WINAPI *)(DWORD, LPCTSTR, LPCTSTR, DWORD, int, int, int, int, - HWND, HMENU, HINSTANCE, LPVOID)) CreateWindowExA, - (BOOL (WINAPI *)(HMENU, UINT, UINT, UINT, LPCTSTR)) InsertMenuA, - (int (WINAPI *)(HWND, LPCTSTR, int)) GetWindowTextA, - (HWND (WINAPI *)(LPCTSTR, LPCTSTR)) FindWindowA, - (int (WINAPI *)(HWND, LPTSTR, int)) GetClassNameA, -}; - static const TkWinProcs unicodeProcs = { 1, (LRESULT (WINAPI *)(WNDPROC, HWND, UINT, WPARAM, LPARAM)) CallWindowProcW, @@ -73,7 +59,7 @@ static const TkWinProcs unicodeProcs = { (int (WINAPI *)(HWND, LPTSTR, int)) GetClassNameW, }; -static const TkWinProcs *tkTestWinProcs = &asciiProcs; +static const TkWinProcs *const tkTestWinProcs = &unicodeProcs; /* @@ -97,12 +83,6 @@ int TkplatformtestInit( Tcl_Interp *interp) /* Interpreter to add commands to. */ { - int useWide = (TkWinGetPlatformId() != VER_PLATFORM_WIN32_WINDOWS); - if (useWide) { - tkTestWinProcs = &unicodeProcs; - } else { - tkTestWinProcs = &asciiProcs; - } /* * Add commands for platform specific tests on MacOS here. */ diff --git a/win/tkWinX.c b/win/tkWinX.c index 75752fe..cc39b90 100644 --- a/win/tkWinX.c +++ b/win/tkWinX.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkWinX.c,v 1.65 2010/05/20 22:48:13 dkf Exp $ + * RCS: @(#) $Id: tkWinX.c,v 1.66 2010/09/09 14:59:24 nijtmans Exp $ */ /* @@ -63,20 +63,6 @@ #define UNICODE_NOCHAR 0xFFFF #endif -static const TkWinProcs asciiProcs = { - 0, - (LRESULT (WINAPI *)(WNDPROC, HWND, UINT, WPARAM, LPARAM)) CallWindowProcA, - (LRESULT (WINAPI *)(HWND, UINT, WPARAM, LPARAM)) DefWindowProcA, - (ATOM (WINAPI *)(const WNDCLASS *)) RegisterClassA, - (BOOL (WINAPI *)(HWND, LPCTSTR)) SetWindowTextA, - (HWND (WINAPI *)(DWORD, LPCTSTR, LPCTSTR, DWORD, int, int, - int, int, HWND, HMENU, HINSTANCE, LPVOID)) CreateWindowExA, - (BOOL (WINAPI *)(HMENU, UINT, UINT, UINT, LPCTSTR)) InsertMenuA, - (int (WINAPI *)(HWND, LPCTSTR, int)) GetWindowTextA, - (HWND (WINAPI *)(LPCTSTR, LPCTSTR)) FindWindowA, - (int (WINAPI *)(HWND, LPTSTR, int)) GetClassNameA, -}; - static const TkWinProcs unicodeProcs = { 1, (LRESULT (WINAPI *)(WNDPROC, HWND, UINT, WPARAM, LPARAM)) CallWindowProcW, @@ -91,7 +77,7 @@ static const TkWinProcs unicodeProcs = { (int (WINAPI *)(HWND, LPTSTR, int)) GetClassNameW, }; -const TkWinProcs *tkWinProcs; +const TkWinProcs *const tkWinProcs = &unicodeProcs; /* * Declarations of static variables used in this file. @@ -248,7 +234,6 @@ TkWinXInit( INITCOMMONCONTROLSEX comctl; CHARSETINFO lpCs; DWORD lpCP; - int useWide; if (childClassInitialized != 0) { return; @@ -261,13 +246,6 @@ TkWinXInit( Tcl_Panic("Unable to load common controls?!"); } - useWide = (TkWinGetPlatformId() != VER_PLATFORM_WIN32_WINDOWS); - if (useWide) { - tkWinProcs = &unicodeProcs; - } else { - tkWinProcs = &asciiProcs; - } - childClass.style = CS_HREDRAW | CS_VREDRAW; childClass.cbClsExtra = 0; childClass.cbWndExtra = 0; -- cgit v0.12