changeset 28965:d24e34e179ab

mkoctfile: don't add DL_LDFLAGS to LDFLAGS if linking stand alone program * mkoctfile.in.cc (make_vars_map): New arg, LINK_STAND_ALONE. If true, don't add DL_LDFLAGS to default_LDFLAGS variable. Change caller.
author John W. Eaton <jwe@octave.org>
date Tue, 20 Oct 2020 01:35:35 -0400
parents 091aeae73b60
children b02d9109fb6e
files src/mkoctfile.in.cc
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/mkoctfile.in.cc	Tue Oct 20 01:20:38 2020 -0400
+++ b/src/mkoctfile.in.cc	Tue Oct 20 01:35:35 2020 -0400
@@ -169,7 +169,7 @@
 }
 
 static std::map<std::string, std::string>
-make_vars_map (bool verbose, bool debug)
+make_vars_map (bool link_stand_alone, bool verbose, bool debug)
 {
   set_octave_home ();
 
@@ -302,7 +302,8 @@
   vars["DL_LDFLAGS"] = get_variable ("DL_LDFLAGS",
                                      %OCTAVE_CONF_MKOCTFILE_DL_LDFLAGS%);
 
-  DEFAULT_LDFLAGS += ' ' + vars["DL_LDFLAGS"];
+  if (! link_stand_alone)
+    DEFAULT_LDFLAGS += ' ' + vars["DL_LDFLAGS"];
 
   vars["RDYNAMIC_FLAG"] = get_variable ("RDYNAMIC_FLAG",
                                         %OCTAVE_CONF_RDYNAMIC_FLAG%);
@@ -940,7 +941,8 @@
         octfile = file;
     }
 
-  std::map<std::string, std::string> vars = make_vars_map (verbose, debug);
+  std::map<std::string, std::string> vars
+    = make_vars_map (link_stand_alone, verbose, debug);
 
   if (! var_to_print.empty ())
     {