So in glibc-2.23 sys/sysmacros.h is no longer included from sys/types.h
and we don't build because of the usage of major/minor/makedev macros.
Autoconf already has AC_HEADER_MAJOR macro that check where exactly
these functions/macros are defined, so let's use that.
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
dnl Support building Win32 DLLs (must appear *before* AM_PROG_LIBTOOL)
AC_LIBTOOL_WIN32_DLL
+AC_HEADER_MAJOR
+
m4_ifndef([LT_INIT], [
AM_PROG_LIBTOOL
], [
#include <sys/stat.h>
#include <sys/types.h>
+#ifdef MAJOR_IN_MKDEV
+# include <sys/mkdev.h>
+#elif MAJOR_IN_SYSMACROS
+# include <sys/sysmacros.h>
+#endif
+
#include "domain_audit.h"
#include "viraudit.h"
#include "viruuid.h"
#include <sys/wait.h>
#include <sys/socket.h>
#include <sys/types.h>
+
+#ifdef MAJOR_IN_MKDEV
+# include <sys/mkdev.h>
+#elif MAJOR_IN_SYSMACROS
+# include <sys/sysmacros.h>
+#endif
+
#include <sys/un.h>
#include <sys/personality.h>
#include <unistd.h>
#include <sys/utsname.h>
#include <string.h>
#include <sys/types.h>
+
+#ifdef MAJOR_IN_MKDEV
+# include <sys/mkdev.h>
+#elif MAJOR_IN_SYSMACROS
+# include <sys/sysmacros.h>
+#endif
+
#include <sys/socket.h>
#include <sys/stat.h>
#include <sys/un.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <sys/types.h>
+
+#ifdef MAJOR_IN_MKDEV
+# include <sys/mkdev.h>
+#elif MAJOR_IN_SYSMACROS
+# include <sys/sysmacros.h>
+#endif
+
#include <signal.h>
#include <dirent.h>
#include <unistd.h>
#include <poll.h>
#include <sys/stat.h>
#include <sys/types.h>
+
+#ifdef MAJOR_IN_MKDEV
+# include <sys/mkdev.h>
+#elif MAJOR_IN_SYSMACROS
+# include <sys/sysmacros.h>
+#endif
+
#include <sys/ioctl.h>
#include <string.h>
#include <termios.h>
# include <unistd.h>
# include <fcntl.h>
# include <sys/stat.h>
+
+# ifdef MAJOR_IN_MKDEV
+# include <sys/mkdev.h>
+# elif MAJOR_IN_SYSMACROS
+# include <sys/sysmacros.h>
+# endif
+
# include <stdarg.h>
# include "testutilslxc.h"
# include "virstring.h"