Add support for linking librt and using clock_gettime to the sample
[oota-llvm.git] / projects / sample / autoconf / configure.ac
index c7e256e8303401cee8508f76963d23b80f49dbc1..89527b3377e64e93cbe22d04f3beb3345c975dc7 100644 (file)
@@ -1079,6 +1079,11 @@ AC_SEARCH_LIBS(dlopen,dl,AC_DEFINE([HAVE_DLOPEN],[1],
                [Define if dlopen() is available on this platform.]),
                AC_MSG_WARN([dlopen() not found - disabling plugin support]))
 
+dnl Search for the clock_gettime() function. Note that we rely on the POSIX
+dnl macros to detect whether clock_gettime is available, this just finds the
+dnl right libraries to link with.
+AC_SEARCH_LIBS(clock_gettime,rt)
+
 dnl The curses library is optional; used for querying terminal info
 if test "$llvm_cv_enable_terminfo" = "yes" ; then
   dnl We need the has_color functionality in curses for it to be useful.