Ticket #119: conf-libs.patch
File conf-libs.patch, 45.1 KB (added by fperrad, 13 years ago) |
---|
-
config/auto/crypto.pm
7 7 8 8 =head1 DESCRIPTION 9 9 10 This library is linked to a dynamic PMC. 11 10 12 See L<http://www.openssl.org> 11 13 12 14 =cut … … 45 47 return 1; 46 48 } 47 49 48 my $cc = $conf->data->get('cc');49 my $libs = $conf->data->get('libs');50 my $linkflags = $conf->data->get('linkflags');51 my $ccflags = $conf->data->get('ccflags');52 53 50 my $osname = $conf->data->get_p5('OSNAME'); 54 51 55 $self->_add_to_libs( {52 my $extra_libs = $self->_select_lib( { 56 53 conf => $conf, 57 54 osname => $osname, 58 cc => $c c,55 cc => $conf->data->get('cc'), 59 56 win32_nongcc => 'libcrypto.lib', 60 57 default => '-lcrypto', 61 58 } ); 62 59 63 60 $conf->cc_gen('config/auto/crypto/crypto.in'); 64 eval { $conf->cc_build( ); };61 eval { $conf->cc_build( q{}, $extra_libs); }; 65 62 my $has_crypto = 0; 66 63 if ( !$@ ) { 67 64 my $test = $conf->cc_run(); 68 65 $has_crypto = $self->_evaluate_cc_run($conf, $test, $has_crypto, $verbose); 69 66 } 70 unless ($has_crypto) {71 # The Parrot::Configure settings might have changed while class ran72 $self->_recheck_settings($conf, $libs, $ccflags, $linkflags, $verbose);73 }74 67 $conf->data->set( has_crypto => $has_crypto ); # for dynpmc.in & digest.t 75 68 76 69 return 1; -
config/auto/gdbm.pm
50 50 return 1; 51 51 } 52 52 53 my $cc = $conf->data->get('cc');54 my $libs = $conf->data->get('libs');55 my $linkflags = $conf->data->get('linkflags');56 my $ccflags = $conf->data->get('ccflags');57 58 53 my $osname = $conf->data->get_p5('OSNAME'); 59 54 55 my $extra_libs = $self->_select_lib( { 56 conf => $conf, 57 osname => $osname, 58 cc => $conf->data->get('cc'), 59 win32_gcc => '-llibgdbm', 60 win32_nongcc => 'gdbm.lib', 61 default => '-lgdbm', 62 } ); 63 60 64 # On OS X check the presence of the gdbm header in the standard 61 65 # Fink location. 62 66 $self->_handle_darwin_for_fink($conf, $osname, 'gdbm.h'); 63 67 64 68 $conf->cc_gen('config/auto/gdbm/gdbm.in'); 65 if ( $osname =~ /mswin32/i ) { 66 if ( $cc =~ /^gcc/i ) { 67 eval { $conf->cc_build( '', '-llibgdbm' ); }; 68 } 69 else { 70 eval { $conf->cc_build( '', 'gdbm.lib' ); }; 71 } 72 } 73 else { 74 eval { $conf->cc_build( '', '-lgdbm' ); }; 75 } 69 eval { $conf->cc_build( q{}, $extra_libs ); }; 76 70 my $has_gdbm = 0; 77 71 if ( !$@ ) { 78 72 my $test = $conf->cc_run(); 79 73 unlink "gdbm_test_db"; 80 74 $has_gdbm = $self->_evaluate_cc_run($test, $has_gdbm, $verbose); 81 75 } 82 unless ($has_gdbm) {83 # The Parrot::Configure settings might have changed while class ran84 $self->_recheck_settings($conf, $libs, $ccflags, $linkflags, $verbose);85 }86 76 $conf->data->set( has_gdbm => $has_gdbm ); # for gdbmhash.t and dynpmc.in 87 77 88 78 return 1; -
config/auto/gettext.pm
50 50 return 1; 51 51 } 52 52 53 my $cc = $conf->data->get('cc');54 my $libs = $conf->data->get('libs');55 my $linkflags = $conf->data->get('linkflags');56 my $ccflags = $conf->data->get('ccflags');57 58 53 my $osname = $conf->data->get_p5('OSNAME'); 59 54 60 $self->_add_to_libs( {55 my $extra_libs = $self->_select_lib( { 61 56 conf => $conf, 62 57 osname => $osname, 63 cc => $c c,58 cc => $conf->data->get('cc'), 64 59 win32_gcc => '-lintl', 65 60 win32_nongcc => 'intl.lib', 66 61 default => defined $conf->data->get('glibc') ? '' : '-lintl', … … 71 66 $self->_handle_darwin_for_fink($conf, $osname, 'libintl.h'); 72 67 73 68 $conf->cc_gen('config/auto/gettext/gettext.in'); 74 eval { $conf->cc_build( ); };75 my $has_gettext ;69 eval { $conf->cc_build( q{}, $extra_libs ); }; 70 my $has_gettext = 0; 76 71 if ( !$@ ) { 77 72 my $test = $conf->cc_run(); 78 73 $has_gettext = $self->_evaluate_cc_run($test, $verbose); 79 74 } 80 75 if ($has_gettext) { 81 _handle_gettext($conf, $verbose );76 _handle_gettext($conf, $verbose, $extra_libs); 82 77 } 83 else {84 # The Parrot::Configure settings might have changed while class ran85 $self->_recheck_settings($conf, $libs, $ccflags, $linkflags, $verbose);86 }87 78 $conf->data->set( HAS_GETTEXT => $has_gettext ); 88 79 89 80 return 1; … … 102 93 } 103 94 104 95 sub _handle_gettext { 105 my ($conf, $verbose ) = @_;96 my ($conf, $verbose, $libs) = @_; 106 97 $conf->data->add( ' ', ccflags => "-DHAS_GETTEXT" ); 98 $conf->data->add( ' ', libs => $libs ); 107 99 $verbose and print "\n ccflags: ", $conf->data->get("ccflags"), "\n"; 108 100 return 1; 109 101 } -
config/auto/gmp.pm
56 56 return 1; 57 57 } 58 58 59 my $cc = $conf->data->get('cc'); 60 my $libs = $conf->data->get('libs'); 61 my $linkflags = $conf->data->get('linkflags'); 62 my $ccflags = $conf->data->get('ccflags'); 59 my $osname = $conf->data->get_p5('OSNAME'); 63 60 64 my $osname = $conf->data->get_p5('OSNAME'); 65 66 $self->_add_to_libs( { 61 my $extra_libs = $self->_select_lib( { 67 62 conf => $conf, 68 63 osname => $osname, 69 cc => $c c,64 cc => $conf->data->get('cc'), 70 65 win32_nongcc => 'gmp.lib', 71 66 default => '-lgmp', 72 67 } ); … … 77 72 $self->_handle_darwin_for_macports($conf, $osname, 'gmp.h'); 78 73 79 74 $conf->cc_gen('config/auto/gmp/gmp.in'); 80 eval { $conf->cc_build( ); };75 eval { $conf->cc_build( q{}, $extra_libs); }; 81 76 my $has_gmp = 0; 82 77 if ( !$@ ) { 83 78 my $test = $conf->cc_run(); 84 79 $has_gmp = $self->_evaluate_cc_run( $conf, $test, $has_gmp, $verbose ); 85 80 } 86 unless ($has_gmp) { 87 # The Parrot::Configure settings might have changed while class ran 88 $self->_recheck_settings($conf, $libs, $ccflags, $linkflags, $verbose); 81 if ($has_gmp) { 82 $conf->data->add( ' ', libs => $extra_libs ); 89 83 } 90 84 91 85 return 1; -
config/auto/opengl.pm
18 18 the steps needed to add OpenGL support for each platform for which we have 19 19 received this information -- details for additional platforms are welcome! 20 20 21 22 21 =head2 Mac OS X 23 22 24 23 You will need to install the F<OpenGL Framework> and the F<GLUT Framework>. … … 160 159 return 1; 161 160 } 162 161 163 my $cc = $conf->data->get('cc');164 my $libs = $conf->data->get('libs');165 my $linkflags = $conf->data->get('linkflags');166 my $ccflags = $conf->data->get('ccflags');167 168 162 my $osname = $conf->data->get_p5('OSNAME'); 169 163 170 164 # Prefer Cygwin/w32api over Cygwin/X, but use X when DISPLAY is set 171 if ($^O eq 'cygwin' and $ENV{DISPLAY}) { 172 $self->_add_to_libs( { 173 conf => $conf, 174 osname => $osname, 175 cc => $cc, 176 cygwin => '-lglut -L/usr/X11R6/lib -lGLU -lGL' 177 } ) 178 } 179 else { 180 $self->_add_to_libs( { 181 conf => $conf, 182 osname => $osname, 183 cc => $cc, 184 win32_gcc => '-lglut32 -lglu32 -lopengl32', 185 win32_nongcc => 'opengl32.lib glu32.lib glut32.lib', 186 darwin => '-framework OpenGL -framework GLUT', 187 default => '-lglut -lGLU -lGL', 188 } ) }; 165 my $extra_libs = ($^O eq 'cygwin' and $ENV{DISPLAY}) 166 ? $self->_select_lib( { 167 conf => $conf, 168 osname => $osname, 169 cc => $conf->data->get('cc'), 170 cygwin => '-lglut -L/usr/X11R6/lib -lGLU -lGL' 171 } ) 172 : $self->_select_lib( { 173 conf => $conf, 174 osname => $osname, 175 cc => $conf->data->get('cc'), 176 win32_gcc => '-lglut32 -lglu32 -lopengl32', 177 win32_nongcc => 'opengl32.lib glu32.lib glut32.lib', 178 darwin => '-framework OpenGL -framework GLUT', 179 default => '-lglut -lGLU -lGL', 180 } ) 181 ; 189 182 190 183 # On OS X check the presence of the OpenGL headers in the standard 191 184 # Fink/macports locations. … … 195 188 196 189 $conf->cc_gen('config/auto/opengl/opengl.in'); 197 190 my $has_glut = 0; 198 eval { $conf->cc_build( ) };191 eval { $conf->cc_build( q{}, $extra_libs ) }; 199 192 if ( !$@ ) { 200 193 my $test = $conf->cc_run(); 201 $has_glut = _handle_glut($conf, $ self->_evaluate_cc_run($test, $verbose));194 $has_glut = _handle_glut($conf, $extra_libs, $self->_evaluate_cc_run($test, $verbose)); 202 195 } 203 unless ($has_glut) {204 # The Parrot::Configure settings might have changed while class ran205 $self->_recheck_settings($conf, $libs, $ccflags, $linkflags, $verbose);206 }207 196 208 197 return 1; 209 198 } … … 219 208 } 220 209 221 210 sub _handle_glut { 222 my ($conf, $ glut_api_version, $glut_brand) = @_;211 my ($conf, $libs, $glut_api_version, $glut_brand) = @_; 223 212 224 213 $conf->data->set( 225 214 # Completely cargo culted 226 215 opengl => 'define', 227 216 has_opengl => 1, 228 217 HAS_OPENGL => 1, 218 opengl_lib => $libs, 229 219 230 220 glut => 'define', 231 221 glut_brand => $glut_brand, -
config/auto/pcre.pm
9 9 10 10 Determines whether the platform supports pcre library. 11 11 12 This library is used via NCI mecanism. 13 12 14 =cut 13 15 14 16 package auto::pcre; … … 44 46 return 1; 45 47 } 46 48 47 my $cc = $conf->data->get('cc');48 my $libs = $conf->data->get('libs');49 my $linkflags = $conf->data->get('linkflags');50 my $ccflags = $conf->data->get('ccflags');51 52 49 my $osname = $conf->data->get_p5('OSNAME'); 53 50 54 $self->_add_to_libs( {51 my $extra_libs = $self->_select_lib( { 55 52 conf => $conf, 56 53 osname => $osname, 57 cc => $c c,54 cc => $conf->data->get('cc'), 58 55 win32_nongcc => 'pcre.lib', 59 56 default => '-lpcre', 60 57 } ); … … 65 62 $self->_handle_darwin_for_macports($conf, $osname, 'pcre.h'); 66 63 67 64 $conf->cc_gen('config/auto/pcre/pcre.in'); 68 eval { $conf->cc_build( ) };65 eval { $conf->cc_build( q{}, $extra_libs ) }; 69 66 my $has_pcre = 0; 70 67 if ( !$@ ) { 71 68 my $test = $conf->cc_run(); 72 69 $has_pcre = $self->_evaluate_cc_run($test, $verbose); 73 70 } 74 if (! $has_pcre) {75 # The Parrot::Configure settings might have changed while class ran76 $self->_recheck_settings($conf, $libs, $ccflags, $linkflags, $verbose);77 }78 71 $conf->data->set( HAS_PCRE => $has_pcre); 79 72 80 73 return 1; -
config/auto/readline.pm
38 38 39 39 my $verbose = $conf->options->get('verbose'); 40 40 41 my $cc = $conf->data->get('cc'); 42 my $libs = $conf->data->get('libs'); 43 my $linkflags = $conf->data->get('linkflags'); 44 my $ccflags = $conf->data->get('ccflags'); 45 41 my $cc = $conf->data->get('cc'); 46 42 my $osname = $conf->data->get_p5('OSNAME'); 47 43 48 $self->_add_to_libs( {44 my $extra_libs = $self->_select_lib( { 49 45 conf => $conf, 50 46 osname => $osname, 51 47 cc => $cc, … … 60 56 61 57 $conf->cc_gen('config/auto/readline/readline.in'); 62 58 my $has_readline = 0; 63 eval { $conf->cc_build( ) };59 eval { $conf->cc_build( q{}, $extra_libs ) }; 64 60 if ( !$@ ) { 65 61 if ( $conf->cc_run() ) { 66 62 $has_readline = $self->_evaluate_cc_run($verbose); 67 63 } 68 _handle_readline($conf, $ has_readline);64 _handle_readline($conf, $extra_libs); 69 65 } 70 66 else { 71 _handle_ncurses_need($conf, $osname, $cc); 72 eval { $conf->cc_build() }; 67 # a second chance with ncurses 68 $extra_libs .= ' '; 69 $extra_libs .= $self->_select_lib( { 70 conf => $conf, 71 osname => $osname, 72 cc => $cc, 73 win32_nongcc => 'ncurses.lib', 74 default => '-lncurses', 75 } ); 76 eval { $conf->cc_build( q{}, $extra_libs) }; 73 77 if ( !$@ ) { 74 78 if ( $conf->cc_run() ) { 75 79 $has_readline = $self->_evaluate_cc_run($verbose); 76 80 } 77 _handle_readline($conf, $ has_readline);81 _handle_readline($conf, $extra_libs); 78 82 } 79 83 } 80 unless ($has_readline) { 81 # The Parrot::Configure settings might have changed while class ran 82 $self->_recheck_settings($conf, $libs, $ccflags, $linkflags, $verbose); 83 } 84 $conf->data->set( HAS_READLINE => $has_readline ); 84 85 85 86 return 1; 86 87 } 87 88 88 sub _handle_ncurses_need {89 my ($conf, $osname, $cc) = @_;90 if ( $osname =~ /mswin32/i ) {91 if ( $cc =~ /^gcc/i ) {92 $conf->data->add( ' ', libs => '-lncurses' );93 }94 else {95 $conf->data->add( ' ', libs => 'ncurses.lib' );96 }97 }98 else {99 $conf->data->add( ' ', libs => '-lncurses' );100 }101 return 1;102 }103 104 89 sub _evaluate_cc_run { 105 90 my ($self, $verbose) = @_; 106 91 my $has_readline = 1; … … 110 95 } 111 96 112 97 sub _handle_readline { 113 my ($conf, $has_readline) = @_; 114 $conf->data->set( 115 readline => 'define', 116 HAS_READLINE => $has_readline, 117 ); 98 my ($conf, $libs) = @_; 99 $conf->data->set( readline => 'define' ); 100 $conf->data->add( ' ', libs => $libs ); 118 101 return 1; 119 102 } 120 103 -
config/gen/crypto/digest_pmc.in
23 23 pmclass @md_name@ 24 24 dynpmc 25 25 need_ext 26 group digest_group { 26 group digest_group 27 lib crypto { 27 28 28 29 /* 29 30 -
config/gen/makefiles/dynoplibs_pl.in
78 78 if ($^O =~ /mswin32/i) { 79 79 # Need to put various libraries in the link line. 80 80 $liblist = join( ' ', map { "$_.lib" } keys %$libs ); 81 if ($CC =~ /gcc/i) {82 $liblist =~ s/gdbm\.lib/-llibgdbm/i;83 }84 81 my $extraLibs = '@libs@ @icu_shared@'; 85 82 $extraLibs =~ s/blib/..\\blib/g; 86 83 $extraLibs =~ s/\Q$(A)\E/.lib/g; … … 122 119 my $core_suffix; 123 120 foreach $core_suffix (values %cores) { 124 121 partial_link({}, $_ . "_ops$core_suffix", @objs) foreach (@oplibs); 125 122 } 126 123 } 127 124 elsif ($mode eq 'copy') { 128 125 # Copy *.so -> destination, where destination is the first -
config/gen/makefiles/dynpmc_pl.in
82 82 my $liblist; 83 83 if ($^O =~ /mswin32/i) { 84 84 # Need to put various libraries in the link line. 85 $liblist = join( ' ', map { "$_.lib" } keys %$libs );86 85 if ($CC =~ /gcc/i) { 87 $liblist =~ s/libgdbm\.lib/-llibgdbm/i; 86 $liblist = join( ' ', map { "-l$_" } keys %$libs ); 87 $liblist =~ s/-lgdbm/-llibgdbm/i; 88 88 } 89 else { 90 $liblist = join( ' ', map { "$_.lib" } keys %$libs ); 91 } 89 92 my $extraLibs = '@libs@ @icu_shared@'; 90 93 $extraLibs =~ s/blib/..\\blib/g; 91 94 $extraLibs =~ s/\Q$(A)\E/.lib/g; … … 212 215 213 216 # there can be many libs 214 217 my %libs = %{ $class->{flags}{lib} || {} }; 215 if ($^O eq 'MSWin32' && $CC =~ /^gcc/i) {216 my %newlibs = ();217 $newlibs{"lib$_"} = $libs{$_} for keys %libs;218 %libs = %newlibs;219 }220 218 $pmc_libs{$pmc} = \%libs; 221 219 222 220 # There should be at most a single group -
config/gen/makefiles/root.in
2197 2197 # for use by runtime/parrot/library/OpenGL.pir 2198 2198 $(LIBGLUTCB_SO): $(LIBPARROT) $(SRC_DIR)/glut_callbacks$(O) 2199 2199 $(LD) $(LD_LOAD_FLAGS) $(LDFLAGS) \ 2200 @ld_out@$@ $(SRC_DIR)/glut_callbacks$(O) $(ALL_PARROT_LIBS) 2200 @ld_out@$@ $(SRC_DIR)/glut_callbacks$(O) \ 2201 $(ALL_PARROT_LIBS) @opengl_lib@ 2201 2202 2202 2203 # emacs etags 2203 2204 # this needs exuberant-ctags -
lib/Parrot/Configure/Step/Methods.pm
27 27 28 28 =head1 METHODS 29 29 30 =head2 C<_recheck_settings()>31 32 $self->_recheck_settings($conf, $libs, $ccflags, $linkflags, $verbose);33 34 Currently used in configuration step classes auto::gmp, auto::readline,35 auto::gdbm, and auto::opengl.36 37 =cut38 39 sub _recheck_settings {40 my ($self, $conf, $libs, $ccflags, $linkflags, $verbose) = @_;41 $conf->data->set( 'libs', $libs );42 $conf->data->set( 'ccflags', $ccflags );43 $conf->data->set( 'linkflags', $linkflags );44 print " (no) " if $verbose;45 $self->set_result('no');46 }47 48 30 =head2 C<_handle_darwin_for_fink()> 49 31 50 32 $self->_handle_darwin_for_fink($conf, $libs, $osname, $file); … … 111 93 return 1; 112 94 } 113 95 114 =head2 C<_ add_to_libs()>96 =head2 C<_select_lib()> 115 97 116 $self->_ add_to_libs( {98 $self->_select_lib( { 117 99 conf => $conf, 118 100 osname => $osname, 119 101 cc => $cc, … … 192 174 193 175 =cut 194 176 195 sub _ add_to_libs{177 sub _select_lib { 196 178 my $self = shift; 197 179 my $args = shift; 198 croak "_ add_to_libs() takes hashref: $!" unless ref($args) eq 'HASH';180 croak "_select_lib() takes hashref: $!" unless ref($args) eq 'HASH'; 199 181 my $platform = 200 182 (($args->{osname} =~ /mswin32/i || 201 183 $args->{osname} =~ /cygwin/i) && … … 206 188 my $libs = defined($args->{$platform}) 207 189 ? $args->{$platform} 208 190 : $args->{default}; 209 $args->{conf}->data->add(' ', libs => $libs); 210 return 1; 191 return $libs; 211 192 } 212 193 213 194 sub _add_flags_not_yet_seen { -
t/steps/auto_crypto-01.t
4 4 5 5 use strict; 6 6 use warnings; 7 use Test::More tests => 36;7 use Test::More tests => 24; 8 8 use Carp; 9 9 use lib qw( lib t/configure/testlib ); 10 10 use_ok('config::auto::crypto'); … … 44 44 45 45 $conf->replenish($serialized); 46 46 47 ########## _ add_to_libs() ##########47 ########## _select_lib() ########## 48 48 49 49 ($args, $step_list_ref) = process_options( { 50 50 argv => [ ], … … 57 57 $initial_libs = $conf->data->get('libs'); 58 58 $osname = 'mswin32'; 59 59 $cc = 'gcc'; 60 ok($step->_add_to_libs( {60 is($step->_select_lib( { 61 61 conf => $conf, 62 62 osname => $osname, 63 63 cc => $cc, 64 64 win32_nongcc => 'libcrypto.lib', 65 65 default => '-lcrypto', 66 66 } ), 67 "_add_to_libs() returned true value"); 68 like($conf->data->get('libs'), 69 qr/-lcrypto/, 70 "'libs' attribute modified as expected"); 71 # Restore setting for next test 72 $conf->data->set( libs => $initial_libs ); 67 '-lcrypto', 68 "_select_lib() returned expected value"); 73 69 74 70 $osname = 'mswin32'; 75 71 $cc = 'cc'; 76 ok($step->_add_to_libs( {72 is($step->_select_lib( { 77 73 conf => $conf, 78 74 osname => $osname, 79 75 cc => $cc, 80 76 win32_nongcc => 'libcrypto.lib', 81 77 default => '-lcrypto', 82 78 } ), 83 "_add_to_libs() returned true value"); 84 like($conf->data->get('libs'), 85 qr/libcrypto.lib/, 86 "'libs' attribute modified as expected"); 87 # Restore setting for next test 88 $conf->data->set( libs => $initial_libs ); 79 'libcrypto.lib', 80 "_select_lib() returned expected value"); 89 81 90 82 $osname = 'foobar'; 91 83 $cc = 'cc'; 92 ok($step->_add_to_libs( {84 is($step->_select_lib( { 93 85 conf => $conf, 94 86 osname => $osname, 95 87 cc => $cc, 96 88 win32_nongcc => 'libcrypto.lib', 97 89 default => '-lcrypto', 98 90 } ), 99 "_add_to_libs() returned true value"); 100 like($conf->data->get('libs'), 101 qr/-lcrypto/, 102 "'libs' attribute modified as expected"); 103 # Restore setting for next test 104 $conf->data->set( libs => $initial_libs ); 91 '-lcrypto', 92 "_select_lib() returned expected value"); 105 93 106 my ($libs, $ccflags, $linkflags, $verbose);94 my $verbose = undef; 107 95 108 $libs = q{-lalpha};109 $ccflags = q{-Ibeta};110 $linkflags = q{-Lgamma};111 $verbose = undef;112 $step->_recheck_settings($conf, $libs, $ccflags, $linkflags, $verbose);113 like($conf->data->get('libs'), qr/$libs/,114 "Got expected value for 'libs'");115 like($conf->data->get('ccflags'), qr/$ccflags/,116 "Got expected value for 'ccflags'");117 like($conf->data->get('linkflags'), qr/$linkflags/,118 "Got expected value for 'linkflags'");119 is($step->result, 'no', "Expected result was set");120 121 ########## _recheck_settings() ##########122 123 {124 my $stdout;125 $libs = q{-lalpha};126 $ccflags = q{-Ibeta};127 $linkflags = q{-Lgamma};128 $verbose = 1;129 capture(130 sub { $step->_recheck_settings(131 $conf, $libs, $ccflags, $linkflags, $verbose); },132 \$stdout,133 );134 like($conf->data->get('libs'), qr/$libs/,135 "Got expected value for 'libs'");136 like($conf->data->get('ccflags'), qr/$ccflags/,137 "Got expected value for 'ccflags'");138 like($conf->data->get('linkflags'), qr/$linkflags/,139 "Got expected value for 'linkflags'");140 is($step->result, 'no', "Expected result was set");141 like($stdout, qr/\(no\)/, "Got expected verbose output");142 }143 144 96 $conf->replenish($serialized); 145 97 146 98 ########## --without-crypto; _evaluate_cc_run() ########## -
t/steps/auto_gdbm-01.t
5 5 6 6 use strict; 7 7 use warnings; 8 use Test::More tests => 62;8 use Test::More tests => 47; 9 9 use Carp; 10 10 use Cwd; 11 11 use File::Spec; … … 165 165 166 166 $conf->replenish($serialized); 167 167 168 ########## --without-gdbm; _recheck_settings() ##########169 170 ($args, $step_list_ref) = process_options( {171 argv => [ q{--without-gdbm} ],172 mode => q{configure},173 } );174 rerun_defaults_for_testing($conf, $args );175 $conf->add_steps($pkg);176 $conf->options->set( %{$args} );177 $step = test_step_constructor_and_description($conf);178 179 my ($libs, $ccflags, $linkflags);180 181 $libs = q{-lalpha};182 $ccflags = q{-Ibeta};183 $linkflags = q{-Lgamma};184 $verbose = undef;185 $step->_recheck_settings($conf, $libs, $ccflags, $linkflags, $verbose);186 like($conf->data->get('libs'), qr/$libs/,187 "Got expected value for 'libs'");188 like($conf->data->get('ccflags'), qr/$ccflags/,189 "Got expected value for 'ccflags'");190 like($conf->data->get('linkflags'), qr/$linkflags/,191 "Got expected value for 'linkflags'");192 is($step->result, 'no', "Expected result was set");193 194 {195 my $stdout;196 $libs = q{-lalpha};197 $ccflags = q{-Ibeta};198 $linkflags = q{-Lgamma};199 $verbose = 1;200 capture(201 sub { $step->_recheck_settings(202 $conf, $libs, $ccflags, $linkflags, $verbose); },203 \$stdout,204 );205 like($conf->data->get('libs'), qr/$libs/,206 "Got expected value for 'libs'");207 like($conf->data->get('ccflags'), qr/$ccflags/,208 "Got expected value for 'ccflags'");209 like($conf->data->get('linkflags'), qr/$linkflags/,210 "Got expected value for 'linkflags'");211 is($step->result, 'no', "Expected result was set");212 like($stdout, qr/\(no\)/, "Got expected verbose output");213 }214 215 168 pass("Completed all tests in $0"); 216 169 217 170 ################### DOCUMENTATION ################### -
t/steps/auto_gettext-01.t
5 5 6 6 use strict; 7 7 use warnings; 8 use Test::More tests => 3 4;8 use Test::More tests => 30; 9 9 use Carp; 10 10 use lib qw( lib t/configure/testlib ); 11 11 use_ok('config::auto::gettext'); … … 45 45 46 46 $conf->replenish($serialized); 47 47 48 ########## _ add_to_libs() ##########48 ########## _select_lib() ########## 49 49 50 50 ($args, $step_list_ref) = process_options( { 51 51 argv => [ ], … … 59 59 $osname = 'mswin32'; 60 60 $cc = 'gcc'; 61 61 $initial_value = $conf->data->get( 'libs' ); 62 ok($step->_add_to_libs( {62 is($step->_select_lib( { 63 63 conf => $conf, 64 64 osname => $osname, 65 65 cc => $cc, … … 67 67 win32_nongcc => 'intl.lib', 68 68 default => defined $conf->data->get('glibc') ? '' : '-lintl', 69 69 } ), 70 "_add_to_libs() returned true value"); 71 like($conf->data->get( 'libs' ), qr/-lintl/, 72 "'libs' modified as expected"); 73 # Restore value for next test. 74 $conf->data->set( 'libs' => $initial_value ); 70 '-lintl', 71 "_select_lib() returned expected value"); 75 72 76 73 $osname = 'mswin32'; 77 74 $cc = 'cc'; 78 ok($step->_add_to_libs( {75 is($step->_select_lib( { 79 76 conf => $conf, 80 77 osname => $osname, 81 78 cc => $cc, … … 83 80 win32_nongcc => 'intl.lib', 84 81 default => defined $conf->data->get('glibc') ? '' : '-lintl', 85 82 } ), 86 "_add_to_libs() returned true value"); 87 like($conf->data->get( 'libs' ), qr/intl.lib/, 88 "'libs' modified as expected"); 89 # Restore value for next test. 90 $conf->data->set( 'libs' => $initial_value ); 83 'intl.lib', 84 "_select_lib() returned expected value"); 91 85 92 86 $osname = 'foobar'; 93 87 $cc = 'cc'; 94 88 $conf->data->set( glibc => 1 ); 95 ok($step->_add_to_libs( {89 isnt($step->_select_lib( { 96 90 conf => $conf, 97 91 osname => $osname, 98 92 cc => $cc, … … 100 94 win32_nongcc => 'intl.lib', 101 95 default => defined $conf->data->get('glibc') ? '' : '-lintl', 102 96 } ), 103 "_add_to_libs() returned true value"); 104 unlike($conf->data->get( 'libs' ), qr/-lintl/, 105 "'libs' modified as expected"); 106 # Restore value for next test. 107 $conf->data->set( 'libs' => $initial_value ); 97 '-lintl', 98 "_select_lib() returned expected value"); 108 99 109 100 $osname = 'foobar'; 110 101 $cc = 'cc'; 111 102 $conf->data->set( glibc => undef ); 112 ok($step->_add_to_libs( {103 is($step->_select_lib( { 113 104 conf => $conf, 114 105 osname => $osname, 115 106 cc => $cc, … … 117 108 win32_nongcc => 'intl.lib', 118 109 default => defined $conf->data->get('glibc') ? '' : '-lintl', 119 110 } ), 120 "_add_to_libs() returned true value"); 121 like($conf->data->get( 'libs' ), qr/-lintl/, 122 "'libs' modified as expected"); 111 '-lintl', 112 "_select_lib() returned expected value"); 123 113 124 114 ########## _evaluate_cc_run() ########## 125 115 -
t/steps/auto_gmp-01.t
5 5 6 6 use strict; 7 7 use warnings; 8 use Test::More tests => 73;8 use Test::More tests => 61; 9 9 use Carp; 10 10 use Cwd; 11 11 use File::Spec; … … 55 55 56 56 $conf->replenish($serialized); 57 57 58 ########### _ add_to_libs() ###########58 ########### _select_lib() ########### 59 59 60 60 ($args, $step_list_ref) = process_options( { 61 61 argv => [ ], … … 68 68 $osname = 'mswin32'; 69 69 $cc = 'gcc'; 70 70 $initial_value = $conf->data->get( 'libs' ); 71 ok($step->_add_to_libs( {71 is($step->_select_lib( { 72 72 conf => $conf, 73 73 osname => $osname, 74 74 cc => $cc, 75 75 win32_nongcc => 'gmp.lib', 76 76 default => '-lgmp', 77 77 } ), 78 "_add_to_libs() returned true value"); 79 like($conf->data->get( 'libs' ), qr/-lgmp/, 80 "'libs' modified as expected"); 81 # Restore value for next test. 82 $conf->data->set( 'libs' => $initial_value ); 78 '-lgmp', 79 "_select_lib() returned expected value"); 83 80 84 81 $osname = 'mswin32'; 85 82 $cc = 'cc'; 86 ok($step->_add_to_libs( {83 is($step->_select_lib( { 87 84 conf => $conf, 88 85 osname => $osname, 89 86 cc => $cc, 90 87 win32_nongcc => 'gmp.lib', 91 88 default => '-lgmp', 92 89 } ), 93 "_add_to_libs() returned true value"); 94 like($conf->data->get( 'libs' ), qr/gmp\.lib/, 95 "'libs' modified as expected"); 96 # Restore value for next test. 97 $conf->data->set( 'libs' => $initial_value ); 90 'gmp.lib', 91 "_select_lib() returned expected value"); 98 92 99 93 $osname = 'foobar'; 100 94 $cc = undef; 101 ok($step->_add_to_libs( {95 is($step->_select_lib( { 102 96 conf => $conf, 103 97 osname => $osname, 104 98 cc => $cc, 105 99 win32_nongcc => 'gmp.lib', 106 100 default => '-lgmp', 107 101 } ), 108 "_handle_mswin32() returned true value"); 109 like($conf->data->get( 'libs' ), qr/-lgmp/, 110 "'libs' modified as expected"); 111 # Restore value for next test. 112 $conf->data->set( 'libs' => $initial_value ); 102 '-lgmp', 103 "_select_lib() returned expected value"); 113 104 114 105 ########### _handle_darwin_for_fink() ########### 115 106 … … 219 210 $step->set_result(undef); 220 211 } 221 212 222 ########### _recheck_settings() ###########223 224 my ($libs, $ccflags, $linkflags);225 226 $libs = q{-lalpha};227 $ccflags = q{-Ibeta};228 $linkflags = q{-Lgamma};229 $verbose = undef;230 $step->_recheck_settings($conf, $libs, $ccflags, $linkflags, $verbose);231 like($conf->data->get('libs'), qr/$libs/,232 "Got expected value for 'libs'");233 like($conf->data->get('ccflags'), qr/$ccflags/,234 "Got expected value for 'ccflags'");235 like($conf->data->get('linkflags'), qr/$linkflags/,236 "Got expected value for 'linkflags'");237 is($step->result, 'no', "Expected result was set");238 239 {240 my $stdout;241 $libs = q{-lalpha};242 $ccflags = q{-Ibeta};243 $linkflags = q{-Lgamma};244 $verbose = 1;245 capture(246 sub { $step->_recheck_settings(247 $conf, $libs, $ccflags, $linkflags, $verbose); },248 \$stdout,249 );250 like($conf->data->get('libs'), qr/$libs/,251 "Got expected value for 'libs'");252 like($conf->data->get('ccflags'), qr/$ccflags/,253 "Got expected value for 'ccflags'");254 like($conf->data->get('linkflags'), qr/$linkflags/,255 "Got expected value for 'linkflags'");256 is($step->result, 'no', "Expected result was set");257 like($stdout, qr/\(no\)/, "Got expected verbose output");258 }259 260 $conf->replenish($serialized);261 262 213 ########### _handle_darwin_for_fink() ########### 263 214 264 215 ($args, $step_list_ref) = process_options( { -
t/steps/auto_opengl-01.t
5 5 6 6 use strict; 7 7 use warnings; 8 use Test::More tests => 4 7;8 use Test::More tests => 43; 9 9 use Carp; 10 10 use lib qw( lib ); 11 11 use_ok('config::init::defaults'); … … 46 46 47 47 $conf->replenish($serialized); 48 48 49 ########## _ add_to_libs() ##########49 ########## _select_lib() ########## 50 50 51 51 ($args, $step_list_ref) = process_options( 52 52 { … … 64 64 $initial_libs = $conf->data->get('libs'); 65 65 $osname = 'mswin32'; 66 66 $cc = 'gcc'; 67 ok($step->_add_to_libs( {67 is($step->_select_lib( { 68 68 conf => $conf, 69 69 osname => $osname, 70 70 cc => $cc, … … 73 73 darwin => '-framework OpenGL -framework GLUT', 74 74 default => '-lglut -lGLU -lGL', 75 75 } ), 76 "_add_to_libs() returned true value"); 77 like($conf->data->get('libs'), 78 qr/-lglut32 -lglu32 -lopengl32/, 79 "'libs' attribute modified as expected"); 80 # Restore setting for next test 81 $conf->data->set( libs => $initial_libs ); 76 '-lglut32 -lglu32 -lopengl32', 77 "_select_lib() returned expected value"); 82 78 83 79 $osname = 'mswin32'; 84 80 $cc = 'cc'; 85 81 $initial_libs = $conf->data->get('libs'); 86 ok($step->_add_to_libs( {82 is($step->_select_lib( { 87 83 conf => $conf, 88 84 osname => $osname, 89 85 cc => $cc, … … 92 88 darwin => '-framework OpenGL -framework GLUT', 93 89 default => '-lglut -lGLU -lGL', 94 90 } ), 95 "_add_to_libs() returned true value"); 96 like($conf->data->get('libs'), 97 qr/glut.lib glu.lib gl.lib/, 98 "'libs' attribute modified as expected"); 99 # Restore setting for next test 100 $conf->data->set( libs => $initial_libs ); 91 'glut.lib glu.lib gl.lib', 92 "_select_lib() returned expected value"); 101 93 102 94 $osname = 'darwin'; 103 95 $cc = 'cc'; 104 96 $initial_libs = $conf->data->get('libs'); 105 ok($step->_add_to_libs( {97 is($step->_select_lib( { 106 98 conf => $conf, 107 99 osname => $osname, 108 100 cc => $cc, … … 111 103 darwin => '-framework OpenGL -framework GLUT', 112 104 default => '-lglut -lGLU -lGL', 113 105 } ), 114 "_add_to_libs() returned true value"); 115 like($conf->data->get('libs'), 116 qr/-framework OpenGL -framework GLUT/, 117 "'libs' attribute modified as expected"); 118 # Restore setting for next test 119 $conf->data->set( libs => $initial_libs ); 106 '-framework OpenGL -framework GLUT', 107 "_select_lib() returned expected value"); 120 108 121 109 $osname = 'foobar'; 122 110 $cc = 'cc'; 123 111 $initial_libs = $conf->data->get('libs'); 124 ok($step->_add_to_libs( {112 is($step->_select_lib( { 125 113 conf => $conf, 126 114 osname => $osname, 127 115 cc => $cc, … … 130 118 darwin => '-framework OpenGL -framework GLUT', 131 119 default => '-lglut -lGLU -lGL', 132 120 } ), 133 "_add_to_libs() returned true value"); 134 like($conf->data->get('libs'), 135 qr/-lglut -lGLU -lGL/, 136 "'libs' attribute modified as expected"); 137 # Restore setting for next test 138 $conf->data->set( libs => $initial_libs ); 121 '-lglut -lGLU -lGL', 122 "_select_lib() returned expected value"); 139 123 140 124 $conf->replenish($serialized); 141 125 … … 200 184 { 201 185 my $glut_api_version = '4'; 202 186 my $glut_brand = 'freeglut'; 203 ok(auto::opengl::_handle_glut( $conf, $glut_api_version, $glut_brand ),187 ok(auto::opengl::_handle_glut( $conf, 'lib', $glut_api_version, $glut_brand ), 204 188 "_handle_glut() returned true value"); 205 189 is( $conf->data->get( 'opengl' ), 'define', 206 190 "Got expected value for opengl"); -
t/steps/auto_pcre-01.t
5 5 6 6 use strict; 7 7 use warnings; 8 use Test::More tests => 44;8 use Test::More tests => 34; 9 9 use Carp; 10 10 use lib qw( lib ); 11 11 use_ok('config::init::defaults'); … … 46 46 47 47 $conf->replenish($serialized); 48 48 49 ########## _ add_to_libs() ##########49 ########## _select_lib() ########## 50 50 51 51 ($args, $step_list_ref) = process_options( { 52 52 argv => [ ], … … 63 63 $osname = 'mswin32'; 64 64 $cc = 'gcc'; 65 65 $initial_value = $conf->data->get( 'libs' ); 66 ok($step->_add_to_libs( {66 is($step->_select_lib( { 67 67 conf => $conf, 68 68 osname => $osname, 69 69 cc => $cc, 70 70 win32_nongcc => 'pcre.lib', 71 71 default => '-lpcre', 72 72 } ), 73 "_add_to_libs() returned true value"); 74 like($conf->data->get( 'libs' ), qr/-lpcre/, 75 "'libs' modified as expected"); 76 # Restore value for next test. 77 $conf->data->set( 'libs' => $initial_value ); 73 '-lpcre', 74 "_select_lib() returned expected value"); 78 75 79 76 $osname = 'mswin32'; 80 77 $cc = 'cc'; 81 78 $initial_value = $conf->data->get( 'libs' ); 82 ok($step->_add_to_libs( {79 is($step->_select_lib( { 83 80 conf => $conf, 84 81 osname => $osname, 85 82 cc => $cc, 86 83 win32_nongcc => 'pcre.lib', 87 84 default => '-lpcre', 88 85 } ), 89 "_add_to_libs() returned true value"); 90 like($conf->data->get( 'libs' ), qr/pcre\.lib/, 91 "'libs' modified as expected"); 92 # Restore value for next test. 93 $conf->data->set( 'libs' => $initial_value ); 86 'pcre.lib', 87 "_select_lib() returned expected value"); 94 88 95 89 $osname = 'foobar'; 96 90 $cc = 'gcc'; 97 91 $initial_value = $conf->data->get( 'libs' ); 98 ok($step->_add_to_libs( {92 is($step->_select_lib( { 99 93 conf => $conf, 100 94 osname => $osname, 101 95 cc => $cc, 102 96 win32_nongcc => 'pcre.lib', 103 97 default => '-lpcre', 104 98 } ), 105 "_add_to_libs() returned true value"); 106 like($conf->data->get( 'libs' ), qr/-lpcre/, 107 "'libs' modified as expected"); 108 # Restore value for next test. 109 $conf->data->set( 'libs' => $initial_value ); 99 '-lpcre', 100 "_select_lib() returned expected value"); 110 101 111 102 ########## _evaluate_cc_run() ########## 112 103 … … 123 114 "_evaluate_cc_run returned true value as expected"); 124 115 is($step->result(), q{yes, 4.1}, "Got expected PCRE version"); 125 116 126 # Mock different outcomes of _recheck_settings()127 my ($libs, $ccflags, $linkflags);128 129 $libs = q{-lalpha};130 $ccflags = q{-Ibeta};131 $linkflags = q{-Lgamma};132 $verbose = undef;133 $step->_recheck_settings($conf, $libs, $ccflags, $linkflags, $verbose);134 like($conf->data->get('libs'), qr/$libs/,135 "Got expected value for 'libs'");136 like($conf->data->get('ccflags'), qr/$ccflags/,137 "Got expected value for 'ccflags'");138 like($conf->data->get('linkflags'), qr/$linkflags/,139 "Got expected value for 'linkflags'");140 141 117 $conf->replenish($serialized); 142 118 143 119 ########## --verbose; _evaluate_cc_run() ########## … … 168 144 like($stdout, qr/\(yes, 4\.0\)/, "Got expected verbose output"); 169 145 } 170 146 171 # Mock different outcomes of _recheck_settings()172 $libs = q{-ldelta};173 $ccflags = q{-Iepsilon};174 $linkflags = q{-Lzeta};175 {176 my ($stdout, $stderr);177 capture(178 sub { $step->_recheck_settings(179 $conf, $libs, $ccflags, $linkflags, $verbose); },180 \$stdout,181 );182 like($conf->data->get('libs'), qr/$libs/,183 "Got expected value for 'libs'");184 like($conf->data->get('ccflags'), qr/$ccflags/,185 "Got expected value for 'ccflags'");186 like($conf->data->get('linkflags'), qr/$linkflags/,187 "Got expected value for 'linkflags'");188 like($stdout, qr/\(no\)/, "Got expected verbose output");189 }190 191 147 pass("Completed all tests in $0"); 192 148 193 149 ################### DOCUMENTATION ################### -
t/steps/auto_readline-01.t
5 5 6 6 use strict; 7 7 use warnings; 8 use Test::More tests => 72;8 use Test::More tests => 69; 9 9 use Carp; 10 10 use Cwd; 11 11 use File::Spec; … … 21 21 ); 22 22 use IO::CaptureOutput qw | capture |; 23 23 24 ########## _ add_to_libs() ##########24 ########## _select_lib() ########## 25 25 26 26 my ($args, $step_list_ref) = process_options( 27 27 { … … 44 44 my ($osname, $cc); 45 45 $osname = 'mswin32'; 46 46 $cc = 'gcc'; 47 ok($step->_add_to_libs( {47 is($step->_select_lib( { 48 48 conf => $conf, 49 49 osname => $osname, 50 50 cc => $cc, 51 51 win32_nongcc => 'readline.lib', 52 52 default => '-lreadline', 53 53 } ), 54 "_add_to_libs() returned true value"); 55 like($conf->data->get( 'libs' ), qr/-lreadline/, 56 "'libs' modified as expected"); 54 '-lreadline', 55 "_select_lib() returned expected value"); 57 56 58 57 $osname = 'mswin32'; 59 58 $cc = 'cc'; 60 ok($step->_add_to_libs( {59 is($step->_select_lib( { 61 60 conf => $conf, 62 61 osname => $osname, 63 62 cc => $cc, 64 63 win32_nongcc => 'readline.lib', 65 64 default => '-lreadline', 66 65 } ), 67 "_add_to_libs() returned true value"); 68 like($conf->data->get( 'libs' ), qr/readline\.lib/, 69 "'libs' modified as expected"); 66 'readline.lib', 67 "_select_lib() returned expected value"); 70 68 71 69 $osname = 'foobar'; 72 70 $cc = undef; 73 ok($step->_add_to_libs( {71 is($step->_select_lib( { 74 72 conf => $conf, 75 73 osname => $osname, 76 74 cc => $cc, 77 75 win32_nongcc => 'readline.lib', 78 76 default => '-lreadline', 79 77 } ), 80 "_add_to_libs() returned true value"); 81 like($conf->data->get( 'libs' ), qr/-lreadline/, 82 "'libs' modified as expected"); 78 '-lreadline', 79 "_select_lib() returned true value"); 83 80 84 81 $osname = 'foobar'; 85 82 $cc = undef; 86 83 eval { 87 $step->_ add_to_libs( [84 $step->_select_lib( [ 88 85 conf => $conf, 89 86 osname => $osname, 90 87 cc => $cc, … … 92 89 default => '-lreadline', 93 90 ] ); 94 91 }; 95 like($@, qr/_ add_to_libs\(\) takes hashref/,96 "Bad argument to _ add_to_libscorrectly detected");92 like($@, qr/_select_lib\(\) takes hashref/, 93 "Bad argument to _select_lib correctly detected"); 97 94 98 95 ########## _handle_darwin_for_fink() ########## 99 96 -
t/steps/auto_readline-02.t
5 5 6 6 use strict; 7 7 use warnings; 8 use Test::More tests => 31;8 use Test::More tests => 14; 9 9 use Carp; 10 10 use Cwd; 11 11 use lib qw( lib ); … … 61 61 ########## _handle_readline() ########## 62 62 63 63 $has_readline = 0; 64 ok(auto::readline::_handle_readline($conf, $has_readline),64 ok(auto::readline::_handle_readline($conf, 'lib', $has_readline), 65 65 "_handle_readline() returned true value"); 66 66 is($conf->data->get('readline'), 'define', 67 67 "Got expected value for 'readline'"); 68 is($conf->data->get('HAS_READLINE'), 0,69 "Got expected value for 'HAS_READLINE'");70 68 # Prepare for next test 71 69 $conf->data->set( readline => undef ); 72 70 $conf->data->set( HAS_READLINE => undef ); 73 71 74 72 $has_readline = 1; 75 ok(auto::readline::_handle_readline($conf, $has_readline),73 ok(auto::readline::_handle_readline($conf, 'lib', $has_readline), 76 74 "_handle_readline() returned true value"); 77 75 is($conf->data->get('readline'), 'define', 78 76 "Got expected value for 'readline'"); 79 is($conf->data->get('HAS_READLINE'), 1,80 "Got expected value for 'HAS_READLINE'");81 77 # Prepare for next test 82 78 $conf->data->set( readline => undef ); 83 79 $conf->data->set( HAS_READLINE => undef ); 84 80 85 ########## _handle_ncurses_need() ##########86 87 my ($osname, $cc);88 my ($libs, $newlibs);89 90 $libs = q{-lalpha};91 $osname = q{mswin32};92 $cc = q{gcc};93 $conf->data->set( libs => $libs );94 ok(auto::readline::_handle_ncurses_need($conf, $osname, $cc),95 "_handle_ncurses_need() returned true value");96 $newlibs = $conf->data->get( 'libs' );97 like(98 $newlibs,99 qr/\s+-lncurses/,100 "Value expected for $osname, $cc added to 'libs'"101 );102 $conf->data->set( libs => undef );103 104 $libs = q{-lalpha};105 $osname = q{mswin32};106 $cc = q{cc};107 $conf->data->set( libs => $libs );108 ok(auto::readline::_handle_ncurses_need($conf, $osname, $cc),109 "_handle_ncurses_need() returned true value");110 $newlibs = $conf->data->get( 'libs' );111 like(112 $newlibs,113 qr/\s+ncurses\.lib/,114 "Value expected for $osname, $cc added to 'libs'"115 );116 $conf->data->set( libs => undef );117 118 $libs = q{-lalpha};119 $osname = q{linux};120 $cc = q{gcc};121 $conf->data->set( libs => $libs );122 ok(auto::readline::_handle_ncurses_need($conf, $osname, $cc),123 "_handle_ncurses_need() returned true value");124 $newlibs = $conf->data->get( 'libs' );125 like(126 $newlibs,127 qr/\s+-lncurses/,128 "Value expected for $osname, $cc added to 'libs'"129 );130 $conf->data->set( libs => undef );131 132 ########## _recheck_settings() ##########133 134 my ($ccflags, $linkflags);135 136 $libs = q{-lalpha};137 $ccflags = q{-Ibeta};138 $linkflags = q{-Lgamma};139 $verbose = undef;140 $step->_recheck_settings($conf, $libs, $ccflags, $linkflags, $verbose);141 like($conf->data->get('libs'), qr/$libs/,142 "Got expected value for 'libs'");143 like($conf->data->get('ccflags'), qr/$ccflags/,144 "Got expected value for 'ccflags'");145 like($conf->data->get('linkflags'), qr/$linkflags/,146 "Got expected value for 'linkflags'");147 is($step->result, 'no', "Expected result was set");148 149 {150 my $stdout;151 $libs = q{-lalpha};152 $ccflags = q{-Ibeta};153 $linkflags = q{-Lgamma};154 $verbose = 1;155 capture(156 sub { $step->_recheck_settings(157 $conf, $libs, $ccflags, $linkflags, $verbose); },158 \$stdout,159 );160 like($conf->data->get('libs'), qr/$libs/,161 "Got expected value for 'libs'");162 like($conf->data->get('ccflags'), qr/$ccflags/,163 "Got expected value for 'ccflags'");164 like($conf->data->get('linkflags'), qr/$linkflags/,165 "Got expected value for 'linkflags'");166 is($step->result, 'no', "Expected result was set");167 like($stdout, qr/\(no\)/, "Got expected verbose output");168 }169 170 81 pass("Completed all tests in $0"); 171 82 172 83 ################### DOCUMENTATION ###################