aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--config/user-makedev.m439
-rw-r--r--config/user.m42
-rw-r--r--lib/libspl/include/sys/sysmacros.h1
-rw-r--r--lib/libspl/include/sys/types.h6
4 files changed, 47 insertions, 1 deletions
diff --git a/config/user-makedev.m4 b/config/user-makedev.m4
new file mode 100644
index 000000000..4383681a8
--- /dev/null
+++ b/config/user-makedev.m4
@@ -0,0 +1,39 @@
+dnl #
+dnl # glibc 2.25
+dnl #
+AC_DEFUN([ZFS_AC_CONFIG_USER_MAKEDEV_IN_SYSMACROS], [
+ AC_MSG_CHECKING([makedev() is declared in sys/sysmacros.h])
+ AC_TRY_COMPILE(
+ [
+ #include <sys/sysmacros.h>
+ ],[
+ int k;
+ k = makedev(0,0);
+ ],[
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_MAKEDEV_IN_SYSMACROS, 1,
+ [makedev() is declared in sys/sysmacros.h])
+ ],[
+ AC_MSG_RESULT(no)
+ ])
+])
+
+dnl #
+dnl # glibc X < Y < 2.25
+dnl #
+AC_DEFUN([ZFS_AC_CONFIG_USER_MAKEDEV_IN_MKDEV], [
+ AC_MSG_CHECKING([makedev() is declared in sys/mkdev.h])
+ AC_TRY_COMPILE(
+ [
+ #include <sys/mkdev.h>
+ ],[
+ int k;
+ k = makedev(0,0);
+ ],[
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_MAKEDEV_IN_MKDEV, 1,
+ [makedev() is declared in sys/mkdev.h])
+ ],[
+ AC_MSG_RESULT(no)
+ ])
+])
diff --git a/config/user.m4 b/config/user.m4
index f70ab635f..0e3430757 100644
--- a/config/user.m4
+++ b/config/user.m4
@@ -15,6 +15,8 @@ AC_DEFUN([ZFS_AC_CONFIG_USER], [
ZFS_AC_CONFIG_USER_LIBUDEV
ZFS_AC_CONFIG_USER_FRAME_LARGER_THAN
ZFS_AC_CONFIG_USER_RUNSTATEDIR
+ ZFS_AC_CONFIG_USER_MAKEDEV_IN_SYSMACROS
+ ZFS_AC_CONFIG_USER_MAKEDEV_IN_MKDEV
ZFS_AC_CONFIG_USER_COMMANDS
ZFS_AC_TEST_FRAMEWORK
diff --git a/lib/libspl/include/sys/sysmacros.h b/lib/libspl/include/sys/sysmacros.h
index f99b4d686..31f347c6f 100644
--- a/lib/libspl/include/sys/sysmacros.h
+++ b/lib/libspl/include/sys/sysmacros.h
@@ -48,7 +48,6 @@
#define makedevice(maj, min) makedev(maj, min)
#define _sysconf(a) sysconf(a)
-#define __NORETURN __attribute__((noreturn))
/*
* Compatibility macros/typedefs needed for Solaris -> Linux port
diff --git a/lib/libspl/include/sys/types.h b/lib/libspl/include/sys/types.h
index c58b2d566..7fb53730f 100644
--- a/lib/libspl/include/sys/types.h
+++ b/lib/libspl/include/sys/types.h
@@ -27,6 +27,12 @@
#ifndef _LIBSPL_SYS_TYPES_H
#define _LIBSPL_SYS_TYPES_H
+#if defined(HAVE_MAKEDEV_IN_SYSMACROS)
+#include <sys/sysmacros.h>
+#elif defined(HAVE_MAKEDEV_IN_MKDEV)
+#include <sys/mkdev.h>
+#endif
+
#include <sys/isa_defs.h>
#include <sys/feature_tests.h>
#include_next <sys/types.h>