wx: fix build issue when GL/glu.h is not present
Currently the build of wx fails if GL/gl.h is present but GL/glu.h is not. This may happen, for example, in macOS if the homebrew mesa package is installed.
This change ensures that both GL/gl.h and GL/glu.h are present before including them.
CT Test Results
2 files 17 suites 3m 47s :stopwatch: 152 tests 147 :heavy_check_mark: 5 :zzz: 0 :x: 167 runs 162 :heavy_check_mark: 5 :zzz: 0 :x:
Results for commit 55cc5a4a.
:recycle: This comment has been updated with latest results.
To speed up review, make sure that you have read Contributing to Erlang/OTP and that all checks pass.
See the TESTING and DEVELOPMENT HowTo guides for details about how to run test locally.
Artifacts
// Erlang/OTP Github Action Bot
Can you make it so that only glu is skipped if the header is not there, since glu is kind of unusable if a modern opengl is used.
Also please rebase on top of maint branch so that it can be included in the next maintenance release
Can you make it so that only glu is skipped if the header is not there, since glu is kind of unusable if a modern opengl is used.
I'm not clear on the specifics of different GL / OpenGL headers on different platforms, so the idea behind this PR was simply to prevent build failures by ensuring that the glu.h file was detected by configure before it is included, without breaking anything else or changing the order of the #ifdef.
In my particular scenario, the build was failing on macOS if the Homebrew mesa formula was installed (but not mesa-glu), so GL/gl.h (from mesa), OpenGL/gl.h and OpenGL/glu.h (from Xcode Command Line Tools macOS 12.3 SDK OpenGL.framework) were present but not GL/glu.h. In this scenario, with this patch, the OpenGL headers can be used, the build succeeds, wx and observer work.
Having said that, it's worth nothing that OpenGL was deprecated in macOS 10.14, so some guidance on building otp with wx on macOS will probably be needed in the near future. Maybe Hombrew mesa and mesa-glu is the way to go?
Also please rebase on top of maint branch so that it can be included in the next maintenance release
Done.
Thanks