1
0
mirror of https://gitlab.xiph.org/xiph/ezstream.git synced 2024-06-02 06:01:10 +00:00
ezstream/configure.ac

263 lines
5.8 KiB
Plaintext
Raw Normal View History

dnl ###########
dnl ## SETUP ###########################################################
dnl ###########
AC_INIT([ezstream], [1.1.0], [https://gitlab.xiph.org/xiph/ezstream/issues])
2022-08-20 21:00:30 +00:00
AC_PREREQ([2.69])
AC_CONFIG_SRCDIR([src/ezstream.c])
AC_CONFIG_AUX_DIR([build-aux])
AM_INIT_AUTOMAKE
AC_CONFIG_HEADERS([src/config.h])
AC_CONFIG_LIBOBJ_DIR([compat])
AM_MAINTAINER_MODE
AC_USE_SYSTEM_EXTENSIONS
AC_PROG_CC_STDC
AC_PROG_FGREP
AC_CANONICAL_HOST
2022-08-20 23:26:56 +00:00
SOURCE_DATE=$(date '+%B %d, %Y')
if test -n "${SOURCE_DATE_EPOCH}"; then
if test -n "$(date --version 2> /dev/null | head -n 1 | grep GNU)"; then
SOURCE_DATE="$(LC_ALL=C date -u -d "@${SOURCE_DATE_EPOCH}" '+%B %d, %Y')"
else
# Assume BSD date
SOURCE_DATE="$(LC_ALL=C date -u -r "${SOURCE_DATE_EPOCH}" '+%B %d, %Y')"
fi
fi
AC_SUBST([SOURCE_DATE])
EXAMPLES_DIR="\$(datadir)/examples/${PACKAGE_TARNAME}"
AC_ARG_ENABLE([examplesdir],
[AS_HELP_STRING([--enable-examplesdir=DIR],
[examples installation directory (default: DATADIR/examples/ezstream)])],
[case "$enableval" in
yes) ;;
no) AC_MSG_ERROR([Must have an install directory for the examples.]) ;;
*) EXAMPLES_DIR="$enableval" ;;
esac], [])
AC_SUBST([EXAMPLES_DIR])
2022-08-20 21:00:30 +00:00
LT_INIT
AC_SUBST([LIBTOOL_DEPS])
EZ_CFLAGS=""
EZ_CPPFLAGS=""
EZ_LDFLAGS=""
EZ_LIBS=""
AC_SYS_LARGEFILE
PKG_CHECK_MODULES([CHECK], [check >= 0.9.4])
dnl ##############
dnl ## COMPILER ########################################################
dnl ##############
if test -n "${GCC}"; then
for _flag in Wall W Wshadow Wconversion 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 14:00:15 +00:00
*-irix*)
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 14:00:15 +00:00
;;
*-solaris*)
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 14:00:15 +00:00
;;
*)
;;
esac
fi
2015-04-15 21:17:20 +00:00
have_attributes=no
CFG_ATTRIBUTE_UNUSED=0
AX_FUNC_ATTRIBUTE_UNUSED([
CFG_ATTRIBUTE_UNUSED=1
have_attributes=yes
], [])
AC_SUBST([CFG_ATTRIBUTE_UNUSED])
CFG_HAVE_ATTRIBUTES=0
CFG_ATTRIBUTE_FORMAT=0
CFG_ATTRIBUTE_NONNULL=0
if test x"${have_attributes}" = "xyes"; then
CFG_HAVE_ATTRIBUTES=1
AX_FUNC_ATTRIBUTE([const char *a, ...],
[format], [(printf, 1, 2)],
[CFG_ATTRIBUTE_FORMAT=1], [])
AX_FUNC_ATTRIBUTE([const char *a],
[nonnull], [(1)],
[CFG_ATTRIBUTE_NONNULL=1], [])
fi
AC_SUBST([CFG_HAVE_ATTRIBUTES])
AC_SUBST([CFG_ATTRIBUTE_FORMAT])
AC_SUBST([CFG_ATTRIBUTE_NONNULL])
AC_C_CONST
AC_C_VOLATILE
2021-02-08 21:10:13 +00:00
want_asan="no"
AC_ARG_WITH([asan],
[AS_HELP_STRING([--with-asan=yes],
[build with AddressSanitizer (for debugging) (default: no)])],
[
case "${withval}" in
no)
;;
*)
want_asan="yes"
;;
esac
]
)
if test x"${want_asan}" = "xyes"; then
AX_UNIQVAR_APPEND([EZ_CFLAGS], [-fsanitize=address -fno-omit-frame-pointer])
AX_UNIQVAR_APPEND([EZ_LDFLAGS], [-fsanitize=address -fno-omit-frame-pointer])
fi
dnl #############
dnl ## HEADERS #########################################################
dnl #############
AC_CHECK_HEADERS([ \
sys/random.h sys/time.h libgen.h paths.h \
], [], [],
[
#ifdef HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif
])
dnl ###########
dnl ## TYPES ###########################################################
dnl ###########
AC_TYPE_SIZE_T
AC_TYPE_SSIZE_T
dnl ###############
dnl ## LIBRARIES #######################################################
dnl ###############
AC_CHECK_LIB([gen], [basename],
2021-02-08 21:10:13 +00:00
[AX_UNIQVAR_PREPEND([EZ_LIBS], [-lgen]) ])
AX_CHECK_LIBSHOUT([], [],
[AC_MSG_ERROR([libshout is missing], [1])])
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 is missing], [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}])
AX_CHECK_TAGLIB_C([], [],
[AC_MSG_ERROR([libtag_c is missing], [1])])
AX_UNIQVAR_APPEND([EZ_CFLAGS], [${TAGLIB_CFLAGS}])
AX_UNIQVAR_APPEND([EZ_CPPFLAGS], [${TAGLIB_CPPFLAGS}])
AX_UNIQVAR_APPEND([EZ_LDFLAGS], [${TAGLIB_LDFLAGS}])
AX_UNIQVAR_PREPEND([EZ_LIBS], [${TAGLIB_C_LIBS}])
EZ_LIBICONV=""
AM_ICONV
if test -n "${LTLIBICONV}"; then
EZ_LIBICONV="${LTLIBICONV}"
else
EZ_LIBICONV="${LIBICONV}"
fi
AX_UNIQVAR_APPEND([EZ_CPPFLAGS], [$INCICONV])
AX_UNIQVAR_PREPEND([EZ_LIBS], [$EZ_LIBICONV])
use_iconv="No"
if test x"${am_cv_func_iconv}" = "xyes"; then
use_iconv="Yes"
fi
dnl #######################
dnl ## FUNCTIONS / MACROS ##############################################
dnl #######################
AC_CHECK_FUNCS([ \
arc4random \
getrandom \
])
AC_REPLACE_FUNCS([ \
getopt \
reallocarray \
strlcat \
strlcpy \
strtonum \
])
AC_CHECK_FUNC([clock_gettime], [], [
AC_CHECK_LIB([rt], [clock_gettime], [
AX_UNIQVAR_PREPEND([EZ_LIBS], [-lrt])
])
])
dnl ##################
dnl ## MISCELLANEOUS ###################################################
dnl ##################
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
doc/Makefile
2018-01-23 00:51:48 +00:00
doc/ezstream-cfgmigrate.1.in
doc/ezstream-file.sh.1.in
doc/ezstream.1.in
examples/Makefile
m4/Makefile
src/Makefile
2015-04-15 21:17:20 +00:00
src/attr_config.h
src/ezstream-file.sh
tests/Makefile
])
AC_OUTPUT
cat << __EOT
${PACKAGE_STRING} has been configured successfully.
Configuration:
2021-02-10 23:50:22 +00:00
Charset conversion support ......... : ${use_iconv}
Prefix ............................. : ${prefix}
AddressSanitizer (for debugging) ... : ${want_asan}
__EOT