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.
2003-06-20 Alexandre Duret-Lutz <adl@gnu.org>
+ * 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.
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 \
{ 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
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
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
# 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
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 \
.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 \
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;
# 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
# 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.
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 \
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
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 \
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
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 \
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
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 \
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
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 \
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
-@set UPDATED 11 June 2003
+@set UPDATED 20 June 2003
@set UPDATED-MONTH June 2003
@set EDITION 1.7a
@set VERSION 1.7a
distcom.test \
distcom2.test \
distcom3.test \
+distcom4.test \
+distcom5.test \
distdir.test \
distname.test \
dollar.test \
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 \
distcom.test \
distcom2.test \
distcom3.test \
+distcom4.test \
+distcom5.test \
distdir.test \
distname.test \
dollar.test \
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
--- /dev/null
+#! /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
--- /dev/null
+#! /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`
-@set UPDATED 11 June 2003
+@set UPDATED 20 June 2003
@set UPDATED-MONTH June 2003
@set EDITION 1.7a
@set VERSION 1.7a