[PATCH] xorg-wrapper: fix build without libdrm

Hans de Goede hdegoede at redhat.com
Mon Oct 19 01:44:30 PDT 2015


Hi,

On 18-10-15 18:48, Samuel Thibault wrote:
> Signed-off-by: Samuel Thibault <samuel.thibault at ens-lyon.org>
> ---
>   configure.ac              | 2 --
>   hw/xfree86/xorg-wrapper.c | 6 ++++++
>   2 files changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/configure.ac b/configure.ac
> index e434720..818026f 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -921,8 +921,6 @@ fi
>   AM_CONDITIONAL(SYSTEMD_LOGIND, [test "x$SYSTEMD_LOGIND" = xyes])
>
>   if test "x$SUID_WRAPPER" = xyes; then
> -        dnl The wrapper uses libdrm headers, so ensure they are available
> -        PKG_CHECK_MODULES([LIBDRM], $LIBDRM)
>           dnl This is a define so that if some platforms want to put the wrapper
>           dnl somewhere else this can be easily changed
>           AC_DEFINE_DIR(SUID_WRAPPER_DIR, libexecdir, [Where to install the Xorg binary and Xorg.wrap])
> diff --git a/hw/xfree86/xorg-wrapper.c b/hw/xfree86/xorg-wrapper.c
> index 22e97ad..75d120a 100644
> --- a/hw/xfree86/xorg-wrapper.c
> +++ b/hw/xfree86/xorg-wrapper.c
> @@ -39,8 +39,10 @@
>   #include <sys/consio.h>
>   #endif
>   #include <unistd.h>
> +#ifdef WITH_LIBDRM
>   #include <drm.h>
>   #include <xf86drm.h> /* For DRM_DEV_NAME */
> +#endif
>
>   #define CONFIG_FILE SYSCONFDIR "/X11/Xwrapper.config"
>
> @@ -183,7 +185,9 @@ static int on_console(int fd)
>
>   int main(int argc, char *argv[])
>   {
> +#ifdef WITH_LIBDRM
>       struct drm_mode_card_res res;
> +#endif
>       char buf[PATH_MAX];
>       int i, r, fd;
>       int kms_cards = 0;
> @@ -219,6 +223,7 @@ int main(int argc, char *argv[])
>           }
>       }
>
> +#ifdef WITH_LIBDRM
>       /* Detect if we need root rights, except when overriden by the config */
>       if (needs_root_rights == -1) {
>           for (i = 0; i < 16; i++) {
> @@ -237,6 +242,7 @@ int main(int argc, char *argv[])
>               close(fd);
>           }
>       }
> +#endif
>

This turns needs_root_rights=auto into needs_root_rights=yes do we really want that
when not building with libdrm ?

Regards,

Hans


More information about the xorg-devel mailing list