configure.ac 5.17 KB
Newer Older
1
AC_INIT([Icecast], [2.4.99.2], [icecast@xiph.org])
2

3
AC_PREREQ([2.54])
Marvin Scholz's avatar
Marvin Scholz committed
4

5
AC_CONFIG_SRCDIR([src/main.c])
6
AC_CONFIG_MACRO_DIR([m4])
Marvin Scholz's avatar
Marvin Scholz committed
7
AC_CONFIG_AUX_DIR([build-aux])
Jack Moffitt's avatar
Jack Moffitt committed
8
9

AC_PROG_CC
Marvin Scholz's avatar
Marvin Scholz committed
10
11
12
13
14
15
AC_PROG_CC_C99

AS_IF([test "${ac_cv_prog_cc_c99}" = "no"], [
  AC_MSG_ERROR([No C99 compiler found!])
])

Karl Heyes's avatar
Karl Heyes committed
16
AC_SYS_LARGEFILE
Jack Moffitt's avatar
Jack Moffitt committed
17

Marvin Scholz's avatar
Marvin Scholz committed
18
19
20
dnl Set build/host to default values
AC_CANONICAL_HOST
AC_CANONICAL_BUILD
Jack Moffitt's avatar
Jack Moffitt committed
21

Marvin Scholz's avatar
Marvin Scholz committed
22
AC_CONFIG_HEADERS([config.h])
Jack Moffitt's avatar
Jack Moffitt committed
23
24


25
AM_INIT_AUTOMAKE([tar-ustar foreign dist-zip])
Marvin Scholz's avatar
Marvin Scholz committed
26
27
28
29
30

AM_SILENT_RULES([yes])
AM_MAINTAINER_MODE([enable])

LT_INIT
Jack Moffitt's avatar
Jack Moffitt committed
31
32

dnl Checks for header files.
33
AC_HEADER_ASSERT
Jack Moffitt's avatar
Jack Moffitt committed
34
AC_HEADER_STDC
35
AC_HEADER_TIME
Jack Moffitt's avatar
Jack Moffitt committed
36

Marvin Scholz's avatar
Marvin Scholz committed
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
AC_CHECK_HEADERS([stdint.h inttypes.h], [
  ice_found_int_headers="yes";
  break;
])

AS_IF([test "$ice_found_int_headers" != "yes"], [
  AC_MSG_ERROR([Unable to find the standard integers headers])
])

AC_CHECK_HEADERS([sys/types.h])
AC_CHECK_HEADERS([sys/timeb.h])
AC_CHECK_HEADERS([sys/socket.h])
AC_CHECK_HEADERS([pwd.h grp.h])

XIPH_NET

dnl Check for functions
AC_FUNC_FORK
AC_FUNC_CHOWN

57
58
AC_CHECK_FUNCS([setuid])
AC_CHECK_FUNCS([chroot])
59
AC_CHECK_FUNCS([strcasestr])
60
61
AC_CHECK_FUNCS([gethostname])
AC_CHECK_FUNCS([uname])
62
AC_CHECK_FUNCS([setenv])
63
64
AC_CHECK_FUNCS([setresuid])
AC_CHECK_FUNCS([setresgid])
Marvin Scholz's avatar
Marvin Scholz committed
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
AC_CHECK_FUNCS([localtime_r])
AC_CHECK_FUNCS([poll])
AC_CHECK_FUNCS([gettimeofday])
AC_CHECK_FUNCS([ftime])

AC_SEARCH_LIBS([nanosleep], [rt posix4], [
  AC_DEFINE([HAVE_NANOSLEEP], [1], [Define if you have nanosleep])
])

dnl Checks for types and typedefs
AC_TYPE_OFF_T
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_TYPE_SSIZE_T
AC_TYPE_UID_T

dnl Checks for required libraries

dnl
dnl libxml2
dnl
PKG_CHECK_MODULES([LIBXML2], [libxml-2.0], [], [
  AC_MSG_ERROR([${LIBXML2_PKG_ERRORS}. libxml2 is required.])
])

CFLAGS="${CFLAGS} ${LIBXML2_CFLAGS}"
LIBS="${LIBS} ${LIBXML2_LIBS}"


dnl
dnl libxslt
dnl
PKG_CHECK_MODULES([LIBXSLT], [libxslt], [], [
  AC_MSG_ERROR([${LIBXSLT_PKG_ERRORS}. libxslt is required.])
])

CFLAGS="${CFLAGS} ${LIBXSLT_CFLAGS}"
LIBS="${LIBS} ${LIBXSLT_LIBS}"


dnl
dnl libvorbis
dnl
PKG_CHECK_MODULES([VORBIS], [vorbis >= 1.0], [], [
  AC_MSG_ERROR([${VORBIS_PKG_ERRORS}. Must have libvorbis v1.0 or above installed.])
])

CFLAGS="${CFLAGS} ${VORBIS_CFLAGS}"
LIBS="${LIBS} ${VORBIS_LIBS}"


dnl Checks for optional libraries

dnl
dnl libogg
dnl
PKG_HAVE_WITH_MODULES([OGG], [ogg], [
  CFLAGS="${CFLAGS} ${OGG_CFLAGS}"
  LIBS="${LIBS} ${OGG_LIBS}"
])

dnl
dnl libtheora
dnl
PKG_HAVE_WITH_MODULES([THEORA], [theora], [
  CFLAGS="${CFLAGS} ${THEORA_CFLAGS}"
  LIBS="${LIBS} ${THEORA_LIBS}"
])

dnl
dnl libspeex
dnl
PKG_HAVE_WITH_MODULES([SPEEX], [speex], [
  CFLAGS="${CFLAGS} ${SPEEX_CFLAGS}"
  LIBS="${LIBS} ${SPEEX_LIBS}"
])

dnl
dnl libkate
dnl
PKG_HAVE_WITH_MODULES([KATE], [kate], [
  CFLAGS="${CFLAGS} ${KATE_CFLAGS}"
  LIBS="${LIBS} ${KATE_LIBS}"
])

dnl
dnl libcurl
dnl
153
PKG_HAVE_WITH_MODULES([CURL], [libcurl], [
Marvin Scholz's avatar
Marvin Scholz committed
154
155
156
157
158
159
160
161
162
163
164
165
166
167
  CFLAGS="${CFLAGS} ${CURL_CFLAGS}"
  LIBS="${LIBS} ${CURL_LIBS}"
])

dnl
dnl openssl
dnl
PKG_HAVE_WITH_MODULES([OPENSSL], [openssl], [
  CFLAGS="${CFLAGS} ${OPENSSL_CFLAGS}"
  LIBS="${LIBS} ${OPENSSL_LIBS}"
])

dnl Check for library-specific functions
AC_CHECK_FUNCS([xsltSaveResultToString])
168

169
170
171
dnl we still use format_kate as it doesn't need libkate to work
#ICECAST_OPTIONAL="$ICECAST_OPTIONAL format_kate.o"

Marvin Scholz's avatar
Marvin Scholz committed
172
ACX_PTHREAD([], [AC_MSG_ERROR([POSIX threads missing])])
Jack Moffitt's avatar
Jack Moffitt committed
173

Marvin Scholz's avatar
Marvin Scholz committed
174
175
176
CFLAGS="${CFLAGS} ${PTHREAD_CFLAGS}"
CPPFLAGS="${CPPFLAGS} ${PTHREAD_CPPFLAGS}"
LIBS="${LIBS} ${PTHREAD_LIBS}"
Jack Moffitt's avatar
Jack Moffitt committed
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
dnl Feature enable/disable arguments

AC_ARG_ENABLE([yp],
  AS_HELP_STRING([--enable-yp],
    [enable yellowpage directory listing support (default: auto)])
)

AS_IF([test "x$enable_yp" != "xno"], [
  AS_IF([test "x$have_curl" != "xyes"], [
    AS_IF([test "x$enable_yp" == "xyes"], [
      AC_MSG_ERROR([cURL is required for YP support])
    ])
    enable_yp="no"
  ], [
    AC_DEFINE([USE_YP], 1, [Define to compile in YP support code])
    enable_yp="yes"
  ])
])

AC_ARG_ENABLE([client-tests],
  AS_HELP_STRING([--enable-client-tests],
    [enable client tests module (default: disabled)])
)

AS_IF([test "x$enable_client_tests" == "xyes"], [
  AC_DEFINE([ENABLE_MODULE_CLIENT_TESTS], 1, [Define to compile client test module])
], [enable_client_tests="no"])
Marvin Scholz's avatar
Marvin Scholz committed
205
206

dnl Make substitutions
207
208
209
AC_SUBST(XIPH_CPPFLAGS)
AC_SUBST(XIPH_CFLAGS)
AC_SUBST(XIPH_LIBS)
210
AC_SUBST(XIPH_LDFLAGS)
211
212
213
AC_SUBST(PTHREAD_CPPFLAGS)
AC_SUBST(PTHREAD_CFLAGS)
AC_SUBST(PTHREAD_LIBS)
Jack Moffitt's avatar
Jack Moffitt committed
214
215
216
AC_SUBST(LIBTOOL_DEPS)
AC_SUBST(LIBS)
AC_SUBST(CFLAGS)
217
AC_SUBST(ICECAST_OPTIONAL)
218
219
AC_SUBST(HAVE_KATE)
AC_SUBST(KATE_LIBS)
Jack Moffitt's avatar
Jack Moffitt committed
220

221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
AC_CONFIG_FILES([
  Makefile
  conf/Makefile
  src/Makefile
  src/common/avl/Makefile
  src/common/httpp/Makefile
  src/common/thread/Makefile
  src/common/log/Makefile
  src/common/net/Makefile
  src/common/timing/Makefile
  doc/Makefile
  web/Makefile
  web/assets/Makefile
  web/assets/css/Makefile
  web/assets/font/Makefile
  admin/Makefile
  admin/includes/Makefile
  win32/Makefile
  examples/Makefile
  tests/Makefile
])

AC_OUTPUT
244
245
246
247

echo "
Icecast configuration
---------------------
248
249
250
Version        : ${VERSION}
cURL           : ${have_curl}
TLS (openSSL)  : ${have_openssl}
251
252

Format/Codec support:
253
254
255
256
257
258
259
260
  Ogg          : ${have_ogg}
  Theora       : ${have_theora}
  Speex        : ${have_speex}
  Kate         : ${have_kate}

Features:
  YP support   : ${enable_yp}
  Client tests : ${enable_client_tests}"