--- a/wine-1.9.7/configure.ac 2016-04-16 14:55:02.188173321 +0900 +++ a/wine-1.9.7/configure.ac 2016-04-16 14:55:24.165887965 +0900 @@ -538,6 +538,7 @@ valgrind/valgrind.h \ zlib.h ) +AC_HEADER_MAJOR() AC_HEADER_STAT() dnl **** Checks for headers that depend on other ones **** --- a/wine-1.9.7/dlls/ntdll/cdrom.c 2016-04-16 14:55:02.296171884 +0900 +++ a/wine-1.9.7/dlls/ntdll/cdrom.c 2016-04-16 14:56:58.121825128 +0900 @@ -38,6 +38,11 @@ #ifdef HAVE_SYS_STAT_H # include #endif +#if defined(MAJOR_IN_MKDEV) +#include +#elif defined(MAJOR_IN_SYSMACROS) +#include +#endif #include #ifdef HAVE_SYS_IOCTL_H --- a/wine-1.9.7/dlls/ntdll/directory.c 2016-04-16 14:55:02.297171871 +0900 +++ a/wine-1.9.7/dlls/ntdll/directory.c 2016-04-16 14:56:43.290995026 +0900 @@ -30,6 +30,11 @@ #undef HAVE_GETDIRENTRIES #include +#if defined(MAJOR_IN_MKDEV) +#include +#elif defined(MAJOR_IN_SYSMACROS) +#include +#endif #include #ifdef HAVE_DIRENT_H # include --- a/wine-1.9.7/dlls/ntdll/file.c 2016-04-16 14:55:02.298171858 +0900 +++ a/wine-1.9.7/dlls/ntdll/file.c 2016-04-16 14:56:30.690138779 +0900 @@ -57,6 +57,11 @@ #ifdef HAVE_SYS_SOCKET_H #include #endif +#if defined(MAJOR_IN_MKDEV) +#include +#elif defined(MAJOR_IN_SYSMACROS) +#include +#endif #ifdef HAVE_UTIME_H # include #endif --- a/wine-1.9.7/server/fd.c 2016-04-16 14:55:02.365170966 +0900 +++ a/wine-1.9.7/server/fd.c 2016-04-16 14:56:15.058316320 +0900 @@ -83,6 +83,11 @@ #endif #include #include +#if defined(MAJOR_IN_MKDEV) +#include +#elif defined(MAJOR_IN_SYSMACROS) +#include +#endif #include #include #ifdef HAVE_SYS_SYSCALL_H