forked from mpv-player/mpv
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure
executable file
·3461 lines (3032 loc) · 87.7 KB
/
configure
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
#! /bin/sh
#
# Original version (C) 2000 Pontscho/fresh!mindworkz
# pontscho@makacs.poliod.hu
#
# History / Contributors: Check the Subversion log.
#
# Cleanups all over the place (c) 2001 pl
#
#
# This configure script is *not* autoconf-based and has different semantics.
# It attempts to autodetect all settings and options where possible. It is
# possible to override autodetection with the --enable-option/--disable-option
# command line parameters. --enable-option forces the option on skipping
# autodetection. Yes, this means that compilation may fail and yes, this is not
# how autoconf-based configure scripts behave.
#
# configure generates a series of configuration files:
# - config.h contains #defines that are used in the C code.
# - config.mak is included from the Makefiles.
#
# If you want to add a new check for $feature, look at the existing checks
# and try to use helper functions where you can.
#
# Furthermore you need to add the variable _feature to the list of default
# settings and set it to one of yes/no/auto. Also add appropriate
# --enable-feature/--disable-feature command line options.
# The results of the check should be written to config.h and config.mak
# at the end of this script. The variable names used for this should be
# uniform, i.e. if the option is named 'feature':
#
# _feature : should have a value of yes/no/auto
# def_feature : '#define ... 1' or '#undef ...' for conditional compilation
# _ld_feature : '-L/path/dir -lfeature' GCC options
#
#############################################################################
# Prevent locale nonsense from breaking basic text processing utils
export LC_ALL=C
# Store the configure line that was used
configuration="$*"
# Prefer these macros to full length text !
# These macros only return an error code - NO display is done
command_check() {
echo >> "$TMPLOG"
echo "$@" >> "$TMPLOG"
"$@" >> "$TMPLOG" 2>&1
TMPRES="$?"
echo >> "$TMPLOG"
return "$TMPRES"
}
compile_check() {
source="$1"
shift
echo >> "$TMPLOG"
cat "$source" >> "$TMPLOG"
echo >> "$TMPLOG"
echo "$_cc $WARNFLAGS $WARN_CFLAGS $CFLAGS $source $extra_cflags $_ld_static $extra_ldflags $libs_mplayer -o $TMPEXE $@" >> "$TMPLOG"
rm -f "$TMPEXE"
$_cc $WARNFLAGS $WARN_CFLAGS $CFLAGS "$source" $extra_cflags $_ld_static $extra_ldflags $libs_mplayer -o "$TMPEXE" "$@" >> "$TMPLOG" 2>&1
TMPRES="$?"
echo >> "$TMPLOG"
echo >> "$TMPLOG"
return "$TMPRES"
}
cc_check() {
compile_check $TMPC $@
}
cxx_check() {
compile_check $TMPCPP $@ -lstdc++
}
cflag_check() {
cat > $TMPC << EOF
int main(void) { return 0; }
EOF
compile_check $TMPC $@
}
header_check() {
cat > $TMPC << EOF
#include <$1>
int main(void) { return 0; }
EOF
shift
compile_check $TMPC $@
}
return_check() {
cat > $TMPC << EOF
#include <$1>
int main(void) { return $2; }
EOF
shift 2
compile_check $TMPC $@
}
statement_check() {
cat > $TMPC << EOF
#include <$1>
int main(void) { $2; return 0; }
EOF
shift
shift
compile_check $TMPC $@
}
define_statement_check() {
cat > $TMPC << EOF
#define $1
#include <$2>
int main(void) { $3; return 0; }
EOF
shift 3
compile_check $TMPC $@
}
return_statement_check() {
cat > $TMPC << EOF
#include <$1>
int main(void) { $2; return $3; }
EOF
shift 3
compile_check $TMPC $@
}
inline_asm_check() {
cat > $TMPC << EOF
int main(void) { __asm__ volatile ($1); return 0; }
EOF
shift
compile_check $TMPC $@
}
# The following checks are special and should only be used with broken and
# non-selfsufficient headers that do not include all of their dependencies.
header_check_broken() {
cat > $TMPC << EOF
#include <$1>
#include <$2>
int main(void) { return 0; }
EOF
shift
shift
compile_check $TMPC $@
}
statement_check_broken() {
cat > $TMPC << EOF
#include <$1>
#include <$2>
int main(void) { $3; return 0; }
EOF
shift 3
compile_check $TMPC $@
}
pkg_config_add() {
unset IFS # shell should not be used for programming
echo >> "$TMPLOG"
echo "$_pkg_config --cflags $@" >> "$TMPLOG"
ctmp=$($_pkg_config --cflags "$@" 2>> "$TMPLOG") || return $?
echo >> "$TMPLOG"
echo "$_pkg_config --libs $@" >> "$TMPLOG"
ltmp=$($_pkg_config --libs "$@" 2>> "$TMPLOG") || return $?
echo >> "$TMPLOG"
echo "cflags: $ctmp" >> "$TMPLOG"
echo "libs: $ltmp" >> "$TMPLOG"
echo >> "$TMPLOG"
extra_cflags="$extra_cflags $ctmp"
libs_mplayer="$libs_mplayer $ltmp"
}
tmp_run() {
"$TMPEXE" >> "$TMPLOG" 2>&1
}
# Display error message, flushes tempfile, exit
die () {
echo
echo "Error: $@" >&2
echo >&2
rm -f "$TMPEXE" "$TMPC" "$TMPS" "$TMPCPP"
echo "Check \"$TMPLOG\" if you do not understand why it failed."
exit 1
}
# OS test booleans functions
issystem() {
test "$(echo $system_name | tr A-Z a-z)" = "$(echo $1 | tr A-Z a-z)"
}
cygwin() { issystem "CYGWIN"; }
darwin() { issystem "Darwin"; }
dragonfly() { issystem "DragonFly"; }
freebsd() { issystem "FreeBSD" || issystem "GNU/kFreeBSD"; }
gnu() { issystem "GNU"; }
linux() { issystem "Linux"; }
mingw32() { issystem "MINGW32"; }
morphos() { issystem "MorphOS"; }
netbsd() { issystem "NetBSD"; }
openbsd() { issystem "OpenBSD"; }
win32() { cygwin || mingw32; }
# arch test boolean functions
x86_32() {
case "$host_arch" in
i[3-9]86|k5|k6|k6-2|k6-3|pentium*|athlon*|i586-i686) return 0 ;;
*) return 1 ;;
esac
}
x86_64() {
case "$host_arch" in
x86_64|amd64) return 0 ;;
*) return 1 ;;
esac
}
x86() {
x86_32 || x86_64
}
ppc() {
case "$host_arch" in
ppc|ppc64|powerpc|powerpc64) return 0;;
*) return 1;;
esac
}
alpha() {
case "$host_arch" in
alpha*) return 0;;
*) return 1;;
esac
}
arm() {
case "$host_arch" in
arm*) return 0;;
*) return 1;;
esac
}
# Use this before starting a check
echocheck() {
echo "============ Checking for $@ ============" >> "$TMPLOG"
echo ${_echo_n} "Checking for $@ ... ${_echo_c}"
}
# Use this to echo the results of a check
echores() {
if test "$res_comment" ; then
res_comment="($res_comment)"
fi
echo "Result is: $@ $res_comment" >> "$TMPLOG"
echo "##########################################" >> "$TMPLOG"
echo "" >> "$TMPLOG"
echo "$@ $res_comment"
res_comment=""
}
#############################################################################
# Check how echo works in this /bin/sh
case $(echo -n) in
-n) _echo_n= _echo_c='\c' ;; # SysV echo
*) _echo_n='-n ' _echo_c= ;; # BSD echo
esac
show_help(){
cat << EOF
Usage: $0 [OPTIONS]...
Configuration:
-h, --help display this help and exit
Installation directories:
--prefix=DIR prefix directory for installation [/usr/local]
--bindir=DIR directory for installing binaries [PREFIX/bin]
--datadir=DIR directory for installing machine independent
data files (skins, etc) [PREFIX/share/mpv]
--mandir=DIR directory for installing man pages [PREFIX/share/man]
--docdir=DIR directory for installing other docs [PREFIX/share/doc]
--confdir=DIR directory for installing configuration files
[PREFIX/etc/mpv]
--localedir=DIR directory for gettext locales [PREFIX/share/locale]
Optional features:
--disable-encoding disable encoding functionality [enable]
--disable-libguess disable libguess [autodetect]
--enable-terminfo use terminfo database for key codes [autodetect]
--enable-termcap use termcap database for key codes [autodetect]
--enable-termios use termios database for key codes [autodetect]
--disable-iconv disable iconv for encoding conversion [autodetect]
--enable-lirc enable LIRC (remote control) support [autodetect]
--enable-lircc enable LIRCCD (LIRC client daemon) input [autodetect]
--enable-joystick enable joystick support [disable]
--disable-vm disable X video mode extensions [autodetect]
--disable-xf86keysym disable support for multimedia keys [autodetect]
--enable-radio enable radio interface [disable]
--enable-radio-capture enable radio capture (through PCI/line-in) [disable]
--disable-radio-v4l2 disable Video4Linux2 radio interface [autodetect]
--disable-tv disable TV interface (TV/DVB grabbers) [enable]
--disable-tv-v4l2 disable Video4Linux2 TV interface [autodetect]
--disable-pvr disable Video4Linux2 MPEG PVR [autodetect]
--enable-smb enable Samba (SMB) input [autodetect]
--disable-libquvi4 disable libquvi 0.4.x [autodetect]
--disable-libquvi9 disable libquvi 0.9.x [autodetect]
--enable-lcms2 enable LCMS2 support [autodetect]
--disable-vcd disable VCD support [autodetect]
--disable-bluray disable Blu-ray support [autodetect]
--disable-dvdread disable libdvdread [autodetect]
--disable-enca disable ENCA charset oracle library [autodetect]
--enable-macosx-bundle enable Mac OS X bundle file locations [disabled]
--disable-pthreads disable Posix threads support [autodetect]
--disable-libass disable subtitle rendering with libass [autodetect]
--disable-libass-osd disable OSD rendering with libass [autodetect]
--enable-rpath enable runtime linker path for extra libs [disabled]
--disable-libpostproc disable postprocess filter (vf_pp) [autodetect]
--disable-libavdevice disable libavdevice demuxers [autodetect]
--disable-libavfilter disable libavfilter [autodetect]
--disable-vf-lavfi disable vf_lavfi libavfilter bridge [audodetect]
--disable-af-lavfi disable af_lavfi libavfilter bridge [audodetect]
Codecs:
--enable-mng enable MNG input support [autodetect]
--enable-jpeg enable JPEG input/output support [autodetect]
--enable-libcdio enable libcdio support [autodetect]
--enable-libav skip Libav autodetection [autodetect]
--disable-ladspa disable LADSPA plugin support [autodetect]
--disable-libbs2b disable libbs2b audio filter support [autodetect]
--disable-mpg123 disable libmpg123 MP3 decoding support [autodetect]
Resampler:
--disable-libavresample check for libswresample only [autodetect]
Video output:
--enable-gl enable OpenGL video output [autodetect]
--enable-caca enable CACA video output [autodetect]
--enable-direct3d enable Direct3D video output [autodetect]
--enable-sdl enable SDL audio output [disable]
--enable-sdl2 enable SDL 2.0+ audio and video output [disable]
--enable-xv enable Xv video output [autodetect]
--enable-vdpau enable VDPAU acceleration [autodetect]
--enable-vda enable VDA acceleration [autodetect]
--enable-vaapi enable VAAPI acceleration [autodetect]
--enable-vm enable XF86VidMode support [autodetect]
--enable-xinerama enable Xinerama support [autodetect]
--enable-x11 enable X11 video output [autodetect]
--enable-wayland enable Wayland video output [autodetect]
--disable-xss disable screensaver support via xss [autodetect]
--disable-corevideo disable CoreVideo video output [autodetect]
--disable-cocoa disable Cocoa OpenGL backend [autodetect]
Audio output:
--disable-alsa disable ALSA audio output [autodetect]
--disable-ossaudio disable OSS audio output [autodetect]
--disable-rsound disable RSound audio output [autodetect]
--disable-pulse disable Pulseaudio audio output [autodetect]
--disable-portaudio disable PortAudio audio output [autodetect]
--disable-jack disable JACK audio output [autodetect]
--enable-openal enable OpenAL audio output [disable]
--disable-coreaudio disable CoreAudio audio output [autodetect]
--disable-dsound disable DirectSound audio output [autodetect]
--disable-wasapi disable WASAPI (event mode) audio output [autodetect]
--disable-select disable using select() on the audio device [enable]
Localization options:
--enable-gettext enable gettext() usage [disable]
Miscellaneous options:
--enable-cross-compile enable cross-compilation [disable]
--cc=COMPILER C compiler to build mpv [gcc]
--pkg-config=PKGCONFIG pkg-config to find some libraries [pkg-config]
--windres=WINDRES windres to build mpv [windres]
--target=PLATFORM target platform (i386-linux, arm-linux, etc)
--enable-static build a statically linked binary
--with-install=PATH path to a custom install program
--disable-manpage do not build and install manpage [auto]
--disable-pdf do not build and install PDF manual [auto]
--disable-build-date do not include binary compile time
Advanced options:
--enable-shm enable shm [autodetect]
--disable-debug compile-in debugging information [enable]
--disable-optimization compile without -O2 [enable]
Use these options if autodetection fails:
--extra-cflags=FLAGS extra CFLAGS
--extra-ldflags=FLAGS extra LDFLAGS
--extra-libs=FLAGS extra linker flags
--extra-libs-mpv=FLAGS extra linker flags for mpv
This configure script is NOT autoconf-based, even though its output is similar.
It will try to autodetect all configuration options. If you --enable an option
it will be forcefully turned on, skipping autodetection. This can break
compilation, so you need to know what you are doing.
EOF
exit 0
} #show_help()
# GOTCHA: the variables below defines the default behavior for autodetection
# and have - unless stated otherwise - at least 2 states : yes no
# If autodetection is available then the third state is: auto
_install=install
_pkg_config=auto
_windres=auto
_cc=auto
test "$CC" && _cc="$CC"
_debug=-g
_opt=-O2
_cross_compile=no
_prefix="/usr/local"
ffmpeg=auto
_encoding=yes
_disable_avresample=no
_x11=auto
_wayland=auto
_xss=auto
_xv=auto
_vdpau=auto
_vda=auto
_vda_refcounting=auto
_vaapi=auto
_direct3d=auto
_sdl=no
_sdl2=no
_dsound=auto
_wasapi=auto
_mng=auto
_jpeg=auto
_gl=auto
_aa=auto
_caca=auto
_dvb=auto
_iconv=auto
_ossaudio=auto
_rsound=auto
_pulse=auto
_portaudio=auto
_jack=auto
_openal=no
_libcdio=auto
_mpg123=auto
_ladspa=auto
_libbs2b=auto
_vcd=auto
_bluray=auto
_dvdread=auto
_lcms2=auto
_xinerama=auto
_vm=auto
_xf86keysym=auto
_alsa=auto
_select=yes
_radio=no
_radio_capture=no
_radio_v4l2=auto
_tv=yes
_tv_v4l2=auto
_pvr=auto
_smb=auto
_libquvi4=auto
_libquvi9=auto
_libguess=auto
_joystick=no
_lirc=auto
_lircc=auto
_terminfo=auto
_termcap=auto
_termios=auto
_shm=auto
_gettext=no
_cdda=auto
_coreaudio=auto
_corevideo=auto
_cocoa=auto
_macosx_bundle=no
_enca=auto
_pthreads=auto
_ass=auto
_libass_osd=auto
_rpath=no
libpostproc=auto
libavfilter=auto
vf_lavfi=auto
af_lavfi=auto
libavdevice=auto
_stream_cache=yes
_priority=no
def_dos_paths="#define HAVE_DOS_PATHS 0"
def_priority="#undef CONFIG_PRIORITY"
_build_man=auto
_build_pdf=auto
_build_date=yes
for ac_option do
case "$ac_option" in
--help|-help|-h)
show_help
;;
--prefix=*)
_prefix=$(echo $ac_option | cut -d '=' -f 2)
;;
--bindir=*)
_bindir=$(echo $ac_option | cut -d '=' -f 2)
;;
--mandir=*)
_mandir=$(echo $ac_option | cut -d '=' -f 2)
;;
--docdir=*)
_docdir=$(echo $ac_option | cut -d '=' -f 2)
;;
--confdir=*)
_confdir=$(echo $ac_option | cut -d '=' -f 2)
;;
--localedir=*)
_localedir=$(echo $ac_option | cut -d '=' -f 2)
;;
--with-install=*)
_install=$(echo $ac_option | cut -d '=' -f 2 )
;;
--extra-cflags=*)
extra_cflags="$extra_cflags $(echo $ac_option | cut -d '=' -f 2-)"
;;
--extra-ldflags=*)
extra_ldflags="$extra_ldflags $(echo $ac_option | cut -d '=' -f 2-)"
;;
--extra-libs=*)
extra_libs=$(echo $ac_option | cut -d '=' -f 2)
;;
--extra-libs-mpv=*)
libs_mplayer=$(echo $ac_option | cut -d '=' -f 2)
;;
--target=*)
_target=$(echo $ac_option | cut -d '=' -f 2)
;;
--cc=*)
_cc=$(echo $ac_option | cut -d '=' -f 2)
;;
--pkg-config=*)
_pkg_config=$(echo $ac_option | cut -d '=' -f 2)
;;
--windres=*)
_windres=$(echo $ac_option | cut -d '=' -f 2)
;;
--enable-static)
_ld_static='-static'
;;
--disable-static)
_ld_static=''
;;
--enable-debug)
_debug='-g'
;;
--enable-debug=*)
_debug=$(echo $_echo_n '-g'$_echo_c; echo $ac_option | cut -d '=' -f 2)
;;
--disable-debug)
_debug=
;;
--enable-optimization)
_opt='-O2'
;;
--enable-optimization=*)
_opt=$(echo $_echo_n '-O'$_echo_c; echo $ac_option | cut -d '=' -f 2)
;;
--disable-optimization)
_opt=
;;
--enable-gettext) _gettext=yes ;;
--disable-gettext) _gettext=no ;;
--enable-cross-compile) _cross_compile=yes ;;
--disable-cross-compile) _cross_compile=no ;;
--enable-encoding) _encoding=yes ;;
--disable-encoding) _encoding=no ;;
--enable-wayland) _wayland=yes ;;
--disable-wayland) _wayland=no ;;
--enable-x11) _x11=yes ;;
--disable-x11) _x11=no ;;
--enable-xss) _xss=yes ;;
--disable-xss) _xss=no ;;
--enable-xv) _xv=yes ;;
--disable-xv) _xv=no ;;
--enable-vdpau) _vdpau=yes ;;
--disable-vdpau) _vdpau=no ;;
--enable-vda) _vda=yes ;;
--disable-vda) _vda=no ;;
--enable-vaapi) _vaapi=yes ;;
--disable-vaapi) _vaapi=no ;;
--enable-direct3d) _direct3d=yes ;;
--disable-direct3d) _direct3d=no ;;
--enable-sdl) _sdl=yes ;;
--disable-sdl) _sdl=no ;;
--enable-sdl2) _sdl2=yes ;;
--disable-sdl2) _sdl2=no ;;
--enable-dsound) _dsound=yes ;;
--disable-dsound) _dsound=no ;;
--enable-wasapi) _wasapi=yes ;;
--disable-wasapi) _wasapi=no ;;
--enable-mng) _mng=yes ;;
--disable-mng) _mng=no ;;
--enable-jpeg) _jpeg=yes ;;
--disable-jpeg) _jpeg=no ;;
--enable-gl) _gl=yes ;;
--disable-gl) _gl=no ;;
--enable-caca) _caca=yes ;;
--disable-caca) _caca=no ;;
--enable-dvb) _dvb=yes ;;
--disable-dvb) _dvb=no ;;
--enable-iconv) _iconv=yes ;;
--disable-iconv) _iconv=no ;;
--enable-ossaudio) _ossaudio=yes ;;
--disable-ossaudio) _ossaudio=no ;;
--enable-rsound) _rsound=yes ;;
--disable-rsound) _rsound=no ;;
--enable-pulse) _pulse=yes ;;
--disable-pulse) _pulse=no ;;
--enable-portaudio) _portaudio=yes ;;
--disable-portaudio) _portaudio=no ;;
--enable-jack) _jack=yes ;;
--disable-jack) _jack=no ;;
--enable-openal) _openal=auto ;;
--disable-openal) _openal=no ;;
--enable-libcdio) _libcdio=yes ;;
--disable-libcdio) _libcdio=no ;;
--enable-mpg123) _mpg123=yes ;;
--disable-mpg123) _mpg123=no ;;
--enable-ladspa) _ladspa=yes ;;
--disable-ladspa) _ladspa=no ;;
--enable-libbs2b) _libbs2b=yes ;;
--disable-libbs2b) _libbs2b=no ;;
--enable-vcd) _vcd=yes ;;
--disable-vcd) _vcd=no ;;
--enable-bluray) _bluray=yes ;;
--disable-bluray) _bluray=no ;;
--enable-dvdread) _dvdread=yes ;;
--disable-dvdread) _dvdread=no ;;
--enable-lcms2) _lcms2=yes ;;
--disable-lcms2) _lcms2=no ;;
--enable-xinerama) _xinerama=yes ;;
--disable-xinerama) _xinerama=no ;;
--enable-vm) _vm=yes ;;
--disable-vm) _vm=no ;;
--enable-xf86keysym) _xf86keysym=yes ;;
--disable-xf86keysym) _xf86keysym=no ;;
--enable-alsa) _alsa=yes ;;
--disable-alsa) _alsa=no ;;
--enable-tv) _tv=yes ;;
--disable-tv) _tv=no ;;
--enable-tv-v4l2) _tv_v4l2=yes ;;
--disable-tv-v4l2) _tv_v4l2=no ;;
--enable-radio) _radio=yes ;;
--enable-radio-capture) _radio_capture=yes ;;
--disable-radio-capture) _radio_capture=no ;;
--disable-radio) _radio=no ;;
--enable-radio-v4l2) _radio_v4l2=yes ;;
--disable-radio-v4l2) _radio_v4l2=no ;;
--enable-pvr) _pvr=yes ;;
--disable-pvr) _pvr=no ;;
--enable-smb) _smb=yes ;;
--disable-smb) _smb=no ;;
--enable-libquvi4) _libquvi4=yes ;;
--disable-libquvi4) _libquvi4=no ;;
--enable-libquvi9) _libquvi9=yes ;;
--disable-libquvi9) _libquvi9=no ;;
--enable-libguess) _libguess=yes ;;
--disable-libguess) _libguess=no ;;
--enable-joystick) _joystick=yes ;;
--disable-joystick) _joystick=no ;;
--enable-libav) ffmpeg=yes ;;
--disable-libavresample) _disable_avresample=yes ;;
--enable-libavresample) _disable_avresample=no ;;
--enable-lirc) _lirc=yes ;;
--disable-lirc) _lirc=no ;;
--enable-lircc) _lircc=yes ;;
--disable-lircc) _lircc=no ;;
--enable-terminfo) _terminfo=yes ;;
--disable-terminfo) _terminfo=no ;;
--enable-termcap) _termcap=yes ;;
--disable-termcap) _termcap=no ;;
--enable-termios) _termios=yes ;;
--disable-termios) _termios=no ;;
--enable-shm) _shm=yes ;;
--disable-shm) _shm=no ;;
--enable-select) _select=yes ;;
--disable-select) _select=no ;;
--enable-pthreads) _pthreads=yes ;;
--disable-pthreads) _pthreads=no ;;
--enable-libass) _ass=yes ;;
--disable-libass) _ass=no ;;
--enable-libass-osd) _libass_osd=yes ;;
--disable-libass-osd) _libass_osd=no ;;
--enable-rpath) _rpath=yes ;;
--disable-rpath) _rpath=no ;;
--enable-libpostproc) libpostproc=yes ;;
--disable-libpostproc) libpostproc=no ;;
--enable-libavdevice) libavdevice=auto ;;
--disable-libavdevice) libavdevice=no ;;
--enable-libavfilter) libavfilter=auto ;;
--disable-libavfilter) libavfilter=no ;;
--enable-vf-lavfi) vf_lavfi=auto ;;
--disable-vf-lavfi) vf_lavfi=no ;;
--enable-af-lavfi) af_lavfi=auto ;;
--disable-af-lavfi) af_lavfi=no ;;
--enable-enca) _enca=yes ;;
--disable-enca) _enca=no ;;
--enable-coreaudio) _coreaudio=yes ;;
--disable-coreaudio) _coreaudio=no ;;
--enable-corevideo) _corevideo=yes ;;
--disable-corevideo) _corevideo=no ;;
--enable-cocoa) _cocoa=yes ;;
--disable-cocoa) _cocoa=no ;;
--enable-macosx-bundle) _macosx_bundle=yes ;;
--enable-manpage) _build_man=yes ;;
--disable-manpage) _build_man=no ;;
--enable-pdf) _build_pdf=yes ;;
--disable-pdf) _build_pdf=no ;;
--enable-build-date) _build_date=yes ;;
--disable-build-date) _build_date=no ;;
*)
echo "Unknown parameter: $ac_option" >&2
exit 1
;;
esac
done
# Atmos: moved this here, to be correct, if --prefix is specified
test -z "$_bindir" && _bindir="$_prefix/bin"
test -z "$_mandir" && _mandir="$_prefix/share/man"
test -z "$_docdir" && _docdir="$_prefix/share/doc"
test -z "$_confdir" && _confdir="$_prefix/etc/mpv"
test -z "$_localedir" && _localedir="$_prefix/share/locale"
for tmpdir in "$TMPDIR" "$TEMPDIR" "/tmp" ; do
test "$tmpdir" && break
done
mplayer_tmpdir="$tmpdir/mpv-configure-$RANDOM-$$"
mkdir $mplayer_tmpdir || die "Unable to create tmpdir."
TMPLOG="config.log"
rm -f "$TMPLOG"
echo Parameters configure was run with: > "$TMPLOG"
if test -n "$CFLAGS" ; then
echo ${_echo_n} CFLAGS="'$CFLAGS' ${_echo_c}" >> "$TMPLOG"
fi
if test -n "$PKG_CONFIG_PATH" ; then
echo ${_echo_n} PKG_CONFIG_PATH="'$PKG_CONFIG_PATH' ${_echo_c}" >> "$TMPLOG"
fi
echo ./configure $configuration >> "$TMPLOG"
echo >> "$TMPLOG"
echocheck "cross compilation"
echores $_cross_compile
if test $_cross_compile = yes; then
tmp_run() {
return 0
}
fi
tool_prefix=""
if test $_cross_compile = yes ; then
# Usually cross-compiler prefixes match with the target triplet
test -n "$_target" && tool_prefix="$_target"-
fi
test "$_windres" = auto && _windres="$tool_prefix"windres
test "$_pkg_config" = auto && _pkg_config="$tool_prefix"pkg-config
if test "$_cc" = auto ; then
if test -n "$tool_prefix" ; then
_cc="$tool_prefix"gcc
else
_cc=cc
fi
fi
# Determine our OS name and CPU architecture
if test -z "$_target" ; then
# OS name
system_name=$(uname -s 2>&1)
case "$system_name" in
Linux|FreeBSD|NetBSD|OpenBSD|DragonFly|Darwin|GNU|MorphOS)
;;
Haiku)
system_name=Haiku
;;
GNU/kFreeBSD)
system_name=FreeBSD
;;
[cC][yY][gG][wW][iI][nN]*)
system_name=CYGWIN
;;
MINGW32*)
system_name=MINGW32
;;
*)
system_name="$system_name-UNKNOWN"
;;
esac
# host's CPU/instruction set
host_arch=$(uname -p 2>&1)
case "$host_arch" in
i386|sparc|ppc|alpha|arm|mips|vax)
;;
powerpc) # Darwin returns 'powerpc'
host_arch=ppc
;;
*) # uname -p on Linux returns 'unknown' for the processor type,
# OpenBSD returns 'Intel Pentium/MMX ("Genuine Intel" 586-class)'
# Maybe uname -m (machine hardware name) returns something we
# recognize.
case "$(uname -m 2>&1)" in
x86_64|amd64|i[3-9]86*|k5|k6|k6_2|k6_3|k6-2|k6-3|pentium*|athlon*|i586_i686|i586-i686|BePC) host_arch=i386 ;;
ia64) host_arch=ia64 ;;
macppc|ppc) host_arch=ppc ;;
ppc64) host_arch=ppc64 ;;
alpha) host_arch=alpha ;;
sparc) host_arch=sparc ;;
sparc64) host_arch=sparc64 ;;
parisc*|hppa*|9000*) host_arch=hppa ;;
arm*|zaurus|cats) host_arch=arm ;;
sh3|sh4|sh4a) host_arch=sh ;;
s390) host_arch=s390 ;;
s390x) host_arch=s390x ;;
*mips*) host_arch=mips ;;
vax) host_arch=vax ;;
xtensa*) host_arch=xtensa ;;
*) host_arch=UNKNOWN ;;
esac
;;
esac
else # if test -z "$_target"
for i in 2 3; do
system_name=$(echo $_target | cut -d '-' -f $i)
case "$(echo $system_name | tr A-Z a-z)" in
linux) system_name=Linux ;;
freebsd) system_name=FreeBSD ;;
gnu/kfreebsd) system_name=FreeBSD ;;
netbsd) system_name=NetBSD ;;
openbsd) system_name=OpenBSD ;;
dragonfly) system_name=DragonFly ;;
morphos) system_name=MorphOS ;;
mingw32*) system_name=MINGW32 ;;
*) continue ;;
esac
break
done
# We need to convert underscores so that values like k6-2 and pentium-mmx can be passed
host_arch=$(echo $_target | cut -d '-' -f 1)
if test $(echo $host_arch) != "x86_64" ; then
host_arch=$(echo $host_arch | tr '_' '-')
fi
fi
extra_cflags="-I. -D_GNU_SOURCE $extra_cflags"
_timer=timer-linux.c
_getch=getch2.c
if freebsd ; then
extra_ldflags="$extra_ldflags -L/usr/local/lib"
extra_cflags="$extra_cflags -I/usr/local/include"
fi
if netbsd || dragonfly ; then
extra_ldflags="$extra_ldflags -L/usr/pkg/lib"
extra_cflags="$extra_cflags -I/usr/pkg/include"
fi
if darwin; then
extra_cflags="-mdynamic-no-pic $extra_cflags"
_timer=timer-darwin.c
fi
_win32=no
if win32 ; then
_win32=yes
_exesuf=".exe"
extra_cflags="$extra_cflags -fno-common"
# -lwinmm is always needed for osdep/timer-win2.c
libs_mplayer="$libs_mplayer -lwinmm"
_pe_executable=yes
_timer=timer-win2.c
_priority=yes
def_dos_paths="#define HAVE_DOS_PATHS 1"
def_priority="#define CONFIG_PRIORITY 1"
fi
if mingw32 ; then
_getch=getch2-win.c
extra_cflags="$extra_cflags -D__USE_MINGW_ANSI_STDIO=1"
# Hack for missing BYTE_ORDER declarations in <sys/types.h>.
# (For some reason, they are in <sys/param.h>, but we don't bother switching
# the includes based on whether we're compiling for MinGW.)
extra_cflags="$extra_cflags -DBYTE_ORDER=1234 -DLITTLE_ENDIAN=1234 -DBIG_ENDIAN=4321"
fi
if cygwin ; then
extra_cflags="$extra_cflags -mwin32"
fi
_rst2man=rst2man
if [ -f "$(which rst2man.py)" ] ; then
_rst2man=rst2man.py
fi
echocheck "whether to build manpages with rst2man"
if test "$_build_man" = auto ; then
_build_man=no
command_check "$_rst2man" --version && _build_man=yes
else
_build_man=no
fi
echores "$_build_man"
_rst2latex=rst2latex
if [ -f "$(which rst2latex.py)" ] ; then
_rst2latex=rst2latex.py
fi
echocheck "whether to build manual PDFs with rst2latex"
if test "$_build_pdf" = auto ; then
_build_pdf=no
command_check "$_rst2latex" --version &&
command_check pdflatex -version && _build_pdf=yes
else
_build_pdf=no
fi
echores "$_build_pdf"
echocheck "whether to print binary build date"
if test "$_build_date" = yes ; then
_build_yes=yes
else
_build_date=no
extra_cflags="$extra_cflags -DNO_BUILD_TIMESTAMPS"
fi
echores "$_build_date"
TMPC="$mplayer_tmpdir/tmp.c"
TMPCPP="$mplayer_tmpdir/tmp.cpp"
TMPEXE="$mplayer_tmpdir/tmp$_exesuf"
TMPH="$mplayer_tmpdir/tmp.h"
TMPS="$mplayer_tmpdir/tmp.S"
# Checking CC version...
# Intel C++ Compilers (no autoselect, use CC=/some/binary ./configure)
if test "$(basename $_cc)" = "icc" || test "$(basename $_cc)" = "ecc"; then
echocheck "$_cc version"
cc_vendor=intel
cc_name=$($_cc -V 2>&1 | head -n 1 | cut -d ',' -f 1)
cc_version=$($_cc -V 2>&1 | head -n 1 | cut -d ',' -f 2 | cut -d ' ' -f 3)
_cc_major=$(echo $cc_version | cut -d '.' -f 1)
_cc_minor=$(echo $cc_version | cut -d '.' -f 2)
# TODO verify older icc/ecc compatibility
case $cc_version in
'')
cc_version="v. ?.??, bad"
cc_fail=yes
;;
10.1|11.0|11.1)
cc_version="$cc_version, ok"
;;
*)
cc_version="$cc_version, bad"
cc_fail=yes
;;
esac
echores "$cc_version"
else
for _cc in "$_cc" gcc cc ; do
cc_name_tmp=$($_cc -v 2>&1 | tail -n 1 | cut -d ' ' -f 1)
if test "$cc_name_tmp" = "gcc"; then
cc_name=$cc_name_tmp