aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWarren Dukes <warren.dukes@gmail.com>2004-11-14 15:22:36 +0000
committerWarren Dukes <warren.dukes@gmail.com>2004-11-14 15:22:36 +0000
commit54acb123bc846eb69266084985a3698818eae0de (patch)
tree3a1a553b6e4a7aca2a862eebf22cac6245cad377
parent450f2decdd432d620fd46d8f2f808398e988456a (diff)
downloadmpd-54acb123bc846eb69266084985a3698818eae0de.tar.gz
mpd-54acb123bc846eb69266084985a3698818eae0de.tar.xz
mpd-54acb123bc846eb69266084985a3698818eae0de.zip
add non-standard m4's to mpd svn repository
git-svn-id: https://svn.musicpd.org/mpd/trunk@2655 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to '')
-rw-r--r--TODO2
-rwxr-xr-xautogen.sh1
-rw-r--r--m4/ao.m4112
-rw-r--r--m4/libFLAC.m4104
-rw-r--r--m4/libmikmod.m4207
-rw-r--r--m4/ogg.m4102
-rw-r--r--m4/shout.m479
-rw-r--r--m4/vorbis.m4122
8 files changed, 729 insertions, 0 deletions
diff --git a/TODO b/TODO
index 65618b9f8..b5beab7b5 100644
--- a/TODO
+++ b/TODO
@@ -37,6 +37,8 @@
*) Handle mp1 and mp2 files (including mp2's that are disguised as mp3's with
a mp3 suffix)
+*) use alsa aclocal/m4 stuff
+
0.13
----
*) support for dynamically loading plugins
diff --git a/autogen.sh b/autogen.sh
index ca1fdea5f..e71ab7bfe 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -96,6 +96,7 @@ fi
echo "Generating configuration files for $package, please wait...."
+ACLOCAL_FLAGS="$ACLOCAL_FLAGS -I ./m4"
if [ -d /usr/local/share/aclocal ]; then
ACLOCAL_FLAGS="$ACLOCAL_FLAGS -I /usr/local/share/aclocal"
fi
diff --git a/m4/ao.m4 b/m4/ao.m4
new file mode 100644
index 000000000..a2bfa67de
--- /dev/null
+++ b/m4/ao.m4
@@ -0,0 +1,112 @@
+# ao.m4
+# Configure paths for libao
+# Jack Moffitt <jack@icecast.org> 10-21-2000
+# Shamelessly stolen from Owen Taylor and Manish Singh
+
+dnl XIPH_PATH_AO([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
+dnl Test for libao, and define AO_CFLAGS and AO_LIBS
+dnl
+AC_DEFUN(XIPH_PATH_AO,
+[dnl
+dnl Get the cflags and libraries
+dnl
+AC_ARG_WITH(ao,[ --with-ao=PFX Prefix where libao is installed (optional)], ao_prefix="$withval", ao_prefix="")
+AC_ARG_WITH(ao-libraries,[ --with-ao-libraries=DIR Directory where libao library is installed (optional)], ao_libraries="$withval", ao_libraries="")
+AC_ARG_WITH(ao-includes,[ --with-ao-includes=DIR Directory where libao header files are installed (optional)], ao_includes="$withval", ao_includes="")
+AC_ARG_ENABLE(aotest, [ --disable-aotest Do not try to compile and run a test ao program],, enable_aotest=yes)
+
+
+ if test "x$ao_libraries" != "x" ; then
+ AO_LIBS="-L$ao_libraries"
+ elif test "x$ao_prefix" != "x"; then
+ AO_LIBS="-L$ao_prefix/lib"
+ elif test "x$prefix" != "xNONE"; then
+ AO_LIBS="-L$prefix/lib"
+ fi
+
+ if test "x$ao_includes" != "x" ; then
+ AO_CFLAGS="-I$ao_includes"
+ elif test "x$ao_prefix" != "x"; then
+ AO_CFLAGS="-I$ao_prefix/include"
+ elif test "x$prefix" != "xNONE"; then
+ AO_CFLAGS="-I$prefix/include"
+ fi
+
+ # see where dl* and friends live
+ AC_CHECK_FUNCS(dlopen, [AO_DL_LIBS=""], [
+ AC_CHECK_LIB(dl, dlopen, [AO_DL_LIBS="-ldl"], [
+ AC_MSG_WARN([could not find dlopen() needed by libao sound drivers
+ your system may not be supported.])
+ ])
+ ])
+
+ AO_LIBS="$AO_LIBS -lao $AO_DL_LIBS"
+
+ AC_MSG_CHECKING(for ao)
+ no_ao=""
+
+
+ if test "x$enable_aotest" = "xyes" ; then
+ ac_save_CFLAGS="$CFLAGS"
+ ac_save_LIBS="$LIBS"
+ CFLAGS="$CFLAGS $AO_CFLAGS"
+ LIBS="$LIBS $AO_LIBS"
+dnl
+dnl Now check if the installed ao is sufficiently new.
+dnl
+ rm -f conf.aotest
+ AC_TRY_RUN([
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <ao/ao.h>
+
+int main ()
+{
+ system("touch conf.aotest");
+ return 0;
+}
+
+],, no_ao=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
+ CFLAGS="$ac_save_CFLAGS"
+ LIBS="$ac_save_LIBS"
+ fi
+
+ if test "x$no_ao" = "x" ; then
+ AC_MSG_RESULT(yes)
+ ifelse([$1], , :, [$1])
+ else
+ AC_MSG_RESULT(no)
+ if test -f conf.aotest ; then
+ :
+ else
+ echo "*** Could not run ao test program, checking why..."
+ CFLAGS="$CFLAGS $AO_CFLAGS"
+ LIBS="$LIBS $AO_LIBS"
+ AC_TRY_LINK([
+#include <stdio.h>
+#include <ao/ao.h>
+], [ return 0; ],
+ [ echo "*** The test program compiled, but did not run. This usually means"
+ echo "*** that the run-time linker is not finding ao or finding the wrong"
+ echo "*** version of ao. If it is not finding ao, 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 ao was incorrectly installed"
+ echo "*** or that you have moved ao since it was installed." ])
+ CFLAGS="$ac_save_CFLAGS"
+ LIBS="$ac_save_LIBS"
+ fi
+ AO_CFLAGS=""
+ AO_LIBS=""
+ ifelse([$2], , :, [$2])
+ fi
+ AC_SUBST(AO_CFLAGS)
+ AC_SUBST(AO_LIBS)
+ rm -f conf.aotest
+])
diff --git a/m4/libFLAC.m4 b/m4/libFLAC.m4
new file mode 100644
index 000000000..88d8e84c3
--- /dev/null
+++ b/m4/libFLAC.m4
@@ -0,0 +1,104 @@
+# Configure paths for libFLAC
+# "Inspired" by ogg.m4
+
+dnl AM_PATH_LIBFLAC([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
+dnl Test for libFLAC, and define LIBFLAC_CFLAGS and LIBFLAC_LIBS
+dnl
+AC_DEFUN(AM_PATH_LIBFLAC,
+[dnl
+dnl Get the cflags and libraries
+dnl
+AC_ARG_WITH(libFLAC,[ --with-libFLAC=PFX Prefix where libFLAC is installed (optional)], libFLAC_prefix="$withval", libFLAC_prefix="")
+AC_ARG_WITH(libFLAC-libraries,[ --with-libFLAC-libraries=DIR Directory where libFLAC library is installed (optional)], libFLAC_libraries="$withval", libFLAC_libraries="")
+AC_ARG_WITH(libFLAC-includes,[ --with-libFLAC-includes=DIR Directory where libFLAC header files are installed (optional)], libFLAC_includes="$withval", libFLAC_includes="")
+AC_ARG_ENABLE(libFLACtest, [ --disable-libFLACtest Do not try to compile and run a test libFLAC program],, enable_libFLACtest=yes)
+
+ if test "x$libFLAC_libraries" != "x" ; then
+ LIBFLAC_LIBS="-L$libFLAC_libraries"
+ elif test "x$libFLAC_prefix" != "x" ; then
+ LIBFLAC_LIBS="-L$libFLAC_prefix/lib"
+ elif test "x$prefix" != "xNONE" ; then
+ LIBFLAC_LIBS="-L$prefix/lib"
+ fi
+
+ LIBFLAC_LIBS="$LIBFLAC_LIBS -lFLAC -lm"
+
+ if test "x$libFLAC_includes" != "x" ; then
+ LIBFLAC_CFLAGS="-I$libFLAC_includes"
+ elif test "x$libFLAC_prefix" != "x" ; then
+ LIBFLAC_CFLAGS="-I$libFLAC_prefix/include"
+ elif test "$prefix" != "xNONE"; then
+ LIBFLAC_CFLAGS="-I$prefix/include"
+ fi
+
+ AC_MSG_CHECKING(for libFLAC)
+ no_libFLAC=""
+
+
+ if test "x$enable_libFLACtest" = "xyes" ; then
+ ac_save_CFLAGS="$CFLAGS"
+ ac_save_CXXFLAGS="$CXXFLAGS"
+ ac_save_LIBS="$LIBS"
+ CFLAGS="$CFLAGS $LIBFLAC_CFLAGS"
+ CXXFLAGS="$CXXFLAGS $LIBFLAC_CFLAGS"
+ LIBS="$LIBS $LIBFLAC_LIBS"
+dnl
+dnl Now check if the installed libFLAC is sufficiently new.
+dnl
+ rm -f conf.libFLACtest
+ AC_TRY_RUN([
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <FLAC/format.h>
+
+int main ()
+{
+ system("touch conf.libFLACtest");
+ return 0;
+}
+
+],, no_libFLAC=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
+ CFLAGS="$ac_save_CFLAGS"
+ LIBS="$ac_save_LIBS"
+ fi
+
+ if test "x$no_libFLAC" = "x" ; then
+ AC_MSG_RESULT(yes)
+ ifelse([$1], , :, [$1])
+ else
+ AC_MSG_RESULT(no)
+ if test -f conf.libFLACtest ; then
+ :
+ else
+ echo "*** Could not run libFLAC test program, checking why..."
+ CFLAGS="$CFLAGS $LIBFLAC_CFLAGS"
+ LIBS="$LIBS $LIBFLAC_LIBS"
+ AC_TRY_LINK([
+#include <stdio.h>
+#include <FLAC/format.h>
+], [ return 0; ],
+ [ echo "*** The test program compiled, but did not run. This usually means"
+ echo "*** that the run-time linker is not finding libFLAC or finding the wrong"
+ echo "*** version of libFLAC. If it is not finding libFLAC, 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 libFLAC was incorrectly installed"
+ echo "*** or that you have moved libFLAC since it was installed. In the latter case, you"
+ echo "*** may want to edit the libFLAC-config script: $LIBFLAC_CONFIG" ])
+ CFLAGS="$ac_save_CFLAGS"
+ LIBS="$ac_save_LIBS"
+ fi
+ LIBFLAC_CFLAGS=""
+ LIBFLAC_LIBS=""
+ ifelse([$2], , :, [$2])
+ fi
+ AC_SUBST(LIBFLAC_CFLAGS)
+ AC_SUBST(LIBFLAC_LIBS)
+ rm -f conf.libFLACtest
+])
diff --git a/m4/libmikmod.m4 b/m4/libmikmod.m4
new file mode 100644
index 000000000..a87f6572d
--- /dev/null
+++ b/m4/libmikmod.m4
@@ -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 --git a/m4/ogg.m4 b/m4/ogg.m4
new file mode 100644
index 000000000..0f428756b
--- /dev/null
+++ b/m4/ogg.m4
@@ -0,0 +1,102 @@
+# Configure paths for libogg
+# Jack Moffitt <jack@icecast.org> 10-21-2000
+# Shamelessly stolen from Owen Taylor and Manish Singh
+
+dnl XIPH_PATH_OGG([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
+dnl Test for libogg, and define OGG_CFLAGS and OGG_LIBS
+dnl
+AC_DEFUN(XIPH_PATH_OGG,
+[dnl
+dnl Get the cflags and libraries
+dnl
+AC_ARG_WITH(ogg,[ --with-ogg=PFX Prefix where libogg is installed (optional)], ogg_prefix="$withval", ogg_prefix="")
+AC_ARG_WITH(ogg-libraries,[ --with-ogg-libraries=DIR Directory where libogg library is installed (optional)], ogg_libraries="$withval", ogg_libraries="")
+AC_ARG_WITH(ogg-includes,[ --with-ogg-includes=DIR Directory where libogg header files are installed (optional)], ogg_includes="$withval", ogg_includes="")
+AC_ARG_ENABLE(oggtest, [ --disable-oggtest Do not try to compile and run a test Ogg program],, enable_oggtest=yes)
+
+ if test "x$ogg_libraries" != "x" ; then
+ OGG_LIBS="-L$ogg_libraries"
+ elif test "x$ogg_prefix" != "x" ; then
+ OGG_LIBS="-L$ogg_prefix/lib"
+ elif test "x$prefix" != "xNONE" ; then
+ OGG_LIBS="-L$prefix/lib"
+ fi
+
+ OGG_LIBS="$OGG_LIBS -logg"
+
+ if test "x$ogg_includes" != "x" ; then
+ OGG_CFLAGS="-I$ogg_includes"
+ elif test "x$ogg_prefix" != "x" ; then
+ OGG_CFLAGS="-I$ogg_prefix/include"
+ elif test "x$prefix" != "xNONE"; then
+ OGG_CFLAGS="-I$prefix/include"
+ fi
+
+ AC_MSG_CHECKING(for Ogg)
+ no_ogg=""
+
+
+ if test "x$enable_oggtest" = "xyes" ; then
+ ac_save_CFLAGS="$CFLAGS"
+ ac_save_LIBS="$LIBS"
+ CFLAGS="$CFLAGS $OGG_CFLAGS"
+ LIBS="$LIBS $OGG_LIBS"
+dnl
+dnl Now check if the installed Ogg is sufficiently new.
+dnl
+ rm -f conf.oggtest
+ AC_TRY_RUN([
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <ogg/ogg.h>
+
+int main ()
+{
+ system("touch conf.oggtest");
+ return 0;
+}
+
+],, no_ogg=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
+ CFLAGS="$ac_save_CFLAGS"
+ LIBS="$ac_save_LIBS"
+ fi
+
+ if test "x$no_ogg" = "x" ; then
+ AC_MSG_RESULT(yes)
+ ifelse([$1], , :, [$1])
+ else
+ AC_MSG_RESULT(no)
+ if test -f conf.oggtest ; then
+ :
+ else
+ echo "*** Could not run Ogg test program, checking why..."
+ CFLAGS="$CFLAGS $OGG_CFLAGS"
+ LIBS="$LIBS $OGG_LIBS"
+ AC_TRY_LINK([
+#include <stdio.h>
+#include <ogg/ogg.h>
+], [ return 0; ],
+ [ echo "*** The test program compiled, but did not run. This usually means"
+ echo "*** that the run-time linker is not finding Ogg or finding the wrong"
+ echo "*** version of Ogg. If it is not finding Ogg, 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 Ogg was incorrectly installed"
+ echo "*** or that you have moved Ogg since it was installed." ])
+ CFLAGS="$ac_save_CFLAGS"
+ LIBS="$ac_save_LIBS"
+ fi
+ OGG_CFLAGS=""
+ OGG_LIBS=""
+ ifelse([$2], , :, [$2])
+ fi
+ AC_SUBST(OGG_CFLAGS)
+ AC_SUBST(OGG_LIBS)
+ rm -f conf.oggtest
+])
diff --git a/m4/shout.m4 b/m4/shout.m4
new file mode 100644
index 000000000..9fad512e6
--- /dev/null
+++ b/m4/shout.m4
@@ -0,0 +1,79 @@
+dnl XIPH_PATH_SHOUT
+dnl Jack Moffitt <jack@icecast.org> 08-06-2001
+dnl Rewritten for libshout 2
+dnl Brendan Cully <brendan@xiph.org> 20030612
+dnl
+dnl $Id: shout.m4 7180 2004-07-20 02:50:54Z brendan $
+
+# XIPH_PATH_SHOUT([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
+# Test for libshout, and define SHOUT_CPPFLAGS SHOUT_CFLAGS SHOUT_LIBS, and
+# SHOUT_THREADSAFE
+AC_DEFUN([XIPH_PATH_SHOUT],
+[dnl
+xt_have_shout="no"
+SHOUT_THREADSAFE="no"
+SHOUT_CPPFLAGS=""
+SHOUT_CFLAGS=""
+SHOUT_LIBS=""
+
+# NB: PKG_CHECK_MODULES exits if pkg-config is unavailable on the target
+# system, so we can't use it.
+
+# seed pkg-config with the default libshout location
+PKG_CONFIG_PATH=${PKG_CONFIG_PATH:-/usr/local/lib/pkgconfig}
+export PKG_CONFIG_PATH
+
+# Step 1: Use pkg-config if available
+AC_PATH_PROG([PKGCONFIG], [pkg-config], [no])
+if test "$PKGCONFIG" != "no" && `$PKGCONFIG --exists shout`
+then
+ SHOUT_CFLAGS=`$PKGCONFIG --variable=cflags_only shout`
+ SHOUT_CPPFLAGS=`$PKGCONFIG --variable=cppflags shout`
+ SHOUT_LIBS=`$PKGCONFIG --libs shout`
+ xt_have_shout="maybe"
+else
+ if test "$PKGCONFIG" != "no"
+ then
+ AC_MSG_NOTICE([$PKGCONFIG couldn't find libshout. Try adjusting PKG_CONFIG_PATH.])
+ fi
+ # pkg-config unavailable, try shout-config
+ AC_PATH_PROG([SHOUTCONFIG], [shout-config], [no])
+ if test "$SHOUTCONFIG" != "no" && test `$SHOUTCONFIG --package` = "libshout"
+ then
+ SHOUT_CPPFLAGS=`$SHOUTCONFIG --cppflags`
+ SHOUT_CFLAGS=`$SHOUTCONFIG --cflags-only`
+ SHOUT_LIBS=`$SHOUTCONFIG --libs`
+ xt_have_shout="maybe"
+ fi
+fi
+
+# Now try actually using libshout
+if test "$xt_have_shout" != "no"
+then
+ ac_save_CPPFLAGS="$CPPFLAGS"
+ ac_save_CFLAGS="$CFLAGS"
+ ac_save_LIBS="$LIBS"
+ CPPFLAGS="$CPPFLAGS $SHOUT_CPPFLAGS"
+ CFLAGS="$CFLAGS $SHOUT_CFLAGS"
+ LIBS="$SHOUT_LIBS $LIBS"
+ AC_CHECK_HEADERS([shout/shout.h], [
+ AC_CHECK_FUNC([shout_new], [
+ ifelse([$1], , :, [$1])
+ xt_have_shout="yes"
+ ])
+ AC_EGREP_CPP([yes], [#include <shout/shout.h>
+#if SHOUT_THREADSAFE
+yes
+#endif
+], [SHOUT_THREADSAFE="yes"])
+ ])
+ CPPFLAGS="$ac_save_CPPFLAGS"
+ CFLAGS="$ac_save_CFLAGS"
+ LIBS="$ac_save_LIBS"
+fi
+
+if test "$xt_have_shout" != "yes"
+then
+ ifelse([$2], , :, [$2])
+fi
+])dnl XIPH_PATH_SHOUT
diff --git a/m4/vorbis.m4 b/m4/vorbis.m4
new file mode 100644
index 000000000..d311a410a
--- /dev/null
+++ b/m4/vorbis.m4
@@ -0,0 +1,122 @@
+# Configure paths for libvorbis
+# Jack Moffitt <jack@icecast.org> 10-21-2000
+# Shamelessly stolen from Owen Taylor and Manish Singh
+# thomasvs added check for vorbis_bitrate_addblock which is new in rc3
+
+dnl XIPH_PATH_VORBIS([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
+dnl Test for libvorbis, and define VORBIS_CFLAGS and VORBIS_LIBS
+dnl
+AC_DEFUN(XIPH_PATH_VORBIS,
+[dnl
+dnl Get the cflags and libraries
+dnl
+AC_ARG_WITH(vorbis,[ --with-vorbis=PFX Prefix where libvorbis is installed (optional)], vorbis_prefix="$withval", vorbis_prefix="")
+AC_ARG_WITH(vorbis-libraries,[ --with-vorbis-libraries=DIR Directory where libvorbis library is installed (optional)], vorbis_libraries="$withval", vorbis_libraries="")
+AC_ARG_WITH(vorbis-includes,[ --with-vorbis-includes=DIR Directory where libvorbis header files are installed (optional)], vorbis_includes="$withval", vorbis_includes="")
+AC_ARG_ENABLE(vorbistest, [ --disable-vorbistest Do not try to compile and run a test Vorbis program],, enable_vorbistest=yes)
+
+ if test "x$vorbis_libraries" != "x" ; then
+ VORBIS_LIBS="-L$vorbis_libraries"
+ elif test "x$vorbis_prefix" != "x" ; then
+ VORBIS_LIBS="-L$vorbis_prefix/lib"
+ elif test "x$prefix" != "xNONE"; then
+ VORBIS_LIBS="-L$prefix/lib"
+ fi
+
+ VORBIS_LIBS="$VORBIS_LIBS -lvorbis -lm"
+ VORBISFILE_LIBS="-lvorbisfile"
+ VORBISENC_LIBS="-lvorbisenc"
+
+ if test "x$vorbis_includes" != "x" ; then
+ VORBIS_CFLAGS="-I$vorbis_includes"
+ elif test "x$vorbis_prefix" != "x" ; then
+ VORBIS_CFLAGS="-I$vorbis_prefix/include"
+ elif test "x$prefix" != "xNONE"; then
+ VORBIS_CFLAGS="-I$prefix/include"
+ fi
+
+
+ AC_MSG_CHECKING(for Vorbis)
+ no_vorbis=""
+
+
+ if test "x$enable_vorbistest" = "xyes" ; then
+ ac_save_CFLAGS="$CFLAGS"
+ ac_save_LIBS="$LIBS"
+ CFLAGS="$CFLAGS $VORBIS_CFLAGS $OGG_CFLAGS"
+ LIBS="$LIBS $VORBIS_LIBS $VORBISENC_LIBS $OGG_LIBS"
+dnl
+dnl Now check if the installed Vorbis is sufficiently new.
+dnl
+ rm -f conf.vorbistest
+ AC_TRY_RUN([
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <vorbis/codec.h>
+#include <vorbis/vorbisenc.h>
+
+int main ()
+{
+ vorbis_block vb;
+ vorbis_dsp_state vd;
+ vorbis_info vi;
+
+ vorbis_info_init (&vi);
+ vorbis_encode_init (&vi, 2, 44100, -1, 128000, -1);
+ vorbis_analysis_init (&vd, &vi);
+ vorbis_block_init (&vd, &vb);
+ /* this function was added in 1.0rc3, so this is what we're testing for */
+ vorbis_bitrate_addblock (&vb);
+
+ system("touch conf.vorbistest");
+ return 0;
+}
+
+],, no_vorbis=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
+ CFLAGS="$ac_save_CFLAGS"
+ LIBS="$ac_save_LIBS"
+ fi
+
+ if test "x$no_vorbis" = "x" ; then
+ AC_MSG_RESULT(yes)
+ ifelse([$1], , :, [$1])
+ else
+ AC_MSG_RESULT(no)
+ if test -f conf.vorbistest ; then
+ :
+ else
+ echo "*** Could not run Vorbis test program, checking why..."
+ CFLAGS="$CFLAGS $VORBIS_CFLAGS"
+ LIBS="$LIBS $VORBIS_LIBS $OGG_LIBS"
+ AC_TRY_LINK([
+#include <stdio.h>
+#include <vorbis/codec.h>
+], [ return 0; ],
+ [ echo "*** The test program compiled, but did not run. This usually means"
+ echo "*** that the run-time linker is not finding Vorbis or finding the wrong"
+ echo "*** version of Vorbis. If it is not finding Vorbis, 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 Vorbis was incorrectly installed"
+ echo "*** or that you have moved Vorbis since it was installed." ])
+ CFLAGS="$ac_save_CFLAGS"
+ LIBS="$ac_save_LIBS"
+ fi
+ VORBIS_CFLAGS=""
+ VORBIS_LIBS=""
+ VORBISFILE_LIBS=""
+ VORBISENC_LIBS=""
+ ifelse([$2], , :, [$2])
+ fi
+ AC_SUBST(VORBIS_CFLAGS)
+ AC_SUBST(VORBIS_LIBS)
+ AC_SUBST(VORBISFILE_LIBS)
+ AC_SUBST(VORBISENC_LIBS)
+ rm -f conf.vorbistest
+])