The following line does not seem to work (or make sense?) on macOS: glutSetOption(GLUT_ACTION_ON_WINDOW_CLOSE, GLUT_ACTION_GLUTMAINLOOP_RETURNS); Maybe it could be replaced by something like #if defined(GLUT_ACTION_ON_WINDOW_CLOSE) glutSetOption(GLUT_ACTION_ON_WINDOW_CLOSE, GLUT_ACTION_GLUTMAINLOOP_RETURNS); #endif but I have no idea about how GLUT is supposed to work.
I forgot to include the actual error report: platform/gl/gl-main.c:1677:16: error: use of undeclared identifier 'GLUT_ACTION_ON_WINDOW_CLOSE' glutSetOption(GLUT_ACTION_ON_WINDOW_CLOSE, GLUT_ACTION_GLUTMAINLOOP_RETURNS); ^ platform/gl/gl-main.c:1677:45: error: use of undeclared identifier 'GLUT_ACTION_GLUTMAINLOOP_RETURNS' glutSetOption(GLUT_ACTION_ON_WINDOW_CLOSE, GLUT_ACTION_GLUTMAINLOOP_RETURNS); ^ I have tested on macOS 10.13. The user reporting the problem on IRC (https://ghostscript.com/mupdfirclogs/2018/03/20.html) worked around it with "HAVE_GLUT=no" (not a real solution).
There were some changes in 1.14.0. Maybe those fixed the issue (I cannot reliably test right now since I have other issues with font installation).
mupdf compiles under MacOS X now, but gives the runtime error: mupdf-gl[52876:870240] GLUT Warning: glutCurrentModifiers: do not call outside core input callback. in a loop.
*** Bug 699833 has been marked as a duplicate of this bug. ***
*** Bug 699374 has been marked as a duplicate of this bug. ***
Created attachment 18067 [details] glutGetModifiers() may only be used in on_keyboard, on_special, on_mouse and on_wheel. The messages "glutCurrentModifiers: do not call outside core input callback" are due to the use of glutGetModifiers() outside of the on_keyboard, on_special, on_mouse and on_wheel callbacks. Do we lose anything if we simply omit the calls?
Omitting glutGetModifiers from on_motion will mean that when drag selecting you cannot change select by word/line dynamically, you will have had to hold down ctl or ctl+shift at the start of the mouse down. This is not a big enough deal to worry about; I have a fix in the works.
commit e30303148f78081a8cf48a36a1ad3144897da812 Author: Tor Andersson <tor.andersson@artifex.com> Date: Mon Sep 2 15:12:21 2019 +0200 Bug 699726: Don't call glutGetModifiers from motion callbacks. The only valid callbacks for this function are the mouse and keyboard callbacks.