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 = . \ ...@@ -123,13 +123,12 @@ SUBDIRS = . \
123 EXTRA_DIST = COPYING.LESSER paths 123 EXTRA_DIST = COPYING.LESSER paths
124 DISTCLEANFILES = pathdefs.h 124 DISTCLEANFILES = pathdefs.h
125 125
126 # Trigger creation of the ChangeLog
127 noinst_DATA = ChangeLog
128
129 gen_start_date = "2008-12-08" 126 gen_start_date = "2008-12-08"
130 prev_change_log = "doc/ChangeLog.CVS" 127 prev_change_log = "doc/ChangeLog.CVS"
131 amend_file=ChangeLog.amend 128 amend_file = ChangeLog.amend
132 129
130 # Trigger creation of the ChangeLog
131 noinst_DATA = ChangeLog
133 .PHONY: ChangeLog 132 .PHONY: ChangeLog
134 ChangeLog: 133 ChangeLog:
135 $(AM_V_at)if test -d .git; then \ 134 $(AM_V_at)if test -d .git; then \
...@@ -138,6 +137,8 @@ ChangeLog: ...@@ -138,6 +137,8 @@ ChangeLog:
138 --append=$(prev_change_log) \ 137 --append=$(prev_change_log) \
139 --amend=$(amend_file) \ 138 --amend=$(amend_file) \
140 --since=$(gen_start_date); \ 139 --since=$(gen_start_date); \
140 elif test "$(builddir)" = "$(srcdir)" && test ! -e ChangeLog; then \
141 echo "This file is a placeholder." > ChangeLog; \
141 fi 142 fi
142 143
143 dist-hook: ChangeLog 144 dist-hook: ChangeLog
......
...@@ -1374,7 +1374,7 @@ AC_PATH_PROG([PERL], perl) ...@@ -1374,7 +1374,7 @@ AC_PATH_PROG([PERL], perl)
1374 if test -z "$PERL"; then 1374 if test -z "$PERL"; then
1375 PERL=false 1375 PERL=false
1376 fi 1376 fi
1377 AC_SUBST([GITINFO],'$(PERL) $(mu_aux_dir)/gitinfo.pl') 1377 AC_SUBST([GITINFO],'$(PERL) $(mu_aux_dir)/gitinfo')
1378 1378
1379 AC_CONFIG_COMMANDS([status],[ 1379 AC_CONFIG_COMMANDS([status],[
1380 cat <<EOF 1380 cat <<EOF
......
...@@ -27,12 +27,13 @@ types.h: $(top_srcdir)/include/mailutils/types.hin Makefile ...@@ -27,12 +27,13 @@ types.h: $(top_srcdir)/include/mailutils/types.hin Makefile
27 $(top_srcdir)/include/mailutils/types.hin > types.h 27 $(top_srcdir)/include/mailutils/types.hin > types.h
28 28
29 gitinfo.h: $(top_srcdir)/ChangeLog 29 gitinfo.h: $(top_srcdir)/ChangeLog
30 $(AM_V_GEN)if ! $(GITINFO) -Hc -ogitinfo.h \ 30 $(AM_V_GEN)if test "$(builddir)" = "$(srcdir)"; then \
31 && test ! -f $(srcdir)/gitinfo.h; then \ 31 test -d $(top_srcdir)/.git && $(GITINFO) -Hc -ogitinfo.h; \
32 echo '/* no info */' > gitinfo.h;\ 32 if test ! -f gitinfo.h; then \
33 echo '/* no info */' > gitinfo.h;\
34 fi; \
33 fi 35 fi
34 36
35
36 DISTCLEANFILES = types.h 37 DISTCLEANFILES = types.h
37 38
38 pkginclude_HEADERS = \ 39 pkginclude_HEADERS = \
......
...@@ -23,7 +23,7 @@ EXTRA_DIST = \ ...@@ -23,7 +23,7 @@ EXTRA_DIST = \
23 texify.sed\ 23 texify.sed\
24 sqlmod.sh\ 24 sqlmod.sh\
25 generr.awk\ 25 generr.awk\
26 gitinfo.pl 26 gitinfo
27 27
28 m4datadir = $(datadir)/aclocal 28 m4datadir = $(datadir)/aclocal
29 dist_m4data_DATA = mailutils.m4 29 dist_m4data_DATA = mailutils.m4
......
1 eval '(exit $?0)' && eval 'exec perl -wS "$0" "$@"'
2 & eval 'exec perl -wS "$0" $argv:q'
3 if 0;
4
1 # This file is part of GNU Mailutils. 5 # This file is part of GNU Mailutils.
2 # Copyright (C) 2017 Free Software Foundation, Inc. 6 # Copyright (C) 2017 Free Software Foundation, Inc.
3 # 7 #
...@@ -443,6 +447,7 @@ EOT ...@@ -443,6 +447,7 @@ EOT
443 'all' => sub { 447 'all' => sub {
444 foreach my $name (sort keys %gitinfo) { 448 foreach my $name (sort keys %gitinfo) {
445 my $val = $gitinfo{$name}; 449 my $val = $gitinfo{$name};
450 next unless defined $val;
446 $val =~ s/(["\\])/\\$1/g; 451 $val =~ s/(["\\])/\\$1/g;
447 print "$name=\"$val\"\n"; 452 print "$name=\"$val\"\n";
448 } 453 }
......