-
Notifications
You must be signed in to change notification settings - Fork 2
/
configure.ac
659 lines (603 loc) · 16.3 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
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
AC_PREREQ(2.59)
AC_INIT(hda-emu.c)
AM_INIT_AUTOMAKE(hda-emu, 0.2.6)
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
AC_PROG_CC
AC_PROG_CPP
AC_PROG_INSTALL
AC_DISABLE_SHARED
AM_PROG_LIBTOOL
AC_HEADER_STDC
WFLAGS="-Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wno-format-security"
WFLAGS="$WFLAGS -fno-delete-null-pointer-checks"
WFLAGS="$WFLAGS -Wdeclaration-after-statement"
WFLAGS="$WFLAGS -Wno-pointer-sign"
WFLAGS="$WFLAGS -fwrapv"
WFLAGS="$WFLAGS -fno-asynchronous-unwind-tables"
OPTFLAGS="-O -g"
CFLAGS="$CFLAGS $OPTFLAGS $WFLAGS"
AC_ARG_ENABLE([readline],
AS_HELP_STRING([--enable-readline], [turn on readline support]),
readline="$enableval", readline="yes")
if test "$readline" = "yes"; then
AC_CHECK_LIB([readline], [main], [HAVE_LIBREADLINE="yes"])
if test "$HAVE_LIBREADLINE" = "yes"; then
LIBREADLINE="-lreadline -lncurses"
AC_DEFINE([HAVE_LIBREADLINE], [1], [Define if you have libreadline])
fi
fi
AC_SUBST(LIBREADLINE)
AC_ARG_ENABLE(old-workq,
AS_HELP_STRING([--enable-old-workq], [use old workqueue API]),
old_workq="$enableval", old_workq="no")
if test "$old_workq" = "yes"; then
AC_DEFINE(OLD_WORKQUEUE)
fi
AC_ARG_WITH(kerneldir,
AS_HELP_STRING([--with-kerneldir=dir],
[path where Linux kernel tree is stored]),
kerneldir="$withval", kerneldir="")
kerneldir="$( cd "$kerneldir" && pwd )"
test -n "$kerneldir" ||
AC_ERROR([No kernel directory is specified])
test -d "$kerneldir" || \
AC_ERROR([Invalid kernel directory: $kerneldir])
test -f "$kerneldir/sound/pci/hda/hda_codec.c" || \
AC_ERROR([Invalid kernel directory: $kerneldir])
rm -f dist
ln -s $kerneldir dist
rm -f hda
ln -s dist/sound/pci/hda hda
have_hda_core=
AC_MSG_CHECKING(for HDA core)
if test -f dist/sound/hda/hdac_bus.c; then
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_HDA_CORE)
have_hda_core=yes
fi
AM_CONDITIONAL(HAVE_HDA_CORE, test "$have_hda_core" = "yes")
AC_DEFUN([CHECK_CODEC], [
AC_MSG_CHECKING(for codec $1)
if test -f hda/patch_$1.c; then
AC_MSG_RESULT(yes)
AC_DEFINE($2)
codec_found=yes
else
AC_MSG_RESULT(no)
codec_found=
fi
AM_CONDITIONAL($2, test "$codec_found" = "yes")
])
CHECK_CODEC(analog, CONFIG_SND_HDA_CODEC_ANALOG)
CHECK_CODEC(atihdmi, CONFIG_SND_HDA_CODEC_ATIHDMI)
CHECK_CODEC(cmedia, CONFIG_SND_HDA_CODEC_CMEDIA)
CHECK_CODEC(conexant, CONFIG_SND_HDA_CODEC_CONEXANT)
CHECK_CODEC(intelhdmi, CONFIG_SND_HDA_CODEC_INTELHDMI)
CHECK_CODEC(nvhdmi, CONFIG_SND_HDA_CODEC_NVHDMI)
CHECK_CODEC(hdmi, CONFIG_SND_HDA_CODEC_HDMI)
CHECK_CODEC(realtek, CONFIG_SND_HDA_CODEC_REALTEK)
CHECK_CODEC(sigmatel, CONFIG_SND_HDA_CODEC_SIGMATEL)
CHECK_CODEC(si3054, CONFIG_SND_HDA_CODEC_SI3054)
CHECK_CODEC(via, CONFIG_SND_HDA_CODEC_VIA)
CHECK_CODEC(ca0110, CONFIG_SND_HDA_CODEC_CA0110)
CHECK_CODEC(ca0132, CONFIG_SND_HDA_CODEC_CA0132)
CHECK_CODEC(cirrus, CONFIG_SND_HDA_CODEC_CIRRUS)
AC_DEFUN([CHECK_HELPER], [
AC_MSG_CHECKING(for helper $1)
if test -f hda/$1; then
AC_MSG_RESULT(yes)
AC_DEFINE($2)
codec_found=yes
else
AC_MSG_RESULT(no)
codec_found=
fi
AM_CONDITIONAL($2, test "$codec_found" = "yes")
])
CHECK_HELPER([hda_auto_parser.c], [HAVE_HDA_AUTO_PARSER])
CHECK_HELPER([hda_jack.c], [HAVE_HDA_JACK])
CHECK_HELPER([hda_eld.c], [HAVE_HDA_ELD])
CHECK_HELPER([hda_beep.c], [HAVE_HDA_BEEP])
CHECK_HELPER([hda_bind.c], [HAVE_HDA_BIND])
AC_ARG_ENABLE(own-proc,
AS_HELP_STRING([--enable-own-proc],
[use own proc-file output function]),
own_proc="$enableval", own_proc="no")
AM_CONDITIONAL(USE_OWN_PROC, test "$own_proc" = "yes")
echo "Generating kernel/init_hooks.h..."
rm -f kernel/init_hooks.h
if test -f dist/sound/hda/hdac_bus.c; then
cat dist/sound/hda/*.c | grep '^subsys_initcall(' | \
sed -e's/^subsys_initcall(\(.*\))/void call_init_\1(void);/g' >> kernel/init_hooks.h
cat dist/sound/hda/*.c | grep '^module_init(' | \
sed -e's/^module_init(\(.*\))/void call_init_\1(void);/g' >> kernel/init_hooks.h
fi
cat hda/patch_*.c | grep '^module_init(' | \
sed -e's/^module_init(\(.*\))/void call_init_\1(void);/g' >> kernel/init_hooks.h
cat hda/*.c | grep '^module_hda_codec_driver(' | \
sed -e's/^module_hda_codec_driver(\(.*\))/void call_init_\1_init(void);/g' >> kernel/init_hooks.h
echo 'static void gather_codec_hooks(void) {' >> kernel/init_hooks.h
if test -f dist/sound/hda/hdac_bus.c; then
cat dist/sound/hda/*.c | grep '^subsys_initcall(' | \
sed -e's/^subsys_initcall(\(.*\))/call_init_\1();/g' >> kernel/init_hooks.h
cat dist/sound/hda/*.c | grep '^module_init(' | \
sed -e's/^module_init(\(.*\))/call_init_\1();/g' >> kernel/init_hooks.h
fi
cat hda/patch_*.c | grep '^module_init(' | \
sed -e's/^module_init(\(.*\))/call_init_\1();/g' >> kernel/init_hooks.h
cat hda/*_*.c | grep '^module_hda_codec_driver(' | \
sed -e's/^module_hda_codec_driver(\(.*\))/call_init_\1_init();/g' >> kernel/init_hooks.h
echo '}' >> kernel/init_hooks.h
AC_MSG_CHECKING(for local hda_codec.h)
if test -f hda/hda_codec.h; then
AC_MSG_RESULT(yes)
rm -f include/sound/hda_codec.h
ln -s ../../hda/hda_codec.h include/sound/hda_codec.h
else
AC_MSG_RESULT(no)
rm -f include/sound/hda_codec.h
ln -s ../../dist/include/sound/hda_codec.h include/sound/hda_codec.h
fi
AC_MSG_CHECKING(for presence of power_save option)
HAVE_POWER_SAVE=
if grep -q 'snd_hda_power_up' include/sound/hda_codec.h; then
AC_MSG_RESULT(yes)
HAVE_POWER_SAVE=1
else
AC_MSG_RESULT(no)
fi
if test "$HAVE_POWER_SAVE" = "1"; then
AC_DEFINE(HAVE_POWER_SAVE)
AC_DEFINE(CONFIG_SND_HDA_POWER_SAVE)
fi
if test "$HAVE_POWER_SAVE" = "1"; then
AC_MSG_CHECKING(for old power_save option)
OLD_POWER_SAVE=
if grep -q '^static int power_save' hda/hda_codec.c; then
AC_MSG_RESULT(yes)
OLD_POWER_SAVE=1
else
AC_MSG_RESULT(no)
fi
if test "$OLD_POWER_SAVE" = "1"; then
AC_DEFINE(OLD_POWER_SAVE)
fi
fi
NEW_HDA_INFRA=
AC_MSG_CHECKING(for new hda structure)
if grep -q hda_bus_template include/sound/hda_codec.h; then
AC_MSG_RESULT(no)
else
AC_MSG_RESULT(yes)
NEW_HDA_INFRA=yes
fi
if test "$NEW_HDA_INFRA" = "yes"; then
AC_DEFINE(NEW_HDA_INFRA)
fi
AC_MSG_CHECKING(for hda_bus_ops)
if grep -q 'struct hda_bus_ops ' include/sound/hda_codec.h; then
AC_MSG_RESULT(yes)
HAVE_BUS_OPS=yes
else
AC_MSG_RESULT(no)
fi
if test "$HAVE_BUS_OPS" = "yes"; then
AC_DEFINE(HAVE_BUS_OPS)
fi
AC_MSG_CHECKING(for old bus callbacks)
ac_save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -Iinclude"
OLD_HDA_CMD=
AC_TRY_COMPILE([
#include "hda-types.h"
#include "hda-log.h"
#include <sound/driver.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/hda_codec.h>
],[
extern struct hda_bus_ops *ops;
ops->command(NULL, 0, 0, 0, 0);
],
[AC_MSG_RESULT(yes); OLD_HDA_CMD="1"],
[AC_MSG_RESULT(no)],
[AC_MSG_RESULT(unknown)]
)
CFLAGS=$ac_save_CFLAGS
if test "$OLD_HDA_CMD" = "1"; then
AC_DEFINE(OLD_HDA_CMD)
fi
AC_MSG_CHECKING(for new pm_notify callback)
ac_save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -Iinclude"
HAVE_NEW_PM_NOTIFY=
AC_TRY_COMPILE([
#include "hda-types.h"
#include "hda-log.h"
#include <sound/driver.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/hda_codec.h>
],[
extern struct hda_bus_ops *ops;
ops->pm_notify(NULL, 0);
],
[AC_MSG_RESULT(yes); HAVE_NEW_PM_NOTIFY="1"],
[AC_MSG_RESULT(no)],
[AC_MSG_RESULT(unknown)]
)
CFLAGS=$ac_save_CFLAGS
if test "$HAVE_NEW_PM_NOTIFY" = "1"; then
AC_DEFINE(HAVE_NEW_PM_NOTIFY)
fi
AC_MSG_CHECKING(for attach_pcm bus ops)
ac_save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -Iinclude"
HAVE_HDA_ATTACH_PCM=
AC_TRY_COMPILE([
#include "hda-types.h"
#include "hda-log.h"
#include <sound/driver.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/hda_codec.h>
],[
extern struct hda_bus_ops *ops;
ops->attach_pcm(NULL, NULL, NULL);
],
[AC_MSG_RESULT(yes); HAVE_HDA_ATTACH_PCM="1"],
[AC_MSG_RESULT(no)],
[AC_MSG_RESULT(unknown)]
)
CFLAGS=$ac_save_CFLAGS
if test "$HAVE_HDA_ATTACH_PCM" = "1"; then
AC_DEFINE(HAVE_HDA_ATTACH_PCM)
fi
if test "$HAVE_HDA_ATTACH_PCM" = "1"; then
AC_MSG_CHECKING(for get_response with caddr)
ac_save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -Iinclude"
HAVE_GET_RESPONSE_WITH_CADDR=
AC_TRY_COMPILE([
#include "hda-types.h"
#include "hda-log.h"
#include <sound/driver.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/hda_codec.h>
],[
extern struct hda_bus_ops *ops;
ops->get_response(NULL, 1);
],
[AC_MSG_RESULT(yes); HAVE_GET_RESPONSE_WITH_CADDR="1"],
[AC_MSG_RESULT(no)],
[AC_MSG_RESULT(unknown)]
)
CFLAGS=$ac_save_CFLAGS
if test "$HAVE_GET_RESPONSE_WITH_CADDR" = "1"; then
AC_DEFINE(HAVE_GET_RESPONSE_WITH_CADDR)
fi
fi # HAVE_HDA_ATTACH_PCM=1
if test "$NEW_HDA_INFRA" = "yes"; then
AC_DEFINE(CONFIG_SND_HDA_RECONFIG)
AC_DEFINE(HAVE_HDA_PATCH_LOADER)
else
AC_MSG_CHECKING(for old snd_hda_codec_new)
ac_save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -Iinclude"
OLD_HDA_CODEC_NEW=
AC_TRY_COMPILE([
#include "hda-types.h"
#include "hda-log.h"
#include <sound/driver.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/hda_codec.h>
],[
int err = snd_hda_codec_new(NULL, 0, NULL);
],
[AC_MSG_RESULT(yes); OLD_HDA_CODEC_NEW="1"],
[AC_MSG_RESULT(no)],
[AC_MSG_RESULT(unknown)]
)
CFLAGS=$ac_save_CFLAGS
if test "$OLD_HDA_CODEC_NEW" = "1"; then
AC_DEFINE(OLD_HDA_CODEC_NEW)
fi
HAVE_HDA_PATCH_LOADER=
if test "$OLD_HDA_CODEC_NEW" = "1"; then
AC_MSG_CHECKING(for hda-patch)
if grep -q snd_hda_load_patch include/sound/hda_codec.h; then
AC_MSG_RESULT(yes)
HAVE_HDA_PATCH_LOADER=yes
AC_DEFINE(CONFIG_SND_HDA_RECONFIG)
else
AC_MSG_RESULT(no)
fi
fi
if test "$HAVE_HDA_PATCH_LOADER" = "yes"; then
AC_DEFINE(HAVE_HDA_PATCH_LOADER)
fi
fi # NEW_HDA_INFRA
AC_MSG_CHECKING(for new HDA PCM)
ac_save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -Iinclude"
OLD_HDA_PCM=
AC_TRY_COMPILE([
#include "hda-types.h"
#include "hda-log.h"
#include <sound/driver.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/hda_codec.h>
],[
struct hda_pcm pcm;
pcm.pcm_type = 0;
],
[AC_MSG_RESULT(yes)],
[AC_MSG_RESULT(no);OLD_HDA_PCM="1"],
[AC_MSG_RESULT(unknown)]
)
CFLAGS=$ac_save_CFLAGS
if test "$OLD_HDA_PCM" = "1"; then
AC_DEFINE(OLD_HDA_PCM)
fi
AC_MSG_CHECKING(for hda-reconfigure)
if grep -q snd_hda_codec_configure hda/hda_*.h include/sound/hda_*.h; then
AC_MSG_RESULT(yes)
HAVE_RECONFIG=yes
AC_DEFINE(CONFIG_SND_HDA_RECONFIG)
else
AC_MSG_RESULT(no)
HAVE_RECONFIG=no
fi
if test "$HAVE_RECONFIG" = "yes"; then
AC_MSG_CHECKING(for user pin configs)
if grep -q user_pins include/sound/hda_codec.h; then
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_USER_PINCFGS)
else
AC_MSG_RESULT(no)
fi
fi
AC_MSG_CHECKING(for new quirk list)
NEW_QUIRK_LIST=
if grep -q SND_PCI_QUIRK_MASK hda/patch_sigmatel.c; then
AC_MSG_RESULT(yes)
NEW_QUIRK_LIST=1
else
AC_MSG_RESULT(no)
fi
if test "$NEW_QUIRK_LIST" = "1"; then
AC_DEFINE(NEW_QUIRK_LIST)
fi
AC_MSG_CHECKING(for hda_codec.pin_amp_workaround)
ac_save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -Iinclude"
HDA_CODEC_PIN_AMP_WORKAROUND=
AC_TRY_COMPILE([
#include "hda-types.h"
#include "hda-log.h"
#include <sound/driver.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/hda_codec.h>
],[
struct hda_codec codec;
codec.pin_amp_workaround = 1;
],
[AC_MSG_RESULT(yes); HDA_CODEC_PIN_AMP_WORKAROUND="1"],
[AC_MSG_RESULT(no)],
[AC_MSG_RESULT(unknown)]
)
CFLAGS=$ac_save_CFLAGS
if test "$HDA_CODEC_PIN_AMP_WORKAROUND" = "1"; then
AC_DEFINE(HDA_CODEC_PIN_AMP_WORKAROUND)
fi
AC_MSG_CHECKING(for hda_codec.function_id)
ac_save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -Iinclude"
HDA_CODEC_FUNCTION_ID=
AC_TRY_COMPILE([
#include "hda-types.h"
#include "hda-log.h"
#include <sound/driver.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/hda_codec.h>
],[
struct hda_codec codec;
codec.function_id = 1;
],
[AC_MSG_RESULT(yes); HDA_CODEC_FUNCTION_ID="1"],
[AC_MSG_RESULT(no)],
[AC_MSG_RESULT(unknown)]
)
CFLAGS=$ac_save_CFLAGS
if test "$HDA_CODEC_FUNCTION_ID" = "1"; then
AC_DEFINE(HDA_CODEC_FUNCTION_ID)
fi
AC_MSG_CHECKING(for local snd_ctl_boolean_mono_info definition)
HAVE_BOOLEAN_INFO=
if grep -q snd_ctl_boolean_mono_info hda/hda_local.h; then
AC_MSG_RESULT(yes)
HAVE_BOOLEAN_INFO=1
else
AC_MSG_RESULT(no)
fi
if test "$HAVE_BOOLEAN_INFO" = "1"; then
AC_DEFINE(HAVE_BOOLEAN_INFO)
fi
if test "$NEW_HDA_INFRA" != "yes"; then
AC_MSG_CHECKING(for snd_hda_suspend with pmsg)
ac_save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -Iinclude"
HAVE_HDA_SUSPEND_PMSG=
AC_TRY_COMPILE([
#include "hda-types.h"
#include "hda-log.h"
#include <sound/driver.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/hda_codec.h>
],[
snd_hda_suspend(NULL);
],
[AC_MSG_RESULT(no)],
[AC_MSG_RESULT(yes); HAVE_HDA_SUSPEND_PMSG="1"],
[AC_MSG_RESULT(unknown)]
)
CFLAGS=$ac_save_CFLAGS
if test "$HAVE_HDA_SUSPEND_PMSG" = "1"; then
AC_DEFINE(HAVE_HDA_SUSPEND_PMSG)
fi
fi # !NEW_HDA_INFRA
HAVE_SND_HDA_JACK=
AC_MSG_CHECKING(for snd_hda_jack_xxx)
if grep -q snd_hda_jack_free include/sound/hda_codec.h; then
AC_MSG_RESULT(yes)
HAVE_SND_HDA_JACK=yes
else
AC_MSG_RESULT(no)
fi
if test "$HAVE_SND_HDA_JACK" = "yes"; then
AC_DEFINE(HAVE_SND_HDA_JACK)
fi
AC_MSG_CHECKING(for invidual spdif ctls)
ac_save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -Iinclude"
INDIVIDUALSPDIF_CTLS=
AC_TRY_COMPILE([
#include "hda-types.h"
#include "hda-log.h"
#include <sound/driver.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/hda_codec.h>
],[
struct hda_spdif_out *spdif = snd_hda_spdif_out_of_nid(0, 0);
],
[AC_MSG_RESULT(yes); INDIVIDUAL_SPDIF_CTLS="1"],
[AC_MSG_RESULT(no)],
[AC_MSG_RESULT(unknown)]
)
CFLAGS=$ac_save_CFLAGS
if test "$INDIVIDUAL_SPDIF_CTLS" = "1"; then
AC_DEFINE(INDIVIDUAL_SPDIF_CTLS)
fi
if test "$INDIVIDUAL_SPDIF_CTLS" != "1"; then
AC_MSG_CHECKING(for new snd_hda_calc_stream_format)
ac_save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -Iinclude"
STREAM_FORMAT_WITH_SPDIF=
AC_TRY_COMPILE([
#include "hda-types.h"
#include "hda-log.h"
#include <sound/driver.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/hda_codec.h>
],[
snd_hda_calc_stream_format(0, 0, 0, 0, 0);
],
[AC_MSG_RESULT(yes); STREAM_FORMAT_WITH_SPDIF="1"],
[AC_MSG_RESULT(no)],
[AC_MSG_RESULT(unknown)]
)
CFLAGS=$ac_save_CFLAGS
if test "$STREAM_FORMAT_WITH_SPDIF" = "1"; then
AC_DEFINE(STREAM_FORMAT_WITH_SPDIF)
fi
fi
AC_MSG_CHECKING(for snd_hda_calc_stream_format with codec)
ac_save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -Iinclude"
STREAM_FORMAT_WITH_CODEC=
AC_TRY_COMPILE([
#include "hda-types.h"
#include "hda-log.h"
#include <sound/driver.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/hda_codec.h>
],[
snd_hda_calc_stream_format(0, 0, 0, 0, 0, 0);
],
[AC_MSG_RESULT(yes); STREAM_FORMAT_WITH_CODEC="1"],
[AC_MSG_RESULT(no)],
[AC_MSG_RESULT(unknown)]
)
CFLAGS=$ac_save_CFLAGS
if test "$STREAM_FORMAT_WITH_CODEC" = "1"; then
AC_DEFINE(STREAM_FORMAT_WITH_CODEC)
fi
HAVE_COMMON_PREPARE=
AC_MSG_CHECKING(for common snd_hda_codec_prepare/cleanup)
if grep -q snd_hda_codec_prepare include/sound/hda_codec.h; then
AC_MSG_RESULT(yes)
HAVE_COMMON_PREPARE=yes
else
AC_MSG_RESULT(no)
fi
if test "$HAVE_COMMON_PREPARE" = "yes"; then
AC_DEFINE(HAVE_COMMON_PREPARE)
fi
AC_MSG_CHECKING(for snd_hda_codec_get_pincfg)
HAVE_SND_HDA_CODEC_GET_PINCFG=
if grep -q 'snd_hda_codec_get_pincfg' include/sound/hda_codec.h; then
AC_MSG_RESULT(yes)
HAVE_SND_HDA_CODEC_GET_PINCFG=1
else
AC_MSG_RESULT(no)
fi
if test "$HAVE_SND_HDA_CODEC_GET_PINCFG" = "1"; then
AC_DEFINE(HAVE_SND_HDA_CODEC_GET_PINCFG)
fi
AC_MSG_CHECKING(for codec user_mutex)
HAVE_CODEC_USER_MUTEX=
if grep -q 'user_mutex' include/sound/hda_codec.h; then
AC_MSG_RESULT(yes)
HAVE_CODEC_USER_MUTEX=1
else
AC_MSG_RESULT(no)
fi
if test "$HAVE_CODEC_USER_MUTEX" = "1"; then
AC_DEFINE(HAVE_CODEC_USER_MUTEX)
fi
AC_MSG_CHECKING(for new jack API)
NEW_JACK_API=
if grep -q 'phantom_jack' dist/include/sound/jack.h; then
AC_MSG_RESULT(yes)
NEW_JACK_API=1
else
AC_MSG_RESULT(no)
fi
if test "$NEW_JACK_API" = "1"; then
AC_DEFINE(NEW_JACK_API)
fi
AC_MSG_CHECKING(for HDMI chmap helper)
if test -f dist/sound/hda/hdmi_chmap.c; then
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_HDMI_CHMAP)
else
AC_MSG_RESULT(no)
fi
AC_MSG_CHECKING(for HDMI chmap helper)
if test -f dist/sound/hda/hdmi_chmap.c; then
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_HDMI_CHMAP)
else
AC_MSG_RESULT(no)
fi
AC_MSG_CHECKING(for HDMI chmap helper)
HAVE_HDAC_IO_OPS=
if grep -q 'struct hdac_io_ops' dist/include/sound/hdaudio.h; then
AC_MSG_RESULT(yes)
HAVE_HDAC_IO_OPS=1
else
AC_MSG_RESULT(no)
fi
if test "$HAVE_HDAC_IO_OPS" = "1"; then
AC_DEFINE(HAVE_HDAC_IO_OPS)
fi
AC_OUTPUT(Makefile lib/Makefile kernel/Makefile include/Makefile)