[pulseaudio-discuss] Cleanup of configure.ac

2011-04-30 Thread Maarten Bosmans
This patch series cleans up the --enable- handling part of 
configure.ac.
It changes the testing of features so that they are all done in the same way.

The linecount of configure.ac is reduced from around 1800 with 450 lines. This 
is partly because os using macro's,
partly due to simplification of if/else logic and also a bit due to rewriting 
stuff to one line.  I think the
readability of configure.ac is greatly improved.

The only feature that is lost is the error message when --enable-foo=arg is 
used with arg something other than yes or
no. Instead now silently the default is used. This is no big loss IMHO, because 
usually just --enable-foo or
--disable-foo is given to configure.

Maarten


[PATCH 1/7] build-system: Simplify AC_ARG_ENABLE usage
[PATCH 2/7] build-system: Use AS_IF macro for configure output
[PATCH 3/7] build-system: Move AC_DEFINE to separate line with AS_IF
[PATCH 4/7] build-system: Move dependency error messages to outer scope
[PATCH 5/7] build-system: Replace some more conditionals with AS_IF
[PATCH 6/7] build-system: Rearrange database selection
[PATCH 7/7] build-system: Small fixes
___
pulseaudio-discuss mailing list
pulseaudio-discuss@mail.0pointer.de
https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss


[pulseaudio-discuss] [PATCH 2/7] build-system: Use AS_IF macro for configure output

2011-04-30 Thread Maarten Bosmans
And add some HAVE_[feature] variables for clarity.
---
 configure.ac |  198 ++
 1 files changed, 48 insertions(+), 150 deletions(-)

diff --git a/configure.ac b/configure.ac
index a816052..403b935 100644
--- a/configure.ac
+++ b/configure.ac
@@ -754,26 +754,32 @@ if test "x$enable_oss_output" != "xno" || test 
"x$enable_oss_wrapper" != "xno";
 AC_CHECK_HEADERS([sys/soundcard.h],
 [
 if test "x$enable_oss_output" != "xno"; then
+HAVE_OSS_OUTPUT=1
 AC_DEFINE([HAVE_OSS_OUTPUT], 1, [Have OSS output?])
 fi
 if test "x$enable_oss_wrapper" != "xno"; then
+HAVE_OSS_WRAPPER=1
 AC_DEFINE([HAVE_OSS_WRAPPER], 1, [Have OSS wrapper (padsp)?])
 fi
 HAVE_OSS=1
 ],
 [
 HAVE_OSS=0
+HAVE_OSS_OUTPUT=0
+HAVE_OSS_WRAPPER=0
 if test "x$enable_oss_output" = "xyes" || test 
"x$enable_oss_wrapper" = "xyes"; then
 AC_MSG_ERROR([*** OSS support not found])
 fi
 ])
 else
 HAVE_OSS=0
+HAVE_OSS_OUTPUT=0
+HAVE_OSS_WRAPPER=0
 fi
 
 AC_SUBST(HAVE_OSS)
-AM_CONDITIONAL([HAVE_OSS_OUTPUT], [test "x$HAVE_OSS" = "x1" && test 
"x$enable_oss_output" != "xno"])
-AM_CONDITIONAL([HAVE_OSS_WRAPPER], [test "x$HAVE_OSS" = "x1" && test 
"x$enable_oss_wrapper" != "xno"])
+AM_CONDITIONAL([HAVE_OSS_OUTPUT], [test "x$HAVE_OSS_OUTPUT" = "x1"])
+AM_CONDITIONAL([HAVE_OSS_WRAPPER], [test "x$HAVE_OSS_WRAPPER" = "x1"])
 
  CoreAudio support (optional) 
 
@@ -1021,11 +1027,15 @@ AC_ARG_ENABLE([tcpwrap],
 
 if test "x$enable_tcpwrap" != "xno"; then
 ACX_LIBWRAP
-if test "x${LIBWRAP_LIBS}" = "x" && test "x$enable_tcpwrap" = "xyes"; then
-AC_MSG_ERROR([*** TCP wrappers support not found])
+HAVE_TCPWRAP=1
+if test "x${LIBWRAP_LIBS}" = "x"; then
+HAVE_TCPWRAP=0
+if test "x$enable_tcpwrap" = "xyes"; then
+AC_MSG_ERROR([*** TCP wrappers support not found])
+fi
 fi
 else
-LIBWRAP_LIBS=
+HAVE_TCPWRAP=0
 fi
 
 AC_SUBST(LIBWRAP_LIBS)
@@ -1274,7 +1284,10 @@ AC_ARG_ENABLE([per-user-esound-socket],
 AS_HELP_STRING([--disable-per-user-esound-socket],[Use global esound 
socket directory /tmp/.esd/socket.]))
 
 if test "x$enable_per_user_esound_socket" != "xno"; then
-   AC_DEFINE([USE_PER_USER_ESOUND_SOCKET], [1], [Define this if you want 
per-user esound socket directories])
+USE_PER_USER_ESOUND_SOCKET=1
+AC_DEFINE([USE_PER_USER_ESOUND_SOCKET], [1], [Define this if you want 
per-user esound socket directories])
+else
+USE_PER_USER_ESOUND_SOCKET=0
 fi
 
  PulseAudio system runtime dir 
@@ -1362,151 +1375,36 @@ po/Makefile.in
 AC_OUTPUT
 
 # ==
-ENABLE_X11=no
-if test "x$HAVE_X11" = "x1" ; then
-   ENABLE_X11=yes
-fi
-
-ENABLE_OSS_OUTPUT=no
-ENABLE_OSS_WRAPPER=no
-if test "x$HAVE_OSS" = "x1" ; then
-   if test "x$enable_oss_output" != "xno"; then
-  ENABLE_OSS_OUTPUT=yes
-   fi
-   if test "x$enable_oss_wrapper" != "xno"; then
-  ENABLE_OSS_WRAPPER=yes
-   fi
-fi
-
-ENABLE_COREAUDIO=no
-if test "x$HAVE_COREAUDIO" = "x1" ; then
-   ENABLE_COREAUDIO=yes
-fi
-
-ENABLE_ALSA=no
-if test "x$HAVE_ALSA" = "x1" ; then
-   ENABLE_ALSA=yes
-fi
-
-ENABLE_SOLARIS=no
-if test "x$HAVE_SOLARIS" = "x1" ; then
-   ENABLE_SOLARIS=yes
-fi
-
-ENABLE_WAVEOUT=no
-if test "x$HAVE_WAVEOUT" = "x1" ; then
-   ENABLE_WAVEOUT=yes
-fi
-
-ENABLE_GTK20=no
-if test "x$HAVE_GTK20" = "x1" ; then
-   ENABLE_GTK20=yes
-fi
-
-ENABLE_GLIB20=no
-if test "x$HAVE_GLIB20" = "x1" ; then
-   ENABLE_GLIB20=yes
-fi
-
-ENABLE_GCONF=no
-if test "x$HAVE_GCONF" = "x1" ; then
-   ENABLE_GCONF=yes
-fi
-
-ENABLE_AVAHI=no
-if test "x$HAVE_AVAHI" = "x1" ; then
-   ENABLE_AVAHI=yes
-fi
-
-ENABLE_JACK=no
-if test "x$HAVE_JACK" = "x1" ; then
-   ENABLE_JACK=yes
-fi
-
-ENABLE_LIBASYNCNS=no
-if test "x$HAVE_LIBASYNCNS" = "x1" ; then
-   ENABLE_LIBASYNCNS=yes
-fi
-
-ENABLE_LIRC=no
-if test "x$HAVE_LIRC" = "x1" ; then
-   ENABLE_LIRC=yes
-fi
-
-ENABLE_DBUS=no
-if test "x$HAVE_DBUS" = "x1" ; then
-   ENABLE_DBUS=yes
-fi
-
-ENABLE_HAL=no
-if test "x$HAVE_HAL" = "x1" ; then
-   ENABLE_HAL=yes
-fi
-
-ENABLE_UDEV=no
-if test "x$HAVE_UDEV" = "x1" ; then
-   ENABLE_UDEV=yes
-fi
-
-ENABLE_HAL_COMPAT=no
-if test "x$HAVE_HAL_COMPAT" = "x1" ; then
-   ENABLE_HAL_COMPAT=yes
-fi
-
-ENABLE_TCPWRAP=no
-if test "x${LIBWRAP_LIBS}" != x ; then
-   ENABLE_TCPWRAP=yes
-fi
-
-ENABLE_LIBSAMPLERATE=no
-if test "x${HAVE_LIBSAMPLERATE}" = "x1" ; then
-   ENABLE_LIBSAMPLERATE=yes
-fi
-
-ENABLE_BLUEZ=no
-if test "x${HAVE_BLUEZ}" = "x1" ; then
-   ENABLE_BLUEZ=yes
-fi
-
-ENABLE_GDBM=no
-if test "x${HAVE_GDBM}" = "x1" ; then
-   ENABLE_GDBM=yes
-fi
 
-ENABLE_TDB=no
-if test "x${HAVE_TDB}" = "x1" ; then
-   ENABLE_TDB=yes
-fi
-
-ENABLE_SIMPLEDB=no
-if test "x${HAVE_SIMPLEDB}" = "x1" ; then
-   

[pulseaudio-discuss] [PATCH 1/7] build-system: Simplify AC_ARG_ENABLE usage

2011-04-30 Thread Maarten Bosmans
Make use of the enable_[feature] variable automatically defined
by AC_ARG_ENABLE instead of defining our own variable.
---
 configure.ac |  415 +++--
 1 files changed, 109 insertions(+), 306 deletions(-)

diff --git a/configure.ac b/configure.ac
index 980d148..a816052 100644
--- a/configure.ac
+++ b/configure.ac
@@ -148,25 +148,14 @@ AM_CONDITIONAL([BUILD_TESTS_DEFAULT], [test 
"x$enable_default_build_tests" != "x
 
 # Native atomic operation support
 AC_ARG_ENABLE([atomic-arm-linux-helpers],
-AS_HELP_STRING([--disable-atomic-arm-linux-helpers],[use inline asm or 
libatomic_ops instead]),
-[
-case "${enableval}" in
-yes) atomic_arm_linux_helpers=yes ;;
-no) atomic_arm_linux_helpers=no ;;
-*) AC_MSG_ERROR(bad value ${enableval} for 
--disable-atomic-arm-linux-helpers) ;;
-esac
-],
-[atomic_arm_linux_helpers=auto])
+AS_HELP_STRING([--disable-atomic-arm-linux-helpers],[use inline asm or 
libatomic_ops instead]))
 
 AC_ARG_ENABLE([atomic-arm-memory-barrier],
-AS_HELP_STRING([--enable-atomic-arm-memory-barrier],[only really needed in 
SMP arm systems]),
-[
-case "${enableval}" in
-yes) AC_DEFINE_UNQUOTED(ATOMIC_ARM_MEMORY_BARRIER_ENABLED, 1, 
[Enable memory barriers]) ;;
-no) ;;
-*) AC_MSG_ERROR(bad value ${enableval} for 
--disable-atomic-arm-linux-helpers) ;;
-esac
-],)
+AS_HELP_STRING([--enable-atomic-arm-memory-barrier],[only really needed in 
SMP arm systems]))
+
+if test "x$enable_atomic_arm_memory_barrier" = "xyes"; then
+AC_DEFINE_UNQUOTED(ATOMIC_ARM_MEMORY_BARRIER_ENABLED, 1, [Enable memory 
barriers])
+fi
 
 AC_ARG_ENABLE(mac-universal,
 AS_HELP_STRING([--enable-mac-universal], [Build Mac universal binaries]),
@@ -229,7 +218,7 @@ else
 # The Linux kernel helper functions have been there since 2.6.16. 
However
 # compile time checking for kernel version in cross compile 
environment
 # (which is usually the case for arm cpu) is tricky (or 
impossible).
-if test "x$pulse_target_os" = "xlinux" && test 
"x$atomic_arm_linux_helpers" != "xno"; then
+if test "x$pulse_target_os" = "xlinux" && test 
"x$enable_atomic_arm_linux_helpers" != "xno"; then
 AC_MSG_RESULT([yes])
 AC_DEFINE_UNQUOTED(ATOMIC_ARM_LINUX_HELPERS, 1, [special arm 
linux implementation])
 need_libatomic_ops=no
@@ -580,22 +569,14 @@ PKG_PROG_PKG_CONFIG
  X11 (optional) 
 
 AC_ARG_ENABLE([x11],
-AS_HELP_STRING([--disable-x11],[Disable optional X11 support]),
-[
-case "${enableval}" in
-yes) x11=yes ;;
-no) x11=no ;;
-*) AC_MSG_ERROR(bad value ${enableval} for --disable-x11) ;;
-esac
-],
-[x11=auto])
+AS_HELP_STRING([--disable-x11],[Disable optional X11 support]))
 
-if test "x${x11}" != xno ; then
+if test "x$enable_x11" != "xno"; then
 PKG_CHECK_MODULES(X11, [ x11-xcb ice sm xtst xcb-atom ],
 HAVE_X11=1,
 [
 HAVE_X11=0
-if test "x$x11" = xyes ; then
+if test "x$enable_x11" = "xyes"; then
 AC_MSG_ERROR([*** X11 not found])
 fi
 ])
@@ -665,22 +646,14 @@ fi
  Libsamplerate support (optional) 
 
 AC_ARG_ENABLE([samplerate],
-AS_HELP_STRING([--disable-samplerate],[Disable optional libsamplerate 
support]),
-[
-case "${enableval}" in
-yes) samplerate=yes ;;
-no) samplerate=no ;;
-*) AC_MSG_ERROR(bad value ${enableval} for 
--disable-samplerate) ;;
-esac
-],
-[samplerate=auto])
+AS_HELP_STRING([--disable-samplerate],[Disable optional libsamplerate 
support]))
 
-if test "x${samplerate}" != xno ; then
+if test "x$enable_samplerate" != "xno"; then
 PKG_CHECK_MODULES(LIBSAMPLERATE, [ samplerate >= 0.1.0 ],
 HAVE_LIBSAMPLERATE=1,
 [
 HAVE_LIBSAMPLERATE=0
-if test "x$samplerate" = xyes ; then
+if test "x$enable_samplerate" = "xyes"; then
 AC_MSG_ERROR([*** Libsamplerate not found])
 fi
 ])
@@ -772,41 +745,25 @@ AM_CONDITIONAL([HAVE_SIMPLEDB], [test "x$HAVE_SIMPLEDB" = 
x1])
  OSS support (optional) 
 
 AC_ARG_ENABLE([oss-output],
-AS_HELP_STRING([--disable-oss-output],[Disable optional OSS output 
support]),
-[
-case "${enableval}" in
-yes) oss_output=yes ;;
-no) oss_output=no ;;
-*) AC_MSG_ERROR(bad value ${enableval} for 
--disable-oss-output) ;;
-esac
-],
-[oss_output=auto])
+AS_HELP_STRING([--disable-oss-output],[Disable optional OSS output 
support]))
 
 AC_ARG_ENABLE([oss-wrappe

[pulseaudio-discuss] [PATCH 4/7] build-system: Move dependency error messages to outer scope

2011-04-30 Thread Maarten Bosmans
---
 configure.ac |  107 +++--
 1 files changed, 43 insertions(+), 64 deletions(-)

diff --git a/configure.ac b/configure.ac
index 72cfbb7..18a136d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -576,13 +576,12 @@ if test "x$enable_x11" != "xno"; then
 HAVE_X11=1,
 [
 HAVE_X11=0
-if test "x$enable_x11" = "xyes"; then
-AC_MSG_ERROR([*** X11 not found])
-fi
 ])
 else
 HAVE_X11=0
 fi
+AS_IF([test "x$enable_x11" = "xyes" && test "x$HAVE_X11" = "x0"],
+[AC_MSG_ERROR([*** X11 not found])])
 
 AC_SUBST(X11_CFLAGS)
 AC_SUBST(X11_LIBS)
@@ -650,13 +649,12 @@ if test "x$enable_samplerate" != "xno"; then
 HAVE_LIBSAMPLERATE=1,
 [
 HAVE_LIBSAMPLERATE=0
-if test "x$enable_samplerate" = "xyes"; then
-AC_MSG_ERROR([*** Libsamplerate not found])
-fi
 ])
 else
 HAVE_LIBSAMPLERATE=0
 fi
+AS_IF([test "x$enable_samplerate" = "xyes" && test "x$HAVE_LIBSAMPLERATE" = 
"x0"],
+[AC_MSG_ERROR([*** Libsamplerate not found])])
 
 AC_SUBST(LIBSAMPLERATE_CFLAGS)
 AC_SUBST(LIBSAMPLERATE_LIBS)
@@ -679,12 +677,10 @@ if test "x${with_database}" = "xauto" -o 
"x${with_database}" = "xtdb" ; then
 [
 HAVE_TDB=1
 with_database=tdb
-], [
-if test "x${with_database}" = "xtdb" ; then
-AC_MSG_ERROR([*** tdb not found])
-fi
-])
+], [])
 fi
+AS_IF([test "x$with_database" = "xtdb" && test "x$HAVE_TDB" = "x0"],
+[AC_MSG_ERROR([*** tdb not found])])
 
 if test "x${with_database}" = "xauto" -o "x${with_database}" = "xgdbm" ; then
have_gdbm=yes
@@ -697,10 +693,10 @@ if test "x${with_database}" = "xauto" -o 
"x${with_database}" = "xgdbm" ; then
GDBM_CFLAGS=
GDBM_LIBS=-lgdbm
with_database=gdbm
-   elif test "x${with_database}" = "xgdbm"; then
-   AC_MSG_ERROR([*** gdbm not found])
fi
 fi
+AS_IF([test "x$with_database" = "xgdbm" && test "x$HAVE_GDBM" = "x0"],
+[AC_MSG_ERROR([*** gdbm not found])])
 
 if test "x${with_database}" = "xauto" -o "x${with_database}" = "xsimple" ; then
 HAVE_SIMPLEDB=1
@@ -750,15 +746,14 @@ if test "x$enable_oss_output" != "xno" || test 
"x$enable_oss_wrapper" != "xno";
 HAVE_OSS=0
 HAVE_OSS_OUTPUT=0
 HAVE_OSS_WRAPPER=0
-if test "x$enable_oss_output" = "xyes" || test 
"x$enable_oss_wrapper" = "xyes"; then
-AC_MSG_ERROR([*** OSS support not found])
-fi
 ])
 else
 HAVE_OSS=0
 HAVE_OSS_OUTPUT=0
 HAVE_OSS_WRAPPER=0
 fi
+AS_IF([test "x$enable_oss_output" = "xyes" -o "x$enable_oss_wrapper" = "xyes" 
&& test "x$HAVE_ALSA" = "x0"],
+[AC_MSG_ERROR([*** OSS support not found])])
 
 AC_SUBST(HAVE_OSS)
 AM_CONDITIONAL([HAVE_OSS_OUTPUT], [test "x$HAVE_OSS_OUTPUT" = "x1"])
@@ -792,13 +787,12 @@ if test "x$enable_alsa" != "xno"; then
 ],
 [
 HAVE_ALSA=0
-if test "x$enable_alsa" = "xyes"; then
-AC_MSG_ERROR([*** Needed alsa >= 1.0.19 support not found])
-fi
 ])
 else
 HAVE_ALSA=0
 fi
+AS_IF([test "x$enable_alsa" = "xyes" && test "x$HAVE_ALSA" = "x0"],
+[AC_MSG_ERROR([*** Needed alsa >= 1.0.19 support not found])])
 
 AC_SUBST(ASOUNDLIB_CFLAGS)
 AC_SUBST(ASOUNDLIB_LIBS)
@@ -818,13 +812,12 @@ if test "x$enable_solaris" != "xno"; then
 ],
 [
 HAVE_SOLARIS=0
-if test "x$enable_solaris" = "xyes"; then
-AC_MSG_ERROR([*** Solaris audio support not found])
-fi
 ])
 else
 HAVE_SOLARIS=0
 fi
+AS_IF([test "x$enable_solaris" = "xyes" && test "x$HAVE_SOLARIS" = "x0"],
+[AC_MSG_ERROR([*** Solaris audio support not found])])
 
 AC_SUBST(HAVE_SOLARIS)
 AM_CONDITIONAL([HAVE_SOLARIS], [test "x$HAVE_SOLARIS" = x1])
@@ -842,14 +835,13 @@ if test "x$enable_waveout" != "xno"; then
 ],
 [
 HAVE_WAVEOUT=0
-if test "x$enable_waveout" = "xyes"; then
-AC_MSG_ERROR([*** WaveOut audio support not found])
-fi
 ],
 [#include ])
 else
 HAVE_WAVEOUT=0
 fi
+AS_IF([test "x$enable_waveout" = "xyes" && test "x$HAVE_WAVEOUT" = "x0"],
+[AC_MSG_ERROR([*** WaveOut audio support not found])])
 
 AC_SUBST(HAVE_WAVEOUT)
 AM_CONDITIONAL([HAVE_WAVEOUT], [test "x$HAVE_WAVEOUT" = x1])
@@ -865,13 +857,12 @@ if test "x$enable_glib2" != "xno"; then
 HAVE_GLIB20=1,
 [
 HAVE_GLIB20=0
-if test "x$enable_glib2" = "xyes"; then
-AC_MSG_ERROR([*** GLib 2 support not found])
-fi
 ])
 else
 HAVE_GLIB20=0
 fi
+AS_IF([test "x$enable_glib2" = "xyes" && test "x$HAVE_GLIB20" = "x0"],
+[AC_MSG_ERROR([*** GLib 2 support not found])])
 
 AC_SUBST(GLIB20_CFLAGS)
 AC_SUBST(GLIB20_LIBS)
@@ -889,13 +880,12 @@ if test "x$enab

[pulseaudio-discuss] [PATCH 3/7] build-system: Move AC_DEFINE to separate line with AS_IF

2011-04-30 Thread Maarten Bosmans
---
 configure.ac |   59 -
 1 files changed, 17 insertions(+), 42 deletions(-)

diff --git a/configure.ac b/configure.ac
index 403b935..72cfbb7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -584,14 +584,11 @@ else
 HAVE_X11=0
 fi
 
-if test "x${HAVE_X11}" = x1 ; then
-   AC_DEFINE([HAVE_X11], 1, [Have X11?])
-fi
-
 AC_SUBST(X11_CFLAGS)
 AC_SUBST(X11_LIBS)
 AC_SUBST(HAVE_X11)
 AM_CONDITIONAL([HAVE_X11], [test "x$HAVE_X11" = x1])
+AS_IF([test "x$HAVE_X11" = "x1"], AC_DEFINE([HAVE_X11], 1, [Have X11?]))
 
  Capabilities (optional) 
 
@@ -661,14 +658,11 @@ else
 HAVE_LIBSAMPLERATE=0
 fi
 
-if test "x${HAVE_LIBSAMPLERATE}" = x1 ; then
-   AC_DEFINE([HAVE_LIBSAMPLERATE], 1, [Have libsamplerate?])
-fi
-
 AC_SUBST(LIBSAMPLERATE_CFLAGS)
 AC_SUBST(LIBSAMPLERATE_LIBS)
 AC_SUBST(HAVE_LIBSAMPLERATE)
 AM_CONDITIONAL([HAVE_LIBSAMPLERATE], [test "x$HAVE_LIBSAMPLERATE" = x1])
+AS_IF([test "x$HAVE_LIBSAMPLERATE" = "x1"], AC_DEFINE([HAVE_LIBSAMPLERATE], 1, 
[Have libsamplerate?]))
 
  Database support 
 
@@ -717,30 +711,21 @@ if test "x${HAVE_TDB}" != x1 -a "x${HAVE_GDBM}" != x1 -a 
"x${HAVE_SIMPLEDB}" !=
AC_MSG_ERROR([*** missing database backend])
 fi
 
-if test "x${HAVE_TDB}" = x1 ; then
-   AC_DEFINE([HAVE_TDB], 1, [Have tdb?])
-fi
-
-if test "x${HAVE_GDBM}" = x1 ; then
-   AC_DEFINE([HAVE_GDBM], 1, [Have gdbm?])
-fi
-
-if test "x${HAVE_SIMPLEDB}" = x1 ; then
-AC_DEFINE([HAVE_SIMPLEDB], 1, [Have simple?])
-fi
-
 AC_SUBST(TDB_CFLAGS)
 AC_SUBST(TDB_LIBS)
 AC_SUBST(HAVE_TDB)
 AM_CONDITIONAL([HAVE_TDB], [test "x$HAVE_TDB" = x1])
+AS_IF([test "x$HAVE_TDB" = "x1"], AC_DEFINE([HAVE_TDB], 1, [Have tdb?]))
 
 AC_SUBST(GDBM_CFLAGS)
 AC_SUBST(GDBM_LIBS)
 AC_SUBST(HAVE_GDBM)
 AM_CONDITIONAL([HAVE_GDBM], [test "x$HAVE_GDBM" = x1])
+AS_IF([test "x$HAVE_GDBM" = "x1"], AC_DEFINE([HAVE_GDBM], 1, [Have gdbm?]))
 
 AC_SUBST(HAVE_SIMPLEDB)
 AM_CONDITIONAL([HAVE_SIMPLEDB], [test "x$HAVE_SIMPLEDB" = x1])
+AS_IF([test "x$HAVE_SIMPLEDB" = "x1"], AC_DEFINE([HAVE_SIMPLEDB], 1, [Have 
simple?]))
 
  OSS support (optional) 
 
@@ -755,11 +740,9 @@ if test "x$enable_oss_output" != "xno" || test 
"x$enable_oss_wrapper" != "xno";
 [
 if test "x$enable_oss_output" != "xno"; then
 HAVE_OSS_OUTPUT=1
-AC_DEFINE([HAVE_OSS_OUTPUT], 1, [Have OSS output?])
 fi
 if test "x$enable_oss_wrapper" != "xno"; then
 HAVE_OSS_WRAPPER=1
-AC_DEFINE([HAVE_OSS_WRAPPER], 1, [Have OSS wrapper (padsp)?])
 fi
 HAVE_OSS=1
 ],
@@ -780,6 +763,8 @@ fi
 AC_SUBST(HAVE_OSS)
 AM_CONDITIONAL([HAVE_OSS_OUTPUT], [test "x$HAVE_OSS_OUTPUT" = "x1"])
 AM_CONDITIONAL([HAVE_OSS_WRAPPER], [test "x$HAVE_OSS_WRAPPER" = "x1"])
+AS_IF([test "x$HAVE_OSS_OUTPUT" = "x1"], AC_DEFINE([HAVE_OSS_OUTPUT], 1, [Have 
OSS output?]))
+AS_IF([test "x$HAVE_OSS_WRAPPER" = "x1"], AC_DEFINE([HAVE_OSS_WRAPPER], 1, 
[Have OSS wrapper (padsp)?]))
 
  CoreAudio support (optional) 
 
@@ -804,7 +789,6 @@ if test "x$enable_alsa" != "xno"; then
 PKG_CHECK_MODULES(ASOUNDLIB, [ alsa >= 1.0.19 ],
 [
 HAVE_ALSA=1
-AC_DEFINE([HAVE_ALSA], 1, [Have ALSA?])
 ],
 [
 HAVE_ALSA=0
@@ -820,6 +804,7 @@ AC_SUBST(ASOUNDLIB_CFLAGS)
 AC_SUBST(ASOUNDLIB_LIBS)
 AC_SUBST(HAVE_ALSA)
 AM_CONDITIONAL([HAVE_ALSA], [test "x$HAVE_ALSA" = x1])
+AS_IF([test "x$HAVE_ALSA" = "x1"], AC_DEFINE([HAVE_ALSA], 1, [Have ALSA?]))
 
  Solaris audio support (optional) 
 
@@ -830,7 +815,6 @@ if test "x$enable_solaris" != "xno"; then
 AC_CHECK_HEADERS([sys/audio.h],
 [
 HAVE_SOLARIS=1
-AC_DEFINE([HAVE_SOLARIS], 1, [Have Solaris audio?])
 ],
 [
 HAVE_SOLARIS=0
@@ -844,6 +828,7 @@ fi
 
 AC_SUBST(HAVE_SOLARIS)
 AM_CONDITIONAL([HAVE_SOLARIS], [test "x$HAVE_SOLARIS" = x1])
+AS_IF([test "x$HAVE_SOLARIS" = "x1"], AC_DEFINE([HAVE_SOLARIS], 1, [Have 
Solaris audio?]))
 
  WaveOut audio support (optional) 
 
@@ -854,7 +839,6 @@ if test "x$enable_waveout" != "xno"; then
 AC_CHECK_HEADERS([mmsystem.h],
 [
 HAVE_WAVEOUT=1
-AC_DEFINE([HAVE_WAVEOUT], 1, [Have WaveOut audio?])
 ],
 [
 HAVE_WAVEOUT=0
@@ -869,6 +853,7 @@ fi
 
 AC_SUBST(HAVE_WAVEOUT)
 AM_CONDITIONAL([HAVE_WAVEOUT], [test "x$HAVE_WAVEOUT" = x1])
+AS_IF([test "x$HAVE_WAVEOUT" = "x1"], AC_DEFINE([HAVE_WAVEOUT], 1, [Have 
WaveOut audio?]))
 
  GLib 2 support (optional) 
 
@@ -892,10 +877,7 @@ AC_SUBST(GLIB20_CFLAGS)
 AC_SUBST(GLIB20_LIBS)
 AC_SUBST(HAVE_GLIB20)
 AM_CONDITIONAL([HAVE_GLIB20], [test "x$HAVE_GLIB20" = x1])
-
-if test "x$HAVE_GLIB20" = x1 ; then
-   AC_DEFINE([HAVE_GLIB], 1, [Have GLIB?])
-fi
+AS_IF([test "x$HAVE_GLIB20" = "x1"], AC_DEFINE([HAVE_GLIB], 1, [Have GLIB?]))
 
  GTK2 support (optional) 
 
@@ -919,10 +901,7 @@ AC_SUBST(GTK20_CFLAGS)
 AC_

[pulseaudio-discuss] [PATCH 6/7] build-system: Rearrange database selection

2011-04-30 Thread Maarten Bosmans
---
 configure.ac |   64 +-
 1 files changed, 32 insertions(+), 32 deletions(-)

diff --git a/configure.ac b/configure.ac
index 9755800..79df100 100644
--- a/configure.ac
+++ b/configure.ac
@@ -654,48 +654,45 @@ AS_IF([test "x$HAVE_LIBSAMPLERATE" = "x1"], 
AC_DEFINE([HAVE_LIBSAMPLERATE], 1, [
 
  Database support 
 
-HAVE_TDB=0
-HAVE_GDBM=0
-HAVE_SIMPLEDB=0
+AC_ARG_WITH([database],
+AS_HELP_STRING([--with-database=auto|tdb|gdbm|simple],[Choose database 
backend.]),[],[with_database=auto])
+
+
+AS_IF([test "x$with_database" = "xauto" -o "x$with_database" = "xtdb"],
+[PKG_CHECK_MODULES(TDB, [ tdb ], HAVE_TDB=1, HAVE_TDB=0)],
+HAVE_TDB=0)
+AS_IF([test "x$HAVE_TDB" = "x1"], with_database=tdb)
 
-AC_ARG_WITH(
-[database],
-AS_HELP_STRING([--with-database=auto|tdb|gdbm|simple],[Choose database 
backend.]),[],[with_database=auto])
-
-if test "x${with_database}" = "xauto" -o "x${with_database}" = "xtdb" ; then
-PKG_CHECK_MODULES(TDB, [ tdb ],
-[
-HAVE_TDB=1
-with_database=tdb
-], [])
-fi
 AS_IF([test "x$with_database" = "xtdb" && test "x$HAVE_TDB" = "x0"],
 [AC_MSG_ERROR([*** tdb not found])])
 
-if test "x${with_database}" = "xauto" -o "x${with_database}" = "xgdbm" ; then
-   have_gdbm=yes
 
-   AC_CHECK_LIB(gdbm, gdbm_open, [], [have_gdbm=no])
-   AC_CHECK_HEADERS(gdbm.h, [], [have_gdbm=no])
+AS_IF([test "x$with_database" = "xauto" -o "x$with_database" = "xgdbm"],
+[
+HAVE_GDBM=1
+AC_CHECK_LIB(gdbm, gdbm_open, [], HAVE_GDBM=0)
+AC_CHECK_HEADERS(gdbm.h, [], HAVE_GDBM=0)
+],
+HAVE_GDBM=0)
+AS_IF([test "x$HAVE_GDBM" = "x1"],
+[
+with_database=gdbm
+GDBM_CFLAGS=
+GDBM_LIBS=-lgdbm
+])
 
-   if test "x${have_gdbm}" = "xyes" ; then
-   HAVE_GDBM=1
-   GDBM_CFLAGS=
-   GDBM_LIBS=-lgdbm
-   with_database=gdbm
-   fi
-fi
 AS_IF([test "x$with_database" = "xgdbm" && test "x$HAVE_GDBM" = "x0"],
 [AC_MSG_ERROR([*** gdbm not found])])
 
-if test "x${with_database}" = "xauto" -o "x${with_database}" = "xsimple" ; then
-HAVE_SIMPLEDB=1
-with_database=simple
-fi
 
-if test "x${HAVE_TDB}" != x1 -a "x${HAVE_GDBM}" != x1 -a "x${HAVE_SIMPLEDB}" 
!= x1; then
-   AC_MSG_ERROR([*** missing database backend])
-fi
+AS_IF([test "x$with_database" = "xauto" -o "x$with_database" = "xsimple"],
+HAVE_SIMPLEDB=1,
+HAVE_SIMPLEDB=0)
+AS_IF([test "x$HAVE_SIMPLEDB" = "x1"], with_database=simple)
+
+AS_IF([test "x$HAVE_TDB" != x1 -a "x$HAVE_GDBM" != x1 -a "x$HAVE_SIMPLEDB" != 
x1],
+AC_MSG_ERROR([*** missing database backend]))
+
 
 AC_SUBST(TDB_CFLAGS)
 AC_SUBST(TDB_LIBS)
@@ -751,6 +748,9 @@ AS_IF([test "x$enable_coreaudio_output" != "xno"],
 [AC_CHECK_HEADERS([CoreAudio/CoreAudio.h], HAVE_COREAUDIO=1, 
HAVE_COREAUDIO=0)],
 HAVE_COREAUDIO=0)
 
+AS_IF([test "x$enable_coreaudio_output" = "xyes" && test "x$HAVE_COREAUDIO" = 
"x0"],
+[AC_MSG_ERROR([*** CoreAudio output support not found])])
+
 AC_SUBST(HAVE_COREAUDIO)
 AM_CONDITIONAL([HAVE_COREAUDIO], [test "x$HAVE_COREAUDIO" = "x1" && test 
"x$enable_coreaudio_output" != "xno"])
 
-- 
1.7.1

___
pulseaudio-discuss mailing list
pulseaudio-discuss@mail.0pointer.de
https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss


[pulseaudio-discuss] [PATCH 5/7] build-system: Replace some more conditionals with AS_IF

2011-04-30 Thread Maarten Bosmans
---
 configure.ac |  311 +++---
 1 files changed, 103 insertions(+), 208 deletions(-)

diff --git a/configure.ac b/configure.ac
index 18a136d..9755800 100644
--- a/configure.ac
+++ b/configure.ac
@@ -571,15 +571,10 @@ PKG_PROG_PKG_CONFIG
 AC_ARG_ENABLE([x11],
 AS_HELP_STRING([--disable-x11],[Disable optional X11 support]))
 
-if test "x$enable_x11" != "xno"; then
-PKG_CHECK_MODULES(X11, [ x11-xcb ice sm xtst xcb-atom ],
-HAVE_X11=1,
-[
-HAVE_X11=0
-])
-else
-HAVE_X11=0
-fi
+AS_IF([test "x$enable_x11" != "xno"],
+[PKG_CHECK_MODULES(X11, [ x11-xcb ice sm xtst xcb-atom ], HAVE_X11=1, 
HAVE_X11=0)],
+HAVE_X11=0)
+
 AS_IF([test "x$enable_x11" = "xyes" && test "x$HAVE_X11" = "x0"],
 [AC_MSG_ERROR([*** X11 not found])])
 
@@ -644,15 +639,10 @@ fi
 AC_ARG_ENABLE([samplerate],
 AS_HELP_STRING([--disable-samplerate],[Disable optional libsamplerate 
support]))
 
-if test "x$enable_samplerate" != "xno"; then
-PKG_CHECK_MODULES(LIBSAMPLERATE, [ samplerate >= 0.1.0 ],
-HAVE_LIBSAMPLERATE=1,
-[
-HAVE_LIBSAMPLERATE=0
-])
-else
-HAVE_LIBSAMPLERATE=0
-fi
+AS_IF([test "x$enable_samplerate" != "xno"],
+[PKG_CHECK_MODULES(LIBSAMPLERATE, [ samplerate >= 0.1.0 ], 
HAVE_LIBSAMPLERATE=1, HAVE_LIBSAMPLERATE=0)],
+HAVE_LIBSAMPLERATE=0)
+
 AS_IF([test "x$enable_samplerate" = "xyes" && test "x$HAVE_LIBSAMPLERATE" = 
"x0"],
 [AC_MSG_ERROR([*** Libsamplerate not found])])
 
@@ -731,30 +721,21 @@ AC_ARG_ENABLE([oss-output],
 AC_ARG_ENABLE([oss-wrapper],
 AS_HELP_STRING([--disable-oss-wrapper],[Disable optional OSS wrapper 
support]))
 
-if test "x$enable_oss_output" != "xno" || test "x$enable_oss_wrapper" != 
"xno"; then
-AC_CHECK_HEADERS([sys/soundcard.h],
-[
-if test "x$enable_oss_output" != "xno"; then
-HAVE_OSS_OUTPUT=1
-fi
-if test "x$enable_oss_wrapper" != "xno"; then
-HAVE_OSS_WRAPPER=1
-fi
-HAVE_OSS=1
-],
-[
-HAVE_OSS=0
-HAVE_OSS_OUTPUT=0
-HAVE_OSS_WRAPPER=0
-])
-else
-HAVE_OSS=0
-HAVE_OSS_OUTPUT=0
-HAVE_OSS_WRAPPER=0
-fi
-AS_IF([test "x$enable_oss_output" = "xyes" -o "x$enable_oss_wrapper" = "xyes" 
&& test "x$HAVE_ALSA" = "x0"],
+AS_IF([test "x$enable_oss_output" != "xno" -o "x$enable_oss_wrapper" != "xno"],
+[AC_CHECK_HEADERS([sys/soundcard.h], HAVE_OSS=1, HAVE_OSS=0)],
+HAVE_OSS=0)
+
+AS_IF([test "x$enable_oss_output" = "xyes" -o "x$enable_oss_wrapper" = "xyes" 
&& test "x$HAVE_OSS" = "x0"],
 [AC_MSG_ERROR([*** OSS support not found])])
 
+AS_IF([test "x$enable_oss_output" != "xno"],
+[AS_IF([test "x$HAVE_OSS" = "x1"], HAVE_OSS_OUTPUT=1, HAVE_OSS_OUTPUT=0)],
+HAVE_OSS_OUTPUT=0)
+
+AS_IF([test "x$enable_oss_wrapper" != "xno"],
+[AS_IF([test "x$HAVE_OSS" = "x1"], HAVE_OSS_WRAPPER=1, 
HAVE_OSS_WRAPPER=0)],
+HAVE_OSS_WRAPPER=0)
+
 AC_SUBST(HAVE_OSS)
 AM_CONDITIONAL([HAVE_OSS_OUTPUT], [test "x$HAVE_OSS_OUTPUT" = "x1"])
 AM_CONDITIONAL([HAVE_OSS_WRAPPER], [test "x$HAVE_OSS_WRAPPER" = "x1"])
@@ -766,11 +747,9 @@ AS_IF([test "x$HAVE_OSS_WRAPPER" = "x1"], 
AC_DEFINE([HAVE_OSS_WRAPPER], 1, [Have
 AC_ARG_ENABLE([coreaudio-output],
 AS_HELP_STRING([--disable-coreaudio-output],[Disable optional CoreAudio 
output support]))
 
-if test "x$enable_coreaudio_output" != "xno"; then
-AC_CHECK_HEADERS([CoreAudio/CoreAudio.h], HAVE_COREAUDIO=1)
-else
-HAVE_COREAUDIO=0
-fi
+AS_IF([test "x$enable_coreaudio_output" != "xno"],
+[AC_CHECK_HEADERS([CoreAudio/CoreAudio.h], HAVE_COREAUDIO=1, 
HAVE_COREAUDIO=0)],
+HAVE_COREAUDIO=0)
 
 AC_SUBST(HAVE_COREAUDIO)
 AM_CONDITIONAL([HAVE_COREAUDIO], [test "x$HAVE_COREAUDIO" = "x1" && test 
"x$enable_coreaudio_output" != "xno"])
@@ -780,17 +759,10 @@ AM_CONDITIONAL([HAVE_COREAUDIO], [test "x$HAVE_COREAUDIO" 
= "x1" && test "x$enab
 AC_ARG_ENABLE([alsa],
 AS_HELP_STRING([--disable-alsa],[Disable optional ALSA support]))
 
-if test "x$enable_alsa" != "xno"; then
-PKG_CHECK_MODULES(ASOUNDLIB, [ alsa >= 1.0.19 ],
-[
-HAVE_ALSA=1
-],
-[
-HAVE_ALSA=0
-])
-else
-HAVE_ALSA=0
-fi
+AS_IF([test "x$enable_alsa" != "xno"],
+[PKG_CHECK_MODULES(ASOUNDLIB, [ alsa >= 1.0.19 ], HAVE_ALSA=1, 
HAVE_ALSA=0)],
+HAVE_ALSA=0)
+
 AS_IF([test "x$enable_alsa" = "xyes" && test "x$HAVE_ALSA" = "x0"],
 [AC_MSG_ERROR([*** Needed alsa >= 1.0.19 support not found])])
 
@@ -805,17 +777,10 @@ AS_IF([test "x$HAVE_ALSA" = "x1"], AC_DEFINE([HAVE_ALSA], 
1, [Have ALSA?]))
 AC_ARG_ENABLE([solaris],
 AS_HELP_STRING([--disable-solaris],[Disable optional Solaris audio 
support]))
 
-if test "x$enable_solaris" != "xno"; then
-AC_CHECK_HEADERS([sys/audio.h],
-[
-HAVE_SOLARIS=1
-],
-[
-HAVE_SOLARIS=0
-])
-else
-HAVE_SOLAR

[pulseaudio-discuss] [PATCH 7/7] build-system: Small fixes

2011-04-30 Thread Maarten Bosmans
---
 configure.ac |   24 ++--
 1 files changed, 10 insertions(+), 14 deletions(-)

diff --git a/configure.ac b/configure.ac
index 79df100..16fb03d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -382,7 +382,6 @@ AM_CONDITIONAL(HAVE_AF_UNIX, test "x$HAVE_AF_UNIX" = "x1")
 
 # Linux
 AC_CHECK_HEADERS([linux/input.h], [HAVE_EVDEV=1], [HAVE_EVDEV=0])
-
 AM_CONDITIONAL([HAVE_EVDEV], [test "x$HAVE_EVDEV" = "x1"])
 
 AC_CHECK_HEADERS_ONCE([sys/prctl.h])
@@ -452,12 +451,6 @@ AC_SEARCH_LIBS([pthread_setname_np], [pthread])
 AC_SEARCH_LIBS([connect], [socket])
 AC_SEARCH_LIBS([backtrace], [execinfo])
 
-# Non-standard
-
-# This magic is needed so we do not needlessly add static libs to the win32
-# build, disabling its ability to make dlls.
-AC_CHECK_FUNCS([getopt_long], [], [AC_CHECK_LIB([iberty], [getopt_long])])
-
 # Darwin/OS X
 if test "x$os_is_darwin" = "x1" ; then
 AC_MSG_CHECKING([looking for Apple CoreService Framework])
@@ -474,7 +467,10 @@ fi
 AC_SUBST(HAVE_BONJOUR)
 AM_CONDITIONAL([HAVE_BONJOUR], [test "x$HAVE_BONJOUR" = x1])
 
+# Windows
 AC_SEARCH_LIBS([regexec], [pcreposix])
+# This magic is needed so we do not needlessly add static libs to the win32  
build, disabling its ability to make dlls.
+AC_CHECK_FUNCS([getopt_long], [], [AC_CHECK_LIB([iberty], [getopt_long])])
 
  Check for functions 
 
@@ -1022,7 +1018,7 @@ AC_SUBST(HAVE_DBUS)
 AM_CONDITIONAL([HAVE_DBUS], [test "x$HAVE_DBUS" = x1])
 AS_IF([test "x$HAVE_DBUS" = "x1"], AC_DEFINE([HAVE_DBUS], 1, [Have D-Bus.]))
 
-# udev and HAL depend on D-Bus: So double check if they were explicitly 
enabled.
+# HAL and BlueZ depend on D-Bus: So double check if they were explicitly 
enabled.
 if test "x$HAVE_DBUS" != "x1" ; then
 HAVE_HAL=0
 if test "x$enable_hal" = "xyes"; then
@@ -1035,7 +1031,6 @@ if test "x$HAVE_DBUS" != "x1" ; then
 fi
 fi
 
-
  HAL compat support (optional) 
 
 AC_ARG_ENABLE([hal-compat],
@@ -1268,11 +1263,11 @@ echo "
 CFLAGS:${CFLAGS}
 LIBS:  ${LIBS}
 
-Have X11:  ${ENABLE_X11}
+Enable X11:${ENABLE_X11}
 Enable OSS Output: ${ENABLE_OSS_OUTPUT}
 Enable OSS Wrapper:${ENABLE_OSS_WRAPPER}
-Enable CoreAudio:  ${ENABLE_COREAUDIO}
 Enable Alsa:   ${ENABLE_ALSA}
+Enable CoreAudio:  ${ENABLE_COREAUDIO}
 Enable Solaris:${ENABLE_SOLARIS}
 Enable WaveOut:${ENABLE_WAVEOUT}
 Enable GLib 2.0:   ${ENABLE_GLIB20}
@@ -1291,11 +1286,12 @@ echo "
 Enable libsamplerate:  ${ENABLE_LIBSAMPLERATE}
 Enable IPv6:   ${ENABLE_IPV6}
 Enable OpenSSL (for Airtunes): ${ENABLE_OPENSSL}
-Enable tdb:${ENABLE_TDB}
-Enable gdbm:   ${ENABLE_GDBM}
-Enable simple database:${ENABLE_SIMPLEDB}
 Enable fftw:   ${ENABLE_FFTW}
 Enable orc:${ENABLE_ORC}
+Database
+  tdb: ${ENABLE_TDB}
+  gdbm:${ENABLE_GDBM}
+  simple database: ${ENABLE_SIMPLEDB}
 
 System User:   ${PA_SYSTEM_USER}
 System Group:  ${PA_SYSTEM_GROUP}
-- 
1.7.1

___
pulseaudio-discuss mailing list
pulseaudio-discuss@mail.0pointer.de
https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] Cleanup of configure.ac

2011-04-30 Thread Colin Guthrie
'Twas brillig, and Maarten Bosmans at 30/04/11 14:25 did gyre and gimble:
> This patch series cleans up the --enable- handling part of 
> configure.ac.
> It changes the testing of features so that they are all done in the same way.
> 
> The linecount of configure.ac is reduced from around 1800 with 450 lines. 
> This is partly because os using macro's,
> partly due to simplification of if/else logic and also a bit due to rewriting 
> stuff to one line.  I think the
> readability of configure.ac is greatly improved.

Nice :)

> The only feature that is lost is the error message when --enable-foo=arg is 
> used with arg something other than yes or
> no. Instead now silently the default is used. This is no big loss IMHO, 
> because usually just --enable-foo or
> --disable-foo is given to configure.

I didn't even now you could call it with --enable-foo=no so I totally
agree that it's much more common to use --enable-foo or --disable-foo.
Not a great loss IMO.


> [PATCH 1/7] build-system: Simplify AC_ARG_ENABLE usage

I had to modify slightly due to XCB patch in my tree... nothing major
tho' (just the pkg-config stuff relating to xcb deps).

> [PATCH 2/7] build-system: Use AS_IF macro for configure output
> [PATCH 3/7] build-system: Move AC_DEFINE to separate line with AS_IF
> [PATCH 4/7] build-system: Move dependency error messages to outer scope
> [PATCH 5/7] build-system: Replace some more conditionals with AS_IF

As per patch 1 above.

> [PATCH 6/7] build-system: Rearrange database selection
> [PATCH 7/7] build-system: Small fixes

Pushed now :)

Thanks!

Col

-- 

Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/

Day Job:
  Tribalogic Limited [http://www.tribalogic.net/]
Open Source:
  Mageia Contributor [http://www.mageia.org/]
  PulseAudio Hacker [http://www.pulseaudio.org/]
  Trac Hacker [http://trac.edgewall.org/]

___
pulseaudio-discuss mailing list
pulseaudio-discuss@mail.0pointer.de
https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] [PATCH 1/3] bluetooth: fix not updating sample spec when using Media API

2011-04-30 Thread Colin Guthrie
'Twas brillig, and Luiz Augusto von Dentz at 29/04/11 15:48 did gyre and
gimble:
> From: Luiz Augusto von Dentz 
> 
> When using transport configured via Media API sample spec needs to be
> updated since codec configuration may affect it when e.g. headset
> configure a different frequency or number of channels from default.


Thanks. All three patches now pushed.

Col


-- 

Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/

Day Job:
  Tribalogic Limited [http://www.tribalogic.net/]
Open Source:
  Mageia Contributor [http://www.mageia.org/]
  PulseAudio Hacker [http://www.pulseaudio.org/]
  Trac Hacker [http://trac.edgewall.org/]

___
pulseaudio-discuss mailing list
pulseaudio-discuss@mail.0pointer.de
https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss


[pulseaudio-discuss] ANN: Rename of module-combine

2011-04-30 Thread Colin Guthrie
Hi,

I've renamed module-combine to module-combine-sink as that's what it is.

I've kept a wrapper called module-combine so exiting setups will still
work fine (in theory) even using the old name. I've tested and paprefs
still works OK without modification.

I will probably patch paprefs at some point, but by the same token I
want it to die at some point anyway, so maybe won't bother.


Col
-- 

Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/

Day Job:
  Tribalogic Limited [http://www.tribalogic.net/]
Open Source:
  Mageia Contributor [http://www.mageia.org/]
  PulseAudio Hacker [http://www.pulseaudio.org/]
  Trac Hacker [http://trac.edgewall.org/]

___
pulseaudio-discuss mailing list
pulseaudio-discuss@mail.0pointer.de
https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss


[pulseaudio-discuss] [PATCH] Make connect-stress test compile for win32

2011-04-30 Thread Maarten Bosmans
---
 src/tests/connect-stress.c |6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/tests/connect-stress.c b/src/tests/connect-stress.c
index 5476675..eadcf88 100644
--- a/src/tests/connect-stress.c
+++ b/src/tests/connect-stress.c
@@ -118,7 +118,7 @@ static void stream_write_callback(pa_stream *stream, size_t 
nbytes, void *userda
 memset(silence, 0, sizeof(silence));
 
 while (nbytes) {
-int n = MIN(sizeof(silence), nbytes);
+int n = PA_MIN(sizeof(silence), nbytes);
 pa_stream_write(stream, silence, n, NULL, 0, 0);
 nbytes -= n;
 }
@@ -195,9 +195,9 @@ int main(int argc, char *argv[]) {
 
 for (i = 0; i < NTESTS; i++) {
 connect(argv[0], &i);
-usleep(random() % 50);
+usleep(rand() % 50);
 disconnect();
-usleep(random() % 50);
+usleep(rand() % 50);
 }
 
 fprintf(stderr, "Done.\n");
-- 
1.7.1

___
pulseaudio-discuss mailing list
pulseaudio-discuss@mail.0pointer.de
https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] [PATCH] Make connect-stress test compile for win32

2011-04-30 Thread Colin Guthrie
Thanks!

Col

-- 

Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/

Day Job:
  Tribalogic Limited [http://www.tribalogic.net/]
Open Source:
  Mageia Contributor [http://www.mageia.org/]
  PulseAudio Hacker [http://www.pulseaudio.org/]
  Trac Hacker [http://trac.edgewall.org/]

___
pulseaudio-discuss mailing list
pulseaudio-discuss@mail.0pointer.de
https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss


[pulseaudio-discuss] rewind and underrun issues on start of playback

2011-04-30 Thread Baek Chang
Hi,

I'm seeing some issue with underruns/rewinds occurring on the beginning of
every sink input playback.
I see rewind requests on alsa sink of 9600 bytes.  The alsa driver is
configured with the following buffer sizes

I: sink.c: device.buffering.buffer_size = "9600"
I: sink.c: device.buffering.fragment_size = "4800"

So it seems like one buffer size is always being rewinded on the beginning
of playback.
Is there a way to prevent these rewinds/underruns when starting playback?
 after the stream has started, there is no issue with audio dropouts or
underruns, just on the beginning.

If i log the data that gets sent to alsa, from pulseaudio or in the alsa
driver, i do see the beginning being dropped as well.

please see attached logs using both tshed=0 and tsched=1.

any help with this?
thanks!

I: client.c: Created 0 "Native client (UNIX socket client)"
D: protocol-native.c: Protocol version: remote 19, local 19
I: protocol-native.c: Got credentials: uid=0 gid=0 success=1
D: protocol-native.c: SHM possible: yes
D: protocol-native.c: Negotiated SHM: no
D: memblockq.c: memblockq requested: maxlength=33554432, tlength=0, base=4,
prebuf=0, minreq=1 maxrewind=0
D: memblockq.c: memblockq sanitized: maxlength=33554432, tlength=33554432,
base=4, prebuf=0, minreq=4 maxrewind=0
I: sink-input.c: Created input 0 "/usr/palm/sounds/notification.wav" on
pcm_output with sample spec s16le 2ch 44100Hz and channel map
front-left,front-right
I: sink-input.c: media.format = "WAV (Microsoft)"
I: sink-input.c: media.name = "/usr/palm/sounds/notification.wav"
I: sink-input.c: application.name = "pacat"
I: sink-input.c: native-protocol.peer = "UNIX socket client"
I: sink-input.c: native-protocol.version = "19"
I: sink-input.c: application.process.id = "4474"
I: sink-input.c: application.process.user = "root"
I: sink-input.c: application.process.host = "PalmDevice"
I: sink-input.c: application.process.binary = "pacat"
I: sink-input.c: application.language = "C"
I: sink-input.c: application.process.machine_id = "PalmDevice"
I: protocol-native.c: Requested tlength=2000.00 ms, minreq=20.00 ms
D: protocol-native.c: Traditional mode enabled, modifying sink usec only for
compat with minreq.
D: memblockq.c: memblockq requested: maxlength=4194304, tlength=352800,
base=4, prebuf=349276, minreq=3528 maxrewind=0
D: memblockq.c: memblockq sanitized: maxlength=4194304, tlength=352800,
base=4, prebuf=349276, minreq=3528 maxrewind=0
I: protocol-native.c: Final latency 2054.42 ms = 1960.00 ms + 2*20.00 ms +
54.42 ms
D: protocol-native.c: Requesting rewind due to end of underrun.
D: alsa-sink.c: Requested to rewind 9600 bytes.
D: alsa-sink.c: Limited to 9344 bytes.
D: alsa-sink.c: before: 2336
D: alsa-sink.c: after: 2336
D: alsa-sink.c: Rewound 9344 bytes.
D: sink.c: Processing rewind...
D: sink-input.c: Have to rewind 9344 bytes on render memblockq.
D: source.c: Processing rewind...
D: protocol-native.c: Underrun on '/usr/palm/sounds/notification.wav', 0
bytes in queue.
D: alsa-sink.c: Requested to rewind 9600 bytes.
D: alsa-sink.c: Limited to 9344 bytes.
D: alsa-sink.c: before: 2336
D: alsa-sink.c: after: 2336
D: alsa-sink.c: Rewound 9344 bytes.
D: sink.c: Processing rewind...
D: source.c: Processing rewind...
D: core.c: Hmm, no streams around, trying to vacuum.
I: sink-input.c: Freeing input 0 "/usr/palm/sounds/notification.wav"
I: client.c: Freed 0 "pacat"
I: protocol-native.c: Connection died.

-- 
-baeksanchang
root@PalmDevice:/media/internal# pulseaudio -
D: core-rtclock.c: Timer slack is set to 50 us.
D: core-util.c: setpriority() worked.
I: core-util.c: Successfully gained nice level -4.
I: main.c: Found user 'pulse' (UID 31) and group 'pulse' (GID 31).
I: main.c: Successfully dropped root privileges.
I: main.c: This is PulseAudio 0.9.22
D: main.c: Compilation host: arm-none-linux-gnueabi
D: main.c: Compilation CFLAGS: -isystem 
/home/reviewdaemon/projects/nova/oe/BUILD-topaz/staging/arm-none-linux-gnueabi/include
 -fexpensive-optimizations -fomit-frame-pointer -frename-registers -O2 
-fno-strict-aliasing -fno-inline-functions -O3 -g -Wimplicit -O3 -Wall -W 
-Wextra -pipe -Wno-long-long -Winline -Wvla -Wno-overlength-strings 
-Wunsafe-loop-optimizations -Wundef -Wformat=2 -Wlogical-op -Wsign-compare 
-Wformat-security -Wmissing-include-dirs -Wformat-nonliteral 
-Wold-style-definition -Wpointer-arith -Winit-self 
-Wdeclaration-after-statement -Wfloat-equal -Wmissing-prototypes 
-Wstrict-prototypes -Wredundant-decls -Wmissing-declarations -Wmissing-noreturn 
-Wshadow -Wendif-labels -Wcast-align -Wstrict-aliasing=2 -Wwrite-strings 
-Wno-unused-parameter -ffast-math -Wp,-D_FORTIFY_SOURCE=2 -fno-common 
-fdiagnostics-show-option
D: main.c: Running on host: Linux armv7l 2.6.35-palm-tenderloin #98 SMP PREEMPT 
Sat Apr 30 12:46:55 PDT 2011
D: main.c: Found 2 CPUs.
I: main.c: Page size is 4096 bytes
D: main.c: Compiled with Valgrind support: yes
D: main.c: Running in valgrind mode: no
D: main

[pulseaudio-discuss] unsubscribe me please.

2011-04-30 Thread Doug


--
Blessed are the peacekeepers...for they shall be shot at from both sides. --A. 
M. Greeley

___
pulseaudio-discuss mailing list
pulseaudio-discuss@mail.0pointer.de
https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss