Ticket #1390: check-for-curses-lib.patch

File check-for-curses-lib.patch, 1.3 KB (added by carlin, 12 years ago)
  • config/auto/readline.pm

     
    6161    else { 
    6262        # a second chance with ncurses 
    6363        $extra_libs .= ' '; 
     64        my $tmp = $extra_libs; 
    6465        $extra_libs .= $self->_select_lib( { 
    6566            conf            => $conf, 
    6667            osname          => $osname, 
     
    7576            } 
    7677            _handle_readline($conf, $extra_libs); 
    7778        } 
     79        else { 
     80            # a third chance with curses 
     81            $extra_libs = $tmp . $self->_select_lib( { 
     82                conf            => $conf, 
     83                osname          => $osname, 
     84                cc              => $cc, 
     85                win32_nongcc    => 'curses.lib', 
     86                default         => '-lcurses', 
     87            } ); 
     88            eval { $conf->cc_build( q{}, $extra_libs) }; 
     89            if ( !$@ ) { 
     90                if ( $conf->cc_run() ) { 
     91                    $has_readline = $self->_evaluate_cc_run($verbose); 
     92                } 
     93                _handle_readline($conf, $extra_libs); 
     94            } 
     95        } 
    7896    } 
    7997    $conf->data->set( HAS_READLINE => $has_readline ); 
    8098    $self->set_result($has_readline ? 'yes' : 'no');