Disable use of glversion for autodetection of GL features. This would require X and I am not sure Xvfb would provide the same set of capabilities. Upstream also includes a gl_exclude.h already that works for us, so just skip the detection. --- a/Makefile.PL +++ b/Makefile.PL @@ -750,192 +750,10 @@ sub get_extensions { my($found,$no_excl) = @_; - print "Testing for OpenGL Extensions\n" if ($verbose); - - # clean up previous output files - my $exc_file = 'gl_exclude.h'; - unlink($exc_file) if (-e $exc_file); - my $glv_file = 'utils/glversion.txt'; - unlink($glv_file) if (-e $glv_file); - - # Only run the rest if GLUT is installed - print "Testing GLUT version\n" if ($verbose); - my($lib,$def); - if ($found->{FREEGLUT32} || $found->{FREEGLUT}) - { - $lib = $found->{FREEGLUT32} || $found->{FREEGLUT}; - $def = "HAVE_FREEGLUT"; - } - elsif ($found->{GLUT32} || $found->{GLUT}) - { - $lib = $found->{GLUT32} || $found->{GLUT}; - $def = "HAVE_GLUT"; - } - elsif ($verbose) - { - print "GLUT not found\n"; - } - - # Platform-specific makefiles for glversion - my $make_ver; - if ($IS_STRAWBERRY) - { - $make_ver = "&strawberry.bat"; - print "strawberry glversion: '$make_ver'\n" if $verbose>1; - } - elsif ($IS_MINGW) - { - $make_ver = "&mingw.bat"; - print "mingw glversion: '$make_ver'\n" if $verbose>1; - } - elsif ($IS_W32API) - { - $make_ver = ";make -f Makefile.cygwin " . (length($lib) ? "GLUT_LIB=$lib " : "") . (length($def) ? "GLUT_DEF=$def " : ""); - print "cygwin glversion: '$make_ver'\n" if $verbose>1; - } - elsif ($^O eq 'MSWin32') - { - $make_ver = '&nmake -f makefile.mak ' . (length($def) ? "GLUT_DEF=$def " : ""); - print "MSWin32 glversion: '$make_ver'\n" if $verbose>1; - } - elsif ($^O eq 'darwin') - { - $make_ver = ";make -f Makefile.macosx " . (length($lib) ? "GLUT_LIB='$lib' " : "") . (length($def) ? "GLUT_DEF=$def " : ""); - print "MacOSX glversion: '$make_ver'\n" if $verbose>1; - } - else - { - if ($ENV{TERM} ne 'xterm') - { - print "\nIn order to test your GPU's capabilities, run this make under an X11 shell\n\n"; - } - - $make_ver = ";make -f Makefile " . (length($lib) ? "GLUT_LIB=$lib " : "") . (length($def) ? "GLUT_DEF=$def " : ""); - print "glversion: '$make_ver'\n" if $verbose>1; - } - my $exec = 'cd utils'."$make_ver clean".$make_ver; - print "glversion: $exec\n" if ($verbose); - my $stat = `$exec`; - print "\n$stat\n\n" if ($verbose); - unlink "utils/freeglut.dll" or die "could not remove temporary freeglut: $!" if -f "utils/freeglut.dll"; - - # Parse glversion.txt file - open GLDATA, $glv_file or die "get_extensions: could not open $glv_file: $!\n"; - my $gldata = {}; - my @gldata = ; - close(GLDATA); - - foreach my $line (@gldata) - { - $line =~ s|[\r\n]+||; - my($key,$val) = split('=',$line); - $gldata->{$key} = $val; - } - die "get_extensions: no extensions found in $glv_file\n" if !keys %$gldata; - - print "This looks like OpenGL Version: $gldata->{VERSION}\n"; - - # Parse glext_procs.h file - open GLEXT, "glext_procs.h" or die "get_extensions: could not open glext_procs.h: $!\n"; - my @lines = ; - close(GLEXT); - - my $no_ext = {}; - foreach my $line (@lines) - { - next if ($line !~ m|\#ifndef NO_([^\s]+)|); - my $ext = $1; - next if ($ext =~ m|^GL_VERSION_|); - $no_ext->{$ext}++; - } - - - # Create gl_exclude.h - die "Unable to write to $exc_file\n" if (!open(GLEXC,">$exc_file")); - print GLEXC "// OpenGL Extension Exclusions - may be modified before building.\n"; - print GLEXC "//\n"; - print GLEXC "// Generated for ".$gldata->{VENDOR}.", ".$gldata->{RENDERER}."\n"; - print GLEXC "// OpenGL v".$gldata->{VERSION}.", using "; - - # Fix GLUT flags based on results - if ($gldata->{FREEGLUT}) - { - print 'Found FreeGLUT v'.$gldata->{FREEGLUT}."\n"; - print GLEXC 'FreeGLUT v'.$gldata->{FREEGLUT}."\n"; - - if (!$found->{FREEGLUT} && !$found->{FREEGLUT32}) - { - $found->{FREEGLUT} = $lib; - } - } - elsif ($gldata->{GLUT}) - { - print "Found GLUT - Version: $gldata->{GLUT}\n"; - } - else - { - print "Found no GLUT\n" - } - - my $GL_VERSION; - my($GL_VERSION_MAJOR, $GL_VERSION_MINOR); - if ($gldata->{VERSION} =~ m|^(\d\.\d+)|) - { - $GL_VERSION = $1; - ($GL_VERSION_MAJOR,$GL_VERSION_MINOR) = split('.', $GL_VERSION); - } - - # Make an empty exclusion file if a Windows distribution build - if ($no_excl) - { - print "OpenGL Extension exclusions disabled\n"; - print GLEXC "//\n"; - print GLEXC "// Exclusions omitted for distribution build.\n"; - } - else - { - print GLEXC "\n"; - if ($GL_VERSION) - { - print GLEXC "#define NO_GL_VERSION_4_5\n" if ($GL_VERSION < 4.5); - print GLEXC "#define NO_GL_VERSION_4_4\n" if ($GL_VERSION < 4.4); - print GLEXC "#define NO_GL_VERSION_4_3\n" if ($GL_VERSION < 4.3); - print GLEXC "#define NO_GL_VERSION_4_2\n" if ($GL_VERSION < 4.2); - print GLEXC "#define NO_GL_VERSION_4_1\n" if ($GL_VERSION < 4.1); - print GLEXC "#define NO_GL_VERSION_4_0\n" if ($GL_VERSION < 4.0); - print GLEXC "#define NO_GL_VERSION_3_3\n" if ($GL_VERSION < 3.3); - print GLEXC "#define NO_GL_VERSION_3_2\n" if ($GL_VERSION < 3.2); - print GLEXC "#define NO_GL_VERSION_3_1\n" if ($GL_VERSION < 3.1); - print GLEXC "#define NO_GL_VERSION_3_0\n" if ($GL_VERSION < 3.0); - print GLEXC "#define NO_GL_VERSION_2_1\n" if ($GL_VERSION < 2.1); - print GLEXC "#define NO_GL_VERSION_2_0\n" if ($GL_VERSION < 2.0); - print GLEXC "#define NO_GL_VERSION_1_5\n" if ($GL_VERSION < 1.5); - print GLEXC "#define NO_GL_VERSION_1_4\n" if ($GL_VERSION < 1.4); - print GLEXC "#define NO_GL_VERSION_1_3\n" if ($GL_VERSION < 1.3); - print GLEXC "#define NO_GL_VERSION_1_2\n" if ($GL_VERSION < 1.2); - print GLEXC "#define NO_GL_VERSION_1_1\n" if ($GL_VERSION < 1.1); - } - - foreach my $ext (split(' ',$gldata->{EXTENSIONS})) - { - next if (!$no_ext->{$ext}); - $no_ext->{$ext} = 0; - } - - foreach my $ext (sort keys(%$no_ext)) - { - next if (!$no_ext->{$ext}); - print GLEXC "#define NO_$ext\n"; - } - } - - close(GLEXC); - # return Distributable Defs print "Have Version Data\n" if ($verbose); my $defines = '-DHAVE_VER'; - $defines .= " -DGL_VERSION_USED=$GL_VERSION" if ($GL_VERSION); return $defines; }