mixer: fix lowering hw volume while muted
[mplayer.git] / configure
blob0672fbb74e399ea2d866c31fd2c18d685cc28c07
1 #! /bin/sh
3 # Original version (C) 2000 Pontscho/fresh!mindworkz
4 # pontscho@makacs.poliod.hu
6 # History / Contributors: Check the Subversion log.
8 # Cleanups all over the place (c) 2001 pl
11 # This configure script is *not* autoconf-based and has different semantics.
12 # It attempts to autodetect all settings and options where possible. It is
13 # possible to override autodetection with the --enable-option/--disable-option
14 # command line parameters. --enable-option forces the option on skipping
15 # autodetection. Yes, this means that compilation may fail and yes, this is not
16 # how autoconf-based configure scripts behave.
18 # configure generates a series of configuration files:
19 # - config.h contains #defines that are used in the C code.
20 # - config.mak is included from the Makefiles.
22 # If you want to add a new check for $feature, look at the existing checks
23 # and try to use helper functions where you can.
25 # Furthermore you need to add the variable _feature to the list of default
26 # settings and set it to one of yes/no/auto. Also add appropriate
27 # --enable-feature/--disable-feature command line options.
28 # The results of the check should be written to config.h and config.mak
29 # at the end of this script. The variable names used for this should be
30 # uniform, i.e. if the option is named 'feature':
32 # _feature : should have a value of yes/no/auto
33 # def_feature : '#define ... 1' or '#undef ...' for conditional compilation
34 # _ld_feature : '-L/path/dir -lfeature' GCC options
36 #############################################################################
38 # Prevent locale nonsense from breaking basic text processing utils
39 export LC_ALL=C
41 # Store the configure line that was used
42 configuration="$*"
44 # Prefer these macros to full length text !
45 # These macros only return an error code - NO display is done
46 compile_check() {
47 source="$1"
48 shift
49 echo >> "$TMPLOG"
50 cat "$source" >> "$TMPLOG"
51 echo >> "$TMPLOG"
52 echo "$_cc $WARNFLAGS $WARN_CFLAGS $CFLAGS $source $extra_cflags $_ld_static $extra_ldflags $libs_mplayer -o $TMPEXE $@" >> "$TMPLOG"
53 rm -f "$TMPEXE"
54 $_cc $WARNFLAGS $WARN_CFLAGS $CFLAGS "$source" $extra_cflags $_ld_static $extra_ldflags $libs_mplayer -o "$TMPEXE" "$@" >> "$TMPLOG" 2>&1
55 TMPRES="$?"
56 echo >> "$TMPLOG"
57 echo >> "$TMPLOG"
58 return "$TMPRES"
61 cc_check() {
62 compile_check $TMPC $@
65 cflag_check() {
66 cat > $TMPC << EOF
67 int main(void) { return 0; }
68 EOF
69 compile_check $TMPC $@
72 header_check() {
73 cat > $TMPC << EOF
74 #include <$1>
75 int main(void) { return 0; }
76 EOF
77 shift
78 compile_check $TMPC $@
81 return_check() {
82 cat > $TMPC << EOF
83 #include <$1>
84 int main(void) { return $2; }
85 EOF
86 shift 2
87 compile_check $TMPC $@
90 statement_check() {
91 cat > $TMPC << EOF
92 #include <$1>
93 int main(void) { $2; return 0; }
94 EOF
95 shift
96 shift
97 compile_check $TMPC $@
100 define_statement_check() {
101 cat > $TMPC << EOF
102 #define $1
103 #include <$2>
104 int main(void) { $3; return 0; }
106 shift 3
107 compile_check $TMPC $@
110 return_statement_check() {
111 cat > $TMPC << EOF
112 #include <$1>
113 int main(void) { $2; return $3; }
115 shift 3
116 compile_check $TMPC $@
119 inline_asm_check() {
120 cat > $TMPC << EOF
121 int main(void) { __asm__ volatile ($1); return 0; }
123 shift
124 compile_check $TMPC $@
127 # The following checks are special and should only be used with broken and
128 # non-selfsufficient headers that do not include all of their dependencies.
130 header_check_broken() {
131 cat > $TMPC << EOF
132 #include <$1>
133 #include <$2>
134 int main(void) { return 0; }
136 shift
137 shift
138 compile_check $TMPC $@
141 statement_check_broken() {
142 cat > $TMPC << EOF
143 #include <$1>
144 #include <$2>
145 int main(void) { $3; return 0; }
147 shift 3
148 compile_check $TMPC $@
151 yasm_check() {
152 echo >> "$TMPLOG"
153 cat "$TMPS" >> "$TMPLOG"
154 echo >> "$TMPLOG"
155 echo "$_yasm $YASMFLAGS -o $TMPEXE $TMPS $@" >> "$TMPLOG"
156 rm -f "$TMPEXE"
157 $_yasm $YASMFLAGS -o "$TMPEXE" "$TMPS" "$@" >> "$TMPLOG" 2>&1
158 TMPRES="$?"
159 echo >> "$TMPLOG"
160 echo >> "$TMPLOG"
161 return "$TMPRES"
164 pkg_config_add() {
165 unset IFS # shell should not be used for programming
166 echo >> "$TMPLOG"
167 echo "$_pkg_config --cflags $@" >> "$TMPLOG"
168 ctmp=$($_pkg_config --cflags "$@" 2>> "$TMPLOG") || return $?
169 echo >> "$TMPLOG"
170 echo "$_pkg_config --libs $@" >> "$TMPLOG"
171 ltmp=$($_pkg_config --libs "$@" 2>> "$TMPLOG") || return $?
172 echo >> "$TMPLOG"
173 echo "cflags: $ctmp" >> "$TMPLOG"
174 echo "libs: $ltmp" >> "$TMPLOG"
175 echo >> "$TMPLOG"
176 extra_cflags="$extra_cflags $ctmp"
177 extra_ldflags="$extra_ldflags $ltmp"
180 tmp_run() {
181 "$TMPEXE" >> "$TMPLOG" 2>&1
184 # Display error message, flushes tempfile, exit
185 die () {
186 echo
187 echo "Error: $@" >&2
188 echo >&2
189 rm -f "$TMPEXE" "$TMPC" "$TMPS"
190 echo "Check \"$TMPLOG\" if you do not understand why it failed."
191 exit 1
194 # OS test booleans functions
195 issystem() {
196 test "$(echo $system_name | tr A-Z a-z)" = "$(echo $1 | tr A-Z a-z)"
198 aix() { issystem "AIX"; }
199 amigaos() { issystem "AmigaOS"; }
200 beos() { issystem "BEOS"; }
201 bsdos() { issystem "BSD/OS"; }
202 cygwin() { issystem "CYGWIN"; }
203 darwin() { issystem "Darwin"; }
204 dragonfly() { issystem "DragonFly"; }
205 freebsd() { issystem "FreeBSD" || issystem "GNU/kFreeBSD"; }
206 gnu() { issystem "GNU"; }
207 hpux() { issystem "HP-UX"; }
208 linux() { issystem "Linux"; }
209 mingw32() { issystem "MINGW32"; }
210 morphos() { issystem "MorphOS"; }
211 netbsd() { issystem "NetBSD"; }
212 openbsd() { issystem "OpenBSD"; }
213 qnx() { issystem "QNX"; }
214 win32() { cygwin || mingw32; }
216 # arch test boolean functions
217 # x86/x86pc is used by QNX
218 x86_32() {
219 case "$host_arch" in
220 i[3-9]86|x86|x86pc|k5|k6|k6-2|k6-3|pentium*|athlon*|i586-i686) return 0 ;;
221 *) return 1 ;;
222 esac
225 x86_64() {
226 case "$host_arch" in
227 x86_64|amd64) return 0 ;;
228 *) return 1 ;;
229 esac
232 x86() {
233 x86_32 || x86_64
236 ppc() {
237 case "$host_arch" in
238 ppc|ppc64|powerpc|powerpc64) return 0;;
239 *) return 1;;
240 esac
243 alpha() {
244 case "$host_arch" in
245 alpha*) return 0;;
246 *) return 1;;
247 esac
250 arm() {
251 case "$host_arch" in
252 arm*) return 0;;
253 *) return 1;;
254 esac
257 # Use this before starting a check
258 echocheck() {
259 echo "============ Checking for $@ ============" >> "$TMPLOG"
260 echo ${_echo_n} "Checking for $@ ... ${_echo_c}"
263 # Use this to echo the results of a check
264 echores() {
265 if test "$res_comment" ; then
266 res_comment="($res_comment)"
268 echo "Result is: $@ $res_comment" >> "$TMPLOG"
269 echo "##########################################" >> "$TMPLOG"
270 echo "" >> "$TMPLOG"
271 echo "$@ $res_comment"
272 res_comment=""
274 #############################################################################
276 # Check how echo works in this /bin/sh
277 case $(echo -n) in
278 -n) _echo_n= _echo_c='\c' ;; # SysV echo
279 *) _echo_n='-n ' _echo_c= ;; # BSD echo
280 esac
282 msg_lang_all=''
283 ls po/*.po >/dev/null 2>&1 && msg_lang_all=$(echo po/*.po | sed -e 's:po/\([^[:space:]]*\)\.po:\1:g')
284 man_lang_all=$(echo DOCS/man/??/mplayer.1 DOCS/man/??_??/mplayer.1 | sed -e "s:DOCS/man/\(..\)/mplayer.1:\1:g" -e "s:DOCS/man/\(.._..\)/mplayer.1:\1:g")
285 doc_lang_all=$(echo DOCS/xml/??/ DOCS/xml/??_??/ | sed -e "s:DOCS/xml/\(..\)/:\1:g" -e "s:DOCS/xml/\(.._..\)/:\1:g")
287 show_help(){
288 cat << EOF
289 Usage: $0 [OPTIONS]...
291 Configuration:
292 -h, --help display this help and exit
294 Installation directories:
295 --prefix=DIR prefix directory for installation [/usr/local]
296 --bindir=DIR directory for installing binaries [PREFIX/bin]
297 --datadir=DIR directory for installing machine independent
298 data files (skins, etc) [PREFIX/share/mplayer]
299 --mandir=DIR directory for installing man pages [PREFIX/share/man]
300 --confdir=DIR directory for installing configuration files
301 [PREFIX/etc/mplayer]
302 --localedir=DIR directory for locale tree [PREFIX/share/locale]
303 --libdir=DIR directory for object code libraries [PREFIX/lib]
304 --codecsdir=DIR directory for binary codecs [LIBDIR/codecs]
306 Optional features:
307 --disable-mplayer disable MPlayer compilation [enable]
308 --enable-termcap use termcap database for key codes [autodetect]
309 --enable-termios use termios database for key codes [autodetect]
310 --disable-iconv disable iconv for encoding conversion [autodetect]
311 --disable-langinfo do not use langinfo [autodetect]
312 --enable-lirc enable LIRC (remote control) support [autodetect]
313 --enable-lircc enable LIRCCD (LIRC client daemon) input [autodetect]
314 --enable-joystick enable joystick support [disable]
315 --enable-apple-remote enable Apple Remote input (Mac OS X only) [autodetect]
316 --enable-apple-ir enable Apple IR Remote input (Linux only) [autodetect]
317 --disable-vm disable X video mode extensions [autodetect]
318 --disable-xf86keysym disable support for multimedia keys [autodetect]
319 --enable-radio enable radio interface [disable]
320 --enable-radio-capture enable radio capture (through PCI/line-in) [disable]
321 --disable-radio-v4l2 disable Video4Linux2 radio interface [autodetect]
322 --disable-radio-bsdbt848 disable BSD BT848 radio interface [autodetect]
323 --disable-tv disable TV interface (TV/DVB grabbers) [enable]
324 --disable-tv-v4l1 disable Video4Linux TV interface [autodetect]
325 --disable-tv-v4l2 disable Video4Linux2 TV interface [autodetect]
326 --disable-tv-bsdbt848 disable BSD BT848 interface [autodetect]
327 --disable-pvr disable Video4Linux2 MPEG PVR [autodetect]
328 --disable-rtc disable RTC (/dev/rtc) on Linux [autodetect]
329 --disable-networking disable networking [enable]
330 --enable-winsock2_h enable winsock2_h [autodetect]
331 --enable-smb enable Samba (SMB) input [autodetect]
332 --enable-libquvi enable libquvi [autodetect]
333 --enable-lcms2 enable LCMS2 support [autodetect]
334 --disable-vcd disable VCD support [autodetect]
335 --disable-bluray disable Blu-ray support [autodetect]
336 --disable-dvdnav disable libdvdnav [autodetect]
337 --disable-dvdread disable libdvdread [autodetect]
338 --disable-dvdread-internal disable internal libdvdread [autodetect]
339 --disable-libdvdcss-internal disable internal libdvdcss [autodetect]
340 --disable-cddb disable cddb [autodetect]
341 --disable-unrarexec disable using of UnRAR executable [enabled]
342 --disable-sortsub disable subtitle sorting [enabled]
343 --disable-enca disable ENCA charset oracle library [autodetect]
344 --enable-macosx-finder enable Mac OS X Finder invocation parameter
345 parsing [disabled]
346 --enable-macosx-bundle enable Mac OS X bundle file locations [autodetect]
347 --disable-inet6 disable IPv6 support [autodetect]
348 --disable-gethostbyname2 gethostbyname2 part of the C library [autodetect]
349 --disable-ftp disable FTP support [enabled]
350 --disable-vstream disable TiVo vstream client support [autodetect]
351 --disable-pthreads disable Posix threads support [autodetect]
352 --disable-w32threads disable Win32 threads support [autodetect]
353 --disable-libass disable subtitle rendering with libass [autodetect]
354 --enable-rpath enable runtime linker path for extra libs [disabled]
355 --disable-libpostproc disable postprocess filter (vf_pp) [autodetect]
356 --disable-libavresample disable libavresample (sample format conversion) [autodetect]
358 Codecs:
359 --enable-gif enable GIF support [autodetect]
360 --enable-png enable PNG input/output support [autodetect]
361 --enable-mng enable MNG input support [autodetect]
362 --enable-jpeg enable JPEG input/output support [autodetect]
363 --enable-libcdio enable libcdio support [autodetect]
364 --disable-win32dll disable Win32 DLL support [autodetect]
365 --disable-qtx disable QuickTime codecs support [enabled]
366 --disable-xanim disable XAnim codecs support [enabled]
367 --disable-real disable RealPlayer codecs support [enabled]
368 --disable-xvid disable Xvid [autodetect]
369 --disable-libnut disable libnut [autodetect]
370 --enable-libav skip Libav autodetection [autodetect]
371 --disable-libvorbis disable libvorbis support [autodetect]
372 --disable-tremor disable Tremor [autodetect if no libvorbis]
373 --disable-speex disable Speex support [autodetect]
374 --enable-theora enable OggTheora libraries [autodetect]
375 --enable-faad enable FAAD2 (AAC) [autodetect]
376 --disable-ladspa disable LADSPA plugin support [autodetect]
377 --disable-libbs2b disable libbs2b audio filter support [autodetect]
378 --disable-libdv disable libdv 0.9.5 en/decoding support [autodetect]
379 --disable-mpg123 disable libmpg123 MP3 decoding support [autodetect]
380 --disable-mad disable libmad (MPEG audio) support [autodetect]
381 --enable-xmms enable XMMS input plugin support [disabled]
382 --enable-libdca enable libdca support [autodetect]
383 --disable-liba52 disable liba52 [autodetect]
384 --enable-musepack enable libmpcdec support (deprecated, libavcodec
385 Musepack decoder is preferred) [disabled]
387 Video output:
388 --enable-gl enable OpenGL video output [autodetect]
389 --enable-sdl enable SDL video output [autodetect]
390 --enable-caca enable CACA video output [autodetect]
391 --enable-direct3d enable Direct3D video output [autodetect]
392 --enable-directx enable DirectX video output [autodetect]
393 --enable-v4l2 enable V4L2 Decoder audio/video output [autodetect]
394 --enable-dvb enable DVB video input [autodetect]
395 --enable-xv enable Xv video output [autodetect]
396 --enable-vdpau enable VDPAU acceleration [autodetect]
397 --enable-vm enable XF86VidMode support [autodetect]
398 --enable-xinerama enable Xinerama support [autodetect]
399 --enable-x11 enable X11 video output [autodetect]
400 --enable-xshape enable XShape support [autodetect]
401 --disable-xss disable screensaver support via xss [autodetect]
402 --enable-directfb enable DirectFB video output [autodetect]
403 --disable-tga disable Targa video output [enable]
404 --disable-pnm disable PNM video output [enable]
405 --disable-md5sum disable md5sum video output [enable]
406 --disable-yuv4mpeg disable yuv4mpeg video output [enable]
407 --disable-corevideo disable CoreVideo video output [autodetect]
408 --disable-cocoa disable Cocoa OpenGL backend [autodetect]
409 --disable-sharedbuffer disable OSX shared buffer video output [autodetect]
411 Audio output:
412 --disable-alsa disable ALSA audio output [autodetect]
413 --disable-ossaudio disable OSS audio output [autodetect]
414 --disable-rsound disable RSound audio output [autodetect]
415 --disable-pulse disable Pulseaudio audio output [autodetect]
416 --disable-portaudio disable PortAudio audio output [autodetect]
417 --disable-jack disable JACK audio output [autodetect]
418 --enable-openal enable OpenAL audio output [disable]
419 --disable-coreaudio disable CoreAudio audio output [autodetect]
420 --disable-select disable using select() on the audio device [enable]
422 Language options:
423 --enable-translation enable support for translated output [disable]
424 --charset=charset convert the console messages to this character set
425 --language-doc=lang language to use for the documentation [en]
426 --language-man=lang language to use for the man pages [en]
427 --language-msg=lang extra languages for program messages [all]
428 --language=lang default language to use [en]
429 Specific options override --language. You can pass a list of languages separated
430 by whitespace or commas instead of a single language. Nonexisting translations
431 will be dropped from each list. All translations available in the list will be
432 installed. The value "all" will activate all translations. The LINGUAS
433 environment variable is honored. In all cases the fallback is English.
434 The program always supports English-language output; additional message
435 languages are only installed if --enable-translation is also specified.
436 Available values for --language-doc are: all $doc_lang_all
437 Available values for --language-man are: all $man_lang_all
438 Available values for --language-msg are: all $msg_lang_all
440 Miscellaneous options:
441 --enable-runtime-cpudetection enable runtime CPU detection [disable]
442 --enable-cross-compile enable cross-compilation [disable]
443 --cc=COMPILER C compiler to build MPlayer [gcc]
444 --as=ASSEMBLER assembler to build MPlayer [as]
445 --nm=NM nm tool to build MPlayer [nm]
446 --yasm=YASM Yasm assembler to build MPlayer [yasm]
447 --ar=AR librarian to build MPlayer [ar]
448 --pkg-config=PKGCONFIG pkg-config to find some libraries [pkg-config]
449 --ranlib=RANLIB ranlib to build MPlayer [ranlib]
450 --windres=WINDRES windres to build MPlayer [windres]
451 --target=PLATFORM target platform (i386-linux, arm-linux, etc)
452 --enable-static build a statically linked binary
453 --with-install=PATH path to a custom install program
455 Advanced options:
456 --enable-mmx enable MMX [autodetect]
457 --enable-mmxext enable MMX2 (Pentium III, Athlon) [autodetect]
458 --enable-3dnow enable 3DNow! [autodetect]
459 --enable-3dnowext enable extended 3DNow! [autodetect]
460 --enable-sse enable SSE [autodetect]
461 --enable-sse2 enable SSE2 [autodetect]
462 --enable-ssse3 enable SSSE3 [autodetect]
463 --enable-shm enable shm [autodetect]
464 --enable-altivec enable AltiVec (PowerPC) [autodetect]
465 --enable-armv5te enable DSP extensions (ARM) [autodetect]
466 --enable-armv6 enable ARMv6 (ARM) [autodetect]
467 --enable-armv6t2 enable ARMv6t2 (ARM) [autodetect]
468 --enable-armvfp enable ARM VFP (ARM) [autodetect]
469 --enable-neon enable NEON (ARM) [autodetect]
470 --enable-iwmmxt enable iWMMXt (ARM) [autodetect]
471 --disable-fastmemcpy disable 3DNow!/SSE/MMX optimized memcpy [enable]
472 --enable-big-endian force byte order to big-endian [autodetect]
473 --enable-debug[=1-3] compile-in debugging information [disable]
474 --enable-profile compile-in profiling information [disable]
475 --disable-sighandler disable sighandler for crashes [enable]
476 --enable-crash-debug enable automatic gdb attach on crash [disable]
478 Use these options if autodetection fails:
479 --extra-cflags=FLAGS extra CFLAGS
480 --extra-ldflags=FLAGS extra LDFLAGS
481 --extra-libs=FLAGS extra linker flags
482 --extra-libs-mplayer=FLAGS extra linker flags for MPlayer
484 --with-sdl-config=PATH path to sdl*-config
485 --with-dvdnav-config=PATH path to dvdnav-config
486 --with-dvdread-config=PATH path to dvdread-config
488 This configure script is NOT autoconf-based, even though its output is similar.
489 It will try to autodetect all configuration options. If you --enable an option
490 it will be forcefully turned on, skipping autodetection. This can break
491 compilation, so you need to know what you are doing.
493 exit 0
494 } #show_help()
496 # GOTCHA: the variables below defines the default behavior for autodetection
497 # and have - unless stated otherwise - at least 2 states : yes no
498 # If autodetection is available then the third state is: auto
499 _mmx=auto
500 _3dnow=auto
501 _3dnowext=auto
502 _mmxext=auto
503 _sse=auto
504 _sse2=auto
505 _ssse3=auto
506 _cmov=auto
507 _fast_cmov=auto
508 _fast_clz=auto
509 _armv5te=auto
510 _armv6=auto
511 _armv6t2=auto
512 _armvfp=auto
513 neon=auto
514 _iwmmxt=auto
515 _altivec=auto
516 _install=install
517 _pkg_config=auto
518 _ranlib=auto
519 _windres=auto
520 _cc=auto
521 _ar=auto
522 test "$CC" && _cc="$CC"
523 _as=auto
524 _nm=auto
525 _yasm=auto
526 _runtime_cpudetection=no
527 _cross_compile=no
528 _prefix="/usr/local"
529 ffmpeg=auto
530 ffmpeg_internals=no
531 _x11=auto
532 _xshape=auto
533 _xss=auto
534 _xv=auto
535 _vdpau=auto
536 _sdl=auto
537 _direct3d=auto
538 _directx=auto
539 _nas=auto
540 _png=auto
541 _mng=auto
542 _jpeg=auto
543 _pnm=yes
544 _md5sum=yes
545 _yuv4mpeg=yes
546 _gif=auto
547 _gl=auto
548 _aa=auto
549 _caca=auto
550 _dvb=auto
551 _v4l2=auto
552 _iconv=auto
553 _langinfo=auto
554 _rtc=auto
555 _ossaudio=auto
556 _rsound=auto
557 _pulse=auto
558 _portaudio=auto
559 _jack=auto
560 _openal=no
561 _libcdio=auto
562 _mad=auto
563 _tremor=auto
564 _libvorbis=auto
565 _speex=auto
566 _theora=auto
567 _mpg123=auto
568 _liba52=auto
569 _libdca=auto
570 _faad=auto
571 _ladspa=auto
572 _libbs2b=auto
573 _xmms=no
574 _vcd=auto
575 _bluray=auto
576 _dvdnav=auto
577 _dvdnavconfig=dvdnav-config
578 _dvdreadconfig=dvdread-config
579 _dvdread=auto
580 _dvdread_internal=auto
581 _libdvdcss_internal=auto
582 _xanim=auto
583 _real=auto
584 _lcms2=auto
585 _xinerama=auto
586 _vm=auto
587 _xf86keysym=auto
588 _alsa=auto
589 _fastmemcpy=yes
590 _unrar_exec=auto
591 _win32dll=auto
592 _select=yes
593 _radio=no
594 _radio_capture=no
595 _radio_v4l=auto
596 _radio_v4l2=auto
597 _radio_bsdbt848=auto
598 _tv=yes
599 _tv_v4l1=auto
600 _tv_v4l2=auto
601 _tv_bsdbt848=auto
602 _tv_dshow=auto
603 _pvr=auto
604 networking=yes
605 _winsock2_h=auto
606 _smb=auto
607 _libquvi=auto
608 _joystick=no
609 _xvid=auto
610 _libnut=auto
611 _lirc=auto
612 _lircc=auto
613 _apple_remote=auto
614 _apple_ir=auto
615 _termcap=auto
616 _termios=auto
617 _tga=yes
618 _directfb=auto
619 #language=en
620 _shm=auto
621 _translation=no
622 _charset="UTF-8"
623 _crash_debug=no
624 _sighandler=yes
625 _libdv=auto
626 _cdda=auto
627 _cddb=auto
628 _big_endian=auto
629 _qtx=auto
630 _coreaudio=auto
631 _corevideo=auto
632 _cocoa=auto
633 _sharedbuffer=auto
634 quicktime=auto
635 _macosx_finder=no
636 _macosx_bundle=auto
637 _sortsub=yes
638 _enca=auto
639 _inet6=auto
640 _gethostbyname2=auto
641 _ftp=auto
642 _musepack=no
643 _vstream=auto
644 _pthreads=auto
645 _w32threads=auto
646 _ass=auto
647 _rpath=no
648 libpostproc=auto
649 libavresample=auto
650 _asmalign_pot=auto
651 _stream_cache=yes
652 _priority=no
653 def_dos_paths="#define HAVE_DOS_PATHS 0"
654 def_stream_cache="#define CONFIG_STREAM_CACHE 1"
655 def_priority="#undef CONFIG_PRIORITY"
656 def_pthread_cache="#undef PTHREAD_CACHE"
657 need_shmem=yes
658 for ac_option do
659 case "$ac_option" in
660 --help|-help|-h)
661 show_help
663 --prefix=*)
664 _prefix=$(echo $ac_option | cut -d '=' -f 2)
666 --bindir=*)
667 _bindir=$(echo $ac_option | cut -d '=' -f 2)
669 --datadir=*)
670 _datadir=$(echo $ac_option | cut -d '=' -f 2)
672 --mandir=*)
673 _mandir=$(echo $ac_option | cut -d '=' -f 2)
675 --confdir=*)
676 _confdir=$(echo $ac_option | cut -d '=' -f 2)
678 --libdir=*)
679 _libdir=$(echo $ac_option | cut -d '=' -f 2)
681 --codecsdir=*)
682 _codecsdir=$(echo $ac_option | cut -d '=' -f 2)
684 --localedir=*)
685 _localedir=$(echo $ac_option | cut -d '=' -f 2)
688 --with-install=*)
689 _install=$(echo $ac_option | cut -d '=' -f 2 )
692 --with-sdl-config=*)
693 _sdlconfig=$(echo $ac_option | cut -d '=' -f 2)
695 --with-dvdnav-config=*)
696 _dvdnavconfig=$(echo $ac_option | cut -d '=' -f 2)
698 --with-dvdread-config=*)
699 _dvdreadconfig=$(echo $ac_option | cut -d '=' -f 2)
702 --extra-cflags=*)
703 extra_cflags="$extra_cflags $(echo $ac_option | cut -d '=' -f 2-)"
705 --extra-ldflags=*)
706 extra_ldflags="$extra_ldflags $(echo $ac_option | cut -d '=' -f 2-)"
708 --extra-libs=*)
709 extra_libs=$(echo $ac_option | cut -d '=' -f 2)
711 --extra-libs-mplayer=*)
712 libs_mplayer=$(echo $ac_option | cut -d '=' -f 2)
715 --target=*)
716 _target=$(echo $ac_option | cut -d '=' -f 2)
718 --cc=*)
719 _cc=$(echo $ac_option | cut -d '=' -f 2)
721 --as=*)
722 _as=$(echo $ac_option | cut -d '=' -f 2)
724 --nm=*)
725 _nm=$(echo $ac_option | cut -d '=' -f 2)
727 --yasm=*)
728 _yasm=$(echo $ac_option | cut -d '=' -f 2)
730 --ar=*)
731 _ar=$(echo $ac_option | cut -d '=' -f 2)
733 --pkg-config=*)
734 _pkg_config=$(echo $ac_option | cut -d '=' -f 2)
736 --ranlib=*)
737 _ranlib=$(echo $ac_option | cut -d '=' -f 2)
739 --windres=*)
740 _windres=$(echo $ac_option | cut -d '=' -f 2)
742 --charset=*)
743 _charset=$(echo $ac_option | cut -d '=' -f 2)
745 --language-doc=*)
746 language_doc=$(echo $ac_option | cut -d '=' -f 2)
748 --language-man=*)
749 language_man=$(echo $ac_option | cut -d '=' -f 2)
751 --language-msg=*)
752 language_msg=$(echo $ac_option | cut -d '=' -f 2)
754 --language=*)
755 language=$(echo $ac_option | cut -d '=' -f 2)
758 --enable-static)
759 _ld_static='-static'
761 --disable-static)
762 _ld_static=''
764 --enable-profile)
765 _profile='-p'
767 --disable-profile)
768 _profile=
770 --enable-debug)
771 _debug='-g'
773 --enable-debug=*)
774 _debug=$(echo $_echo_n '-g'$_echo_c; echo $ac_option | cut -d '=' -f 2)
776 --disable-debug)
777 _debug=
779 --enable-translation) _translation=yes ;;
780 --disable-translation) _translation=no ;;
781 --enable-runtime-cpudetection) _runtime_cpudetection=yes ;;
782 --disable-runtime-cpudetection) _runtime_cpudetection=no ;;
783 --enable-cross-compile) _cross_compile=yes ;;
784 --disable-cross-compile) _cross_compile=no ;;
785 --enable-x11) _x11=yes ;;
786 --disable-x11) _x11=no ;;
787 --enable-xshape) _xshape=yes ;;
788 --disable-xshape) _xshape=no ;;
789 --enable-xss) _xss=yes ;;
790 --disable-xss) _xss=no ;;
791 --enable-xv) _xv=yes ;;
792 --disable-xv) _xv=no ;;
793 --enable-vdpau) _vdpau=yes ;;
794 --disable-vdpau) _vdpau=no ;;
795 --enable-sdl) _sdl=yes ;;
796 --disable-sdl) _sdl=no ;;
797 --enable-direct3d) _direct3d=yes ;;
798 --disable-direct3d) _direct3d=no ;;
799 --enable-directx) _directx=yes ;;
800 --disable-directx) _directx=no ;;
801 --enable-png) _png=yes ;;
802 --disable-png) _png=no ;;
803 --enable-mng) _mng=yes ;;
804 --disable-mng) _mng=no ;;
805 --enable-jpeg) _jpeg=yes ;;
806 --disable-jpeg) _jpeg=no ;;
807 --enable-pnm) _pnm=yes ;;
808 --disable-pnm) _pnm=no ;;
809 --enable-md5sum) _md5sum=yes ;;
810 --disable-md5sum) _md5sum=no ;;
811 --enable-yuv4mpeg) _yuv4mpeg=yes ;;
812 --disable-yuv4mpeg) _yuv4mpeg=no ;;
813 --enable-gif) _gif=yes ;;
814 --disable-gif) _gif=no ;;
815 --enable-gl) _gl=yes ;;
816 --disable-gl) _gl=no ;;
817 --enable-caca) _caca=yes ;;
818 --disable-caca) _caca=no ;;
819 --enable-dvb) _dvb=yes ;;
820 --disable-dvb) _dvb=no ;;
821 --enable-v4l2) _v4l2=yes ;;
822 --disable-v4l2) _v4l2=no ;;
823 --enable-iconv) _iconv=yes ;;
824 --disable-iconv) _iconv=no ;;
825 --enable-langinfo) _langinfo=yes ;;
826 --disable-langinfo) _langinfo=no ;;
827 --enable-rtc) _rtc=yes ;;
828 --disable-rtc) _rtc=no ;;
829 --enable-libdv) _libdv=yes ;;
830 --disable-libdv) _libdv=no ;;
831 --enable-ossaudio) _ossaudio=yes ;;
832 --disable-ossaudio) _ossaudio=no ;;
833 --enable-rsound) _rsound=yes ;;
834 --disable-rsound) _rsound=no ;;
835 --enable-pulse) _pulse=yes ;;
836 --disable-pulse) _pulse=no ;;
837 --enable-portaudio) _portaudio=yes ;;
838 --disable-portaudio) _portaudio=no ;;
839 --enable-jack) _jack=yes ;;
840 --disable-jack) _jack=no ;;
841 --enable-openal) _openal=yes ;;
842 --disable-openal) _openal=no ;;
843 --enable-mad) _mad=yes ;;
844 --disable-mad) _mad=no ;;
845 --enable-libcdio) _libcdio=yes ;;
846 --disable-libcdio) _libcdio=no ;;
847 --enable-libvorbis) _libvorbis=yes ;;
848 --disable-libvorbis) _libvorbis=no ;;
849 --enable-speex) _speex=yes ;;
850 --disable-speex) _speex=no ;;
851 --enable-tremor) _tremor=yes ;;
852 --disable-tremor) _tremor=no ;;
853 --enable-theora) _theora=yes ;;
854 --disable-theora) _theora=no ;;
855 --enable-mpg123) _mpg123=yes ;;
856 --disable-mpg123) _mpg123=no ;;
857 --enable-liba52) _liba52=yes ;;
858 --disable-liba52) _liba52=no ;;
859 --enable-libdca) _libdca=yes ;;
860 --disable-libdca) _libdca=no ;;
861 --enable-musepack) _musepack=yes ;;
862 --disable-musepack) _musepack=no ;;
863 --enable-faad) _faad=yes ;;
864 --disable-faad) _faad=no ;;
865 --enable-ladspa) _ladspa=yes ;;
866 --disable-ladspa) _ladspa=no ;;
867 --enable-libbs2b) _libbs2b=yes ;;
868 --disable-libbs2b) _libbs2b=no ;;
869 --enable-xmms) _xmms=yes ;;
870 --disable-xmms) _xmms=no ;;
871 --enable-vcd) _vcd=yes ;;
872 --disable-vcd) _vcd=no ;;
873 --enable-bluray) _bluray=yes ;;
874 --disable-bluray) _bluray=no ;;
875 --enable-dvdread) _dvdread=yes ;;
876 --disable-dvdread) _dvdread=no ;;
877 --enable-dvdread-internal) _dvdread_internal=yes ;;
878 --disable-dvdread-internal) _dvdread_internal=no ;;
879 --enable-libdvdcss-internal) _libdvdcss_internal=yes ;;
880 --disable-libdvdcss-internal) _libdvdcss_internal=no ;;
881 --enable-dvdnav) _dvdnav=yes ;;
882 --disable-dvdnav) _dvdnav=no ;;
883 --enable-xanim) _xanim=yes ;;
884 --disable-xanim) _xanim=no ;;
885 --enable-real) _real=yes ;;
886 --disable-real) _real=no ;;
887 --enable-lcms2) _lcms2=yes ;;
888 --disable-lcms2) _lcms2=no ;;
889 --enable-xinerama) _xinerama=yes ;;
890 --disable-xinerama) _xinerama=no ;;
891 --enable-vm) _vm=yes ;;
892 --disable-vm) _vm=no ;;
893 --enable-xf86keysym) _xf86keysym=yes ;;
894 --disable-xf86keysym) _xf86keysym=no ;;
895 --enable-alsa) _alsa=yes ;;
896 --disable-alsa) _alsa=no ;;
897 --enable-tv) _tv=yes ;;
898 --disable-tv) _tv=no ;;
899 --enable-tv-bsdbt848) _tv_bsdbt848=yes ;;
900 --disable-tv-bsdbt848) _tv_bsdbt848=no ;;
901 --enable-tv-v4l1) _tv_v4l1=yes ;;
902 --disable-tv-v4l1) _tv_v4l1=no ;;
903 --enable-tv-v4l2) _tv_v4l2=yes ;;
904 --disable-tv-v4l2) _tv_v4l2=no ;;
905 --enable-tv-dshow) _tv_dshow=yes ;;
906 --disable-tv-dshow) _tv_dshow=no ;;
907 --enable-radio) _radio=yes ;;
908 --enable-radio-capture) _radio_capture=yes ;;
909 --disable-radio-capture) _radio_capture=no ;;
910 --disable-radio) _radio=no ;;
911 --enable-radio-v4l) _radio_v4l=yes ;;
912 --disable-radio-v4l) _radio_v4l=no ;;
913 --enable-radio-v4l2) _radio_v4l2=yes ;;
914 --disable-radio-v4l2) _radio_v4l2=no ;;
915 --enable-radio-bsdbt848) _radio_bsdbt848=yes ;;
916 --disable-radio-bsdbt848) _radio_bsdbt848=no ;;
917 --enable-pvr) _pvr=yes ;;
918 --disable-pvr) _pvr=no ;;
919 --enable-fastmemcpy) _fastmemcpy=yes ;;
920 --disable-fastmemcpy) _fastmemcpy=no ;;
921 --enable-networking) networking=yes ;;
922 --disable-networking) networking=no ;;
923 --enable-winsock2_h) _winsock2_h=yes ;;
924 --disable-winsock2_h) _winsock2_h=no ;;
925 --enable-smb) _smb=yes ;;
926 --disable-smb) _smb=no ;;
927 --enable-libquvi) _libquvi=yes ;;
928 --disable-libquvi) _libquvi=no ;;
929 --enable-joystick) _joystick=yes ;;
930 --disable-joystick) _joystick=no ;;
931 --enable-xvid) _xvid=yes ;;
932 --disable-xvid) _xvid=no ;;
933 --enable-libnut) _libnut=yes ;;
934 --disable-libnut) _libnut=no ;;
935 --enable-libav) ffmpeg=yes ;;
936 --ffmpeg-source-dir=*)
937 _ffmpeg_source=$(echo $ac_option | cut -d '=' -f 2 ) ;;
939 --enable-lirc) _lirc=yes ;;
940 --disable-lirc) _lirc=no ;;
941 --enable-lircc) _lircc=yes ;;
942 --disable-lircc) _lircc=no ;;
943 --enable-apple-remote) _apple_remote=yes ;;
944 --disable-apple-remote) _apple_remote=no ;;
945 --enable-apple-ir) _apple_ir=yes ;;
946 --disable-apple-ir) _apple_ir=no ;;
947 --enable-termcap) _termcap=yes ;;
948 --disable-termcap) _termcap=no ;;
949 --enable-termios) _termios=yes ;;
950 --disable-termios) _termios=no ;;
951 --disable-tga) _tga=no ;;
952 --enable-tga) _tga=yes ;;
953 --enable-directfb) _directfb=yes ;;
954 --disable-directfb) _directfb=no ;;
955 --enable-shm) _shm=yes ;;
956 --disable-shm) _shm=no ;;
957 --enable-select) _select=yes ;;
958 --disable-select) _select=no ;;
959 --enable-cddb) _cddb=yes ;;
960 --disable-cddb) _cddb=no ;;
961 --enable-big-endian) _big_endian=yes ;;
962 --disable-big-endian) _big_endian=no ;;
963 --enable-unrarexec) _unrar_exec=yes ;;
964 --disable-unrarexec) _unrar_exec=no ;;
965 --enable-ftp) _ftp=yes ;;
966 --disable-ftp) _ftp=no ;;
967 --enable-vstream) _vstream=yes ;;
968 --disable-vstream) _vstream=no ;;
969 --enable-pthreads) _pthreads=yes ;;
970 --disable-pthreads) _pthreads=no ;;
971 --enable-w32threads) _w32threads=yes ;;
972 --disable-w32threads) _w32threads=no ;;
973 --enable-libass) _ass=yes ;;
974 --disable-libass) _ass=no ;;
975 --enable-rpath) _rpath=yes ;;
976 --disable-rpath) _rpath=no ;;
977 --enable-libpostproc) libpostproc=yes ;;
978 --disable-libpostproc) libpostproc=no ;;
979 --enable-libavresample) libavresample=yes ;;
980 --disable-libavresample) libavresample=no ;;
982 --enable-enca) _enca=yes ;;
983 --disable-enca) _enca=no ;;
985 --enable-inet6) _inet6=yes ;;
986 --disable-inet6) _inet6=no ;;
988 --enable-gethostbyname2) _gethostbyname2=yes ;;
989 --disable-gethostbyname2) _gethostbyname2=no ;;
991 --enable-qtx) _qtx=yes ;;
992 --disable-qtx) _qtx=no ;;
994 --enable-coreaudio) _coreaudio=yes ;;
995 --disable-coreaudio) _coreaudio=no ;;
996 --enable-corevideo) _corevideo=yes ;;
997 --disable-corevideo) _corevideo=no ;;
998 --enable-cocoa) _cocoa=yes ;;
999 --disable-cocoa) _cocoa=no ;;
1000 --enable-sharedbuffer) _sharedbuffer=yes ;;
1001 --disable-sharedbuffer) _sharedbuffer=no ;;
1002 --enable-macosx-finder) _macosx_finder=yes ;;
1003 --disable-macosx-finder) _macosx_finder=no ;;
1004 --enable-macosx-bundle) _macosx_bundle=yes ;;
1005 --disable-macosx-bundle) _macosx_bundle=no ;;
1007 --enable-sortsub) _sortsub=yes ;;
1008 --disable-sortsub) _sortsub=no ;;
1010 --enable-crash-debug) _crash_debug=yes ;;
1011 --disable-crash-debug) _crash_debug=no ;;
1012 --enable-sighandler) _sighandler=yes ;;
1013 --disable-sighandler) _sighandler=no ;;
1014 --enable-win32dll) _win32dll=yes ;;
1015 --disable-win32dll) _win32dll=no ;;
1017 --enable-sse) _sse=yes ;;
1018 --disable-sse) _sse=no ;;
1019 --enable-sse2) _sse2=yes ;;
1020 --disable-sse2) _sse2=no ;;
1021 --enable-ssse3) _ssse3=yes ;;
1022 --disable-ssse3) _ssse3=no ;;
1023 --enable-mmxext) _mmxext=yes ;;
1024 --disable-mmxext) _mmxext=no ;;
1025 --enable-3dnow) _3dnow=yes ;;
1026 --disable-3dnow) _3dnow=no _3dnowext=no ;;
1027 --enable-3dnowext) _3dnow=yes _3dnowext=yes ;;
1028 --disable-3dnowext) _3dnowext=no ;;
1029 --enable-cmov) _cmov=yes ;;
1030 --disable-cmov) _cmov=no ;;
1031 --enable-fast-cmov) _fast_cmov=yes ;;
1032 --disable-fast-cmov) _fast_cmov=no ;;
1033 --enable-fast-clz) _fast_clz=yes ;;
1034 --disable-fast-clz) _fast_clz=no ;;
1035 --enable-altivec) _altivec=yes ;;
1036 --disable-altivec) _altivec=no ;;
1037 --enable-armv5te) _armv5te=yes ;;
1038 --disable-armv5te) _armv5te=no ;;
1039 --enable-armv6) _armv6=yes ;;
1040 --disable-armv6) _armv6=no ;;
1041 --enable-armv6t2) _armv6t2=yes ;;
1042 --disable-armv6t2) _armv6t2=no ;;
1043 --enable-armvfp) _armvfp=yes ;;
1044 --disable-armvfp) _armvfp=no ;;
1045 --enable-neon) neon=yes ;;
1046 --disable-neon) neon=no ;;
1047 --enable-iwmmxt) _iwmmxt=yes ;;
1048 --disable-iwmmxt) _iwmmxt=no ;;
1049 --enable-mmx) _mmx=yes ;;
1050 --disable-mmx) # 3Dnow! and MMX2 require MMX
1051 _3dnow=no _3dnowext=no _mmx=no _mmxext=no ;;
1054 echo "Unknown parameter: $ac_option" >&2
1055 exit 1
1058 esac
1059 done
1061 # Atmos: moved this here, to be correct, if --prefix is specified
1062 test -z "$_bindir" && _bindir="$_prefix/bin"
1063 test -z "$_datadir" && _datadir="$_prefix/share/mplayer"
1064 test -z "$_mandir" && _mandir="$_prefix/share/man"
1065 test -z "$_confdir" && _confdir="$_prefix/etc/mplayer"
1066 test -z "$_libdir" && _libdir="$_prefix/lib"
1067 test -z "$_localedir" && _localedir="$_prefix/share/locale"
1069 for tmpdir in "$TMPDIR" "$TEMPDIR" "/tmp" ; do
1070 test "$tmpdir" && break
1071 done
1073 mplayer_tmpdir="$tmpdir/mplayer-configure-$RANDOM-$$"
1074 mkdir $mplayer_tmpdir || die "Unable to create tmpdir."
1076 TMPLOG="config.log"
1078 rm -f "$TMPLOG"
1079 echo Parameters configure was run with: > "$TMPLOG"
1080 if test -n "$CFLAGS" ; then
1081 echo ${_echo_n} CFLAGS="'$CFLAGS' ${_echo_c}" >> "$TMPLOG"
1083 if test -n "$PKG_CONFIG_PATH" ; then
1084 echo ${_echo_n} PKG_CONFIG_PATH="'$PKG_CONFIG_PATH' ${_echo_c}" >> "$TMPLOG"
1086 echo ./configure $configuration >> "$TMPLOG"
1087 echo >> "$TMPLOG"
1090 echocheck "cross compilation"
1091 echores $_cross_compile
1093 if test $_cross_compile = yes; then
1094 tmp_run() {
1095 return 0
1099 tool_prefix=""
1101 if test $_cross_compile = yes ; then
1102 # Usually cross-compiler prefixes match with the target triplet
1103 test -n "$_target" && tool_prefix="$_target"-
1106 test "$_ranlib" = auto && _ranlib="$tool_prefix"ranlib
1107 test "$_windres" = auto && _windres="$tool_prefix"windres
1108 test "$_ar" = auto && _ar="$tool_prefix"ar
1109 test "$_yasm" = auto && _yasm="$tool_prefix"yasm
1110 test "$_pkg_config" = auto && _pkg_config="$tool_prefix"pkg-config
1112 if test "$_cc" = auto ; then
1113 if test -n "$tool_prefix" ; then
1114 _cc="$tool_prefix"gcc
1115 else
1116 _cc=cc
1120 # Determine our OS name and CPU architecture
1121 if test -z "$_target" ; then
1122 # OS name
1123 system_name=$(uname -s 2>&1)
1124 case "$system_name" in
1125 Linux|FreeBSD|NetBSD|OpenBSD|DragonFly|BSD/OS|Darwin|QNX|GNU|BeOS|MorphOS|AIX|AmigaOS)
1127 Haiku)
1128 system_name=BeOS
1130 GNU/kFreeBSD)
1131 system_name=FreeBSD
1133 HP-UX*)
1134 system_name=HP-UX
1136 [cC][yY][gG][wW][iI][nN]*)
1137 system_name=CYGWIN
1139 MINGW32*)
1140 system_name=MINGW32
1142 OS/2*)
1143 system_name=OS/2
1146 system_name="$system_name-UNKNOWN"
1148 esac
1151 # host's CPU/instruction set
1152 host_arch=$(uname -p 2>&1)
1153 case "$host_arch" in
1154 i386|sparc|ppc|alpha|arm|mips|vax)
1156 powerpc) # Darwin returns 'powerpc'
1157 host_arch=ppc
1159 *) # uname -p on Linux returns 'unknown' for the processor type,
1160 # OpenBSD returns 'Intel Pentium/MMX ("Genuine Intel" 586-class)'
1162 # Maybe uname -m (machine hardware name) returns something we
1163 # recognize.
1165 # x86/x86pc is used by QNX
1166 case "$(uname -m 2>&1)" in
1167 x86_64|amd64|i[3-9]86*|x86|x86pc|k5|k6|k6_2|k6_3|k6-2|k6-3|pentium*|athlon*|i586_i686|i586-i686|BePC) host_arch=i386 ;;
1168 ia64) host_arch=ia64 ;;
1169 macppc|ppc) host_arch=ppc ;;
1170 ppc64) host_arch=ppc64 ;;
1171 alpha) host_arch=alpha ;;
1172 sparc) host_arch=sparc ;;
1173 sparc64) host_arch=sparc64 ;;
1174 parisc*|hppa*|9000*) host_arch=hppa ;;
1175 arm*|zaurus|cats) host_arch=arm ;;
1176 sh3|sh4|sh4a) host_arch=sh ;;
1177 s390) host_arch=s390 ;;
1178 s390x) host_arch=s390x ;;
1179 *mips*) host_arch=mips ;;
1180 vax) host_arch=vax ;;
1181 xtensa*) host_arch=xtensa ;;
1182 *) host_arch=UNKNOWN ;;
1183 esac
1185 esac
1186 else # if test -z "$_target"
1187 for i in 2 3; do
1188 system_name=$(echo $_target | cut -d '-' -f $i)
1189 case "$(echo $system_name | tr A-Z a-z)" in
1190 linux) system_name=Linux ;;
1191 freebsd) system_name=FreeBSD ;;
1192 gnu/kfreebsd) system_name=FreeBSD ;;
1193 netbsd) system_name=NetBSD ;;
1194 bsd/os) system_name=BSD/OS ;;
1195 openbsd) system_name=OpenBSD ;;
1196 dragonfly) system_name=DragonFly ;;
1197 qnx) system_name=QNX ;;
1198 morphos) system_name=MorphOS ;;
1199 amigaos) system_name=AmigaOS ;;
1200 mingw32*) system_name=MINGW32 ;;
1201 *) continue ;;
1202 esac
1203 break
1204 done
1205 # We need to convert underscores so that values like k6-2 and pentium-mmx can be passed
1206 host_arch=$(echo $_target | cut -d '-' -f 1)
1207 if test $(echo $host_arch) != "x86_64" ; then
1208 host_arch=$(echo $host_arch | tr '_' '-')
1212 extra_cflags="-I. $extra_cflags"
1213 _timer=timer-linux.c
1214 _getch=getch2.c
1215 if freebsd ; then
1216 extra_ldflags="$extra_ldflags -L/usr/local/lib"
1217 extra_cflags="$extra_cflags -I/usr/local/include"
1220 if netbsd || dragonfly ; then
1221 extra_ldflags="$extra_ldflags -L/usr/pkg/lib"
1222 extra_cflags="$extra_cflags -I/usr/pkg/include"
1225 if darwin; then
1226 extra_cflags="-mdynamic-no-pic $extra_cflags"
1227 _timer=timer-darwin.c
1230 if aix ; then
1231 extra_ldflags="$extra_ldflags -lC"
1234 if linux ; then
1235 _ranlib='true'
1238 if win32 ; then
1239 _exesuf=".exe"
1240 extra_cflags="$extra_cflags -fno-common"
1241 # -lwinmm is always needed for osdep/timer-win2.c
1242 extra_ldflags="$extra_ldflags -lwinmm"
1243 _pe_executable=yes
1244 _timer=timer-win2.c
1245 _priority=yes
1246 def_dos_paths="#define HAVE_DOS_PATHS 1"
1247 def_priority="#define CONFIG_PRIORITY 1"
1250 if mingw32 ; then
1251 _getch=getch2-win.c
1252 need_shmem=no
1253 extra_cflags="$extra_cflags -D__USE_MINGW_ANSI_STDIO=1"
1256 if amigaos ; then
1257 _select=no
1258 _sighandler=no
1259 _stream_cache=no
1260 def_stream_cache="#undef CONFIG_STREAM_CACHE"
1261 extra_cflags="-DNEWLIB -D__USE_INLINE__ $extra_cflags"
1264 if qnx ; then
1265 extra_ldflags="$extra_ldflags -lph"
1268 TMPC="$mplayer_tmpdir/tmp.c"
1269 TMPEXE="$mplayer_tmpdir/tmp$_exesuf"
1270 TMPH="$mplayer_tmpdir/tmp.h"
1271 TMPS="$mplayer_tmpdir/tmp.S"
1273 if test "$_runtime_cpudetection" = yes && ! x86 && ! ppc; then
1274 die "Runtime CPU detection only works for x86, x86-64 and PPC!"
1278 # Checking CC version...
1279 # Intel C++ Compilers (no autoselect, use CC=/some/binary ./configure)
1280 if test "$(basename $_cc)" = "icc" || test "$(basename $_cc)" = "ecc"; then
1281 echocheck "$_cc version"
1282 cc_vendor=intel
1283 cc_name=$($_cc -V 2>&1 | head -n 1 | cut -d ',' -f 1)
1284 cc_version=$($_cc -V 2>&1 | head -n 1 | cut -d ',' -f 2 | cut -d ' ' -f 3)
1285 _cc_major=$(echo $cc_version | cut -d '.' -f 1)
1286 _cc_minor=$(echo $cc_version | cut -d '.' -f 2)
1287 # TODO verify older icc/ecc compatibility
1288 case $cc_version in
1290 cc_version="v. ?.??, bad"
1291 cc_fail=yes
1293 10.1|11.0|11.1)
1294 cc_version="$cc_version, ok"
1297 cc_version="$cc_version, bad"
1298 cc_fail=yes
1300 esac
1301 echores "$cc_version"
1302 else
1303 for _cc in "$_cc" gcc cc ; do
1304 cc_name_tmp=$($_cc -v 2>&1 | tail -n 1 | cut -d ' ' -f 1)
1305 if test "$cc_name_tmp" = "gcc"; then
1306 cc_name=$cc_name_tmp
1307 echocheck "$_cc version"
1308 cc_vendor=gnu
1309 cc_version=$($_cc -dumpversion 2>&1)
1310 case $cc_version in
1311 2.96*)
1312 cc_fail=yes
1315 _cc_major=$(echo $cc_version | cut -d '.' -f 1)
1316 _cc_minor=$(echo $cc_version | cut -d '.' -f 2)
1317 _cc_mini=$(echo $cc_version | cut -d '.' -f 3)
1319 esac
1320 echores "$cc_version"
1321 break
1323 if $_cc -v 2>&1 | grep -q "clang"; then
1324 echocheck "$_cc version"
1325 cc_vendor=clang
1326 cc_version=$($_cc -dumpversion 2>&1)
1327 res_comment="experimental support only"
1328 echores "clang $cc_version"
1329 break
1331 cc_name_tmp=$($_cc -V 2>&1 | head -n 1 | cut -d ' ' -f 2,3)
1332 done
1333 fi # icc
1334 test "$cc_fail" = yes && die "unsupported compiler version"
1336 echocheck "working compiler"
1337 cflag_check "" || die "Compiler is not functioning correctly. Check your installation and custom CFLAGS $CFLAGS ."
1338 echo "yes"
1340 if test -z "$_target" && x86 ; then
1341 cat > $TMPC << EOF
1342 int main(void) {
1343 int test[(int)sizeof(char *)-7];
1344 return 0;
1347 cc_check && host_arch=x86_64 || host_arch=i386
1350 echo "Detected operating system: $system_name"
1351 echo "Detected host architecture: $host_arch"
1353 # ---
1355 # now that we know what compiler should be used for compilation, try to find
1356 # out which assembler is used by the $_cc compiler
1357 if test "$_as" = auto ; then
1358 _as=$($_cc -print-prog-name=as)
1359 test -z "$_as" && _as=as
1362 if test "$_nm" = auto ; then
1363 _nm=$($_cc -print-prog-name=nm)
1364 test -z "$_nm" && _nm=nm
1367 # XXX: this should be ok..
1368 _cpuinfo="echo"
1370 if test "$_runtime_cpudetection" = no ; then
1372 # Cygwin has /proc/cpuinfo, but only supports Intel CPUs
1373 # FIXME: Remove the cygwin check once AMD CPUs are supported
1374 if test -r /proc/cpuinfo && ! cygwin; then
1375 # Linux with /proc mounted, extract CPU information from it
1376 _cpuinfo="cat /proc/cpuinfo"
1377 elif test -r /compat/linux/proc/cpuinfo && ! x86 ; then
1378 # FreeBSD with Linux emulation /proc mounted,
1379 # extract CPU information from it
1380 # Don't use it on x86 though, it never reports 3Dnow
1381 _cpuinfo="cat /compat/linux/proc/cpuinfo"
1382 elif darwin && ! x86 ; then
1383 # use hostinfo on Darwin
1384 _cpuinfo="hostinfo"
1385 elif aix; then
1386 # use 'lsattr' on AIX
1387 _cpuinfo="lsattr -E -l proc0 -a type"
1388 elif x86; then
1389 # all other OSes try to extract CPU information from a small helper
1390 # program cpuinfo instead
1391 $_cc -o cpuinfo$_exesuf cpuinfo.c
1392 _cpuinfo="./cpuinfo$_exesuf"
1395 if x86 ; then
1396 # gather more CPU information
1397 pname=$($_cpuinfo | grep 'model name' | cut -d ':' -f 2 | head -n 1)
1398 pvendor=$($_cpuinfo | grep 'vendor_id' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1)
1399 pfamily=$($_cpuinfo | grep 'cpu family' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1)
1400 pmodel=$($_cpuinfo | grep -v 'model name' | grep 'model' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1)
1401 pstepping=$($_cpuinfo | grep 'stepping' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1)
1403 exts=$($_cpuinfo | egrep 'features|flags' | cut -d ':' -f 2 | head -n 1)
1405 pparam=$(echo $exts | sed -e s/xmm/sse/ -e s/kni/sse/)
1406 # SSE implies MMX2, but not all SSE processors report the mmxext CPU flag.
1407 pparam=$(echo $pparam | sed -e 's/sse/sse mmxext/')
1409 for ext in $pparam ; do
1410 eval test \"\$_$ext\" = auto 2>/dev/null && eval _$ext=kernel_check
1411 done
1413 echocheck "CPU vendor"
1414 echores "$pvendor ($pfamily:$pmodel:$pstepping)"
1416 echocheck "CPU type"
1417 echores "$pname"
1420 fi # test "$_runtime_cpudetection" = no
1422 if x86 && test "$_runtime_cpudetection" = no ; then
1423 extcheck() {
1424 if test "$1" = kernel_check ; then
1425 echocheck "kernel support of $2"
1426 cat > $TMPC <<EOF
1427 #include <stdlib.h>
1428 #include <signal.h>
1429 static void catch(int sig) { exit(1); }
1430 int main(void) {
1431 signal(SIGILL, catch);
1432 __asm__ volatile ("$3":::"memory"); return 0;
1436 if cc_check && tmp_run ; then
1437 eval _$2=yes
1438 echores "yes"
1439 _optimizing="$_optimizing $2"
1440 return 0
1441 else
1442 eval _$2=no
1443 echores "failed"
1444 echo "It seems that your kernel does not correctly support $2."
1445 echo "To use $2 extensions in MPlayer, you have to upgrade/recompile your kernel!"
1446 return 1
1449 return 0
1452 extcheck $_mmx "mmx" "emms"
1453 extcheck $_mmxext "mmxext" "sfence"
1454 extcheck $_3dnow "3dnow" "femms"
1455 extcheck $_3dnowext "3dnowext" "pswapd %%mm0, %%mm0"
1456 extcheck $_sse "sse" "xorps %%xmm0, %%xmm0" || _gcc3_ext="$_gcc3_ext -mno-sse"
1457 extcheck $_sse2 "sse2" "xorpd %%xmm0, %%xmm0" || _gcc3_ext="$_gcc3_ext -mno-sse2"
1458 extcheck $_ssse3 "ssse3" "pabsd %%xmm0, %%xmm0"
1459 extcheck $_cmov "cmov" "cmovb %%eax, %%ebx"
1461 if test "$_gcc3_ext" != ""; then
1462 # if we had to disable sse/sse2 because the active kernel does not
1463 # support this instruction set extension, we also have to tell
1464 # gcc3 to not generate sse/sse2 instructions for normal C code
1465 cflag_check $_march $_gcc3_ext && _march="$_march $_gcc3_ext"
1471 def_fast_64bit='#define HAVE_FAST_64BIT 0'
1472 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 0'
1473 arch_all='X86 IA64 SPARC ARM AVR32 SH4 PPC ALPHA MIPS PA_RISC S390 S390X VAX BFIN XTENSA TOMI GENERIC'
1474 subarch_all='X86_32 X86_64 PPC64'
1475 case "$host_arch" in
1476 i[3-9]86|x86|x86pc|k5|k6|k6-2|k6-3|pentium*|athlon*|i586-i686)
1477 arch='x86'
1478 subarch='x86_32'
1479 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
1480 iproc=486
1481 proc=i486
1484 if test "$_runtime_cpudetection" = no ; then
1485 case "$pvendor" in
1486 AuthenticAMD)
1487 case "$pfamily" in
1488 3) proc=i386 iproc=386 ;;
1489 4) proc=i486 iproc=486 ;;
1490 5) iproc=586 # LGB: models are: K5/SSA5 K5 K5 K5 ? ? K6 K6 K6-2 K6-3
1491 # K6 model 13 are the K6-2+ and K6-III+, only differing in cache size.
1492 if test "$pmodel" -eq 9 -o "$pmodel" -eq 13; then
1493 proc=k6-3
1494 elif test "$pmodel" -eq 5 -o "$pmodel" -eq 10; then
1495 proc=geode
1496 elif test "$pmodel" -ge 8; then
1497 proc=k6-2
1498 elif test "$pmodel" -ge 6; then
1499 proc=k6
1500 else
1501 proc=i586
1504 6) iproc=686
1505 # It's a bit difficult to determine the correct type of Family 6
1506 # AMD CPUs just from their signature. Instead, we check directly
1507 # whether it supports SSE.
1508 if test "$_sse" = yes; then
1509 # gcc treats athlon-xp, athlon-4 and athlon-mp similarly.
1510 proc=athlon-xp
1511 else
1512 # Again, gcc treats athlon and athlon-tbird similarly.
1513 proc=athlon
1516 15) iproc=686
1517 # k8 cpu-type only supported in gcc >= 3.4.0, but that will be
1518 # caught and remedied in the optimization tests below.
1519 proc=k8
1522 *) proc=amdfam10 iproc=686
1523 test $_fast_clz = "auto" && _fast_clz=yes
1525 esac
1527 GenuineIntel)
1528 case "$pfamily" in
1529 3) proc=i386 iproc=386 ;;
1530 4) proc=i486 iproc=486 ;;
1531 5) iproc=586
1532 if test "$pmodel" -eq 4 || test "$pmodel" -eq 8; then
1533 proc=pentium-mmx # 4 is desktop, 8 is mobile
1534 else
1535 proc=i586
1538 6) iproc=686
1539 if test "$pmodel" -ge 15; then
1540 proc=core2
1541 elif test "$pmodel" -eq 9 -o "$pmodel" -ge 13; then
1542 proc=pentium-m
1543 elif test "$pmodel" -ge 7; then
1544 proc=pentium3
1545 elif test "$pmodel" -ge 3; then
1546 proc=pentium2
1547 else
1548 proc=i686
1550 test $_fast_clz = "auto" && _fast_clz=yes
1552 15) iproc=686
1553 # A nocona in 32-bit mode has no more capabilities than a prescott.
1554 if test "$pmodel" -ge 3; then
1555 proc=prescott
1556 else
1557 proc=pentium4
1558 test $_fast_clz = "auto" && _fast_clz=yes
1560 test $_fast_cmov = "auto" && _fast_cmov=no
1562 *) proc=prescott iproc=686 ;;
1563 esac
1565 CentaurHauls)
1566 case "$pfamily" in
1567 5) iproc=586
1568 if test "$pmodel" -ge 8; then
1569 proc=winchip2
1570 elif test "$pmodel" -ge 4; then
1571 proc=winchip-c6
1572 else
1573 proc=i586
1576 6) iproc=686
1577 if test "$pmodel" -ge 9; then
1578 proc=c3-2
1579 else
1580 proc=c3
1581 iproc=586
1584 *) proc=i686 iproc=i686 ;;
1585 esac
1587 unknown)
1588 case "$pfamily" in
1589 3) proc=i386 iproc=386 ;;
1590 4) proc=i486 iproc=486 ;;
1591 *) proc=i586 iproc=586 ;;
1592 esac
1595 proc=i586 iproc=586 ;;
1596 esac
1597 test $_fast_clz = "auto" && _fast_clz=no
1598 fi # test "$_runtime_cpudetection" = no
1601 # check that gcc supports our CPU, if not, fall back to earlier ones
1602 # LGB: check -mcpu and -march swithing step by step with enabling
1603 # to fall back till 386.
1605 # gcc >= 3.4.0 doesn't support -mcpu, we have to use -mtune instead
1607 if [ "$cc_vendor" = "gnu" ] && ([ "$_cc_major" -gt 3 ] || ( [ "$_cc_major" = 3 ] && [ "$_cc_minor" -ge 4 ])) ; then
1608 cpuopt=-mtune
1609 else
1610 cpuopt=-mcpu
1613 echocheck "GCC & CPU optimization abilities"
1614 if test "$_runtime_cpudetection" = no ; then
1615 if test $cc_vendor != "intel" && test $cc_vendor != "clang" ; then
1616 cflag_check -march=native && proc=native
1618 if test "$proc" = "amdfam10"; then
1619 cflag_check -march=$proc $cpuopt=$proc || proc=k8
1621 if test "$proc" = "k8"; then
1622 cflag_check -march=$proc $cpuopt=$proc || proc=athlon-xp
1624 if test "$proc" = "athlon-xp"; then
1625 cflag_check -march=$proc $cpuopt=$proc || proc=athlon
1627 if test "$proc" = "k6-3" || test "$proc" = "k6-2"; then
1628 cflag_check -march=$proc $cpuopt=$proc || proc=k6
1630 if test "$proc" = "k6" || test "$proc" = "c3"; then
1631 if ! cflag_check -march=$proc $cpuopt=$proc; then
1632 if cflag_check -march=i586 $cpuopt=i686; then
1633 proc=i586-i686
1634 else
1635 proc=i586
1639 if test "$proc" = "prescott" ; then
1640 cflag_check -march=$proc $cpuopt=$proc || proc=pentium4
1642 if test "$proc" = "core2" ; then
1643 cflag_check -march=$proc $cpuopt=$proc || proc=pentium-m
1645 if test "$proc" = "pentium4" || test "$proc" = "pentium-m" || test "$proc" = "pentium3" || test "$proc" = "pentium2" || test "$proc" = "athlon" || test "$proc" = "c3-2" || test "$proc" = "geode"; then
1646 cflag_check -march=$proc $cpuopt=$proc || proc=i686
1648 if test "$proc" = "i686" || test "$proc" = "pentium-mmx" || test "$proc" = "winchip-c6" || test "$proc" = "winchip2"; then
1649 cflag_check -march=$proc $cpuopt=$proc || proc=i586
1651 if test "$proc" = "i586"; then
1652 cflag_check -march=$proc $cpuopt=$proc || proc=i486
1654 if test "$proc" = "i486" ; then
1655 cflag_check -march=$proc $cpuopt=$proc || proc=i386
1657 if test "$proc" = "i386" ; then
1658 cflag_check -march=$proc $cpuopt=$proc || proc=error
1660 if test "$proc" = "error" ; then
1661 echores "CPU optimization disabled. CPU not recognized or your compiler is too old."
1662 _mcpu=""
1663 _march=""
1664 _optimizing=""
1665 elif test "$proc" = "i586-i686"; then
1666 _march="-march=i586"
1667 _mcpu="$cpuopt=i686"
1668 _optimizing="$proc"
1669 else
1670 _march="-march=$proc"
1671 _mcpu="$cpuopt=$proc"
1672 _optimizing="$proc"
1674 else # if test "$_runtime_cpudetection" = no
1675 _mcpu="$cpuopt=generic"
1676 # at least i486 required, for bswap instruction
1677 _march="-march=i486"
1678 cflag_check $_mcpu || _mcpu="$cpuopt=i686"
1679 cflag_check $_mcpu || _mcpu=""
1680 cflag_check $_march $_mcpu || _march=""
1683 ## Gabucino : --target takes effect here (hopefully...) by overwriting
1684 ## autodetected mcpu/march parameters
1685 if test "$_target" ; then
1686 # TODO: it may be a good idea to check GCC and fall back in all cases
1687 if test "$host_arch" = "i586-i686"; then
1688 _march="-march=i586"
1689 _mcpu="$cpuopt=i686"
1690 else
1691 _march="-march=$host_arch"
1692 _mcpu="$cpuopt=$host_arch"
1695 proc="$host_arch"
1697 case "$proc" in
1698 i386) iproc=386 ;;
1699 i486) iproc=486 ;;
1700 i586|k5|k6|k6-2|k6-3|pentium|pentium-mmx) iproc=586 ;;
1701 i686|athlon*|pentium*) iproc=686 ;;
1702 *) iproc=586 ;;
1703 esac
1706 if test $_cmov = "yes" && test $_fast_cmov = "auto" ; then
1707 _fast_cmov="yes"
1708 else
1709 _fast_cmov="no"
1711 test $_fast_clz = "auto" && _fast_clz=yes
1713 echores "$proc"
1716 ia64)
1717 arch='ia64'
1718 def_fast_64bit='#define HAVE_FAST_64BIT 1'
1719 iproc='ia64'
1722 x86_64|amd64)
1723 arch='x86'
1724 subarch='x86_64'
1725 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
1726 def_fast_64bit='#define HAVE_FAST_64BIT 1'
1727 iproc='x86_64'
1729 # gcc >= 3.4.0 doesn't support -mcpu, we have to use -mtune instead
1730 if test "$cc_vendor" = "gnu" && test "$_cc_major" -gt 3 -o "$_cc_major" -eq 3 -a "$_cc_minor" -ge 4 ; then
1731 cpuopt=-mtune
1732 else
1733 cpuopt=-mcpu
1735 if test "$_runtime_cpudetection" = no ; then
1736 case "$pvendor" in
1737 AuthenticAMD)
1738 case "$pfamily" in
1739 15) proc=k8
1740 test $_fast_clz = "auto" && _fast_clz=no
1742 *) proc=amdfam10;;
1743 esac
1745 GenuineIntel)
1746 case "$pfamily" in
1747 6) proc=core2;;
1749 # 64-bit prescotts exist, but as far as GCC is concerned they
1750 # have the same capabilities as a nocona.
1751 proc=nocona
1752 test $_fast_cmov = "auto" && _fast_cmov=no
1753 test $_fast_clz = "auto" && _fast_clz=no
1755 esac
1758 proc=error;;
1759 esac
1760 fi # test "$_runtime_cpudetection" = no
1762 echocheck "GCC & CPU optimization abilities"
1763 # This is a stripped-down version of the i386 fallback.
1764 if test "$_runtime_cpudetection" = no ; then
1765 if test $cc_vendor != "intel" && test $cc_vendor != "clang" ; then
1766 cflag_check -march=native && proc=native
1768 # --- AMD processors ---
1769 if test "$proc" = "amdfam10"; then
1770 cflag_check -march=$proc $cpuopt=$proc || proc=k8
1772 if test "$proc" = "k8"; then
1773 cflag_check -march=$proc $cpuopt=$proc || proc=athlon-xp
1775 # This will fail if gcc version < 3.3, which is ok because earlier
1776 # versions don't really support 64-bit on amd64.
1777 # Is this a valid assumption? -Corey
1778 if test "$proc" = "athlon-xp"; then
1779 cflag_check -march=$proc $cpuopt=$proc || proc=error
1781 # --- Intel processors ---
1782 if test "$proc" = "core2"; then
1783 cflag_check -march=$proc $cpuopt=$proc || proc=x86-64
1785 if test "$proc" = "x86-64"; then
1786 cflag_check -march=$proc $cpuopt=$proc || proc=nocona
1788 if test "$proc" = "nocona"; then
1789 cflag_check -march=$proc $cpuopt=$proc || proc=pentium4
1791 if test "$proc" = "pentium4"; then
1792 cflag_check -march=$proc $cpuopt=$proc || proc=error
1795 _march="-march=$proc"
1796 _mcpu="$cpuopt=$proc"
1797 if test "$proc" = "error" ; then
1798 echores "CPU optimization disabled. CPU not recognized or your compiler is too old."
1799 _mcpu=""
1800 _march=""
1802 else # if test "$_runtime_cpudetection" = no
1803 # x86-64 is an undocumented option, an intersection of k8 and nocona.
1804 _march="-march=x86-64"
1805 _mcpu="$cpuopt=generic"
1806 cflag_check $_mcpu || _mcpu="x86-64"
1807 cflag_check $_mcpu || _mcpu=""
1808 cflag_check $_march $_mcpu || _march=""
1811 _optimizing="$proc"
1812 test $_fast_cmov = "auto" && _fast_cmov=yes
1813 test $_fast_clz = "auto" && _fast_clz=yes
1815 echores "$proc"
1818 sparc|sparc64)
1819 arch='sparc'
1820 iproc='sparc'
1821 if test "$host_arch" = "sparc64" ; then
1822 _vis='yes'
1823 proc='ultrasparc'
1824 def_fast_64bit='#define HAVE_FAST_64BIT 1'
1825 else
1826 proc=v8
1828 _mcpu="-mcpu=$proc"
1829 _optimizing="$proc"
1832 arm*)
1833 arch='arm'
1834 iproc='arm'
1837 avr32)
1838 arch='avr32'
1839 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
1840 iproc='avr32'
1841 test $_fast_clz = "auto" && _fast_clz=yes
1844 sh|sh4)
1845 arch='sh4'
1846 iproc='sh4'
1849 ppc|ppc64|powerpc|powerpc64)
1850 arch='ppc'
1851 def_dcbzl='#define HAVE_DCBZL 0'
1852 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
1853 iproc='ppc'
1855 if test "$host_arch" = "ppc64" -o "$host_arch" = "powerpc64" ; then
1856 subarch='ppc64'
1857 def_fast_64bit='#define HAVE_FAST_64BIT 1'
1859 echocheck "CPU type"
1860 case $system_name in
1861 Linux)
1862 proc=$($_cpuinfo | grep 'cpu' | cut -d ':' -f 2 | cut -d ',' -f 1 | cut -b 2- | head -n 1)
1863 if test -n "$($_cpuinfo | grep altivec)"; then
1864 test $_altivec = auto && _altivec=yes
1867 Darwin)
1868 proc=$($_cpuinfo | grep "Processor type" | cut -f 3 -d ' ' | sed 's/ppc//')
1869 if [ $(sysctl -n hw.vectorunit) -eq 1 -o \
1870 "$(sysctl -n hw.optional.altivec 2> /dev/null)" = "1" ]; then
1871 test $_altivec = auto && _altivec=yes
1874 NetBSD)
1875 # only gcc 3.4 works reliably with AltiVec code under NetBSD
1876 case $cc_version in
1877 2*|3.0*|3.1*|3.2*|3.3*)
1880 if [ $(sysctl -n machdep.altivec) -eq 1 ]; then
1881 test $_altivec = auto && _altivec=yes
1884 esac
1886 AIX)
1887 proc=$($_cpuinfo | grep 'type' | cut -f 2 -d ' ' | sed 's/PowerPC_//')
1889 esac
1890 if test "$_altivec" = yes; then
1891 echores "$proc altivec"
1892 else
1893 _altivec=no
1894 echores "$proc"
1897 echocheck "GCC & CPU optimization abilities"
1899 if test -n "$proc"; then
1900 case "$proc" in
1901 601) _march='-mcpu=601' _mcpu='-mtune=601' ;;
1902 603) _march='-mcpu=603' _mcpu='-mtune=603' ;;
1903 603e|603ev) _march='-mcpu=603e' _mcpu='-mtune=603e' ;;
1904 604|604e|604r|604ev) _march='-mcpu=604' _mcpu='-mtune=604' ;;
1905 740|740/750|745/755) _march='-mcpu=740' _mcpu='-mtune=740' ;;
1906 750|750CX) _march='-mcpu=750' _mcpu='-mtune=750' ;;
1907 POWER) _march='-mcpu=power' _mcpu='-mtune=power' ;;
1908 POWER2) _march='-mcpu=power2' _mcpu='-mtune=power2' ;;
1909 POWER3) _march='-mcpu=power3' _mcpu='-mtune=power3' ;;
1910 *) ;;
1911 esac
1912 # gcc 3.1(.1) and up supports 7400 and 7450
1913 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "1" || test "$_cc_major" -ge "4"; then
1914 case "$proc" in
1915 7400*|7410*) _march='-mcpu=7400' _mcpu='-mtune=7400' ;;
1916 7447*|7450*|7455*) _march='-mcpu=7450' _mcpu='-mtune=7450' ;;
1917 *) ;;
1918 esac
1920 # gcc 3.2 and up supports 970
1921 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "3" || test "$_cc_major" -ge "4"; then
1922 case "$proc" in
1923 970*|PPC970*) _march='-mcpu=970' _mcpu='-mtune=970'
1924 def_dcbzl='#define HAVE_DCBZL 1' ;;
1925 *) ;;
1926 esac
1928 # gcc 3.3 and up supports POWER4
1929 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "3" || test "$_cc_major" -ge "4"; then
1930 case "$proc" in
1931 POWER4) _march='-mcpu=power4' _mcpu='-mtune=power4' ;;
1932 *) ;;
1933 esac
1935 # gcc 3.4 and up supports 440*
1936 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "4" || test "$_cc_major" -ge "4"; then
1937 case "$proc" in
1938 440EP*) _march='-mcpu=440fp' _mcpu='-mtune=440fp' ;;
1939 440G* ) _march='-mcpu=440' _mcpu='-mtune=440' ;;
1940 *) ;;
1941 esac
1943 # gcc 4.0 and up supports POWER5
1944 if test "$_cc_major" -ge "4"; then
1945 case "$proc" in
1946 POWER5*) _march='-mcpu=power5' _mcpu='-mtune=power5' ;;
1947 *) ;;
1948 esac
1952 if test -n "$_mcpu"; then
1953 _optimizing=$(echo $_mcpu | cut -c 8-)
1954 echores "$_optimizing"
1955 else
1956 echores "none"
1959 test $_fast_clz = "auto" && _fast_clz=yes
1963 alpha*)
1964 arch='alpha'
1965 iproc='alpha'
1966 def_fast_64bit='#define HAVE_FAST_64BIT 1'
1968 echocheck "CPU type"
1969 cat > $TMPC << EOF
1970 int main(void) {
1971 unsigned long ver, mask;
1972 __asm__ ("implver %0" : "=r" (ver));
1973 __asm__ ("amask %1, %0" : "=r" (mask) : "r" (-1));
1974 printf("%ld-%x\n", ver, ~mask);
1975 return 0;
1978 $_cc -o "$TMPEXE" "$TMPC"
1979 case $("$TMPEXE") in
1981 0-0) proc="ev4"; _mvi="0";;
1982 1-0) proc="ev5"; _mvi="0";;
1983 1-1) proc="ev56"; _mvi="0";;
1984 1-101) proc="pca56"; _mvi="1";;
1985 2-303) proc="ev6"; _mvi="1";;
1986 2-307) proc="ev67"; _mvi="1";;
1987 2-1307) proc="ev68"; _mvi="1";;
1988 esac
1989 echores "$proc"
1991 echocheck "GCC & CPU optimization abilities"
1992 if test "$proc" = "ev68" ; then
1993 cc_check -mcpu=$proc || proc=ev67
1995 if test "$proc" = "ev67" ; then
1996 cc_check -mcpu=$proc || proc=ev6
1998 _mcpu="-mcpu=$proc"
1999 echores "$proc"
2001 test $_fast_clz = "auto" && _fast_clz=yes
2003 _optimizing="$proc"
2006 mips*)
2007 arch='mips'
2008 iproc='mips'
2010 test $_fast_clz = "auto" && _fast_clz=yes
2014 hppa)
2015 arch='pa_risc'
2016 iproc='PA-RISC'
2019 s390)
2020 arch='s390'
2021 iproc='390'
2024 s390x)
2025 arch='s390x'
2026 iproc='390x'
2029 vax)
2030 arch='vax'
2031 iproc='vax'
2034 xtensa)
2035 arch='xtensa'
2036 iproc='xtensa'
2039 generic)
2040 arch='generic'
2044 echo "The architecture of your CPU ($host_arch) is not supported by this configure script"
2045 echo "It seems nobody has ported MPlayer to your OS or CPU type yet."
2046 die "unsupported architecture $host_arch"
2048 esac # case "$host_arch" in
2050 if test "$_runtime_cpudetection" = yes ; then
2051 if x86 ; then
2052 test "$_cmov" != no && _cmov=yes
2053 x86_32 && _cmov=no
2054 test "$_mmx" != no && _mmx=yes
2055 test "$_3dnow" != no && _3dnow=yes
2056 test "$_3dnowext" != no && _3dnowext=yes
2057 test "$_mmxext" != no && _mmxext=yes
2058 test "$_sse" != no && _sse=yes
2059 test "$_sse2" != no && _sse2=yes
2060 test "$_ssse3" != no && _ssse3=yes
2062 if ppc; then
2063 _altivec=yes
2068 # endian testing
2069 echocheck "byte order"
2070 if test "$_big_endian" = auto ; then
2071 cat > $TMPC <<EOF
2072 short ascii_name[] = {
2073 'M' << 8 | 'P', 'l' << 8 | 'a', 'y' << 8 | 'e', 'r' << 8 | 'B',
2074 'i' << 8 | 'g', 'E' << 8 | 'n', 'd' << 8 | 'i', 'a' << 8 | 'n', 0 };
2075 int main(void) { return (long)ascii_name; }
2077 if cc_check ; then
2078 if strings $TMPEXE | grep -q -l MPlayerBigEndian ; then
2079 _big_endian=yes
2080 else
2081 _big_endian=no
2083 else
2084 echo ${_echo_n} "failed to autodetect byte order, defaulting to ${_echo_c}"
2087 if test "$_big_endian" = yes ; then
2088 _byte_order='big-endian'
2089 def_words_endian='#define WORDS_BIGENDIAN 1'
2090 def_bigendian='#define HAVE_BIGENDIAN 1'
2091 else
2092 _byte_order='little-endian'
2093 def_words_endian='#undef WORDS_BIGENDIAN'
2094 def_bigendian='#define HAVE_BIGENDIAN 0'
2096 echores "$_byte_order"
2099 echocheck "extern symbol prefix"
2100 cat > $TMPC << EOF
2101 int ff_extern;
2103 cc_check -c || die "Symbol mangling check failed."
2104 sym=$($_nm -P -g $TMPEXE)
2105 extern_prefix=${sym%%ff_extern*}
2106 def_extern_asm="#define EXTERN_ASM $extern_prefix"
2107 def_extern_prefix="#define EXTERN_PREFIX \"$extern_prefix\""
2108 echores $extern_prefix
2111 echocheck "assembler support of -pipe option"
2112 # -I. helps to detect compilers that just misunderstand -pipe like Sun C
2113 cflag_check -pipe -I. && _pipe="-pipe" && echores "yes" || echores "no"
2116 if darwin && test "$cc_vendor" = "gnu" ; then
2117 echocheck "GCC support of -mstackrealign"
2118 # GCC 4.2 and some earlier Apple versions support this flag on x86. Since
2119 # Mac OS X/Intel has an ABI different from Windows this is needed to avoid
2120 # crashes when loading Win32 DLLs. Unfortunately some gcc versions create
2121 # wrong code with this flag, but this can be worked around by adding
2122 # -fno-unit-at-a-time as described in the blog post at
2123 # http://www.dribin.org/dave/blog/archives/2006/12/05/missing_third_param/
2124 cat > $TMPC << EOF
2125 __attribute__((noinline)) static int foo3(int i1, int i2, int i3) { return i3; }
2126 int main(void) { return foo3(1, 2, 3) == 3 ? 0 : 1; }
2128 cc_check -O2 -mstackrealign && tmp_run && cflags_stackrealign=-mstackrealign
2129 test -z "$cflags_stackrealign" && cc_check -O2 -mstackrealign -fno-unit-at-a-time &&
2130 tmp_run && cflags_stackrealign="-mstackrealign -fno-unit-at-a-time"
2131 test -n "$cflags_stackrealign" && echores "yes" || echores "no"
2132 fi # if darwin && test "$cc_vendor" = "gnu" ; then
2135 # Checking for CFLAGS
2136 _install_strip="-s"
2137 if test "$_profile" != "" || test "$_debug" != "" ; then
2138 _install_strip=
2140 if test -z "$CFLAGS" ; then
2141 if test "$cc_vendor" = "intel" ; then
2142 CFLAGS="-O2 $_debug $_profile $_march $_mcpu $_pipe -fomit-frame-pointer"
2143 WARNFLAGS="-wd167 -wd556 -wd144"
2144 elif test "$cc_vendor" = "clang"; then
2145 CFLAGS="-O2 $_debug $_profile $_march $_pipe"
2146 WARNFLAGS="-Wall -Wno-switch-enum -Wno-logical-op-parentheses -Wpointer-arith -Wundef -Wno-pointer-sign -Wmissing-prototypes"
2147 ERRORFLAGS="-Werror=implicit-function-declaration"
2148 elif test "$cc_vendor" != "gnu" ; then
2149 CFLAGS="-O2 $_debug $_profile $_march $_mcpu $_pipe"
2150 else
2151 CFLAGS="-O2 $_debug $_profile $_march $_mcpu $_pipe -ffast-math -fomit-frame-pointer"
2152 WARNFLAGS="-Wall -Wno-switch -Wno-parentheses -Wpointer-arith -Wredundant-decls"
2153 ERRORFLAGS="-Werror-implicit-function-declaration"
2154 extra_ldflags="$extra_ldflags -ffast-math"
2156 else
2157 warn_cflags=yes
2160 if darwin && test "$cc_vendor" = "gnu" ; then
2161 extra_cflags="-falign-loops=16 -shared-libgcc $extra_cflags"
2164 if test "$cc_vendor" = "gnu" ; then
2165 cflag_check -Wundef && WARNFLAGS="-Wundef $WARNFLAGS"
2166 # -std=gnu99 is not a warning flag but is placed in WARN_CFLAGS because
2167 # that's the only variable specific to C now, and this option is not valid
2168 # for C++.
2169 cflag_check -std=gnu99 && WARN_CFLAGS="-std=gnu99 $WARN_CFLAGS"
2170 cflag_check -Wno-pointer-sign && WARN_CFLAGS="-Wno-pointer-sign $WARN_CFLAGS"
2171 cflag_check -Wdisabled-optimization && WARN_CFLAGS="-Wdisabled-optimization $WARN_CFLAGS"
2172 cflag_check -Wmissing-prototypes && WARN_CFLAGS="-Wmissing-prototypes $WARN_CFLAGS"
2173 cflag_check -Wstrict-prototypes && WARN_CFLAGS="-Wstrict-prototypes $WARN_CFLAGS"
2174 else
2175 CFLAGS="-D_ISOC99_SOURCE -D_BSD_SOURCE $CFLAGS"
2178 cflag_check -mno-omit-leaf-frame-pointer && cflags_no_omit_leaf_frame_pointer="-mno-omit-leaf-frame-pointer"
2179 cflag_check -MD -MP && DEPFLAGS="-MD -MP"
2182 if test -n "$LDFLAGS" ; then
2183 extra_ldflags="$extra_ldflags $LDFLAGS"
2184 warn_cflags=yes
2185 elif test "$cc_vendor" = "intel" ; then
2186 extra_ldflags="$extra_ldflags -i-static"
2188 if test -n "$CPPFLAGS" ; then
2189 extra_cflags="$extra_cflags $CPPFLAGS"
2190 warn_cflags=yes
2195 if x86_32 ; then
2196 # Checking assembler (_as) compatibility...
2197 # Added workaround for older as that reads from stdin by default - atmos
2198 as_version=$(echo '' | $_as -version 2>&1 | sed -n 's/^.*assembler \(version \)*\([0-9.]*\).*$/\2/p')
2199 echocheck "assembler ($_as $as_version)"
2201 _pref_as_version='2.9.1'
2202 echo 'nop' > $TMPS
2203 if test "$_mmx" = yes ; then
2204 echo 'emms' >> $TMPS
2206 if test "$_3dnow" = yes ; then
2207 _pref_as_version='2.10.1'
2208 echo 'femms' >> $TMPS
2210 if test "$_3dnowext" = yes ; then
2211 _pref_as_version='2.10.1'
2212 echo 'pswapd %mm0, %mm0' >> $TMPS
2214 if test "$_mmxext" = yes ; then
2215 _pref_as_version='2.10.1'
2216 echo 'movntq %mm0, (%eax)' >> $TMPS
2218 if test "$_sse" = yes ; then
2219 _pref_as_version='2.10.1'
2220 echo 'xorps %xmm0, %xmm0' >> $TMPS
2222 #if test "$_sse2" = yes ; then
2223 # _pref_as_version='2.11'
2224 # echo 'xorpd %xmm0, %xmm0' >> $TMPS
2226 if test "$_cmov" = yes ; then
2227 _pref_as_version='2.10.1'
2228 echo 'cmovb %eax, %ebx' >> $TMPS
2230 if test "$_ssse3" = yes ; then
2231 _pref_as_version='2.16.92'
2232 echo 'pabsd %xmm0, %xmm1' >> $TMPS
2234 $_as $TMPS -o $TMPEXE > /dev/null 2>&1 || as_verc_fail=yes
2236 if test "$as_verc_fail" != yes ; then
2237 echores "ok"
2238 else
2239 res_comment="Upgrade binutils to ${_pref_as_version} or use --disable-ssse3 etc."
2240 echores "failed"
2241 die "obsolete binutils version"
2244 fi #if x86_32
2247 echocheck "PIC"
2248 pic=no
2249 cat > $TMPC << EOF
2250 int main(void) {
2251 #if !(defined(__PIC__) || defined(__pic__) || defined(PIC))
2252 #error PIC not enabled
2253 #endif
2254 return 0;
2257 cc_check && pic=yes && extra_cflags="$extra_cflags -DPIC"
2258 echores $pic
2261 if x86 ; then
2263 echocheck ".align is a power of two"
2264 if test "$_asmalign_pot" = auto ; then
2265 _asmalign_pot=no
2266 inline_asm_check '".align 3"' && _asmalign_pot=yes
2268 if test "$_asmalign_pot" = "yes" ; then
2269 def_asmalign_pot='#define ASMALIGN(ZEROBITS) ".align " #ZEROBITS "\n\t"'
2270 else
2271 def_asmalign_pot='#define ASMALIGN(ZEROBITS) ".align 1<<" #ZEROBITS "\n\t"'
2273 echores $_asmalign_pot
2276 echocheck "ebx availability"
2277 ebx_available=no
2278 def_ebx_available='#define HAVE_EBX_AVAILABLE 0'
2279 cat > $TMPC << EOF
2280 int main(void) {
2281 int x;
2282 __asm__ volatile(
2283 "xor %0, %0"
2284 :"=b"(x)
2285 // just adding ebx to clobber list seems unreliable with some
2286 // compilers, e.g. Haiku's gcc 2.95
2288 // and the above check does not work for OSX 64 bit...
2289 __asm__ volatile("":::"%ebx");
2290 return 0;
2293 cc_check && ebx_available=yes && def_ebx_available='#define HAVE_EBX_AVAILABLE 1'
2294 echores $ebx_available
2297 echocheck "yasm"
2298 if test -z "$YASMFLAGS" ; then
2299 if darwin ; then
2300 x86_64 && objformat="macho64" || objformat="macho"
2301 elif win32 ; then
2302 objformat="win32"
2303 else
2304 objformat="elf"
2306 # currently tested for Linux x86, x86_64
2307 YASMFLAGS="-f $objformat"
2308 x86_64 && YASMFLAGS="$YASMFLAGS -DARCH_X86_64 -m amd64"
2309 test "$pic" = "yes" && YASMFLAGS="$YASMFLAGS -DPIC"
2310 case "$objformat" in
2311 elf) test $_debug && YASMFLAGS="$YASMFLAGS -g dwarf2" ;;
2312 *) YASMFLAGS="$YASMFLAGS -DPREFIX" ;;
2313 esac
2314 else
2315 warn_cflags=yes
2318 echo "pabsw xmm0, xmm0" > $TMPS
2319 yasm_check || _yasm=""
2320 if test $_yasm ; then
2321 def_yasm='#define HAVE_YASM 1'
2322 have_yasm="yes"
2323 echores "$_yasm"
2324 else
2325 def_yasm='#define HAVE_YASM 0'
2326 have_yasm="no"
2327 echores "no"
2330 echocheck "bswap"
2331 def_bswap='#define HAVE_BSWAP 0'
2332 echo 'bswap %eax' > $TMPS
2333 $_as $TMPS -o $TMPEXE > /dev/null 2>&1 && def_bswap='#define HAVE_BSWAP 1' && bswap=yes || bswap=no
2334 echores "$bswap"
2335 fi #if x86
2338 #FIXME: This should happen before the check for CFLAGS..
2339 def_altivec_h='#define HAVE_ALTIVEC_H 0'
2340 if ppc && ( test "$_altivec" = yes || test "$_runtime_cpudetection" = yes ) ; then
2342 # check if AltiVec is supported by the compiler, and how to enable it
2343 echocheck "GCC AltiVec flags"
2344 if $(cflag_check -maltivec -mabi=altivec) ; then
2345 _altivec_gcc_flags="-maltivec -mabi=altivec"
2346 # check if <altivec.h> should be included
2347 if $(header_check altivec.h $_altivec_gcc_flags) ; then
2348 def_altivec_h='#define HAVE_ALTIVEC_H 1'
2349 inc_altivec_h='#include <altivec.h>'
2350 else
2351 if $(cflag_check -faltivec) ; then
2352 _altivec_gcc_flags="-faltivec"
2353 else
2354 _altivec=no
2355 _altivec_gcc_flags="none, AltiVec disabled"
2359 echores "$_altivec_gcc_flags"
2361 # check if the compiler supports braces for vector declarations
2362 cat > $TMPC << EOF
2363 $inc_altivec_h
2364 int main(void) { (vector int) {1}; return 0; }
2366 cc_check $_altivec_gcc_flags || die "You need a compiler that supports {} in AltiVec vector declarations."
2368 # Disable runtime cpudetection if we cannot generate AltiVec code or
2369 # AltiVec is disabled by the user.
2370 test "$_runtime_cpudetection" = yes && test "$_altivec" = no \
2371 && _runtime_cpudetection=no
2373 # Show that we are optimizing for AltiVec (if enabled and supported).
2374 test "$_runtime_cpudetection" = no && test "$_altivec" = yes \
2375 && _optimizing="$_optimizing altivec"
2377 # If AltiVec is enabled, make sure the correct flags turn up in CFLAGS.
2378 test "$_altivec" = yes && CFLAGS="$CFLAGS $_altivec_gcc_flags"
2381 if ppc ; then
2382 def_xform_asm='#define HAVE_XFORM_ASM 0'
2383 xform_asm=no
2384 echocheck "XFORM ASM support"
2385 inline_asm_check '"lwzx %1, %y0" :: "Z"(*(int*)0), "r"(0)' &&
2386 xform_asm=yes && def_xform_asm='#define HAVE_XFORM_ASM 1'
2387 echores "$xform_asm"
2390 if arm ; then
2391 echocheck "ARMv5TE (Enhanced DSP Extensions)"
2392 if test $_armv5te = "auto" ; then
2393 _armv5te=no
2394 inline_asm_check '"qadd r0, r0, r0"' && _armv5te=yes
2396 echores "$_armv5te"
2398 test $_armv5te = "yes" && test $_fast_clz = "auto" && _fast_clz=yes
2400 echocheck "ARMv6 (SIMD instructions)"
2401 if test $_armv6 = "auto" ; then
2402 _armv6=no
2403 inline_asm_check '"sadd16 r0, r0, r0"' && _armv6=yes
2405 echores "$_armv6"
2407 echocheck "ARMv6t2 (SIMD instructions)"
2408 if test $_armv6t2 = "auto" ; then
2409 _armv6t2=no
2410 inline_asm_check '"movt r0, #0"' && _armv6t2=yes
2412 echores "$_armv6t2"
2414 echocheck "ARM VFP"
2415 if test $_armvfp = "auto" ; then
2416 _armvfp=no
2417 inline_asm_check '"fadds s0, s0, s0"' && _armvfp=yes
2419 echores "$_armvfp"
2421 echocheck "ARM NEON"
2422 if test $neon = "auto" ; then
2423 neon=no
2424 inline_asm_check '"vadd.i16 q0, q0, q0"' && neon=yes
2426 echores "$neon"
2428 echocheck "iWMMXt (Intel XScale SIMD instructions)"
2429 if test $_iwmmxt = "auto" ; then
2430 _iwmmxt=no
2431 inline_asm_check '"wunpckelub wr6, wr4"' && _iwmmxt=yes
2433 echores "$_iwmmxt"
2436 cpuexts_all='ALTIVEC MMX MMX2 AMD3DNOW AMD3DNOWEXT SSE SSE2 SSSE3 FAST_CMOV CMOV FAST_CLZ ARMV5TE ARMV6 ARMV6T2 ARMVFP NEON IWMMXT MMI VIS MVI'
2437 test "$_altivec" = yes && cpuexts="ALTIVEC $cpuexts"
2438 test "$_mmx" = yes && cpuexts="MMX $cpuexts"
2439 test "$_mmxext" = yes && cpuexts="MMX2 $cpuexts"
2440 test "$_3dnow" = yes && cpuexts="AMD3DNOW $cpuexts"
2441 test "$_3dnowext" = yes && cpuexts="AMD3DNOWEXT $cpuexts"
2442 test "$_sse" = yes && cpuexts="SSE $cpuexts"
2443 test "$_sse2" = yes && cpuexts="SSE2 $cpuexts"
2444 test "$_ssse3" = yes && cpuexts="SSSE3 $cpuexts"
2445 test "$_cmov" = yes && cpuexts="CMOV $cpuexts"
2446 test "$_fast_cmov" = yes && cpuexts="FAST_CMOV $cpuexts"
2447 test "$_fast_clz" = yes && cpuexts="FAST_CLZ $cpuexts"
2448 test "$_armv5te" = yes && cpuexts="ARMV5TE $cpuexts"
2449 test "$_armv6" = yes && cpuexts="ARMV6 $cpuexts"
2450 test "$_armv6t2" = yes && cpuexts="ARMV6T2 $cpuexts"
2451 test "$_armvfp" = yes && cpuexts="ARMVFP $cpuexts"
2452 test "$neon" = yes && cpuexts="NEON $cpuexts"
2453 test "$_iwmmxt" = yes && cpuexts="IWMMXT $cpuexts"
2454 test "$_vis" = yes && cpuexts="VIS $cpuexts"
2455 test "$_mvi" = yes && cpuexts="MVI $cpuexts"
2457 # Checking kernel version...
2458 if x86_32 && linux ; then
2459 _k_verc_problem=no
2460 kernel_version=$(uname -r 2>&1)
2461 echocheck "$system_name kernel version"
2462 case "$kernel_version" in
2463 '') kernel_version="?.??"; _k_verc_fail=yes;;
2464 [0-1].[0-9].[0-9]*|2.[0-3].[0-9]*)
2465 _k_verc_problem=yes;;
2466 esac
2467 if test "$_k_verc_problem" = yes && test "$_sse" = yes ; then
2468 _k_verc_fail=yes
2470 if test "$_k_verc_fail" ; then
2471 echores "$kernel_version, fail"
2472 echo "WARNING! If you want to run MPlayer on this system, get prepared for problems!"
2473 echo "2.2.x has limited SSE support. Upgrade the kernel or use --disable-sse if you"
2474 echo "experience crashes. MPlayer tries to autodetect if your kernel correctly"
2475 echo "supports SSE, but you have been warned! If you are using a kernel older than"
2476 echo "2.2.x you must upgrade it to get SSE support!"
2477 # die "Your kernel is too old for this CPU." # works fine on some 2.2.x so don't die (later check will test)
2478 else
2479 echores "$kernel_version, ok"
2483 ######################
2484 # MAIN TESTS GO HERE #
2485 ######################
2488 echocheck "-lposix"
2489 if cflag_check -lposix ; then
2490 extra_ldflags="$extra_ldflags -lposix"
2491 echores "yes"
2492 else
2493 echores "no"
2496 echocheck "-lm"
2497 if cflag_check -lm ; then
2498 _ld_lm="-lm"
2499 echores "yes"
2500 else
2501 _ld_lm=""
2502 echores "no"
2506 echocheck "langinfo"
2507 if test "$_langinfo" = auto ; then
2508 _langinfo=no
2509 statement_check langinfo.h 'nl_langinfo(CODESET)' && _langinfo=yes
2511 if test "$_langinfo" = yes ; then
2512 def_langinfo='#define HAVE_LANGINFO 1'
2513 else
2514 def_langinfo='#undef HAVE_LANGINFO'
2516 echores "$_langinfo"
2519 echocheck "translation support"
2520 if test "$_translation" = yes; then
2521 def_translation="#define CONFIG_TRANSLATION 1"
2522 else
2523 def_translation="#undef CONFIG_TRANSLATION"
2525 echores "$_translation"
2527 echocheck "language"
2528 # Set preferred languages, "all" uses English as main language.
2529 test -z "$language" && language=$LINGUAS
2530 test -z "$language_doc" && language_doc=$language
2531 test -z "$language_man" && language_man=$language
2532 test -z "$language_msg" && language_msg=$language
2533 test -z "$language_msg" && language_msg="all"
2534 language_doc=$(echo $language_doc | tr , " ")
2535 language_man=$(echo $language_man | tr , " ")
2536 language_msg=$(echo $language_msg | tr , " ")
2538 test "$language_doc" = "all" && language_doc=$doc_lang_all
2539 test "$language_man" = "all" && language_man=$man_lang_all
2540 test "$language_msg" = "all" && language_msg=$msg_lang_all
2542 if test "$_translation" != yes ; then
2543 language_msg=""
2546 # Prune non-existing translations from language lists.
2547 # Set message translation to the first available language.
2548 # Fall back on English.
2549 for lang in $language_doc ; do
2550 test -d DOCS/xml/$lang && tmp_language_doc="$tmp_language_doc $lang"
2551 done
2552 language_doc=$tmp_language_doc
2553 test -z "$language_doc" && language_doc=en
2555 for lang in $language_man ; do
2556 test -d DOCS/man/$lang && tmp_language_man="$tmp_language_man $lang"
2557 done
2558 language_man=$tmp_language_man
2559 test -z "$language_man" && language_man=en
2561 for lang in $language_msg ; do
2562 test -f po/$lang.po && tmp_language_msg="$tmp_language_msg $lang"
2563 done
2564 language_msg=$tmp_language_msg
2566 echores "messages (en+): $language_msg - man pages: $language_man - documentation: $language_doc"
2569 echocheck "enable sighandler"
2570 if test "$_sighandler" = yes ; then
2571 def_sighandler='#define CONFIG_SIGHANDLER 1'
2572 else
2573 def_sighandler='#undef CONFIG_SIGHANDLER'
2575 echores "$_sighandler"
2577 echocheck "runtime cpudetection"
2578 if test "$_runtime_cpudetection" = yes ; then
2579 _optimizing="Runtime CPU-Detection enabled"
2580 def_runtime_cpudetection='#define CONFIG_RUNTIME_CPUDETECT 1'
2581 else
2582 def_runtime_cpudetection='#define CONFIG_RUNTIME_CPUDETECT 0'
2584 echores "$_runtime_cpudetection"
2587 echocheck "restrict keyword"
2588 for restrict_keyword in restrict __restrict __restrict__ ; do
2589 echo "void foo(char * $restrict_keyword p); int main(void) { return 0; }" > $TMPC
2590 if cc_check; then
2591 def_restrict_keyword=$restrict_keyword
2592 break;
2594 done
2595 if [ -n "$def_restrict_keyword" ]; then
2596 echores "$def_restrict_keyword"
2597 else
2598 echores "none"
2600 # Avoid infinite recursion loop ("#define restrict restrict")
2601 if [ "$def_restrict_keyword" != "restrict" ]; then
2602 def_restrict_keyword="#define restrict $def_restrict_keyword"
2603 else
2604 def_restrict_keyword=""
2608 echocheck "__builtin_expect"
2609 # GCC branch prediction hint
2610 cat > $TMPC << EOF
2611 static int foo(int a) {
2612 a = __builtin_expect(a, 10);
2613 return a == 10 ? 0 : 1;
2615 int main(void) { return foo(10) && foo(0); }
2617 _builtin_expect=no
2618 cc_check && _builtin_expect=yes
2619 if test "$_builtin_expect" = yes ; then
2620 def_builtin_expect='#define HAVE_BUILTIN_EXPECT 1'
2621 else
2622 def_builtin_expect='#undef HAVE_BUILTIN_EXPECT'
2624 echores "$_builtin_expect"
2627 echocheck "kstat"
2628 _kstat=no
2629 statement_check kstat.h 'kstat_open()' -lkstat && _kstat=yes
2630 if test "$_kstat" = yes ; then
2631 def_kstat="#define HAVE_LIBKSTAT 1"
2632 extra_ldflags="$extra_ldflags -lkstat"
2633 else
2634 def_kstat="#undef HAVE_LIBKSTAT"
2636 echores "$_kstat"
2639 echocheck "posix4"
2640 # required for nanosleep on some systems
2641 _posix4=no
2642 statement_check time.h 'nanosleep(0, 0)' -lposix4 && _posix4=yes
2643 if test "$_posix4" = yes ; then
2644 extra_ldflags="$extra_ldflags -lposix4"
2646 echores "$_posix4"
2648 for func in exp2 exp2f llrint log2 log2f lrint lrintf round roundf truncf; do
2649 echocheck $func
2650 eval _$func=no
2651 statement_check math.h "${func}(2.0)" -D_ISOC99_SOURCE $_ld_lm && eval _$func=yes
2652 if eval test "x\$_$func" = "xyes"; then
2653 eval def_$func="\"#define HAVE_$(echo $func | tr '[a-z]' '[A-Z]') 1\""
2654 echores yes
2655 else
2656 eval def_$func="\"#define HAVE_$(echo $func | tr '[a-z]' '[A-Z]') 0\""
2657 echores no
2659 done
2662 echocheck "mkstemp"
2663 _mkstemp=no
2664 define_statement_check "_XOPEN_SOURCE 600" "stdlib.h" 'mkstemp("")' && _mkstemp=yes
2665 if test "$_mkstemp" = yes ; then
2666 def_mkstemp='#define HAVE_MKSTEMP 1'
2667 else
2668 def_mkstemp='#define HAVE_MKSTEMP 0'
2670 echores "$_mkstemp"
2673 echocheck "nanosleep"
2674 _nanosleep=no
2675 statement_check time.h 'nanosleep(0, 0)' && _nanosleep=yes
2676 if test "$_nanosleep" = yes ; then
2677 def_nanosleep='#define HAVE_NANOSLEEP 1'
2678 else
2679 def_nanosleep='#undef HAVE_NANOSLEEP'
2681 echores "$_nanosleep"
2684 echocheck "socklib"
2685 # for Solaris (socket stuff is in -lsocket, gethostbyname and friends in -lnsl):
2686 # for BeOS (socket stuff is in -lsocket, gethostbyname and friends in -lbind):
2687 cat > $TMPC << EOF
2688 #include <netdb.h>
2689 #include <sys/socket.h>
2690 int main(void) { gethostbyname(0); socket(AF_INET, SOCK_STREAM, 0); return 0; }
2692 _socklib=no
2693 for _ld_tmp in "" "-lsocket -lbind" "-lsocket -ldnet" "-lsocket -lnsl" "-lnsl" "-lsocket" ; do
2694 cc_check $_ld_tmp && _ld_sock="$_ld_tmp" && _socklib=yes && break
2695 done
2696 test $_socklib = yes && test $_winsock2_h = auto && _winsock2_h=no
2697 if test $_winsock2_h = auto ; then
2698 _winsock2_h=no
2699 statement_check winsock2.h 'gethostbyname(0)' -lws2_32 && _ld_sock="-lws2_32" && _winsock2_h=yes
2701 test "$_ld_sock" && res_comment="using $_ld_sock"
2702 echores "$_socklib"
2705 if test $_winsock2_h = yes ; then
2706 _ld_sock="-lws2_32"
2707 def_winsock2_h='#define HAVE_WINSOCK2_H 1'
2708 else
2709 def_winsock2_h='#define HAVE_WINSOCK2_H 0'
2713 echocheck "arpa/inet.h"
2714 arpa_inet_h=no
2715 def_arpa_inet_h='#define HAVE_ARPA_INET_H 0'
2716 header_check arpa/inet.h && arpa_inet_h=yes &&
2717 def_arpa_inet_h='#define HAVE_ARPA_INET_H 1'
2718 echores "$arpa_inet_h"
2721 echocheck "inet_pton()"
2722 def_inet_pton='#define HAVE_INET_PTON 0'
2723 inet_pton=no
2724 for _ld_tmp in "$_ld_sock" "$_ld_sock -lresolv" ; do
2725 statement_check arpa/inet.h 'inet_pton(0, 0, 0)' $_ld_tmp && inet_pton=yes && break
2726 done
2727 if test $inet_pton = yes ; then
2728 test "$_ld_tmp" && res_comment="using $_ld_tmp"
2729 def_inet_pton='#define HAVE_INET_PTON 1'
2731 echores "$inet_pton"
2734 echocheck "inet_aton()"
2735 def_inet_aton='#define HAVE_INET_ATON 0'
2736 inet_aton=no
2737 for _ld_tmp in "$_ld_sock" "$_ld_sock -lresolv" ; do
2738 statement_check arpa/inet.h 'inet_aton(0, 0)' $_ld_tmp && inet_aton=yes && break
2739 done
2740 if test $inet_aton = yes ; then
2741 test "$_ld_tmp" && res_comment="using $_ld_tmp"
2742 def_inet_aton='#define HAVE_INET_ATON 1'
2744 echores "$inet_aton"
2747 echocheck "socklen_t"
2748 _socklen_t=no
2749 for header in "sys/socket.h" "ws2tcpip.h" "sys/types.h" ; do
2750 statement_check $header 'socklen_t v = 0' && _socklen_t=yes && break
2751 done
2752 if test "$_socklen_t" = yes ; then
2753 def_socklen_t='#define HAVE_SOCKLEN_T 1'
2754 else
2755 def_socklen_t='#define HAVE_SOCKLEN_T 0'
2757 echores "$_socklen_t"
2760 echocheck "closesocket()"
2761 _closesocket=no
2762 statement_check winsock2.h 'closesocket(~0)' $_ld_sock && _closesocket=yes
2763 if test "$_closesocket" = yes ; then
2764 def_closesocket='#define HAVE_CLOSESOCKET 1'
2765 else
2766 def_closesocket='#define HAVE_CLOSESOCKET 0'
2768 echores "$_closesocket"
2771 echocheck "networking"
2772 test $_winsock2_h = no && test $inet_pton = no &&
2773 test $inet_aton = no && networking=no
2774 if test "$networking" = yes ; then
2775 def_network='#define CONFIG_NETWORK 1'
2776 def_networking='#define CONFIG_NETWORKING 1'
2777 extra_ldflags="$extra_ldflags $_ld_sock"
2778 inputmodules="networking $inputmodules"
2779 else
2780 noinputmodules="networking $noinputmodules"
2781 def_network='#define CONFIG_NETWORK 0'
2782 def_networking='#undef CONFIG_NETWORKING'
2784 echores "$networking"
2787 echocheck "inet6"
2788 if test "$_inet6" = auto ; then
2789 cat > $TMPC << EOF
2790 #include <sys/types.h>
2791 #if !defined(_WIN32)
2792 #include <sys/socket.h>
2793 #include <netinet/in.h>
2794 #else
2795 #include <ws2tcpip.h>
2796 #endif
2797 int main(void) { struct sockaddr_in6 six; socket(AF_INET6, SOCK_STREAM, AF_INET6); return 0; }
2799 _inet6=no
2800 if cc_check $_ld_sock ; then
2801 _inet6=yes
2804 if test "$_inet6" = yes ; then
2805 def_inet6='#define HAVE_AF_INET6 1'
2806 else
2807 def_inet6='#undef HAVE_AF_INET6'
2809 echores "$_inet6"
2812 echocheck "gethostbyname2"
2813 if test "$_gethostbyname2" = auto ; then
2814 cat > $TMPC << EOF
2815 #include <sys/types.h>
2816 #include <sys/socket.h>
2817 #include <netdb.h>
2818 int main(void) { gethostbyname2("", AF_INET); return 0; }
2820 _gethostbyname2=no
2821 if cc_check ; then
2822 _gethostbyname2=yes
2825 if test "$_gethostbyname2" = yes ; then
2826 def_gethostbyname2='#define HAVE_GETHOSTBYNAME2 1'
2827 else
2828 def_gethostbyname2='#undef HAVE_GETHOSTBYNAME2'
2830 echores "$_gethostbyname2"
2833 echocheck "inttypes.h (required)"
2834 _inttypes=no
2835 header_check inttypes.h && _inttypes=yes
2836 echores "$_inttypes"
2838 if test "$_inttypes" = no ; then
2839 echocheck "sys/bitypes.h (inttypes.h predecessor)"
2840 header_check sys/bitypes.h && _inttypes=yes
2841 if test "$_inttypes" = yes ; then
2842 die "You don't have inttypes.h, but sys/bitypes.h is present. Please copy etc/inttypes.h into the include path, and re-run configure."
2843 else
2844 die "Cannot find header either inttypes.h or bitypes.h. There is no chance for compilation to succeed."
2849 echocheck "malloc.h"
2850 _malloc=no
2851 header_check malloc.h && _malloc=yes
2852 if test "$_malloc" = yes ; then
2853 def_malloc_h='#define HAVE_MALLOC_H 1'
2854 else
2855 def_malloc_h='#define HAVE_MALLOC_H 0'
2857 echores "$_malloc"
2860 echocheck "memalign()"
2861 # XXX restrict to x86 ? extend to other CPUs/cacheline sizes ?
2862 def_memalign_hack='#define CONFIG_MEMALIGN_HACK 0'
2863 _memalign=no
2864 statement_check malloc.h 'memalign(64, sizeof(char))' && _memalign=yes
2865 if test "$_memalign" = yes ; then
2866 def_memalign='#define HAVE_MEMALIGN 1'
2867 else
2868 def_memalign='#define HAVE_MEMALIGN 0'
2869 def_map_memalign='#define memalign(a, b) malloc(b)'
2870 darwin || def_memalign_hack='#define CONFIG_MEMALIGN_HACK 1'
2872 echores "$_memalign"
2875 echocheck "posix_memalign()"
2876 posix_memalign=no
2877 def_posix_memalign='#define HAVE_POSIX_MEMALIGN 0'
2878 define_statement_check "_XOPEN_SOURCE 600" "stdlib.h" 'posix_memalign(NULL, 0, 0)' &&
2879 posix_memalign=yes && def_posix_memalign='#define HAVE_POSIX_MEMALIGN 1'
2880 echores "$posix_memalign"
2883 echocheck "alloca.h"
2884 _alloca=no
2885 statement_check alloca.h 'alloca(0)' && _alloca=yes
2886 if cc_check ; then
2887 def_alloca_h='#define HAVE_ALLOCA_H 1'
2888 else
2889 def_alloca_h='#undef HAVE_ALLOCA_H'
2891 echores "$_alloca"
2894 echocheck "fastmemcpy"
2895 if test "$_fastmemcpy" = yes ; then
2896 def_fastmemcpy='#define CONFIG_FASTMEMCPY 1'
2897 else
2898 def_fastmemcpy='#undef CONFIG_FASTMEMCPY'
2900 echores "$_fastmemcpy"
2903 echocheck "mman.h"
2904 _mman=no
2905 statement_check sys/mman.h 'mmap(0, 0, 0, 0, 0, 0)' && _mman=yes
2906 if test "$_mman" = yes ; then
2907 def_mman_h='#define HAVE_SYS_MMAN_H 1'
2908 else
2909 def_mman_h='#undef HAVE_SYS_MMAN_H'
2911 echores "$_mman"
2913 _mman_has_map_failed=no
2914 statement_check sys/mman.h 'void *p = MAP_FAILED' && _mman_has_map_failed=yes
2915 if test "$_mman_has_map_failed" = yes ; then
2916 def_mman_has_map_failed=''
2917 else
2918 def_mman_has_map_failed='#define MAP_FAILED ((void *) -1)'
2921 echocheck "dynamic loader"
2922 _dl=no
2923 for _ld_tmp in "" "-ldl"; do
2924 statement_check dlfcn.h 'dlopen("", 0)' $_ld_tmp && _ld_dl="$_ld_tmp" && _dl=yes && break
2925 done
2926 if test "$_dl" = yes ; then
2927 def_dl='#define HAVE_LIBDL 1'
2928 else
2929 def_dl='#undef HAVE_LIBDL'
2931 echores "$_dl"
2934 def_threads='#define HAVE_THREADS 0'
2936 echocheck "pthread"
2937 if linux ; then
2938 THREAD_CFLAGS=-D_REENTRANT
2939 elif freebsd || netbsd || openbsd || bsdos ; then
2940 THREAD_CFLAGS=-D_THREAD_SAFE
2942 if test "$_pthreads" = auto ; then
2943 cat > $TMPC << EOF
2944 #include <pthread.h>
2945 static void *func(void *arg) { return arg; }
2946 int main(void) {
2947 pthread_t tid;
2948 #ifdef PTW32_STATIC_LIB
2949 pthread_win32_process_attach_np();
2950 pthread_win32_thread_attach_np();
2951 #endif
2952 return pthread_create (&tid, 0, func, 0) != 0;
2955 _pthreads=no
2956 if ! hpux ; then
2957 for _ld_tmp in "-lpthreadGC2" "" "-lpthread" "-pthread" ; do
2958 # for crosscompilation, we cannot execute the program, be happy if we can link statically
2959 cc_check $THREAD_CFLAGS $_ld_tmp && (tmp_run || test "$_ld_static") && _ld_pthread="$_ld_tmp" && _pthreads=yes && break
2960 done
2961 if test "$_pthreads" = no && mingw32 ; then
2962 _ld_tmp="-lpthreadGC2 -lws2_32"
2963 cc_check $_ld_tmp -DPTW32_STATIC_LIB && (tmp_run || test "$_ld_static") && _ld_pthread="$_ld_tmp" && _pthreads=yes && CFLAGS="$CFLAGS -DPTW32_STATIC_LIB"
2967 if test "$_pthreads" = yes ; then
2968 test $_ld_pthread && res_comment="using $_ld_pthread"
2969 def_pthreads='#define HAVE_PTHREADS 1'
2970 def_threads='#define HAVE_THREADS 1'
2971 extra_cflags="$extra_cflags $THREAD_CFLAGS"
2972 else
2973 res_comment="v4l, v4l2, ao_nas, win32 loader disabled"
2974 def_pthreads='#undef HAVE_PTHREADS'
2975 _nas=no ; _tv_v4l1=no ; _tv_v4l2=no
2976 mingw32 || _win32dll=no
2978 echores "$_pthreads"
2980 if cygwin ; then
2981 if test "$_pthreads" = yes ; then
2982 def_pthread_cache="#define PTHREAD_CACHE 1"
2983 else
2984 _stream_cache=no
2985 def_stream_cache="#undef CONFIG_STREAM_CACHE"
2989 echocheck "w32threads"
2990 if test "$_pthreads" = yes ; then
2991 res_comment="using pthread instead"
2992 _w32threads=no
2994 if test "$_w32threads" = auto ; then
2995 _w32threads=no
2996 mingw32 && _w32threads=yes
2998 test "$_w32threads" = yes && def_threads='#define HAVE_THREADS 1'
2999 echores "$_w32threads"
3001 echocheck "rpath"
3002 if test "$_rpath" = yes ; then
3003 for I in $(echo $extra_ldflags | sed 's/-L//g') ; do
3004 tmp="$tmp $(echo $I | sed 's/.*/ -L& -Wl,-R&/')"
3005 done
3006 extra_ldflags=$tmp
3008 echores "$_rpath"
3010 echocheck "iconv"
3011 if test "$_iconv" = auto ; then
3012 cat > $TMPC << EOF
3013 #include <stdio.h>
3014 #include <unistd.h>
3015 #include <iconv.h>
3016 #define INBUFSIZE 1024
3017 #define OUTBUFSIZE 4096
3019 char inbuffer[INBUFSIZE];
3020 char outbuffer[OUTBUFSIZE];
3022 int main(void) {
3023 size_t numread;
3024 iconv_t icdsc;
3025 char *tocode="UTF-8";
3026 char *fromcode="cp1250";
3027 if ((icdsc = iconv_open(tocode, fromcode)) != (iconv_t)(-1)) {
3028 while ((numread = read(0, inbuffer, INBUFSIZE))) {
3029 char *iptr=inbuffer;
3030 char *optr=outbuffer;
3031 size_t inleft=numread;
3032 size_t outleft=OUTBUFSIZE;
3033 if (iconv(icdsc, &iptr, &inleft, &optr, &outleft)
3034 != (size_t)(-1)) {
3035 write(1, outbuffer, OUTBUFSIZE - outleft);
3038 if (iconv_close(icdsc) == -1)
3041 return 0;
3044 _iconv=no
3045 for _ld_tmp in "" "-liconv" "-liconv $_ld_dl" ; do
3046 cc_check $_ld_lm $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" &&
3047 _iconv=yes && break
3048 done
3049 if test "$_iconv" != yes ; then
3050 die "Unable to find iconv which should be part of standard compilation environment. Aborting. If you really mean to compile without iconv support use --disable-iconv."
3053 if test "$_iconv" = yes ; then
3054 def_iconv='#define CONFIG_ICONV 1'
3055 else
3056 def_iconv='#undef CONFIG_ICONV'
3058 echores "$_iconv"
3061 echocheck "soundcard.h"
3062 _soundcard_h=no
3063 def_soundcard_h='#undef HAVE_SOUNDCARD_H'
3064 def_sys_soundcard_h='#undef HAVE_SYS_SOUNDCARD_H'
3065 for _soundcard_header in "sys/soundcard.h" "soundcard.h"; do
3066 header_check $_soundcard_header && _soundcard_h=yes &&
3067 res_comment="$_soundcard_header" && break
3068 done
3070 if test "$_soundcard_h" = yes ; then
3071 if test $_soundcard_header = "sys/soundcard.h"; then
3072 def_sys_soundcard_h='#define HAVE_SYS_SOUNDCARD_H 1'
3073 else
3074 def_soundcard_h='#define HAVE_SOUNDCARD_H 1'
3077 echores "$_soundcard_h"
3080 echocheck "sys/videoio.h"
3081 sys_videoio_h=no
3082 def_sys_videoio_h='#undef HAVE_SYS_VIDEOIO_H'
3083 header_check sys/videoio.h && sys_videoio_h=yes &&
3084 def_sys_videoio_h='#define HAVE_SYS_VIDEOIO_H 1'
3085 echores "$sys_videoio_h"
3088 echocheck "sys/dvdio.h"
3089 _dvdio=no
3090 # FreeBSD 8.1 has broken dvdio.h
3091 header_check_broken sys/types.h sys/dvdio.h && _dvdio=yes
3092 if test "$_dvdio" = yes ; then
3093 def_dvdio='#define DVD_STRUCT_IN_SYS_DVDIO_H 1'
3094 else
3095 def_dvdio='#undef DVD_STRUCT_IN_SYS_DVDIO_H'
3097 echores "$_dvdio"
3100 echocheck "sys/cdio.h"
3101 _cdio=no
3102 # at least OpenSolaris has a broken cdio.h
3103 header_check_broken sys/types.h sys/cdio.h && _cdio=yes
3104 if test "$_cdio" = yes ; then
3105 def_cdio='#define DVD_STRUCT_IN_SYS_CDIO_H 1'
3106 else
3107 def_cdio='#undef DVD_STRUCT_IN_SYS_CDIO_H'
3109 echores "$_cdio"
3112 echocheck "linux/cdrom.h"
3113 _cdrom=no
3114 header_check linux/cdrom.h && _cdrom=yes
3115 if test "$_cdrom" = yes ; then
3116 def_cdrom='#define DVD_STRUCT_IN_LINUX_CDROM_H 1'
3117 else
3118 def_cdrom='#undef DVD_STRUCT_IN_LINUX_CDROM_H'
3120 echores "$_cdrom"
3123 echocheck "dvd.h"
3124 _dvd=no
3125 header_check dvd.h && _dvd=yes
3126 if test "$_dvd" = yes ; then
3127 def_dvd='#define DVD_STRUCT_IN_DVD_H 1'
3128 else
3129 def_dvd='#undef DVD_STRUCT_IN_DVD_H'
3131 echores "$_dvd"
3134 if bsdos; then
3135 echocheck "BSDI dvd.h"
3136 _bsdi_dvd=no
3137 header_check dvd.h && _bsdi_dvd=yes
3138 if test "$_bsdi_dvd" = yes ; then
3139 def_bsdi_dvd='#define DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H 1'
3140 else
3141 def_bsdi_dvd='#undef DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H'
3143 echores "$_bsdi_dvd"
3144 fi #if bsdos
3147 if hpux; then
3148 # also used by AIX, but AIX does not support VCD and/or libdvdread
3149 echocheck "HP-UX SCSI header"
3150 _hpux_scsi_h=no
3151 header_check sys/scsi.h && _hpux_scsi_h=yes
3152 if test "$_hpux_scsi_h" = yes ; then
3153 def_hpux_scsi_h='#define HPUX_SCTL_IO 1'
3154 else
3155 def_hpux_scsi_h='#undef HPUX_SCTL_IO'
3157 echores "$_hpux_scsi_h"
3158 fi #if hpux
3161 echocheck "termcap"
3162 if test "$_termcap" = auto ; then
3163 _termcap=no
3164 for _ld_tmp in "-lncurses" "-ltinfo" "-ltermcap"; do
3165 statement_check term.h 'tgetent(0, 0)' $_ld_tmp &&
3166 extra_ldflags="$extra_ldflags $_ld_tmp" && _termcap=yes && break
3167 done
3169 if test "$_termcap" = yes ; then
3170 def_termcap='#define HAVE_TERMCAP 1'
3171 test $_ld_tmp && res_comment="using $_ld_tmp"
3172 else
3173 def_termcap='#undef HAVE_TERMCAP'
3175 echores "$_termcap"
3178 echocheck "termios"
3179 def_termios='#undef HAVE_TERMIOS'
3180 def_termios_h='#undef HAVE_TERMIOS_H'
3181 def_termios_sys_h='#undef HAVE_SYS_TERMIOS_H'
3182 if test "$_termios" = auto ; then
3183 _termios=no
3184 for _termios_header in "termios.h" "sys/termios.h"; do
3185 header_check $_termios_header && _termios=yes &&
3186 res_comment="using $_termios_header" && break
3187 done
3190 if test "$_termios" = yes ; then
3191 def_termios='#define HAVE_TERMIOS 1'
3192 if test "$_termios_header" = "termios.h" ; then
3193 def_termios_h='#define HAVE_TERMIOS_H 1'
3194 else
3195 def_termios_sys_h='#define HAVE_SYS_TERMIOS_H 1'
3198 echores "$_termios"
3201 echocheck "shm"
3202 if test "$_shm" = auto ; then
3203 _shm=no
3204 statement_check sys/shm.h 'shmget(0, 0, 0); shmat(0, 0, 0); shmctl(0, 0, 0)' && _shm=yes
3206 if test "$_shm" = yes ; then
3207 def_shm='#define HAVE_SHM 1'
3208 else
3209 def_shm='#undef HAVE_SHM'
3211 echores "$_shm"
3214 echocheck "strsep()"
3215 _strsep=no
3216 statement_check string.h 'char *s = "Hello, world!"; strsep(&s, ",")' && _strsep=yes
3217 if test "$_strsep" = yes ; then
3218 def_strsep='#define HAVE_STRSEP 1'
3219 need_strsep=no
3220 else
3221 def_strsep='#undef HAVE_STRSEP'
3222 need_strsep=yes
3224 echores "$_strsep"
3227 echocheck "vsscanf()"
3228 cat > $TMPC << EOF
3229 #define _ISOC99_SOURCE
3230 #include <stdarg.h>
3231 #include <stdio.h>
3232 int main(void) { va_list ap; vsscanf("foo", "bar", ap); return 0; }
3234 _vsscanf=no
3235 cc_check && _vsscanf=yes
3236 if test "$_vsscanf" = yes ; then
3237 def_vsscanf='#define HAVE_VSSCANF 1'
3238 need_vsscanf=no
3239 else
3240 def_vsscanf='#undef HAVE_VSSCANF'
3241 need_vsscanf=yes
3243 echores "$_vsscanf"
3246 echocheck "swab()"
3247 _swab=no
3248 define_statement_check "_XOPEN_SOURCE 600" "unistd.h" 'int a, b; swab(&a, &b, 0)' ||
3249 statement_check "string.h" 'int a, b; swab(&a, &b, 0)' && _swab=yes
3250 if test "$_swab" = yes ; then
3251 def_swab='#define HAVE_SWAB 1'
3252 need_swab=no
3253 else
3254 def_swab='#undef HAVE_SWAB'
3255 need_swab=yes
3257 echores "$_swab"
3259 echocheck "POSIX select()"
3260 cat > $TMPC << EOF
3261 #include <stdio.h>
3262 #include <stdlib.h>
3263 #include <sys/types.h>
3264 #include <string.h>
3265 #include <sys/time.h>
3266 #include <unistd.h>
3267 int main(void) {int nfds = 1; fd_set readfds; struct timeval timeout; select(nfds, &readfds, NULL, NULL, &timeout); return 0; }
3269 _posix_select=no
3270 def_posix_select='#undef HAVE_POSIX_SELECT'
3271 cc_check && _posix_select=yes &&
3272 def_posix_select='#define HAVE_POSIX_SELECT 1'
3273 echores "$_posix_select"
3276 echocheck "audio select()"
3277 if test "$_select" = no ; then
3278 def_select='#undef HAVE_AUDIO_SELECT'
3279 elif test "$_select" = yes ; then
3280 def_select='#define HAVE_AUDIO_SELECT 1'
3282 echores "$_select"
3285 echocheck "gettimeofday()"
3286 _gettimeofday=no
3287 statement_check sys/time.h 'struct timeval tv; struct timezone tz; gettimeofday(&tv, &tz)' && _gettimeofday=yes
3288 if test "$_gettimeofday" = yes ; then
3289 def_gettimeofday='#define HAVE_GETTIMEOFDAY 1'
3290 need_gettimeofday=no
3291 else
3292 def_gettimeofday='#undef HAVE_GETTIMEOFDAY'
3293 need_gettimeofday=yes
3295 echores "$_gettimeofday"
3298 echocheck "glob()"
3299 _glob=no
3300 statement_check glob.h 'glob("filename", 0, 0, 0)' && _glob=yes
3301 need_glob=no
3302 if test "$_glob" = yes ; then
3303 def_glob='#define HAVE_GLOB 1'
3304 else
3305 def_glob='#undef HAVE_GLOB'
3306 # HACK! need_glob currently enables compilation of a
3307 # win32-specific glob()-replacement.
3308 # Other OS neither need it nor can they use it (mf:// is disabled for them).
3309 win32 && need_glob=yes
3311 echores "$_glob"
3314 echocheck "setenv()"
3315 _setenv=no
3316 statement_check stdlib.h 'setenv("", "", 0)' && _setenv=yes
3317 if test "$_setenv" = yes ; then
3318 def_setenv='#define HAVE_SETENV 1'
3319 need_setenv=no
3320 else
3321 def_setenv='#undef HAVE_SETENV'
3322 need_setenv=yes
3324 echores "$_setenv"
3327 echocheck "setmode()"
3328 _setmode=no
3329 def_setmode='#define HAVE_SETMODE 0'
3330 statement_check io.h 'setmode(0, 0)' && _setmode=yes && def_setmode='#define HAVE_SETMODE 1'
3331 echores "$_setmode"
3334 echocheck "sys/sysinfo.h"
3335 _sys_sysinfo=no
3336 statement_check sys/sysinfo.h 'struct sysinfo s_info; s_info.mem_unit=0; sysinfo(&s_info)' && _sys_sysinfo=yes
3337 if test "$_sys_sysinfo" = yes ; then
3338 def_sys_sysinfo_h='#define HAVE_SYS_SYSINFO_H 1'
3339 else
3340 def_sys_sysinfo_h='#undef HAVE_SYS_SYSINFO_H'
3342 echores "$_sys_sysinfo"
3345 if darwin; then
3347 echocheck "Mac OS X Finder Support"
3348 def_macosx_finder='#undef CONFIG_MACOSX_FINDER'
3349 if test "$_macosx_finder" = yes ; then
3350 def_macosx_finder='#define CONFIG_MACOSX_FINDER 1'
3351 extra_ldflags="$extra_ldflags -framework Cocoa"
3353 echores "$_macosx_finder"
3355 echocheck "Mac OS X Bundle file locations"
3356 def_macosx_bundle='#undef CONFIG_MACOSX_BUNDLE'
3357 test "$_macosx_bundle" = auto && _macosx_bundle=$_macosx_finder
3358 if test "$_macosx_bundle" = yes ; then
3359 def_macosx_bundle='#define CONFIG_MACOSX_BUNDLE 1'
3361 echores "$_macosx_bundle"
3363 echocheck "Apple Remote"
3364 if test "$_apple_remote" = auto ; then
3365 _apple_remote=no
3366 cat > $TMPC <<EOF
3367 #include <stdio.h>
3368 #include <IOKit/IOCFPlugIn.h>
3369 int main(void) {
3370 io_iterator_t hidObjectIterator = (io_iterator_t)NULL;
3371 CFMutableDictionaryRef hidMatchDictionary;
3372 IOReturn ioReturnValue;
3374 // Set up a matching dictionary to search the I/O Registry by class.
3375 // name for all HID class devices
3376 hidMatchDictionary = IOServiceMatching("AppleIRController");
3378 // Now search I/O Registry for matching devices.
3379 ioReturnValue = IOServiceGetMatchingServices(kIOMasterPortDefault,
3380 hidMatchDictionary, &hidObjectIterator);
3382 // If search is unsuccessful, return nonzero.
3383 if (ioReturnValue != kIOReturnSuccess ||
3384 !IOIteratorIsValid(hidObjectIterator)) {
3385 return 1;
3387 return 0;
3390 cc_check -framework IOKit && _apple_remote=yes
3392 if test "$_apple_remote" = yes ; then
3393 def_apple_remote='#define CONFIG_APPLE_REMOTE 1'
3394 libs_mplayer="$libs_mplayer -framework IOKit -framework Cocoa"
3395 else
3396 def_apple_remote='#undef CONFIG_APPLE_REMOTE'
3398 echores "$_apple_remote"
3400 fi #if darwin
3402 if linux; then
3404 echocheck "Apple IR"
3405 if test "$_apple_ir" = auto ; then
3406 _apple_ir=no
3407 statement_check linux/input.h 'struct input_event ev; struct input_id id' && _apple_ir=yes
3409 if test "$_apple_ir" = yes ; then
3410 def_apple_ir='#define CONFIG_APPLE_IR 1'
3411 else
3412 def_apple_ir='#undef CONFIG_APPLE_IR'
3414 echores "$_apple_ir"
3415 fi #if linux
3417 echocheck "pkg-config"
3418 if $($_pkg_config --version > /dev/null 2>&1); then
3419 if test "$_ld_static"; then
3420 _pkg_config="$_pkg_config --static"
3422 echores "yes"
3423 else
3424 _pkg_config=false
3425 echores "no"
3429 echocheck "Samba support (libsmbclient)"
3430 if test "$_smb" = yes; then
3431 extra_ldflags="$extra_ldflags -lsmbclient"
3433 if test "$_smb" = auto; then
3434 _smb=no
3435 for _ld_tmp in "-lsmbclient" "-lsmbclient $_ld_dl" "-lsmbclient $_ld_dl -lnsl" "-lsmbclient $_ld_dl -lssl -lnsl" ; do
3436 statement_check libsmbclient.h 'smbc_opendir("smb://")' $_ld_tmp &&
3437 extra_ldflags="$extra_ldflags $_ld_tmp" && _smb=yes && break
3438 done
3441 if test "$_smb" = yes; then
3442 def_smb="#define CONFIG_LIBSMBCLIENT 1"
3443 inputmodules="smb $inputmodules"
3444 else
3445 def_smb="#undef CONFIG_LIBSMBCLIENT"
3446 noinputmodules="smb $noinputmodules"
3448 echores "$_smb"
3450 echocheck "libquvi support"
3451 if test "$_libquvi" = auto ; then
3452 _libquvi=no
3453 if pkg_config_add 'libquvi >= 0.4.1' ; then
3454 _libquvi=yes
3457 if test "$_libquvi" = yes; then
3458 def_libquvi="#define CONFIG_LIBQUVI 1"
3459 else
3460 def_libquvi="#undef CONFIG_LIBQUVI"
3462 echores "$_libquvi"
3464 #########
3465 # VIDEO #
3466 #########
3469 echocheck "tga"
3470 if test "$_tga" = yes ; then
3471 def_tga='#define CONFIG_TGA 1'
3472 vomodules="tga $vomodules"
3473 else
3474 def_tga='#undef CONFIG_TGA'
3475 novomodules="tga $novomodules"
3477 echores "$_tga"
3480 echocheck "md5sum support"
3481 if test "$_md5sum" = yes; then
3482 def_md5sum="#define CONFIG_MD5SUM 1"
3483 vomodules="md5sum $vomodules"
3484 else
3485 def_md5sum="#undef CONFIG_MD5SUM"
3486 novomodules="md5sum $novomodules"
3488 echores "$_md5sum"
3491 echocheck "yuv4mpeg support"
3492 if test "$_yuv4mpeg" = yes; then
3493 def_yuv4mpeg="#define CONFIG_YUV4MPEG 1"
3494 vomodules="yuv4mpeg $vomodules"
3495 else
3496 def_yuv4mpeg="#undef CONFIG_YUV4MPEG"
3497 novomodules="yuv4mpeg $novomodules"
3499 echores "$_yuv4mpeg"
3502 echocheck "DirectFB"
3503 if test "$_directfb" = auto ; then
3504 _directfb=no
3505 cat > $TMPC << EOF
3506 #include <directfb.h>
3507 #include <directfb_version.h>
3508 #if (DIRECTFB_MAJOR_VERSION << 16 | DIRECTFB_MINOR_VERSION << 8 | DIRECTFB_MICRO_VERSION) < (0 << 16 | 9 << 8 | 22)
3509 #error "DirectFB version too old."
3510 #endif
3511 int main(void) { DirectFBInit(0, 0); return 0; }
3513 for _inc_tmp in "" -I/usr/local/include/directfb -I/usr/include/directfb -I/usr/local/include; do
3514 cc_check $_inc_tmp -ldirectfb &&
3515 _directfb=yes && extra_cflags="$extra_cflags $_inc_tmp" && break
3516 done
3518 if test "$_directfb" = yes ; then
3519 def_directfb='#define CONFIG_DIRECTFB 1'
3520 vomodules="directfb $vomodules"
3521 libs_mplayer="$libs_mplayer -ldirectfb"
3522 else
3523 def_directfb='#undef CONFIG_DIRECTFB'
3524 novomodules="directfb $novomodules"
3526 echores "$_directfb"
3529 if darwin; then
3531 echocheck "QuickTime"
3532 if test "$quicktime" = auto ; then
3533 quicktime=no
3534 statement_check QuickTime/QuickTime.h 'ImageDescription *desc; EnterMovies(); ExitMovies()' -framework QuickTime && quicktime=yes
3536 if test "$quicktime" = yes ; then
3537 extra_ldflags="$extra_ldflags -framework QuickTime"
3538 def_quicktime='#define CONFIG_QUICKTIME 1'
3539 else
3540 def_quicktime='#undef CONFIG_QUICKTIME'
3542 echores $quicktime
3544 echocheck "Cocoa"
3545 if test "$_cocoa" = auto ; then
3546 cat > $TMPC <<EOF
3547 #include <CoreServices/CoreServices.h>
3548 #include <OpenGL/OpenGL.h>
3549 int main(void) {
3550 NSApplicationLoad();
3553 _cocoa=no
3554 cc_check -framework Cocoa -framework OpenGL && _cocoa=yes
3556 if test "$_cocoa" = yes ; then
3557 libs_mplayer="$libs_mplayer -framework Cocoa -framework OpenGL"
3558 def_cocoa='#define CONFIG_COCOA 1'
3559 else
3560 def_cocoa='#undef CONFIG_COCOA'
3562 echores "$_cocoa"
3564 echocheck "CoreVideo"
3565 if test "$_cocoa" = yes && test "$_corevideo" = auto ; then
3566 cat > $TMPC <<EOF
3567 #include <QuartzCore/CoreVideo.h>
3568 int main(void) { return 0; }
3570 _corevideo=no
3571 cc_check -framework Cocoa -framework QuartzCore -framework OpenGL && _corevideo=yes
3573 if test "$_corevideo" = yes ; then
3574 vomodules="corevideo $vomodules"
3575 libs_mplayer="$libs_mplayer -framework QuartzCore"
3576 def_corevideo='#define CONFIG_COREVIDEO 1'
3577 else
3578 novomodules="corevideo $novomodules"
3579 def_corevideo='#undef CONFIG_COREVIDEO'
3581 echores "$_corevideo"
3583 echocheck "SharedBuffer"
3584 if test "$_sharedbuffer" = auto ; then
3585 cat > $TMPC <<EOF
3586 int main(void) {
3587 NSApplicationLoad();
3590 _sharedbuffer=no
3591 cc_check -framework Cocoa && _sharedbuffer=yes
3593 if test "$_sharedbuffer" = yes ; then
3594 vomodules="sharedbuffer $vomodules"
3595 libs_mplayer="$libs_mplayer -framework Cocoa"
3596 def_sharedbuffer='#define CONFIG_SHAREDBUFFER 1'
3597 else
3598 novomodules="sharedbuffer $novomodules"
3599 def_sharedbuffer='#undef CONFIG_SHAREDBUFFER'
3601 echores "$_sharedbuffer"
3603 depends_on_application_services(){
3604 test "$_corevideo" = yes
3607 fi #if darwin
3610 echocheck "X11 headers presence"
3611 _x11_headers="no"
3612 res_comment="check if the dev(el) packages are installed"
3613 for I in $(echo $extra_cflags | sed s/-I//g) /usr/include ; do
3614 if test -f "$I/X11/Xlib.h" ; then
3615 _x11_headers="yes"
3616 res_comment=""
3617 break
3619 done
3620 if test $_cross_compile = no; then
3621 for I in /usr/X11/include /usr/X11R7/include /usr/local/include /usr/X11R6/include \
3622 /usr/include/X11R6 /usr/openwin/include ; do
3623 if test -f "$I/X11/Xlib.h" ; then
3624 extra_cflags="$extra_cflags -I$I"
3625 _x11_headers="yes"
3626 res_comment="using $I"
3627 break
3629 done
3631 echores "$_x11_headers"
3634 echocheck "X11"
3635 if test "$_x11" = auto && test "$_x11_headers" = yes ; then
3636 for I in "" -L/usr/X11R7/lib -L/usr/local/lib -L/usr/X11R6/lib -L/usr/lib/X11R6 \
3637 -L/usr/X11/lib -L/usr/lib32 -L/usr/openwin/lib -L/usr/local/lib64 -L/usr/X11R6/lib64 \
3638 -L/usr/lib ; do
3639 if netbsd; then
3640 _ld_tmp="$I -lXext -lX11 $_ld_pthread -Wl,-R$(echo $I | sed s/^-L//)"
3641 else
3642 _ld_tmp="$I -lXext -lX11 $_ld_pthread"
3644 statement_check X11/Xutil.h 'XCreateWindow(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)' $_ld_tmp &&
3645 _x11=yes
3646 # Check that there aren't conflicting headers between ApplicationServices
3647 # and X11. On versions of Mac OSX prior to 10.7 the deprecated QuickDraw API
3648 # is included by -framework ApplicationServices and clashes with the X11
3649 # definition of the "Cursor" type.
3650 if darwin && depends_on_application_services && test "$_x11" = yes ; then
3651 _x11=no
3652 header_check_broken ApplicationServices/ApplicationServices.h \
3653 X11/Xutil.h $_ld_tmp && _x11=yes
3655 if test "$_x11" = yes ; then
3656 libs_mplayer="$libs_mplayer $_ld_tmp"
3657 break
3659 done
3661 if test "$_x11" = yes ; then
3662 def_x11='#define CONFIG_X11 1'
3663 vomodules="x11 $vomodules"
3664 else
3665 _x11=no
3666 def_x11='#undef CONFIG_X11'
3667 novomodules="x11 $novomodules"
3668 res_comment="check if the dev(el) packages are installed"
3670 echores "$_x11"
3672 echocheck "Xss screensaver extensions"
3673 if test "$_xss" = auto ; then
3674 _xss=no
3675 statement_check "X11/extensions/scrnsaver.h" 'XScreenSaverSuspend(NULL, True)' -lXss && _xss=yes
3677 if test "$_xss" = yes ; then
3678 def_xss='#define CONFIG_XSS 1'
3679 libs_mplayer="$libs_mplayer -lXss"
3680 else
3681 def_xss='#undef CONFIG_XSS'
3683 echores "$_xss"
3685 echocheck "DPMS"
3686 _xdpms3=no
3687 _xdpms4=no
3688 if test "$_x11" = yes ; then
3689 cat > $TMPC <<EOF
3690 #include <X11/Xmd.h>
3691 #include <X11/Xlib.h>
3692 #include <X11/Xutil.h>
3693 #include <X11/Xatom.h>
3694 #include <X11/extensions/dpms.h>
3695 int main(void) { DPMSQueryExtension(0, 0, 0); return 0; }
3697 cc_check -lXdpms && _xdpms3=yes
3698 statement_check_broken X11/Xlib.h X11/extensions/dpms.h 'DPMSQueryExtension(0, 0, 0)' -lXext && _xdpms4=yes
3700 if test "$_xdpms4" = yes ; then
3701 def_xdpms='#define CONFIG_XDPMS 1'
3702 res_comment="using Xdpms 4"
3703 echores "yes"
3704 elif test "$_xdpms3" = yes ; then
3705 def_xdpms='#define CONFIG_XDPMS 1'
3706 libs_mplayer="$libs_mplayer -lXdpms"
3707 res_comment="using Xdpms 3"
3708 echores "yes"
3709 else
3710 def_xdpms='#undef CONFIG_XDPMS'
3711 echores "no"
3715 echocheck "Xv"
3716 if test "$_xv" = auto && test "$_x11" = yes ; then
3717 _xv=no
3718 statement_check_broken X11/Xlib.h X11/extensions/Xvlib.h 'XvGetPortAttribute(0, 0, 0, 0)' -lXv && _xv=yes
3721 if test "$_xv" = yes ; then
3722 def_xv='#define CONFIG_XV 1'
3723 libs_mplayer="$libs_mplayer -lXv"
3724 vomodules="xv $vomodules"
3725 else
3726 def_xv='#undef CONFIG_XV'
3727 novomodules="xv $novomodules"
3729 echores "$_xv"
3732 echocheck "VDPAU"
3733 if test "$_vdpau" = auto && test "$_x11" = yes ; then
3734 _vdpau=no
3735 if test "$_dl" = yes ; then
3736 pkg_config_add 'vdpau >= 0.2' && _vdpau=yes
3739 if test "$_vdpau" = yes ; then
3740 def_vdpau='#define CONFIG_VDPAU 1'
3741 vomodules="vdpau $vomodules"
3742 else
3743 def_vdpau='#define CONFIG_VDPAU 0'
3744 novomodules="vdpau $novomodules"
3746 echores "$_vdpau"
3749 echocheck "Xinerama"
3750 if test "$_xinerama" = auto && test "$_x11" = yes ; then
3751 _xinerama=no
3752 statement_check X11/extensions/Xinerama.h 'XineramaIsActive(0)' -lXinerama && _xinerama=yes
3755 if test "$_xinerama" = yes ; then
3756 def_xinerama='#define CONFIG_XINERAMA 1'
3757 libs_mplayer="$libs_mplayer -lXinerama"
3758 else
3759 def_xinerama='#undef CONFIG_XINERAMA'
3761 echores "$_xinerama"
3764 # Note: the -lXxf86vm library is the VideoMode extension and though it's not
3765 # needed for DGA, AFAIK every distribution packages together with DGA stuffs
3766 # named 'X extensions' or something similar.
3767 # This check may be useful for future mplayer versions (to change resolution)
3768 # If you run into problems, remove '-lXxf86vm'.
3769 echocheck "Xxf86vm"
3770 if test "$_vm" = auto && test "$_x11" = yes ; then
3771 _vm=no
3772 statement_check_broken X11/Xlib.h X11/extensions/xf86vmode.h 'XF86VidModeQueryExtension(0, 0, 0)' -lXxf86vm && _vm=yes
3774 if test "$_vm" = yes ; then
3775 def_vm='#define CONFIG_XF86VM 1'
3776 libs_mplayer="$libs_mplayer -lXxf86vm"
3777 else
3778 def_vm='#undef CONFIG_XF86VM'
3780 echores "$_vm"
3782 # Check for the presence of special keycodes, like audio control buttons
3783 # that XFree86 might have. Used to be bundled with the xf86vm check, but
3784 # has nothing to do with xf86vm and XFree 3.x has xf86vm but does NOT
3785 # have these new keycodes.
3786 echocheck "XF86keysym"
3787 if test "$_xf86keysym" = auto && test "$_x11" = yes ; then
3788 _xf86keysym=no
3789 return_check X11/XF86keysym.h XF86XK_AudioPause && _xf86keysym=yes
3791 if test "$_xf86keysym" = yes ; then
3792 def_xf86keysym='#define CONFIG_XF86XK 1'
3793 else
3794 def_xf86keysym='#undef CONFIG_XF86XK'
3796 echores "$_xf86keysym"
3799 echocheck "CACA"
3800 if test "$_caca" = auto ; then
3801 _caca=no
3802 if ( caca-config --version ) >> "$TMPLOG" 2>&1 ; then
3803 cat > $TMPC << EOF
3804 #include <caca.h>
3805 #ifdef CACA_API_VERSION_1
3806 #include <caca0.h>
3807 #endif
3808 int main(void) { caca_init(); return 0; }
3810 cc_check $(caca-config --libs) && _caca=yes
3813 if test "$_caca" = yes ; then
3814 def_caca='#define CONFIG_CACA 1'
3815 extra_cflags="$extra_cflags $(caca-config --cflags)"
3816 libs_mplayer="$libs_mplayer $(caca-config --libs)"
3817 vomodules="caca $vomodules"
3818 else
3819 def_caca='#undef CONFIG_CACA'
3820 novomodules="caca $novomodules"
3822 echores "$_caca"
3825 echocheck "DVB"
3826 if test "$_dvb" = auto ; then
3827 _dvb=no
3828 cat >$TMPC << EOF
3829 #include <poll.h>
3830 #include <sys/ioctl.h>
3831 #include <stdio.h>
3832 #include <time.h>
3833 #include <unistd.h>
3834 #include <linux/dvb/dmx.h>
3835 #include <linux/dvb/frontend.h>
3836 #include <linux/dvb/video.h>
3837 #include <linux/dvb/audio.h>
3838 int main(void) {return 0;}
3840 for _inc_tmp in "" "-I/usr/src/DVB/include" ; do
3841 cc_check $_inc_tmp && _dvb=yes &&
3842 extra_cflags="$extra_cflags $_inc_tmp" && break
3843 done
3845 echores "$_dvb"
3846 if test "$_dvb" = yes ; then
3847 _dvbin=yes
3848 inputmodules="dvb $inputmodules"
3849 def_dvbin='#define CONFIG_DVBIN 1'
3850 else
3851 _dvbin=no
3852 noinputmodules="dvb $noinputmodules"
3853 def_dvbin='#undef CONFIG_DVBIN '
3857 echocheck "PNG support"
3858 if test "$_png" = auto ; then
3859 _png=no
3860 cat > $TMPC << EOF
3861 #include <stdio.h>
3862 #include <string.h>
3863 #include <png.h>
3864 int main(void) {
3865 printf("png.h : %s\n", PNG_LIBPNG_VER_STRING);
3866 printf("libpng: %s\n", png_libpng_ver);
3867 return strcmp(PNG_LIBPNG_VER_STRING, png_libpng_ver);
3870 cc_check -lpng -lz $_ld_lm && _png=yes
3872 echores "$_png"
3873 if test "$_png" = yes ; then
3874 def_png='#define CONFIG_PNG 1'
3875 extra_ldflags="$extra_ldflags -lpng -lz"
3876 else
3877 def_png='#undef CONFIG_PNG'
3880 echocheck "MNG support"
3881 if test "$_mng" = auto ; then
3882 _mng=no
3883 return_statement_check libmng.h 'const char * p_ver = mng_version_text()' '!p_ver || p_ver[0] == 0' -lmng -lz $_ld_lm && _mng=yes
3885 echores "$_mng"
3886 if test "$_mng" = yes ; then
3887 def_mng='#define CONFIG_MNG 1'
3888 extra_ldflags="$extra_ldflags -lmng -lz"
3889 else
3890 def_mng='#undef CONFIG_MNG'
3893 echocheck "JPEG support"
3894 if test "$_jpeg" = auto ; then
3895 _jpeg=no
3896 header_check_broken stdio.h jpeglib.h -ljpeg $_ld_lm && _jpeg=yes
3898 echores "$_jpeg"
3900 if test "$_jpeg" = yes ; then
3901 def_jpeg='#define CONFIG_JPEG 1'
3902 vomodules="jpeg $vomodules"
3903 extra_ldflags="$extra_ldflags -ljpeg"
3904 else
3905 def_jpeg='#undef CONFIG_JPEG'
3906 novomodules="jpeg $novomodules"
3911 echocheck "PNM support"
3912 if test "$_pnm" = yes; then
3913 def_pnm="#define CONFIG_PNM 1"
3914 vomodules="pnm $vomodules"
3915 else
3916 def_pnm="#undef CONFIG_PNM"
3917 novomodules="pnm $novomodules"
3919 echores "$_pnm"
3923 echocheck "GIF support"
3924 # This is to appease people who want to force gif support.
3925 # If it is forced to yes, then we still do checks to determine
3926 # which gif library to use.
3927 if test "$_gif" = yes ; then
3928 _force_gif=yes
3929 _gif=auto
3932 if test "$_gif" = auto ; then
3933 _gif=no
3934 for _ld_gif in "-lungif" "-lgif" ; do
3935 statement_check gif_lib.h 'QuantizeBuffer(0, 0, 0, 0, 0, 0, 0, 0)' $_ld_gif && _gif=yes && break
3936 done
3939 # If no library was found, and the user wants support forced,
3940 # then we force it on with libgif, as this is the safest
3941 # assumption IMHO. (libungif & libregif both create symbolic
3942 # links to libgif. We also assume that no x11 support is needed,
3943 # because if you are forcing this, then you _should_ know what
3944 # you are doing. [ Besides, package maintainers should never
3945 # have compiled x11 deps into libungif in the first place. ] )
3946 # </rant>
3947 # --Joey
3948 if test "$_force_gif" = yes && test "$_gif" = no ; then
3949 _gif=yes
3950 _ld_gif="-lgif"
3953 if test "$_gif" = yes ; then
3954 def_gif='#define CONFIG_GIF 1'
3955 codecmodules="gif $codecmodules"
3956 vomodules="gif89a $vomodules"
3957 res_comment="old version, some encoding functions disabled"
3958 def_gif_4='#undef CONFIG_GIF_4'
3959 extra_ldflags="$extra_ldflags $_ld_gif"
3961 cat > $TMPC << EOF
3962 #include <signal.h>
3963 #include <stdio.h>
3964 #include <stdlib.h>
3965 #include <gif_lib.h>
3966 static void catch(int sig) { exit(1); }
3967 int main(void) {
3968 signal(SIGSEGV, catch); // catch segfault
3969 printf("EGifPutExtensionFirst is at address %p\n", EGifPutExtensionFirst);
3970 EGifSetGifVersion("89a"); // this will segfault a buggy gif lib.
3971 return 0;
3974 if cc_check "$_ld_gif" ; then
3975 def_gif_4='#define CONFIG_GIF_4 1'
3976 res_comment=""
3978 else
3979 def_gif='#undef CONFIG_GIF'
3980 def_gif_4='#undef CONFIG_GIF_4'
3981 novomodules="gif89a $novomodules"
3982 nocodecmodules="gif $nocodecmodules"
3984 echores "$_gif"
3987 case "$_gif" in yes*)
3988 echocheck "broken giflib workaround"
3989 def_gif_tvt_hack='#define CONFIG_GIF_TVT_HACK 1'
3991 cat > $TMPC << EOF
3992 #include <stdio.h>
3993 #include <gif_lib.h>
3994 int main(void) {
3995 GifFileType gif = {.UserData = NULL};
3996 printf("UserData is at address %p\n", gif.UserData);
3997 return 0;
4000 if cc_check "$_ld_gif" ; then
4001 def_gif_tvt_hack='#undef CONFIG_GIF_TVT_HACK'
4002 echores "disabled"
4003 else
4004 echores "enabled"
4007 esac
4010 #################
4011 # VIDEO + AUDIO #
4012 #################
4015 echocheck "SDL"
4016 _inc_tmp=""
4017 _ld_tmp=""
4018 def_sdl_sdl_h="#undef CONFIG_SDL_SDL_H"
4019 if test -z "$_sdlconfig" ; then
4020 if ( sdl-config --version ) >>"$TMPLOG" 2>&1 ; then
4021 _sdlconfig="sdl-config"
4022 elif ( sdl11-config --version ) >>"$TMPLOG" 2>&1 ; then
4023 _sdlconfig="sdl11-config"
4024 else
4025 _sdlconfig=false
4028 if test "$_sdl" = auto || test "$_sdl" = yes ; then
4029 cat > $TMPC << EOF
4030 #ifdef CONFIG_SDL_SDL_H
4031 #include <SDL/SDL.h>
4032 #else
4033 #include <SDL.h>
4034 #endif
4035 #ifndef __APPLE__
4036 // we allow SDL hacking our main() only on OSX
4037 #undef main
4038 #endif
4039 int main(int argc, char *argv[]) {
4040 SDL_Init(SDL_INIT_VIDEO|SDL_INIT_NOPARACHUTE);
4041 return 0;
4044 _sdl=no
4045 for _ld_tmp in "-lSDL" "-lSDL -lpthread" "-lSDL -lwinmm -lgdi32" "-lSDL -lwinmm -lgdi32 -ldxguid" ; do
4046 if cc_check -DCONFIG_SDL_SDL_H $_inc_tmp $_ld_tmp ; then
4047 _sdl=yes
4048 def_sdl_sdl_h="#define CONFIG_SDL_SDL_H 1"
4049 break
4051 done
4052 if test "$_sdl" = no && "$_sdlconfig" --version >>"$TMPLOG" 2>&1 ; then
4053 res_comment="using $_sdlconfig"
4054 if cygwin ; then
4055 _inc_tmp="$($_sdlconfig --cflags | cut -d " " -f 1,5,6 | sed s/no-cygwin/cygwin/)"
4056 _ld_tmp="$($_sdlconfig --libs | cut -d " " -f 1,4,6 | sed s/no-cygwin/cygwin/)"
4057 elif mingw32 ; then
4058 _inc_tmp=$($_sdlconfig --cflags | sed s/-Dmain=SDL_main//)
4059 _ld_tmp=$($_sdlconfig --libs | sed -e s/-mwindows// -e s/-lmingw32//)
4060 else
4061 _inc_tmp="$($_sdlconfig --cflags)"
4062 _ld_tmp="$($_sdlconfig --libs)"
4064 if cc_check $_inc_tmp $_ld_tmp >>"$TMPLOG" 2>&1 ; then
4065 _sdl=yes
4066 elif cc_check $_inc_tmp $_ld_tmp -lstdc++ >>"$TMPLOG" 2>&1 ; then
4067 # HACK for BeOS/Haiku SDL
4068 _ld_tmp="$_ld_tmp -lstdc++"
4069 _sdl=yes
4073 if test "$_sdl" = yes ; then
4074 def_sdl='#define CONFIG_SDL 1'
4075 extra_cflags="$extra_cflags $_inc_tmp"
4076 libs_mplayer="$libs_mplayer $_ld_tmp"
4077 vomodules="sdl $vomodules"
4078 aomodules="sdl $aomodules"
4079 else
4080 def_sdl='#undef CONFIG_SDL'
4081 novomodules="sdl $novomodules"
4082 noaomodules="sdl $noaomodules"
4084 echores "$_sdl"
4087 # make sure this stays below CoreVideo to avoid issues due to namespace
4088 # conflicts between -lGL and -framework OpenGL
4089 echocheck "OpenGL"
4090 #Note: this test is run even with --enable-gl since we autodetect linker flags
4091 if (test "$_x11" = yes || test "$_sdl" = yes || test "$_cocoa" = yes || win32) && test "$_gl" != no ; then
4092 cat > $TMPC << EOF
4093 #ifdef GL_WIN32
4094 #include <windows.h>
4095 #include <GL/gl.h>
4096 #elif defined(GL_SDL)
4097 #include <GL/gl.h>
4098 #ifdef CONFIG_SDL_SDL_H
4099 #include <SDL/SDL.h>
4100 #else
4101 #include <SDL.h>
4102 #endif
4103 #ifndef __APPLE__
4104 // we allow SDL hacking our main() only on OSX
4105 #undef main
4106 #endif
4107 #else
4108 #include <GL/gl.h>
4109 #include <X11/Xlib.h>
4110 #include <GL/glx.h>
4111 #endif
4112 int main(int argc, char *argv[]) {
4113 #ifdef GL_WIN32
4114 HDC dc;
4115 wglCreateContext(dc);
4116 #elif defined(GL_SDL)
4117 SDL_GL_SwapBuffers();
4118 #else
4119 glXCreateContext(NULL, NULL, NULL, True);
4120 #endif
4121 glFinish();
4122 return 0;
4125 _gl=no
4126 if test "$_x11" = yes ; then
4127 for _ld_tmp in "" -lGL "-lGL -lXdamage" "-lGL $_ld_pthread" ; do
4128 if cc_check $_ld_tmp $_ld_lm ; then
4129 _gl=yes
4130 _gl_x11=yes
4131 libs_mplayer="$libs_mplayer $_ld_tmp $_ld_dl"
4132 break
4134 done
4136 if win32 && cc_check -DGL_WIN32 -lopengl32 ; then
4137 _gl=yes
4138 _gl_win32=yes
4139 libs_mplayer="$libs_mplayer -lopengl32 -lgdi32"
4141 if test "$_cocoa" = yes ; then
4142 _gl=yes
4143 _gl_cocoa=yes
4145 # last so it can reuse any linker etc. flags detected before
4146 if test "$_sdl" = yes ; then
4147 if cc_check -DGL_SDL ||
4148 cc_check -DCONFIG_SDL_SDL_H -DGL_SDL ; then
4149 _gl=yes
4150 _gl_sdl=yes
4151 elif cc_check -DGL_SDL -lGL ||
4152 cc_check -DCONFIG_SDL_SDL_H -DGL_SDL -lGL ; then
4153 _gl=yes
4154 _gl_sdl=yes
4155 libs_mplayer="$libs_mplayer -lGL"
4158 else
4159 _gl=no
4161 if test "$_gl" = yes ; then
4162 def_gl='#define CONFIG_GL 1'
4163 res_comment="backends:"
4164 if test "$_gl_cocoa" = yes ; then
4165 def_gl_cocoa='#define CONFIG_GL_COCOA 1'
4166 res_comment="$res_comment cocoa"
4168 if test "$_gl_win32" = yes ; then
4169 def_gl_win32='#define CONFIG_GL_WIN32 1'
4170 res_comment="$res_comment win32"
4172 if test "$_gl_x11" = yes ; then
4173 def_gl_x11='#define CONFIG_GL_X11 1'
4174 res_comment="$res_comment x11"
4176 if test "$_gl_sdl" = yes ; then
4177 def_gl_sdl='#define CONFIG_GL_SDL 1'
4178 res_comment="$res_comment sdl"
4180 vomodules="opengl $vomodules"
4181 else
4182 def_gl='#undef CONFIG_GL'
4183 def_gl_cocoa='#undef CONFIG_GL_COCOA'
4184 def_gl_win32='#undef CONFIG_GL_WIN32'
4185 def_gl_x11='#undef CONFIG_GL_X11'
4186 def_gl_sdl='#undef CONFIG_GL_SDL'
4187 novomodules="opengl $novomodules"
4189 echores "$_gl"
4192 if win32; then
4194 echocheck "Direct3D"
4195 if test "$_direct3d" = auto ; then
4196 _direct3d=no
4197 header_check d3d9.h && _direct3d=yes
4199 if test "$_direct3d" = yes ; then
4200 def_direct3d='#define CONFIG_DIRECT3D 1'
4201 vomodules="direct3d $vomodules"
4202 else
4203 def_direct3d='#undef CONFIG_DIRECT3D'
4204 novomodules="direct3d $novomodules"
4206 echores "$_direct3d"
4208 echocheck "Directx"
4209 if test "$_directx" = auto ; then
4210 cat > $TMPC << EOF
4211 #include <ddraw.h>
4212 #include <dsound.h>
4213 int main(void) { return 0; }
4215 _directx=no
4216 cc_check -lgdi32 && _directx=yes
4218 if test "$_directx" = yes ; then
4219 def_directx='#define CONFIG_DIRECTX 1'
4220 libs_mplayer="$libs_mplayer -lgdi32"
4221 vomodules="directx $vomodules"
4222 aomodules="dsound $aomodules"
4223 else
4224 def_directx='#undef CONFIG_DIRECTX'
4225 novomodules="directx $novomodules"
4226 noaomodules="dsound $noaomodules"
4228 echores "$_directx"
4230 fi #if win32; then
4233 echocheck "V4L2 MPEG Decoder"
4234 if test "$_v4l2" = auto ; then
4235 cat > $TMPC << EOF
4236 #include <sys/time.h>
4237 #include <linux/videodev2.h>
4238 #include <linux/version.h>
4239 int main(void) {
4240 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22)
4241 #error kernel headers too old, need 2.6.22
4242 #endif
4243 struct v4l2_ext_controls ctrls;
4244 ctrls.ctrl_class = V4L2_CTRL_CLASS_MPEG;
4245 return 0;
4248 _v4l2=no
4249 cc_check && _v4l2=yes
4251 if test "$_v4l2" = yes ; then
4252 def_v4l2='#define CONFIG_V4L2_DECODER 1'
4253 vomodules="v4l2 $vomodules"
4254 aomodules="v4l2 $aomodules"
4255 else
4256 def_v4l2='#undef CONFIG_V4L2_DECODER'
4257 novomodules="v4l2 $novomodules"
4258 noaomodules="v4l2 $noaomodules"
4260 echores "$_v4l2"
4264 #########
4265 # AUDIO #
4266 #########
4269 echocheck "OSS Audio"
4270 if test "$_ossaudio" = auto ; then
4271 _ossaudio=no
4272 return_check $_soundcard_header SNDCTL_DSP_SETFRAGMENT && _ossaudio=yes
4274 if test "$_ossaudio" = yes ; then
4275 def_ossaudio='#define CONFIG_OSS_AUDIO 1'
4276 aomodules="oss $aomodules"
4277 cat > $TMPC << EOF
4278 #include <$_soundcard_header>
4279 #ifdef OPEN_SOUND_SYSTEM
4280 int main(void) { return 0; }
4281 #else
4282 #error Not the real thing
4283 #endif
4285 _real_ossaudio=no
4286 cc_check && _real_ossaudio=yes
4287 if test "$_real_ossaudio" = yes; then
4288 def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/dsp"'
4289 # Check for OSS4 headers (override default headers)
4290 # Does not apply to systems where OSS4 is native (e.g. FreeBSD)
4291 if test -f /etc/oss.conf; then
4292 . /etc/oss.conf
4293 _ossinc="$OSSLIBDIR/include"
4294 if test -f "$_ossinc/sys/soundcard.h"; then
4295 extra_cflags="-I$_ossinc $extra_cflags"
4298 elif netbsd || openbsd ; then
4299 def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/sound"'
4300 extra_ldflags="$extra_ldflags -lossaudio"
4301 else
4302 def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/dsp"'
4304 def_ossaudio_devmixer='#define PATH_DEV_MIXER "/dev/mixer"'
4305 else
4306 def_ossaudio='#undef CONFIG_OSS_AUDIO'
4307 def_ossaudio_devdsp='#define PATH_DEV_DSP ""'
4308 def_ossaudio_devmixer='#define PATH_DEV_MIXER ""'
4309 noaomodules="oss $noaomodules"
4311 echores "$_ossaudio"
4314 echocheck "RSound"
4315 if test "$_rsound" = auto ; then
4316 _rsound=no
4317 statement_check rsound.h 'rsd_init(NULL);' -lrsound && _rsound=yes
4319 echores "$_rsound"
4321 if test "$_rsound" = yes ; then
4322 def_rsound='#define CONFIG_RSOUND 1'
4323 aomodules="rsound $aomodules"
4324 libs_mplayer="$libs_mplayer -lrsound"
4325 else
4326 def_rsound='#undef CONFIG_RSOUND'
4327 noaomodules="rsound $noaomodules"
4331 echocheck "pulse"
4332 if test "$_pulse" = auto ; then
4333 _pulse=no
4334 if pkg_config_add 'libpulse >= 0.9' ; then
4335 _pulse=yes
4338 echores "$_pulse"
4340 if test "$_pulse" = yes ; then
4341 def_pulse='#define CONFIG_PULSE 1'
4342 aomodules="pulse $aomodules"
4343 else
4344 def_pulse='#undef CONFIG_PULSE'
4345 noaomodules="pulse $noaomodules"
4349 echocheck "PortAudio"
4350 if test "$_portaudio" = auto && test "$_pthreads" != yes ; then
4351 _portaudio=no
4352 res_comment="pthreads not enabled"
4354 if test "$_portaudio" = auto ; then
4355 _portaudio=no
4356 if pkg_config_add 'portaudio-2.0 >= 19' ; then
4357 _portaudio=yes
4360 echores "$_portaudio"
4362 if test "$_portaudio" = yes ; then
4363 def_portaudio='#define CONFIG_PORTAUDIO 1'
4364 aomodules="portaudio $aomodules"
4365 else
4366 def_portaudio='#undef CONFIG_PORTAUDIO'
4367 noaomodules="portaudio $noaomodules"
4371 echocheck "JACK"
4372 if test "$_jack" = auto ; then
4373 _jack=no
4374 if pkg_config_add jack ; then
4375 _jack=yes
4379 if test "$_jack" = yes ; then
4380 def_jack='#define CONFIG_JACK 1'
4381 aomodules="jack $aomodules"
4382 else
4383 noaomodules="jack $noaomodules"
4385 echores "$_jack"
4387 echocheck "OpenAL"
4388 if test "$_openal" = auto ; then
4389 _openal=no
4390 cat > $TMPC << EOF
4391 #ifdef OPENAL_AL_H
4392 #include <OpenAL/al.h>
4393 #else
4394 #include <AL/al.h>
4395 #endif
4396 int main(void) {
4397 alSourceQueueBuffers(0, 0, 0);
4398 // alGetSourcei(0, AL_SAMPLE_OFFSET, 0);
4399 return 0;
4402 for I in "-lopenal" "-lopenal32" "-framework OpenAL" ; do
4403 cc_check $I && _openal=yes && break
4404 cc_check -DOPENAL_AL_H=1 $I && def_openal_h='#define OPENAL_AL_H 1' && _openal=yes && break
4405 done
4406 test "$_openal" = yes && libs_mplayer="$libs_mplayer $I"
4408 if test "$_openal" = yes ; then
4409 def_openal='#define CONFIG_OPENAL 1'
4410 aomodules="openal $aomodules"
4411 else
4412 noaomodules="openal $noaomodules"
4414 echores "$_openal"
4416 echocheck "ALSA audio"
4417 if test "$_alloca" != yes ; then
4418 _alsa=no
4419 res_comment="alloca missing"
4421 if test "$_alsa" = auto ; then
4422 _alsa=no
4423 if pkg_config_add "alsa >= 1.0.9" ; then
4424 _alsa=yes
4427 def_alsa='#undef CONFIG_ALSA'
4428 if test "$_alsa" = yes ; then
4429 aomodules="alsa $aomodules"
4430 def_alsa='#define CONFIG_ALSA 1'
4431 else
4432 noaomodules="alsa $noaomodules"
4434 echores "$_alsa"
4437 if darwin; then
4438 echocheck "CoreAudio"
4439 if test "$_coreaudio" = auto ; then
4440 cat > $TMPC <<EOF
4441 #include <CoreAudio/CoreAudio.h>
4442 #include <AudioToolbox/AudioToolbox.h>
4443 #include <AudioUnit/AudioUnit.h>
4444 int main(void) { return 0; }
4446 _coreaudio=no
4447 cc_check -framework CoreAudio -framework AudioUnit -framework AudioToolbox && _coreaudio=yes
4449 if test "$_coreaudio" = yes ; then
4450 libs_mplayer="$libs_mplayer -framework CoreAudio -framework AudioUnit -framework AudioToolbox"
4451 def_coreaudio='#define CONFIG_COREAUDIO 1'
4452 aomodules="coreaudio $aomodules"
4453 else
4454 def_coreaudio='#undef CONFIG_COREAUDIO'
4455 noaomodules="coreaudio $noaomodules"
4457 echores $_coreaudio
4458 fi #if darwin
4461 # set default CD/DVD devices
4462 if win32 ; then
4463 default_cdrom_device="D:"
4464 elif darwin ; then
4465 default_cdrom_device="/dev/disk1"
4466 elif dragonfly ; then
4467 default_cdrom_device="/dev/cd0"
4468 elif freebsd ; then
4469 default_cdrom_device="/dev/acd0"
4470 elif openbsd ; then
4471 default_cdrom_device="/dev/rcd0c"
4472 elif amigaos ; then
4473 default_cdrom_device="a1ide.device:2"
4474 else
4475 default_cdrom_device="/dev/cdrom"
4478 if win32 || dragonfly || freebsd || openbsd || amigaos ; then
4479 default_dvd_device=$default_cdrom_device
4480 elif darwin ; then
4481 default_dvd_device="/dev/rdiskN"
4482 else
4483 default_dvd_device="/dev/dvd"
4487 echocheck "VCD support"
4488 if test "$_vcd" = auto; then
4489 _vcd=no
4490 if linux || freebsd || netbsd || openbsd || dragonfly || bsdos || darwin ; then
4491 _vcd=yes
4492 elif mingw32; then
4493 header_check ddk/ntddcdrm.h && _vcd=yes
4496 if test "$_vcd" = yes; then
4497 inputmodules="vcd $inputmodules"
4498 def_vcd='#define CONFIG_VCD 1'
4499 else
4500 def_vcd='#undef CONFIG_VCD'
4501 noinputmodules="vcd $noinputmodules"
4502 res_comment="not supported on this OS"
4504 echores "$_vcd"
4508 echocheck "Blu-ray support"
4509 if test "$_bluray" = auto ; then
4510 _bluray=no
4511 pkg_config_add 'libbluray >= 0.2.1' && _bluray=yes
4513 if test "$_bluray" = yes ; then
4514 def_bluray='#define CONFIG_LIBBLURAY 1'
4515 inputmodules="bluray $inputmodules"
4516 else
4517 def_bluray='#undef CONFIG_LIBBLURAY'
4518 noinputmodules="bluray $noinputmodules"
4520 echores "$_bluray"
4522 echocheck "dvdread"
4523 if test "$_dvdread_internal" = auto && test ! -f "libdvdread4/dvd_reader.c" ; then
4524 _dvdread_internal=no
4526 if test "$_dvdread_internal" = auto ; then
4527 _dvdread_internal=no
4528 _dvdread=no
4529 if (linux || freebsd || netbsd || openbsd || dragonfly || hpux) &&
4530 (test "$_dvd" = yes || test "$_cdrom" = yes || test "$_cdio" = yes ||
4531 test "$_dvdio" = yes || test "$_bsdi_dvd" = yes) ||
4532 darwin || win32; then
4533 _dvdread_internal=yes
4534 _dvdread=yes
4535 extra_cflags="-Ilibdvdread4 $extra_cflags"
4537 elif test "$_dvdread" = auto ; then
4538 _dvdread=no
4539 if test "$_dl" = yes; then
4540 _dvdreadcflags=$($_dvdreadconfig --cflags 2> /dev/null)
4541 _dvdreadlibs=$($_dvdreadconfig --libs 2> /dev/null)
4542 if header_check dvdread/dvd_reader.h $_dvdreadcflags $_dvdreadlibs $_ld_dl ; then
4543 _dvdread=yes
4544 extra_cflags="$extra_cflags $_dvdreadcflags"
4545 extra_ldflags="$extra_ldflags $_dvdreadlibs"
4546 res_comment="external"
4551 if test "$_dvdread_internal" = yes; then
4552 def_dvdread='#define CONFIG_DVDREAD 1'
4553 inputmodules="dvdread(internal) $inputmodules"
4554 res_comment="internal"
4555 elif test "$_dvdread" = yes; then
4556 def_dvdread='#define CONFIG_DVDREAD 1'
4557 extra_ldflags="$extra_ldflags -ldvdread"
4558 inputmodules="dvdread(external) $inputmodules"
4559 res_comment="external"
4560 else
4561 def_dvdread='#undef CONFIG_DVDREAD'
4562 noinputmodules="dvdread $noinputmodules"
4564 echores "$_dvdread"
4567 echocheck "internal libdvdcss"
4568 if test "$_libdvdcss_internal" = auto ; then
4569 _libdvdcss_internal=no
4570 test "$_dvdread_internal" = yes && test -d libdvdcss && _libdvdcss_internal=yes
4571 hpux && test "$_hpux_scsi_h" = no && _libdvdcss_internal=no
4573 if test "$_libdvdcss_internal" = yes ; then
4574 if linux || netbsd || openbsd || bsdos ; then
4575 def_dvd_linux='#define HAVE_LINUX_DVD_STRUCT 1'
4576 openbsd && def_dvd_openbsd='#define HAVE_OPENBSD_DVD_STRUCT 1'
4577 elif freebsd || dragonfly ; then
4578 def_dvd_bsd='#define HAVE_BSD_DVD_STRUCT 1'
4579 elif darwin ; then
4580 def_dvd_darwin='#define DARWIN_DVD_IOCTL'
4581 extra_ldflags="$extra_ldflags -framework IOKit -framework Carbon"
4582 elif cygwin ; then
4583 cflags_libdvdcss="-DSYS_CYGWIN -DWIN32"
4584 elif beos ; then
4585 cflags_libdvdcss="-DSYS_BEOS"
4587 cflags_libdvdcss_dvdread="-Ilibdvdcss"
4588 def_dvdcss="#define HAVE_DVDCSS_DVDCSS_H 1"
4589 inputmodules="libdvdcss(internal) $inputmodules"
4590 else
4591 noinputmodules="libdvdcss(internal) $noinputmodules"
4593 echores "$_libdvdcss_internal"
4596 echocheck "libcdio"
4597 if test "$_libcdio" = auto ; then
4598 _libcdio=no
4599 if pkg_config_add libcdio_paranoia ; then
4600 _libcdio=yes
4603 if test "$_libcdio" = yes ; then
4604 _cdda='yes'
4605 def_cdda='#define CONFIG_CDDA 1'
4606 test $_cddb = auto && test $networking = yes && _cddb=yes
4607 inputmodules="cdda $inputmodules"
4608 else
4609 _libcdio=no
4610 _cdda='no'
4611 def_cdda='#undef CONFIG_CDDA'
4612 noinputmodules="cdda $noinputmodules"
4614 echores "$_libcdio"
4616 if test "$_cddb" = yes ; then
4617 def_cddb='#define CONFIG_CDDB 1'
4618 inputmodules="cddb $inputmodules"
4619 else
4620 _cddb=no
4621 def_cddb='#undef CONFIG_CDDB'
4622 noinputmodules="cddb $noinputmodules"
4626 echocheck "SSA/ASS support"
4627 if test "$_ass" = auto ; then
4628 if pkg_config_add libass ; then
4629 _ass=yes
4630 def_ass='#define CONFIG_ASS 1'
4631 else
4632 die "Unable to find development files for libass. Aborting. If you really mean to compile without libass support use --disable-libass."
4634 else
4635 def_ass='#undef CONFIG_ASS'
4637 echores "$_ass"
4640 echocheck "ENCA"
4641 if test "$_enca" = auto ; then
4642 _enca=no
4643 statement_check enca.h 'enca_get_languages(NULL)' -lenca $_ld_lm && _enca=yes
4645 if test "$_enca" = yes ; then
4646 def_enca='#define CONFIG_ENCA 1'
4647 extra_ldflags="$extra_ldflags -lenca"
4648 else
4649 def_enca='#undef CONFIG_ENCA'
4651 echores "$_enca"
4654 echocheck "zlib"
4655 _zlib=no
4656 statement_check zlib.h 'inflate(0, Z_NO_FLUSH)' -lz && _zlib=yes
4657 if test "$_zlib" = yes ; then
4658 def_zlib='#define CONFIG_ZLIB 1'
4659 extra_ldflags="$extra_ldflags -lz"
4660 else
4661 def_zlib='#define CONFIG_ZLIB 0'
4663 echores "$_zlib"
4666 echocheck "RTC"
4667 if test "$_rtc" = auto ; then
4668 cat > $TMPC << EOF
4669 #include <sys/ioctl.h>
4670 #ifdef __linux__
4671 #include <linux/rtc.h>
4672 #else
4673 #include <rtc.h>
4674 #define RTC_PIE_ON RTCIO_PIE_ON
4675 #endif
4676 int main(void) { return RTC_PIE_ON; }
4678 _rtc=no
4679 cc_check && _rtc=yes
4680 ppc && _rtc=no
4682 if test "$_rtc" = yes ; then
4683 def_rtc='#define HAVE_RTC 1'
4684 else
4685 def_rtc='#undef HAVE_RTC'
4687 echores "$_rtc"
4690 echocheck "mad support"
4691 if test "$_mad" = auto ; then
4692 _mad=no
4693 header_check mad.h -lmad && _mad=yes
4695 if test "$_mad" = yes ; then
4696 def_mad='#define CONFIG_LIBMAD 1'
4697 extra_ldflags="$extra_ldflags -lmad"
4698 codecmodules="libmad $codecmodules"
4699 else
4700 def_mad='#undef CONFIG_LIBMAD'
4701 nocodecmodules="libmad $nocodecmodules"
4703 echores "$_mad"
4705 echocheck "OggVorbis support"
4706 if test "$_libvorbis" = auto; then
4707 _libvorbis=no
4708 statement_check vorbis/codec.h 'vorbis_packet_blocksize(0, 0)' -lvorbis -logg $_ld_lm && _libvorbis=yes && _tremor=no
4709 elif test "$_libvorbis" = yes ; then
4710 _tremor=no
4712 if test "$_tremor" = auto; then
4713 _tremor=no
4714 statement_check tremor/ivorbiscodec.h 'vorbis_packet_blocksize(0, 0)' -logg -lvorbisidec $_ld_lm && _tremor=yes
4716 if test "$_tremor" = yes ; then
4717 _vorbis=yes
4718 def_vorbis='#define CONFIG_OGGVORBIS 1'
4719 def_tremor='#define CONFIG_TREMOR 1'
4720 codecmodules="tremor(external) $codecmodules"
4721 res_comment="external Tremor"
4722 extra_ldflags="$extra_ldflags -logg -lvorbisidec"
4723 elif test "$_libvorbis" = yes ; then
4724 _vorbis=yes
4725 def_vorbis='#define CONFIG_OGGVORBIS 1'
4726 codecmodules="libvorbis $codecmodules"
4727 res_comment="libvorbis"
4728 extra_ldflags="$extra_ldflags -lvorbis -logg"
4729 else
4730 _vorbis=no
4731 nocodecmodules="libvorbis $nocodecmodules"
4733 echores "$_vorbis"
4735 echocheck "libspeex (version >= 1.1 required)"
4736 if test "$_speex" = auto ; then
4737 _speex=no
4738 cat > $TMPC << EOF
4739 #include <stddef.h>
4740 #include <speex/speex.h>
4741 int main(void) { SpeexBits bits; void *dec = NULL; speex_decode_int(dec, &bits, dec); return 0; }
4743 cc_check -lspeex $_ld_lm && _speex=yes
4745 if test "$_speex" = yes ; then
4746 def_speex='#define CONFIG_SPEEX 1'
4747 extra_ldflags="$extra_ldflags -lspeex"
4748 codecmodules="speex $codecmodules"
4749 else
4750 def_speex='#undef CONFIG_SPEEX'
4751 nocodecmodules="speex $nocodecmodules"
4753 echores "$_speex"
4755 echocheck "OggTheora support"
4756 if test "$_theora" = auto ; then
4757 _theora=no
4758 if pkg_config_add theora ; then
4759 _theora=yes
4762 if test "$_theora" = yes ; then
4763 def_theora='#define CONFIG_OGGTHEORA 1'
4764 codecmodules="libtheora $codecmodules"
4765 else
4766 def_theora='#undef CONFIG_OGGTHEORA'
4767 nocodecmodules="libtheora $nocodecmodules"
4769 echores "$_theora"
4771 # Any version of libmpg123 that knows MPG123_RESYNC_LIMIT shall be fine.
4772 # That is, 1.2.0 onwards. Recommened is 1.14 onwards, though.
4773 echocheck "mpg123 support"
4774 def_mpg123='#undef CONFIG_MPG123'
4775 if test "$_mpg123" = auto; then
4776 _mpg123=no
4777 pkg_config_add 'libmpg123 >= 1.2.0' && _mpg123=yes
4779 if test "$_mpg123" = yes ; then
4780 def_mpg123='#define CONFIG_MPG123 1'
4781 codecmodules="mpg123 $codecmodules"
4782 else
4783 nocodecmodules="mpg123 $nocodecmodules"
4785 echores "$_mpg123"
4787 echocheck "liba52 support"
4788 def_liba52='#undef CONFIG_LIBA52'
4789 if test "$_liba52" = auto ; then
4790 _liba52=no
4791 cat > $TMPC << EOF
4792 #include <inttypes.h>
4793 #include <a52dec/a52.h>
4794 int main(void) { a52_state_t *testHand; testHand=a52_init(0); return 0; }
4796 cc_check -la52 && _liba52=yes && extra_ldflags="$extra_ldflags -la52"
4798 if test "$_liba52" = yes ; then
4799 def_liba52='#define CONFIG_LIBA52 1'
4800 codecmodules="liba52 $codecmodules"
4801 else
4802 nocodecmodules="liba52 $nocodecmodules"
4804 echores "$_liba52"
4806 echocheck "libdca support"
4807 if test "$_libdca" = auto ; then
4808 _libdca=no
4809 for _ld_dca in -ldca -ldts ; do
4810 statement_check_broken stdint.h dts.h 'dts_init(0)' $_ld_dca $_ld_lm &&
4811 extra_ldflags="$extra_ldflags $_ld_dca" && _libdca=yes && break
4812 done
4814 if test "$_libdca" = yes ; then
4815 def_libdca='#define CONFIG_LIBDCA 1'
4816 codecmodules="libdca $codecmodules"
4817 else
4818 def_libdca='#undef CONFIG_LIBDCA'
4819 nocodecmodules="libdca $nocodecmodules"
4821 echores "$_libdca"
4823 echocheck "libmpcdec (musepack, version >= 1.2.1 required)"
4824 if test "$_musepack" = yes ; then
4825 _musepack=no
4826 cat > $TMPC << EOF
4827 #include <stddef.h>
4828 #include <mpcdec/mpcdec.h>
4829 int main(void) {
4830 mpc_streaminfo info;
4831 mpc_decoder decoder;
4832 mpc_decoder_set_streaminfo(&decoder, &info);
4833 mpc_decoder_decode_frame(&decoder, NULL, 0, NULL);
4834 return 0;
4837 cc_check -lmpcdec $_ld_lm && _musepack=yes
4839 if test "$_musepack" = yes ; then
4840 def_musepack='#define CONFIG_MUSEPACK 1'
4841 extra_ldflags="$extra_ldflags -lmpcdec"
4842 codecmodules="musepack $codecmodules"
4843 else
4844 def_musepack='#undef CONFIG_MUSEPACK'
4845 nocodecmodules="musepack $nocodecmodules"
4847 echores "$_musepack"
4850 echocheck "FAAD2 support"
4851 if test "$_faad" = auto ; then
4852 _faad=no
4853 cat > $TMPC << EOF
4854 #include <faad.h>
4855 #ifndef FAAD_MIN_STREAMSIZE
4856 #error Too old version
4857 #endif
4858 int main(void) { faacDecHandle testhand; faacDecFrameInfo testinfo;
4859 testhand = faacDecOpen(); faacDecInit(0, 0, 0, 0, 0); return 0; }
4861 cc_check -lfaad $_ld_lm && _faad=yes
4864 def_faad='#undef CONFIG_FAAD'
4865 if test "$_faad" = yes ; then
4866 def_faad='#define CONFIG_FAAD 1'
4867 extra_ldflags="$extra_ldflags -lfaad"
4868 codecmodules="faad2 $codecmodules"
4869 else
4870 nocodecmodules="faad2 $nocodecmodules"
4872 echores "$_faad"
4875 echocheck "LADSPA plugin support"
4876 if test "$_ladspa" = auto ; then
4877 _ladspa=no
4878 statement_check ladspa.h 'LADSPA_Descriptor ld = {0}' && _ladspa=yes
4880 if test "$_ladspa" = yes; then
4881 def_ladspa="#define CONFIG_LADSPA 1"
4882 else
4883 def_ladspa="#undef CONFIG_LADSPA"
4885 echores "$_ladspa"
4888 echocheck "libbs2b audio filter support"
4889 if test "$_libbs2b" = auto ; then
4890 _libbs2b=no
4891 if pkg_config_add libbs2b ; then
4892 _libbs2b=yes
4895 def_libbs2b="#undef CONFIG_LIBBS2B"
4896 test "$_libbs2b" = yes && def_libbs2b="#define CONFIG_LIBBS2B 1"
4897 echores "$_libbs2b"
4900 if test -z "$_codecsdir" ; then
4901 for dir in "$_libdir/codecs" "$_libdir/win32" /usr/local/lib/codecs \
4902 /usr/lib/codecs /usr/local/lib/win32 /usr/lib/win32 ; do
4903 if test -d "$dir" ; then
4904 _codecsdir="$dir"
4905 break;
4907 done
4909 # Fall back on default directory.
4910 if test -z "$_codecsdir" ; then
4911 _codecsdir="$_libdir/codecs"
4912 mingw32 && _codecsdir="codecs"
4916 echocheck "Win32 codecs"
4917 if test "$_win32dll" = auto ; then
4918 _win32dll=no
4919 if x86_32 && ! qnx; then
4920 _win32dll=yes
4923 if test "$_win32dll" = yes ; then
4924 def_win32dll='#define CONFIG_WIN32DLL 1'
4925 if ! win32 ; then
4926 def_win32_loader='#define WIN32_LOADER 1'
4927 _win32_emulation=yes
4928 else
4929 extra_ldflags="$extra_ldflags -ladvapi32 -lole32"
4930 res_comment="using native windows"
4932 codecmodules="win32 $codecmodules"
4933 else
4934 def_win32dll='#undef CONFIG_WIN32DLL'
4935 def_win32_loader='#undef WIN32_LOADER'
4936 nocodecmodules="win32 $nocodecmodules"
4938 echores "$_win32dll"
4941 echocheck "XAnim codecs"
4942 if test "$_xanim" = auto ; then
4943 _xanim=no
4944 res_comment="dynamic loader support needed"
4945 if test "$_dl" = yes ; then
4946 _xanim=yes
4949 if test "$_xanim" = yes ; then
4950 def_xanim='#define CONFIG_XANIM 1'
4951 codecmodules="xanim $codecmodules"
4952 else
4953 def_xanim='#undef CONFIG_XANIM'
4954 nocodecmodules="xanim $nocodecmodules"
4956 echores "$_xanim"
4959 echocheck "RealPlayer codecs"
4960 if test "$_real" = auto ; then
4961 _real=no
4962 res_comment="dynamic loader support needed"
4963 if test "$_dl" = yes || test "$_win32dll" = yes &&
4964 (linux || freebsd || netbsd || openbsd || dragonfly || darwin || win32) ; then
4965 _real=yes
4968 if test "$_real" = yes ; then
4969 def_real='#define CONFIG_REALCODECS 1'
4970 codecmodules="real $codecmodules"
4971 else
4972 def_real='#undef CONFIG_REALCODECS'
4973 nocodecmodules="real $nocodecmodules"
4975 echores "$_real"
4978 echocheck "QuickTime codecs"
4979 _qtx_emulation=no
4980 def_qtx_win32='#undef CONFIG_QTX_CODECS_WIN32'
4981 if test "$_qtx" = auto ; then
4982 test "$_win32dll" = yes || test "$quicktime" = yes && _qtx=yes
4984 if test "$_qtx" = yes ; then
4985 def_qtx='#define CONFIG_QTX_CODECS 1'
4986 win32 && _qtx_codecs_win32=yes && def_qtx_win32='#define CONFIG_QTX_CODECS_WIN32 1'
4987 codecmodules="qtx $codecmodules"
4988 darwin || win32 || _qtx_emulation=yes
4989 else
4990 def_qtx='#undef CONFIG_QTX_CODECS'
4991 nocodecmodules="qtx $nocodecmodules"
4993 echores "$_qtx"
4995 echocheck "LCMS2 support"
4996 if test "$_lcms2" = auto ; then
4997 _lcms2=no
4998 if pkg_config_add lcms2 ; then
4999 _lcms2=yes
5002 if test "$_lcms2" = yes; then
5003 def_lcms2="#define CONFIG_LCMS2 1"
5004 else
5005 def_lcms2="#undef CONFIG_LCMS2"
5007 echores "$_lcms2"
5010 # Test with > against Libav 0.8 versions which will NOT work rather than
5011 # specify minimum version, to allow (future) point releases to possibly work.
5012 all_libav_libs="libavutil > 51.21.0:libavcodec > 53.34.0:libavformat > 53.20.0:libswscale >= 2.0.0"
5013 echocheck "Libav ($all_libav_libs)"
5014 if test "$ffmpeg" = auto ; then
5015 IFS=":" # shell should not be used for programming
5016 if ! pkg_config_add $all_libav_libs ; then
5017 die "Unable to find development files for some of the required Libav libraries above. Aborting."
5020 echores "yes"
5022 def_ffmpeg_internals="#undef CONFIG_FFMPEG_INTERNALS"
5023 if ! test -z "$_ffmpeg_source" ; then
5024 def_ffmpeg_internals="#define CONFIG_FFMPEG_INTERNALS 1" && ffmpeg_internals=yes
5027 echocheck "libpostproc >= 52.0.0"
5028 if test "$libpostproc" = auto ; then
5029 libpostproc=no
5030 if pkg_config_add "libpostproc >= 52.0.0" ; then
5031 libpostproc=yes
5034 if test "$libpostproc" = yes ; then
5035 def_libpostproc='#define CONFIG_LIBPOSTPROC 1'
5036 else
5037 def_libpostproc='#undef CONFIG_LIBPOSTPROC'
5039 echores "$libpostproc"
5041 echocheck "libavresample >= 1.0.0"
5042 if test "$libavresample" = auto ; then
5043 libavresample=no
5044 if pkg_config_add "libavresample >= 1.0.0" ; then
5045 libavresample=yes
5048 if test "$libavresample" = yes ; then
5049 def_libavresample='#define CONFIG_LIBAVRESAMPLE 1'
5050 else
5051 def_libavresample='#undef CONFIG_LIBAVRESAMPLE'
5053 echores "$libavresample"
5055 echocheck "libdv-0.9.5+"
5056 if test "$_libdv" = auto ; then
5057 _libdv=no
5058 statement_check libdv/dv.h 'dv_encoder_new(1, 1, 1)' -ldv $_ld_pthread $_ld_lm && _libdv=yes
5060 if test "$_libdv" = yes ; then
5061 def_libdv='#define CONFIG_LIBDV095 1'
5062 extra_ldflags="$extra_ldflags -ldv"
5063 codecmodules="libdv $codecmodules"
5064 else
5065 def_libdv='#undef CONFIG_LIBDV095'
5066 nocodecmodules="libdv $nocodecmodules"
5068 echores "$_libdv"
5071 echocheck "Xvid"
5072 if test "$_xvid" = auto ; then
5073 _xvid=no
5074 for _ld_tmp in "-lxvidcore $_ld_lm" "-lxvidcore $_ld_lm $_ld_pthread" ; do
5075 statement_check xvid.h 'xvid_global(0, 0, 0, 0)' $_ld_tmp &&
5076 extra_ldflags="$extra_ldflags $_ld_tmp" && _xvid=yes && break
5077 done
5080 if test "$_xvid" = yes ; then
5081 def_xvid='#define CONFIG_XVID4 1'
5082 codecmodules="xvid $codecmodules"
5083 else
5084 def_xvid='#undef CONFIG_XVID4'
5085 nocodecmodules="xvid $nocodecmodules"
5087 echores "$_xvid"
5090 echocheck "libnut"
5091 if test "$_libnut" = auto ; then
5092 _libnut=no
5093 statement_check libnut.h 'nut_context_tt * nut; nut_error(0)' -lnut && _libnut=yes
5096 if test "$_libnut" = yes ; then
5097 def_libnut='#define CONFIG_LIBNUT 1'
5098 extra_ldflags="$extra_ldflags -lnut"
5099 else
5100 def_libnut='#undef CONFIG_LIBNUT'
5102 echores "$_libnut"
5105 echocheck "UnRAR executable"
5106 if test "$_unrar_exec" = auto ; then
5107 _unrar_exec="yes"
5108 mingw32 && _unrar_exec="no"
5110 if test "$_unrar_exec" = yes ; then
5111 def_unrar_exec='#define CONFIG_UNRAR_EXEC 1'
5112 else
5113 def_unrar_exec='#undef CONFIG_UNRAR_EXEC'
5115 echores "$_unrar_exec"
5117 echocheck "TV interface"
5118 if test "$_tv" = yes ; then
5119 def_tv='#define CONFIG_TV 1'
5120 inputmodules="tv $inputmodules"
5121 else
5122 noinputmodules="tv $noinputmodules"
5123 def_tv='#undef CONFIG_TV'
5125 echores "$_tv"
5128 if freebsd || netbsd || openbsd || dragonfly || bsdos ; then
5129 echocheck "*BSD BT848 bt8xx header"
5130 _ioctl_bt848_h=no
5131 for file in "machine/ioctl_bt848.h" \
5132 "dev/bktr/ioctl_bt848.h" \
5133 "dev/video/bktr/ioctl_bt848.h" \
5134 "dev/ic/bt8xx.h" ; do
5135 cat > $TMPC <<EOF
5136 #include <sys/types.h>
5137 #include <sys/ioctl.h>
5138 #include <$file>
5139 int main(void) { ioctl(0, TVTUNER_GETFREQ, 0); return 0; }
5141 if cc_check ; then
5142 _ioctl_bt848_h=yes
5143 _ioctl_bt848_h_name="$file"
5144 break;
5146 done
5147 if test "$_ioctl_bt848_h" = yes ; then
5148 def_ioctl_bt848_h_name="#define IOCTL_BT848_H_NAME <$_ioctl_bt848_h_name>"
5149 res_comment="using $_ioctl_bt848_h_name"
5150 else
5151 def_ioctl_bt848_h_name="#undef IOCTL_BT848_H_NAME"
5153 echores "$_ioctl_bt848_h"
5155 echocheck "*BSD ioctl_meteor.h"
5156 _ioctl_meteor_h=no
5157 for ioctl_meteor_h_path in "machine/ioctl_meteor.h" "dev/bktr/ioctl_meteor.h" "dev/video/bktr/ioctl_meteor.h" ; do
5158 statement_check_broken "sys/types.h" "$ioctl_meteor_h_path" 'ioctl(0, METEORSINPUT, 0)' &&
5159 _ioctl_meteor_h=yes && break
5160 done
5161 if test "$_ioctl_meteor_h" = yes ; then
5162 def_ioctl_meteor_h_name="#define IOCTL_METEOR_H_NAME <$ioctl_meteor_h_path>"
5163 res_comment="using $ioctl_meteor_h_path"
5164 else
5165 def_ioctl_meteor_h_name="#undef IOCTL_METEOR_H_NAME"
5167 echores "$_ioctl_meteor_h"
5169 echocheck "*BSD BrookTree 848 TV interface"
5170 if test "$_tv_bsdbt848" = auto ; then
5171 _tv_bsdbt848=no
5172 if test "$_tv" = yes ; then
5173 cat > $TMPC <<EOF
5174 #include <sys/types.h>
5175 $def_ioctl_meteor_h_name
5176 $def_ioctl_bt848_h_name
5177 #ifdef IOCTL_METEOR_H_NAME
5178 #include IOCTL_METEOR_H_NAME
5179 #endif
5180 #ifdef IOCTL_BT848_H_NAME
5181 #include IOCTL_BT848_H_NAME
5182 #endif
5183 int main(void) {
5184 ioctl(0, METEORSINPUT, 0);
5185 ioctl(0, TVTUNER_GETFREQ, 0);
5186 return 0;
5189 cc_check && _tv_bsdbt848=yes
5192 if test "$_tv_bsdbt848" = yes ; then
5193 def_tv_bsdbt848='#define CONFIG_TV_BSDBT848 1'
5194 inputmodules="tv-bsdbt848 $inputmodules"
5195 else
5196 def_tv_bsdbt848='#undef CONFIG_TV_BSDBT848'
5197 noinputmodules="tv-bsdbt848 $noinputmodules"
5199 echores "$_tv_bsdbt848"
5200 fi #if freebsd || netbsd || openbsd || dragonfly || bsdos
5203 echocheck "DirectShow TV interface"
5204 if test "$_tv_dshow" = auto ; then
5205 _tv_dshow=no
5206 if test "$_tv" = yes && win32 ; then
5207 statement_check ole2.h 'void* p; CoCreateInstance((GUID*)&GUID_NULL, NULL, CLSCTX_INPROC_SERVER, &GUID_NULL, &p)' -lole32 -luuid && _tv_dshow=yes
5210 if test "$_tv_dshow" = yes ; then
5211 inputmodules="tv-dshow $inputmodules"
5212 def_tv_dshow='#define CONFIG_TV_DSHOW 1'
5213 extra_ldflags="$extra_ldflags -lole32 -luuid"
5214 else
5215 noinputmodules="tv-dshow $noinputmodules"
5216 def_tv_dshow='#undef CONFIG_TV_DSHOW'
5218 echores "$_tv_dshow"
5221 echocheck "Video 4 Linux TV interface"
5222 if test "$_tv_v4l1" = auto ; then
5223 _tv_v4l1=no
5224 if test "$_tv" = yes && linux ; then
5225 header_check_broken sys/time.h linux/videodev.h && _tv_v4l1=yes
5228 if test "$_tv_v4l1" = yes ; then
5229 _audio_input=yes
5230 _tv_v4l=yes
5231 def_tv_v4l='#define CONFIG_TV_V4L 1'
5232 def_tv_v4l1='#define CONFIG_TV_V4L1 1'
5233 inputmodules="tv-v4l $inputmodules"
5234 else
5235 noinputmodules="tv-v4l1 $noinputmodules"
5236 def_tv_v4l='#undef CONFIG_TV_V4L'
5238 echores "$_tv_v4l1"
5241 echocheck "Video 4 Linux 2 TV interface"
5242 if test "$_tv_v4l2" = auto ; then
5243 _tv_v4l2=no
5244 if test "$_tv" = yes && linux ; then
5245 header_check_broken sys/time.h linux/videodev2.h && _tv_v4l2=yes
5246 elif test "$_tv" = yes && test "$sys_videoio_h" = "yes" ; then
5247 _tv_v4l2=yes
5250 if test "$_tv_v4l2" = yes ; then
5251 _audio_input=yes
5252 _tv_v4l=yes
5253 def_tv_v4l='#define CONFIG_TV_V4L 1'
5254 def_tv_v4l2='#define CONFIG_TV_V4L2 1'
5255 inputmodules="tv-v4l2 $inputmodules"
5256 else
5257 noinputmodules="tv-v4l2 $noinputmodules"
5258 def_tv_v4l2='#undef CONFIG_TV_V4L2'
5260 echores "$_tv_v4l2"
5263 echocheck "Radio interface"
5264 if test "$_radio" = yes ; then
5265 def_radio='#define CONFIG_RADIO 1'
5266 inputmodules="radio $inputmodules"
5267 if test "$_alsa" != yes -a "$_ossaudio" != yes ; then
5268 _radio_capture=no
5270 if test "$_radio_capture" = yes ; then
5271 _audio_input=yes
5272 def_radio_capture="#define CONFIG_RADIO_CAPTURE 1"
5273 else
5274 def_radio_capture="#undef CONFIG_RADIO_CAPTURE"
5276 else
5277 noinputmodules="radio $noinputmodules"
5278 def_radio='#undef CONFIG_RADIO'
5279 def_radio_capture="#undef CONFIG_RADIO_CAPTURE"
5280 _radio_capture=no
5282 echores "$_radio"
5283 echocheck "Capture for Radio interface"
5284 echores "$_radio_capture"
5286 echocheck "Video 4 Linux 2 Radio interface"
5287 if test "$_radio_v4l2" = auto ; then
5288 _radio_v4l2=no
5289 if test "$_radio" = yes && linux ; then
5290 header_check linux/videodev2.h && _radio_v4l2=yes
5293 if test "$_radio_v4l2" = yes ; then
5294 def_radio_v4l2='#define CONFIG_RADIO_V4L2 1'
5295 else
5296 def_radio_v4l2='#undef CONFIG_RADIO_V4L2'
5298 echores "$_radio_v4l2"
5300 echocheck "Video 4 Linux Radio interface"
5301 if test "$_radio_v4l" = auto ; then
5302 _radio_v4l=no
5303 if test "$_radio" = yes && linux ; then
5304 header_check linux/videodev.h && _radio_v4l=yes
5307 if test "$_radio_v4l" = yes ; then
5308 def_radio_v4l='#define CONFIG_RADIO_V4L 1'
5309 else
5310 def_radio_v4l='#undef CONFIG_RADIO_V4L'
5312 echores "$_radio_v4l"
5314 if freebsd || netbsd || openbsd || dragonfly || bsdos &&
5315 test "$_radio" = yes && test "$_radio_bsdbt848" = auto ; then
5316 echocheck "*BSD BrookTree 848 Radio interface"
5317 _radio_bsdbt848=no
5318 cat > $TMPC <<EOF
5319 #include <sys/types.h>
5320 $def_ioctl_bt848_h_name
5321 #ifdef IOCTL_BT848_H_NAME
5322 #include IOCTL_BT848_H_NAME
5323 #endif
5324 int main(void) { ioctl(0, RADIO_GETFREQ, 0); return 0; }
5326 cc_check && _radio_bsdbt848=yes
5327 echores "$_radio_bsdbt848"
5328 fi #if freebsd || netbsd || openbsd || dragonfly || bsdos && _radio && _radio_bsdbt848
5330 if test "$_radio_bsdbt848" = yes ; then
5331 def_radio_bsdbt848='#define CONFIG_RADIO_BSDBT848 1'
5332 else
5333 def_radio_bsdbt848='#undef CONFIG_RADIO_BSDBT848'
5336 if test "$_radio_v4l" = no && test "$_radio_v4l2" = no &&
5337 test "$_radio_bsdbt848" = no && test "$_radio" = yes ; then
5338 die "Radio driver requires BSD BT848, V4L or V4L2!"
5341 echocheck "Video 4 Linux 2 MPEG PVR interface"
5342 if test "$_pvr" = auto ; then
5343 _pvr=no
5344 if test "$_tv_v4l2" = yes && linux ; then
5345 cat > $TMPC <<EOF
5346 #include <sys/time.h>
5347 #include <linux/videodev2.h>
5348 int main(void) { struct v4l2_ext_controls ext; return ext.controls->value; }
5350 cc_check && _pvr=yes
5353 if test "$_pvr" = yes ; then
5354 def_pvr='#define CONFIG_PVR 1'
5355 inputmodules="pvr $inputmodules"
5356 else
5357 noinputmodules="pvr $noinputmodules"
5358 def_pvr='#undef CONFIG_PVR'
5360 echores "$_pvr"
5363 echocheck "ftp"
5364 if test "$_ftp" = "auto" ; then
5365 test "$networking" = "yes" && ! beos && _ftp=yes
5367 if test "$_ftp" = yes ; then
5368 def_ftp='#define CONFIG_FTP 1'
5369 inputmodules="ftp $inputmodules"
5370 else
5371 noinputmodules="ftp $noinputmodules"
5372 def_ftp='#undef CONFIG_FTP'
5374 echores "$_ftp"
5376 echocheck "vstream client"
5377 if test "$_vstream" = auto ; then
5378 _vstream=no
5379 cat > $TMPC <<EOF
5380 #include <vstream-client.h>
5381 void vstream_error(const char *format, ... ) {}
5382 int main(void) { vstream_start(); return 0; }
5384 cc_check -lvstream-client && _vstream=yes
5386 if test "$_vstream" = yes ; then
5387 def_vstream='#define CONFIG_VSTREAM 1'
5388 inputmodules="vstream $inputmodules"
5389 extra_ldflags="$extra_ldflags -lvstream-client"
5390 else
5391 noinputmodules="vstream $noinputmodules"
5392 def_vstream='#undef CONFIG_VSTREAM'
5394 echores "$_vstream"
5397 echocheck "Subtitles sorting"
5398 if test "$_sortsub" = yes ; then
5399 def_sortsub='#define CONFIG_SORTSUB 1'
5400 else
5401 def_sortsub='#undef CONFIG_SORTSUB'
5403 echores "$_sortsub"
5406 echocheck "XMMS inputplugin support"
5407 if test "$_xmms" = yes ; then
5408 if ( xmms-config --version ) >/dev/null 2>&1 ; then
5409 _xmmsplugindir=$(xmms-config --input-plugin-dir)
5410 _xmmslibdir=$(xmms-config --exec-prefix)/lib
5411 else
5412 _xmmsplugindir=/usr/lib/xmms/Input
5413 _xmmslibdir=/usr/lib
5416 def_xmms='#define CONFIG_XMMS 1'
5417 if darwin ; then
5418 extra_ldflags="$extra_ldflags ${_xmmslibdir}/libxmms.dylib"
5419 else
5420 extra_ldflags="$extra_ldflags ${_xmmslibdir}/libxmms.so.1 -export-dynamic"
5422 else
5423 def_xmms='#undef CONFIG_XMMS'
5425 echores "$_xmms"
5427 if test "$_charset" != "noconv" ; then
5428 def_charset="#define MSG_CHARSET \"$_charset\""
5429 else
5430 def_charset="#undef MSG_CHARSET"
5431 _charset="UTF-8"
5434 #############################################################################
5436 echocheck "automatic gdb attach"
5437 if test "$_crash_debug" = yes ; then
5438 def_crash_debug='#define CONFIG_CRASH_DEBUG 1'
5439 else
5440 def_crash_debug='#undef CONFIG_CRASH_DEBUG'
5441 _crash_debug=no
5443 echores "$_crash_debug"
5445 echocheck "compiler support for noexecstack"
5446 if cflag_check -Wl,-z,noexecstack ; then
5447 extra_ldflags="-Wl,-z,noexecstack $extra_ldflags"
5448 echores "yes"
5449 else
5450 echores "no"
5453 echocheck "linker support for --nxcompat --no-seh --dynamicbase"
5454 if cflag_check "-Wl,--nxcompat -Wl,--no-seh -Wl,--dynamicbase" ; then
5455 extra_ldflags="-Wl,--nxcompat -Wl,--no-seh -Wl,--dynamicbase $extra_ldflags"
5456 echores "yes"
5457 else
5458 echores "no"
5462 # Dynamic linking flags
5463 # (FIXME: 'echocheck "dynamic linking"' above and modify here accordingly)
5464 _ld_dl_dynamic=''
5465 freebsd || netbsd || openbsd || dragonfly || bsdos && _ld_dl_dynamic='-rdynamic'
5466 if test "$_real" = yes || test "$_xanim" = yes && ! win32 && ! qnx && ! darwin ; then
5467 _ld_dl_dynamic='-rdynamic'
5470 extra_ldflags="$extra_ldflags $_ld_pthread $_ld_dl $_ld_dl_dynamic"
5471 bsdos && extra_ldflags="$extra_ldflags -ldvd"
5472 (netbsd || openbsd) && x86_32 && extra_ldflags="$extra_ldflags -li386"
5474 def_debug='#undef MP_DEBUG'
5475 test "$_debug" != "" && def_debug='#define MP_DEBUG 1'
5478 echocheck "joystick"
5479 def_joystick='#undef CONFIG_JOYSTICK'
5480 if test "$_joystick" = yes ; then
5481 if linux || freebsd ; then
5482 # TODO add some check
5483 def_joystick='#define CONFIG_JOYSTICK 1'
5484 else
5485 _joystick="no"
5486 res_comment="unsupported under $system_name"
5489 echores "$_joystick"
5491 echocheck "lirc"
5492 if test "$_lirc" = auto ; then
5493 _lirc=no
5494 header_check lirc/lirc_client.h -llirc_client && _lirc=yes
5496 if test "$_lirc" = yes ; then
5497 def_lirc='#define CONFIG_LIRC 1'
5498 libs_mplayer="$libs_mplayer -llirc_client"
5499 else
5500 def_lirc='#undef CONFIG_LIRC'
5502 echores "$_lirc"
5504 echocheck "lircc"
5505 if test "$_lircc" = auto ; then
5506 _lircc=no
5507 header_check lirc/lircc.h -llircc && _lircc=yes
5509 if test "$_lircc" = yes ; then
5510 def_lircc='#define CONFIG_LIRCC 1'
5511 libs_mplayer="$libs_mplayer -llircc"
5512 else
5513 def_lircc='#undef CONFIG_LIRCC'
5515 echores "$_lircc"
5517 #############################################################################
5519 CFLAGS="$CFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE"
5521 # This must be the last test to be performed. Any other tests following it
5522 # could fail due to linker errors. libdvdnavmini is intentionally not linked
5523 # against libdvdread (to permit MPlayer to use its own copy of the library).
5524 # So any compilation using the flags added here but not linking against
5525 # libdvdread can fail.
5526 echocheck "DVD support (libdvdnav)"
5527 if test "$_dvdread_internal" = yes && test ! -f "libdvdnav/dvdnav.c" ; then
5528 _dvdnav=no
5530 dvdnav_internal=no
5531 if test "$_dvdnav" = auto ; then
5532 if test "$_dvdread_internal" = yes ; then
5533 _dvdnav=yes
5534 dvdnav_internal=yes
5535 res_comment="internal"
5536 else
5537 $_dvdnavconfig --version --minilibs >> $TMPLOG 2>&1 || _dvdnav=no
5540 if test "$_dvdnav" = auto ; then
5541 _dvdnav=no
5542 _dvdnavdir=$($_dvdnavconfig --cflags)
5543 _dvdnavlibs=$($_dvdnavconfig --libs)
5544 statement_check_broken stdint.h dvdnav/dvdnav.h 'dvdnav_t *dvd = 0' $_dvdnavdir $_dvdnavlibs $_ld_dl $_ld_pthread && _dvdnav=yes
5546 if test "$_dvdnav" = yes ; then
5547 def_dvdnav='#define CONFIG_DVDNAV 1'
5548 if test "$dvdnav_internal" = yes ; then
5549 cflags_libdvdnav="-Ilibdvdnav"
5550 inputmodules="dvdnav(internal) $inputmodules"
5551 else
5552 extra_cflags="$extra_cflags $($_dvdnavconfig --cflags)"
5553 extra_ldflags="$extra_ldflags $($_dvdnavconfig --minilibs)"
5554 inputmodules="dvdnav $inputmodules"
5556 else
5557 def_dvdnav='#undef CONFIG_DVDNAV'
5558 noinputmodules="dvdnav $noinputmodules"
5560 echores "$_dvdnav"
5562 # DO NOT ADD ANY TESTS THAT USE LINKER FLAGS HERE (like cc_check).
5563 # Read dvdnav comment above.
5565 mak_enable () {
5566 list=$(echo $1 | tr '[a-z]' '[A-Z]')
5567 item=$(echo $2 | tr '[a-z]' '[A-Z]')
5568 nprefix=$3;
5569 for part in $list; do
5570 if $(echo $item | grep -q -E "(^| )$part($| )"); then
5571 echo "${nprefix}_$part = yes"
5573 done
5576 #############################################################################
5577 echo "Creating config.mak"
5578 cat > config.mak << EOF
5579 # -------- Generated by configure -----------
5581 # Ensure that locale settings do not interfere with shell commands.
5582 export LC_ALL = C
5584 CONFIGURATION = $configuration
5586 CHARSET = $_charset
5587 DOC_LANGS = $language_doc
5588 DOC_LANG_ALL = $doc_lang_all
5589 MAN_LANGS = $language_man
5590 MAN_LANG_ALL = $man_lang_all
5591 MSG_LANGS = $language_msg
5592 MSG_LANG_ALL = $msg_lang_all
5594 prefix = \$(DESTDIR)$_prefix
5595 BINDIR = \$(DESTDIR)$_bindir
5596 DATADIR = \$(DESTDIR)$_datadir
5597 LIBDIR = \$(DESTDIR)$_libdir
5598 MANDIR = \$(DESTDIR)$_mandir
5599 CONFDIR = \$(DESTDIR)$_confdir
5600 LOCALEDIR = \$(DESTDIR)$_localedir
5602 AR = $_ar
5603 AS = $_cc
5604 CC = $_cc
5605 INSTALL = $_install
5606 INSTALLSTRIP = $_install_strip
5607 WINDRES = $_windres
5609 CFLAGS = $WARNFLAGS $ERRORFLAGS $WARN_CFLAGS $CFLAGS $extra_cflags
5610 DEPFLAGS = $DEPFLAGS
5612 CFLAGS_LIBDVDCSS = $cflags_libdvdcss
5613 CFLAGS_LIBDVDCSS_DVDREAD = $cflags_libdvdcss_dvdread
5614 CFLAGS_LIBDVDNAV = $cflags_libdvdnav
5615 CFLAGS_NO_OMIT_LEAF_FRAME_POINTER = $cflags_no_omit_leaf_frame_pointer
5616 CFLAGS_STACKREALIGN = $cflags_stackrealign
5618 EXTRALIBS = $extra_ldflags $_ld_static $_ld_lm $extra_libs
5619 EXTRALIBS_MPLAYER = $libs_mplayer
5621 GETCH = $_getch
5622 TIMER = $_timer
5624 EXESUF = $_exesuf
5625 EXESUFS_ALL = .exe
5627 ARCH = $arch
5628 $(mak_enable "$arch_all" "$arch" ARCH)
5629 $(mak_enable "$subarch_all" "$subarch" ARCH)
5630 $(mak_enable "$cpuexts_all" "$cpuexts" HAVE)
5632 NEED_GETTIMEOFDAY = $need_gettimeofday
5633 NEED_GLOB = $need_glob
5634 NEED_SETENV = $need_setenv
5635 NEED_SHMEM = $need_shmem
5636 NEED_STRSEP = $need_strsep
5637 NEED_SWAB = $need_swab
5638 NEED_VSSCANF = $need_vsscanf
5640 # features
5641 ALSA = $_alsa
5642 APPLE_IR = $_apple_ir
5643 APPLE_REMOTE = $_apple_remote
5644 AUDIO_INPUT = $_audio_input
5645 CACA = $_caca
5646 CDDA = $_cdda
5647 CDDB = $_cddb
5648 COCOA = $_cocoa
5649 COREAUDIO = $_coreaudio
5650 COREVIDEO = $_corevideo
5651 SHAREDBUFFER = $_sharedbuffer
5652 DIRECT3D = $_direct3d
5653 DIRECTFB = $_directfb
5654 DIRECTX = $_directx
5655 DVBIN = $_dvbin
5656 DVDNAV = $_dvdnav
5657 DVDNAV_INTERNAL = $dvdnav_internal
5658 DVDREAD = $_dvdread
5659 DVDREAD_INTERNAL = $_dvdread_internal
5660 DXR3 = $_dxr3
5661 FAAD = $_faad
5662 FASTMEMCPY = $_fastmemcpy
5663 FTP = $_ftp
5664 GIF = $_gif
5665 GL = $_gl
5666 GL_COCOA = $_gl_cocoa
5667 GL_WIN32 = $_gl_win32
5668 GL_X11 = $_gl_x11
5669 GL_SDL = $_gl_sdl
5670 HAVE_POSIX_SELECT = $_posix_select
5671 HAVE_SYS_MMAN_H = $_mman
5672 JACK = $_jack
5673 JOYSTICK = $_joystick
5674 JPEG = $_jpeg
5675 LADSPA = $_ladspa
5676 LIBA52 = $_liba52
5677 LIBASS = $_ass
5678 LIBBLURAY = $_bluray
5679 LIBBS2B = $_libbs2b
5680 LIBDCA = $_libdca
5681 LIBDV = $_libdv
5682 LIBDVDCSS_INTERNAL = $_libdvdcss_internal
5683 LIBMAD = $_mad
5684 LCMS2 = $_lcms2
5685 LIBNUT = $_libnut
5686 LIBPOSTPROC = $libpostproc
5687 LIBAVRESAMPLE = $libavresample
5688 LIBSMBCLIENT = $_smb
5689 LIBQUVI = $_libquvi
5690 LIBTHEORA = $_theora
5691 LIRC = $_lirc
5692 MACOSX_FINDER = $_macosx_finder
5693 MD5SUM = $_md5sum
5694 MNG = $_mng
5695 MPG123 = $_mpg123
5696 MUSEPACK = $_musepack
5697 NETWORKING = $networking
5698 OPENAL = $_openal
5699 OSS = $_ossaudio
5700 PE_EXECUTABLE = $_pe_executable
5701 PNG = $_png
5702 PNM = $_pnm
5703 PRIORITY = $_priority
5704 PULSE = $_pulse
5705 PORTAUDIO = $_portaudio
5706 PVR = $_pvr
5707 QTX_CODECS = $_qtx
5708 QTX_CODECS_WIN32 = $_qtx_codecs_win32
5709 QTX_EMULATION = $_qtx_emulation
5710 RADIO=$_radio
5711 RADIO_CAPTURE=$_radio_capture
5712 REAL_CODECS = $_real
5713 RSOUND = $_rsound
5714 SDL = $_sdl
5715 SPEEX = $_speex
5716 STREAM_CACHE = $_stream_cache
5717 TGA = $_tga
5718 TV = $_tv
5719 TV_BSDBT848 = $_tv_bsdbt848
5720 TV_DSHOW = $_tv_dshow
5721 TV_V4L = $_tv_v4l
5722 TV_V4L1 = $_tv_v4l1
5723 TV_V4L2 = $_tv_v4l2
5724 UNRAR_EXEC = $_unrar_exec
5725 V4L2 = $_v4l2
5726 VCD = $_vcd
5727 VDPAU = $_vdpau
5728 VORBIS = $_vorbis
5729 VSTREAM = $_vstream
5730 WIN32DLL = $_win32dll
5731 WIN32_EMULATION = $_win32_emulation
5732 X11 = $_x11
5733 XANIM_CODECS = $_xanim
5734 XMMS_PLUGINS = $_xmms
5735 XV = $_xv
5736 XVID4 = $_xvid
5737 YUV4MPEG = $_yuv4mpeg
5739 # FFmpeg
5740 FFMPEG_INTERNALS = $ffmpeg_internals
5741 FFMPEG_SOURCE_PATH = $_ffmpeg_source
5743 RANLIB = $_ranlib
5744 YASM = $_yasm
5745 YASMFLAGS = $YASMFLAGS
5747 CONFIG_VDPAU = $_vdpau
5748 CONFIG_ZLIB = $_zlib
5750 HAVE_PTHREADS = $_pthreads
5751 HAVE_SHM = $_shm
5752 HAVE_W32THREADS = $_w32threads
5753 HAVE_YASM = $have_yasm
5757 #############################################################################
5759 ff_config_enable () {
5760 list=$(echo $1 | tr '[a-z]' '[A-Z]')
5761 item=$(echo $2 | tr '[a-z]' '[A-Z]')
5762 _nprefix=$3;
5763 test -z "$_nprefix" && _nprefix='CONFIG'
5764 for part in $list; do
5765 if $(echo $item | grep -q -E "(^| )$part($| )"); then
5766 echo "#define ${_nprefix}_$part 1"
5767 else
5768 echo "#define ${_nprefix}_$part 0"
5770 done
5773 echo "Creating config.h"
5774 cat > $TMPH << EOF
5775 /*----------------------------------------------------------------------------
5776 ** This file has been automatically generated by configure any changes in it
5777 ** will be lost when you run configure again.
5778 ** Instead of modifying definitions here, use the --enable/--disable options
5779 ** of the configure script! See ./configure --help for details.
5780 *---------------------------------------------------------------------------*/
5782 #ifndef MPLAYER_CONFIG_H
5783 #define MPLAYER_CONFIG_H
5785 #define CONFIGURATION "$configuration"
5787 #define MPLAYER_DATADIR "$_datadir"
5788 #define MPLAYER_CONFDIR "$_confdir"
5789 #define MPLAYER_LOCALEDIR "$_localedir"
5791 $def_translation
5793 /* definitions needed by included libraries */
5794 #define HAVE_INTTYPES_H 1
5795 /* libdvdcss */
5796 #define HAVE_ERRNO_H 1
5797 /* libdvdcss + libdvdread */
5798 #define HAVE_LIMITS_H 1
5799 /* libdvdcss */
5800 #define HAVE_UNISTD_H 1
5801 /* libdvdread */
5802 #define STDC_HEADERS 1
5803 #define HAVE_MEMCPY 1
5804 /* libdvdnav */
5805 #define READ_CACHE_TRACE 0
5806 /* libdvdread */
5807 #define HAVE_DLFCN_H 1
5808 $def_dvdcss
5811 /* system headers */
5812 $def_alloca_h
5813 $def_altivec_h
5814 $def_malloc_h
5815 $def_mman_h
5816 $def_mman_has_map_failed
5817 $def_soundcard_h
5818 $def_sys_soundcard_h
5819 $def_sys_sysinfo_h
5820 $def_sys_videoio_h
5821 $def_termios_h
5822 $def_termios_sys_h
5823 $def_winsock2_h
5826 /* system functions */
5827 $def_gethostbyname2
5828 $def_gettimeofday
5829 $def_glob
5830 $def_langinfo
5831 $def_lrintf
5832 $def_map_memalign
5833 $def_memalign
5834 $def_nanosleep
5835 $def_posix_select
5836 $def_select
5837 $def_setenv
5838 $def_setmode
5839 $def_shm
5840 $def_strsep
5841 $def_swab
5842 $def_sysi86
5843 $def_sysi86_iv
5844 $def_termcap
5845 $def_termios
5846 $def_vsscanf
5849 /* system-specific features */
5850 $def_asmalign_pot
5851 $def_builtin_expect
5852 $def_dl
5853 $def_dos_paths
5854 $def_extern_asm
5855 $def_extern_prefix
5856 $def_iconv
5857 $def_kstat
5858 $def_macosx_bundle
5859 $def_macosx_finder
5860 $def_priority
5861 $def_quicktime
5862 $def_restrict_keyword
5863 $def_rtc
5864 $def_unrar_exec
5867 /* configurable options */
5868 $def_charset
5869 $def_crash_debug
5870 $def_debug
5871 $def_fastmemcpy
5872 $def_runtime_cpudetection
5873 $def_sighandler
5874 $def_sortsub
5875 $def_stream_cache
5876 $def_pthread_cache
5879 /* CPU stuff */
5880 #define __CPU__ $iproc
5881 $def_ebx_available
5882 $def_words_endian
5883 $def_bigendian
5884 $(ff_config_enable "$arch_all" "$arch" "ARCH")
5885 $(ff_config_enable "$subarch_all" "$subarch" "ARCH")
5886 $(ff_config_enable "$cpuexts_all" "$cpuexts" "HAVE")
5889 /* Blu-ray/DVD/VCD/CD */
5890 #define DEFAULT_CDROM_DEVICE "$default_cdrom_device"
5891 #define DEFAULT_DVD_DEVICE "$default_dvd_device"
5892 $def_bluray
5893 $def_bsdi_dvd
5894 $def_cdda
5895 $def_cddb
5896 $def_cdio
5897 $def_cdrom
5898 $def_dvd
5899 $def_dvd_bsd
5900 $def_dvd_darwin
5901 $def_dvd_linux
5902 $def_dvd_openbsd
5903 $def_dvdio
5904 $def_dvdnav
5905 $def_dvdread
5906 $def_hpux_scsi_h
5907 $def_sol_scsi_h
5908 $def_vcd
5911 /* codec libraries */
5912 $def_faad
5913 $def_liba52
5914 $def_libdca
5915 $def_libdv
5916 $def_mad
5917 $def_mpg123
5918 $def_musepack
5919 $def_speex
5920 $def_theora
5921 $def_tremor
5922 $def_vorbis
5923 $def_xvid
5924 $def_zlib
5926 $def_libpostproc
5927 $def_libavresample
5928 $def_libnut
5931 /* binary codecs */
5932 $def_qtx
5933 $def_qtx_win32
5934 $def_real
5935 $def_win32_loader
5936 $def_win32dll
5937 $def_xanim
5938 $def_xmms
5939 #define BINARY_CODECS_PATH "$_codecsdir"
5940 #define XMMS_INPUT_PLUGIN_DIR "$_xmmsplugindir"
5943 /* Audio output drivers */
5944 $def_alsa
5945 $def_coreaudio
5946 $def_jack
5947 $def_nas
5948 $def_openal
5949 $def_openal_h
5950 $def_ossaudio
5951 $def_ossaudio_devdsp
5952 $def_ossaudio_devmixer
5953 $def_pulse
5954 $def_portaudio
5955 $def_rsound
5957 $def_ladspa
5958 $def_libbs2b
5961 /* input */
5962 $def_apple_ir
5963 $def_apple_remote
5964 $def_ioctl_bt848_h_name
5965 $def_ioctl_meteor_h_name
5966 $def_joystick
5967 $def_lirc
5968 $def_lircc
5969 $def_pvr
5970 $def_radio
5971 $def_radio_bsdbt848
5972 $def_radio_capture
5973 $def_radio_v4l
5974 $def_radio_v4l2
5975 $def_tv
5976 $def_tv_bsdbt848
5977 $def_tv_dshow
5978 $def_tv_v4l
5979 $def_tv_v4l1
5980 $def_tv_v4l2
5983 /* font stuff */
5984 $def_ass
5985 $def_enca
5987 /* networking */
5988 $def_closesocket
5989 $def_ftp
5990 $def_inet6
5991 $def_inet_aton
5992 $def_inet_pton
5993 $def_networking
5994 $def_smb
5995 $def_libquvi
5996 $def_socklen_t
5997 $def_vstream
5999 $def_lcms2
6002 /* libvo options */
6003 $def_caca
6004 $def_corevideo
6005 $def_cocoa
6006 $def_sharedbuffer
6007 $def_direct3d
6008 $def_directfb
6009 $def_directx
6010 $def_dvbin
6011 $def_gif
6012 $def_gif_4
6013 $def_gif_tvt_hack
6014 $def_gl
6015 $def_gl_cocoa
6016 $def_gl_win32
6017 $def_gl_x11
6018 $def_gl_sdl
6019 $def_jpeg
6020 $def_md5sum
6021 $def_mng
6022 $def_png
6023 $def_pnm
6024 $def_sdl
6025 $def_sdl_sdl_h
6026 $def_tga
6027 $def_v4l2
6028 $def_vdpau
6029 $def_vm
6030 $def_x11
6031 $def_xdpms
6032 $def_xf86keysym
6033 $def_xinerama
6034 $def_xss
6035 $def_xv
6036 $def_yuv4mpeg
6039 /* FFmpeg */
6040 $def_ffmpeg_internals
6042 $def_arpa_inet_h
6043 $def_bswap
6044 $def_dcbzl
6045 $def_exp2
6046 $def_exp2f
6047 $def_fast_64bit
6048 $def_fast_unaligned
6049 $def_llrint
6050 $def_log2
6051 $def_log2f
6052 $def_lrint
6053 $def_memalign_hack
6054 $def_mkstemp
6055 $def_posix_memalign
6056 $def_pthreads
6057 $def_round
6058 $def_roundf
6059 $def_threads
6060 $def_truncf
6061 $def_xform_asm
6062 $def_yasm
6064 #define HAVE_INLINE_ASM 1
6066 /* Use these registers in x86 inline asm. No proper detection yet. */
6067 #define HAVE_EBP_AVAILABLE 1
6069 #endif /* MPLAYER_CONFIG_H */
6072 # Do not overwrite an unchanged config.h to avoid superfluous rebuilds.
6073 cmp -s "$TMPH" config.h || mv -f "$TMPH" config.h
6075 #############################################################################
6077 cat << EOF
6079 Config files successfully generated by ./configure $configuration !
6081 Install prefix: $_prefix
6082 Data directory: $_datadir
6083 Config direct.: $_confdir
6085 Byte order: $_byte_order
6086 Optimizing for: $_optimizing
6088 Languages:
6089 Messages (in addition to English): $language_msg
6090 Manual pages: $language_man
6091 Documentation: $language_doc
6093 Enabled optional drivers:
6094 Input: $inputmodules
6095 Codecs: $codecmodules
6096 Audio output: $aomodules
6097 Video output: $vomodules
6099 Disabled optional drivers:
6100 Input: $noinputmodules
6101 Codecs: $nocodecmodules
6102 Audio output: $noaomodules
6103 Video output: $novomodules
6105 'config.h' and 'config.mak' contain your configuration options.
6106 Note: If you alter theses files (for instance CFLAGS) MPlayer may no longer
6107 compile *** DO NOT REPORT BUGS if you tweak these files ***
6109 'make' will now compile MPlayer and 'make install' will install it.
6110 Note: On non-Linux systems you might need to use 'gmake' instead of 'make'.
6115 cat <<EOF
6116 Check $TMPLOG if you wonder why an autodetection failed (make sure
6117 development headers/packages are installed).
6119 NOTE: The --enable-* parameters unconditionally force options on, completely
6120 skipping autodetection. This behavior is unlike what you may be used to from
6121 autoconf-based configure scripts that can decide to override you. This greater
6122 level of control comes at a price. You may have to provide the correct compiler
6123 and linker flags yourself.
6124 If you used one of these options (except --enable-runtime-cpudetection and
6125 similar ones that turn on internal features) and experience a compilation or
6126 linking failure, make sure you have passed the necessary compiler/linker flags
6127 to configure.
6129 If you suspect a bug, please read DOCS/HTML/$language_doc/bugreports.html.
6133 if test "$warn_cflags" = yes; then
6134 cat <<EOF
6136 MPlayer compilation will use the CPPFLAGS/CFLAGS/LDFLAGS/YASMFLAGS set by you,
6137 but:
6139 *** *** DO NOT REPORT BUGS IF IT DOES NOT COMPILE/WORK! *** ***
6141 It is strongly recommended to let MPlayer choose the correct CFLAGS!
6142 To do so, execute 'CFLAGS= ./configure <options>'
6147 # Last move:
6148 rm -rf "$mplayer_tmpdir"