summaryrefslogtreecommitdiff
blob: a06332a2287fb424750688a2776d5168ece69457 (plain)
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
package Apache2;

sub BEGIN {
  use Config;

  @inc = ( '/etc/perl',
	   $Config{sitearchexp},
	   $Config{sitelibexp},
	   $Config{vendorarchexp},
	   $Config{vendorlibexp},
	   $Config{archlibexp},
	   $Config{privlibexp},
	 );

  my @sfxs = split( / /, $Config{inc_version_list} );

  # this fails if we have numbers over 9. the goal is to get newer
  # versions earlier in the list.
  @sfxs = sort { $b cmp $a } @sfxs;

  my $site_pfx = $Config{sitelib_stem};
  my $vend_pfx = $Config{vendorlib_stem};
  for my $sfx ( @sfxs ) {
    push( @inc, "$site_pfx/$sfx", "$vend_pfx/$sfx" );
  }

  push( @inc,
	"/usr/local/lib/site_perl",
	"/usr/lib/apache2",
	"/usr/lib/apache2/lib/perl",
      );

  # no . here because it doesn't make sense for us

  # ok, now prepend Apache2 subdirectories of anything and take out
  # nonexistent directories.  a case could be made that leaving
  # nonexistent directories on here would be a good idea, but i'm
  # going to go with the "reduce clutter" goal for now.

  @INC = ();
  for my $cd ( @inc ) {
    next unless -d $cd;
    push( @INC, "$cd/Apache2" ) if -d "$cd/Apache2";
    push( @INC, $cd );
  }
}

1;