diff --git a/configure.ac b/configure.ac index 34038517c..7756e6b94 100644 --- a/configure.ac +++ b/configure.ac @@ -388,6 +388,17 @@ AC_C_BIGENDIAN # Checks for library functions. AC_FUNC_FORK AC_CHECK_FUNCS([gettimeofday memset socket strchr malloc]) +if test "x$WIN32" != "xyes"; then + AC_CHECK_LIB(rt, clock_gettime, + [ + RT_LIBS="-lrt" + AC_SUBST(RT_LIBS) + ], + [ + AC_MSG_ERROR([required library rt was not found on your system]) + ] + ) +fi if test "x$BUILD_AV" = "xyes"; then AX_PTHREAD( diff --git a/toxcore/Makefile.inc b/toxcore/Makefile.inc index 926b4e3fa..4c9597890 100644 --- a/toxcore/Makefile.inc +++ b/toxcore/Makefile.inc @@ -50,6 +50,7 @@ libtoxcore_la_LDFLAGS = $(TOXCORE_LT_LDFLAGS) \ $(EXTRA_LT_LDFLAGS) \ $(LIBSODIUM_LDFLAGS) \ $(NACL_LDFLAGS) \ + $(RT_LIBS) \ $(WINSOCK2_LIBS) libtoxcore_la_LIBADD = $(LIBSODIUM_LIBS) \