From 5943ca5a1dd1858e2052a46c3f079cda1257abbe Mon Sep 17 00:00:00 2001 From: stefan11111 Date: Sat, 20 Sep 2025 13:45:06 +0300 Subject: [PATCH] os: Fix builds with `-Dxdmcp=false` Fixes: https://github.com/X11Libre/xserver/issues/239 Signed-off-by: stefan11111 --- include/meson.build | 2 +- meson.build | 6 ++---- os/access.c | 3 +++ os/auth.c | 3 +++ os/connection.c | 2 ++ os/meson.build | 2 +- os/utils.c | 4 ++++ os/xdmauth.c | 4 ++++ 8 files changed, 20 insertions(+), 6 deletions(-) diff --git a/include/meson.build b/include/meson.build index e9d506116..8b4b87c6c 100644 --- a/include/meson.build +++ b/include/meson.build @@ -243,7 +243,7 @@ conf_data.set('XACE', '1') conf_data.set('XCMISC', '1') conf_data.set('XCSECURITY', build_xsecurity ? '1' : false) conf_data.set('CONFIG_NAMESPACE', build_namespace ? '1' : false) -conf_data.set('XDMCP', xdmcp_dep.found() ? '1' : false) +conf_data.set('XDMCP', build_xdmcp ? '1' : false) conf_data.set('XF86BIGFONT', build_xf86bigfont ? '1' : false) conf_data.set('XF86DRI', build_dri1 ? '1' : false) conf_data.set('XF86VIDMODE', 1) diff --git a/meson.build b/meson.build index 2a57bfc29..cd02a8f14 100644 --- a/meson.build +++ b/meson.build @@ -427,10 +427,8 @@ else endif endif -xdmcp_dep = dependency('', required : false) -if get_option('xdmcp') - xdmcp_dep = dependency('xdmcp') -endif +build_xdmcp = get_option('xdmcp') +xdmcp_dep = dependency('xdmcp', required : build_xdmcp) has_xdm_auth = get_option('xdm-auth-1') diff --git a/os/access.c b/os/access.c index 0dbaf22ea..a2612c1ad 100644 --- a/os/access.c +++ b/os/access.c @@ -180,7 +180,10 @@ SOFTWARE. #include "dixstruct.h" #include "xace.h" + +#ifdef XDMCP #include "xdmcp.h" +#endif Bool defeatAccessControl = FALSE; diff --git a/os/auth.c b/os/auth.c index 28b2c6246..71871ef40 100644 --- a/os/auth.c +++ b/os/auth.c @@ -48,7 +48,10 @@ from The Open Group. #include "os/auth.h" +#ifdef XDMCP #include "xdmcp.h" +#endif + #include "xdmauth.h" #include "mitauth.h" diff --git a/os/connection.c b/os/connection.c index b8e87ef2d..ba1d78a27 100644 --- a/os/connection.c +++ b/os/connection.c @@ -115,7 +115,9 @@ SOFTWARE. #include #endif +#ifdef XDMCP #include "xdmcp.h" +#endif #define MAX_CONNECTIONS (1<<16) diff --git a/os/meson.build b/os/meson.build index 6257e420c..2f210c933 100644 --- a/os/meson.build +++ b/os/meson.build @@ -55,7 +55,7 @@ if conf_data.get('HAVE_SIGACTION').to_int() != 0 srcs_os += 'busfault.c' endif -if get_option('xdmcp') +if build_xdmcp srcs_os += 'xdmcp.c' endif diff --git a/os/utils.c b/os/utils.c index 3c4fb9b7d..68b9f5b24 100644 --- a/os/utils.c +++ b/os/utils.c @@ -70,7 +70,11 @@ OR PERFORMANCE OF THIS SOFTWARE. #include "dixfont.h" #include #include "osdep.h" + +#ifdef XDMCP #include "xdmcp.h" +#endif + #include "extension.h" #include #ifndef WIN32 diff --git a/os/xdmauth.c b/os/xdmauth.c index 1ff7ab75c..1ed48e3da 100644 --- a/os/xdmauth.c +++ b/os/xdmauth.c @@ -43,7 +43,11 @@ from The Open Group. #include "os.h" #include "osdep.h" + +#ifdef XDMCP #include "xdmcp.h" +#endif + #include "xdmauth.h" #include "dixstruct.h"