2017-11-17 04:07:01 -05:00
|
|
|
AC_INIT([Icecast], [2.4.99.2], [icecast@xiph.org])
|
2003-07-24 12:21:22 -04:00
|
|
|
|
2015-11-28 07:22:05 -05:00
|
|
|
AC_PREREQ([2.54])
|
2017-10-18 06:23:24 -04:00
|
|
|
|
2015-11-28 07:22:05 -05:00
|
|
|
AC_CONFIG_SRCDIR([src/main.c])
|
2015-11-28 07:43:00 -05:00
|
|
|
AC_CONFIG_MACRO_DIR([m4])
|
2017-10-18 06:23:24 -04:00
|
|
|
AC_CONFIG_AUX_DIR([build-aux])
|
2001-09-09 22:21:46 -04:00
|
|
|
|
|
|
|
AC_PROG_CC
|
2018-06-16 11:12:34 -04:00
|
|
|
|
|
|
|
AX_CHECK_COMPILE_FLAG([-std=c99], [
|
|
|
|
AX_APPEND_FLAG([-std=c99])
|
|
|
|
], [
|
|
|
|
AC_MSG_WARN([Compiler does not accept -std=c99 flag!])
|
|
|
|
])
|
|
|
|
|
2017-10-18 06:23:24 -04:00
|
|
|
AC_PROG_CC_C99
|
|
|
|
|
|
|
|
AS_IF([test "${ac_cv_prog_cc_c99}" = "no"], [
|
|
|
|
AC_MSG_ERROR([No C99 compiler found!])
|
|
|
|
])
|
|
|
|
|
2018-07-11 06:10:11 -04:00
|
|
|
dnl With clang, we want an error for unknown flags instead of just warn
|
|
|
|
AX_APPEND_COMPILE_FLAGS([-Werror=unknown-warning-option -Werror=invalid-command-line-argument])
|
|
|
|
|
2018-10-17 06:13:03 -04:00
|
|
|
AX_APPEND_COMPILE_FLAGS([-Wall -Wextra -Wno-unused-parameter])
|
|
|
|
|
2007-09-12 21:59:33 -04:00
|
|
|
AC_SYS_LARGEFILE
|
2018-06-16 09:27:20 -04:00
|
|
|
AC_DEFINE([_GNU_SOURCE], 1, [Define to include GNU extensions to POSIX])
|
2001-09-09 22:21:46 -04:00
|
|
|
|
2017-10-18 06:23:24 -04:00
|
|
|
dnl Set build/host to default values
|
|
|
|
AC_CANONICAL_HOST
|
|
|
|
AC_CANONICAL_BUILD
|
2001-09-09 22:21:46 -04:00
|
|
|
|
2018-07-11 06:10:57 -04:00
|
|
|
dnl Check for which host we are compiling
|
|
|
|
AS_CASE("${host_os}",
|
|
|
|
[linux*], [SYS="linux"],
|
|
|
|
[darwin*], [SYS="darwin"],
|
|
|
|
[SYS="${host_os}"]
|
|
|
|
)
|
2001-09-09 22:21:46 -04:00
|
|
|
|
2018-08-16 09:24:31 -04:00
|
|
|
AM_INIT_AUTOMAKE([tar-ustar foreign dist-zip subdir-objects])
|
2018-05-29 07:57:25 -04:00
|
|
|
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
|
2017-10-18 06:23:24 -04:00
|
|
|
|
|
|
|
AM_MAINTAINER_MODE([enable])
|
|
|
|
|
|
|
|
LT_INIT
|
2001-09-09 22:21:46 -04:00
|
|
|
|
2018-07-09 01:38:52 -04:00
|
|
|
|
|
|
|
dnl Sanitizer flags
|
|
|
|
|
|
|
|
AC_ARG_WITH([sanitizer],
|
|
|
|
[AS_HELP_STRING([--with-sanitizer=(address/memory/undefined/thread)],
|
|
|
|
[build with sanitizer flags (default disabled)])],
|
|
|
|
[],
|
|
|
|
[with_sanitizer=no])
|
|
|
|
|
|
|
|
AS_VAR_IF(with_sanitizer, no, [], [
|
|
|
|
AX_CHECK_COMPILE_FLAG([-fsanitize=${with_sanitizer}], [
|
|
|
|
AX_APPEND_FLAG([-fsanitize=${with_sanitizer}])
|
|
|
|
AX_APPEND_FLAG([-fsanitize=${with_sanitizer}], [LDFLAGS])
|
|
|
|
], [
|
|
|
|
AC_MSG_ERROR(["-fsanitize=${with_sanitizer} not supported!"])
|
|
|
|
])
|
|
|
|
AX_APPEND_FLAG([-g])
|
|
|
|
|
2018-07-11 06:17:31 -04:00
|
|
|
AS_CASE("${with_sanitizer}",
|
|
|
|
[address], [
|
|
|
|
AX_APPEND_COMPILE_FLAGS([-fsanitize-address-use-after-scope -fno-omit-frame-pointer -fsanitize=pointer-compare -fsanitize=pointer-subtract])
|
|
|
|
],
|
|
|
|
[memory], [
|
2018-07-09 01:38:52 -04:00
|
|
|
AX_APPEND_COMPILE_FLAGS([-fPIE -pie])
|
2018-07-11 06:17:31 -04:00
|
|
|
],
|
|
|
|
[thread], [
|
2018-07-09 01:38:52 -04:00
|
|
|
AX_APPEND_COMPILE_FLAGS([-fPIE -pie])
|
2018-07-11 06:17:31 -04:00
|
|
|
],
|
|
|
|
[]
|
|
|
|
)
|
2018-07-09 01:38:52 -04:00
|
|
|
])
|
|
|
|
|
2018-06-17 08:14:40 -04:00
|
|
|
dnl Check for attributes
|
|
|
|
AX_GCC_TYPE_ATTRIBUTE([transparent_union])
|
|
|
|
|
2001-09-09 22:21:46 -04:00
|
|
|
dnl Checks for header files.
|
2018-05-28 09:19:32 -04:00
|
|
|
AC_HEADER_ASSERT
|
2001-09-09 22:21:46 -04:00
|
|
|
AC_HEADER_STDC
|
2008-04-18 22:04:17 -04:00
|
|
|
AC_HEADER_TIME
|
2001-09-09 22:21:46 -04:00
|
|
|
|
2017-10-18 06:23:24 -04:00
|
|
|
AC_CHECK_HEADERS([stdint.h inttypes.h], [
|
|
|
|
ice_found_int_headers="yes";
|
|
|
|
break;
|
|
|
|
])
|
|
|
|
|
|
|
|
AS_IF([test "$ice_found_int_headers" != "yes"], [
|
|
|
|
AC_MSG_ERROR([Unable to find the standard integers headers])
|
|
|
|
])
|
|
|
|
|
|
|
|
AC_CHECK_HEADERS([sys/types.h])
|
|
|
|
AC_CHECK_HEADERS([sys/timeb.h])
|
|
|
|
AC_CHECK_HEADERS([sys/socket.h])
|
|
|
|
AC_CHECK_HEADERS([pwd.h grp.h])
|
2021-10-31 06:03:56 -04:00
|
|
|
AC_CHECK_HEADERS([sys/resource.h])
|
2017-10-18 06:23:24 -04:00
|
|
|
|
2020-10-21 12:50:11 -04:00
|
|
|
AC_C_BIGENDIAN
|
|
|
|
|
2017-10-18 06:23:24 -04:00
|
|
|
XIPH_NET
|
|
|
|
|
|
|
|
dnl Check for functions
|
|
|
|
AC_FUNC_FORK
|
|
|
|
AC_FUNC_CHOWN
|
|
|
|
|
2012-10-10 20:26:38 -04:00
|
|
|
AC_CHECK_FUNCS([setuid])
|
|
|
|
AC_CHECK_FUNCS([chroot])
|
2014-01-12 07:29:27 -05:00
|
|
|
AC_CHECK_FUNCS([strcasestr])
|
2014-11-20 13:41:42 -05:00
|
|
|
AC_CHECK_FUNCS([gethostname])
|
|
|
|
AC_CHECK_FUNCS([uname])
|
2014-11-21 04:28:29 -05:00
|
|
|
AC_CHECK_FUNCS([setenv])
|
2014-11-29 05:34:07 -05:00
|
|
|
AC_CHECK_FUNCS([setresuid])
|
|
|
|
AC_CHECK_FUNCS([setresgid])
|
2017-10-18 06:23:24 -04:00
|
|
|
AC_CHECK_FUNCS([localtime_r])
|
|
|
|
AC_CHECK_FUNCS([gettimeofday])
|
|
|
|
AC_CHECK_FUNCS([ftime])
|
2021-10-31 06:03:56 -04:00
|
|
|
AC_CHECK_FUNCS([getrlimit])
|
2017-10-18 06:23:24 -04:00
|
|
|
|
2018-07-11 06:11:50 -04:00
|
|
|
dnl Do not check for poll on Darwin, it is broken in some versions
|
|
|
|
AS_IF([test "${SYS}" != "darwin"], [
|
|
|
|
AC_CHECK_FUNCS([poll])
|
|
|
|
])
|
|
|
|
|
2017-10-18 06:23:24 -04:00
|
|
|
AC_SEARCH_LIBS([nanosleep], [rt posix4], [
|
|
|
|
AC_DEFINE([HAVE_NANOSLEEP], [1], [Define if you have nanosleep])
|
|
|
|
])
|
|
|
|
|
|
|
|
dnl Checks for types and typedefs
|
|
|
|
AC_TYPE_OFF_T
|
|
|
|
AC_TYPE_PID_T
|
|
|
|
AC_TYPE_SIZE_T
|
|
|
|
AC_TYPE_SSIZE_T
|
|
|
|
AC_TYPE_UID_T
|
|
|
|
|
|
|
|
dnl Checks for required libraries
|
|
|
|
|
|
|
|
dnl
|
|
|
|
dnl libxml2
|
|
|
|
dnl
|
|
|
|
PKG_CHECK_MODULES([LIBXML2], [libxml-2.0], [], [
|
|
|
|
AC_MSG_ERROR([${LIBXML2_PKG_ERRORS}. libxml2 is required.])
|
|
|
|
])
|
|
|
|
|
|
|
|
CFLAGS="${CFLAGS} ${LIBXML2_CFLAGS}"
|
|
|
|
LIBS="${LIBS} ${LIBXML2_LIBS}"
|
|
|
|
|
|
|
|
|
|
|
|
dnl
|
|
|
|
dnl libxslt
|
|
|
|
dnl
|
|
|
|
PKG_CHECK_MODULES([LIBXSLT], [libxslt], [], [
|
|
|
|
AC_MSG_ERROR([${LIBXSLT_PKG_ERRORS}. libxslt is required.])
|
|
|
|
])
|
|
|
|
|
|
|
|
CFLAGS="${CFLAGS} ${LIBXSLT_CFLAGS}"
|
|
|
|
LIBS="${LIBS} ${LIBXSLT_LIBS}"
|
|
|
|
|
|
|
|
|
|
|
|
dnl
|
|
|
|
dnl libvorbis
|
|
|
|
dnl
|
|
|
|
PKG_CHECK_MODULES([VORBIS], [vorbis >= 1.0], [], [
|
|
|
|
AC_MSG_ERROR([${VORBIS_PKG_ERRORS}. Must have libvorbis v1.0 or above installed.])
|
|
|
|
])
|
|
|
|
|
|
|
|
CFLAGS="${CFLAGS} ${VORBIS_CFLAGS}"
|
|
|
|
LIBS="${LIBS} ${VORBIS_LIBS}"
|
|
|
|
|
|
|
|
|
|
|
|
dnl Checks for optional libraries
|
|
|
|
|
|
|
|
dnl
|
|
|
|
dnl libogg
|
|
|
|
dnl
|
|
|
|
PKG_HAVE_WITH_MODULES([OGG], [ogg], [
|
|
|
|
CFLAGS="${CFLAGS} ${OGG_CFLAGS}"
|
|
|
|
LIBS="${LIBS} ${OGG_LIBS}"
|
|
|
|
])
|
|
|
|
|
|
|
|
dnl
|
|
|
|
dnl libtheora
|
|
|
|
dnl
|
|
|
|
PKG_HAVE_WITH_MODULES([THEORA], [theora], [
|
|
|
|
CFLAGS="${CFLAGS} ${THEORA_CFLAGS}"
|
|
|
|
LIBS="${LIBS} ${THEORA_LIBS}"
|
|
|
|
])
|
|
|
|
|
|
|
|
dnl
|
|
|
|
dnl libspeex
|
|
|
|
dnl
|
|
|
|
PKG_HAVE_WITH_MODULES([SPEEX], [speex], [
|
|
|
|
CFLAGS="${CFLAGS} ${SPEEX_CFLAGS}"
|
|
|
|
LIBS="${LIBS} ${SPEEX_LIBS}"
|
|
|
|
])
|
|
|
|
|
|
|
|
dnl
|
|
|
|
dnl libcurl
|
|
|
|
dnl
|
2018-05-28 09:19:32 -04:00
|
|
|
PKG_HAVE_WITH_MODULES([CURL], [libcurl], [
|
2017-10-18 06:23:24 -04:00
|
|
|
CFLAGS="${CFLAGS} ${CURL_CFLAGS}"
|
|
|
|
LIBS="${LIBS} ${CURL_LIBS}"
|
|
|
|
])
|
|
|
|
|
|
|
|
dnl
|
|
|
|
dnl openssl
|
|
|
|
dnl
|
|
|
|
PKG_HAVE_WITH_MODULES([OPENSSL], [openssl], [
|
|
|
|
CFLAGS="${CFLAGS} ${OPENSSL_CFLAGS}"
|
|
|
|
LIBS="${LIBS} ${OPENSSL_LIBS}"
|
|
|
|
])
|
|
|
|
|
|
|
|
dnl Check for library-specific functions
|
|
|
|
AC_CHECK_FUNCS([xsltSaveResultToString])
|
2001-10-20 17:28:09 -04:00
|
|
|
|
2008-04-18 22:11:37 -04:00
|
|
|
dnl we still use format_kate as it doesn't need libkate to work
|
|
|
|
#ICECAST_OPTIONAL="$ICECAST_OPTIONAL format_kate.o"
|
|
|
|
|
2017-10-18 06:23:24 -04:00
|
|
|
ACX_PTHREAD([], [AC_MSG_ERROR([POSIX threads missing])])
|
2001-09-09 22:21:46 -04:00
|
|
|
|
2017-10-18 06:23:24 -04:00
|
|
|
CFLAGS="${CFLAGS} ${PTHREAD_CFLAGS}"
|
|
|
|
CPPFLAGS="${CPPFLAGS} ${PTHREAD_CPPFLAGS}"
|
|
|
|
LIBS="${LIBS} ${PTHREAD_LIBS}"
|
2001-09-09 22:21:46 -04:00
|
|
|
|
2018-05-28 09:19:32 -04:00
|
|
|
dnl Feature enable/disable arguments
|
|
|
|
|
|
|
|
AC_ARG_ENABLE([yp],
|
|
|
|
AS_HELP_STRING([--enable-yp],
|
|
|
|
[enable yellowpage directory listing support (default: auto)])
|
|
|
|
)
|
|
|
|
|
|
|
|
AS_IF([test "x$enable_yp" != "xno"], [
|
|
|
|
AS_IF([test "x$have_curl" != "xyes"], [
|
|
|
|
AS_IF([test "x$enable_yp" == "xyes"], [
|
|
|
|
AC_MSG_ERROR([cURL is required for YP support])
|
|
|
|
])
|
|
|
|
enable_yp="no"
|
|
|
|
], [
|
|
|
|
AC_DEFINE([USE_YP], 1, [Define to compile in YP support code])
|
|
|
|
enable_yp="yes"
|
|
|
|
])
|
|
|
|
])
|
|
|
|
|
2018-05-28 12:12:51 -04:00
|
|
|
AM_CONDITIONAL([ENABLE_YP],
|
|
|
|
[test "x$enable_yp" = "xyes"])
|
|
|
|
|
|
|
|
|
2018-05-28 09:19:32 -04:00
|
|
|
AC_ARG_ENABLE([client-tests],
|
|
|
|
AS_HELP_STRING([--enable-client-tests],
|
|
|
|
[enable client tests module (default: disabled)])
|
|
|
|
)
|
|
|
|
|
|
|
|
AS_IF([test "x$enable_client_tests" == "xyes"], [
|
|
|
|
AC_DEFINE([ENABLE_MODULE_CLIENT_TESTS], 1, [Define to compile client test module])
|
|
|
|
], [enable_client_tests="no"])
|
2017-10-18 06:23:24 -04:00
|
|
|
|
2018-05-28 12:12:51 -04:00
|
|
|
AM_CONDITIONAL([ENABLE_MODULE_CLIENT_TESTS],
|
|
|
|
[test "x$enable_client_tests" = "xyes"])
|
|
|
|
|
2018-06-16 12:42:03 -04:00
|
|
|
AC_ARG_WITH([default-config],
|
|
|
|
AS_HELP_STRING([--with-default-config=PATH],
|
2018-06-16 12:51:25 -04:00
|
|
|
[Sets default Icecast configuration file (used when no configuration file is given)]),
|
|
|
|
[], [with_default_config=no]
|
2018-06-16 12:42:03 -04:00
|
|
|
)
|
|
|
|
|
|
|
|
AS_IF([test "$with_default_config" != "no"], [
|
|
|
|
|
|
|
|
AS_IF([test "$with_default_config" = "yes"], [
|
|
|
|
AC_MSG_ERROR([You need to supply a path as value for --with-default-config])
|
|
|
|
])
|
|
|
|
|
|
|
|
AC_DEFINE_UNQUOTED([ICECAST_DEFAULT_CONFIG], ["$with_default_config"], [Define to default config file path])
|
|
|
|
|
|
|
|
])
|
|
|
|
|
2019-01-09 10:22:38 -05:00
|
|
|
AC_ARG_ENABLE([devel-logging],
|
|
|
|
AS_HELP_STRING([--enable-devel-logging],
|
|
|
|
[enable development logging (default: disabled)])
|
|
|
|
)
|
|
|
|
|
|
|
|
AS_IF([test "x$enable_devel_logging" == "xyes"], [
|
|
|
|
AC_DEFINE([DEVEL_LOGGING], 1, [Define to enable development logging])
|
|
|
|
], [enable_devel_logging="no"])
|
|
|
|
|
2017-10-18 06:23:24 -04:00
|
|
|
dnl Make substitutions
|
2018-05-28 12:05:00 -04:00
|
|
|
AC_SUBST(XIPH_LIBS)
|
2003-07-20 22:23:41 -04:00
|
|
|
AC_SUBST(XIPH_CPPFLAGS)
|
|
|
|
AC_SUBST(XIPH_CFLAGS)
|
2004-12-07 16:06:26 -05:00
|
|
|
AC_SUBST(XIPH_LDFLAGS)
|
2001-09-09 22:21:46 -04:00
|
|
|
|
2018-05-28 13:41:59 -04:00
|
|
|
AC_CONFIG_HEADERS([config.h])
|
|
|
|
|
2017-10-19 05:37:26 -04:00
|
|
|
AC_CONFIG_FILES([
|
|
|
|
Makefile
|
|
|
|
conf/Makefile
|
|
|
|
src/Makefile
|
|
|
|
src/common/avl/Makefile
|
|
|
|
src/common/httpp/Makefile
|
|
|
|
src/common/thread/Makefile
|
|
|
|
src/common/log/Makefile
|
|
|
|
src/common/net/Makefile
|
|
|
|
src/common/timing/Makefile
|
|
|
|
doc/Makefile
|
|
|
|
web/Makefile
|
|
|
|
admin/Makefile
|
|
|
|
win32/Makefile
|
|
|
|
examples/Makefile
|
|
|
|
tests/Makefile
|
|
|
|
])
|
|
|
|
|
|
|
|
AC_OUTPUT
|
2017-10-19 04:40:34 -04:00
|
|
|
|
2018-07-11 06:41:16 -04:00
|
|
|
AS_ECHO(["
|
2017-10-19 04:40:34 -04:00
|
|
|
Icecast configuration
|
|
|
|
---------------------
|
2018-05-28 09:19:32 -04:00
|
|
|
Version : ${VERSION}
|
|
|
|
cURL : ${have_curl}
|
|
|
|
TLS (openSSL) : ${have_openssl}
|
2017-10-19 04:40:34 -04:00
|
|
|
|
|
|
|
Format/Codec support:
|
2018-05-28 09:19:32 -04:00
|
|
|
Ogg : ${have_ogg}
|
|
|
|
Theora : ${have_theora}
|
|
|
|
Speex : ${have_speex}
|
|
|
|
|
|
|
|
Features:
|
|
|
|
YP support : ${enable_yp}
|
2019-01-09 10:22:38 -05:00
|
|
|
Client tests : ${enable_client_tests}
|
|
|
|
|
|
|
|
Development logging: ${enable_devel_logging}"])
|