summaryrefslogtreecommitdiffstats
path: root/win/tcl.m4
diff options
context:
space:
mode:
authorhobbs <hobbs@noemail.net>2010-08-27 00:21:45 (GMT)
committerhobbs <hobbs@noemail.net>2010-08-27 00:21:45 (GMT)
commitd3ff272d708bd5ffb590e2e67035bcfec7b0df49 (patch)
tree89b762704d6b179591b4ffacbea7975c1e55f3c9 /win/tcl.m4
parentbd183b8e7522c31f9e8a83e06e81f461cb749eb5 (diff)
downloadtk-d3ff272d708bd5ffb590e2e67035bcfec7b0df49.zip
tk-d3ff272d708bd5ffb590e2e67035bcfec7b0df49.tar.gz
tk-d3ff272d708bd5ffb590e2e67035bcfec7b0df49.tar.bz2
* win/Makefile.in (VC_MANIFEST_EMBED_DLL VC_MANIFEST_EMBED_EXE):
* win/configure, win/configure.in, win/tcl.m4: SC_EMBED_MANIFEST macro and --enable-embedded-manifest configure arg added to support manifest embedding where we know the magic. Help prevents DLL hell with MSVC8+. FossilOrigin-Name: 3416226333358009ffed8d1ef0470d1a6109c1f3
Diffstat (limited to 'win/tcl.m4')
-rw-r--r--win/tcl.m450
1 files changed, 50 insertions, 0 deletions
diff --git a/win/tcl.m4 b/win/tcl.m4
index 2f56787..cd9a36e 100644
--- a/win/tcl.m4
+++ b/win/tcl.m4
@@ -922,3 +922,53 @@ AC_DEFUN([SC_TCL_CFG_ENCODING], [
AC_DEFINE(TCL_CFGVAL_ENCODING,"cp1252")
fi
])
+
+#--------------------------------------------------------------------
+# SC_EMBED_MANIFEST
+#
+# Figure out if we can embed the manifest where necessary
+#
+# Arguments:
+# An optional manifest to merge into DLL/EXE.
+#
+# Results:
+# Will define the following vars:
+# VC_MANIFEST_EMBED_DLL
+# VC_MANIFEST_EMBED_EXE
+#
+#--------------------------------------------------------------------
+
+AC_DEFUN([SC_EMBED_MANIFEST], [
+ AC_MSG_CHECKING(whether to embed manifest)
+ AC_ARG_ENABLE(embedded-manifest,
+ AC_HELP_STRING([--enable-embedded-manifest],
+ [embed manifest if possible (default: yes)]),
+ [embed_ok=$enableval], [embed_ok=yes])
+
+ VC_MANIFEST_EMBED_DLL=
+ VC_MANIFEST_EMBED_EXE=
+ result=no
+ if test "$embed_ok" = "yes" -a "${SHARED_BUILD}" = "1" \
+ -a "$GCC" != "yes" ; then
+ # Add the magic to embed the manifest into the dll/exe
+ AC_EGREP_CPP([manifest needed], [
+#if defined(_MSC_VER) && _MSC_VER >= 1400
+print("manifest needed")
+#endif
+ ], [
+ # Could do a CHECK_PROG for mt, but should always be with MSVC8+
+ # Could add 'if test -f' check, but manifest should be created
+ # in this compiler case
+ # Add in a manifest argument that may be specified
+ VC_MANIFEST_EMBED_DLL="mt.exe -nologo -manifest \[$]@.manifest $1 -outputresource:\[$]@\;2"
+ VC_MANIFEST_EMBED_EXE="mt.exe -nologo -manifest \[$]@.manifest $1 -outputresource:\[$]@\;1"
+ result=yes
+ if test "x$1" != x ; then
+ result="yes ($1)"
+ fi
+ ])
+ fi
+ AC_MSG_RESULT([$result])
+ AC_SUBST(VC_MANIFEST_EMBED_DLL)
+ AC_SUBST(VC_MANIFEST_EMBED_EXE)
+])