develooper Front page | perl.cvs.parrot | Postings from January 2009

[svn:parrot] r35899 - in trunk: config/auto config/gen/crypto config/gen/makefiles lib/Parrot/Configure/Step t/steps

From:
fperrad
Date:
January 22, 2009 15:24
Subject:
[svn:parrot] r35899 - in trunk: config/auto config/gen/crypto config/gen/makefiles lib/Parrot/Configure/Step t/steps
Message ID:
20090122232333.8992DCB9AE@x12.develooper.com
Author: fperrad
Date: Thu Jan 22 15:23:31 2009
New Revision: 35899

Modified:
   trunk/config/auto/crypto.pm
   trunk/config/auto/gdbm.pm
   trunk/config/auto/gettext.pm
   trunk/config/auto/gmp.pm
   trunk/config/auto/opengl.pm
   trunk/config/auto/pcre.pm
   trunk/config/auto/readline.pm
   trunk/config/gen/crypto/digest_pmc.in
   trunk/config/gen/makefiles/dynoplibs_pl.in
   trunk/config/gen/makefiles/dynpmc_pl.in
   trunk/config/gen/makefiles/root.in
   trunk/lib/Parrot/Configure/Step/Methods.pm
   trunk/t/steps/auto_crypto-01.t
   trunk/t/steps/auto_gdbm-01.t
   trunk/t/steps/auto_gettext-01.t
   trunk/t/steps/auto_gmp-01.t
   trunk/t/steps/auto_opengl-01.t
   trunk/t/steps/auto_pcre-01.t
   trunk/t/steps/auto_readline-01.t
   trunk/t/steps/auto_readline-02.t

Log:
[configure] apply patch from TT #119
Many libraries are only used by PMC or via NCI. 
So, don't put them in @libs@, we don't need them to link parrot executable & shared lib.



Modified: trunk/config/auto/crypto.pm
==============================================================================
--- trunk/config/auto/crypto.pm	(original)
+++ trunk/config/auto/crypto.pm	Thu Jan 22 15:23:31 2009
@@ -7,6 +7,8 @@
 
 =head1 DESCRIPTION
 
+This library is linked to a dynamic PMC.
+
 See L<http://www.openssl.org>
 
 =cut
@@ -45,32 +47,23 @@
         return 1;
     }
 
-    my $cc        = $conf->data->get('cc');
-    my $libs      = $conf->data->get('libs');
-    my $linkflags = $conf->data->get('linkflags');
-    my $ccflags   = $conf->data->get('ccflags');
-
     my $osname = $conf->data->get_p5('OSNAME');
 
-    $self->_add_to_libs( {
+    my $extra_libs = $self->_select_lib( {
         conf            => $conf,
         osname          => $osname,
-        cc              => $cc,
+        cc              => $conf->data->get('cc'),
         win32_nongcc    => 'libcrypto.lib',
         default         => '-lcrypto',
     } );
 
     $conf->cc_gen('config/auto/crypto/crypto.in');
-    eval { $conf->cc_build(); };
+    eval { $conf->cc_build( q{}, $extra_libs); };
     my $has_crypto = 0;
     if ( !$@ ) {
         my $test = $conf->cc_run();
         $has_crypto = $self->_evaluate_cc_run($conf, $test, $has_crypto, $verbose);
     }
-    unless ($has_crypto) {
-        # The Parrot::Configure settings might have changed while class ran
-        $self->_recheck_settings($conf, $libs, $ccflags, $linkflags, $verbose);
-    }
     $conf->data->set( has_crypto => $has_crypto );    # for dynpmc.in & digest.t
 
     return 1;

Modified: trunk/config/auto/gdbm.pm
==============================================================================
--- trunk/config/auto/gdbm.pm	(original)
+++ trunk/config/auto/gdbm.pm	Thu Jan 22 15:23:31 2009
@@ -50,39 +50,29 @@
         return 1;
     }
 
-    my $cc        = $conf->data->get('cc');
-    my $libs      = $conf->data->get('libs');
-    my $linkflags = $conf->data->get('linkflags');
-    my $ccflags   = $conf->data->get('ccflags');
-
     my $osname = $conf->data->get_p5('OSNAME');
 
+    my $extra_libs = $self->_select_lib( {
+        conf            => $conf,
+        osname          => $osname,
+        cc              => $conf->data->get('cc'),
+        win32_gcc       => '-llibgdbm',
+        win32_nongcc    => 'gdbm.lib',
+        default         => '-lgdbm',
+    } );
+
     # On OS X check the presence of the gdbm header in the standard
     # Fink location.
     $self->_handle_darwin_for_fink($conf, $osname, 'gdbm.h');
 
     $conf->cc_gen('config/auto/gdbm/gdbm.in');
-    if ( $osname =~ /mswin32/i ) {
-        if ( $cc =~ /^gcc/i ) {
-            eval { $conf->cc_build( '', '-llibgdbm' ); };
-        }
-        else {
-            eval { $conf->cc_build( '', 'gdbm.lib' ); };
-        }
-    }
-    else {
-        eval { $conf->cc_build( '', '-lgdbm' ); };
-    }
+    eval { $conf->cc_build( q{}, $extra_libs ); };
     my $has_gdbm = 0;
     if ( !$@ ) {
         my $test = $conf->cc_run();
         unlink "gdbm_test_db";
         $has_gdbm = $self->_evaluate_cc_run($test, $has_gdbm, $verbose);
     }
-    unless ($has_gdbm) {
-        # The Parrot::Configure settings might have changed while class ran
-        $self->_recheck_settings($conf, $libs, $ccflags, $linkflags, $verbose);
-    }
     $conf->data->set( has_gdbm => $has_gdbm );    # for gdbmhash.t and dynpmc.in
 
     return 1;

Modified: trunk/config/auto/gettext.pm
==============================================================================
--- trunk/config/auto/gettext.pm	(original)
+++ trunk/config/auto/gettext.pm	Thu Jan 22 15:23:31 2009
@@ -50,17 +50,12 @@
         return 1;
     }
 
-    my $cc        = $conf->data->get('cc');
-    my $libs      = $conf->data->get('libs');
-    my $linkflags = $conf->data->get('linkflags');
-    my $ccflags   = $conf->data->get('ccflags');
-
     my $osname = $conf->data->get_p5('OSNAME');
 
-    $self->_add_to_libs( {
+    my $extra_libs = $self->_select_lib( {
         conf            => $conf,
         osname          => $osname,
-        cc              => $cc,
+        cc              => $conf->data->get('cc'),
         win32_gcc       => '-lintl',
         win32_nongcc    => 'intl.lib',
         default         => defined $conf->data->get('glibc') ? '' : '-lintl',
@@ -71,18 +66,14 @@
     $self->_handle_darwin_for_fink($conf, $osname, 'libintl.h');
 
     $conf->cc_gen('config/auto/gettext/gettext.in');
-    eval { $conf->cc_build(); };
-    my $has_gettext;
+    eval { $conf->cc_build( q{}, $extra_libs ); };
+    my $has_gettext = 0;
     if ( !$@ ) {
         my $test = $conf->cc_run();
         $has_gettext = $self->_evaluate_cc_run($test, $verbose);
     }
     if ($has_gettext) {
-        _handle_gettext($conf, $verbose);
-    }
-    else {
-        # The Parrot::Configure settings might have changed while class ran
-        $self->_recheck_settings($conf, $libs, $ccflags, $linkflags, $verbose);
+        _handle_gettext($conf, $verbose, $extra_libs);
     }
     $conf->data->set( HAS_GETTEXT => $has_gettext );
 
@@ -102,8 +93,9 @@
 }
 
 sub _handle_gettext {
-    my ($conf, $verbose) = @_;
+    my ($conf, $verbose, $libs) = @_;
     $conf->data->add( ' ', ccflags => "-DHAS_GETTEXT" );
+    $conf->data->add( ' ', libs => $libs );
     $verbose and print "\n  ccflags: ", $conf->data->get("ccflags"), "\n";
     return 1;
 }

Modified: trunk/config/auto/gmp.pm
==============================================================================
--- trunk/config/auto/gmp.pm	(original)
+++ trunk/config/auto/gmp.pm	Thu Jan 22 15:23:31 2009
@@ -56,17 +56,12 @@
         return 1;
     }
 
-    my $cc        = $conf->data->get('cc');
-    my $libs      = $conf->data->get('libs');
-    my $linkflags = $conf->data->get('linkflags');
-    my $ccflags   = $conf->data->get('ccflags');
+    my $osname = $conf->data->get_p5('OSNAME');
 
-    my $osname    = $conf->data->get_p5('OSNAME');
-
-    $self->_add_to_libs( {
+    my $extra_libs = $self->_select_lib( {
         conf            => $conf,
         osname          => $osname,
-        cc              => $cc,
+        cc              => $conf->data->get('cc'),
         win32_nongcc    => 'gmp.lib',
         default         => '-lgmp',
     } );
@@ -77,15 +72,14 @@
     $self->_handle_darwin_for_macports($conf, $osname, 'gmp.h');
 
     $conf->cc_gen('config/auto/gmp/gmp.in');
-    eval { $conf->cc_build(); };
+    eval { $conf->cc_build( q{}, $extra_libs); };
     my $has_gmp = 0;
     if ( !$@ ) {
         my $test = $conf->cc_run();
         $has_gmp = $self->_evaluate_cc_run( $conf, $test, $has_gmp, $verbose );
     }
-    unless ($has_gmp) {
-        # The Parrot::Configure settings might have changed while class ran
-        $self->_recheck_settings($conf, $libs, $ccflags, $linkflags, $verbose);
+    if ($has_gmp) {
+        $conf->data->add( ' ', libs => $extra_libs );
     }
 
     return 1;

Modified: trunk/config/auto/opengl.pm
==============================================================================
--- trunk/config/auto/opengl.pm	(original)
+++ trunk/config/auto/opengl.pm	Thu Jan 22 15:23:31 2009
@@ -18,7 +18,6 @@
 the steps needed to add OpenGL support for each platform for which we have
 received this information -- details for additional platforms are welcome!
 
-
 =head2 Mac OS X
 
 You will need to install the F<OpenGL Framework> and the F<GLUT Framework>.
@@ -163,18 +162,12 @@
         return 1;
     }
 
-    my $cc        = $conf->data->get('cc');
-    my $libs      = $conf->data->get('libs');
-    my $linkflags = $conf->data->get('linkflags');
-    my $ccflags   = $conf->data->get('ccflags');
-
     my $osname = $conf->data->get_p5('OSNAME');
 
-    # Prefer Cygwin/w32api over Cygwin/X, but use X when DISPLAY is set
-    $self->_add_to_libs( {
+    my $extra_libs = $self->_select_lib( {
             conf            => $conf,
             osname          => $osname,
-            cc              => $cc,
+            cc              => $conf->data->get('cc'),
             # Prefer Cygwin/w32api over Cygwin/X, but use X when DISPLAY is set
             ($^O eq 'cygwin') ?
              ($ENV{DISPLAY} ? (cygwin => '-lglut -L/usr/X11R6/lib -lGLU -lGL')
@@ -194,14 +187,10 @@
 
     $conf->cc_gen('config/auto/opengl/opengl.in');
     my $has_glut = 0;
-    eval { $conf->cc_build() };
+    eval { $conf->cc_build( q{}, $extra_libs ) };
     if ( !$@ ) {
         my $test = $conf->cc_run();
-        $has_glut = _handle_glut($conf, $self->_evaluate_cc_run($test, $verbose));
-    }
-    unless ($has_glut) {
-        # The Parrot::Configure settings might have changed while class ran
-        $self->_recheck_settings($conf, $libs, $ccflags, $linkflags, $verbose);
+        $has_glut = _handle_glut($conf, $extra_libs, $self->_evaluate_cc_run($test, $verbose));
     }
 
     return 1;
@@ -218,13 +207,14 @@
 }
 
 sub _handle_glut {
-    my ($conf, $glut_api_version, $glut_brand) = @_;
+    my ($conf, $libs, $glut_api_version, $glut_brand) = @_;
 
     $conf->data->set(
         # Completely cargo culted
         opengl     => 'define',
         has_opengl => 1,
         HAS_OPENGL => 1,
+        opengl_lib => $libs,
 
         glut       => 'define',
         glut_brand => $glut_brand,

Modified: trunk/config/auto/pcre.pm
==============================================================================
--- trunk/config/auto/pcre.pm	(original)
+++ trunk/config/auto/pcre.pm	Thu Jan 22 15:23:31 2009
@@ -9,6 +9,8 @@
 
 Determines whether the platform supports pcre library.
 
+This library is used via NCI mecanism.
+
 =cut
 
 package auto::pcre;
@@ -44,17 +46,12 @@
         return 1;
     }
 
-    my $cc        = $conf->data->get('cc');
-    my $libs      = $conf->data->get('libs');
-    my $linkflags = $conf->data->get('linkflags');
-    my $ccflags   = $conf->data->get('ccflags');
-
     my $osname = $conf->data->get_p5('OSNAME');
 
-    $self->_add_to_libs( {
+    my $extra_libs = $self->_select_lib( {
         conf            => $conf,
         osname          => $osname,
-        cc              => $cc,
+        cc              => $conf->data->get('cc'),
         win32_nongcc    => 'pcre.lib',
         default         => '-lpcre',
     } );
@@ -65,16 +62,12 @@
     $self->_handle_darwin_for_macports($conf, $osname, 'pcre.h');
 
     $conf->cc_gen('config/auto/pcre/pcre.in');
-    eval { $conf->cc_build() };
+    eval { $conf->cc_build( q{}, $extra_libs ) };
     my $has_pcre = 0;
     if ( !$@ ) {
         my $test = $conf->cc_run();
         $has_pcre = $self->_evaluate_cc_run($test, $verbose);
     }
-    if (! $has_pcre) {
-        # The Parrot::Configure settings might have changed while class ran
-        $self->_recheck_settings($conf, $libs, $ccflags, $linkflags, $verbose);
-    }
     $conf->data->set( HAS_PCRE => $has_pcre);
 
     return 1;

Modified: trunk/config/auto/readline.pm
==============================================================================
--- trunk/config/auto/readline.pm	(original)
+++ trunk/config/auto/readline.pm	Thu Jan 22 15:23:31 2009
@@ -38,14 +38,10 @@
 
     my $verbose = $conf->options->get('verbose');
 
-    my $cc        = $conf->data->get('cc');
-    my $libs      = $conf->data->get('libs');
-    my $linkflags = $conf->data->get('linkflags');
-    my $ccflags   = $conf->data->get('ccflags');
-
+    my $cc     = $conf->data->get('cc');
     my $osname = $conf->data->get_p5('OSNAME');
 
-    $self->_add_to_libs( {
+    my $extra_libs = $self->_select_lib( {
         conf            => $conf,
         osname          => $osname,
         cc              => $cc,
@@ -60,44 +56,33 @@
 
     $conf->cc_gen('config/auto/readline/readline.in');
     my $has_readline = 0;
-    eval { $conf->cc_build() };
+    eval { $conf->cc_build( q{}, $extra_libs ) };
     if ( !$@ ) {
         if ( $conf->cc_run() ) {
             $has_readline = $self->_evaluate_cc_run($verbose);
         }
-        _handle_readline($conf, $has_readline);
+        _handle_readline($conf, $extra_libs);
     }
     else {
-        _handle_ncurses_need($conf, $osname, $cc);
-        eval { $conf->cc_build() };
+        # a second chance with ncurses
+        $extra_libs .= ' ';
+        $extra_libs .= $self->_select_lib( {
+            conf            => $conf,
+            osname          => $osname,
+            cc              => $cc,
+            win32_nongcc    => 'ncurses.lib',
+            default         => '-lncurses',
+        } );
+        eval { $conf->cc_build( q{}, $extra_libs) };
         if ( !$@ ) {
             if ( $conf->cc_run() ) {
                 $has_readline = $self->_evaluate_cc_run($verbose);
             }
-            _handle_readline($conf, $has_readline);
+            _handle_readline($conf, $extra_libs);
         }
     }
-    unless ($has_readline) {
-        # The Parrot::Configure settings might have changed while class ran
-        $self->_recheck_settings($conf, $libs, $ccflags, $linkflags, $verbose);
-    }
-
-    return 1;
-}
+    $conf->data->set( HAS_READLINE => $has_readline );
 
-sub _handle_ncurses_need {
-    my ($conf, $osname, $cc) = @_;
-    if ( $osname =~ /mswin32/i ) {
-        if ( $cc =~ /^gcc/i ) {
-            $conf->data->add( ' ', libs => '-lncurses' );
-        }
-        else {
-            $conf->data->add( ' ', libs => 'ncurses.lib' );
-        }
-    }
-    else {
-        $conf->data->add( ' ', libs => '-lncurses' );
-    }
     return 1;
 }
 
@@ -110,11 +95,9 @@
 }
 
 sub _handle_readline {
-    my ($conf, $has_readline) = @_;
-    $conf->data->set(
-        readline     => 'define',
-        HAS_READLINE => $has_readline,
-    );
+    my ($conf, $libs) = @_;
+    $conf->data->set( readline => 'define' );
+    $conf->data->add( ' ', libs => $libs );
     return 1;
 }
 

Modified: trunk/config/gen/crypto/digest_pmc.in
==============================================================================
--- trunk/config/gen/crypto/digest_pmc.in	(original)
+++ trunk/config/gen/crypto/digest_pmc.in	Thu Jan 22 15:23:31 2009
@@ -23,7 +23,8 @@
 pmclass @md_name@
     dynpmc
     need_ext
-    group digest_group {
+    group digest_group
+    lib crypto {
 
 /*
 

Modified: trunk/config/gen/makefiles/dynoplibs_pl.in
==============================================================================
--- trunk/config/gen/makefiles/dynoplibs_pl.in	(original)
+++ trunk/config/gen/makefiles/dynoplibs_pl.in	Thu Jan 22 15:23:31 2009
@@ -78,9 +78,6 @@
     if ($^O =~ /mswin32/i) {
         # Need to put various libraries in the link line.
         $liblist = join( ' ', map { "$_.lib" } keys %$libs );
-        if ($CC =~ /gcc/i) {
-            $liblist =~ s/gdbm\.lib/-llibgdbm/i;
-        }
         my $extraLibs = '@libs@ @icu_shared@';
         $extraLibs =~ s/blib/..\\blib/g;
         $extraLibs =~ s/\Q$(A)\E/.lib/g;
@@ -122,7 +119,7 @@
     my $core_suffix;
     foreach $core_suffix (values %cores) {
         partial_link({}, $_ . "_ops$core_suffix", @objs) foreach (@oplibs);
-     }
+    }
 }
 elsif ($mode eq 'copy') {
     # Copy *.so -> destination, where destination is the first

Modified: trunk/config/gen/makefiles/dynpmc_pl.in
==============================================================================
--- trunk/config/gen/makefiles/dynpmc_pl.in	(original)
+++ trunk/config/gen/makefiles/dynpmc_pl.in	Thu Jan 22 15:23:31 2009
@@ -82,9 +82,12 @@
     my $liblist;
     if ($^O =~ /mswin32/i) {
         # Need to put various libraries in the link line.
-        $liblist = join( ' ', map { "$_.lib" } keys %$libs );
         if ($CC =~ /gcc/i) {
-            $liblist =~ s/libgdbm\.lib/-llibgdbm/i;
+            $liblist = join( ' ', map { "-l$_" } keys %$libs );
+            $liblist =~ s/-lgdbm/-llibgdbm/i;
+        }
+        else {
+            $liblist = join( ' ', map { "$_.lib" } keys %$libs );
         }
         my $extraLibs = '@libs@ @icu_shared@';
         $extraLibs =~ s/blib/..\\blib/g;
@@ -212,11 +215,6 @@
 
         # there can be many libs
         my %libs = %{ $class->{flags}{lib} || {} };
-        if ($^O eq 'MSWin32' && $CC =~ /^gcc/i) {
-            my %newlibs = ();
-            $newlibs{"lib$_"} = $libs{$_} for keys %libs;
-            %libs = %newlibs;
-        }
         $pmc_libs{$pmc} = \%libs;
 
         # There should be at most a single group

Modified: trunk/config/gen/makefiles/root.in
==============================================================================
--- trunk/config/gen/makefiles/root.in	(original)
+++ trunk/config/gen/makefiles/root.in	Thu Jan 22 15:23:31 2009
@@ -2185,7 +2185,8 @@
 # for use by runtime/parrot/library/OpenGL.pir
 $(LIBGLUTCB_SO): $(LIBPARROT) $(SRC_DIR)/glut_callbacks$(O)
 	$(LD) $(LD_LOAD_FLAGS) $(LDFLAGS) \
-    @ld_out@$@ $(SRC_DIR)/glut_callbacks$(O) $(ALL_PARROT_LIBS)
+    @ld_out@$@ $(SRC_DIR)/glut_callbacks$(O) \
+    $(ALL_PARROT_LIBS) @opengl_lib@
 
 # emacs etags
 # this needs exuberant-ctags

Modified: trunk/lib/Parrot/Configure/Step/Methods.pm
==============================================================================
--- trunk/lib/Parrot/Configure/Step/Methods.pm	(original)
+++ trunk/lib/Parrot/Configure/Step/Methods.pm	Thu Jan 22 15:23:31 2009
@@ -27,24 +27,6 @@
 
 =head1 METHODS
 
-=head2 C<_recheck_settings()>
-
-    $self->_recheck_settings($conf, $libs, $ccflags, $linkflags, $verbose);
-
-Currently used in configuration step classes auto::gmp, auto::readline,
-auto::gdbm, and auto::opengl.
-
-=cut
-
-sub _recheck_settings {
-    my ($self, $conf, $libs, $ccflags, $linkflags, $verbose) = @_;
-    $conf->data->set( 'libs',      $libs );
-    $conf->data->set( 'ccflags',   $ccflags );
-    $conf->data->set( 'linkflags', $linkflags );
-    print " (no) " if $verbose;
-    $self->set_result('no');
-}
-
 =head2 C<_handle_darwin_for_fink()>
 
     $self->_handle_darwin_for_fink($conf, $libs, $osname, $file);
@@ -111,9 +93,9 @@
     return 1;
 }
 
-=head2 C<_add_to_libs()>
+=head2 C<_select_lib()>
 
-    $self->_add_to_libs( {
+    $self->_select_lib( {
         conf            => $conf,
         osname          => $osname,
         cc              => $cc,
@@ -201,10 +183,10 @@
 
 =cut
 
-sub _add_to_libs {
+sub _select_lib {
     my $self = shift;
     my $args = shift;
-    croak "_add_to_libs() takes hashref: $!" unless ref($args) eq 'HASH';
+    croak "_select_lib() takes hashref: $!" unless ref($args) eq 'HASH';
     my $platform =
            $args->{osname} =~ /cygwin/i      ? 'cygwin'
         :(($args->{osname} =~ /mswin32/i ||
@@ -216,8 +198,7 @@
     my $libs = defined($args->{$platform})
         ? $args->{$platform}
         : $args->{default};
-    $args->{conf}->data->add(' ', libs => $libs);
-    return 1;
+    return $libs;
 }
 
 sub _add_flags_not_yet_seen {

Modified: trunk/t/steps/auto_crypto-01.t
==============================================================================
--- trunk/t/steps/auto_crypto-01.t	(original)
+++ trunk/t/steps/auto_crypto-01.t	Thu Jan 22 15:23:31 2009
@@ -4,7 +4,7 @@
 
 use strict;
 use warnings;
-use Test::More tests =>  36;
+use Test::More tests =>  24;
 use Carp;
 use lib qw( lib t/configure/testlib );
 use_ok('config::auto::crypto');
@@ -44,7 +44,7 @@
 
 $conf->replenish($serialized);
 
-########## _add_to_libs() ##########
+########## _select_lib() ##########
 
 ($args, $step_list_ref) = process_options( {
     argv => [ ],
@@ -57,89 +57,41 @@
 $initial_libs = $conf->data->get('libs');
 $osname = 'mswin32';
 $cc = 'gcc';
-ok($step->_add_to_libs( {
+is($step->_select_lib( {
     conf            => $conf,
     osname          => $osname,
     cc              => $cc,
     win32_nongcc    => 'libcrypto.lib',
     default         => '-lcrypto',
 } ),
-   "_add_to_libs() returned true value");
-like($conf->data->get('libs'),
-    qr/-lcrypto/,
-    "'libs' attribute modified as expected");
-# Restore setting for next test
-$conf->data->set( libs => $initial_libs );
+   '-lcrypto',
+   "_select_lib() returned expected value");
 
 $osname = 'mswin32';
 $cc = 'cc';
-ok($step->_add_to_libs( {
+is($step->_select_lib( {
     conf            => $conf,
     osname          => $osname,
     cc              => $cc,
     win32_nongcc    => 'libcrypto.lib',
     default         => '-lcrypto',
 } ),
-   "_add_to_libs() returned true value");
-like($conf->data->get('libs'),
-    qr/libcrypto.lib/,
-    "'libs' attribute modified as expected");
-# Restore setting for next test
-$conf->data->set( libs => $initial_libs );
+   'libcrypto.lib',
+   "_select_lib() returned expected value");
 
 $osname = 'foobar';
 $cc = 'cc';
-ok($step->_add_to_libs( {
+is($step->_select_lib( {
     conf            => $conf,
     osname          => $osname,
     cc              => $cc,
     win32_nongcc    => 'libcrypto.lib',
     default         => '-lcrypto',
 } ),
-   "_add_to_libs() returned true value");
-like($conf->data->get('libs'),
-    qr/-lcrypto/,
-    "'libs' attribute modified as expected");
-# Restore setting for next test
-$conf->data->set( libs => $initial_libs );
-
-my ($libs, $ccflags, $linkflags, $verbose);
-
-$libs = q{-lalpha};
-$ccflags = q{-Ibeta};
-$linkflags = q{-Lgamma};
-$verbose = undef;
-$step->_recheck_settings($conf, $libs, $ccflags, $linkflags, $verbose);
-like($conf->data->get('libs'), qr/$libs/,
-    "Got expected value for 'libs'");
-like($conf->data->get('ccflags'), qr/$ccflags/,
-    "Got expected value for 'ccflags'");
-like($conf->data->get('linkflags'), qr/$linkflags/,
-    "Got expected value for 'linkflags'");
-is($step->result, 'no', "Expected result was set");
-
-########## _recheck_settings() ##########
+   '-lcrypto',
+   "_select_lib() returned expected value");
 
-{
-    my $stdout;
-    $libs = q{-lalpha};
-    $ccflags = q{-Ibeta};
-    $linkflags = q{-Lgamma};
-    $verbose = 1;
-    capture(
-        sub { $step->_recheck_settings(
-            $conf, $libs, $ccflags, $linkflags, $verbose); },
-        \$stdout,
-    );
-    like($conf->data->get('libs'), qr/$libs/,
-        "Got expected value for 'libs'");
-    like($conf->data->get('ccflags'), qr/$ccflags/,
-        "Got expected value for 'ccflags'");
-    like($conf->data->get('linkflags'), qr/$linkflags/,
-        "Got expected value for 'linkflags'");
-    is($step->result, 'no', "Expected result was set");
-    like($stdout, qr/\(no\)/, "Got expected verbose output");
-}
+my $verbose = undef;
 
 $conf->replenish($serialized);
 

Modified: trunk/t/steps/auto_gdbm-01.t
==============================================================================
--- trunk/t/steps/auto_gdbm-01.t	(original)
+++ trunk/t/steps/auto_gdbm-01.t	Thu Jan 22 15:23:31 2009
@@ -5,7 +5,7 @@
 
 use strict;
 use warnings;
-use Test::More tests =>  62;
+use Test::More tests =>  47;
 use Carp;
 use Cwd;
 use File::Spec;
@@ -165,53 +165,6 @@
 
 $conf->replenish($serialized);
 
-########## --without-gdbm; _recheck_settings() ##########
-
-($args, $step_list_ref) = process_options( {
-    argv => [ q{--without-gdbm} ],
-    mode => q{configure},
-} );
-rerun_defaults_for_testing($conf, $args );
-$conf->add_steps($pkg);
-$conf->options->set( %{$args} );
-$step = test_step_constructor_and_description($conf);
-
-my ($libs, $ccflags, $linkflags);
-
-$libs = q{-lalpha};
-$ccflags = q{-Ibeta};
-$linkflags = q{-Lgamma};
-$verbose = undef;
-$step->_recheck_settings($conf, $libs, $ccflags, $linkflags, $verbose);
-like($conf->data->get('libs'), qr/$libs/,
-    "Got expected value for 'libs'");
-like($conf->data->get('ccflags'), qr/$ccflags/,
-    "Got expected value for 'ccflags'");
-like($conf->data->get('linkflags'), qr/$linkflags/,
-    "Got expected value for 'linkflags'");
-is($step->result, 'no', "Expected result was set");
-
-{
-    my $stdout;
-    $libs = q{-lalpha};
-    $ccflags = q{-Ibeta};
-    $linkflags = q{-Lgamma};
-    $verbose = 1;
-    capture(
-        sub { $step->_recheck_settings(
-            $conf, $libs, $ccflags, $linkflags, $verbose); },
-        \$stdout,
-    );
-    like($conf->data->get('libs'), qr/$libs/,
-        "Got expected value for 'libs'");
-    like($conf->data->get('ccflags'), qr/$ccflags/,
-        "Got expected value for 'ccflags'");
-    like($conf->data->get('linkflags'), qr/$linkflags/,
-        "Got expected value for 'linkflags'");
-    is($step->result, 'no', "Expected result was set");
-    like($stdout, qr/\(no\)/, "Got expected verbose output");
-}
-
 pass("Completed all tests in $0");
 
 ################### DOCUMENTATION ###################

Modified: trunk/t/steps/auto_gettext-01.t
==============================================================================
--- trunk/t/steps/auto_gettext-01.t	(original)
+++ trunk/t/steps/auto_gettext-01.t	Thu Jan 22 15:23:31 2009
@@ -5,7 +5,7 @@
 
 use strict;
 use warnings;
-use Test::More tests =>  34;
+use Test::More tests =>  30;
 use Carp;
 use lib qw( lib t/configure/testlib );
 use_ok('config::auto::gettext');
@@ -45,7 +45,7 @@
 
 $conf->replenish($serialized);
 
-########## _add_to_libs() ##########
+########## _select_lib() ##########
 
 ($args, $step_list_ref) = process_options( {
     argv => [ ],
@@ -59,7 +59,7 @@
 $osname = 'mswin32';
 $cc = 'gcc';
 $initial_value = $conf->data->get( 'libs' );
-ok($step->_add_to_libs( {
+is($step->_select_lib( {
     conf            => $conf,
     osname          => $osname,
     cc              => $cc,
@@ -67,15 +67,12 @@
     win32_nongcc    => 'intl.lib',
     default         => defined $conf->data->get('glibc') ? '' : '-lintl',
 } ),
-    "_add_to_libs() returned true value");
-like($conf->data->get( 'libs' ), qr/-lintl/,
-    "'libs' modified as expected");
-# Restore value for next test.
-$conf->data->set( 'libs' => $initial_value );
+   '-lintl',
+   "_select_lib() returned expected value");
 
 $osname = 'mswin32';
 $cc = 'cc';
-ok($step->_add_to_libs( {
+is($step->_select_lib( {
     conf            => $conf,
     osname          => $osname,
     cc              => $cc,
@@ -83,16 +80,13 @@
     win32_nongcc    => 'intl.lib',
     default         => defined $conf->data->get('glibc') ? '' : '-lintl',
 } ),
-    "_add_to_libs() returned true value");
-like($conf->data->get( 'libs' ), qr/intl.lib/,
-    "'libs' modified as expected");
-# Restore value for next test.
-$conf->data->set( 'libs' => $initial_value );
+   'intl.lib',
+   "_select_lib() returned expected value");
 
 $osname = 'foobar';
 $cc = 'cc';
 $conf->data->set( glibc => 1 );
-ok($step->_add_to_libs( {
+isnt($step->_select_lib( {
     conf            => $conf,
     osname          => $osname,
     cc              => $cc,
@@ -100,16 +94,13 @@
     win32_nongcc    => 'intl.lib',
     default         => defined $conf->data->get('glibc') ? '' : '-lintl',
 } ),
-    "_add_to_libs() returned true value");
-unlike($conf->data->get( 'libs' ), qr/-lintl/,
-    "'libs' modified as expected");
-# Restore value for next test.
-$conf->data->set( 'libs' => $initial_value );
+   '-lintl',
+   "_select_lib() returned expected value");
 
 $osname = 'foobar';
 $cc = 'cc';
 $conf->data->set( glibc => undef );
-ok($step->_add_to_libs( {
+is($step->_select_lib( {
     conf            => $conf,
     osname          => $osname,
     cc              => $cc,
@@ -117,9 +108,8 @@
     win32_nongcc    => 'intl.lib',
     default         => defined $conf->data->get('glibc') ? '' : '-lintl',
 } ),
-    "_add_to_libs() returned true value");
-like($conf->data->get( 'libs' ), qr/-lintl/,
-    "'libs' modified as expected");
+   '-lintl',
+   "_select_lib() returned expected value");
 
 ########## _evaluate_cc_run() ##########
 

Modified: trunk/t/steps/auto_gmp-01.t
==============================================================================
--- trunk/t/steps/auto_gmp-01.t	(original)
+++ trunk/t/steps/auto_gmp-01.t	Thu Jan 22 15:23:31 2009
@@ -5,7 +5,7 @@
 
 use strict;
 use warnings;
-use Test::More tests =>  73;
+use Test::More tests =>  61;
 use Carp;
 use Cwd;
 use File::Spec;
@@ -55,7 +55,7 @@
 
 $conf->replenish($serialized);
 
-########### _add_to_libs() ###########
+########### _select_lib() ###########
 
 ($args, $step_list_ref) = process_options( {
     argv => [ ],
@@ -68,48 +68,39 @@
 $osname = 'mswin32';
 $cc = 'gcc';
 $initial_value = $conf->data->get( 'libs' );
-ok($step->_add_to_libs( {
+is($step->_select_lib( {
     conf            => $conf,
     osname          => $osname,
     cc              => $cc,
     win32_nongcc    => 'gmp.lib',
     default         => '-lgmp',
 } ),
-    "_add_to_libs() returned true value");
-like($conf->data->get( 'libs' ), qr/-lgmp/,
-    "'libs' modified as expected");
-# Restore value for next test.
-$conf->data->set( 'libs' => $initial_value );
+   '-lgmp',
+   "_select_lib() returned expected value");
 
 $osname = 'mswin32';
 $cc = 'cc';
-ok($step->_add_to_libs( {
+is($step->_select_lib( {
     conf            => $conf,
     osname          => $osname,
     cc              => $cc,
     win32_nongcc    => 'gmp.lib',
     default         => '-lgmp',
 } ),
-    "_add_to_libs() returned true value");
-like($conf->data->get( 'libs' ), qr/gmp\.lib/,
-    "'libs' modified as expected");
-# Restore value for next test.
-$conf->data->set( 'libs' => $initial_value );
+   'gmp.lib',
+   "_select_lib() returned expected value");
 
 $osname = 'foobar';
 $cc = undef;
-ok($step->_add_to_libs( {
+is($step->_select_lib( {
     conf            => $conf,
     osname          => $osname,
     cc              => $cc,
     win32_nongcc    => 'gmp.lib',
     default         => '-lgmp',
 } ),
-    "_handle_mswin32() returned true value");
-like($conf->data->get( 'libs' ), qr/-lgmp/,
-    "'libs' modified as expected");
-# Restore value for next test.
-$conf->data->set( 'libs' => $initial_value );
+   '-lgmp',
+   "_select_lib() returned expected value");
 
 ########### _handle_darwin_for_fink() ###########
 
@@ -219,46 +210,6 @@
     $step->set_result(undef);
 }
 
-########### _recheck_settings() ###########
-
-my ($libs, $ccflags, $linkflags);
-
-$libs = q{-lalpha};
-$ccflags = q{-Ibeta};
-$linkflags = q{-Lgamma};
-$verbose = undef;
-$step->_recheck_settings($conf, $libs, $ccflags, $linkflags, $verbose);
-like($conf->data->get('libs'), qr/$libs/,
-    "Got expected value for 'libs'");
-like($conf->data->get('ccflags'), qr/$ccflags/,
-    "Got expected value for 'ccflags'");
-like($conf->data->get('linkflags'), qr/$linkflags/,
-    "Got expected value for 'linkflags'");
-is($step->result, 'no', "Expected result was set");
-
-{
-    my $stdout;
-    $libs = q{-lalpha};
-    $ccflags = q{-Ibeta};
-    $linkflags = q{-Lgamma};
-    $verbose = 1;
-    capture(
-        sub { $step->_recheck_settings(
-            $conf, $libs, $ccflags, $linkflags, $verbose); },
-        \$stdout,
-    );
-    like($conf->data->get('libs'), qr/$libs/,
-        "Got expected value for 'libs'");
-    like($conf->data->get('ccflags'), qr/$ccflags/,
-        "Got expected value for 'ccflags'");
-    like($conf->data->get('linkflags'), qr/$linkflags/,
-        "Got expected value for 'linkflags'");
-    is($step->result, 'no', "Expected result was set");
-    like($stdout, qr/\(no\)/, "Got expected verbose output");
-}
-
-$conf->replenish($serialized);
-
 ########### _handle_darwin_for_fink() ###########
 
 ($args, $step_list_ref) = process_options( {

Modified: trunk/t/steps/auto_opengl-01.t
==============================================================================
--- trunk/t/steps/auto_opengl-01.t	(original)
+++ trunk/t/steps/auto_opengl-01.t	Thu Jan 22 15:23:31 2009
@@ -5,7 +5,7 @@
 
 use strict;
 use warnings;
-use Test::More tests => 47;
+use Test::More tests => 43;
 use Carp;
 use lib qw( lib );
 use_ok('config::init::defaults');
@@ -46,7 +46,7 @@
 
 $conf->replenish($serialized);
 
-########## _add_to_libs() ##########
+########## _select_lib() ##########
 
 ($args, $step_list_ref) = process_options(
     {
@@ -64,7 +64,7 @@
 $initial_libs = $conf->data->get('libs');
 $osname = 'mswin32';
 $cc = 'gcc';
-ok($step->_add_to_libs( {
+is($step->_select_lib( {
     conf            => $conf,
     osname          => $osname,
     cc              => $cc,
@@ -73,17 +73,13 @@
     darwin          => '-framework OpenGL -framework GLUT',
     default         => '-lglut -lGLU -lGL',
 } ),
-   "_add_to_libs() returned true value");
-like($conf->data->get('libs'),
-    qr/-lglut32 -lglu32 -lopengl32/,
-    "'libs' attribute modified as expected");
-# Restore setting for next test
-$conf->data->set( libs => $initial_libs );
+    '-lglut32 -lglu32 -lopengl32',
+   "_select_lib() returned expected value");
 
 $osname = 'mswin32';
 $cc = 'cc';
 $initial_libs = $conf->data->get('libs');
-ok($step->_add_to_libs( {
+is($step->_select_lib( {
     conf            => $conf,
     osname          => $osname,
     cc              => $cc,
@@ -92,17 +88,13 @@
     darwin          => '-framework OpenGL -framework GLUT',
     default         => '-lglut -lGLU -lGL',
 } ),
-   "_add_to_libs() returned true value");
-like($conf->data->get('libs'),
-    qr/glut.lib glu.lib gl.lib/,
-    "'libs' attribute modified as expected");
-# Restore setting for next test
-$conf->data->set( libs => $initial_libs );
+   'glut.lib glu.lib gl.lib',
+   "_select_lib() returned expected value");
 
 $osname = 'darwin';
 $cc = 'cc';
 $initial_libs = $conf->data->get('libs');
-ok($step->_add_to_libs( {
+is($step->_select_lib( {
     conf            => $conf,
     osname          => $osname,
     cc              => $cc,
@@ -111,17 +103,13 @@
     darwin          => '-framework OpenGL -framework GLUT',
     default         => '-lglut -lGLU -lGL',
 } ),
-   "_add_to_libs() returned true value");
-like($conf->data->get('libs'),
-    qr/-framework OpenGL -framework GLUT/,
-    "'libs' attribute modified as expected");
-# Restore setting for next test
-$conf->data->set( libs => $initial_libs );
+   '-framework OpenGL -framework GLUT',
+   "_select_lib() returned expected value");
 
 $osname = 'foobar';
 $cc = 'cc';
 $initial_libs = $conf->data->get('libs');
-ok($step->_add_to_libs( {
+is($step->_select_lib( {
     conf            => $conf,
     osname          => $osname,
     cc              => $cc,
@@ -130,12 +118,8 @@
     darwin          => '-framework OpenGL -framework GLUT',
     default         => '-lglut -lGLU -lGL',
 } ),
-   "_add_to_libs() returned true value");
-like($conf->data->get('libs'),
-    qr/-lglut -lGLU -lGL/,
-    "'libs' attribute modified as expected");
-# Restore setting for next test
-$conf->data->set( libs => $initial_libs );
+   '-lglut -lGLU -lGL',
+   "_select_lib() returned expected value");
 
 $conf->replenish($serialized);
 
@@ -200,7 +184,7 @@
 {
     my $glut_api_version = '4';
     my $glut_brand = 'freeglut';
-    ok(auto::opengl::_handle_glut( $conf, $glut_api_version, $glut_brand ),
+    ok(auto::opengl::_handle_glut( $conf, 'lib', $glut_api_version, $glut_brand ),
         "_handle_glut() returned true value");
     is( $conf->data->get( 'opengl' ),  'define',
         "Got expected value for opengl");

Modified: trunk/t/steps/auto_pcre-01.t
==============================================================================
--- trunk/t/steps/auto_pcre-01.t	(original)
+++ trunk/t/steps/auto_pcre-01.t	Thu Jan 22 15:23:31 2009
@@ -5,7 +5,7 @@
 
 use strict;
 use warnings;
-use Test::More tests => 44;
+use Test::More tests => 34;
 use Carp;
 use lib qw( lib );
 use_ok('config::init::defaults');
@@ -46,7 +46,7 @@
 
 $conf->replenish($serialized);
 
-########## _add_to_libs() ##########
+########## _select_lib() ##########
 
 ($args, $step_list_ref) = process_options( {
     argv => [ ],
@@ -63,50 +63,41 @@
 $osname = 'mswin32';
 $cc = 'gcc';
 $initial_value = $conf->data->get( 'libs' );
-ok($step->_add_to_libs( {
+is($step->_select_lib( {
     conf            => $conf,
     osname          => $osname,
     cc              => $cc,
     win32_nongcc    => 'pcre.lib',
     default         => '-lpcre',
 } ),
-    "_add_to_libs() returned true value");
-like($conf->data->get( 'libs' ), qr/-lpcre/,
-    "'libs' modified as expected");
-# Restore value for next test.
-$conf->data->set( 'libs' => $initial_value );
+   '-lpcre',
+   "_select_lib() returned expected value");
 
 $osname = 'mswin32';
 $cc = 'cc';
 $initial_value = $conf->data->get( 'libs' );
-ok($step->_add_to_libs( {
+is($step->_select_lib( {
     conf            => $conf,
     osname          => $osname,
     cc              => $cc,
     win32_nongcc    => 'pcre.lib',
     default         => '-lpcre',
 } ),
-    "_add_to_libs() returned true value");
-like($conf->data->get( 'libs' ), qr/pcre\.lib/,
-    "'libs' modified as expected");
-# Restore value for next test.
-$conf->data->set( 'libs' => $initial_value );
+   'pcre.lib',
+   "_select_lib() returned expected value");
 
 $osname = 'foobar';
 $cc = 'gcc';
 $initial_value = $conf->data->get( 'libs' );
-ok($step->_add_to_libs( {
+is($step->_select_lib( {
     conf            => $conf,
     osname          => $osname,
     cc              => $cc,
     win32_nongcc    => 'pcre.lib',
     default         => '-lpcre',
 } ),
-    "_add_to_libs() returned true value");
-like($conf->data->get( 'libs' ), qr/-lpcre/,
-    "'libs' modified as expected");
-# Restore value for next test.
-$conf->data->set( 'libs' => $initial_value );
+   '-lpcre',
+   "_select_lib() returned expected value");
 
 ########## _evaluate_cc_run() ##########
 
@@ -123,21 +114,6 @@
     "_evaluate_cc_run returned true value as expected");
 is($step->result(), q{yes, 4.1}, "Got expected PCRE version");
 
-# Mock different outcomes of _recheck_settings()
-my ($libs, $ccflags, $linkflags);
-
-$libs = q{-lalpha};
-$ccflags = q{-Ibeta};
-$linkflags = q{-Lgamma};
-$verbose = undef;
-$step->_recheck_settings($conf, $libs, $ccflags, $linkflags, $verbose);
-like($conf->data->get('libs'), qr/$libs/,
-    "Got expected value for 'libs'");
-like($conf->data->get('ccflags'), qr/$ccflags/,
-    "Got expected value for 'ccflags'");
-like($conf->data->get('linkflags'), qr/$linkflags/,
-    "Got expected value for 'linkflags'");
-
 $conf->replenish($serialized);
 
 ########## --verbose; _evaluate_cc_run() ##########
@@ -168,26 +144,6 @@
     like($stdout, qr/\(yes, 4\.0\)/, "Got expected verbose output");
 }
 
-# Mock different outcomes of _recheck_settings()
-$libs = q{-ldelta};
-$ccflags = q{-Iepsilon};
-$linkflags = q{-Lzeta};
-{
-    my ($stdout, $stderr);
-    capture(
-        sub { $step->_recheck_settings(
-            $conf, $libs, $ccflags, $linkflags, $verbose); },
-        \$stdout,
-    );
-    like($conf->data->get('libs'), qr/$libs/,
-        "Got expected value for 'libs'");
-    like($conf->data->get('ccflags'), qr/$ccflags/,
-        "Got expected value for 'ccflags'");
-    like($conf->data->get('linkflags'), qr/$linkflags/,
-        "Got expected value for 'linkflags'");
-    like($stdout, qr/\(no\)/, "Got expected verbose output");
-}
-
 pass("Completed all tests in $0");
 
 ################### DOCUMENTATION ###################

Modified: trunk/t/steps/auto_readline-01.t
==============================================================================
--- trunk/t/steps/auto_readline-01.t	(original)
+++ trunk/t/steps/auto_readline-01.t	Thu Jan 22 15:23:31 2009
@@ -5,7 +5,7 @@
 
 use strict;
 use warnings;
-use Test::More tests => 72;
+use Test::More tests => 69;
 use Carp;
 use Cwd;
 use File::Spec;
@@ -21,7 +21,7 @@
 );
 use IO::CaptureOutput qw | capture |;
 
-########## _add_to_libs() ##########
+########## _select_lib() ##########
 
 my ($args, $step_list_ref) = process_options(
     {
@@ -44,47 +44,44 @@
 my ($osname, $cc);
 $osname = 'mswin32';
 $cc = 'gcc';
-ok($step->_add_to_libs( {
+is($step->_select_lib( {
     conf            => $conf,
     osname          => $osname,
     cc              => $cc,
     win32_nongcc    => 'readline.lib',
     default         => '-lreadline',
 } ),
-    "_add_to_libs() returned true value");
-like($conf->data->get( 'libs' ), qr/-lreadline/,
-    "'libs' modified as expected");
+   '-lreadline',
+   "_select_lib() returned expected value");
 
 $osname = 'mswin32';
 $cc = 'cc';
-ok($step->_add_to_libs( {
+is($step->_select_lib( {
     conf            => $conf,
     osname          => $osname,
     cc              => $cc,
     win32_nongcc    => 'readline.lib',
     default         => '-lreadline',
 } ),
-    "_add_to_libs() returned true value");
-like($conf->data->get( 'libs' ), qr/readline\.lib/,
-    "'libs' modified as expected");
+   'readline.lib',
+   "_select_lib() returned expected value");
 
 $osname = 'foobar';
 $cc = undef;
-ok($step->_add_to_libs( {
+is($step->_select_lib( {
     conf            => $conf,
     osname          => $osname,
     cc              => $cc,
     win32_nongcc    => 'readline.lib',
     default         => '-lreadline',
 } ),
-    "_add_to_libs() returned true value");
-like($conf->data->get( 'libs' ), qr/-lreadline/,
-    "'libs' modified as expected");
+   '-lreadline',
+   "_select_lib() returned true value");
 
 $osname = 'foobar';
 $cc = undef;
 eval {
-    $step->_add_to_libs( [
+    $step->_select_lib( [
         conf            => $conf,
         osname          => $osname,
         cc              => $cc,
@@ -92,8 +89,8 @@
         default         => '-lreadline',
     ] );
 };
-like($@, qr/_add_to_libs\(\) takes hashref/,
-    "Bad argument to _add_to_libs correctly detected");
+like($@, qr/_select_lib\(\) takes hashref/,
+    "Bad argument to _select_lib correctly detected");
 
 ########## _handle_darwin_for_fink() ##########
 

Modified: trunk/t/steps/auto_readline-02.t
==============================================================================
--- trunk/t/steps/auto_readline-02.t	(original)
+++ trunk/t/steps/auto_readline-02.t	Thu Jan 22 15:23:31 2009
@@ -5,7 +5,7 @@
 
 use strict;
 use warnings;
-use Test::More tests =>  31;
+use Test::More tests =>  14;
 use Carp;
 use Cwd;
 use lib qw( lib );
@@ -61,112 +61,23 @@
 ########## _handle_readline() ##########
 
 $has_readline = 0;
-ok(auto::readline::_handle_readline($conf, $has_readline),
+ok(auto::readline::_handle_readline($conf, 'lib', $has_readline),
     "_handle_readline() returned true value");
 is($conf->data->get('readline'), 'define',
     "Got expected value for 'readline'");
-is($conf->data->get('HAS_READLINE'), 0,
-    "Got expected value for 'HAS_READLINE'");
 # Prepare for next test
 $conf->data->set( readline => undef );
 $conf->data->set( HAS_READLINE => undef );
 
 $has_readline = 1;
-ok(auto::readline::_handle_readline($conf, $has_readline),
+ok(auto::readline::_handle_readline($conf, 'lib', $has_readline),
     "_handle_readline() returned true value");
 is($conf->data->get('readline'), 'define',
     "Got expected value for 'readline'");
-is($conf->data->get('HAS_READLINE'), 1,
-    "Got expected value for 'HAS_READLINE'");
 # Prepare for next test
 $conf->data->set( readline => undef );
 $conf->data->set( HAS_READLINE => undef );
 
-########## _handle_ncurses_need() ##########
-
-my ($osname, $cc);
-my ($libs, $newlibs);
-
-$libs = q{-lalpha};
-$osname = q{mswin32};
-$cc = q{gcc};
-$conf->data->set( libs => $libs );
-ok(auto::readline::_handle_ncurses_need($conf, $osname, $cc),
-    "_handle_ncurses_need() returned true value");
-$newlibs = $conf->data->get( 'libs' );
-like(
-    $newlibs,
-    qr/\s+-lncurses/,
-    "Value expected for $osname, $cc added to 'libs'"
-);
-$conf->data->set( libs => undef );
-
-$libs = q{-lalpha};
-$osname = q{mswin32};
-$cc = q{cc};
-$conf->data->set( libs => $libs );
-ok(auto::readline::_handle_ncurses_need($conf, $osname, $cc),
-    "_handle_ncurses_need() returned true value");
-$newlibs = $conf->data->get( 'libs' );
-like(
-    $newlibs,
-    qr/\s+ncurses\.lib/,
-    "Value expected for $osname, $cc added to 'libs'"
-);
-$conf->data->set( libs => undef );
-
-$libs = q{-lalpha};
-$osname = q{linux};
-$cc = q{gcc};
-$conf->data->set( libs => $libs );
-ok(auto::readline::_handle_ncurses_need($conf, $osname, $cc),
-    "_handle_ncurses_need() returned true value");
-$newlibs = $conf->data->get( 'libs' );
-like(
-    $newlibs,
-    qr/\s+-lncurses/,
-    "Value expected for $osname, $cc added to 'libs'"
-);
-$conf->data->set( libs => undef );
-
-########## _recheck_settings() ##########
-
-my ($ccflags, $linkflags);
-
-$libs = q{-lalpha};
-$ccflags = q{-Ibeta};
-$linkflags = q{-Lgamma};
-$verbose = undef;
-$step->_recheck_settings($conf, $libs, $ccflags, $linkflags, $verbose);
-like($conf->data->get('libs'), qr/$libs/,
-    "Got expected value for 'libs'");
-like($conf->data->get('ccflags'), qr/$ccflags/,
-    "Got expected value for 'ccflags'");
-like($conf->data->get('linkflags'), qr/$linkflags/,
-    "Got expected value for 'linkflags'");
-is($step->result, 'no', "Expected result was set");
-
-{
-    my $stdout;
-    $libs = q{-lalpha};
-    $ccflags = q{-Ibeta};
-    $linkflags = q{-Lgamma};
-    $verbose = 1;
-    capture(
-        sub { $step->_recheck_settings(
-            $conf, $libs, $ccflags, $linkflags, $verbose); },
-        \$stdout,
-    );
-    like($conf->data->get('libs'), qr/$libs/,
-        "Got expected value for 'libs'");
-    like($conf->data->get('ccflags'), qr/$ccflags/,
-        "Got expected value for 'ccflags'");
-    like($conf->data->get('linkflags'), qr/$linkflags/,
-        "Got expected value for 'linkflags'");
-    is($step->result, 'no', "Expected result was set");
-    like($stdout, qr/\(no\)/, "Got expected verbose output");
-}
-
 pass("Completed all tests in $0");
 
 ################### DOCUMENTATION ###################



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About