From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1H2YXI-0007Kx-5i for qemu-devel@nongnu.org; Thu, 04 Jan 2007 14:46:00 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1H2YXH-0007KM-2v for qemu-devel@nongnu.org; Thu, 04 Jan 2007 14:45:59 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1H2YXG-0007KF-Qz for qemu-devel@nongnu.org; Thu, 04 Jan 2007 14:45:58 -0500 Received: from [195.3.96.113] (helo=email.aon.at) by monty-python.gnu.org with esmtp (Exim 4.52) id 1H2YXG-00008N-5d for qemu-devel@nongnu.org; Thu, 04 Jan 2007 14:45:58 -0500 Date: Thu, 4 Jan 2007 20:47:46 +0100 From: Bernhard Fischer Subject: Re: [Qemu-devel] [patch] add configure check for working alsa Message-ID: <20070104194746.GK28746@aon.at> References: <20070104150259.GE28746@aon.at> <200701041921.41677.paul@codesourcery.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="kA1LkgxZ0NN7Mz3A" Content-Disposition: inline In-Reply-To: <200701041921.41677.paul@codesourcery.com> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paul Brook Cc: qemu-devel@nongnu.org --kA1LkgxZ0NN7Mz3A Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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. --kA1LkgxZ0NN7Mz3A Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="qemu.cvs-20070104.add-alsa-config-check.02.diff" --- ../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 +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" --kA1LkgxZ0NN7Mz3A--