summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJustin McPherson <justin.mcpherson@nokia.com>2010-03-29 06:05:53 (GMT)
committerJustin McPherson <justin.mcpherson@nokia.com>2010-03-29 06:05:53 (GMT)
commit0c2f6d17b3eecf88feb3e7720f9654601d75033a (patch)
tree900f5d93be0fd344c7719409381aa9d60d1ce754
parent56c18942a13da36d79707ebc814d486dc0dbbc67 (diff)
downloadQt-0c2f6d17b3eecf88feb3e7720f9654601d75033a.zip
Qt-0c2f6d17b3eecf88feb3e7720f9654601d75033a.tar.gz
Qt-0c2f6d17b3eecf88feb3e7720f9654601d75033a.tar.bz2
Update PulseAudio config.test.
Originally by Thiago Macieira Reviewed-by: Justin McPherson
-rw-r--r--config.tests/unix/pulseaudio/pulseaudio.cpp (renamed from config.tests/unix/pulseaudio/pulseaudiotest.cpp)19
-rw-r--r--config.tests/unix/pulseaudio/pulseaudio.pro7
-rwxr-xr-xconfigure33
-rw-r--r--src/multimedia/effects/effects.pri3
4 files changed, 43 insertions, 19 deletions
diff --git a/config.tests/unix/pulseaudio/pulseaudiotest.cpp b/config.tests/unix/pulseaudio/pulseaudio.cpp
index eed88da..ba5405b 100644
--- a/config.tests/unix/pulseaudio/pulseaudiotest.cpp
+++ b/config.tests/unix/pulseaudio/pulseaudio.cpp
@@ -4,7 +4,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the documentation of the Qt Toolkit.
+** This file is part of the config.tests of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
@@ -40,10 +40,19 @@
****************************************************************************/
#include <pulse/pulseaudio.h>
+#include <pulse/glib-mainloop.h>
-int main(int ,char **)
+#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 **)
{
- pa_threaded_mainloop *mainloop = pa_threaded_mainloop_new();
- return 0;
+ 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/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