Package: libopengl-perl / 0.6704+dfsg-2

disable-glversion Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
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
@@ -788,170 +788,6 @@
 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);
-
-
-  # Parse glversion.txt file
-  if ( !defined(open(GLDATA,$glv_file)) ) {
-     print "get_extensions: could not open $glv_file: $!\n" if $verbose;
-     return '';
-  }
-  my $gldata = {};
-  my @gldata = <GLDATA>;
-  close(GLDATA);
-
-  foreach my $line (@gldata)
-  {
-    $line =~ s|[\r\n]+||;
-    my($key,$val) = split('=',$line);
-    $gldata->{$key} = $val;
-  }
-  if (!scalar(keys %$gldata)) {
-     print "get_extensions: no extensions found in $glv_file\n" if $verbose;
-     return '';
-  }
-
-
-  # Parse glext_procs.h file
-  return '' if (!open(GLEXT,"glext_procs.h"));
-  my @lines = <GLEXT>;
-  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->{GLUT} > 0)
-  {
-    print 'Found FreeGLUT v'.$gldata->{GLUT}."\n";
-    print GLEXC 'FreeGLUT v'.$gldata->{GLUT}."\n";
-
-    if (!$found->{FREEGLUT} && !$found->{FREEGLUT32})
-    {
-      $found->{FREEGLUT} = $lib;
-    }
-  }
-  else
-  {
-    print "Found GLUT - unknown version\n";
-  }
-
-  # 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 ($gldata->{VERSION} =~ m|^(\d\.\d+)|)
-    {
-      my $ver = $1;
-      print GLEXC "#define NO_GL_VERSION_2_0\n" if ($ver < 2.0);
-      print GLEXC "#define NO_GL_VERSION_1_5\n" if ($ver < 1.5);
-      print GLEXC "#define NO_GL_VERSION_1_4\n" if ($ver < 1.4);
-      print GLEXC "#define NO_GL_VERSION_1_3\n" if ($ver < 1.3);
-      print GLEXC "#define NO_GL_VERSION_1_2\n" if ($ver < 1.2);
-      print GLEXC "#define NO_GL_VERSION_1_1\n" if ($ver < 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);