Package: owfs / 3.2p3+dfsg1-2

for-upstream-MAJOR-detect.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
Fix upstream patch to look for MAJOR macro
diff --git a/configure.ac b/configure.ac
index 4154bb96..298da3e8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -188,9 +188,10 @@ m4_include([src/scripts/m4/acx_pthread.m4])
 # Checks for header files.
 AC_HEADER_DIRENT
 AC_HEADER_STDC
-AC_CHECK_HEADERS([asm/types.h arpa/inet.h sys/ioctl.h sys/mkdev.h sys/socket.h sys/sysmacros.h sys/time.h sys/times.h sys/types.h sys/param.h sys/uio.h feature_tests.h fcntl.h netinet/in.h stdlib.h string.h strings.h sys/file.h syslog.h termios.h unistd.h limits.h stdint.h features.h getopt.h resolv.h semaphore.h])
+AC_CHECK_HEADERS([asm/types.h arpa/inet.h sys/ioctl.h sys/socket.h sys/time.h sys/times.h sys/types.h sys/param.h sys/uio.h feature_tests.h fcntl.h netinet/in.h stdlib.h string.h strings.h sys/file.h syslog.h termios.h unistd.h limits.h stdint.h features.h getopt.h resolv.h semaphore.h])
 AC_CHECK_HEADERS([linux/limits.h linux/types.h netdb.h dlfcn.h])
 AC_CHECK_HEADERS(sys/event.h sys/inotify.h)
+AC_HEADER_MAJOR
 
 # Test if debugging out enabled
 ENABLE_DEBUG="true"
diff --git a/module/owlib/src/include/ow.h b/module/owlib/src/include/ow.h
index 0a310552..01744e23 100644
--- a/module/owlib/src/include/ow.h
+++ b/module/owlib/src/include/ow.h
@@ -188,13 +188,12 @@
 #include <netdb.h>				/* for getaddrinfo */
 #endif							/* HAVE_NETDB_H */
 
-#ifdef HAVE_SYS_SYSMACROS_H
-#include <sys/sysmacros.h>			/* for major() */
-#endif							/* HAVE_SYS_SYSMACROS_H */
-
-#ifdef HAVE_SYS_MKDEV_H
-#include <sys/mkdev.h>			/* for major() on Solaris */
-#endif							/* HAVE_SYS_MKDEV_H */
+/* for major() if sys/types.h is not enough */
+#ifdef MAJOR_IN_MKDEV
+#include <sys/mkdev.h>
+#elif defined MAJOR_IN_SYSMACROS
+#include <sys/sysmacros.h>
+#endif
 
 #include <stddef.h> // for offsetof()
 
diff --git a/module/ownet/c/src/include/ow.h b/module/ownet/c/src/include/ow.h
index c157a7c9..5d6162fb 100644
--- a/module/ownet/c/src/include/ow.h
+++ b/module/ownet/c/src/include/ow.h
@@ -118,9 +118,12 @@
 
 #include <netdb.h>				/* addrinfo */
 
-#ifdef HAVE_SYS_MKDEV_H
-#include <sys/mkdev.h>			/* for major() */
-#endif							/* HAVE_SYS_MKDEV_H */
+/* for major() if sys/types.h is not enough */
+#ifdef MAJOR_IN_MKDEV
+#include <sys/mkdev.h>
+#elif defined MAJOR_IN_SYSMACROS
+#include <sys/sysmacros.h>
+#endif
 
 /* Can't include search.h when compiling owperl on Fedora Core 1. */
 #ifndef SKIP_SEARCH_H