From 9d90bbd7b14db17a64e6a664e6f98b58efa97747 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 9 Jun 2017 16:17:34 +0200 Subject: rework detection and use of clock_gettime()/librt recent versions of glibc include clock_gettime() inside libc itself. Task-number: QTBUG-41009 Change-Id: I7401773be99682a356bf06a69571d11c4b15978b Reviewed-by: Thiago Macieira --- src/corelib/configure.json | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'src/corelib/configure.json') diff --git a/src/corelib/configure.json b/src/corelib/configure.json index c6c5c93ddb..deb7a544ef 100644 --- a/src/corelib/configure.json +++ b/src/corelib/configure.json @@ -84,6 +84,14 @@ "-ldl" ] }, + "librt": { + "label": "clock_gettime()", + "test": "unix/clock-gettime", + "sources": [ + "", + "-lrt" + ] + }, "pcre2": { "label": "PCRE2", "test": "unix/pcre2", @@ -119,15 +127,11 @@ "type": "compile", "test": "common/atomicfptr" }, - "clock-gettime": { - "label": "clock_gettime()", - "type": "compile", - "test": "unix/clock-gettime" - }, "clock-monotonic": { "label": "POSIX monotonic clock", "type": "compile", - "test": "unix/clock-monotonic" + "test": "unix/clock-monotonic", + "use": "librt" }, "cloexec": { "label": "O_CLOEXEC", @@ -199,7 +203,7 @@ "features": { "clock-gettime": { "label": "clock_gettime()", - "condition": "tests.clock-gettime", + "condition": "config.unix && libs.librt", "output": [ "privateFeature" ] }, "clock-monotonic": { -- cgit v1.2.3