xref: /freebsd/sys/contrib/openzfs/config/user-clock_gettime.m4 (revision e25152834cdf3b353892835a4f3b157e066a8ed4)
1*eda14cbcSMatt Macydnl #
2*eda14cbcSMatt Macydnl # Check if librt is required for clock_gettime.
3*eda14cbcSMatt Macydnl # clock_gettime is generally available in libc on modern systems.
4*eda14cbcSMatt Macydnl #
5*eda14cbcSMatt MacyAC_DEFUN([ZFS_AC_CONFIG_USER_CLOCK_GETTIME], [
6*eda14cbcSMatt Macy	AC_CHECK_FUNC([clock_gettime], [], [
7*eda14cbcSMatt Macy	    AC_CHECK_LIB([rt], [clock_gettime], [
8*eda14cbcSMatt Macy		AC_SUBST([LIBCLOCK_GETTIME], [-lrt])], [
9*eda14cbcSMatt Macy		AC_MSG_FAILURE([*** clock_gettime is missing in libc and librt])
10*eda14cbcSMatt Macy	    ])
11*eda14cbcSMatt Macy	])
12*eda14cbcSMatt Macy])
13