Author: rurban
Date: Sun Dec 28 04:50:46 2008
New Revision: 34480
Modified:
branches/pdd30install_stage3/config/auto/opengl.pm
branches/pdd30install_stage3/config/gen/opengl.pm
branches/pdd30install_stage3/lib/Parrot/Configure/Step/Methods.pm
Log:
57006-opengl-cyg
Modified: branches/pdd30install_stage3/config/auto/opengl.pm
==============================================================================
--- branches/pdd30install_stage3/config/auto/opengl.pm (original)
+++ branches/pdd30install_stage3/config/auto/opengl.pm Sun Dec 28 04:50:46 2008
@@ -114,14 +114,16 @@
The Cygwin/w32api for native opengl support
-F<-lglut32 -lglu32 -lopengl32>
-
+F<opengl>, F<w32api>
=head3 Cygwin/X
Requires a X server.
-F<freeglut>, F<libglut-devel>
+F<freeglut>, F<libglut-devel>, F<xorg-x11-devel>
+
+This is detected if freeglut is installed and DISPLAY is set.
+It requires an X server.
=cut
@@ -168,24 +170,20 @@
my $osname = $conf->data->get_p5('OSNAME');
# 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( {
+ $self->_add_to_libs( {
conf => $conf,
osname => $osname,
cc => $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 => '-lglut32 -lglu32 -lopengl32'))
+ : (),
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.
Modified: branches/pdd30install_stage3/config/gen/opengl.pm
==============================================================================
--- branches/pdd30install_stage3/config/gen/opengl.pm (original)
+++ branches/pdd30install_stage3/config/gen/opengl.pm Sun Dec 28 04:50:46 2008
@@ -448,6 +448,9 @@
# "$ENV{HOME}/src/osx-insane/usr/X11R6 1/include/GL/*.h",
);
+ # X freeglut only if DISPLAY is set, otherwise use native w32api GLUT
+ shift @header_globs if $^O eq 'cygwin' and !$ENV{DISPLAY};
+
print "\nChecking for OpenGL headers using the following globs:\n\t",
join("\n\t", @header_globs), "\n"
if $verbose;
Modified: branches/pdd30install_stage3/lib/Parrot/Configure/Step/Methods.pm
==============================================================================
--- branches/pdd30install_stage3/lib/Parrot/Configure/Step/Methods.pm
(original)
+++ branches/pdd30install_stage3/lib/Parrot/Configure/Step/Methods.pm Sun Dec
28 04:50:46 2008
@@ -119,6 +119,7 @@
cc => $cc,
win32_gcc => '-lalpha32 -lalpha32 -lopenalpha32',
win32_nongcc => 'alpha.lib',
+ cygwin => '-lalpha32 -lXalpha32', # optional
darwin => 'alphadarwin.lib',
default => '-lalpha',
} );
@@ -138,6 +139,8 @@
=item * MSWin32 with any C-compiler other than F<gcc>.
+=item * Cygwin to override Mingw.
+
=item * Darwin.
=back
@@ -173,7 +176,7 @@
=item * C<win32_gcc>
-Libraries to be added where OS is mswin32 and C-compiler is F<gcc>.
+Libraries to be added where OS is mswin32 or cygwin and C-compiler is F<gcc>.
Single whitespace-delimited string.
=item * C<win32_nongcc>
@@ -181,6 +184,12 @@
Libraries to be added where OS is mswin32 and C-compiler is not F<gcc>.
Single whitespace-delimited string.
+=item * C<cygwin>
+
+Optional libraries to be added where OS is cygwin. This overrides C<win32_gcc>
+if defined.
+Single whitespace-delimited string.
+
=item * C<darwin>
Libraries to be added where OS is Darwin. Do not supply a value if the value
@@ -197,7 +206,8 @@
my $args = shift;
croak "_add_to_libs() takes hashref: $!" unless ref($args) eq 'HASH';
my $platform =
- (($args->{osname} =~ /mswin32/i ||
+ $args->{osname} =~ /cygwin/i ? 'cygwin'
+ :(($args->{osname} =~ /mswin32/i ||
$args->{osname} =~ /cygwin/i) &&
$args->{cc} =~ /^gcc/i) ? 'win32_gcc'
: $args->{osname} =~ /mswin32/i ? 'win32_nongcc'