changeset 15263:ad1a980b0cb5

install default values before initializing interpreter (bug #37161) * octave.cc (octave_initialize_interpreter): Don't call install_defaults here. (octave_main): Call install_defaults here. * main.cc (main): Likewise. * main-cli.cc (main): Likewise. * src/Makefile.am (AM_CPPFLAGS): Include -I$(srcdir)/../libcruft/misc, -I$(srcdir)/../liboctave, and -I$(top_builddir)/libinterp/interpfcn in the list.
author John W. Eaton <jwe@octave.org>
date Thu, 30 Aug 2012 12:05:04 -0400
parents 6be46886099f
children 2136343014d5
files libinterp/octave.cc src/Makefile.am src/main-cli.cc src/main.cc
diffstat 4 files changed, 18 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/octave.cc
+++ b/libinterp/octave.cc
@@ -46,7 +46,7 @@
 #include "pathsearch.h"
 #include "str-vec.h"
 
-#include <defaults.h>
+#include "defaults.h"
 #include "Cell.h"
 #include "defun.h"
 #include "display.h"
@@ -687,6 +687,8 @@
 {
   octave_process_command_line (argc, argv);
 
+  install_defaults ();
+
   octave_initialize_interpreter (argc, argv, embedded);
 
   return octave_execute_interpreter ();
@@ -873,11 +875,9 @@
   octave_thread::init ();
 
   // The order of these calls is important.  The call to
-  // install_defaults must come before install_builtins because
-  // default variable values must be available for the variables to be
-  // installed, and the call to install_builtins must come before the
-  // options are processed because some command line options override
-  // defaults by calling bind_internal_variable.
+  // install_builtins must come before the option settings are processed
+  // because some command line options override defaults by calling
+  // bind_internal_variable.
 
   init_signals ();
 
@@ -897,8 +897,6 @@
 
   initialize_default_warning_state ();
 
-  install_defaults ();
-
   initialize_pathsearch ();
 
   if (! embedded)
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -22,7 +22,10 @@
 
 ## Search local directories before those specified by the user.
 AM_CPPFLAGS = \
+  -I$(srcdir)/../libcruft/misc \
+  -I$(srcdir)/../liboctave \
   -I$(srcdir)/../libinterp \
+  -I$(top_builddir)/libinterp/interpfcn \
   -I$(top_builddir)/libgnu -I$(top_srcdir)/libgnu
 
 OCTAVE_BINARIES = \
--- a/src/main-cli.cc
+++ b/src/main-cli.cc
@@ -24,13 +24,16 @@
 #include <config.h>
 #endif
 
-#include <octave.h>
+#include "defaults.h"
+#include "octave.h"
 
 int
 main (int argc, char **argv)
 {
   octave_process_command_line (argc, argv);
 
+  install_defaults ();
+
   octave_initialize_interpreter (argc, argv, 0);
 
   return octave_execute_interpreter ();
--- a/src/main.cc
+++ b/src/main.cc
@@ -24,8 +24,9 @@
 #include <config.h>
 #endif
 
-#include <octave.h>
-#include <octave-gui.h>
+#include "defaults.h"
+#include "octave.h"
+#include "octave-gui.h"
 
 int
 main (int argc, char **argv)
@@ -34,6 +35,8 @@
 
   octave_process_command_line (argc, argv);
 
+  install_defaults ();
+
   if (octave_starting_gui ())
     retval = octave_start_gui (argc, argv);
   else