diff --git a/Makefile.in b/Makefile.in index 813e1ed9..7672a8e1 100755 --- a/Makefile.in +++ b/Makefile.in @@ -59,10 +59,9 @@ SRCS= \ vomp.c \ xprintf.c -# Only build these on Linux -ifeq (0, 1) -SRCS+= audio_alsa.c \ - audio_msm_g1.c +HAVE_ALSA= @HAVE_ALSA@ +ifeq (HAVE_ALSA,1) +SRCS+= audio_alsa.c endif MONITORCLIENTSRCS=conf.c \ diff --git a/audiodevices.c b/audiodevices.c index 4373e901..1028fe42 100644 --- a/audiodevices.c +++ b/audiodevices.c @@ -33,7 +33,7 @@ int detectAudioDevice() #ifdef ANDROID if (!audev) audev=audio_msm_g1_detect(); #endif -#ifdef linux +#ifdef HAVE_SYS_ALSA_ASOUNDLIB_H if (!audev) audev=audio_alsa_detect(); #endif if (audev) { diff --git a/configure.in b/configure.in index 439c6b60..ef91afd4 100644 --- a/configure.in +++ b/configure.in @@ -92,13 +92,17 @@ AC_CHECK_HEADERS( net/route.h \ signal.h \ jni.h \ - alsa/asoundlib.h \ ucred.h \ sys/filio.h \ sys/endian.h \ sys/byteorder.h \ ) +dnl Check for ALSA +AC_CHECK_HEADER([alsa/asoundlib.h], [have_alsa=1], [have_alsa=0]) +AS_IF([test x"$have_alsa" = "x1"], [AC_DEFINE([HAVE_ALSA_ASOUNDLIB_H])]) +AS_IF([test x"$have_alsa" = "x1"], [AC_SUBST(HAVE_ALSA,1)], [AC_SUBST(HAVE_ALSA,0)]) + echo "Fetching and building NaCl if required." echo "(this can take HOURS to build depending on your architecture," echo " but fortunately it only needs to happen once.)"