aboutsummaryrefslogtreecommitdiffstats
path: root/devel/automake19/files/patch-ad
blob: 3cd773443ae74ec995a8febdfefd2b20131249aa (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
--- aclocal.in.orig Sun Sep  9 11:31:39 2001
+++ aclocal.in  Sun Sep  9 11:37:54 2001
@@ -34,6 +34,8 @@
 # Note that this isn't pkgdatadir, but a separate directory.
 $acdir = "@datadir@/aclocal";
 
+$acdir_x11 = '%%X11BASE%%/share/aclocal';
+
 # Some globals.
 
 # Exit status.
@@ -115,6 +117,9 @@
 
 
 local (@dirlist) = &parse_arguments (@ARGV);
+
+unshift @dirlist, $acdir_x11 if -d "$acdir_x11/.";
+
 &scan_m4_files (@dirlist);
 &scan_configure;
 if (! $exit_status)
@@ -299,11 +304,13 @@
    $file_contents{'acinclude.m4'} = &scan_file ('acinclude.m4');
     }
 
+    local (@skipinolist) = ();
     local ($m4dir);
     foreach $m4dir (@dirlist)
     {
    opendir (DIR, $m4dir)
        || die "aclocal: couldn't open directory `$m4dir': $!\n";
+   local ($file, $fullfile, $expr);
    local ($file, $fullfile);
    foreach $file (sort grep (! /^\./, readdir (DIR)))
    {
@@ -314,6 +321,12 @@
        next if $file eq 'aclocal.m4';
 
        $fullfile = $m4dir . '/' . $file;
+
+       # Do not scan a file more than once.
+       $ino = (stat($fullfile))[1];
+       next if grep($ino eq $_, @skipinolist);
+       push @skipinolist, $ino;
+
        $file_contents{$fullfile} = &scan_file ($fullfile);
    }
    closedir (DIR);