xorg-wrapper: fix build without libdrm
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
This commit is contained in:
parent
a4cd8ee5f8
commit
08c4912406
|
@ -926,8 +926,6 @@ fi
|
||||||
AM_CONDITIONAL(SYSTEMD_LOGIND, [test "x$SYSTEMD_LOGIND" = xyes])
|
AM_CONDITIONAL(SYSTEMD_LOGIND, [test "x$SYSTEMD_LOGIND" = xyes])
|
||||||
|
|
||||||
if test "x$SUID_WRAPPER" = xyes; then
|
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 This is a define so that if some platforms want to put the wrapper
|
||||||
dnl somewhere else this can be easily changed
|
dnl somewhere else this can be easily changed
|
||||||
AC_DEFINE_DIR(SUID_WRAPPER_DIR, libexecdir, [Where to install the Xorg binary and Xorg.wrap])
|
AC_DEFINE_DIR(SUID_WRAPPER_DIR, libexecdir, [Where to install the Xorg binary and Xorg.wrap])
|
||||||
|
|
|
@ -39,8 +39,10 @@
|
||||||
#include <sys/consio.h>
|
#include <sys/consio.h>
|
||||||
#endif
|
#endif
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#ifdef WITH_LIBDRM
|
||||||
#include <drm.h>
|
#include <drm.h>
|
||||||
#include <xf86drm.h> /* For DRM_DEV_NAME */
|
#include <xf86drm.h> /* For DRM_DEV_NAME */
|
||||||
|
#endif
|
||||||
|
|
||||||
#define CONFIG_FILE SYSCONFDIR "/X11/Xwrapper.config"
|
#define CONFIG_FILE SYSCONFDIR "/X11/Xwrapper.config"
|
||||||
|
|
||||||
|
@ -183,7 +185,9 @@ static int on_console(int fd)
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
|
#ifdef WITH_LIBDRM
|
||||||
struct drm_mode_card_res res;
|
struct drm_mode_card_res res;
|
||||||
|
#endif
|
||||||
char buf[PATH_MAX];
|
char buf[PATH_MAX];
|
||||||
int i, r, fd;
|
int i, r, fd;
|
||||||
int kms_cards = 0;
|
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 */
|
/* Detect if we need root rights, except when overriden by the config */
|
||||||
if (needs_root_rights == -1) {
|
if (needs_root_rights == -1) {
|
||||||
for (i = 0; i < 16; i++) {
|
for (i = 0; i < 16; i++) {
|
||||||
|
@ -237,6 +242,7 @@ int main(int argc, char *argv[])
|
||||||
close(fd);
|
close(fd);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* If we've found cards, and all cards support kms, drop root rights */
|
/* If we've found cards, and all cards support kms, drop root rights */
|
||||||
if (needs_root_rights == 0 || (total_cards && kms_cards == total_cards)) {
|
if (needs_root_rights == 0 || (total_cards && kms_cards == total_cards)) {
|
||||||
|
|
Loading…
Reference in New Issue