diff -Nur mpd-0.12.1.orig/m4/alsa.m4 mpd-0.12.1/m4/alsa.m4
--- mpd-0.12.1.orig/m4/alsa.m4	1970-01-01 01:00:00.000000000 +0100
+++ mpd-0.12.1/m4/alsa.m4	2007-03-15 00:47:48.000000000 +0100
@@ -0,0 +1,138 @@
+dnl Configure Paths for Alsa
+dnl Some modifications by Richard Boulton <richard-alsa@tartarus.org>
+dnl Christopher Lansdown <lansdoct@cs.alfred.edu>
+dnl Jaroslav Kysela <perex@suse.cz>
+dnl Last modification: alsa.m4,v 1.24 2004/09/15 18:48:07 tiwai Exp
+dnl AM_PATH_ALSA([MINIMUM-VERSION [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
+dnl Test for libasound, and define ALSA_CFLAGS and ALSA_LIBS as appropriate.
+dnl enables arguments --with-alsa-prefix=
+dnl                   --with-alsa-enc-prefix=
+dnl                   --disable-alsatest
+dnl
+dnl For backwards compatibility, if ACTION_IF_NOT_FOUND is not specified,
+dnl and the alsa libraries are not found, a fatal AC_MSG_ERROR() will result.
+dnl
+AC_DEFUN([AM_PATH_ALSA],
+[dnl Save the original CFLAGS, LDFLAGS, and LIBS
+alsa_save_CFLAGS="$CFLAGS"
+alsa_save_LDFLAGS="$LDFLAGS"
+alsa_save_LIBS="$LIBS"
+alsa_found=yes
+
+dnl
+dnl Get the cflags and libraries for alsa
+dnl
+AC_ARG_WITH(alsa-prefix,
+[  --with-alsa-prefix=PFX  Prefix where Alsa library is installed(optional)],
+[alsa_prefix="$withval"], [alsa_prefix=""])
+
+AC_ARG_WITH(alsa-inc-prefix,
+[  --with-alsa-inc-prefix=PFX  Prefix where include libraries are (optional)],
+[alsa_inc_prefix="$withval"], [alsa_inc_prefix=""])
+
+dnl FIXME: this is not yet implemented
+AC_ARG_ENABLE(alsatest,
+[  --disable-alsatest      Do not try to compile and run a test Alsa program],
+[enable_alsatest="$enableval"],
+[enable_alsatest=yes])
+
+dnl Add any special include directories
+AC_MSG_CHECKING(for ALSA CFLAGS)
+if test "$alsa_inc_prefix" != "" ; then
+	ALSA_CFLAGS="$ALSA_CFLAGS -I$alsa_inc_prefix"
+	CFLAGS="$CFLAGS -I$alsa_inc_prefix"
+fi
+AC_MSG_RESULT($ALSA_CFLAGS)
+CFLAGS="$alsa_save_CFLAGS"
+
+dnl add any special lib dirs
+AC_MSG_CHECKING(for ALSA LDFLAGS)
+if test "$alsa_prefix" != "" ; then
+	ALSA_LIBS="$ALSA_LIBS -L$alsa_prefix"
+	LDFLAGS="$LDFLAGS $ALSA_LIBS"
+fi
+
+dnl add the alsa library
+ALSA_LIBS="$ALSA_LIBS -lasound -lm -ldl -lpthread"
+LIBS="$ALSA_LIBS $LIBS"
+AC_MSG_RESULT($ALSA_LIBS)
+
+dnl Check for a working version of libasound that is of the right version.
+min_alsa_version=ifelse([$1], ,0.1.1,$1)
+AC_MSG_CHECKING(for libasound headers version >= $min_alsa_version)
+no_alsa=""
+    alsa_min_major_version=`echo $min_alsa_version | \
+           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
+    alsa_min_minor_version=`echo $min_alsa_version | \
+           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
+    alsa_min_micro_version=`echo $min_alsa_version | \
+           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
+
+AC_LANG_SAVE
+AC_LANG_C
+AC_TRY_COMPILE([
+#include <alsa/asoundlib.h>
+], [
+/* ensure backward compatibility */
+#if !defined(SND_LIB_MAJOR) && defined(SOUNDLIB_VERSION_MAJOR)
+#define SND_LIB_MAJOR SOUNDLIB_VERSION_MAJOR
+#endif
+#if !defined(SND_LIB_MINOR) && defined(SOUNDLIB_VERSION_MINOR)
+#define SND_LIB_MINOR SOUNDLIB_VERSION_MINOR
+#endif
+#if !defined(SND_LIB_SUBMINOR) && defined(SOUNDLIB_VERSION_SUBMINOR)
+#define SND_LIB_SUBMINOR SOUNDLIB_VERSION_SUBMINOR
+#endif
+
+#  if(SND_LIB_MAJOR > $alsa_min_major_version)
+  exit(0);
+#  else
+#    if(SND_LIB_MAJOR < $alsa_min_major_version)
+#       error not present
+#    endif
+
+#   if(SND_LIB_MINOR > $alsa_min_minor_version)
+  exit(0);
+#   else
+#     if(SND_LIB_MINOR < $alsa_min_minor_version)
+#          error not present
+#      endif
+
+#      if(SND_LIB_SUBMINOR < $alsa_min_micro_version)
+#        error not present
+#      endif
+#    endif
+#  endif
+exit(0);
+],
+  [AC_MSG_RESULT(found.)],
+  [AC_MSG_RESULT(not present.)
+   ifelse([$3], , [AC_MSG_ERROR(Sufficiently new version of libasound not found.)])
+   alsa_found=no]
+)
+AC_LANG_RESTORE
+
+dnl Now that we know that we have the right version, let's see if we have the library and not just the headers.
+if test "x$enable_alsatest" = "xyes"; then
+AC_CHECK_LIB([asound], [snd_ctl_open],,
+	[ifelse([$3], , [AC_MSG_ERROR(No linkable libasound was found.)])
+	 alsa_found=no]
+)
+fi
+
+LDFLAGS="$alsa_save_LDFLAGS"
+LIBS="$alsa_save_LIBS"
+
+if test "x$alsa_found" = "xyes" ; then
+   ifelse([$2], , :, [$2])
+else
+   ALSA_CFLAGS=""
+   ALSA_LIBS=""
+   ifelse([$3], , :, [$3])
+fi
+
+dnl That should be it.  Now just export out symbols:
+AC_SUBST(ALSA_CFLAGS)
+AC_SUBST(ALSA_LIBS)
+])
+
diff -Nur mpd-0.12.1.orig/m4/audiofile.m4 mpd-0.12.1/m4/audiofile.m4
--- mpd-0.12.1.orig/m4/audiofile.m4	1970-01-01 01:00:00.000000000 +0100
+++ mpd-0.12.1/m4/audiofile.m4	2007-03-15 00:47:48.000000000 +0100
@@ -0,0 +1,179 @@
+# Configure paths for the Audio File Library
+# Bertrand Guiheneuf 98-10-21
+# stolen from esd.m4 in esound :
+# Manish Singh    98-9-30
+# stolen back from Frank Belew
+# stolen from Manish Singh
+# Shamelessly stolen from Owen Taylor
+
+dnl AM_PATH_AUDIOFILE([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
+dnl Test for Audio File Library, and define AUDIOFILE_CFLAGS and AUDIOFILE_LIBS.
+dnl
+AC_DEFUN([AM_PATH_AUDIOFILE],
+[dnl 
+dnl Get compiler flags and libraries from the audiofile-config script.
+dnl
+AC_ARG_WITH(audiofile-prefix,[  --with-audiofile-prefix=PFX   Prefix where Audio File Library is installed (optional)],
+            audiofile_prefix="$withval", audiofile_prefix="")
+AC_ARG_WITH(audiofile-exec-prefix,[  --with-audiofile-exec-prefix=PFX Exec prefix where Audio File Library is installed (optional)],
+            audiofile_exec_prefix="$withval", audiofile_exec_prefix="")
+AC_ARG_ENABLE(audiofiletest, [  --disable-audiofiletest       Do not try to compile and run a test Audio File Library program], , enable_audiofiletest=yes)
+
+  if test x$audiofile_exec_prefix != x ; then
+     audiofile_args="$audiofile_args --exec-prefix=$audiofile_exec_prefix"
+     if test x${AUDIOFILE_CONFIG+set} != xset ; then
+        AUDIOFILE_CONFIG=$audiofile_exec_prefix/bin/audiofile-config
+     fi
+  fi
+  if test x$audiofile_prefix != x ; then
+     audiofile_args="$audiofile_args --prefix=$audiofile_prefix"
+     if test x${AUDIOFILE_CONFIG+set} != xset ; then
+        AUDIOFILE_CONFIG=$audiofile_prefix/bin/audiofile-config
+     fi
+  fi
+
+  AC_PATH_PROG(AUDIOFILE_CONFIG, audiofile-config, no)
+  min_audiofile_version=ifelse([$1], ,0.2.5,$1)
+  AC_MSG_CHECKING(for Audio File Library - version >= $min_audiofile_version)
+  no_audiofile=""
+  if test "$AUDIOFILE_CONFIG" = "no" ; then
+    no_audiofile=yes
+  else
+    AUDIOFILE_LIBS=`$AUDIOFILE_CONFIG $audiofileconf_args --libs`
+    AUDIOFILE_CFLAGS=`$AUDIOFILE_CONFIG $audiofileconf_args --cflags`
+    audiofile_major_version=`$AUDIOFILE_CONFIG $audiofile_args --version | \
+           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
+    audiofile_minor_version=`$AUDIOFILE_CONFIG $audiofile_args --version | \
+           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
+    audiofile_micro_version=`$AUDIOFILE_CONFIG $audiofile_config_args --version | \
+           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
+    if test "x$enable_audiofiletest" = "xyes" ; then
+      AC_LANG_SAVE
+      AC_LANG_C
+      ac_save_CFLAGS="$CFLAGS"
+      ac_save_LIBS="$LIBS"
+      CFLAGS="$CFLAGS $AUDIOFILE_CFLAGS"
+      LIBS="$LIBS $AUDIOFILE_LIBS"
+dnl
+dnl Now check if the installed Audio File Library is sufficiently new. 
+dnl (Also checks the sanity of the results of audiofile-config to some extent.)
+dnl
+      rm -f conf.audiofiletest
+      AC_TRY_RUN([
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <audiofile.h>
+
+char*
+my_strdup (char *str)
+{
+  char *new_str;
+  
+  if (str)
+    {
+      new_str = malloc ((strlen (str) + 1) * sizeof(char));
+      strcpy (new_str, str);
+    }
+  else
+    new_str = NULL;
+  
+  return new_str;
+}
+
+int main ()
+{
+  int major, minor, micro;
+  char *tmp_version;
+
+  system ("touch conf.audiofiletest");
+
+  /* HP/UX 9 (%@#!) writes to sscanf strings */
+  tmp_version = my_strdup("$min_audiofile_version");
+  if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
+     printf("%s, bad version string\n", "$min_audiofile_version");
+     exit(1);
+   }
+
+   if (($audiofile_major_version > major) ||
+      (($audiofile_major_version == major) && ($audiofile_minor_version > minor)) ||
+      (($audiofile_major_version == major) && ($audiofile_minor_version == minor) && ($audiofile_micro_version >= micro)))
+    {
+      return 0;
+    }
+  else
+    {
+      printf("\n*** 'audiofile-config --version' returned %d.%d.%d, but the minimum version\n", $audiofile_major_version, $audiofile_minor_version, $audiofile_micro_version);
+      printf("*** of the Audio File Library required is %d.%d.%d. If audiofile-config is correct, then it is\n", major, minor, micro);
+      printf("*** best to upgrade to the required version.\n");
+      printf("*** If audiofile-config was wrong, set the environment variable AUDIOFILE_CONFIG\n");
+      printf("*** to point to the correct copy of audiofile-config, and remove the file\n");
+      printf("*** config.cache before re-running configure\n");
+      return 1;
+    }
+}
+
+],, no_audiofile=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
+       CFLAGS="$ac_save_CFLAGS"
+       LIBS="$ac_save_LIBS"
+       AC_LANG_RESTORE
+     fi
+  fi
+  if test "x$no_audiofile" = x ; then
+     AC_MSG_RESULT(yes)
+     ifelse([$2], , :, [$2])     
+  else
+     AC_MSG_RESULT(no)
+     if test "$AUDIOFILE_CONFIG" = "no" ; then
+       cat <<END
+*** The audiofile-config script installed by the Audio File Library could
+*** not be found.  If the Audio File Library was installed in PREFIX, make
+*** sure PREFIX/bin is in your path, or set the AUDIOFILE_CONFIG
+*** environment variable to the full path to audiofile-config.
+END
+     else
+       if test -f conf.audiofiletest ; then
+        :
+       else
+          echo "*** Could not run Audio File Library test program; checking why..."
+          AC_LANG_SAVE
+          AC_LANG_C
+          CFLAGS="$CFLAGS $AUDIOFILE_CFLAGS"
+          LIBS="$LIBS $AUDIOFILE_LIBS"
+          AC_TRY_LINK([
+#include <stdio.h>
+#include <audiofile.h>
+],      [ return 0; ],
+        [ cat <<END
+*** The test program compiled, but did not run.  This usually means that
+*** the run-time linker is not finding Audio File Library or finding the
+*** wrong version of Audio File Library.
+***
+*** If it is not finding Audio File Library, you'll need to set your
+*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point
+*** to the installed location.  Also, make sure you have run ldconfig if
+*** that is required on your system.
+***
+*** If you have an old version installed, it is best to remove it, although
+*** you may also be able to get things to work by modifying
+*** LD_LIBRARY_PATH.
+END
+        ],
+        [ echo "*** The test program failed to compile or link. See the file config.log"
+          echo "*** for the exact error that occured. This usually means the Audio File"
+          echo "*** Library was incorrectly installed or that you have moved the Audio"
+          echo "*** File Library since it was installed. In the latter case, you may want"
+          echo "*** to edit the audiofile-config script: $AUDIOFILE_CONFIG" ])
+          CFLAGS="$ac_save_CFLAGS"
+          LIBS="$ac_save_LIBS"
+          AC_LANG_RESTORE
+       fi
+     fi
+     AUDIOFILE_CFLAGS=""
+     AUDIOFILE_LIBS=""
+     ifelse([$3], , :, [$3])
+  fi
+  AC_SUBST(AUDIOFILE_CFLAGS)
+  AC_SUBST(AUDIOFILE_LIBS)
+  rm -f conf.audiofiletest
+])
diff -Nur mpd-0.12.1.orig/m4/libmikmod.m4 mpd-0.12.1/m4/libmikmod.m4
--- mpd-0.12.1.orig/m4/libmikmod.m4	1970-01-01 01:00:00.000000000 +0100
+++ mpd-0.12.1/m4/libmikmod.m4	2007-03-15 00:47:48.000000000 +0100
@@ -0,0 +1,207 @@
+# Configure paths for libmikmod
+#
+# Derived from glib.m4 (Owen Taylor 97-11-3)
+# Improved by Chris Butler
+#
+
+dnl AM_PATH_LIBMIKMOD([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]]])
+dnl Test for libmikmod, and define LIBMIKMOD_CFLAGS, LIBMIKMOD_LIBS and
+dnl LIBMIKMOD_LDADD
+dnl
+AC_DEFUN([AM_PATH_LIBMIKMOD],
+[dnl 
+dnl Get the cflags and libraries from the libmikmod-config script
+dnl
+AC_ARG_WITH(libmikmod-prefix,[  --with-libmikmod-prefix=PFX   Prefix where libmikmod is installed (optional)],
+            libmikmod_config_prefix="$withval", libmikmod_config_prefix="")
+AC_ARG_WITH(libmikmod-exec-prefix,[  --with-libmikmod-exec-prefix=PFX Exec prefix where libmikmod is installed (optional)],
+            libmikmod_config_exec_prefix="$withval", libmikmod_config_exec_prefix="")
+AC_ARG_ENABLE(libmikmodtest, [  --disable-libmikmodtest       Do not try to compile and run a test libmikmod program],
+		    , enable_libmikmodtest=yes)
+
+  if test x$libmikmod_config_exec_prefix != x ; then
+     libmikmod_config_args="$libmikmod_config_args --exec-prefix=$libmikmod_config_exec_prefix"
+     if test x${LIBMIKMOD_CONFIG+set} != xset ; then
+        LIBMIKMOD_CONFIG=$libmikmod_config_exec_prefix/bin/libmikmod-config
+     fi
+  fi
+  if test x$libmikmod_config_prefix != x ; then
+     libmikmod_config_args="$libmikmod_config_args --prefix=$libmikmod_config_prefix"
+     if test x${LIBMIKMOD_CONFIG+set} != xset ; then
+        LIBMIKMOD_CONFIG=$libmikmod_config_prefix/bin/libmikmod-config
+     fi
+  fi
+
+  AC_PATH_PROG(LIBMIKMOD_CONFIG, libmikmod-config, no)
+  min_libmikmod_version=ifelse([$1], ,3.1.5,$1)
+  AC_MSG_CHECKING(for libmikmod - version >= $min_libmikmod_version)
+  no_libmikmod=""
+  if test "$LIBMIKMOD_CONFIG" = "no" ; then
+    no_libmikmod=yes
+  else
+    LIBMIKMOD_CFLAGS=`$LIBMIKMOD_CONFIG $libmikmod_config_args --cflags`
+    LIBMIKMOD_LIBS=`$LIBMIKMOD_CONFIG $libmikmod_config_args --libs`
+    LIBMIKMOD_LDADD=`$LIBMIKMOD_CONFIG $libmikmod_config_args --ldadd`
+    libmikmod_config_major_version=`$LIBMIKMOD_CONFIG $libmikmod_config_args --version | \
+           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\).*/\1/'`
+    libmikmod_config_minor_version=`$LIBMIKMOD_CONFIG $libmikmod_config_args --version | \
+           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\).*/\2/'`
+    libmikmod_config_micro_version=`$LIBMIKMOD_CONFIG $libmikmod_config_args --version | \
+           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\).*/\3/'`
+    if test "x$enable_libmikmodtest" = "xyes" ; then
+      ac_save_CFLAGS="$CFLAGS"
+      ac_save_LIBS="$LIBS"
+	  AC_LANG_SAVE
+	  AC_LANG_C
+      CFLAGS="$CFLAGS $LIBMIKMOD_CFLAGS $LIBMIKMOD_LDADD"
+      LIBS="$LIBMIKMOD_LIBS $LIBS"
+dnl
+dnl Now check if the installed libmikmod is sufficiently new. (Also sanity
+dnl checks the results of libmikmod-config to some extent
+dnl
+      rm -f conf.mikmodtest
+      AC_TRY_RUN([
+#include <mikmod.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+char* my_strdup (char *str)
+{
+  char *new_str;
+
+  if (str) {
+    new_str = malloc ((strlen (str) + 1) * sizeof(char));
+    strcpy (new_str, str);
+  } else
+    new_str = NULL;
+
+  return new_str;
+}
+
+int main()
+{
+  int major,minor,micro;
+  int libmikmod_major_version,libmikmod_minor_version,libmikmod_micro_version;
+  char *tmp_version;
+
+  system("touch conf.mikmodtest");
+
+  /* HP/UX 9 (%@#!) writes to sscanf strings */
+  tmp_version = my_strdup("$min_libmikmod_version");
+  if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
+     printf("%s, bad version string\n", "$min_libmikmod_version");
+     exit(1);
+   }
+
+  libmikmod_major_version=(MikMod_GetVersion() >> 16) & 255;
+  libmikmod_minor_version=(MikMod_GetVersion() >>  8) & 255;
+  libmikmod_micro_version=(MikMod_GetVersion()      ) & 255;
+
+  if ((libmikmod_major_version != $libmikmod_config_major_version) ||
+      (libmikmod_minor_version != $libmikmod_config_minor_version) ||
+      (libmikmod_micro_version != $libmikmod_config_micro_version))
+    {
+      printf("\n*** 'libmikmod-config --version' returned %d.%d.%d, but libmikmod (%d.%d.%d)\n", 
+             $libmikmod_config_major_version, $libmikmod_config_minor_version, $libmikmod_config_micro_version,
+             libmikmod_major_version, libmikmod_minor_version, libmikmod_micro_version);
+      printf ("*** was found! If libmikmod-config was correct, then it is best\n");
+      printf ("*** to remove the old version of libmikmod. You may also be able to fix the error\n");
+      printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
+      printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
+      printf("*** required on your system.\n");
+      printf("*** If libmikmod-config was wrong, set the environment variable LIBMIKMOD_CONFIG\n");
+      printf("*** to point to the correct copy of libmikmod-config, and remove the file config.cache\n");
+      printf("*** before re-running configure\n");
+    } 
+  else if ((libmikmod_major_version != LIBMIKMOD_VERSION_MAJOR) ||
+	   (libmikmod_minor_version != LIBMIKMOD_VERSION_MINOR) ||
+           (libmikmod_micro_version != LIBMIKMOD_REVISION))
+    {
+      printf("*** libmikmod header files (version %d.%d.%d) do not match\n",
+	     LIBMIKMOD_VERSION_MAJOR, LIBMIKMOD_VERSION_MINOR, LIBMIKMOD_REVISION);
+      printf("*** library (version %d.%d.%d)\n",
+	     libmikmod_major_version, libmikmod_minor_version, libmikmod_micro_version);
+    }
+  else
+    {
+      if ((libmikmod_major_version > major) ||
+        ((libmikmod_major_version == major) && (libmikmod_minor_version > minor)) ||
+        ((libmikmod_major_version == major) && (libmikmod_minor_version == minor) && (libmikmod_micro_version >= micro)))
+      {
+        return 0;
+       }
+     else
+      {
+        printf("\n*** An old version of libmikmod (%d.%d.%d) was found.\n",
+               libmikmod_major_version, libmikmod_minor_version, libmikmod_micro_version);
+        printf("*** You need a version of libmikmod newer than %d.%d.%d.\n",
+	       major, minor, micro);
+        printf("***\n");
+        printf("*** If you have already installed a sufficiently new version, this error\n");
+        printf("*** probably means that the wrong copy of the libmikmod-config shell script is\n");
+        printf("*** being found. The easiest way to fix this is to remove the old version\n");
+        printf("*** of libmikmod, but you can also set the LIBMIKMOD_CONFIG environment to point to the\n");
+        printf("*** correct copy of libmikmod-config. (In this case, you will have to\n");
+        printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
+        printf("*** so that the correct libraries are found at run-time))\n");
+      }
+    }
+  return 1;
+}
+],, no_libmikmod=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
+       CFLAGS="$ac_save_CFLAGS"
+       LIBS="$ac_save_LIBS"
+	   AC_LANG_RESTORE
+     fi
+  fi
+  if test "x$no_libmikmod" = x ; then
+     AC_MSG_RESULT([yes, `$LIBMIKMOD_CONFIG --version`])
+     ifelse([$2], , :, [$2])     
+  else
+     AC_MSG_RESULT(no)
+     if test "$LIBMIKMOD_CONFIG" = "no" ; then
+       echo "*** The libmikmod-config script installed by libmikmod could not be found"
+       echo "*** If libmikmod was installed in PREFIX, make sure PREFIX/bin is in"
+       echo "*** your path, or set the LIBMIKMOD_CONFIG environment variable to the"
+       echo "*** full path to libmikmod-config."
+     else
+       if test -f conf.mikmodtest ; then
+        :
+       else
+          echo "*** Could not run libmikmod test program, checking why..."
+          CFLAGS="$CFLAGS $LIBMIKMOD_CFLAGS"
+          LIBS="$LIBS $LIBMIKMOD_LIBS"
+		  AC_LANG_SAVE
+		  AC_LANG_C
+          AC_TRY_LINK([
+#include <mikmod.h>
+#include <stdio.h>
+],      [ return (MikMod_GetVersion()!=0); ],
+        [ echo "*** The test program compiled, but did not run. This usually means"
+          echo "*** that the run-time linker is not finding libmikmod or finding the wrong"
+          echo "*** version of libmikmod. If it is not finding libmikmod, you'll need to set your"
+          echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
+          echo "*** to the installed location. Also, make sure you have run ldconfig if that"
+          echo "*** is required on your system."
+	  echo "***"
+          echo "*** If you have an old version installed, it is best to remove it, although"
+          echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
+        [ echo "*** The test program failed to compile or link. See the file config.log for the"
+          echo "*** exact error that occured. This usually means libmikmod was incorrectly installed"
+          echo "*** or that you have moved libmikmod since it was installed. In the latter case, you"
+          echo "*** may want to edit the libmikmod-config script: $LIBMIKMOD_CONFIG" ])
+          CFLAGS="$ac_save_CFLAGS"
+          LIBS="$ac_save_LIBS"
+		  AC_LANG_RESTORE
+       fi
+     fi
+     LIBMIKMOD_CFLAGS=""
+     LIBMIKMOD_LIBS=""
+     LIBMIKMOD_LDADD=""
+     ifelse([$3], , :, [$3])
+  fi
+  AC_SUBST(LIBMIKMOD_CFLAGS)
+  AC_SUBST(LIBMIKMOD_LIBS)
+  AC_SUBST(LIBMIKMOD_LDADD)
+  rm -f conf.mikmodtest
+])
diff -Nur mpd-0.12.1.orig/m4/libOggFLAC.m4 mpd-0.12.1/m4/libOggFLAC.m4
--- mpd-0.12.1.orig/m4/libOggFLAC.m4	1970-01-01 01:00:00.000000000 +0100
+++ mpd-0.12.1/m4/libOggFLAC.m4	2007-03-15 00:47:48.000000000 +0100
@@ -0,0 +1,104 @@
+# Configure paths for libOggFLAC
+# "Inspired" by ogg.m4
+
+dnl AM_PATH_LIBOGGFLAC([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
+dnl Test for libOggFLAC, and define LIBOGGFLAC_CFLAGS and LIBOGGFLAC_LIBS
+dnl
+AC_DEFUN([AM_PATH_LIBOGGFLAC],
+[dnl 
+dnl Get the cflags and libraries
+dnl
+AC_ARG_WITH(libOggFLAC,[  --with-libOggFLAC=PFX   Prefix where libOggFLAC is installed (optional)], libOggFLAC_prefix="$withval", libOggFLAC_prefix="")
+AC_ARG_WITH(libOggFLAC-libraries,[  --with-libOggFLAC-libraries=DIR   Directory where libOggFLAC library is installed (optional)], libOggFLAC_libraries="$withval", libOggFLAC_libraries="")
+AC_ARG_WITH(libOggFLAC-includes,[  --with-libOggFLAC-includes=DIR   Directory where libOggFLAC header files are installed (optional)], libOggFLAC_includes="$withval", libOggFLAC_includes="")
+AC_ARG_ENABLE(libOggFLACtest, [  --disable-libOggFLACtest       Do not try to compile and run a test libOggFLAC program],, enable_libOggFLACtest=yes)
+
+  if test "x$libOggFLAC_libraries" != "x" ; then
+    LIBOGGFLAC_LIBS="-L$libOggFLAC_libraries"
+  elif test "x$libOggFLAC_prefix" != "x" ; then
+    LIBOGGFLAC_LIBS="-L$libOggFLAC_prefix/lib"
+  elif test "x$prefix" != "xNONE" ; then
+    LIBOGGFLAC_LIBS="-L$prefix/lib"
+  fi
+
+  LIBOGGFLAC_LIBS="$LIBOGGFLAC_LIBS -lOggFLAC -lFLAC -lm"
+
+  if test "x$libOggFLAC_includes" != "x" ; then
+    LIBOGGFLAC_CFLAGS="-I$libOggFLAC_includes"
+  elif test "x$libOggFLAC_prefix" != "x" ; then
+    LIBOGGFLAC_CFLAGS="-I$libOggFLAC_prefix/include"
+  elif test "$prefix" != "xNONE"; then
+    LIBOGGFLAC_CFLAGS="-I$prefix/include"
+  fi
+
+  AC_MSG_CHECKING(for libOggFLAC)
+  no_libOggFLAC=""
+
+
+  if test "x$enable_libOggFLACtest" = "xyes" ; then
+    ac_save_CFLAGS="$CFLAGS"
+    ac_save_CXXFLAGS="$CXXFLAGS"
+    ac_save_LIBS="$LIBS"
+    CFLAGS="$CFLAGS $LIBOGGFLAC_CFLAGS"
+    CXXFLAGS="$CXXFLAGS $LIBOGGFLAC_CFLAGS"
+    LIBS="$LIBS $LIBOGGFLAC_LIBS"
+dnl
+dnl Now check if the installed libOggFLAC is sufficiently new.
+dnl
+      rm -f conf.libOggFLACtest
+      AC_TRY_RUN([
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <OggFLAC/stream_decoder.h>
+
+int main ()
+{
+  system("touch conf.libOggFLACtest");
+  return 0;
+}
+
+],, no_libOggFLAC=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
+       CFLAGS="$ac_save_CFLAGS"
+       LIBS="$ac_save_LIBS"
+  fi
+
+  if test "x$no_libOggFLAC" = "x" ; then
+     AC_MSG_RESULT(yes)
+     ifelse([$1], , :, [$1])     
+  else
+     AC_MSG_RESULT(no)
+     if test -f conf.libOggFLACtest ; then
+       :
+     else
+       echo "*** Could not run libOggFLAC test program, checking why..."
+       CFLAGS="$CFLAGS $LIBOGGFLAC_CFLAGS"
+       LIBS="$LIBS $LIBOGGFLAC_LIBS"
+       AC_TRY_LINK([
+#include <stdio.h>
+#include <OggFLAC/stream_decoder.h>
+],     [ return 0; ],
+       [ echo "*** The test program compiled, but did not run. This usually means"
+       echo "*** that the run-time linker is not finding libOggFLAC or finding the wrong"
+       echo "*** version of libOggFLAC. If it is not finding libOggFLAC, you'll need to set your"
+       echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
+       echo "*** to the installed location  Also, make sure you have run ldconfig if that"
+       echo "*** is required on your system"
+       echo "***"
+       echo "*** If you have an old version installed, it is best to remove it, although"
+       echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
+       [ echo "*** The test program failed to compile or link. See the file config.log for the"
+       echo "*** exact error that occured. This usually means libOggFLAC was incorrectly installed"
+       echo "*** or that you have moved libOggFLAC since it was installed. In the latter case, you"
+       echo "*** may want to edit the libOggFLAC-config script: $LIBOGGFLAC_CONFIG" ])
+       CFLAGS="$ac_save_CFLAGS"
+       LIBS="$ac_save_LIBS"
+     fi
+     LIBOGGFLAC_CFLAGS=""
+     LIBOGGFLAC_LIBS=""
+     ifelse([$2], , :, [$2])
+  fi
+  AC_SUBST(LIBOGGFLAC_CFLAGS)
+  AC_SUBST(LIBOGGFLAC_LIBS)
+  rm -f conf.libOggFLACtest
+])
