From: Alexandre Duret-Lutz Date: Fri, 20 Jun 2003 20:38:58 +0000 (+0000) Subject: * automake.in (handle_dist): Delete DIST_COMMON before redefining X-Git-Tag: Release-1-7b~153 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=97aee5d70df0abe4e71f951aeaef799ad091c2a5;p=thirdparty%2Fautomake.git * automake.in (handle_dist): Delete DIST_COMMON before redefining it. Bug report from Akim Demaille. (rewrite_inputs_into_dependencies): Make sure we always return something, even when $add_srcdir is 0. * tests/distcom4.test, tests/distcom5.test: New files. * tests/Makefile.am (TESTS): Add distcom4.test and distcom5.test. --- diff --git a/ChangeLog b/ChangeLog index b25b8e070..edb5694b3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,12 @@ 2003-06-20 Alexandre Duret-Lutz + * automake.in (handle_dist): Delete DIST_COMMON before redefining + it. Bug report from Akim Demaille. + (rewrite_inputs_into_dependencies): Make sure we always return + something, even when $add_srcdir is 0. + * tests/distcom4.test, tests/distcom5.test: New files. + * tests/Makefile.am (TESTS): Add distcom4.test and distcom5.test. + * tests/cond29.test: Also check for _SOURCES. Report from Paolo Bonzini. diff --git a/Makefile.in b/Makefile.in index 25bfe5c2b..a9f1705f2 100644 --- a/Makefile.in +++ b/Makefile.in @@ -34,11 +34,9 @@ POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : -DIST_COMMON = Makefile.in Makefile.am COPYING INSTALL NEWS README \ - AUTHORS ChangeLog THANKS aclocal.m4 configure configure.in \ - $(am__configure_deps) version.texi stamp-vti AUTHORS COPYING \ - ChangeLog INSTALL NEWS README THANKS TODO configure \ - configure.in +DIST_COMMON = README $(am__configure_deps) AUTHORS COPYING ChangeLog \ + INSTALL Makefile.am Makefile.in NEWS THANKS TODO aclocal.m4 \ + configure configure.in stamp-vti version.texi subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__configure_deps = $(top_srcdir)/m4/init.m4 \ @@ -86,6 +84,7 @@ am__remove_distdir = \ { test ! -d $(distdir) \ || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -fr $(distdir); }; } +DIST_ARCHIVES = $(distdir).tar.gz $(distdir).tar.bz2 GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print distcleancheck_listfiles = find . -type f -print @@ -198,7 +197,7 @@ $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) $( exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @@ -516,11 +515,23 @@ distdir: $(DISTFILES) dist-gzip: distdir $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) - dist-bzip2: distdir $(AMTAR) chof - $(distdir) | bzip2 -9 -c >$(distdir).tar.bz2 $(am__remove_distdir) +dist-tarZ: distdir + $(AMTAR) chof - $(distdir) | compress -c >$(distdir).tar.Z + $(am__remove_distdir) + +dist-shar: distdir + shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz + $(am__remove_distdir) + +dist-zip: distdir + -rm -f $(distdir).zip + zip -rq $(distdir).zip $(distdir) + $(am__remove_distdir) + dist dist-all: distdir $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(AMTAR) chof - $(distdir) | bzip2 -9 -c >$(distdir).tar.bz2 @@ -530,8 +541,18 @@ dist dist-all: distdir # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist - $(am__remove_distdir) - GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(AMTAR) xf - + case '$(DIST_ARCHIVES)' in \ + *.tar.gz*) \ + GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(AMTAR) xf - ;;\ + *.tar.bz2*) \ + bunzip2 -c $(distdir).tar.bz2 | $(AMTAR) xf - ;;\ + *.tar.Z*) \ + uncompress -c $(distdir).tar.Z | $(AMTAR) xf - ;;\ + *.shar.gz*) \ + GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | unshar ;;\ + *.zip*) \ + unzip $(distdir).zip ;;\ + esac chmod -R a-w $(distdir); chmod a+w $(distdir) mkdir $(distdir)/_build mkdir $(distdir)/_inst @@ -558,12 +579,12 @@ distcheck: dist distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ - && $(MAKE) $(AM_MAKEFLAGS) dist-gzip \ - && rm -f $(distdir).tar.gz \ + && $(MAKE) $(AM_MAKEFLAGS) dist \ + && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck - $(am__remove_distdir) - @echo "$(distdir).tar.gz is ready for distribution" | \ - sed 'h;s/./=/g;p;x;p;x' + @(echo "$(distdir) archives ready for distribution: "; \ + for i in $(DIST_ARCHIVES); do echo $$i; done) | \ + sed -e '1{h;s/./=/g;p;x}' -e '$${p;x}' distuninstallcheck: @cd $(distuninstallcheck_dir) \ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ @@ -699,9 +720,10 @@ uninstall-info: uninstall-info-recursive .PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am am--refresh check \ check-am clean clean-generic clean-recursive ctags \ ctags-recursive dist dist-all dist-bzip2 dist-gzip dist-info \ - distcheck distclean distclean-generic distclean-recursive \ - distclean-tags distcleancheck distdir distuninstallcheck dvi \ - dvi-am dvi-recursive html html-am html-recursive info info-am \ + dist-shar dist-tarZ dist-zip distcheck distclean \ + distclean-generic distclean-recursive distclean-tags \ + distcleancheck distdir distuninstallcheck dvi dvi-am \ + dvi-recursive html html-am html-recursive info info-am \ info-recursive install install-am install-binSCRIPTS \ install-data install-data-am install-data-recursive \ install-exec install-exec-am install-exec-recursive \ diff --git a/automake.in b/automake.in index 721608479..b3b749f8b 100755 --- a/automake.in +++ b/automake.in @@ -3833,7 +3833,7 @@ sub handle_dist my $archive_defined = $options{'no-dist-gzip'} ? 0 : 1; $archive_defined ||= grep { $options{"dist-$_"} } ('shar', 'zip', 'tarZ', 'bzip2'); - error ($options{'no-dist-gzip'}, + error ($options{'no-dist-gzip'}, "no-dist-gzip specified but no dist-* specified, " . "at least one archive format must be enabled") unless $archive_defined; @@ -3888,6 +3888,7 @@ sub handle_dist # as it recursively expands `$(dist_pkgdata_DATA)' etc. my @dist_common = split (' ', rvar ('DIST_COMMON')->variable_value); @dist_common = uniq (sort for_dist_common (@dist_common)); + variable_delete 'DIST_COMMON'; define_pretty_variable ('DIST_COMMON', TRUE, INTERNAL, @dist_common); # Now that we've processed DIST_COMMON, disallow further attempts @@ -4097,22 +4098,21 @@ sub scan_aclocal_m4 # If 0 then files that require this addition will simply be ignored. sub rewrite_inputs_into_dependencies ($@) { - my ($add_srcdir, @inputs) = @_; - my @newinputs; + my ($add_srcdir, @inputs) = @_; + my @newinputs; - foreach my $single (@inputs) + foreach my $single (@inputs) { - if (dirname ($single) eq $relative_dir) + if (dirname ($single) eq $relative_dir) { - push (@newinputs, basename ($single)); + push (@newinputs, basename ($single)); } - elsif ($add_srcdir) + else { - push (@newinputs, '$(top_srcdir)/' . $single); + push (@newinputs, ($add_srcdir ? '$(top_srcdir)/' : '') . $single); } } - - return @newinputs; + return @newinputs; } # Handle remaking and configure stuff. diff --git a/lib/Automake/Makefile.in b/lib/Automake/Makefile.in index 53691156b..5f478289d 100644 --- a/lib/Automake/Makefile.in +++ b/lib/Automake/Makefile.in @@ -34,7 +34,7 @@ POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : -DIST_COMMON = Makefile.in Makefile.am $(dist_perllib_DATA) +DIST_COMMON = $(dist_perllib_DATA) Makefile.am Makefile.in subdir = lib/Automake ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__configure_deps = $(top_srcdir)/m4/init.m4 \ @@ -155,7 +155,7 @@ $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) $( exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu lib/Automake/Makefile'; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu lib/Automake/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu lib/Automake/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status diff --git a/lib/Automake/tests/Makefile.in b/lib/Automake/tests/Makefile.in index f18ba25ad..43e2a04fb 100644 --- a/lib/Automake/tests/Makefile.in +++ b/lib/Automake/tests/Makefile.in @@ -33,7 +33,7 @@ POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : -DIST_COMMON = Makefile.in Makefile.am +DIST_COMMON = Makefile.am Makefile.in subdir = lib/Automake/tests ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__configure_deps = $(top_srcdir)/m4/init.m4 \ @@ -132,7 +132,7 @@ $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) $( exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu lib/Automake/tests/Makefile'; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu lib/Automake/tests/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu lib/Automake/tests/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status diff --git a/lib/Makefile.in b/lib/Makefile.in index b1716f3dc..670a6efbd 100644 --- a/lib/Makefile.in +++ b/lib/Makefile.in @@ -34,11 +34,10 @@ POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : -DIST_COMMON = Makefile.in Makefile.am $(dist_pkgvdata_DATA) \ - $(dist_script_DATA) COPYING INSTALL ansi2knr.1 ansi2knr.c \ - compile config.guess config.sub depcomp elisp-comp install-sh \ - mdate-sh missing mkinstalldirs py-compile texinfo.tex ylwrap \ - config.guess config.sub +DIST_COMMON = $(dist_pkgvdata_DATA) $(dist_script_DATA) COPYING \ + INSTALL Makefile.am Makefile.in ansi2knr.1 ansi2knr.c compile \ + config.guess config.sub depcomp elisp-comp install-sh mdate-sh \ + missing mkinstalldirs py-compile texinfo.tex ylwrap subdir = lib ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__configure_deps = $(top_srcdir)/m4/init.m4 \ @@ -149,7 +148,7 @@ $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) $( exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu lib/Makefile'; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu lib/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu lib/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status diff --git a/lib/am/Makefile.in b/lib/am/Makefile.in index f029a3325..332b6742a 100644 --- a/lib/am/Makefile.in +++ b/lib/am/Makefile.in @@ -34,7 +34,7 @@ POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : -DIST_COMMON = Makefile.in Makefile.am $(dist_am_DATA) +DIST_COMMON = $(dist_am_DATA) Makefile.am Makefile.in subdir = lib/am ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__configure_deps = $(top_srcdir)/m4/init.m4 \ @@ -137,7 +137,7 @@ $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) $( exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu lib/am/Makefile'; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu lib/am/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu lib/am/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status diff --git a/m4/Makefile.in b/m4/Makefile.in index c94314002..cc1342fac 100644 --- a/m4/Makefile.in +++ b/m4/Makefile.in @@ -34,7 +34,7 @@ POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : -DIST_COMMON = Makefile.in Makefile.am $(dist_m4data_DATA) +DIST_COMMON = $(dist_m4data_DATA) Makefile.am Makefile.in subdir = m4 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__configure_deps = $(top_srcdir)/m4/init.m4 \ @@ -167,7 +167,7 @@ $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) $( exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu m4/Makefile'; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu m4/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu m4/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status diff --git a/stamp-vti b/stamp-vti index d1324bff9..b0c900bae 100644 --- a/stamp-vti +++ b/stamp-vti @@ -1,4 +1,4 @@ -@set UPDATED 11 June 2003 +@set UPDATED 20 June 2003 @set UPDATED-MONTH June 2003 @set EDITION 1.7a @set VERSION 1.7a diff --git a/tests/Makefile.am b/tests/Makefile.am index d06b611bb..9eb2650b9 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -163,6 +163,8 @@ discover.test \ distcom.test \ distcom2.test \ distcom3.test \ +distcom4.test \ +distcom5.test \ distdir.test \ distname.test \ dollar.test \ diff --git a/tests/Makefile.in b/tests/Makefile.in index 3514066a8..d9790506a 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -33,7 +33,7 @@ POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : -DIST_COMMON = Makefile.in Makefile.am defs.in README +DIST_COMMON = README Makefile.am Makefile.in defs.in subdir = tests ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__configure_deps = $(top_srcdir)/m4/init.m4 \ @@ -274,6 +274,8 @@ discover.test \ distcom.test \ distcom2.test \ distcom3.test \ +distcom4.test \ +distcom5.test \ distdir.test \ distname.test \ dollar.test \ @@ -602,7 +604,7 @@ $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) $( exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tests/Makefile'; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tests/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu tests/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status diff --git a/tests/distcom4.test b/tests/distcom4.test new file mode 100755 index 000000000..916fa9b89 --- /dev/null +++ b/tests/distcom4.test @@ -0,0 +1,73 @@ +#! /bin/sh +# Copyright (C) 2003 Free Software Foundation, Inc. +# +# This file is part of GNU Automake. +# +# GNU Automake 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 2, or (at your option) +# any later version. +# +# GNU Automake 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 Automake; see the file COPYING. If not, write to +# the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +# Boston, MA 02111-1307, USA. + +# Test to make sure config files are distributed, and only once. +# This tries to distribute a file from a subdirectory, without +# Makefile in that directory. distcom5.test performs the same +# test with a Makefile in the directory. +# Also make sure that README appears first in DIST_COMMON. + +. ./defs || exit 1 + +set -e + +cat >> configure.in << 'END' + AC_CONFIG_FILES([tests/autoconf:tests/wrapper.in], + [chmod +x tests/autoconf]) + AC_CONFIG_FILES([tests/autoheader:tests/wrapper.in], + [chmod +x tests/autoheader]) + AC_CONFIG_FILES([tests/autom4te:tests/wrapper.in], + [chmod +x tests/autom4te]) + AC_CONFIG_FILES([tests/autoreconf:tests/wrapper.in], + [chmod +x tests/autoreconf]) + AC_CONFIG_FILES([tests/autoscan:tests/wrapper.in], + [chmod +x tests/autoscan]) + AC_CONFIG_FILES([tests/autoupdate:tests/wrapper.in], + [chmod +x tests/autoupdate]) + AC_CONFIG_FILES([tests/ifnames:tests/wrapper.in], + [chmod +x tests/ifnames]) + AC_OUTPUT +END + +mkdir tests +: > README +: > tests/wrapper.in +cat > Makefile.am << 'END' +test: distdir + test -f $(distdir)/tests/wrapper.in +END + +$ACLOCAL +$AUTOCONF +$AUTOMAKE --add-missing +./configure +$MAKE test + +sed -n -e '/^DIST_COMMON =.*\\$/ { + :loop + p + n + /\\$/ b loop + p + n + }' -e '/^DIST_COMMON =/ p' Makefile.in > dc.txt + +test 1 = `grep tests dc.txt | wc -l` +grep 'DIST_COMMON = README' Makefile.in diff --git a/tests/distcom5.test b/tests/distcom5.test new file mode 100755 index 000000000..84cde4cee --- /dev/null +++ b/tests/distcom5.test @@ -0,0 +1,83 @@ +#! /bin/sh +# Copyright (C) 2003 Free Software Foundation, Inc. +# +# This file is part of GNU Automake. +# +# GNU Automake 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 2, or (at your option) +# any later version. +# +# GNU Automake 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 Automake; see the file COPYING. If not, write to +# the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +# Boston, MA 02111-1307, USA. + +# Test to make sure config files are distributed, and only once. +# This tries to distribute a file from a subdirectory, with +# a Makefile in that directory. distcom4.test performs the same +# test without Makefile in the directory. + +. ./defs || exit 1 + +set -e + +cat >> configure.in << 'END' + AC_CONFIG_FILES([tests/autoconf:tests/wrapper.in], + [chmod +x tests/autoconf]) + AC_CONFIG_FILES([tests/autoheader:tests/wrapper.in], + [chmod +x tests/autoheader]) + AC_CONFIG_FILES([tests/autom4te:tests/wrapper.in], + [chmod +x tests/autom4te]) + AC_CONFIG_FILES([tests/autoreconf:tests/wrapper.in], + [chmod +x tests/autoreconf]) + AC_CONFIG_FILES([tests/autoscan:tests/wrapper.in], + [chmod +x tests/autoscan]) + AC_CONFIG_FILES([tests/autoupdate:tests/wrapper.in], + [chmod +x tests/autoupdate]) + AC_CONFIG_FILES([tests/ifnames:tests/wrapper.in], + [chmod +x tests/ifnames]) + AC_CONFIG_FILES([tests/Makefile]) + AC_OUTPUT +END + +mkdir tests +: > tests/wrapper.in +: > tests/Makefile.am +cat > Makefile.am << 'END' +SUBDIRS = tests +test: distdir + test -f $(distdir)/tests/wrapper.in +END + +$ACLOCAL +$AUTOCONF +$AUTOMAKE --add-missing +./configure +$MAKE test + +sed -n -e '/^DIST_COMMON =.*\\$/ { + :loop + p + n + /\\$/ b loop + p + n + }' -e '/^DIST_COMMON =/ p' Makefile.in > top.txt + +sed -n -e '/^DIST_COMMON =.*\\$/ { + :loop + p + n + /\\$/ b loop + p + n + }' -e '/^DIST_COMMON =/ p' tests/Makefile.in > inner.txt + +test 0 = `grep tests top.txt | wc -l` +test 1 = `grep wrapper inner.txt | wc -l` diff --git a/version.texi b/version.texi index d1324bff9..b0c900bae 100644 --- a/version.texi +++ b/version.texi @@ -1,4 +1,4 @@ -@set UPDATED 11 June 2003 +@set UPDATED 20 June 2003 @set UPDATED-MONTH June 2003 @set EDITION 1.7a @set VERSION 1.7a