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>
main
Mike Frysinger 2016-06-21 12:18:15 -04:00 committed by Emil Velikov
parent 50d3c85bdb
commit 8c8d5dd76f
3 changed files with 11 additions and 4 deletions

View File

@ -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])

View File

@ -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"

View File

@ -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>