-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
2639 lines (2413 loc) · 80.9 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
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
dnl configure.ac: source for the configure script
dnl copyright by the mpg123 project - free software under the terms of the LGPL 2.1
dnl see COPYING and AUTHORS files in distribution or http://mpg123.org
dnl initially written by Nicholas J. Humfrey
dnl Require autoconf version >= 2.57
AC_PREREQ(2.57)
dnl ############# Initialisation
AC_INIT([mpg123], [1.26.1], [maintainer@mpg123.org])
dnl Increment API_VERSION when the API gets changes (new functions).
dnl libmpg123
API_VERSION=45
LIB_PATCHLEVEL=1
dnl libout123
OUTAPI_VERSION=3
OUTLIB_PATCHLEVEL=0
dnl libsyn123
SYNAPI_VERSION=1
SYNLIB_PATCHLEVEL=0
dnl Since we want to be backwards compatible, both sides get set to API_VERSION.
LIBMPG123_VERSION=$API_VERSION:$LIB_PATCHLEVEL:$API_VERSION
LIBOUT123_VERSION=$OUTAPI_VERSION:$OUTLIB_PATCHLEVEL:$OUTAPI_VERSION
LIBSYN123_VERSION=$SYNAPI_VERSION:$SYNLIB_PATCHLEVEL:$SYNAPI_VERSION
AC_SUBST(LIBMPG123_VERSION)
AC_SUBST(API_VERSION)
AC_SUBST(LIBOUT123_VERSION)
AC_SUBST(OUTAPI_VERSION)
AC_SUBST(LIBSYN123_VERSION)
AC_SUBST(SYNAPI_VERSION)
AC_CONFIG_SRCDIR(src/mpg123.c)
AC_CONFIG_AUX_DIR(build)
AC_CONFIG_SRCDIR(doc)
AC_CONFIG_MACRO_DIR([m4])
AC_CANONICAL_HOST
dnl Version 1.7 of automake is recommended
dnl Not sure what minimal version does not choke on sub directories.
dnl Testing with 1.14.
AM_INIT_AUTOMAKE([subdir-objects])
AC_CONFIG_HEADERS([src/config.h])
# You get strange symptoms like jack module build failing because the AC_C_CONST failed to detect the working const support.
# In that case, the test failed because -Werror, not because no const there...
# After looking again, there are possibly more tests being obscured by false failures.
AC_MSG_CHECKING([for -Werror in CFLAGS (It breaks tests)])
if echo "$CFLAGS" | grep Werror; then
AC_MSG_RESULT([yes])
AC_MSG_WARN([You have -Werror in CFLAGS. That may break some tests and make this configure bogus.
If you want paranoid compilation, use --enable-nagging option, which adds -Werror for gcc.
Also note that you shall not run make distcheck after configuring with --enable-nagging.
distcheck uses the generated CFLAGS...
Anyhow, continuing at your own risk.])
else
AC_MSG_RESULT([no])
fi
buffer=enabled # try to build with buffer by default
dnl ############# Compiler and tools Checks
LT_LDFLAGS=-export-dynamic
EXEC_LT_LDFLAGS=
be_static=no
all_static=no
lib_static=no
AC_MSG_CHECKING([if you are up to something totally static with LDFLAGS/CFLAGS])
for f in $LDFLAGS $CFLAGS
do
case "$f" in
-all-static)
be_static=yes
all_static=yes
lib_static=yes
;;
-static)
be_static=yes
lib_static=yes
;;
-static-libgcc)
lib_static=yes
;;
esac
done
if test "x$be_static" = xyes; then
AC_MSG_RESULT([yes])
LT_LDFLAGS=-all-static
EXEC_LT_LDFLAGS="$LT_LDFLAGS"
else
AC_MSG_RESULT([no])
fi
if test "x$all_static" = xyes; then
AC_MSG_WARN( Use -static in LDFLAGS for all-static linking! Your compiler may blow up on that -all-static. )
fi
AM_PROG_AS
AC_PROG_CC_C99
AM_PROG_CC_C_O
AC_PROG_CPP
AC_PROG_INSTALL
# Just look, no touch.
oldLIBS=$LIBS
AC_CHECK_LIBM
LIBS=$oldLIBS
AC_SUBST(LIBM)
dnl "Checking for egrep is broken after removal of libltdl stuff... checks use $EGREP, so searching it here."
AC_PROG_EGREP
AC_C_CONST
AC_INLINE
AC_C_BIGENDIAN
if test "x$lib_static" = xyes; then
CC="$CC -static-libgcc"
CCLD="$CC"
echo "Adding -static-libgcc"
fi
dnl ############# Use Libtool for dynamic module loading
modules=auto
OUTPUT_OBJ="module.\$(OBJEXT)"
AC_ARG_ENABLE(modules,
[ --enable-modules=[no/yes] dynamically loadable output modules],
[
if test "x$enableval" = xyes
then
modules=enabled
else
modules=disabled
fi
],
[
if test "x$be_static" = "xyes"; then
modules=disabled
else
modules=auto
fi
])
dnl We only want shared libraries by default
AC_DISABLE_STATIC
AC_ENABLE_SHARED
if test x"$enable_shared" = xno; then
modules=disabled
LT_LDFLAGS=
else
AC_DEFINE(DYNAMIC_BUILD, 1, [ Define if building with dynamcally linked libmpg123])
fi
dnl We need the windows header also for checking the module mechanism.
AC_CHECK_HEADERS([windows.h])
case "$host" in
*-*-mingw*)
win32=yes
;;
*)
win32=no
;;
esac
LIBDL=
if test x"$modules" = xdisabled
then
echo "Modules disabled, not checking for dynamic loading."
else
have_dl=no
dl_missing=no
# The dlopen() API is either in libc or in libdl.
if test "x$ac_cv_header_windows_h" = xyes &&
test "x$win32" = xyes; then
AC_MSG_CHECKING([if LoadLibrary should be used])
AC_LINK_IFELSE([AC_LANG_SOURCE([
#include <windows.h>
int main() {
LoadLibraryW(0);
GetProcAddress(0, 0);
FreeLibrary(0);
}
])], [
have_dl=yes
AC_MSG_RESULT([Using LoadLibrary])
],
[AC_MSG_RESULT([no])])
else
# Check for libdl functions, but only apply them for libcompat_dl.
# This looks too messy. Can I avoid messing with LIBS here?
oldLIBS=$LIBS
AC_SEARCH_LIBS(dlopen, dl)
AC_SEARCH_LIBS(dlsym, dl)
AC_SEARCH_LIBS(dlclose, dl)
AC_CHECK_HEADER(dlfcn.h)
AC_CHECK_FUNCS(dlopen dlsym dlclose, [ have_dl=yes ], [ dl_missing=yes] )
LIBS=$oldLIBS
# A better way to check if the library was really needed?
if test "x$ac_cv_search_dlopen" = x-ldl ||
test "x$ac_cv_search_dlsym" = x-ldl ||
test "x$ac_cv_search_dlclose" = x-ldl
then
LIBDL=-ldl
fi
fi
if test x"$dl_missing" = xyes; then
AC_MSG_WARN([Some dynamic loading functions missing.])
have_dl=no
fi
if test x"$modules" = xenabled -a x"$have_dl" = xno; then
AC_MSG_ERROR([Modules enabled but no runtime loader found! This will not work...])
fi
if test x"$modules" = xauto; then
if test x"$have_dl" = xyes; then
modules=enabled
echo "We found a runtime loader: Modules enabled."
else
echo "We did not find a runtime loader: Modules disabled."
modules=disabled
fi
fi
fi
AC_SUBST(LIBDL)
dnl Configure libtool
AC_LIBTOOL_WIN32_DLL
AM_PROG_LIBTOOL
if test x"$modules" = xdisabled
then
echo "Modules disabled."
else
# Enable module support in source code
AC_DEFINE( USE_MODULES, 1, [Define if modules are enabled] )
# Export the module file suffix as LT_MODULE_EXT
LT_SYS_MODULE_EXT
fi
AM_CONDITIONAL( [HAVE_MODULES], [test "x$modules" = xenabled] )
AC_SUBST(LT_LDFLAGS)
AC_SUBST(EXEC_LT_LDFLAGS)
dnl ############## Configurable Options
AC_ARG_ENABLE(debug,
[ --enable-debug=[no/yes] turn on debugging],
[
if test "x$enableval" = xyes
then
debugging="enabled"
else
debugging="disabled"
fi
],
[ debugging="disabled" ]
)
AC_ARG_ENABLE(nagging,
[ --enable-nagging=[no/yes] turn on GCC's pedantic nagging with error on warnings, does not include --enable-debug anymore ],
[
if test "x$enableval" = xyes
then
nagging="enabled"
else
nagging="disabled"
fi
],
[ nagging="disabled" ]
)
if test x"$debugging" = xenabled; then
AC_DEFINE(DEBUG, 1, [ Define if debugging is enabled. ])
fi
AC_ARG_ENABLE(gapless,
[ --enable-gapless=[no/yes] turn on gapless (enabled per default)],
[
if test "x$enableval" = xyes
then
gapless="enabled"
AC_DEFINE(GAPLESS, 1, [ Define if gapless is enabled. ])
else
gapless="disabled"
fi
],
[
gapless="enabled"
AC_DEFINE(GAPLESS, 1, [ Define if gapless is enabled. ])
]
)
AC_ARG_ENABLE(fifo,
[ --enable-fifo=[no/yes] FIFO support for control interface (auto-enabled on linux) ],
[
if test "x$enableval" = xyes
then
fifo="enabled"
else
fifo="disabled"
fi
],
[
fifo="auto"
]
)
AC_ARG_ENABLE(ipv6,
[ --enable-ipv6=[no/yes] IPv6 support (actually any protocol your libc does with getaddrinfo) ],
[
if test "x$enableval" = xyes
then
ipv6="enabled"
else
ipv6="disabled"
fi
],
[
ipv6="auto"
]
)
AC_ARG_ENABLE(network,
[ --enable-network=[no/yes] network support (http streams / webradio) ],
[
if test "x$enableval" = xyes
then
network="enabled"
else
network="disabled"
fi
],
[
network="auto"
]
)
dnl Optional objects list, depends on decoder choice and core feature selection.
dnl Not just for specific decoders anymore...
s_fpu=
DECODER_OBJ=
DECODER_LOBJ=
dnl Core features that can be disabled to reduce binary size.
id3v2=enabled
AC_ARG_ENABLE(id3v2,
[ --disable-id3v2=[no/yes] no ID3v2 parsing ],
[
if test "x$enableval" = xno; then
id3v2="disabled"
fi
], [])
# id3v2 depends on strings... so check that in between.
string=enabled
AC_ARG_ENABLE(string,
[ --disable-string=[no/yes] no string API (this will disable ID3v2; main mpg123 won't build anymore) ],
[
if test "x$enableval" = xno; then
string="disabled"
fi
], [])
if test "x$string" = "xdisabled"; then
AC_DEFINE(NO_STRING, 1, [ Define to disable string functions. ])
id3v2=disabled
AC_MSG_WARN([ID3v2 support disabled because of string API being disabled.])
else
DECODER_OBJ="$DECODER_OBJ stringbuf.\$(OBJEXT)"
DECODER_LOBJ="$DECODER_LOBJ stringbuf.lo"
fi
if test "x$id3v2" = "xdisabled"; then
AC_DEFINE(NO_ID3V2, 1, [ Define to disable ID3v2 parsing. ])
fi
icy=enabled
AC_ARG_ENABLE(icy,
[ --disable-icy=[no/yes] no ICY metainfo parsing/conversion (main mpg123 won't build!) ],
[
if test "x$enableval" = xno; then
icy="disabled"
fi
], [])
if test "x$icy" = "xdisabled"; then
AC_DEFINE(NO_ICY, 1, [ Define to disable ICY handling. ])
else
DECODER_OBJ="$DECODER_OBJ icy.\$(OBJEXT) icy2utf8.\$(OBJEXT)"
DECODER_LOBJ="$DECODER_LOBJ icy.lo icy2utf8.lo"
fi
ntom=enabled
AC_ARG_ENABLE(ntom,
[ --disable-ntom=[no/yes] no flexible resampling ],
[
if test "x$enableval" = xno; then
ntom="disabled"
fi
], [])
if test "x$ntom" = "xdisabled"; then
AC_DEFINE(NO_NTOM, 1, [ Define to disable ntom resampling. ])
else
DECODER_OBJ="$DECODER_OBJ ntom.\$(OBJEXT)"
DECODER_LOBJ="$DECODER_LOBJ ntom.lo"
fi
downsample=enabled
AC_ARG_ENABLE(downsample,
[ --disable-downsample=[no/yes] no downsampled decoding ],
[
if test "x$enableval" = xno; then
downsample="disabled"
fi
], [])
if test "x$downsample" = "xdisabled"; then
AC_DEFINE(NO_DOWNSAMPLE, 1, [ Define to disable downsampled decoding. ])
fi
feeder=enabled
AC_ARG_ENABLE(feeder,
[ --disable-feeder=[no/yes] no feeder decoding, no buffered readers ],
[
if test "x$enableval" = xno; then
feeder="disabled"
fi
], [])
if test "x$feeder" = "xdisabled"; then
AC_DEFINE(NO_FEEDER, 1, [ Define to disable feeder and buffered readers. ])
fi
moreinfo=enabled
AC_ARG_ENABLE(moreinfo,
[ --disable-moreinfo=[no/yes] no extra information for frame analyzers ],
[
if test "x$enableval" = xno; then
moreinfo="disabled"
fi
], [])
if test "x$moreinfo" = "xdisabled"; then
AC_DEFINE(NO_MOREINFO, 1, [ Define to disable analyzer info. ])
fi
messages=enabled
AC_ARG_ENABLE(messages,
[ --disable-messages=[no/yes] no error/warning messages on the console ],
[
if test "x$enableval" = xno; then
messages="disabled"
fi
], [])
if test "x$messages" = "xdisabled"; then
AC_DEFINE(NO_WARNING, 1, [ Define to disable warning messages. ])
AC_DEFINE(NO_ERRORMSG, 1, [ Define to disable error messages. ])
AC_DEFINE(NO_ERETURN, 1, [ Define to disable error messages in combination with a return value (the return is left intact). ])
fi
newhuff=enabled
AC_ARG_ENABLE(new-huffman,
[ --enable-new-huffman=[yes/no] use new huffman decoding scheme by Taihei (faster on modern CPUs at least, so on by default) ],
[
if test "x$enableval" = xno; then
newhuff=disabled
fi
]
, [])
if test "x$newhuff" = "xenabled"; then
AC_DEFINE(USE_NEW_HUFFTABLE, 1, [ Define for new Huffman decoding scheme. ])
fi
integers=quality
AC_ARG_ENABLE(int-quality,
[ --enable-int-quality=[yes/no] use rounding instead of fast truncation for integer output, where possible ],
[
if test "x$enableval" = xno; then
integers=fast
fi
], [])
if test $integers = quality; then
AC_DEFINE(ACCURATE_ROUNDING, 1, [ Define to use proper rounding. ])
fi
int16=enabled
AC_ARG_ENABLE(16bit,
[ --disable-16bit=[no/yes] no 16 bit integer output ],
[
if test "x$enableval" = xno; then
int16="disabled"
fi
], [])
int8=enabled
AC_ARG_ENABLE(8bit,
[ --disable-8bit=[no/yes] no 8 bit integer output ],
[
if test "x$enableval" = xno; then
int8="disabled"
fi
], [])
int32=enabled
AC_ARG_ENABLE(32bit,
[ --disable-32bit=[no/yes] no 32 bit integer output (also 24 bit) ],
[
if test "x$enableval" = xno; then
int32="disabled"
fi
], [])
real=enabled
AC_ARG_ENABLE(real,
[ --disable-real=[no/yes] no real (floating point) output ],
[
if test "x$enableval" = xno; then
real="disabled"
fi
], [])
equalizer=enabled
AC_ARG_ENABLE(equalizer,
[ --disable-equalizer=[no/yes] no equalizer support ],
[
if test "x$enableval" = xno; then
equalizer="disabled"
fi
], [])
AC_ARG_WITH([cpu], [
--with-cpu=generic[[_fpu]] Use generic processor code with floating point arithmetic
--with-cpu=generic_float Plain alias to generic_fpu now... float output is a normal runtime option!
--with-cpu=generic_nofpu Use generic processor code with fixed point arithmetic (p.ex. ARM)
--with-cpu=generic_dither Use generic processor code with floating point arithmetic and dithering for 1to1 16bit decoding.
--with-cpu=i386[[_fpu]] Use code optimized for i386 processors with floating point arithmetic
--with-cpu=i386_nofpu Use code optimized for i386 processors with fixed point arithmetic
--with-cpu=i486 Use code optimized for i486 processors (only usable alone!)
--with-cpu=i586 Use code optimized for i586 processors
--with-cpu=i586_dither Use code optimized for i586 processors with dithering (noise shaping), adds 256K to binary size
--with-cpu=3dnow Use code optimized for 3DNow processors
--with-cpu=3dnow_vintage Use code optimized for older 3DNow processors (K6 family)
--with-cpu=3dnowext Use code optimized for 3DNowExt processors (K6-3+, Athlon)
--with-cpu=3dnowext_alone Really only 3DNowExt decoder, without 3DNow fallback for flexible rate
--with-cpu=3dnow_vintage Use code optimized for older extended 3DNow processors (like K6-III+)
--with-cpu=mmx Use code optimized for MMX processors
--with-cpu=mmx_alone Really only MMX decoder, without i586 fallback for flexible rate
--with-cpu=sse Use code optimized for SSE processors
--with-cpu=sse_vintage Use code optimized for older SSE processors (plain C DCT36)
--with-cpu=sse_alone Really only SSE decoder, without i586 fallback for flexible rate
--with-cpu=avx Use code optimized for x86-64 with AVX processors
--with-cpu=x86 Pack all x86 opts into one binary (excluding i486, including dither)
--with-cpu=x86-64 Use code optimized for x86-64 processors (AMD64 and Intel64, including AVX and dithered generic)
--with-cpu=altivec Use code optimized for Altivec processors (PowerPC G4 and G5)
--with-cpu=ppc_nofpu Use code optimized for PowerPC processors with fixed point arithmetic
--with-cpu=neon Use code optimized for ARM NEON SIMD engine (Cortex-A series)
--with-cpu=arm_fpu Pack neon and generic[[_dither]] decoders, for ARM processors with FPU and/or NEON
--with-cpu=arm_nofpu Use code optimized for ARM processors with fixed point arithmetic
--with-cpu=neon64 Use code optimized for AArch64 NEON SIMD engine
--with-cpu=aarch64 Pack neon64 and generic[[_dither]] decoders, for 64bit ARM processors
])
use_yasm=auto
AC_ARG_ENABLE(yasm,
[ --enable-yasm=[no/yes] enforce yasm instad of default assembler for some optimizations (AVX, currently) ],
[
if test "x$enableval" = xyes; then
use_yasm="enabled"
else
use_yasm="disabled"
fi
], [])
AC_ARG_ENABLE(ieeefloat,
[ --enable-ieeefloat=[yes/no] use special hackery relying on IEEE 754 floating point storage format (to accurately round to 16 bit integer at bit more efficiently in generic decoder, enabled by default, disable in case you have a very special computer) ],
[
if test "x$enableval" = xyes; then
ieee=enabled
else
ieee=disabled
fi
], [ ieee=enabled ])
if test "x$ieee" = xenabled; then
echo "We assume IEEE754 floating point format."
AC_DEFINE(IEEE_FLOAT, 1, [ Define to indicate that float storage follows IEEE754. ])
fi
AC_ARG_ENABLE(cases,
[ --enable-cases=[yes/no] include special cases for likely parameter values (channel count, encoding sizes in libsyn123 routines) in the hope of better optimization at the expense of some code bloat (default enabled) ],
[
if test "x$enableval" = xyes; then
specialcases=enabled
else
specialcases=disabled
fi
], [ specialcases=enabled ])
if test "x$specialcases" = xdisabled; then
AC_DEFINE(SYN123_NO_CASES, 1, [ Define to not duplicate some code for likely cases in libsyn123. ])
fi
sys_cppflags=
newoldwritesample=disabled
case $host in
aarch64-*linux*|arm64-*linux*|aarch64-*bsd*|arm64-*bsd*|aarch64-apple-darwin*|arm64-apple-darwin*)
cpu_type="aarch64"
;;
arm*-*-linux*-*eabihf|armv7hl*-*-linux*)
cpu_type="arm_fpu"
;;
arm*-*-linux*)
# check that... perhaps we are better off on arm with kernel math emulation
cpu_type="arm_nofpu"
;;
armv7*-apple-darwin*)
cpu_type="arm_fpu"
;;
i386-*-linux*|i386-*-kfreebsd*-gnu)
cpu_type="i386_fpu"
newoldwritesample=enabled
;;
i486-*-linux*|i486-*-kfreebsd*-gnu)
cpu_type="i486"
newoldwritesample=enabled
;;
i586-*-linux*|i586-*-kfreebsd*-gnu)
cpu_type="x86"
newoldwritesample=enabled
;;
i686-*-linux*|i686-*-kfreebsd*-gnu)
cpu_type="x86"
newoldwritesample=enabled
;;
x86_64-*-linux*|x86_64-*-kfreebsd*-gnu)
cpu_type="x86-64"
;;
*-*-linux*|*-*-kfreebsd*-gnu)
cpu_type="generic_fpu"
;;
i?86-apple-darwin10*)
AC_MSG_CHECKING([if CPU type supports x86-64])
case `sysctl -n hw.optional.x86_64` in
1)
AC_MSG_RESULT([yes])
cpu_type="x86-64"
;;
*)
AC_MSG_RESULT([no])
cpu_type="x86"
newoldwritesample=enabled
;;
esac
;;
i?86-apple-darwin*)
cpu_type="x86"
newoldwritesample=enabled
;;
x86_64-apple-darwin*)
cpu_type="x86-64"
;;
*-apple-darwin*)
AC_MSG_CHECKING([if CPU type supports AltiVec])
case `machine` in
ppc7400 | ppc7450 | ppc970)
AC_MSG_RESULT([yes])
cpu_type="altivec"
;;
*)
AC_MSG_RESULT([no])
cpu_type="generic_fpu"
;;
esac
;;
i?86-*-dragonfly* | i?86-*-freebsd* | i?86-*-midnightbsd* | i?86-*-mirbsd* | i?86-*-netbsd* | i?86-*-openbsd* | i?86-*-haiku*)
cpu_type="x86"
newoldwritesample=enabled
;;
x86_64-*-dragonfly* | x86_64-*-freebsd* | x86_64-*-midnightbsd* | x86_64-*-mirbsd* | x86_64-*-netbsd* | x86_64-*-openbsd* | x86_64-*-haiku*)
cpu_type="x86-64"
;;
*-*-dragonfly* | *-*-freebsd* | *-*-midnightbsd* | *-*-mirbsd* | *-*-netbsd* | *-*-openbsd*)
cpu_type="generic_fpu"
;;
i386-*-solaris*)
cpu_type=x86
newoldwritesample=enabled
;;
x86_64-*-solaris*)
cpu_type=x86-64
;;
*-*-solaris*)
cpu_type="generic_fpu"
;;
# os2-emx = OS/2 with some Unix fun; so p.ex. buffer works.
# Till we sorted out the assembler troubles, generic CPU is default.
i386-pc-os2-emx)
cpu_type=generic_fpu
newoldwritesample=enabled
;;
x86_64-pc-os2-emx)
# We are optimistic hat the future knows OS/2 on x86-64;-)
cpu_type=generic_fpu
;;
*-pc-os2-emx)
cpu_type="generic_fpu"
;;
*-dec-osf*)
cpu_type="generic_fpu"
;;
x86_64-*-cygwin*)
cpu_type="x86-64"
;;
i686-*-cygwin*)
cpu_type="x86"
newoldwritesample=enabled
;;
i586-*-cygwin*)
cpu_type="x86"
newoldwritesample=enabled
;;
i486-*-cygwin*)
cpu_type="i486"
newoldwritesample=enabled
;;
i386-*-cygwin*)
cpu_type="i386"
newoldwritesample=enabled
;;
*-cygwin*)
cpu_type="generic_fpu"
;;
i@<:@3-7@:>@86-*-mingw32*)
LIBS="$LIBS"
buffer=disabled
cpu_type="x86"
newoldwritesample=enabled
;;
x86_64-*-mingw32*)
LIBS="$LIBS"
buffer=disabled
cpu_type="x86-64"
;;
i386-*-nto-qnx*)
cpu_type="x86"
newoldwritesample=enabled
;;
*-ibm-aix*)
AC_MSG_WARN([AIX system detected. You might want to --disable-largefile when trouble about conflicting types for lseek64 and friends occurs.])
# Altivec instead? It is developed for MacOS ...
cpu_type=generic_fpu
# no struct winsize without _ALL_SOURCE
sys_cppflags=-D_ALL_SOURCE
;;
i386-*)
AC_MSG_WARN([Unknown host operating system])
cpu_type="i386"
buffer=disabled
sys_cppflags=-DGENERIC
newoldwritesample=enabled
;;
i486-*)
AC_MSG_WARN([Unknown host operating system])
cpu_type="i486"
buffer=disabled
sys_cppflags=-DGENERIC
newoldwritesample=enabled
;;
i586-*)
AC_MSG_WARN([Unknown host operating system])
cpu_type="x86"
buffer=disabled
sys_cppflags=-DGENERIC
newoldwritesample=enabled
;;
i686-*)
AC_MSG_WARN([Unknown host operating system])
cpu_type="x86"
buffer=disabled
sys_cppflags=-DGENERIC
newoldwritesample=enabled
;;
x86_64-*)
AC_MSG_WARN([Unknown host operating system])
cpu_type="x86-64"
buffer=disabled
sys_cppflags=-DGENERIC
;;
*)
AC_MSG_WARN([Unknown host operating system])
cpu_type="generic_fpu"
buffer=disabled
sys_cppflags=-DGENERIC
;;
esac
AC_ARG_ENABLE(buffer,
[ --enable-buffer=[yes/no] disable audio buffer code (default uses system whitelist... proper checks later) ],
[
if test "x$enableval" = xyes
then
echo "Note: Enabling buffer per request... perhaps it will not build anyway."
buffer="enabled"
else
echo "Note: Disabling buffer per request."
buffer="disabled"
fi
]
)
AC_ARG_ENABLE(newoldwritesample,
[ --enable-newoldwritesample=[no/yes] enable new/old WRITE_SAMPLE macro for non-accurate 16 bit output, faster on certain CPUs (default on on x86-32)],
[
if test "x$enableval" = xyes
then
newoldwritesample=enabled
else
newoldwritesample=disabled
fi
])
dnl Did user choose other CPU type ?
if test "x$with_cpu" != "x"; then
cpu_type=$with_cpu
fi
# Flag for 32 bit synth output or post-processing.
case "$cpu_type" in
*_nofpu)
synth32=false
AC_DEFINE(NO_SYNTH32, 1, [ Define for post-processed 32 bit formats. ])
;;
*)
synth32=true
;;
esac
if test "x$int16" = "xdisabled"; then
AC_DEFINE(NO_16BIT, 1, [ Define to disable 16 bit integer output. ])
else
DECODER_OBJ="$DECODER_OBJ synth.\$(OBJEXT)"
DECODER_LOBJ="$DECODER_LOBJ synth.lo"
fi
AM_CONDITIONAL( [NO_16_BIT], [test "x$int16" = "xdisabled"])
# 8bit works only through 16bit
if test "x$int16" = "xdisabled"; then
int8=disabled
fi
if test "x$int8" = "xdisabled"; then
AC_DEFINE(NO_8BIT, 1, [ Define to disable 8 bit integer output. ])
else
DECODER_OBJ="$DECODER_OBJ synth_8bit.\$(OBJEXT)"
DECODER_LOBJ="$DECODER_LOBJ synth_8bit.lo"
fi
if test "x$int32" = "xdisabled"; then
AC_DEFINE(NO_32BIT, 1, [ Define to disable 32 bit and 24 bit integer output. ])
else
if $synth32; then
s_fpu="$s_fpu synth_s32"
fi
fi
if test "x$real" = "xdisabled"; then
AC_DEFINE(NO_REAL, 1, [ Define to disable real output. ])
else
if $synth32; then
s_fpu="$s_fpu synth_real"
fi
fi
if test "x$equalizer" = "xdisabled"; then
AC_DEFINE(NO_EQUALIZER, 1, [ Define to disable equalizer. ])
fi
layer1=enabled
AC_ARG_ENABLE(layer1,
[ --disable-layer1=[no/yes] no layer I decoding ],
[
if test "x$enableval" = xno; then
layer1="disabled"
fi
], [])
if test "x$layer1" = "xdisabled"; then
AC_DEFINE(NO_LAYER1, 1, [ Define to disable layer I. ])
else
# layer1 needs code in layer2
DECODER_OBJ="$DECODER_OBJ layer1.\$(OBJEXT) layer2.\$(OBJEXT)"
DECODER_LOBJ="$DECODER_LOBJ layer1.lo layer2.lo"
fi
layer2=enabled
AC_ARG_ENABLE(layer2,
[ --disable-layer2=[no/yes] no layer II decoding ],
[
if test "x$enableval" = xno; then
layer2="disabled"
fi
], [])
if test "x$layer2" = "xdisabled"; then
AC_DEFINE(NO_LAYER2, 1, [ Define to disable layer II. ])
else
# layer1 may have added the objects already
if test "x$layer1" = "xdisabled"; then
DECODER_OBJ="$DECODER_OBJ layer2.\$(OBJEXT)"
DECODER_LOBJ="$DECODER_LOBJ layer2.lo"
fi
fi
layer3=enabled
AC_ARG_ENABLE(layer3,
[ --disable-layer3=[no/yes] no layer III decoding ],
[
if test "x$enableval" = xno; then
layer3="disabled"
fi
], [])
if test "x$layer3" = "xdisabled"; then
AC_DEFINE(NO_LAYER3, 1, [ Define to disable layer III. ])
else
DECODER_OBJ="$DECODER_OBJ layer3.\$(OBJEXT)"
DECODER_LOBJ="$DECODER_LOBJ layer3.lo"
fi
AC_ARG_WITH([audio], [
--with-audio=<list of modules> Select a list (or only one) of audio output modules (comma or space separated list).
])
AC_ARG_WITH([default-audio], [
--with-default-audio=aix Use AIX as default audio output sub-system
--with-default-audio=alib Use Alib as default audio output sub-system (for HPUX)
--with-default-audio=alsa Use ALSA as default audio output sub-system (libasound)
--with-default-audio=tinyalsa Use ALSA as default audio output sub-system (tinyalsa)
--with-default-audio=arts Use aRts as default audio output sub-system (KDE sound server)
--with-default-audio=dummy Use dummy as default audio (when no sound card is available)
--with-default-audio=esd Use ESoundD as default audio output sub-system
--with-default-audio=hp Use HP as default audio output sub-system
--with-default-audio=jack Use JACK as default low-latency audio server
--with-default-audio=coreaudio Use Mac OS X as default audio output sub-system (CoreAudio)
--with-default-audio=mint Use MinT as default audio output sub-system (Atari)
--with-default-audio=nas Use NAS as default audio output (Network Audio System)
--with-default-audio=os2 Use OS2 as default audio output sub-system
--with-default-audio=oss Use OSS as default audio output sub-system (/dev/dsp)
--with-default-audio=portaudio Use PortAudio as default audio output sub-system
--with-default-audio=pulse Use Pulse audio server as default audio output sub-system
--with-default-audio=qsa Use QSA as default audio output sub-system
--with-default-audio=sdl Use SDL as default audio output sub-system (Simple DirectMedia Layer)
--with-default-audio=sgi Use SGI as default audio output sub-system (IRIX)
--with-default-audio=sndio Use OpenBSD's sndio as default audio output sub-system
--with-default-audio=sun Use Sun as default audio output sub-system (/dev/audio)
--with-default-audio=win32 Use Win32 audio as default audio output sub-system
--with-default-audio=win32_wasapi Use Win32 wasapi audio as default audio output sub-system
])
AC_ARG_WITH([optimization], [
--with-optimization=0 No Optimization
--with-optimization=1 Limited Optimization (-O) (for gcc)
--with-optimization=2 Default Optimization (-O2 ...) (for gcc)
--with-optimization=3 More Optimize than default (-O3 ...) (for gcc)
--with-optimization=4 Optimize yet more (-O4 ...) (for gcc)
])
AC_ARG_WITH([seektable], [
--with-seektable=<size> choose size of seek index table (0 disables it), default 1000
])
dnl ############## Modules
# Dummy audio output module is always supported
output_modules="dummy"
dnl ############## Assembler, compiler properties
# based on posting from John Dalgliesh <johnd@defyne.org> on ffmpeg (LGPL) mailing list
# extended to use balign if present
AC_MSG_CHECKING([if .balign is present])
echo '.balign 4' > conftest.s
if $CCAS -c -o conftest.o conftest.s 1>/dev/null 2>&1; then