File Coverage

File:config/inter/shlibs.pm
Coverage:100.0%

linestmtbrancondsubcode
1# Copyright (C) 2005-2007, Parrot Foundation.
2
3 - 16
=head1 NAME

config/inter/shlibs.pm - Flags for shared libraries.

=head1 DESCRIPTION

Asks the user which flags are needed for compiling position-independent code
for use in shared libraries.  Eventually, other shared-library-related prompts
may end up here.

This is a separate unit from config/inter/progs.pm because the answers depend
on which compiler is in use.  Thus it should come after the gccversion test.

=cut
17
18package inter::shlibs;
19
20
2
2
2
use strict;
21
2
2
2
use warnings;
22
23
2
2
2
use base qw(Parrot::Configure::Step);
24
25
2
2
2
use Parrot::Configure::Utils ':inter';
26
27
28sub _init {
29
3
    my $self = shift;
30
3
    my %data;
31
3
    $data{description} = q{Determine flags for building shared libraries};
32
3
    $data{result} = q{};
33
3
    return \%data;
34}
35
36sub runstep {
37
3
    my ( $self, $conf ) = @_;
38
39
3
    my $cc_shared = $conf->options->get('cc_shared');
40
3
    $cc_shared = integrate( $conf->data->get('cc_shared'), $cc_shared );
41
3
    $cc_shared = prompt(
42        "\nWhat flags instruct your compiler to compile code suitable for use in a shared library?",
43        $cc_shared
44    ) if $conf->options->get('ask');
45
3
    $conf->data->set( cc_shared => $cc_shared );
46
3
    $self->set_result( ( $cc_shared =~ m/^ ?$/ ) ? 'done' : $cc_shared );
47
48
3
    return 1;
49}
50
511;
52
53# Local Variables:
54# mode: cperl
55# cperl-indent-level: 4
56# fill-column: 100
57# End:
58# vim: expandtab shiftwidth=4: