x11: On macOS, look for X11 install in /opt/X11 instead of /usr/X11R6.
authorRyan C. Gordon <icculus@icculus.org>
Tue, 15 Oct 2019 22:36:08 -0400
changeset 13130502bb7d04f0a
parent 13129 b0f1f9e5cb63
child 13131 5f88f7095b8a
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.
configure
configure.ac
include/SDL_config_macosx.h
src/video/x11/SDL_x11opengl.c
     1.1 --- a/configure	Tue Oct 15 14:55:09 2019 -0400
     1.2 +++ b/configure	Tue Oct 15 22:36:08 2019 -0400
     1.3 @@ -19886,10 +19886,10 @@
     1.4                  # This isn't necessary for X11, but fixes GLX detection
     1.5                  if test "x$x_includes" = xNONE && \
     1.6                     test "x$x_libraries" = xNONE && \
     1.7 -                   test -d /usr/X11R6/include && \
     1.8 -                   test -d /usr/X11R6/lib; then
     1.9 -                    x_includes="/usr/X11R6/include"
    1.10 -                    x_libraries="/usr/X11R6/lib"
    1.11 +                   test -d /opt/X11/include && \
    1.12 +                   test -d /opt/X11/lib; then
    1.13 +                    x_includes="/opt/X11/include"
    1.14 +                    x_libraries="/opt/X11/lib"
    1.15                  fi
    1.16                  ;;
    1.17          esac
    1.18 @@ -20587,15 +20587,16 @@
    1.19  
    1.20              case "$host" in
    1.21                  *-*-darwin*)
    1.22 -                    x11_lib='/usr/X11R6/lib/libX11.6.dylib'
    1.23 -                    x11ext_lib='/usr/X11R6/lib/libXext.6.dylib'
    1.24 -                    xcursor_lib='/usr/X11R6/lib/libXcursor.1.dylib'
    1.25 -                    xinerama_lib='/usr/X11R6/lib/libXinerama.1.dylib'
    1.26 -                    xinput_lib='/usr/X11R6/lib/libXi.6.dylib'
    1.27 -                    xrandr_lib='/usr/X11R6/lib/libXrandr.2.dylib'
    1.28 -                    xrender_lib='/usr/X11R6/lib/libXrender.1.dylib'
    1.29 -                    xss_lib='/usr/X11R6/lib/libXss.1.dylib'
    1.30 -                    xvidmode_lib='/usr/X11R6/lib/libXxf86vm.1.dylib'
    1.31 +                    # Apple now puts this in /opt/X11
    1.32 +                    x11_lib='/opt/X11/lib/libX11.6.dylib'
    1.33 +                    x11ext_lib='/opt/X11/lib/libXext.6.dylib'
    1.34 +                    xcursor_lib='/opt/X11/lib/libXcursor.1.dylib'
    1.35 +                    xinerama_lib='/opt/X11/lib/libXinerama.1.dylib'
    1.36 +                    xinput_lib='/opt/X11/lib/libXi.6.dylib'
    1.37 +                    xrandr_lib='/opt/X11/lib/libXrandr.2.dylib'
    1.38 +                    xrender_lib='/opt/X11/lib/libXrender.1.dylib'
    1.39 +                    xss_lib='/opt/X11/lib/libXss.1.dylib'
    1.40 +                    xvidmode_lib='/opt/X11/lib/libXxf86vm.1.dylib'
    1.41                      ;;
    1.42                  *-*-openbsd*)
    1.43                      x11_lib='libX11.so'
     2.1 --- a/configure.ac	Tue Oct 15 14:55:09 2019 -0400
     2.2 +++ b/configure.ac	Tue Oct 15 22:36:08 2019 -0400
     2.3 @@ -1610,10 +1610,10 @@
     2.4                  # This isn't necessary for X11, but fixes GLX detection
     2.5                  if test "x$x_includes" = xNONE && \
     2.6                     test "x$x_libraries" = xNONE && \
     2.7 -                   test -d /usr/X11R6/include && \
     2.8 -                   test -d /usr/X11R6/lib; then
     2.9 -                    x_includes="/usr/X11R6/include"
    2.10 -                    x_libraries="/usr/X11R6/lib"
    2.11 +                   test -d /opt/X11/include && \
    2.12 +                   test -d /opt/X11/lib; then
    2.13 +                    x_includes="/opt/X11/include"
    2.14 +                    x_libraries="/opt/X11/lib"
    2.15                  fi
    2.16                  ;;
    2.17          esac
    2.18 @@ -1626,15 +1626,16 @@
    2.19  
    2.20              case "$host" in
    2.21                  *-*-darwin*)
    2.22 -                    x11_lib='/usr/X11R6/lib/libX11.6.dylib'
    2.23 -                    x11ext_lib='/usr/X11R6/lib/libXext.6.dylib'
    2.24 -                    xcursor_lib='/usr/X11R6/lib/libXcursor.1.dylib'
    2.25 -                    xinerama_lib='/usr/X11R6/lib/libXinerama.1.dylib'
    2.26 -                    xinput_lib='/usr/X11R6/lib/libXi.6.dylib'
    2.27 -                    xrandr_lib='/usr/X11R6/lib/libXrandr.2.dylib'
    2.28 -                    xrender_lib='/usr/X11R6/lib/libXrender.1.dylib'
    2.29 -                    xss_lib='/usr/X11R6/lib/libXss.1.dylib'
    2.30 -                    xvidmode_lib='/usr/X11R6/lib/libXxf86vm.1.dylib'
    2.31 +                    # Apple now puts this in /opt/X11
    2.32 +                    x11_lib='/opt/X11/lib/libX11.6.dylib'
    2.33 +                    x11ext_lib='/opt/X11/lib/libXext.6.dylib'
    2.34 +                    xcursor_lib='/opt/X11/lib/libXcursor.1.dylib'
    2.35 +                    xinerama_lib='/opt/X11/lib/libXinerama.1.dylib'
    2.36 +                    xinput_lib='/opt/X11/lib/libXi.6.dylib'
    2.37 +                    xrandr_lib='/opt/X11/lib/libXrandr.2.dylib'
    2.38 +                    xrender_lib='/opt/X11/lib/libXrender.1.dylib'
    2.39 +                    xss_lib='/opt/X11/lib/libXss.1.dylib'
    2.40 +                    xvidmode_lib='/opt/X11/lib/libXxf86vm.1.dylib'
    2.41                      ;;
    2.42                  *-*-openbsd*)
    2.43                      x11_lib='libX11.so'
     3.1 --- a/include/SDL_config_macosx.h	Tue Oct 15 14:55:09 2019 -0400
     3.2 +++ b/include/SDL_config_macosx.h	Tue Oct 15 22:36:08 2019 -0400
     3.3 @@ -159,13 +159,13 @@
     3.4  #define SDL_VIDEO_DRIVER_COCOA  1
     3.5  #define SDL_VIDEO_DRIVER_DUMMY  1
     3.6  #undef SDL_VIDEO_DRIVER_X11
     3.7 -#define SDL_VIDEO_DRIVER_X11_DYNAMIC "/usr/X11R6/lib/libX11.6.dylib"
     3.8 -#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT "/usr/X11R6/lib/libXext.6.dylib"
     3.9 -#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XINERAMA "/usr/X11R6/lib/libXinerama.1.dylib"
    3.10 -#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT2 "/usr/X11R6/lib/libXi.6.dylib"
    3.11 -#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR "/usr/X11R6/lib/libXrandr.2.dylib"
    3.12 -#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS "/usr/X11R6/lib/libXss.1.dylib"
    3.13 -#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XVIDMODE "/usr/X11R6/lib/libXxf86vm.1.dylib"
    3.14 +#define SDL_VIDEO_DRIVER_X11_DYNAMIC "/opt/X11/lib/libX11.6.dylib"
    3.15 +#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT "/opt/X11/lib/libXext.6.dylib"
    3.16 +#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XINERAMA "/opt/X11/lib/libXinerama.1.dylib"
    3.17 +#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT2 "/opt/X11/lib/libXi.6.dylib"
    3.18 +#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR "/opt/X11/lib/libXrandr.2.dylib"
    3.19 +#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS "/opt/X11/lib/libXss.1.dylib"
    3.20 +#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XVIDMODE "/opt/X11/lib/libXxf86vm.1.dylib"
    3.21  #define SDL_VIDEO_DRIVER_X11_XDBE 1
    3.22  #define SDL_VIDEO_DRIVER_X11_XINERAMA 1
    3.23  #define SDL_VIDEO_DRIVER_X11_XRANDR 1
     4.1 --- a/src/video/x11/SDL_x11opengl.c	Tue Oct 15 14:55:09 2019 -0400
     4.2 +++ b/src/video/x11/SDL_x11opengl.c	Tue Oct 15 22:36:08 2019 -0400
     4.3 @@ -36,7 +36,7 @@
     4.4  /* IRIX doesn't have a GL library versioning system */
     4.5  #define DEFAULT_OPENGL  "libGL.so"
     4.6  #elif defined(__MACOSX__)
     4.7 -#define DEFAULT_OPENGL  "/usr/X11R6/lib/libGL.1.dylib"
     4.8 +#define DEFAULT_OPENGL  "/opt/X11/lib/libGL.1.dylib"
     4.9  #elif defined(__QNXNTO__)
    4.10  #define DEFAULT_OPENGL  "libGL.so.3"
    4.11  #else