configure.in 4.42 KB
Newer Older
Jack Moffitt's avatar
Jack Moffitt committed
1
AC_INIT(src/main.c)
brendan's avatar
brendan committed
2
AC_PREREQ(2.50)
3
dnl Process this file with autoconf to produce a configure script.
Jack Moffitt's avatar
Jack Moffitt committed
4

5
AM_INIT_AUTOMAKE(icecast,2.0-alpha-2)
6
AM_CONFIG_HEADER(config.h)
Jack Moffitt's avatar
Jack Moffitt committed
7 8 9 10 11 12 13

AC_PROG_CC
AC_CANONICAL_HOST
AM_PROG_LIBTOOL

dnl Set some options based on environment

14
case "$host" in
15 16
    *openbsd*)
    ;;
17
    *) AC_DEFINE(_XOPEN_SOURCE, 600, [Define if you have POSIX and XPG specifications])
18 19
    ;;
esac
Jack Moffitt's avatar
Jack Moffitt committed
20
if test -z "$GCC"; then
21
    case $host in 
Jack Moffitt's avatar
Jack Moffitt committed
22
        *-*-irix*)
Jack Moffitt's avatar
Jack Moffitt committed
23
                DEBUG="-g -signed -D_REENTRANT" 
24
                XIPH_CFLAGS="-O2 -w -signed -D_REENTRANT"
Jack Moffitt's avatar
Jack Moffitt committed
25
                PROFILE="-p -g3 -O2 -signed -D_REENTRANT"
26
                ;;
Jack Moffitt's avatar
Jack Moffitt committed
27
        *-*-solaris*)
28
                DEBUG="-v -g -D_REENTRANT"
29
                XIPH_CFLAGS="-xO4 -fast -w -fsimple -native -xcg92 -D_REENTRANT"
30
                PROFILE="-v -xpg -g -xO4 -fast -native -fsimple -xcg92 -Dsuncc -D_REENTRANT"
31
                ;;
Jack Moffitt's avatar
Jack Moffitt committed
32
        *)
Jack Moffitt's avatar
Jack Moffitt committed
33
                DEBUG="-g -D_REENTRANT"
34
                XIPH_CFLAGS="-O -D_REENTRANT"
Jack Moffitt's avatar
Jack Moffitt committed
35
                PROFILE="-g -p -D_REENTRANT"
36 37
                ;;
    esac
Jack Moffitt's avatar
Jack Moffitt committed
38
else
39
    case $host in 
Jack Moffitt's avatar
Jack Moffitt committed
40
        *-*-linux*)
41 42 43 44
                DEBUG="-g -Wall -fsigned-char -D_GNU_SOURCE"
                XIPH_CPPFLAGS="-ffast-math -fsigned-char -D_GNU_SOURCE"
                PROFILE="-Wall -W -pg -g -ffast-math -fsigned-char -D_GNU_SOURCE"
                ;;
45
        sparc-sun-solaris*)
46 47 48 49 50 51 52 53 54 55
                AC_DEFINE(__EXTENSIONS__, 1, [define to 1 to get resolve header problem on solaris])
                DEBUG="-g -Wall -fsigned-char -mv8"
                XIPH_CPPFLAGS="-ffast-math -fsigned-char -mv8"
                PROFILE="-pg -g -fsigned-char -mv8" 
                ;;
        *-pc-solaris*)
                DEBUG="-g -Wall -fsigned-char"
                XIPH_CPPFLAGS="-ffast-math -fsigned-char"
                PROFILE="-pg -g -fsigned-char" 
                ;;
56
        *freebsd*)
57
                DEBUG="-g -Wall -fsigned-char"
58 59 60
                XIPH_CPPFLAGS="-fsigned-char"
                PROFILE="-g -pg -fsigned-char" 
                ;;
Jack Moffitt's avatar
Jack Moffitt committed
61
        *)
62
                DEBUG="-g -Wall -fsigned-char"
63 64 65 66
                XIPH_CPPFLAGS="-Wall -fsigned-char"
                PROFILE="-g -pg -Wall -fsigned-char" 
                ;;
    esac
Jack Moffitt's avatar
Jack Moffitt committed
67 68 69 70 71 72 73 74 75
fi

dnl Checks for programs.

dnl Checks for libraries.

dnl Checks for header files.
AC_HEADER_STDC

76 77
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]),,)
78

Jack Moffitt's avatar
Jack Moffitt committed
79 80 81 82 83
dnl Checks for typedefs, structures, and compiler characteristics.

dnl Check for types

dnl Checks for library functions.
84 85
AC_CHECK_FUNCS(nanosleep poll)
XIPH_NET
Jack Moffitt's avatar
Jack Moffitt committed
86 87 88

dnl -- configure options --

89 90 91
XIPH_PATH_XSLT
XIPH_VAR_APPEND([XIPH_CPPFLAGS],[$XSLT_CFLAGS])
XIPH_VAR_PREPEND([XIPH_LIBS],[$XSLT_LIBS])
92

93 94 95
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
96

brendan's avatar
brendan committed
97
ACX_PTHREAD(, AC_MSG_ERROR([POSIX threads missing]))
98 99 100
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
101 102 103

dnl -- YP support --
AC_ARG_ENABLE([yp],
104
        AC_HELP_STRING([--disable-yp],[disable YP directory support]))
brendan's avatar
brendan committed
105 106
if test "x$enable_yp" != "xno"
then
107
XIPH_PATH_CURL([
brendan's avatar
brendan committed
108 109
  AC_CHECK_DECL([CURLOPT_NOSIGNAL], [
    AC_DEFINE([USE_YP], 1, [Define to compile in YP support code])
110
    ICECAST_OPTIONAL="$ICECAST_OPTIONAL geturl.o yp.o"
brendan's avatar
brendan committed
111 112 113 114 115 116 117 118 119 120 121 122 123 124 125
    ], [
    if test "x$enable_yp" != "xyes"
    then
      AC_MSG_NOTICE([Your curl dev files are too old (7.10 or above required), YP disabled])
    else
      AC_MSG_ERROR([Your curl dev files are too old (7.10 or above required)])
    fi
    ], [#include <curl/curl.h>])
  ], [
  if test "x$enable_yp" != "xyes"
  then
    AC_MSG_NOTICE([libcurl not found, YP disabled])
  else
    AC_MSG_ERROR([libcurl not found])
  fi
126
  ])
brendan's avatar
brendan committed
127
fi
128 129
XIPH_VAR_APPEND([XIPH_CFLAGS],[$CURL_CFLAGS])
XIPH_VAR_PREPEND([XIPH_LIBS],[$CURL_LIBS])
Jack Moffitt's avatar
Jack Moffitt committed
130 131 132

dnl Make substitutions

133 134 135 136 137 138
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
139 140 141 142 143
AC_SUBST(LIBTOOL_DEPS)
AC_SUBST(LIBS)
AC_SUBST(DEBUG)
AC_SUBST(CFLAGS)
AC_SUBST(PROFILE)
144
AC_SUBST(ICECAST_OPTIONAL)
Jack Moffitt's avatar
Jack Moffitt committed
145

146
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 admin/Makefile win32/Makefile win32/res/Makefile)