2003-03-07 18:57:43 -05:00
|
|
|
# Configure paths for libogg
|
2003-06-17 23:55:41 -04:00
|
|
|
# updated by Karl Heyes 10-Jun-2003
|
2003-03-07 18:57:43 -05:00
|
|
|
# Jack Moffitt <jack@icecast.org> 10-21-2000
|
|
|
|
# Shamelessly stolen from Owen Taylor and Manish Singh
|
|
|
|
|
|
|
|
dnl XIPH_PATH_OGG([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
|
2003-06-17 23:55:41 -04:00
|
|
|
dnl Test for libogg, and define OGG_CFLAGS OGG_LDFLAGS and OGG_LIBS
|
2003-03-07 18:57:43 -05:00
|
|
|
dnl
|
2004-01-26 02:48:39 -05:00
|
|
|
AC_DEFUN([XIPH_PATH_OGG],
|
2003-03-07 18:57:43 -05:00
|
|
|
[dnl
|
2003-06-17 23:55:41 -04:00
|
|
|
AC_ARG_VAR([OGG_PREFIX],[path to ogg installation])
|
|
|
|
AC_ARG_WITH(ogg,
|
|
|
|
[AC_HELP_STRING([--with-ogg=PREFIX],
|
2004-11-30 15:36:09 -05:00
|
|
|
[Prefix where libogg is installed (optional)])],
|
2003-06-17 23:55:41 -04:00
|
|
|
ogg_prefix="$withval",
|
|
|
|
ogg_prefix="$OGG_PREFIX"
|
2004-11-30 15:36:09 -05:00
|
|
|
)
|
2003-06-17 23:55:41 -04:00
|
|
|
if test "x$ogg_prefix" = "x"; then
|
|
|
|
if test "x$prefix" = "xNONE"; then
|
|
|
|
ogg_prefix=/usr/local
|
|
|
|
else
|
|
|
|
ogg_prefix="$prefix"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2003-06-26 12:03:37 -04:00
|
|
|
XIPH_GCC_WARNING([-I$ogg_prefix/include],,
|
2004-11-30 15:36:09 -05:00
|
|
|
[ OGG_CFLAGS="-I$ogg_prefix/include"
|
|
|
|
OGG_LDFLAGS="-L$ogg_prefix/lib"
|
|
|
|
])
|
|
|
|
AC_CACHE_CHECK([for libogg], xt_cv_lib_ogg,
|
|
|
|
[dnl
|
2003-06-17 23:55:41 -04:00
|
|
|
OGG_LIBS="-logg"
|
|
|
|
|
|
|
|
#
|
|
|
|
# check if the installed Ogg is sufficiently new.
|
|
|
|
#
|
|
|
|
ac_save_CFLAGS="$CFLAGS"
|
|
|
|
ac_save_LIBS="$LIBS"
|
|
|
|
ac_save_LDFLAGS="$LDFLAGS"
|
|
|
|
CFLAGS="$CFLAGS $OGG_CFLAGS"
|
|
|
|
LIBS="$LIBS $OGG_LIBS"
|
|
|
|
LDFLAGS="$LDFLAGS $OGG_LDFLAGS"
|
|
|
|
AC_TRY_LINK_FUNC(ogg_sync_init,
|
2004-11-30 15:36:09 -05:00
|
|
|
[ xt_cv_lib_ogg=ok ],
|
|
|
|
[ AC_TRY_LINK([#include <ogg/ogg.h>],,
|
|
|
|
[ xt_cv_lib_ogg="pre v1.0, needs updating" ],
|
|
|
|
[ xt_cv_lib_ogg="not found" ])
|
|
|
|
])
|
2003-06-17 23:55:41 -04:00
|
|
|
CFLAGS="$ac_save_CFLAGS"
|
2003-07-08 10:32:03 -04:00
|
|
|
LDFLAGS="$ac_save_LDFLAGS"
|
2003-06-17 23:55:41 -04:00
|
|
|
LIBS="$ac_save_LIBS"
|
2004-11-30 15:36:09 -05:00
|
|
|
])
|
|
|
|
if test "x$xt_cv_lib_ogg" = "xok"; then
|
|
|
|
ifelse([$1],,,[$1])
|
|
|
|
AC_DEFINE([HAVE_OGG], [1], [Define if you have libogg installed])
|
|
|
|
else
|
|
|
|
OGG_LIBS=""
|
|
|
|
OGG_CFLAGS=""
|
|
|
|
OGG_LDFLAGS=""
|
|
|
|
ifelse([$2],,,[$2])
|
|
|
|
fi
|
|
|
|
AC_SUBST(OGG_LIBS)
|
2003-06-17 23:55:41 -04:00
|
|
|
AC_SUBST(OGG_CFLAGS)
|
|
|
|
AC_SUBST(OGG_LDFLAGS)
|
2003-03-07 18:57:43 -05:00
|
|
|
])
|