/
shlibs.pm
58 lines (41 loc) · 1.36 KB
/
shlibs.pm
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
# Copyright (C) 2005-2007, Parrot Foundation.
=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
package inter::shlibs;
use strict;
use warnings;
use base qw(Parrot::Configure::Step);
use Parrot::Configure::Utils ':inter';
sub _init {
my $self = shift;
my %data;
$data{description} = q{Determine flags for building shared libraries};
$data{result} = q{};
return \%data;
}
sub runstep {
my ( $self, $conf ) = @_;
my $cc_shared = $conf->options->get('cc_shared');
$cc_shared = integrate( $conf->data->get('cc_shared'), $cc_shared );
$cc_shared = prompt(
"\nWhat flags instruct your compiler to compile code suitable for use in a shared library?",
$cc_shared
) if $conf->options->get('ask');
$conf->data->set( cc_shared => $cc_shared );
$self->set_result( ( $cc_shared =~ m/^ ?$/ ) ? 'done' : $cc_shared );
return 1;
}
1;
# Local Variables:
# mode: cperl
# cperl-indent-level: 4
# fill-column: 100
# End:
# vim: expandtab shiftwidth=4: