configure.in 3.9 KB
Newer Older
Jack Moffitt's avatar
Jack Moffitt committed
1
dnl Process this file with autoconf to produce a configure script.
Karl Heyes's avatar
Karl Heyes committed
2
AC_INIT([IceS], [2.0.1], [icecast@xiph.org])
3
AC_PREREQ(2.54)
4
AC_CONFIG_SRCDIR(src/ices.c)
Jack Moffitt's avatar
Jack Moffitt committed
5

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

AC_PROG_CC
AM_PROG_LIBTOOL

dnl Set some options based on environment

Karl Heyes's avatar
Karl Heyes committed
15
dnl BSD headers break when _XOPEN_SOURCE is defined but without it seems
16
dnl to be fine
Karl Heyes's avatar
Karl Heyes committed
17
18
19
20
21
case "$host" in
    *bsd*|*irix*)
    ;;
    *) AC_DEFINE(_XOPEN_SOURCE, 600, [Define if you have POSIX and XPG specifications])
    ;;
22
23
esac
if test -n "$GCC"; then
Karl Heyes's avatar
Karl Heyes committed
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
    AC_DEFINE(_GNU_SOURCE, ,[Define if you have POSIX and GNU specifications])
    XIPH_VAR_APPEND([XIPH_CPPFLAGS], [-ffast-math -fsigned-char])
    XIPH_VAR_APPEND([DEBUG],[-g])
    XIPH_VAR_APPEND([PROFILE],[-g -pg])
else
    case "$host" in 
        *-*-irix*)
            XIPH_VAR_APPEND([DEBUG], [-g -signed -D_REENTRANT])
            XIPH_VAR_APPEND([XIPH_CPPFLAGS],[-O2 -w -signed -D_REENTRANT])
            XIPH_VAR_APPEND([PROFILE],[-p -g3 -O2 -signed -D_REENTRANT])
            ;;
        *-*-solaris*)
            AC_DEFINE(__EXTENSIONS__, 1, [define to 1 to resolve header problem on solaris])
            XIPH_VAR_APPEND([DEBUG],[-v -g -D_REENTRANT])
            XIPH_VAR_APPEND([XIPH_CPPFLAGS],[-xO4 -fast -w -fsimple -native -xcg92 -D_REENTRANT])
            XIPH_VAR_APPEND([PROFILE],[-v -xpg -g -xO4 -fast -native -fsimple -xcg92 -Dsuncc -D_REENTRANT])
            ;;
        *)
            DEBUG="-g -D_REENTRANT"
            XIPH_CPPFLAGS="-O -D_REENTRANT"
            PROFILE="-g -p -D_REENTRANT" 
            ;;
    esac
Jack Moffitt's avatar
Jack Moffitt committed
47
48
49
50
51
52
53
54
fi

dnl Checks for programs.

dnl Checks for libraries.

dnl Checks for header files.
AC_HEADER_STDC
55
AC_CHECK_HEADERS([stropts.h])
Jack Moffitt's avatar
Jack Moffitt committed
56
57
58
59
60
61
62

dnl Check for OSS

AC_CHECK_HEADER(sys/soundcard.h, have_oss=yes, have_oss=no)
AC_CHECK_HEADER(machine/soundcard.h, have_oss=yes, )
AM_CONDITIONAL(HAVE_OSS,test "$have_oss" = yes)
if test "$have_oss" = yes; then
63
    AC_DEFINE(HAVE_OSS,,[Define to enable OSS input module])
Jack Moffitt's avatar
Jack Moffitt committed
64
65
66
67
fi

dnl Check for Sun audio

68
AC_C_BIGENDIAN
69
AC_ARG_ENABLE(sun-audio,
70
71
    AC_HELP_STRING([--disable-sun-audio],
                   [Disable sun audio input (default autodetect)]),
72
73
74
75
76
    enable_sun="$enableval",
    enable_sun=yes
)
if test x$enable_sun = xyes; then
   AC_CHECK_HEADER(sys/audioio.h, have_sun_audio=yes, have_sun_audio=no)
Jack Moffitt's avatar
Jack Moffitt committed
77

78
79
80
   if test "$have_sun_audio" = yes; then
       AC_DEFINE(HAVE_SUN_AUDIO,,[Define to enable sun audio input module])
   fi
Jack Moffitt's avatar
Jack Moffitt committed
81
fi
82
AM_CONDITIONAL(HAVE_SUN_AUDIO,test "$have_sun_audio" = yes)
Jack Moffitt's avatar
Jack Moffitt committed
83

84
85
86
87
88
89
90
dnl Check for ALSA audio

AC_CHECK_HEADER(alsa/asoundlib.h, have_alsa=yes, have_alsa=no)
AM_CONDITIONAL(HAVE_ALSA,test "$have_alsa" = yes)

if test "$have_alsa" = yes; then
   ALSA_LIBS="-lasound"
91
   AC_DEFINE(HAVE_ALSA, ,[Define to enable ALSA input module])
92
93
fi

Jack Moffitt's avatar
Jack Moffitt committed
94
95
96
97
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST

dnl Check for types
98
AC_CHECK_TYPES([uint64_t],,AC_ERROR([could not find a uint64_t type]))
Jack Moffitt's avatar
Jack Moffitt committed
99
100
101

dnl Checks for library functions.

102
XIPH_PATH_XML
103
104
105
106
XIPH_VAR_APPEND([XIPH_CFLAGS], [$XML_CFLAGS])
XIPH_VAR_PREPEND([XIPH_LIBS], [$XML_LIBS])

XIPH_PATH_SHOUT(, AC_MSG_ERROR([must have libshout installed!]))
107
108
109
110
111
if test "$SHOUT_THREADSAFE" != "yes"
then
  AC_MSG_ERROR([This libshout isn't threadsafe])
fi

112
113
114
XIPH_VAR_APPEND([XIPH_CPPFLAGS], [$SHOUT_CPPFLAGS])
XIPH_VAR_APPEND([XIPH_CFLAGS], [$SHOUT_CFLAGS])
XIPH_VAR_PREPEND([XIPH_LIBS], [$SHOUT_LIBS])
Jack Moffitt's avatar
Jack Moffitt committed
115

Karl Heyes's avatar
Karl Heyes committed
116
XIPH_PATH_VORBIS(, AC_MSG_ERROR([must have Ogg Vorbis v1.0 or above installed!]))
117
118
XIPH_VAR_APPEND([XIPH_CPPFLAGS], [$VORBIS_CFLAGS $VORBISENC_CFLAGS])
XIPH_VAR_PREPEND([XIPH_LIBS], [$VORBISENC_LIBS $VORBIS_LIBS])
Jack Moffitt's avatar
Jack Moffitt committed
119
120
121

dnl Make substitutions

122
AC_SUBST(ALSA_LIBS)
Jack Moffitt's avatar
Jack Moffitt committed
123
AC_SUBST(XML_LIBS)
124
AC_SUBST(XML_CFLAGS)
Jack Moffitt's avatar
Jack Moffitt committed
125
126
127
AC_SUBST(LIBTOOL_DEPS)
AC_SUBST(DEBUG)
AC_SUBST(PROFILE)
128
AC_SUBST(XIPH_CFLAGS)
129
130
AC_SUBST(XIPH_CPPFLAGS)
AC_SUBST(XIPH_LIBS)
Jack Moffitt's avatar
Jack Moffitt committed
131

132
133
134
AC_OUTPUT(
  Makefile
  conf/Makefile 
135
  doc/Makefile 
keegan's avatar
keegan committed
136
  debian/Makefile
137
138
139
  src/Makefile 
   src/log/Makefile 
   src/timing/Makefile
140
   src/thread/Makefile
141
   src/avl/Makefile
142
)