Blame m4/theora.m4

Packit eed494
# Configure paths for libtheora
Packit eed494
# Karl Heyes 02-Feb-2004
Packit eed494
Packit eed494
dnl XIPH_PATH_THEORA([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
Packit eed494
dnl Test for libtheora, and define THEORA_CFLAGS THEORA_LIBS
Packit eed494
dnl
Packit eed494
Packit eed494
AC_DEFUN([XIPH_PATH_THEORA],
Packit eed494
[
Packit eed494
AC_REQUIRE([XIPH_PATH_OGG])
Packit eed494
Packit eed494
dnl Get the cflags and libraries for theora
Packit eed494
dnl
Packit eed494
AC_ARG_VAR([THEORA],[path to theora installation])
Packit eed494
AC_ARG_WITH(theora,
Packit eed494
    AC_HELP_STRING([--with-theora=PREFIX],
Packit eed494
        [Prefix where libtheora is installed (optional)]),
Packit eed494
    theora_prefix="$withval",
Packit eed494
    theora_prefix="$THEORA_PREFIX"
Packit eed494
    )
Packit eed494
Packit eed494
if test "x$with_theora" = "xno"
Packit eed494
then
Packit eed494
  AC_MSG_RESULT([Theora support disabled by request])
Packit eed494
else
Packit eed494
  if test "x$theora_prefix" = "x" -o "x$theora_prefix" = "xyes"; then
Packit eed494
    if test "x$prefix" = "xNONE"; then
Packit eed494
        theora_prefix="/usr/local"
Packit eed494
    else
Packit eed494
        theora_prefix="$prefix"
Packit eed494
    fi
Packit eed494
  fi
Packit eed494
Packit eed494
  THEORA_CFLAGS="$OGG_CFLAGS"
Packit eed494
  THEORA_LDFLAGS="$OGG_LDFLAGS"
Packit eed494
  if test "x$theora_prefix" != "x$ogg_prefix"; then
Packit eed494
      XIPH_GCC_WARNING(-I"$theora_prefix/include",,
Packit eed494
              [THEORA_CFLAGS="$THEORA_CFLAGS -I$theora_prefix/include"
Packit eed494
              THEORA_LDFLAGS="-L$theora_prefix/lib $THEORA_LDFLAGS"
Packit eed494
              ])
Packit eed494
  fi
Packit eed494
Packit eed494
  THEORA_LIBS="-ltheora -logg"
Packit eed494
Packit eed494
  ac_save_LIBS="$LIBS"
Packit eed494
  ac_save_LDFLAGS="$LDFLAGS"
Packit eed494
  LDFLAGS="$LDFLAGS $THEORA_LDFLAGS"
Packit eed494
  LIBS="$LIBS $THEORA_LIBS"
Packit eed494
  AC_MSG_CHECKING([for libtheora])
Packit eed494
  AC_TRY_LINK_FUNC(theora_decode_header, [xt_have_theora="yes"],
Packit eed494
          [xt_have_theora="Not found"])
Packit eed494
  if test "x$xt_have_theora" = "xyes"
Packit eed494
  then
Packit eed494
    AC_TRY_LINK_FUNC(theora_packet_isheader, [xt_have_theora="yes"],
Packit eed494
          [xt_have_theora="newer version required"])
Packit eed494
  fi
Packit eed494
Packit eed494
  LIBS="$ac_save_LIBS"
Packit eed494
  LDFLAGS="$ac_save_LDFLAGS"
Packit eed494
Packit eed494
  if test "x$xt_have_theora" = "xyes"
Packit eed494
  then
Packit eed494
    AC_MSG_RESULT([ok])
Packit eed494
    AC_DEFINE([HAVE_THEORA],[1],[Define if Theora support is available])
Packit eed494
    $1
Packit eed494
  else
Packit eed494
    THEORA_CFLAGS=""
Packit eed494
    THEORA_LDFLAGS=""
Packit eed494
    THEORA_LIBS=""
Packit eed494
    AC_MSG_RESULT([$xt_have_theora])
Packit eed494
    $2
Packit eed494
  fi
Packit eed494
fi
Packit eed494
AC_SUBST(THEORA_CFLAGS)
Packit eed494
AC_SUBST(THEORA_LDFLAGS)
Packit eed494
AC_SUBST(THEORA_LIBS)
Packit eed494
])