Author: fperrad Date: Sat Apr 5 14:25:41 2008 New Revision: 26790 Modified: trunk/config/auto/gdbm.pm
Log: [gdbm] - fix configure on MinGW32 Modified: trunk/config/auto/gdbm.pm ============================================================================== --- trunk/config/auto/gdbm.pm (original) +++ trunk/config/auto/gdbm.pm Sat Apr 5 14:25:41 2008 @@ -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) = @_;