build: Convert oss detection to new macros.
authorAndre Noll <maan@tuebingen.mpg.de>
Mon, 25 Aug 2014 21:50:01 +0000 (23:50 +0200)
committerAndre Noll <maan@tuebingen.mpg.de>
Mon, 30 Mar 2015 16:45:41 +0000 (16:45 +0000)
This also adds the missing oss_cppflags autoconf variable and the
corresponding make rule for building the oss writer.

Makefile.in
Makefile.real
configure.ac

index d8c6ed8..14015c9 100644 (file)
@@ -50,6 +50,7 @@ flac_cppflags := @flac_cppflags@
 samplerate_cppflags := @samplerate_cppflags@
 readline_cppflags := @readline_cppflags@
 alsa_cppflags := @alsa_cppflags@
+oss_cppflags := @oss_cppflags@
 
 clock_gettime_ldflags := @clock_gettime_ldflags@
 id3tag_ldflags := @id3tag_ldflags@
index 55d9e18..c5d6405 100644 (file)
@@ -204,6 +204,9 @@ $(object_dir)/interactive.o $(dep_dir)/interactive.d \
 $(object_dir)/resample_filter.o $(dep_dir)/resample_filter.d \
 : CPPFLAGS += $(samplerate_cppflags)
 
+$(object_dir)/oss_write.o $(dep_dir)/oss_write.d \
+: CPPFLAGS += $(oss_cppflags)
+
 $(object_dir)/ao_write.o $(dep_dir)/ao_write.d \
 : CPPFLAGS += $(ao_cppflags) $(pthread_cppflags)
 
index 81f1e64..98d75c7 100644 (file)
@@ -354,29 +354,12 @@ AC_CHECK_LIB([id3tag], [id3_file_fdopen], [], HAVE_ID3TAG=no)
 LIB_SUBST_FLAGS(id3tag)
 UNSTASH_FLAGS
 ########################################################################### oss
-OLD_CPPFLAGS="$CPPFLAGS"
-OLD_LDFLAGS="$LDFLAGS"
-OLD_LIBS="$LIBS"
-
-have_oss="yes"
-msg="=> will not build oss writer"
-
-AC_CHECK_HEADER(sys/soundcard.h, [
-       AC_CHECK_LIB(ossaudio, _oss_ioctl, [
-                       oss_ldflags="-lossaudio"
-                       AC_SUBST(oss_ldflags)
-               ]
-       )
-       ],
-       [
-               have_oss="no"
-               AC_MSG_WARN([no sys/soundcard.h $msg])
-       ]
-)
-CPPFLAGS="$OLD_CPPFLAGS"
-LDFLAGS="$OLD_LDFLAGS"
-LIBS="$OLD_LIBS"
-
+STASH_FLAGS
+LIB_ARG_WITH([oss], [])
+AC_CHECK_HEADER(sys/soundcard.h, [HAVE_OSS=yes], [HAVE_OSS=no])
+AC_CHECK_LIB(ossaudio, _oss_ioctl, [oss_ldflags="$oss_ldflags -lossaudio"], [])
+LIB_SUBST_FLAGS(oss)
+UNSTASH_FLAGS
 ########################################################################### alsa
 STASH_FLAGS
 LIB_ARG_WITH([alsa], [-lasound])
@@ -667,7 +650,7 @@ if test -n "$CRYPTOLIB"; then
                audiod_cmdline_objs="$audiod_cmdline_objs mp3dec_filter"
                audiod_errlist_objs="$audiod_errlist_objs mp3dec_filter"
        fi
-       if test "$have_oss" = "yes"; then
+       if test $HAVE_OSS = yes; then
                audiod_errlist_objs="$audiod_errlist_objs oss_write"
                audiod_cmdline_objs="$audiod_cmdline_objs oss_write"
        fi
@@ -697,12 +680,12 @@ 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"
        fade_errlist_objs="fade exec string fd version ggo"
-       if test "$have_oss" = "yes"; then
+       if test $HAVE_OSS = yes; then
                fade_errlist_objs="$fade_errlist_objs oss_mix"
                mixers="${mixers}oss "
                default_mixer="OSS_MIX"
@@ -1014,7 +997,7 @@ if test $HAVE_MAD = yes; then
        play_cmdline_objs="$play_cmdline_objs mp3dec_filter"
        play_errlist_objs="$play_errlist_objs mp3dec_filter"
 fi
-if test "$have_oss" = "yes"; then
+if test $HAVE_OSS = yes; then
        play_errlist_objs="$play_errlist_objs oss_write"
        play_cmdline_objs="$play_cmdline_objs oss_write"
 fi
@@ -1072,7 +1055,7 @@ NEED_AO_OBJECTS && {
        writers="$writers ao"
        default_writer="AO_WRITE"
 }
-if test "$have_oss" = "yes"; then
+if test $HAVE_OSS = yes; then
        write_errlist_objs="$write_errlist_objs oss_write"
        write_cmdline_objs="$write_cmdline_objs oss_write"
        writers="$writers oss"