changeset 25507:b61f3500651f

mkoctfile: fix check for using -o and -c with multiple source files (bug #54182) * mkoctfile.in.cc (main): New variable, output_file_option. Fix check for using -o and -c with multiple source files.
author John W. Eaton <jwe@octave.org>
date Tue, 26 Jun 2018 14:12:25 -0400
parents 46836dd20f25
children 3edae6ba1fcd
files src/mkoctfile.in.cc
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/mkoctfile.in.cc	Tue Jun 26 09:22:25 2018 -0700
+++ b/src/mkoctfile.in.cc	Tue Jun 26 14:12:25 2018 -0400
@@ -578,6 +578,7 @@
   bool link_stand_alone = false;
   bool depend = false;
   bool printonly = false;
+  bool output_file_option = false;
 
   for (int i = 1; i < argc; i++)
     {
@@ -671,6 +672,8 @@
         }
       else if (arg == "-o" || arg == "-output" || arg == "--output")
         {
+          output_file_option = true;
+
           if (i < argc-1)
             {
               arg = argv[++i];
@@ -764,7 +767,7 @@
       defs += " -DMEX_DEBUG";
     }
 
-  if (compile_only
+  if (compile_only && output_file_option
       && (cfiles.size () + ccfiles.size () + f77files.size ()) > 1)
     {
       std::cerr << "mkoctfile: may not use -c and -o with multiple source files"