x11: On macOS, look for X11 install in /opt/X11 instead of /usr/X11R6. This is where Apple installs XQuartz now (and apparently, the compatibility symlink at /usr/X11R6 can be missing). Fixes Bugzilla #4706.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128
diff --git a/configure b/configure
index 906c619..8c029f6 100755
--- a/configure
+++ b/configure
@@ -19886,10 +19886,10 @@ fi
# This isn't necessary for X11, but fixes GLX detection
if test "x$x_includes" = xNONE && \
test "x$x_libraries" = xNONE && \
- test -d /usr/X11R6/include && \
- test -d /usr/X11R6/lib; then
- x_includes="/usr/X11R6/include"
- x_libraries="/usr/X11R6/lib"
+ test -d /opt/X11/include && \
+ test -d /opt/X11/lib; then
+ x_includes="/opt/X11/include"
+ x_libraries="/opt/X11/lib"
fi
;;
esac
@@ -20587,15 +20587,16 @@ fi
case "$host" in
*-*-darwin*)
- x11_lib='/usr/X11R6/lib/libX11.6.dylib'
- x11ext_lib='/usr/X11R6/lib/libXext.6.dylib'
- xcursor_lib='/usr/X11R6/lib/libXcursor.1.dylib'
- xinerama_lib='/usr/X11R6/lib/libXinerama.1.dylib'
- xinput_lib='/usr/X11R6/lib/libXi.6.dylib'
- xrandr_lib='/usr/X11R6/lib/libXrandr.2.dylib'
- xrender_lib='/usr/X11R6/lib/libXrender.1.dylib'
- xss_lib='/usr/X11R6/lib/libXss.1.dylib'
- xvidmode_lib='/usr/X11R6/lib/libXxf86vm.1.dylib'
+ # Apple now puts this in /opt/X11
+ x11_lib='/opt/X11/lib/libX11.6.dylib'
+ x11ext_lib='/opt/X11/lib/libXext.6.dylib'
+ xcursor_lib='/opt/X11/lib/libXcursor.1.dylib'
+ xinerama_lib='/opt/X11/lib/libXinerama.1.dylib'
+ xinput_lib='/opt/X11/lib/libXi.6.dylib'
+ xrandr_lib='/opt/X11/lib/libXrandr.2.dylib'
+ xrender_lib='/opt/X11/lib/libXrender.1.dylib'
+ xss_lib='/opt/X11/lib/libXss.1.dylib'
+ xvidmode_lib='/opt/X11/lib/libXxf86vm.1.dylib'
;;
*-*-openbsd*)
x11_lib='libX11.so'
diff --git a/configure.ac b/configure.ac
index 4d64449..13c3b02 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1610,10 +1610,10 @@ AS_HELP_STRING([--enable-video-x11], [use X11 video driver [[default=yes]]]),
# This isn't necessary for X11, but fixes GLX detection
if test "x$x_includes" = xNONE && \
test "x$x_libraries" = xNONE && \
- test -d /usr/X11R6/include && \
- test -d /usr/X11R6/lib; then
- x_includes="/usr/X11R6/include"
- x_libraries="/usr/X11R6/lib"
+ test -d /opt/X11/include && \
+ test -d /opt/X11/lib; then
+ x_includes="/opt/X11/include"
+ x_libraries="/opt/X11/lib"
fi
;;
esac
@@ -1626,15 +1626,16 @@ AS_HELP_STRING([--enable-x11-shared], [dynamically load X11 support [[default=ma
case "$host" in
*-*-darwin*)
- x11_lib='/usr/X11R6/lib/libX11.6.dylib'
- x11ext_lib='/usr/X11R6/lib/libXext.6.dylib'
- xcursor_lib='/usr/X11R6/lib/libXcursor.1.dylib'
- xinerama_lib='/usr/X11R6/lib/libXinerama.1.dylib'
- xinput_lib='/usr/X11R6/lib/libXi.6.dylib'
- xrandr_lib='/usr/X11R6/lib/libXrandr.2.dylib'
- xrender_lib='/usr/X11R6/lib/libXrender.1.dylib'
- xss_lib='/usr/X11R6/lib/libXss.1.dylib'
- xvidmode_lib='/usr/X11R6/lib/libXxf86vm.1.dylib'
+ # Apple now puts this in /opt/X11
+ x11_lib='/opt/X11/lib/libX11.6.dylib'
+ x11ext_lib='/opt/X11/lib/libXext.6.dylib'
+ xcursor_lib='/opt/X11/lib/libXcursor.1.dylib'
+ xinerama_lib='/opt/X11/lib/libXinerama.1.dylib'
+ xinput_lib='/opt/X11/lib/libXi.6.dylib'
+ xrandr_lib='/opt/X11/lib/libXrandr.2.dylib'
+ xrender_lib='/opt/X11/lib/libXrender.1.dylib'
+ xss_lib='/opt/X11/lib/libXss.1.dylib'
+ xvidmode_lib='/opt/X11/lib/libXxf86vm.1.dylib'
;;
*-*-openbsd*)
x11_lib='libX11.so'
diff --git a/include/SDL_config_macosx.h b/include/SDL_config_macosx.h
index 254c36d..2035f2d 100644
--- a/include/SDL_config_macosx.h
+++ b/include/SDL_config_macosx.h
@@ -159,13 +159,13 @@
#define SDL_VIDEO_DRIVER_COCOA 1
#define SDL_VIDEO_DRIVER_DUMMY 1
#undef SDL_VIDEO_DRIVER_X11
-#define SDL_VIDEO_DRIVER_X11_DYNAMIC "/usr/X11R6/lib/libX11.6.dylib"
-#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT "/usr/X11R6/lib/libXext.6.dylib"
-#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XINERAMA "/usr/X11R6/lib/libXinerama.1.dylib"
-#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT2 "/usr/X11R6/lib/libXi.6.dylib"
-#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR "/usr/X11R6/lib/libXrandr.2.dylib"
-#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS "/usr/X11R6/lib/libXss.1.dylib"
-#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XVIDMODE "/usr/X11R6/lib/libXxf86vm.1.dylib"
+#define SDL_VIDEO_DRIVER_X11_DYNAMIC "/opt/X11/lib/libX11.6.dylib"
+#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT "/opt/X11/lib/libXext.6.dylib"
+#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XINERAMA "/opt/X11/lib/libXinerama.1.dylib"
+#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT2 "/opt/X11/lib/libXi.6.dylib"
+#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR "/opt/X11/lib/libXrandr.2.dylib"
+#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS "/opt/X11/lib/libXss.1.dylib"
+#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XVIDMODE "/opt/X11/lib/libXxf86vm.1.dylib"
#define SDL_VIDEO_DRIVER_X11_XDBE 1
#define SDL_VIDEO_DRIVER_X11_XINERAMA 1
#define SDL_VIDEO_DRIVER_X11_XRANDR 1
diff --git a/src/video/x11/SDL_x11opengl.c b/src/video/x11/SDL_x11opengl.c
index da72e91..d3e2e7d 100644
--- a/src/video/x11/SDL_x11opengl.c
+++ b/src/video/x11/SDL_x11opengl.c
@@ -36,7 +36,7 @@
/* IRIX doesn't have a GL library versioning system */
#define DEFAULT_OPENGL "libGL.so"
#elif defined(__MACOSX__)
-#define DEFAULT_OPENGL "/usr/X11R6/lib/libGL.1.dylib"
+#define DEFAULT_OPENGL "/opt/X11/lib/libGL.1.dylib"
#elif defined(__QNXNTO__)
#define DEFAULT_OPENGL "libGL.so.3"
#else