configure.in 3.45 KB
Newer Older
1
AC_INIT([Icecast], [2.1RC2], [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
Jack Moffitt's avatar
Jack Moffitt committed
14 15 16

dnl Set some options based on environment

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

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

dnl Checks for programs.

dnl Checks for libraries.

dnl Checks for header files.
AC_HEADER_STDC

brendan's avatar
brendan committed
56
AC_CHECK_HEADERS([alloca.h])
57 58
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]),,)
59

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

dnl Check for types

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

dnl -- configure options --

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

76 77 78
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])
Jack Moffitt's avatar
Jack Moffitt committed
79

brendan's avatar
brendan committed
80
ACX_PTHREAD(, AC_MSG_ERROR([POSIX threads missing]))
81 82 83
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
84 85

dnl -- YP support --
Karl Heyes's avatar
Karl Heyes committed
86 87 88 89
AC_ARG_ENABLE([yp],
        AC_HELP_STRING([--disable-yp],[disable YP directory support]),
        enable_yp="$enableval",
        enable_yp="yes")
90
if test "x$enable_yp" = "xyes"
brendan's avatar
brendan committed
91
then
92
XIPH_PATH_CURL([
93 94
    AC_CHECK_DECL([CURLOPT_NOSIGNAL],
        [ AC_DEFINE([USE_YP], 1, [Define to compile in YP support code])
95
        ICECAST_OPTIONAL="$ICECAST_OPTIONAL yp.o"
96 97 98 99 100 101 102 103 104
        XIPH_VAR_APPEND([XIPH_CPPFLAGS],[$CURL_CFLAGS])
        XIPH_VAR_PREPEND([XIPH_LIBS],[$CURL_LIBS])
        ], [ AC_MSG_NOTICE([Your curl dev files are too old (7.10 or above required), YP disabled])
        ], [#include <curl/curl.h>
        ])
    ],[ AC_MSG_NOTICE([libcurl not found, YP disabled])
    ])
else
    AC_MSG_NOTICE([YP support disabled])
brendan's avatar
brendan committed
105
fi
Jack Moffitt's avatar
Jack Moffitt committed
106 107 108

dnl Make substitutions

109 110 111 112 113 114
AC_SUBST(XIPH_CPPFLAGS)
AC_SUBST(XIPH_CFLAGS)
AC_SUBST(XIPH_LIBS)
AC_SUBST(PTHREAD_CPPFLAGS)
AC_SUBST(PTHREAD_CFLAGS)
AC_SUBST(PTHREAD_LIBS)
Jack Moffitt's avatar
Jack Moffitt committed
115 116 117 118 119
AC_SUBST(LIBTOOL_DEPS)
AC_SUBST(LIBS)
AC_SUBST(DEBUG)
AC_SUBST(CFLAGS)
AC_SUBST(PROFILE)
120
AC_SUBST(ICECAST_OPTIONAL)
Jack Moffitt's avatar
Jack Moffitt committed
121

keegan's avatar
keegan committed
122
AC_OUTPUT([Makefile conf/Makefile debian/Makefile src/Makefile src/avl/Makefile
123 124 125
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])