* automake.in (&handle_dist): Don't.
(&uniq): New.
(&handle_dist_worker, &am_install_var): Use it.
2001-02-21 Akim Demaille <akim@epita.fr>
+ * 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 <akim@epita.fr>
+
* distdir.am (distdir): Handle the DIST-TARGETS.
* automake.in (&handle_dist_worker): Don't.
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-GZIP_ENV = --best
DIST_SUBDIRS = $(SUBDIRS)
all: all-recursive
.SUFFIXES:
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; \
! -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)
################################################################
-
# 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.
$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
# 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.
# 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);
}
## 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
## 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
## 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
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)
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)