summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2017-09-06 08:57:05 +0200
committerFrederik Gladhorn <frederik.gladhorn@qt.io>2017-09-08 13:11:16 +0000
commit5393b76f3780b0be33cc727458993223605e5ab1 (patch)
treeb793275da1e797033705ad762e551213d65f6691
parentd9f592f38ce7fb5a4fe5bd540b2ae9baf16760cc (diff)
Add configure test for speechd when pkg-config file is not availablev5.9.2
Sadly older speech-dispatcher versions (on RHEL where we package) seem to not yet ship the correct pkg-config stuff, so try to manually detect the presence of speechd, so that we finally have linux packages. And for speech-dispatcher-devel packages (on RHEL where we package), different versions have different include path. 0.8.7 has /usr/include/speech-dispatcher and 0.7.1 has /usr/include. Task-number: QTBUG-58461 Done-with: Frederik Gladhorn<frederik.gladhorn@qt.io> Change-Id: Ib3946cc7b84411f509dc74f6022831cb16d88b2e Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
-rw-r--r--config.tests/speechd/speechd.cpp45
-rw-r--r--config.tests/speechd/speechd.pro3
-rw-r--r--qtspeech.pro3
-rw-r--r--src/plugins/tts/speechdispatcher/qtexttospeech_speechd.cpp2
-rw-r--r--src/plugins/tts/speechdispatcher/qtexttospeech_speechd.h2
-rw-r--r--src/plugins/tts/speechdispatcher/speechdispatcher.pro3
-rw-r--r--src/plugins/tts/tts.pro2
-rw-r--r--tests/auto/texttospeech/texttospeech.pro5
-rw-r--r--tests/auto/texttospeech/tst_qtexttospeech.cpp2
9 files changed, 60 insertions, 7 deletions
diff --git a/config.tests/speechd/speechd.cpp b/config.tests/speechd/speechd.cpp
new file mode 100644
index 0000000..9910b31
--- /dev/null
+++ b/config.tests/speechd/speechd.cpp
@@ -0,0 +1,45 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Speech module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** 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 http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <libspeechd.h>
+
+int main()
+{
+ SPDConnection *speechDispatcher = spd_open("QtConfigTest", "main", 0, SPD_MODE_THREADED);
+ if (speechDispatcher)
+ spd_close(speechDispatcher);
+ return 0;
+}
diff --git a/config.tests/speechd/speechd.pro b/config.tests/speechd/speechd.pro
new file mode 100644
index 0000000..48e2ffa
--- /dev/null
+++ b/config.tests/speechd/speechd.pro
@@ -0,0 +1,3 @@
+SOURCES = speechd.cpp
+
+LIBS += -lspeechd
diff --git a/qtspeech.pro b/qtspeech.pro
index 69d4e5b..57563dc 100644
--- a/qtspeech.pro
+++ b/qtspeech.pro
@@ -2,4 +2,7 @@ lessThan(QT_MAJOR_VERSION, 5): error("The QtSpeech library only supports Qt 5.")
load(configure)
qtCompileTest(flite)
qtCompileTest(flite_alsa)
+!packagesExist(speech-dispatcher) {
+ qtCompileTest(speechd)
+}
load(qt_parts)
diff --git a/src/plugins/tts/speechdispatcher/qtexttospeech_speechd.cpp b/src/plugins/tts/speechdispatcher/qtexttospeech_speechd.cpp
index 118a71c..4210e43 100644
--- a/src/plugins/tts/speechdispatcher/qtexttospeech_speechd.cpp
+++ b/src/plugins/tts/speechdispatcher/qtexttospeech_speechd.cpp
@@ -38,7 +38,7 @@
#include "qtexttospeech_speechd.h"
#include <qdebug.h>
-#include <speech-dispatcher/libspeechd.h>
+#include <libspeechd.h>
#if LIBSPEECHD_MAJOR_VERSION > 0 || LIBSPEECHD_MINOR_VERSION >= 9
#define HAVE_SPD_090
diff --git a/src/plugins/tts/speechdispatcher/qtexttospeech_speechd.h b/src/plugins/tts/speechdispatcher/qtexttospeech_speechd.h
index cfe91b0..18df3e4 100644
--- a/src/plugins/tts/speechdispatcher/qtexttospeech_speechd.h
+++ b/src/plugins/tts/speechdispatcher/qtexttospeech_speechd.h
@@ -44,7 +44,7 @@
#include <QtCore/qvector.h>
#include <QtCore/qstring.h>
#include <QtCore/qlocale.h>
-#include <speech-dispatcher/libspeechd.h>
+#include <libspeechd.h>
QT_BEGIN_NAMESPACE
diff --git a/src/plugins/tts/speechdispatcher/speechdispatcher.pro b/src/plugins/tts/speechdispatcher/speechdispatcher.pro
index 5a5c0ab..b8a984e 100644
--- a/src/plugins/tts/speechdispatcher/speechdispatcher.pro
+++ b/src/plugins/tts/speechdispatcher/speechdispatcher.pro
@@ -7,7 +7,8 @@ load(qt_plugin)
QT += core texttospeech
CONFIG += link_pkgconfig
-PKGCONFIG = speech-dispatcher
+packagesExist(speech-dispatcher): PKGCONFIG = speech-dispatcher
+config_speechd: LIBS += -lspeechd
HEADERS += \
qtexttospeech_speechd.h \
diff --git a/src/plugins/tts/tts.pro b/src/plugins/tts/tts.pro
index 32085d5..e97c3cd 100644
--- a/src/plugins/tts/tts.pro
+++ b/src/plugins/tts/tts.pro
@@ -2,7 +2,7 @@ TEMPLATE = subdirs
unix {
CONFIG += link_pkgconfig
- packagesExist(speech-dispatcher) {
+ config_speechd | packagesExist(speech-dispatcher) {
SUBDIRS += speechdispatcher
}
}
diff --git a/tests/auto/texttospeech/texttospeech.pro b/tests/auto/texttospeech/texttospeech.pro
index 8789213..fdbe826 100644
--- a/tests/auto/texttospeech/texttospeech.pro
+++ b/tests/auto/texttospeech/texttospeech.pro
@@ -5,8 +5,9 @@ SOURCES += tst_qtexttospeech.cpp
unix {
CONFIG += link_pkgconfig
- packagesExist(speech-dispatcher) {
- PKGCONFIG = speech-dispatcher
+ packagesExist(speech-dispatcher): PKGCONFIG = speech-dispatcher
+ config_speechd | packagesExist(speech-dispatcher) {
DEFINES += HAVE_SPEECHD
}
+ config_speechd: LIBS += -lspeechd
}
diff --git a/tests/auto/texttospeech/tst_qtexttospeech.cpp b/tests/auto/texttospeech/tst_qtexttospeech.cpp
index 2e54d78..9e828e0 100644
--- a/tests/auto/texttospeech/tst_qtexttospeech.cpp
+++ b/tests/auto/texttospeech/tst_qtexttospeech.cpp
@@ -40,7 +40,7 @@
#include <QSignalSpy>
#if defined(HAVE_SPEECHD)
- #include <speech-dispatcher/libspeechd.h>
+ #include <libspeechd.h>
#if LIBSPEECHD_MAJOR_VERSION == 0 && LIBSPEECHD_MINOR_VERSION < 9
#define HAVE_SPEECHD_BEFORE_090
#endif