Commit 52b917d2 authored by Karl Heyes's avatar Karl Heyes

Make icecast use the shared M4 macros. Cleanup the other files.

svn path=/trunk/icecast/; revision=5157
parent 43953202
## Process this file with automake to produce Makefile.in
AUTOMAKE_OPTIONS = foreign dist-zip
AUTOMAKE_OPTIONS = 1.6 foreign dist-zip
SUBDIRS = src conf doc web admin win32
EXTRA_DIST = HACKING
EXTRA_DIST = HACKING m4/acx_pthread.m4 m4/ogg.m4 m4/vorbis.m4 \
m4/xiph_compiler.m4 m4/xiph_curl.m4 m4/xiph_net.m4 \
m4/xiph_types.m4 m4/xiph_xml2.m4
docdir = $(datadir)/doc/$(PACKAGE)
doc_DATA = README AUTHORS COPYING NEWS TODO
debug:
$(MAKE) all CFLAGS="@DEBUG@ @XML_CFLAGS@ @OGG_CFLAGS@ @VORBIS_CFLAGS@"
$(MAKE) all CFLAGS="@DEBUG@"
profile:
$(MAKE) all CFLAGS="@PROFILE@ @XML_CFLAGS@ @OGG_CFLAGS@ @VORBIS_CFLAGS@"
$(MAKE) all CFLAGS="@PROFILE@"
/* Define if you lack the socklen_t type */
#undef socklen_t
This diff is collapsed.
......@@ -18,20 +18,59 @@ DIE=0
echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
DIE=1
}
(automake --version) < /dev/null > /dev/null 2>&1 || {
VERSIONGREP="sed -e s/.*[^0-9\.]\([0-9]\.[0-9]\).*/\1/"
# do we need automake?
if test -r Makefile.am; then
options=`fgrep AUTOMAKE_OPTIONS Makefile.am`
AM_NEEDED=`echo "$options" | $VERSIONGREP`
if test -z "$AM_NEEDED" || test "x$AM_NEEDED" = "x$options"; then
echo -n "checking for automake..."
AUTOMAKE=automake
ACLOCAL=aclocal
if ($AUTOMAKE --version < /dev/null > /dev/null 2>&1); then
echo "yes"
else
echo "no"
AUTOMAKE=""
fi
else
echo -n "checking for automake $AM_NEEDED or later..."
for am in automake-$AM_NEEDED automake$AM_NEEDED automake; do
($am --version < /dev/null > /dev/null 2>&1) || continue
ver=`$am --version < /dev/null | head -1 | $VERSIONGREP`
if test $ver = $AM_NEEDED; then
AUTOMAKE=$am
echo $AUTOMAKE
break
fi
done
test -z $AUTOMAKE && echo "no"
echo -n "checking for aclocal $AM_NEEDED or later..."
for ac in aclocal-$AM_NEEDED aclocal$AM_NEEDED aclocal; do
($ac --version < /dev/null > /dev/null 2>&1) || continue
ver=`$ac --version < /dev/null | head -1 | $VERSIONGREP`
if test $ver = $AM_NEEDED; then
ACLOCAL=$ac
echo $ACLOCAL
break
fi
done
test -z $ACLOCAL && echo "no"
fi
test -z $AUTOMAKE || test -z $ACLOCAL && {
echo
echo "You must have automake installed to compile $package."
echo "Download the appropriate package for your system,
echo "or get the source from one of the GNU ftp sites"
echo "listed in http://www.gnu.org/order/ftp.html"
echo "Download the appropriate package for your distribution,"
echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
DIE=1
}
}
fi
(libtool --version) < /dev/null > /dev/null 2>&1 || {
(libtoolize --version) < /dev/null > /dev/null 2>&1 || {
echo
echo "You must have libtool installed to compile $package."
echo "Download the appropriate package for your system,
echo "Download the appropriate package for your system,"
echo "or get the source from one of the GNU ftp sites"
echo "listed in http://www.gnu.org/order/ftp.html"
DIE=1
......@@ -41,23 +80,31 @@ if test "$DIE" -eq 1; then
exit 1
fi
if test -z "$*"; then
echo "I am going to run ./configure with no arguments - if you wish "
echo "to pass any to it, please specify them on the $0 command line."
echo "Generating configuration files for $package, please wait...."
ACLOCAL_FLAGS="$ACLOCAL_FLAGS -I m4"
if ! test -z $ACLOCAL; then
echo " $ACLOCAL $ACLOCAL_FLAGS"
$ACLOCAL $ACLOCAL_FLAGS
fi
echo "Generating configuration files for $package, please wait...."
echo " autoheader"
autoheader
echo " aclocal $ACLOCAL_FLAGS"
aclocal $ACLOCAL_FLAGS
#echo " autoheader"
#autoheader
echo " libtoolize --automake"
libtoolize --automake
echo " automake --add-missing"
automake --add-missing
if ! test -z $AUTOMAKE; then
echo " $AUTOMAKE --add-missing"
$AUTOMAKE --add-missing
fi
echo " autoconf"
autoconf
if test -z "$*"; then
echo "I am going to run ./configure with no arguments - if you wish "
echo "to pass any to it, please specify them on the $0 command line."
fi
cd $olddir
$srcdir/configure "$@" && echo
dnl Process this file with autoconf to produce a configure script.
AC_INIT(src/main.c)
AC_PREREQ(2.50)
dnl Process this file with autoconf to produce a configure script.
AM_INIT_AUTOMAKE(icecast,2.0-alpha-2)
AM_CONFIG_HEADER(config.h)
AC_PROG_CC
AC_CANONICAL_HOST
......@@ -10,182 +11,103 @@ AM_PROG_LIBTOOL
dnl Set some options based on environment
SOCKET_LIBS=
case "$ac_cv_host" in
case "$host" in
*openbsd*)
;;
*) AC_DEFINE(_XOPEN_SOURCE, 500, [Define if you have POSIX and XPG specifications])
*) AC_DEFINE(_XOPEN_SOURCE, 600, [Define if you have POSIX and XPG specifications])
;;
esac
if test -z "$GCC"; then
case $host in
case $host in
*-*-irix*)
DEBUG="-g -signed -D_REENTRANT"
CFLAGS="-O2 -w -signed -D_REENTRANT"
XIPH_CFLAGS="-O2 -w -signed -D_REENTRANT"
PROFILE="-p -g3 -O2 -signed -D_REENTRANT"
;;
;;
*-*-solaris*)
DEBUG="-v -g -D_REENTRANT"
CFLAGS="-xO4 -fast -w -fsimple -native -xcg92 -D_REENTRANT"
XIPH_CFLAGS="-xO4 -fast -w -fsimple -native -xcg92 -D_REENTRANT"
PROFILE="-v -xpg -g -xO4 -fast -native -fsimple -xcg92 -Dsuncc -D_REENTRANT"
SOCKET_LIBS="-lnsl -lsocket -lresolv"
;;
;;
*)
DEBUG="-g -D_REENTRANT"
CFLAGS="-O -D_REENTRANT"
XIPH_CFLAGS="-O -D_REENTRANT"
PROFILE="-g -p -D_REENTRANT"
;;
esac
;;
esac
else
case $host in
case $host in
*-*-linux*)
DEBUG="-g -Wall -fsigned-char -D_REENTRANT -D_GNU_SOURCE"
CFLAGS="-O20 -ffast-math -fsigned-char -D_REENTRANT -D_GNU_SOURCE"
PROFILE="-Wall -W -pg -g -O20 -ffast-math -fsigned-char -D_REENTRANT -D_GNU_SOURCE"
;;
DEBUG="-g -Wall -fsigned-char -D_GNU_SOURCE"
XIPH_CPPFLAGS="-ffast-math -fsigned-char -D_GNU_SOURCE"
PROFILE="-Wall -W -pg -g -ffast-math -fsigned-char -D_GNU_SOURCE"
;;
sparc-sun-solaris*)
DEBUG="-g -Wall -fsigned-char -mv8 -D_REENTRANT"
CFLAGS="-O20 -ffast-math -fsigned-char -mv8 -D_REENTRANT"
PROFILE="-pg -g -O20 -fsigned-char -mv8 -D_REENTRANT"
SOCKET_LIBS="-lnsl -lsocket -lresolv"
;;
*-pc-solaris*)
DEBUG="-g -Wall -fsigned-char -D_REENTRANT"
CFLAGS="-O20 -ffast-math -fsigned-char -D_REENTRANT"
PROFILE="-pg -g -O20 -fsigned-char -D_REENTRANT"
SOCKET_LIBS="-lnsl -lsocket -lresolv"
;;
AC_DEFINE(__EXTENSIONS__, 1, [define to 1 to get resolve header problem on solaris])
DEBUG="-g -Wall -fsigned-char -mv8"
XIPH_CPPFLAGS="-ffast-math -fsigned-char -mv8"
PROFILE="-pg -g -fsigned-char -mv8"
;;
*-pc-solaris*)
DEBUG="-g -Wall -fsigned-char"
XIPH_CPPFLAGS="-ffast-math -fsigned-char"
PROFILE="-pg -g -fsigned-char"
;;
*freebsd*)
DEBUG="-g -Wall -fsigned-char"
CFLAGS="-O20 -fsigned-char"
PROFILE="-O20 -g -pg -fsigned-char"
ogg_prefix="/usr/local"
vorbis_prefix="/usr/local"
;;
XIPH_CPPFLAGS="-fsigned-char"
PROFILE="-g -pg -fsigned-char"
;;
*)
DEBUG="-g -Wall -fsigned-char"
CFLAGS="-O20 -Wall -fsigned-char"
PROFILE="-O20 -g -pg -Wall -fsigned-char"
;;
esac
XIPH_CPPFLAGS="-Wall -fsigned-char"
PROFILE="-g -pg -Wall -fsigned-char"
;;
esac
fi
dnl Checks for programs.
dnl Checks for libraries.
dnl IPV6
AC_SEARCH_LIBS(inet_pton, socket,
[AC_DEFINE([HAVE_INET_PTON], 1, [Define if you have the `inet_pton' function])])
AC_SEARCH_LIBS(getipnodebyname, nsl,
[AC_DEFINE([HAVE_GETIPNODEBYNAME], 1,
[Define if you have the `getipnodebyname' function])])
dnl Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADER(stdint.h, AC_DEFINE(HAVE_STDINT_H, 1, [Define if you have stdint.h]),,)
AC_CHECK_HEADER(pwd.h, AC_DEFINE(CHUID, 1, [Define if you have pwd.h]),,)
AC_CHECK_HEADER(unistd.h, AC_DEFINE(CHROOT, 1, [Define if you have unistd.h]),,)
AC_CHECK_HEADER(sys/uio.h, AC_DEFINE(HAVE_SYS_UIO_H, 1, [Define if you have sys/uio.h]),,)
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_MSG_CHECKING([how to copy va_list])
AC_TRY_LINK([#include <stdarg.h>], [va_list ap1, ap2; va_copy(ap1, ap2);],
AC_MSG_RESULT([va_copy]),
[ AH_TEMPLATE([va_copy], [define if va_copy is not available])
AC_TRY_LINK([#include <stdarg.h>], [va_list ap1, ap2; __va_copy(ap1, ap2);],
[ AC_DEFINE([va_copy], [__va_copy])
AC_MSG_RESULT([__va_copy])],
[ AC_DEFINE([va_copy(dest,src)], [memcpy(&dest,&src,sizeof(va_list))])
AC_MSG_RESULT([memcpy])]
)
])
dnl Check for types
AC_CHECK_TYPE([socklen_t], int)
dnl Checks for library functions.
AC_CHECK_FUNCS(nanosleep)
AC_CHECK_FUNCS(poll)
AC_CHECK_FUNCS(sethostent endhostent)
AC_CHECK_FUNCS(getnameinfo getaddrinfo inet_aton)
AC_CHECK_FUNCS(nanosleep poll)
XIPH_NET
dnl -- configure options --
AC_ARG_WITH(xslt-config,
[ --with-xslt-config=PATH use xslt-config in PATH to find libxslt ],
[if ! test -x "$with_xslt_config"
then
AC_MSG_ERROR([$with_xslt_config cannot be executed])
fi
XSLTCONFIG="$with_xslt_config"]
)
if test -z "$XSLTCONFIG"
then
AC_CHECK_PROGS(XSLTCONFIG, [xslt-config])
fi
if test -n "$XSLTCONFIG"
then
XSLT_LIBS="`$XSLTCONFIG --libs`"
XSLT_CFLAGS="`$XSLTCONFIG --cflags`"
save_LIBS="$LIBS"
save_CFLAGS="$CFLAGS"
LIBS="$LIBS $XSLT_LIBS"
CFLAGS="$CFLAGS $XSLT_CFLAGS"
AC_CHECK_FUNC(xsltParseStylesheetFile,, [AC_MSG_ERROR([There was a problem linking with libxslt])])
LIBS="$save_LIBS"
CFLAGS="$save_CFLAGS"
save_LIBS=
save_CFLAGS=
else
AC_MSG_ERROR([xslt-config could not be found])
fi
XIPH_PATH_XSLT
XIPH_VAR_APPEND([XIPH_CPPFLAGS],[$XSLT_CFLAGS])
XIPH_VAR_PREPEND([XIPH_LIBS],[$XSLT_LIBS])
AC_ARG_WITH(xml-config,
[ --with-xml-config=PATH use xml-config in PATH to find libxml ],
[if ! test -x "$with_xml_config"
then
AC_MSG_ERROR([$with_xml_config cannot be executed])
fi
XMLCONFIG="$with_xml_config"]
)
if test -z "$XMLCONFIG"
then
AC_CHECK_PROGS(XMLCONFIG, [xml2-config xml-config])
fi
if test -n "$XMLCONFIG"
then
XML_LIBS="`$XMLCONFIG --libs`"
XML_CFLAGS="`$XMLCONFIG --cflags`"
save_LIBS="$LIBS"
save_CFLAGS="$CFLAGS"
LIBS="$LIBS $XML_LIBS"
CFLAGS="$CFLAGS $XML_CFLAGS"
AC_CHECK_FUNC(xmlParseFile,, [AC_MSG_ERROR([There was a problem linking with libxml])])
LIBS="$save_LIBS"
CFLAGS="$save_CFLAGS"
save_LIBS=
save_CFLAGS=
else
AC_MSG_ERROR([xml-config could not be found])
fi
XIPH_PATH_VORBIS(, AC_MSG_ERROR([must have Ogg Vorbis v1.0 installed!]))
XIPH_VAR_APPEND([XIPH_CPPFLAGS],[$VORBIS_CFLAGS])
XIPH_VAR_PREPEND([XIPH_LIBS],[$VORBIS_LIBS])
AM_PATH_OGG(, AC_MSG_ERROR(must have Ogg installed!(Perhaps you need --with-ogg-prefix=/usr/local)))
AM_PATH_VORBIS(, AC_MSG_ERROR(must have Vorbis installed!(Perhaps you need --with-vorbis-prefix=/usr/local)))
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])
dnl -- YP support --
AC_ARG_ENABLE([yp],
[ --disable-yp disable YP directory support])
AC_HELP_STRING([--disable-yp],[disable YP directory support]))
if test "x$enable_yp" != "xno"
then
AM_PATH_CURL([
XIPH_PATH_CURL([
AC_CHECK_DECL([CURLOPT_NOSIGNAL], [
AC_DEFINE([USE_YP], 1, [Define to compile in YP support code])
ICECAST_OBJECTS="$ICECAST_OBJECTS geturl.o yp.o"
ICECAST_OPTIONAL="$ICECAST_OPTIONAL geturl.o yp.o"
], [
if test "x$enable_yp" != "xyes"
then
......@@ -203,25 +125,22 @@ AM_PATH_CURL([
fi
])
fi
XIPH_VAR_APPEND([XIPH_CFLAGS],[$CURL_CFLAGS])
XIPH_VAR_PREPEND([XIPH_LIBS],[$CURL_LIBS])
dnl Make substitutions
AC_SUBST(XSLT_CFLAGS)
AC_SUBST(XML_CFLAGS)
AC_SUBST(OGG_CFLAGS)
AC_SUBST(VORBIS_CFLAGS)
AC_SUBST(XSLT_LIBS)
AC_SUBST(XML_LIBS)
AC_SUBST(OGG_LIBS)
AC_SUBST(VORBIS_LIBS)
AC_SUBST(SOCKET_LIBS)
AC_SUBST(XIPH_CPPFLAGS)
AC_SUBST(XIPH_CFLAGS)
AC_SUBST(XIPH_LIBS)
AC_SUBST(PTHREAD_CPPFLAGS)
AC_SUBST(PTHREAD_CFLAGS)
AC_SUBST(PTHREAD_LIBS)
AC_SUBST(LIBTOOL_DEPS)
AC_SUBST(OPT)
AC_SUBST(LIBS)
AC_SUBST(DEBUG)
AC_SUBST(CFLAGS)
AC_SUBST(PROFILE)
AC_SUBST(XIPH_CFLAGS)
AC_SUBST(ICECAST_OBJECTS)
AC_SUBST(ICECAST_OPTIONAL)
AC_OUTPUT(Makefile conf/Makefile src/Makefile src/avl/Makefile src/httpp/Makefile src/thread/Makefile src/log/Makefile src/net/Makefile src/timing/Makefile doc/Makefile web/Makefile admin/Makefile win32/Makefile win32/res/Makefile)
......@@ -6,24 +6,27 @@ SUBDIRS = avl thread httpp net log timing
bin_PROGRAMS = icecast
noinst_HEADERS = admin.h config.h os.h logging.h sighandler.h connection.h global.h\
noinst_HEADERS = admin.h cfgfile.h os.h logging.h sighandler.h connection.h global.h\
util.h slave.h source.h stats.h refbuf.h client.h format.h format_vorbis.h\
compat.h format_mp3.h fserve.h xslt.h geturl.h yp.h event.h
icecast_SOURCES = config.c main.c logging.c sighandler.c connection.c global.c\
icecast_SOURCES = cfgfile.c main.c logging.c sighandler.c connection.c global.c\
util.c slave.c source.c stats.c refbuf.c client.c format.c format_vorbis.c\
format_mp3.c xslt.c fserve.c event.c admin.c
EXTRA_icecast_SOURCES = geturl.c yp.c
icecast_LDADD = $(ICECAST_OBJECTS) net/libicenet.la thread/libicethread.la httpp/libicehttpp.la\
log/libicelog.la avl/libiceavl.la timing/libicetiming.la
icecast_DEPENDENCIES = $(icecast_LDADD)
icecast_LDADD = @ICECAST_OPTIONAL@ net/libicenet.la thread/libicethread.la \
httpp/libicehttpp.la log/libicelog.la avl/libiceavl.la \
timing/libicetiming.la @XIPH_LIBS@
icecast_DEPENDENCIES = @ICECAST_OPTIONAL@
AM_CFLAGS = @XIPH_CFLAGS@
AM_CPPFLAGS = @XIPH_CPPFLAGS@
LIBS = @LIBS@ @XSLT_LIBS@ @SOCKET_LIBS@ @XML_LIBS@ @OGG_LIBS@ @VORBIS_LIBS@ @CURL_LIBS@ @PTHREAD_LIBS@
CFLAGS = -g @CFLAGS@ @XML_CFLAGS@ @XSLT_CFLAGS@ @OGG_CFLAGS@ @VORBIS_CFLAGS@ @CURL_CFLAGS@ @PTHREAD_CFLAGS@
debug:
$(MAKE) all CFLAGS="@DEBUG@ @XML_CFLAGS@ @OGG_CFLAGS@ @VORBIS_CFLAGS@"
$(MAKE) all CFLAGS="@DEBUG@"
profile:
$(MAKE) all CFLAGS="@PROFILE@ @XML_CFLAGS@ @OGG_CFLAGS@ @VORBIS_CFLAGS@"
$(MAKE) all CFLAGS="@PROFILE@"
This diff is collapsed.
#ifndef __CONFIG_H__
#define __CONFIG_H__
#define CONFIG_EINSANE -1
#define CONFIG_ENOROOT -2
#define CONFIG_EBADROOT -3
#define CONFIG_EPARSE -4
#define MAX_YP_DIRECTORIES 25
#include "thread/thread.h"
#include "avl/avl.h"
#include "global.h"
typedef struct ice_config_dir_tag
{
char *host;
int touch_interval;
struct ice_config_dir_tag *next;
} ice_config_dir_t;
typedef struct _relay_server {
char *server;
int port;
char *mount;
char *localmount;
int mp3metadata;
struct _relay_server *next;
} relay_server;
typedef struct _mount_proxy {
char *mountname; /* The mountpoint this proxy is used for */
char *username; /* Username and password for this mountpoint. If unset, */
char *password; /* falls back to global source password */
char *dumpfile; /* Filename to dump this stream to (will be appended). NULL
to not dump. */
int max_listeners; /* Max listeners for this mountpoint only. -1 to not
limit here (i.e. only use the global limit) */
char *fallback_mount;
struct _mount_proxy *next;
} mount_proxy;
typedef struct _aliases {
char *source;
char *destination;
int port;
char *bind_address;
struct _aliases *next;
}aliases;
typedef struct {
int port;
char *bind_address;
} listener_t;
typedef struct ice_config_tag
{
char *config_filename;
char *location;
char *admin;
int client_limit;
int source_limit;
long queue_size_limit;
int threadpool_size;
int client_timeout;
int header_timeout;
int source_timeout;
int ice_login;
int fileserve;
char *source_password;
char *admin_username;
char *admin_password;
int touch_interval;
ice_config_dir_t *dir_list;
char *hostname;
int port;
listener_t listeners[MAX_LISTEN_SOCKETS];
char *master_server;
int master_server_port;
int master_update_interval;
char *master_password;
relay_server *relay;
mount_proxy *mounts;
char *base_dir;
char *log_dir;
char *webroot_dir;
char *adminroot_dir;
aliases *aliases;
char *access_log;
char *error_log;
int loglevel;
int chroot;
int chuid;
char *user;
char *group;
char *yp_url[MAX_YP_DIRECTORIES];
int yp_url_timeout[MAX_YP_DIRECTORIES];
int num_yp_directories;
} ice_config_t;
typedef struct {
mutex_t config_lock;
mutex_t relay_lock;
mutex_t mounts_lock;
} ice_config_locks;
void config_initialize(void);
void config_shutdown(void);
int config_parse_file(const char *filename, ice_config_t *configuration);
int config_initial_parse_file(const char *filename);
int config_parse_cmdline(int arg, char **argv);
void config_set_config(ice_config_t *config);
void config_clear(ice_config_t *config);
int config_rehash(void);
ice_config_locks *config_locks(void);
ice_config_t *config_get_config(void);
void config_release_config(void);
/* To be used ONLY in one-time startup code */
ice_config_t *config_get_config_unlocked(void);
#endif /* __CONFIG_H__ */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment