Bug 807683 - Convert ALSA to a configure option. r=khuey
authorJan Beich <jbeich@tormail.org>
Mon, 26 Nov 2012 20:38:21 -0500
changeset 114172 828a19e29014d1eb2915987728c48ee64aae0be6
parent 114171 b960d3ce65bc656bc459ffb5cf028f4bc48c7671
child 114173 448bb73bddb07afdaff6a500e0c433f72938f479
push id23907
push useremorley@mozilla.com
push dateTue, 27 Nov 2012 14:15:28 +0000
treeherdermozilla-central@532d0832c09d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskhuey
bugs807683
milestone20.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 807683 - Convert ALSA to a configure option. r=khuey
configure.in
media/libcubeb/src/Makefile.in
media/libsydneyaudio/src/Makefile.in
toolkit/library/Makefile.in
--- a/configure.in
+++ b/configure.in
@@ -5613,21 +5613,35 @@ if test -n "$MOZ_OPUS"; then
 fi
 
 dnl ========================================================
 dnl = Check alsa availability on Linux if using sydneyaudio
 dnl ========================================================
 
 dnl If using sydneyaudio with Linux, ensure that the alsa library is available
 if test -n "$MOZ_SYDNEYAUDIO" -a "$OS_TARGET" = "Linux"; then
+    MOZ_ALSA=1
+fi
+
+MOZ_ARG_ENABLE_BOOL(alsa,
+[  --enable-alsa          Enable Alsa support (default on Linux)],
+MOZ_ALSA=1,
+MOZ_ALSA=)
+
+if test -n "$MOZ_ALSA"; then
+    AC_DEFINE(MOZ_CUBEB)
     PKG_CHECK_MODULES(MOZ_ALSA, alsa, ,
          [echo "$MOZ_ALSA_PKG_ERRORS"
           AC_MSG_ERROR([Need alsa for Ogg, Wave or WebM decoding on Linux.  Disable with --disable-ogg --disable-wave --disable-webm.  (On Ubuntu, you might try installing the package libasound2-dev.)])])
 fi
 
+AC_SUBST(MOZ_ALSA)
+AC_SUBST(MOZ_ALSA_CFLAGS)
+AC_SUBST(MOZ_ALSA_LIBS)
+
 dnl ========================================================
 dnl = Enable PulseAudio
 dnl ========================================================
 
 MOZ_ARG_ENABLE_BOOL(pulseaudio,
 [  --enable-pulseaudio          Enable PulseAudio support (experimental)],
 MOZ_PULSEAUDIO=1,
 MOZ_PULSEAUDIO=)
@@ -8629,18 +8643,16 @@ AC_SUBST(MOZ_OPUS)
 AC_SUBST(MOZ_WEBM)
 AC_SUBST(MOZ_DASH)
 AC_SUBST(MOZ_MEDIA_PLUGINS)
 AC_SUBST(MOZ_OMX_PLUGIN)
 AC_SUBST(MOZ_VP8_ERROR_CONCEALMENT)
 AC_SUBST(MOZ_VP8_ENCODER)
 AC_SUBST(MOZ_VP8)
 AC_SUBST(MOZ_OGG)
-AC_SUBST(MOZ_ALSA_LIBS)
-AC_SUBST(MOZ_ALSA_CFLAGS)
 AC_SUBST(VPX_AS)
 AC_SUBST(VPX_ASFLAGS)
 AC_SUBST(VPX_DASH_C_FLAG)
 AC_SUBST(VPX_AS_CONVERSION)
 AC_SUBST(VPX_ASM_SUFFIX)
 AC_SUBST(VPX_X86_ASM)
 AC_SUBST(VPX_ARM_ASM)
 AC_SUBST(VPX_NEED_OBJ_INT_EXTRACT)
--- a/media/libcubeb/src/Makefile.in
+++ b/media/libcubeb/src/Makefile.in
@@ -24,34 +24,36 @@ endif
 
 ifeq ($(OS_TARGET),Android)
 ifeq ($(MOZ_WIDGET_TOOLKIT),gonk)
 CSRCS         = \
               cubeb_opensl.c \
               $(NULL)
 endif
 # No Android implementation of libcubeb yet.
-else ifeq ($(OS_TARGET),Linux)
-CSRCS         = \
-              cubeb_alsa.c \
-              $(NULL)
 endif
 
 ifeq ($(OS_TARGET),Darwin)
 CSRCS           = \
                 cubeb_audiounit.c \
                 $(NULL)
 endif
 
 ifeq ($(OS_ARCH),OpenBSD)
 CSRCS           = \
                 cubeb_sndio.c \
                 $(NULL)
 endif
 
+ifdef MOZ_ALSA
+CSRCS         = \
+              cubeb_alsa.c \
+              $(NULL)
+endif
+
 ifdef MOZ_PULSEAUDIO
 CSRCS		= \
 		cubeb_pulse.c \
 		$(NULL)
 endif
 
 include $(topsrcdir)/config/rules.mk
 
--- a/media/libsydneyaudio/src/Makefile.in
+++ b/media/libsydneyaudio/src/Makefile.in
@@ -25,20 +25,16 @@ endif
 ifeq ($(MOZ_WIDGET_TOOLKIT),gonk)
 CPPSRCS		= \
 		sydney_audio_gonk.cpp \
 		$(NULL)
 else ifeq ($(MOZ_WIDGET_TOOLKIT),android)
 CSRCS		= \
 		sydney_audio_android.c \
 		$(NULL)
-else ifeq ($(OS_ARCH),Linux)
-CSRCS		= \
-		sydney_audio_alsa.c \
-		$(NULL)
 endif
 
 ifeq ($(OS_ARCH),WINNT)
 CSRCS		= \
 		sydney_audio_waveapi.c \
 		$(NULL)
 endif
 
@@ -63,16 +59,22 @@ CSRCS		= \
 endif
 
 ifeq ($(OS_ARCH),AIX)
 CSRCS		= \
 		sydney_audio_aix.c \
 		$(NULL)
 endif
 
+ifdef MOZ_ALSA
+CSRCS		= \
+		sydney_audio_alsa.c \
+		$(NULL)
+endif
+
 ifeq ($(OS_ARCH),WINNT)
 OS_LIBS += winmm.lib
 endif
 
 include $(topsrcdir)/config/rules.mk
 
 LOCAL_INCLUDES += -I$(srcdir)/../include
 
--- a/toolkit/library/Makefile.in
+++ b/toolkit/library/Makefile.in
@@ -416,24 +416,21 @@ EXTRA_DSO_LDOPTS += \
   -LIBPATH:"$(MOZ_DIRECTX_SDK_PATH)/lib/$(MOZ_DIRECTX_SDK_CPU_SUFFIX)" \
   $(NULL)
 OS_LIBS += $(call EXPAND_LIBNAME,secur32 crypt32 iphlpapi strmiids dmoguids wmcodecdspuuid amstrmid msdmo wininet)
 endif
 endif
 endif
 
 
-ifdef MOZ_SYDNEYAUDIO
-ifeq ($(OS_ARCH),Linux)
+ifneq (,$(MOZ_CUBEB)$(MOZ_SYDNEYAUDIO))
+ifdef MOZ_ALSA
 EXTRA_DSO_LDOPTS += $(MOZ_ALSA_LIBS)
 endif
-endif
-
 ifdef MOZ_PULSEAUDIO
-ifdef MOZ_CUBEB
 EXTRA_DSO_LDOPTS += $(MOZ_PULSEAUDIO_LIBS)
 endif
 endif
 
 ifdef HAVE_CLOCK_MONOTONIC
 EXTRA_DSO_LDOPTS += $(REALTIME_LIBS)
 endif