-
Notifications
You must be signed in to change notification settings - Fork 12
/
configure.ac
3073 lines (2799 loc) · 94.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
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 Autoconf 2.71 wants some changes, hope we kept it fine for
dnl 2.69 at least.
AC_PREREQ([2.69])
dnl ############# Initialisation
dnl Set version numbers from header version.h and each library API header.
dnl Do not forget the re-generate configure on version changes. This does
dnl not happen automatically, as it would with m4_include() usage, wich
dnl is too fragile with arbitrary header contents.
m4_define([V_HEADER], m4_esyscmd(grep MPG123_ src/version.h))
m4_define([V_MAJOR], m4_bregexp(V_HEADER,
[#define MPG123_MAJOR\s+\([0-9]+\)],
[\1]))
m4_define([V_MINOR], m4_bregexp(V_HEADER,
[\#define MPG123_MINOR\s+\([0-9]+\)],
[\1]))
m4_define([V_PATCH], m4_bregexp(V_HEADER,
[\#define MPG123_PATCH\s+\([0-9]+\)],
[\1]))
m4_define([V_SUFFIX], m4_bregexp(V_HEADER,
[\#define MPG123_SUFFIX\s+"\(.+\)"],
[\1]))
m4_undefine([V_HEADER])
AC_INIT([mpg123], V_MAJOR.V_MINOR.V_PATCH[]V_SUFFIX, [[email protected]])
m4_define([V_HEADER], m4_esyscmd(grep -e _API_VERSION -e _PATCHLEVEL src/include/mpg123.h src/include/out123.h src/include/syn123.h))
dnl libmpg123
m4_define([API_VERSION], m4_bregexp(V_HEADER,
[\#define MPG123_API_VERSION\s+\([0-9]+\)],
[\1]))
m4_define([LIB_PATCHLEVEL], m4_bregexp(V_HEADER,
[\#define MPG123_PATCHLEVEL\s+\([0-9]+\)],
[\1]))
dnl libout123
m4_define([OUTAPI_VERSION], m4_bregexp(V_HEADER,
[\#define OUT123_API_VERSION\s+\([0-9]+\)],
[\1]))
m4_define([OUTLIB_PATCHLEVEL], m4_bregexp(V_HEADER,
[\#define OUT123_PATCHLEVEL\s+\([0-9]+\)],
[\1]))
dnl libsyn123
m4_define([SYNAPI_VERSION], m4_bregexp(V_HEADER,
[\#define SYN123_API_VERSION\s+\([0-9]+\)],
[\1]))
m4_define([SYNLIB_PATCHLEVEL], m4_bregexp(V_HEADER,
[\#define SYN123_PATCHLEVEL\s+\([0-9]+\)],
[\1]))
m4_undefine([V_HEADER])
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([LIBOUT123_VERSION])
AC_SUBST([LIBSYN123_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
m4_version_prereq(2.70, [AC_PROG_CC], [AC_PROG_CC_C99])
AC_PROG_CPP
AC_PROG_INSTALL
# Just look, no touch.
oldLIBS=$LIBS
LT_LIB_M
dnl Test if -lrt is required for clock_gettime() (old glibc).
AC_SEARCH_LIBS([clock_gettime], [rt])
if echo " $LIBS" | grep -q -w -- -lrt; then
LIBRT=-lrt
fi
# Could actually be missing.
AC_CHECK_FUNCS([clock_gettime])
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_C_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
AC_ARG_ENABLE(modules,
[AS_HELP_STRING([--disable-modules], [dynamically loadable output module support (default enabled in shared library builds)])],
[
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
])
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])
# enable win32 code
if test "x$ac_cv_header_windows_h" = xyes -a "x$host_os" != xcygwin -a "x$host_os" != xmidipix; then
win32_specific_codes=enabled
fi
android_build=no
case "$host" in
*-*-mingw*)
win32=yes
AC_MSG_CHECKING([if this is a UWP build])
AC_PREPROC_IFELSE([AC_LANG_PROGRAM(
[[#include <winapifamily.h>
#if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP)
# error Win32 Desktop build
#endif
]],[[;]])
],[
uwp_build=yes
AC_MSG_RESULT([yes])
],[
uwp_build=no
AC_MSG_RESULT([no])
])
if test x"$uwp_build" = xyes; then
AC_DEFINE( [WINDOWS_UWP], 1, [Windows UWP build] )
fi
;;
linux*)
dnl Android is linux, but a bit different
AC_MSG_CHECKING([for an Android system])
AC_PREPROC_IFELSE([AC_LANG_PROGRAM(
[[#ifndef __ANDROID__
# error Not Android
#endif
]],[[;]])
],[
android_build=yes
AC_MSG_RESULT([yes])
],[
AC_MSG_RESULT([no])
])
;;
*)
win32=no
;;
esac
if test x$win32_specific_codes = xenabled; then
# Check GetThreadErrorMode
if test x"$modules" != xdisabled; then
AC_MSG_CHECKING([if we have GetThreadErrorMode])
AC_LINK_IFELSE([AC_LANG_SOURCE([
#include <windows.h>
int main(){
return GetThreadErrorMode();
}])],[win32_thread_error=yes],[win32_winver_bump=yes])
if test "x$win32_thread_error" != "xyes"; then
AC_MSG_CHECKING([if we have GetThreadErrorMode])
AC_LINK_IFELSE([AC_LANG_SOURCE([
#define WINVER 0x600
#define _WIN32_WINNT 0x600
#include <windows.h>
int main(){
return GetThreadErrorMode();
}])],[win32_thread_error=yes],[win32_thread_error=no])
fi
if test "x$win32_thread_error" = "xyes"; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
if test "x$modules" = xenabled; then
AC_MSG_ERROR([GetThreadErrorMode is required for modules but not found.])
else
AC_MSG_WARN([Disabling modules because of missing GetThreadErrorMode()])
modules=disabled
fi
fi
fi
fi
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
LT_INIT([win32-dll disable-static])
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] )
# Ensure that a possibly hijacked libtool does not build any static libs.
if test x"$enable_static" = xno; then
LIB_CFLAGS=-shared
else
LIB_CFLAGS=
fi
AC_SUBST(LIB_CFLAGS)
AC_SUBST(LT_LDFLAGS)
AC_SUBST(EXEC_LT_LDFLAGS)
dnl ############## Component selection
AC_ARG_ENABLE(components,
[AS_HELP_STRING([--disable-components], [(not) build end-user programs with default components, select individual components via --enable-libmpg123 etc.])],
[
if test "x$enableval" = xyes
then
build_all=yes
else
build_all=no
fi
],
[
build_all=yes
]
)
AC_ARG_ENABLE(programs,
[AS_HELP_STRING([--enable-programs], [build (only) programs (with --disable-components)])],
[
if test "x$enableval" = xyes
then
build_programs=yes
else
build_programs=no
fi
],
[
build_programs=no
]
)
AC_ARG_ENABLE(libmpg123,
[AS_HELP_STRING([--enable-libmpg123], [build (only) libmpg123 (with --disable-components)])],
[
if test "x$enableval" = xyes
then
build_libmpg123=yes
else
build_libmpg123=no
fi
],
[
build_libmpg123=no
]
)
AC_ARG_ENABLE(libout123,
[AS_HELP_STRING([--enable-libout123], [build (only) libout123 (with --disable-components)])],
[
if test "x$enableval" = xyes
then
build_libout123=yes
else
build_libout123=no
fi
],
[
build_libout123=no
]
)
AC_ARG_ENABLE(libout123-modules,
[AS_HELP_STRING([--enable-libout123-modules], [build (only) libout123 modules (with --disable-components)])],
[
if test "x$enableval" = xyes
then
build_libout123_modules=yes
else
build_libout123_modules=no
fi
],
[
build_libout123_modules=no
]
)
AC_ARG_ENABLE(libsyn123,
[AS_HELP_STRING([--enable-libsyn123], [build (only) libsyn123 (with --disable-components)])],
[
if test "x$enableval" = xyes
then
build_libsyn123=yes
else
build_libsyn123=no
fi
],
[
build_libsyn123=no
]
)
if test "x$build_all" = xyes; then
build_programs=yes
build_libmpg123=yes
build_libout123=yes
build_libout123_modules=yes
build_libsyn123=yes
fi
AM_CONDITIONAL([BUILD_PROGRAMS], [ test "x$build_programs" = xyes ])
AM_CONDITIONAL([BUILD_LIBMPG123], [ test "x$build_libmpg123" = xyes ])
AM_CONDITIONAL([BUILD_LIBOUT123], [ test "x$build_libout123" = xyes ])
AM_CONDITIONAL([BUILD_LIBOUT123_MODULES], [ test "x$build_libout123_modules" = xyes ])
AM_CONDITIONAL([BUILD_LIBOUT123_OR_MODULES], [ test "x$build_libout123" = xyes || test "x$build_libout123_modules" = xyes ])
AM_CONDITIONAL([BUILD_LIBSYN123], [ test "x$build_libsyn123" = xyes ])
# If we install libraries, prompting pkgconfig and include directories.
AM_CONDITIONAL([NEED_LIB], [ test "x$build_libmpg123" = xyes || test "x$build_libout123" = xyes || test "x$build_libout123_modules" = xyes || test "x$build_libsyn123" = xyes ])
AM_CONDITIONAL([NEED_MAINLIB], [ test "x$build_libmpg123" = xyes || test "x$build_libout123" = xyes || test "x$build_libsyn123" = xyes ])
components=""
if test "x$build_programs" = xyes; then
components="$components programs"
fi
if test "x$build_libmpg123" = xyes; then
components="$components libmpg123"
fi
if test "x$build_libout123" = xyes; then
components="$components libout123"
fi
if test "x$build_libout123_modules" = xyes; then
components="$components libout123-modules"
fi
if test "x$build_libsyn123" = xyes; then
components="$components libsyn123"
fi
components=$(echo $components)
dnl ############## Configurable Options
AC_ARG_ENABLE(debug,
[AS_HELP_STRING([--enable-debug], [turn on (lots of) debugging printouts])],
[
if test "x$enableval" = xyes
then
debugging="enabled"
else
debugging="disabled"
fi
],
[ debugging="disabled" ]
)
AC_ARG_ENABLE(xdebug,
[AS_HELP_STRING([--enable-xdebug], [turn on (yet more) extreme debugging printouts])],
[
if test "x$enableval" = xyes
then
xdebugging="enabled"
else
xdebugging="disabled"
fi
],
[ xdebugging="disabled" ]
)
if test x"$xdebugging" = xenabled; then
debugging=enabled
AC_DEFINE(XDEBUG, 1, [ Define for extreme debugging. ])
fi
AC_ARG_ENABLE(nagging,
[AS_HELP_STRING([--enable-nagging], [turn on GCC's pedantic nagging with error on warnings])],
[
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,
[AS_HELP_STRING( [--disable-gapless], [turn off gapless decoding (please don't)])],
[
if test "x$enableval" = xyes
then
gapless="enabled"
else
gapless="disabled"
fi
],
[ gapless="enabled" ]
)
if test "x$gapless" = xenabled; then
AC_DEFINE(GAPLESS, 1, [ Define if gapless is enabled. ])
fi
AC_ARG_ENABLE(fifo,
[AS_HELP_STRING( [--enable-fifo], [FIFO support for control interface (auto-enabled on linux)])],
[
if test "x$enableval" = xyes
then
fifo="enabled"
else
fifo="disabled"
fi
],
[
fifo="auto"
]
)
dnl Optional objects list, depends on decoder choice and core feature selection.
dnl Not just for specific decoders anymore...
dnl Core features that can be disabled to reduce binary size.
id3v2=enabled
AC_ARG_ENABLE(id3v2,
[AS_HELP_STRING( [--disable-id3v2], [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,
[AS_HELP_STRING( [--disable-string], [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.])
fi
AM_CONDITIONAL([HAVE_STRING], [test "x$string" = xenabled])
if test "x$id3v2" = "xdisabled"; then
AC_DEFINE(NO_ID3V2, 1, [ Define to disable ID3v2 parsing. ])
fi
icy=enabled
AC_ARG_ENABLE(icy,
[AS_HELP_STRING( [--disable-icy], [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. ])
fi
AM_CONDITIONAL([HAVE_ICY], [test "x$icy" = xenabled])
ntom=enabled
AC_ARG_ENABLE(ntom,
[AS_HELP_STRING( [--disable-ntom], [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. ])
fi
AM_CONDITIONAL([HAVE_NTOM], [test "x$ntom" = xenabled])
downsample=enabled
AC_ARG_ENABLE(downsample,
[AS_HELP_STRING( [--disable-downsample], [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,
[AS_HELP_STRING( [--disable-feeder], [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,
[AS_HELP_STRING( [--disable-moreinfo], [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,
[AS_HELP_STRING( [--disable-messages], [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
runtimetables=disabled
AC_ARG_ENABLE(runtime-tables,
[AS_HELP_STRING([--enable-runtime-tables], [calculate tables at runtime saving size at the expense of additional computation at load time])],
[
if test "x$enableval" = xyes; then
runtimetables=enabled
fi
]
, [])
if test "x$runtimetables" = "xenabled"; then
AC_DEFINE(RUNTIME_TABLES, 1, [ Define for calculating tables at runtime. ])
fi
AM_CONDITIONAL([HAVE_RUNTIME_TABLES], [test "x$runtimetables" = xenabled] )
newhuff=enabled
AC_ARG_ENABLE(new-huffman,
[AS_HELP_STRING([--disable-new-huffman], [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,
[AS_HELP_STRING([--disable-int-quality], [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
AM_CONDITIONAL([HAVE_ACCURATE], [ test x"$integers" = xquality ])
int16=enabled
AC_ARG_ENABLE(16bit,
[AS_HELP_STRING( [--disable-16bit], [no 16 bit integer output])],
[
if test "x$enableval" = xno; then
int16="disabled"
fi
], [])
int8=enabled
AC_ARG_ENABLE(8bit,
[AS_HELP_STRING( [--disable-8bit], [no 8 bit integer output])],
[
if test "x$enableval" = xno; then
int8="disabled"
fi
], [])
int32=enabled
AC_ARG_ENABLE(32bit,
[AS_HELP_STRING( [--disable-32bit], [no 32 bit integer output (also 24 bit)])],
[
if test "x$enableval" = xno; then
int32="disabled"
fi
], [])
real=enabled
AC_ARG_ENABLE(real,
[AS_HELP_STRING( [--disable-real], [no real (floating point) output])],
[
if test "x$enableval" = xno; then
real="disabled"
fi
], [])
equalizer=enabled
AC_ARG_ENABLE(equalizer,
[AS_HELP_STRING( [--disable-equalizer], [no equalizer support])],
[
if test "x$enableval" = xno; then
equalizer="disabled"
fi
], [])
AC_ARG_WITH([cpu], [AS_HELP_STRING([--with-cpu=<type>], [select CPU optimization. Choices are:])
generic[[_fpu]] Use generic processor code with floating point arithmetic
generic_float Plain alias to generic_fpu now... float output is a normal runtime option!
generic_nofpu Use generic processor code with fixed point arithmetic (p.ex. ARM)
generic_dither Use generic processor code with floating point arithmetic and dithering for 1to1 16bit decoding.
i386[[_fpu]] Use code optimized for i386 processors with floating point arithmetic
i386_nofpu Use code optimized for i386 processors with fixed point arithmetic
i486 Use code optimized for i486 processors (only usable alone!)
i586 Use code optimized for i586 processors
i586_dither Use code optimized for i586 processors with dithering (noise shaping), adds 256K to binary size
3dnow Use code optimized for 3DNow processors
3dnow_vintage Use code optimized for older 3DNow processors (K6 family)
3dnowext Use code optimized for 3DNowExt processors (K6-3+, Athlon)
3dnowext_alone Really only 3DNowExt decoder, without 3DNow fallback for flexible rate
3dnow_vintage Use code optimized for older extended 3DNow processors (like K6-III+)
mmx Use code optimized for MMX processors
mmx_alone Really only MMX decoder, without i586 fallback for flexible rate
sse Use code optimized for SSE processors
sse_vintage Use code optimized for older SSE processors (plain C DCT36)
sse_alone Really only SSE decoder, without i586 fallback for flexible rate
avx Use code optimized for x86-64 with AVX processors
x86 Pack all x86 opts into one binary (excluding i486, including dither)
x86-64 Use code optimized for x86-64 processors (AMD64 and Intel64, including AVX and dithered generic)
altivec Use code optimized for Altivec processors (PowerPC G4 and G5)
ppc_nofpu Use code optimized for PowerPC processors with fixed point arithmetic
neon Use code optimized for ARM NEON SIMD engine (Cortex-A series)
arm_fpu Pack neon and generic[[_dither]] decoders, for ARM processors with FPU and/or NEON
arm_nofpu Use code optimized for ARM processors with fixed point arithmetic
neon64 Use code optimized for AArch64 NEON SIMD engine
aarch64 Pack neon64 and generic[[_dither]] decoders, for 64bit ARM processors
])
use_yasm=auto
AC_ARG_ENABLE(yasm,
[AS_HELP_STRING( [--enable-yasm], [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
], [])
if test x"$use_yasm" = xenabled; then
AC_MSG_ERROR([Yasm for AVX is currently broken and might go away.])
fi
AC_ARG_ENABLE(ieeefloat,
[AS_HELP_STRING( [--disable-ieeefloat], [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,
[AS_HELP_STRING([--disable-cases], [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])],
[
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"
;;