configure.ac: Make libdrm optional in weston-launch
If libdrm is available, weston-launch and launcer-util.c will support
getting the drm device and setting and dropping drm master, otherwise
we'll only support getting input devices.
diff --git a/src/weston-launch.c b/src/weston-launch.c
index d8364c8..56e22b1 100644
--- a/src/weston-launch.c
+++ b/src/weston-launch.c
@@ -50,8 +50,6 @@
#include <grp.h>
#include <security/pam_appl.h>
-#include <xf86drm.h>
-
#ifdef HAVE_SYSTEMD_LOGIN
#include <systemd/sd-login.h>
#endif
@@ -70,6 +68,26 @@
#define MAX_ARGV_SIZE 256
+#ifdef HAVE_LIBDRM
+
+#include <xf86drm.h>
+
+#else
+
+static inline int
+drmDropMaster(int drm_fd)
+{
+ return 0;
+}
+
+static inline int
+drmSetMaster(int drm_fd)
+{
+ return 0;
+}
+
+#endif
+
struct weston_launch {
struct pam_conv pc;
pam_handle_t *ph;