Fixed bug 5463 - generated Wayland interfaces are included in the library's ABI Simon McVittie In versions since 1.15, the `code` mode is a deprecated alias for `public-code`, which emits symbols with default visibility, overriding SDL's -fvisibility=hidden option. Use the `private-code` mode instead. This emits symbols with hidden visibility, so they do not affect the ABI of libSDL. See also: https://bugreports.qt.io/browse/QTBUG-73099, https://lists.freedesktop.org/archives/wayland-devel/2018-February/037097.html
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 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198
diff --git a/Makefile.in b/Makefile.in
index 57871be..6d0b7e3 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -43,6 +43,7 @@ SDLTEST_TARGET = libSDL2_test.la
SDLTEST_OBJECTS = @SDLTEST_OBJECTS@
WAYLAND_SCANNER = @WAYLAND_SCANNER@
+WAYLAND_SCANNER_CODE_MODE = @WAYLAND_SCANNER_CODE_MODE@
INSTALL_SDL2_CONFIG = @INSTALL_SDL2_CONFIG@
diff --git a/cmake/sdlchecks.cmake b/cmake/sdlchecks.cmake
index d08ad24..ea70774 100644
--- a/cmake/sdlchecks.cmake
+++ b/cmake/sdlchecks.cmake
@@ -564,7 +564,7 @@ macro(CheckX11)
endif()
endmacro()
-macro(WaylandProtocolGen _SCANNER _XML _PROTL)
+macro(WaylandProtocolGen _SCANNER _CODE_MODE _XML _PROTL)
set(_WAYLAND_PROT_C_CODE "${CMAKE_CURRENT_BINARY_DIR}/wayland-generated-protocols/${_PROTL}-protocol.c")
set(_WAYLAND_PROT_H_CODE "${CMAKE_CURRENT_BINARY_DIR}/wayland-generated-protocols/${_PROTL}-client-protocol.h")
@@ -579,7 +579,7 @@ macro(WaylandProtocolGen _SCANNER _XML _PROTL)
OUTPUT "${_WAYLAND_PROT_C_CODE}"
DEPENDS "${_WAYLAND_PROT_H_CODE}"
COMMAND "${_SCANNER}"
- ARGS code "${_XML}" "${_WAYLAND_PROT_C_CODE}"
+ ARGS "${_CODE_MODE}" "${_XML}" "${_WAYLAND_PROT_C_CODE}"
)
set(SOURCE_FILES ${SOURCE_FILES} "${_WAYLAND_PROT_C_CODE}")
@@ -594,6 +594,7 @@ endmacro()
macro(CheckWayland)
if(VIDEO_WAYLAND)
pkg_check_modules(WAYLAND wayland-client wayland-scanner wayland-egl wayland-cursor egl xkbcommon)
+ pkg_check_modules(WAYLAND_SCANNER_1_15 "wayland-scanner>=1.15")
if(WAYLAND_FOUND)
execute_process(
@@ -610,6 +611,12 @@ macro(CheckWayland)
endif()
if(WAYLAND_FOUND)
+ if(WAYLAND_SCANNER_1_15_FOUND)
+ set(WAYLAND_SCANNER_CODE_MODE "private-code")
+ else()
+ set(WAYLAND_SCANNER_CODE_MODE "code")
+ endif()
+
link_directories(
${WAYLAND_LIBRARY_DIRS}
)
@@ -629,7 +636,7 @@ macro(CheckWayland)
file(GLOB WAYLAND_PROTOCOLS_XML RELATIVE "${SDL2_SOURCE_DIR}/wayland-protocols/" "${SDL2_SOURCE_DIR}/wayland-protocols/*.xml")
foreach(_XML ${WAYLAND_PROTOCOLS_XML})
string(REGEX REPLACE "\\.xml$" "" _PROTL "${_XML}")
- WaylandProtocolGen("${WAYLAND_SCANNER}" "${SDL2_SOURCE_DIR}/wayland-protocols/${_XML}" "${_PROTL}")
+ WaylandProtocolGen("${WAYLAND_SCANNER}" "${WAYLAND_SCANNER_CODE_MODE}" "${SDL2_SOURCE_DIR}/wayland-protocols/${_XML}" "${_PROTL}")
endforeach()
if(VIDEO_WAYLAND_QT_TOUCH)
diff --git a/configure b/configure
index a4dae08..39aaee0 100755
--- a/configure
+++ b/configure
@@ -630,6 +630,7 @@ ac_includes_default="\
#endif"
ac_subst_vars='LTLIBOBJS
+WAYLAND_SCANNER_CODE_MODE
WAYLAND_SCANNER
EXTRA_LDFLAGS
BUILD_LDFLAGS
@@ -19793,6 +19794,11 @@ $as_echo_n "checking for Wayland support... " >&6; }
WAYLAND_CFLAGS=`$PKG_CONFIG --cflags wayland-client wayland-egl wayland-cursor xkbcommon`
WAYLAND_LIBS=`$PKG_CONFIG --libs wayland-client wayland-egl wayland-cursor xkbcommon`
WAYLAND_SCANNER=`$PKG_CONFIG --variable=wayland_scanner wayland-scanner`
+ if $PKG_CONFIG --exists 'wayland-scanner >= 1.15'; then :
+ WAYLAND_SCANNER_CODE_MODE=private-code
+else
+ WAYLAND_SCANNER_CODE_MODE=code
+fi
video_wayland=yes
fi
fi
@@ -22901,6 +22907,47 @@ $as_echo "#define SDL_INPUT_FBSDKBIO 1" >>confdefs.h
fi
}
+CheckInputWSCONS()
+{
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OpenBSD wscons" >&5
+$as_echo_n "checking for OpenBSD wscons... " >&6; }
+ use_input_wscons=no
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include <sys/time.h>
+ #include <dev/wscons/wsconsio.h>
+ #include <dev/wscons/wsksymdef.h>
+ #include <dev/wscons/wsksymvar.h>
+ #include <sys/ioctl.h>
+
+int
+main ()
+{
+
+ struct wskbd_map_data data;
+ ioctl(0, WSKBDIO_GETMAP, &data);
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+ use_input_wscons=yes
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $use_input_wscons" >&5
+$as_echo "$use_input_wscons" >&6; }
+ if test x$use_input_wscons = xyes; then
+
+$as_echo "#define SDL_INPUT_WSCONS 1" >>confdefs.h
+
+ SUMMARY_input="${SUMMARY_input} wscons"
+ fi
+}
+
CheckLibUDev()
{
# Check whether --enable-libudev was given.
@@ -24853,6 +24900,9 @@ $as_echo "#define SDL_VIDEO_DRIVER_ANDROID 1" >>confdefs.h
freebsd)
CheckInputKBIO
;;
+ openbsd)
+ CheckInputWSCONS
+ ;;
esac
CheckUSBHID
CheckHIDAPI
@@ -25028,6 +25078,11 @@ $as_echo "#define SDL_TIMER_UNIX 1" >>confdefs.h
SOURCES="$SOURCES $srcdir/src/core/linux/SDL_evdev_kbd.c"
SOURCES="$SOURCES $srcdir/src/core/freebsd/SDL_evdev_kbd_freebsd.c"
fi
+ # Set up files for wscons input
+ if test x$use_input_wscons = xyes; then
+ SOURCES="$SOURCES $srcdir/src/core/openbsd/SDL_wscons_kbd.c"
+ SOURCES="$SOURCES $srcdir/src/core/openbsd/SDL_wscons_mouse.c"
+ fi
# Set up other core UNIX files
SOURCES="$SOURCES $srcdir/src/core/linux/SDL_evdev_capabilities.c"
SOURCES="$SOURCES $srcdir/src/core/linux/SDL_threadprio.c"
@@ -25822,7 +25877,7 @@ if test x$video_wayland = xyes; then
echo ;\
printf '%s\n' "\\$(gen)/\$p-protocol.c: \\$(srcdir)/wayland-protocols/\$p.xml" ;\
printf '%s\n' " @\\$(SHELL) \\$(auxdir)/mkinstalldirs \\$(gen)" ;\
- printf '%s\n' " \\$(RUN_CMD_GEN)\\$(WAYLAND_SCANNER) code \\$< \\$@" ;\
+ printf '%s\n' " \\$(RUN_CMD_GEN)\\$(WAYLAND_SCANNER) \\$(WAYLAND_SCANNER_CODE_MODE) \\$< \\$@" ;\
echo ;\
printf '%s\n' "\\$(objects)/\$p-protocol.lo: \\$(gen)/\$p-protocol.c \\$(gen)/\$p-client-protocol.h" ;\
printf '%s\n' " \\$(RUN_CMD_CC)\\$(LIBTOOL) --tag=CC --mode=compile \\$(CC) \\$(CFLAGS) \\$(EXTRA_CFLAGS) $DEPENDENCY_TRACKING_OPTIONS -c \\$< -o \\$@" ;\
diff --git a/configure.ac b/configure.ac
index 898f446..cc2f064 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1539,6 +1539,9 @@ AS_HELP_STRING([--enable-video-wayland-qt-touch], [QtWayland server support for
WAYLAND_CFLAGS=`$PKG_CONFIG --cflags wayland-client wayland-egl wayland-cursor xkbcommon`
WAYLAND_LIBS=`$PKG_CONFIG --libs wayland-client wayland-egl wayland-cursor xkbcommon`
WAYLAND_SCANNER=`$PKG_CONFIG --variable=wayland_scanner wayland-scanner`
+ AS_IF([$PKG_CONFIG --exists 'wayland-scanner >= 1.15'],
+ [WAYLAND_SCANNER_CODE_MODE=private-code],
+ [WAYLAND_SCANNER_CODE_MODE=code])
video_wayland=yes
fi
fi
@@ -4381,7 +4384,7 @@ if test x$video_wayland = xyes; then
echo ;\
printf '%s\n' "\\$(gen)/\$p-protocol.c: \\$(srcdir)/wayland-protocols/\$p.xml" ;\
printf '%s\n' " @\\$(SHELL) \\$(auxdir)/mkinstalldirs \\$(gen)" ;\
- printf '%s\n' " \\$(RUN_CMD_GEN)\\$(WAYLAND_SCANNER) code \\$< \\$@" ;\
+ printf '%s\n' " \\$(RUN_CMD_GEN)\\$(WAYLAND_SCANNER) \\$(WAYLAND_SCANNER_CODE_MODE) \\$< \\$@" ;\
echo ;\
printf '%s\n' "\\$(objects)/\$p-protocol.lo: \\$(gen)/\$p-protocol.c \\$(gen)/\$p-client-protocol.h" ;\
printf '%s\n' " \\$(RUN_CMD_CC)\\$(LIBTOOL) --tag=CC --mode=compile \\$(CC) \\$(CFLAGS) \\$(EXTRA_CFLAGS) $DEPENDENCY_TRACKING_OPTIONS -c \\$< -o \\$@" ;\
@@ -4492,6 +4495,7 @@ AC_SUBST(EXTRA_CFLAGS)
AC_SUBST(BUILD_LDFLAGS)
AC_SUBST(EXTRA_LDFLAGS)
AC_SUBST(WAYLAND_SCANNER)
+AC_SUBST(WAYLAND_SCANNER_CODE_MODE)
cat >Makefile.rules <<__EOF__