1 # Copyright (C) 2001-2003, The Perl Foundation.
6 config/auto/inline.pm - Inline Compiler Support
10 Determines whether the compiler supports C<inline>.
19 use base
qw(Parrot::Configure::Step);
21 use Parrot
::Configure
::Utils
':auto';
27 $data{description
} = q{Determining if your compiler supports inline};
33 my ( $self, $conf ) = @_;
35 my $inline = $conf->options->get(qw(inline));
36 if ( defined $inline ) {
37 $conf->data->set( inline
=> $inline );
41 my $test = $self->_first_probe_for_inline($conf);
43 $test = $self->_second_probe_for_inline($conf, $test);
46 $self->_evaluate_inline($conf, $test);
50 sub _first_probe_for_inline
{
54 $conf->cc_gen('config/auto/inline/test_1.in');
55 eval { $conf->cc_build(); };
57 $test = $conf->cc_run();
64 sub _second_probe_for_inline
{
69 $conf->cc_gen('config/auto/inline/test_2.in');
70 eval { $conf->cc_build(); };
72 $test = $conf->cc_run();
80 sub _evaluate_inline
{
81 my ($self, $conf, $test) = @_;
82 my $verbose = $conf->options->get(qw(verbose));
84 print " ($test) " if $verbose;
85 $self->set_result('yes');
88 print " no " if $verbose;
89 $self->set_result('no');
92 $conf->data->set( inline
=> $test );
100 # cperl-indent-level: 4
103 # vim: expandtab shiftwidth=4: