summaryrefslogtreecommitdiff
path: root/automake.in
diff options
context:
space:
mode:
authorAkim Demaille <akim@epita.fr>2001-10-02 17:17:45 +0000
committerAkim Demaille <akim@epita.fr>2001-10-02 17:17:45 +0000
commit2a9e88830dc337d25f2a87e371b0e86c56b34cef (patch)
treec31ee5e43d9b12bd6f1bd897d2409acc423f7a2b /automake.in
parent22e0da02d82f97d46a47c88e47ddde00c80abccb (diff)
downloadautomake-2a9e88830dc337d25f2a87e371b0e86c56b34cef.tar.gz
* lib/Automake/Struct.pm: Update from Autoconf.
* lib/Automake/General.pm, lib/Automake/XFile.pm: New, from CVS Autoconf. * automake.in: Use them. (&uniq, $me): Remove, as they are provided by Automake::General.
Diffstat (limited to 'automake.in')
-rwxr-xr-xautomake.in50
1 files changed, 7 insertions, 43 deletions
diff --git a/automake.in b/automake.in
index a41bcaebf..14c15543d 100755
--- a/automake.in
+++ b/automake.in
@@ -112,11 +112,10 @@ package Automake;
require 5.005;
use strict 'vars', 'subs';
-use File::Basename;
+use Automake::General;
+use Automake::XFile;
use IO::File;
-
-my $me = basename ($0);
-
+use File::Basename;
## ----------- ##
## Constants. ##
@@ -1040,25 +1039,6 @@ sub prog_error (@)
}
-# @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;
-}
-
# subst ($TEXT)
# -------------
# Return a configure-style substitution using the indicated text.
@@ -4474,11 +4454,7 @@ sub scan_autoconf_traces
$traces .= ' -t AC_LIBSOURCE';
$traces .= ' -t AC_SUBST';
- my $tracefh = new IO::File ("$traces |");
- if (! $tracefh)
- {
- die "$me: couldn't open `$traces': $!\n";
- }
+ my $tracefh = new Automake::XFile ("$traces |");
print "$me: reading $traces\n" if $verbose;
while ($_ = $tracefh->getline)
@@ -4529,11 +4505,7 @@ sub scan_one_autoconf_file
{
my ($filename) = @_;
- my $configfh = new IO::File ("< $filename");
- if (! $configfh)
- {
- die "$me: couldn't open `$filename': $!\n";
- }
+ my $configfh = new Automake::XFile ("< $filename");
print "$me: reading $filename\n" if $verbose;
my ($in_ac_output, $in_ac_replace) = (0, 0);
@@ -6662,11 +6634,7 @@ sub read_am_file
{
my ($amfile) = @_;
- my $am_file = new IO::File ("< $amfile");
- if (! $am_file)
- {
- die "$me: couldn't open `$amfile': $!\n";
- }
+ my $am_file = new Automake::XFile ("< $amfile");
print "$me: reading $amfile\n" if $verbose;
my $spacing = '';
@@ -7016,11 +6984,7 @@ sub make_paragraphs ($%)
. 's/\n{3,}/\n\n/g';
# Swallow the file and apply the COMMAND.
- my $fc_file = new IO::File ("< $file");
- if (! $fc_file)
- {
- die "$me: installation error: cannot open `$file'\n";
- }
+ my $fc_file = new Automake::XFile ("< $file");
# Looks stupid?
print "$me: reading $file\n"
if $verbose;