ref: 092f717a789af0fba9de6934254d88913c653c81
parent: 23b230681534f389067929f1bcf6cddb89ddaf72
author: Tanu Kaskinen <tanuk@iki.fi>
date: Fri Sep 23 08:09:32 EDT 2016
configure.ac: improve alsa handling Three improvements: 1) "--enable-alsa" or "--disable-alsa" caused a warning about an unsupported configure option, because AC_ARG_ENABLE was not used. 2) If alsa was disabled, the "Have ALSA" item in the summary would print an empty string instead of "no". 3) If "--enable-alsa" was passed to configure, but the headers were not found, configure would still succeed (with alsa disabled). It's better to fail and abort configure if a feature that was explicitly requested can't be enabled. Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
--- a/configure.ac
+++ b/configure.ac
@@ -102,6 +102,9 @@
AC_HELP_STRING([--disable-cpu-clip], [disable tricky cpu specific clipper]),
ac_arg_cpu_clip="N", ac_arg_cpu_clip="Y")
+AC_ARG_ENABLE(alsa,
+ AC_HELP_STRING([--disable-alsa], [disable ALSA support in the varispeed-play example program]))
+
#====================================================================================
# Check types and their sizes.
@@ -195,6 +198,10 @@
if test x$ac_cv_header_alsa_asoundlib_h = xyes ; then
ALSA_LIBS="-lasound"
enable_alsa=yes
+ elif test x$enable_alsa = xyes ; then
+ AC_MSG_ERROR(["ALSA headers not found"])
+ else
+ enable_alsa=no
fi
fi
@@ -341,7 +348,7 @@
Have FFTW : ................... ${ac_cv_fftw3}])
AC_MSG_RESULT([ Have libsndfile : ............. ${ac_cv_sndfile}])
-AC_MSG_RESULT([ Have ALSA : ................... ${ac_cv_header_alsa_asoundlib_h}
+AC_MSG_RESULT([ Have ALSA : ................... ${enable_alsa}
])
AC_MSG_RESULT([ Installation directories :