configure.in 4.59 KB
Newer Older
Ed "oddsock" Zaleski's avatar
Ed "oddsock" Zaleski committed
1
AC_INIT([Icecast], [2.3.1], [icecast@xiph.org])
2

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

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

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

dnl Set some options based on environment

18
DEBUG="-g"
Jack Moffitt's avatar
Jack Moffitt committed
19
if test -z "$GCC"; then
20
    XIPH_CPPFLAGS="-D_REENTRANT"
21
    case $host in 
Jack Moffitt's avatar
Jack Moffitt committed
22
        *-*-irix*)
23
                XIPH_CPPFLAGS="$XIPH_CPPFLAGS -w -signed"
Jack Moffitt's avatar
Jack Moffitt committed
24
                PROFILE="-p -g3 -O2 -signed -D_REENTRANT"
25
                ;;
Jack Moffitt's avatar
Jack Moffitt committed
26
        *-*-solaris*)
27 28 29
                XIPH_CFLAGS="-xO4 -xcg92"
                XIPH_CPPFLAGS="$XIPH_CPPFLAGS -v -w -fsimple -fast"
                PROFILE="-xpg -g -Dsuncc"
30
                ;;
Jack Moffitt's avatar
Jack Moffitt committed
31
        *)
32 33
                XIPH_CFLAGS="-O"
                PROFILE="-g -p"
34 35
                ;;
    esac
brendan's avatar
brendan committed
36 37 38 39 40 41 42 43

    case "$host" in
        *openbsd* | *irix*)
        ;;
        *) AC_DEFINE([_XOPEN_SOURCE], 600, [Define if you have POSIX and XPG specifications])
        ;;
    esac

Jack Moffitt's avatar
Jack Moffitt committed
44
else
45 46
    XIPH_CPPFLAGS="-Wall -ffast-math -fsigned-char"
    PROFILE="-pg -g"
brendan's avatar
brendan committed
47
    AC_DEFINE([_GNU_SOURCE], 1, [Define to include GNU extensions to POSIX])
Jack Moffitt's avatar
Jack Moffitt committed
48 49 50 51 52 53 54 55 56
fi

dnl Checks for programs.

dnl Checks for libraries.

dnl Checks for header files.
AC_HEADER_STDC

brendan's avatar
brendan committed
57
AC_CHECK_HEADERS([alloca.h])
58 59
AC_CHECK_HEADERS(pwd.h, AC_DEFINE(CHUID, 1, [Define if you have pwd.h]),,)
AC_CHECK_HEADERS(unistd.h, AC_DEFINE(CHROOT, 1, [Define if you have unistd.h]),,)
60

Jack Moffitt's avatar
Jack Moffitt committed
61 62 63 64 65
dnl Checks for typedefs, structures, and compiler characteristics.

dnl Check for types

dnl Checks for library functions.
66 67 68
AC_CHECK_FUNCS(localtime_r poll)
AC_SEARCH_LIBS(nanosleep, rt posix4, AC_DEFINE(HAVE_NANOSLEEP, 1,
    [Define if you have nanosleep]))
69
XIPH_NET
Jack Moffitt's avatar
Jack Moffitt committed
70 71 72

dnl -- configure options --

73 74 75
XIPH_PATH_XSLT
XIPH_VAR_APPEND([XIPH_CPPFLAGS],[$XSLT_CFLAGS])
XIPH_VAR_PREPEND([XIPH_LIBS],[$XSLT_LIBS])
76

77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93
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
94

95 96 97 98 99 100 101 102 103
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!])
    ])

brendan's avatar
brendan committed
104
ACX_PTHREAD(, AC_MSG_ERROR([POSIX threads missing]))
105 106 107
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
108

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

dnl Make substitutions

143 144 145
AC_SUBST(XIPH_CPPFLAGS)
AC_SUBST(XIPH_CFLAGS)
AC_SUBST(XIPH_LIBS)
146
AC_SUBST(XIPH_LDFLAGS)
147 148 149
AC_SUBST(PTHREAD_CPPFLAGS)
AC_SUBST(PTHREAD_CFLAGS)
AC_SUBST(PTHREAD_LIBS)
Jack Moffitt's avatar
Jack Moffitt committed
150 151 152 153 154
AC_SUBST(LIBTOOL_DEPS)
AC_SUBST(LIBS)
AC_SUBST(DEBUG)
AC_SUBST(CFLAGS)
AC_SUBST(PROFILE)
155
AC_SUBST(ICECAST_OPTIONAL)
Jack Moffitt's avatar
Jack Moffitt committed
156

keegan's avatar
keegan committed
157
AC_OUTPUT([Makefile conf/Makefile debian/Makefile src/Makefile src/avl/Makefile
158 159
src/httpp/Makefile src/thread/Makefile src/log/Makefile
src/net/Makefile src/timing/Makefile doc/Makefile web/Makefile
160
admin/Makefile win32/Makefile win32/res/Makefile examples/Makefile])