[m-rev.] diff: force the use of static linkage with MSVC in the ml script

Julien Fischer jfischer at opturion.com
Thu Jan 23 20:29:55 AEDT 2020


Force the use of static linkage with MSVC in the ml script.

This fixes a problem that made it impossible to use mmake with MSVC.

scripts/ml.in:
      Force the use of static linkage with MSVC.

Julien.

diff --git a/scripts/ml.in b/scripts/ml.in
index 88676e1..c77432e 100644
--- a/scripts/ml.in
+++ b/scripts/ml.in
@@ -2,7 +2,8 @@
  # vim: ts=4 sw=4 noet
  # @configure_input@
  #---------------------------------------------------------------------------#
-# Copyright (C) 1995-2008, 2010-2011The University of Melbourne.
+# Copyright (C) 1995-2008, 2010-2011 The University of Melbourne.
+# Copyright (C) 2013-2014, 2016, 2019-2020 The Mercury team.
  # This file may only be copied under the terms of the GNU General
  # Public License - see the file COPYING in the Mercury distribution.
  #---------------------------------------------------------------------------#
@@ -145,6 +146,15 @@ case $mercury_libs in
  		;;
  esac

+# We cannot determine if we are using MSVC by looking at FULLARCH;
+# we must use static linkage with it as we do not currently support
+# the use of DLLs on Windows.
+case "$C_COMPILER_TYPE" in
+	msvc*)
+		mercury_libs=static
+	;;
+esac
+
  # If you haven't set all_libs, set it to the default value
  # (shared on most systems).
  case $all_libs in
@@ -169,6 +179,12 @@ case $all_libs in
  		;;
  esac

+case "$C_COMPILER_TYPE" in
+	msvc*)
+		all_libs=static
+	;;
+esac
+
  # Defaults have been set, now set options.

  case $all_libs in


More information about the reviews mailing list