configure.ac 5.18 KB
Newer Older
1
AC_INIT([Icecast], [2.4.99.1], [icecast@xiph.org])
2

3 4
AC_PREREQ([2.54])
AC_CONFIG_SRCDIR([src/main.c])
5
AC_CONFIG_MACRO_DIR([m4])
6
dnl Process this file with autoconf to produce a configure script.
Jack Moffitt's avatar
Jack Moffitt committed
7

8
AM_INIT_AUTOMAKE
9
AM_CONFIG_HEADER([config.h])
10
AM_MAINTAINER_MODE
Jack Moffitt's avatar
Jack Moffitt committed
11 12 13

AC_PROG_CC
AC_CANONICAL_HOST
Karl Heyes's avatar
Karl Heyes committed
14
AC_PROG_LIBTOOL
Karl Heyes's avatar
Karl Heyes committed
15
AC_SYS_LARGEFILE
Jack Moffitt's avatar
Jack Moffitt committed
16 17 18

dnl Set some options based on environment

19
DEBUG="-g"
Jack Moffitt's avatar
Jack Moffitt committed
20
if test -z "$GCC"; then
21
    XIPH_CPPFLAGS="-D_REENTRANT"
22
    PROFILE="-g -p"
Jack Moffitt's avatar
Jack Moffitt committed
23
else
24 25
    XIPH_CPPFLAGS="-Wall -ffast-math -fsigned-char"
    PROFILE="-pg -g"
brendan's avatar
brendan committed
26
    AC_DEFINE([_GNU_SOURCE], 1, [Define to include GNU extensions to POSIX])
Jack Moffitt's avatar
Jack Moffitt committed
27 28 29 30 31 32 33 34
fi

dnl Checks for programs.

dnl Checks for libraries.

dnl Checks for header files.
AC_HEADER_STDC
35
AC_HEADER_TIME
Jack Moffitt's avatar
Jack Moffitt committed
36

37
AC_CHECK_HEADERS([alloca.h sys/timeb.h])
38 39 40 41
AC_CHECK_HEADERS([pwd.h unistd.h grp.h sys/types.h],,,AC_INCLUDES_DEFAULT)
AC_CHECK_FUNCS([setuid])
AC_CHECK_FUNCS([chroot])
AC_CHECK_FUNCS([chown])
42
AC_CHECK_FUNCS([strcasestr])
43 44
AC_CHECK_FUNCS([gethostname])
AC_CHECK_FUNCS([uname])
45
AC_CHECK_FUNCS([setenv])
46 47
AC_CHECK_FUNCS([setresuid])
AC_CHECK_FUNCS([setresgid])
48

Jack Moffitt's avatar
Jack Moffitt committed
49
dnl Checks for typedefs, structures, and compiler characteristics.
50
XIPH_C__FUNC__
Jack Moffitt's avatar
Jack Moffitt committed
51 52 53 54

dnl Check for types

dnl Checks for library functions.
55 56 57
AC_CHECK_FUNCS([localtime_r poll gettimeofday ftime])

AC_SEARCH_LIBS([nanosleep], [rt posix4], AC_DEFINE([HAVE_NANOSLEEP], [1], [Define if you have nanosleep]))
58
XIPH_NET
Jack Moffitt's avatar
Jack Moffitt committed
59 60 61

dnl -- configure options --

62 63 64
XIPH_PATH_XSLT
XIPH_VAR_APPEND([XIPH_CPPFLAGS],[$XSLT_CFLAGS])
XIPH_VAR_PREPEND([XIPH_LIBS],[$XSLT_LIBS])
65

66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82
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])
    ])

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!])
    ])
Jack Moffitt's avatar
Jack Moffitt committed
83

84 85 86 87 88 89 90 91 92
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!])
    ])

93 94 95 96 97 98 99 100 101 102 103 104 105
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 we still use format_kate as it doesn't need libkate to work
#ICECAST_OPTIONAL="$ICECAST_OPTIONAL format_kate.o"

brendan's avatar
brendan committed
106
ACX_PTHREAD(, AC_MSG_ERROR([POSIX threads missing]))
107 108 109
XIPH_VAR_APPEND([XIPH_CFLAGS],[$PTHREAD_CFLAGS])
XIPH_VAR_APPEND([XIPH_CPPFLAGS],[$PTHREAD_CPPFLAGS])
XIPH_VAR_PREPEND([XIPH_LIBS],[$PTHREAD_LIBS])
brendan's avatar
brendan committed
110

111
XIPH_PATH_CURL([
112
    AC_CHECK_DECL([CURLOPT_NOSIGNAL],
Karl Heyes's avatar
Karl Heyes committed
113
        [ AC_DEFINE([HAVE_AUTH_URL], 1, [Define to compile in auth URL support code])
114
        AC_CHECK_FUNCS([curl_global_init])
115
        ICECAST_OPTIONAL="$ICECAST_OPTIONAL auth_url.o event_url.o curl.o"
Karl Heyes's avatar
Karl Heyes committed
116
        enable_curl="yes"
117 118
        XIPH_VAR_APPEND([XIPH_CPPFLAGS],[$CURL_CFLAGS])
        XIPH_VAR_PREPEND([XIPH_LIBS],[$CURL_LIBS])
119
        ], [ AC_MSG_NOTICE([Your curl dev files are too old (7.10 or above required)])
120 121
        ], [#include <curl/curl.h>
        ])
Karl Heyes's avatar
Karl Heyes committed
122
    ],[ AC_MSG_NOTICE([libcurl not found])
123
    ])
Karl Heyes's avatar
Karl Heyes committed
124 125 126 127 128 129 130 131 132
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"
133 134
else
    AC_MSG_NOTICE([YP support disabled])
brendan's avatar
brendan committed
135
fi
136 137 138 139 140 141 142
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!])
    ])
Jack Moffitt's avatar
Jack Moffitt committed
143

144 145 146 147 148 149 150 151 152 153 154 155 156 157 158

dnl Documentation

AC_PATH_PROG([MKDOCS], [mkdocs], [no])

AS_IF([test "$MKDOCS" = "no"], [
    AC_MSG_WARN([mkdocs not found - generating docs will be disabled])
])
AM_CONDITIONAL([HAVE_MKDOCS], [test ! "$MKDOCS" = "no"])

AM_COND_IF([HAVE_MKDOCS], [
    AC_CONFIG_FILES([doc/mkdocs.yml])
])


Jack Moffitt's avatar
Jack Moffitt committed
159 160
dnl Make substitutions

161 162 163
AC_SUBST(XIPH_CPPFLAGS)
AC_SUBST(XIPH_CFLAGS)
AC_SUBST(XIPH_LIBS)
164
AC_SUBST(XIPH_LDFLAGS)
165 166 167
AC_SUBST(PTHREAD_CPPFLAGS)
AC_SUBST(PTHREAD_CFLAGS)
AC_SUBST(PTHREAD_LIBS)
Jack Moffitt's avatar
Jack Moffitt committed
168 169 170 171 172
AC_SUBST(LIBTOOL_DEPS)
AC_SUBST(LIBS)
AC_SUBST(DEBUG)
AC_SUBST(CFLAGS)
AC_SUBST(PROFILE)
173
AC_SUBST(ICECAST_OPTIONAL)
174 175
AC_SUBST(HAVE_KATE)
AC_SUBST(KATE_LIBS)
Jack Moffitt's avatar
Jack Moffitt committed
176

177 178
AC_OUTPUT([Makefile conf/Makefile src/Makefile src/common/avl/Makefile
src/common/httpp/Makefile src/common/thread/Makefile src/common/log/Makefile
179
src/common/net/Makefile src/common/timing/Makefile doc/Makefile web/Makefile web/assets/Makefile web/assets/css/Makefile
180
web/assets/font/Makefile admin/Makefile admin/includes/Makefile win32/Makefile
181
 examples/Makefile])