1 # Configure paths for Tremor
3 dnl XIPH_PATH_IVORBIS([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
4 dnl Test for libivorbis, and define IVORBIS_CFLAGS and IVORBIS_LIBS
6 AC_DEFUN([XIPH_PATH_IVORBIS],
8 dnl Get the cflags and libraries
10 AC_ARG_WITH(ivorbis,[ --with-ivorbis=PFX Prefix where libivorbis is installed (optional)], ivorbis_prefix="$withval", ivorbis_prefix="")
11 AC_ARG_WITH(ivorbis-libraries,[ --with-ivorbis-libraries=DIR Directory where libivorbis library is installed (optional)], ivorbis_libraries="$withval", ivorbis_libraries="")
12 AC_ARG_WITH(ivorbis-includes,[ --with-ivorbis-includes=DIR Directory where libivorbis header files are installed (optional)], ivorbis_includes="$withval", ivorbis_includes="")
13 AC_ARG_ENABLE(ivorbistest, [ --disable-ivorbistest Do not try to compile and run a test Ivorbis program],, enable_ivorbistest=yes)
15 if test "x$ivorbis_libraries" != "x" ; then
16 IVORBIS_LIBS="-L$ivorbis_libraries"
17 elif test "x$ivorbis_prefix" != "x" ; then
18 IVORBIS_LIBS="-L$ivorbis_prefix/lib"
19 elif test "x$prefix" != "xNONE"; then
20 IVORBIS_LIBS="-L$prefix/lib"
23 IVORBIS_LIBS="$IVORBIS_LIBS -lvorbisidec -lm"
25 if test "x$ivorbis_includes" != "x" ; then
26 IVORBIS_CFLAGS="-I$ivorbis_includes"
27 elif test "x$ivorbis_prefix" != "x" ; then
28 IVORBIS_CFLAGS="-I$ivorbis_prefix/include"
29 elif test "x$prefix" != "xNONE"; then
30 IVORBIS_CFLAGS="-I$prefix/include"
33 AC_MSG_CHECKING(for Tremor)
36 if test "x$enable_ivorbistest" = "xyes" ; then
37 ac_save_CFLAGS="$CFLAGS"
39 CFLAGS="$CFLAGS $IVORBIS_CFLAGS $OGG_CFLAGS"
40 LIBS="$LIBS $IVORBIS_LIBS $OGG_LIBS"
42 dnl Now check if the installed Tremor is sufficiently new.
44 rm -f conf.ivorbistest
49 #include <tremor/codec.h>
51 CFLAGS="$ac_save_CFLAGS"
55 if test "x$no_ivorbis" = "x" ; then
57 ifelse([$1], , :, [$1])
63 ifelse([$2], , :, [$2])
65 AC_SUBST(IVORBIS_CFLAGS)
66 AC_SUBST(IVORBIS_LIBS)
67 AC_SUBST(IVORBISFILE_LIBS)