# HG changeset patch # User John W. Eaton # Date 1460391379 14400 # Node ID 37f6ed8a6f1bfb2dca22e9e482d8072ff37c1982 # Parent ec01be3b8f5d089234828455dc1bfc26fe37a3f2 store liboctave and liboctinterp hg ids separately * liboctinterp-build-info.h: Rename from build-info.h. * liboctinterp-build-info.in.cc: Rename from build-info.in.cc. * liboctinterp-build-info.h, liboctinterp-build-info.in.cc (liboctinterp_hg_id): Rename function from octave_hg_id. * libinterp/module.mk: Update. * liboctave/liboctave-build-info.h, liboctave/liboctave-build-info.in.cc: New files. * liboctave/module.mk: Update. * toplev.cc: Include both liboctave-build-info.h and liboctinterp-build-info.h. (F__octave_config_info__): Replace hg_id field with liboctave_hg_id and liboctinterp_hg_id fields. diff -r ec01be3b8f5d -r 37f6ed8a6f1b libinterp/build-info.h --- a/libinterp/build-info.h Mon Apr 11 11:38:46 2016 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,34 +0,0 @@ -/* - -Copyright (C) 2016 M. Muetzel - -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 -. - -*/ - -#if ! defined (octave_build_info_h) -#define octave_build_info_h 1 - -#include "octave-config.h" - -#include - -#include - -extern OCTAVE_API std::string octave_hg_id (void); - -#endif diff -r ec01be3b8f5d -r 37f6ed8a6f1b libinterp/build-info.in.cc --- a/libinterp/build-info.in.cc Mon Apr 11 11:38:46 2016 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,34 +0,0 @@ -// %NO_EDIT_WARNING% -/* - -Copyright (C) 2016 M. Muetzel - -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 -. - -*/ - -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif - -#include "build-info.h" - -std::string -octave_hg_id (void) -{ - return "%OCTAVE_HG_ID%"; -} diff -r ec01be3b8f5d -r 37f6ed8a6f1b libinterp/corefcn/toplev.cc --- a/libinterp/corefcn/toplev.cc Mon Apr 11 11:38:46 2016 -0400 +++ b/libinterp/corefcn/toplev.cc Mon Apr 11 12:16:19 2016 -0400 @@ -52,7 +52,8 @@ #include "str-vec.h" #include "build-env.h" -#include "build-info.h" +#include "liboctave-build-info.h" +#include "liboctinterp-build-info.h" #include "defaults.h" #include "defun.h" #include "error.h" @@ -1431,13 +1432,18 @@ { "fcnfiledir", subst_octave_home (OCTAVE_FCNFILEDIR) }, { "fftw_version", octave_fftw_version () }, { "fftwf_version", octave_fftwf_version () }, - { "hg_id", octave_hg_id () }, { "imagedir", subst_octave_home (OCTAVE_IMAGEDIR) }, { "includedir", subst_octave_home (OCTAVE_INCLUDEDIR) }, { "infodir", subst_octave_home (OCTAVE_INFODIR) }, { "infofile", subst_octave_home (OCTAVE_INFOFILE) }, { "libdir", subst_octave_home (OCTAVE_LIBDIR) }, { "libexecdir", subst_octave_home (OCTAVE_LIBEXECDIR) }, + // The liboctave and liboctinterp hg ids should always be the + // same, but it is possible for someone to accidentally have a + // mismatched pair so we record both separately so that we can + // ensure that they are consistent. + { "liboctave_hg_id", liboctave_hg_id () }, + { "liboctinterp_hg_id", liboctinterp_hg_id () }, { "localapiarchlibdir", subst_octave_home (OCTAVE_LOCALAPIARCHLIBDIR) }, { "localapifcnfiledir", subst_octave_home (OCTAVE_LOCALAPIFCNFILEDIR) }, { "localapioctfiledir", subst_octave_home (OCTAVE_LOCALAPIOCTFILEDIR) }, diff -r ec01be3b8f5d -r 37f6ed8a6f1b libinterp/liboctinterp-build-info.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libinterp/liboctinterp-build-info.h Mon Apr 11 12:16:19 2016 -0400 @@ -0,0 +1,34 @@ +/* + +Copyright (C) 2016 M. Muetzel + +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 +. + +*/ + +#if ! defined (octave_liboctinterp_build_info_h) +#define octave_liboctinterp_build_info_h 1 + +#include "octave-config.h" + +#include + +#include + +extern OCTAVE_API std::string liboctinterp_hg_id (void); + +#endif diff -r ec01be3b8f5d -r 37f6ed8a6f1b libinterp/liboctinterp-build-info.in.cc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libinterp/liboctinterp-build-info.in.cc Mon Apr 11 12:16:19 2016 -0400 @@ -0,0 +1,34 @@ +// %NO_EDIT_WARNING% +/* + +Copyright (C) 2016 M. Muetzel + +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 +. + +*/ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include "liboctinterp-build-info.h" + +std::string +liboctinterp_hg_id (void) +{ + return "%OCTAVE_HG_ID%"; +} diff -r ec01be3b8f5d -r 37f6ed8a6f1b libinterp/module.mk --- a/libinterp/module.mk Mon Apr 11 11:38:46 2016 -0400 +++ b/libinterp/module.mk Mon Apr 11 12:16:19 2016 -0400 @@ -43,9 +43,9 @@ BUILT_SOURCES += \ $(GENERATED_MAKE_BUILTINS_INCS) \ libinterp/build-env.cc \ - libinterp/build-info.cc \ libinterp/builtin-defun-decls.h \ libinterp/builtins.cc \ + libinterp/liboctinterp-build-info.cc \ libinterp/corefcn/oct-errno.cc \ libinterp/corefcn/oct-tex-lexer.cc \ libinterp/corefcn/oct-tex-parser.cc \ @@ -77,7 +77,7 @@ LIBINTERP_BUILT_NODISTFILES = \ libinterp/build-env.cc \ libinterp/build-env-features.cc \ - libinterp/build-info.cc \ + libinterp/liboctinterp-build-info.cc \ libinterp/corefcn/mxarray.h \ libinterp/corefcn/oct-errno.cc \ libinterp/corefcn/defaults.h \ @@ -93,10 +93,10 @@ libinterp/DOCSTRINGS \ libinterp/build-env.in.cc \ libinterp/build-env-features.sh \ - libinterp/build-info.in.cc \ libinterp/find-defun-files.sh \ libinterp/gendoc.pl \ libinterp/genprops.awk \ + libinterp/liboctinterp-build-info.in.cc \ libinterp/mk-errno-list \ libinterp/mk-pkg-add \ libinterp/mkbuiltins \ @@ -110,7 +110,7 @@ libinterp/builtins.h \ libinterp/builtin-defun-decls.h \ libinterp/build-env.h \ - libinterp/build-info.h \ + libinterp/liboctinterp-build-info.h \ libinterp/octave.h \ libinterp/options-usage.h \ $(OCTAVE_VALUE_INC) \ @@ -168,7 +168,7 @@ libinterp/builtins.cc \ libinterp/build-env.cc \ libinterp/build-env-features.cc \ - libinterp/build-info.cc \ + libinterp/liboctinterp-build-info.cc \ libinterp/version.h libinterp_liboctinterp_la_LIBADD = \ @@ -263,7 +263,7 @@ libinterp/version.h: libinterp/version.in.h build-aux/mk-version-h.sh | libinterp/$(octave-dirstamp) $(AM_V_GEN)$(call simple-filter-rule,build-aux/mk-version-h.sh) -libinterp/build-info.cc: libinterp/build-info.in.cc HG-ID | libinterp/$(octave-dirstamp) +libinterp/liboctinterp-build-info.cc: libinterp/liboctinterp-build-info.in.cc HG-ID | libinterp/$(octave-dirstamp) $(AM_V_GEN)rm -f $@-t && \ $(SED) \ -e "s|%NO_EDIT_WARNING%|DO NOT EDIT! Generated automatically by Makefile|" \ diff -r ec01be3b8f5d -r 37f6ed8a6f1b liboctave/liboctave-build-info.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/liboctave/liboctave-build-info.h Mon Apr 11 12:16:19 2016 -0400 @@ -0,0 +1,34 @@ +/* + +Copyright (C) 2016 M. Muetzel + +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 +. + +*/ + +#if ! defined (octave_liboctave_build_info_h) +#define octave_liboctave_build_info_h 1 + +#include "octave-config.h" + +#include + +#include + +extern OCTAVE_API std::string liboctave_hg_id (void); + +#endif diff -r ec01be3b8f5d -r 37f6ed8a6f1b liboctave/liboctave-build-info.in.cc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/liboctave/liboctave-build-info.in.cc Mon Apr 11 12:16:19 2016 -0400 @@ -0,0 +1,34 @@ +// %NO_EDIT_WARNING% +/* + +Copyright (C) 2016 M. Muetzel + +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 +. + +*/ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include "liboctave-build-info.h" + +std::string +liboctave_hg_id (void) +{ + return "%OCTAVE_HG_ID%"; +} diff -r ec01be3b8f5d -r 37f6ed8a6f1b liboctave/module.mk --- a/liboctave/module.mk Mon Apr 11 11:38:46 2016 -0400 +++ b/liboctave/module.mk Mon Apr 11 12:16:19 2016 -0400 @@ -1,4 +1,5 @@ -liboctave_EXTRA_DIST = +liboctave_EXTRA_DIST = \ + liboctave/liboctave-build-info.in.cc liboctave_CLEANFILES = liboctave_DISTCLEANFILES = @@ -8,6 +9,7 @@ liboctave_liboctave_la_CPPFLAGS = \ @OCTAVE_DLL_DEFS@ \ @CRUFT_DLL_DEFS@ \ + -Iliboctave -I$(srcdir)/liboctave \ -I$(srcdir)/liboctave/array \ -I$(srcdir)/liboctave/cruft/misc \ -Iliboctave/numeric -I$(srcdir)/liboctave/numeric \ @@ -28,9 +30,14 @@ BUILT_SOURCES += \ $(BUILT_INCS) \ - $(BUILT_LIBOCTAVE_OPERATORS_SOURCES) + $(BUILT_LIBOCTAVE_OPERATORS_SOURCES) \ + liboctave/liboctave-build-info.cc + +LIBOCTAVE_BUILT_NODISTFILES = \ + liboctave/liboctave-build-info.cc octinclude_HEADERS += \ + liboctave/liboctave-build-info.h \ $(ARRAY_INC) \ $(CRUFT_INC) \ $(NUMERIC_INC) \ @@ -61,7 +68,8 @@ ## liboctave merely collects a bunch of compiled convenience libraries. ## It has no source code itself. -liboctave_liboctave_la_SOURCES = +liboctave_liboctave_la_SOURCES = \ + liboctave/liboctave-build-info.cc # Dummy C++ source to force C++ linking. EXTRA_liboctave_liboctave_la_SOURCES = liboctave/.dummy_force_cxx_link.cc @@ -102,12 +110,22 @@ nobase_liboctavetests_DATA = $(LIBOCTAVE_TST_FILES) +liboctave/liboctave-build-info.cc: liboctave/liboctave-build-info.in.cc HG-ID | liboctave/$(octave-dirstamp) + $(AM_V_GEN)rm -f $@-t && \ + $(SED) \ + -e "s|%NO_EDIT_WARNING%|DO NOT EDIT! Generated automatically by Makefile|" \ + -e "s|%OCTAVE_HG_ID%|`cat $(builddir)/HG-ID`|" $< > $@-t && \ + $(simple_move_if_change_rule) + EXTRA_DIST += $(liboctave_EXTRA_DIST) liboctave_DISTCLEANFILES += \ + $(LIBOCTAVE_BUILT_NODISTFILES) \ $(BUILT_INCS) \ $(LIBOCTAVE_TST_FILES) +BUILT_NODISTFILES += $(LIBOCTAVE_BUILT_NODISTFILES) + CLEANFILES += $(liboctave_CLEANFILES) DISTCLEANFILES += $(liboctave_DISTCLEANFILES) MAINTAINERCLEANFILES += $(liboctave_MAINTAINERCLEANFILES)