--- configure.orig	2025-02-24 13:19:10
+++ configure	2025-10-29 11:18:00
@@ -13035,9 +13035,33 @@
 
 
 as_fn_error $? "*** Unable to locate OpenGL library." "$LINENO" 5
+
+
+
+fi
+
+LIBS=${ac_save_libs}
+LDFLAGS=${ac_save_ldflags}
+
+
+ac_save_libs="$LIBS"
+ac_save_ldflags="$LDFLAGS"
+LIBS="-framework AGL  $LIBS"
+LDFLAGS="$OPENGLPATH $LDFLAGS"
+ac_fn_c_check_func "$LINENO" "aglDestroyPixelFormat" "ac_cv_func_aglDestroyPixelFormat"
+if test "x$ac_cv_func_aglDestroyPixelFormat" = xyes
+then :
 
+OPENGLLIB="$OPENGLLIB -framework AGL"
 
+printf "%s\n" "#define OPENGL_AGL 1" >>confdefs.h
 
+
+
+else $as_nop
+
+:
+
 fi
 
 LIBS=${ac_save_libs}
--- configure.ac.orig	2025-02-24 13:19:10
+++ configure.ac	2025-10-29 11:17:50
@@ -1440,6 +1440,10 @@
 LOC_CHECK_INCLUDES(OpenGL/gl.h OpenGL/glu.h,OpenGL,$OPENGLPATH)
 
 LOC_CHECK_FUNC(glBegin,OpenGL library,OPENGLLIB,-framework OpenGL -framework AGL -framework ApplicationServices,$OPENGLPATH)
+LOC_CHECK_FUNC(aglDestroyPixelFormat,[OpenGL library (AGL)],OPENGLLIB,[-framework AGL],$OPENGLPATH,,[
+  [OPENGLLIB="$OPENGLLIB -framework AGL"]
+  AC_DEFINE(OPENGL_AGL,1,[Define to 1 if OpenGL uses AGL (MacOS X).])
+  ],[:])
 LOC_CHECK_FUNC(gluBeginCurve,GLU library,OPENGLLIB,,$OPENGLPATH,$OPENGLLIB)
 
 OPENGLINC="$OPENGLPATH"
--- include/grass/config.h.in.orig	2025-02-24 13:19:10
+++ include/grass/config.h.in	2025-10-29 11:18:49
@@ -293,6 +293,9 @@
 /* Define to 1 if you have the <zstd.h> header file. */
 #undef HAVE_ZSTD_H
 
+/* Define to 1 if OpenGL uses AGL (MacOS X). */
+#undef OPENGL_AGL
+
 /* Define to 1 if OpenGL uses Aqua (MacOS X). */
 #undef OPENGL_AQUA
 
