From b6fc8db4b7c72fa5a8fe643d287ac74a275b76d7 Mon Sep 17 00:00:00 2001 From: Karl Tomlinson Date: Fri, 21 Aug 2009 10:08:18 +1200 Subject: [PATCH] Bug 511326 Move libasound out of global OS_LIBS r=doublec --- config/autoconf.mk.in | 2 ++ config/static-config.mk | 6 ++++++ configure.in | 7 ++++--- layout/build/Makefile.in | 3 +++ toolkit/library/libxul-rules.mk | 6 ++++++ 5 files changed, 21 insertions(+), 3 deletions(-) diff --git a/config/autoconf.mk.in b/config/autoconf.mk.in index f1a5645bc21..fb419ffe9e9 100644 --- a/config/autoconf.mk.in +++ b/config/autoconf.mk.in @@ -541,6 +541,8 @@ MOZ_LIBNOTIFY_CFLAGS = @MOZ_LIBNOTIFY_CFLAGS@ MOZ_LIBNOTIFY_LIBS = @MOZ_LIBNOTIFY_LIBS@ MOZ_ENABLE_LIBNOTIFY = @MOZ_ENABLE_LIBNOTIFY@ +MOZ_ALSA_LIBS = @MOZ_ALSA_LIBS@ + GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_LIBS = @GLIB_LIBS@ GLIB_GMODULE_LIBS = @GLIB_GMODULE_LIBS@ diff --git a/config/static-config.mk b/config/static-config.mk index cfbb60a19bf..4c69dbbe134 100644 --- a/config/static-config.mk +++ b/config/static-config.mk @@ -94,6 +94,12 @@ ifdef MOZ_ENABLE_STARTUP_NOTIFICATION STATIC_EXTRA_LIBS += $(MOZ_STARTUP_NOTIFICATION_LIBS) endif +ifdef MOZ_SYDNEYAUDIO +ifeq ($(OS_ARCH),Linux) +STATIC_EXTRA_LIBS += $(MOZ_ALSA_LIBS) +endif +endif + # Component Makefile always brings in this. # STATIC_EXTRA_LIBS += $(TK_LIBS) diff --git a/configure.in b/configure.in index 98d02d67174..ed37421e3d8 100644 --- a/configure.in +++ b/configure.in @@ -5540,15 +5540,16 @@ 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 "$COMPILE_ENVIRONMENT"; then if test -n "$MOZ_SYDNEYAUDIO"; then case "$target_os" in linux*) - AC_CHECK_LIB(asound, snd_pcm_open,,AC_MSG_ERROR([Ogg support on Linux requires the alsa library])) + PKG_CHECK_MODULES(MOZ_ALSA, alsa, , + [echo "$MOZ_ALSA_PKG_ERRORS" + AC_MSG_ERROR([Need alsa for Ogg or Wave decoding on Linux. Disable with --disable-ogg --disable-wave.])]) ;; esac fi -fi +AC_SUBST(MOZ_ALSA_LIBS) dnl ======================================================== dnl Splashscreen diff --git a/layout/build/Makefile.in b/layout/build/Makefile.in index 5a79c33e7ef..a44772eb073 100644 --- a/layout/build/Makefile.in +++ b/layout/build/Makefile.in @@ -280,6 +280,9 @@ EXTRA_DSO_LDOPTS += $(XLDFLAGS) $(XLIBS) endif ifdef MOZ_SYDNEYAUDIO +ifeq ($(OS_ARCH),Linux) +EXTRA_DSO_LDOPTS += $(MOZ_ALSA_LIBS) +endif ifeq ($(OS_ARCH),Darwin) OS_LIBS += -framework CoreAudio -framework AudioToolbox -framework AudioUnit -framework Carbon endif diff --git a/toolkit/library/libxul-rules.mk b/toolkit/library/libxul-rules.mk index 5152478a36e..cf2e22e2395 100644 --- a/toolkit/library/libxul-rules.mk +++ b/toolkit/library/libxul-rules.mk @@ -83,6 +83,12 @@ ifneq (,$(filter $(MOZ_WIDGET_TOOLKIT),mac cocoa)) EXTRA_DSO_LDOPTS += -lcups endif +ifdef MOZ_SYDNEYAUDIO +ifeq ($(OS_ARCH),Linux) +EXTRA_DSO_LDOPTS += $(MOZ_ALSA_LIBS) +endif +endif + export:: dlldeps.cpp dlldeps.cpp: $(topsrcdir)/xpcom/build/dlldeps.cpp