aboutsummaryrefslogtreecommitdiff
path: root/gprofng/configure.ac
diff options
context:
space:
mode:
Diffstat (limited to 'gprofng/configure.ac')
-rw-r--r--gprofng/configure.ac13
1 files changed, 13 insertions, 0 deletions
diff --git a/gprofng/configure.ac b/gprofng/configure.ac
index 7fcf6c3..a4da4e0 100644
--- a/gprofng/configure.ac
+++ b/gprofng/configure.ac
@@ -202,6 +202,19 @@ AC_SUBST(GPROFNG_LIBDIR, [${libdir}])
AC_CHECK_DECLS([basename])
AC_CHECK_FUNCS(clock_gettime strsignal)
+clock_gettime_link=
+# At least for glibc, clock_gettime is in librt. But don't
+# pull that in if it still doesn't give us the function we want. This
+# test is copied from libgomp, and modified to not link in -lrt as
+# we're using this for test timing only.
+if test "$ac_cv_func_clock_gettime" = no; then
+ AC_CHECK_LIB(rt, clock_gettime,
+ [CLOCK_GETTIME_LINK=-lrt
+ AC_DEFINE(HAVE_CLOCK_GETTIME, 1,
+ [Define to 1 if you have the `clock_gettime' function.])])
+fi
+AC_SUBST(CLOCK_GETTIME_LINK)
+
AC_SUBST(BUILD_SUBDIRS)
AC_CONFIG_FILES([Makefile src/Makefile gp-display-html/Makefile doc/Makefile])