summaryrefslogtreecommitdiff
path: root/m4/vorbis.m4
diff options
context:
space:
mode:
authorDaniel Caujolle-Bert <f1rmb@users.sourceforge.net>2001-10-07 20:10:45 +0000
committerDaniel Caujolle-Bert <f1rmb@users.sourceforge.net>2001-10-07 20:10:45 +0000
commit19b84cd45f5be52401edae5852df4c889e832979 (patch)
treec4caa6e58b1fade69f7ae4f5f92b5e15c2470b04 /m4/vorbis.m4
parentfd99af790c0f3fe36373553870a301c39e34bf12 (diff)
downloadxine-lib-19b84cd45f5be52401edae5852df4c889e832979.tar.gz
xine-lib-19b84cd45f5be52401edae5852df4c889e832979.tar.bz2
Add ogg/vorbis checks. Change divxdecore checks.
CVS patchset: 760 CVS date: 2001/10/07 20:10:45
Diffstat (limited to 'm4/vorbis.m4')
-rw-r--r--m4/vorbis.m496
1 files changed, 96 insertions, 0 deletions
diff --git a/m4/vorbis.m4 b/m4/vorbis.m4
new file mode 100644
index 000000000..0cc4c3c2e
--- /dev/null
+++ b/m4/vorbis.m4
@@ -0,0 +1,96 @@
+# Configure paths for libvorbis
+# Jack Moffitt <jack@icecast.org> 10-21-2000
+# Shamelessly stolen from Owen Taylor and Manish Singh
+
+dnl AM_PATH_VORBIS([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
+dnl Test for libvorbis, and define VORBIS_CFLAGS and VORBIS_LIBS
+dnl
+AC_DEFUN(AM_PATH_VORBIS,
+[dnl
+dnl Get the cflags and libraries
+dnl
+AC_ARG_WITH(vorbis-prefix,[ --with-vorbis-prefix=PFX Prefix where libvorbis is installed (optional)], vorbis_prefix="$withval", vorbis_prefix="")
+AC_ARG_ENABLE(vorbistest, [ --disable-vorbistest Do not try to compile and run a test Vorbis program],, enable_vorbistest=yes)
+
+ if test x$vorbis_prefix != x ; then
+ vorbis_args="$vorbis_args --prefix=$vorbis_prefix"
+ VORBIS_CFLAGS="-I$vorbis_prefix/include"
+ VORBIS_LIBDIR="-L$vorbis_prefix/lib"
+ fi
+
+ VORBIS_LIBS="$VORBIS_LIBDIR -lvorbis -lm"
+ VORBISFILE_LIBS="-lvorbisfile"
+ VORBISENC_LIBS="-lvorbisenc"
+
+ 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"
+ LIBS="$LIBS $VORBIS_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>
+
+int main ()
+{
+ 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
+])