From 0c2f6d17b3eecf88feb3e7720f9654601d75033a Mon Sep 17 00:00:00 2001 From: Justin McPherson Date: Mon, 29 Mar 2010 16:05:53 +1000 Subject: Update PulseAudio config.test. Originally by Thiago Macieira Reviewed-by: Justin McPherson --- config.tests/unix/pulseaudio/pulseaudio.cpp | 58 +++++++++++++++++++++++++ config.tests/unix/pulseaudio/pulseaudio.pro | 7 ++- config.tests/unix/pulseaudio/pulseaudiotest.cpp | 49 --------------------- configure | 33 ++++++++++---- src/multimedia/effects/effects.pri | 3 +- 5 files changed, 87 insertions(+), 63 deletions(-) create mode 100644 config.tests/unix/pulseaudio/pulseaudio.cpp delete mode 100644 config.tests/unix/pulseaudio/pulseaudiotest.cpp diff --git a/config.tests/unix/pulseaudio/pulseaudio.cpp b/config.tests/unix/pulseaudio/pulseaudio.cpp new file mode 100644 index 0000000..ba5405b --- /dev/null +++ b/config.tests/unix/pulseaudio/pulseaudio.cpp @@ -0,0 +1,58 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the config.tests of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include +#include + +#if !defined(PA_API_VERSION) || PA_API_VERSION-0 != 12 +# error "Incompatible PulseAudio API version" +#endif +#if !PA_CHECK_VERSION(0,9,0) +# error "PulseAudio version too old" +#endif + +int main(int, char **) +{ + const char *headers = pa_get_headers_version(); + const char *library = pa_get_library_version(); + pa_glib_mainloop_new(0); + return (headers - library) * 0; +} diff --git a/config.tests/unix/pulseaudio/pulseaudio.pro b/config.tests/unix/pulseaudio/pulseaudio.pro index 698a35f..d75b16f 100644 --- a/config.tests/unix/pulseaudio/pulseaudio.pro +++ b/config.tests/unix/pulseaudio/pulseaudio.pro @@ -1,4 +1,3 @@ -SOURCES = pulseaudiotest.cpp -LIBS+=-lpulse -CONFIG -= qt dylib -mac:CONFIG -= app_bundle +SOURCES = pulseaudio.cpp +CONFIG -= qt +LIBS += diff --git a/config.tests/unix/pulseaudio/pulseaudiotest.cpp b/config.tests/unix/pulseaudio/pulseaudiotest.cpp deleted file mode 100644 index eed88da..0000000 --- a/config.tests/unix/pulseaudio/pulseaudiotest.cpp +++ /dev/null @@ -1,49 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include - -int main(int ,char **) -{ - pa_threaded_mainloop *mainloop = pa_threaded_mainloop_new(); - return 0; -} - diff --git a/configure b/configure index 3c38763..4ffc457 100755 --- a/configure +++ b/configure @@ -5213,6 +5213,29 @@ if [ "$PLATFORM_X11" = "yes" -o "$PLATFORM_QWS" = "yes" ]; then elif [ "$CFG_GLIB" = "no" ]; then CFG_ICD=no fi + + # Auto-detect PulseAudio support + if [ "$CFG_PULSEAUDIO" != "no" ]; then + if [ -n "$PKG_CONFIG" ]; then + QT_CFLAGS_PULSEAUDIO=`$PKG_CONFIG --cflags libpulse '>=' 0.9.10 libpulse-mainloop-glib 2>/dev/null` + QT_LIBS_PULSEAUDIO=`$PKG_CONFIG --libs libpulse '>=' 0.9.10 libpulse-mainloop-glib 2>/dev/null` + fi + if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/pulseaudio "PulseAudio" $L_FLAGS $I_FLAGS $l_FLAGS $QT_CFLAGS_PULSEAUDIO $QT_LIBS_PULSEAUDIO $X11TESTS_FLAGS; then + CFG_PULSEAUDIO=yes + QMakeVar set QT_CFLAGS_PULSEAUDIO "$QT_CFLAGS_PULSEAUDIO" + QMakeVar set QT_LIBS_PULSEAUDIO "$QT_LIBS_PULSEAUDIO" + else + if [ "$CFG_PULSEAUDIO" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then + echo "PulseAudio support cannot be enabled due to functionality tests!" + echo " Turn on verbose messaging (-v) to $0 to see the final report." + echo " If you believe this message is in error you may use the continue" + echo " switch (-continue) to $0 to continue." + exit 101 + else + CFG_PULSEAUDIO=no + fi + fi + fi fi # X11/QWS # x11 @@ -6036,14 +6059,6 @@ if [ "$CFG_ALSA" = "auto" ]; then fi fi -if [ "$CFG_PULSEAUDIO" = "auto" ]; then - if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/pulseaudio "pulseaudio" $L_FLAGS $I_FLAGS $l_FLAGS; then - CFG_PULSEAUDIO=yes - else - CFG_PULSEAUDIO=no - fi -fi - if [ "$CFG_JAVASCRIPTCORE_JIT" = "yes" ] || [ "$CFG_JAVASCRIPTCORE_JIT" = "auto" ]; then if [ "$CFG_ARCH" = "arm" ] || [ "$CFG_ARCH" = "armv6" ]; then "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/javascriptcore-jit "javascriptcore-jit" $L_FLAGS $I_FLAGS $l_FLAGS @@ -7700,6 +7715,7 @@ echo "CUPS support ........... $CFG_CUPS" echo "Iconv support .......... $CFG_ICONV" echo "Glib support ........... $CFG_GLIB" echo "GStreamer support ...... $CFG_GSTREAMER" +echo "PulseAudio support ..... $CFG_PULSEAUDIO" echo "Large File support ..... $CFG_LARGEFILE" echo "GIF support ............ $CFG_GIF" if [ "$CFG_TIFF" = "no" ]; then @@ -7807,7 +7823,6 @@ elif [ "$CFG_OPENSSL" = "linked" ]; then fi echo "OpenSSL support ........ $CFG_OPENSSL $OPENSSL_LINKAGE" echo "Alsa support ........... $CFG_ALSA" -echo "Pulse Audio support .... $CFG_PULSEAUDIO" if [ "$PLATFORM_MAC" = "yes" ]; then echo "CoreWlan support ....... $CFG_COREWLAN" fi diff --git a/src/multimedia/effects/effects.pri b/src/multimedia/effects/effects.pri index be2b696..6307255 100644 --- a/src/multimedia/effects/effects.pri +++ b/src/multimedia/effects/effects.pri @@ -5,7 +5,8 @@ unix:!mac { DEFINES += QT_MULTIMEDIA_PULSEAUDIO HEADERS += $$PWD/qsoundeffect_pulse_p.h SOURCES += $$PWD/qsoundeffect_pulse_p.cpp - LIBS += -lpulse + QMAKE_CXXFLAGS += $$QT_CFLAGS_PULSEAUDIO + LIBS += $$QT_LIBS_PULSEAUDIO } else { DEFINES += QT_MULTIMEDIA_QMEDIAPLAYER HEADERS += $$PWD/qsoundeffect_qmedia_p.h -- cgit v0.12