ref: b99314b36f8a144714439ea061f0d0b5f7065b5a
parent: 38d6c5896319fd315200ed1e38dbb612d12a3f36
author: rrt <rrt>
date: Fri Dec 8 07:00:09 EST 2006
Make OSS build again. Go back to having a special HAVE_ALSA symbol rather than the working but rather obscure and possibly confusing HAVE_ALSA_ASOUNDLIB_H.
--- a/configure
+++ b/configure
@@ -5669,7 +5669,14 @@
done
+if test "$with_alsa" = yes; then
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_ALSA 1
+_ACEOF
+,
+fi
+
with_oss=no
for ac_header in sys/soundcard.h
@@ -5961,7 +5968,14 @@
done
+if test "$with_oss" = yes; then
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_OSS 1
+_ACEOF
+,
+fi
+
with_sun_audio=no
for ac_header in sys/audioio.h
@@ -6618,8 +6632,7 @@
withval=$with_flac;
fi
-if test "$with_flac" = yes
-then
+if test "$with_flac" = yes; then
if test "${ac_cv_header_FLAC_file_encoder_h+set}" = set; then
{ echo "$as_me:$LINENO: checking for FLAC/file_encoder.h" >&5
echo $ECHO_N "checking for FLAC/file_encoder.h... $ECHO_C" >&6; }
@@ -6838,8 +6851,7 @@
withval=$with_mad;
fi
-if test "$with_mad" = yes
-then
+if test "$with_mad" = yes; then
if test "${ac_cv_header_mad_h+set}" = set; then
{ echo "$as_me:$LINENO: checking for mad.h" >&5
echo $ECHO_N "checking for mad.h... $ECHO_C" >&6; }
@@ -7058,8 +7070,7 @@
withval=$with_lame;
fi
-if test "$with_lame" = yes
-then
+if test "$with_lame" = yes; then
if test "${ac_cv_header_lame_lame_h+set}" = set; then
{ echo "$as_me:$LINENO: checking for lame/lame.h" >&5
echo $ECHO_N "checking for lame/lame.h... $ECHO_C" >&6; }
@@ -7278,8 +7289,7 @@
withval=$with_samplerate;
fi
-if test "$with_samplerate" = yes
-then
+if test "$with_samplerate" = yes; then
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
@@ -7470,7 +7480,7 @@
{ echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6; }
-cat >>confdefs.h <<_ACEOF
+cat >>confdefs.h <<\_ACEOF
#define HAVE_SAMPLERATE 1
_ACEOF
--- a/configure.ac
+++ b/configure.ac
@@ -41,11 +41,17 @@
[with_alsa=yes
AC_CHECK_LIB(asound, snd_pcm_open,, with_alsa=no)],
with_alsa=no)
+if test "$with_alsa" = yes; then
+ AC_DEFINE(HAVE_ALSA, 1, [Set to 1 if you have ALSA.]),
+fi
dnl Check for OSS audio
with_oss=no
AC_CHECK_HEADERS(sys/soundcard.h, with_oss=yes)
AC_CHECK_HEADERS(machine/soundcard.h, with_oss=yes)
+if test "$with_oss" = yes; then
+ AC_DEFINE(HAVE_OSS, 1, [Set to 1 if you have OSS.]),
+fi
dnl Check for Sun-style audio
with_sun_audio=no
@@ -65,8 +71,7 @@
AC_ARG_WITH(flac,
AS_HELP_STRING([--with-flac],
[Use FLAC if present (default is YES)]))
-if test "$with_flac" = yes
-then
+if test "$with_flac" = yes; then
AC_CHECK_HEADER(FLAC/file_encoder.h,
[AC_CHECK_LIB(FLAC, FLAC__file_encoder_new,,with_flac=no)],
with_flac=no)
@@ -77,8 +82,7 @@
AC_ARG_WITH(mad,
AS_HELP_STRING([--with-mad],
[Use MAD (MP3 Audio Decoder) if present (default is YES)]))
-if test "$with_mad" = yes
-then
+if test "$with_mad" = yes; then
AC_CHECK_HEADER(mad.h,
[AC_CHECK_LIB(mad, mad_stream_buffer,,with_mad=no)],
with_mad=no)
@@ -89,8 +93,7 @@
AC_ARG_WITH(lame,
AS_HELP_STRING([--with-lame],
[Use LAME (LAME Ain't an MP3 Encoder) if present (default is YES)]))
-if test "$with_lame" = yes
-then
+if test "$with_lame" = yes; then
AC_CHECK_HEADER(lame/lame.h,
[AC_CHECK_LIB(mp3lame, lame_init,,with_lame=no)],
with_lame=no)
@@ -101,11 +104,9 @@
AC_ARG_WITH(samplerate,
AS_HELP_STRING([--with-samplerate],
[Use libsamplerate (aka Secret Rabbit Code) if present (default is YES)]))
-if test "$with_samplerate" = yes
-then
+if test "$with_samplerate" = yes; then
PKG_CHECK_MODULES(SAMPLERATE, samplerate >= 0.0.15,
- AC_DEFINE_UNQUOTED([HAVE_SAMPLERATE],1,
- [Set to 1 if you have libsamplerate.]),
+ AC_DEFINE(HAVE_SAMPLERATE, 1, [Set to 1 if you have libsamplerate.]),
with_samplerate=no)
fi
AC_SUBST(SAMPLERATE_CFLAGS)
--- a/src/alsa.c
+++ b/src/alsa.c
@@ -16,7 +16,7 @@
#include "st_i.h"
-#ifdef HAVE_ALSA_ASOUNDLIB_H
+#ifdef HAVE_ALSA
#include <alsa/asoundlib.h>
@@ -651,4 +651,4 @@
return &st_alsa_format;
}
-#endif /* HAVE_ALSA_ASOUNDLIB_H */
+#endif /* HAVE_ALSA */
--- 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_ASOUNDLIB_H
+#ifdef HAVE_ALSA
st_alsa_format_fn,
#endif
st_au_format_fn,
--- 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_ASOUNDLIB_H
+#ifdef HAVE_ALSA
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
@@ -1,5 +1,8 @@
/* src/stconfig.h.in. Generated from configure.ac by autoheader. */
+/* Set to 1 if you have ALSA. */
+#undef HAVE_ALSA
+
/* Define to 1 if you have the <alsa/asoundlib.h> header file. */
#undef HAVE_ALSA_ASOUNDLIB_H
@@ -44,6 +47,9 @@
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
+
+/* Set to 1 if you have OSS. */
+#undef HAVE_OSS
/* Set to 1 if you have libsamplerate. */
#undef HAVE_SAMPLERATE