From 6569d83f23ae8fe9f31df1425434bb77429b37f2 Mon Sep 17 00:00:00 2001 From: Marvin Scholz Date: Mon, 28 May 2018 17:01:54 +0200 Subject: [PATCH 01/29] Update m4 --- m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/m4 b/m4 index 57027c6c..b3dea05e 160000 --- a/m4 +++ b/m4 @@ -1 +1 @@ -Subproject commit 57027c6cc3f8b26d59e9560b4ac72a1a06d643b9 +Subproject commit b3dea05e6a626729b67f5803159b0f865f518949 From 61ac5f9b9ce5db793df191a72800b7e168aa7c4f Mon Sep 17 00:00:00 2001 From: Marvin Scholz Date: Wed, 18 Oct 2017 12:23:24 +0200 Subject: [PATCH 02/29] Rewrite configure.ac This rewritten configure.ac is nearly independent of any of the xiph m4 macros, most of which are ancient and can nowadays easily replaced with pkg-config. --- configure.ac | 244 +++++++++++++++++++++++++++++---------------------- src/compat.h | 6 +- 2 files changed, 141 insertions(+), 109 deletions(-) diff --git a/configure.ac b/configure.ac index 86663921..41d39e46 100644 --- a/configure.ac +++ b/configure.ac @@ -1,150 +1,182 @@ AC_INIT([Icecast], [2.4.99.2], [icecast@xiph.org]) AC_PREREQ([2.54]) + AC_CONFIG_SRCDIR([src/main.c]) AC_CONFIG_MACRO_DIR([m4]) -AC_REQUIRE_AUX_FILE([tap-driver.sh]) -dnl Process this file with autoconf to produce a configure script. - -AM_INIT_AUTOMAKE -AM_CONFIG_HEADER([config.h]) -AM_MAINTAINER_MODE +AC_CONFIG_AUX_DIR([build-aux]) AC_PROG_CC -AC_PROG_AWK -AC_CANONICAL_HOST -AC_PROG_LIBTOOL +AC_PROG_CC_C99 + +AS_IF([test "${ac_cv_prog_cc_c99}" = "no"], [ + AC_MSG_ERROR([No C99 compiler found!]) +]) + AC_SYS_LARGEFILE -dnl Set some options based on environment +dnl Set build/host to default values +AC_CANONICAL_HOST +AC_CANONICAL_BUILD -DEBUG="-g" -if test -z "$GCC"; then - XIPH_CPPFLAGS="-D_REENTRANT" - PROFILE="-g -p" -else - XIPH_CPPFLAGS="-Wall -ffast-math -fsigned-char" - PROFILE="-pg -g" - AC_DEFINE([_GNU_SOURCE], 1, [Define to include GNU extensions to POSIX]) -fi +AC_CONFIG_HEADERS([config.h]) -dnl Checks for programs. -dnl Checks for libraries. +AM_INIT_AUTOMAKE([tar-ustar foreign]) + +AM_SILENT_RULES([yes]) +AM_MAINTAINER_MODE([enable]) + +LT_INIT dnl Checks for header files. AC_HEADER_STDC AC_HEADER_TIME -AC_CHECK_HEADERS([alloca.h sys/timeb.h]) -AC_CHECK_HEADERS([pwd.h unistd.h grp.h sys/types.h],,,AC_INCLUDES_DEFAULT) +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]) + +XIPH_NET + +dnl Check for functions +AC_FUNC_FORK +AC_FUNC_CHOWN + AC_CHECK_FUNCS([setuid]) AC_CHECK_FUNCS([chroot]) -AC_CHECK_FUNCS([chown]) AC_CHECK_FUNCS([strcasestr]) AC_CHECK_FUNCS([gethostname]) AC_CHECK_FUNCS([uname]) AC_CHECK_FUNCS([setenv]) AC_CHECK_FUNCS([setresuid]) AC_CHECK_FUNCS([setresgid]) +AC_CHECK_FUNCS([localtime_r]) +AC_CHECK_FUNCS([poll]) +AC_CHECK_FUNCS([gettimeofday]) +AC_CHECK_FUNCS([ftime]) -dnl Checks for typedefs, structures, and compiler characteristics. -XIPH_C__FUNC__ +AC_SEARCH_LIBS([nanosleep], [rt posix4], [ + AC_DEFINE([HAVE_NANOSLEEP], [1], [Define if you have nanosleep]) +]) -dnl Check for types +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 library functions. -AC_CHECK_FUNCS([localtime_r poll gettimeofday ftime]) +dnl Checks for required libraries -AC_SEARCH_LIBS([nanosleep], [rt posix4], AC_DEFINE([HAVE_NANOSLEEP], [1], [Define if you have nanosleep])) -XIPH_NET +dnl +dnl libxml2 +dnl +PKG_CHECK_MODULES([LIBXML2], [libxml-2.0], [], [ + AC_MSG_ERROR([${LIBXML2_PKG_ERRORS}. libxml2 is required.]) +]) -dnl -- configure options -- +CFLAGS="${CFLAGS} ${LIBXML2_CFLAGS}" +LIBS="${LIBS} ${LIBXML2_LIBS}" -XIPH_PATH_XSLT -XIPH_VAR_APPEND([XIPH_CPPFLAGS],[$XSLT_CFLAGS]) -XIPH_VAR_PREPEND([XIPH_LIBS],[$XSLT_LIBS]) -XIPH_PATH_VORBIS([ - XIPH_VAR_APPEND([XIPH_CPPFLAGS],[$VORBIS_CFLAGS]) - XIPH_VAR_PREPEND([XIPH_LIBS],[$VORBIS_LIBS]) - XIPH_VAR_APPEND([XIPH_LDFLAGS],[$VORBIS_LDFLAGS]) - ICECAST_OPTIONAL="$ICECAST_OPTIONAL format_vorbis.o" - ], - [AC_MSG_ERROR([must have Ogg Vorbis v1.0 or above installed]) - ]) +dnl +dnl libxslt +dnl +PKG_CHECK_MODULES([LIBXSLT], [libxslt], [], [ + AC_MSG_ERROR([${LIBXSLT_PKG_ERRORS}. libxslt is required.]) +]) -XIPH_PATH_THEORA([ - XIPH_VAR_APPEND([XIPH_CPPFLAGS],[$THEORA_CFLAGS]) - XIPH_VAR_APPEND([XIPH_LDFLAGS],[$THEORA_LDFLAGS]) - XIPH_VAR_PREPEND([XIPH_LIBS],[$THEORA_LIBS]) - ICECAST_OPTIONAL="$ICECAST_OPTIONAL format_theora.o" - ], - [ AC_MSG_WARN([Theora disabled!]) - ]) +CFLAGS="${CFLAGS} ${LIBXSLT_CFLAGS}" +LIBS="${LIBS} ${LIBXSLT_LIBS}" -XIPH_PATH_SPEEX( - [ XIPH_VAR_APPEND([XIPH_CPPFLAGS],[$SPEEX_CFLAGS]) - XIPH_VAR_PREPEND([XIPH_LIBS],[$SPEEX_LIBS]) - XIPH_VAR_APPEND([XIPH_LDFLAGS],[$SPEEX_LDFLAGS]) - ICECAST_OPTIONAL="$ICECAST_OPTIONAL format_speex.o" - ], - [ AC_MSG_WARN([Speex support disabled!]) - ]) -AC_CHECK_LIB(kate, kate_decode_init,[have_kate=yes],[have_kate=no], -logg) -if test "x$have_kate" == "xyes" -then - AC_CHECK_LIB(oggkate, kate_ogg_decode_headerin,[have_kate=yes],[have_kate=no],-lkate -logg) - if test "x$have_kate" == "xyes" - then - KATE_LIBS="-loggkate -lkate -logg" - AC_DEFINE([HAVE_KATE],[1],[Define if you have libkate]) - fi -fi +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 libkate +dnl +PKG_HAVE_WITH_MODULES([KATE], [kate], [ + CFLAGS="${CFLAGS} ${KATE_CFLAGS}" + LIBS="${LIBS} ${KATE_LIBS}" +]) + +dnl +dnl libcurl +dnl +PKG_HAVE_WITH_MODULES([CURL], [curl], [ + 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]) + dnl we still use format_kate as it doesn't need libkate to work #ICECAST_OPTIONAL="$ICECAST_OPTIONAL format_kate.o" -ACX_PTHREAD(, AC_MSG_ERROR([POSIX threads missing])) -XIPH_VAR_APPEND([XIPH_CFLAGS],[$PTHREAD_CFLAGS]) -XIPH_VAR_APPEND([XIPH_CPPFLAGS],[$PTHREAD_CPPFLAGS]) -XIPH_VAR_PREPEND([XIPH_LIBS],[$PTHREAD_LIBS]) +ACX_PTHREAD([], [AC_MSG_ERROR([POSIX threads missing])]) -XIPH_PATH_CURL([ - AC_CHECK_DECL([CURLOPT_NOSIGNAL], - [ AC_DEFINE([HAVE_AUTH_URL], 1, [Define to compile in auth URL support code]) - AC_CHECK_FUNCS([curl_global_init]) - ICECAST_OPTIONAL="$ICECAST_OPTIONAL auth_url.o event_url.o curl.o" - enable_curl="yes" - XIPH_VAR_APPEND([XIPH_CPPFLAGS],[$CURL_CFLAGS]) - XIPH_VAR_PREPEND([XIPH_LIBS],[$CURL_LIBS]) - ], [ AC_MSG_NOTICE([Your curl dev files are too old (7.10 or above required)]) - ], [#include - ]) - ],[ AC_MSG_NOTICE([libcurl not found]) - ]) -dnl -- YP support -- -AC_ARG_ENABLE([yp], - AC_HELP_STRING([--disable-yp],[disable YP directory support]), - enable_yp="$enableval", - enable_yp="yes") -if test "x$enable_yp" = "xyes" -a "x$enable_curl" = xyes -then - AC_DEFINE([USE_YP], 1, [Define to compile in YP support code]) - ICECAST_OPTIONAL="$ICECAST_OPTIONAL yp.o" -else - AC_MSG_NOTICE([YP support disabled]) -fi -XIPH_PATH_OPENSSL([ - XIPH_VAR_APPEND([XIPH_CPPFLAGS],[$OPENSSL_CFLAGS]) - XIPH_VAR_APPEND([XIPH_LDFLAGS],[$OPENSSL_LDFLAGS]) - XIPH_VAR_PREPEND([XIPH_LIBS],[$OPENSSL_LIBS]) - ], - [ AC_MSG_NOTICE([SSL disabled!]) - ]) +CFLAGS="${CFLAGS} ${PTHREAD_CFLAGS}" +CPPFLAGS="${CPPFLAGS} ${PTHREAD_CPPFLAGS}" +LIBS="${LIBS} ${PTHREAD_LIBS}" + +#AC_DEFINE([USE_YP], 1, [Define to compile in YP support code]) dnl Make substitutions - AC_SUBST(XIPH_CPPFLAGS) AC_SUBST(XIPH_CFLAGS) AC_SUBST(XIPH_LIBS) diff --git a/src/compat.h b/src/compat.h index 2628c62d..a5e43ed3 100644 --- a/src/compat.h +++ b/src/compat.h @@ -47,10 +47,10 @@ # define PRId64 "I64d" #else # define PATH_SEPARATOR "/" -# if defined(HAVE_INTTYPES_H) -# include -# elif defined(HAVE_STDINT_H) +# if defined(HAVE_STDINT_H) # include +# elif defined(HAVE_INTTYPES_H) +# include # endif #endif From 66af62bc25f64911cf428b1b3897990db327545a Mon Sep 17 00:00:00 2001 From: Marvin Scholz Date: Thu, 19 Oct 2017 10:40:34 +0200 Subject: [PATCH 03/29] Print configuration at the end of configure This makes it easy to know which things will be enabled or disabled, depending which deps were found or not found. --- configure.ac | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/configure.ac b/configure.ac index 41d39e46..f4fc50c8 100644 --- a/configure.ac +++ b/configure.ac @@ -198,3 +198,16 @@ src/common/httpp/Makefile src/common/thread/Makefile src/common/log/Makefile src/common/net/Makefile src/common/timing/Makefile doc/Makefile web/Makefile web/assets/Makefile web/assets/css/Makefile web/assets/font/Makefile admin/Makefile admin/includes/Makefile win32/Makefile examples/Makefile tests/Makefile]) + +echo " +Icecast configuration +--------------------- +Version : ${VERSION} +cURL : ${have_curl} +TLS (openSSL) : ${have_openssl} + +Format/Codec support: + Ogg : ${have_ogg} + Theora : ${have_theora} + Speex : ${have_speex} + Kate : ${have_kate}" From d915e0a9dd33ddca016a7435fcd40e427b1829e3 Mon Sep 17 00:00:00 2001 From: Marvin Scholz Date: Thu, 19 Oct 2017 10:41:08 +0200 Subject: [PATCH 04/29] Remove no longer required foreign option, it's in the configure.ac now --- conf/Makefile.am | 2 -- 1 file changed, 2 deletions(-) diff --git a/conf/Makefile.am b/conf/Makefile.am index 851aa2b7..f6853e43 100644 --- a/conf/Makefile.am +++ b/conf/Makefile.am @@ -1,7 +1,5 @@ ## Process this with automake to create Makefile.in -AUTOMAKE_OPTIONS = foreign - EXTRA_DIST = icecast.xml.in icecast_minimal.xml.in icecast_shoutcast_compat.xml.in icecast_urlauth.xml.in DISTCLEANFILES = icecast.xml.dist icecast_minimal.xml.dist icecast_shoutcast_compat.xml.dist icecast_urlauth.xml.dist From e9f0331b230afa3003a4867ed455365e1d6b458f Mon Sep 17 00:00:00 2001 From: Marvin Scholz Date: Thu, 19 Oct 2017 11:37:26 +0200 Subject: [PATCH 05/29] doc: Remove unnecessary Makefiles --- configure.ac | 28 +++++++++++++++++++++++----- doc/Makefile.am | 2 +- 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/configure.ac b/configure.ac index f4fc50c8..107300d6 100644 --- a/configure.ac +++ b/configure.ac @@ -193,11 +193,29 @@ AC_SUBST(ICECAST_OPTIONAL) AC_SUBST(HAVE_KATE) AC_SUBST(KATE_LIBS) -AC_OUTPUT([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 -web/assets/Makefile web/assets/css/Makefile web/assets/font/Makefile -admin/Makefile admin/includes/Makefile win32/Makefile examples/Makefile tests/Makefile]) +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 + web/assets/Makefile + web/assets/css/Makefile + web/assets/font/Makefile + admin/Makefile + admin/includes/Makefile + win32/Makefile + examples/Makefile + tests/Makefile +]) + +AC_OUTPUT echo " Icecast configuration diff --git a/doc/Makefile.am b/doc/Makefile.am index b92e4f2f..9d2db1d1 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -1,6 +1,6 @@ ## Process this file with automake to produce Makefile.in -AUTOMAKE_OPTIONS = foreign +docdir = $(datadir)/doc/$(PACKAGE) docdir = $(datadir)/doc/icecast nobase_doc_DATA = index.html \ From 623c0d6bd62a443e552cf9361800feba1526f79b Mon Sep 17 00:00:00 2001 From: Marvin Scholz Date: Mon, 28 May 2018 15:19:32 +0200 Subject: [PATCH 06/29] Add options for cURL and future client tests --- configure.ac | 49 ++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 40 insertions(+), 9 deletions(-) diff --git a/configure.ac b/configure.ac index 107300d6..e23aa78d 100644 --- a/configure.ac +++ b/configure.ac @@ -30,6 +30,7 @@ AM_MAINTAINER_MODE([enable]) LT_INIT dnl Checks for header files. +AC_HEADER_ASSERT AC_HEADER_STDC AC_HEADER_TIME @@ -149,7 +150,7 @@ PKG_HAVE_WITH_MODULES([KATE], [kate], [ dnl dnl libcurl dnl -PKG_HAVE_WITH_MODULES([CURL], [curl], [ +PKG_HAVE_WITH_MODULES([CURL], [libcurl], [ CFLAGS="${CFLAGS} ${CURL_CFLAGS}" LIBS="${LIBS} ${CURL_LIBS}" ]) @@ -174,7 +175,33 @@ CFLAGS="${CFLAGS} ${PTHREAD_CFLAGS}" CPPFLAGS="${CPPFLAGS} ${PTHREAD_CPPFLAGS}" LIBS="${LIBS} ${PTHREAD_LIBS}" -#AC_DEFINE([USE_YP], 1, [Define to compile in YP support code]) +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" + ]) +]) + +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"]) dnl Make substitutions AC_SUBST(XIPH_CPPFLAGS) @@ -220,12 +247,16 @@ AC_OUTPUT echo " Icecast configuration --------------------- -Version : ${VERSION} -cURL : ${have_curl} -TLS (openSSL) : ${have_openssl} +Version : ${VERSION} +cURL : ${have_curl} +TLS (openSSL) : ${have_openssl} Format/Codec support: - Ogg : ${have_ogg} - Theora : ${have_theora} - Speex : ${have_speex} - Kate : ${have_kate}" + Ogg : ${have_ogg} + Theora : ${have_theora} + Speex : ${have_speex} + Kate : ${have_kate} + +Features: + YP support : ${enable_yp} + Client tests : ${enable_client_tests}" From 81f64401d6e1c36b033fdca98f216557594bdb05 Mon Sep 17 00:00:00 2001 From: Marvin Scholz Date: Mon, 28 May 2018 17:32:03 +0200 Subject: [PATCH 07/29] Add dist-zip to automake options --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index e23aa78d..e2b4c4f6 100644 --- a/configure.ac +++ b/configure.ac @@ -22,7 +22,7 @@ AC_CANONICAL_BUILD AC_CONFIG_HEADERS([config.h]) -AM_INIT_AUTOMAKE([tar-ustar foreign]) +AM_INIT_AUTOMAKE([tar-ustar foreign dist-zip]) AM_SILENT_RULES([yes]) AM_MAINTAINER_MODE([enable]) From 3f7d21857645f5fe92807706cf95e1edd3c43600 Mon Sep 17 00:00:00 2001 From: Marvin Scholz Date: Mon, 28 May 2018 17:32:20 +0200 Subject: [PATCH 08/29] Remove automake options from makefiles --- Makefile.am | 3 --- src/Makefile.am | 2 -- 2 files changed, 5 deletions(-) diff --git a/Makefile.am b/Makefile.am index d1131949..7faca29a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,8 +1,5 @@ ## Process this file with automake to produce Makefile.in -AUTOMAKE_OPTIONS = foreign dist-zip -ACLOCAL_AMFLAGS = -I m4 - SUBDIRS = src conf doc web admin win32 examples tests EXTRA_DIST = README.md HACKING m4/acx_pthread.m4 m4/ogg.m4 \ diff --git a/src/Makefile.am b/src/Makefile.am index e7ea542e..70cd64f9 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,7 +1,5 @@ ## Process this with automake to create Makefile.in -AUTOMAKE_OPTIONS = foreign - SUBDIRS = common/avl common/net common/thread common/httpp common/log common/timing bin_PROGRAMS = icecast From 25f62e8a0038a4920929428c2da1969126a46630 Mon Sep 17 00:00:00 2001 From: Marvin Scholz Date: Mon, 28 May 2018 17:33:49 +0200 Subject: [PATCH 09/29] Do not include m4 files in dist --- Makefile.am | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Makefile.am b/Makefile.am index 7faca29a..a899b59c 100644 --- a/Makefile.am +++ b/Makefile.am @@ -2,10 +2,7 @@ SUBDIRS = src conf doc web admin win32 examples tests -EXTRA_DIST = README.md HACKING m4/acx_pthread.m4 m4/ogg.m4 \ - m4/theora.m4 m4/vorbis.m4 m4/speex.m4 \ - m4/xiph_compiler.m4 m4/xiph_curl.m4 m4/xiph_net.m4 \ - m4/xiph_types.m4 m4/xiph_xml2.m4 +EXTRA_DIST = README.md HACKING docdir = $(datadir)/doc/$(PACKAGE) doc_DATA = README.md AUTHORS COPYING NEWS ChangeLog From af608dd12010a032e0331a310bd5f48f57fa4d4e Mon Sep 17 00:00:00 2001 From: Marvin Scholz Date: Mon, 28 May 2018 17:40:59 +0200 Subject: [PATCH 10/29] Remove debug and profile targets --- Makefile.am | 6 ------ configure.ac | 2 -- src/Makefile.am | 7 ------- 3 files changed, 15 deletions(-) diff --git a/Makefile.am b/Makefile.am index a899b59c..62ddfe99 100644 --- a/Makefile.am +++ b/Makefile.am @@ -7,11 +7,5 @@ EXTRA_DIST = README.md HACKING docdir = $(datadir)/doc/$(PACKAGE) doc_DATA = README.md AUTHORS COPYING NEWS ChangeLog -debug: - $(MAKE) all CFLAGS="@DEBUG@" - -profile: - $(MAKE) all CFLAGS="@PROFILE@" - static: $(MAKE) all LDFLAGS="${LDFLAGS} -all-static" diff --git a/configure.ac b/configure.ac index e2b4c4f6..de720a05 100644 --- a/configure.ac +++ b/configure.ac @@ -213,9 +213,7 @@ AC_SUBST(PTHREAD_CFLAGS) AC_SUBST(PTHREAD_LIBS) AC_SUBST(LIBTOOL_DEPS) AC_SUBST(LIBS) -AC_SUBST(DEBUG) AC_SUBST(CFLAGS) -AC_SUBST(PROFILE) AC_SUBST(ICECAST_OPTIONAL) AC_SUBST(HAVE_KATE) AC_SUBST(KATE_LIBS) diff --git a/src/Makefile.am b/src/Makefile.am index 70cd64f9..e41f82a9 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -30,10 +30,3 @@ icecast_LDADD = $(icecast_DEPENDENCIES) @XIPH_LIBS@ @KATE_LIBS@ AM_CFLAGS = @XIPH_CFLAGS@ AM_CPPFLAGS = -I$(srcdir)/common/ @XIPH_CPPFLAGS@ AM_LDFLAGS = @XIPH_LDFLAGS@ @KATE_LIBS@ - - -debug: - $(MAKE) all CFLAGS="@DEBUG@" - -profile: - $(MAKE) all CFLAGS="@PROFILE@" From 3b5d5b7b936c97fa79f8ea8a68d7ad802e1aea39 Mon Sep 17 00:00:00 2001 From: Marvin Scholz Date: Mon, 28 May 2018 17:42:54 +0200 Subject: [PATCH 11/29] Makefile formatting improvements --- src/Makefile.am | 94 +++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 80 insertions(+), 14 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index e41f82a9..a321345c 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -4,21 +4,87 @@ SUBDIRS = common/avl common/net common/thread common/httpp common/log common/tim bin_PROGRAMS = icecast -noinst_HEADERS = admin.h cfgfile.h logging.h sighandler.h connection.h \ - global.h util.h errors.h curl.h slave.h source.h stats.h refbuf.h client.h playlist.h \ - compat.h fserve.h xslt.h yp.h md5.h matchfile.h tls.h \ - event.h event_log.h event_exec.h event_url.h \ +noinst_HEADERS = \ + admin.h \ + cfgfile.h \ + logging.h \ + sighandler.h \ + connection.h \ + global.h \ + util.h \ + errors.h \ + curl.h \ + slave.h \ + source.h \ + stats.h \ + refbuf.h \ + client.h \ + playlist.h \ + compat.h \ + fserve.h \ + xslt.h \ + yp.h \ + md5.h \ + matchfile.h \ + tls.h \ + event.h \ + event_log.h \ + event_exec.h \ + event_url.h \ acl.h auth.h \ - format.h format_ogg.h format_mp3.h format_ebml.h \ - format_vorbis.h format_theora.h format_flac.h format_speex.h format_midi.h \ - format_kate.h format_skeleton.h format_opus.h -icecast_SOURCES = cfgfile.c main.c logging.c sighandler.c connection.c global.c \ - util.c errors.c slave.c source.c stats.c refbuf.c client.c playlist.c \ - xslt.c fserve.c admin.c md5.c matchfile.c tls.c \ - format.c format_ogg.c format_mp3.c format_midi.c format_flac.c format_ebml.c \ - format_kate.c format_skeleton.c format_opus.c \ - event.c event_log.c event_exec.c \ - acl.c auth.c auth_htpasswd.c auth_anonymous.c auth_static.c + format.h \ + format_ogg.h \ + format_mp3.h \ + format_ebml.h \ + format_vorbis.h \ + format_theora.h \ + format_flac.h \ + format_speex.h \ + format_midi.h \ + format_kate.h \ + format_skeleton.h \ + format_opus.h + +icecast_SOURCES = \ + main.c \ + cfgfile.c \ + logging.c \ + sighandler.c \ + connection.c \ + global.c \ + util.c \ + errors.c \ + slave.c \ + source.c \ + stats.c \ + refbuf.c \ + client.c \ + playlist.c \ + xslt.c \ + fserve.c \ + admin.c \ + md5.c \ + matchfile.c \ + tls.c \ + format.c \ + format_ogg.c \ + format_mp3.c \ + format_midi.c \ + format_flac.c \ + format_ebml.c \ + format_kate.c \ + format_skeleton.c \ + format_opus.c \ + event.c \ + event_log.c \ + event_exec.c \ + acl.c \ + auth.c \ + auth_htpasswd.c \ + auth_anonymous.c \ + auth_static.c + + EXTRA_icecast_SOURCES = curl.c yp.c \ auth_url.c event_url.c \ format_vorbis.c format_theora.c format_speex.c From 22a1887afb185c0e68ab7a77e66191fee2c5e390 Mon Sep 17 00:00:00 2001 From: Marvin Scholz Date: Mon, 28 May 2018 18:05:00 +0200 Subject: [PATCH 12/29] Remove unnecessary substitutions --- configure.ac | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/configure.ac b/configure.ac index de720a05..4c290a98 100644 --- a/configure.ac +++ b/configure.ac @@ -204,19 +204,10 @@ AS_IF([test "x$enable_client_tests" == "xyes"], [ ], [enable_client_tests="no"]) dnl Make substitutions +AC_SUBST(XIPH_LIBS) AC_SUBST(XIPH_CPPFLAGS) AC_SUBST(XIPH_CFLAGS) -AC_SUBST(XIPH_LIBS) AC_SUBST(XIPH_LDFLAGS) -AC_SUBST(PTHREAD_CPPFLAGS) -AC_SUBST(PTHREAD_CFLAGS) -AC_SUBST(PTHREAD_LIBS) -AC_SUBST(LIBTOOL_DEPS) -AC_SUBST(LIBS) -AC_SUBST(CFLAGS) -AC_SUBST(ICECAST_OPTIONAL) -AC_SUBST(HAVE_KATE) -AC_SUBST(KATE_LIBS) AC_CONFIG_FILES([ Makefile From 7f13d02184f120860fee7f83e6b34936a641e244 Mon Sep 17 00:00:00 2001 From: Marvin Scholz Date: Mon, 28 May 2018 18:12:51 +0200 Subject: [PATCH 13/29] Add makefile conditionals for features --- configure.ac | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/configure.ac b/configure.ac index 4c290a98..a08f8640 100644 --- a/configure.ac +++ b/configure.ac @@ -194,6 +194,10 @@ AS_IF([test "x$enable_yp" != "xno"], [ ]) ]) +AM_CONDITIONAL([ENABLE_YP], + [test "x$enable_yp" = "xyes"]) + + AC_ARG_ENABLE([client-tests], AS_HELP_STRING([--enable-client-tests], [enable client tests module (default: disabled)]) @@ -203,6 +207,9 @@ 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"]) +AM_CONDITIONAL([ENABLE_MODULE_CLIENT_TESTS], + [test "x$enable_client_tests" = "xyes"]) + dnl Make substitutions AC_SUBST(XIPH_LIBS) AC_SUBST(XIPH_CPPFLAGS) From 39a0ca84914cca95260698e68896ab4e27d38276 Mon Sep 17 00:00:00 2001 From: Marvin Scholz Date: Sat, 11 Nov 2017 23:45:06 +0100 Subject: [PATCH 14/29] Makefiles cleanup --- Makefile.am | 2 ++ doc/Makefile.am | 1 - src/Makefile.am | 48 +++++++++++++++++++++++++++++++++++++++--------- web/Makefile.am | 4 ---- 4 files changed, 41 insertions(+), 14 deletions(-) diff --git a/Makefile.am b/Makefile.am index 62ddfe99..a29d1a1a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,5 +1,7 @@ ## Process this file with automake to produce Makefile.in +ACLOCAL_AMFLAGS = -I m4 + SUBDIRS = src conf doc web admin win32 examples tests EXTRA_DIST = README.md HACKING diff --git a/doc/Makefile.am b/doc/Makefile.am index 9d2db1d1..f4c0ed2a 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -2,7 +2,6 @@ docdir = $(datadir)/doc/$(PACKAGE) -docdir = $(datadir)/doc/icecast nobase_doc_DATA = index.html \ admin_interface/index.html \ auth/index.html \ diff --git a/src/Makefile.am b/src/Makefile.am index a321345c..8612bcd0 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -84,15 +84,45 @@ icecast_SOURCES = \ auth_anonymous.c \ auth_static.c +if HAVE_CURL +icecast_SOURCES += \ + curl.c \ + auth_url.c \ + event_url.c +endif -EXTRA_icecast_SOURCES = curl.c yp.c \ - auth_url.c event_url.c \ - format_vorbis.c format_theora.c format_speex.c +if ENABLE_YP +icecast_SOURCES += yp.c +endif -icecast_DEPENDENCIES = @ICECAST_OPTIONAL@ common/net/libicenet.la common/thread/libicethread.la \ - common/httpp/libicehttpp.la common/log/libicelog.la common/avl/libiceavl.la common/timing/libicetiming.la -icecast_LDADD = $(icecast_DEPENDENCIES) @XIPH_LIBS@ @KATE_LIBS@ +if HAVE_OGG +icecast_SOURCES += format_vorbis.c +endif -AM_CFLAGS = @XIPH_CFLAGS@ -AM_CPPFLAGS = -I$(srcdir)/common/ @XIPH_CPPFLAGS@ -AM_LDFLAGS = @XIPH_LDFLAGS@ @KATE_LIBS@ +if HAVE_THEORA +icecast_SOURCES += format_theora.c +endif + +if HAVE_SPEEX +icecast_SOURCES += format_speex.c +endif + +EXTRA_icecast_SOURCES = \ + curl.c \ + yp.c \ + auth_url.c \ + event_url.c \ + format_vorbis.c \ + format_theora.c \ + format_speex.c + +icecast_DEPENDENCIES = \ + common/net/libicenet.la \ + common/thread/libicethread.la \ + common/httpp/libicehttpp.la \ + common/log/libicelog.la \ + common/avl/libiceavl.la \ + common/timing/libicetiming.la + +icecast_LDADD = $(icecast_DEPENDENCIES) +icecast_CPPFLAGS = $(AM_CPPFLAGS) -I$(srcdir)/common diff --git a/web/Makefile.am b/web/Makefile.am index 1676058d..09edf3f5 100644 --- a/web/Makefile.am +++ b/web/Makefile.am @@ -1,9 +1,5 @@ ## Process this file with automake to produce Makefile.in -AUTOMAKE_OPTIONS = foreign - -SUBDIRS = assets - webdir = $(pkgdatadir)/web web_DATA = status.xsl \ favicon.ico \ From e7599f6fe511ccab2163a1c3bcb723a61f33308b Mon Sep 17 00:00:00 2001 From: Marvin Scholz Date: Mon, 28 May 2018 18:28:03 +0200 Subject: [PATCH 15/29] Simplify web makefiles --- configure.ac | 3 --- web/Makefile.am | 38 ++++++++++++++++++++++++++----------- web/assets/Makefile.am | 5 ----- web/assets/css/Makefile.am | 10 ---------- web/assets/font/Makefile.am | 15 --------------- 5 files changed, 27 insertions(+), 44 deletions(-) delete mode 100644 web/assets/Makefile.am delete mode 100644 web/assets/css/Makefile.am delete mode 100644 web/assets/font/Makefile.am diff --git a/configure.ac b/configure.ac index a08f8640..7a537c0f 100644 --- a/configure.ac +++ b/configure.ac @@ -228,9 +228,6 @@ AC_CONFIG_FILES([ src/common/timing/Makefile doc/Makefile web/Makefile - web/assets/Makefile - web/assets/css/Makefile - web/assets/font/Makefile admin/Makefile admin/includes/Makefile win32/Makefile diff --git a/web/Makefile.am b/web/Makefile.am index 09edf3f5..52696e04 100644 --- a/web/Makefile.am +++ b/web/Makefile.am @@ -1,15 +1,31 @@ ## Process this file with automake to produce Makefile.in webdir = $(pkgdatadir)/web -web_DATA = status.xsl \ - favicon.ico \ - icecast.png \ - style.css \ - auth.xsl \ - server_version.xsl \ - tunein.png \ - key.png \ - status-json.xsl \ - xml2json.xslt -EXTRA_DIST = $(web_DATA) +nobase_web_DATA = \ + status.xsl \ + favicon.ico \ + icecast.png \ + style.css \ + auth.xsl \ + server_version.xsl \ + tunein.png \ + key.png \ + status-json.xsl \ + xml2json.xslt \ + assets/css/style.css \ + assets/font/FiraMono-Bold.eot \ + assets/font/FiraMono-Regular.eot \ + assets/font/FiraSans-Bold.eot \ + assets/font/FiraSans-BoldItalic.woff \ + assets/font/FiraSans-Italic.eot \ + assets/font/FiraSans-Regular.eot \ + assets/font/FiraMono-Bold.woff \ + assets/font/FiraMono-Regular.woff \ + assets/font/FiraSans-BoldItalic.eot \ + assets/font/FiraSans-Bold.woff \ + assets/font/FiraSans-Italic.woff \ + assets/font/FiraSans-Regular.woff + + +EXTRA_DIST = $(nobase_web_DATA) diff --git a/web/assets/Makefile.am b/web/assets/Makefile.am deleted file mode 100644 index a8fcb346..00000000 --- a/web/assets/Makefile.am +++ /dev/null @@ -1,5 +0,0 @@ -## Process this file with automake to produce Makefile.in - -AUTOMAKE_OPTIONS = foreign - -SUBDIRS = css font diff --git a/web/assets/css/Makefile.am b/web/assets/css/Makefile.am deleted file mode 100644 index 7a27aaa8..00000000 --- a/web/assets/css/Makefile.am +++ /dev/null @@ -1,10 +0,0 @@ -## Process this file with automake to produce Makefile.in - -AUTOMAKE_OPTIONS = foreign - -webdir = $(pkgdatadir)/web -otherwebdir = $(webdir)/assets/css - -otherweb_DATA = style.css - -EXTRA_DIST = $(otherweb_DATA) diff --git a/web/assets/font/Makefile.am b/web/assets/font/Makefile.am deleted file mode 100644 index 57bda1ee..00000000 --- a/web/assets/font/Makefile.am +++ /dev/null @@ -1,15 +0,0 @@ -## Process this file with automake to produce Makefile.in - -AUTOMAKE_OPTIONS = foreign - -webdir = $(pkgdatadir)/web -otherwebdir = $(webdir)/assets/font - -otherweb_DATA = FiraMono-Bold.eot FiraMono-Regular.eot \ - FiraSans-Bold.eot FiraSans-BoldItalic.woff \ - FiraSans-Italic.eot FiraSans-Regular.eot \ - FiraMono-Bold.woff FiraMono-Regular.woff \ - FiraSans-BoldItalic.eot FiraSans-Bold.woff \ - FiraSans-Italic.woff FiraSans-Regular.woff - -EXTRA_DIST = $(otherweb_DATA) From 5b59406718227abdbf9a3938962c1c86c852c6d9 Mon Sep 17 00:00:00 2001 From: Marvin Scholz Date: Mon, 28 May 2018 19:41:59 +0200 Subject: [PATCH 16/29] Move AC_CONFIG_HEADERS to the bottom --- configure.ac | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 7a537c0f..549fcab4 100644 --- a/configure.ac +++ b/configure.ac @@ -19,8 +19,6 @@ dnl Set build/host to default values AC_CANONICAL_HOST AC_CANONICAL_BUILD -AC_CONFIG_HEADERS([config.h]) - AM_INIT_AUTOMAKE([tar-ustar foreign dist-zip]) @@ -216,6 +214,8 @@ AC_SUBST(XIPH_CPPFLAGS) AC_SUBST(XIPH_CFLAGS) AC_SUBST(XIPH_LDFLAGS) +AC_CONFIG_HEADERS([config.h]) + AC_CONFIG_FILES([ Makefile conf/Makefile From 1c901869e6cddbc5767c429254621ae181065349 Mon Sep 17 00:00:00 2001 From: Marvin Scholz Date: Mon, 28 May 2018 19:58:55 +0200 Subject: [PATCH 17/29] Remove libkate support Basic kate support is possible without needing libkate --- configure.ac | 9 --------- 1 file changed, 9 deletions(-) diff --git a/configure.ac b/configure.ac index 549fcab4..95965a34 100644 --- a/configure.ac +++ b/configure.ac @@ -137,14 +137,6 @@ PKG_HAVE_WITH_MODULES([SPEEX], [speex], [ LIBS="${LIBS} ${SPEEX_LIBS}" ]) -dnl -dnl libkate -dnl -PKG_HAVE_WITH_MODULES([KATE], [kate], [ - CFLAGS="${CFLAGS} ${KATE_CFLAGS}" - LIBS="${LIBS} ${KATE_LIBS}" -]) - dnl dnl libcurl dnl @@ -248,7 +240,6 @@ Format/Codec support: Ogg : ${have_ogg} Theora : ${have_theora} Speex : ${have_speex} - Kate : ${have_kate} Features: YP support : ${enable_yp} From 0499efe9a7ac5c3c5d823babeb65b88534a904e7 Mon Sep 17 00:00:00 2001 From: Marvin Scholz Date: Mon, 28 May 2018 20:10:57 +0200 Subject: [PATCH 18/29] Remove more unnecessary AUTOMAKE_OPTIONS The foreign option is set in AM_INIT_AUTOMAKE already --- admin/Makefile.am | 2 -- admin/includes/Makefile.am | 2 -- examples/Makefile.am | 2 -- win32/Makefile.am | 2 -- 4 files changed, 8 deletions(-) diff --git a/admin/Makefile.am b/admin/Makefile.am index a14df5f8..665ab5f4 100644 --- a/admin/Makefile.am +++ b/admin/Makefile.am @@ -1,7 +1,5 @@ ## Process this file with automake to produce Makefile.in -AUTOMAKE_OPTIONS = foreign - SUBDIRS = includes admindir = $(pkgdatadir)/admin diff --git a/admin/includes/Makefile.am b/admin/includes/Makefile.am index 0aacf273..c50c78de 100644 --- a/admin/includes/Makefile.am +++ b/admin/includes/Makefile.am @@ -1,7 +1,5 @@ ## Process this file with automake to produce Makefile.in -AUTOMAKE_OPTIONS = foreign - admindir = $(pkgdatadir)/admin otheradmindir = $(admindir)/includes otheradmin_DATA = footer.xsl head.xsl header.xsl page.xsl mountnav.xsl diff --git a/examples/Makefile.am b/examples/Makefile.am index a312cc63..3d49cf90 100644 --- a/examples/Makefile.am +++ b/examples/Makefile.am @@ -1,5 +1,3 @@ ## Process this file with automake to produce Makefile.in -AUTOMAKE_OPTIONS = foreign - EXTRA_DIST = icecast_auth-1.0.tar.gz diff --git a/win32/Makefile.am b/win32/Makefile.am index 29af79c1..db1d5b2d 100644 --- a/win32/Makefile.am +++ b/win32/Makefile.am @@ -1,6 +1,4 @@ ## Process this file with automake to produce Makefile.in -AUTOMAKE_OPTIONS = foreign - EXTRA_DIST = dllbundler.sh icecast2logo2.bmp icecast2logo3.bmp \ icecast2title.bmp icecast.ico icecast.nsis From c89eec920ff24cf1017b4dd19ed24a584dd99e5a Mon Sep 17 00:00:00 2001 From: Marvin Scholz Date: Mon, 28 May 2018 20:14:09 +0200 Subject: [PATCH 19/29] Simplify admin Makefiles --- admin/Makefile.am | 7 +++---- admin/includes/Makefile.am | 7 ------- configure.ac | 1 - 3 files changed, 3 insertions(+), 12 deletions(-) delete mode 100644 admin/includes/Makefile.am diff --git a/admin/Makefile.am b/admin/Makefile.am index 665ab5f4..7073b01f 100644 --- a/admin/Makefile.am +++ b/admin/Makefile.am @@ -1,8 +1,7 @@ ## Process this file with automake to produce Makefile.in -SUBDIRS = includes - admindir = $(pkgdatadir)/admin -dist_admin_DATA = listclients.xsl listmounts.xsl moveclients.xsl response.xsl \ - stats.xsl manageauth.xsl updatemetadata.xsl xspf.xsl vclt.xsl +nobase_dist_admin_DATA = listclients.xsl listmounts.xsl moveclients.xsl response.xsl \ + stats.xsl manageauth.xsl updatemetadata.xsl xspf.xsl vclt.xsl includes/footer.xsl \ + includes/head.xsl includes/header.xsl includes/page.xsl includes/mountnav.xsl diff --git a/admin/includes/Makefile.am b/admin/includes/Makefile.am deleted file mode 100644 index c50c78de..00000000 --- a/admin/includes/Makefile.am +++ /dev/null @@ -1,7 +0,0 @@ -## Process this file with automake to produce Makefile.in - -admindir = $(pkgdatadir)/admin -otheradmindir = $(admindir)/includes -otheradmin_DATA = footer.xsl head.xsl header.xsl page.xsl mountnav.xsl - -EXTRA_DIST = $(otheradmin_DATA) diff --git a/configure.ac b/configure.ac index 95965a34..1e6eed38 100644 --- a/configure.ac +++ b/configure.ac @@ -221,7 +221,6 @@ AC_CONFIG_FILES([ doc/Makefile web/Makefile admin/Makefile - admin/includes/Makefile win32/Makefile examples/Makefile tests/Makefile From 8b3372e08536a6f771d3af6d7f43cfe6a98066b1 Mon Sep 17 00:00:00 2001 From: Philipp Schafft Date: Tue, 29 May 2018 07:08:50 +0000 Subject: [PATCH 20/29] Cleanup: Removed unused (and broken?) libkate support from format_kate.c --- src/format_kate.c | 58 ----------------------------------------------- 1 file changed, 58 deletions(-) diff --git a/src/format_kate.c b/src/format_kate.c index ebc5d53c..da558a0f 100644 --- a/src/format_kate.c +++ b/src/format_kate.c @@ -20,9 +20,6 @@ #include #include #include -#ifdef HAVE_KATE -#include -#endif typedef struct source_tag source_t; @@ -39,10 +36,6 @@ typedef struct source_tag source_t; typedef struct _kate_codec_tag { int headers_done; -#ifdef HAVE_KATE - kate_info ki; - kate_comment kc; -#endif int num_headers; int granule_shift; ogg_int64_t last_iframe; @@ -61,10 +54,6 @@ static void kate_codec_free (ogg_state_t *ogg_info, ogg_codec_t *codec) stats_event (ogg_info->mount, "frame_rate", NULL); stats_event (ogg_info->mount, "frame_size", NULL); */ -#ifdef HAVE_KATE - kate_info_clear (&kate->ki); - kate_comment_clear (&kate->kc); -#endif ogg_stream_clear (&codec->os); free (kate); free (codec); @@ -93,35 +82,6 @@ static refbuf_t *process_kate_page (ogg_state_t *ogg_info, ogg_codec_t *codec, o { if (!kate->headers_done) { -#ifdef HAVE_KATE - int ret = kate_ogg_decode_headerin (&kate->ki, &kate->kc, &packet); - if (ret < 0) - { - ogg_info->error = 1; - ICECAST_LOG_WARN("problem with kate header"); - return NULL; - } - header_page = 1; - kate->num_headers = kate->ki.num_headers; - codec->headers++; - if (ret > 0) - { - kate->headers_done = 1; - /* TODO: what to replace this with ? - ogg_info->bitrate += theora->ti.target_bitrate; - stats_event_args (ogg_info->mount, "video_bitrate", "%ld", - (long)theora->ti.target_bitrate); - stats_event_args (ogg_info->mount, "video_quality", "%ld", - (long)theora->ti.quality); - stats_event_args (ogg_info->mount, "frame_size", "%ld x %ld", - (long)theora->ti.frame_width, - (long)theora->ti.frame_height); - stats_event_args (ogg_info->mount, "frame_rate", "%.2f", - (float)theora->ti.fps_numerator/theora->ti.fps_denominator); - */ - } - continue; -#else header_page = (packet.bytes > 0 && (packet.packet[0] & 0x80)); if (!header_page) break; @@ -133,7 +93,6 @@ static refbuf_t *process_kate_page (ogg_state_t *ogg_info, ogg_codec_t *codec, o kate->num_headers = packet.packet[11]; } continue; -#endif } if (codec->headers < kate->num_headers) @@ -189,25 +148,9 @@ ogg_codec_t *initial_kate_page(format_plugin_t *plugin, ogg_page *page) ogg_stream_init(&codec->os, ogg_page_serialno(page)); ogg_stream_pagein(&codec->os, page); -#ifdef HAVE_KATE - kate_info_init (&kate_codec->ki); - kate_comment_init (&kate_codec->kc); -#endif - ogg_stream_packetout(&codec->os, &packet); ICECAST_LOG_DEBUG("checking for kate codec"); -#ifdef HAVE_KATE - if (kate_ogg_decode_headerin (&kate_codec->ki, &kate_codec->kc, &packet) < 0) - { - kate_info_clear (&kate_codec->ki); - kate_comment_clear (&kate_codec->kc); - ogg_stream_clear (&codec->os); - free (kate_codec); - free (codec); - return NULL; - } -#else /* we don't have libkate, so we examine the packet magic by hand */ if ((packet.bytes<9) || memcmp(packet.packet, "\x80kate\0\0\0\0", 9)) { @@ -216,7 +159,6 @@ ogg_codec_t *initial_kate_page(format_plugin_t *plugin, ogg_page *page) free (codec); return NULL; } -#endif ICECAST_LOG_INFO("seen initial kate header"); codec->specific = kate_codec; From fd1f34c1e2cbf379b5dab85e1bbc0d2cc2aa6a49 Mon Sep 17 00:00:00 2001 From: Philipp Schafft Date: Tue, 29 May 2018 07:11:22 +0000 Subject: [PATCH 21/29] Cleanup: HAVE_AUTH_URL -> HAVE_CURL --- src/auth.c | 2 +- src/event.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/auth.c b/src/auth.c index 1f37151b..a08fc063 100644 --- a/src/auth.c +++ b/src/auth.c @@ -438,7 +438,7 @@ static int get_authenticator (auth_t *auth, config_options_t *options) ICECAST_LOG_DEBUG("type is %s", auth->type); if (strcmp(auth->type, AUTH_TYPE_URL) == 0) { -#ifdef HAVE_AUTH_URL +#ifdef HAVE_CURL if (auth_get_url_auth(auth, options) < 0) return -1; break; diff --git a/src/event.c b/src/event.c index b15b537a..254998d9 100644 --- a/src/event.c +++ b/src/event.c @@ -247,7 +247,7 @@ event_registration_t * event_new_from_xml_node(xmlNodePtr node) { rv = event_get_log(ret, options); } else if (strcmp(ret->type, EVENT_TYPE_EXEC) == 0) { rv = event_get_exec(ret, options); -#ifdef HAVE_AUTH_URL +#ifdef HAVE_CURL } else if (strcmp(ret->type, EVENT_TYPE_URL) == 0) { rv = event_get_url(ret, options); #endif From d1142e2c4ddf97b391ee201131d71fed2113b8f9 Mon Sep 17 00:00:00 2001 From: Marvin Scholz Date: Tue, 29 May 2018 13:57:25 +0200 Subject: [PATCH 22/29] Backwards-compatible usage of AM_SILENT_RULES for ancient automake versions --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 1e6eed38..dcb02cf5 100644 --- a/configure.ac +++ b/configure.ac @@ -21,8 +21,8 @@ AC_CANONICAL_BUILD AM_INIT_AUTOMAKE([tar-ustar foreign dist-zip]) +m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) -AM_SILENT_RULES([yes]) AM_MAINTAINER_MODE([enable]) LT_INIT From 02fb2aa97bb2681264d60d32f2492462ddc57446 Mon Sep 17 00:00:00 2001 From: Philipp Schafft Date: Sat, 16 Jun 2018 13:12:19 +0000 Subject: [PATCH 23/29] Fix: Corrected the include of and to match IEEE Std 1003.1-2017 ("POSIX 7") --- src/compat.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/compat.h b/src/compat.h index a5e43ed3..c876601e 100644 --- a/src/compat.h +++ b/src/compat.h @@ -47,9 +47,10 @@ # define PRId64 "I64d" #else # define PATH_SEPARATOR "/" -# if defined(HAVE_STDINT_H) +# ifdef HAVE_STDINT_H # include -# elif defined(HAVE_INTTYPES_H) +# endif +# ifdef HAVE_INTTYPES_H # include # endif #endif From 772ce306094f1361dd57f9a264b3407db9847684 Mon Sep 17 00:00:00 2001 From: Marvin Scholz Date: Sat, 16 Jun 2018 15:27:20 +0200 Subject: [PATCH 24/29] Add missing _GNU_SOURCE define --- configure.ac | 1 + 1 file changed, 1 insertion(+) diff --git a/configure.ac b/configure.ac index dcb02cf5..ff677984 100644 --- a/configure.ac +++ b/configure.ac @@ -14,6 +14,7 @@ AS_IF([test "${ac_cv_prog_cc_c99}" = "no"], [ ]) AC_SYS_LARGEFILE +AC_DEFINE([_GNU_SOURCE], 1, [Define to include GNU extensions to POSIX]) dnl Set build/host to default values AC_CANONICAL_HOST From 55e34b3b52250d5f0e3037cdaff42cc584f95638 Mon Sep 17 00:00:00 2001 From: Philipp Schafft Date: Sat, 16 Jun 2018 14:30:46 +0000 Subject: [PATCH 25/29] Fix: Removed erroneously defined types --- src/format_flac.c | 2 -- src/format_kate.c | 2 -- src/format_midi.c | 2 -- src/format_opus.c | 2 -- src/format_skeleton.c | 2 -- src/format_speex.c | 2 -- src/format_theora.c | 2 -- 7 files changed, 14 deletions(-) diff --git a/src/format_flac.c b/src/format_flac.c index 09d71cd5..4e4e8b0d 100644 --- a/src/format_flac.c +++ b/src/format_flac.c @@ -21,8 +21,6 @@ #include #include -typedef struct source_tag source_t; - #include "refbuf.h" #include "format_ogg.h" #include "client.h" diff --git a/src/format_kate.c b/src/format_kate.c index da558a0f..eee97d27 100644 --- a/src/format_kate.c +++ b/src/format_kate.c @@ -21,8 +21,6 @@ #include #include -typedef struct source_tag source_t; - #include "refbuf.h" #include "format_ogg.h" #include "format_kate.h" diff --git a/src/format_midi.c b/src/format_midi.c index 069b297c..32b3aeb9 100644 --- a/src/format_midi.c +++ b/src/format_midi.c @@ -21,8 +21,6 @@ #include #include -typedef struct source_tag source_t; - #include "refbuf.h" #include "format_ogg.h" #include "client.h" diff --git a/src/format_opus.c b/src/format_opus.c index 5821c677..bb810fa9 100644 --- a/src/format_opus.c +++ b/src/format_opus.c @@ -20,8 +20,6 @@ #include #include -typedef struct source_tag source_t; - #include "format_opus.h" #include "stats.h" #include "refbuf.h" diff --git a/src/format_skeleton.c b/src/format_skeleton.c index 6a8bbef4..d29d806b 100644 --- a/src/format_skeleton.c +++ b/src/format_skeleton.c @@ -21,8 +21,6 @@ #include #include -typedef struct source_tag source_t; - #include "refbuf.h" #include "format_ogg.h" #include "format_skeleton.h" diff --git a/src/format_speex.c b/src/format_speex.c index ed3dd82a..70347de0 100644 --- a/src/format_speex.c +++ b/src/format_speex.c @@ -21,8 +21,6 @@ #include #include -typedef struct source_tag source_t; - #include "format_speex.h" #include "refbuf.h" #include "client.h" diff --git a/src/format_theora.c b/src/format_theora.c index 797519da..bbd2a15d 100644 --- a/src/format_theora.c +++ b/src/format_theora.c @@ -21,8 +21,6 @@ #include #include -typedef struct source_tag source_t; - #include "refbuf.h" #include "format_ogg.h" #include "format_theora.h" From 60ec2d48786c3c34af8f44bb9f7441df44b0b4dd Mon Sep 17 00:00:00 2001 From: Marvin Scholz Date: Sat, 16 Jun 2018 17:12:34 +0200 Subject: [PATCH 26/29] Add -std=c99 arg to compiler if possible --- configure.ac | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/configure.ac b/configure.ac index ff677984..02883e14 100644 --- a/configure.ac +++ b/configure.ac @@ -7,6 +7,13 @@ AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_AUX_DIR([build-aux]) AC_PROG_CC + +AX_CHECK_COMPILE_FLAG([-std=c99], [ + AX_APPEND_FLAG([-std=c99]) +], [ + AC_MSG_WARN([Compiler does not accept -std=c99 flag!]) +]) + AC_PROG_CC_C99 AS_IF([test "${ac_cv_prog_cc_c99}" = "no"], [ From 645ab428965f7de797a297b135e3aeefe33cd19e Mon Sep 17 00:00:00 2001 From: Marvin Scholz Date: Sat, 16 Jun 2018 17:13:02 +0200 Subject: [PATCH 27/29] Update m4 to include needed macros --- m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/m4 b/m4 index b3dea05e..541d6079 160000 --- a/m4 +++ b/m4 @@ -1 +1 @@ -Subproject commit b3dea05e6a626729b67f5803159b0f865f518949 +Subproject commit 541d6079634c420ea757687715580fa199a0e3f0 From a1ccd0adec9608e0ce3b59764bdfdb332a5319b9 Mon Sep 17 00:00:00 2001 From: Marvin Scholz Date: Sat, 16 Jun 2018 18:42:03 +0200 Subject: [PATCH 28/29] Add --with-default-config=PATH option --- configure.ac | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/configure.ac b/configure.ac index 02883e14..c42b7318 100644 --- a/configure.ac +++ b/configure.ac @@ -208,6 +208,21 @@ AS_IF([test "x$enable_client_tests" == "xyes"], [ AM_CONDITIONAL([ENABLE_MODULE_CLIENT_TESTS], [test "x$enable_client_tests" = "xyes"]) +AC_ARG_WITH([default-config], + AS_HELP_STRING([--with-default-config=PATH], + [Sets default Icecast configuration file (used when no configuration file is given)]) +) + +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]) + +]) + dnl Make substitutions AC_SUBST(XIPH_LIBS) AC_SUBST(XIPH_CPPFLAGS) From e0c227d4d9997b2501a0a303e19cdc35298995a9 Mon Sep 17 00:00:00 2001 From: Marvin Scholz Date: Sat, 16 Jun 2018 18:51:25 +0200 Subject: [PATCH 29/29] Only set ICECAST_DEFAULT_CONFIG if supplied --- configure.ac | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index c42b7318..e2a5ae31 100644 --- a/configure.ac +++ b/configure.ac @@ -210,7 +210,8 @@ AM_CONDITIONAL([ENABLE_MODULE_CLIENT_TESTS], AC_ARG_WITH([default-config], AS_HELP_STRING([--with-default-config=PATH], - [Sets default Icecast configuration file (used when no configuration file is given)]) + [Sets default Icecast configuration file (used when no configuration file is given)]), + [], [with_default_config=no] ) AS_IF([test "$with_default_config" != "no"], [