Commit 5161a7bb authored by Karl Heyes's avatar Karl Heyes
Browse files

hopefully last lot of autotool changes for a while (yipee!), this cleans

up the macros a bit more, the --with-* are shorter and in line with
libshout, variables can be passed via commandline or environment and
shout-config is used by default.

svn path=/trunk/ices/; revision=4572
parent a1742490
## Process this file with automake to produce Makefile.in
AUTOMAKE_OPTIONS = foreign dist-zip
AUTOMAKE_OPTIONS = foreign dist-zip dist-bzip2
ACLOCAL_AMFLAGS = -I m4
SUBDIRS = src conf
......
......@@ -3,8 +3,9 @@ AC_INIT([IceS], 2.0-Beta2, [icecast@xiph.org])
AC_PREREQ(2.52)
AC_CONFIG_SRCDIR(src/ices.c)
AM_INIT_AUTOMAKE(dist-bzip2)
AM_INIT_AUTOMAKE
AM_CONFIG_HEADER(config.h)
AM_MAINTAINER_MODE
AC_PROG_CC
AM_PROG_LIBTOOL
......@@ -63,8 +64,8 @@ fi
dnl Check for Sun audio
AC_ARG_ENABLE(sun-audio,
AC_HELP_STRING([--enable-sun-audio],
[Enable sun audio input (default autodetect)]),
AC_HELP_STRING([--disable-sun-audio],
[Disable sun audio input (default autodetect)]),
enable_sun="$enableval",
enable_sun=yes
)
......@@ -119,57 +120,49 @@ AC_CHECK_LIB(resolv, res_query, LIBS="-lresolv $LIBS",)
dnl -- configure options --
dnl deal with xml-config
AC_MSG_RESULT([checking for XML configuration])
AC_ARG_VAR([XMLCONFIG],[XML configuration program])
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"]
[AC_HELP_STRING([--with-xml-config=PATH],
[use xml-config in PATH to find libxml])],
[XMLCONFIG="$withval"],
[AC_PATH_PROGS(XMLCONFIG, [xml2-config xml-config], "")]
)
if test -z "$XMLCONFIG"
then
AC_CHECK_PROGS(XMLCONFIG, [xml2-config xml-config])
if test "x$XMLCONFIG" = "x"; then
AC_MSG_ERROR([XML configuration could not be found])
fi
if test -n "$XMLCONFIG"
then
XML_LIBS="`$XMLCONFIG --libs`"
XML_CFLAGS="`$XMLCONFIG --cflags`"
LIBS="$XML_LIBS $LIBS"
XIPH_CFLAGS="$XIPH_CFLAGS $XML_CFLAGS"
AC_CHECK_FUNC(xmlParseFile,, [AC_MSG_ERROR([There was a problem linking with libxml])])
else
AC_MSG_ERROR([xml-config could not be found])
if ! test -x "$XMLCONFIG"; then
AC_MSG_ERROR([$XMLCONFIG cannot be executed])
fi
XML_LIBS="$($XMLCONFIG --libs)"
XML_CFLAGS="$($XMLCONFIG --cflags)"
LIBS="$XML_LIBS $LIBS"
XIPH_CFLAGS="$XIPH_CFLAGS $XML_CFLAGS"
AC_CHECK_FUNC(xmlParseFile,, [AC_MSG_ERROR([There was a problem linking with libxml])])
AM_PATH_OGG(, AC_MSG_ERROR(must have Ogg installed!))
AM_PATH_OGG(, AC_MSG_ERROR([must have Ogg v1.0 installed!]))
LIBS="$OGG_LIBS $LIBS"
XIPH_CFLAGS="$XIPH_CFLAGS $OGG_CFLAGS"
AM_PATH_VORBIS(, AC_MSG_ERROR(must have Vorbis installed!))
AM_PATH_VORBIS(, AC_MSG_ERROR([must have Vorbis v1.0 installed!]))
LIBS="$VORBIS_LIBS $VORBISENC_LIBS $LIBS"
XIPH_CFLAGS="$XIPH_CFLAGS $VORBIS_CFLAGS $VORBISENC_CFLAGS"
dnl we expect thread support in libshout
save_CFLAGS=$CFLAGS
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
AM_PATH_SHOUT(, AC_MSG_ERROR(must have libshout installed!))
AM_PATH_SHOUT(, AC_MSG_ERROR([must have libshout installed!]))
LIBS="$SHOUT_LIBS $LIBS"
XIPH_CFLAGS="$XIPH_CFLAGS $SHOUT_CFLAGS"
CFLAGS=$save_CFLAGS
dnl Make substitutions
AC_SUBST(ICES_EXTRA_OBJS)
AC_SUBST(ALSA_LIBS)
AC_SUBST(XML_LIBS)
AC_SUBST(SHOUT_LIBS)
AC_SUBST(OGG_CFLAGS)
AC_SUBST(VORBIS_CFLAGS)
AC_SUBST(SHOUT_CLFAGS)
AC_SUBST(XML_CFLAGS)
AC_SUBST(LIBTOOL_DEPS)
AC_SUBST(OPT)
AC_SUBST(LIBS)
AC_SUBST(DEBUG)
AC_SUBST(PROFILE)
......
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