From: Akim Demaille Date: Wed, 21 Feb 2001 08:22:24 +0000 (+0000) Subject: * distdir.am (GZIP_ENV): Define. X-Git-Tag: handle-languages~287 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=1ab4848cac4a72e25b31e12d7e3e52098b05cc36;p=automake.git * distdir.am (GZIP_ENV): Define. * automake.in (&handle_dist): Don't. (&uniq): New. (&handle_dist_worker, &am_install_var): Use it. --- diff --git a/ChangeLog b/ChangeLog index 12f0c3d3..5e47fd48 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2001-02-21 Akim Demaille + + * distdir.am (GZIP_ENV): Define. + * automake.in (&handle_dist): Don't. + (&uniq): New. + (&handle_dist_worker, &am_install_var): Use it. + 2001-02-21 Akim Demaille * distdir.am (distdir): Handle the DIST-TARGETS. diff --git a/Makefile.in b/Makefile.in index d5d0fd82..9177a544 100644 --- a/Makefile.in +++ b/Makefile.in @@ -139,7 +139,6 @@ stamp-vti texinfo.tex version.texi ylwrap DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -GZIP_ENV = --best DIST_SUBDIRS = $(SUBDIRS) all: all-recursive .SUFFIXES: @@ -487,6 +486,8 @@ distcheck: dist echo "$$banner"; \ echo "$$dashes" +GZIP_ENV = --best + distdir: $(DISTFILES) @if sed 15q $(srcdir)/NEWS | fgrep -e "$(VERSION)" >/dev/null; then :; else \ echo "NEWS not updated; not releasing" 1>&2; \ @@ -524,7 +525,6 @@ distdir: $(DISTFILES) ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r $(distdir) - dist: distdir $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz -chmod -R a+w $(distdir) >/dev/null 2>&1; rm -rf $(distdir) diff --git a/automake.in b/automake.in index 65bb252c..5d4320eb 100755 --- a/automake.in +++ b/automake.in @@ -421,17 +421,36 @@ exit $exit_status; ################################################################ - # prog_error (@PRINT-ME) # ---------------------- # Signal a programming error, display PRINT-ME, and exit 1. -sub prog_error +sub prog_error (@) { print STDERR "automake: programming error: @_\n"; exit 1; } +# @RES +# uniq (@LIST) +# ------------ +# Return LIST with no duplicates. +sub uniq (@) +{ + my @res = (); + my %seen = (); + foreach my $item (@_) + { + if (! defined $seen{$item}) + { + $seen{$item} = 1; + push (@res, $item); + } + } + return @res; +} + + ################################################################ # Parse command line. @@ -2629,18 +2648,9 @@ sub handle_dist_worker $dist_subdir_name = 'DIST_SUBDIRS'; if (! &variable_defined ('DIST_SUBDIRS')) { - local (@full_list) = &variable_value_as_list ('SUBDIRS', - 'all'); - local (@ds_list, %uniq, $iter); - foreach $iter (@full_list) - { - if (! defined $uniq{$iter}) - { - $uniq{$iter} = 1; - push (@ds_list, $iter); - } - } - &define_pretty_variable ('DIST_SUBDIRS', '', @ds_list); + &define_pretty_variable + ('DIST_SUBDIRS', '', + uniq (&variable_value_as_list ('SUBDIRS', 'all'))); } } else @@ -2754,7 +2764,6 @@ sub handle_dist # Some boilerplate. $output_vars .= &file_contents ('dist-vars') . "\n"; - &define_variable ('GZIP_ENV', '--best'); # Put these things in rules section so it is easier for whoever # reads Makefile.in. @@ -7382,9 +7391,7 @@ sub am_install_var # Make the result unique. This lets the user use conditionals in # a natural way, but still lets us program lazily -- we don't have # to worry about handling a particular object more than once. - local (%uniquify) = (); - grep ($uniquify{$_} = 1, @result); - return sort keys %uniquify; + return uniq (sort @result); } diff --git a/dist-vars.am b/dist-vars.am index 677f6de2..9266bb47 100644 --- a/dist-vars.am +++ b/dist-vars.am @@ -1,5 +1,5 @@ ## automake - create Makefile.in from Makefile.am -## Copyright 1994, 1995, 1996, 1999 Free Software Foundation, Inc. +## Copyright 1994, 1995, 1996, 1999, 2001 Free Software Foundation, Inc. ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by diff --git a/distdir.am b/distdir.am index e6df942e..5704f87c 100644 --- a/distdir.am +++ b/distdir.am @@ -123,6 +123,7 @@ distdir: $(DISTFILES) ## the only reason) is that some versions of tar (e.g., OSF1) ## interpret `-z' differently. +?TOPDIR?GZIP_ENV = --best ?TOPDIR?.PHONY: dist-all dist ?TOPDIR?dist-all: dist ?TOPDIR?dist: distdir diff --git a/lib/am/distdir.am b/lib/am/distdir.am index e6df942e..5704f87c 100644 --- a/lib/am/distdir.am +++ b/lib/am/distdir.am @@ -123,6 +123,7 @@ distdir: $(DISTFILES) ## the only reason) is that some versions of tar (e.g., OSF1) ## interpret `-z' differently. +?TOPDIR?GZIP_ENV = --best ?TOPDIR?.PHONY: dist-all dist ?TOPDIR?dist-all: dist ?TOPDIR?dist: distdir diff --git a/m4/Makefile.in b/m4/Makefile.in index 240886c9..03656b24 100644 --- a/m4/Makefile.in +++ b/m4/Makefile.in @@ -99,7 +99,6 @@ DIST_COMMON = Makefile.am Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -GZIP_ENV = --best all: all-am .SUFFIXES: $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) diff --git a/tests/Makefile.in b/tests/Makefile.in index 8dc5d37b..35c436f2 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -360,7 +360,6 @@ DIST_COMMON = Makefile.am Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -GZIP_ENV = --best all: all-am .SUFFIXES: $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)