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

Unbreak the TagLib checks.

git-svn-id: https://svn.xiph.org/trunk/ezstream@15777 0101bb08-14d6-0310-b084-bc0e0c8e3800
This commit is contained in:
moritz 2009-03-16 00:40:26 +00:00
parent 9acbffc2dd
commit 10d883fa98
2 changed files with 84 additions and 31 deletions

View File

@ -162,11 +162,12 @@ AX_UNIQVAR_APPEND([EZ_LDFLAGS], [${LIBXML2_LDFLAGS}])
AX_UNIQVAR_PREPEND([EZ_LIBS], [${LIBXML2_LIBS}]) AX_UNIQVAR_PREPEND([EZ_LIBS], [${LIBXML2_LIBS}])
use_taglib="No" use_taglib="No"
AX_CHECK_TAGLIB_C([ AX_CHECK_TAGLIB_C([], [
AC_DEFINE([HAVE_TAGLIB], [1], AC_DEFINE([HAVE_TAGLIB], [1],
[Define to 1 if you have the libtag_c library.] [Define to 1 if you have the libtag_c library.]
) )
AX_UNIQVAR_APPEND([EZ_CPPFLAGS], [${TAGLIB_CFLAGS}]) AX_UNIQVAR_APPEND([EZ_CFLAGS], [${TAGLIB_CFLAGS}])
AX_UNIQVAR_APPEND([EZ_CPPFLAGS], [${TAGLIB_CPPFLAGS}])
AX_UNIQVAR_APPEND([EZ_LDFLAGS], [${TAGLIB_LDFLAGS}]) AX_UNIQVAR_APPEND([EZ_LDFLAGS], [${TAGLIB_LDFLAGS}])
AX_UNIQVAR_PREPEND([EZ_LIBS], [${TAGLIB_C_LIBS}]) AX_UNIQVAR_PREPEND([EZ_LIBS], [${TAGLIB_C_LIBS}])
use_taglib="Yes" use_taglib="Yes"

View File

@ -1,37 +1,41 @@
dnl $Id: taglib.m4 721 2008-10-29 14:28:09Z mgrimm $ dnl $Id$
dnl Check for working installations of TagLib and its C-wrapper library, dnl # Check for working installations of TagLib and its C-wrapper library,
dnl libtag_c. dnl # libtag_c.
dnl Provides appropriate --with configuration options, fills and substitutes dnl # Provides appropriate --with configuration options, fills and substitutes
dnl the TAGLIB_CPPFLAGS, TAGLIB_LDFLAGS, TAGLIB_LIBS and TAGLIB_C_LIBS dnl # the TAGLIB_CFLAGS, TAGLIB_CPPFLAGS, TAGLIB_LDFLAGS, TAGLIB_LIBS and
dnl variables accordingly. dnl # TAGLIB_C_LIBS variables accordingly.
dnl Copyright (c) 2008 Moritz Grimm <mgrimm@mrsserver.net> dnl # Copyright (c) 2008 Moritz Grimm <mgrimm@mrsserver.net>
dnl dnl
dnl Permission to use, copy, modify, and distribute this software for any dnl # Permission to use, copy, modify, and distribute this software for any
dnl purpose with or without fee is hereby granted, provided that the above dnl # purpose with or without fee is hereby granted, provided that the above
dnl copyright notice and this permission notice appear in all copies. dnl # copyright notice and this permission notice appear in all copies.
dnl dnl
dnl THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES dnl # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
dnl WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF dnl # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
dnl MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR dnl # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
dnl ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES dnl # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
dnl WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN dnl # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
dnl ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF dnl # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
dnl OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. dnl # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
dnl Both check functions provide TAGLIB_CPPFLAGS and TAGLIB_LDFLAGS. dnl # Both check functions provide TAGLIB_CPPFLAGS and TAGLIB_LDFLAGS.
dnl For TAGLIB_LIBS: dnl # For TAGLIB_LIBS:
dnl AX_CHECK_TAGLIB([ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) dnl # AX_CHECK_TAGLIB([TAGLIB-VERSION], [ACTION-IF-FOUND],
dnl # [ACTION-IF-NOT-FOUND])
dnl For TAGLIB_C_LIBS: dnl # For TAGLIB_C_LIBS:
dnl AX_CHECK_TAGLIB_C([ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) dnl # AX_CHECK_TAGLIB_C([TAGLIB-VERSION], [ACTION-IF-FOUND],
dnl # [ACTION-IF-NOT-FOUND])
AC_DEFUN([_AX_CHECK_TAGLIB_OPTS], AC_DEFUN([_AX_CHECK_TAGLIB_OPTS],
[ [
AC_ARG_VAR([TAGLIB_CFLAGS],
[C compiler flags for TagLib])
AC_ARG_VAR([TAGLIB_CPPFLAGS], AC_ARG_VAR([TAGLIB_CPPFLAGS],
[C preprocessor flags for TagLib]) [C preprocessor flags for TagLib])
AC_ARG_VAR([TAGLIB_LDFLAGS], AC_ARG_VAR([TAGLIB_LDFLAGS],
@ -88,6 +92,9 @@ esac
) )
AC_CACHE_VAL([local_cv_have_lib_taglib_opts], AC_CACHE_VAL([local_cv_have_lib_taglib_opts],
[ [
if test -z "${TAGLIB_CFLAGS}"; then
TAGLIB_CFLAGS="`${PKG_CONFIG} --cflags-only-other taglib`"
fi
if test -n "${TAGLIB_CPPFLAGS}"; then if test -n "${TAGLIB_CPPFLAGS}"; then
if test x"${have_taglib_includes}" != "x"; then if test x"${have_taglib_includes}" != "x"; then
TAGLIB_CPPFLAGS="${TAGLIB_CPPFLAGS} -I${have_taglib_includes}" TAGLIB_CPPFLAGS="${TAGLIB_CPPFLAGS} -I${have_taglib_includes}"
@ -95,10 +102,14 @@ if test -n "${TAGLIB_CPPFLAGS}"; then
else else
if test x"${have_taglib_includes}" != "x"; then if test x"${have_taglib_includes}" != "x"; then
TAGLIB_CPPFLAGS="-I${have_taglib_includes}" TAGLIB_CPPFLAGS="-I${have_taglib_includes}"
else
if test x"${want_taglib}" = "xauto"; then
TAGLIB_CPPFLAGS="`${PKG_CONFIG} --cflags-only-I taglib`"
else else
TAGLIB_CPPFLAGS="-I${have_taglib_prefix}/include/taglib" TAGLIB_CPPFLAGS="-I${have_taglib_prefix}/include/taglib"
fi fi
fi fi
fi
if test -n "${TAGLIB_LDFLAGS}"; then if test -n "${TAGLIB_LDFLAGS}"; then
if test x"${have_taglib_libs}" != "x"; then if test x"${have_taglib_libs}" != "x"; then
TAGLIB_LDFLAGS="-L${have_taglib_libs} ${TAGLIB_LDFLAGS}" TAGLIB_LDFLAGS="-L${have_taglib_libs} ${TAGLIB_LDFLAGS}"
@ -106,25 +117,45 @@ if test -n "${TAGLIB_LDFLAGS}"; then
else else
if test -n "${have_taglib_libs}"; then if test -n "${have_taglib_libs}"; then
TAGLIB_LDFLAGS="-L${have_taglib_libs}" TAGLIB_LDFLAGS="-L${have_taglib_libs}"
else
if test x"${want_taglib}" = "xauto"; then
TAGLIB_LDFLAGS=" \
`${PKG_CONFIG} --libs-only-L taglib` \
`${PKG_CONFIG} --libs-only-other taglib` \
"
else else
TAGLIB_LDFLAGS="-L${have_taglib_prefix}/lib" TAGLIB_LDFLAGS="-L${have_taglib_prefix}/lib"
fi fi
fi fi
fi
local_cv_have_lib_taglib_opts=yes local_cv_have_lib_taglib_opts=yes
]) ])
]) ])
AC_DEFUN([AX_CHECK_TAGLIB], AC_DEFUN([AX_CHECK_TAGLIB],
[ [
AC_REQUIRE([PKG_PROG_PKG_CONFIG])
AC_REQUIRE([_AX_CHECK_TAGLIB_OPTS]) AC_REQUIRE([_AX_CHECK_TAGLIB_OPTS])
AC_ARG_VAR([TAGLIB_LIBS], AC_ARG_VAR([TAGLIB_LIBS],
[libraries to use for TagLib]) [libraries to use for TagLib])
AC_CACHE_VAL([local_cv_have_lib_taglib], AC_CACHE_VAL([local_cv_have_lib_taglib],
[ [
local_cv_have_lib_taglib=no local_cv_have_lib_taglib=no
PKG_CONFIG_PATH="${PKG_CONFIG_PATH}:${have_taglib_prefix}/lib/pkgconfig"
if test -z "${PKG_CONFIG}"; then
AC_MSG_ERROR([The pkg-config utility is required.], [1])
fi
dnl ####### BEGIN CHECK ######
PKG_CHECK_EXISTS([taglib $1], [
dnl ##########################
if test x"${want_taglib}" != "xno"; then # want_taglib != no if test x"${want_taglib}" != "xno"; then # want_taglib != no
libtag_libs_autodetected=no
if test -z "${TAGLIB_LIBS}"; then if test -z "${TAGLIB_LIBS}"; then
TAGLIB_LIBS="-ltag" TAGLIB_LIBS="`${PKG_CONFIG} --libs-only-l taglib`"
libtag_libs_autodetected=yes
fi fi
ax_check_taglib_save_CPPFLAGS="${CPPFLAGS}" ax_check_taglib_save_CPPFLAGS="${CPPFLAGS}"
ax_check_taglib_save_LDFLAGS="${LDFLAGS}" ax_check_taglib_save_LDFLAGS="${LDFLAGS}"
@ -181,27 +212,43 @@ LDFLAGS="${ax_check_taglib_save_LDFLAGS}"
LIBS="${ax_check_taglib_save_LIBS}" LIBS="${ax_check_taglib_save_LIBS}"
AC_LANG_POP([C++]) AC_LANG_POP([C++])
fi # want_taglib != no fi # want_taglib != no
dnl ####### END CHECK ########
], [])
dnl ##########################
]) ])
AC_MSG_CHECKING([for TagLib]) AC_MSG_CHECKING([for TagLib])
if test x"${local_cv_have_lib_taglib}" = "xyes"; then if test x"${local_cv_have_lib_taglib}" = "xyes"; then
AC_MSG_RESULT([yes]) AC_MSG_RESULT([yes])
: :
$1 $2
else else
AC_MSG_RESULT([no]) AC_MSG_RESULT([no])
: :
$2 $3
fi fi
]) ])
AC_DEFUN([AX_CHECK_TAGLIB_C], AC_DEFUN([AX_CHECK_TAGLIB_C],
[ [
AC_REQUIRE([PKG_PROG_PKG_CONFIG])
AC_REQUIRE([_AX_CHECK_TAGLIB_OPTS]) AC_REQUIRE([_AX_CHECK_TAGLIB_OPTS])
AC_ARG_VAR([TAGLIB_C_LIBS], AC_ARG_VAR([TAGLIB_C_LIBS],
[libraries to use for the TagLib C wrapper]) [libraries to use for the TagLib C wrapper])
AC_CACHE_VAL([local_cv_have_lib_taglib_c], AC_CACHE_VAL([local_cv_have_lib_taglib_c],
[ [
local_cv_have_lib_taglib_c=no local_cv_have_lib_taglib_c=no
PKG_CONFIG_PATH="${PKG_CONFIG_PATH}:${have_taglib_prefix}/lib/pkgconfig"
if test -z "${PKG_CONFIG}"; then
AC_MSG_ERROR([The pkg-config utility is required.], [1])
fi
dnl ####### BEGIN CHECK ######
PKG_CHECK_EXISTS([taglib $1], [
dnl ##########################
if test x"${want_taglib}" != "xno"; then # want_taglib != no if test x"${want_taglib}" != "xno"; then # want_taglib != no
if test -z "${TAGLIB_C_LIBS}"; then if test -z "${TAGLIB_C_LIBS}"; then
TAGLIB_C_LIBS="-ltag_c" TAGLIB_C_LIBS="-ltag_c"
@ -259,15 +306,20 @@ LDFLAGS="${ax_check_taglib_c_save_LDFLAGS}"
LIBS="${ax_check_taglib_c_save_LIBS}" LIBS="${ax_check_taglib_c_save_LIBS}"
AC_LANG_POP([C]) AC_LANG_POP([C])
fi # want_taglib != no fi # want_taglib != no
dnl ####### END CHECK ########
], [])
dnl ##########################
]) ])
AC_MSG_CHECKING([for libtag_c]) AC_MSG_CHECKING([for libtag_c])
if test x"${local_cv_have_lib_taglib_c}" = "xyes"; then if test x"${local_cv_have_lib_taglib_c}" = "xyes"; then
AC_MSG_RESULT([yes]) AC_MSG_RESULT([yes])
: :
$1 $2
else else
AC_MSG_RESULT([no]) AC_MSG_RESULT([no])
: :
$2 $3
fi fi
]) ])