# HG changeset patch # User Mike Miller # Date 1521399360 25200 # Node ID a73dedb0d9b59e2da411037fb4d23a9c074d6996 # Parent e4839b041cc4a93415d27da7da8108a88f4049bd# Parent 00d42b86d0a5950ad91829d73d27922beab9de7b maint: merge stable to default diff -r e4839b041cc4 -r a73dedb0d9b5 Makefile.am --- a/Makefile.am Thu Mar 15 15:38:35 2018 -0700 +++ b/Makefile.am Sun Mar 18 11:56:00 2018 -0700 @@ -99,6 +99,7 @@ octdata_DATA = octdoc_DATA = octetc_DATA = +octfonts_DATA = octlocale_DATA = DOC_TARGETS = diff -r e4839b041cc4 -r a73dedb0d9b5 build-aux/subst-default-vals.in.sh --- a/build-aux/subst-default-vals.in.sh Thu Mar 15 15:38:35 2018 -0700 +++ b/build-aux/subst-default-vals.in.sh Sun Mar 18 11:56:00 2018 -0700 @@ -63,6 +63,7 @@ octdatadir=`echo "@octdatadir@" | sed "s|^${prefix}/||"` octdocdir=`echo "@octdocdir@" | sed "s|^${prefix}/||"` octetcdir=`echo "@octetcdir@" | sed "s|^${prefix}/||"` +octfontsdir=`echo "@octfontsdir@" | sed "s|^${prefix}/||"` octincludedir=`echo "@octincludedir@" | sed "s|^${prefix}/||"` octlocaledir=`echo "@octlocaledir@" | sed "s|^${prefix}/||"` octtestsdir=`echo "@octtestsdir@" | sed "s|^${prefix}/||"` @@ -103,8 +104,9 @@ -e "s|%OCTAVE_MANDIR%|\"${mandir}\"|" \ -e "s|%OCTAVE_OCTDATADIR%|\"${octdatadir}\"|" \ -e "s|%OCTAVE_OCTDOCDIR%|\"${octdocdir}\"|" \ + -e "s|%OCTAVE_OCTETCDIR%|\"${octetcdir}\"|" \ -e "s|%OCTAVE_OCTFILEDIR%|\"${octfiledir}\"|" \ - -e "s|%OCTAVE_OCTETCDIR%|\"${octetcdir}\"|" \ + -e "s|%OCTAVE_OCTFONTSDIR%|\"${octfontsdir}\"|" \ -e "s|%OCTAVE_OCTINCLUDEDIR%|\"${octincludedir}\"|" \ -e "s|%OCTAVE_OCTLIBDIR%|\"${octlibdir}\"|" \ -e "s|%OCTAVE_OCTLOCALEDIR%|\"${octlocaledir}\"|" \ diff -r e4839b041cc4 -r a73dedb0d9b5 configure.ac --- a/configure.ac Thu Mar 15 15:38:35 2018 -0700 +++ b/configure.ac Sun Mar 18 11:56:00 2018 -0700 @@ -170,6 +170,9 @@ ## Where Octave will search for Qt help files shipped with distribution. OCTAVE_SET_DEFAULT([octdocdir], '${datadir}/octave/${version}/doc') +## Where Octave will search for fallback font files shipped with distribution. +OCTAVE_SET_DEFAULT([octfontsdir], '${datadir}/octave/${version}/fonts') + ## Where Octave will look for startup files. OCTAVE_SET_DEFAULT([startupfiledir], '${fcnfiledir}/startup') OCTAVE_SET_DEFAULT([localstartupfiledir], '${localfcnfiledir}/startup') @@ -273,6 +276,34 @@ AC_DEFINE_UNQUOTED([SHELL_PATH], ["$SHELL_PATH"], [Define this to be the path to the shell command interpreter.]) +### Use the system-wide installation of GNU FreeFont if the user requests it. +### By default, Octave includes its own copy of the FreeSans font, which it +### installs in its own directory for use as a fallback default font. If this +### configuration option is used, then do not install our own copy of the fonts +### and assume they can be found in the provided system directory. +SYSTEM_FREEFONT_DIR= +AC_ARG_WITH([system-freefont], + [AS_HELP_STRING([--with-system-freefont=DIR], + [use FreeSans fonts in DIR (default: install and use internal copy)])]) +case $with_system_freefont in + no | "") + SYSTEM_FREEFONT_DIR= + ;; + yes) + AC_MSG_ERROR([directory argument required for --with-system-freefont]) + ;; + *) + SYSTEM_FREEFONT_DIR=$with_system_freefont + ;; +esac +if test -n "$SYSTEM_FREEFONT_DIR"; then + AC_MSG_NOTICE([configuring Octave to use system fonts in $SYSTEM_FREEFONT_DIR]) + AC_DEFINE_UNQUOTED([SYSTEM_FREEFONT_DIR], ["$SYSTEM_FREEFONT_DIR"], + [Define this to be the system directory containing the GNU FreeFont fonts.]) +fi +AM_CONDITIONAL([AMCOND_INSTALL_INTERNAL_FONT_FILES], + [test -z "$SYSTEM_FREEFONT_DIR"]) + ### Determine which C++ compiler to use (we expect to find g++). AC_PROG_CXX @@ -3197,6 +3228,7 @@ eval imagedir="\"$imagedir\"" eval octdatadir="\"$octdatadir\"" eval octdocdir="\"$octdocdir\"" + eval octfontsdir="\"$octfontsdir\"" eval startupfiledir="\"$startupfiledir\"" eval localstartupfiledir="\"$localstartupfiledir\"" eval man1dir="\"$man1dir\"" diff -r e4839b041cc4 -r a73dedb0d9b5 etc/module.mk --- a/etc/module.mk Thu Mar 15 15:38:35 2018 -0700 +++ b/etc/module.mk Sun Mar 18 11:56:00 2018 -0700 @@ -21,16 +21,19 @@ %reldir%/OLD-ChangeLogs/src-ChangeLog \ %reldir%/OLD-ChangeLogs/test-ChangeLog -etc_fontsdir = $(octetcdir)/fonts - -etc_fonts_DATA = \ +fallback_FONT_FILES = \ %reldir%/fonts/FreeSans.otf \ %reldir%/fonts/FreeSansBold.otf \ %reldir%/fonts/FreeSansBoldOblique.otf \ %reldir%/fonts/FreeSansOblique.otf +if AMCOND_INSTALL_INTERNAL_FONT_FILES +octfonts_DATA += \ + $(fallback_FONT_FILES) +endif + %canon_reldir%_EXTRA_DIST += \ - $(etc_fonts_DATA) + $(fallback_FONT_FILES) appdatadir = $(datadir)/metainfo diff -r e4839b041cc4 -r a73dedb0d9b5 libinterp/corefcn/default-defs.in.h --- a/libinterp/corefcn/default-defs.in.h Thu Mar 15 15:38:35 2018 -0700 +++ b/libinterp/corefcn/default-defs.in.h Sun Mar 18 11:56:00 2018 -0700 @@ -128,6 +128,10 @@ # define OCTAVE_OCTETCDIR %OCTAVE_OCTETCDIR% #endif +#if ! defined (OCTAVE_OCTFONTSDIR) +# define OCTAVE_OCTFONTSDIR %OCTAVE_OCTFONTSDIR% +#endif + #if ! defined (OCTAVE_OCTINCLUDEDIR) # define OCTAVE_OCTINCLUDEDIR %OCTAVE_OCTINCLUDEDIR% #endif diff -r e4839b041cc4 -r a73dedb0d9b5 libinterp/corefcn/defaults.cc --- a/libinterp/corefcn/defaults.cc Thu Mar 15 15:38:35 2018 -0700 +++ b/libinterp/corefcn/defaults.cc Sun Mar 18 11:56:00 2018 -0700 @@ -75,6 +75,7 @@ static std::string Voct_data_dir; static std::string Voct_doc_dir; static std::string Voct_etc_dir; +static std::string Voct_fonts_dir; static std::string Voct_include_dir; static std::string Voct_lib_dir; static std::string Voct_locale_dir; @@ -213,6 +214,7 @@ Voct_data_dir = octave::config::prepend_octave_home (OCTAVE_OCTDATADIR); Voct_doc_dir = octave::config::prepend_octave_home (OCTAVE_OCTDOCDIR); Voct_etc_dir = octave::config::prepend_octave_home (OCTAVE_OCTETCDIR); + Voct_fonts_dir = octave::config::prepend_octave_home (OCTAVE_OCTFONTSDIR); Voct_include_dir = octave::config::prepend_octave_home (OCTAVE_OCTINCLUDEDIR); Voct_lib_dir = octave::config::prepend_octave_exec_home (OCTAVE_OCTLIBDIR); Voct_locale_dir = octave::config::prepend_octave_home (OCTAVE_OCTLOCALEDIR); @@ -294,6 +296,7 @@ std::string oct_data_dir (void) { RETURN (Voct_data_dir); } std::string oct_doc_dir (void) { RETURN (Voct_doc_dir); } std::string oct_etc_dir (void) { RETURN (Voct_etc_dir); } + std::string oct_fonts_dir (void) { RETURN (Voct_fonts_dir); } std::string oct_include_dir (void) { RETURN (Voct_include_dir); } std::string oct_lib_dir (void) { RETURN (Voct_lib_dir); } std::string oct_locale_dir (void) { RETURN (Voct_locale_dir); } diff -r e4839b041cc4 -r a73dedb0d9b5 libinterp/corefcn/defaults.h --- a/libinterp/corefcn/defaults.h Thu Mar 15 15:38:35 2018 -0700 +++ b/libinterp/corefcn/defaults.h Sun Mar 18 11:56:00 2018 -0700 @@ -79,6 +79,7 @@ extern OCTINTERP_API std::string oct_data_dir (void); extern OCTINTERP_API std::string oct_doc_dir (void); extern OCTINTERP_API std::string oct_etc_dir (void); + extern OCTINTERP_API std::string oct_fonts_dir (void); extern OCTINTERP_API std::string oct_include_dir (void); extern OCTINTERP_API std::string oct_lib_dir (void); extern OCTINTERP_API std::string oct_locale_dir (void); diff -r e4839b041cc4 -r a73dedb0d9b5 libinterp/corefcn/ft-text-renderer.cc --- a/libinterp/corefcn/ft-text-renderer.cc Thu Mar 15 15:38:35 2018 -0700 +++ b/libinterp/corefcn/ft-text-renderer.cc Sun Mar 18 11:56:00 2018 -0700 @@ -206,24 +206,27 @@ } #endif - static std::string font_dir; + static std::string fonts_dir; - if (font_dir.empty ()) + if (fonts_dir.empty ()) { - font_dir = sys::env::getenv ("OCTAVE_FONT_DIR"); + fonts_dir = sys::env::getenv ("OCTAVE_FONTS_DIR"); - if (font_dir.empty ()) - font_dir = config::oct_etc_dir () + sys::file_ops::dir_sep_str () - + "fonts"; + if (fonts_dir.empty ()) +#if defined (SYSTEM_FREEFONT_DIR) + fonts_dir = SYSTEM_FREEFONT_DIR; +#else + fonts_dir = config::oct_fonts_dir (); +#endif } // Default font file std::string file; - if (! font_dir.empty ()) + if (! fonts_dir.empty ()) { - file = font_dir + octave::sys::file_ops::dir_sep_str () + "FreeSans"; + file = fonts_dir + octave::sys::file_ops::dir_sep_str () + "FreeSans"; if (weight == "bold") file += "Bold"; diff -r e4839b041cc4 -r a73dedb0d9b5 libinterp/corefcn/toplev.cc --- a/libinterp/corefcn/toplev.cc Thu Mar 15 15:38:35 2018 -0700 +++ b/libinterp/corefcn/toplev.cc Sun Mar 18 11:56:00 2018 -0700 @@ -412,8 +412,9 @@ { "mandir", octave::config::man_dir () }, { "octdatadir", octave::config::oct_data_dir () }, { "octdocdir", octave::config::oct_doc_dir () }, + { "octetcdir", octave::config::oct_etc_dir () }, { "octfiledir", octave::config::oct_file_dir () }, - { "octetcdir", octave::config::oct_etc_dir () }, + { "octfontsdir", octave::config::oct_fonts_dir () }, { "octincludedir", octave::config::oct_include_dir () }, { "octlibdir", octave::config::oct_lib_dir () }, { "octtestsdir", octave::config::oct_tests_dir () }, diff -r e4839b041cc4 -r a73dedb0d9b5 run-octave.in --- a/run-octave.in Thu Mar 15 15:38:35 2018 -0700 +++ b/run-octave.in Sun Mar 18 11:56:00 2018 -0700 @@ -104,7 +104,7 @@ OCTAVE_ARCHLIBDIR="$builddir/src"; export OCTAVE_ARCHLIBDIR OCTAVE_BINDIR="$builddir/src"; export OCTAVE_BINDIR OCTAVE_DEFAULT_QT_SETTINGS="$builddir/libgui/default-qt-settings"; export OCTAVE_DEFAULT_QT_SETTINGS -OCTAVE_FONT_DIR="$top_srcdir/etc/fonts"; export OCTAVE_FONT_DIR +OCTAVE_FONTS_DIR="$top_srcdir/etc/fonts"; export OCTAVE_FONTS_DIR OCTAVE_JAVA_DIR="$builddir/scripts/java"; export OCTAVE_JAVA_DIR OCTAVE_LOCALE_DIR="$builddir/libgui/languages"; export OCTAVE_LOCALE_DIR OCTAVE_QTHELP_COLLECTION="$builddir/doc/interpreter/octave_interpreter.qhc"; export OCTAVE_QTHELP_COLLECTION diff -r e4839b041cc4 -r a73dedb0d9b5 src/main.in.cc --- a/src/main.in.cc Thu Mar 15 15:38:35 2018 -0700 +++ b/src/main.in.cc Sun Mar 18 11:56:00 2018 -0700 @@ -203,7 +203,7 @@ { int retval = 0; - bool start_gui = true; + bool start_gui = false; bool gui_libs = true; set_octave_home (); @@ -258,6 +258,15 @@ start_gui = false; new_argv[k++] = argv[i]; } + else if (! strcmp (argv[i], "--gui")) + { + // If we see this option, then we fork and exec octave with + // the --gui option, while continuing to handle signals in the + // terminal. + + start_gui = true; + new_argv[k++] = argv[i]; + } else if (! strcmp (argv[i], "--silent") || ! strcmp (argv[i], "--quiet")) { warn_display = false; diff -r e4839b041cc4 -r a73dedb0d9b5 src/octave-config.in.cc --- a/src/octave-config.in.cc Thu Mar 15 15:38:35 2018 -0700 +++ b/src/octave-config.in.cc Sun Mar 18 11:56:00 2018 -0700 @@ -64,25 +64,26 @@ " -p VAR, --print VAR Print the value of the given configuration\n" " variable VAR. Recognized variables are:\n" "\n" -" API_VERSION LOCALARCHLIBDIR\n" -" ARCHLIBDIR LOCALFCNFILEDIR\n" -" BINDIR LOCALOCTFILEDIR\n" -" CANONICAL_HOST_TYPE LOCALSTARTUPFILEDIR\n" -" DATADIR LOCALVERARCHLIBDIR\n" -" DATAROOTDIR LOCALVERFCNFILEDIR\n" -" DEFAULT_PAGER LOCALVEROCTFILEDIR\n" -" EXEC_PREFIX MAN1DIR\n" -" EXEEXT MAN1EXT\n" -" FCNFILEDIR MANDIR\n" -" IMAGEDIR OCTAVE_EXEC_HOME\n" -" INCLUDEDIR OCTAVE_HOME\n" -" INFODIR OCTDATADIR\n" -" INFOFILE OCTDOCDIR\n" -" LIBDIR OCTFILEDIR\n" +" API_VERSION LOCALFCNFILEDIR\n" +" ARCHLIBDIR LOCALOCTFILEDIR\n" +" BINDIR LOCALSTARTUPFILEDIR\n" +" CANONICAL_HOST_TYPE LOCALVERARCHLIBDIR\n" +" DATADIR LOCALVERFCNFILEDIR\n" +" DATAROOTDIR LOCALVEROCTFILEDIR\n" +" DEFAULT_PAGER MAN1DIR\n" +" EXEC_PREFIX MAN1EXT\n" +" EXEEXT MANDIR\n" +" FCNFILEDIR OCTAVE_EXEC_HOME\n" +" IMAGEDIR OCTAVE_HOME\n" +" INCLUDEDIR OCTDATADIR\n" +" INFODIR OCTDOCDIR\n" +" INFOFILE OCTFILEDIR\n" +" LIBDIR OCTFONTSDIR\n" " LIBEXECDIR OCTINCLUDEDIR\n" " LOCALAPIARCHLIBDIR OCTLIBDIR\n" " LOCALAPIFCNFILEDIR STARTUPFILEDIR\n" " LOCALAPIOCTFILEDIR VERSION\n" +" LOCALARCHLIBDIR\n" "\n" " -v, --version Print the Octave version number.\n" "\n"; @@ -128,6 +129,7 @@ vars["OCTDATADIR"] = prepend_octave_home (%OCTAVE_OCTDATADIR%); vars["OCTDOCDIR"] = prepend_octave_home (%OCTAVE_OCTDOCDIR%); vars["OCTFILEDIR"] = prepend_octave_exec_home (%OCTAVE_OCTFILEDIR%); + vars["OCTFONTSDIR"] = prepend_octave_home (%OCTAVE_OCTFONTSDIR%); vars["OCTINCLUDEDIR"] = prepend_octave_home (%OCTAVE_OCTINCLUDEDIR%); vars["OCTLIBDIR"] = prepend_octave_exec_home (%OCTAVE_OCTLIBDIR%); vars["STARTUPFILEDIR"] = prepend_octave_home (%OCTAVE_STARTUPFILEDIR%);