qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [patch] add configure check for working alsa
@ 2007-01-04 15:02 Bernhard Fischer
  2007-01-04 19:21 ` Paul Brook
  0 siblings, 1 reply; 3+ messages in thread
From: Bernhard Fischer @ 2007-01-04 15:02 UTC (permalink / raw)
  To: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 364 bytes --]

Hi,

This patchlet adds a check to configure that makes sure that we have a
working alsa setup.

Previously, if --enable-alsa was given but the user forgot to install
the alsa libs proper, the build failed later on due to eventually
missing libs. The patch makes sure that the user can spot that alsa
support was turned off after configuration completed.

thanks,

[-- Attachment #2: qemu.cvs-20070104.add-alsa-config-check.diff --]
[-- Type: text/x-diff, Size: 725 bytes --]

diff --exclude='*.diff' -rduNp ../qemu_trunk.orig/configure ./configure
--- ../qemu_trunk.orig/configure	2007-01-04 14:38:58.000000000 +0100
+++ ./configure	2007-01-04 14:48:14.000000000 +0100
@@ -509,6 +509,17 @@ fi # sdl compile test
 fi # cross compilation
 fi # -z $sdl
 
+##########################################
+# sound support libraries
+# alsa
+if test "$alsa" = "yes" ; then
+  cat > $TMPC << EOF
+#include <alsa/asoundlib.h>
+int main(void) { snd_pcm_t **handle; return snd_pcm_close(*handle); }
+EOF
+  $cc -o $TMPE $TMPC -lasound 2> /dev/null || alsa="no"
+fi # alsa
+
 # Check if tools are available to build documentation.
 if [ -x "`which texi2html`" ] && [ -x "`which pod2man`" ]; then
   build_docs="yes"

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [patch] add configure check for working alsa
  2007-01-04 15:02 [Qemu-devel] [patch] add configure check for working alsa Bernhard Fischer
@ 2007-01-04 19:21 ` Paul Brook
  2007-01-04 19:47   ` Bernhard Fischer
  0 siblings, 1 reply; 3+ messages in thread
From: Paul Brook @ 2007-01-04 19:21 UTC (permalink / raw)
  To: qemu-devel

On Thursday 04 January 2007 15:02, Bernhard Fischer wrote:
> Hi,
>
> This patchlet adds a check to configure that makes sure that we have a
> working alsa setup.
>
> Previously, if --enable-alsa was given but the user forgot to install
> the alsa libs proper, the build failed later on due to eventually
> missing libs. The patch makes sure that the user can spot that alsa
> support was turned off after configuration completed.

This is wrong. If the user requests alsa we should honour that request, or 
fail trying. We should never quietly ignore an explicit user decision.

Making configure fail early with an error is acceptable (as it the current 
link failure). Ignoring --enable-alsa is not.

Paul

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [patch] add configure check for working alsa
  2007-01-04 19:21 ` Paul Brook
@ 2007-01-04 19:47   ` Bernhard Fischer
  0 siblings, 0 replies; 3+ messages in thread
From: Bernhard Fischer @ 2007-01-04 19:47 UTC (permalink / raw)
  To: Paul Brook; +Cc: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 852 bytes --]

On Thu, Jan 04, 2007 at 07:21:40PM +0000, Paul Brook wrote:
>On Thursday 04 January 2007 15:02, Bernhard Fischer wrote:
>> Hi,
>>
>> This patchlet adds a check to configure that makes sure that we have a
>> working alsa setup.
>>
>> Previously, if --enable-alsa was given but the user forgot to install
>> the alsa libs proper, the build failed later on due to eventually
>> missing libs. The patch makes sure that the user can spot that alsa
>> support was turned off after configuration completed.
>
>This is wrong. If the user requests alsa we should honour that request, or 
>fail trying. We should never quietly ignore an explicit user decision.
>
>Making configure fail early with an error is acceptable (as it the current 
>link failure). Ignoring --enable-alsa is not.

Fair enough. Updated variant prints an error if the compile-check
failed.

[-- Attachment #2: qemu.cvs-20070104.add-alsa-config-check.02.diff --]
[-- Type: text/x-diff, Size: 807 bytes --]

--- ../qemu_trunk.orig/configure	2007-01-04 14:38:58.000000000 +0100
+++ configure	2007-01-04 20:46:22.000000000 +0100
@@ -509,6 +536,25 @@ fi # sdl compile test
 fi # cross compilation
 fi # -z $sdl
 
+##########################################
+# sound support libraries
+# alsa
+if test "$alsa" = "yes" ; then
+  cat > $TMPC << EOF
+#include <alsa/asoundlib.h>
+int main(void) { snd_pcm_t **handle; return snd_pcm_close(*handle); }
+EOF
+  if $cc -o $TMPE $TMPC -lasound 2> /dev/null ; then
+    :
+  else
+    echo
+    echo "Error: Could not find alsa"
+    echo "Make sure to have the alsa libs and headers installed."
+    echo
+    exit 1
+  fi
+fi # alsa
+
 # Check if tools are available to build documentation.
 if [ -x "`which texi2html`" ] && [ -x "`which pod2man`" ]; then
   build_docs="yes"

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-01-04 19:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-01-04 15:02 [Qemu-devel] [patch] add configure check for working alsa Bernhard Fischer
2007-01-04 19:21 ` Paul Brook
2007-01-04 19:47   ` Bernhard Fischer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).