diff --git a/config/user-makedev.m4 b/config/user-makedev.m4 new file mode 100644 index 0000000000..4383681a8f --- /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 + ],[ + 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 + ],[ + 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 f70ab635fa..0e3430757e 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 f99b4d6864..31f347c6fd 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 c58b2d5660..7fb53730f8 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 +#elif defined(HAVE_MAKEDEV_IN_MKDEV) +#include +#endif + #include #include #include_next