Commit 9c6c1cd0 9c6c1cd005bb037c40f3e1a2f0ce1492a70ec33f by Sergey Poznyakoff

Minor improvement in gitinfo.h production

* Makefile.am: Minor change.
* include/mailutils/Makefile.am (gitinfo.h): Build only if
$(srcdir) and $(builddir) are the same.
* mu-aux/gitinfo.pl: Rename to mu-aux/gitinfo
* configure.ac (GITINFO): Reflect this change
* mu-aux/Makefile.am: Likewise.
1 parent 612f9a55
......@@ -123,13 +123,12 @@ SUBDIRS = . \
EXTRA_DIST = COPYING.LESSER paths
DISTCLEANFILES = pathdefs.h
# Trigger creation of the ChangeLog
noinst_DATA = ChangeLog
gen_start_date = "2008-12-08"
prev_change_log = "doc/ChangeLog.CVS"
amend_file=ChangeLog.amend
amend_file = ChangeLog.amend
# Trigger creation of the ChangeLog
noinst_DATA = ChangeLog
.PHONY: ChangeLog
ChangeLog:
$(AM_V_at)if test -d .git; then \
......@@ -138,6 +137,8 @@ ChangeLog:
--append=$(prev_change_log) \
--amend=$(amend_file) \
--since=$(gen_start_date); \
elif test "$(builddir)" = "$(srcdir)" && test ! -e ChangeLog; then \
echo "This file is a placeholder." > ChangeLog; \
fi
dist-hook: ChangeLog
......
......@@ -1374,7 +1374,7 @@ AC_PATH_PROG([PERL], perl)
if test -z "$PERL"; then
PERL=false
fi
AC_SUBST([GITINFO],'$(PERL) $(mu_aux_dir)/gitinfo.pl')
AC_SUBST([GITINFO],'$(PERL) $(mu_aux_dir)/gitinfo')
AC_CONFIG_COMMANDS([status],[
cat <<EOF
......
......@@ -27,12 +27,13 @@ types.h: $(top_srcdir)/include/mailutils/types.hin Makefile
$(top_srcdir)/include/mailutils/types.hin > types.h
gitinfo.h: $(top_srcdir)/ChangeLog
$(AM_V_GEN)if ! $(GITINFO) -Hc -ogitinfo.h \
&& test ! -f $(srcdir)/gitinfo.h; then \
echo '/* no info */' > gitinfo.h;\
$(AM_V_GEN)if test "$(builddir)" = "$(srcdir)"; then \
test -d $(top_srcdir)/.git && $(GITINFO) -Hc -ogitinfo.h; \
if test ! -f gitinfo.h; then \
echo '/* no info */' > gitinfo.h;\
fi; \
fi
DISTCLEANFILES = types.h
pkginclude_HEADERS = \
......
......@@ -23,7 +23,7 @@ EXTRA_DIST = \
texify.sed\
sqlmod.sh\
generr.awk\
gitinfo.pl
gitinfo
m4datadir = $(datadir)/aclocal
dist_m4data_DATA = mailutils.m4
......
eval '(exit $?0)' && eval 'exec perl -wS "$0" "$@"'
& eval 'exec perl -wS "$0" $argv:q'
if 0;
# This file is part of GNU Mailutils.
# Copyright (C) 2017 Free Software Foundation, Inc.
#
......@@ -443,6 +447,7 @@ EOT
'all' => sub {
foreach my $name (sort keys %gitinfo) {
my $val = $gitinfo{$name};
next unless defined $val;
$val =~ s/(["\\])/\\$1/g;
print "$name=\"$val\"\n";
}
......