2007-02-24 16:29:27 -05:00
|
|
|
dnl INITIALIZATION
|
2004-01-30 12:19:45 -05:00
|
|
|
|
2007-08-13 23:33:12 -04:00
|
|
|
AC_INIT([ezstream], [0.5.0], [https://trac.xiph.org/newticket?component=ezstream])
|
2007-02-24 16:44:35 -05:00
|
|
|
AC_PREREQ(2.61)
|
2004-01-30 12:19:45 -05:00
|
|
|
AC_CONFIG_SRCDIR(src/ezstream.c)
|
2007-08-23 20:52:13 -04:00
|
|
|
AC_CONFIG_AUX_DIR(build-aux)
|
2004-01-30 12:19:45 -05:00
|
|
|
AM_INIT_AUTOMAKE
|
2007-02-24 16:46:05 -05:00
|
|
|
AC_CONFIG_HEADERS(src/config.h)
|
2007-02-24 16:50:54 -05:00
|
|
|
AC_CONFIG_LIBOBJ_DIR(src)
|
2004-01-30 12:19:45 -05:00
|
|
|
AM_MAINTAINER_MODE
|
2007-02-24 16:44:35 -05:00
|
|
|
AC_USE_SYSTEM_EXTENSIONS
|
2007-08-08 09:46:17 -04:00
|
|
|
AC_PROG_CC_STDC
|
2004-01-30 12:19:45 -05:00
|
|
|
|
2007-02-24 16:29:27 -05:00
|
|
|
|
|
|
|
dnl SETUP
|
|
|
|
|
2007-02-28 19:10:12 -05:00
|
|
|
EXAMPLES_DIR="\$(datadir)/examples/${PACKAGE_TARNAME}"
|
|
|
|
AC_ARG_ENABLE(examplesdir,
|
|
|
|
AS_HELP_STRING([--enable-examplesdir=DIR],
|
|
|
|
[example configuration files installation directory (default: DATADIR/examples/ezstream)]),
|
|
|
|
[case "$enableval" in
|
|
|
|
yes) ;;
|
|
|
|
no) AC_MSG_ERROR([Must have an example configuration files install dir.]) ;;
|
|
|
|
*) EXAMPLES_DIR="$enableval" ;;
|
|
|
|
esac], [])
|
2007-02-24 16:59:07 -05:00
|
|
|
AC_SUBST(EXAMPLES_DIR)
|
|
|
|
|
2004-01-30 12:19:45 -05:00
|
|
|
AC_CANONICAL_HOST
|
|
|
|
|
|
|
|
if test -z "$GCC"; then
|
Various cleanups and auto-fu tweaks.
* Make Makefile.am files look alike as much as possible.
* Remove debug: target and don't mess with the users DEBUG environment
variable: Autoconf checks for -g and automatically adds it to CFLAGS, which
is overridden by the user's $DEBUG. If the user didn't specify one, "make
install" will strip the resulting binaries and leave the debugging symbols
intact otherwise.
* Remove profile: target, as it is quite pointless in Ezstream. Also, the user
can add profiling flags via the $DEBUG variable as well.
* Remove -ffast-math and -fsigned-char from gcc, and enable two additional
warnings instead.
* Unconfuse Solaris compiler flags (unfortunately, the configure script still
fails in the libshout check with some obscure linker error): Do not force
-x04 and -fast optimizations, let the user decide (it doesn't matter for
Ezstream anyways.) Remove -xgc92, which is deprecated and actually makes
the resulting binary run slower on SPARC. Also remove -fsimple, which does
not help and has the potential of causing trouble, and don't enable verbose
warnings just to disable them afterwards with -w. Leave only -v for verbose
warnings.
* Const'ify getFormat*() functions and blankString, and squelch a few const-
related warnings.
* Squelch a signedness warning and fix two ;; syntax errors.
* Add a snapshot target to Makefile.am that creates a tarball of the form
ezstream-snapshot-YYYYMMDD.tar.gz.
git-svn-id: https://svn.xiph.org/trunk/ezstream@12562 0101bb08-14d6-0310-b084-bc0e0c8e3800
2007-02-25 09:00:15 -05:00
|
|
|
case $host in
|
|
|
|
*-irix*)
|
2007-02-27 09:44:46 -05:00
|
|
|
XIPH_CPPFLAGS="-fullwarn"
|
Various cleanups and auto-fu tweaks.
* Make Makefile.am files look alike as much as possible.
* Remove debug: target and don't mess with the users DEBUG environment
variable: Autoconf checks for -g and automatically adds it to CFLAGS, which
is overridden by the user's $DEBUG. If the user didn't specify one, "make
install" will strip the resulting binaries and leave the debugging symbols
intact otherwise.
* Remove profile: target, as it is quite pointless in Ezstream. Also, the user
can add profiling flags via the $DEBUG variable as well.
* Remove -ffast-math and -fsigned-char from gcc, and enable two additional
warnings instead.
* Unconfuse Solaris compiler flags (unfortunately, the configure script still
fails in the libshout check with some obscure linker error): Do not force
-x04 and -fast optimizations, let the user decide (it doesn't matter for
Ezstream anyways.) Remove -xgc92, which is deprecated and actually makes
the resulting binary run slower on SPARC. Also remove -fsimple, which does
not help and has the potential of causing trouble, and don't enable verbose
warnings just to disable them afterwards with -w. Leave only -v for verbose
warnings.
* Const'ify getFormat*() functions and blankString, and squelch a few const-
related warnings.
* Squelch a signedness warning and fix two ;; syntax errors.
* Add a snapshot target to Makefile.am that creates a tarball of the form
ezstream-snapshot-YYYYMMDD.tar.gz.
git-svn-id: https://svn.xiph.org/trunk/ezstream@12562 0101bb08-14d6-0310-b084-bc0e0c8e3800
2007-02-25 09:00:15 -05:00
|
|
|
;;
|
|
|
|
*-solaris*)
|
|
|
|
XIPH_CPPFLAGS="-v"
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
;;
|
|
|
|
esac
|
2004-01-30 12:19:45 -05:00
|
|
|
else
|
2007-08-24 07:57:09 -04:00
|
|
|
XIPH_CPPFLAGS="-fstrict-aliasing -Wall -Wno-unused-parameter -Wwrite-strings -Wpointer-arith -Wsign-compare -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations"
|
2004-01-30 12:19:45 -05:00
|
|
|
fi
|
|
|
|
|
2007-08-02 14:48:26 -04:00
|
|
|
ez_enable_debug=no
|
|
|
|
AC_ARG_ENABLE(debug,
|
|
|
|
AS_HELP_STRING([--enable-debug],
|
|
|
|
[enable memory debugging (default: no)]),
|
|
|
|
[case "$enableval" in
|
|
|
|
no) ;;
|
|
|
|
*) ez_enable_debug=yes ;;
|
|
|
|
esac], [])
|
|
|
|
AC_MSG_CHECKING([whether to enable debugging])
|
|
|
|
if test x"$ez_enable_debug" = "xyes"; then
|
|
|
|
AC_DEFINE(XALLOC_DEBUG, 1, [Define whether to build with XALLOC debugging])
|
|
|
|
fi
|
|
|
|
AC_MSG_RESULT([$ez_enable_debug])
|
|
|
|
|
2004-01-30 12:19:45 -05:00
|
|
|
|
2007-02-24 16:50:54 -05:00
|
|
|
dnl MISC SYSTEM CHARACTERISTICS
|
|
|
|
|
2007-03-08 15:24:09 -05:00
|
|
|
dnl __progname check adapted from OpenNTPd-portable configure.ac
|
2007-02-24 16:50:54 -05:00
|
|
|
AC_MSG_CHECKING([whether libc defines __progname])
|
|
|
|
AC_LINK_IFELSE(
|
|
|
|
[AC_LANG_PROGRAM([[#include <stdio.h>]],
|
|
|
|
[[extern char *__progname; printf("%s\n", __progname); ]])],
|
|
|
|
[ac_cv_libc_defines___progname="yes"],
|
|
|
|
[ac_cv_libc_defines___progname="no"]
|
|
|
|
)
|
|
|
|
if test x"$ac_cv_libc_defines___progname" = "xyes"; then
|
|
|
|
AC_MSG_RESULT([yes])
|
|
|
|
AC_DEFINE(HAVE___PROGNAME, 1, [Define whether libc defines __progname])
|
|
|
|
else
|
|
|
|
AC_MSG_RESULT([no])
|
|
|
|
fi
|
|
|
|
|
|
|
|
AC_C_CONST
|
2007-08-08 09:46:17 -04:00
|
|
|
AC_C_VOLATILE
|
2007-02-24 16:50:54 -05:00
|
|
|
AC_TYPE_SIZE_T
|
2007-08-08 09:46:17 -04:00
|
|
|
AC_CHECK_TYPES(ssize_t, ,
|
|
|
|
[AC_DEFINE_UNQUOTED(ssize_t, long, [Define to `long' if <sys/types.h> does not define.])],
|
|
|
|
[
|
|
|
|
#ifdef HAVE_SYS_TYPES_H
|
|
|
|
# include <sys/types.h>
|
|
|
|
#endif
|
|
|
|
])
|
|
|
|
|
2007-02-24 16:50:54 -05:00
|
|
|
|
|
|
|
|
2007-02-24 16:29:27 -05:00
|
|
|
dnl USEFUL HEADERS
|
2004-01-30 12:19:45 -05:00
|
|
|
|
2007-08-24 07:57:09 -04:00
|
|
|
AC_CHECK_HEADERS(sys/time.h paths.h signal.h langinfo.h libgen.h locale.h)
|
2007-02-24 16:50:54 -05:00
|
|
|
|
2007-08-02 14:48:26 -04:00
|
|
|
COMPAT_INCLUDES=""
|
|
|
|
if test x"$ez_enable_debug" = "xyes"; then
|
|
|
|
AC_CHECK_HEADERS(sys/tree.h)
|
|
|
|
if test x"$ac_cv_header_sys_tree_h" = "xyes"; then
|
|
|
|
AC_MSG_CHECKING([for RB_FOREACH and RB_INSERT in sys/tree.h])
|
|
|
|
AC_EGREP_CPP([yes], [
|
|
|
|
#include <sys/tree.h>
|
|
|
|
#if defined(RB_FOREACH) && defined(RB_INSERT)
|
|
|
|
yes
|
|
|
|
#endif
|
|
|
|
], [
|
|
|
|
AC_MSG_RESULT([yes])
|
|
|
|
AC_DEFINE(HAVE_WORKING_SYS_TREE_H, 1,
|
|
|
|
[Define whether RB_FOREACH is defined in <sys/tree.h>])
|
|
|
|
], [
|
|
|
|
AC_MSG_RESULT([no])
|
|
|
|
COMPAT_INCLUDES="-I\$(top_srcdir)/compat"
|
|
|
|
])
|
|
|
|
else
|
|
|
|
COMPAT_INCLUDES="-I\$(top_srcdir)/compat"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
AC_SUBST(COMPAT_INCLUDES)
|
|
|
|
|
2007-02-24 16:50:54 -05:00
|
|
|
|
|
|
|
dnl LIBRARY FUNCTIONS
|
|
|
|
|
2007-02-27 09:44:46 -05:00
|
|
|
AC_CHECK_LIB(gen, basename)
|
2007-08-24 07:57:09 -04:00
|
|
|
AC_CHECK_FUNCS(arc4random gettimeofday nl_langinfo random setlocale srandomdev stat)
|
2007-03-02 07:52:10 -05:00
|
|
|
AC_REPLACE_FUNCS(getopt strlcat strlcpy strtonum)
|
2007-02-24 16:50:54 -05:00
|
|
|
if test x"$ac_cv_header_signal_h" = "xyes"; then
|
|
|
|
AC_CHECK_FUNCS([sigaction], [
|
|
|
|
AC_DEFINE(HAVE_SIGNALS, 1, [Define whether we have BSD signals])
|
|
|
|
], [], [#include <signal.h>])
|
|
|
|
fi
|
2007-08-26 10:31:40 -04:00
|
|
|
|
|
|
|
LIBICONV=""
|
|
|
|
LTLIBICONV=""
|
|
|
|
INCICONV=""
|
2007-08-24 07:57:09 -04:00
|
|
|
AM_ICONV
|
2007-08-26 10:31:40 -04:00
|
|
|
EZ_LIBICONV=""
|
|
|
|
if test -n "$LTLIBICONV"; then
|
|
|
|
EZ_LIBICONV="$LTLIBICONV"
|
|
|
|
else
|
|
|
|
EZ_LIBICONV="$LIBICONV"
|
|
|
|
fi
|
|
|
|
XIPH_VAR_PREPEND([XIPH_LIBS], [$EZ_LIBICONV])
|
|
|
|
XIPH_VAR_APPEND([XIPH_CPPFLAGS], [$INCICONV])
|
2007-02-24 16:50:54 -05:00
|
|
|
|
2004-01-30 12:19:45 -05:00
|
|
|
|
2007-02-24 16:29:27 -05:00
|
|
|
dnl CONFIGURE OPTIONS
|
2004-01-30 12:19:45 -05:00
|
|
|
|
2007-03-08 15:24:09 -05:00
|
|
|
dnl Optional: TagLib support
|
|
|
|
AC_ARG_VAR([TAGLIB_PREFIX], [path to TagLib installation])
|
|
|
|
if test -n "${TAGLIB_PREFIX}"; then
|
|
|
|
taglib_prefix="${TAGLIB_PREFIX}"
|
|
|
|
else
|
|
|
|
taglib_prefix=""
|
|
|
|
fi
|
|
|
|
use_taglib=yes
|
|
|
|
require_taglib=no
|
|
|
|
AC_ARG_WITH(taglib,
|
|
|
|
[AS_HELP_STRING([--with-taglib=PREFIX],
|
|
|
|
[Prefix where TagLib is installed (default: autodetect)])],
|
|
|
|
[case "$withval" in
|
|
|
|
yes) require_taglib=yes
|
|
|
|
if test -z "$taglib_prefix"; then
|
|
|
|
taglib_prefix=/usr/local
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
no) use_taglib=no ;;
|
|
|
|
*) require_taglib=yes
|
|
|
|
taglib_prefix="$withval"
|
|
|
|
;;
|
|
|
|
esac], [])
|
|
|
|
|
|
|
|
have_taglib=no
|
|
|
|
AC_MSG_CHECKING([for TagLib option])
|
|
|
|
if test x"$use_taglib" != "xno"; then
|
|
|
|
if test x"$require_taglib" = "xyes"; then
|
|
|
|
AC_MSG_RESULT([enabled])
|
|
|
|
else
|
|
|
|
AC_MSG_RESULT([autodetect])
|
|
|
|
fi
|
|
|
|
|
|
|
|
TAGLIB_CFLAGS=""
|
|
|
|
TAGLIB_CPPFLAGS=""
|
|
|
|
TAGLIB_LIBS="-ltag_c"
|
|
|
|
if test -n "$taglib_prefix"; then
|
|
|
|
TAGLIB_CPPFLAGS="-I${taglib_prefix}/include"
|
|
|
|
TAGLIB_LIBS="-L${taglib_prefix}/lib ${TAGLIB_LIBS}"
|
|
|
|
fi
|
|
|
|
|
|
|
|
ac_taglib_save_CFLAGS="$CFLAGS"
|
|
|
|
ac_taglib_save_CPPFLAGS="$CPPFLAGS"
|
|
|
|
ac_taglib_save_LIBS="$LIBS"
|
|
|
|
|
|
|
|
CFLAGS="${TAGLIB_CFLAGS}"
|
|
|
|
CPPFLAGS="${TAGLIB_CPPFLAGS}"
|
|
|
|
LIBS="${TAGLIB_LIBS}"
|
|
|
|
|
|
|
|
AC_CHECK_HEADERS([taglib/tag_c.h], [
|
|
|
|
AC_MSG_CHECKING([whether TagLib works])
|
|
|
|
AC_LINK_IFELSE(
|
|
|
|
[AC_LANG_PROGRAM([[#include <taglib/tag_c.h>]],
|
|
|
|
[[ taglib_set_string_management_enabled(0); ]])],
|
|
|
|
[
|
|
|
|
AC_MSG_RESULT([yes])
|
|
|
|
have_taglib=yes
|
|
|
|
], [
|
|
|
|
if test x"$require_taglib" = "xyes"; then
|
|
|
|
AC_MSG_RESULT([no])
|
|
|
|
AC_MSG_ERROR([Cannot link against libtag_c in ${taglib_prefix}/lib])
|
|
|
|
else
|
|
|
|
AC_MSG_RESULT([no])
|
|
|
|
AC_MSG_WARN([Error while linking against libtag_c in ${taglib_prefix}/lib, disabling support])
|
|
|
|
fi
|
|
|
|
]
|
|
|
|
)
|
|
|
|
], [
|
|
|
|
if test x"$require_taglib" = "xyes"; then
|
|
|
|
AC_MSG_ERROR([Cannot find taglib/tag_c.h in ${taglib_prefix}/include])
|
|
|
|
else
|
|
|
|
AC_MSG_NOTICE([No TagLib C header found on this system])
|
|
|
|
fi
|
|
|
|
])
|
|
|
|
|
|
|
|
CFLAGS="$ac_taglib_save_CFLAGS"
|
|
|
|
CPPFLAGS="$ac_taglib_save_CPPFLAGS"
|
|
|
|
LIBS="$ac_taglib_save_LIBS"
|
|
|
|
else
|
|
|
|
AC_MSG_RESULT([disabled])
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test x"$have_taglib" = "xyes"; then
|
|
|
|
AC_DEFINE(HAVE_TAGLIB, 1, [Define whether we're using TagLib])
|
|
|
|
else
|
|
|
|
TAGLIB_CFLAGS=""
|
|
|
|
TAGLIB_CPPFLAGS=""
|
|
|
|
TAGLIB_LIBS=""
|
|
|
|
fi
|
|
|
|
AC_SUBST(TAGLIB_CFLAGS)
|
|
|
|
AC_SUBST(TAGLIB_CPPFLAGS)
|
|
|
|
AC_SUBST(TAGLIB_LIBS)
|
|
|
|
|
2007-02-26 15:29:48 -05:00
|
|
|
dnl Check for Ogg Vorbis
|
|
|
|
XIPH_PATH_OGG(, AC_MSG_ERROR([Must have libogg 1.x installed.]))
|
|
|
|
XIPH_PATH_VORBIS(, AC_MSG_ERROR([Must have libvorbis 1.x installed.]))
|
|
|
|
|
|
|
|
dnl Check for libshout.
|
|
|
|
XIPH_PATH_SHOUT(, AC_MSG_ERROR([Must have libshout 2.x installed.]))
|
|
|
|
|
|
|
|
dnl Check for libxml
|
|
|
|
XIPH_PATH_XML(, AC_MSG_ERROR([Must have libxml 2.x installed.]))
|
|
|
|
|
|
|
|
dnl Assemble *FLAGS and *LIBS in the proper order.
|
|
|
|
XIPH_VAR_APPEND([XIPH_CFLAGS], [$OGG_CFLAGS])
|
|
|
|
XIPH_VAR_PREPEND([XIPH_LIBS], [$OGG_LIBS])
|
|
|
|
XIPH_VAR_APPEND([XIPH_CFLAGS], [$VORBIS_CFLAGS])
|
|
|
|
XIPH_VAR_PREPEND([XIPH_LIBS], [$VORBIS_LIBS])
|
|
|
|
XIPH_VAR_APPEND([XIPH_CFLAGS], [$VORBISFILE_CFLAGS])
|
|
|
|
XIPH_VAR_PREPEND([XIPH_LIBS], [$VORBISFILE_LIBS])
|
2004-01-30 12:19:45 -05:00
|
|
|
XIPH_VAR_APPEND([XIPH_CFLAGS], [$SHOUT_CFLAGS])
|
2007-02-26 15:29:48 -05:00
|
|
|
XIPH_VAR_APPEND([XIPH_CPPFLAGS], [$SHOUT_CPPFLAGS])
|
2004-01-30 12:19:45 -05:00
|
|
|
XIPH_VAR_PREPEND([XIPH_LIBS], [$SHOUT_LIBS])
|
2007-02-26 15:29:48 -05:00
|
|
|
XIPH_VAR_APPEND([XIPH_CFLAGS], [$XML_CFLAGS])
|
|
|
|
XIPH_VAR_PREPEND([XIPH_LIBS], [$XML_LIBS])
|
2004-01-30 12:19:45 -05:00
|
|
|
|
2007-02-24 16:29:27 -05:00
|
|
|
|
|
|
|
dnl OUTPUT
|
2004-01-30 12:19:45 -05:00
|
|
|
|
2007-02-24 16:37:06 -05:00
|
|
|
AC_CONFIG_FILES(Makefile \
|
2007-08-23 20:52:13 -04:00
|
|
|
build-aux/Makefile \
|
2007-08-02 14:48:26 -04:00
|
|
|
compat/Makefile \
|
|
|
|
compat/sys/Makefile \
|
2007-02-24 16:37:06 -05:00
|
|
|
doc/Makefile \
|
2007-03-10 15:13:56 -05:00
|
|
|
examples/Makefile \
|
2007-02-26 14:59:19 -05:00
|
|
|
m4/Makefile \
|
2007-02-24 16:37:06 -05:00
|
|
|
src/Makefile \
|
|
|
|
win32/Makefile)
|
|
|
|
|
2004-01-30 12:19:45 -05:00
|
|
|
AC_SUBST(XIPH_CPPFLAGS)
|
|
|
|
AC_SUBST(XIPH_CFLAGS)
|
|
|
|
AC_SUBST(XIPH_LIBS)
|
|
|
|
AC_SUBST(LIBS)
|
|
|
|
AC_SUBST(CFLAGS)
|
|
|
|
|
2007-02-24 16:37:06 -05:00
|
|
|
AC_OUTPUT
|