1 From ca8a08606d3f0900b3f4aa8f2e6547882a22dba8 Mon Sep 17 00:00:00 2001
2 From: Seong-ho Cho <darkcircle.0426@gmail.com>
3 Date: Mon, 18 Apr 2016 04:25:38 +0900
4 Subject: [PATCH] configure: Add AC_HEADER_MAJOR to find where major() is
7 Signed-off-by: Seong-ho Cho <darkcircle.0426@gmail.com>
8 Signed-off-by: Alexandre Julliard <julliard@winehq.org>
10 configure | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++
12 dlls/ntdll/cdrom.c | 5 +++++
13 dlls/ntdll/directory.c | 5 +++++
14 dlls/ntdll/file.c | 5 +++++
15 include/config.h.in | 8 ++++++++
17 7 files changed, 79 insertions(+)
19 diff --git a/configure b/configure
20 index 1cb0e59..ffb1825 100755
23 @@ -6836,6 +6836,56 @@ fi
27 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether sys/types.h defines makedev" >&5
28 +$as_echo_n "checking whether sys/types.h defines makedev... " >&6; }
29 +if ${ac_cv_header_sys_types_h_makedev+:} false; then :
30 + $as_echo_n "(cached) " >&6
32 + cat confdefs.h - <<_ACEOF >conftest.$ac_ext
33 +/* end confdefs.h. */
34 +#include <sys/types.h>
38 +return makedev(0, 0);
43 +if ac_fn_c_try_link "$LINENO"; then :
44 + ac_cv_header_sys_types_h_makedev=yes
46 + ac_cv_header_sys_types_h_makedev=no
48 +rm -f core conftest.err conftest.$ac_objext \
49 + conftest$ac_exeext conftest.$ac_ext
52 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_sys_types_h_makedev" >&5
53 +$as_echo "$ac_cv_header_sys_types_h_makedev" >&6; }
55 +if test $ac_cv_header_sys_types_h_makedev = no; then
56 +ac_fn_c_check_header_mongrel "$LINENO" "sys/mkdev.h" "ac_cv_header_sys_mkdev_h" "$ac_includes_default"
57 +if test "x$ac_cv_header_sys_mkdev_h" = xyes; then :
59 +$as_echo "#define MAJOR_IN_MKDEV 1" >>confdefs.h
65 + if test $ac_cv_header_sys_mkdev_h = no; then
66 + ac_fn_c_check_header_mongrel "$LINENO" "sys/sysmacros.h" "ac_cv_header_sys_sysmacros_h" "$ac_includes_default"
67 +if test "x$ac_cv_header_sys_sysmacros_h" = xyes; then :
69 +$as_echo "#define MAJOR_IN_SYSMACROS 1" >>confdefs.h
77 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stat file-mode macros are broken" >&5
78 $as_echo_n "checking whether stat file-mode macros are broken... " >&6; }
79 if ${ac_cv_header_stat_broken+:} false; then :
80 diff --git a/configure.ac b/configure.ac
81 index 6189aa9..201bc77 100644
84 @@ -512,6 +512,7 @@ AC_CHECK_HEADERS(\
91 dnl **** Checks for headers that depend on other ones ****
92 diff --git a/dlls/ntdll/cdrom.c b/dlls/ntdll/cdrom.c
93 index ee36045..2c64106 100644
94 --- a/dlls/ntdll/cdrom.c
95 +++ b/dlls/ntdll/cdrom.c
97 #ifdef HAVE_SYS_STAT_H
98 # include <sys/stat.h>
100 +#ifdef MAJOR_IN_MKDEV
101 +# include <sys/mkdev.h>
102 +#elif defined(MAJOR_IN_SYSMACROS)
103 +# include <sys/sysmacros.h>
105 #include <sys/types.h>
107 #ifdef HAVE_SYS_IOCTL_H
108 diff --git a/dlls/ntdll/directory.c b/dlls/ntdll/directory.c
109 index 93fe594..4d431c0 100644
110 --- a/dlls/ntdll/directory.c
111 +++ b/dlls/ntdll/directory.c
113 #ifdef HAVE_SYS_ATTR_H
114 #include <sys/attr.h>
116 +#ifdef MAJOR_IN_MKDEV
117 +# include <sys/mkdev.h>
118 +#elif defined(MAJOR_IN_SYSMACROS)
119 +# include <sys/sysmacros.h>
121 #ifdef HAVE_SYS_VNODE_H
122 /* Work around a conflict with Solaris' system list defined in sys/list.h. */
124 diff --git a/dlls/ntdll/file.c b/dlls/ntdll/file.c
125 index 7e5da59..b3bd9d6 100644
126 --- a/dlls/ntdll/file.c
127 +++ b/dlls/ntdll/file.c
129 #ifdef HAVE_SYS_SOCKET_H
130 #include <sys/socket.h>
132 +#ifdef MAJOR_IN_MKDEV
133 +# include <sys/mkdev.h>
134 +#elif defined(MAJOR_IN_SYSMACROS)
135 +# include <sys/sysmacros.h>
140 diff --git a/include/config.h.in b/include/config.h.in
141 index 0650f31..06b192f 100644
142 --- a/include/config.h.in
143 +++ b/include/config.h.in
144 @@ -1335,6 +1335,14 @@
145 /* Define to 1 if you have the `__res_get_state' function. */
146 #undef HAVE___RES_GET_STATE
148 +/* Define to 1 if `major', `minor', and `makedev' are declared in <mkdev.h>.
150 +#undef MAJOR_IN_MKDEV
152 +/* Define to 1 if `major', `minor', and `makedev' are declared in
154 +#undef MAJOR_IN_SYSMACROS
156 /* Define to the address where bug reports for this package should be sent. */
157 #undef PACKAGE_BUGREPORT
159 diff --git a/server/fd.c b/server/fd.c
160 index 1fd1ce7..17b1b66 100644
165 #include <sys/stat.h>
166 #include <sys/time.h>
167 +#ifdef MAJOR_IN_MKDEV
168 +#include <sys/mkdev.h>
169 +#elif defined(MAJOR_IN_SYSMACROS)
170 +#include <sys/sysmacros.h>
172 #include <sys/types.h>
174 #ifdef HAVE_SYS_SYSCALL_H