shithub: sox

Download patch

ref: 49e582e17530a50f18f58547b241371894a98d76
parent: c0ee26e6f06281f3a4834318babf0aa9ee17ece7
author: rrt <rrt>
date: Sat Jun 9 18:56:00 EDT 2007

Fix MP3 libs detection

--- a/configure.ac
+++ b/configure.ac
@@ -216,7 +216,7 @@
         [with_mad=$withval])
 if test "$with_mad" != "no"; then
     using_mad=yes
-    AC_CHECK_HEADER(mad.h,
+    AC_CHECK_HEADERS(mad.h,
         [AC_CHECK_LIB(mad, mad_stream_buffer, MP3_LIBS="$MP3_LIBS -lmad",using_mad=no)],
         with_mad=no)
     if test "$with_mad" = "yes" -a "$using_mad" = "no"; then
@@ -231,7 +231,7 @@
         [with_lame=$withval])
 if test "$with_lame" != "no"; then
     using_lame=yes
-    AC_CHECK_HEADER(lame/lame.h,
+    AC_CHECK_HEADERS(lame/lame.h,
         [AC_CHECK_LIB(mp3lame, lame_init, MP3_LIBS="$MP3_LIBS -lmp3lame",using_lame=no)],
         using_lame=no)
     if test "$with_lame" = "yes" -a "$using_lame" = "no"; then
--- a/src/mp3.c
+++ b/src/mp3.c
@@ -14,11 +14,11 @@
 
 #include <string.h>
 
-#ifdef HAVE_LIBMAD
+#ifdef HAVE_MAD_H
 #include <mad.h>
 #endif
 
-#ifdef HAVE_LIBMP3LAME
+#ifdef HAVE_LAME_LAME_H
 #include <lame/lame.h>
 #include <math.h>
 #endif
@@ -27,7 +27,7 @@
 
 /* Private data */
 struct mp3priv {
-#ifdef HAVE_LIBMAD
+#ifdef HAVE_MAD_H
         struct mad_stream       *Stream;
         struct mad_frame        *Frame;
         struct mad_synth        *Synth;
@@ -35,13 +35,13 @@
         unsigned char           *InputBuffer;
         sox_ssize_t              cursamp;
         sox_size_t               FrameCount;
-#endif /*HAVE_LIBMAD*/
-#ifdef HAVE_LIBMP3LAME
+#endif /*HAVE_MAD_H*/
+#ifdef HAVE_LAME_LAME_H
         lame_global_flags       *gfp;
-#endif /*HAVE_LIBMP3LAME*/
+#endif /*HAVE_LAME_LAME_H*/
 };
 
-#ifdef HAVE_LIBMAD
+#ifdef HAVE_MAD_H
 
 /* This function merges the functions tagtype() and id3_tag_query()
    from MAD's libid3tag, so we don't have to link to it
@@ -340,7 +340,7 @@
 
   return SOX_SUCCESS;
 }
-#else /*HAVE_LIBMAD*/
+#else /*HAVE_MAD_H*/
 static int sox_mp3startread(sox_format_t * ft)
 {
   sox_fail_errno(ft,SOX_EOF,"SoX was compiled without MP3 decoding support");
@@ -358,9 +358,9 @@
   sox_fail_errno(ft,SOX_EOF,"SoX was compiled without MP3 decoding support");
   return SOX_EOF;
 }
-#endif /*HAVE_LIBMAD*/
+#endif /*HAVE_MAD_H*/
 
-#ifdef HAVE_LIBMP3LAME
+#ifdef HAVE_LAME_LAME_H
 static void null_error_func(const char* string UNUSED, va_list va UNUSED)
 {
   return;
@@ -523,7 +523,7 @@
   return SOX_SUCCESS;
 }
 
-#else /* HAVE_LIBMP3LAME */
+#else /* HAVE_LAME_LAME_H */
 static int sox_mp3startwrite(sox_format_t * ft UNUSED)
 {
   sox_fail_errno(ft,SOX_EOF,"SoX was compiled without MP3 encoding support");
@@ -541,7 +541,7 @@
   sox_fail_errno(ft,SOX_EOF,"SoX was compiled without MP3 encoding support");
   return SOX_EOF;
 }
-#endif /* HAVE_LIBMP3LAME */
+#endif /* HAVE_LAME_LAME_H */
 
 /* MP3 */
 static const char *mp3names[] = {