From f36a306563b4e77e4c64884382da22f3412708a0 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Wed, 17 Apr 2019 14:16:36 +0200 Subject: configure: Support the = prefix for -I and -L For gcc's -I and -L arguments a = prefix is replaced by the sysroot. Since we're resolving include paths and library paths, we have to support this feature. For example, the linux-rasp-pi3-g++ makes use of this and is broken without this patch. Change-Id: Ie39e63322bd35e2a93aa8e55d52260164b8c6a6b Reviewed-by: Kai Koehne --- mkspecs/features/qt_configure.prf | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'mkspecs/features/qt_configure.prf') diff --git a/mkspecs/features/qt_configure.prf b/mkspecs/features/qt_configure.prf index 62ad972796..aa4348235e 100644 --- a/mkspecs/features/qt_configure.prf +++ b/mkspecs/features/qt_configure.prf @@ -515,6 +515,17 @@ defineTest(qtConfSetupLibraries) { } } +defineReplace(qtGccSysrootifiedPath) { + return($$replace(1, ^=, $$[QT_SYSROOT])) +} + +defineReplace(qtGccSysrootifiedPaths) { + sysrootified = + for (path, 1): \ + sysrootified += $$qtGccSysrootifiedPath($$path) + return($$sysrootified) +} + # libs-var, libs, in-paths, out-paths-var defineTest(qtConfResolveLibs) { ret = true @@ -531,6 +542,7 @@ defineTest(qtConfResolveLibs) { out += $$l } else: contains(l, "^-L.*") { lp = $$replace(l, "^-L", ) + gcc: lp = $$qtGccSysrootifiedPath($$lp) !exists($$lp/.) { qtLog("Library path $$val_escape(lp) is invalid.") ret = false @@ -604,6 +616,7 @@ defineTest(qtConfResolveAllLibs) { # libs-var, in-paths, libs defineTest(qtConfResolvePathLibs) { ret = true + gcc: 2 = $$qtGccSysrootifiedPaths($$2) for (libdir, 2) { !exists($$libdir/.) { qtLog("Library path $$val_escape(libdir) is invalid.") @@ -654,6 +667,7 @@ defineReplace(qtConfGetTestIncludes) { # includes-var, in-paths, test-object-var defineTest(qtConfResolvePathIncs) { ret = true + gcc: 2 = $$qtGccSysrootifiedPaths($$2) for (incdir, 2) { !exists($$incdir/.) { qtLog("Include path $$val_escape(incdir) is invalid.") -- cgit v1.2.1 From bbfc95914fa21f2025bb29ae17103502265e2cf6 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Thu, 25 Apr 2019 12:51:49 +0200 Subject: Fix determination of OpenGL include paths on macOS, take 3 The sysrootification of QMAKE_INCDIR_OPENGL on macOS must happen only once. Commit 49ef3773 addressed this but stored the sysrootified QMAKE_INCDIR_OPENGL in qt_lib_gui_private.pri. For installer packages, these paths are the paths of the build machine and most likely wrong on the user's machine. This reverts commit 4949ef377349ba4dae840c2d5caa36e2d516707baa and restores the sysrootification in sdk.prf. The original include paths are assigned to QMAKE_EXPORT_INCDIR_OPENGL and stored as QMAKE_INCDIR_OPENGL in qt_lib_gui_private.pri. Fixes: QTBUG-75374 Task-number: QTBUG-73736 Change-Id: I4c0f65866d60660c632363dba3adc7ea2e344bfc Reviewed-by: Alexandru Croitor --- mkspecs/features/qt_configure.prf | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'mkspecs/features/qt_configure.prf') diff --git a/mkspecs/features/qt_configure.prf b/mkspecs/features/qt_configure.prf index aa4348235e..b2dd846b11 100644 --- a/mkspecs/features/qt_configure.prf +++ b/mkspecs/features/qt_configure.prf @@ -786,6 +786,11 @@ defineTest(qtConfLibrary_makeSpec) { !qtConfResolvePathIncs($${1}.includedir, $$eval(QMAKE_INCDIR_$$spec), $$2): \ return(false) + !isEmpty(QMAKE_EXPORT_INCDIR_$$spec) { + $${1}.exportincludedir = $$eval(QMAKE_EXPORT_INCDIR_$$spec) + export($${1}.exportincludedir) + } + # note that the object is re-exported, because we resolve the libraries. return(true) @@ -953,7 +958,8 @@ defineTest(qtConfExportLibrary) { } defines = $$eval($${spfx}.defines) !isEmpty(defines): qtConfOutputVar(assign, $$output, QMAKE_DEFINES_$$NAME, $$defines) - includes = $$eval($${spfx}.includedir) + includes = $$eval($${spfx}.exportincludedir) + isEmpty(includes): includes = $$eval($${spfx}.includedir) !isEmpty(includes): qtConfOutputVar(assign, $$output, QMAKE_INCDIR_$$NAME, $$includes) uses = $$eval($${lpfx}.dependencies) !isEmpty(uses) { -- cgit v1.2.1 From 6288c12bb4316c8970ab8437ef5beefce89f5836 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Mon, 29 Apr 2019 12:39:52 +0200 Subject: Resolve QMAKE_INCDIR_VULKAN on every qmake call Do not store this variable locally, because a) it might change if the SDK location changes b) does not play well with Qt installer packages which would provide the include path of the build machine. To achieve this we introduce the (usual) magic value - for QMAKE_EXPORT_INCDIR_VULKAN to denote "do not export this value". Fixes: QTBUG-73796 Change-Id: Ied26ee12cbcdf7f5f6e1caef5d29dadf6309c5d6 Reviewed-by: Laszlo Agocs Reviewed-by: Kai Koehne --- mkspecs/features/qt_configure.prf | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'mkspecs/features/qt_configure.prf') diff --git a/mkspecs/features/qt_configure.prf b/mkspecs/features/qt_configure.prf index b2dd846b11..95e54d72c9 100644 --- a/mkspecs/features/qt_configure.prf +++ b/mkspecs/features/qt_configure.prf @@ -959,8 +959,10 @@ defineTest(qtConfExportLibrary) { defines = $$eval($${spfx}.defines) !isEmpty(defines): qtConfOutputVar(assign, $$output, QMAKE_DEFINES_$$NAME, $$defines) includes = $$eval($${spfx}.exportincludedir) - isEmpty(includes): includes = $$eval($${spfx}.includedir) - !isEmpty(includes): qtConfOutputVar(assign, $$output, QMAKE_INCDIR_$$NAME, $$includes) + !equals(includes, -) { + isEmpty(includes): includes = $$eval($${spfx}.includedir) + !isEmpty(includes): qtConfOutputVar(assign, $$output, QMAKE_INCDIR_$$NAME, $$includes) + } uses = $$eval($${lpfx}.dependencies) !isEmpty(uses) { # FIXME: ideally, we would export transitive deps only for static -- cgit v1.2.1