[m-rev.] diff: delete --with-msvcrt configure option
Julien Fischer
jfischer at opturion.com
Tue Jan 13 05:02:59 AEDT 2026
Delete --with-msvcrt configure option.
The --with-msvcrt option was intended for selecting between the older Microsoft
C runtime (crtdll.dll) and the Microsoft Visual C runtime (msvcrt.dll). This is
all now ancient history, since the MSVCRT itself has been superseded by the
Universal C runtime since Windows 10. Delete the --with-msvcrt option and all
uses of it.
configure.ac:
Delete the --with-msvcrt option.
scripts/mgnuc.in
scripts/ml.in:
Delete uses of the above configuration value.
Documentation/README.MS-VisualC.md:
Delete references to --with-msvcrt.
Julien.
diff --git a/Documentation/README.MS-VisualC.md
b/Documentation/README.MS-VisualC.md
index 0881c15b9..2bd1749e3 100644
--- a/Documentation/README.MS-VisualC.md
+++ b/Documentation/README.MS-VisualC.md
@@ -86,13 +86,7 @@ cross-compile the MSVC port.
In either case, to use MSVC as the C compiler with Mercury, invoke `configure`
as follows:
-
- ./configure --with-cc=cl [--with-msvcrt] [<any other options>]
-
-
-The `--with-msvcrt` flag causes executables built with this install of Mercury
-to be linked with the MS Visual C runtime, instead of the standard libC
-runtime.
+ ./configure --with-cc=cl [<any other options>]
On Cygwin, `configure` and `mmake` will do translation of Unix style paths, so
you may specify the installation directory using either a Unix- or
@@ -100,28 +94,20 @@ Windows-style path. On MSYS2, you must use a full
Windows-style path with a
drive letter, except that you must use `/` instead of `\` as a directory
separator. For example, this is acceptable:
-
./configure --prefix="c:/where/to/install/mercury"
-
but this is not:
-
./configure --prefix="c:\where\to\install\mercury"
-
Once `configure` has successfully finished, then do
-
make
-
and then
-
make install
-
as normal.
Limitations
diff --git a/configure.ac b/configure.ac
index 35b82c52e..4dfb3e550 100644
--- a/configure.ac
+++ b/configure.ac
@@ -5089,28 +5089,6 @@ fi
#-----------------------------------------------------------------------------#
-AC_ARG_WITH(msvcrt,
- AS_HELP_STRING([--with-msvcrt],
- [use the MS Visual C runtime if using MS C compiler.]),
- mercury_cv_msvcrt=yes,mercury_cv_msvcrt=no)
-
-AC_MSG_CHECKING(whether to use the MS Visual C Runtime)
-if test "$mercury_cv_msvcrt" = "yes"; then
- if test "$ac_microsoft" = "yes"; then
- AC_MSG_RESULT(yes)
- USE_MSVCRT=yes
- else
- AC_MSG_RESULT(no as not using the MS C compiler)
- USE_MSVCRT=no
- fi
-else
- AC_MSG_RESULT(no)
- USE_MSVCRT=no
-fi
-AC_SUBST(USE_MSVCRT)
-
-#-----------------------------------------------------------------------------#
-
AC_ARG_ENABLE(lto,
AS_HELP_STRING([--enable-lto],
[Enable link-time optimization for C grades
(experimental)]),
diff --git a/scripts/mgnuc.in b/scripts/mgnuc.in
index f60c90f37..3af04f517 100644
--- a/scripts/mgnuc.in
+++ b/scripts/mgnuc.in
@@ -320,22 +320,6 @@ case ${threadscope} in
false) THREADSCOPE_OPTS="" ;;
esac
-# Set the correct flags if we are to use the MS Visual C runtime.
-use_msvcrt=@USE_MSVCRT@
-if test ${use_msvcrt} = "yes"
-then
- case ${thread_safe} in
- # -MD states that we will use the MSVC runtime, the boehm_gc collector
- # assumes that the collector has been built as a DLL if we are using
- # the MSVC runtime so we need to define GC_NOT_DLL when the collector
- # isn't built as a DLL.
- true) MSVCRT_OPTS="-MD" ;;
- false) MSVCRT_OPTS="-DGC_NOT_DLL -MD" ;;
- esac
-else
- MSVCRT_OPTS=""
-fi
-
boehm_opts="-DMR_CONSERVATIVE_GC -DMR_BOEHM_GC "
case ${gc_method} in
accurate) GC_OPTS="-DMR_NATIVE_GC" ;;
diff --git a/scripts/ml.in b/scripts/ml.in
index 06d63bb8d..f8b1032fb 100644
--- a/scripts/ml.in
+++ b/scripts/ml.in
@@ -400,17 +400,6 @@ case "${thread_safe},${all_libs}" in
;;
esac
-# Set the correct flags if we're to use the MS Visual C runtime.
-use_msvcrt=@USE_MSVCRT@
-if test "${use_msvcrt}" = "yes"
-then
- MSVCRT_OPTS="-MD" # Enable linking with the MS Visual C runtime.
- NODEFAULTLIB_FLAG="-nodefaultlib:libcmt"
-else
- MSVCRT_OPTS=""
- NODEFAULTLIB_FLAG=""
-fi
-
# Use any applicable LTO options
LTO_OPTS="${LDFLAGS_FOR_LTO}"
@@ -576,8 +565,8 @@ case "${C_COMPILER_TYPE}" in
;;
esac
-LINKER_PRE_FLAGS="${NOLOGO_OPTS} ${MSVCRT_OPTS} ${PRINT_MAP_OPT}
${UNDEF_OPT} ${STRIP_OPTS} ${LTO_OPTS} ${MAYBE_STATIC_OPT}
${ARCH_OPTS} ${SANITIZER_OPTS}"
-LINKER_POST_FLAGS="@LINK_OPT_SEP@ ${MSVC_SETARGV}
${NODEFAULTLIB_FLAG} ${DEBUG_FLAG} ${LIBDIR_OPTS} ${RPATH_OPT_LIST}
${LIBS}"
+LINKER_PRE_FLAGS="${NOLOGO_OPTS} ${PRINT_MAP_OPT} ${UNDEF_OPT}
${STRIP_OPTS} ${LTO_OPTS} ${MAYBE_STATIC_OPT} ${ARCH_OPTS}
${SANITIZER_OPTS}"
+LINKER_POST_FLAGS="@LINK_OPT_SEP@ ${MSVC_SETARGV} ${DEBUG_FLAG}
${LIBDIR_OPTS} ${RPATH_OPT_LIST} ${LIBS}"
case "${verbose}" in
true)
More information about the reviews
mailing list