configure.in 5.68 KB
Newer Older
Jack Moffitt's avatar
Jack Moffitt committed
1
dnl Process this file with autoconf to produce a configure script.
2
3
4
5
6
dnl
dnl Options refactored to allow all audio input modules to be enabled/disabled
dnl by Thomas B. "dm8tbr" Ruecker <thomas.ruecker@tieto.com>
dnl
AC_INIT([IceS], [2.0.2], [icecast@xiph.org])
7
AC_PREREQ(2.54)
8
AC_CONFIG_SRCDIR(src/ices.c)
Jack Moffitt's avatar
Jack Moffitt committed
9

10
AM_INIT_AUTOMAKE
11
AM_CONFIG_HEADER(config.h)
12
AM_MAINTAINER_MODE
Jack Moffitt's avatar
Jack Moffitt committed
13
14
15
16
17
18

AC_PROG_CC
AM_PROG_LIBTOOL

dnl Set some options based on environment

Karl Heyes's avatar
Karl Heyes committed
19
dnl BSD headers break when _XOPEN_SOURCE is defined but without it seems
20
dnl to be fine
21
if test -n "$GCC"; then
Karl Heyes's avatar
Karl Heyes committed
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
    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
45
46
47
48
49
50
51
52
fi

dnl Checks for programs.

dnl Checks for libraries.

dnl Checks for header files.
AC_HEADER_STDC
Karl Heyes's avatar
Karl Heyes committed
53
AC_CHECK_HEADERS([stropts.h sys/timeb.h sys/select.h])
Jack Moffitt's avatar
Jack Moffitt committed
54

55
dnl ================================================================
Jack Moffitt's avatar
Jack Moffitt committed
56
dnl Check for OSS
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
dnl ================================================================

AC_ARG_ENABLE(oss,
 	[AC_HELP_STRING([--disable-oss],
 	[OSS support [default=autodetect]])],,
 	enable_oss=yes)

if test "x$enable_oss" = xyes ; then
    AC_CHECK_HEADER(sys/soundcard.h, have_oss=yes, have_oss=no)
    AC_CHECK_HEADER(machine/soundcard.h, have_oss=yes, )
    if test "$have_oss" = yes; then
	AC_DEFINE(HAVE_OSS,,[Define to enable OSS input module])
    fi
else
    have_oss=no
fi
Jack Moffitt's avatar
Jack Moffitt committed
73
74
75

AM_CONDITIONAL(HAVE_OSS,test "$have_oss" = yes)

76
77

dnl ================================================================
Jack Moffitt's avatar
Jack Moffitt committed
78
dnl Check for Sun audio
79
dnl ================================================================
Jack Moffitt's avatar
Jack Moffitt committed
80

81
AC_C_BIGENDIAN
82
AC_ARG_ENABLE(sun-audio,
83
    AC_HELP_STRING([--disable-sun-audio],
84
                   [Sun audio input [default=autodetect]]),
85
86
87
88
89
    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
90

91
92
93
   if test "$have_sun_audio" = yes; then
       AC_DEFINE(HAVE_SUN_AUDIO,,[Define to enable sun audio input module])
   fi
94
95
else
    have_sun_audio=no
Jack Moffitt's avatar
Jack Moffitt committed
96
fi
97

98
AM_CONDITIONAL(HAVE_SUN_AUDIO,test "$have_sun_audio" = yes)
Jack Moffitt's avatar
Jack Moffitt committed
99

100
dnl ================================================================
101
dnl Check for ALSA audio
102
dnl ================================================================
103

104
105
106
107
108
109
110
AC_ARG_ENABLE(alsa,
 	[AC_HELP_STRING([--disable-alsa],
 	[ALSA support [default=autodetect]])],,
 	enable_alsa=yes)

if test "x$enable_alsa" = xyes ; then
    AC_CHECK_HEADER(alsa/asoundlib.h, have_alsa=yes, have_alsa=no)
111

112
113
114
115
116
117
    if test "$have_alsa" = yes; then
        ALSA_LIBS="-lasound"
	AC_DEFINE(HAVE_ALSA, ,[Define to enable ALSA input module])
    fi
else
    have_alsa=no
118
119
fi

120
121
122
AM_CONDITIONAL(HAVE_ALSA,test "$have_alsa" = yes)

dnl ================================================================
123
dnl Check for RoarAudio
124
dnl ================================================================
125

126
127
128
129
130
131
132
AC_ARG_ENABLE(roaraudio,
 	[AC_HELP_STRING([--disable-roaraudio],
 	[Roaraudio support [default=autodetect]])],,
 	enable_roaraudio=yes)

if test "x$enable_roaraudio" = xyes ; then
    PKG_CHECK_MODULES(RoarAudio, [libroar >= 0.4.0], have_roaraudio=yes, have_roaraudio=no)
133

134
135
136
137
138
139
    if test "$have_roaraudio" = yes; then
	ROARAUDIO_LIBS="-lroar"
        AC_DEFINE(HAVE_ROARAUDIO, ,[Define to enable RoarAudio input module])
    fi
else
    have_roaraudio=no
140
141
fi

142
143
144
AM_CONDITIONAL(HAVE_ROARAUDIO,test "$have_roaraudio" = yes)


Jack Moffitt's avatar
Jack Moffitt committed
145
146
147
148
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST

dnl Check for types
149
AC_CHECK_TYPES([uint64_t],,AC_ERROR([could not find a uint64_t type]))
Jack Moffitt's avatar
Jack Moffitt committed
150
151
152

dnl Checks for library functions.

153
154
AC_CHECK_FUNCS([gettimeofday ftime])

155
XIPH_PATH_XML
156
157
158
159
XIPH_VAR_APPEND([XIPH_CFLAGS], [$XML_CFLAGS])
XIPH_VAR_PREPEND([XIPH_LIBS], [$XML_LIBS])

XIPH_PATH_SHOUT(, AC_MSG_ERROR([must have libshout installed!]))
160
161
162
163
164
if test "$SHOUT_THREADSAFE" != "yes"
then
  AC_MSG_ERROR([This libshout isn't threadsafe])
fi

165
166
167
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
168

Karl Heyes's avatar
Karl Heyes committed
169
XIPH_PATH_VORBIS(, AC_MSG_ERROR([must have Ogg Vorbis v1.0 or above installed!]))
170
171
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
172
173
174

dnl Make substitutions

175
AC_SUBST(ALSA_LIBS)
176
AC_SUBST(ROARAUDIO_LIBS)
Jack Moffitt's avatar
Jack Moffitt committed
177
AC_SUBST(XML_LIBS)
178
AC_SUBST(XML_CFLAGS)
Jack Moffitt's avatar
Jack Moffitt committed
179
180
181
AC_SUBST(LIBTOOL_DEPS)
AC_SUBST(DEBUG)
AC_SUBST(PROFILE)
182
AC_SUBST(XIPH_CFLAGS)
183
184
AC_SUBST(XIPH_CPPFLAGS)
AC_SUBST(XIPH_LIBS)
Jack Moffitt's avatar
Jack Moffitt committed
185

186
187
188
AC_OUTPUT(
  Makefile
  conf/Makefile 
189
  doc/Makefile 
190
191
192
  src/Makefile 
   src/log/Makefile 
   src/timing/Makefile
193
   src/thread/Makefile
194
   src/avl/Makefile
195
)
196
197
198
199
200
201
202
203
204

echo "

                Build with alsa:           $have_alsa
                Build with OSS:            $have_oss
                Build with Sun audio:      $have_sun_audio
                Build with RoarAudio:      $have_roaraudio

"