ref: 38d6c5896319fd315200ed1e38dbb612d12a3f36
parent: 8a0dd9d39a62d4d962d370b3ddce05e41d3480f3
author: rrt <rrt>
date: Thu Dec 7 21:05:58 EST 2006
Fix ALSA detection. Remove redundant check for -lvorbis (don't need it). Note: OSS still broken!
--- a/configure
+++ b/configure
@@ -5589,7 +5589,9 @@
cat >>confdefs.h <<_ACEOF
#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF
- { echo "$as_me:$LINENO: checking for snd_pcm_open in -lasound" >&5
+ with_alsa=yes
+
+{ echo "$as_me:$LINENO: checking for snd_pcm_open in -lasound" >&5
echo $ECHO_N "checking for snd_pcm_open in -lasound... $ECHO_C" >&6; }
if test "${ac_cv_lib_asound_snd_pcm_open+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -5651,7 +5653,12 @@
{ echo "$as_me:$LINENO: result: $ac_cv_lib_asound_snd_pcm_open" >&5
echo "${ECHO_T}$ac_cv_lib_asound_snd_pcm_open" >&6; }
if test $ac_cv_lib_asound_snd_pcm_open = yes; then
- with_alsa=yes
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBASOUND 1
+_ACEOF
+
+ LIBS="-lasound $LIBS"
+
else
with_alsa=no
fi
@@ -6378,73 +6385,7 @@
fi
if test $ac_cv_header_vorbis_codec_h = yes; then
- { echo "$as_me:$LINENO: checking for vorbis_analysis_init in -lvorbis" >&5
-echo $ECHO_N "checking for vorbis_analysis_init in -lvorbis... $ECHO_C" >&6; }
-if test "${ac_cv_lib_vorbis_vorbis_analysis_init+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lvorbis -logg $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char vorbis_analysis_init ();
-int
-main ()
-{
-return vorbis_analysis_init ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- ac_cv_lib_vorbis_vorbis_analysis_init=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_lib_vorbis_vorbis_analysis_init=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_vorbis_vorbis_analysis_init" >&5
-echo "${ECHO_T}$ac_cv_lib_vorbis_vorbis_analysis_init" >&6; }
-if test $ac_cv_lib_vorbis_vorbis_analysis_init = yes; then
with_ogg_vorbis=yes
-else
- with_ogg_vorbis=no
-fi
-
{ echo "$as_me:$LINENO: checking for ogg_packet_clear in -logg" >&5
echo $ECHO_N "checking for ogg_packet_clear in -logg... $ECHO_C" >&6; }
--- a/configure.ac
+++ b/configure.ac
@@ -38,7 +38,8 @@
dnl Check for ALSA audio
AC_CHECK_HEADERS(alsa/asoundlib.h,
- [AC_CHECK_LIB(asound, snd_pcm_open, with_alsa=yes, with_alsa=no)],
+ [with_alsa=yes
+ AC_CHECK_LIB(asound, snd_pcm_open,, with_alsa=no)],
with_alsa=no)
dnl Check for OSS audio
@@ -53,7 +54,7 @@
dnl Check for Ogg Vorbis libraries
AC_CHECK_HEADER(vorbis/codec.h,
- [AC_CHECK_LIB(vorbis, vorbis_analysis_init, with_ogg_vorbis=yes, with_ogg_vorbis=no, -logg)
+ [with_ogg_vorbis=yes
AC_CHECK_LIB(ogg, ogg_packet_clear,, with_ogg_vorbis=no)
AC_CHECK_LIB(vorbisfile, ov_clear,, with_ogg_vorbis=no)
AC_CHECK_LIB(vorbisenc, vorbis_encode_init_vbr,, with_ogg_vorbis=no)],
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -61,8 +61,5 @@
$(RM) $(includedir)/st.h
$(RM) $(includedir)/ststdint.h
-clean:
- $(RM) *.o libst.a
-
distclean-local:
$(RM) *.raw *.sf libst-config stconfig.h ststdint.h
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -651,6 +651,8 @@
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
clean-am: clean-binPROGRAMS clean-generic clean-libLIBRARIES \
mostlyclean-am
@@ -756,9 +758,6 @@
$(RM) $(libdir)/libst.a
$(RM) $(includedir)/st.h
$(RM) $(includedir)/ststdint.h
-
-clean:
- $(RM) *.o libst.a
distclean-local:
$(RM) *.raw *.sf libst-config stconfig.h ststdint.h
--- a/src/alsa.c
+++ b/src/alsa.c
@@ -16,7 +16,7 @@
#include "st_i.h"
-#ifdef HAVE_ALSA
+#ifdef HAVE_ALSA_ASOUNDLIB_H
#include <alsa/asoundlib.h>
@@ -650,4 +650,5 @@
{
return &st_alsa_format;
}
-#endif /* HAVE_ALSA */
+
+#endif /* HAVE_ALSA_ASOUNDLIB_H */
--- a/src/handlers.c
+++ b/src/handlers.c
@@ -19,7 +19,7 @@
st_aiff_format_fn,
st_aifc_format_fn,
st_al_format_fn,
-#ifdef HAVE_ALSA
+#ifdef HAVE_ALSA_ASOUNDLIB_H
st_alsa_format_fn,
#endif
st_au_format_fn,
--- a/src/sox.c
+++ b/src/sox.c
@@ -1,5 +1,5 @@
/*
- * Sox - The Swiss Army Knife of Audio Manipulation.
+ * SoX - The Swiss Army Knife of Audio Manipulation.
*
* This is the main function for the command line sox program.
*
--- a/src/st_i.h
+++ b/src/st_i.h
@@ -162,7 +162,7 @@
extern const st_format_t *st_aiff_format_fn(void);
extern const st_format_t *st_aifc_format_fn(void);
-#ifdef HAVE_ALSA
+#ifdef HAVE_ALSA_ASOUNDLIB_H
extern const st_format_t *st_alsa_format_fn(void);
#endif
extern const st_format_t *st_au_format_fn(void);
--- a/src/stconfig.h.in
+++ b/src/stconfig.h.in
@@ -18,6 +18,9 @@
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
+/* Define to 1 if you have the `asound' library (-lasound). */
+#undef HAVE_LIBASOUND
+
/* Define to 1 if you have the `FLAC' library (-lFLAC). */
#undef HAVE_LIBFLAC
--
⑨