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