Author: japhb Date: Wed Jan 28 10:05:18 2009 New Revision: 36100 Modified: trunk/config/auto/opengl.pm
Log: [OpenGL] Produce sane(ish) results for no OpenGL Modified: trunk/config/auto/opengl.pm ============================================================================== --- trunk/config/auto/opengl.pm (original) +++ trunk/config/auto/opengl.pm Wed Jan 28 10:05:18 2009 @@ -156,11 +156,7 @@ | ); - if ($without) { - $conf->data->set( has_opengl => 0 ); - $self->set_result('no'); - return 1; - } + return $self->_handle_no_opengl($conf) if $without; my $osname = $conf->data->get_p5('OSNAME'); @@ -188,12 +184,13 @@ $conf->cc_gen('config/auto/opengl/opengl.in'); my $has_glut = 0; eval { $conf->cc_build( q{}, $extra_libs ) }; - if ( !$@ ) { + if ( $@ ) { + return $self->_handle_no_opengl($conf); + } + else { my $test = $conf->cc_run(); - $has_glut = _handle_glut($conf, $extra_libs, $self->_evaluate_cc_run($test, $verbose)); + return _handle_glut($conf, $extra_libs, $self->_evaluate_cc_run($test, $verbose)); } - - return 1; } sub _evaluate_cc_run { @@ -225,6 +222,24 @@ return 1; } +sub _handle_no_opengl { + my ($self, $conf) = @_; + + $conf->data->set( + has_opengl => 0, + HAS_OPENGL => 0, + opengl_lib => '', + + has_glut => 0, + HAS_GLUT => 0, + ); + + $self->set_result('no'); + + return 1; +} + + 1; # Local Variables: