X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=configure.in;fp=configure.in;h=3b46188a3e73ea9ac4cb7be49b3db4bd1dccc2d7;hb=5c4d218936559af2f6cb9857af7f5b9c8d83be6d;hp=fd6a25701e5c5a41c416ac53dab941f5001caee0;hpb=af94242000c1f54c0f752bb66bcecfcced4080f0;p=collectd.git diff --git a/configure.in b/configure.in index fd6a2570..3b46188a 100644 --- a/configure.in +++ b/configure.in @@ -574,13 +574,24 @@ AM_CONDITIONAL(BUILD_WITH_LIBSOCKET, test "x$socket_needs_socket" = "xyes") clock_gettime_needs_rt="no" clock_gettime_needs_posix4="no" -AC_CHECK_FUNCS(clock_gettime, - [], - AC_CHECK_LIB(rt, clock_gettime, - [clock_gettime_needs_rt="yes"], - AC_CHECK_LIB(posix4, clock_gettime, - [clock_gettime_needs_posix4="yes"], - AC_MSG_ERROR(cannot find clock_gettime)))) +have_clock_gettime="no" +AC_CHECK_FUNCS(clock_gettime, [have_clock_gettime="yes"]) +if test "x$have_clock_gettime" = "xno" +then + AC_CHECK_LIB(rt, clock_gettime, [clock_gettime_needs_rt="yes" + have_clock_gettime="yes"]) +fi +if test "x$have_clock_gettime" = "xno" +then + AC_CHECK_LIB(posix4, clock_gettime, [clock_gettime_needs_posix4="yes" + have_clock_gettime="yes"]) +fi +if test "x$have_clock_gettime" = "xyes" +then + AC_DEFINE(HAVE_CLOCK_GETTIME, 1, [Define if the clock_gettime(2) function is available.]) +else + AC_MSG_WARN(cannot find clock_gettime) +fi nanosleep_needs_rt="no" nanosleep_needs_posix4="no"