summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2016-12-14 15:21:28 +0100
committerJani Heikkinen <jani.heikkinen@qt.io>2016-12-15 07:01:39 +0000
commitb9d0b6933875005a5b1f17a53e29240faf4a440e (patch)
treef57a4b96f2dc67411413bd336141f5dd02752bad
parent42cd3124cdef38545fdba5a2de37bfcad2542cad (diff)
Fix Linux audio library detection
The configure checks where moved to QtMultimedia which we do not depend on, therefore we need to now duplicate the checks ourselves. Task-number: QTBUG-57620 Change-Id: I6f7319c7e91e3f51baf012c669121389cd6e1360 Reviewed-by: Michael BrĂ¼ning <michael.bruning@qt.io>
-rw-r--r--configure.json43
-rw-r--r--src/core/config/linux.pri7
-rw-r--r--tools/qmake/config.tests/alsa/alsa.pro2
-rw-r--r--tools/qmake/config.tests/alsa/alsatest.cpp37
-rw-r--r--tools/qmake/mkspecs/features/configure.prf15
5 files changed, 93 insertions, 11 deletions
diff --git a/configure.json b/configure.json
index 63abd1dba..22870a0eb 100644
--- a/configure.json
+++ b/configure.json
@@ -1,14 +1,45 @@
{
"module": "webengine",
+ "testDir": "tools/qmake/config.tests",
+
"commandline": {
"options": {
+ "alsa": "boolean",
"proprietary-codecs": "boolean",
+ "pulseaudio": "boolean",
"spellchecker": "boolean"
}
},
+ "libraries": {
+ "alsa": {
+ "label": "ALSA",
+ "test": "alsa",
+ "sources": [
+ "-lasound"
+ ]
+ },
+ "pulseaudio": {
+ "label": "PulseAudio >= 0.9.10",
+ "sources": [
+ { "type": "pkgConfig", "args": "libpulse >= 0.9.10 libpulse-mainloop-glib" }
+ ]
+ }
+ },
+
"features": {
+ "alsa": {
+ "label": "ALSA",
+ "condition": "config.unix && libs.alsa",
+ "output": [ "privateFeature" ]
+ },
+ "pulseaudio": {
+ "label": "PulseAudio",
+ "autoDetect": "config.unix",
+ "condition": "libs.pulseaudio",
+ "output": [ "privateFeature" ]
+ },
"proprietary-codecs": {
"label": "Proprietary Codecs",
"autoDetect": false,
@@ -27,7 +58,17 @@
"section": "Qt WebEngine",
"entries": [
"proprietary-codecs",
- "spellchecker"
+ "spellchecker",
+ {
+ "type": "feature",
+ "args": "alsa",
+ "condition": "config.unix"
+ },
+ {
+ "type": "feature",
+ "args": "pulseaudio",
+ "condition": "config.unix"
+ }
]
}
]
diff --git a/src/core/config/linux.pri b/src/core/config/linux.pri
index 83c852f86..59417997a 100644
--- a/src/core/config/linux.pri
+++ b/src/core/config/linux.pri
@@ -1,5 +1,6 @@
include(common.pri)
-QT_FOR_CONFIG += gui-private
+include($$QTWEBENGINE_OUT_ROOT/qtwebengine-config.pri)
+QT_FOR_CONFIG += gui-private webengine-private
# linux_use_bundled_gold currently relies on a hardcoded relative path from chromium/src/out/(Release|Debug)
# Disable it along with the -Wl,--threads flag just in case gold isn't installed on the system.
@@ -41,12 +42,12 @@ qtConfig(system-png): GYP_CONFIG += use_system_libpng=1
qtConfig(system-jpeg): GYP_CONFIG += use_system_libjpeg=1
qtConfig(system-harfbuzz): use?(system_harfbuzz): GYP_CONFIG += use_system_harfbuzz=1
!qtConfig(glib): GYP_CONFIG += use_glib=0
-contains(QT_CONFIG, pulseaudio) {
+qtConfig(pulseaudio) {
GYP_CONFIG += use_pulseaudio=1
} else {
GYP_CONFIG += use_pulseaudio=0
}
-contains(QT_CONFIG, alsa) {
+qtConfig(alsa) {
GYP_CONFIG += use_alsa=1
} else {
GYP_CONFIG += use_alsa=0
diff --git a/tools/qmake/config.tests/alsa/alsa.pro b/tools/qmake/config.tests/alsa/alsa.pro
new file mode 100644
index 000000000..7322b6fb8
--- /dev/null
+++ b/tools/qmake/config.tests/alsa/alsa.pro
@@ -0,0 +1,2 @@
+SOURCES = alsatest.cpp
+
diff --git a/tools/qmake/config.tests/alsa/alsatest.cpp b/tools/qmake/config.tests/alsa/alsatest.cpp
new file mode 100644
index 000000000..ea511cd21
--- /dev/null
+++ b/tools/qmake/config.tests/alsa/alsatest.cpp
@@ -0,0 +1,37 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:GPL-EXCEPT$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <alsa/asoundlib.h>
+#if SND_LIB_VERSION < 0x1000a // 1.0.10
+#error "Alsa version found too old, require >= 1.0.10"
+#endif
+
+int main(int argc,char **argv)
+{
+}
+
diff --git a/tools/qmake/mkspecs/features/configure.prf b/tools/qmake/mkspecs/features/configure.prf
index bb4c56cae..43a5f2757 100644
--- a/tools/qmake/mkspecs/features/configure.prf
+++ b/tools/qmake/mkspecs/features/configure.prf
@@ -20,13 +20,20 @@ defineTest(runConfigure) {
qtCompileTest($$test)
}
+ isQtMinimum(5, 8) {
+ include($$QTWEBENGINE_OUT_ROOT/qtwebengine-config.pri)
+ QT_FOR_CONFIG += webengine-private
+ qtConfig(proprietary-codecs): WEBENGINE_CONFIG += use_proprietary_codecs
+ qtConfig(spellchecker): WEBENGINE_CONFIG += use_spellchecker
+ }
+
linux {
QT_FOR_CONFIG += gui-private
!config_khr:skipBuild("khronos development headers appear to be missing (mesa/libegl1-mesa-dev)")
REQUIRED_PACKAGES = dbus-1 fontconfig
!cross_compile: qtConfig(xcb): REQUIRED_PACKAGES += libdrm xcomposite xcursor xi xrandr xscrnsaver xtst
- contains(QT_CONFIG, pulseaudio): REQUIRED_PACKAGES += libpulse
+ qtConfig(pulseaudio): REQUIRED_PACKAGES += libpulse
qtConfig(system-png): REQUIRED_PACKAGES += libpng
qtConfig(system-harfbuzz) {
packagesExist("\'harfbuzz >= 1.2.0\'"): WEBENGINE_CONFIG += use_system_harfbuzz
@@ -81,12 +88,6 @@ defineTest(runConfigure) {
!cross_compile {
WEBENGINE_CONFIG += enable_pdf
}
- isQtMinimum(5, 8) {
- include($$QTWEBENGINE_OUT_ROOT/qtwebengine-config.pri)
- QT_FOR_CONFIG += webengine-private
- qtConfig(proprietary-codecs): WEBENGINE_CONFIG += use_proprietary_codecs
- qtConfig(spellchecker): WEBENGINE_CONFIG += use_spellchecker
- }
isEmpty(skipBuildReason): {
cache(CONFIG, add, $$list(webengine_successfully_configured))