summaryrefslogtreecommitdiffstats
path: root/win
diff options
context:
space:
mode:
authornijtmans@users.sourceforge.net <jan.nijtmans>2015-08-28 11:47:28 (GMT)
committernijtmans@users.sourceforge.net <jan.nijtmans>2015-08-28 11:47:28 (GMT)
commit3a227eba3472dde0044265158032e25d75300753 (patch)
tree8b19b845d9b5911b28fc2cde6ca3ed391c20e18f /win
parent206c0db2b36c78e76c5969ad16a4e92eb43eff88 (diff)
parent8f4a1ccf2d7dd4819b46368bba2a2f00f0671b35 (diff)
downloadtk-3a227eba3472dde0044265158032e25d75300753.zip
tk-3a227eba3472dde0044265158032e25d75300753.tar.gz
tk-3a227eba3472dde0044265158032e25d75300753.tar.bz2
Completing [http://core.tcl.tk/tcl/info/00189c4afcb9e2586301d711f71383e48817a72d|00189c4afc]: Allow semi-static UCRT build on Windows with VC 14.0. Now for the configure/makefile build.
Diffstat (limited to 'win')
-rwxr-xr-xwin/configure20
-rw-r--r--win/makefile.vc25
-rw-r--r--win/rules.vc7
-rw-r--r--win/tcl.m420
4 files changed, 43 insertions, 29 deletions
diff --git a/win/configure b/win/configure
index 8b7ae07..1959f8f 100755
--- a/win/configure
+++ b/win/configure
@@ -3906,6 +3906,13 @@ echo "${ECHO_T}using shared flags" >&6
# Add SHLIB_LD_LIBS to the Make rule, not here.
LIBRARIES="\${SHARED_LIBRARIES}"
EXESUFFIX="\${DBGX}.exe"
+ case "x`echo \${VisualStudioVersion}`" in
+ x14*)
+ lflags="${lflags} -nodefaultlib:libucrt.lib"
+ ;;
+ *)
+ ;;
+ esac
fi
MAKE_DLL="\${SHLIB_LD} \$(LDFLAGS) -out:\$@"
# DLLSUFFIX is separate because it is the building block for
@@ -3946,6 +3953,15 @@ echo "${ECHO_T} Using 64-bit $MACHINE mode" >&6
fi
LIBS="netapi32.lib kernel32.lib user32.lib advapi32.lib ws2_32.lib"
+
+ case "x`echo \${VisualStudioVersion}`" in
+ x14*)
+ LIBS="$LIBS ucrt.lib"
+ ;;
+ *)
+ ;;
+ esac
+
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
@@ -4020,7 +4036,7 @@ fi
CFLAGS_DEBUG="-nologo -Zi -Od ${runtime}d"
# Do not use -O2 for Win64 - this has proved buggy in code gen.
CFLAGS_OPTIMIZE="-nologo -O1 ${runtime}"
- lflags="-nologo -MACHINE:${MACHINE} -LIBPATH:\"${MSSDK}/Lib/${MACHINE}\""
+ lflags="${lflags} -nologo -MACHINE:${MACHINE} -LIBPATH:\"${MSSDK}/Lib/${MACHINE}\""
LINKBIN="\"${PATH64}/link.exe\""
# Avoid 'unresolved external symbol __security_cookie' errors.
# c.f. http://support.microsoft.com/?id=894573
@@ -4032,7 +4048,7 @@ fi
CFLAGS_DEBUG="-nologo -Z7 -Od -WX ${runtime}d"
# -O2 - create fast code (/Og /Oi /Ot /Oy /Ob2 /Gs /GF /Gy)
CFLAGS_OPTIMIZE="-nologo -O2 ${runtime}"
- lflags="-nologo"
+ lflags="${lflags} -nologo"
LINKBIN="link"
fi
diff --git a/win/makefile.vc b/win/makefile.vc
index 1a80dbc..1b55cdf 100644
--- a/win/makefile.vc
+++ b/win/makefile.vc
@@ -42,7 +42,7 @@ the build instructions.
# turn on the 64-bit compiler, if your SDK has it.
#
# 3) Targets are:
-# release -- Builds the core, the shell. (default)
+# release -- Builds the core, the shell and the dlls. (default)
# dlls -- Just builds the windows extensions.
# shell -- Just builds the shell and the core.
# core -- Only builds the core [tkXX.(dll|lib)].
@@ -76,7 +76,7 @@ the build instructions.
# Sets where to install Tcl from the built binaries.
# C:\Progra~1\Tcl is assumed when not specified.
#
-# OPTS=loimpact,msvcrt,nothreads,noxp,pdbs,profile,square,static,staticpkg,symbols,unchecked,ucrt,none
+# OPTS=loimpact,msvcrt,nothreads,noxp,pdbs,profile,square,static,staticpkg,symbols,unchecked,none
# Sets special options for the core. The default is for none.
# Any combination of the above may be used (comma separated).
# 'none' will over-ride everything to nothing.
@@ -105,11 +105,6 @@ the build instructions.
# unchecked = Allows a symbols build to not use the debug
# enabled runtime (msvcrt.dll not msvcrtd.dll
# or libcmt.lib not libcmtd.lib).
-# ucrt= Uses ucrt.lib and libvcruntime.lib, which
-# ensures Tcl will run on machines with only the subset
-# of the C runtime that is part of the operating system.
-# If omitted, builds with VC 14.0 or later will require
-# the full C runtime redistributable.
#
# STATS=compdbg,memdbg,none
# Sets optional memory and bytecode compiler debugging code added
@@ -452,7 +447,7 @@ cdebug = $(OPTIMIZATIONS)
cdebug =
!endif
!if $(SYMBOLS)
-cdebug = $(cdebug) -Zi
+cdebug = $(cdebug) -Zi
!endif
!else if "$(MACHINE)" == "IA64" || "$(MACHINE)" == "AMD64"
### Warnings are too many, can't support warnings into errors.
@@ -465,13 +460,7 @@ cdebug = -Zi -WX $(DEBUGFLAGS)
cwarn = $(WARNINGS) -D _CRT_SECURE_NO_DEPRECATE -D _CRT_NONSTDC_NO_DEPRECATE
cflags = -nologo -c $(COMPILERFLAGS) $(cwarn) -Fp$(TMP_DIR)^\
-!if $(UCRT)
-!if $(DEBUG) && !$(UNCHECKED)
-crt = -MDd
-!else
-crt = -MT
-!endif
-!elseif $(MSVCRT)
+!if $(MSVCRT)
!if $(DEBUG) && !$(UNCHECKED)
crt = -MDd
!else
@@ -491,6 +480,7 @@ CON_CFLAGS = $(cdebug) $(cflags) $(crt) -DCONSOLE
WISH_CFLAGS = $(BASE_CFLAGS) $(TK_DEFINES)
STUB_CFLAGS = $(cflags) $(cdebug) $(TK_DEFINES)
+
#---------------------------------------------------------------------
# Link flags
#---------------------------------------------------------------------
@@ -511,7 +501,7 @@ lflags = -nologo -machine:$(MACHINE) $(LINKERFLAGS) $(ldebug)
lflags = $(lflags) -profile
!endif
-!if $(UCRT) && !($(DEBUG) && !$(UNCHECKED))
+!if $(MSVCRT) && !($(DEBUG) && !$(UNCHECKED)) && $(VCVERSION) >= 1900
lflags = $(lflags) -nodefaultlib:libucrt.lib
!endif
@@ -541,8 +531,7 @@ baselibs = netapi32.lib kernel32.lib user32.lib advapi32.lib ws2_32.lib
baselibs = $(baselibs) bufferoverflowU.lib
!endif
!endif
-
-!if $(UCRT) && !($(DEBUG) && !$(UNCHECKED))
+!if $(MSVCRT) && !($(DEBUG) && !$(UNCHECKED)) && $(VCVERSION) >= 1900
baselibs = $(baselibs) ucrt.lib
!endif
diff --git a/win/rules.vc b/win/rules.vc
index b2d92b7..0d8cd6b 100644
--- a/win/rules.vc
+++ b/win/rules.vc
@@ -223,7 +223,6 @@ LOIMPACT = 0
TCL_USE_STATIC_PACKAGES = 0
USE_THREAD_ALLOC = 1
UNCHECKED = 0
-UCRT = 0
!else
!if [nmakehlp -f $(OPTS) "static"]
!message *** Doing static
@@ -303,12 +302,6 @@ UNCHECKED = 1
UNCHECKED = 0
!endif
!endif
-!if [nmakehlp -f $(OPTS) "ucrt"] && $(VCVERSION) >= 1900
-!message *** Doing UCRT
-UCRT = 1
-!else
-UCRT = 0
-!endif
#----------------------------------------------------------
# Figure-out how to name our intermediate and output directories.
diff --git a/win/tcl.m4 b/win/tcl.m4
index d12ae10..7d4acdb 100644
--- a/win/tcl.m4
+++ b/win/tcl.m4
@@ -791,6 +791,13 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
# Add SHLIB_LD_LIBS to the Make rule, not here.
LIBRARIES="\${SHARED_LIBRARIES}"
EXESUFFIX="\${DBGX}.exe"
+ case "x`echo \${VisualStudioVersion}`" in
+ x14*)
+ lflags="${lflags} -nodefaultlib:libucrt.lib"
+ ;;
+ *)
+ ;;
+ esac
fi
MAKE_DLL="\${SHLIB_LD} \$(LDFLAGS) -out:\[$]@"
# DLLSUFFIX is separate because it is the building block for
@@ -828,6 +835,15 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
fi
LIBS="netapi32.lib kernel32.lib user32.lib advapi32.lib ws2_32.lib"
+
+ case "x`echo \${VisualStudioVersion}`" in
+ x14*)
+ LIBS="$LIBS ucrt.lib"
+ ;;
+ *)
+ ;;
+ esac
+
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
@@ -842,7 +858,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
CFLAGS_DEBUG="-nologo -Zi -Od ${runtime}d"
# Do not use -O2 for Win64 - this has proved buggy in code gen.
CFLAGS_OPTIMIZE="-nologo -O1 ${runtime}"
- lflags="-nologo -MACHINE:${MACHINE} -LIBPATH:\"${MSSDK}/Lib/${MACHINE}\""
+ lflags="${lflags} -nologo -MACHINE:${MACHINE} -LIBPATH:\"${MSSDK}/Lib/${MACHINE}\""
LINKBIN="\"${PATH64}/link.exe\""
# Avoid 'unresolved external symbol __security_cookie' errors.
# c.f. http://support.microsoft.com/?id=894573
@@ -854,7 +870,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
CFLAGS_DEBUG="-nologo -Z7 -Od -WX ${runtime}d"
# -O2 - create fast code (/Og /Oi /Ot /Oy /Ob2 /Gs /GF /Gy)
CFLAGS_OPTIMIZE="-nologo -O2 ${runtime}"
- lflags="-nologo"
+ lflags="${lflags} -nologo"
LINKBIN="link"
fi