Revert "[baseaudiosink] add docs for can-activate-pull"
[platform/upstream/gstreamer.git] / m4 / gst-ivorbis.m4
1 # Configure paths for Tremor
2
3 dnl XIPH_PATH_IVORBIS([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
4 dnl Test for libivorbis, and define IVORBIS_CFLAGS and IVORBIS_LIBS
5 dnl
6 AC_DEFUN([XIPH_PATH_IVORBIS],
7 [dnl 
8 dnl Get the cflags and libraries
9 dnl
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)
14
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"
21   fi
22
23   IVORBIS_LIBS="$IVORBIS_LIBS -lvorbisidec -lm"
24
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"
31   fi
32
33   AC_MSG_CHECKING(for Tremor)
34   no_ivorbis=""
35
36   if test "x$enable_ivorbistest" = "xyes" ; then
37     ac_save_CFLAGS="$CFLAGS"
38     ac_save_LIBS="$LIBS"
39     CFLAGS="$CFLAGS $IVORBIS_CFLAGS $OGG_CFLAGS"
40     LIBS="$LIBS $IVORBIS_LIBS $OGG_LIBS"
41 dnl
42 dnl Now check if the installed Tremor is sufficiently new.
43 dnl
44       rm -f conf.ivorbistest
45       AC_TRY_COMPILE([
46 #include <stdio.h>
47 #include <stdlib.h>
48 #include <string.h>
49 #include <tremor/codec.h>
50 ],,, no_ivorbis=yes)
51        CFLAGS="$ac_save_CFLAGS"
52        LIBS="$ac_save_LIBS"
53   fi
54
55   if test "x$no_ivorbis" = "x" ; then
56      AC_MSG_RESULT(yes)
57      ifelse([$1], , :, [$1])     
58   else
59      AC_MSG_RESULT(no)
60      IVORBIS_CFLAGS=""
61      IVORBIS_LIBS=""
62      IVORBISFILE_LIBS=""
63      ifelse([$2], , :, [$2])
64   fi
65   AC_SUBST(IVORBIS_CFLAGS)
66   AC_SUBST(IVORBIS_LIBS)
67   AC_SUBST(IVORBISFILE_LIBS)
68 ])