diff Makefile.am @ 21598:cf552443c104

revise method of handling hg id for build info * Makefile.am (HG-ID): New target and file to distribute. * build-info.h: Don't include config.h. * build-info.in.cc: Strip CR from line endings. * build-info.h, build-info.in.cc (octave_hg_id): Rename from oct_hg_id. (octave_build_date): Rename from oct_build_date. (octave_build_time): Rename from oct_build_time. Change all callers. * toplev.cc (F__octave_config_info__): Rename fields: builddate to build_date, buildtime to build_time, hgid to hg_id, and releasedate to * libinterp/module.mk (upate_hg_id): Delete rule. (octinclude_HEADERS): Include build-info.h in the list. (BUILT_SOURCES): Remove update_hg_id from the list. (libinterp/build-info.cc): Don't depend on build-aux/mk-build-info.sh. Depend on HG-ID instead of libinterp/hg.id. Call sed directly here instead of using a shell script. * build-aux/mk-build-info-cc.in.sh: Delete. * Makefile.am (EXTRA_DIST): Remove build-aux/mk-build-info-cc.sh.in from the list. (GEN_CONFIG_SHELL): Remove build-aux/mk-build-info-cc.sh from the list. * configure.ac (OCTAVE_CONFIG_MOVE_IF_CHANGE_FILES): Remove build-aux/mk-build-info-cc.sh from the list.
author John W. Eaton <jwe@octave.org>
date Sat, 09 Apr 2016 18:58:28 -0400
parents fe1447ae68cf
children 43d9eec519bd
line wrap: on
line diff
--- a/Makefile.am	Fri Apr 08 21:41:18 2016 +0200
+++ b/Makefile.am	Sat Apr 09 18:58:28 2016 -0400
@@ -37,6 +37,7 @@
   AUTHORS \
   BUGS \
   ChangeLog \
+  HG-ID \
   INSTALL.OCTAVE
 
 EXTRA_DIST += \
@@ -52,7 +53,6 @@
   build-aux/mk-f77-def.in.sh \
   build-aux/mk-mxarray-h.in.sh \
   build-aux/mk-version-h.in.sh \
-  build-aux/mk-build-info-cc.in.sh \
   build-aux/mk-octave-config-h.sh \
   build-aux/mk-opts.pl \
   build-aux/move-if-change \
@@ -70,7 +70,6 @@
   build-aux/mk-f77-def.sh \
   build-aux/mk-mxarray-h.sh \
   build-aux/mk-version-h.sh \
-  build-aux/mk-build-info-cc.sh \
   build-aux/subst-config-vals.sh \
   build-aux/subst-cross-config-vals.sh \
   build-aux/subst-default-vals.sh \
@@ -287,6 +286,20 @@
 	$(AM_V_GEN)$(changelog-from-hg-log)
 .PHONY: ChangeLog
 
+HG-ID:
+	$(AM_V_GEN)rm -f $@-t && \
+	if [ -d $(srcdir)/.hg ]; then \
+	  ( cd $(srcdir) && hg identify --id ) > $@-t && \
+	  $(simple_move_if_change_rule); \
+	elif [ ! -f $(srcdir)/HG-ID ]; then \
+	  echo "$(srcdir)/HG-ID is missing!" 1>&2; \
+	  echo "unknown" >& $@-t && mv $@-t $@; \
+	else \
+	  echo "preserving existing HG-ID file" 1>&2; \
+	  $(cp_update_rule); \
+	fi
+.PHONY: HG-ID
+
 octetc_DATA += \
   CITATION \
   NEWS