https://github.com/NGSolve/netgen/issues/173

--- libsrc/include/incopengl.hpp	2023-12-23 05:42:55.000000000 +0800
+++ libsrc/include/incopengl.hpp	2024-01-04 00:51:24.000000000 +0800
@@ -5,16 +5,20 @@
 #include <mystdlib.h>
 #include <mydefs.hpp>
 
-#  ifdef __APPLE__
-#define GL_SILENCE_DEPRECATION
-#define GL_DO_NOT_WARN_IF_MULTI_GL_VERSION_HEADERS_INCLUDED
+#ifdef __APPLE__
+#  include <AvailabilityMacros.h>
+#  define GL_SILENCE_DEPRECATION
+#  define GL_DO_NOT_WARN_IF_MULTI_GL_VERSION_HEADERS_INCLUDED
+#  if MAC_OS_X_VERSION_MIN_REQUIRED > 1060
 #    include <OpenGL/gl3.h>
-#    include <OpenGL/glu.h>
 #  else
-#    include <GL/gl.h>
-#    include <GL/glu.h>
+#    include <OpenGL/gl.h>
 #  endif
-
+#  include <OpenGL/glu.h>
+#else
+#  include <GL/gl.h>
+#  include <GL/glu.h>
+#endif
 
 #ifdef TOGL_X11
 // parallel
