LIBS="$OLD_LIBS"
########################################################################### alsa
-OLD_CPPFLAGS="$CPPFLAGS"
-OLD_LDFLAGS="$LDFLAGS"
-OLD_LIBS="$LIBS"
-
-msg="=> no alsa support for para_audiod/para_write"
-if test "$OSTYPE" != "Linux"; then
- have_alsa="no"
-else
- have_alsa="yes"
-fi
-if test "$have_alsa" = "yes"; then
- AC_CHECK_HEADERS([alsa/asoundlib.h], [], [
- have_alsa="no"
- AC_MSG_WARN([no alsa/asoundlib $msg])
- ])
-fi
-
-if test "$have_alsa" = "yes"; then
- AC_CHECK_LIB([asound], [snd_pcm_open], [], [
- have_alsa="no"
- AC_MSG_WARN([no libasound $msg])
- ])
-fi
-
-if test "$have_alsa" = "yes"; then
- alsa_ldflags="-lasound"
- AC_SUBST(alsa_ldflags)
-fi
-
-CPPFLAGS="$OLD_CPPFLAGS"
-LDFLAGS="$OLD_LDFLAGS"
-LIBS="$OLD_LIBS"
+STASH_FLAGS
+LIB_ARG_WITH([alsa], [-lasound])
+HAVE_ALSA=yes
+AC_CHECK_HEADER(alsa/asoundlib.h, [], HAVE_ALSA=no)
+AC_CHECK_LIB([asound], [snd_pcm_open], [], HAVE_ALSA=no)
+LIB_SUBST_FLAGS(alsa)
+UNSTASH_FLAGS
########################################################################### libao
OLD_CPPFLAGS="$CPPFLAGS"
OLD_LDFLAGS="$LDFLAGS"
audiod_errlist_objs="$audiod_errlist_objs oss_write"
audiod_cmdline_objs="$audiod_cmdline_objs oss_write"
fi
- if test "$have_alsa" = "yes"; then
+ if test $HAVE_ALSA = yes; then
audiod_errlist_objs="$audiod_errlist_objs alsa_write"
audiod_cmdline_objs="$audiod_cmdline_objs alsa_write"
fi
build_audiod="no"
fi
########################################################################### fade
-if test "$have_oss" = "yes" -o "$have_alsa" = "yes"; then
+if test "$have_oss" = "yes" -o $HAVE_ALSA = yes; then
build_fade="yes"
executables="$executables fade"
fade_cmdline_objs="fade"
mixers="${mixers}oss "
default_mixer="OSS_MIX"
fi
- if test "$have_alsa" = "yes"; then
+ if test $HAVE_ALSA = yes; then
fade_errlist_objs="$fade_errlist_objs alsa_mix"
mixers="${mixers}alsa "
default_mixer="ALSA_MIX"
play_errlist_objs="$play_errlist_objs oss_write"
play_cmdline_objs="$play_cmdline_objs oss_write"
fi
-if test "$have_alsa" = "yes"; then
+if test $HAVE_ALSA = yes; then
play_errlist_objs="$play_errlist_objs alsa_write"
play_cmdline_objs="$play_cmdline_objs alsa_write"
fi
writers="$writers oss"
default_writer="OSS_WRITE"
fi
-if test "$have_alsa" = "yes"; then
+if test $HAVE_ALSA = yes; then
write_errlist_objs="$write_errlist_objs alsa_write"
write_cmdline_objs="$write_cmdline_objs alsa_write"
writers="$writers alsa"