~ubuntu-branches/ubuntu/edgy/libapache2-mod-perl2/edgy

« back to all changes in this revision

Viewing changes to lib/ModPerl/Config.pm

  • Committer: Bazaar Package Importer
  • Author(s): Andres Salomon
  • Date: 2005-08-12 01:40:38 UTC
  • mfrom: (1.1.2 upstream) (2.1.1 sarge)
  • Revision ID: james.westby@ubuntu.com-20050812014038-gjigefs55pqx4qc8
Tags: 2.0.1-3
Grr.  Really include perl.conf file; it got lost due to diff not
wanting to add an empty file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright 2001-2004 The Apache Software Foundation
 
1
# Copyright 2001-2005 The Apache Software Foundation
2
2
#
3
3
# Licensed under the Apache License, Version 2.0 (the "License");
4
4
# you may not use this file except in compliance with the License.
16
16
 
17
17
use strict;
18
18
 
19
 
use Apache::Build ();
 
19
use Apache2::Build ();
20
20
use Apache::TestConfig ();
 
21
use File::Spec ();
 
22
 
 
23
use constant WIN32 => Apache2::Build::WIN32;
21
24
 
22
25
sub as_string {
23
 
    my $build_config = Apache::Build->build_config;
 
26
    my $build = Apache2::Build->build_config;
24
27
 
25
28
    my $cfg = '';
26
29
 
27
30
    $cfg .= "*** mod_perl version $mod_perl::VERSION\n\n";;
28
31
 
29
 
    $cfg .= "*** using $INC{'Apache/BuildConfig.pm'}\n";
 
32
    my $file = File::Spec->rel2abs($INC{'Apache2/BuildConfig.pm'});
 
33
    $cfg .= "*** using $file\n\n";
30
34
 
31
35
    # the widest key length
32
36
    my $max_len = 0;
33
 
    for (map {length} grep /^MP_/, keys %$build_config) {
 
37
    for (map {length} grep /^MP_/, keys %$build) {
34
38
        $max_len = $_ if $_ > $max_len;
35
39
    }
36
40
 
37
41
    # mod_perl opts
38
42
    $cfg .= "*** Makefile.PL options:\n";
39
43
    $cfg .= join '',
40
 
        map {sprintf "  %-${max_len}s => %s\n", $_, $build_config->{$_}}
41
 
            grep /^MP_/, sort keys %$build_config;
 
44
        map {sprintf "  %-${max_len}s => %s\n", $_, $build->{$_}}
 
45
            grep /^MP_/, sort keys %$build;
42
46
 
43
47
    my $command = '';
44
48
 
52
56
        $cfg .= "\n\n*** The httpd binary was not found\n";
53
57
    }
54
58
 
 
59
    # apr
 
60
    $cfg .= "\n\n*** (apr|apu)-config linking info\n\n";
 
61
    my @apru_link_flags = $build->apru_link_flags;
 
62
    if (@apru_link_flags) {
 
63
        my $libs = join "\n", @apru_link_flags;
 
64
        $cfg .= "$libs\n\n";
 
65
    }
 
66
    else {
 
67
        $cfg .= "(apr|apu)-config scripts were not found\n\n";
 
68
    }
 
69
 
55
70
    # perl opts
56
 
    my $perl = $build_config->{MODPERL_PERLPATH};
 
71
    my $perl = $build->{MODPERL_PERLPATH};
57
72
    $command = "$perl -V";
58
73
    $cfg .= "\n\n*** $command\n";
59
74
    $cfg .= qx{$command};