Commit 9acbffc2 authored by moritz's avatar moritz

Overhaul the ezstream build system, using my own library of autoconf macros.

There are a few benefits to this, but the main reason is consistency and me
completely understanding what's going on. Regressions are not expected, but
wouldn't surprise either ... this needs lots of testing.


git-svn-id: https://svn.xiph.org/trunk/ezstream@15776 0101bb08-14d6-0310-b084-bc0e0c8e3800
parent 4eab64df
AUTOMAKE_OPTIONS = 1.9 foreign
ACLOCAL_AMFLAGS = -I m4
ACLOCAL_AMFLAGS = -I m4
SUBDIRS = build-aux compat doc examples m4 src win32
SUBDIRS = build-aux compat doc examples m4 src win32
dist_doc_DATA = COPYING NEWS README
dist_doc_DATA = COPYING NEWS README
CLEANFILES = core *.core *~ .*~
EXTRA_DIST = \
autogen.sh \
m4/ccflags.m4 m4/libogg.m4 m4/libshout.m4 m4/libvorbis.m4 \
m4/libxml2.m4 m4/progname.m4 m4/taglib.m4 m4/tree.m4 m4/vacopy.m4 \
m4/vars.m4
.PHONY: regen-win32 snapshot
CLEANFILES = core *.core *~ .*~
.PHONY: regen-win32 snapshot
regen-win32:
cd win32; ${MAKE} regen-win32
......
......@@ -8,6 +8,9 @@ Changes in 0.5.4, released on XXXX-XX-XX:
- [FIX] Add a missing metadata charset conversion, and add charset
conversions for filenames. From Roman Donchenko.
- [FIX] Fix build on MinGW. From Roman Donchenko.
- [MISC] Overhaul and modernize the build system. Ezstream is now expected
to build "out of the box" on more systems without configuration
tweaks.
......
......@@ -57,15 +57,17 @@ configure script, a couple of additional options are available:
example configuration files installation directory
(default: DATADIR/examples/ezstream)
--enable-debug enable memory debugging (default: no)
--with-taglib=PFX prefix where the TagLib header files and library are
installed (default: autodetect
--with-taglib-includes=DIR
directory where TagLib header files are installed
(optional)
--with-taglib-libs=DIR directory where TagLib is installed (optional)
--with-gnu-ld assume the C compiler uses GNU ld default=no
--with-libiconv-prefix[=DIR]
search for libiconv in DIR/include and DIR/lib
--without-libiconv-prefix
don't search for libiconv in includedir and libdir
--with-taglib=PREFIX Prefix where TagLib is installed (default:
autodetect)
--with-ogg=PREFIX Prefix where libogg is installed (optional)
--with-vorbis=PREFIX Prefix where libvorbis is installed (optional)
--with-xml-config=PATH use xml-config in PATH to find libxml
The compilation and installation process boils down to the usual
......@@ -77,6 +79,12 @@ The compilation and installation process boils down to the usual
If this procedure is unfamiliar to you, please consult the INSTALL file for
more detailed instructions.
When the configuration keeps failing despite having all dependencies
installed, take note of the more verbose error messages in config.log. If
necessary, it is possible to directly customize many build flags through
environment variables. See the "influential environment variables" list
in the --help output.
USAGE
......
......@@ -7,7 +7,12 @@ if [ ! -f "./`basename $0`" ]; then
exit 1
fi
AUTOCONF_VERSION=2.61 AUTOMAKE_VERSION=1.9 aclocal -I m4
EXTRA=
if [ -d /usr/local/share/aclocal ]; then
EXTRA="-I /usr/local/share/aclocal"
fi
AUTOCONF_VERSION=2.61 AUTOMAKE_VERSION=1.9 aclocal -I m4 ${EXTRA}
AUTOCONF_VERSION=2.61 AUTOMAKE_VERSION=1.9 autoconf
AUTOCONF_VERSION=2.61 AUTOMAKE_VERSION=1.9 autoheader
# AUTOCONF_VERSION=2.61 AUTOMAKE_VERSION=1.9 libtoolize --automake -c -f
......
AUTOMAKE_OPTIONS = 1.9 foreign
EXTRA_DIST = config.rpath
EXTRA_DIST = config.rpath
CLEANFILES = core *.core *~ .*~
CLEANFILES = core *.core *~ .*~
AUTOMAKE_OPTIONS = 1.9 foreign
SUBDIRS = sys
SUBDIRS = sys
CLEANFILES = *~ *.core core
CLEANFILES = *~ *.core core
AUTOMAKE_OPTIONS = 1.9 foreign
EXTRA_DIST = tree.h tree.3
EXTRA_DIST = tree.h tree.3
CLEANFILES = *~ *.core core
CLEANFILES = *~ *.core core
This diff is collapsed.
AUTOMAKE_OPTIONS = 1.9 foreign
man_MANS = ezstream.1
man_MANS = ezstream.1
EXTRA_DIST = ezstream.1.in
EXTRA_DIST = ezstream.1.in
do_subst = sed -e 's,!!EXAMPLES_DIR!!,@EXAMPLES_DIR@,g'
do_subst = sed -e 's,!!EXAMPLES_DIR!!,@EXAMPLES_DIR@,g'
ezstream.1: ezstream.1.in Makefile
$(do_subst) < $(srcdir)/ezstream.1.in > ezstream.1
ezstream.1: ezstream.1.in Makefile
$(do_subst) < $(srcdir)/ezstream.1.in > ezstream.1
CLEANFILES = *~ *.core core ${man_MANS}
CLEANFILES = *~ *.core core $(man_MANS)
AUTOMAKE_OPTIONS = 1.9 foreign
examplesdir = @EXAMPLES_DIR@
dist_examples_DATA = ezstream_mp3.xml ezstream_reencode_mp3.xml \
ezstream_reencode_theora.xml ezstream_reencode_vorbis.xml \
ezstream_stdin_vorbis.xml ezstream_vorbis.xml \
ezstream_metadata.xml
examplesdir = @EXAMPLES_DIR@
dist_examples_DATA = \
ezstream_mp3.xml ezstream_reencode_mp3.xml \
ezstream_reencode_theora.xml ezstream_reencode_vorbis.xml \
ezstream_stdin_vorbis.xml ezstream_vorbis.xml \
ezstream_metadata.xml
dist_examples_SCRIPTS = meta.sh play.sh
CLEANFILES = core *.core *~ .*~
CLEANFILES = core *.core *~ .*~
AUTOMAKE_OPTIONS = 1.9 foreign
EXTRA_DIST = xiph_compiler.m4 xiph_xml2.m4
CLEANFILES = core *.core *~ .*~
CLEANFILES = core *.core *~ .*~
# Distribute required .m4 files via EXTRA_DIST in the parent Makefile.am.
dnl $Id: ccflags.m4 907 2009-03-08 10:28:51Z mgrimm $
dnl * Check if the compiler understands a certain flag or not.
dnl Inspiration for this came from watching TagLib configure.
dnl * Check for the CFLAG required to turn warnings into errors.
dnl Copyright (c) 2008 Moritz Grimm <mgrimm@mrsserver.net>
dnl
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 copyright notice and this permission notice appear in all copies.
dnl
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 MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
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 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
dnl OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
dnl AX_CHECK_CFLAG(CFLAG, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
dnl AX_CHECK_CXXFLAG(CXXFLAG, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
AC_DEFUN([AX_CHECK_CFLAG],
[
AC_MSG_CHECKING([if ${CC} understands -$1])
_cv_sufx_=$(echo $1 | sed 'y|-+,= |_p___|')
AC_CACHE_VAL([local_cv_prog_cc_${_cv_sufx_}],
[
AC_LANG_PUSH([C])
save_CFLAGS="${CFLAGS}"
CFLAGS="${CFLAGS} -$1"
AC_TRY_LINK([], [],
[eval "local_cv_prog_cc_${_cv_sufx_}=yes"],
[eval "local_cv_prog_cc_${_cv_sufx_}=no"])
CFLAGS="${save_CFLAGS}"
AC_LANG_POP([C])
])
eval "_cache_val_=\${local_cv_prog_cc_${_cv_sufx_}}"
if test x"${_cache_val_}" = "xyes"; then
AC_MSG_RESULT([yes])
:
$2
else
AC_MSG_RESULT([no])
:
$3
fi
])
AC_DEFUN([AX_CHECK_CXXFLAG],
[
AC_MSG_CHECKING([if ${CXX} understands -$1])
_cv_sufx_=$(echo $1 | sed 'y|-+,= |_p___|')
AC_CACHE_VAL([local_cv_prog_cxx_${_cv_sufx_}],
[
AC_LANG_PUSH([C++])
save_CXXFLAGS="${CXXFLAGS}"
CXXFLAGS="${CXXFLAGS} -$1"
AC_TRY_LINK([], [],
[eval "local_cv_prog_cxx_${_cv_sufx_}=yes"],
[eval "local_cv_prog_cxx_${_cv_sufx_}=no"])
CXXFLAGS="${save_CXXFLAGS}"
AC_LANG_POP([C++])
])
eval "_cache_val_=\${local_cv_prog_cxx_${_cv_sufx_}}"
if test x"${_cache_val_}" = "xyes"; then
AC_MSG_RESULT([yes])
:
$2
else
AC_MSG_RESULT([no])
:
$3
fi
])
AC_DEFUN([AX_CHECK_ERROR_FLAG],
[
AC_CACHE_VAL([local_cv_prog_cc_error_flag],
[
AC_MSG_CHECKING([if ${CC} supports an error flag])
AC_LANG_PUSH([C])
save_CFLAGS="${CFLAGS}"
CFLAGS="${CFLAGS} -Werror"
AC_TRY_LINK([], [],
[local_cv_prog_cc_error_flag=-Werror],
[local_cv_prog_cc_error_flag=no])
CFLAGS="${save_CFLAGS}"
AC_LANG_POP([C])
if test x"${local_cv_prog_cc_error_flag}" != "xno"; then
AC_MSG_RESULT([yes (${local_cv_prog_cc_error_flag})])
:
$2
else
AC_MSG_RESULT([no])
:
$3
fi
])
])
dnl $Id: libogg.m4 729 2008-11-01 17:38:43Z mgrimm $
dnl # Check for a working installation of libogg.
dnl # Provides appropriate --with configuration options, fills and substitutes
dnl # the LIBOGG_CFLAGS, LIBOGG_CPPFLAGS, LIBOGG_LDFLAGS and LIBOGG_LIBS
dnl # variables accordingly.
dnl # Copyright (c) 2008 Moritz Grimm <mgrimm@mrsserver.net>
dnl #
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 # copyright notice and this permission notice appear in all copies.
dnl
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 # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
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 # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
dnl # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
dnl # For LIBOGG_CFLAGS, LIBOGG_CPPFLAGS, LIBOGG_LDFLAGS and LIBOGG_LIBS:
dnl # AX_CHECK_LIBOGG([LIBOGG-VERSION], [ACTION-IF-FOUND],
dnl # [ACTION-IF-NOT-FOUND])
AC_DEFUN([AX_CHECK_LIBOGG],
[
AC_REQUIRE([PKG_PROG_PKG_CONFIG])
AC_ARG_VAR([LIBOGG_CFLAGS],
[C compiler flags for libogg])
AC_ARG_VAR([LIBOGG_CPPFLAGS],
[C preprocessor flags for libogg])
AC_ARG_VAR([LIBOGG_LDFLAGS],
[linker flags for libogg])
AC_ARG_VAR([LIBOGG_LIBS],
[libraries to use for libogg])
if test x"${prefix}" = "xNONE"; then
ax_check_libogg_prefix="/usr/local"
else
ax_check_libogg_prefix="${prefix}"
fi
AC_CACHE_VAL([local_cv_have_lib_libogg],
[
local_cv_have_lib_libogg=no
PKG_CONFIG_PATH="${PKG_CONFIG_PATH}:${ax_check_libogg_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([ogg $1], [
dnl ##########################
libogg_libs_autodetect=no
if test -z "${LIBOGG_CFLAGS}"; then
LIBOGG_CFLAGS="`${PKG_CONFIG} --cflags-only-other ogg`"
fi
if test -z "${LIBOGG_CPPFLAGS}"; then
LIBOGG_CPPFLAGS="`${PKG_CONFIG} --cflags-only-I ogg`"
fi
if test -z "${LIBOGG_LDFLAGS}"; then
LIBOGG_LDFLAGS="\
`${PKG_CONFIG} --libs-only-L ogg` \
`${PKG_CONFIG} --libs-only-other ogg` \
"
fi
if test -z "${LIBOGG_LIBS}"; then
LIBOGG_LIBS="`${PKG_CONFIG} --libs-only-l ogg`"
libogg_libs_autodetect=yes
fi
ax_check_libogg_save_CFLAGS="${CFLAGS}"
ax_check_libogg_save_CPPFLAGS="${CPPFLAGS}"
ax_check_libogg_save_LDFLAGS="${LDFLAGS}"
ax_check_libogg_save_LIBS="${LIBS}"
AC_LANG_PUSH([C])
CFLAGS="${CFLAGS} ${LIBOGG_CFLAGS}"
CPPFLAGS="${CPPFLAGS} ${LIBOGG_CPPFLAGS}"
LDFLAGS="${LDFLAGS} ${LIBOGG_LDFLAGS}"
LIBS="${LIBOGG_LIBS} ${LIBS}"
AC_CHECK_HEADER([ogg/ogg.h],
[
AC_MSG_CHECKING([if libogg works])
AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
[[
#include <stdlib.h>
#include <ogg/ogg.h>
]],
[[
ogg_sync_init(NULL);
]]
)],
[
AC_MSG_RESULT([yes])
local_cv_have_lib_libogg=yes
],
[
AC_MSG_RESULT([no])
]
)
])
CFLAGS="${ax_check_libogg_save_CFLAGS}"
CPPFLAGS="${ax_check_libogg_save_CPPFLAGS}"
LDFLAGS="${ax_check_libogg_save_LDFLAGS}"
LIBS="${ax_check_libogg_save_LIBS}"
AC_LANG_POP([C])
dnl ####### END CHECK ########
], [])
dnl ##########################
])
AC_MSG_CHECKING([for libogg $1])
if test x"${local_cv_have_lib_libogg}" = "xyes"; then
AC_MSG_RESULT([yes])
:
$2
else
AC_MSG_RESULT([no])
:
$3
fi
])
dnl $Id: libshout.m4 948 2009-03-15 17:59:37Z mgrimm $
dnl # Check for a working installation of libshout.
dnl # Provides appropriate --with configuration options, fills and substitutes
dnl # the LIBSHOUT_CFLAGS, LIBSHOUT_CPPFLAGS, LIBSHOUT_LDFLAGS and
dnl # LIBSHOUT_LIBS variables accordingly.
dnl # Copyright (c) 2008 Moritz Grimm <mgrimm@mrsserver.net>
dnl #
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 # copyright notice and this permission notice appear in all copies.
dnl
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 # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
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 # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
dnl # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
dnl # For LIBSHOUT_CFLAGS, LIBSHOUT_CPPFLAGS, LIBSHOUT_LDFLAGS and
dnl # LIBSHOUT_LIBS:
dnl # AX_CHECK_LIBSHOUT([LIBSHOUT-VERSION], [ACTION-IF-FOUND],
dnl # [ACTION-IF-NOT-FOUND])
AC_DEFUN([AX_CHECK_LIBSHOUT],
[
AC_REQUIRE([PKG_PROG_PKG_CONFIG])
AC_REQUIRE([AC_PROG_FGREP])
AC_ARG_VAR([LIBSHOUT_CFLAGS],
[C compiler flags for libshout])
AC_ARG_VAR([LIBSHOUT_CPPFLAGS],
[C preprocessor flags for libshout])
AC_ARG_VAR([LIBSHOUT_LDFLAGS],
[linker flags for libshout])
AC_ARG_VAR([LIBSHOUT_LIBS],
[libraries to use for libshout])
if test x"${prefix}" = "xNONE"; then
ax_check_libshout_prefix="/usr/local"
else
ax_check_libshout_prefix="${prefix}"
fi
AC_CACHE_VAL([local_cv_have_lib_libshout],
[
local_cv_have_lib_libshout=no
PKG_CONFIG_PATH="${PKG_CONFIG_PATH}:${ax_check_libshout_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([shout $1], [
dnl ##########################
libshout_libs_autodetect=no
if test -z "${LIBSHOUT_CFLAGS}"; then
LIBSHOUT_CFLAGS="`${PKG_CONFIG} --cflags-only-other shout`"
fi
if test -z "${LIBSHOUT_CPPFLAGS}"; then
LIBSHOUT_CPPFLAGS="`${PKG_CONFIG} --cflags-only-I shout`"
fi
if test -z "${LIBSHOUT_LDFLAGS}"; then
LIBSHOUT_LDFLAGS="\
`${PKG_CONFIG} --libs-only-L shout` \
`${PKG_CONFIG} --libs-only-other shout` \
"
fi
if test -z "${LIBSHOUT_LIBS}"; then
LIBSHOUT_LIBS="`${PKG_CONFIG} --libs-only-l shout`"
libshout_libs_autodetect=yes
fi
# If libshout required libm, make sure that it is listed at the end:
if test "${libshout_libs_autodetect}" = "yes"; then
if test -n "`echo ${LIBSHOUT_LIBS} | ${FGREP} -e ' -lm'`"; then
xt_shout_TEMP="`echo ${LIBSHOUT_LIBS} | sed -e 's, -lm,,g'`"
LIBSHOUT_LIBS="${xt_shout_TEMP} -lm"
fi
fi
ax_check_libshout_save_CFLAGS="${CFLAGS}"
ax_check_libshout_save_CPPFLAGS="${CPPFLAGS}"
ax_check_libshout_save_LDFLAGS="${LDFLAGS}"
ax_check_libshout_save_LIBS="${LIBS}"
AC_LANG_PUSH([C])
CFLAGS="${CFLAGS} ${LIBSHOUT_CFLAGS}"
CPPFLAGS="${CPPFLAGS} ${LIBSHOUT_CPPFLAGS}"
LDFLAGS="${LDFLAGS} ${LIBSHOUT_LDFLAGS}"
LIBS="${LIBSHOUT_LIBS} ${LIBS}"
AC_CHECK_HEADER([shout/shout.h],
[
AC_MSG_CHECKING([if libshout works])
AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
[[
#include <shout/shout.h>
]],
[[
shout_new();
]]
)],
[
AC_MSG_RESULT([yes])
local_cv_have_lib_libshout=yes
],
[
AC_MSG_RESULT([no])
]
)
])
CFLAGS="${ax_check_libshout_save_CFLAGS}"
CPPFLAGS="${ax_check_libshout_save_CPPFLAGS}"
LDFLAGS="${ax_check_libshout_save_LDFLAGS}"
LIBS="${ax_check_libshout_save_LIBS}"
AC_LANG_POP([C])
dnl ####### END CHECK ########
], [])
dnl ##########################
])
AC_MSG_CHECKING([for libshout $1])
if test x"${local_cv_have_lib_libshout}" = "xyes"; then
AC_MSG_RESULT([yes])
:
$2
else
AC_MSG_RESULT([no])
:
$3
fi
])
dnl $Id: libvorbis.m4 735 2008-11-01 18:34:34Z mgrimm $
dnl # Check for working installations of libvorbis, libvorbisfile and
dnl # libvorbisenc.
dnl # Provides appropriate --with configuration options, fills and substitutes
dnl # the VORBIS_CFLAGS, VORBIS_CPPFLAGS, VORBIS_LDFLAGS, LIBVORBIS_LIBS,
dnl # LIBVORBISENC_LIBS and LIBVORBISFILE_LIBS variables accordingly.
dnl # Copyright (c) 2008 Moritz Grimm <mgrimm@mrsserver.net>
dnl #
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 # copyright notice and this permission notice appear in all copies.
dnl #
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 # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
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 # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
dnl # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
dnl # Each of these macros supply VORBIS_CFLAGS, VORBIS_CPPFLAGS and
dnl # VORBIS_LDFLAGS.
dnl # For LIBVORBIS_LIBS:
dnl # AX_CHECK_LIBVORBIS([VORBISLIBS-VERSION], [ACTION-IF-FOUND],
dnl # [ACTION-IF-NOT-FOUND])
dnl # For LIBVORBISENC_LIBS:
dnl # AX_CHECK_LIBVORBISENC([VORBISLIBS-VERSION], [ACTION-IF-FOUND],
dnl # [ACTION-IF-NOT-FOUND])
dnl # For LIBVORBISFILE_LIBS:
dnl # AX_CHECK_LIBVORBISFILE([VORBISLIBS-VERSION], [ACTION-IF-FOUND],
dnl # [ACTION-IF-NOT-FOUND])
AC_DEFUN([_AX_CHECK_VORBIS_OPTS],
[
AC_REQUIRE([PKG_PROG_PKG_CONFIG])
AC_ARG_VAR([VORBIS_CFLAGS],
[C compiler flags for the Vorbis libraries])
AC_ARG_VAR([VORBIS_CPPFLAGS],
[C preprocessor flags for the Vorbis libraries])
AC_ARG_VAR([VORBIS_LDFLAGS],
[linker flags for the Vorbis libraries])
if test x"${prefix}" = "xNONE"; then
ax_check_libvorbis_prefix="/usr/local"
else
ax_check_libvorbis_prefix="${prefix}"
fi
if test -z "${VORBIS_CFLAGS}"; then
VORBIS_CFLAGS="`${PKG_CONFIG} --cflags-only-other vorbis`"
fi
if test -z "${VORBIS_CPPFLAGS}"; then
VORBIS_CPPFLAGS="`${PKG_CONFIG} --cflags-only-I vorbis`"
fi
if test -z "${VORBIS_LDFLAGS}"; then
VORBIS_LDFLAGS="\
`${PKG_CONFIG} --libs-only-L vorbis` \
`${PKG_CONFIG} --libs-only-other vorbis` \
"
fi
])
AC_DEFUN([AX_CHECK_LIBVORBIS],
[
AC_REQUIRE([_AX_CHECK_VORBIS_OPTS])
AC_ARG_VAR([LIBVORBIS_LIBS],
[libraries to use for libvorbis])
AC_CACHE_VAL([local_cv_have_lib_libvorbis],
[
local_cv_have_lib_libvorbis=no
PKG_CONFIG_PATH="${PKG_CONFIG_PATH}:${ax_check_libogg_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([vorbis $1], [
dnl ##########################
libvorbis_libs_autodetect=no
if test -z "${LIBVORBIS_LIBS}"; then
LIBVORBIS_LIBS="`${PKG_CONFIG} --libs-only-l vorbis`"
libvorbis_libs_autodetect=yes
fi
ax_check_libvorbis_save_CFLAGS="${CFLAGS}"
ax_check_libvorbis_save_CPPFLAGS="${CPPFLAGS}"
ax_check_libvorbis_save_LDFLAGS="${LDFLAGS}"
ax_check_libvorbis_save_LIBS="${LIBS}"
AC_LANG_PUSH([C])
CFLAGS="${CFLAGS} ${VORBIS_CFLAGS}"
CPPFLAGS="${CPPFLAGS} ${VORBIS_CPPFLAGS}"
LDFLAGS="${LDFLAGS} ${VORBIS_LDFLAGS}"
LIBS="${LIBVORBIS_LIBS} ${LIBS}"
AC_CHECK_HEADER([vorbis/codec.h],
[
AC_MSG_CHECKING([if libvorbis works])
AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
[[
#include <stdlib.h>
#include <ogg/ogg.h>
#include <vorbis/codec.h>
]],
[[
vorbis_info_init(NULL);
]]
)],
[
AC_MSG_RESULT([yes])
local_cv_have_lib_libvorbis=yes
],
[
AC_MSG_RESULT([no])
]
)
AC_CHECK_TYPE([struct ovectl_ratemanage_arg],
[],
[AC_MSG_ERROR([These Vorbis libraries are too old, please upgrade.], [1])],
[
#include <stdlib.h>
#include <ogg/ogg.h>
#include <vorbis/codec.h>
#include <vorbis/vorbisenc.h>
]
)
])
CFLAGS="${ax_check_libvorbis_save_CFLAGS}"
CPPFLAGS="${ax_check_libvorbis_save_CPPFLAGS}"
LDFLAGS="${ax_check_libvorbis_save_LDFLAGS}"
LIBS="${ax_check_libvorbis_save_LIBS}"
AC_LANG_POP([C])
dnl ####### END CHECK ########
], [])
dnl ##########################
])
AC_MSG_CHECKING([for libvorbis $1])
if test x"${local_cv_have_lib_libvorbis}" = "xyes"; then
AC_MSG_RESULT([yes])
:
$2
else
AC_MSG_RESULT([no])
:
$3
fi
])
AC_DEFUN([AX_CHECK_LIBVORBISFILE],
[
AC_REQUIRE([_AX_CHECK_VORBIS_OPTS])
AC_ARG_VAR([LIBVORBISFILE_LIBS],
[libraries to use for libvorbisfile])
AC_CACHE_VAL([local_cv_have_lib_libvorbisfile],
[
local_cv_have_lib_libvorbisfile=no
PKG_CONFIG_PATH="${PKG_CONFIG_PATH}:${ax_check_libogg_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([vorbisfile $1], [
dnl ##########################
libvorbisfile_libs_autodetect=no
if test -z "${LIBVORBISFILE_LIBS}"; then
LIBVORBISFILE_LIBS="`${PKG_CONFIG} --libs-only-l vorbisfile`"
libvorbisfile_libs_autodetect=yes
fi
ax_check_libvorbisfile_save_CFLAGS="${CFLAGS}"
ax_check_libvorbisfile_save_CPPFLAGS="${CPPFLAGS}"
ax_check_libvorbisfile_save_LDFLAGS="${LDFLAGS}"
ax_check_libvorbisfile_save_LIBS="${LIBS}"
AC_LANG_PUSH([C])
CFLAGS="${CFLAGS} ${VORBIS_CFLAGS}"
CPPFLAGS="${CPPFLAGS} ${VORBIS_CPPFLAGS}"
LDFLAGS="${LDFLAGS} ${VORBIS_LDFLAGS}"
LIBS="${LIBVORBISFILE_LIBS} ${LIBS}"
AC_CHECK_HEADER([vorbis/vorbisfile.h],
[
AC_MSG_CHECKING([if libvorbisfile works])
AC_LINK_IFELSE(
[AC_LANG_PROGRAM(