ref: 2be5185b4edd6060c0369b88a82a3c2263f6b91f
parent: a669b692fe9d8a59947626ea8b9d80bfec926ee9
author: cbagwell <cbagwell>
date: Mon Aug 4 23:30:45 EDT 2008
Finding header doesn't always mean library is around, especially when using LDFLAGS=-static. Some updates to handle this better.
--- a/configure.ac
+++ b/configure.ac
@@ -221,10 +221,11 @@
AM_CONDITIONAL(HAVE_SUN_AUDIO, test x$enable_sun_audio = xyes)
dnl Check for libgsm
-AC_CHECK_HEADERS(gsm/gsm.h, found_libgsm=yes,
- [AC_CHECK_HEADERS(gsm.h, found_libgsm=yes)])
+found_libgsm=yes
+AC_CHECK_HEADERS(gsm/gsm.h, ,
+ [AC_CHECK_HEADERS(gsm.h, ,found_libgsm=no)])
+ AC_CHECK_LIB(gsm, gsm_create, GSM_LIBS="$GSM_LIBS -lgsm", found_libgsm=no)
if test "$found_libgsm" = yes; then
- AC_CHECK_LIB(gsm, gsm_create, GSM_LIBS="$GSM_LIBS -lgsm")
AC_DEFINE(EXTERNAL_GSM, 1, [Define if you are using an external GSM library])
else
LIBGSM_LIBADD=../libgsm/libgsm.la
@@ -245,6 +246,9 @@
AC_MSG_FAILURE([cannot find libsndfile])
fi
fi
+if test "$using_sndfile" = yes; then
+ AC_DEFINE(HAVE_SNDFILE, 1, [Define to 1 if you have libsndfile.])
+fi
AM_CONDITIONAL(HAVE_SNDFILE, test x$using_sndfile = xyes)
AC_SUBST(SNDFILE_CFLAGS)
AC_SUBST(SNDFILE_LIBS)
@@ -370,6 +374,9 @@
fi
dnl MP3 library depends on libmad || LAME
+if test "$using_mad" = yes -o "$using_lame" = yes; then
+ AC_DEFINE(HAVE_MP3, 1, [Define to 1 if you have lame or mad support.])
+fi
AM_CONDITIONAL(HAVE_MP3, test "x$using_mad" = "xyes" -o "x$using_lame" = "xyes")
AC_SUBST(MP3_LIBS)
--- a/src/formats.h
+++ b/src/formats.h
@@ -79,13 +79,13 @@
#if defined HAVE_FLAC
FORMAT(flac)
#endif
-#if defined(HAVE_MAD_H) || defined(HAVE_LAME_LAME_H)
+#if defined(HAVE_MP3)
FORMAT(mp3)
#endif
#if defined(HAVE_SYS_SOUNDCARD_H) || defined(HAVE_MACHINE_SOUNDCARD_H)
FORMAT(oss)
#endif
-#if defined HAVE_SNDFILE_H
+#if defined HAVE_SNDFILE
FORMAT(sndfile)
#if defined HAVE_SNDFILE_1_0_12
FORMAT(caf)