aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Benjamin Barenblat <bbarenblat@galois.com>2014-04-14 13:49:59 -0700
committerGravatar Benjamin Barenblat <bbarenblat@galois.com>2014-04-14 13:49:59 -0700
commit79baeabd91fc5e369d109c8350b7369283b0c607 (patch)
tree78b23748715c1884053ed000becb7bfff4670928
parent857ad5fda8129d7b87b5bff781aacf48a37811e2 (diff)
Link against librt if necessaryHEADmaster
For a while, we were very confused why ppamltracer would work happily on some Debian systems but produce dynamic linker errors on other, similar ones. It turns out the difference was glibc versions – if you have glibc <2.17, you need to specify '-lrt' for one of the functions ppamltracer uses. This commit adds an Autoconf macro that adds that flag if necessary; it should improve portability in general as well.
-rw-r--r--configure.ac6
1 files changed, 6 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 38c5ec8..7e1c7a5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -49,6 +49,12 @@ LT_INIT
# Dependencies
AC_CHECK_HEADERS([unistd.h])
AC_CHECK_TYPE([clockid_t])
+# glibc 2.17 moved 'clock_gettime' (and the other 'clock_' functions) into the
+# main C library, but pre-2.17, you needed to link with '-lrt'. (See
+# https://blog.flameeyes.eu/2012/12/glibc-2-17-what-s-going-to-be-a-trouble.)
+# Search for 'clock_gettime', and if it doesn't exist, add 'rt' to the link
+# list.
+AC_SEARCH_LIBS([clock_gettime], [rt])
GALOIS_PPAML_LIB_OPENTRACE(
[],
[AC_MSG_ERROR([both OTF development libraries and the 'otfconfig' program are required. You can install them from <http://tu-dresden.de/die_tu_dresden/zentrale_einrichtungen/zih/forschung/projekte/otf>.])])