From 9bfd946422ec369c4fd91aa1c674cfb277e8cd9f Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Sun, 24 Aug 2014 22:57:29 +0200 Subject: [PATCH 1/1] build: Convert alsa detection to new macros. Adds alsa_cppflags. --- Makefile.in | 1 + Makefile.real | 1 + configure.ac | 49 ++++++++++++------------------------------------- 3 files changed, 14 insertions(+), 37 deletions(-) diff --git a/Makefile.in b/Makefile.in index a638f968..39d5b23b 100644 --- a/Makefile.in +++ b/Makefile.in @@ -48,6 +48,7 @@ ao_cppflags := @ao_cppflags@ flac_cppflags := @flac_cppflags@ samplerate_cppflags := @samplerate_cppflags@ readline_cppflags := @readline_cppflags@ +alsa_cppflags := @alsa_cppflags@ clock_gettime_ldflags := @clock_gettime_ldflags@ id3tag_ldflags := @id3tag_ldflags@ diff --git a/Makefile.real b/Makefile.real index 269babaf..94a0865e 100644 --- a/Makefile.real +++ b/Makefile.real @@ -197,6 +197,7 @@ $(object_dir)/mp3_afh.o $(dep_dir)/mp3_afh.d: CPPFLAGS += $(id3tag_cppflags) $(object_dir)/crypt.o $(dep_dir)/crypt.d: CPPFLAGS += $(openssl_cppflags) $(object_dir)/gcrypt.o $(dep_dir)/gcrypt.d: CPPFLAGS += $(gcrypt_cppflags) $(object_dir)/ao_write.o $(dep_dir)/ao_write.d: CPPFLAGS += $(ao_cppflags) +$(object_dir)/alsa%.o $(dep_dir)/alsa%.d: CPPFLAGS += $(alsa_cppflags) $(object_dir)/interactive.o $(dep_dir)/interactive.d \ : CPPFLAGS += $(readline_cppflags) diff --git a/configure.ac b/configure.ac index 5358c6e3..80fff1e0 100644 --- a/configure.ac +++ b/configure.ac @@ -378,38 +378,13 @@ LDFLAGS="$OLD_LDFLAGS" 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" @@ -755,7 +730,7 @@ if test -n "$CRYPTOLIB"; then 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 @@ -781,7 +756,7 @@ else 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" @@ -791,7 +766,7 @@ if test "$have_oss" = "yes" -o "$have_alsa" = "yes"; then 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" @@ -1102,7 +1077,7 @@ if test "$have_oss" = "yes"; then 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 @@ -1162,7 +1137,7 @@ if test "$have_oss" = "yes"; then 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" -- 2.39.2