summaryrefslogtreecommitdiffstats
path: root/mkspecs/features
diff options
context:
space:
mode:
authorJames McDonnell <jmcdonnell@blackberry.com>2017-06-06 15:34:56 -0400
committerJames McDonnell <jmcdonnell@blackberry.com>2017-06-29 14:13:04 +0000
commitb2ec7317c889c1eae1eab1060f572680c28ed997 (patch)
tree2def0ce4ede67faf66cb601b6cf2116289014328 /mkspecs/features
parent6dd61b4e62d9b67a721bbf671b7ffd62c0a50809 (diff)
Add query of default include/library paths for QNX
Change-Id: Iafc5a573a2ddb277d2a786cb6b48521985defe44 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Diffstat (limited to 'mkspecs/features')
-rw-r--r--mkspecs/features/toolchain.prf81
1 files changed, 55 insertions, 26 deletions
diff --git a/mkspecs/features/toolchain.prf b/mkspecs/features/toolchain.prf
index 9687767cf1..a7c9172133 100644
--- a/mkspecs/features/toolchain.prf
+++ b/mkspecs/features/toolchain.prf
@@ -25,9 +25,11 @@ isEmpty($${target_prefix}.INCDIRS) {
!equals(QMAKE_HOST.os, Windows) {
cmd_prefix = "LC_ALL=C"
cmd_suffix = "</dev/null >/dev/null"
+ null_file = /dev/null
} else {
cmd_prefix = "set LC_ALL=C&"
cmd_suffix = "<NUL >NUL"
+ null_file = NUL
}
cxx_flags = $$QMAKE_CXXFLAGS
@@ -40,7 +42,10 @@ isEmpty($${target_prefix}.INCDIRS) {
# QMAKE_DEFAULT_*DIRS, because they're handled in a single build pass.
darwin: cxx_flags += -isysroot $$QMAKE_MAC_SDK_PATH
- clang: \
+ rim_qcc: \
+ # Need the cc1plus and ld command lines to pick up the paths
+ cxx_flags += $$QMAKE_LFLAGS_SHLIB -o $$null_file -v
+ else: clang: \
# Need to link to pick up library paths
cxx_flags += $$QMAKE_LFLAGS_SHLIB -o /dev/null -v -Wl,-v
else: \
@@ -50,35 +55,59 @@ isEmpty($${target_prefix}.INCDIRS) {
output = $$system("$$cmd_prefix $$QMAKE_CXX $$qtMakeExpand($$cxx_flags) -xc++ - 2>&1 $$cmd_suffix", lines, ec)
!equals(ec, 0): \
error("Cannot run compiler '$$QMAKE_CXX'. Maybe you forgot to setup the environment?")
- add_includes = false
- add_libraries = false
- for (line, output) {
- line ~= s/^[ \\t]*// # remove leading spaces
- contains(line, "LIBRARY_PATH=.*") {
- line ~= s/^LIBRARY_PATH=// # remove leading LIBRARY_PATH=
- paths = $$split(line, $$QMAKE_DIRLIST_SEP)
- for (path, paths): \
- QMAKE_DEFAULT_LIBDIRS += $$clean_path($$path)
- } else: contains(line, "Library search paths:") {
- add_libraries = true
- } else: contains(line, "$${LITERAL_HASH}include <.*") { # #include <...> search starts here:
- add_includes = true
- } else: contains(line, "End of search.*") {
- add_includes = false
- } else: $$add_libraries {
- # We assume all library search paths are absolute
- !contains(line, "^/.*") {
- add_libraries = false
- next()
+
+ rim_qcc {
+ for (line, output) {
+ contains(line, "^[^ ]*cc1plus .*") {
+ take_next = false
+ for (parameter, $$list($$line)) {
+ $$take_next {
+ QMAKE_DEFAULT_INCDIRS += $$clean_path($$parameter)
+ take_next = false
+ } else: equals(parameter, "-isystem") {
+ take_next = true
+ }
+ }
+ } else: contains(line, "^[^ ]*-ld .*") {
+ for (parameter, $$list($$line)) {
+ contains(parameter, "^-L.*") {
+ parameter ~= s/^-L//
+ QMAKE_DEFAULT_LIBDIRS += $$clean_path($$parameter)
+ }
+ }
+ }
+ }
+ } else {
+ add_includes = false
+ add_libraries = false
+ for (line, output) {
+ line ~= s/^[ \\t]*// # remove leading spaces
+ contains(line, "LIBRARY_PATH=.*") {
+ line ~= s/^LIBRARY_PATH=// # remove leading LIBRARY_PATH=
+ paths = $$split(line, $$QMAKE_DIRLIST_SEP)
+ for (path, paths): \
+ QMAKE_DEFAULT_LIBDIRS += $$clean_path($$path)
+ } else: contains(line, "Library search paths:") {
+ add_libraries = true
+ } else: contains(line, "$${LITERAL_HASH}include <.*") { # #include <...> search starts here:
+ add_includes = true
+ } else: contains(line, "End of search.*") {
+ add_includes = false
+ } else: $$add_libraries {
+ # We assume all library search paths are absolute
+ !contains(line, "^/.*") {
+ add_libraries = false
+ next()
+ }
+ QMAKE_DEFAULT_LIBDIRS += $$clean_path($$line)
+ } else: $$add_includes {
+ !contains(line, ".* \\(framework directory\\)"): \
+ QMAKE_DEFAULT_INCDIRS += $$clean_path($$line)
}
- QMAKE_DEFAULT_LIBDIRS += $$clean_path($$line)
- } else: $$add_includes {
- !contains(line, ".* \\(framework directory\\)"): \
- QMAKE_DEFAULT_INCDIRS += $$clean_path($$line)
}
}
isEmpty(QMAKE_DEFAULT_LIBDIRS)|isEmpty(QMAKE_DEFAULT_INCDIRS): \
- !if(qnx|integrity): \
+ !integrity: \
error("failed to parse default search paths from compiler output")
QMAKE_DEFAULT_LIBDIRS = $$unique(QMAKE_DEFAULT_LIBDIRS)
} else: msvc {