[svn:parrot] r37202 - in trunk: . config/auto

rurban at svn.parrot.org rurban at svn.parrot.org
Sun Mar 8 12:18:48 UTC 2009


Author: rurban
Date: Sun Mar  8 12:18:47 2009
New Revision: 37202
URL: https://trac.parrot.org/parrot/changeset/37202

Log:
Clarify and change the broken cygwin opengl logic:
- if /usr/include/GL is found then freeglut is tried
- else w32api native GLUT is tried.
- you must uninstall freeglut and its devel packages to use native GLUT

Modified:
   trunk/README_cygwin.pod
   trunk/config/auto/opengl.pm

Modified: trunk/README_cygwin.pod
==============================================================================
--- trunk/README_cygwin.pod	Sun Mar  8 12:07:48 2009	(r37201)
+++ trunk/README_cygwin.pod	Sun Mar  8 12:18:47 2009	(r37202)
@@ -66,14 +66,20 @@
 
 =item opengl
 
-You can use the w32api and opengl packages for native Windows opengl support,
-or the freeglut package for the X Server.
+Building is tricky:
 
-Configure.pl will detect freeglut if freeglut is installed and DISPLAY
-is set, otherwise it checks for w32api and opengl with GLUT.
-In case that freeglut is installed, DISPLAY must be set I<before> running
-Configure.pl. If not using freeglut, then DISPLAY must B<not> be set.
-C<export DISPLAY=127.0.0.1:0.0> is the typical setting.
+If the freeglut package for the X Server is installed, this
+is used, otherwise the w32api and opengl packages for native
+Windows opengl support are tried.  
+
+In order to use the w32api native GLUT there must be no
+F</usr/include/GL> directory.
+ 
+The problem is that the L<NCI|pdds/draft/pdd16_native_call.pod> 
+tries the header files to create the imports and not the
+libraries, and if the /usr/include/GL headers are found
+these are used, despite the w32api GLUT libraries are
+defined.
 
   Determining if your platform supports OpenGL.............yes, freeglut 3.4.
   Determining if your platform supports OpenGL...................yes, GLUT 3.
@@ -81,11 +87,11 @@
 
 Required packages:
 
-  w32api opengl
+  libglut-devel libGL-devel libGLU-devel libglut3 ... 
 
-or
+or if C<libglut-devel> and C<libGL-devel> is not installed:
 
-  freeglut libglut-devel xorg-x11-devel xorg-x11-base xorg-x11-bin-dlls
+  w32api opengl
 
 =item SDL
 

Modified: trunk/config/auto/opengl.pm
==============================================================================
--- trunk/config/auto/opengl.pm	Sun Mar  8 12:07:48 2009	(r37201)
+++ trunk/config/auto/opengl.pm	Sun Mar  8 12:18:47 2009	(r37202)
@@ -110,20 +110,24 @@
 see L<http://www.transmissionzero.co.uk/computing/using-glut-with-mingw/>.
 
 
-=head3 Cygwin/w32api
+=head3 Cygwin/X
 
-The Cygwin/w32api for native opengl support
+Requires a X server and F<libglut-devel>, F<libGL-devel>, F<libGLU-devel>,
+F<freeglut> and its dependencies.
 
-F<opengl>, F<w32api>
+This is tried first.
 
-=head3 Cygwin/X
+=head3 Cygwin/w32api
 
-Requires a X server.
+The Cygwin/w32api for native opengl support
+is only tried if F</usr/include/GL> does not exist.
 
-F<freeglut>, F<libglut-devel>, F<xorg-x11-devel>
+The problem is that the L<NCI|pdds/draft/pdd16_native_call.pod>
+tries the header files to create the imports and not the libraries,
+and if the F</usr/include/GL> headers are found these are used, despite
+the w32api GLUT libraries are defined.
 
-This is detected if freeglut is installed and DISPLAY is set.
-It requires an X server.
+F<opengl>, F<w32api>
 
 =cut
 
@@ -164,10 +168,10 @@
             conf            => $conf,
             osname          => $osname,
             cc              => $conf->data->get('cc'),
-            # Prefer Cygwin/w32api over Cygwin/X, but use X when DISPLAY is set
-            ($^O eq 'cygwin') ?
-             ($ENV{DISPLAY} ? (cygwin => '-lglut -L/usr/X11R6/lib -lGLU -lGL')
-                            : (cygwin => '/usr/bin/glut32.dll -lglu32 -lopengl32'))
+            ($^O eq 'cygwin') ?  # Cygwin/X is used when /usr/include/GL is found
+             (-d '/usr/include/GL'
+                ? (cygwin => '-lglut -L/usr/X11R6/lib -lGLU -lGL')
+                : (cygwin => '-lglut32 -lglu32 -lopengl32'))
              : (),
             win32_gcc       => '-lglut32 -lglu32 -lopengl32',
             win32_nongcc    => 'opengl32.lib glu32.lib glut32.lib',


More information about the parrot-commits mailing list