1
0
mirror of https://gitlab.xiph.org/xiph/icecast-server.git synced 2024-12-04 14:46:30 -05:00

update macros

svn path=/icecast/trunk/m4/; revision=8320
This commit is contained in:
Karl Heyes 2004-11-30 20:36:09 +00:00
parent a521d15d74
commit 3af3d7f559
6 changed files with 69 additions and 49 deletions

View File

@ -11,10 +11,10 @@ AC_DEFUN([XIPH_PATH_OGG],
AC_ARG_VAR([OGG_PREFIX],[path to ogg installation])
AC_ARG_WITH(ogg,
[AC_HELP_STRING([--with-ogg=PREFIX],
[Prefix where libogg is installed (optional)])],
[Prefix where libogg is installed (optional)])],
ogg_prefix="$withval",
ogg_prefix="$OGG_PREFIX"
)
)
if test "x$ogg_prefix" = "x"; then
if test "x$prefix" = "xNONE"; then
ogg_prefix=/usr/local
@ -24,15 +24,16 @@ if test "x$ogg_prefix" = "x"; then
fi
XIPH_GCC_WARNING([-I$ogg_prefix/include],,
[OGG_CFLAGS="-I$ogg_prefix/include"
OGG_LDFLAGS="-L$ogg_prefix/lib"
])
[ 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_MSG_CHECKING([for ogg_sync_init in libogg])
ac_save_CFLAGS="$CFLAGS"
ac_save_LIBS="$LIBS"
ac_save_LDFLAGS="$LDFLAGS"
@ -40,16 +41,25 @@ CFLAGS="$CFLAGS $OGG_CFLAGS"
LIBS="$LIBS $OGG_LIBS"
LDFLAGS="$LDFLAGS $OGG_LDFLAGS"
AC_TRY_LINK_FUNC(ogg_sync_init,
[ifelse([$1],, [AC_MSG_RESULT([ok])], [$1])],
[AC_TRY_LINK([#include <ogg/ogg.h>],,
[ ifelse([$2], ,[AC_MSG_ERROR([found, but needs updating])], [$2])],
[ ifelse([$2], ,[AC_MSG_ERROR([not found, maybe you need to set LD_LIBRARY_PATH or /etc/ld.so.conf])], [$2])])
])
[ 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)
AC_SUBST(OGG_LIBS)
])

View File

@ -8,7 +8,7 @@ dnl
AC_DEFUN([XIPH_PATH_SPEEX],
[
XIPH_PATH_OGG([$1],[$2])
AC_REQUIRE([XIPH_PATH_OGG])
dnl Get the cflags and libraries for speex
dnl
@ -70,6 +70,7 @@ else
then
AC_MSG_RESULT([ok])
AC_DEFINE([HAVE_SPEEX],[1],[Define if Speex support is available])
$1
else
ifelse([$2], , AC_MSG_ERROR([Unable to link to libspeex]), [$2])
SPEEX_CFLAGS=""

View File

@ -7,7 +7,7 @@ dnl
AC_DEFUN([XIPH_PATH_THEORA],
[
XIPH_PATH_OGG([$1],[$2])
AC_REQUIRE([XIPH_PATH_OGG])
dnl Get the cflags and libraries for theora
dnl
@ -40,20 +40,17 @@ else
])
fi
THEORA_LIBS="-ltheora"
THEORA_LIBS="-ltheora -logg"
ac_save_LIBS="$LIBS"
ac_save_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS $THEORA_LDFLAGS"
LIBS="$LIBS $THEORA_LIBS"
xt_have_theora="yes"
AC_MSG_CHECKING([for libtheora])
AC_TRY_LINK_FUNC(ogg_stream_init, [AC_MSG_RESULT([ok])],
[LIBS="$LIBS $OGG_LIBS"
AC_TRY_LINK_FUNC(ogg_stream_init,
[THEORA_LIBS="$THEORA_LIBS $OGG_LIBS"],
[xt_have_theora="no"])
])
AC_TRY_LINK_FUNC(theora_decode_header, [xt_have_theora="yes"],
[xt_have_theora="Not found"])
AC_TRY_LINK_FUNC(theora_decode_header, [xt_have_theora="yes"],
[xt_have_theora="old version"])
LIBS="$ac_save_LIBS"
LDFLAGS="$ac_save_LDFLAGS"
@ -62,14 +59,16 @@ else
then
AC_MSG_RESULT([ok])
AC_DEFINE([HAVE_THEORA],[1],[Define if Theora support is available])
$1
else
ifelse([$2], , AC_MSG_ERROR([Unable to link to libtheora]), [$2])
THEORA_CFLAGS=""
THEORA_LDFLAGS=""
THEORA_LIBS=""
AC_MSG_WARN([$xt_have_theora])
$2
fi
AC_SUBST(THEORA_CFLAGS)
AC_SUBST(THEORA_LDFLAGS)
AC_SUBST(THEORA_LIBS)
fi
AC_SUBST(THEORA_CFLAGS)
AC_SUBST(THEORA_LDFLAGS)
AC_SUBST(THEORA_LIBS)
])

View File

@ -9,8 +9,8 @@ dnl VORBIS_VORBISENC_LIBS VORBIS_VORBISFILE_LIBS VORBIS_LDFLAGS
dnl
AC_DEFUN([XIPH_PATH_VORBIS],
[
XIPH_PATH_OGG([$1],[$2])
[dnl
AC_REQUIRE([XIPH_PATH_OGG])
dnl Get the cflags and libraries for vorbis
dnl
@ -42,38 +42,47 @@ VORBIS_LIBS="-lvorbis"
VORBISFILE_LIBS="-lvorbisfile"
VORBISENC_LIBS="-lvorbisenc"
ac_save_LIBS="$LIBS"
ac_save_LDFLAGS="$LDFLAGS"
xt_save_LIBS="$LIBS"
xt_save_LDFLAGS="$LDFLAGS"
xt_save_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $VORBIS_CFLAGS"
LDFLAGS="$LDFLAGS $VORBIS_LDFLAGS"
LIBS="$LIBS $VORBIS_LIBS"
xt_lib_vorbis="not found"
AC_MSG_CHECKING([for libvorbis])
AC_TRY_LINK_FUNC(ogg_stream_init, [AC_MSG_RESULT([ok])],
AC_TRY_LINK_FUNC(ogg_stream_init, [xt_lib_vorbis=ok],
[LIBS="$LIBS $OGG_LIBS -lm"
AC_TRY_LINK_FUNC(vorbis_info_init,
[AC_MSG_RESULT([found, adding extra libs])
[xt_lib_vorbis=ok
VORBIS_LIBS="$VORBIS_LIBS $OGG_LIBS -lm"],
[ifelse([$2], , AC_MSG_ERROR([Unable to link to libvorbis]), [$2])
])
)
])
LIBS="$ac_save_LIBS"
LDFLAGS="$ac_save_LDFLAGS"
AC_MSG_RESULT([$xt_lib_vorbis])
if test "x$xt_lib_vorbis" = "xok"; then
#
# Now check if the installed Vorbis is sufficiently new.
#
ac_save_CFLAGS="$CFLAGS"
ac_save_LIBS="$LIBS"
CFLAGS="$CFLAGS $VORBIS_CFLAGS"
LIBS="$LIBS $VORBIS_LDFLAGS $VORBIS_LIBS"
AC_CHECK_TYPES([struct ovectl_ratemanage_arg],[vorbis_ok=yes],
[ifelse([$2], ,[AC_MSG_ERROR([libvorbis needs updating])], [$2])], [
AC_CHECK_TYPES([struct ovectl_ratemanage_arg],,
[xt_lib_vorbis="old version found"], [
#include <vorbis/codec.h>
#include <vorbis/vorbisenc.h>
])
CFLAGS="$ac_save_CFLAGS"
LIBS="$ac_save_LIBS"
fi
CPPFLAGS="$xt_save_CPPFLAGS"
LIBS="$xt_save_LIBS"
LDFLAGS="$xt_save_LDFLAGS"
if test "x$xt_lib_vorbis" = "xok"; then
ifelse([$1], ,[:], [$1])
else
VORBIS_CFLAGS=""
VORBIS_LDFLAGS=""
VORBIS_LIBS=""
VORBISFILE_LIBS=""
VORBISENC_LIBS=""
ifelse([$2], ,, [$2])
fi
AC_SUBST(VORBIS_CFLAGS)
AC_SUBST(VORBIS_LDFLAGS)
AC_SUBST(VORBIS_LIBS)

View File

@ -34,7 +34,8 @@ AC_DEFUN([XIPH_C_ATTRIBUTE],
[dnl
AC_TRY_COMPILE([int func(void) __attribute__((unused));],
[int x __attribute__ ((unused));],,[dnl
AC_DEFINE([__attribute__(x)],, [Define to empty if __attribute__ is not supported])
AH_TEMPLATE([__attribute__],[Define to empty if __attribute__ is not supported])
AC_DEFINE([__attribute__(x)],[])
])
])dnl XIPH_C_ATTRIBUTE

View File

@ -52,7 +52,7 @@ ac_xslt_save_LIBS="$LIBS"
ac_xslt_save_CFLAGS="$CFLAGS"
LIBS="$XSLT_LIBS $LIBS"
CFLAGS="$CFLAGS $XSLT_CFLAGS"
AC_CHECK_FUNC(xsltParseStylesheetFile,,[AC_MSG_ERROR([Unable to link with libxslt])])
AC_CHECK_FUNC(xsltSaveResultToString,,[AC_MSG_ERROR([Unable to link with libxslt (>=v1.0.18)])])
CFLAGS="$ac_xslt_save_CFLAGS"
LIBS="$ac_xslt_save_LIBS"
])