From 68d17e05d996abcaf308610b1f4b2ca076e2ee41 Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Mon, 12 Jan 2026 14:35:30 +0100 Subject: [PATCH] drop obsolete check for SHM extension Xlibre Xserver always has SHM extension built-in, so no extra checks or fallback code pathes needed. Signed-off-by: Enrico Weigelt, metux IT consult --- configure.ac | 27 +-------------------------- meson.build | 10 ---------- test/dri3-test.c | 6 ------ test/lowlevel-blt-bench.c | 13 ------------- test/present-race.c | 6 ------ test/present-test.c | 6 ------ test/shm-test.c | 7 ------- tools/virtual.c | 6 ------ 8 files changed, 1 insertion(+), 80 deletions(-) diff --git a/configure.ac b/configure.ac index d0474cef..03ca1bf4 100644 --- a/configure.ac +++ b/configure.ac @@ -204,27 +204,8 @@ if test "x$cpuid" = "xyes"; then AC_DEFINE(HAVE_CPUID_H,1,[Found a useable cpuid.h]) fi -shm=yes -AC_CHECK_HEADERS([sys/ipc.h sys/ipc.h], [], [shm="no"]) -AC_CHECK_HEADERS([X11/extensions/XShm.h], [], [shm="no"], [ -#include -#include -]) -AC_CHECK_HEADERS([X11/extensions/shmproto.h X11/extensions/shmstr.h], [], [], [ -#include -#include -]) -if test "x$ac_cv_header_X11_extensions_shmproto_h" != "xyes" -a "x$ac_cv_header_X11_extensions_shmstr_h" != "xyes"; then - shm="no" -fi - -if test "x$shm" = "xyes"; then - AC_DEFINE([HAVE_MIT_SHM], 1, [Define to 1 if MIT-SHM is available]) -fi - PKG_CHECK_MODULES(X11_DRI3, [xcb-dri3 xcb-sync xcb-xfixes xcb-present x11-xcb xshmfence x11 xcomposite xdamage xrender xrandr xxf86vm xext libdrm], [x11_dri3="yes"], [x11_dri3="no"]) -AM_CONDITIONAL(X11_DRI3, test "x$x11_dri3" = "xyes" -a "x$shm" = "xyes") -AM_CONDITIONAL(X11_SHM, test "x$shm" = "xyes") +AM_CONDITIONAL(X11_DRI3, test "x$x11_dri3" = "xyes") PKG_CHECK_MODULES(X11_VM, [xxf86vm], [x11_vm="yes"], [x11_vm="no"]) AM_CONDITIONAL(X11_VM, test "x$x11_vm" = "xyes") @@ -233,12 +214,6 @@ AC_ARG_ENABLE(tools, AS_HELP_STRING([--disable-tools], [Enable building and installing the miscellaneous tools [default=auto]]), [tools="$enableval"], [tools="auto"]) -if test "x$shm" != "xyes"; then - if test "x$tools" = "xyes"; then - AC_MSG_ERROR([Incomplete requirements for extra tools, X11 MIT-SHM extension required]) - fi - tools="no" -fi if test "x$tools" != "xno"; then ivo_requires="xrandr xdamage xfixes xcursor xtst xrender xscrnsaver xext x11 pixman-1" extra_cflags="" diff --git a/meson.build b/meson.build index 67e7ab6e..c2fed312 100644 --- a/meson.build +++ b/meson.build @@ -107,16 +107,6 @@ if cc.links(cpuid_code, name : '__cpuid()') config.set('HAVE_CPUID_H', 1) endif -has_shm = (cc.has_header('sys/ipc.h') and - cc.has_header('X11/extensions/XShm.h') and - cc.has_header('X11/extensions/shmproto.h') and - cc.has_header('X11/extensions/shmstr.h')) -if has_shm - config.set('HAVE_MIT_SHM', 1) - config.set('HAVE_X11_EXTENSIONS_SHMPROTO_H', 1) - config.set('HAVE_X11_EXTENSIONS_SHMSTR_H', 1) -endif - if cc.has_header('X11/extensions/Xinerama.h') config.set('HAVE_X11_EXTENSIONS_XINERAMA_H', 1) endif diff --git a/test/dri3-test.c b/test/dri3-test.c index d1ed1cf5..47b85f6e 100644 --- a/test/dri3-test.c +++ b/test/dri3-test.c @@ -28,13 +28,7 @@ #include #include #include -#if HAVE_X11_EXTENSIONS_SHMPROTO_H #include -#elif HAVE_X11_EXTENSIONS_SHMSTR_H -#include -#else -#error Failed to find the right header for X11 MIT-SHM protocol definitions -#endif #include #include diff --git a/test/lowlevel-blt-bench.c b/test/lowlevel-blt-bench.c index 908c0714..6ef2d68a 100644 --- a/test/lowlevel-blt-bench.c +++ b/test/lowlevel-blt-bench.c @@ -34,15 +34,7 @@ #include /* for XDestroyImage */ #include #include -#if HAVE_MIT_SHM -#include -#if HAVE_X11_EXTENSIONS_SHMPROTO_H #include -#elif HAVE_X11_EXTENSIONS_SHMSTR_H -#include -#else -#error Failed to find the right header for X11 MIT-SHM protocol definitions -#endif #include #include #endif @@ -227,7 +219,6 @@ static Picture source_radial_generic(struct test_display *t, struct test_target return XRenderCreateRadialGradient(t->dpy, &gradient, stops, colors, 2); } -#if HAVE_MIT_SHM static XShmSegmentInfo shmref, shmout; static void setup_shm(struct test *t) @@ -290,10 +281,6 @@ static Picture source_shm(struct test_display *t, struct test_target *target) return picture; } -#else -static void setup_shm(struct test *t) { } -static Picture source_shm(struct test_display *t, struct test_target *target) { return 0; } -#endif static const struct { Picture (*create)(struct test_display *, struct test_target *); diff --git a/test/present-race.c b/test/present-race.c index d7c6a06d..56fbc514 100644 --- a/test/present-race.c +++ b/test/present-race.c @@ -34,13 +34,7 @@ #include #include #include -#if HAVE_X11_EXTENSIONS_SHMPROTO_H #include -#elif HAVE_X11_EXTENSIONS_SHMSTR_H -#include -#else -#error Failed to find the right header for X11 MIT-SHM protocol definitions -#endif #include #include #include diff --git a/test/present-test.c b/test/present-test.c index fd5dd82b..157097c2 100644 --- a/test/present-test.c +++ b/test/present-test.c @@ -34,13 +34,7 @@ #include #include #include -#if HAVE_X11_EXTENSIONS_SHMPROTO_H #include -#elif HAVE_X11_EXTENSIONS_SHMSTR_H -#include -#else -#error Failed to find the right header for X11 MIT-SHM protocol definitions -#endif #include #include #include diff --git a/test/shm-test.c b/test/shm-test.c index fa3556ec..9bedbd11 100644 --- a/test/shm-test.c +++ b/test/shm-test.c @@ -28,14 +28,7 @@ #include #include #include -#if HAVE_X11_EXTENSIONS_SHMPROTO_H #include -#elif HAVE_X11_EXTENSIONS_SHMSTR_H -#include -#else -#error Failed to find the right header for X11 MIT-SHM protocol definitions -#endif - #include #include #include diff --git a/tools/virtual.c b/tools/virtual.c index 7259b913..cf2aea29 100644 --- a/tools/virtual.c +++ b/tools/virtual.c @@ -30,13 +30,7 @@ #include #include #include -#if HAVE_X11_EXTENSIONS_SHMPROTO_H #include -#elif HAVE_X11_EXTENSIONS_SHMSTR_H -#include -#else -#error Failed to find the right header for X11 MIT-SHM protocol definitions -#endif #include #if HAVE_X11_EXTENSIONS_XINERAMA_H #include