diff options
Diffstat (limited to 'mkspecs')
-rw-r--r-- | mkspecs/common/winrt_winphone/qmake.conf | 4 | ||||
-rw-r--r-- | mkspecs/common/winrt_winphone/qplatformdefs.h | 10 | ||||
-rw-r--r-- | mkspecs/features/android/android.prf | 2 | ||||
-rw-r--r-- | mkspecs/features/data/cmake/Qt5ConfigVersion.cmake.in | 4 | ||||
-rw-r--r-- | mkspecs/features/data/unix/findclasslist.pl | 17 | ||||
-rw-r--r-- | mkspecs/features/qt.prf | 4 | ||||
-rw-r--r-- | mkspecs/features/qt_docs.prf | 14 | ||||
-rw-r--r-- | mkspecs/features/qt_functions.prf | 76 | ||||
-rw-r--r-- | mkspecs/features/qt_module.prf | 5 | ||||
-rw-r--r-- | mkspecs/features/testcase.prf | 9 | ||||
-rw-r--r-- | mkspecs/features/win32/idcidl.prf | 2 | ||||
-rw-r--r-- | mkspecs/features/win32/windows.prf | 2 | ||||
-rw-r--r-- | mkspecs/win32-g++/qmake.conf | 1 |
13 files changed, 99 insertions, 51 deletions
diff --git a/mkspecs/common/winrt_winphone/qmake.conf b/mkspecs/common/winrt_winphone/qmake.conf index bf237882ff..a9450b0c32 100644 --- a/mkspecs/common/winrt_winphone/qmake.conf +++ b/mkspecs/common/winrt_winphone/qmake.conf @@ -78,9 +78,9 @@ QMAKE_PREFIX_STATICLIB = QMAKE_EXTENSION_STATICLIB = lib QMAKE_LIBS += runtimeobject.lib -QMAKE_LIBS_CORE = +QMAKE_LIBS_CORE += ws2_32.lib QMAKE_LIBS_GUI = -QMAKE_LIBS_NETWORK = +QMAKE_LIBS_NETWORK += ws2_32.lib QMAKE_LIBS_OPENGL_ES2 = $${LIBEGL_NAME}.lib $${LIBGLESV2_NAME}.lib QMAKE_LIBS_OPENGL_ES2_DEBUG = $${LIBEGL_NAME}d.lib $${LIBGLESV2_NAME}d.lib diff --git a/mkspecs/common/winrt_winphone/qplatformdefs.h b/mkspecs/common/winrt_winphone/qplatformdefs.h index 6abac1e94d..14f6c58253 100644 --- a/mkspecs/common/winrt_winphone/qplatformdefs.h +++ b/mkspecs/common/winrt_winphone/qplatformdefs.h @@ -130,14 +130,4 @@ typedef int mode_t; -#ifndef INADDR_ANY -# define INADDR_ANY (u_long)0x00000000 -#endif -#ifndef INADDR_LOOPBACK -# define INADDR_LOOPBACK 0x7f000001 -#endif -#ifndef INADDR_BROADCAST -# define INADDR_BROADCAST (u_long)0xffffffff -#endif - #endif // QPLATFORMDEFS_H diff --git a/mkspecs/features/android/android.prf b/mkspecs/features/android/android.prf index f428f7db87..7d77598e76 100644 --- a/mkspecs/features/android/android.prf +++ b/mkspecs/features/android/android.prf @@ -3,7 +3,7 @@ contains(TEMPLATE, ".*app") { !contains(TARGET, ".so"): TARGET = lib$${TARGET}.so QMAKE_LFLAGS += -Wl,-soname,$$shell_quote($$TARGET) - android_install: { + android_install { target.path=/libs/$$ANDROID_TARGET_ARCH/ INSTALLS *= target } diff --git a/mkspecs/features/data/cmake/Qt5ConfigVersion.cmake.in b/mkspecs/features/data/cmake/Qt5ConfigVersion.cmake.in index e804754912..7c42430e97 100644 --- a/mkspecs/features/data/cmake/Qt5ConfigVersion.cmake.in +++ b/mkspecs/features/data/cmake/Qt5ConfigVersion.cmake.in @@ -1,11 +1,11 @@ set(PACKAGE_VERSION $$CMAKE_PACKAGE_VERSION) -if(\"\${PACKAGE_VERSION}\" VERSION_LESS \"\${PACKAGE_FIND_VERSION}\") +if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION) set(PACKAGE_VERSION_COMPATIBLE FALSE) else() set(PACKAGE_VERSION_COMPATIBLE TRUE) - if(\"\${PACKAGE_FIND_VERSION}\" STREQUAL \"\${PACKAGE_VERSION}\") + if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION) set(PACKAGE_VERSION_EXACT TRUE) endif() endif() diff --git a/mkspecs/features/data/unix/findclasslist.pl b/mkspecs/features/data/unix/findclasslist.pl index 9113b4921c..ac010ae0a7 100644 --- a/mkspecs/features/data/unix/findclasslist.pl +++ b/mkspecs/features/data/unix/findclasslist.pl @@ -33,8 +33,21 @@ ############################################################################# use strict; -my $syntax = "findclasslist.pl [private header list]\n" . +my $syntax = "findclasslist.pl <file (containing private header list)>\n" . "Replaces \@CLASSLIST\@ with the classes found in the header files\n"; + +die("Expected exactly one argument") if (@ARGV != 1); + +my @headers = (); + +# Expand contents of the command-line arguments file +open ARGFILE, "<$ARGV[0]" or die("Could not open arguments file $ARGV[0]: $!"); +while (my $line = <ARGFILE>) { + chomp($line); + push @headers, $line; +} +close ARGFILE; + $\ = $/; while (<STDIN>) { chomp; @@ -44,7 +57,7 @@ while (<STDIN>) { } # Replace @CLASSLIST@ with the class list - for my $header (@ARGV) { + for my $header (@headers) { open HDR, "<$header" or die("Could not open header $header: $!"); my $comment = " /* $header */"; while (my $line = <HDR>) { diff --git a/mkspecs/features/qt.prf b/mkspecs/features/qt.prf index c041c306c1..3c9ab79b27 100644 --- a/mkspecs/features/qt.prf +++ b/mkspecs/features/qt.prf @@ -208,7 +208,7 @@ contains(qt_module_deps, qml): \ !isEmpty(IMPORTS._KEYS_) { # add import plugins to LIBS line - for (key, IMPORTS._KEYS_): { + for (key, IMPORTS._KEYS_) { PATH = $$eval(IMPORTS.$${key}.path) PLUGIN = $$eval(IMPORTS.$${key}.plugin) !isEmpty(PATH):!isEmpty(PLUGIN): LIBS *= -L$$PATH -l$${PLUGIN}$$qtPlatformTargetSuffix() @@ -347,7 +347,7 @@ for(QT_CURRENT_VERIFY, $$list($$QT_PLUGIN_VERIFY)) { QT_LINKAGE = -l$${QTPLUG}$$qtPlatformTargetSuffix() # Only link against plugin in static builds - isEqual(QT_CURRENT_VERIFY, QTPLUGIN): { + isEqual(QT_CURRENT_VERIFY, QTPLUGIN) { !isEmpty(QT_PLUGINPATH) { plugpath = $$eval(QT_PLUGIN.$${QTPLUG}.PATH) isEmpty(plugpath): \ diff --git a/mkspecs/features/qt_docs.prf b/mkspecs/features/qt_docs.prf index 15bd12072a..37b2f06193 100644 --- a/mkspecs/features/qt_docs.prf +++ b/mkspecs/features/qt_docs.prf @@ -31,9 +31,9 @@ qtdocs.value = $$[QT_INSTALL_DOCS/src] QT_TOOL_ENV = qtver qtmver qtvertag qtdocs qtPrepareTool(QDOC, qdoc) QT_TOOL_ENV = -QDOC += -outputdir $$QMAKE_DOCS_OUTPUTDIR +QDOC += -outputdir $$shell_quote($$QMAKE_DOCS_OUTPUTDIR) !build_online_docs: \ - QDOC += -installdir $$[QT_INSTALL_DOCS] + QDOC += -installdir $$shell_quote($$[QT_INSTALL_DOCS]) PREP_DOC_INDEXES = DOC_INDEXES = !isEmpty(QTREPOS) { @@ -46,14 +46,14 @@ DOC_INDEXES = mps += $$dirname(QT.$${d}.libs) mps = $$unique(mps) for (mp, mps): \ - PREP_DOC_INDEXES += -indexdir $$mp/doc + PREP_DOC_INDEXES += -indexdir $$shell_quote($$mp/doc) } for(qrep, QTREPOS): \ - DOC_INDEXES += -indexdir $$qrep/doc + DOC_INDEXES += -indexdir $$shell_quote($$qrep/doc) } else { prepare_docs: \ - PREP_DOC_INDEXES += -indexdir $$[QT_INSTALL_DOCS/get] - DOC_INDEXES += -indexdir $$[QT_INSTALL_DOCS/get] + PREP_DOC_INDEXES += -indexdir $$shell_quote($$[QT_INSTALL_DOCS/get]) + DOC_INDEXES += -indexdir $$shell_quote($$[QT_INSTALL_DOCS/get]) } doc_command = $$QDOC $$QMAKE_DOCS prepare_docs { @@ -65,7 +65,7 @@ prepare_docs { !build_online_docs { qtPrepareTool(QHELPGENERATOR, qhelpgenerator) - qch_docs.commands = $$QHELPGENERATOR $$QMAKE_DOCS_OUTPUTDIR/$${QMAKE_DOCS_TARGET}.qhp -o $$QMAKE_DOCS_BASE_OUTDIR/$${QMAKE_DOCS_TARGET}.qch + qch_docs.commands = $$QHELPGENERATOR $$shell_quote($$QMAKE_DOCS_OUTPUTDIR/$${QMAKE_DOCS_TARGET}.qhp) -o $$shell_quote($$QMAKE_DOCS_BASE_OUTDIR/$${QMAKE_DOCS_TARGET}.qch) inst_html_docs.files = $$QMAKE_DOCS_OUTPUTDIR inst_html_docs.path = $$[QT_INSTALL_DOCS] diff --git a/mkspecs/features/qt_functions.prf b/mkspecs/features/qt_functions.prf index 00f4bdf93e..c23d006d82 100644 --- a/mkspecs/features/qt_functions.prf +++ b/mkspecs/features/qt_functions.prf @@ -70,6 +70,7 @@ defineTest(qtPrepareTool) { } } QT_TOOL_ENV += $$eval(QT_TOOL.$${2}.envvars) + QT_TOOL_NAME = $$2 !isEmpty(3)|!isEmpty(4) { $$1$$3 = for (arg, cmd): \ @@ -90,29 +91,73 @@ defineTest(qtAddToolEnv) { ds = $$QMAKE_DIR_SEP else: \ ds = $$DIR_SEPARATOR + batch_sets = for(env, 2) { value = $$eval($${env}.value) !isEmpty(value) { name = $$eval($${env}.name) + config = $$eval($${env}.CONFIG) equals(ds, /) { - contains($${env}.CONFIG, prepend): infix = \${$$name:+:\$$$name} + contains(config, prepend): infix = \${$$name:+:\$$$name} + else: contains(config, always_prepend): infix = :\$$$name else: infix = - val = "$$name=$$shell_quote($$join(value, :))$$infix" + # Under msys, this path is taken only in the non-system() + # case, so using shell_quote() always works. + batch_sets += \ + "$$name=$$shell_quote($$join(value, :))$$infix" \ + "export $$name" } else { - # Escape closing parens when expanding the variable, otherwise cmd confuses itself. - contains($${env}.CONFIG, prepend): infix = ;%$$name:)=^)% - else: infix = + value ~= s,\\^,^^^^,g + value ~= s,!,^^!,g value ~= s,\\),^),g - val = "(set $$name=$$join(value, ;)$$infix) &" - } - isEmpty(3): !contains(TEMPLATE, vc.*) { - contains(MAKEFILE_GENERATOR, MS.*): val ~= s,%,%%,g - val ~= s,\\\$,\$\$,g + contains(config, prepend) { + batch_sets += \ + "if defined $$name (" \ + " set $$name=$$join(value, ;);!$$name!" \ + ") else (" \ + " set $$name=$$join(value, ;)" \ + ")" + } else: contains(config, always_prepend) { + batch_sets += "(set $$name=$$join(value, ;);!$$name!)" + } else { + batch_sets += "(set $$name=$$join(value, ;))" + } } - $$1 = "$$val $$eval($$1)" } } + !isEmpty(batch_sets) { + batch_name = wrapper + !isEmpty(QT_TOOL_NAME): batch_name = $${QT_TOOL_NAME}_wrapper + cmd = $$eval($$1) + !isEmpty(cmd): cmd = "$$cmd " + equals(ds, /) { + batch_name = $${batch_name}.sh + batch_cont = \ + "$$LITERAL_HASH!/bin/sh" \ + $$batch_sets \ + "exec $$cmd\"$@\"" + # It would be nicer to use the '.' command (without 'exec' above), + # but that doesn't set the positional arguments under (d)ash. + $$1 = + } else { + batch_name = $${batch_name}.bat + batch_cont = \ + "@echo off" \ + "SetLocal EnableDelayedExpansion" \ + $$batch_sets \ + "$$cmd%*" \ + "EndLocal" + $$1 = call + } + !build_pass:!write_file($$OUT_PWD/$$batch_name, batch_cont, exe): error("Aborting.") + isEmpty(3): \ + $$1 += $$shell_quote($$shell_path($$OUT_PWD/$$batch_name)) + else: \ + $$1 += $$system_quote($$system_path($$OUT_PWD/$$batch_name)) + QMAKE_DISTCLEAN += $$OUT_PWD/$$batch_name + } export($$1) + export(QMAKE_DISTCLEAN) } # target variable, dependency var name, [non-empty: prepare for system(), not make] @@ -120,9 +165,9 @@ defineTest(qtAddTargetEnv) { deps = $$replace($$2, -private$, _private) deps = $$resolve_depends(deps, "QT.", ".depends" ".run_depends") !isEmpty(deps) { - libs = libs + deppath.CONFIG = prepend equals(QMAKE_HOST.os, Windows) { - libs = bins + deppath.CONFIG = always_prepend deppath.name = PATH } else:contains(QMAKE_HOST.os, Linux|FreeBSD|OpenBSD|NetBSD|DragonFly|SunOS|HP-UX|QNX|GNU) { deppath.name = LD_LIBRARY_PATH @@ -141,13 +186,12 @@ defineTest(qtAddTargetEnv) { ptypes = for(dep, deps) { isEmpty(3): \ - deppath += $$shell_path($$eval(QT.$${dep}.$$libs)) + deppath += $$shell_path($$eval(QT.$${dep}.libs)) else: \ - deppath += $$system_path($$eval(QT.$${dep}.$$libs)) + deppath += $$system_path($$eval(QT.$${dep}.libs)) ptypes += $$eval(QT.$${dep}.plugin_types) } deppath.value = $$unique(deppath) - deppath.CONFIG = prepend pluginpath.value = ppaths = $$[QT_INSTALL_PLUGINS/get] diff --git a/mkspecs/features/qt_module.prf b/mkspecs/features/qt_module.prf index 9a4ed20af8..1dae370630 100644 --- a/mkspecs/features/qt_module.prf +++ b/mkspecs/features/qt_module.prf @@ -215,11 +215,12 @@ android: CONFIG += qt_android_deps no_linker_version_script } # Add a post-processing step to replace the @CLASSLIST@ - verscriptprocess.commands = perl $${PWD}/data/unix/findclasslist.pl < $^ > $@ + verscriptprocess.commands = perl $${PWD}/data/unix/findclasslist.pl < $${verscript}.in $${verscript}.in.args > $@ verscriptprocess.target = $$verscript - verscriptprocess.depends = $${verscript}.in for(header, SYNCQT.PRIVATE_HEADER_FILES): \ verscriptprocess.depends += $${_PRO_FILE_PWD_}/$$header + write_file($${verscript}.in.args, verscriptprocess.depends)|error("Aborting.") + verscriptprocess.depends += $${verscript}.in $${verscript}.in.args QMAKE_EXTRA_TARGETS += verscriptprocess PRE_TARGETDEPS += $$verscript verscript = $${verscript}.in diff --git a/mkspecs/features/testcase.prf b/mkspecs/features/testcase.prf index 0340b7ed3c..e6eace190e 100644 --- a/mkspecs/features/testcase.prf +++ b/mkspecs/features/testcase.prf @@ -9,6 +9,11 @@ testcase_exceptions: CONFIG += exceptions check.files = check.path = . +# Add environment for non-installed builds. Do this first, so the +# 'make' variable expansions don't end up in a batch file/script. +QT_TOOL_NAME = target +qtAddTargetEnv(check.commands, QT) + # If the test ends up in a different directory, we should cd to that directory. TESTRUN_CWD = $$DESTDIR @@ -40,10 +45,6 @@ unix { # Allow for custom arguments to tests check.commands += $(TESTARGS) -# Add environment for non-installed builds -qtAddTargetEnv(check.commands, QT) - -# This must happen after adding the environment. !isEmpty(TESTRUN_CWD):!contains(TESTRUN_CWD, ^\\./?): \ check.commands = cd $$shell_path($$TESTRUN_CWD) && $$check.commands diff --git a/mkspecs/features/win32/idcidl.prf b/mkspecs/features/win32/idcidl.prf index a688b3ff41..fba7173e79 100644 --- a/mkspecs/features/win32/idcidl.prf +++ b/mkspecs/features/win32/idcidl.prf @@ -1,4 +1,4 @@ -build_pass:console: { +build_pass:console { warning("QAxServer applications cannot be console applications.") warning("Remove 'console' from your CONFIG.") } diff --git a/mkspecs/features/win32/windows.prf b/mkspecs/features/win32/windows.prf index 6ea9756f9a..986067fc8c 100644 --- a/mkspecs/features/win32/windows.prf +++ b/mkspecs/features/win32/windows.prf @@ -5,7 +5,7 @@ contains(TEMPLATE, ".*app") { mingw:DEFINES += QT_NEEDS_QMAIN qt:for(entryLib, $$list($$unique(QMAKE_LIBS_QT_ENTRY))) { - isEqual(entryLib, -lqtmain): { + isEqual(entryLib, -lqtmain) { !contains(QMAKE_DEFAULT_LIBDIRS, $$QT.core.libs): \ QMAKE_LIBS += -L$$QT.core.libs CONFIG(debug, debug|release): QMAKE_LIBS += $${entryLib}$${QT_LIBINFIX}d diff --git a/mkspecs/win32-g++/qmake.conf b/mkspecs/win32-g++/qmake.conf index 73f1fb6201..bb780882c1 100644 --- a/mkspecs/win32-g++/qmake.conf +++ b/mkspecs/win32-g++/qmake.conf @@ -85,7 +85,6 @@ QMAKE_LFLAGS_CXX11 = QMAKE_LFLAGS_CXX14 = QMAKE_LFLAGS_CXX1Z = QMAKE_LFLAGS_GCSECTIONS = -Wl,--gc-sections -QMAKE_LFLAGS_USE_GOLD = -fuse-ld=gold QMAKE_LINK_OBJECT_MAX = 10 QMAKE_LINK_OBJECT_SCRIPT = object_script QMAKE_PREFIX_SHLIB = |