summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2015-10-12 15:59:17 +0200
committerAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2015-10-12 15:23:45 +0000
commite0dd0c4e02efc3897c4c1f814ee89963849ffd50 (patch)
tree4027657f73cb6fa198e4348744d563a43af48e4a
parent4654fd86fb5de097a8ad271c2f53e99e19c36c93 (diff)
Clean up configure syntax
Imports use? qmake macro from QtWebKit and use it to make checks simpler and keep the webengine config in WEBENGINE_CONFIG. Change-Id: Ic0f1fca45ebc292d8146107697f9d3ca3764dfb4 Reviewed-by: Michael BrĂ¼ning <michael.bruning@theqtcompany.com>
-rw-r--r--src/core/config/linux.pri29
-rw-r--r--tools/qmake/mkspecs/features/configure.prf29
-rw-r--r--tools/qmake/mkspecs/features/functions.prf5
3 files changed, 33 insertions, 30 deletions
diff --git a/src/core/config/linux.pri b/src/core/config/linux.pri
index 803043c50..8d736d0c1 100644
--- a/src/core/config/linux.pri
+++ b/src/core/config/linux.pri
@@ -18,29 +18,28 @@ GYP_CONFIG += \
use_kerberos=0 \
use_pango=0
-!config_system_nss {
+!use?(nss) {
GYP_CONFIG += use_nss_certs=0 \
use_openssl=1 \
use_openssl_certs=1
}
-contains(QT_CONFIG, system-zlib): config_system_minizip: GYP_CONFIG += use_system_zlib=1
+contains(QT_CONFIG, system-zlib): use?(system_minizip): GYP_CONFIG += use_system_zlib=1
contains(QT_CONFIG, system-png): GYP_CONFIG += use_system_libpng=1
contains(QT_CONFIG, system-jpeg): GYP_CONFIG += use_system_libjpeg=1
contains(QT_CONFIG, system-harfbuzz): GYP_CONFIG += use_system_harfbuzz=1
!contains(QT_CONFIG, pulseaudio): GYP_CONFIG += use_pulseaudio=0
-config_system_libevent: GYP_CONFIG += use_system_libevent=1
-config_system_libwebp: GYP_CONFIG += use_system_libwebp=1
-config_system_libsrtp: GYP_CONFIG += use_system_libsrtp=1
-config_system_libxslt: GYP_CONFIG += use_system_libxml=1
-config_system_flac: GYP_CONFIG += use_system_flac=1
-config_system_jsoncpp: GYP_CONFIG += use_system_jsoncpp=1
-config_system_opus: GYP_CONFIG += use_system_opus=1
-config_system_snappy: GYP_CONFIG += use_system_snappy=1
-config_system_speex: GYP_CONFIG += use_system_speex=1
-config_system_vpx: GYP_CONFIG += use_system_libvpx=1
-
-contains(WEBENGINE_CONFIG, use_system_icu): GYP_CONFIG += use_system_icu=1
-contains(WEBENGINE_CONFIG, use_system_ffmpeg): GYP_CONFIG += use_system_ffmpeg=1
+use?(system_libevent): GYP_CONFIG += use_system_libevent=1
+use?(system_libwebp): GYP_CONFIG += use_system_libwebp=1
+use?(system_libsrtp): GYP_CONFIG += use_system_libsrtp=1
+use?(system_libxslt): GYP_CONFIG += use_system_libxml=1
+use?(system_flac): GYP_CONFIG += use_system_flac=1
+use?(system_jsoncpp): GYP_CONFIG += use_system_jsoncpp=1
+use?(system_opus): GYP_CONFIG += use_system_opus=1
+use?(system_snappy): GYP_CONFIG += use_system_snappy=1
+use?(system_speex): GYP_CONFIG += use_system_speex=1
+use?(system_vpx): GYP_CONFIG += use_system_libvpx=1
+use?(system_icu): GYP_CONFIG += use_system_icu=1
+use?(system_ffmpeg): GYP_CONFIG += use_system_ffmpeg=1
diff --git a/tools/qmake/mkspecs/features/configure.prf b/tools/qmake/mkspecs/features/configure.prf
index 90966151d..f117e214d 100644
--- a/tools/qmake/mkspecs/features/configure.prf
+++ b/tools/qmake/mkspecs/features/configure.prf
@@ -35,48 +35,47 @@ defineTest(runConfigure) {
for(package, $$list($$REQUIRED_PACKAGES)) {
!packagesExist($$package):skipBuild("Unmet dependency: $$package")
}
- packagesExist(minizip, zlib): WEBENGINE_CONFIG += config_system_minizip
+ packagesExist(minizip, zlib): WEBENGINE_CONFIG += use_system_minizip
else: log("System zlib or minizip not found. Using Chromium's copies.$${EOL}")
- packagesExist(libwebp,libwebpdemux): WEBENGINE_CONFIG += config_system_libwebp
+ packagesExist(libwebp,libwebpdemux): WEBENGINE_CONFIG += use_system_libwebp
else: log("System libwebp or libwebpdemux not found. Using Chromium's copies.$${EOL}")
- packagesExist(libxml-2.0,libxslt): WEBENGINE_CONFIG += config_system_libxslt
+ packagesExist(libxml-2.0,libxslt): WEBENGINE_CONFIG += use_system_libxslt
else: log("System libxml2 or libxslt not found. Using Chromium's copies.$${EOL}")
for(package, $$list("libevent flac jsoncpp opus speex")) {
- packagesExist($$package): WEBENGINE_CONFIG += config_system_$$package
+ packagesExist($$package): WEBENGINE_CONFIG += use_system_$$package
else: log("System $$package not found. Using Chromium's copy.$${EOL}")
}
- packagesExist("\'vpx >= 1.4\'"): WEBENGINE_CONFIG += config_system_vpx
+ packagesExist("\'vpx >= 1.4\'"): WEBENGINE_CONFIG += use_system_vpx
else: log("System vpx >= 1.4 not found. Using Chromium's copy.$${EOL}")
- config_srtp: WEBENGINE_CONFIG += config_system_libsrtp
+ config_srtp: WEBENGINE_CONFIG += use_system_libsrtp
else: log("System libsrtp not found. Using Chromium's copy.$${EOL}")
- config_snappy: WEBENGINE_CONFIG += config_system_snappy
+ config_snappy: WEBENGINE_CONFIG += use_system_snappy
else: log("System snappy not found. Using Chromium's copy.$${EOL}")
# Optional dependencies
- packagesExist(nss): WEBENGINE_CONFIG += config_system_nss
+ packagesExist(nss): WEBENGINE_CONFIG += use_nss
else: log("System NSS not found, BoringSSL will be used.$${EOL}")
}
isEmpty(skipBuildReason): {
cache(CONFIG, add, $$list(webengine_successfully_configured))
!isEmpty(WEBENGINE_CONFIG) {
- CONFIG += $$WEBENGINE_CONFIG
- cache(CONFIG, add, $$list($$WEBENGINE_CONFIG))
+ cache(WEBENGINE_CONFIG, add, $$list($$WEBENGINE_CONFIG))
+ export(WEBENGINE_CONFIG)
}
}
- export(CONFIG)
}
# This is called from default_post, at which point we've also parsed
# command line options
defineTest(finalizeConfigure) {
linux {
- config_system_nss {
+ use?(nss) {
log("SSL............................... Using system NSS$${EOL}")
} else {
log("SSL............................... Using bundled BoringSSL$${EOL}")
}
- contains(WEBENGINE_CONFIG, use_system_icu) {
+ use?(system_icu) {
packagesExist("icu-uc icu-i18n") {
log("ICU............................... Using system version$${EOL}")
} else {
@@ -86,7 +85,7 @@ defineTest(finalizeConfigure) {
} else {
log("ICU............................... Using internal copy (Default, force system ICU with WEBENGINE_CONFIG += use_system_icu)$${EOL}")
}
- contains(WEBENGINE_CONFIG, use_system_ffmpeg) {
+ use?(system_ffmpeg) {
packagesExist("libavcodec libavformat libavutil") {
packagesExist("libwebp, libwebpdemux, opus, \'vpx >= 1.4\'"){
log("FFMPEG............................ Using system version$${EOL}")
@@ -102,7 +101,7 @@ defineTest(finalizeConfigure) {
log("FFMPEG............................ Using internal copy (Default, force system FFMPEG with WEBENGINE_CONFIG += use_system_ffmpeg)$${EOL}")
}
}
- contains(WEBENGINE_CONFIG, use_proprietary_codecs) {
+ use?(proprietary_codecs) {
log("Proprietary codecs (H264, MP3).... Enabled$${EOL}")
} else {
log("Proprietary codecs (H264, MP3).... Not enabled (Default, enable with WEBENGINE_CONFIG += use_proprietary_codecs)$${EOL}")
diff --git a/tools/qmake/mkspecs/features/functions.prf b/tools/qmake/mkspecs/features/functions.prf
index 421513727..99f60d0e5 100644
--- a/tools/qmake/mkspecs/features/functions.prf
+++ b/tools/qmake/mkspecs/features/functions.prf
@@ -149,6 +149,11 @@ defineReplace(which) {
return($$out)
}
+defineTest(use?) {
+ contains(WEBENGINE_CONFIG, use_$$lower($$1)): return(true)
+ return(false)
+}
+
defineReplace(findOrBuildNinja) {
# If NINJA_PATH env var is set, prefer that.
# Fallback to locating our own bootstrapped ninja.