~ubuntu-branches/ubuntu/maverick/lire/maverick

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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
package Lire::Config::Build;

use strict;

use vars qw( $VERSION %ac @ISA @EXPORT_OK );

sub coalesce {
    my $x;
    $x = shift while @_ && !defined $x;
    return $x;
}

BEGIN {
    ($VERSION)  = '$Revision: 1.8 $' =~ m!Revision: ([.\d]+)!;

    @ISA = qw(Exporter);
    @EXPORT_OK  = qw(ac_info ac_path ac_flags);

    %ac = (
        exec_prefix => '@exec_prefix@',
        prefix => '@prefix@',
        program_transform_name => '@program_transform_name@',
        bindir => '@bindir@',
        sbindir => '@sbindir@',
        libexecdir => '@libexecdir@',
        datadir => '@datadir@',
        sysconfdir => '@sysconfdir@',
        sharedstatedir => '@sharedstatedir@',
        localstatedir => '@localstatedir@',
        libdir => '@libdir@',
        includedir => '@includedir@',
        oldincludedir => '@oldincludedir@',
        infodir => '@infodir@',
        mandir => '@mandir@',
        INSTALL_PROGRAM => '@INSTALL_PROGRAM@',
        INSTALL_SCRIPT => '@INSTALL_SCRIPT@',
        INSTALL_DATA => '@INSTALL_DATA@',
        PACKAGE => '@PACKAGE@',
        VERSION => '@VERSION@',
        SHELL => '@SHELL@',
        CFLAGS => '@CFLAGS@',
        CPPFLAGS => '@CPPFLAGS@',
        CXXFLAGS => '@CXXFLAGS@',
        FFLAGS => '@FFLAGS@',
        DEFS => '@DEFS@',
        LDFLAGS => '@LDFLAGS@',
        LIBS => '@LIBS@',
        PERL => '@PERL@',
        LR_PERL5LIB => '@LR_PERL5LIBDIR@',
        GZIP => '@GZIP@',
        SENDMAIL => '@SENDMAIL@',
        PLOTICUS => '@PLOTICUS@',
        TAR => '@TAR@',
        GHOSTSCRIPT => '@GHOSTSCRIPT@',
        LR_ARCHIVEDIR => '@LR_ARCHIVEDIR@',
    );
    # calculate the transitive closure of any substitutions
    my $changed;
    do {
        $changed = 0;
        while(my ($k, $v) = each(%ac)) {
            $changed ||= $ac{$k} =~ s/\$\{([^}]+)\}/coalesce($ac{$1}, $ENV{$1}, '')/e;
            $changed ||= $ac{$k} =~ s/\$([A-Za-z][A-Za-z0-9_]*)/coalesce($ac{$1}, $ENV{$1}, '')/e;
        }
    } while($changed);
}

sub ac_info {
    return $ac{$_[0]};
}

sub ac_path {
    return join('/', map { ac_info($_) } @_);
}

sub ac_flags {
    return join(' ', map { ac_info($_) } @_);
}

# keep perl happy
1;

__END__

=pod

=head1 NAME

Lire::Config::Build - Look up build-time information

=head1 SYNOPSIS

This module provides build-time information to the configuration
module. It is primarily intended to be used internally by the
configuration module but can be used elsewhere as well. Consider
using the proper configuration though, since the user may wish to
override certain parameters.

=head1 DESCRIPTION

=head1 VERSION

$Id: Build.pm.in,v 1.8 2006/07/23 13:16:30 vanbaal Exp $

=head1 COPYRIGHT

Copyright (C) 2001 Stichting LogReport Foundation LogReport@LogReport.org

This file is part of Lire.

Lire is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program (see COPYING); if not, check with
http://www.gnu.org/copyleft/gpl.html. 

=head1 AUTHOR

Wessel Dankers <wsl@logreport.org>

=cut
# Local Variables:
# mode: cperl
# End: