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 <thiago.macieira@intel.com>
This commit is contained in:
Oswald Buddenhagen 2017-06-09 16:17:34 +02:00
parent 72d4f0750b
commit 9d90bbd7b1
5 changed files with 12 additions and 12 deletions

View File

@ -1,2 +0,0 @@
# clock_gettime() is implemented in librt on these systems
linux-*|hpux-*|solaris-*:LIBS_PRIVATE *= -lrt

View File

@ -1,3 +1,2 @@
SOURCES = clock-gettime.cpp
CONFIG -= qt dylib
include(clock-gettime.pri)

View File

@ -1,3 +1,2 @@
SOURCES = clock-monotonic.cpp
CONFIG -= qt dylib
include(../clock-gettime/clock-gettime.pri)

View File

@ -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": {

View File

@ -162,7 +162,7 @@ unix|integrity {
QMAKE_USE_PRIVATE += glib
}
qtConfig(clock-gettime): include($$QT_SOURCE_TREE/config.tests/unix/clock-gettime/clock-gettime.pri)
qtConfig(clock-gettime): QMAKE_USE_PRIVATE += librt
!android {
SOURCES += kernel/qsharedmemory_posix.cpp \