forked from xiph/Icecast-IceS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.in
218 lines (177 loc) · 6.08 KB
/
configure.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
dnl Process this file with autoconf to produce a configure script.
dnl
dnl Options refactored to allow all audio input modules to be enabled/disabled
dnl by Thomas B. "dm8tbr" Ruecker <[email protected]>
dnl
AC_INIT([IceS], [2.0.2], [[email protected]])
AC_PREREQ(2.54)
AC_CONFIG_SRCDIR(src/ices.c)
AM_INIT_AUTOMAKE
AM_CONFIG_HEADER(config.h)
AM_MAINTAINER_MODE
AC_PROG_CC
AM_PROG_LIBTOOL
dnl Set some options based on environment
dnl BSD headers break when _XOPEN_SOURCE is defined but without it seems
dnl to be fine
if test -n "$GCC"; then
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
fi
dnl Checks for programs.
dnl Checks for libraries.
dnl Checks for header files.
AC_HEADER_STDC
AC_HEADER_TIME
AC_CHECK_HEADERS([stropts.h sys/timeb.h sys/select.h])
dnl ================================================================
dnl Check for OSS
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
AM_CONDITIONAL(HAVE_OSS,test "$have_oss" = yes)
dnl ================================================================
dnl Check for Sun audio
dnl ================================================================
AC_C_BIGENDIAN
AC_ARG_ENABLE(sun-audio,
AC_HELP_STRING([--disable-sun-audio],
[Sun audio input [default=autodetect]]),
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)
if test "$have_sun_audio" = yes; then
AC_DEFINE(HAVE_SUN_AUDIO,,[Define to enable sun audio input module])
fi
else
have_sun_audio=no
fi
AM_CONDITIONAL(HAVE_SUN_AUDIO,test "$have_sun_audio" = yes)
dnl ================================================================
dnl Check for ALSA audio
dnl ================================================================
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)
if test "$have_alsa" = yes; then
ALSA_LIBS="-lasound"
AC_DEFINE(HAVE_ALSA, ,[Define to enable ALSA input module])
fi
else
have_alsa=no
fi
AM_CONDITIONAL(HAVE_ALSA,test "$have_alsa" = yes)
dnl ================================================================
dnl Check for RoarAudio
dnl ================================================================
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)
echo -n "checking for libroar... "
if roar-config --compare-versions current ge 0.4.0
then
have_roaraudio=yes
else
have_roaraudio=no
fi
if test "$have_roaraudio" = yes; then
ROARAUDIO_LIBS="`roar-config --libs`"
ROARAUDIO_CFLAGS="`roar-config --cflags`"
XIPH_VAR_APPEND([XIPH_CFLAGS], [$ROARAUDIO_CFLAGS])
AC_DEFINE(HAVE_ROARAUDIO, ,[Define to enable RoarAudio input module])
echo "ok"
else
echo "failed"
fi
else
have_roaraudio=no
fi
AM_CONDITIONAL(HAVE_ROARAUDIO,test "$have_roaraudio" = yes)
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
dnl Check for types
AC_CHECK_TYPES([uint64_t],,AC_ERROR([could not find a uint64_t type]))
dnl Checks for library functions.
AC_CHECK_FUNCS([gettimeofday ftime])
XIPH_PATH_XML
XIPH_VAR_APPEND([XIPH_CFLAGS], [$XML_CFLAGS])
XIPH_VAR_PREPEND([XIPH_LIBS], [$XML_LIBS])
XIPH_PATH_SHOUT(, AC_MSG_ERROR([must have libshout installed!]))
if test "$SHOUT_THREADSAFE" != "yes"
then
AC_MSG_ERROR([This libshout isn't threadsafe])
fi
XIPH_VAR_APPEND([XIPH_CPPFLAGS], [$SHOUT_CPPFLAGS])
XIPH_VAR_APPEND([XIPH_CFLAGS], [$SHOUT_CFLAGS])
XIPH_VAR_PREPEND([XIPH_LIBS], [$SHOUT_LIBS])
XIPH_PATH_VORBIS(, AC_MSG_ERROR([must have Ogg Vorbis v1.0 or above installed!]))
XIPH_VAR_APPEND([XIPH_CPPFLAGS], [$VORBIS_CFLAGS $VORBISENC_CFLAGS])
XIPH_VAR_PREPEND([XIPH_LIBS], [$VORBISENC_LIBS $VORBIS_LIBS])
dnl Make substitutions
AC_SUBST(ALSA_LIBS)
AC_SUBST(ROARAUDIO_LIBS)
AC_SUBST(ROARAUDIO_CFLAGS)
AC_SUBST(XML_LIBS)
AC_SUBST(XML_CFLAGS)
AC_SUBST(LIBTOOL_DEPS)
AC_SUBST(DEBUG)
AC_SUBST(PROFILE)
AC_SUBST(XIPH_CFLAGS)
AC_SUBST(XIPH_CPPFLAGS)
AC_SUBST(XIPH_LIBS)
AC_OUTPUT(
Makefile
conf/Makefile
doc/Makefile
src/Makefile
src/common/log/Makefile
src/common/timing/Makefile
src/common/thread/Makefile
src/common/avl/Makefile
)
echo "
Build with alsa: $have_alsa
Build with OSS: $have_oss
Build with Sun audio: $have_sun_audio
Build with RoarAudio: $have_roaraudio
"