1 # Copyright (C) 2001-2018 Free Software Foundation, Inc.
3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation; either version 2, or (at your option)
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
13 # You should have received a copy of the GNU General Public License
14 # along with this program. If not, see <https://www.gnu.org/licenses/>.
16 package Automake
::General
;
23 use vars qw
(@ISA @EXPORT);
26 @EXPORT = qw
(&uniq
&none
$me);
28 # Variable we share with the main package. Be sure to have a single
29 # copy of them: using 'my' together with multiple inclusion of this
30 # package would introduce several copies.
36 # Exit nonzero whenever closing STDOUT fails.
39 # This is required if the code might send any output to stdout
40 # E.g., even --version or --help. So it's best to do it unconditionally.
43 print STDERR
"$me: closing standard output: $!\n";
53 # Return LIST with no duplicates.
60 if (! exists $seen{$item})
66 return wantarray ?
@res : "@res";
72 # Return 1 when no element in LIST satisfies predicate PRED otherwise 0.
75 my ($pred, @list) = @_;
77 foreach my $item (@list)