2001-09-09 22:21:46 -04:00
|
|
|
dnl Process this file with autoconf to produce a configure script.
|
|
|
|
AC_INIT(src/main.c)
|
2003-03-17 11:17:49 -05:00
|
|
|
AC_PREREQ(2.50)
|
2001-09-09 22:21:46 -04:00
|
|
|
|
2003-02-02 09:21:57 -05:00
|
|
|
AM_INIT_AUTOMAKE(icecast,2.0-alpha-2)
|
2001-09-09 22:21:46 -04:00
|
|
|
|
|
|
|
AC_PROG_CC
|
|
|
|
AC_CANONICAL_HOST
|
|
|
|
AM_PROG_LIBTOOL
|
|
|
|
|
|
|
|
dnl Set some options based on environment
|
|
|
|
|
2001-10-21 11:25:45 -04:00
|
|
|
SOCKET_LIBS=
|
|
|
|
|
2003-04-21 13:52:12 -04:00
|
|
|
case "$ac_cv_host" in
|
|
|
|
*openbsd*)
|
|
|
|
;;
|
|
|
|
*) AC_DEFINE(_XOPEN_SOURCE, 500, [Define if you have POSIX and XPG specifications])
|
|
|
|
;;
|
|
|
|
esac
|
2001-09-09 22:21:46 -04:00
|
|
|
if test -z "$GCC"; then
|
|
|
|
case $host in
|
|
|
|
*-*-irix*)
|
2001-10-21 10:19:39 -04:00
|
|
|
DEBUG="-g -signed -D_REENTRANT"
|
|
|
|
CFLAGS="-O2 -w -signed -D_REENTRANT"
|
|
|
|
PROFILE="-p -g3 -O2 -signed -D_REENTRANT"
|
2001-09-09 22:21:46 -04:00
|
|
|
;;
|
2001-10-29 10:02:54 -05:00
|
|
|
*-*-solaris*)
|
2001-10-21 06:07:51 -04:00
|
|
|
DEBUG="-v -g -D_REENTRANT"
|
|
|
|
CFLAGS="-xO4 -fast -w -fsimple -native -xcg92 -D_REENTRANT"
|
|
|
|
PROFILE="-v -xpg -g -xO4 -fast -native -fsimple -xcg92 -Dsuncc -D_REENTRANT"
|
2003-04-21 13:52:12 -04:00
|
|
|
SOCKET_LIBS="-lnsl -lsocket -lresolv"
|
2001-09-09 22:21:46 -04:00
|
|
|
;;
|
|
|
|
*)
|
2001-10-21 10:19:39 -04:00
|
|
|
DEBUG="-g -D_REENTRANT"
|
|
|
|
CFLAGS="-O -D_REENTRANT"
|
|
|
|
PROFILE="-g -p -D_REENTRANT"
|
2001-09-09 22:21:46 -04:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
else
|
|
|
|
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"
|
|
|
|
;;
|
2001-10-29 10:53:28 -05:00
|
|
|
sparc-sun-solaris*)
|
2001-10-21 06:07:51 -04:00
|
|
|
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"
|
2003-04-21 13:52:12 -04:00
|
|
|
SOCKET_LIBS="-lnsl -lsocket -lresolv"
|
2001-09-09 22:21:46 -04:00
|
|
|
;;
|
2003-04-21 13:52:12 -04:00
|
|
|
*-pc-solaris*)
|
2001-10-29 10:53:28 -05:00
|
|
|
DEBUG="-g -Wall -fsigned-char -D_REENTRANT"
|
|
|
|
CFLAGS="-O20 -ffast-math -fsigned-char -D_REENTRANT"
|
|
|
|
PROFILE="-pg -g -O20 -fsigned-char -D_REENTRANT"
|
2003-04-21 13:52:12 -04:00
|
|
|
SOCKET_LIBS="-lnsl -lsocket -lresolv"
|
2003-01-13 05:48:43 -05:00
|
|
|
;;
|
|
|
|
*freebsd*)
|
2003-04-21 13:52:12 -04:00
|
|
|
DEBUG="-g -Wall -fsigned-char"
|
|
|
|
CFLAGS="-O20 -fsigned-char"
|
|
|
|
PROFILE="-O20 -g -pg -fsigned-char"
|
|
|
|
ogg_prefix="/usr/local"
|
|
|
|
vorbis_prefix="/usr/local"
|
2001-10-29 10:53:28 -05:00
|
|
|
;;
|
2001-09-09 22:21:46 -04:00
|
|
|
*)
|
2003-04-21 13:52:12 -04:00
|
|
|
DEBUG="-g -Wall -fsigned-char"
|
|
|
|
CFLAGS="-O20 -Wall -fsigned-char"
|
|
|
|
PROFILE="-O20 -g -pg -Wall -fsigned-char"
|
2001-09-09 22:21:46 -04:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
fi
|
|
|
|
|
|
|
|
dnl Checks for programs.
|
|
|
|
|
|
|
|
dnl Checks for libraries.
|
|
|
|
|
|
|
|
dnl IPV6
|
|
|
|
AC_SEARCH_LIBS(inet_pton, socket, AC_DEFINE(HAVE_IPV6, 1, [Define if you have IPV6 support]))
|
|
|
|
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
|
|
|
|
|
2003-01-15 00:34:20 -05:00
|
|
|
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]),,)
|
2003-02-02 15:43:02 -05:00
|
|
|
AC_CHECK_HEADER(sys/uio.h, AC_DEFINE(HAVE_SYS_UIO_H, 1, [Define if you have sys/uio.h]),,)
|
2001-10-20 17:28:09 -04:00
|
|
|
|
2001-09-09 22:21:46 -04:00
|
|
|
dnl Checks for typedefs, structures, and compiler characteristics.
|
|
|
|
AC_C_CONST
|
|
|
|
|
|
|
|
dnl Check for types
|
2003-01-15 00:58:09 -05:00
|
|
|
AC_CHECK_TYPE([socklen_t], int)
|
2001-09-09 22:21:46 -04:00
|
|
|
|
|
|
|
dnl Checks for library functions.
|
2002-11-22 08:13:04 -05:00
|
|
|
AC_CHECK_FUNCS(nanosleep)
|
2003-02-14 20:13:35 -05:00
|
|
|
AC_CHECK_FUNCS(poll)
|
2002-11-22 08:13:04 -05:00
|
|
|
AC_CHECK_FUNCS(sethostent endhostent)
|
2003-04-21 22:35:05 -04:00
|
|
|
AC_CHECK_FUNCS(getnameinfo getaddrinfo inet_pton inet_aton)
|
2001-09-09 22:21:46 -04:00
|
|
|
|
|
|
|
dnl -- configure options --
|
|
|
|
|
2002-08-11 08:15:40 -04:00
|
|
|
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
|
|
|
|
|
2001-09-09 22:21:46 -04:00
|
|
|
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
|
2001-10-21 10:19:39 -04:00
|
|
|
XML_LIBS="`$XMLCONFIG --libs`"
|
2001-10-21 12:13:02 -04:00
|
|
|
XML_CFLAGS="`$XMLCONFIG --cflags`"
|
2001-10-21 11:12:23 -04:00
|
|
|
save_LIBS="$LIBS"
|
2001-10-21 12:13:02 -04:00
|
|
|
save_CFLAGS="$CFLAGS"
|
2001-10-21 11:12:23 -04:00
|
|
|
LIBS="$LIBS $XML_LIBS"
|
2001-10-21 12:13:02 -04:00
|
|
|
CFLAGS="$CFLAGS $XML_CFLAGS"
|
2001-09-09 22:21:46 -04:00
|
|
|
AC_CHECK_FUNC(xmlParseFile,, [AC_MSG_ERROR([There was a problem linking with libxml])])
|
2001-10-21 11:12:23 -04:00
|
|
|
LIBS="$save_LIBS"
|
2001-10-21 12:13:02 -04:00
|
|
|
CFLAGS="$save_CFLAGS"
|
2001-10-21 11:12:23 -04:00
|
|
|
save_LIBS=
|
2001-10-21 12:13:02 -04:00
|
|
|
save_CFLAGS=
|
2001-09-09 22:21:46 -04:00
|
|
|
else
|
|
|
|
AC_MSG_ERROR([xml-config could not be found])
|
|
|
|
fi
|
|
|
|
|
2003-01-13 05:48:43 -05:00
|
|
|
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)))
|
2003-03-27 12:10:14 -05:00
|
|
|
AM_PATH_CURL(
|
|
|
|
[ICECAST_OBJECTS="$ICECAST_OBJECTS geturl.o yp.o"],
|
|
|
|
[AC_MSG_NOTICE([libcurl not found, YP disabled])])
|
2003-02-02 09:21:57 -05:00
|
|
|
ACX_PTHREAD(, AC_MSG_ERROR(POSIX threads missing))
|
2001-09-09 22:21:46 -04:00
|
|
|
|
|
|
|
dnl Make substitutions
|
|
|
|
|
2002-08-11 08:15:40 -04:00
|
|
|
AC_SUBST(XSLT_CFLAGS)
|
2001-10-21 12:13:02 -04:00
|
|
|
AC_SUBST(XML_CFLAGS)
|
|
|
|
AC_SUBST(OGG_CFLAGS)
|
|
|
|
AC_SUBST(VORBIS_CFLAGS)
|
2002-08-11 08:15:40 -04:00
|
|
|
AC_SUBST(XSLT_LIBS)
|
2001-10-21 11:25:45 -04:00
|
|
|
AC_SUBST(XML_LIBS)
|
|
|
|
AC_SUBST(OGG_LIBS)
|
|
|
|
AC_SUBST(VORBIS_LIBS)
|
|
|
|
AC_SUBST(SOCKET_LIBS)
|
2001-09-09 22:21:46 -04:00
|
|
|
AC_SUBST(LIBTOOL_DEPS)
|
|
|
|
AC_SUBST(OPT)
|
|
|
|
AC_SUBST(LIBS)
|
|
|
|
AC_SUBST(DEBUG)
|
|
|
|
AC_SUBST(CFLAGS)
|
|
|
|
AC_SUBST(PROFILE)
|
2003-03-07 17:39:17 -05:00
|
|
|
AC_SUBST(XIPH_CFLAGS)
|
2003-03-27 12:10:14 -05:00
|
|
|
AC_SUBST(ICECAST_OBJECTS)
|
2001-09-09 22:21:46 -04:00
|
|
|
|
2002-09-24 04:16:24 -04:00
|
|
|
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 win32/Makefile win32/res/Makefile)
|