From patchwork Fri Mar 16 17:12:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Engestrom X-Patchwork-Id: 10289525 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C1DB660386 for ; Fri, 16 Mar 2018 17:12:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 774642521E for ; Fri, 16 Mar 2018 17:12:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6C17328647; Fri, 16 Mar 2018 17:12:48 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 2001F2521E for ; Fri, 16 Mar 2018 17:12:48 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8D9BD6EBB8; Fri, 16 Mar 2018 17:12:46 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mailapp01.imgtec.com (mailapp01.imgtec.com [195.59.15.196]) by gabe.freedesktop.org (Postfix) with ESMTP id 9B0306EBB8 for ; Fri, 16 Mar 2018 17:12:43 +0000 (UTC) Received: from hhmail02.hh.imgtec.org (unknown [10.100.10.20]) by Forcepoint Email with ESMTPS id 5E067D033F68F; Fri, 16 Mar 2018 17:12:38 +0000 (GMT) Received: from localhost.localdomain (10.60.4.28) by hhmail02.hh.imgtec.org (10.100.10.21) with Microsoft SMTP Server (TLS) id 14.3.382.0; Fri, 16 Mar 2018 17:12:41 +0000 From: Eric Engestrom To: Subject: [PATCH libdrm 3/4] meson,configure: always define UDEV Date: Fri, 16 Mar 2018 17:12:26 +0000 Message-ID: <20180316171227.2968-3-eric.engestrom@imgtec.com> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180316171227.2968-1-eric.engestrom@imgtec.com> References: <20180316171227.2968-1-eric.engestrom@imgtec.com> MIME-Version: 1.0 X-Originating-IP: [10.60.4.28] X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Dylan Baker Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Eric Engestrom Reviewed-by: Emil Velikov --- configure.ac | 2 ++ meson.build | 2 +- xf86drm.c | 8 ++++---- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/configure.ac b/configure.ac index 14baa1c87f9078f336fa..619af49726d198c5d685 100644 --- a/configure.ac +++ b/configure.ac @@ -347,6 +347,8 @@ AC_SUBST(PCIACCESS_LIBS) if test "x$UDEV" = xyes; then AC_DEFINE(UDEV, 1, [Have UDEV support]) +else + AC_DEFINE(UDEV, 0) fi AC_CANONICAL_HOST diff --git a/meson.build b/meson.build index 8d4d38b46ebcf75b9fb6..0fe04a1411963c70cf80 100644 --- a/meson.build +++ b/meson.build @@ -165,9 +165,9 @@ if _libkms != 'false' with_libkms = _libkms == 'true' or ['linux', 'freebsd', 'dragonfly'].contains(host_machine.system()) endif +config.set10('UDEV', with_udev) if with_udev dep_udev = dependency('udev') - config.set10('UDEV', true) else dep_udev = [] endif diff --git a/xf86drm.c b/xf86drm.c index 117b0fc9e4a0158cf384..689e8fe9fe356957f03e 100644 --- a/xf86drm.c +++ b/xf86drm.c @@ -290,7 +290,7 @@ static int drmMatchBusID(const char *id1, const char *id2, int pci_domain_ok) * If any other failure happened then it will output error mesage using * drmMsg() call. */ -#if !defined(UDEV) +#if !UDEV static int chown_check_return(const char *path, uid_t owner, gid_t group) { int rv; @@ -329,7 +329,7 @@ static int drmOpenDevice(dev_t dev, int minor, int type) int fd; mode_t devmode = DRM_DEV_MODE, serv_mode; gid_t serv_group; -#if !defined(UDEV) +#if !UDEV int isroot = !geteuid(); uid_t user = DRM_DEV_UID; gid_t group = DRM_DEV_GID; @@ -358,7 +358,7 @@ static int drmOpenDevice(dev_t dev, int minor, int type) devmode &= ~(S_IXUSR|S_IXGRP|S_IXOTH); } -#if !defined(UDEV) +#if !UDEV if (stat(DRM_DIR_NAME, &st)) { if (!isroot) return DRM_ERR_NOT_ROOT; @@ -411,7 +411,7 @@ static int drmOpenDevice(dev_t dev, int minor, int type) if (fd >= 0) return fd; -#if !defined(UDEV) +#if !UDEV /* Check if the device node is not what we expect it to be, and recreate it * and try again if so. */