changeset 25397:2cf750f5cb7d

make version info accessible in liboctave * mk-version-h.in.sh: Move from libinterp to liboctave. * configure.ac, libinterp/module.mk, liboctave/module.mk, libgui/graphics/module.mk, libgui/src/module.mk: Update. * version.in.h (OCTAVE_CANONICAL_HOST_TYPE): Define here instead of in default-defs.in.h. * liboctave/mk-version-h.in.sh: Move here from libinterp. Also substitute OCTAVE_CANONICAL_HOST_TYPE. * liboctave/version.cc: Move here from libinterp. Don't include defaults.h. Use OCTAVE_CANONICAL_HOST_TYPE macro instead of octave::config::canonical_host_type function.
author John W. Eaton <jwe@octave.org>
date Sat, 19 May 2018 13:54:04 -0400
parents 75fef3484d12
children a78e5b8d5ee7
files configure.ac libgui/graphics/module.mk libgui/src/module.mk libinterp/corefcn/default-defs.in.h libinterp/mk-version-h.in.sh libinterp/module.mk libinterp/version.cc libinterp/version.in.h liboctave/mk-version-h.in.sh liboctave/module.mk liboctave/version.cc liboctave/version.in.h
diffstat 12 files changed, 275 insertions(+), 271 deletions(-) [+]
line wrap: on
line diff
--- a/configure.ac	Fri Mar 16 02:29:30 2018 -0500
+++ b/configure.ac	Sat May 19 13:54:04 2018 -0400
@@ -3287,8 +3287,8 @@
 OCTAVE_CONFIG_MOVE_IF_CHANGE_FILES([
   libgui/mk-default-qt-settings.sh
   liboctave/external/mk-f77-def.sh
+  liboctave/mk-version-h.sh
   libinterp/corefcn/mk-mxarray-h.sh
-  libinterp/mk-version-h.sh
   build-aux/subst-config-vals.sh
   build-aux/subst-cross-config-vals.sh
   build-aux/subst-default-vals.sh
--- a/libgui/graphics/module.mk	Fri Mar 16 02:29:30 2018 -0500
+++ b/libgui/graphics/module.mk	Sat May 19 13:54:04 2018 -0400
@@ -135,6 +135,7 @@
   @QT_CPPFLAGS@ \
   -Ilibgui/graphics -I$(srcdir)/libgui/graphics \
   -Isrc -I$(srcdir)/libgui/src \
+  -Iliboctave \
   -I$(srcdir)/liboctave/array \
   -Iliboctave/numeric -I$(srcdir)/liboctave/numeric \
   -Iliboctave/operators -I$(srcdir)/liboctave/operators \
--- a/libgui/src/module.mk	Fri Mar 16 02:29:30 2018 -0500
+++ b/libgui/src/module.mk	Sat May 19 13:54:04 2018 -0400
@@ -235,6 +235,7 @@
   -I$(srcdir)/%reldir%/m-editor \
   -I$(srcdir)/%reldir%/qtinfo \
   -I$(srcdir)/libgui/graphics \
+  -Iliboctave \
   -I$(srcdir)/liboctave/array \
   -Iliboctave/numeric -I$(srcdir)/liboctave/numeric \
   -Iliboctave/operators -I$(srcdir)/liboctave/operators \
--- a/libinterp/corefcn/default-defs.in.h	Fri Mar 16 02:29:30 2018 -0500
+++ b/libinterp/corefcn/default-defs.in.h	Sat May 19 13:54:04 2018 -0400
@@ -24,10 +24,6 @@
 // These are used by functions declared in defaults.h and defined in
 // defaults.cc.
 
-#if ! defined (OCTAVE_CANONICAL_HOST_TYPE)
-#  define OCTAVE_CANONICAL_HOST_TYPE %OCTAVE_CANONICAL_HOST_TYPE%
-#endif
-
 #if ! defined (OCTAVE_RELEASE)
 #  define OCTAVE_RELEASE %OCTAVE_RELEASE%
 #endif
--- a/libinterp/mk-version-h.in.sh	Fri Mar 16 02:29:30 2018 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-#! /bin/sh
-#
-# Copyright (C) 2016-2018 John W. Eaton
-#
-# This file is part of Octave.
-#
-# Octave is free software: you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# Octave is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with Octave; see the file COPYING.  If not, see
-# <https://www.gnu.org/licenses/>.
-
-: ${SED=@SED@}
-
-OCTAVE_API_VERSION="@OCTAVE_API_VERSION@"
-OCTAVE_COPYRIGHT="@OCTAVE_COPYRIGHT@"
-OCTAVE_MAJOR_VERSION="@OCTAVE_MAJOR_VERSION@"
-OCTAVE_MINOR_VERSION="@OCTAVE_MINOR_VERSION@"
-OCTAVE_PATCH_VERSION="@OCTAVE_PATCH_VERSION@"
-OCTAVE_RELEASE_DATE="@OCTAVE_RELEASE_DATE@"
-OCTAVE_VERSION="@OCTAVE_VERSION@"
-
-$SED \
-  -e "s|%NO_EDIT_WARNING%|DO NOT EDIT!  Generated automatically by mk-version-h.|" \
-  -e "s|%OCTAVE_API_VERSION%|\"${OCTAVE_API_VERSION}\"|" \
-  -e "s|%OCTAVE_COPYRIGHT%|\"${OCTAVE_COPYRIGHT}\"|" \
-  -e "s|%OCTAVE_MAJOR_VERSION%|${OCTAVE_MAJOR_VERSION}|" \
-  -e "s|%OCTAVE_MINOR_VERSION%|${OCTAVE_MINOR_VERSION}|" \
-  -e "s|%OCTAVE_PATCH_VERSION%|${OCTAVE_PATCH_VERSION}|" \
-  -e "s|%OCTAVE_RELEASE_DATE%|\"${OCTAVE_RELEASE_DATE}\"|" \
-  -e "s|%OCTAVE_VERSION%|\"${OCTAVE_VERSION}\"|"
--- a/libinterp/module.mk	Fri Mar 16 02:29:30 2018 -0500
+++ b/libinterp/module.mk	Sat May 19 13:54:04 2018 -0400
@@ -39,8 +39,7 @@
   %reldir%/corefcn/oct-tex-parser.h \
   %reldir%/corefcn/oct-tex-symbols.cc \
   %reldir%/parse-tree/oct-gperf.h \
-  %reldir%/parse-tree/oct-parse.h \
-  %reldir%/version.h
+  %reldir%/parse-tree/oct-parse.h
 
 ULT_PARSER_SRC := \
   %reldir%/corefcn/oct-tex-lexer.in.ll \
@@ -77,8 +76,7 @@
   %reldir%/corefcn/mxarray.h \
   %reldir%/corefcn/oct-errno.cc \
   %reldir%/liboctinterp-build-info.cc \
-  %reldir%/operators/ops.cc \
-  %reldir%/version.h
+  %reldir%/operators/ops.cc
 
 %canon_reldir%_EXTRA_DIST += \
   %reldir%/DOCSTRINGS \
@@ -88,14 +86,9 @@
   %reldir%/mk-builtins.pl \
   %reldir%/mk-doc.pl \
   %reldir%/mk-pkg-add.sh \
-  %reldir%/mk-version-h.in.sh \
   %reldir%/op-kw-docs \
-  %reldir%/version.in.h \
   $(LIBINTERP_BUILT_DISTFILES)
 
-GEN_CONFIG_SHELL += \
-  %reldir%/mk-version-h.sh
-
 octinclude_HEADERS += \
   %reldir%/build-env.h \
   %reldir%/liboctinterp-build-info.h \
@@ -114,12 +107,10 @@
   %reldir%/builtin-defun-decls.h \
   %reldir%/corefcn/graphics-props.cc \
   %reldir%/corefcn/graphics.h \
-  %reldir%/corefcn/mxarray.h \
-  %reldir%/version.h
+  %reldir%/corefcn/mxarray.h
 
 DIST_SRC += \
   %reldir%/octave.cc \
-  %reldir%/version.cc \
   $(OCTAVE_VALUE_SRC) \
   $(PARSE_TREE_SRC) \
   $(COREFCN_SRC)
@@ -143,7 +134,6 @@
 
 %canon_reldir%_liboctinterp_la_SOURCES = \
   %reldir%/octave.cc \
-  %reldir%/version.cc \
   $(LIBINTERP_OPERATORS_SRC) \
   $(TEMPLATE_INST_SRC)
 
@@ -157,8 +147,7 @@
   %reldir%/corefcn/mxarray.h \
   %reldir%/corefcn/oct-errno.cc \
   %reldir%/liboctinterp-build-info.cc \
-  %reldir%/operators/ops.cc \
-  %reldir%/version.h
+  %reldir%/operators/ops.cc
 
 %canon_reldir%_liboctinterp_la_LIBADD = \
   %reldir%/octave-value/liboctave-value.la \
@@ -240,9 +229,6 @@
 	$(SHELL) $(srcdir)/%reldir%/mk-build-env-features.sh $< > $@-t && \
 	mv $@-t $@
 
-%reldir%/version.h: %reldir%/version.in.h %reldir%/mk-version-h.sh | %reldir%/$(octave_dirstamp)
-	$(AM_V_GEN)$(call simple-filter-rule,%reldir%/mk-version-h.sh)
-
 %reldir%/liboctinterp-build-info.cc: %reldir%/liboctinterp-build-info.in.cc HG-ID | %reldir%/$(octave_dirstamp)
 	$(AM_V_GEN)$(build-info-commands)
 
--- a/libinterp/version.cc	Fri Mar 16 02:29:30 2018 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,133 +0,0 @@
-/*
-
-Copyright (C) 2013-2018 John W. Eaton
-
-This file is part of Octave.
-
-Octave is free software: you can redistribute it and/or modify it
-under the terms of the GNU General Public License as published by
-the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
-
-Octave is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with Octave; see the file COPYING.  If not, see
-<https://www.gnu.org/licenses/>.
-
-*/
-
-#if defined (HAVE_CONFIG_H)
-#  include "config.h"
-#endif
-
-#include <string>
-
-#include "defaults.h"
-#include "version.h"
-
-static std::string
-octave_warranty_statement (const std::string& extra_info = "")
-{
-  return "There is ABSOLUTELY NO WARRANTY; not even for MERCHANTABILITY or\n\
-FITNESS FOR A PARTICULAR PURPOSE."
-         + extra_info;
-}
-
-static std::string
-format_url (bool html, const std::string& url)
-{
-  return html ? R"(<a href=")" + url + R"(">)" + url + "</a>" : url;
-}
-
-std::string
-octave_www_statement (bool html)
-{
-  return "Additional information about Octave is available at "
-         + format_url (html, "https://www.octave.org.");
-}
-
-std::string
-octave_contrib_statement (bool html)
-{
-  return "Please contribute if you find this software useful.\n\
-For more information, visit "
-         + format_url (html, "https://www.octave.org/get-involved.html");
-}
-
-std::string
-octave_bugs_statement (bool html)
-{
-  return "Read " + format_url (html, "https://www.octave.org/bugs.html")
-         + " to learn how to submit bug reports.";
-}
-
-std::string
-octave_name_version_and_copyright (void)
-{
-  // The GNU coding standards say that on the first line printed by
-  // --version, the version number should follow the last space on the
-  // line.
-
-  return "GNU Octave, version " OCTAVE_VERSION "\n" OCTAVE_COPYRIGHT;
-}
-
-std::string
-octave_name_version_copyright_copying_and_warranty
-  (bool html, const std::string& extra_info)
-{
-  std::string br = (html ? "<br>\n" : "\n");
-  std::string sep = (html ? "\n</p>\n<p>\n" : "\n\n");
-
-  return octave_name_version_and_copyright ()
-         + br
-         + "This is free software; see the source code for copying conditions."
-         + br
-         + octave_warranty_statement (extra_info)
-         + sep
-         + R"(Octave was configured for ")"
-         + octave::config::canonical_host_type ()
-         + R"(".)";
-}
-
-std::string
-octave_name_version_copyright_copying_warranty_and_bugs
-  (bool html, const std::string& extra_info)
-{
-  std::string sep = (html ? "\n</p>\n<p>\n" : "\n\n");
-
-  std::string msg;
-
-  if (html)
-    msg = "<p>\n";
-
-  msg += octave_name_version_copyright_copying_and_warranty (html, extra_info)
-         + sep
-         + octave_www_statement (html)
-         + sep
-         + octave_contrib_statement (html)
-         + sep
-         + octave_bugs_statement (html)
-         + (html ? "\n</p>" : "");
-
-  return msg;
-}
-
-std::string
-octave_startup_message (bool html)
-{
-  std::string msg
-    = octave_name_version_copyright_copying_warranty_and_bugs
-        (html, "  For details, type 'warranty'.");
-
-  msg += (html ? "<p>\n" : "\n");
-
-  msg += "For information about changes from previous versions, type 'news'.";
-
-  msg += (html ? "\n</p>" : "");
-
-  return msg;
-}
--- a/libinterp/version.in.h	Fri Mar 16 02:29:30 2018 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,71 +0,0 @@
-// %NO_EDIT_WARNING%
-/*
-
-Copyright (C) 1992-2018 John W. Eaton
-
-This file is part of Octave.
-
-Octave is free software: you can redistribute it and/or modify it
-under the terms of the GNU General Public License as published by
-the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
-
-Octave is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with Octave; see the file COPYING.  If not, see
-<https://www.gnu.org/licenses/>.
-
-*/
-
-#if ! defined (octave_version_h)
-#define octave_version_h 1
-
-#include "octave-config.h"
-
-#define OCTAVE_VERSION %OCTAVE_VERSION%
-
-#define OCTAVE_MAJOR_VERSION %OCTAVE_MAJOR_VERSION%
-
-#define OCTAVE_MINOR_VERSION %OCTAVE_MINOR_VERSION%
-
-#define OCTAVE_PATCH_VERSION %OCTAVE_PATCH_VERSION%
-
-// The "API version" is used as a way of checking that interfaces in the
-// liboctave and libinterp libraries haven't changed in a backwardly
-// incompatible way when loading .oct files.  A better way to do that is
-// with library versioning, but not all systems support that.
-// NOTE: This macro will be removed in a future version of Octave.  If
-// you insist on checking for features using a version number, use the
-// OCTAVE_MAJOR_VERSION, OCTAVE_MINOR_VERSION, and
-// OCTAVE_PATCH_VERSION macros instead.
-#define OCTAVE_API_VERSION %OCTAVE_API_VERSION%
-
-#define OCTAVE_RELEASE_DATE %OCTAVE_RELEASE_DATE%
-
-#define OCTAVE_COPYRIGHT %OCTAVE_COPYRIGHT%
-
-#include <string>
-
-extern OCTINTERP_API std::string octave_www_statement (bool html = false);
-
-extern OCTINTERP_API std::string octave_contrib_statement (bool html = false);
-
-extern OCTINTERP_API std::string octave_bugs_statement (bool html = false);
-
-extern OCTINTERP_API std::string octave_name_version_and_copyright (void);
-
-extern OCTINTERP_API std::string
-octave_name_version_copyright_copying_and_warranty
-  (bool html = false, const std::string& extra_info = "");
-
-extern OCTINTERP_API std::string
-octave_name_version_copyright_copying_warranty_and_bugs
-  (bool html = false, const std::string& extra_info = "");
-
-extern OCTINTERP_API std::string octave_startup_message (bool html = false);
-
-#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/liboctave/mk-version-h.in.sh	Sat May 19 13:54:04 2018 -0400
@@ -0,0 +1,41 @@
+#! /bin/sh
+#
+# Copyright (C) 2016-2018 John W. Eaton
+#
+# This file is part of Octave.
+#
+# Octave is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# Octave is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with Octave; see the file COPYING.  If not, see
+# <https://www.gnu.org/licenses/>.
+
+: ${SED=@SED@}
+
+OCTAVE_API_VERSION="@OCTAVE_API_VERSION@"
+OCTAVE_CANONICAL_HOST_TYPE="@canonical_host_type@"
+OCTAVE_COPYRIGHT="@OCTAVE_COPYRIGHT@"
+OCTAVE_MAJOR_VERSION="@OCTAVE_MAJOR_VERSION@"
+OCTAVE_MINOR_VERSION="@OCTAVE_MINOR_VERSION@"
+OCTAVE_PATCH_VERSION="@OCTAVE_PATCH_VERSION@"
+OCTAVE_RELEASE_DATE="@OCTAVE_RELEASE_DATE@"
+OCTAVE_VERSION="@OCTAVE_VERSION@"
+
+$SED \
+  -e "s|%NO_EDIT_WARNING%|DO NOT EDIT!  Generated automatically by mk-version-h.|" \
+  -e "s|%OCTAVE_API_VERSION%|\"${OCTAVE_API_VERSION}\"|" \
+  -e "s|%OCTAVE_CANONICAL_HOST_TYPE%|\"${OCTAVE_CANONICAL_HOST_TYPE}\"|" \
+  -e "s|%OCTAVE_COPYRIGHT%|\"${OCTAVE_COPYRIGHT}\"|" \
+  -e "s|%OCTAVE_MAJOR_VERSION%|${OCTAVE_MAJOR_VERSION}|" \
+  -e "s|%OCTAVE_MINOR_VERSION%|${OCTAVE_MINOR_VERSION}|" \
+  -e "s|%OCTAVE_PATCH_VERSION%|${OCTAVE_PATCH_VERSION}|" \
+  -e "s|%OCTAVE_RELEASE_DATE%|\"${OCTAVE_RELEASE_DATE}\"|" \
+  -e "s|%OCTAVE_VERSION%|\"${OCTAVE_VERSION}\"|"
--- a/liboctave/module.mk	Fri Mar 16 02:29:30 2018 -0500
+++ b/liboctave/module.mk	Sat May 19 13:54:04 2018 -0400
@@ -1,5 +1,10 @@
 %canon_reldir%_EXTRA_DIST = \
-  %reldir%/liboctave-build-info.in.cc
+  %reldir%/liboctave-build-info.in.cc \
+  %reldir%/mk-version-h.in.sh \
+  %reldir%/version.in.h
+
+GEN_CONFIG_SHELL += \
+  %reldir%/mk-version-h.sh
 
 %canon_reldir%_CLEANFILES =
 %canon_reldir%_DISTCLEANFILES =
@@ -31,10 +36,12 @@
 
 BUILT_SOURCES += \
   $(BUILT_INCS) \
-  $(BUILT_LIBOCTAVE_OPERATORS_SOURCES)
+  $(BUILT_LIBOCTAVE_OPERATORS_SOURCES) \
+  %reldir%/version.h
 
 LIBOCTAVE_BUILT_NODISTFILES = \
-  %reldir%/liboctave-build-info.cc
+  %reldir%/liboctave-build-info.cc \
+  %reldir%/version.h
 
 octinclude_HEADERS += \
   %reldir%/liboctave-build-info.h \
@@ -47,7 +54,12 @@
   $(OTHER_INC) \
   $(LIBOCTAVE_TEMPLATE_SRC)
 
-nodist_octinclude_HEADERS += $(BUILT_INCS)
+nodist_octinclude_HEADERS += \
+  $(BUILT_INCS) \
+  %reldir%/version.h
+
+DIST_SRC += \
+  %reldir%/version.cc
 
 ## C++ files that are #included, not compiled
 OTHER_INC =
@@ -68,7 +80,9 @@
 include %reldir%/wrappers/module.mk
 
 nodist_%canon_reldir%_%canon_reldir%_la_SOURCES = \
-  %reldir%/liboctave-build-info.cc
+  %reldir%/liboctave-build-info.cc \
+  %reldir%/version.cc \
+  %reldir%/version.h
 
 %canon_reldir%_%canon_reldir%_la_LIBADD += \
   libgnu/libgnu.la \
@@ -106,6 +120,9 @@
 
 nobase_liboctavetests_DATA = $(LIBOCTAVE_TST_FILES)
 
+%reldir%/version.h: %reldir%/version.in.h %reldir%/mk-version-h.sh | %reldir%/$(octave_dirstamp)
+	$(AM_V_GEN)$(call simple-filter-rule,%reldir%/mk-version-h.sh)
+
 %reldir%/liboctave-build-info.cc: %reldir%/liboctave-build-info.in.cc HG-ID | %reldir%/$(octave_dirstamp)
 	$(AM_V_GEN)$(build-info-commands)
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/liboctave/version.cc	Sat May 19 13:54:04 2018 -0400
@@ -0,0 +1,132 @@
+/*
+
+Copyright (C) 2013-2018 John W. Eaton
+
+This file is part of Octave.
+
+Octave is free software: you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+Octave is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with Octave; see the file COPYING.  If not, see
+<https://www.gnu.org/licenses/>.
+
+*/
+
+#if defined (HAVE_CONFIG_H)
+#  include "config.h"
+#endif
+
+#include <string>
+
+#include "version.h"
+
+static std::string
+octave_warranty_statement (const std::string& extra_info = "")
+{
+  return "There is ABSOLUTELY NO WARRANTY; not even for MERCHANTABILITY or\n\
+FITNESS FOR A PARTICULAR PURPOSE."
+         + extra_info;
+}
+
+static std::string
+format_url (bool html, const std::string& url)
+{
+  return html ? R"(<a href=")" + url + R"(">)" + url + "</a>" : url;
+}
+
+std::string
+octave_www_statement (bool html)
+{
+  return "Additional information about Octave is available at "
+         + format_url (html, "https://www.octave.org.");
+}
+
+std::string
+octave_contrib_statement (bool html)
+{
+  return "Please contribute if you find this software useful.\n\
+For more information, visit "
+         + format_url (html, "https://www.octave.org/get-involved.html");
+}
+
+std::string
+octave_bugs_statement (bool html)
+{
+  return "Read " + format_url (html, "https://www.octave.org/bugs.html")
+         + " to learn how to submit bug reports.";
+}
+
+std::string
+octave_name_version_and_copyright (void)
+{
+  // The GNU coding standards say that on the first line printed by
+  // --version, the version number should follow the last space on the
+  // line.
+
+  return "GNU Octave, version " OCTAVE_VERSION "\n" OCTAVE_COPYRIGHT;
+}
+
+std::string
+octave_name_version_copyright_copying_and_warranty
+  (bool html, const std::string& extra_info)
+{
+  std::string br = (html ? "<br>\n" : "\n");
+  std::string sep = (html ? "\n</p>\n<p>\n" : "\n\n");
+
+  return octave_name_version_and_copyright ()
+         + br
+         + "This is free software; see the source code for copying conditions."
+         + br
+         + octave_warranty_statement (extra_info)
+         + sep
+         + R"(Octave was configured for ")"
+         + OCTAVE_CANONICAL_HOST_TYPE
+         + R"(".)";
+}
+
+std::string
+octave_name_version_copyright_copying_warranty_and_bugs
+  (bool html, const std::string& extra_info)
+{
+  std::string sep = (html ? "\n</p>\n<p>\n" : "\n\n");
+
+  std::string msg;
+
+  if (html)
+    msg = "<p>\n";
+
+  msg += octave_name_version_copyright_copying_and_warranty (html, extra_info)
+         + sep
+         + octave_www_statement (html)
+         + sep
+         + octave_contrib_statement (html)
+         + sep
+         + octave_bugs_statement (html)
+         + (html ? "\n</p>" : "");
+
+  return msg;
+}
+
+std::string
+octave_startup_message (bool html)
+{
+  std::string msg
+    = octave_name_version_copyright_copying_warranty_and_bugs
+        (html, "  For details, type 'warranty'.");
+
+  msg += (html ? "<p>\n" : "\n");
+
+  msg += "For information about changes from previous versions, type 'news'.";
+
+  msg += (html ? "\n</p>" : "");
+
+  return msg;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/liboctave/version.in.h	Sat May 19 13:54:04 2018 -0400
@@ -0,0 +1,73 @@
+// %NO_EDIT_WARNING%
+/*
+
+Copyright (C) 1992-2018 John W. Eaton
+
+This file is part of Octave.
+
+Octave is free software: you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+Octave is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with Octave; see the file COPYING.  If not, see
+<https://www.gnu.org/licenses/>.
+
+*/
+
+#if ! defined (octave_version_h)
+#define octave_version_h 1
+
+#include "octave-config.h"
+
+#define OCTAVE_VERSION %OCTAVE_VERSION%
+
+#define OCTAVE_MAJOR_VERSION %OCTAVE_MAJOR_VERSION%
+
+#define OCTAVE_MINOR_VERSION %OCTAVE_MINOR_VERSION%
+
+#define OCTAVE_PATCH_VERSION %OCTAVE_PATCH_VERSION%
+
+// The "API version" is used as a way of checking that interfaces in the
+// liboctave and libinterp libraries haven't changed in a backwardly
+// incompatible way when loading .oct files.  A better way to do that is
+// with library versioning, but not all systems support that.
+// NOTE: This macro will be removed in a future version of Octave.  If
+// you insist on checking for features using a version number, use the
+// OCTAVE_MAJOR_VERSION, OCTAVE_MINOR_VERSION, and
+// OCTAVE_PATCH_VERSION macros instead.
+#define OCTAVE_API_VERSION %OCTAVE_API_VERSION%
+
+#define OCTAVE_RELEASE_DATE %OCTAVE_RELEASE_DATE%
+
+#define OCTAVE_CANONICAL_HOST_TYPE %OCTAVE_CANONICAL_HOST_TYPE%
+
+#define OCTAVE_COPYRIGHT %OCTAVE_COPYRIGHT%
+
+#include <string>
+
+extern OCTINTERP_API std::string octave_www_statement (bool html = false);
+
+extern OCTINTERP_API std::string octave_contrib_statement (bool html = false);
+
+extern OCTINTERP_API std::string octave_bugs_statement (bool html = false);
+
+extern OCTINTERP_API std::string octave_name_version_and_copyright (void);
+
+extern OCTINTERP_API std::string
+octave_name_version_copyright_copying_and_warranty
+  (bool html = false, const std::string& extra_info = "");
+
+extern OCTINTERP_API std::string
+octave_name_version_copyright_copying_warranty_and_bugs
+  (bool html = false, const std::string& extra_info = "");
+
+extern OCTINTERP_API std::string octave_startup_message (bool html = false);
+
+#endif