On Sun, Oct 25, 2009 at 02:41:38PM -0400, Chris Marshall wrote:
> Henning Glawe wrote:
>>
>>> For what its worth, TriD uses the glutMainLoopEvent() to pump the GUI
>>> events. GLUT does not have that function which is why nothing is
>>> being pumped and no mouse/resize response.
>>
>> thanks for the hint; my patch for Makefile.PL checks now for this symbol in
>> the header.
>
> Thanks for the patch. I've tested it out and nothing breaks
> on cygwin or win32 and by inspection it appears it may address
> other reported problems of the same ilk. One thought, don't
> you need to define HAVE_FREEGLUT_H also? If you have it and
> are linking to the FreeGLUT library then that is the right
> thing to do---even if there is a glut.h link to freeglut.h.
good point; glut.h is not a link to freeglut.h in my case, but describes only
the standard-glut part of the api (may result in an 'implicite declaration'
warning when compiling).
> Looks good and checks out so far. I would appreciate hearing
> from you whether changing the $DEFS assignment to:
>
> $DEFS .= " -DHAVE_FREEGLUT -DHAVE_FREEGLUT_H";
>
> works ok as well. That seems like it might address some of the
> other freeglut.h include file problems that have been seen.
works; attached a new version of the patch, which also overrides
$found_libs->{FREEGLUT} only in case it was not defined before.
a small cosmetical problem that I observed is: the option interface=FREEGLUT
leads nevertheless to a message 'FREEGLUT interface requires FreeGLUT,
Falling back to the GLUT interface' (although freeglut is actually used).
Reason for this is: my patch is in a section of the Makefile.PL that comes
_after_ the interface selection, but contains all necessary infrastructure
for the header check. For a cleaner solution, the Makefile.PL would have to
be restructured.
--
c u
henning
Index: libopengl-perl-0.60+dfsg/Makefile.PL
===================================================================
--- libopengl-perl-0.60+dfsg.orig/Makefile.PL 2009-10-26 11:25:15.529290305
+0100
+++ libopengl-perl-0.60+dfsg/Makefile.PL 2009-10-26 11:38:18.692290542
+0100
@@ -476,6 +476,19 @@
print "GLX not found (neither library, nor headers).";
}
+ # Test for obfuscated Freeglut
+ # quite often Freeglut is in -lglut... Test for GL/freeglut.h instead...
+ my $out = cfile_text('GL/freeglut.h');
+
+ # The cpp would not let this macro through. Check for something else
+ # that still exists after the cpp pass. a typedef, or type would work
+ my $has_freeglut = ($out =~ m|glutMainLoopEvent|);
+
+ if ($has_freeglut)
+ {
+ $DEFS .= " -DHAVE_FREEGLUT_H -DHAVE_FREEGLUT";
+ $found_libs->{FREEGLUT}="glut" unless ($found_libs->{FREEGLUT});
+ }
# Marshall libs
my $libs = ' -l'.join(' -l',values(%$found_libs));
_______________________________________________
Perldl mailing list
[email protected]
http://mailman.jach.hawaii.edu/mailman/listinfo/perldl