Package: libopengl-perl / 0.7000+dfsg-5

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
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
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
@@ -798,192 +798,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 = <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 = <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->{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;
 }