[m-rev.] diff: avoid using -o to name executables with MSVC

Julien Fischer juliensf at csse.unimelb.edu.au
Tue Oct 4 13:32:58 AEDT 2011


In order to avoid bootstrapping problems (due to the special handling
of the slice directory in the bootcheck script), this diff will be
committed in two parts.  I will commit the changes to the first two
files now and the change to the compiler after they have bootstrapped.

Branches: main, 11.07

Don't use -o when creating executables with MSVC.  (For some silly
reason its been deprecated and we have to use -Fe instead.)
Note that mmc --make already uses -Fe with MSVC, this change only
affects mmake.

configure.in:
scripts/Mmake.vars.in:
 	Define a new variable, EXEFILE_OPT, whose variable gives the option
 	used to name executables.

compiler/write_deps_file.m:
 	Use the above variable instead of hardcoding the option to be
 	"-o".

Julien.

Index: configure.in
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/configure.in,v
retrieving revision 1.595
diff -u -r1.595 configure.in
--- configure.in	3 Oct 2011 12:22:20 -0000	1.595
+++ configure.in	3 Oct 2011 16:13:48 -0000
@@ -1036,6 +1036,7 @@
      LINK_OPT_SEP="-link"

      OBJFILE_OPT="-Fo"
+    EXEFILE_OPT="-Fe"
      AR="lib"
      ARFLAGS=""
      AR_LIBFILE_OPT="-OUT:"
@@ -1062,6 +1063,7 @@
      LINK_OPT_SEP=""

      OBJFILE_OPT="-o "
+    EXEFILE_OPT="-o "
      AR="ar"
      ARFLAGS="cr"
      AR_LIBFILE_OPT=""
@@ -1125,6 +1127,7 @@

  AC_SUBST(RANLIBFLAGS)
  AC_SUBST(OBJFILE_OPT)
+AC_SUBST(EXEFILE_OPT)
  AC_SUBST(AR)
  AC_SUBST(ARFLAGS)
  AC_SUBST(AR_LIBFILE_OPT)
Index: compiler/write_deps_file.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/write_deps_file.m,v
retrieving revision 1.14
diff -u -r1.14 write_deps_file.m
--- compiler/write_deps_file.m	23 May 2011 05:08:15 -0000	1.14
+++ compiler/write_deps_file.m	3 Oct 2011 16:16:27 -0000
@@ -1837,7 +1837,7 @@
              "$(", MakeVarName, ".os) ", InitObjFileName, " ",
              All_MLObjsString, " ", All_MLLibsDepString, "\n",
          "\t$(ML) $(ALL_GRADEFLAGS) $(ALL_MLFLAGS) -- $(ALL_LDFLAGS) ",
-            "-o ", ExeFileName, "$(EXT_FOR_EXE) ", InitObjFileName, " \\\n",
+            "$(EXEFILE_OPT)", ExeFileName, "$(EXT_FOR_EXE) ", InitObjFileName, " \\\n",
          "\t\t$(", MakeVarName, ".os) ", All_MLObjsString, " $(ALL_MLLIBS)\n"],

      globals.get_target(Globals, Target),
Index: scripts/Mmake.vars.in
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/scripts/Mmake.vars.in,v
retrieving revision 1.116
diff -u -r1.116 Mmake.vars.in
--- scripts/Mmake.vars.in	20 Dec 2010 16:29:08 -0000	1.116
+++ scripts/Mmake.vars.in	3 Oct 2011 16:14:41 -0000
@@ -758,6 +758,7 @@
  # any trailing spaces in @OBJFILE_OPT@
  empty_string=
  OBJFILE_OPT=@OBJFILE_OPT@$(empty_string)
+EXEFILE_OPT=@EXEFILE_OPT@$(empty_string)

  EXT_FOR_EXE=@EXEEXT@
  O=@OBJ_SUFFIX@
--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to:       mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions:          mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the reviews mailing list