1
0
mirror of https://gitlab.xiph.org/xiph/ezstream.git synced 2024-11-03 04:17:18 -05:00
ezstream/m4/ogg.m4
moritz 678e161e54 Unbreak "make distcheck": $prefix is not a good default, use /usr/local instead.
This makes it more likely that installed libogg and libvorbis are found, when
the user (or autoconf) specifies a different --prefix. Users who installed
their libraries in their homedir now have to set $OGG_PREFIX and $VORBIS_PREFIX,
or set their respective --with arguments.
Let the snapshot target use distcheck now that it works.


git-svn-id: https://svn.xiph.org/trunk/ezstream@12570 0101bb08-14d6-0310-b084-bc0e0c8e3800
2007-02-26 15:28:50 +00:00

70 lines
1.7 KiB
Plaintext

# Configure paths for libogg
# updated by Karl Heyes 10-Jun-2003
# 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]])
dnl Test for libogg, and define OGG_CFLAGS OGG_LDFLAGS and OGG_LIBS
dnl
AC_DEFUN([XIPH_PATH_OGG],
[dnl
AC_ARG_VAR([OGG_PREFIX],[path to Ogg installation])
AC_ARG_WITH(ogg,
[AS_HELP_STRING([--with-ogg=PREFIX],
[Prefix where libogg is installed (optional)])],
[ogg_prefix="$withval"], [
if test x"$OGG_PREFIX" != "x"; then
ogg_prefix="$OGG_PREFIX"
else
ogg_prefix=/usr/local
fi
])
if test "x$ogg_prefix" = "xyes"; then
if test "x$prefix" = "xNONE"; then
ogg_prefix=/usr/local
else
ogg_prefix="$prefix"
fi
fi
XIPH_GCC_WARNING([-I$ogg_prefix/include],,
[ OGG_CFLAGS="-I$ogg_prefix/include"
OGG_LDFLAGS="-L$ogg_prefix/lib"
])
AC_CACHE_CHECK([for libogg], xt_cv_lib_ogg,
[dnl
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,
[ 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" ])
])
CFLAGS="$ac_save_CFLAGS"
LDFLAGS="$ac_save_LDFLAGS"
LIBS="$ac_save_LIBS"
])
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)
AC_SUBST(OGG_CFLAGS)
AC_SUBST(OGG_LDFLAGS)
])