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 SOURCES = clock-gettime.cpp
CONFIG -= qt dylib CONFIG -= qt dylib
include(clock-gettime.pri)

View File

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

View File

@ -84,6 +84,14 @@
"-ldl" "-ldl"
] ]
}, },
"librt": {
"label": "clock_gettime()",
"test": "unix/clock-gettime",
"sources": [
"",
"-lrt"
]
},
"pcre2": { "pcre2": {
"label": "PCRE2", "label": "PCRE2",
"test": "unix/pcre2", "test": "unix/pcre2",
@ -119,15 +127,11 @@
"type": "compile", "type": "compile",
"test": "common/atomicfptr" "test": "common/atomicfptr"
}, },
"clock-gettime": {
"label": "clock_gettime()",
"type": "compile",
"test": "unix/clock-gettime"
},
"clock-monotonic": { "clock-monotonic": {
"label": "POSIX monotonic clock", "label": "POSIX monotonic clock",
"type": "compile", "type": "compile",
"test": "unix/clock-monotonic" "test": "unix/clock-monotonic",
"use": "librt"
}, },
"cloexec": { "cloexec": {
"label": "O_CLOEXEC", "label": "O_CLOEXEC",
@ -199,7 +203,7 @@
"features": { "features": {
"clock-gettime": { "clock-gettime": {
"label": "clock_gettime()", "label": "clock_gettime()",
"condition": "tests.clock-gettime", "condition": "config.unix && libs.librt",
"output": [ "privateFeature" ] "output": [ "privateFeature" ]
}, },
"clock-monotonic": { "clock-monotonic": {

View File

@ -162,7 +162,7 @@ unix|integrity {
QMAKE_USE_PRIVATE += glib 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 { !android {
SOURCES += kernel/qsharedmemory_posix.cpp \ SOURCES += kernel/qsharedmemory_posix.cpp \