Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 1 | From 957ebce3837588f71016e37ffaf9aad0a9d41cec Mon Sep 17 00:00:00 2001 |
| 2 | From: Tanu Kaskinen <tanuk@iki.fi> |
| 3 | Date: Fri, 23 Sep 2016 12:02:06 +0300 |
| 4 | Subject: [PATCH] configure.ac: improve alsa handling |
| 5 | |
| 6 | Three improvements: |
| 7 | |
| 8 | 1) "--enable-alsa" or "--disable-alsa" caused a warning about an |
| 9 | unsupported configure option, because AC_ARG_ENABLE was not used. |
| 10 | |
| 11 | 2) If alsa was disabled, the "Have ALSA" item in the summary would print |
| 12 | an empty string instead of "no". |
| 13 | |
| 14 | 3) If "--enable-alsa" was passed to configure, but the headers were not |
| 15 | found, configure would still succeed (with alsa disabled). It's better |
| 16 | to fail and abort configure if a feature that was explicitly requested |
| 17 | can't be enabled. |
| 18 | |
| 19 | Upstream-Status: Submitted [sent to src@mega-nerd.com] |
| 20 | |
| 21 | Signed-off-by: Tanu Kaskinen <tanuk@iki.fi> |
| 22 | --- |
| 23 | configure.ac | 9 ++++++++- |
| 24 | 1 file changed, 8 insertions(+), 1 deletion(-) |
| 25 | |
| 26 | diff --git a/configure.ac b/configure.ac |
| 27 | index 474c6ab..bad597e 100644 |
| 28 | --- a/configure.ac |
| 29 | +++ b/configure.ac |
| 30 | @@ -101,6 +101,9 @@ AC_ARG_ENABLE(cpu-clip, |
| 31 | AC_HELP_STRING([--disable-cpu-clip], [disable tricky cpu specific clipper]), |
| 32 | ac_arg_cpu_clip="N", ac_arg_cpu_clip="Y") |
| 33 | |
| 34 | +AC_ARG_ENABLE(alsa, |
| 35 | + AC_HELP_STRING([--disable-alsa], [disable ALSA support in the varispeed-play example program])) |
| 36 | + |
| 37 | #==================================================================================== |
| 38 | # Check types and their sizes. |
| 39 | |
| 40 | @@ -194,6 +197,10 @@ if test x$enable_alsa != xno ; then |
| 41 | if test x$ac_cv_header_alsa_asoundlib_h = xyes ; then |
| 42 | ALSA_LIBS="-lasound" |
| 43 | enable_alsa=yes |
| 44 | + elif test x$enable_alsa = xyes ; then |
| 45 | + AC_MSG_ERROR(["ALSA headers not found"]) |
| 46 | + else |
| 47 | + enable_alsa=no |
| 48 | fi |
| 49 | fi |
| 50 | |
| 51 | @@ -340,7 +347,7 @@ AC_MSG_RESULT([ |
| 52 | Have FFTW : ................... ${ac_cv_fftw3}]) |
| 53 | |
| 54 | AC_MSG_RESULT([ Have libsndfile : ............. ${ac_cv_sndfile}]) |
| 55 | -AC_MSG_RESULT([ Have ALSA : ................... ${ac_cv_header_alsa_asoundlib_h} |
| 56 | +AC_MSG_RESULT([ Have ALSA : ................... ${enable_alsa} |
| 57 | ]) |
| 58 | |
| 59 | AC_MSG_RESULT([ Installation directories : |
| 60 | -- |
| 61 | 2.9.3 |
| 62 | |