-
Notifications
You must be signed in to change notification settings - Fork 3
/
configure.ac
335 lines (290 loc) · 8.86 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
AC_PREREQ(2.59)
AC_INIT(src/control.c)
AM_INIT_AUTOMAKE(salsa-lib, 0.1.7)
AC_PREFIX_DEFAULT(/usr)
dnl AC_CONFIG_HEADERS(src/config.h)
AC_PROG_CC
AC_PROG_INSTALL
dnl AC_DISABLE_STATIC
AM_PROG_LIBTOOL
AC_HEADER_STDC
dnl Compatible version
AC_ARG_WITH(compat-version,
AS_HELP_STRING([--with-compat-version=VERSION],
[specify the compatible version with ALSA-lib (default=1.2.5)]),
compatver="$withval", compatver="1.2.5")
SND_LIB_VERSION="$compatver"
SND_LIB_MAJOR=1
SND_LIB_MINOR=2
SND_LIB_SUBMINOR=5
SND_LIB_EXTRAVER=1000000
case "$compatver" in
*.*.*)
SND_LIB_MAJOR=`echo $SND_LIB_VERSION | cut -d . -f 1`
SND_LIB_MINOR=`echo $SND_LIB_VERSION | cut -d . -f 2`
SND_LIB_SUBMINOR=`echo $SND_LIB_VERSION | cut -d . -f 3`
;;
esac
AC_SUBST(SND_LIB_VERSION)
AC_SUBST(SND_LIB_MAJOR)
AC_SUBST(SND_LIB_MINOR)
AC_SUBST(SND_LIB_SUBMINOR)
AC_SUBST(SND_LIB_EXTRAVER)
dnl Non-standard device files directory
AC_MSG_CHECKING([for ALSA device file directory])
AC_ARG_WITH(alsa-devdir,
AS_HELP_STRING([--with-alsa-devdir=dir],
[directory with ALSA device files (default /dev/snd)]),
[alsa_dev_dir="$withval"],
[alsa_dev_dir="/dev/snd"])
DEVPATH="$alsa_dev_dir"
AC_SUBST(DEVPATH)
AC_MSG_RESULT([$alsa_dev_dir])
dnl Component selections
AC_ARG_ENABLE(pcm,
AS_HELP_STRING([--disable-pcm],
[disable PCM interface]),
pcm="$enableval", pcm="yes")
AC_ARG_ENABLE(mixer,
AS_HELP_STRING([--disable-mixer],
[disable mixer interface]),
mixer="$enableval", mixer="yes")
AC_ARG_ENABLE(rawmidi,
AS_HELP_STRING([--enable-rawmidi],
[enable rawmidi interface]),
rawmidi="$enableval", rawmidi="no")
AC_ARG_ENABLE(hwdep,
AS_HELP_STRING([--enable-hwdep],
[enable hwdep interface]),
hwdep="$enableval", hwdep="no")
AC_ARG_ENABLE(timer,
AS_HELP_STRING([--enable-timer],
[enable timer interface]),
timer="$enableval", timer="no")
AC_ARG_ENABLE(conf,
AS_HELP_STRING([--enable-conf],
[enable dummy conf functions]),
sndconf="$enableval", sndconf="no")
AC_ARG_ENABLE(seq,
AS_HELP_STRING([--enable-seq],
[enable seq functions]),
sndseq="$enableval", sndseq="no")
AC_ARG_ENABLE(tlv,
AS_HELP_STRING([--enable-tlv],
[enable TLV (dB) support]),
tlv="$enableval", tlv="no")
AC_ARG_ENABLE(user-elem,
AS_HELP_STRING([--disable-user-elem],
[disable user-space control element support]),
user_elem="$enableval", user_elem="yes")
AC_ARG_ENABLE(async,
AS_HELP_STRING([--enable-async],
[enable async handler support]),
async="$enableval", async="no")
AC_ARG_ENABLE(chmap,
AS_HELP_STRING([--enable-chmap],
[enable chmap API support]),
chmap="$enableval", chmap="no")
AC_ARG_ENABLE(abi-compat,
AS_HELP_STRING([--enable-abi-compat],
[build ABI-compatible library with alsa-lib]),
abi_compat="$enableval", abi_compat="no")
AC_ARG_ENABLE(deprecated,
AS_HELP_STRING([--disable-deprecated],
[don't mark deprecated attribute for non-working functions]),
markdeprecated="$enableval", markdeprecated="yes")
AC_ARG_ENABLE(output-buffer,
AS_HELP_STRING([--enable-output-buffer],
[support the string output via snd_output_*() functions]),
output_buffer="$enableval", output_buffer="no")
AC_ARG_ENABLE(delight-valgrind,
AS_HELP_STRING([--disable-delight-valgrind],
[do not initialize unnecessary fields for ioctls]),
delight_valgrind="$enableval", delight_valgrind="yes")
AC_ARG_ENABLE(symbolic-functions,
AS_HELP_STRING([--disable-symbolic-functions],
[use -Bsymbolic-functions option if available (optmization for size and speed)]),
symfuncs="$enableval", symfuncs="yes")
AC_ARG_ENABLE(float,
AS_HELP_STRING([--enable-float],
[support floatin-point unit]),
support_float="$enableval", support_float="no")
AC_ARG_ENABLE(4bit,
AS_HELP_STRING([--disable-4bit],
[drop the support for 4bit PCM (IMA ADPCM)]),
support_4bit="$enableval", support_4bit="yes")
AC_ARG_ENABLE(abicheck,
AS_HELP_STRING([--enable-abicheck],
[enable library ABI check]),
abicheck="$enableval", abicheck="no")
AC_ARG_ENABLE(ctlasciiparser,
AS_HELP_STRING([--enable-ctlasciiparser],
[enable ctl ASCII parser (for amixer)]),
ctlasciiparser="$enableval", ctlasciiparser="no")
AC_ARG_ENABLE(time64,
AS_HELP_STRING([--enable-time64],
[enforce 64bit timespec for ioctls]),
struct_time64="$enableval", struct_time64="no")
AC_ARG_ENABLE(everything,
AS_HELP_STRING([--enable-everything],
[enable everything :)]),
everything="$enableval", everything="no")
if test "$everything" = "yes"; then
pcm="yes"
mixer="yes"
rawmidi="yes"
hwdep="yes"
timer="yes"
sndconf="yes"
sndseq="yes"
tlv="yes"
user_elem="yes"
async="yes"
chmap="yes"
abi_compat="yes"
symfuncs="yes"
output_buffer="yes"
support_float="yes"
support_4bit="yes"
abicheck="yes"
ctlasciiparser="yes"
struct_time64="yes"
fi
SALSA_DEPLIBS=""
AM_CONDITIONAL(BUILD_PCM, test "$pcm" = "yes")
AM_CONDITIONAL(BUILD_MIXER, test "$mixer" = "yes")
AM_CONDITIONAL(BUILD_RAWMIDI, test "$rawmidi" = "yes")
AM_CONDITIONAL(BUILD_HWDEP, test "$hwdep" = "yes")
AM_CONDITIONAL(BUILD_TIMER, test "$timer" = "yes")
AM_CONDITIONAL(BUILD_CONF, test "$sndconf" = "yes")
AM_CONDITIONAL(BUILD_SEQ, test "$sndseq" = "yes")
AM_CONDITIONAL(BUILD_ASYNC, test "$async" = "yes")
if test "$tlv" = "yes"; then
SALSA_HAS_TLV_SUPPORT=1
else
SALSA_HAS_TLV_SUPPORT=0
fi
AC_SUBST(SALSA_HAS_TLV_SUPPORT)
if test "$user_elem" = "yes"; then
SALSA_HAS_USER_ELEM_SUPPORT=1
else
SALSA_HAS_USER_ELEM_SUPPORT=0
fi
AC_SUBST(SALSA_HAS_USER_ELEM_SUPPORT)
if test "$async" = "yes"; then
SALSA_HAS_ASYNC_SUPPORT=1
else
SALSA_HAS_ASYNC_SUPPORT=0
fi
AC_SUBST(SALSA_HAS_ASYNC_SUPPORT)
if test "$chmap" = "yes"; then
SALSA_HAS_CHMAP_SUPPORT=1
else
SALSA_HAS_CHMAP_SUPPORT=0
fi
AC_SUBST(SALSA_HAS_CHMAP_SUPPORT)
if test "$sndconf" = "yes"; then
SALSA_HAS_DUMMY_CONF=1
else
SALSA_HAS_DUMMY_CONF=0
fi
AC_SUBST(SALSA_HAS_DUMMY_CONF)
AM_CONDITIONAL(COMPAT_ABI, test "$abi_compat" = "yes")
if test "$markdeprecated" = "yes"; then
SALSA_MARK_DEPRECATED=1
else
SALSA_MARK_DEPRECATED=0
fi
AC_SUBST(SALSA_MARK_DEPRECATED)
if test "$output_buffer" = "yes"; then
SALSA_SUPPORT_OUTPUT_BUFFER=1
else
SALSA_SUPPORT_OUTPUT_BUFFER=0
fi
AC_SUBST(SALSA_SUPPORT_OUTPUT_BUFFER)
if test "$support_float" = "yes"; then
SALSA_SUPPORT_FLOAT=1
SALSA_DEPLIBS="$SALSA_DEPLIBS -lm"
else
SALSA_SUPPORT_FLOAT=0
fi
AC_SUBST(SALSA_SUPPORT_FLOAT)
if test "$support_4bit" = "yes"; then
SALSA_SUPPORT_4BIT_PCM=1
else
SALSA_SUPPORT_4BIT_PCM=0
fi
AC_SUBST(SALSA_SUPPORT_4BIT_PCM)
if test "$abicheck" = "yes"; then
SALSA_CHECK_ABI=1
else
SALSA_CHECK_ABI=0
fi
AC_SUBST(SALSA_CHECK_ABI)
if test "$ctlasciiparser" = "yes"; then
SALSA_CTL_ASCII_PARSER=1
else
SALSA_CTL_ASCII_PARSER=0
fi
AC_SUBST(SALSA_CTL_ASCII_PARSER)
if test "$struct_time64" = "yes"; then
SALSA_STRUCT_TIME64=1
else
SALSA_STRUCT_TIME64=0
fi
AC_SUBST(SALSA_STRUCT_TIME64)
if test "$delight_valgrind" = "yes"; then
AC_DEFINE(DELIGHT_VALGRIND)
fi
AC_MSG_CHECKING(for symbolic-functions)
if test "$symfuncs" = "yes"; then
if ld --help | grep -q -- '-Bsymbolic-functions'; then
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(not supported by ld)
symfuncs="no"
fi
else
AC_MSG_RESULT(no)
fi
AM_CONDITIONAL(SYMBOLIC_FUNCTIONS, test x"$symfuncs" = xyes)
AC_SUBST(SALSA_DEPLIBS)
dnl OK, let's output...
AC_OUTPUT([
Makefile
alsa.pc
src/Makefile
src/recipe.h
src/version.h
])
echo "Creating asoundlib.h..."
cp "$srcdir"/src/asoundlib-head.h src/asoundlib.h
test "$pcm" = "yes" && echo "#include \"pcm.h\"" >> src/asoundlib.h
test "$mixer" = "yes" && echo "#include \"mixer.h\"" >> src/asoundlib.h
test "$rawmidi" = "yes" && echo "#include \"rawmidi.h\"" >> src/asoundlib.h
test "$hwdep" = "yes" && echo "#include \"hwdep.h\"" >> src/asoundlib.h
test "$timer" = "yes" && echo "#include \"timer.h\"" >> src/asoundlib.h
test "$sndconf" = "yes" && echo "#include \"conf.h\"" >> src/asoundlib.h
test "$sndseq" = "yes" && echo "#include \"seq_event.h\"" >> src/asoundlib.h
test "$sndseq" = "yes" && echo "#include \"seq.h\"" >> src/asoundlib.h
test "$sndseq" = "yes" && echo "#include \"seqmid.h\"" >> src/asoundlib.h
cat "$srcdir"/src/asoundlib-tail.h >> src/asoundlib.h
echo "SALSA-Lib build configuration:"
echo " - PCM interface: $pcm"
echo " - Mixer interface: $mixer"
echo " - Raw MIDI interface: $rawmidi"
echo " - HW-dependent interface: $hwdep"
echo " - Timer interface: $timer"
echo " - ALSA-config dummy interface: $sndconf"
echo " - ALSA-sequencer dummy interface: $sndseq"
echo " - TLV (dB) support: $tlv"
echo " - User-space control element support: $user_elem"
echo " - Async handler support: $async"
echo " - PCM chmap API support: $chmap"
echo " - Make ABI-compatible libasound.so: $abi_compat"
echo " - Mark deprecated attribute: $markdeprecated"
echo " - Support string-output via snd_output: $output_buffer"
echo " - Support floating-point: $support_float"
echo " - Enable library ABI check: $abicheck"
echo " - Support ctl ASCII parser: $ctlasciiparser"
echo " - Enforce 64bit timespec: $struct_time64"