I'm not quite sure what needs to be done about this. Build.PL properly detects that OpenGL headers are in /usr/X11R6/include/GL, so it generates a command line to compile with
-I/usr/X11R6/include/GL on it. When including gl.h from OpenGL.xs, it finds it in /usr/X11R6/include/GL, of course. Unfortunately, gl.h contains the line: #include <GL/glext.h> which is relative to /usr/X11R6/include, but /usr/X11R6/include isn't specified as a include search path on the command line. And thus the build dies when trying to parse gl.h. I was able to work around this by editing _build/notes and adding '-I/usr/X11R6/include', in the 'extra_compiler_flags' value of 'src/SDL/OpenGL.xs'. I think the fix might be to have OpenGL.xs do #include <GL/gl.h> and search for GL/gl.h instead of just gl.h when running Build.PL. I don't know much about OpenGL, but this seems to be what a lot of other programs do (include relative to the directory that contains the GL directory). But I think this might break the header search algorithm, which appears to try to do things in a case-insentitive manner (looking for gl/gl.h and GL/gl.h), so this is most likely not the best thing to do. Someone with more experience with Module::Build than myself will have to be the judge of that. Alternatively, if there was a way to specify multiple paths to be -I'ed as the result of one search, that might be better. Andy Bakun
