Bug 1452509 - Move --enable-alsa to moz.configure. r?Build
MozReview-Commit-ID: Cv0HnZPvkWe
--- a/build/moz.configure/old.configure
+++ b/build/moz.configure/old.configure
@@ -165,17 +165,16 @@ def old_configure_options(*options):
return depends(prepare_configure, extra_old_configure_args, all_options,
*options)
@old_configure_options(
'--cache-file',
'--datadir',
'--enable-accessibility',
- '--enable-alsa',
'--enable-bundled-fonts',
'--enable-content-sandbox',
'--enable-cookies',
'--enable-cpp-rtti',
'--enable-crashreporter',
'--enable-dbus',
'--enable-debug-js-modules',
'--enable-directshow',
--- a/old-configure.in
+++ b/old-configure.in
@@ -2594,34 +2594,16 @@ fi
if test -n "$MOZ_TREMOR"; then
AC_DEFINE(MOZ_TREMOR)
fi
MOZ_WEBM_ENCODER=1
AC_DEFINE(MOZ_WEBM_ENCODER)
AC_SUBST(MOZ_WEBM_ENCODER)
-dnl ==================================
-dnl = Check alsa availability on Linux
-dnl ==================================
-
-MOZ_ARG_ENABLE_BOOL(alsa,
-[ --enable-alsa Enable Alsa support],
- MOZ_ALSA=1,
- MOZ_ALSA=)
-
-if test -n "$MOZ_ALSA"; then
- AC_DEFINE(MOZ_ALSA)
- PKG_CHECK_MODULES(MOZ_ALSA, alsa, ,
- [echo "$MOZ_ALSA_PKG_ERRORS"
- AC_MSG_ERROR([Need alsa for audio output on Linux. (On Ubuntu, you might try installing the package libasound2-dev.)])])
-fi
-
-AC_SUBST(MOZ_ALSA)
-
dnl ========================================================
dnl = Disable PulseAudio
dnl ========================================================
dnl If using Desktop Linux, ensure that the PA library is available
case "$OS_TARGET" in
WINNT|Darwin|Android|OpenBSD)
;;
--- a/toolkit/moz.configure
+++ b/toolkit/moz.configure
@@ -50,16 +50,26 @@ def dmd(value):
set_config('MOZ_DMD', dmd)
set_define('MOZ_DMD', dmd)
add_old_configure_assignment('MOZ_DMD', dmd)
imply_option('--enable-profiling', dmd)
imply_option('--enable-jemalloc', dmd)
imply_option('--enable-replace-malloc', dmd)
+# ALSA cubeb backend
+# ==============================================================
+option('--enable-alsa', env='MOZ_ALSA',
+ help='Enable ALSA audio backend.')
+
+alsa = pkg_check_modules('MOZ_ALSA', 'alsa', when='--enable-alsa')
+
+set_config('MOZ_ALSA', depends_if(alsa)(lambda _: True))
+set_define('MOZ_ALSA', depends_if(alsa)(lambda _: True))
+
# JACK cubeb backend
# ==============================================================
option('--enable-jack', env='MOZ_JACK',
help='Enable JACK audio backend.')
jack = pkg_check_modules('MOZ_JACK', 'jack', when='--enable-jack')
set_config('MOZ_JACK', depends_if(jack)(lambda _: True))