summaryrefslogtreecommitdiff
path: root/gprofng/configure.ac
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2022-03-18 15:45:34 +0000
committerNick Clifton <nickc@redhat.com>2022-03-18 15:46:33 +0000
commit0a30596cfad9cd221a81eea984b6fe3fabb20b95 (patch)
treeb688d33f46d2507a16dc89d7f057cba01618c355 /gprofng/configure.ac
parentf0cf07f341f565978228c9a2cfa73d2a9f3001c3 (diff)
downloadbinutils-gdb-0a30596cfad9cd221a81eea984b6fe3fabb20b95.tar.gz
Fix Build issues due to patch "gprofng: a new GNU profiler"
Find and fix more places where clock_gettime() and CLOCK_MONOTONIC_RAW are used.
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 7fcf6c3b1db..a4da4e0f6f8 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])