Donald Hunter via RT schrieb:
Sorry rurban, this patch will break on my cygwin installation. I think
the problem is caused by more than an assumption that "mingw eq cygwin".
The real problem is that Cygwin hosts three flavours of library for
OpenGL: mingw, cygwin/w32api, cygwin/X11.

All your patch does is switch from Cygwin/w32api to Cygwin/X11.
Please see rt#56628 for more details.

Ah thanks. I missed your recent common on this.
http://rt.perl.org/rt3/Public/Bug/Display.html?id=56628

The problem I had with the w32api libs was -lglut32. with linking directly to the dll /usr/bin/glut32.dll everything works fine, and I'll get rid of freeglut as default.

Now I only have to find out whatÄs wrong with that importlib, then I send the revised patch. for now it is:

--- origsrc/parrot-0.6.4/config/auto/opengl.pm 2008-06-02 17:35:05.000000000 +0000 +++ src/parrot-0.6.4/config/auto/opengl.pm 2008-07-17 19:14:11.000000000 +0000
@@ -89,7 +89,6 @@
 On Windows, Parrot supports three different compiler environments, each of
 which has different requirements for OpenGL support:

-
 =head3 MSVC

 =over 4
@@ -104,16 +103,21 @@

 =back

-
 =head3 MinGW

  XXXX: No details yet

+=head3 Cygwin/w32api

-=head3 cygwin
+The Cygwin/w32api for native opengl support

- XXXX: No details yet
+F<-lglut32 -lglu32 -lopengl32>
+
+=head3 Cygwin/X
+
+Requires a X server.

+F<freeglut>, F<libglut-devel>

 =cut

@@ -159,15 +163,23 @@

     my $osname = $conf->data->get_p5('OSNAME');

-    $self->_add_to_libs( {
-        conf            => $conf,
-        osname          => $osname,
-        cc              => $cc,
-        win32_gcc       => '-lglut32 -lglu32 -lopengl32',
-        win32_nongcc    => 'opengl32.lib glu32.lib glut32.lib',
-        darwin          => '-framework OpenGL -framework GLUT',
-        default         => '-lglut -lGLU -lGL',
-    } );
+    # Prefer Cygwin/w32api over Cygwin/X, but use X when DISPLAY is set
+    if ($^O eq 'cygwin' and $ENV{DISPLAY}) {
+       $self->_add_to_libs( {
+           conf        => $conf,
+           osname      => $osname,
+           cc          => $cc,
+           cygwin      => '-lglut -L/usr/X11R6/lib -lGLU -lGL'
+    } ) } else {
+       $self->_add_to_libs( {
+           conf            => $conf,
+            osname          => $osname,
+            cc              => $cc,
+            win32_gcc       => '-lglut32 -lglu32 -lopengl32',
+            win32_nongcc    => 'opengl32.lib glu32.lib glut32.lib',
+            darwin          => '-framework OpenGL -framework GLUT',
+            default         => '-lglut -lGLU -lGL',
+    } ) };

     # On OS X check the presence of the OpenGL headers in the standard
     # Fink/macports locations.

Reply via email to