From ee4a642fd43dde2d79f0175ab24e3a12a420387c Mon Sep 17 00:00:00 2001 From: nijtmans Date: Sun, 31 Oct 2010 21:25:55 +0000 Subject: Add -D_CRT_SECURE_NO_DEPRECATE and -D_CRT_NONSTDC_NO_DEPRECATE, reducing the number of deprecation warnings on later VC++ versions. Better VCVERSION determination. All changes backported from Tcl8.5/8.6 --- ChangeLog | 9 +++++++++ win/.cvsignore | 3 +++ win/configure | 43 +++++++++++++++++++++++-------------------- win/rules.vc | 35 +++++++++++++++++++---------------- win/tcl.m4 | 29 ++++++++++++++++------------- 5 files changed, 70 insertions(+), 49 deletions(-) diff --git a/ChangeLog b/ChangeLog index f1485b3..ed194c1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2010-10-31 Jan Nijtmans + + * win/tcl.m4 Add -D_CRT_SECURE_NO_DEPRECATE and + -D_CRT_NONSTDC_NO_DEPRECATE, reducing the number of + deprecation warnings on later VC++ versions. + * win/rules.vc Better VCVERSION determination + * win/configure (regenerated with autoconf 2.13) + All changes backported from Tcl8.5/8.6 + 2010-10-23 Jan Nijtmans * win/rules.vc Update for VS10 diff --git a/win/.cvsignore b/win/.cvsignore index 42f80eb..510be7b 100644 --- a/win/.cvsignore +++ b/win/.cvsignore @@ -19,3 +19,6 @@ nmakehlp.exe *.manifest config.cache config.status +*.res +*.exp +*.lib diff --git a/win/configure b/win/configure index 56e8dc8..1a34301 100755 --- a/win/configure +++ b/win/configure @@ -1323,7 +1323,7 @@ echo "configure:1230: checking compiler flags" >&5 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: @@ -1334,7 +1334,7 @@ echo "configure:1230: checking compiler flags" >&5 # 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}" @@ -1434,16 +1434,19 @@ echo "configure:1230: checking compiler flags" >&5 MAKE_EXE="\${CC} -Fe\$@" LIBPREFIX="" + CFLAGS_DEBUG="${CFLAGS_DEBUG} -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE" + CFLAGS_OPTIMIZE="${CFLAGS_OPTIMIZE} -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE" + EXTRA_CFLAGS="" 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. LDFLAGS_CONSOLE="-link -subsystem:console ${lflags}" LDFLAGS_WINDOW="-link -subsystem:windows ${lflags}" @@ -1461,7 +1464,7 @@ echo "configure:1230: checking compiler flags" >&5 #-------------------------------------------------------------------- echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:1465: checking how to run the C preprocessor" >&5 +echo "configure:1468: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -1476,13 +1479,13 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1486: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1489: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1493,13 +1496,13 @@ else rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1503: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1506: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1510,13 +1513,13 @@ else rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1520: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1523: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1542,17 +1545,17 @@ echo "$ac_t""$CPP" 1>&6 ac_safe=`echo "errno.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for errno.h""... $ac_c" 1>&6 -echo "configure:1546: checking for errno.h" >&5 +echo "configure:1549: checking for errno.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1556: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1559: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1584,7 +1587,7 @@ fi echo $ac_n "checking for build with symbols""... $ac_c" 1>&6 -echo "configure:1588: checking for build with symbols" >&5 +echo "configure:1591: checking for build with symbols" >&5 # Check whether --enable-symbols or --disable-symbols was given. if test "${enable_symbols+set}" = set; then enableval="$enable_symbols" @@ -1645,7 +1648,7 @@ TK_DBGX=${DBGX} echo $ac_n "checking the location of tclConfig.sh""... $ac_c" 1>&6 -echo "configure:1649: checking the location of tclConfig.sh" >&5 +echo "configure:1652: checking the location of tclConfig.sh" >&5 if test -d ../../tcl8.4$TK_PATCH_LEVEL/win; then TCL_BIN_DIR_DEFAULT=../../tcl8.4$TK_PATCH_LEVEL/win @@ -1654,7 +1657,7 @@ echo "configure:1649: checking the location of tclConfig.sh" >&5 else TCL_BIN_DIR_DEFAULT=../../tcl/win fi - + # Check whether --with-tcl or --without-tcl was given. if test "${with_tcl+set}" = set; then withval="$with_tcl" @@ -1673,7 +1676,7 @@ fi echo $ac_n "checking for existence of $TCL_BIN_DIR/tclConfig.sh""... $ac_c" 1>&6 -echo "configure:1677: checking for existence of $TCL_BIN_DIR/tclConfig.sh" >&5 +echo "configure:1680: checking for existence of $TCL_BIN_DIR/tclConfig.sh" >&5 if test -f "$TCL_BIN_DIR/tclConfig.sh" ; then echo "$ac_t""loading" 1>&6 @@ -1727,14 +1730,14 @@ echo "configure:1677: checking for existence of $TCL_BIN_DIR/tclConfig.sh" >&5 echo $ac_n "checking for tclsh in Tcl build directory""... $ac_c" 1>&6 -echo "configure:1731: checking for tclsh in Tcl build directory" >&5 +echo "configure:1734: checking for tclsh in Tcl build directory" >&5 BUILD_TCLSH=${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}${EXEEXT} echo "$ac_t""$BUILD_TCLSH" 1>&6 echo $ac_n "checking for tclsh""... $ac_c" 1>&6 -echo "configure:1738: checking for tclsh" >&5 +echo "configure:1741: checking for tclsh" >&5 if eval "test \"`echo '$''{'ac_cv_path_tclsh'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 diff --git a/win/rules.vc b/win/rules.vc index ba87724..80e6b2d 100644 --- a/win/rules.vc +++ b/win/rules.vc @@ -11,7 +11,7 @@ # Copyright (c) 2003-2006 Patrick Thoyts # #------------------------------------------------------------------------------ -# RCS: @(#) $Id: rules.vc,v 1.5.2.10 2010/10/23 21:43:05 nijtmans Exp $ +# RCS: @(#) $Id: rules.vc,v 1.5.2.11 2010/10/31 21:25:55 nijtmans Exp $ #------------------------------------------------------------------------------ !ifndef _RULES_VC @@ -187,24 +187,27 @@ LINKERFLAGS =-ltcg _VC_MANIFEST_EMBED_EXE= _VC_MANIFEST_EMBED_DLL= -!if ![cl /Zs /Tc NUL 2>&1 | find "Version 12" > NUL] -VCVER=6 -!elseif ![cl /Zs /Tc NUL 2>&1 | find "Version 13" > NUL] -VCVER=7 -!elseif ![cl /Zs /Tc NUL 2>&1 | find "Version 14" > NUL] -VCVER=8 -_VC_MANIFEST_EMBED_EXE=if exist $@.manifest mt -nologo -manifest $@.manifest -outputresource:$@;1 -_VC_MANIFEST_EMBED_DLL=if exist $@.manifest mt -nologo -manifest $@.manifest -outputresource:$@;2 -!elseif ![cl /Zs /Tc NUL 2>&1 | find "Version 15" > NUL] -VCVER=9 -_VC_MANIFEST_EMBED_EXE=if exist $@.manifest mt -nologo -manifest $@.manifest -outputresource:$@;1 -_VC_MANIFEST_EMBED_DLL=if exist $@.manifest mt -nologo -manifest $@.manifest -outputresource:$@;2 -!elseif ![cl /Zs /Tc NUL 2>&1 | find "Version 16" > NUL] +VCVER=0 +!if ![echo VCVERSION=_MSC_VER > vercl.x] \ + && ![cl -nologo -TC -P vercl.x $(ERRNULL)] +!include vercl.i +!if $(VCVERSION) >= 1600 VCVER=10 +!elseif $(VCVERSION) >= 1500 +VCVER=9 +!elseif $(VCVERSION) >= 1400 +VCVER=8 +!elseif $(VCVERSION) >= 1300 +VCVER=7 +!elseif $(VCVERSION) >= 1200 +VCVER=6 +!endif +!endif + +# Since MSVC8 we must deal with manifest resources. +!if $(VCVERSION) >= 1400 _VC_MANIFEST_EMBED_EXE=if exist $@.manifest mt -nologo -manifest $@.manifest -outputresource:$@;1 _VC_MANIFEST_EMBED_DLL=if exist $@.manifest mt -nologo -manifest $@.manifest -outputresource:$@;2 -!else -VCVER=0 !endif #---------------------------------------------------------- diff --git a/win/tcl.m4 b/win/tcl.m4 index 056cbe2..ffc6588 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.4 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.4 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 # @@ -159,7 +159,7 @@ AC_DEFUN([SC_LOAD_TCLCONFIG], [ # Currently a no-op for Windows # # Arguments: -# +# # Requires the following vars to be set: # TK_BIN_DIR # @@ -192,7 +192,7 @@ AC_DEFUN([SC_LOAD_TKCONFIG], [ # # Arguments: # none -# +# # Results: # # Adds the following arguments to configure: @@ -236,7 +236,7 @@ AC_DEFUN([SC_ENABLE_SHARED], [ # # Arguments: # none -# +# # Results: # # Adds the following arguments to configure: @@ -274,11 +274,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: @@ -527,7 +527,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ 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: @@ -538,7 +538,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ # 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}" @@ -638,16 +638,19 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ MAKE_EXE="\${CC} -Fe\[$]@" LIBPREFIX="" + CFLAGS_DEBUG="${CFLAGS_DEBUG} -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE" + CFLAGS_OPTIMIZE="${CFLAGS_OPTIMIZE} -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE" + EXTRA_CFLAGS="" 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. LDFLAGS_CONSOLE="-link -subsystem:console ${lflags}" LDFLAGS_WINDOW="-link -subsystem:windows ${lflags}" @@ -683,7 +686,7 @@ AC_DEFUN([SC_WITH_TCL], [ else TCL_BIN_DEFAULT=../../tcl8.4/win fi - + AC_ARG_WITH(tcl, [ --with-tcl=DIR use Tcl 8.4 binaries from DIR], TCL_BIN_DIR=$withval, TCL_BIN_DIR=`cd $TCL_BIN_DEFAULT; pwd`) if test ! -d $TCL_BIN_DIR; then -- cgit v0.12