2009-03-15 20:08:31 -04:00
|
|
|
dnl ###########
|
|
|
|
dnl ## SETUP ###########################################################
|
|
|
|
dnl ###########
|
|
|
|
|
|
|
|
AC_INIT([ezstream], [0.5.4],
|
|
|
|
[https://trac.xiph.org/newticket?component=ezstream])
|
2009-03-17 14:20:58 -04:00
|
|
|
AC_REVISION([$Id$])
|
2009-03-15 20:08:31 -04:00
|
|
|
AC_PREREQ([2.61])
|
|
|
|
AC_CONFIG_SRCDIR([src/ezstream.c])
|
|
|
|
AC_CONFIG_AUX_DIR([build-aux])
|
2004-01-30 12:19:45 -05:00
|
|
|
AM_INIT_AUTOMAKE
|
2009-03-15 20:08:31 -04:00
|
|
|
AC_CONFIG_HEADERS([src/config.h])
|
|
|
|
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
|
2009-03-15 20:08:31 -04:00
|
|
|
AC_PROG_FGREP
|
|
|
|
AC_CANONICAL_HOST
|
2007-02-24 16:29:27 -05:00
|
|
|
|
2007-02-28 19:10:12 -05:00
|
|
|
EXAMPLES_DIR="\$(datadir)/examples/${PACKAGE_TARNAME}"
|
2009-03-15 20:08:31 -04:00
|
|
|
AC_ARG_ENABLE([examplesdir],
|
|
|
|
[AS_HELP_STRING([--enable-examplesdir=DIR],
|
|
|
|
[examples installation directory (default: DATADIR/examples/ezstream)])],
|
2007-02-28 19:10:12 -05:00
|
|
|
[case "$enableval" in
|
|
|
|
yes) ;;
|
2009-03-15 20:08:31 -04:00
|
|
|
no) AC_MSG_ERROR([Must have an install directory for the examples.]) ;;
|
2007-02-28 19:10:12 -05:00
|
|
|
*) EXAMPLES_DIR="$enableval" ;;
|
|
|
|
esac], [])
|
2009-03-15 20:08:31 -04:00
|
|
|
AC_SUBST([EXAMPLES_DIR])
|
2007-02-24 16:59:07 -05:00
|
|
|
|
2009-03-15 20:08:31 -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
|
|
|
|
2009-03-15 20:08:31 -04:00
|
|
|
EZ_CFLAGS=""
|
|
|
|
EZ_CPPFLAGS=""
|
|
|
|
EZ_LDFLAGS=""
|
|
|
|
EZ_LIBS=""
|
|
|
|
|
|
|
|
|
|
|
|
dnl ##############
|
|
|
|
dnl ## COMPILER ########################################################
|
|
|
|
dnl ##############
|
|
|
|
|
|
|
|
if test -n "${GCC}"; then
|
|
|
|
for _flag in fstack-protector fstrict-aliasing Wall W Wstrict-aliasing \
|
|
|
|
Wwrite-strings Wpointer-arith Wshadow Wconversion Wcast-qual \
|
|
|
|
Wcast-align Wbounded Wmissing-declarations Wmissing-prototypes \
|
|
|
|
Wstrict-prototypes
|
|
|
|
do
|
|
|
|
AX_CHECK_CFLAG([${_flag}],
|
|
|
|
[ AX_UNIQVAR_APPEND([EZ_CFLAGS], [-${_flag}]) ], [])
|
|
|
|
done
|
|
|
|
AX_CHECK_CFLAG([Wformat=2],
|
|
|
|
[ AX_UNIQVAR_APPEND([EZ_CFLAGS], [-Wformat=2]) ],
|
|
|
|
[
|
|
|
|
AX_CHECK_CFLAG([Wformat],
|
|
|
|
[ AX_UNIQVAR_APPEND([EZ_CFLAGS], [-Wformat]) ], [])
|
|
|
|
])
|
|
|
|
else
|
|
|
|
case "${host}" in
|
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
|
|
|
*-irix*)
|
2009-03-15 20:08:31 -04:00
|
|
|
EZ_CFLAGS="-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*)
|
2009-03-15 20:08:31 -04:00
|
|
|
EZ_CFLAGS="-v"
|
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
|
|
|
;;
|
|
|
|
*)
|
|
|
|
;;
|
|
|
|
esac
|
2004-01-30 12:19:45 -05:00
|
|
|
fi
|
|
|
|
|
2009-03-15 20:08:31 -04:00
|
|
|
AC_C_CONST
|
|
|
|
AC_C_VOLATILE
|
2007-08-02 14:48:26 -04:00
|
|
|
|
2004-01-30 12:19:45 -05:00
|
|
|
|
2009-03-15 20:08:31 -04:00
|
|
|
dnl #############
|
|
|
|
dnl ## HEADERS #########################################################
|
|
|
|
dnl #############
|
2004-01-30 12:19:45 -05:00
|
|
|
|
2009-03-15 20:08:31 -04:00
|
|
|
AC_CHECK_HEADERS([ \
|
|
|
|
sys/time.h signal.h langinfo.h libgen.h locale.h paths.h \
|
|
|
|
], [], [],
|
|
|
|
[
|
|
|
|
#ifdef HAVE_SYS_TYPES_H
|
|
|
|
# include <sys/types.h>
|
|
|
|
#endif
|
|
|
|
])
|
2007-02-24 16:50:54 -05:00
|
|
|
|
2007-08-02 14:48:26 -04:00
|
|
|
COMPAT_INCLUDES=""
|
2009-03-15 20:08:31 -04:00
|
|
|
if test x"${ez_enable_debug}" = "xyes"; then
|
|
|
|
AX_HEADER_TREE([RB_FOREACHx], [],
|
|
|
|
[
|
|
|
|
COMPAT_INCLUDES="-I\$(top_srcdir)/compat"
|
2007-08-02 14:48:26 -04:00
|
|
|
])
|
2007-08-31 07:47:54 -04:00
|
|
|
fi
|
2009-03-15 20:08:31 -04:00
|
|
|
AC_SUBST([COMPAT_INCLUDES])
|
|
|
|
|
|
|
|
|
|
|
|
dnl ###########
|
|
|
|
dnl ## TYPES ###########################################################
|
|
|
|
dnl ###########
|
2007-08-31 07:47:54 -04:00
|
|
|
|
|
|
|
AC_TYPE_SIZE_T
|
|
|
|
AC_TYPE_SSIZE_T
|
2009-03-15 20:08:31 -04:00
|
|
|
|
2007-08-31 07:47:54 -04:00
|
|
|
AC_CHECK_TYPES(struct timeval, , ,
|
|
|
|
[
|
|
|
|
#ifdef HAVE_SYS_TIME_H
|
|
|
|
# include <sys/time.h>
|
|
|
|
#endif
|
|
|
|
])
|
|
|
|
|
|
|
|
|
2009-03-15 20:08:31 -04:00
|
|
|
dnl ###############
|
|
|
|
dnl ## LIBRARIES #######################################################
|
|
|
|
dnl ###############
|
|
|
|
|
|
|
|
AC_CHECK_LIB([gen], [basename],
|
|
|
|
[ AX_UNIQVAR_PREPEND([EZ_LIBS], [-lgen]) ])
|
|
|
|
|
|
|
|
AX_CHECK_LIBSHOUT([], [],
|
2009-03-16 18:59:28 -04:00
|
|
|
[AC_MSG_ERROR([libshout 2.2.x is required.], [1])])
|
2009-03-15 20:08:31 -04:00
|
|
|
AX_UNIQVAR_APPEND([EZ_CPPFLAGS], [${LIBSHOUT_CPPFLAGS}])
|
|
|
|
AX_UNIQVAR_APPEND([EZ_CFLAGS], [${LIBSHOUT_CFLAGS}])
|
|
|
|
AX_UNIQVAR_APPEND([EZ_LDFLAGS], [${LIBSHOUT_LDFLAGS}])
|
|
|
|
AX_UNIQVAR_PREPEND([EZ_LIBS], [${LIBSHOUT_LIBS}])
|
|
|
|
|
|
|
|
AX_CHECK_LIBXML2([], [],
|
|
|
|
[AC_MSG_ERROR([libxml 2.x is required.], [1])])
|
|
|
|
AX_UNIQVAR_APPEND([EZ_CPPFLAGS], [${LIBXML2_CPPFLAGS}])
|
|
|
|
AX_UNIQVAR_APPEND([EZ_CFLAGS], [${LIBXML2_CFLAGS}])
|
|
|
|
AX_UNIQVAR_APPEND([EZ_LDFLAGS], [${LIBXML2_LDFLAGS}])
|
|
|
|
AX_UNIQVAR_PREPEND([EZ_LIBS], [${LIBXML2_LIBS}])
|
|
|
|
|
2009-03-16 18:59:28 -04:00
|
|
|
use_metadata="No"
|
2009-03-15 20:40:26 -04:00
|
|
|
AX_CHECK_TAGLIB_C([], [
|
2009-03-15 20:08:31 -04:00
|
|
|
AC_DEFINE([HAVE_TAGLIB], [1],
|
|
|
|
[Define to 1 if you have the libtag_c library.]
|
|
|
|
)
|
2009-03-15 20:40:26 -04:00
|
|
|
AX_UNIQVAR_APPEND([EZ_CFLAGS], [${TAGLIB_CFLAGS}])
|
|
|
|
AX_UNIQVAR_APPEND([EZ_CPPFLAGS], [${TAGLIB_CPPFLAGS}])
|
2009-03-15 20:08:31 -04:00
|
|
|
AX_UNIQVAR_APPEND([EZ_LDFLAGS], [${TAGLIB_LDFLAGS}])
|
|
|
|
AX_UNIQVAR_PREPEND([EZ_LIBS], [${TAGLIB_C_LIBS}])
|
2009-03-16 18:59:28 -04:00
|
|
|
use_metadata="TagLib"
|
|
|
|
], [
|
|
|
|
AX_CHECK_LIBVORBISFILE([], [
|
|
|
|
AC_DEFINE([HAVE_VORBISFILE], [1],
|
|
|
|
[Define to 1 if you have the libvorbisfile library.])
|
|
|
|
AX_UNIQVAR_APPEND([EZ_CPPFLAGS], [${VORBIS_CPPFLAGS}])
|
|
|
|
AX_UNIQVAR_APPEND([EZ_CFLAGS], [${VORBIS_CFLAGS}])
|
|
|
|
AX_UNIQVAR_APPEND([EZ_LDFLAGS], [${VORBIS_LDFLAGS}])
|
|
|
|
AX_UNIQVAR_PREPEND([EZ_LIBS], [${LIBVORBISFILE_LIBS}])
|
|
|
|
use_metadata="libvorbis"
|
|
|
|
], [])
|
|
|
|
])
|
2009-03-15 20:08:31 -04:00
|
|
|
|
|
|
|
# Not using AM_ICONV to check for iconv(), with or without libiconv(),
|
|
|
|
# is not a viable option. Something in the past went horribly wrong;
|
|
|
|
# the whole topic is extremely complex and not worth rewriting.
|
|
|
|
# Instead, work around the buggy no-op that is --with-libiconv-prefix,
|
|
|
|
# and at least try to find it in --prefix. Thankfully, it is and will
|
|
|
|
# remain optional in ezstream.
|
2007-08-26 10:31:40 -04:00
|
|
|
|
2009-03-15 20:08:31 -04:00
|
|
|
INCICONV=""
|
|
|
|
LDICONV=""
|
2007-08-26 10:31:40 -04:00
|
|
|
LIBICONV=""
|
|
|
|
LTLIBICONV=""
|
|
|
|
EZ_LIBICONV=""
|
2009-03-15 20:08:31 -04:00
|
|
|
AM_ICONV
|
|
|
|
if test x"${am_cv_func_iconv}" != "xyes"; then
|
|
|
|
unset am_cv_func_iconv
|
|
|
|
unset am_cv_lib_iconv
|
|
|
|
if test x"${prefix}" = "xNONE"; then
|
|
|
|
libiconv_prefix="/usr/local"
|
|
|
|
else
|
|
|
|
libiconv_prefix="${prefix}"
|
|
|
|
fi
|
|
|
|
AC_MSG_NOTICE([Looking for libiconv in ${libiconv_prefix} ...])
|
|
|
|
libiconv_save_CPPFLAGS="${CPPFLAGS}"
|
|
|
|
libiconv_save_LDFLAGS="${LDFLAGS}"
|
|
|
|
libiconv_save_LIBS="${LIBS}"
|
|
|
|
CPPFLAGS="${CPPFLAGS} -I${libiconv_prefix}/include"
|
|
|
|
LDFLAGS="${LDFLAGS} -L${libiconv_prefix}/lib"
|
|
|
|
LIBS="-liconv"
|
|
|
|
AM_ICONV
|
|
|
|
if test x"${am_cv_func_iconv}" = "xyes"; then
|
|
|
|
INCICONV="-I${libiconv_prefix}/include"
|
|
|
|
LDICONV="-L${libiconv_prefix}/lib"
|
|
|
|
LIBICONV="-liconv"
|
|
|
|
fi
|
|
|
|
CPPFLAGS="${libiconv_save_CPPFLAGS}"
|
|
|
|
LDFLAGS="${libiconv_save_LDFLAGS}"
|
|
|
|
LIBS="${libiconv_save_LIBS}"
|
|
|
|
fi
|
|
|
|
if test -n "${LTLIBICONV}"; then
|
|
|
|
EZ_LIBICONV="${LTLIBICONV}"
|
2007-08-26 10:31:40 -04:00
|
|
|
else
|
2009-03-15 20:08:31 -04:00
|
|
|
EZ_LIBICONV="${LIBICONV}"
|
|
|
|
fi
|
|
|
|
AX_UNIQVAR_APPEND([EZ_CPPFLAGS], [$INCICONV])
|
|
|
|
AX_UNIQVAR_APPEND([EZ_LDFLAGS], [$LDICONV])
|
|
|
|
AX_UNIQVAR_PREPEND([EZ_LIBS], [$EZ_LIBICONV])
|
|
|
|
use_iconv="No"
|
|
|
|
if test x"${am_cv_func_iconv}" = "xyes"; then
|
|
|
|
use_iconv="Yes"
|
2007-08-26 10:31:40 -04:00
|
|
|
fi
|
2007-02-24 16:50:54 -05:00
|
|
|
|
2004-01-30 12:19:45 -05:00
|
|
|
|
2009-03-15 20:08:31 -04:00
|
|
|
dnl #######################
|
|
|
|
dnl ## FUNCTIONS / MACROS ##############################################
|
|
|
|
dnl #######################
|
2004-01-30 12:19:45 -05:00
|
|
|
|
2009-03-15 20:08:31 -04:00
|
|
|
AC_CHECK_FUNCS([ \
|
|
|
|
arc4random \
|
|
|
|
gettimeofday \
|
2009-03-16 16:12:29 -04:00
|
|
|
getopt \
|
2009-03-15 20:08:31 -04:00
|
|
|
nl_langinfo \
|
|
|
|
random \
|
|
|
|
setlocale \
|
|
|
|
srandomdev \
|
|
|
|
stat \
|
|
|
|
])
|
2007-03-08 15:24:09 -05:00
|
|
|
|
2009-03-15 20:08:31 -04:00
|
|
|
AC_REPLACE_FUNCS([ \
|
|
|
|
strlcat \
|
|
|
|
strlcpy \
|
|
|
|
strtonum \
|
|
|
|
])
|
2007-03-08 15:24:09 -05:00
|
|
|
|
2009-03-15 20:08:31 -04:00
|
|
|
AX_FUNC_VA_COPY
|
2007-03-08 15:24:09 -05:00
|
|
|
|
2009-03-15 20:08:31 -04:00
|
|
|
AC_CHECK_FUNCS([sigaction], [
|
|
|
|
AC_DEFINE([HAVE_SIGNALS], [1],
|
|
|
|
[Define to 1 if we have BSD signals.])
|
|
|
|
], [], [
|
|
|
|
#ifdef HAVE_SIGNAL_H
|
|
|
|
# include <signal.h>
|
|
|
|
#endif
|
|
|
|
])
|
2007-03-08 15:24:09 -05:00
|
|
|
|
2007-08-31 11:55:16 -04:00
|
|
|
|
2009-03-15 20:08:31 -04:00
|
|
|
dnl ##################
|
|
|
|
dnl ## MISCELLANEOUS ###################################################
|
|
|
|
dnl ##################
|
2007-03-08 15:24:09 -05:00
|
|
|
|
2009-03-15 20:08:31 -04:00
|
|
|
AX_CHECK___PROGNAME
|
|
|
|
|
|
|
|
|
|
|
|
dnl ############
|
|
|
|
dnl ## OUTPUT ##########################################################
|
|
|
|
dnl ############
|
|
|
|
|
|
|
|
AC_SUBST([EZ_CPPFLAGS])
|
|
|
|
AC_SUBST([EZ_CFLAGS])
|
|
|
|
AC_SUBST([EZ_LDFLAGS])
|
|
|
|
AC_SUBST([EZ_LIBS])
|
|
|
|
|
|
|
|
AC_CONFIG_FILES([
|
|
|
|
Makefile
|
|
|
|
build-aux/Makefile
|
|
|
|
compat/Makefile
|
|
|
|
compat/sys/Makefile
|
|
|
|
doc/Makefile
|
|
|
|
examples/Makefile
|
|
|
|
m4/Makefile
|
|
|
|
src/Makefile
|
|
|
|
win32/Makefile
|
|
|
|
])
|
2004-01-30 12:19:45 -05:00
|
|
|
|
2007-02-24 16:37:06 -05:00
|
|
|
AC_OUTPUT
|
2009-03-15 20:08:31 -04:00
|
|
|
|
|
|
|
cat << __EOT
|
|
|
|
|
|
|
|
${PACKAGE_STRING} has been configured successfully.
|
|
|
|
|
|
|
|
Configuration:
|
2009-03-16 18:59:28 -04:00
|
|
|
Ogg Vorbis metadata support ... : ${use_metadata}
|
|
|
|
Charset conversion support .... : ${use_iconv}
|
|
|
|
Prefix ........................ : ${prefix}
|
2009-03-15 20:08:31 -04:00
|
|
|
|
|
|
|
__EOT
|