I hypothesized that this problem -- which is continuing as of r26920
(Apr 10) -- originated in a recent change to a GDBM-related file within
the Parrot distribution.

[parrot] 530 $ find . ! -path '*/.svn*' -iname '*gdbm*' | xargs svn
status -v
            26920    26101 particle     config/auto/gdbm
            26920    26101 particle     config/auto/gdbm/gdbm.in
            26920    26101 particle     config/auto/gdbm/gdbm.in
            26920    26790 fperrad      config/auto/gdbm.pm
?                                       gdbm_hash_1
I                                      
runtime/parrot/dynext/gdbmhash.bundle
I                                       src/dynpmc/gdbmhash.bundle
I                                       src/dynpmc/gdbmhash.c
I                                       src/dynpmc/gdbmhash.dump
I                                       src/dynpmc/gdbmhash.o
            26920    26647 chromatic    src/dynpmc/gdbmhash.pmc


So I started with the most recent change:  r26790 change to
config/auto/gdbm.pm.

$> svn diff -r 24769:26790   config/auto/gdbm.pm

See attached for the diff.

Note these lines:

-    else {
-        eval { $conf->cc_build( '', '-lgdbm' ); };
-    }
+    eval { $conf->cc_build(); };

In the prior revision, a non-Win32 OS explicitly had '-lgdbm' added to
its flags.  But in the later revision, this flag goes missing.

It's too late for me to test this out tonight, i.e., to see what happens
if I revert or modify auto::gdbm.  François, could you take a look at
this please?

Thank you very much.
kid51
Index: config/auto/gdbm.pm
===================================================================
--- config/auto/gdbm.pm (revision 24769)
+++ config/auto/gdbm.pm (revision 26790)
@@ -61,18 +61,10 @@
     # Fink location.
     $self->_handle_darwin_for_fink($conf, $osname, 'gdbm.h');
 
+    _handle_mswin32($conf, $osname, $cc);
+
     $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(); };
     my $has_gdbm = 0;
     if ( !$@ ) {
         my $test = $conf->cc_run();
@@ -88,6 +80,22 @@
     return 1;
 }
 
+sub _handle_mswin32 {
+    my ($conf, $osname, $cc) = @_;
+    if ( $osname =~ /mswin32/i ) {
+        if ( $cc =~ /^gcc/i ) {
+            $conf->data->add( ' ', libs => '-lgdbm.dll' );
+        }
+        else {
+            $conf->data->add( ' ', libs => 'libgdbm.lib' );
+        }
+    }
+    else {
+        $conf->data->add( ' ', libs => '-lgdbm' );
+    }
+    return 1;
+}
+
 sub _evaluate_cc_run {
     my $self = shift;
     my ($test, $has_gdbm, $verbose) = @_;

Reply via email to