summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2016-06-21 12:18:15 -0400
committerEmil Velikov <emil.l.velikov@gmail.com>2016-07-06 16:58:38 +0100
commit8c8d5dd76fb80637031e824a48ceaa0f9f65d2dd (patch)
tree1e270c4f8ec18d4c7e7b27b11e2d0f0f61442989
parent50d3c85bdb4ac0b3d546336605a722889aff7066 (diff)
pull in sys/sysmacros.h when available
This header provides major/minor/makedev funcs under most Linux C libs. Pull it in to fix building with newer versions that drop the implicit include via sys/types.h. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94231 Signed-off-by: Mike Frysinger <vapier@gentoo.org>
-rw-r--r--configure.ac3
-rw-r--r--libkms/linux.c5
-rw-r--r--xf86drm.c7
3 files changed, 11 insertions, 4 deletions
diff --git a/configure.ac b/configure.ac
index a04ce877..90fc455e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -53,7 +53,8 @@ AC_USE_SYSTEM_EXTENSIONS
AC_SYS_LARGEFILE
AC_FUNC_ALLOCA
-AC_CHECK_HEADERS([sys/mkdev.h sys/sysctl.h sys/select.h])
+AC_HEADER_MAJOR
+AC_CHECK_HEADERS([sys/sysctl.h sys/select.h])
# Initialize libtool
LT_PREREQ([2.2])
diff --git a/libkms/linux.c b/libkms/linux.c
index 6e0da830..69eb1aa4 100644
--- a/libkms/linux.c
+++ b/libkms/linux.c
@@ -41,9 +41,12 @@
#include <unistd.h>
#include <sys/stat.h>
#include <sys/types.h>
-#ifdef HAVE_SYS_MKDEV_H
+#ifdef MAJOR_IN_MKDEV
#include <sys/mkdev.h>
#endif
+#ifdef MAJOR_IN_SYSMACROS
+#include <sys/sysmacros.h>
+#endif
#include "libdrm_macros.h"
#include "internal.h"
diff --git a/xf86drm.c b/xf86drm.c
index e99f2e2d..8a858efa 100644
--- a/xf86drm.c
+++ b/xf86drm.c
@@ -54,8 +54,11 @@
#include <sys/ioctl.h>
#include <sys/time.h>
#include <stdarg.h>
-#ifdef HAVE_SYS_MKDEV_H
-# include <sys/mkdev.h> /* defines major(), minor(), and makedev() on Solaris */
+#ifdef MAJOR_IN_MKDEV
+#include <sys/mkdev.h>
+#endif
+#ifdef MAJOR_IN_SYSMACROS
+#include <sys/sysmacros.h>
#endif
#include <math.h>