mirror of
https://gitlab.xiph.org/xiph/icecast-server.git
synced 2025-01-03 14:56:34 -05:00
update library check
svn path=/icecast/trunk/m4/; revision=7605
This commit is contained in:
parent
ac73dff07a
commit
4f2c1d8d3d
103
m4/speex.m4
103
m4/speex.m4
@ -19,52 +19,65 @@ AC_ARG_WITH(speex,
|
|||||||
speex_prefix="$withval",
|
speex_prefix="$withval",
|
||||||
speex_prefix="$SPEEX_PREFIX"
|
speex_prefix="$SPEEX_PREFIX"
|
||||||
)
|
)
|
||||||
if test "x$speex_prefix" = "x"; then
|
if test "x$with_speex" = "xno"
|
||||||
if test "x$prefix" = "xNONE"; then
|
|
||||||
speex_prefix="/usr/local"
|
|
||||||
else
|
|
||||||
speex_prefix="$prefix"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
SPEEX_CFLAGS="$OGG_CFLAGS"
|
|
||||||
SPEEX_LDFLAGS="$OGG_LDFLAGS"
|
|
||||||
if test "x$speex_prefix" != "x$ogg_prefix"; then
|
|
||||||
XIPH_GCC_WARNING(-I"$speex_prefix/include",,
|
|
||||||
[SPEEX_CFLAGS="$SPEEX_CFLAGS -I$speex_prefix/include"
|
|
||||||
SPEEX_LDFLAGS="-L$speex_prefix/lib $SPEEX_LDFLAGS"
|
|
||||||
])
|
|
||||||
fi
|
|
||||||
|
|
||||||
SPEEX_LIBS="-lspeex"
|
|
||||||
|
|
||||||
ac_save_LIBS="$LIBS"
|
|
||||||
ac_save_LDFLAGS="$LDFLAGS"
|
|
||||||
LDFLAGS="$LDFLAGS $SPEEX_LDFLAGS"
|
|
||||||
LIBS="$LIBS $SPEEX_LIBS"
|
|
||||||
xt_have_speex="yes"
|
|
||||||
AC_MSG_CHECKING([for libspeex])
|
|
||||||
AC_TRY_LINK_FUNC(ogg_stream_init, [AC_MSG_RESULT([ok])],
|
|
||||||
[LIBS="$LIBS $OGG_LIBS"
|
|
||||||
AC_TRY_LINK_FUNC(ogg_stream_init,
|
|
||||||
[SPEEX_LIBS="$SPEEX_LIBS $OGG_LIBS"],
|
|
||||||
[xt_have_speex="no"])
|
|
||||||
])
|
|
||||||
|
|
||||||
LIBS="$ac_save_LIBS"
|
|
||||||
LDFLAGS="$ac_save_LDFLAGS"
|
|
||||||
|
|
||||||
if test "x$xt_have_speex" = "xyes"
|
|
||||||
then
|
then
|
||||||
AC_MSG_RESULT([ok])
|
AC_MSG_RESULT([Speex support disabled by request])
|
||||||
AC_DEFINE([HAVE_SPEEX],[1],[Define if Speex support is available])
|
|
||||||
else
|
else
|
||||||
ifelse([$2], , AC_MSG_ERROR([Unable to link to libspeex]), [$2])
|
if test "x$speex_prefix" = "x"; then
|
||||||
SPEEX_CFLAGS=""
|
if test "x$prefix" = "xNONE"; then
|
||||||
SPEEX_LDFLAGS=""
|
speex_prefix="/usr/local"
|
||||||
SPEEX_LIBS=""
|
else
|
||||||
|
speex_prefix="$prefix"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
SPEEX_CFLAGS="$OGG_CFLAGS"
|
||||||
|
SPEEX_LDFLAGS="$OGG_LDFLAGS"
|
||||||
|
if test "x$speex_prefix" != "x$ogg_prefix"; then
|
||||||
|
XIPH_GCC_WARNING(-I"$speex_prefix/include",,
|
||||||
|
[SPEEX_CFLAGS="$SPEEX_CFLAGS -I$speex_prefix/include"
|
||||||
|
SPEEX_LDFLAGS="-L$speex_prefix/lib $SPEEX_LDFLAGS"
|
||||||
|
])
|
||||||
|
fi
|
||||||
|
|
||||||
|
SPEEX_LIBS="-lspeex"
|
||||||
|
|
||||||
|
xt_save_LIBS="$LIBS"
|
||||||
|
xt_save_LDFLAGS="$LDFLAGS"
|
||||||
|
LDFLAGS="$LDFLAGS $SPEEX_LDFLAGS"
|
||||||
|
LIBS="$LIBS $SPEEX_LIBS"
|
||||||
|
xt_have_speex="yes"
|
||||||
|
AC_MSG_CHECKING([for libspeex])
|
||||||
|
AC_TRY_LINK_FUNC(ogg_stream_init, [AC_MSG_RESULT([ok])],
|
||||||
|
[LIBS="$LIBS $OGG_LIBS"
|
||||||
|
AC_TRY_LINK_FUNC(ogg_stream_init,
|
||||||
|
[SPEEX_LIBS="$SPEEX_LIBS $OGG_LIBS"],
|
||||||
|
[xt_have_speex="no"])
|
||||||
|
])
|
||||||
|
if test "x$xt_have_speex" = "xyes"
|
||||||
|
then
|
||||||
|
AC_LINK_IFELSE([AC_LANG_PROGRAM(
|
||||||
|
[#include <speex/speex_header.h>],
|
||||||
|
[void *p = speex_packet_to_header;])],
|
||||||
|
[],
|
||||||
|
[xt_have_speex="no"])
|
||||||
|
fi
|
||||||
|
|
||||||
|
LIBS="$xt_save_LIBS"
|
||||||
|
LDFLAGS="$xt_save_LDFLAGS"
|
||||||
|
|
||||||
|
if test "x$xt_have_speex" = "xyes"
|
||||||
|
then
|
||||||
|
AC_MSG_RESULT([ok])
|
||||||
|
AC_DEFINE([HAVE_SPEEX],[1],[Define if Speex support is available])
|
||||||
|
else
|
||||||
|
ifelse([$2], , AC_MSG_ERROR([Unable to link to libspeex]), [$2])
|
||||||
|
SPEEX_CFLAGS=""
|
||||||
|
SPEEX_LDFLAGS=""
|
||||||
|
SPEEX_LIBS=""
|
||||||
|
fi
|
||||||
|
AC_SUBST(SPEEX_CFLAGS)
|
||||||
|
AC_SUBST(SPEEX_LDFLAGS)
|
||||||
|
AC_SUBST(SPEEX_LIBS)
|
||||||
fi
|
fi
|
||||||
AC_SUBST(SPEEX_CFLAGS)
|
|
||||||
AC_SUBST(SPEEX_LDFLAGS)
|
|
||||||
AC_SUBST(SPEEX_LIBS)
|
|
||||||
])
|
])
|
||||||
|
Loading…
Reference in New Issue
Block a user