1 # Copyright (C) 2001-2003, The Perl Foundation.
6 config/auto/env.pm - System Environment
10 Determining if the C library has C<setenv()> and C<unsetenv()>.
12 More information about these functions can be found at
13 L<http://www.gnu.org/software/libc/manual/html_node/Environment-Access.html>,
14 among other locations.
23 use base
qw(Parrot::Configure::Step);
25 use Parrot
::Configure
::Utils
':auto';
30 $data{description
} = q{Determining if your C library has setenv / unsetenv};
36 my ( $self, $conf ) = ( shift, shift );
38 my ( $setenv, $unsetenv ) = ( 0, 0 );
40 $conf->cc_gen('config/auto/env/test_setenv.in');
41 eval { $conf->cc_build(); };
42 unless ( $@
|| $conf->cc_run() !~ /ok/ ) {
46 $conf->cc_gen('config/auto/env/test_unsetenv.in');
47 eval { $conf->cc_build(); };
48 unless ( $@
|| $conf->cc_run() !~ /ok/ ) {
53 $self->_evaluate_env($conf, $setenv, $unsetenv);
59 my ($self, $conf, $setenv, $unsetenv) = @_;
60 my $verbose = $conf->options->get('verbose');
66 if ( $setenv && $unsetenv ) {
67 print " (both) " if $verbose;
68 $self->set_result('both');
71 print " (setenv) " if $verbose;
72 $self->set_result('setenv');
75 print " (unsetenv) " if $verbose;
76 $self->set_result('unsetenv');
79 print " (no) " if $verbose;
80 $self->set_result('no');
88 # cperl-indent-level: 4
91 # vim: expandtab shiftwidth=4: