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>
55 ],, no_ivorbis=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
56 CFLAGS="$ac_save_CFLAGS"
60 if test "x$no_ivorbis" = "x" ; then
62 ifelse([$1], , :, [$1])
68 ifelse([$2], , :, [$2])
70 AC_SUBST(IVORBIS_CFLAGS)
71 AC_SUBST(IVORBIS_LIBS)
72 AC_SUBST(IVORBISFILE_LIBS)