-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfigure.ac
336 lines (305 loc) · 9.57 KB
/
configure.ac
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
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
dnl Process this file with autoconf to produce a configure script.
AC_PREREQ(2.53)
AC_INIT([normalize],[0.7.7])
AC_CONFIG_SRCDIR(src/normalize.c)
AC_CONFIG_AUX_DIR(config)
AC_CONFIG_FILES(config/Makefile)
AM_INIT_AUTOMAKE
AM_CONFIG_HEADER(config.h)
AC_CANONICAL_HOST
AC_PROG_CC
AC_ISC_POSIX
AC_PROG_INSTALL
AC_PROG_LN_S
AC_DOSFILE
dnl Checks for headers
AC_HEADER_STDC([])
AC_CHECK_HEADERS([string.h math.h ctype.h fcntl.h unistd.h byteswap.h sys/types.h sys/stat.h sys/mman.h locale.h stdint.h inttypes.h errno.h])
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_INLINE
AC_TYPE_OFF_T
AC_TYPE_SIZE_T
if test "$cross_compiling" = "yes"; then
dnl Try to guess the endianness from the host cpu type
case "$host_cpu" in
i?86 | alpha ) ENDIAN=little;;
*) ENDIAN=big; AC_DEFINE(WORDS_BIGENDIAN);;
esac
AC_MSG_WARN([I'm guessing that the target machine is ]$ENDIAN[-endian])
else
AC_C_BIGENDIAN
fi
dnl Checks for libraries
AC_CHECK_LIB(m, sqrt, , AC_MSG_ERROR([You don't seem to have a math library!]))
AC_CHECK_FUNCS(strerror strtod strchr memcpy ftruncate)
dnl Word sizes...
if test x"$cross_compiling" = xyes -a x"$ac_cv_sizeof_long" = x; then
# if cross-compiling, with no cached values, just assume something common.
ac_cv_sizeof_char=1
ac_cv_sizeof_short=2
ac_cv_sizeof_int=4
ac_cv_sizeof_long=4
AC_MSG_WARN([Cross-compiling, so cannot check type sizes; assuming short=2, int=4, long=4])
fi
AC_CHECK_SIZEOF(char)
AC_CHECK_SIZEOF(short)
AC_CHECK_SIZEOF(int)
AC_CHECK_SIZEOF(long)
SIZEOF_CHAR=$ac_cv_sizeof_char
SIZEOF_SHORT=$ac_cv_sizeof_short
SIZEOF_INT=$ac_cv_sizeof_int
SIZEOF_LONG=$ac_cv_sizeof_long
AH_TEMPLATE([__TYPE8__], [Define to the 8-bit integer type on your system.])
AH_TEMPLATE([__TYPE16__], [Define to the 16-bit integer type on your system.])
AH_TEMPLATE([__TYPE32__], [Define to the 32-bit integer type on your system.])
AC_MSG_CHECKING([for an 8-bit type])
if test $SIZEOF_CHAR -eq 1; then
AC_DEFINE(__TYPE8__, char)
TYPE8=char
elif test $SIZEOF_SHORT -eq 1; then
AC_DEFINE(__TYPE8__, short)
TYPE8=short
elif test $SIZEOF_INT -eq 1; then
AC_DEFINE(__TYPE8__, int)
TYPE8=int
elif test $SIZEOF_LONG -eq 1; then
AC_DEFINE(__TYPE8__, long)
TYPE8=long
else
AC_MSG_RESULT([not found])
AC_MSG_ERROR([I can't seem to find an 8-bit integer type!])
fi
AC_MSG_RESULT($TYPE8)
AC_MSG_CHECKING([for a 16-bit type])
if test $SIZEOF_CHAR -eq 2; then
AC_DEFINE(__TYPE16__, char)
TYPE16=char
elif test $SIZEOF_SHORT -eq 2; then
AC_DEFINE(__TYPE16__, short)
TYPE16=short
elif test $SIZEOF_INT -eq 2; then
AC_DEFINE(__TYPE16__, int)
TYPE16=int
elif test $SIZEOF_LONG -eq 2; then
AC_DEFINE(__TYPE16__, long)
TYPE16=long
else
AC_MSG_RESULT([not found])
AC_MSG_ERROR([I can't seem to find a 16-bit integer type!])
fi
AC_MSG_RESULT($TYPE16)
AC_MSG_CHECKING([for a 32-bit type])
if test $SIZEOF_CHAR -eq 4; then
AC_DEFINE(__TYPE32__, char)
TYPE32=char
elif test $SIZEOF_SHORT -eq 4; then
AC_DEFINE(__TYPE32__, short)
TYPE32=short
elif test $SIZEOF_INT -eq 4; then
AC_DEFINE(__TYPE32__, int)
TYPE32=int
elif test $SIZEOF_LONG -eq 4; then
AC_DEFINE(__TYPE32__, long)
TYPE32=long
else
AC_MSG_RESULT([not found])
AC_MSG_ERROR([I can't seem to find a 32-bit integer type!])
fi
AC_MSG_RESULT($TYPE32)
dnl Solaris puts int8_t, etc in inttypes.h for some reason,
dnl and cygwin puts it in sys/types.h
AC_CHECK_TYPES([int8_t, int16_t, int32_t, uint8_t, uint16_t, uint32_t],,,
[#if HAVE_STDINT_H
# include <stdint.h>
#endif
#if HAVE_INTTYPES_H
# include <inttypes.h>
#endif
#if HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif]
)
AH_BOTTOM(
[#if !HAVE_INT8_T
typedef signed __TYPE8__ int8_t;
#endif
#if !HAVE_INT16_T
typedef signed __TYPE16__ int16_t;
#endif
#if !HAVE_INT32_T
typedef signed __TYPE32__ int32_t;
#endif
#if !HAVE_UINT8_T
typedef unsigned __TYPE8__ uint8_t;
#endif
#if !HAVE_UINT16_T
typedef unsigned __TYPE16__ uint16_t;
#endif
#if !HAVE_UINT32_T
typedef unsigned __TYPE32__ uint32_t;
#endif])
AC_CACHE_SAVE
dnl *** Helper programs used by the normalize-mp3 script ***
AC_ARG_ENABLE(helper-search,
AC_HELP_STRING([--disable-helper-search],
[do not look for helper programs]),
[ case "$enableval" in
yes) do_helper_search=true ;;
no) do_helper_search=false ;;
*) AC_MSG_ERROR(bad value $withval for --enable-helper-search) ;;
esac ],
do_helper_search=true)
AC_PATH_PROG(PERL, perl, /usr/bin/perl)
if test x$do_helper_search = xtrue; then
AC_CHECK_PROGS(MP3DECODE, madplay mpg123, [])
AC_CHECK_PROGS(MP3ENCODE, lame notlame bladeenc, [])
dnl AC_CHECK_PROGS(MP3INFO, mp3info id3cp, [])
AC_CHECK_PROGS(OGGDECODE, oggdec ogg123, [])
AC_CHECK_PROGS(OGGENCODE, oggenc, [])
AC_CHECK_PROGS(VORBISCOMMENT, vorbiscomment, [])
AC_CHECK_PROGS(FLACDECODE, flac, [])
AC_CHECK_PROGS(FLACENCODE, flac, [])
AC_CHECK_PROGS(METAFLAC, metaflac, [])
if test x$MP3DECODE = xmpg123; then
MP3DECODE="$MP3DECODE -q -w %w %m"
else
MP3DECODE="$MP3DECODE -q -o %w %m"
fi
if test x$MP3ENCODE = xlame -o x$MP3ENCODE = xnotlame; then
MP3ENCODE="$MP3ENCODE --quiet -h -b %b %w %m"
else
MP3ENCODE="$MP3ENCODE -quiet %w %m"
fi
if test x$OGGDECODE = xoggdec; then
OGGDECODE="$OGGDECODE -Q -o %w %m"
else
OGGDECODE="$OGGDECODE -q -d wav -f %w %m"
fi
if test x$OGGENCODE != x; then
OGGENCODE="$OGGENCODE -Q -b %b -o %m %w"
fi
if test x$FLACDECODE != x; then
FLACDECODE="$FLACDECODE -s -d -o %w %m"
fi
if test x$FLACENCODE != x; then
FLACENCODE="$FLACENCODE -s -o %m %w"
fi
fi
dnl *** lookup table enable/disable ***
AH_TEMPLATE([USE_LOOKUPTABLE],
[Define if you want to use lookup tables
(faster, but uses memory).])
AC_ARG_ENABLE(lookup-table,
AC_HELP_STRING([--disable-lookup-table],
[do not use lookup tables (saves memory, but slow)]),
[ case "$enableval" in
yes) AC_DEFINE(USE_LOOKUPTABLE) ;;
no) ;;
*) AC_MSG_ERROR(bad value $withval for --with-lookuptable) ;;
esac ],
AC_DEFINE(USE_LOOKUPTABLE))
dnl *** Stuff for xmms plugin ***
have_xmms=true
AM_PATH_GLIB(1.2.2, , [ have_xmms=false ])
AM_PATH_GTK(1.2.2, , [ have_xmms=false ], gthread)
AM_PATH_XMMS(1.0.0, , [ have_xmms=false ])
AM_DISABLE_STATIC
AM_PROG_LIBTOOL
AC_ARG_ENABLE(xmms,
AC_HELP_STRING([--enable-xmms],
[build the volume adjust plugin for xmms (default yes)]),
[ case "$enableval" in
yes) enable_xmms=true ;;
no) enable_xmms=false ;;
*) AC_MSG_ERROR(bad value $enableval for --enable-xmms) ;;
esac ])
use_xmms=false
if test x$enable_xmms != xfalse; then
if test x$have_xmms = xtrue; then
use_xmms=true
PLUGINS="xmms-rva $PLUGINS"
elif test x$enable_xmms = xtrue; then
AC_MSG_ERROR([--enable-xmms specified, but xmms not found])
fi
fi
AC_SUBST(PLUGINS)
dnl *** Stuff for audiofile library ***
dnl v0.2.1 and before have bugs with 24-bit LE files
AM_PATH_AUDIOFILE([ 0.2.2 ], [ have_audiofile=true ])
dnl AC_CHECK_LIB(audiofile, afSetVirtualSampleFormat, have_audiofile=true)
AH_TEMPLATE([USE_AUDIOFILE],
[Define if you want to use the audiofile library.])
AC_ARG_WITH(audiofile,
AC_HELP_STRING([--with-audiofile],
[use the audiofile library (default yes)]),
[ case "$withval" in
no) with_audiofile=false ;;
*) with_audiofile=true ;;
esac ])
use_audiofile=false
if test x$with_audiofile != xfalse; then
if test x$have_audiofile = xtrue; then
AC_DEFINE(USE_AUDIOFILE)
use_audiofile=true
dnl AUDIOFILELIBS="-laudiofile"
elif test x$with_audiofile = xtrue; then
AC_MSG_ERROR([--with-audiofile specified, but audiofile library not found])
fi
fi
dnl AC_SUBST(AUDIOFILELIBS)
test x$use_audiofile = xfalse && AUDIOFILE_LIBS=
test x$use_audiofile = xfalse && AUDIOFILE_CFLAGS=
AM_CONDITIONAL(AUDIOFILE, test x$use_audiofile = xtrue)
dnl *** Stuff for mad mpeg audio decoder library ***
AH_TEMPLATE([USE_MAD],
[Define if you want to use the mad mpeg audio decoder library.])
AC_ARG_WITH(mad-prefix,
AC_HELP_STRING([--with-mad-prefix=PFX],
[prefix where MAD library is installed]),
[ CPPFLAGS="$CPPFLAGS -I$withval/include"
LDFLAGS="$LDFLAGS -L$withval/lib"
with_mad=true ])
AC_ARG_WITH(mad,
AC_HELP_STRING([--with-mad],
[use the mad mpeg audio library (default yes)]),
[ case "$withval" in
no) with_mad=false ;;
*) with_mad=true ;;
esac ])
AC_CHECK_LIB(mad, mad_decoder_init, have_mad=true)
use_mad=false
if test x$with_mad != xfalse; then
if test x$have_mad = xtrue; then
AC_DEFINE(USE_MAD)
use_mad=true
MADLIBS="-lmad"
elif test x$with_mad = xtrue; then
AC_MSG_ERROR([--with-mad specified, but mad library not found])
fi
fi
AC_SUBST(MADLIBS)
AM_CONDITIONAL(MAD, test x$use_mad = xtrue)
dnl *** make the name "normalize-audio" like the debian folks like it ***
AC_ARG_ENABLE(longer-name,
AC_HELP_STRING([--enable-longer-name],
[name the binary "normalize-audio" instead of "normalize"]),
[ case "$enableval" in
yes) NORMALIZE_BIN=normalize-audio ;;
no) NORMALIZE_BIN=normalize ;;
*) AC_MSG_ERROR(bad value $withval for --enable-longer-name) ;;
esac ],
NORMALIZE_BIN=normalize)
AC_SUBST(NORMALIZE_BIN)
AM_GNU_GETTEXT([external])
AC_CONFIG_FILES(src/normalize-mp3, [chmod +x src/normalize-mp3])
dnl AC_CONFIG_FILES(packaging/normalize.spec packaging/normalize.list)
AC_CONFIG_FILES(Makefile doc/Makefile doc/fr/Makefile po/Makefile.in
src/Makefile nid3lib/Makefile xmms-rva/Makefile test/Makefile)
AC_OUTPUT
echo
echo "Configuration:"
echo " audiofile library: $use_audiofile"
echo " mpeg audio support: $use_mad"
echo " xmms volume adjust plugin: $use_xmms"
echo