gl_common: minor cleanup/refactor
[mplayer.git] / configure
blobbf3dde8bb750f22e5294091548b61416b82d20c3
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]
357 Codecs:
358 --enable-gif enable GIF support [autodetect]
359 --enable-png enable PNG input/output support [autodetect]
360 --enable-mng enable MNG input support [autodetect]
361 --enable-jpeg enable JPEG input/output support [autodetect]
362 --enable-libcdio enable libcdio support [autodetect]
363 --disable-win32dll disable Win32 DLL support [autodetect]
364 --disable-qtx disable QuickTime codecs support [enabled]
365 --disable-xanim disable XAnim codecs support [enabled]
366 --disable-real disable RealPlayer codecs support [enabled]
367 --disable-xvid disable Xvid [autodetect]
368 --disable-libnut disable libnut [autodetect]
369 --enable-libav skip Libav autodetection [autodetect]
370 --disable-libvorbis disable libvorbis support [autodetect]
371 --disable-tremor disable Tremor [autodetect if no libvorbis]
372 --disable-speex disable Speex support [autodetect]
373 --enable-theora enable OggTheora libraries [autodetect]
374 --enable-faad enable FAAD2 (AAC) [autodetect]
375 --disable-ladspa disable LADSPA plugin support [autodetect]
376 --disable-libbs2b disable libbs2b audio filter support [autodetect]
377 --disable-libdv disable libdv 0.9.5 en/decoding support [autodetect]
378 --disable-mpg123 disable libmpg123 MP3 decoding support [autodetect]
379 --disable-mad disable libmad (MPEG audio) support [autodetect]
380 --enable-xmms enable XMMS input plugin support [disabled]
381 --enable-libdca enable libdca support [autodetect]
382 --disable-liba52 disable liba52 [autodetect]
383 --enable-musepack enable libmpcdec support (deprecated, libavcodec
384 Musepack decoder is preferred) [disabled]
386 Video output:
387 --enable-gl enable OpenGL video output [autodetect]
388 --enable-sdl enable SDL video output [autodetect]
389 --enable-caca enable CACA video output [autodetect]
390 --enable-direct3d enable Direct3D video output [autodetect]
391 --enable-directx enable DirectX video output [autodetect]
392 --enable-v4l2 enable V4L2 Decoder audio/video output [autodetect]
393 --enable-dvb enable DVB video input [autodetect]
394 --enable-xv enable Xv video output [autodetect]
395 --enable-vdpau enable VDPAU acceleration [autodetect]
396 --enable-vm enable XF86VidMode support [autodetect]
397 --enable-xinerama enable Xinerama support [autodetect]
398 --enable-x11 enable X11 video output [autodetect]
399 --enable-xshape enable XShape support [autodetect]
400 --disable-xss disable screensaver support via xss [autodetect]
401 --enable-directfb enable DirectFB video output [autodetect]
402 --disable-tga disable Targa video output [enable]
403 --disable-pnm disable PNM video output [enable]
404 --disable-md5sum disable md5sum video output [enable]
405 --disable-yuv4mpeg disable yuv4mpeg video output [enable]
406 --disable-corevideo disable CoreVideo video output [autodetect]
407 --disable-cocoa disable Cocoa OpenGL backend [autodetect]
408 --disable-sharedbuffer disable OSX shared buffer video output [autodetect]
410 Audio output:
411 --disable-alsa disable ALSA audio output [autodetect]
412 --disable-ossaudio disable OSS audio output [autodetect]
413 --disable-rsound disable RSound audio output [autodetect]
414 --disable-pulse disable Pulseaudio audio output [autodetect]
415 --disable-portaudio disable PortAudio audio output [autodetect]
416 --disable-jack disable JACK audio output [autodetect]
417 --enable-openal enable OpenAL audio output [disable]
418 --disable-coreaudio disable CoreAudio audio output [autodetect]
419 --disable-select disable using select() on the audio device [enable]
421 Language options:
422 --enable-translation enable support for translated output [disable]
423 --charset=charset convert the console messages to this character set
424 --language-doc=lang language to use for the documentation [en]
425 --language-man=lang language to use for the man pages [en]
426 --language-msg=lang extra languages for program messages [all]
427 --language=lang default language to use [en]
428 Specific options override --language. You can pass a list of languages separated
429 by whitespace or commas instead of a single language. Nonexisting translations
430 will be dropped from each list. All translations available in the list will be
431 installed. The value "all" will activate all translations. The LINGUAS
432 environment variable is honored. In all cases the fallback is English.
433 The program always supports English-language output; additional message
434 languages are only installed if --enable-translation is also specified.
435 Available values for --language-doc are: all $doc_lang_all
436 Available values for --language-man are: all $man_lang_all
437 Available values for --language-msg are: all $msg_lang_all
439 Miscellaneous options:
440 --enable-runtime-cpudetection enable runtime CPU detection [disable]
441 --enable-cross-compile enable cross-compilation [disable]
442 --cc=COMPILER C compiler to build MPlayer [gcc]
443 --as=ASSEMBLER assembler to build MPlayer [as]
444 --nm=NM nm tool to build MPlayer [nm]
445 --yasm=YASM Yasm assembler to build MPlayer [yasm]
446 --ar=AR librarian to build MPlayer [ar]
447 --pkg-config=PKGCONFIG pkg-config to find some libraries [pkg-config]
448 --ranlib=RANLIB ranlib to build MPlayer [ranlib]
449 --windres=WINDRES windres to build MPlayer [windres]
450 --target=PLATFORM target platform (i386-linux, arm-linux, etc)
451 --enable-static build a statically linked binary
452 --with-install=PATH path to a custom install program
454 Advanced options:
455 --enable-mmx enable MMX [autodetect]
456 --enable-mmxext enable MMX2 (Pentium III, Athlon) [autodetect]
457 --enable-3dnow enable 3DNow! [autodetect]
458 --enable-3dnowext enable extended 3DNow! [autodetect]
459 --enable-sse enable SSE [autodetect]
460 --enable-sse2 enable SSE2 [autodetect]
461 --enable-ssse3 enable SSSE3 [autodetect]
462 --enable-shm enable shm [autodetect]
463 --enable-altivec enable AltiVec (PowerPC) [autodetect]
464 --enable-armv5te enable DSP extensions (ARM) [autodetect]
465 --enable-armv6 enable ARMv6 (ARM) [autodetect]
466 --enable-armv6t2 enable ARMv6t2 (ARM) [autodetect]
467 --enable-armvfp enable ARM VFP (ARM) [autodetect]
468 --enable-neon enable NEON (ARM) [autodetect]
469 --enable-iwmmxt enable iWMMXt (ARM) [autodetect]
470 --disable-fastmemcpy disable 3DNow!/SSE/MMX optimized memcpy [enable]
471 --enable-big-endian force byte order to big-endian [autodetect]
472 --enable-debug[=1-3] compile-in debugging information [disable]
473 --enable-profile compile-in profiling information [disable]
474 --disable-sighandler disable sighandler for crashes [enable]
475 --enable-crash-debug enable automatic gdb attach on crash [disable]
477 Use these options if autodetection fails:
478 --extra-cflags=FLAGS extra CFLAGS
479 --extra-ldflags=FLAGS extra LDFLAGS
480 --extra-libs=FLAGS extra linker flags
481 --extra-libs-mplayer=FLAGS extra linker flags for MPlayer
483 --with-sdl-config=PATH path to sdl*-config
484 --with-dvdnav-config=PATH path to dvdnav-config
485 --with-dvdread-config=PATH path to dvdread-config
487 This configure script is NOT autoconf-based, even though its output is similar.
488 It will try to autodetect all configuration options. If you --enable an option
489 it will be forcefully turned on, skipping autodetection. This can break
490 compilation, so you need to know what you are doing.
492 exit 0
493 } #show_help()
495 # GOTCHA: the variables below defines the default behavior for autodetection
496 # and have - unless stated otherwise - at least 2 states : yes no
497 # If autodetection is available then the third state is: auto
498 _mmx=auto
499 _3dnow=auto
500 _3dnowext=auto
501 _mmxext=auto
502 _sse=auto
503 _sse2=auto
504 _ssse3=auto
505 _cmov=auto
506 _fast_cmov=auto
507 _fast_clz=auto
508 _armv5te=auto
509 _armv6=auto
510 _armv6t2=auto
511 _armvfp=auto
512 neon=auto
513 _iwmmxt=auto
514 _altivec=auto
515 _install=install
516 _pkg_config=auto
517 _ranlib=auto
518 _windres=auto
519 _cc=auto
520 _ar=auto
521 test "$CC" && _cc="$CC"
522 _as=auto
523 _nm=auto
524 _yasm=auto
525 _runtime_cpudetection=no
526 _cross_compile=no
527 _prefix="/usr/local"
528 ffmpeg=auto
529 ffmpeg_internals=no
530 _mplayer=yes
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 _asmalign_pot=auto
650 _stream_cache=yes
651 _priority=no
652 def_dos_paths="#define HAVE_DOS_PATHS 0"
653 def_stream_cache="#define CONFIG_STREAM_CACHE 1"
654 def_priority="#undef CONFIG_PRIORITY"
655 def_pthread_cache="#undef PTHREAD_CACHE"
656 need_shmem=yes
657 for ac_option do
658 case "$ac_option" in
659 --help|-help|-h)
660 show_help
662 --prefix=*)
663 _prefix=$(echo $ac_option | cut -d '=' -f 2)
665 --bindir=*)
666 _bindir=$(echo $ac_option | cut -d '=' -f 2)
668 --datadir=*)
669 _datadir=$(echo $ac_option | cut -d '=' -f 2)
671 --mandir=*)
672 _mandir=$(echo $ac_option | cut -d '=' -f 2)
674 --confdir=*)
675 _confdir=$(echo $ac_option | cut -d '=' -f 2)
677 --libdir=*)
678 _libdir=$(echo $ac_option | cut -d '=' -f 2)
680 --codecsdir=*)
681 _codecsdir=$(echo $ac_option | cut -d '=' -f 2)
683 --localedir=*)
684 _localedir=$(echo $ac_option | cut -d '=' -f 2)
687 --with-install=*)
688 _install=$(echo $ac_option | cut -d '=' -f 2 )
691 --with-sdl-config=*)
692 _sdlconfig=$(echo $ac_option | cut -d '=' -f 2)
694 --with-dvdnav-config=*)
695 _dvdnavconfig=$(echo $ac_option | cut -d '=' -f 2)
697 --with-dvdread-config=*)
698 _dvdreadconfig=$(echo $ac_option | cut -d '=' -f 2)
701 --extra-cflags=*)
702 extra_cflags="$extra_cflags $(echo $ac_option | cut -d '=' -f 2-)"
704 --extra-ldflags=*)
705 extra_ldflags="$extra_ldflags $(echo $ac_option | cut -d '=' -f 2-)"
707 --extra-libs=*)
708 extra_libs=$(echo $ac_option | cut -d '=' -f 2)
710 --extra-libs-mplayer=*)
711 libs_mplayer=$(echo $ac_option | cut -d '=' -f 2)
714 --target=*)
715 _target=$(echo $ac_option | cut -d '=' -f 2)
717 --cc=*)
718 _cc=$(echo $ac_option | cut -d '=' -f 2)
720 --as=*)
721 _as=$(echo $ac_option | cut -d '=' -f 2)
723 --nm=*)
724 _nm=$(echo $ac_option | cut -d '=' -f 2)
726 --yasm=*)
727 _yasm=$(echo $ac_option | cut -d '=' -f 2)
729 --ar=*)
730 _ar=$(echo $ac_option | cut -d '=' -f 2)
732 --pkg-config=*)
733 _pkg_config=$(echo $ac_option | cut -d '=' -f 2)
735 --ranlib=*)
736 _ranlib=$(echo $ac_option | cut -d '=' -f 2)
738 --windres=*)
739 _windres=$(echo $ac_option | cut -d '=' -f 2)
741 --charset=*)
742 _charset=$(echo $ac_option | cut -d '=' -f 2)
744 --language-doc=*)
745 language_doc=$(echo $ac_option | cut -d '=' -f 2)
747 --language-man=*)
748 language_man=$(echo $ac_option | cut -d '=' -f 2)
750 --language-msg=*)
751 language_msg=$(echo $ac_option | cut -d '=' -f 2)
753 --language=*)
754 language=$(echo $ac_option | cut -d '=' -f 2)
757 --enable-static)
758 _ld_static='-static'
760 --disable-static)
761 _ld_static=''
763 --enable-profile)
764 _profile='-p'
766 --disable-profile)
767 _profile=
769 --enable-debug)
770 _debug='-g'
772 --enable-debug=*)
773 _debug=$(echo $_echo_n '-g'$_echo_c; echo $ac_option | cut -d '=' -f 2)
775 --disable-debug)
776 _debug=
778 --enable-translation) _translation=yes ;;
779 --disable-translation) _translation=no ;;
780 --enable-runtime-cpudetection) _runtime_cpudetection=yes ;;
781 --disable-runtime-cpudetection) _runtime_cpudetection=no ;;
782 --enable-cross-compile) _cross_compile=yes ;;
783 --disable-cross-compile) _cross_compile=no ;;
784 --enable-mplayer) _mplayer=yes ;;
785 --disable-mplayer) _mplayer=no ;;
786 --enable-x11) _x11=yes ;;
787 --disable-x11) _x11=no ;;
788 --enable-xshape) _xshape=yes ;;
789 --disable-xshape) _xshape=no ;;
790 --enable-xss) _xss=yes ;;
791 --disable-xss) _xss=no ;;
792 --enable-xv) _xv=yes ;;
793 --disable-xv) _xv=no ;;
794 --enable-vdpau) _vdpau=yes ;;
795 --disable-vdpau) _vdpau=no ;;
796 --enable-sdl) _sdl=yes ;;
797 --disable-sdl) _sdl=no ;;
798 --enable-direct3d) _direct3d=yes ;;
799 --disable-direct3d) _direct3d=no ;;
800 --enable-directx) _directx=yes ;;
801 --disable-directx) _directx=no ;;
802 --enable-png) _png=yes ;;
803 --disable-png) _png=no ;;
804 --enable-mng) _mng=yes ;;
805 --disable-mng) _mng=no ;;
806 --enable-jpeg) _jpeg=yes ;;
807 --disable-jpeg) _jpeg=no ;;
808 --enable-pnm) _pnm=yes ;;
809 --disable-pnm) _pnm=no ;;
810 --enable-md5sum) _md5sum=yes ;;
811 --disable-md5sum) _md5sum=no ;;
812 --enable-yuv4mpeg) _yuv4mpeg=yes ;;
813 --disable-yuv4mpeg) _yuv4mpeg=no ;;
814 --enable-gif) _gif=yes ;;
815 --disable-gif) _gif=no ;;
816 --enable-gl) _gl=yes ;;
817 --disable-gl) _gl=no ;;
818 --enable-caca) _caca=yes ;;
819 --disable-caca) _caca=no ;;
820 --enable-dvb) _dvb=yes ;;
821 --disable-dvb) _dvb=no ;;
822 --enable-v4l2) _v4l2=yes ;;
823 --disable-v4l2) _v4l2=no ;;
824 --enable-iconv) _iconv=yes ;;
825 --disable-iconv) _iconv=no ;;
826 --enable-langinfo) _langinfo=yes ;;
827 --disable-langinfo) _langinfo=no ;;
828 --enable-rtc) _rtc=yes ;;
829 --disable-rtc) _rtc=no ;;
830 --enable-libdv) _libdv=yes ;;
831 --disable-libdv) _libdv=no ;;
832 --enable-ossaudio) _ossaudio=yes ;;
833 --disable-ossaudio) _ossaudio=no ;;
834 --enable-rsound) _rsound=yes ;;
835 --disable-rsound) _rsound=no ;;
836 --enable-pulse) _pulse=yes ;;
837 --disable-pulse) _pulse=no ;;
838 --enable-portaudio) _portaudio=yes ;;
839 --disable-portaudio) _portaudio=no ;;
840 --enable-jack) _jack=yes ;;
841 --disable-jack) _jack=no ;;
842 --enable-openal) _openal=yes ;;
843 --disable-openal) _openal=no ;;
844 --enable-mad) _mad=yes ;;
845 --disable-mad) _mad=no ;;
846 --enable-libcdio) _libcdio=yes ;;
847 --disable-libcdio) _libcdio=no ;;
848 --enable-libvorbis) _libvorbis=yes ;;
849 --disable-libvorbis) _libvorbis=no ;;
850 --enable-speex) _speex=yes ;;
851 --disable-speex) _speex=no ;;
852 --enable-tremor) _tremor=yes ;;
853 --disable-tremor) _tremor=no ;;
854 --enable-theora) _theora=yes ;;
855 --disable-theora) _theora=no ;;
856 --enable-mpg123) _mpg123=yes ;;
857 --disable-mpg123) _mpg123=no ;;
858 --enable-liba52) _liba52=yes ;;
859 --disable-liba52) _liba52=no ;;
860 --enable-libdca) _libdca=yes ;;
861 --disable-libdca) _libdca=no ;;
862 --enable-musepack) _musepack=yes ;;
863 --disable-musepack) _musepack=no ;;
864 --enable-faad) _faad=yes ;;
865 --disable-faad) _faad=no ;;
866 --enable-ladspa) _ladspa=yes ;;
867 --disable-ladspa) _ladspa=no ;;
868 --enable-libbs2b) _libbs2b=yes ;;
869 --disable-libbs2b) _libbs2b=no ;;
870 --enable-xmms) _xmms=yes ;;
871 --disable-xmms) _xmms=no ;;
872 --enable-vcd) _vcd=yes ;;
873 --disable-vcd) _vcd=no ;;
874 --enable-bluray) _bluray=yes ;;
875 --disable-bluray) _bluray=no ;;
876 --enable-dvdread) _dvdread=yes ;;
877 --disable-dvdread) _dvdread=no ;;
878 --enable-dvdread-internal) _dvdread_internal=yes ;;
879 --disable-dvdread-internal) _dvdread_internal=no ;;
880 --enable-libdvdcss-internal) _libdvdcss_internal=yes ;;
881 --disable-libdvdcss-internal) _libdvdcss_internal=no ;;
882 --enable-dvdnav) _dvdnav=yes ;;
883 --disable-dvdnav) _dvdnav=no ;;
884 --enable-xanim) _xanim=yes ;;
885 --disable-xanim) _xanim=no ;;
886 --enable-real) _real=yes ;;
887 --disable-real) _real=no ;;
888 --enable-lcms2) _lcms2=yes ;;
889 --disable-lcms2) _lcms2=no ;;
890 --enable-xinerama) _xinerama=yes ;;
891 --disable-xinerama) _xinerama=no ;;
892 --enable-vm) _vm=yes ;;
893 --disable-vm) _vm=no ;;
894 --enable-xf86keysym) _xf86keysym=yes ;;
895 --disable-xf86keysym) _xf86keysym=no ;;
896 --enable-alsa) _alsa=yes ;;
897 --disable-alsa) _alsa=no ;;
898 --enable-tv) _tv=yes ;;
899 --disable-tv) _tv=no ;;
900 --enable-tv-bsdbt848) _tv_bsdbt848=yes ;;
901 --disable-tv-bsdbt848) _tv_bsdbt848=no ;;
902 --enable-tv-v4l1) _tv_v4l1=yes ;;
903 --disable-tv-v4l1) _tv_v4l1=no ;;
904 --enable-tv-v4l2) _tv_v4l2=yes ;;
905 --disable-tv-v4l2) _tv_v4l2=no ;;
906 --enable-tv-dshow) _tv_dshow=yes ;;
907 --disable-tv-dshow) _tv_dshow=no ;;
908 --enable-radio) _radio=yes ;;
909 --enable-radio-capture) _radio_capture=yes ;;
910 --disable-radio-capture) _radio_capture=no ;;
911 --disable-radio) _radio=no ;;
912 --enable-radio-v4l) _radio_v4l=yes ;;
913 --disable-radio-v4l) _radio_v4l=no ;;
914 --enable-radio-v4l2) _radio_v4l2=yes ;;
915 --disable-radio-v4l2) _radio_v4l2=no ;;
916 --enable-radio-bsdbt848) _radio_bsdbt848=yes ;;
917 --disable-radio-bsdbt848) _radio_bsdbt848=no ;;
918 --enable-pvr) _pvr=yes ;;
919 --disable-pvr) _pvr=no ;;
920 --enable-fastmemcpy) _fastmemcpy=yes ;;
921 --disable-fastmemcpy) _fastmemcpy=no ;;
922 --enable-networking) networking=yes ;;
923 --disable-networking) networking=no ;;
924 --enable-winsock2_h) _winsock2_h=yes ;;
925 --disable-winsock2_h) _winsock2_h=no ;;
926 --enable-smb) _smb=yes ;;
927 --disable-smb) _smb=no ;;
928 --enable-libquvi) _libquvi=yes ;;
929 --disable-libquvi) _libquvi=no ;;
930 --enable-joystick) _joystick=yes ;;
931 --disable-joystick) _joystick=no ;;
932 --enable-xvid) _xvid=yes ;;
933 --disable-xvid) _xvid=no ;;
934 --enable-libnut) _libnut=yes ;;
935 --disable-libnut) _libnut=no ;;
936 --enable-libav) ffmpeg=yes ;;
937 --ffmpeg-source-dir=*)
938 _ffmpeg_source=$(echo $ac_option | cut -d '=' -f 2 ) ;;
940 --enable-lirc) _lirc=yes ;;
941 --disable-lirc) _lirc=no ;;
942 --enable-lircc) _lircc=yes ;;
943 --disable-lircc) _lircc=no ;;
944 --enable-apple-remote) _apple_remote=yes ;;
945 --disable-apple-remote) _apple_remote=no ;;
946 --enable-apple-ir) _apple_ir=yes ;;
947 --disable-apple-ir) _apple_ir=no ;;
948 --enable-termcap) _termcap=yes ;;
949 --disable-termcap) _termcap=no ;;
950 --enable-termios) _termios=yes ;;
951 --disable-termios) _termios=no ;;
952 --disable-tga) _tga=no ;;
953 --enable-tga) _tga=yes ;;
954 --enable-directfb) _directfb=yes ;;
955 --disable-directfb) _directfb=no ;;
956 --enable-shm) _shm=yes ;;
957 --disable-shm) _shm=no ;;
958 --enable-select) _select=yes ;;
959 --disable-select) _select=no ;;
960 --enable-cddb) _cddb=yes ;;
961 --disable-cddb) _cddb=no ;;
962 --enable-big-endian) _big_endian=yes ;;
963 --disable-big-endian) _big_endian=no ;;
964 --enable-unrarexec) _unrar_exec=yes ;;
965 --disable-unrarexec) _unrar_exec=no ;;
966 --enable-ftp) _ftp=yes ;;
967 --disable-ftp) _ftp=no ;;
968 --enable-vstream) _vstream=yes ;;
969 --disable-vstream) _vstream=no ;;
970 --enable-pthreads) _pthreads=yes ;;
971 --disable-pthreads) _pthreads=no ;;
972 --enable-w32threads) _w32threads=yes ;;
973 --disable-w32threads) _w32threads=no ;;
974 --enable-libass) _ass=yes ;;
975 --disable-libass) _ass=no ;;
976 --enable-rpath) _rpath=yes ;;
977 --disable-rpath) _rpath=no ;;
978 --enable-libpostproc) libpostproc=yes ;;
979 --disable-libpostproc) libpostproc=no ;;
981 --enable-enca) _enca=yes ;;
982 --disable-enca) _enca=no ;;
984 --enable-inet6) _inet6=yes ;;
985 --disable-inet6) _inet6=no ;;
987 --enable-gethostbyname2) _gethostbyname2=yes ;;
988 --disable-gethostbyname2) _gethostbyname2=no ;;
990 --enable-qtx) _qtx=yes ;;
991 --disable-qtx) _qtx=no ;;
993 --enable-coreaudio) _coreaudio=yes ;;
994 --disable-coreaudio) _coreaudio=no ;;
995 --enable-corevideo) _corevideo=yes ;;
996 --disable-corevideo) _corevideo=no ;;
997 --enable-cocoa) _cocoa=yes ;;
998 --disable-cocoa) _cocoa=no ;;
999 --enable-sharedbuffer) _sharedbuffer=yes ;;
1000 --disable-sharedbuffer) _sharedbuffer=no ;;
1001 --enable-macosx-finder) _macosx_finder=yes ;;
1002 --disable-macosx-finder) _macosx_finder=no ;;
1003 --enable-macosx-bundle) _macosx_bundle=yes ;;
1004 --disable-macosx-bundle) _macosx_bundle=no ;;
1006 --enable-sortsub) _sortsub=yes ;;
1007 --disable-sortsub) _sortsub=no ;;
1009 --enable-crash-debug) _crash_debug=yes ;;
1010 --disable-crash-debug) _crash_debug=no ;;
1011 --enable-sighandler) _sighandler=yes ;;
1012 --disable-sighandler) _sighandler=no ;;
1013 --enable-win32dll) _win32dll=yes ;;
1014 --disable-win32dll) _win32dll=no ;;
1016 --enable-sse) _sse=yes ;;
1017 --disable-sse) _sse=no ;;
1018 --enable-sse2) _sse2=yes ;;
1019 --disable-sse2) _sse2=no ;;
1020 --enable-ssse3) _ssse3=yes ;;
1021 --disable-ssse3) _ssse3=no ;;
1022 --enable-mmxext) _mmxext=yes ;;
1023 --disable-mmxext) _mmxext=no ;;
1024 --enable-3dnow) _3dnow=yes ;;
1025 --disable-3dnow) _3dnow=no _3dnowext=no ;;
1026 --enable-3dnowext) _3dnow=yes _3dnowext=yes ;;
1027 --disable-3dnowext) _3dnowext=no ;;
1028 --enable-cmov) _cmov=yes ;;
1029 --disable-cmov) _cmov=no ;;
1030 --enable-fast-cmov) _fast_cmov=yes ;;
1031 --disable-fast-cmov) _fast_cmov=no ;;
1032 --enable-fast-clz) _fast_clz=yes ;;
1033 --disable-fast-clz) _fast_clz=no ;;
1034 --enable-altivec) _altivec=yes ;;
1035 --disable-altivec) _altivec=no ;;
1036 --enable-armv5te) _armv5te=yes ;;
1037 --disable-armv5te) _armv5te=no ;;
1038 --enable-armv6) _armv6=yes ;;
1039 --disable-armv6) _armv6=no ;;
1040 --enable-armv6t2) _armv6t2=yes ;;
1041 --disable-armv6t2) _armv6t2=no ;;
1042 --enable-armvfp) _armvfp=yes ;;
1043 --disable-armvfp) _armvfp=no ;;
1044 --enable-neon) neon=yes ;;
1045 --disable-neon) neon=no ;;
1046 --enable-iwmmxt) _iwmmxt=yes ;;
1047 --disable-iwmmxt) _iwmmxt=no ;;
1048 --enable-mmx) _mmx=yes ;;
1049 --disable-mmx) # 3Dnow! and MMX2 require MMX
1050 _3dnow=no _3dnowext=no _mmx=no _mmxext=no ;;
1053 echo "Unknown parameter: $ac_option" >&2
1054 exit 1
1057 esac
1058 done
1060 # Atmos: moved this here, to be correct, if --prefix is specified
1061 test -z "$_bindir" && _bindir="$_prefix/bin"
1062 test -z "$_datadir" && _datadir="$_prefix/share/mplayer"
1063 test -z "$_mandir" && _mandir="$_prefix/share/man"
1064 test -z "$_confdir" && _confdir="$_prefix/etc/mplayer"
1065 test -z "$_libdir" && _libdir="$_prefix/lib"
1066 test -z "$_localedir" && _localedir="$_prefix/share/locale"
1068 for tmpdir in "$TMPDIR" "$TEMPDIR" "/tmp" ; do
1069 test "$tmpdir" && break
1070 done
1072 mplayer_tmpdir="$tmpdir/mplayer-configure-$RANDOM-$$"
1073 mkdir $mplayer_tmpdir || die "Unable to create tmpdir."
1075 TMPLOG="config.log"
1077 rm -f "$TMPLOG"
1078 echo Parameters configure was run with: > "$TMPLOG"
1079 if test -n "$CFLAGS" ; then
1080 echo ${_echo_n} CFLAGS="'$CFLAGS' ${_echo_c}" >> "$TMPLOG"
1082 if test -n "$PKG_CONFIG_PATH" ; then
1083 echo ${_echo_n} PKG_CONFIG_PATH="'$PKG_CONFIG_PATH' ${_echo_c}" >> "$TMPLOG"
1085 echo ./configure $configuration >> "$TMPLOG"
1086 echo >> "$TMPLOG"
1089 echocheck "cross compilation"
1090 echores $_cross_compile
1092 if test $_cross_compile = yes; then
1093 tmp_run() {
1094 return 0
1098 tool_prefix=""
1100 if test $_cross_compile = yes ; then
1101 # Usually cross-compiler prefixes match with the target triplet
1102 test -n "$_target" && tool_prefix="$_target"-
1105 test "$_ranlib" = auto && _ranlib="$tool_prefix"ranlib
1106 test "$_windres" = auto && _windres="$tool_prefix"windres
1107 test "$_ar" = auto && _ar="$tool_prefix"ar
1108 test "$_yasm" = auto && _yasm="$tool_prefix"yasm
1109 test "$_pkg_config" = auto && _pkg_config="$tool_prefix"pkg-config
1111 if test "$_cc" = auto ; then
1112 if test -n "$tool_prefix" ; then
1113 _cc="$tool_prefix"gcc
1114 else
1115 _cc=cc
1119 # Determine our OS name and CPU architecture
1120 if test -z "$_target" ; then
1121 # OS name
1122 system_name=$(uname -s 2>&1)
1123 case "$system_name" in
1124 Linux|FreeBSD|NetBSD|OpenBSD|DragonFly|BSD/OS|Darwin|QNX|GNU|BeOS|MorphOS|AIX|AmigaOS)
1126 Haiku)
1127 system_name=BeOS
1129 GNU/kFreeBSD)
1130 system_name=FreeBSD
1132 HP-UX*)
1133 system_name=HP-UX
1135 [cC][yY][gG][wW][iI][nN]*)
1136 system_name=CYGWIN
1138 MINGW32*)
1139 system_name=MINGW32
1141 OS/2*)
1142 system_name=OS/2
1145 system_name="$system_name-UNKNOWN"
1147 esac
1150 # host's CPU/instruction set
1151 host_arch=$(uname -p 2>&1)
1152 case "$host_arch" in
1153 i386|sparc|ppc|alpha|arm|mips|vax)
1155 powerpc) # Darwin returns 'powerpc'
1156 host_arch=ppc
1158 *) # uname -p on Linux returns 'unknown' for the processor type,
1159 # OpenBSD returns 'Intel Pentium/MMX ("Genuine Intel" 586-class)'
1161 # Maybe uname -m (machine hardware name) returns something we
1162 # recognize.
1164 # x86/x86pc is used by QNX
1165 case "$(uname -m 2>&1)" in
1166 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 ;;
1167 ia64) host_arch=ia64 ;;
1168 macppc|ppc) host_arch=ppc ;;
1169 ppc64) host_arch=ppc64 ;;
1170 alpha) host_arch=alpha ;;
1171 sparc) host_arch=sparc ;;
1172 sparc64) host_arch=sparc64 ;;
1173 parisc*|hppa*|9000*) host_arch=hppa ;;
1174 arm*|zaurus|cats) host_arch=arm ;;
1175 sh3|sh4|sh4a) host_arch=sh ;;
1176 s390) host_arch=s390 ;;
1177 s390x) host_arch=s390x ;;
1178 *mips*) host_arch=mips ;;
1179 vax) host_arch=vax ;;
1180 xtensa*) host_arch=xtensa ;;
1181 *) host_arch=UNKNOWN ;;
1182 esac
1184 esac
1185 else # if test -z "$_target"
1186 for i in 2 3; do
1187 system_name=$(echo $_target | cut -d '-' -f $i)
1188 case "$(echo $system_name | tr A-Z a-z)" in
1189 linux) system_name=Linux ;;
1190 freebsd) system_name=FreeBSD ;;
1191 gnu/kfreebsd) system_name=FreeBSD ;;
1192 netbsd) system_name=NetBSD ;;
1193 bsd/os) system_name=BSD/OS ;;
1194 openbsd) system_name=OpenBSD ;;
1195 dragonfly) system_name=DragonFly ;;
1196 qnx) system_name=QNX ;;
1197 morphos) system_name=MorphOS ;;
1198 amigaos) system_name=AmigaOS ;;
1199 mingw32*) system_name=MINGW32 ;;
1200 *) continue ;;
1201 esac
1202 break
1203 done
1204 # We need to convert underscores so that values like k6-2 and pentium-mmx can be passed
1205 host_arch=$(echo $_target | cut -d '-' -f 1)
1206 if test $(echo $host_arch) != "x86_64" ; then
1207 host_arch=$(echo $host_arch | tr '_' '-')
1211 extra_cflags="-I. $extra_cflags"
1212 _timer=timer-linux.c
1213 _getch=getch2.c
1214 if freebsd ; then
1215 extra_ldflags="$extra_ldflags -L/usr/local/lib"
1216 extra_cflags="$extra_cflags -I/usr/local/include"
1219 if netbsd || dragonfly ; then
1220 extra_ldflags="$extra_ldflags -L/usr/pkg/lib"
1221 extra_cflags="$extra_cflags -I/usr/pkg/include"
1224 if darwin; then
1225 extra_cflags="-mdynamic-no-pic $extra_cflags"
1226 _timer=timer-darwin.c
1229 if aix ; then
1230 extra_ldflags="$extra_ldflags -lC"
1233 if linux ; then
1234 _ranlib='true'
1237 if win32 ; then
1238 _exesuf=".exe"
1239 extra_cflags="$extra_cflags -fno-common"
1240 # -lwinmm is always needed for osdep/timer-win2.c
1241 extra_ldflags="$extra_ldflags -lwinmm"
1242 _pe_executable=yes
1243 _timer=timer-win2.c
1244 _priority=yes
1245 def_dos_paths="#define HAVE_DOS_PATHS 1"
1246 def_priority="#define CONFIG_PRIORITY 1"
1249 if mingw32 ; then
1250 _getch=getch2-win.c
1251 need_shmem=no
1252 extra_cflags="$extra_cflags -D__USE_MINGW_ANSI_STDIO=1"
1255 if amigaos ; then
1256 _select=no
1257 _sighandler=no
1258 _stream_cache=no
1259 def_stream_cache="#undef CONFIG_STREAM_CACHE"
1260 extra_cflags="-DNEWLIB -D__USE_INLINE__ $extra_cflags"
1263 if qnx ; then
1264 extra_ldflags="$extra_ldflags -lph"
1267 TMPC="$mplayer_tmpdir/tmp.c"
1268 TMPEXE="$mplayer_tmpdir/tmp$_exesuf"
1269 TMPH="$mplayer_tmpdir/tmp.h"
1270 TMPS="$mplayer_tmpdir/tmp.S"
1272 if test "$_runtime_cpudetection" = yes && ! x86 && ! ppc; then
1273 die "Runtime CPU detection only works for x86, x86-64 and PPC!"
1277 # Checking CC version...
1278 # Intel C++ Compilers (no autoselect, use CC=/some/binary ./configure)
1279 if test "$(basename $_cc)" = "icc" || test "$(basename $_cc)" = "ecc"; then
1280 echocheck "$_cc version"
1281 cc_vendor=intel
1282 cc_name=$($_cc -V 2>&1 | head -n 1 | cut -d ',' -f 1)
1283 cc_version=$($_cc -V 2>&1 | head -n 1 | cut -d ',' -f 2 | cut -d ' ' -f 3)
1284 _cc_major=$(echo $cc_version | cut -d '.' -f 1)
1285 _cc_minor=$(echo $cc_version | cut -d '.' -f 2)
1286 # TODO verify older icc/ecc compatibility
1287 case $cc_version in
1289 cc_version="v. ?.??, bad"
1290 cc_fail=yes
1292 10.1|11.0|11.1)
1293 cc_version="$cc_version, ok"
1296 cc_version="$cc_version, bad"
1297 cc_fail=yes
1299 esac
1300 echores "$cc_version"
1301 else
1302 for _cc in "$_cc" gcc cc ; do
1303 cc_name_tmp=$($_cc -v 2>&1 | tail -n 1 | cut -d ' ' -f 1)
1304 if test "$cc_name_tmp" = "gcc"; then
1305 cc_name=$cc_name_tmp
1306 echocheck "$_cc version"
1307 cc_vendor=gnu
1308 cc_version=$($_cc -dumpversion 2>&1)
1309 case $cc_version in
1310 2.96*)
1311 cc_fail=yes
1314 _cc_major=$(echo $cc_version | cut -d '.' -f 1)
1315 _cc_minor=$(echo $cc_version | cut -d '.' -f 2)
1316 _cc_mini=$(echo $cc_version | cut -d '.' -f 3)
1318 esac
1319 echores "$cc_version"
1320 break
1322 if $_cc -v 2>&1 | grep -q "clang"; then
1323 echocheck "$_cc version"
1324 cc_vendor=clang
1325 cc_version=$($_cc -dumpversion 2>&1)
1326 res_comment="experimental support only"
1327 echores "clang $cc_version"
1328 break
1330 cc_name_tmp=$($_cc -V 2>&1 | head -n 1 | cut -d ' ' -f 2,3)
1331 done
1332 fi # icc
1333 test "$cc_fail" = yes && die "unsupported compiler version"
1335 echocheck "working compiler"
1336 cflag_check "" || die "Compiler is not functioning correctly. Check your installation and custom CFLAGS $CFLAGS ."
1337 echo "yes"
1339 if test -z "$_target" && x86 ; then
1340 cat > $TMPC << EOF
1341 int main(void) {
1342 int test[(int)sizeof(char *)-7];
1343 return 0;
1346 cc_check && host_arch=x86_64 || host_arch=i386
1349 echo "Detected operating system: $system_name"
1350 echo "Detected host architecture: $host_arch"
1352 # ---
1354 # now that we know what compiler should be used for compilation, try to find
1355 # out which assembler is used by the $_cc compiler
1356 if test "$_as" = auto ; then
1357 _as=$($_cc -print-prog-name=as)
1358 test -z "$_as" && _as=as
1361 if test "$_nm" = auto ; then
1362 _nm=$($_cc -print-prog-name=nm)
1363 test -z "$_nm" && _nm=nm
1366 # XXX: this should be ok..
1367 _cpuinfo="echo"
1369 if test "$_runtime_cpudetection" = no ; then
1371 # Cygwin has /proc/cpuinfo, but only supports Intel CPUs
1372 # FIXME: Remove the cygwin check once AMD CPUs are supported
1373 if test -r /proc/cpuinfo && ! cygwin; then
1374 # Linux with /proc mounted, extract CPU information from it
1375 _cpuinfo="cat /proc/cpuinfo"
1376 elif test -r /compat/linux/proc/cpuinfo && ! x86 ; then
1377 # FreeBSD with Linux emulation /proc mounted,
1378 # extract CPU information from it
1379 # Don't use it on x86 though, it never reports 3Dnow
1380 _cpuinfo="cat /compat/linux/proc/cpuinfo"
1381 elif darwin && ! x86 ; then
1382 # use hostinfo on Darwin
1383 _cpuinfo="hostinfo"
1384 elif aix; then
1385 # use 'lsattr' on AIX
1386 _cpuinfo="lsattr -E -l proc0 -a type"
1387 elif x86; then
1388 # all other OSes try to extract CPU information from a small helper
1389 # program cpuinfo instead
1390 $_cc -o cpuinfo$_exesuf cpuinfo.c
1391 _cpuinfo="./cpuinfo$_exesuf"
1394 if x86 ; then
1395 # gather more CPU information
1396 pname=$($_cpuinfo | grep 'model name' | cut -d ':' -f 2 | head -n 1)
1397 pvendor=$($_cpuinfo | grep 'vendor_id' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1)
1398 pfamily=$($_cpuinfo | grep 'cpu family' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1)
1399 pmodel=$($_cpuinfo | grep -v 'model name' | grep 'model' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1)
1400 pstepping=$($_cpuinfo | grep 'stepping' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1)
1402 exts=$($_cpuinfo | egrep 'features|flags' | cut -d ':' -f 2 | head -n 1)
1404 pparam=$(echo $exts | sed -e s/xmm/sse/ -e s/kni/sse/)
1405 # SSE implies MMX2, but not all SSE processors report the mmxext CPU flag.
1406 pparam=$(echo $pparam | sed -e 's/sse/sse mmxext/')
1408 for ext in $pparam ; do
1409 eval test \"\$_$ext\" = auto 2>/dev/null && eval _$ext=kernel_check
1410 done
1412 echocheck "CPU vendor"
1413 echores "$pvendor ($pfamily:$pmodel:$pstepping)"
1415 echocheck "CPU type"
1416 echores "$pname"
1419 fi # test "$_runtime_cpudetection" = no
1421 if x86 && test "$_runtime_cpudetection" = no ; then
1422 extcheck() {
1423 if test "$1" = kernel_check ; then
1424 echocheck "kernel support of $2"
1425 cat > $TMPC <<EOF
1426 #include <stdlib.h>
1427 #include <signal.h>
1428 static void catch(int sig) { exit(1); }
1429 int main(void) {
1430 signal(SIGILL, catch);
1431 __asm__ volatile ("$3":::"memory"); return 0;
1435 if cc_check && tmp_run ; then
1436 eval _$2=yes
1437 echores "yes"
1438 _optimizing="$_optimizing $2"
1439 return 0
1440 else
1441 eval _$2=no
1442 echores "failed"
1443 echo "It seems that your kernel does not correctly support $2."
1444 echo "To use $2 extensions in MPlayer, you have to upgrade/recompile your kernel!"
1445 return 1
1448 return 0
1451 extcheck $_mmx "mmx" "emms"
1452 extcheck $_mmxext "mmxext" "sfence"
1453 extcheck $_3dnow "3dnow" "femms"
1454 extcheck $_3dnowext "3dnowext" "pswapd %%mm0, %%mm0"
1455 extcheck $_sse "sse" "xorps %%xmm0, %%xmm0" || _gcc3_ext="$_gcc3_ext -mno-sse"
1456 extcheck $_sse2 "sse2" "xorpd %%xmm0, %%xmm0" || _gcc3_ext="$_gcc3_ext -mno-sse2"
1457 extcheck $_ssse3 "ssse3" "pabsd %%xmm0, %%xmm0"
1458 extcheck $_cmov "cmov" "cmovb %%eax, %%ebx"
1460 if test "$_gcc3_ext" != ""; then
1461 # if we had to disable sse/sse2 because the active kernel does not
1462 # support this instruction set extension, we also have to tell
1463 # gcc3 to not generate sse/sse2 instructions for normal C code
1464 cflag_check $_march $_gcc3_ext && _march="$_march $_gcc3_ext"
1470 def_fast_64bit='#define HAVE_FAST_64BIT 0'
1471 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 0'
1472 arch_all='X86 IA64 SPARC ARM AVR32 SH4 PPC ALPHA MIPS PA_RISC S390 S390X VAX BFIN XTENSA TOMI GENERIC'
1473 subarch_all='X86_32 X86_64 PPC64'
1474 case "$host_arch" in
1475 i[3-9]86|x86|x86pc|k5|k6|k6-2|k6-3|pentium*|athlon*|i586-i686)
1476 arch='x86'
1477 subarch='x86_32'
1478 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
1479 iproc=486
1480 proc=i486
1483 if test "$_runtime_cpudetection" = no ; then
1484 case "$pvendor" in
1485 AuthenticAMD)
1486 case "$pfamily" in
1487 3) proc=i386 iproc=386 ;;
1488 4) proc=i486 iproc=486 ;;
1489 5) iproc=586 # LGB: models are: K5/SSA5 K5 K5 K5 ? ? K6 K6 K6-2 K6-3
1490 # K6 model 13 are the K6-2+ and K6-III+, only differing in cache size.
1491 if test "$pmodel" -eq 9 -o "$pmodel" -eq 13; then
1492 proc=k6-3
1493 elif test "$pmodel" -eq 5 -o "$pmodel" -eq 10; then
1494 proc=geode
1495 elif test "$pmodel" -ge 8; then
1496 proc=k6-2
1497 elif test "$pmodel" -ge 6; then
1498 proc=k6
1499 else
1500 proc=i586
1503 6) iproc=686
1504 # It's a bit difficult to determine the correct type of Family 6
1505 # AMD CPUs just from their signature. Instead, we check directly
1506 # whether it supports SSE.
1507 if test "$_sse" = yes; then
1508 # gcc treats athlon-xp, athlon-4 and athlon-mp similarly.
1509 proc=athlon-xp
1510 else
1511 # Again, gcc treats athlon and athlon-tbird similarly.
1512 proc=athlon
1515 15) iproc=686
1516 # k8 cpu-type only supported in gcc >= 3.4.0, but that will be
1517 # caught and remedied in the optimization tests below.
1518 proc=k8
1521 *) proc=amdfam10 iproc=686
1522 test $_fast_clz = "auto" && _fast_clz=yes
1524 esac
1526 GenuineIntel)
1527 case "$pfamily" in
1528 3) proc=i386 iproc=386 ;;
1529 4) proc=i486 iproc=486 ;;
1530 5) iproc=586
1531 if test "$pmodel" -eq 4 || test "$pmodel" -eq 8; then
1532 proc=pentium-mmx # 4 is desktop, 8 is mobile
1533 else
1534 proc=i586
1537 6) iproc=686
1538 if test "$pmodel" -ge 15; then
1539 proc=core2
1540 elif test "$pmodel" -eq 9 -o "$pmodel" -ge 13; then
1541 proc=pentium-m
1542 elif test "$pmodel" -ge 7; then
1543 proc=pentium3
1544 elif test "$pmodel" -ge 3; then
1545 proc=pentium2
1546 else
1547 proc=i686
1549 test $_fast_clz = "auto" && _fast_clz=yes
1551 15) iproc=686
1552 # A nocona in 32-bit mode has no more capabilities than a prescott.
1553 if test "$pmodel" -ge 3; then
1554 proc=prescott
1555 else
1556 proc=pentium4
1557 test $_fast_clz = "auto" && _fast_clz=yes
1559 test $_fast_cmov = "auto" && _fast_cmov=no
1561 *) proc=prescott iproc=686 ;;
1562 esac
1564 CentaurHauls)
1565 case "$pfamily" in
1566 5) iproc=586
1567 if test "$pmodel" -ge 8; then
1568 proc=winchip2
1569 elif test "$pmodel" -ge 4; then
1570 proc=winchip-c6
1571 else
1572 proc=i586
1575 6) iproc=686
1576 if test "$pmodel" -ge 9; then
1577 proc=c3-2
1578 else
1579 proc=c3
1580 iproc=586
1583 *) proc=i686 iproc=i686 ;;
1584 esac
1586 unknown)
1587 case "$pfamily" in
1588 3) proc=i386 iproc=386 ;;
1589 4) proc=i486 iproc=486 ;;
1590 *) proc=i586 iproc=586 ;;
1591 esac
1594 proc=i586 iproc=586 ;;
1595 esac
1596 test $_fast_clz = "auto" && _fast_clz=no
1597 fi # test "$_runtime_cpudetection" = no
1600 # check that gcc supports our CPU, if not, fall back to earlier ones
1601 # LGB: check -mcpu and -march swithing step by step with enabling
1602 # to fall back till 386.
1604 # gcc >= 3.4.0 doesn't support -mcpu, we have to use -mtune instead
1606 if [ "$cc_vendor" = "gnu" ] && ([ "$_cc_major" -gt 3 ] || ( [ "$_cc_major" = 3 ] && [ "$_cc_minor" -ge 4 ])) ; then
1607 cpuopt=-mtune
1608 else
1609 cpuopt=-mcpu
1612 echocheck "GCC & CPU optimization abilities"
1613 if test "$_runtime_cpudetection" = no ; then
1614 if test $cc_vendor != "intel" && test $cc_vendor != "clang" ; then
1615 cflag_check -march=native && proc=native
1617 if test "$proc" = "amdfam10"; then
1618 cflag_check -march=$proc $cpuopt=$proc || proc=k8
1620 if test "$proc" = "k8"; then
1621 cflag_check -march=$proc $cpuopt=$proc || proc=athlon-xp
1623 if test "$proc" = "athlon-xp"; then
1624 cflag_check -march=$proc $cpuopt=$proc || proc=athlon
1626 if test "$proc" = "k6-3" || test "$proc" = "k6-2"; then
1627 cflag_check -march=$proc $cpuopt=$proc || proc=k6
1629 if test "$proc" = "k6" || test "$proc" = "c3"; then
1630 if ! cflag_check -march=$proc $cpuopt=$proc; then
1631 if cflag_check -march=i586 $cpuopt=i686; then
1632 proc=i586-i686
1633 else
1634 proc=i586
1638 if test "$proc" = "prescott" ; then
1639 cflag_check -march=$proc $cpuopt=$proc || proc=pentium4
1641 if test "$proc" = "core2" ; then
1642 cflag_check -march=$proc $cpuopt=$proc || proc=pentium-m
1644 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
1645 cflag_check -march=$proc $cpuopt=$proc || proc=i686
1647 if test "$proc" = "i686" || test "$proc" = "pentium-mmx" || test "$proc" = "winchip-c6" || test "$proc" = "winchip2"; then
1648 cflag_check -march=$proc $cpuopt=$proc || proc=i586
1650 if test "$proc" = "i586"; then
1651 cflag_check -march=$proc $cpuopt=$proc || proc=i486
1653 if test "$proc" = "i486" ; then
1654 cflag_check -march=$proc $cpuopt=$proc || proc=i386
1656 if test "$proc" = "i386" ; then
1657 cflag_check -march=$proc $cpuopt=$proc || proc=error
1659 if test "$proc" = "error" ; then
1660 echores "CPU optimization disabled. CPU not recognized or your compiler is too old."
1661 _mcpu=""
1662 _march=""
1663 _optimizing=""
1664 elif test "$proc" = "i586-i686"; then
1665 _march="-march=i586"
1666 _mcpu="$cpuopt=i686"
1667 _optimizing="$proc"
1668 else
1669 _march="-march=$proc"
1670 _mcpu="$cpuopt=$proc"
1671 _optimizing="$proc"
1673 else # if test "$_runtime_cpudetection" = no
1674 _mcpu="$cpuopt=generic"
1675 # at least i486 required, for bswap instruction
1676 _march="-march=i486"
1677 cflag_check $_mcpu || _mcpu="$cpuopt=i686"
1678 cflag_check $_mcpu || _mcpu=""
1679 cflag_check $_march $_mcpu || _march=""
1682 ## Gabucino : --target takes effect here (hopefully...) by overwriting
1683 ## autodetected mcpu/march parameters
1684 if test "$_target" ; then
1685 # TODO: it may be a good idea to check GCC and fall back in all cases
1686 if test "$host_arch" = "i586-i686"; then
1687 _march="-march=i586"
1688 _mcpu="$cpuopt=i686"
1689 else
1690 _march="-march=$host_arch"
1691 _mcpu="$cpuopt=$host_arch"
1694 proc="$host_arch"
1696 case "$proc" in
1697 i386) iproc=386 ;;
1698 i486) iproc=486 ;;
1699 i586|k5|k6|k6-2|k6-3|pentium|pentium-mmx) iproc=586 ;;
1700 i686|athlon*|pentium*) iproc=686 ;;
1701 *) iproc=586 ;;
1702 esac
1705 if test $_cmov = "yes" && test $_fast_cmov = "auto" ; then
1706 _fast_cmov="yes"
1707 else
1708 _fast_cmov="no"
1710 test $_fast_clz = "auto" && _fast_clz=yes
1712 echores "$proc"
1715 ia64)
1716 arch='ia64'
1717 def_fast_64bit='#define HAVE_FAST_64BIT 1'
1718 iproc='ia64'
1721 x86_64|amd64)
1722 arch='x86'
1723 subarch='x86_64'
1724 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
1725 def_fast_64bit='#define HAVE_FAST_64BIT 1'
1726 iproc='x86_64'
1728 # gcc >= 3.4.0 doesn't support -mcpu, we have to use -mtune instead
1729 if test "$cc_vendor" = "gnu" && test "$_cc_major" -gt 3 -o "$_cc_major" -eq 3 -a "$_cc_minor" -ge 4 ; then
1730 cpuopt=-mtune
1731 else
1732 cpuopt=-mcpu
1734 if test "$_runtime_cpudetection" = no ; then
1735 case "$pvendor" in
1736 AuthenticAMD)
1737 case "$pfamily" in
1738 15) proc=k8
1739 test $_fast_clz = "auto" && _fast_clz=no
1741 *) proc=amdfam10;;
1742 esac
1744 GenuineIntel)
1745 case "$pfamily" in
1746 6) proc=core2;;
1748 # 64-bit prescotts exist, but as far as GCC is concerned they
1749 # have the same capabilities as a nocona.
1750 proc=nocona
1751 test $_fast_cmov = "auto" && _fast_cmov=no
1752 test $_fast_clz = "auto" && _fast_clz=no
1754 esac
1757 proc=error;;
1758 esac
1759 fi # test "$_runtime_cpudetection" = no
1761 echocheck "GCC & CPU optimization abilities"
1762 # This is a stripped-down version of the i386 fallback.
1763 if test "$_runtime_cpudetection" = no ; then
1764 if test $cc_vendor != "intel" && test $cc_vendor != "clang" ; then
1765 cflag_check -march=native && proc=native
1767 # --- AMD processors ---
1768 if test "$proc" = "amdfam10"; then
1769 cflag_check -march=$proc $cpuopt=$proc || proc=k8
1771 if test "$proc" = "k8"; then
1772 cflag_check -march=$proc $cpuopt=$proc || proc=athlon-xp
1774 # This will fail if gcc version < 3.3, which is ok because earlier
1775 # versions don't really support 64-bit on amd64.
1776 # Is this a valid assumption? -Corey
1777 if test "$proc" = "athlon-xp"; then
1778 cflag_check -march=$proc $cpuopt=$proc || proc=error
1780 # --- Intel processors ---
1781 if test "$proc" = "core2"; then
1782 cflag_check -march=$proc $cpuopt=$proc || proc=x86-64
1784 if test "$proc" = "x86-64"; then
1785 cflag_check -march=$proc $cpuopt=$proc || proc=nocona
1787 if test "$proc" = "nocona"; then
1788 cflag_check -march=$proc $cpuopt=$proc || proc=pentium4
1790 if test "$proc" = "pentium4"; then
1791 cflag_check -march=$proc $cpuopt=$proc || proc=error
1794 _march="-march=$proc"
1795 _mcpu="$cpuopt=$proc"
1796 if test "$proc" = "error" ; then
1797 echores "CPU optimization disabled. CPU not recognized or your compiler is too old."
1798 _mcpu=""
1799 _march=""
1801 else # if test "$_runtime_cpudetection" = no
1802 # x86-64 is an undocumented option, an intersection of k8 and nocona.
1803 _march="-march=x86-64"
1804 _mcpu="$cpuopt=generic"
1805 cflag_check $_mcpu || _mcpu="x86-64"
1806 cflag_check $_mcpu || _mcpu=""
1807 cflag_check $_march $_mcpu || _march=""
1810 _optimizing="$proc"
1811 test $_fast_cmov = "auto" && _fast_cmov=yes
1812 test $_fast_clz = "auto" && _fast_clz=yes
1814 echores "$proc"
1817 sparc|sparc64)
1818 arch='sparc'
1819 iproc='sparc'
1820 if test "$host_arch" = "sparc64" ; then
1821 _vis='yes'
1822 proc='ultrasparc'
1823 def_fast_64bit='#define HAVE_FAST_64BIT 1'
1824 else
1825 proc=v8
1827 _mcpu="-mcpu=$proc"
1828 _optimizing="$proc"
1831 arm*)
1832 arch='arm'
1833 iproc='arm'
1836 avr32)
1837 arch='avr32'
1838 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
1839 iproc='avr32'
1840 test $_fast_clz = "auto" && _fast_clz=yes
1843 sh|sh4)
1844 arch='sh4'
1845 iproc='sh4'
1848 ppc|ppc64|powerpc|powerpc64)
1849 arch='ppc'
1850 def_dcbzl='#define HAVE_DCBZL 0'
1851 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
1852 iproc='ppc'
1854 if test "$host_arch" = "ppc64" -o "$host_arch" = "powerpc64" ; then
1855 subarch='ppc64'
1856 def_fast_64bit='#define HAVE_FAST_64BIT 1'
1858 echocheck "CPU type"
1859 case $system_name in
1860 Linux)
1861 proc=$($_cpuinfo | grep 'cpu' | cut -d ':' -f 2 | cut -d ',' -f 1 | cut -b 2- | head -n 1)
1862 if test -n "$($_cpuinfo | grep altivec)"; then
1863 test $_altivec = auto && _altivec=yes
1866 Darwin)
1867 proc=$($_cpuinfo | grep "Processor type" | cut -f 3 -d ' ' | sed 's/ppc//')
1868 if [ $(sysctl -n hw.vectorunit) -eq 1 -o \
1869 "$(sysctl -n hw.optional.altivec 2> /dev/null)" = "1" ]; then
1870 test $_altivec = auto && _altivec=yes
1873 NetBSD)
1874 # only gcc 3.4 works reliably with AltiVec code under NetBSD
1875 case $cc_version in
1876 2*|3.0*|3.1*|3.2*|3.3*)
1879 if [ $(sysctl -n machdep.altivec) -eq 1 ]; then
1880 test $_altivec = auto && _altivec=yes
1883 esac
1885 AIX)
1886 proc=$($_cpuinfo | grep 'type' | cut -f 2 -d ' ' | sed 's/PowerPC_//')
1888 esac
1889 if test "$_altivec" = yes; then
1890 echores "$proc altivec"
1891 else
1892 _altivec=no
1893 echores "$proc"
1896 echocheck "GCC & CPU optimization abilities"
1898 if test -n "$proc"; then
1899 case "$proc" in
1900 601) _march='-mcpu=601' _mcpu='-mtune=601' ;;
1901 603) _march='-mcpu=603' _mcpu='-mtune=603' ;;
1902 603e|603ev) _march='-mcpu=603e' _mcpu='-mtune=603e' ;;
1903 604|604e|604r|604ev) _march='-mcpu=604' _mcpu='-mtune=604' ;;
1904 740|740/750|745/755) _march='-mcpu=740' _mcpu='-mtune=740' ;;
1905 750|750CX) _march='-mcpu=750' _mcpu='-mtune=750' ;;
1906 POWER) _march='-mcpu=power' _mcpu='-mtune=power' ;;
1907 POWER2) _march='-mcpu=power2' _mcpu='-mtune=power2' ;;
1908 POWER3) _march='-mcpu=power3' _mcpu='-mtune=power3' ;;
1909 *) ;;
1910 esac
1911 # gcc 3.1(.1) and up supports 7400 and 7450
1912 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "1" || test "$_cc_major" -ge "4"; then
1913 case "$proc" in
1914 7400*|7410*) _march='-mcpu=7400' _mcpu='-mtune=7400' ;;
1915 7447*|7450*|7455*) _march='-mcpu=7450' _mcpu='-mtune=7450' ;;
1916 *) ;;
1917 esac
1919 # gcc 3.2 and up supports 970
1920 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "3" || test "$_cc_major" -ge "4"; then
1921 case "$proc" in
1922 970*|PPC970*) _march='-mcpu=970' _mcpu='-mtune=970'
1923 def_dcbzl='#define HAVE_DCBZL 1' ;;
1924 *) ;;
1925 esac
1927 # gcc 3.3 and up supports POWER4
1928 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "3" || test "$_cc_major" -ge "4"; then
1929 case "$proc" in
1930 POWER4) _march='-mcpu=power4' _mcpu='-mtune=power4' ;;
1931 *) ;;
1932 esac
1934 # gcc 3.4 and up supports 440*
1935 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "4" || test "$_cc_major" -ge "4"; then
1936 case "$proc" in
1937 440EP*) _march='-mcpu=440fp' _mcpu='-mtune=440fp' ;;
1938 440G* ) _march='-mcpu=440' _mcpu='-mtune=440' ;;
1939 *) ;;
1940 esac
1942 # gcc 4.0 and up supports POWER5
1943 if test "$_cc_major" -ge "4"; then
1944 case "$proc" in
1945 POWER5*) _march='-mcpu=power5' _mcpu='-mtune=power5' ;;
1946 *) ;;
1947 esac
1951 if test -n "$_mcpu"; then
1952 _optimizing=$(echo $_mcpu | cut -c 8-)
1953 echores "$_optimizing"
1954 else
1955 echores "none"
1958 test $_fast_clz = "auto" && _fast_clz=yes
1962 alpha*)
1963 arch='alpha'
1964 iproc='alpha'
1965 def_fast_64bit='#define HAVE_FAST_64BIT 1'
1967 echocheck "CPU type"
1968 cat > $TMPC << EOF
1969 int main(void) {
1970 unsigned long ver, mask;
1971 __asm__ ("implver %0" : "=r" (ver));
1972 __asm__ ("amask %1, %0" : "=r" (mask) : "r" (-1));
1973 printf("%ld-%x\n", ver, ~mask);
1974 return 0;
1977 $_cc -o "$TMPEXE" "$TMPC"
1978 case $("$TMPEXE") in
1980 0-0) proc="ev4"; _mvi="0";;
1981 1-0) proc="ev5"; _mvi="0";;
1982 1-1) proc="ev56"; _mvi="0";;
1983 1-101) proc="pca56"; _mvi="1";;
1984 2-303) proc="ev6"; _mvi="1";;
1985 2-307) proc="ev67"; _mvi="1";;
1986 2-1307) proc="ev68"; _mvi="1";;
1987 esac
1988 echores "$proc"
1990 echocheck "GCC & CPU optimization abilities"
1991 if test "$proc" = "ev68" ; then
1992 cc_check -mcpu=$proc || proc=ev67
1994 if test "$proc" = "ev67" ; then
1995 cc_check -mcpu=$proc || proc=ev6
1997 _mcpu="-mcpu=$proc"
1998 echores "$proc"
2000 test $_fast_clz = "auto" && _fast_clz=yes
2002 _optimizing="$proc"
2005 mips*)
2006 arch='mips'
2007 iproc='mips'
2009 test $_fast_clz = "auto" && _fast_clz=yes
2013 hppa)
2014 arch='pa_risc'
2015 iproc='PA-RISC'
2018 s390)
2019 arch='s390'
2020 iproc='390'
2023 s390x)
2024 arch='s390x'
2025 iproc='390x'
2028 vax)
2029 arch='vax'
2030 iproc='vax'
2033 xtensa)
2034 arch='xtensa'
2035 iproc='xtensa'
2038 generic)
2039 arch='generic'
2043 echo "The architecture of your CPU ($host_arch) is not supported by this configure script"
2044 echo "It seems nobody has ported MPlayer to your OS or CPU type yet."
2045 die "unsupported architecture $host_arch"
2047 esac # case "$host_arch" in
2049 if test "$_runtime_cpudetection" = yes ; then
2050 if x86 ; then
2051 test "$_cmov" != no && _cmov=yes
2052 x86_32 && _cmov=no
2053 test "$_mmx" != no && _mmx=yes
2054 test "$_3dnow" != no && _3dnow=yes
2055 test "$_3dnowext" != no && _3dnowext=yes
2056 test "$_mmxext" != no && _mmxext=yes
2057 test "$_sse" != no && _sse=yes
2058 test "$_sse2" != no && _sse2=yes
2059 test "$_ssse3" != no && _ssse3=yes
2061 if ppc; then
2062 _altivec=yes
2067 # endian testing
2068 echocheck "byte order"
2069 if test "$_big_endian" = auto ; then
2070 cat > $TMPC <<EOF
2071 short ascii_name[] = {
2072 'M' << 8 | 'P', 'l' << 8 | 'a', 'y' << 8 | 'e', 'r' << 8 | 'B',
2073 'i' << 8 | 'g', 'E' << 8 | 'n', 'd' << 8 | 'i', 'a' << 8 | 'n', 0 };
2074 int main(void) { return (long)ascii_name; }
2076 if cc_check ; then
2077 if strings $TMPEXE | grep -q -l MPlayerBigEndian ; then
2078 _big_endian=yes
2079 else
2080 _big_endian=no
2082 else
2083 echo ${_echo_n} "failed to autodetect byte order, defaulting to ${_echo_c}"
2086 if test "$_big_endian" = yes ; then
2087 _byte_order='big-endian'
2088 def_words_endian='#define WORDS_BIGENDIAN 1'
2089 def_bigendian='#define HAVE_BIGENDIAN 1'
2090 else
2091 _byte_order='little-endian'
2092 def_words_endian='#undef WORDS_BIGENDIAN'
2093 def_bigendian='#define HAVE_BIGENDIAN 0'
2095 echores "$_byte_order"
2098 echocheck "extern symbol prefix"
2099 cat > $TMPC << EOF
2100 int ff_extern;
2102 cc_check -c || die "Symbol mangling check failed."
2103 sym=$($_nm -P -g $TMPEXE)
2104 extern_prefix=${sym%%ff_extern*}
2105 def_extern_asm="#define EXTERN_ASM $extern_prefix"
2106 def_extern_prefix="#define EXTERN_PREFIX \"$extern_prefix\""
2107 echores $extern_prefix
2110 echocheck "assembler support of -pipe option"
2111 # -I. helps to detect compilers that just misunderstand -pipe like Sun C
2112 cflag_check -pipe -I. && _pipe="-pipe" && echores "yes" || echores "no"
2115 if darwin && test "$cc_vendor" = "gnu" ; then
2116 echocheck "GCC support of -mstackrealign"
2117 # GCC 4.2 and some earlier Apple versions support this flag on x86. Since
2118 # Mac OS X/Intel has an ABI different from Windows this is needed to avoid
2119 # crashes when loading Win32 DLLs. Unfortunately some gcc versions create
2120 # wrong code with this flag, but this can be worked around by adding
2121 # -fno-unit-at-a-time as described in the blog post at
2122 # http://www.dribin.org/dave/blog/archives/2006/12/05/missing_third_param/
2123 cat > $TMPC << EOF
2124 __attribute__((noinline)) static int foo3(int i1, int i2, int i3) { return i3; }
2125 int main(void) { return foo3(1, 2, 3) == 3 ? 0 : 1; }
2127 cc_check -O2 -mstackrealign && tmp_run && cflags_stackrealign=-mstackrealign
2128 test -z "$cflags_stackrealign" && cc_check -O2 -mstackrealign -fno-unit-at-a-time &&
2129 tmp_run && cflags_stackrealign="-mstackrealign -fno-unit-at-a-time"
2130 test -n "$cflags_stackrealign" && echores "yes" || echores "no"
2131 fi # if darwin && test "$cc_vendor" = "gnu" ; then
2134 # Checking for CFLAGS
2135 _install_strip="-s"
2136 if test "$_profile" != "" || test "$_debug" != "" ; then
2137 _install_strip=
2139 if test -z "$CFLAGS" ; then
2140 if test "$cc_vendor" = "intel" ; then
2141 CFLAGS="-O2 $_debug $_profile $_march $_mcpu $_pipe -fomit-frame-pointer"
2142 WARNFLAGS="-wd167 -wd556 -wd144"
2143 elif test "$cc_vendor" = "clang"; then
2144 CFLAGS="-O2 $_debug $_profile $_march $_pipe"
2145 WARNFLAGS="-Wall -Wno-switch-enum -Wno-logical-op-parentheses -Wpointer-arith -Wundef -Wno-pointer-sign -Wmissing-prototypes"
2146 ERRORFLAGS="-Werror=implicit-function-declaration"
2147 elif test "$cc_vendor" != "gnu" ; then
2148 CFLAGS="-O2 $_debug $_profile $_march $_mcpu $_pipe"
2149 else
2150 CFLAGS="-O2 $_debug $_profile $_march $_mcpu $_pipe -ffast-math -fomit-frame-pointer"
2151 WARNFLAGS="-Wall -Wno-switch -Wno-parentheses -Wpointer-arith -Wredundant-decls"
2152 ERRORFLAGS="-Werror-implicit-function-declaration"
2153 extra_ldflags="$extra_ldflags -ffast-math"
2155 else
2156 warn_cflags=yes
2159 if darwin && test "$cc_vendor" = "gnu" ; then
2160 extra_cflags="-falign-loops=16 -shared-libgcc $extra_cflags"
2163 if test "$cc_vendor" = "gnu" ; then
2164 cflag_check -Wundef && WARNFLAGS="-Wundef $WARNFLAGS"
2165 # -std=gnu99 is not a warning flag but is placed in WARN_CFLAGS because
2166 # that's the only variable specific to C now, and this option is not valid
2167 # for C++.
2168 cflag_check -std=gnu99 && WARN_CFLAGS="-std=gnu99 $WARN_CFLAGS"
2169 cflag_check -Wno-pointer-sign && WARN_CFLAGS="-Wno-pointer-sign $WARN_CFLAGS"
2170 cflag_check -Wdisabled-optimization && WARN_CFLAGS="-Wdisabled-optimization $WARN_CFLAGS"
2171 cflag_check -Wmissing-prototypes && WARN_CFLAGS="-Wmissing-prototypes $WARN_CFLAGS"
2172 cflag_check -Wstrict-prototypes && WARN_CFLAGS="-Wstrict-prototypes $WARN_CFLAGS"
2173 else
2174 CFLAGS="-D_ISOC99_SOURCE -D_BSD_SOURCE $CFLAGS"
2177 cflag_check -mno-omit-leaf-frame-pointer && cflags_no_omit_leaf_frame_pointer="-mno-omit-leaf-frame-pointer"
2178 cflag_check -MD -MP && DEPFLAGS="-MD -MP"
2181 if test -n "$LDFLAGS" ; then
2182 extra_ldflags="$extra_ldflags $LDFLAGS"
2183 warn_cflags=yes
2184 elif test "$cc_vendor" = "intel" ; then
2185 extra_ldflags="$extra_ldflags -i-static"
2187 if test -n "$CPPFLAGS" ; then
2188 extra_cflags="$extra_cflags $CPPFLAGS"
2189 warn_cflags=yes
2194 if x86_32 ; then
2195 # Checking assembler (_as) compatibility...
2196 # Added workaround for older as that reads from stdin by default - atmos
2197 as_version=$(echo '' | $_as -version 2>&1 | sed -n 's/^.*assembler \(version \)*\([0-9.]*\).*$/\2/p')
2198 echocheck "assembler ($_as $as_version)"
2200 _pref_as_version='2.9.1'
2201 echo 'nop' > $TMPS
2202 if test "$_mmx" = yes ; then
2203 echo 'emms' >> $TMPS
2205 if test "$_3dnow" = yes ; then
2206 _pref_as_version='2.10.1'
2207 echo 'femms' >> $TMPS
2209 if test "$_3dnowext" = yes ; then
2210 _pref_as_version='2.10.1'
2211 echo 'pswapd %mm0, %mm0' >> $TMPS
2213 if test "$_mmxext" = yes ; then
2214 _pref_as_version='2.10.1'
2215 echo 'movntq %mm0, (%eax)' >> $TMPS
2217 if test "$_sse" = yes ; then
2218 _pref_as_version='2.10.1'
2219 echo 'xorps %xmm0, %xmm0' >> $TMPS
2221 #if test "$_sse2" = yes ; then
2222 # _pref_as_version='2.11'
2223 # echo 'xorpd %xmm0, %xmm0' >> $TMPS
2225 if test "$_cmov" = yes ; then
2226 _pref_as_version='2.10.1'
2227 echo 'cmovb %eax, %ebx' >> $TMPS
2229 if test "$_ssse3" = yes ; then
2230 _pref_as_version='2.16.92'
2231 echo 'pabsd %xmm0, %xmm1' >> $TMPS
2233 $_as $TMPS -o $TMPEXE > /dev/null 2>&1 || as_verc_fail=yes
2235 if test "$as_verc_fail" != yes ; then
2236 echores "ok"
2237 else
2238 res_comment="Upgrade binutils to ${_pref_as_version} or use --disable-ssse3 etc."
2239 echores "failed"
2240 die "obsolete binutils version"
2243 fi #if x86_32
2246 echocheck "PIC"
2247 pic=no
2248 cat > $TMPC << EOF
2249 int main(void) {
2250 #if !(defined(__PIC__) || defined(__pic__) || defined(PIC))
2251 #error PIC not enabled
2252 #endif
2253 return 0;
2256 cc_check && pic=yes && extra_cflags="$extra_cflags -DPIC"
2257 echores $pic
2260 if x86 ; then
2262 echocheck ".align is a power of two"
2263 if test "$_asmalign_pot" = auto ; then
2264 _asmalign_pot=no
2265 inline_asm_check '".align 3"' && _asmalign_pot=yes
2267 if test "$_asmalign_pot" = "yes" ; then
2268 def_asmalign_pot='#define ASMALIGN(ZEROBITS) ".align " #ZEROBITS "\n\t"'
2269 else
2270 def_asmalign_pot='#define ASMALIGN(ZEROBITS) ".align 1<<" #ZEROBITS "\n\t"'
2272 echores $_asmalign_pot
2275 echocheck "ebx availability"
2276 ebx_available=no
2277 def_ebx_available='#define HAVE_EBX_AVAILABLE 0'
2278 cat > $TMPC << EOF
2279 int main(void) {
2280 int x;
2281 __asm__ volatile(
2282 "xor %0, %0"
2283 :"=b"(x)
2284 // just adding ebx to clobber list seems unreliable with some
2285 // compilers, e.g. Haiku's gcc 2.95
2287 // and the above check does not work for OSX 64 bit...
2288 __asm__ volatile("":::"%ebx");
2289 return 0;
2292 cc_check && ebx_available=yes && def_ebx_available='#define HAVE_EBX_AVAILABLE 1'
2293 echores $ebx_available
2296 echocheck "yasm"
2297 if test -z "$YASMFLAGS" ; then
2298 if darwin ; then
2299 x86_64 && objformat="macho64" || objformat="macho"
2300 elif win32 ; then
2301 objformat="win32"
2302 else
2303 objformat="elf"
2305 # currently tested for Linux x86, x86_64
2306 YASMFLAGS="-f $objformat"
2307 x86_64 && YASMFLAGS="$YASMFLAGS -DARCH_X86_64 -m amd64"
2308 test "$pic" = "yes" && YASMFLAGS="$YASMFLAGS -DPIC"
2309 case "$objformat" in
2310 elf) test $_debug && YASMFLAGS="$YASMFLAGS -g dwarf2" ;;
2311 *) YASMFLAGS="$YASMFLAGS -DPREFIX" ;;
2312 esac
2313 else
2314 warn_cflags=yes
2317 echo "pabsw xmm0, xmm0" > $TMPS
2318 yasm_check || _yasm=""
2319 if test $_yasm ; then
2320 def_yasm='#define HAVE_YASM 1'
2321 have_yasm="yes"
2322 echores "$_yasm"
2323 else
2324 def_yasm='#define HAVE_YASM 0'
2325 have_yasm="no"
2326 echores "no"
2329 echocheck "bswap"
2330 def_bswap='#define HAVE_BSWAP 0'
2331 echo 'bswap %eax' > $TMPS
2332 $_as $TMPS -o $TMPEXE > /dev/null 2>&1 && def_bswap='#define HAVE_BSWAP 1' && bswap=yes || bswap=no
2333 echores "$bswap"
2334 fi #if x86
2337 #FIXME: This should happen before the check for CFLAGS..
2338 def_altivec_h='#define HAVE_ALTIVEC_H 0'
2339 if ppc && ( test "$_altivec" = yes || test "$_runtime_cpudetection" = yes ) ; then
2341 # check if AltiVec is supported by the compiler, and how to enable it
2342 echocheck "GCC AltiVec flags"
2343 if $(cflag_check -maltivec -mabi=altivec) ; then
2344 _altivec_gcc_flags="-maltivec -mabi=altivec"
2345 # check if <altivec.h> should be included
2346 if $(header_check altivec.h $_altivec_gcc_flags) ; then
2347 def_altivec_h='#define HAVE_ALTIVEC_H 1'
2348 inc_altivec_h='#include <altivec.h>'
2349 else
2350 if $(cflag_check -faltivec) ; then
2351 _altivec_gcc_flags="-faltivec"
2352 else
2353 _altivec=no
2354 _altivec_gcc_flags="none, AltiVec disabled"
2358 echores "$_altivec_gcc_flags"
2360 # check if the compiler supports braces for vector declarations
2361 cat > $TMPC << EOF
2362 $inc_altivec_h
2363 int main(void) { (vector int) {1}; return 0; }
2365 cc_check $_altivec_gcc_flags || die "You need a compiler that supports {} in AltiVec vector declarations."
2367 # Disable runtime cpudetection if we cannot generate AltiVec code or
2368 # AltiVec is disabled by the user.
2369 test "$_runtime_cpudetection" = yes && test "$_altivec" = no \
2370 && _runtime_cpudetection=no
2372 # Show that we are optimizing for AltiVec (if enabled and supported).
2373 test "$_runtime_cpudetection" = no && test "$_altivec" = yes \
2374 && _optimizing="$_optimizing altivec"
2376 # If AltiVec is enabled, make sure the correct flags turn up in CFLAGS.
2377 test "$_altivec" = yes && CFLAGS="$CFLAGS $_altivec_gcc_flags"
2380 if ppc ; then
2381 def_xform_asm='#define HAVE_XFORM_ASM 0'
2382 xform_asm=no
2383 echocheck "XFORM ASM support"
2384 inline_asm_check '"lwzx %1, %y0" :: "Z"(*(int*)0), "r"(0)' &&
2385 xform_asm=yes && def_xform_asm='#define HAVE_XFORM_ASM 1'
2386 echores "$xform_asm"
2389 if arm ; then
2390 echocheck "ARMv5TE (Enhanced DSP Extensions)"
2391 if test $_armv5te = "auto" ; then
2392 _armv5te=no
2393 inline_asm_check '"qadd r0, r0, r0"' && _armv5te=yes
2395 echores "$_armv5te"
2397 test $_armv5te = "yes" && test $_fast_clz = "auto" && _fast_clz=yes
2399 echocheck "ARMv6 (SIMD instructions)"
2400 if test $_armv6 = "auto" ; then
2401 _armv6=no
2402 inline_asm_check '"sadd16 r0, r0, r0"' && _armv6=yes
2404 echores "$_armv6"
2406 echocheck "ARMv6t2 (SIMD instructions)"
2407 if test $_armv6t2 = "auto" ; then
2408 _armv6t2=no
2409 inline_asm_check '"movt r0, #0"' && _armv6t2=yes
2411 echores "$_armv6t2"
2413 echocheck "ARM VFP"
2414 if test $_armvfp = "auto" ; then
2415 _armvfp=no
2416 inline_asm_check '"fadds s0, s0, s0"' && _armvfp=yes
2418 echores "$_armvfp"
2420 echocheck "ARM NEON"
2421 if test $neon = "auto" ; then
2422 neon=no
2423 inline_asm_check '"vadd.i16 q0, q0, q0"' && neon=yes
2425 echores "$neon"
2427 echocheck "iWMMXt (Intel XScale SIMD instructions)"
2428 if test $_iwmmxt = "auto" ; then
2429 _iwmmxt=no
2430 inline_asm_check '"wunpckelub wr6, wr4"' && _iwmmxt=yes
2432 echores "$_iwmmxt"
2435 cpuexts_all='ALTIVEC MMX MMX2 AMD3DNOW AMD3DNOWEXT SSE SSE2 SSSE3 FAST_CMOV CMOV FAST_CLZ ARMV5TE ARMV6 ARMV6T2 ARMVFP NEON IWMMXT MMI VIS MVI'
2436 test "$_altivec" = yes && cpuexts="ALTIVEC $cpuexts"
2437 test "$_mmx" = yes && cpuexts="MMX $cpuexts"
2438 test "$_mmxext" = yes && cpuexts="MMX2 $cpuexts"
2439 test "$_3dnow" = yes && cpuexts="AMD3DNOW $cpuexts"
2440 test "$_3dnowext" = yes && cpuexts="AMD3DNOWEXT $cpuexts"
2441 test "$_sse" = yes && cpuexts="SSE $cpuexts"
2442 test "$_sse2" = yes && cpuexts="SSE2 $cpuexts"
2443 test "$_ssse3" = yes && cpuexts="SSSE3 $cpuexts"
2444 test "$_cmov" = yes && cpuexts="CMOV $cpuexts"
2445 test "$_fast_cmov" = yes && cpuexts="FAST_CMOV $cpuexts"
2446 test "$_fast_clz" = yes && cpuexts="FAST_CLZ $cpuexts"
2447 test "$_armv5te" = yes && cpuexts="ARMV5TE $cpuexts"
2448 test "$_armv6" = yes && cpuexts="ARMV6 $cpuexts"
2449 test "$_armv6t2" = yes && cpuexts="ARMV6T2 $cpuexts"
2450 test "$_armvfp" = yes && cpuexts="ARMVFP $cpuexts"
2451 test "$neon" = yes && cpuexts="NEON $cpuexts"
2452 test "$_iwmmxt" = yes && cpuexts="IWMMXT $cpuexts"
2453 test "$_vis" = yes && cpuexts="VIS $cpuexts"
2454 test "$_mvi" = yes && cpuexts="MVI $cpuexts"
2456 # Checking kernel version...
2457 if x86_32 && linux ; then
2458 _k_verc_problem=no
2459 kernel_version=$(uname -r 2>&1)
2460 echocheck "$system_name kernel version"
2461 case "$kernel_version" in
2462 '') kernel_version="?.??"; _k_verc_fail=yes;;
2463 [0-1].[0-9].[0-9]*|2.[0-3].[0-9]*)
2464 _k_verc_problem=yes;;
2465 esac
2466 if test "$_k_verc_problem" = yes && test "$_sse" = yes ; then
2467 _k_verc_fail=yes
2469 if test "$_k_verc_fail" ; then
2470 echores "$kernel_version, fail"
2471 echo "WARNING! If you want to run MPlayer on this system, get prepared for problems!"
2472 echo "2.2.x has limited SSE support. Upgrade the kernel or use --disable-sse if you"
2473 echo "experience crashes. MPlayer tries to autodetect if your kernel correctly"
2474 echo "supports SSE, but you have been warned! If you are using a kernel older than"
2475 echo "2.2.x you must upgrade it to get SSE support!"
2476 # die "Your kernel is too old for this CPU." # works fine on some 2.2.x so don't die (later check will test)
2477 else
2478 echores "$kernel_version, ok"
2482 ######################
2483 # MAIN TESTS GO HERE #
2484 ######################
2487 echocheck "-lposix"
2488 if cflag_check -lposix ; then
2489 extra_ldflags="$extra_ldflags -lposix"
2490 echores "yes"
2491 else
2492 echores "no"
2495 echocheck "-lm"
2496 if cflag_check -lm ; then
2497 _ld_lm="-lm"
2498 echores "yes"
2499 else
2500 _ld_lm=""
2501 echores "no"
2505 echocheck "langinfo"
2506 if test "$_langinfo" = auto ; then
2507 _langinfo=no
2508 statement_check langinfo.h 'nl_langinfo(CODESET)' && _langinfo=yes
2510 if test "$_langinfo" = yes ; then
2511 def_langinfo='#define HAVE_LANGINFO 1'
2512 else
2513 def_langinfo='#undef HAVE_LANGINFO'
2515 echores "$_langinfo"
2518 echocheck "translation support"
2519 if test "$_translation" = yes; then
2520 def_translation="#define CONFIG_TRANSLATION 1"
2521 else
2522 def_translation="#undef CONFIG_TRANSLATION"
2524 echores "$_translation"
2526 echocheck "language"
2527 # Set preferred languages, "all" uses English as main language.
2528 test -z "$language" && language=$LINGUAS
2529 test -z "$language_doc" && language_doc=$language
2530 test -z "$language_man" && language_man=$language
2531 test -z "$language_msg" && language_msg=$language
2532 test -z "$language_msg" && language_msg="all"
2533 language_doc=$(echo $language_doc | tr , " ")
2534 language_man=$(echo $language_man | tr , " ")
2535 language_msg=$(echo $language_msg | tr , " ")
2537 test "$language_doc" = "all" && language_doc=$doc_lang_all
2538 test "$language_man" = "all" && language_man=$man_lang_all
2539 test "$language_msg" = "all" && language_msg=$msg_lang_all
2541 if test "$_translation" != yes ; then
2542 language_msg=""
2545 # Prune non-existing translations from language lists.
2546 # Set message translation to the first available language.
2547 # Fall back on English.
2548 for lang in $language_doc ; do
2549 test -d DOCS/xml/$lang && tmp_language_doc="$tmp_language_doc $lang"
2550 done
2551 language_doc=$tmp_language_doc
2552 test -z "$language_doc" && language_doc=en
2554 for lang in $language_man ; do
2555 test -d DOCS/man/$lang && tmp_language_man="$tmp_language_man $lang"
2556 done
2557 language_man=$tmp_language_man
2558 test -z "$language_man" && language_man=en
2560 for lang in $language_msg ; do
2561 test -f po/$lang.po && tmp_language_msg="$tmp_language_msg $lang"
2562 done
2563 language_msg=$tmp_language_msg
2565 echores "messages (en+): $language_msg - man pages: $language_man - documentation: $language_doc"
2568 echocheck "enable sighandler"
2569 if test "$_sighandler" = yes ; then
2570 def_sighandler='#define CONFIG_SIGHANDLER 1'
2571 else
2572 def_sighandler='#undef CONFIG_SIGHANDLER'
2574 echores "$_sighandler"
2576 echocheck "runtime cpudetection"
2577 if test "$_runtime_cpudetection" = yes ; then
2578 _optimizing="Runtime CPU-Detection enabled"
2579 def_runtime_cpudetection='#define CONFIG_RUNTIME_CPUDETECT 1'
2580 else
2581 def_runtime_cpudetection='#define CONFIG_RUNTIME_CPUDETECT 0'
2583 echores "$_runtime_cpudetection"
2586 echocheck "restrict keyword"
2587 for restrict_keyword in restrict __restrict __restrict__ ; do
2588 echo "void foo(char * $restrict_keyword p); int main(void) { return 0; }" > $TMPC
2589 if cc_check; then
2590 def_restrict_keyword=$restrict_keyword
2591 break;
2593 done
2594 if [ -n "$def_restrict_keyword" ]; then
2595 echores "$def_restrict_keyword"
2596 else
2597 echores "none"
2599 # Avoid infinite recursion loop ("#define restrict restrict")
2600 if [ "$def_restrict_keyword" != "restrict" ]; then
2601 def_restrict_keyword="#define restrict $def_restrict_keyword"
2602 else
2603 def_restrict_keyword=""
2607 echocheck "__builtin_expect"
2608 # GCC branch prediction hint
2609 cat > $TMPC << EOF
2610 static int foo(int a) {
2611 a = __builtin_expect(a, 10);
2612 return a == 10 ? 0 : 1;
2614 int main(void) { return foo(10) && foo(0); }
2616 _builtin_expect=no
2617 cc_check && _builtin_expect=yes
2618 if test "$_builtin_expect" = yes ; then
2619 def_builtin_expect='#define HAVE_BUILTIN_EXPECT 1'
2620 else
2621 def_builtin_expect='#undef HAVE_BUILTIN_EXPECT'
2623 echores "$_builtin_expect"
2626 echocheck "kstat"
2627 _kstat=no
2628 statement_check kstat.h 'kstat_open()' -lkstat && _kstat=yes
2629 if test "$_kstat" = yes ; then
2630 def_kstat="#define HAVE_LIBKSTAT 1"
2631 extra_ldflags="$extra_ldflags -lkstat"
2632 else
2633 def_kstat="#undef HAVE_LIBKSTAT"
2635 echores "$_kstat"
2638 echocheck "posix4"
2639 # required for nanosleep on some systems
2640 _posix4=no
2641 statement_check time.h 'nanosleep(0, 0)' -lposix4 && _posix4=yes
2642 if test "$_posix4" = yes ; then
2643 extra_ldflags="$extra_ldflags -lposix4"
2645 echores "$_posix4"
2647 for func in exp2 exp2f llrint log2 log2f lrint lrintf round roundf truncf; do
2648 echocheck $func
2649 eval _$func=no
2650 statement_check math.h "${func}(2.0)" -D_ISOC99_SOURCE $_ld_lm && eval _$func=yes
2651 if eval test "x\$_$func" = "xyes"; then
2652 eval def_$func="\"#define HAVE_$(echo $func | tr '[a-z]' '[A-Z]') 1\""
2653 echores yes
2654 else
2655 eval def_$func="\"#define HAVE_$(echo $func | tr '[a-z]' '[A-Z]') 0\""
2656 echores no
2658 done
2661 echocheck "mkstemp"
2662 _mkstemp=no
2663 define_statement_check "_XOPEN_SOURCE 600" "stdlib.h" 'mkstemp("")' && _mkstemp=yes
2664 if test "$_mkstemp" = yes ; then
2665 def_mkstemp='#define HAVE_MKSTEMP 1'
2666 else
2667 def_mkstemp='#define HAVE_MKSTEMP 0'
2669 echores "$_mkstemp"
2672 echocheck "nanosleep"
2673 _nanosleep=no
2674 statement_check time.h 'nanosleep(0, 0)' && _nanosleep=yes
2675 if test "$_nanosleep" = yes ; then
2676 def_nanosleep='#define HAVE_NANOSLEEP 1'
2677 else
2678 def_nanosleep='#undef HAVE_NANOSLEEP'
2680 echores "$_nanosleep"
2683 echocheck "socklib"
2684 # for Solaris (socket stuff is in -lsocket, gethostbyname and friends in -lnsl):
2685 # for BeOS (socket stuff is in -lsocket, gethostbyname and friends in -lbind):
2686 cat > $TMPC << EOF
2687 #include <netdb.h>
2688 #include <sys/socket.h>
2689 int main(void) { gethostbyname(0); socket(AF_INET, SOCK_STREAM, 0); return 0; }
2691 _socklib=no
2692 for _ld_tmp in "" "-lsocket -lbind" "-lsocket -ldnet" "-lsocket -lnsl" "-lnsl" "-lsocket" ; do
2693 cc_check $_ld_tmp && _ld_sock="$_ld_tmp" && _socklib=yes && break
2694 done
2695 test $_socklib = yes && test $_winsock2_h = auto && _winsock2_h=no
2696 if test $_winsock2_h = auto ; then
2697 _winsock2_h=no
2698 statement_check winsock2.h 'gethostbyname(0)' -lws2_32 && _ld_sock="-lws2_32" && _winsock2_h=yes
2700 test "$_ld_sock" && res_comment="using $_ld_sock"
2701 echores "$_socklib"
2704 if test $_winsock2_h = yes ; then
2705 _ld_sock="-lws2_32"
2706 def_winsock2_h='#define HAVE_WINSOCK2_H 1'
2707 else
2708 def_winsock2_h='#define HAVE_WINSOCK2_H 0'
2712 echocheck "arpa/inet.h"
2713 arpa_inet_h=no
2714 def_arpa_inet_h='#define HAVE_ARPA_INET_H 0'
2715 header_check arpa/inet.h && arpa_inet_h=yes &&
2716 def_arpa_inet_h='#define HAVE_ARPA_INET_H 1'
2717 echores "$arpa_inet_h"
2720 echocheck "inet_pton()"
2721 def_inet_pton='#define HAVE_INET_PTON 0'
2722 inet_pton=no
2723 for _ld_tmp in "$_ld_sock" "$_ld_sock -lresolv" ; do
2724 statement_check arpa/inet.h 'inet_pton(0, 0, 0)' $_ld_tmp && inet_pton=yes && break
2725 done
2726 if test $inet_pton = yes ; then
2727 test "$_ld_tmp" && res_comment="using $_ld_tmp"
2728 def_inet_pton='#define HAVE_INET_PTON 1'
2730 echores "$inet_pton"
2733 echocheck "inet_aton()"
2734 def_inet_aton='#define HAVE_INET_ATON 0'
2735 inet_aton=no
2736 for _ld_tmp in "$_ld_sock" "$_ld_sock -lresolv" ; do
2737 statement_check arpa/inet.h 'inet_aton(0, 0)' $_ld_tmp && inet_aton=yes && break
2738 done
2739 if test $inet_aton = yes ; then
2740 test "$_ld_tmp" && res_comment="using $_ld_tmp"
2741 def_inet_aton='#define HAVE_INET_ATON 1'
2743 echores "$inet_aton"
2746 echocheck "socklen_t"
2747 _socklen_t=no
2748 for header in "sys/socket.h" "ws2tcpip.h" "sys/types.h" ; do
2749 statement_check $header 'socklen_t v = 0' && _socklen_t=yes && break
2750 done
2751 if test "$_socklen_t" = yes ; then
2752 def_socklen_t='#define HAVE_SOCKLEN_T 1'
2753 else
2754 def_socklen_t='#define HAVE_SOCKLEN_T 0'
2756 echores "$_socklen_t"
2759 echocheck "closesocket()"
2760 _closesocket=no
2761 statement_check winsock2.h 'closesocket(~0)' $_ld_sock && _closesocket=yes
2762 if test "$_closesocket" = yes ; then
2763 def_closesocket='#define HAVE_CLOSESOCKET 1'
2764 else
2765 def_closesocket='#define HAVE_CLOSESOCKET 0'
2767 echores "$_closesocket"
2770 echocheck "networking"
2771 test $_winsock2_h = no && test $inet_pton = no &&
2772 test $inet_aton = no && networking=no
2773 if test "$networking" = yes ; then
2774 def_network='#define CONFIG_NETWORK 1'
2775 def_networking='#define CONFIG_NETWORKING 1'
2776 extra_ldflags="$extra_ldflags $_ld_sock"
2777 inputmodules="networking $inputmodules"
2778 else
2779 noinputmodules="networking $noinputmodules"
2780 def_network='#define CONFIG_NETWORK 0'
2781 def_networking='#undef CONFIG_NETWORKING'
2783 echores "$networking"
2786 echocheck "inet6"
2787 if test "$_inet6" = auto ; then
2788 cat > $TMPC << EOF
2789 #include <sys/types.h>
2790 #if !defined(_WIN32)
2791 #include <sys/socket.h>
2792 #include <netinet/in.h>
2793 #else
2794 #include <ws2tcpip.h>
2795 #endif
2796 int main(void) { struct sockaddr_in6 six; socket(AF_INET6, SOCK_STREAM, AF_INET6); return 0; }
2798 _inet6=no
2799 if cc_check $_ld_sock ; then
2800 _inet6=yes
2803 if test "$_inet6" = yes ; then
2804 def_inet6='#define HAVE_AF_INET6 1'
2805 else
2806 def_inet6='#undef HAVE_AF_INET6'
2808 echores "$_inet6"
2811 echocheck "gethostbyname2"
2812 if test "$_gethostbyname2" = auto ; then
2813 cat > $TMPC << EOF
2814 #include <sys/types.h>
2815 #include <sys/socket.h>
2816 #include <netdb.h>
2817 int main(void) { gethostbyname2("", AF_INET); return 0; }
2819 _gethostbyname2=no
2820 if cc_check ; then
2821 _gethostbyname2=yes
2824 if test "$_gethostbyname2" = yes ; then
2825 def_gethostbyname2='#define HAVE_GETHOSTBYNAME2 1'
2826 else
2827 def_gethostbyname2='#undef HAVE_GETHOSTBYNAME2'
2829 echores "$_gethostbyname2"
2832 echocheck "inttypes.h (required)"
2833 _inttypes=no
2834 header_check inttypes.h && _inttypes=yes
2835 echores "$_inttypes"
2837 if test "$_inttypes" = no ; then
2838 echocheck "sys/bitypes.h (inttypes.h predecessor)"
2839 header_check sys/bitypes.h && _inttypes=yes
2840 if test "$_inttypes" = yes ; then
2841 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."
2842 else
2843 die "Cannot find header either inttypes.h or bitypes.h. There is no chance for compilation to succeed."
2848 echocheck "malloc.h"
2849 _malloc=no
2850 header_check malloc.h && _malloc=yes
2851 if test "$_malloc" = yes ; then
2852 def_malloc_h='#define HAVE_MALLOC_H 1'
2853 else
2854 def_malloc_h='#define HAVE_MALLOC_H 0'
2856 echores "$_malloc"
2859 echocheck "memalign()"
2860 # XXX restrict to x86 ? extend to other CPUs/cacheline sizes ?
2861 def_memalign_hack='#define CONFIG_MEMALIGN_HACK 0'
2862 _memalign=no
2863 statement_check malloc.h 'memalign(64, sizeof(char))' && _memalign=yes
2864 if test "$_memalign" = yes ; then
2865 def_memalign='#define HAVE_MEMALIGN 1'
2866 else
2867 def_memalign='#define HAVE_MEMALIGN 0'
2868 def_map_memalign='#define memalign(a, b) malloc(b)'
2869 darwin || def_memalign_hack='#define CONFIG_MEMALIGN_HACK 1'
2871 echores "$_memalign"
2874 echocheck "posix_memalign()"
2875 posix_memalign=no
2876 def_posix_memalign='#define HAVE_POSIX_MEMALIGN 0'
2877 define_statement_check "_XOPEN_SOURCE 600" "stdlib.h" 'posix_memalign(NULL, 0, 0)' &&
2878 posix_memalign=yes && def_posix_memalign='#define HAVE_POSIX_MEMALIGN 1'
2879 echores "$posix_memalign"
2882 echocheck "alloca.h"
2883 _alloca=no
2884 statement_check alloca.h 'alloca(0)' && _alloca=yes
2885 if cc_check ; then
2886 def_alloca_h='#define HAVE_ALLOCA_H 1'
2887 else
2888 def_alloca_h='#undef HAVE_ALLOCA_H'
2890 echores "$_alloca"
2893 echocheck "fastmemcpy"
2894 if test "$_fastmemcpy" = yes ; then
2895 def_fastmemcpy='#define CONFIG_FASTMEMCPY 1'
2896 else
2897 def_fastmemcpy='#undef CONFIG_FASTMEMCPY'
2899 echores "$_fastmemcpy"
2902 echocheck "mman.h"
2903 _mman=no
2904 statement_check sys/mman.h 'mmap(0, 0, 0, 0, 0, 0)' && _mman=yes
2905 if test "$_mman" = yes ; then
2906 def_mman_h='#define HAVE_SYS_MMAN_H 1'
2907 else
2908 def_mman_h='#undef HAVE_SYS_MMAN_H'
2910 echores "$_mman"
2912 _mman_has_map_failed=no
2913 statement_check sys/mman.h 'void *p = MAP_FAILED' && _mman_has_map_failed=yes
2914 if test "$_mman_has_map_failed" = yes ; then
2915 def_mman_has_map_failed=''
2916 else
2917 def_mman_has_map_failed='#define MAP_FAILED ((void *) -1)'
2920 echocheck "dynamic loader"
2921 _dl=no
2922 for _ld_tmp in "" "-ldl"; do
2923 statement_check dlfcn.h 'dlopen("", 0)' $_ld_tmp && _ld_dl="$_ld_tmp" && _dl=yes && break
2924 done
2925 if test "$_dl" = yes ; then
2926 def_dl='#define HAVE_LIBDL 1'
2927 else
2928 def_dl='#undef HAVE_LIBDL'
2930 echores "$_dl"
2933 def_threads='#define HAVE_THREADS 0'
2935 echocheck "pthread"
2936 if linux ; then
2937 THREAD_CFLAGS=-D_REENTRANT
2938 elif freebsd || netbsd || openbsd || bsdos ; then
2939 THREAD_CFLAGS=-D_THREAD_SAFE
2941 if test "$_pthreads" = auto ; then
2942 cat > $TMPC << EOF
2943 #include <pthread.h>
2944 static void *func(void *arg) { return arg; }
2945 int main(void) {
2946 pthread_t tid;
2947 #ifdef PTW32_STATIC_LIB
2948 pthread_win32_process_attach_np();
2949 pthread_win32_thread_attach_np();
2950 #endif
2951 return pthread_create (&tid, 0, func, 0) != 0;
2954 _pthreads=no
2955 if ! hpux ; then
2956 for _ld_tmp in "-lpthreadGC2" "" "-lpthread" "-pthread" ; do
2957 # for crosscompilation, we cannot execute the program, be happy if we can link statically
2958 cc_check $THREAD_CFLAGS $_ld_tmp && (tmp_run || test "$_ld_static") && _ld_pthread="$_ld_tmp" && _pthreads=yes && break
2959 done
2960 if test "$_pthreads" = no && mingw32 ; then
2961 _ld_tmp="-lpthreadGC2 -lws2_32"
2962 cc_check $_ld_tmp -DPTW32_STATIC_LIB && (tmp_run || test "$_ld_static") && _ld_pthread="$_ld_tmp" && _pthreads=yes && CFLAGS="$CFLAGS -DPTW32_STATIC_LIB"
2966 if test "$_pthreads" = yes ; then
2967 test $_ld_pthread && res_comment="using $_ld_pthread"
2968 def_pthreads='#define HAVE_PTHREADS 1'
2969 def_threads='#define HAVE_THREADS 1'
2970 extra_cflags="$extra_cflags $THREAD_CFLAGS"
2971 else
2972 res_comment="v4l, v4l2, ao_nas, win32 loader disabled"
2973 def_pthreads='#undef HAVE_PTHREADS'
2974 _nas=no ; _tv_v4l1=no ; _tv_v4l2=no
2975 mingw32 || _win32dll=no
2977 echores "$_pthreads"
2979 if cygwin ; then
2980 if test "$_pthreads" = yes ; then
2981 def_pthread_cache="#define PTHREAD_CACHE 1"
2982 else
2983 _stream_cache=no
2984 def_stream_cache="#undef CONFIG_STREAM_CACHE"
2988 echocheck "w32threads"
2989 if test "$_pthreads" = yes ; then
2990 res_comment="using pthread instead"
2991 _w32threads=no
2993 if test "$_w32threads" = auto ; then
2994 _w32threads=no
2995 mingw32 && _w32threads=yes
2997 test "$_w32threads" = yes && def_threads='#define HAVE_THREADS 1'
2998 echores "$_w32threads"
3000 echocheck "rpath"
3001 if test "$_rpath" = yes ; then
3002 for I in $(echo $extra_ldflags | sed 's/-L//g') ; do
3003 tmp="$tmp $(echo $I | sed 's/.*/ -L& -Wl,-R&/')"
3004 done
3005 extra_ldflags=$tmp
3007 echores "$_rpath"
3009 echocheck "iconv"
3010 if test "$_iconv" = auto ; then
3011 cat > $TMPC << EOF
3012 #include <stdio.h>
3013 #include <unistd.h>
3014 #include <iconv.h>
3015 #define INBUFSIZE 1024
3016 #define OUTBUFSIZE 4096
3018 char inbuffer[INBUFSIZE];
3019 char outbuffer[OUTBUFSIZE];
3021 int main(void) {
3022 size_t numread;
3023 iconv_t icdsc;
3024 char *tocode="UTF-8";
3025 char *fromcode="cp1250";
3026 if ((icdsc = iconv_open(tocode, fromcode)) != (iconv_t)(-1)) {
3027 while ((numread = read(0, inbuffer, INBUFSIZE))) {
3028 char *iptr=inbuffer;
3029 char *optr=outbuffer;
3030 size_t inleft=numread;
3031 size_t outleft=OUTBUFSIZE;
3032 if (iconv(icdsc, &iptr, &inleft, &optr, &outleft)
3033 != (size_t)(-1)) {
3034 write(1, outbuffer, OUTBUFSIZE - outleft);
3037 if (iconv_close(icdsc) == -1)
3040 return 0;
3043 _iconv=no
3044 for _ld_tmp in "" "-liconv" "-liconv $_ld_dl" ; do
3045 cc_check $_ld_lm $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" &&
3046 _iconv=yes && break
3047 done
3048 if test "$_iconv" != yes ; then
3049 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."
3052 if test "$_iconv" = yes ; then
3053 def_iconv='#define CONFIG_ICONV 1'
3054 else
3055 def_iconv='#undef CONFIG_ICONV'
3057 echores "$_iconv"
3060 echocheck "soundcard.h"
3061 _soundcard_h=no
3062 def_soundcard_h='#undef HAVE_SOUNDCARD_H'
3063 def_sys_soundcard_h='#undef HAVE_SYS_SOUNDCARD_H'
3064 for _soundcard_header in "sys/soundcard.h" "soundcard.h"; do
3065 header_check $_soundcard_header && _soundcard_h=yes &&
3066 res_comment="$_soundcard_header" && break
3067 done
3069 if test "$_soundcard_h" = yes ; then
3070 if test $_soundcard_header = "sys/soundcard.h"; then
3071 def_sys_soundcard_h='#define HAVE_SYS_SOUNDCARD_H 1'
3072 else
3073 def_soundcard_h='#define HAVE_SOUNDCARD_H 1'
3076 echores "$_soundcard_h"
3079 echocheck "sys/videoio.h"
3080 sys_videoio_h=no
3081 def_sys_videoio_h='#undef HAVE_SYS_VIDEOIO_H'
3082 header_check sys/videoio.h && sys_videoio_h=yes &&
3083 def_sys_videoio_h='#define HAVE_SYS_VIDEOIO_H 1'
3084 echores "$sys_videoio_h"
3087 echocheck "sys/dvdio.h"
3088 _dvdio=no
3089 # FreeBSD 8.1 has broken dvdio.h
3090 header_check_broken sys/types.h sys/dvdio.h && _dvdio=yes
3091 if test "$_dvdio" = yes ; then
3092 def_dvdio='#define DVD_STRUCT_IN_SYS_DVDIO_H 1'
3093 else
3094 def_dvdio='#undef DVD_STRUCT_IN_SYS_DVDIO_H'
3096 echores "$_dvdio"
3099 echocheck "sys/cdio.h"
3100 _cdio=no
3101 # at least OpenSolaris has a broken cdio.h
3102 header_check_broken sys/types.h sys/cdio.h && _cdio=yes
3103 if test "$_cdio" = yes ; then
3104 def_cdio='#define DVD_STRUCT_IN_SYS_CDIO_H 1'
3105 else
3106 def_cdio='#undef DVD_STRUCT_IN_SYS_CDIO_H'
3108 echores "$_cdio"
3111 echocheck "linux/cdrom.h"
3112 _cdrom=no
3113 header_check linux/cdrom.h && _cdrom=yes
3114 if test "$_cdrom" = yes ; then
3115 def_cdrom='#define DVD_STRUCT_IN_LINUX_CDROM_H 1'
3116 else
3117 def_cdrom='#undef DVD_STRUCT_IN_LINUX_CDROM_H'
3119 echores "$_cdrom"
3122 echocheck "dvd.h"
3123 _dvd=no
3124 header_check dvd.h && _dvd=yes
3125 if test "$_dvd" = yes ; then
3126 def_dvd='#define DVD_STRUCT_IN_DVD_H 1'
3127 else
3128 def_dvd='#undef DVD_STRUCT_IN_DVD_H'
3130 echores "$_dvd"
3133 if bsdos; then
3134 echocheck "BSDI dvd.h"
3135 _bsdi_dvd=no
3136 header_check dvd.h && _bsdi_dvd=yes
3137 if test "$_bsdi_dvd" = yes ; then
3138 def_bsdi_dvd='#define DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H 1'
3139 else
3140 def_bsdi_dvd='#undef DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H'
3142 echores "$_bsdi_dvd"
3143 fi #if bsdos
3146 if hpux; then
3147 # also used by AIX, but AIX does not support VCD and/or libdvdread
3148 echocheck "HP-UX SCSI header"
3149 _hpux_scsi_h=no
3150 header_check sys/scsi.h && _hpux_scsi_h=yes
3151 if test "$_hpux_scsi_h" = yes ; then
3152 def_hpux_scsi_h='#define HPUX_SCTL_IO 1'
3153 else
3154 def_hpux_scsi_h='#undef HPUX_SCTL_IO'
3156 echores "$_hpux_scsi_h"
3157 fi #if hpux
3160 echocheck "termcap"
3161 if test "$_termcap" = auto ; then
3162 _termcap=no
3163 for _ld_tmp in "-lncurses" "-ltinfo" "-ltermcap"; do
3164 statement_check term.h 'tgetent(0, 0)' $_ld_tmp &&
3165 extra_ldflags="$extra_ldflags $_ld_tmp" && _termcap=yes && break
3166 done
3168 if test "$_termcap" = yes ; then
3169 def_termcap='#define HAVE_TERMCAP 1'
3170 test $_ld_tmp && res_comment="using $_ld_tmp"
3171 else
3172 def_termcap='#undef HAVE_TERMCAP'
3174 echores "$_termcap"
3177 echocheck "termios"
3178 def_termios='#undef HAVE_TERMIOS'
3179 def_termios_h='#undef HAVE_TERMIOS_H'
3180 def_termios_sys_h='#undef HAVE_SYS_TERMIOS_H'
3181 if test "$_termios" = auto ; then
3182 _termios=no
3183 for _termios_header in "termios.h" "sys/termios.h"; do
3184 header_check $_termios_header && _termios=yes &&
3185 res_comment="using $_termios_header" && break
3186 done
3189 if test "$_termios" = yes ; then
3190 def_termios='#define HAVE_TERMIOS 1'
3191 if test "$_termios_header" = "termios.h" ; then
3192 def_termios_h='#define HAVE_TERMIOS_H 1'
3193 else
3194 def_termios_sys_h='#define HAVE_SYS_TERMIOS_H 1'
3197 echores "$_termios"
3200 echocheck "shm"
3201 if test "$_shm" = auto ; then
3202 _shm=no
3203 statement_check sys/shm.h 'shmget(0, 0, 0); shmat(0, 0, 0); shmctl(0, 0, 0)' && _shm=yes
3205 if test "$_shm" = yes ; then
3206 def_shm='#define HAVE_SHM 1'
3207 else
3208 def_shm='#undef HAVE_SHM'
3210 echores "$_shm"
3213 echocheck "strsep()"
3214 _strsep=no
3215 statement_check string.h 'char *s = "Hello, world!"; strsep(&s, ",")' && _strsep=yes
3216 if test "$_strsep" = yes ; then
3217 def_strsep='#define HAVE_STRSEP 1'
3218 need_strsep=no
3219 else
3220 def_strsep='#undef HAVE_STRSEP'
3221 need_strsep=yes
3223 echores "$_strsep"
3226 echocheck "vsscanf()"
3227 cat > $TMPC << EOF
3228 #define _ISOC99_SOURCE
3229 #include <stdarg.h>
3230 #include <stdio.h>
3231 int main(void) { va_list ap; vsscanf("foo", "bar", ap); return 0; }
3233 _vsscanf=no
3234 cc_check && _vsscanf=yes
3235 if test "$_vsscanf" = yes ; then
3236 def_vsscanf='#define HAVE_VSSCANF 1'
3237 need_vsscanf=no
3238 else
3239 def_vsscanf='#undef HAVE_VSSCANF'
3240 need_vsscanf=yes
3242 echores "$_vsscanf"
3245 echocheck "swab()"
3246 _swab=no
3247 define_statement_check "_XOPEN_SOURCE 600" "unistd.h" 'int a, b; swab(&a, &b, 0)' ||
3248 statement_check "string.h" 'int a, b; swab(&a, &b, 0)' && _swab=yes
3249 if test "$_swab" = yes ; then
3250 def_swab='#define HAVE_SWAB 1'
3251 need_swab=no
3252 else
3253 def_swab='#undef HAVE_SWAB'
3254 need_swab=yes
3256 echores "$_swab"
3258 echocheck "POSIX select()"
3259 cat > $TMPC << EOF
3260 #include <stdio.h>
3261 #include <stdlib.h>
3262 #include <sys/types.h>
3263 #include <string.h>
3264 #include <sys/time.h>
3265 #include <unistd.h>
3266 int main(void) {int nfds = 1; fd_set readfds; struct timeval timeout; select(nfds, &readfds, NULL, NULL, &timeout); return 0; }
3268 _posix_select=no
3269 def_posix_select='#undef HAVE_POSIX_SELECT'
3270 cc_check && _posix_select=yes &&
3271 def_posix_select='#define HAVE_POSIX_SELECT 1'
3272 echores "$_posix_select"
3275 echocheck "audio select()"
3276 if test "$_select" = no ; then
3277 def_select='#undef HAVE_AUDIO_SELECT'
3278 elif test "$_select" = yes ; then
3279 def_select='#define HAVE_AUDIO_SELECT 1'
3281 echores "$_select"
3284 echocheck "gettimeofday()"
3285 _gettimeofday=no
3286 statement_check sys/time.h 'struct timeval tv; struct timezone tz; gettimeofday(&tv, &tz)' && _gettimeofday=yes
3287 if test "$_gettimeofday" = yes ; then
3288 def_gettimeofday='#define HAVE_GETTIMEOFDAY 1'
3289 need_gettimeofday=no
3290 else
3291 def_gettimeofday='#undef HAVE_GETTIMEOFDAY'
3292 need_gettimeofday=yes
3294 echores "$_gettimeofday"
3297 echocheck "glob()"
3298 _glob=no
3299 statement_check glob.h 'glob("filename", 0, 0, 0)' && _glob=yes
3300 need_glob=no
3301 if test "$_glob" = yes ; then
3302 def_glob='#define HAVE_GLOB 1'
3303 else
3304 def_glob='#undef HAVE_GLOB'
3305 # HACK! need_glob currently enables compilation of a
3306 # win32-specific glob()-replacement.
3307 # Other OS neither need it nor can they use it (mf:// is disabled for them).
3308 win32 && need_glob=yes
3310 echores "$_glob"
3313 echocheck "setenv()"
3314 _setenv=no
3315 statement_check stdlib.h 'setenv("", "", 0)' && _setenv=yes
3316 if test "$_setenv" = yes ; then
3317 def_setenv='#define HAVE_SETENV 1'
3318 need_setenv=no
3319 else
3320 def_setenv='#undef HAVE_SETENV'
3321 need_setenv=yes
3323 echores "$_setenv"
3326 echocheck "setmode()"
3327 _setmode=no
3328 def_setmode='#define HAVE_SETMODE 0'
3329 statement_check io.h 'setmode(0, 0)' && _setmode=yes && def_setmode='#define HAVE_SETMODE 1'
3330 echores "$_setmode"
3333 echocheck "sys/sysinfo.h"
3334 _sys_sysinfo=no
3335 statement_check sys/sysinfo.h 'struct sysinfo s_info; s_info.mem_unit=0; sysinfo(&s_info)' && _sys_sysinfo=yes
3336 if test "$_sys_sysinfo" = yes ; then
3337 def_sys_sysinfo_h='#define HAVE_SYS_SYSINFO_H 1'
3338 else
3339 def_sys_sysinfo_h='#undef HAVE_SYS_SYSINFO_H'
3341 echores "$_sys_sysinfo"
3344 if darwin; then
3346 echocheck "Mac OS X Finder Support"
3347 def_macosx_finder='#undef CONFIG_MACOSX_FINDER'
3348 if test "$_macosx_finder" = yes ; then
3349 def_macosx_finder='#define CONFIG_MACOSX_FINDER 1'
3350 extra_ldflags="$extra_ldflags -framework Cocoa"
3352 echores "$_macosx_finder"
3354 echocheck "Mac OS X Bundle file locations"
3355 def_macosx_bundle='#undef CONFIG_MACOSX_BUNDLE'
3356 test "$_macosx_bundle" = auto && _macosx_bundle=$_macosx_finder
3357 if test "$_macosx_bundle" = yes ; then
3358 def_macosx_bundle='#define CONFIG_MACOSX_BUNDLE 1'
3360 echores "$_macosx_bundle"
3362 echocheck "Apple Remote"
3363 if test "$_apple_remote" = auto ; then
3364 _apple_remote=no
3365 cat > $TMPC <<EOF
3366 #include <stdio.h>
3367 #include <IOKit/IOCFPlugIn.h>
3368 int main(void) {
3369 io_iterator_t hidObjectIterator = (io_iterator_t)NULL;
3370 CFMutableDictionaryRef hidMatchDictionary;
3371 IOReturn ioReturnValue;
3373 // Set up a matching dictionary to search the I/O Registry by class.
3374 // name for all HID class devices
3375 hidMatchDictionary = IOServiceMatching("AppleIRController");
3377 // Now search I/O Registry for matching devices.
3378 ioReturnValue = IOServiceGetMatchingServices(kIOMasterPortDefault,
3379 hidMatchDictionary, &hidObjectIterator);
3381 // If search is unsuccessful, return nonzero.
3382 if (ioReturnValue != kIOReturnSuccess ||
3383 !IOIteratorIsValid(hidObjectIterator)) {
3384 return 1;
3386 return 0;
3389 cc_check -framework IOKit && _apple_remote=yes
3391 if test "$_apple_remote" = yes ; then
3392 def_apple_remote='#define CONFIG_APPLE_REMOTE 1'
3393 libs_mplayer="$libs_mplayer -framework IOKit -framework Cocoa"
3394 else
3395 def_apple_remote='#undef CONFIG_APPLE_REMOTE'
3397 echores "$_apple_remote"
3399 fi #if darwin
3401 if linux; then
3403 echocheck "Apple IR"
3404 if test "$_apple_ir" = auto ; then
3405 _apple_ir=no
3406 statement_check linux/input.h 'struct input_event ev; struct input_id id' && _apple_ir=yes
3408 if test "$_apple_ir" = yes ; then
3409 def_apple_ir='#define CONFIG_APPLE_IR 1'
3410 else
3411 def_apple_ir='#undef CONFIG_APPLE_IR'
3413 echores "$_apple_ir"
3414 fi #if linux
3416 echocheck "pkg-config"
3417 if $($_pkg_config --version > /dev/null 2>&1); then
3418 if test "$_ld_static"; then
3419 _pkg_config="$_pkg_config --static"
3421 echores "yes"
3422 else
3423 _pkg_config=false
3424 echores "no"
3428 echocheck "Samba support (libsmbclient)"
3429 if test "$_smb" = yes; then
3430 extra_ldflags="$extra_ldflags -lsmbclient"
3432 if test "$_smb" = auto; then
3433 _smb=no
3434 for _ld_tmp in "-lsmbclient" "-lsmbclient $_ld_dl" "-lsmbclient $_ld_dl -lnsl" "-lsmbclient $_ld_dl -lssl -lnsl" ; do
3435 statement_check libsmbclient.h 'smbc_opendir("smb://")' $_ld_tmp &&
3436 extra_ldflags="$extra_ldflags $_ld_tmp" && _smb=yes && break
3437 done
3440 if test "$_smb" = yes; then
3441 def_smb="#define CONFIG_LIBSMBCLIENT 1"
3442 inputmodules="smb $inputmodules"
3443 else
3444 def_smb="#undef CONFIG_LIBSMBCLIENT"
3445 noinputmodules="smb $noinputmodules"
3447 echores "$_smb"
3449 echocheck "libquvi support"
3450 if test "$_libquvi" = auto ; then
3451 _libquvi=no
3452 if pkg_config_add libquvi ; then
3453 _libquvi=yes
3456 if test "$_libquvi" = yes; then
3457 def_libquvi="#define CONFIG_LIBQUVI 1"
3458 else
3459 def_libquvi="#undef CONFIG_LIBQUVI"
3461 echores "$_libquvi"
3463 #########
3464 # VIDEO #
3465 #########
3468 echocheck "tga"
3469 if test "$_tga" = yes ; then
3470 def_tga='#define CONFIG_TGA 1'
3471 vomodules="tga $vomodules"
3472 else
3473 def_tga='#undef CONFIG_TGA'
3474 novomodules="tga $novomodules"
3476 echores "$_tga"
3479 echocheck "md5sum support"
3480 if test "$_md5sum" = yes; then
3481 def_md5sum="#define CONFIG_MD5SUM 1"
3482 vomodules="md5sum $vomodules"
3483 else
3484 def_md5sum="#undef CONFIG_MD5SUM"
3485 novomodules="md5sum $novomodules"
3487 echores "$_md5sum"
3490 echocheck "yuv4mpeg support"
3491 if test "$_yuv4mpeg" = yes; then
3492 def_yuv4mpeg="#define CONFIG_YUV4MPEG 1"
3493 vomodules="yuv4mpeg $vomodules"
3494 else
3495 def_yuv4mpeg="#undef CONFIG_YUV4MPEG"
3496 novomodules="yuv4mpeg $novomodules"
3498 echores "$_yuv4mpeg"
3501 echocheck "DirectFB"
3502 if test "$_directfb" = auto ; then
3503 _directfb=no
3504 cat > $TMPC << EOF
3505 #include <directfb.h>
3506 #include <directfb_version.h>
3507 #if (DIRECTFB_MAJOR_VERSION << 16 | DIRECTFB_MINOR_VERSION << 8 | DIRECTFB_MICRO_VERSION) < (0 << 16 | 9 << 8 | 22)
3508 #error "DirectFB version too old."
3509 #endif
3510 int main(void) { DirectFBInit(0, 0); return 0; }
3512 for _inc_tmp in "" -I/usr/local/include/directfb -I/usr/include/directfb -I/usr/local/include; do
3513 cc_check $_inc_tmp -ldirectfb &&
3514 _directfb=yes && extra_cflags="$extra_cflags $_inc_tmp" && break
3515 done
3517 if test "$_directfb" = yes ; then
3518 def_directfb='#define CONFIG_DIRECTFB 1'
3519 vomodules="directfb $vomodules"
3520 libs_mplayer="$libs_mplayer -ldirectfb"
3521 else
3522 def_directfb='#undef CONFIG_DIRECTFB'
3523 novomodules="directfb $novomodules"
3525 echores "$_directfb"
3528 if darwin; then
3530 echocheck "QuickTime"
3531 if test "$quicktime" = auto ; then
3532 quicktime=no
3533 statement_check QuickTime/QuickTime.h 'ImageDescription *desc; EnterMovies(); ExitMovies()' -framework QuickTime && quicktime=yes
3535 if test "$quicktime" = yes ; then
3536 extra_ldflags="$extra_ldflags -framework QuickTime"
3537 def_quicktime='#define CONFIG_QUICKTIME 1'
3538 else
3539 def_quicktime='#undef CONFIG_QUICKTIME'
3541 echores $quicktime
3543 echocheck "Cocoa"
3544 if test "$_cocoa" = auto ; then
3545 cat > $TMPC <<EOF
3546 #include <CoreServices/CoreServices.h>
3547 #include <OpenGL/OpenGL.h>
3548 int main(void) {
3549 NSApplicationLoad();
3552 _cocoa=no
3553 cc_check -framework Cocoa -framework OpenGL && _cocoa=yes
3555 if test "$_cocoa" = yes ; then
3556 libs_mplayer="$libs_mplayer -framework Cocoa -framework OpenGL"
3557 def_cocoa='#define CONFIG_COCOA 1'
3558 else
3559 def_cocoa='#undef CONFIG_COCOA'
3561 echores "$_cocoa"
3563 echocheck "CoreVideo"
3564 if test "$_cocoa" = yes && test "$_corevideo" = auto ; then
3565 cat > $TMPC <<EOF
3566 #include <QuartzCore/CoreVideo.h>
3567 int main(void) { return 0; }
3569 _corevideo=no
3570 cc_check -framework Cocoa -framework QuartzCore -framework OpenGL && _corevideo=yes
3572 if test "$_corevideo" = yes ; then
3573 vomodules="corevideo $vomodules"
3574 libs_mplayer="$libs_mplayer -framework QuartzCore"
3575 def_corevideo='#define CONFIG_COREVIDEO 1'
3576 else
3577 novomodules="corevideo $novomodules"
3578 def_corevideo='#undef CONFIG_COREVIDEO'
3580 echores "$_corevideo"
3582 echocheck "SharedBuffer"
3583 if test "$_sharedbuffer" = auto ; then
3584 cat > $TMPC <<EOF
3585 int main(void) {
3586 NSApplicationLoad();
3589 _sharedbuffer=no
3590 cc_check -framework Cocoa && _sharedbuffer=yes
3592 if test "$_sharedbuffer" = yes ; then
3593 vomodules="sharedbuffer $vomodules"
3594 libs_mplayer="$libs_mplayer -framework Cocoa"
3595 def_sharedbuffer='#define CONFIG_SHAREDBUFFER 1'
3596 else
3597 novomodules="sharedbuffer $novomodules"
3598 def_sharedbuffer='#undef CONFIG_SHAREDBUFFER'
3600 echores "$_sharedbuffer"
3602 depends_on_application_services(){
3603 test "$_corevideo" = yes
3606 fi #if darwin
3609 echocheck "X11 headers presence"
3610 _x11_headers="no"
3611 res_comment="check if the dev(el) packages are installed"
3612 for I in $(echo $extra_cflags | sed s/-I//g) /usr/include ; do
3613 if test -f "$I/X11/Xlib.h" ; then
3614 _x11_headers="yes"
3615 res_comment=""
3616 break
3618 done
3619 if test $_cross_compile = no; then
3620 for I in /usr/X11/include /usr/X11R7/include /usr/local/include /usr/X11R6/include \
3621 /usr/include/X11R6 /usr/openwin/include ; do
3622 if test -f "$I/X11/Xlib.h" ; then
3623 extra_cflags="$extra_cflags -I$I"
3624 _x11_headers="yes"
3625 res_comment="using $I"
3626 break
3628 done
3630 echores "$_x11_headers"
3633 echocheck "X11"
3634 if test "$_x11" = auto && test "$_x11_headers" = yes ; then
3635 for I in "" -L/usr/X11R7/lib -L/usr/local/lib -L/usr/X11R6/lib -L/usr/lib/X11R6 \
3636 -L/usr/X11/lib -L/usr/lib32 -L/usr/openwin/lib -L/usr/local/lib64 -L/usr/X11R6/lib64 \
3637 -L/usr/lib ; do
3638 if netbsd; then
3639 _ld_tmp="$I -lXext -lX11 $_ld_pthread -Wl,-R$(echo $I | sed s/^-L//)"
3640 else
3641 _ld_tmp="$I -lXext -lX11 $_ld_pthread"
3643 statement_check X11/Xutil.h 'XCreateWindow(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)' $_ld_tmp &&
3644 _x11=yes
3645 # Check that there aren't conflicting headers between ApplicationServices
3646 # and X11. On versions of Mac OSX prior to 10.7 the deprecated QuickDraw API
3647 # is included by -framework ApplicationServices and clashes with the X11
3648 # definition of the "Cursor" type.
3649 if darwin && depends_on_application_services && test "$_x11" = yes ; then
3650 _x11=no
3651 header_check_broken ApplicationServices/ApplicationServices.h \
3652 X11/Xutil.h $_ld_tmp && _x11=yes
3654 if test "$_x11" = yes ; then
3655 libs_mplayer="$libs_mplayer $_ld_tmp"
3656 break
3658 done
3660 if test "$_x11" = yes ; then
3661 def_x11='#define CONFIG_X11 1'
3662 vomodules="x11 $vomodules"
3663 else
3664 _x11=no
3665 def_x11='#undef CONFIG_X11'
3666 novomodules="x11 $novomodules"
3667 res_comment="check if the dev(el) packages are installed"
3669 echores "$_x11"
3671 echocheck "Xss screensaver extensions"
3672 if test "$_xss" = auto ; then
3673 _xss=no
3674 statement_check "X11/extensions/scrnsaver.h" 'XScreenSaverSuspend(NULL, True)' -lXss && _xss=yes
3676 if test "$_xss" = yes ; then
3677 def_xss='#define CONFIG_XSS 1'
3678 libs_mplayer="$libs_mplayer -lXss"
3679 else
3680 def_xss='#undef CONFIG_XSS'
3682 echores "$_xss"
3684 echocheck "DPMS"
3685 _xdpms3=no
3686 _xdpms4=no
3687 if test "$_x11" = yes ; then
3688 cat > $TMPC <<EOF
3689 #include <X11/Xmd.h>
3690 #include <X11/Xlib.h>
3691 #include <X11/Xutil.h>
3692 #include <X11/Xatom.h>
3693 #include <X11/extensions/dpms.h>
3694 int main(void) { DPMSQueryExtension(0, 0, 0); return 0; }
3696 cc_check -lXdpms && _xdpms3=yes
3697 statement_check_broken X11/Xlib.h X11/extensions/dpms.h 'DPMSQueryExtension(0, 0, 0)' -lXext && _xdpms4=yes
3699 if test "$_xdpms4" = yes ; then
3700 def_xdpms='#define CONFIG_XDPMS 1'
3701 res_comment="using Xdpms 4"
3702 echores "yes"
3703 elif test "$_xdpms3" = yes ; then
3704 def_xdpms='#define CONFIG_XDPMS 1'
3705 libs_mplayer="$libs_mplayer -lXdpms"
3706 res_comment="using Xdpms 3"
3707 echores "yes"
3708 else
3709 def_xdpms='#undef CONFIG_XDPMS'
3710 echores "no"
3714 echocheck "Xv"
3715 if test "$_xv" = auto && test "$_x11" = yes ; then
3716 _xv=no
3717 statement_check_broken X11/Xlib.h X11/extensions/Xvlib.h 'XvGetPortAttribute(0, 0, 0, 0)' -lXv && _xv=yes
3720 if test "$_xv" = yes ; then
3721 def_xv='#define CONFIG_XV 1'
3722 libs_mplayer="$libs_mplayer -lXv"
3723 vomodules="xv $vomodules"
3724 else
3725 def_xv='#undef CONFIG_XV'
3726 novomodules="xv $novomodules"
3728 echores "$_xv"
3731 echocheck "VDPAU"
3732 if test "$_vdpau" = auto && test "$_x11" = yes ; then
3733 _vdpau=no
3734 if test "$_dl" = yes ; then
3735 pkg_config_add 'vdpau >= 0.2' && _vdpau=yes
3738 if test "$_vdpau" = yes ; then
3739 def_vdpau='#define CONFIG_VDPAU 1'
3740 vomodules="vdpau $vomodules"
3741 else
3742 def_vdpau='#define CONFIG_VDPAU 0'
3743 novomodules="vdpau $novomodules"
3745 echores "$_vdpau"
3748 echocheck "Xinerama"
3749 if test "$_xinerama" = auto && test "$_x11" = yes ; then
3750 _xinerama=no
3751 statement_check X11/extensions/Xinerama.h 'XineramaIsActive(0)' -lXinerama && _xinerama=yes
3754 if test "$_xinerama" = yes ; then
3755 def_xinerama='#define CONFIG_XINERAMA 1'
3756 libs_mplayer="$libs_mplayer -lXinerama"
3757 else
3758 def_xinerama='#undef CONFIG_XINERAMA'
3760 echores "$_xinerama"
3763 # Note: the -lXxf86vm library is the VideoMode extension and though it's not
3764 # needed for DGA, AFAIK every distribution packages together with DGA stuffs
3765 # named 'X extensions' or something similar.
3766 # This check may be useful for future mplayer versions (to change resolution)
3767 # If you run into problems, remove '-lXxf86vm'.
3768 echocheck "Xxf86vm"
3769 if test "$_vm" = auto && test "$_x11" = yes ; then
3770 _vm=no
3771 statement_check_broken X11/Xlib.h X11/extensions/xf86vmode.h 'XF86VidModeQueryExtension(0, 0, 0)' -lXxf86vm && _vm=yes
3773 if test "$_vm" = yes ; then
3774 def_vm='#define CONFIG_XF86VM 1'
3775 libs_mplayer="$libs_mplayer -lXxf86vm"
3776 else
3777 def_vm='#undef CONFIG_XF86VM'
3779 echores "$_vm"
3781 # Check for the presence of special keycodes, like audio control buttons
3782 # that XFree86 might have. Used to be bundled with the xf86vm check, but
3783 # has nothing to do with xf86vm and XFree 3.x has xf86vm but does NOT
3784 # have these new keycodes.
3785 echocheck "XF86keysym"
3786 if test "$_xf86keysym" = auto && test "$_x11" = yes ; then
3787 _xf86keysym=no
3788 return_check X11/XF86keysym.h XF86XK_AudioPause && _xf86keysym=yes
3790 if test "$_xf86keysym" = yes ; then
3791 def_xf86keysym='#define CONFIG_XF86XK 1'
3792 else
3793 def_xf86keysym='#undef CONFIG_XF86XK'
3795 echores "$_xf86keysym"
3798 echocheck "CACA"
3799 if test "$_caca" = auto ; then
3800 _caca=no
3801 if ( caca-config --version ) >> "$TMPLOG" 2>&1 ; then
3802 cat > $TMPC << EOF
3803 #include <caca.h>
3804 #ifdef CACA_API_VERSION_1
3805 #include <caca0.h>
3806 #endif
3807 int main(void) { caca_init(); return 0; }
3809 cc_check $(caca-config --libs) && _caca=yes
3812 if test "$_caca" = yes ; then
3813 def_caca='#define CONFIG_CACA 1'
3814 extra_cflags="$extra_cflags $(caca-config --cflags)"
3815 libs_mplayer="$libs_mplayer $(caca-config --libs)"
3816 vomodules="caca $vomodules"
3817 else
3818 def_caca='#undef CONFIG_CACA'
3819 novomodules="caca $novomodules"
3821 echores "$_caca"
3824 echocheck "DVB"
3825 if test "$_dvb" = auto ; then
3826 _dvb=no
3827 cat >$TMPC << EOF
3828 #include <poll.h>
3829 #include <sys/ioctl.h>
3830 #include <stdio.h>
3831 #include <time.h>
3832 #include <unistd.h>
3833 #include <linux/dvb/dmx.h>
3834 #include <linux/dvb/frontend.h>
3835 #include <linux/dvb/video.h>
3836 #include <linux/dvb/audio.h>
3837 int main(void) {return 0;}
3839 for _inc_tmp in "" "-I/usr/src/DVB/include" ; do
3840 cc_check $_inc_tmp && _dvb=yes &&
3841 extra_cflags="$extra_cflags $_inc_tmp" && break
3842 done
3844 echores "$_dvb"
3845 if test "$_dvb" = yes ; then
3846 _dvbin=yes
3847 inputmodules="dvb $inputmodules"
3848 def_dvbin='#define CONFIG_DVBIN 1'
3849 else
3850 _dvbin=no
3851 noinputmodules="dvb $noinputmodules"
3852 def_dvbin='#undef CONFIG_DVBIN '
3856 echocheck "PNG support"
3857 if test "$_png" = auto ; then
3858 _png=no
3859 cat > $TMPC << EOF
3860 #include <stdio.h>
3861 #include <string.h>
3862 #include <png.h>
3863 int main(void) {
3864 printf("png.h : %s\n", PNG_LIBPNG_VER_STRING);
3865 printf("libpng: %s\n", png_libpng_ver);
3866 return strcmp(PNG_LIBPNG_VER_STRING, png_libpng_ver);
3869 cc_check -lpng -lz $_ld_lm && _png=yes
3871 echores "$_png"
3872 if test "$_png" = yes ; then
3873 def_png='#define CONFIG_PNG 1'
3874 extra_ldflags="$extra_ldflags -lpng -lz"
3875 else
3876 def_png='#undef CONFIG_PNG'
3879 echocheck "MNG support"
3880 if test "$_mng" = auto ; then
3881 _mng=no
3882 return_statement_check libmng.h 'const char * p_ver = mng_version_text()' '!p_ver || p_ver[0] == 0' -lmng -lz $_ld_lm && _mng=yes
3884 echores "$_mng"
3885 if test "$_mng" = yes ; then
3886 def_mng='#define CONFIG_MNG 1'
3887 extra_ldflags="$extra_ldflags -lmng -lz"
3888 else
3889 def_mng='#undef CONFIG_MNG'
3892 echocheck "JPEG support"
3893 if test "$_jpeg" = auto ; then
3894 _jpeg=no
3895 header_check_broken stdio.h jpeglib.h -ljpeg $_ld_lm && _jpeg=yes
3897 echores "$_jpeg"
3899 if test "$_jpeg" = yes ; then
3900 def_jpeg='#define CONFIG_JPEG 1'
3901 vomodules="jpeg $vomodules"
3902 extra_ldflags="$extra_ldflags -ljpeg"
3903 else
3904 def_jpeg='#undef CONFIG_JPEG'
3905 novomodules="jpeg $novomodules"
3910 echocheck "PNM support"
3911 if test "$_pnm" = yes; then
3912 def_pnm="#define CONFIG_PNM 1"
3913 vomodules="pnm $vomodules"
3914 else
3915 def_pnm="#undef CONFIG_PNM"
3916 novomodules="pnm $novomodules"
3918 echores "$_pnm"
3922 echocheck "GIF support"
3923 # This is to appease people who want to force gif support.
3924 # If it is forced to yes, then we still do checks to determine
3925 # which gif library to use.
3926 if test "$_gif" = yes ; then
3927 _force_gif=yes
3928 _gif=auto
3931 if test "$_gif" = auto ; then
3932 _gif=no
3933 for _ld_gif in "-lungif" "-lgif" ; do
3934 statement_check gif_lib.h 'QuantizeBuffer(0, 0, 0, 0, 0, 0, 0, 0)' $_ld_gif && _gif=yes && break
3935 done
3938 # If no library was found, and the user wants support forced,
3939 # then we force it on with libgif, as this is the safest
3940 # assumption IMHO. (libungif & libregif both create symbolic
3941 # links to libgif. We also assume that no x11 support is needed,
3942 # because if you are forcing this, then you _should_ know what
3943 # you are doing. [ Besides, package maintainers should never
3944 # have compiled x11 deps into libungif in the first place. ] )
3945 # </rant>
3946 # --Joey
3947 if test "$_force_gif" = yes && test "$_gif" = no ; then
3948 _gif=yes
3949 _ld_gif="-lgif"
3952 if test "$_gif" = yes ; then
3953 def_gif='#define CONFIG_GIF 1'
3954 codecmodules="gif $codecmodules"
3955 vomodules="gif89a $vomodules"
3956 res_comment="old version, some encoding functions disabled"
3957 def_gif_4='#undef CONFIG_GIF_4'
3958 extra_ldflags="$extra_ldflags $_ld_gif"
3960 cat > $TMPC << EOF
3961 #include <signal.h>
3962 #include <stdio.h>
3963 #include <stdlib.h>
3964 #include <gif_lib.h>
3965 static void catch(int sig) { exit(1); }
3966 int main(void) {
3967 signal(SIGSEGV, catch); // catch segfault
3968 printf("EGifPutExtensionFirst is at address %p\n", EGifPutExtensionFirst);
3969 EGifSetGifVersion("89a"); // this will segfault a buggy gif lib.
3970 return 0;
3973 if cc_check "$_ld_gif" ; then
3974 def_gif_4='#define CONFIG_GIF_4 1'
3975 res_comment=""
3977 else
3978 def_gif='#undef CONFIG_GIF'
3979 def_gif_4='#undef CONFIG_GIF_4'
3980 novomodules="gif89a $novomodules"
3981 nocodecmodules="gif $nocodecmodules"
3983 echores "$_gif"
3986 case "$_gif" in yes*)
3987 echocheck "broken giflib workaround"
3988 def_gif_tvt_hack='#define CONFIG_GIF_TVT_HACK 1'
3990 cat > $TMPC << EOF
3991 #include <stdio.h>
3992 #include <gif_lib.h>
3993 int main(void) {
3994 GifFileType gif = {.UserData = NULL};
3995 printf("UserData is at address %p\n", gif.UserData);
3996 return 0;
3999 if cc_check "$_ld_gif" ; then
4000 def_gif_tvt_hack='#undef CONFIG_GIF_TVT_HACK'
4001 echores "disabled"
4002 else
4003 echores "enabled"
4006 esac
4009 #################
4010 # VIDEO + AUDIO #
4011 #################
4014 echocheck "SDL"
4015 _inc_tmp=""
4016 _ld_tmp=""
4017 def_sdl_sdl_h="#undef CONFIG_SDL_SDL_H"
4018 if test -z "$_sdlconfig" ; then
4019 if ( sdl-config --version ) >>"$TMPLOG" 2>&1 ; then
4020 _sdlconfig="sdl-config"
4021 elif ( sdl11-config --version ) >>"$TMPLOG" 2>&1 ; then
4022 _sdlconfig="sdl11-config"
4023 else
4024 _sdlconfig=false
4027 if test "$_sdl" = auto || test "$_sdl" = yes ; then
4028 cat > $TMPC << EOF
4029 #ifdef CONFIG_SDL_SDL_H
4030 #include <SDL/SDL.h>
4031 #else
4032 #include <SDL.h>
4033 #endif
4034 #ifndef __APPLE__
4035 // we allow SDL hacking our main() only on OSX
4036 #undef main
4037 #endif
4038 int main(int argc, char *argv[]) {
4039 SDL_Init(SDL_INIT_VIDEO|SDL_INIT_NOPARACHUTE);
4040 return 0;
4043 _sdl=no
4044 for _ld_tmp in "-lSDL" "-lSDL -lpthread" "-lSDL -lwinmm -lgdi32" "-lSDL -lwinmm -lgdi32 -ldxguid" ; do
4045 if cc_check -DCONFIG_SDL_SDL_H $_inc_tmp $_ld_tmp ; then
4046 _sdl=yes
4047 def_sdl_sdl_h="#define CONFIG_SDL_SDL_H 1"
4048 break
4050 done
4051 if test "$_sdl" = no && "$_sdlconfig" --version >>"$TMPLOG" 2>&1 ; then
4052 res_comment="using $_sdlconfig"
4053 if cygwin ; then
4054 _inc_tmp="$($_sdlconfig --cflags | cut -d " " -f 1,5,6 | sed s/no-cygwin/cygwin/)"
4055 _ld_tmp="$($_sdlconfig --libs | cut -d " " -f 1,4,6 | sed s/no-cygwin/cygwin/)"
4056 elif mingw32 ; then
4057 _inc_tmp=$($_sdlconfig --cflags | sed s/-Dmain=SDL_main//)
4058 _ld_tmp=$($_sdlconfig --libs | sed -e s/-mwindows// -e s/-lmingw32//)
4059 else
4060 _inc_tmp="$($_sdlconfig --cflags)"
4061 _ld_tmp="$($_sdlconfig --libs)"
4063 if cc_check $_inc_tmp $_ld_tmp >>"$TMPLOG" 2>&1 ; then
4064 _sdl=yes
4065 elif cc_check $_inc_tmp $_ld_tmp -lstdc++ >>"$TMPLOG" 2>&1 ; then
4066 # HACK for BeOS/Haiku SDL
4067 _ld_tmp="$_ld_tmp -lstdc++"
4068 _sdl=yes
4072 if test "$_sdl" = yes ; then
4073 def_sdl='#define CONFIG_SDL 1'
4074 extra_cflags="$extra_cflags $_inc_tmp"
4075 libs_mplayer="$libs_mplayer $_ld_tmp"
4076 vomodules="sdl $vomodules"
4077 aomodules="sdl $aomodules"
4078 else
4079 def_sdl='#undef CONFIG_SDL'
4080 novomodules="sdl $novomodules"
4081 noaomodules="sdl $noaomodules"
4083 echores "$_sdl"
4086 # make sure this stays below CoreVideo to avoid issues due to namespace
4087 # conflicts between -lGL and -framework OpenGL
4088 echocheck "OpenGL"
4089 #Note: this test is run even with --enable-gl since we autodetect linker flags
4090 if (test "$_x11" = yes || test "$_sdl" = yes || test "$_cocoa" = yes || win32) && test "$_gl" != no ; then
4091 cat > $TMPC << EOF
4092 #ifdef GL_WIN32
4093 #include <windows.h>
4094 #include <GL/gl.h>
4095 #elif defined(GL_SDL)
4096 #include <GL/gl.h>
4097 #ifdef CONFIG_SDL_SDL_H
4098 #include <SDL/SDL.h>
4099 #else
4100 #include <SDL.h>
4101 #endif
4102 #ifndef __APPLE__
4103 // we allow SDL hacking our main() only on OSX
4104 #undef main
4105 #endif
4106 #else
4107 #include <GL/gl.h>
4108 #include <X11/Xlib.h>
4109 #include <GL/glx.h>
4110 #endif
4111 int main(int argc, char *argv[]) {
4112 #ifdef GL_WIN32
4113 HDC dc;
4114 wglCreateContext(dc);
4115 #elif defined(GL_SDL)
4116 SDL_GL_SwapBuffers();
4117 #else
4118 glXCreateContext(NULL, NULL, NULL, True);
4119 #endif
4120 glFinish();
4121 return 0;
4124 _gl=no
4125 if test "$_x11" = yes ; then
4126 for _ld_tmp in "" -lGL "-lGL -lXdamage" "-lGL $_ld_pthread" ; do
4127 if cc_check $_ld_tmp $_ld_lm ; then
4128 _gl=yes
4129 _gl_x11=yes
4130 libs_mplayer="$libs_mplayer $_ld_tmp $_ld_dl"
4131 break
4133 done
4135 if win32 && cc_check -DGL_WIN32 -lopengl32 ; then
4136 _gl=yes
4137 _gl_win32=yes
4138 libs_mplayer="$libs_mplayer -lopengl32 -lgdi32"
4140 if test "$_cocoa" = yes ; then
4141 _gl=yes
4142 _gl_cocoa=yes
4144 # last so it can reuse any linker etc. flags detected before
4145 if test "$_sdl" = yes ; then
4146 if cc_check -DGL_SDL ||
4147 cc_check -DCONFIG_SDL_SDL_H -DGL_SDL ; then
4148 _gl=yes
4149 _gl_sdl=yes
4150 elif cc_check -DGL_SDL -lGL ||
4151 cc_check -DCONFIG_SDL_SDL_H -DGL_SDL -lGL ; then
4152 _gl=yes
4153 _gl_sdl=yes
4154 libs_mplayer="$libs_mplayer -lGL"
4157 else
4158 _gl=no
4160 if test "$_gl" = yes ; then
4161 def_gl='#define CONFIG_GL 1'
4162 res_comment="backends:"
4163 if test "$_gl_cocoa" = yes ; then
4164 def_gl_cocoa='#define CONFIG_GL_COCOA 1'
4165 res_comment="$res_comment cocoa"
4167 if test "$_gl_win32" = yes ; then
4168 def_gl_win32='#define CONFIG_GL_WIN32 1'
4169 res_comment="$res_comment win32"
4171 if test "$_gl_x11" = yes ; then
4172 def_gl_x11='#define CONFIG_GL_X11 1'
4173 res_comment="$res_comment x11"
4175 if test "$_gl_sdl" = yes ; then
4176 def_gl_sdl='#define CONFIG_GL_SDL 1'
4177 res_comment="$res_comment sdl"
4179 vomodules="opengl $vomodules"
4180 else
4181 def_gl='#undef CONFIG_GL'
4182 def_gl_cocoa='#undef CONFIG_GL_COCOA'
4183 def_gl_win32='#undef CONFIG_GL_WIN32'
4184 def_gl_x11='#undef CONFIG_GL_X11'
4185 def_gl_sdl='#undef CONFIG_GL_SDL'
4186 novomodules="opengl $novomodules"
4188 echores "$_gl"
4191 if win32; then
4193 echocheck "Direct3D"
4194 if test "$_direct3d" = auto ; then
4195 _direct3d=no
4196 header_check d3d9.h && _direct3d=yes
4198 if test "$_direct3d" = yes ; then
4199 def_direct3d='#define CONFIG_DIRECT3D 1'
4200 vomodules="direct3d $vomodules"
4201 else
4202 def_direct3d='#undef CONFIG_DIRECT3D'
4203 novomodules="direct3d $novomodules"
4205 echores "$_direct3d"
4207 echocheck "Directx"
4208 if test "$_directx" = auto ; then
4209 cat > $TMPC << EOF
4210 #include <ddraw.h>
4211 #include <dsound.h>
4212 int main(void) { return 0; }
4214 _directx=no
4215 cc_check -lgdi32 && _directx=yes
4217 if test "$_directx" = yes ; then
4218 def_directx='#define CONFIG_DIRECTX 1'
4219 libs_mplayer="$libs_mplayer -lgdi32"
4220 vomodules="directx $vomodules"
4221 aomodules="dsound $aomodules"
4222 else
4223 def_directx='#undef CONFIG_DIRECTX'
4224 novomodules="directx $novomodules"
4225 noaomodules="dsound $noaomodules"
4227 echores "$_directx"
4229 fi #if win32; then
4232 echocheck "V4L2 MPEG Decoder"
4233 if test "$_v4l2" = auto ; then
4234 cat > $TMPC << EOF
4235 #include <sys/time.h>
4236 #include <linux/videodev2.h>
4237 #include <linux/version.h>
4238 int main(void) {
4239 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22)
4240 #error kernel headers too old, need 2.6.22
4241 #endif
4242 struct v4l2_ext_controls ctrls;
4243 ctrls.ctrl_class = V4L2_CTRL_CLASS_MPEG;
4244 return 0;
4247 _v4l2=no
4248 cc_check && _v4l2=yes
4250 if test "$_v4l2" = yes ; then
4251 def_v4l2='#define CONFIG_V4L2_DECODER 1'
4252 vomodules="v4l2 $vomodules"
4253 aomodules="v4l2 $aomodules"
4254 else
4255 def_v4l2='#undef CONFIG_V4L2_DECODER'
4256 novomodules="v4l2 $novomodules"
4257 noaomodules="v4l2 $noaomodules"
4259 echores "$_v4l2"
4263 #########
4264 # AUDIO #
4265 #########
4268 echocheck "OSS Audio"
4269 if test "$_ossaudio" = auto ; then
4270 _ossaudio=no
4271 return_check $_soundcard_header SNDCTL_DSP_SETFRAGMENT && _ossaudio=yes
4273 if test "$_ossaudio" = yes ; then
4274 def_ossaudio='#define CONFIG_OSS_AUDIO 1'
4275 aomodules="oss $aomodules"
4276 cat > $TMPC << EOF
4277 #include <$_soundcard_header>
4278 #ifdef OPEN_SOUND_SYSTEM
4279 int main(void) { return 0; }
4280 #else
4281 #error Not the real thing
4282 #endif
4284 _real_ossaudio=no
4285 cc_check && _real_ossaudio=yes
4286 if test "$_real_ossaudio" = yes; then
4287 def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/dsp"'
4288 # Check for OSS4 headers (override default headers)
4289 # Does not apply to systems where OSS4 is native (e.g. FreeBSD)
4290 if test -f /etc/oss.conf; then
4291 . /etc/oss.conf
4292 _ossinc="$OSSLIBDIR/include"
4293 if test -f "$_ossinc/sys/soundcard.h"; then
4294 extra_cflags="-I$_ossinc $extra_cflags"
4297 elif netbsd || openbsd ; then
4298 def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/sound"'
4299 extra_ldflags="$extra_ldflags -lossaudio"
4300 else
4301 def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/dsp"'
4303 def_ossaudio_devmixer='#define PATH_DEV_MIXER "/dev/mixer"'
4304 else
4305 def_ossaudio='#undef CONFIG_OSS_AUDIO'
4306 def_ossaudio_devdsp='#define PATH_DEV_DSP ""'
4307 def_ossaudio_devmixer='#define PATH_DEV_MIXER ""'
4308 noaomodules="oss $noaomodules"
4310 echores "$_ossaudio"
4313 echocheck "RSound"
4314 if test "$_rsound" = auto ; then
4315 _rsound=no
4316 statement_check rsound.h 'rsd_init(NULL);' -lrsound && _rsound=yes
4318 echores "$_rsound"
4320 if test "$_rsound" = yes ; then
4321 def_rsound='#define CONFIG_RSOUND 1'
4322 aomodules="rsound $aomodules"
4323 libs_mplayer="$libs_mplayer -lrsound"
4324 else
4325 def_rsound='#undef CONFIG_RSOUND'
4326 noaomodules="rsound $noaomodules"
4330 echocheck "pulse"
4331 if test "$_pulse" = auto ; then
4332 _pulse=no
4333 if pkg_config_add 'libpulse >= 0.9' ; then
4334 _pulse=yes
4337 echores "$_pulse"
4339 if test "$_pulse" = yes ; then
4340 def_pulse='#define CONFIG_PULSE 1'
4341 aomodules="pulse $aomodules"
4342 else
4343 def_pulse='#undef CONFIG_PULSE'
4344 noaomodules="pulse $noaomodules"
4348 echocheck "PortAudio"
4349 if test "$_portaudio" = auto && test "$_pthreads" != yes ; then
4350 _portaudio=no
4351 res_comment="pthreads not enabled"
4353 if test "$_portaudio" = auto ; then
4354 _portaudio=no
4355 if pkg_config_add 'portaudio-2.0 >= 19' ; then
4356 _portaudio=yes
4359 echores "$_portaudio"
4361 if test "$_portaudio" = yes ; then
4362 def_portaudio='#define CONFIG_PORTAUDIO 1'
4363 aomodules="portaudio $aomodules"
4364 else
4365 def_portaudio='#undef CONFIG_PORTAUDIO'
4366 noaomodules="portaudio $noaomodules"
4370 echocheck "JACK"
4371 if test "$_jack" = auto ; then
4372 _jack=no
4373 if pkg_config_add jack ; then
4374 _jack=yes
4378 if test "$_jack" = yes ; then
4379 def_jack='#define CONFIG_JACK 1'
4380 aomodules="jack $aomodules"
4381 else
4382 noaomodules="jack $noaomodules"
4384 echores "$_jack"
4386 echocheck "OpenAL"
4387 if test "$_openal" = auto ; then
4388 _openal=no
4389 cat > $TMPC << EOF
4390 #ifdef OPENAL_AL_H
4391 #include <OpenAL/al.h>
4392 #else
4393 #include <AL/al.h>
4394 #endif
4395 int main(void) {
4396 alSourceQueueBuffers(0, 0, 0);
4397 // alGetSourcei(0, AL_SAMPLE_OFFSET, 0);
4398 return 0;
4401 for I in "-lopenal" "-lopenal32" "-framework OpenAL" ; do
4402 cc_check $I && _openal=yes && break
4403 cc_check -DOPENAL_AL_H=1 $I && def_openal_h='#define OPENAL_AL_H 1' && _openal=yes && break
4404 done
4405 test "$_openal" = yes && libs_mplayer="$libs_mplayer $I"
4407 if test "$_openal" = yes ; then
4408 def_openal='#define CONFIG_OPENAL 1'
4409 aomodules="openal $aomodules"
4410 else
4411 noaomodules="openal $noaomodules"
4413 echores "$_openal"
4415 echocheck "ALSA audio"
4416 if test "$_alloca" != yes ; then
4417 _alsa=no
4418 res_comment="alloca missing"
4420 if test "$_alsa" = auto ; then
4421 _alsa=no
4422 if pkg_config_add "alsa >= 1.0.9" ; then
4423 _alsa=yes
4426 def_alsa='#undef CONFIG_ALSA'
4427 if test "$_alsa" = yes ; then
4428 aomodules="alsa $aomodules"
4429 def_alsa='#define CONFIG_ALSA 1'
4430 else
4431 noaomodules="alsa $noaomodules"
4433 echores "$_alsa"
4436 if darwin; then
4437 echocheck "CoreAudio"
4438 if test "$_coreaudio" = auto ; then
4439 cat > $TMPC <<EOF
4440 #include <CoreAudio/CoreAudio.h>
4441 #include <AudioToolbox/AudioToolbox.h>
4442 #include <AudioUnit/AudioUnit.h>
4443 int main(void) { return 0; }
4445 _coreaudio=no
4446 cc_check -framework CoreAudio -framework AudioUnit -framework AudioToolbox && _coreaudio=yes
4448 if test "$_coreaudio" = yes ; then
4449 libs_mplayer="$libs_mplayer -framework CoreAudio -framework AudioUnit -framework AudioToolbox"
4450 def_coreaudio='#define CONFIG_COREAUDIO 1'
4451 aomodules="coreaudio $aomodules"
4452 else
4453 def_coreaudio='#undef CONFIG_COREAUDIO'
4454 noaomodules="coreaudio $noaomodules"
4456 echores $_coreaudio
4457 fi #if darwin
4460 # set default CD/DVD devices
4461 if win32 ; then
4462 default_cdrom_device="D:"
4463 elif darwin ; then
4464 default_cdrom_device="/dev/disk1"
4465 elif dragonfly ; then
4466 default_cdrom_device="/dev/cd0"
4467 elif freebsd ; then
4468 default_cdrom_device="/dev/acd0"
4469 elif openbsd ; then
4470 default_cdrom_device="/dev/rcd0c"
4471 elif amigaos ; then
4472 default_cdrom_device="a1ide.device:2"
4473 else
4474 default_cdrom_device="/dev/cdrom"
4477 if win32 || dragonfly || freebsd || openbsd || amigaos ; then
4478 default_dvd_device=$default_cdrom_device
4479 elif darwin ; then
4480 default_dvd_device="/dev/rdiskN"
4481 else
4482 default_dvd_device="/dev/dvd"
4486 echocheck "VCD support"
4487 if test "$_vcd" = auto; then
4488 _vcd=no
4489 if linux || freebsd || netbsd || openbsd || dragonfly || bsdos || darwin ; then
4490 _vcd=yes
4491 elif mingw32; then
4492 header_check ddk/ntddcdrm.h && _vcd=yes
4495 if test "$_vcd" = yes; then
4496 inputmodules="vcd $inputmodules"
4497 def_vcd='#define CONFIG_VCD 1'
4498 else
4499 def_vcd='#undef CONFIG_VCD'
4500 noinputmodules="vcd $noinputmodules"
4501 res_comment="not supported on this OS"
4503 echores "$_vcd"
4507 echocheck "Blu-ray support"
4508 if test "$_bluray" = auto ; then
4509 _bluray=no
4510 pkg_config_add 'libbluray >= 0.2.1' && _bluray=yes
4512 if test "$_bluray" = yes ; then
4513 def_bluray='#define CONFIG_LIBBLURAY 1'
4514 inputmodules="bluray $inputmodules"
4515 else
4516 def_bluray='#undef CONFIG_LIBBLURAY'
4517 noinputmodules="bluray $noinputmodules"
4519 echores "$_bluray"
4521 echocheck "dvdread"
4522 if test "$_dvdread_internal" = auto && test ! -f "libdvdread4/dvd_reader.c" ; then
4523 _dvdread_internal=no
4525 if test "$_dvdread_internal" = auto ; then
4526 _dvdread_internal=no
4527 _dvdread=no
4528 if (linux || freebsd || netbsd || openbsd || dragonfly || hpux) &&
4529 (test "$_dvd" = yes || test "$_cdrom" = yes || test "$_cdio" = yes ||
4530 test "$_dvdio" = yes || test "$_bsdi_dvd" = yes) ||
4531 darwin || win32; then
4532 _dvdread_internal=yes
4533 _dvdread=yes
4534 extra_cflags="-Ilibdvdread4 $extra_cflags"
4536 elif test "$_dvdread" = auto ; then
4537 _dvdread=no
4538 if test "$_dl" = yes; then
4539 _dvdreadcflags=$($_dvdreadconfig --cflags 2> /dev/null)
4540 _dvdreadlibs=$($_dvdreadconfig --libs 2> /dev/null)
4541 if header_check dvdread/dvd_reader.h $_dvdreadcflags $_dvdreadlibs $_ld_dl ; then
4542 _dvdread=yes
4543 extra_cflags="$extra_cflags $_dvdreadcflags"
4544 extra_ldflags="$extra_ldflags $_dvdreadlibs"
4545 res_comment="external"
4550 if test "$_dvdread_internal" = yes; then
4551 def_dvdread='#define CONFIG_DVDREAD 1'
4552 inputmodules="dvdread(internal) $inputmodules"
4553 res_comment="internal"
4554 elif test "$_dvdread" = yes; then
4555 def_dvdread='#define CONFIG_DVDREAD 1'
4556 extra_ldflags="$extra_ldflags -ldvdread"
4557 inputmodules="dvdread(external) $inputmodules"
4558 res_comment="external"
4559 else
4560 def_dvdread='#undef CONFIG_DVDREAD'
4561 noinputmodules="dvdread $noinputmodules"
4563 echores "$_dvdread"
4566 echocheck "internal libdvdcss"
4567 if test "$_libdvdcss_internal" = auto ; then
4568 _libdvdcss_internal=no
4569 test "$_dvdread_internal" = yes && test -d libdvdcss && _libdvdcss_internal=yes
4570 hpux && test "$_hpux_scsi_h" = no && _libdvdcss_internal=no
4572 if test "$_libdvdcss_internal" = yes ; then
4573 if linux || netbsd || openbsd || bsdos ; then
4574 def_dvd_linux='#define HAVE_LINUX_DVD_STRUCT 1'
4575 openbsd && def_dvd_openbsd='#define HAVE_OPENBSD_DVD_STRUCT 1'
4576 elif freebsd || dragonfly ; then
4577 def_dvd_bsd='#define HAVE_BSD_DVD_STRUCT 1'
4578 elif darwin ; then
4579 def_dvd_darwin='#define DARWIN_DVD_IOCTL'
4580 extra_ldflags="$extra_ldflags -framework IOKit -framework Carbon"
4581 elif cygwin ; then
4582 cflags_libdvdcss="-DSYS_CYGWIN -DWIN32"
4583 elif beos ; then
4584 cflags_libdvdcss="-DSYS_BEOS"
4586 cflags_libdvdcss_dvdread="-Ilibdvdcss"
4587 def_dvdcss="#define HAVE_DVDCSS_DVDCSS_H 1"
4588 inputmodules="libdvdcss(internal) $inputmodules"
4589 else
4590 noinputmodules="libdvdcss(internal) $noinputmodules"
4592 echores "$_libdvdcss_internal"
4595 echocheck "libcdio"
4596 if test "$_libcdio" = auto ; then
4597 _libcdio=no
4598 if pkg_config_add libcdio_paranoia ; then
4599 _libcdio=yes
4602 if test "$_libcdio" = yes ; then
4603 _cdda='yes'
4604 def_cdda='#define CONFIG_CDDA 1'
4605 test $_cddb = auto && test $networking = yes && _cddb=yes
4606 inputmodules="cdda $inputmodules"
4607 else
4608 _libcdio=no
4609 _cdda='no'
4610 def_cdda='#undef CONFIG_CDDA'
4611 noinputmodules="cdda $noinputmodules"
4613 echores "$_libcdio"
4615 if test "$_cddb" = yes ; then
4616 def_cddb='#define CONFIG_CDDB 1'
4617 inputmodules="cddb $inputmodules"
4618 else
4619 _cddb=no
4620 def_cddb='#undef CONFIG_CDDB'
4621 noinputmodules="cddb $noinputmodules"
4625 echocheck "SSA/ASS support"
4626 if test "$_ass" = auto ; then
4627 if pkg_config_add libass ; then
4628 _ass=yes
4629 def_ass='#define CONFIG_ASS 1'
4630 else
4631 die "Unable to find development files for libass. Aborting. If you really mean to compile without libass support use --disable-libass."
4633 else
4634 def_ass='#undef CONFIG_ASS'
4636 echores "$_ass"
4639 echocheck "ENCA"
4640 if test "$_enca" = auto ; then
4641 _enca=no
4642 statement_check enca.h 'enca_get_languages(NULL)' -lenca $_ld_lm && _enca=yes
4644 if test "$_enca" = yes ; then
4645 def_enca='#define CONFIG_ENCA 1'
4646 extra_ldflags="$extra_ldflags -lenca"
4647 else
4648 def_enca='#undef CONFIG_ENCA'
4650 echores "$_enca"
4653 echocheck "zlib"
4654 _zlib=no
4655 statement_check zlib.h 'inflate(0, Z_NO_FLUSH)' -lz && _zlib=yes
4656 if test "$_zlib" = yes ; then
4657 def_zlib='#define CONFIG_ZLIB 1'
4658 extra_ldflags="$extra_ldflags -lz"
4659 else
4660 def_zlib='#define CONFIG_ZLIB 0'
4662 echores "$_zlib"
4665 echocheck "RTC"
4666 if test "$_rtc" = auto ; then
4667 cat > $TMPC << EOF
4668 #include <sys/ioctl.h>
4669 #ifdef __linux__
4670 #include <linux/rtc.h>
4671 #else
4672 #include <rtc.h>
4673 #define RTC_PIE_ON RTCIO_PIE_ON
4674 #endif
4675 int main(void) { return RTC_PIE_ON; }
4677 _rtc=no
4678 cc_check && _rtc=yes
4679 ppc && _rtc=no
4681 if test "$_rtc" = yes ; then
4682 def_rtc='#define HAVE_RTC 1'
4683 else
4684 def_rtc='#undef HAVE_RTC'
4686 echores "$_rtc"
4689 echocheck "mad support"
4690 if test "$_mad" = auto ; then
4691 _mad=no
4692 header_check mad.h -lmad && _mad=yes
4694 if test "$_mad" = yes ; then
4695 def_mad='#define CONFIG_LIBMAD 1'
4696 extra_ldflags="$extra_ldflags -lmad"
4697 codecmodules="libmad $codecmodules"
4698 else
4699 def_mad='#undef CONFIG_LIBMAD'
4700 nocodecmodules="libmad $nocodecmodules"
4702 echores "$_mad"
4704 echocheck "OggVorbis support"
4705 if test "$_libvorbis" = auto; then
4706 _libvorbis=no
4707 statement_check vorbis/codec.h 'vorbis_packet_blocksize(0, 0)' -lvorbis -logg $_ld_lm && _libvorbis=yes && _tremor=no
4708 elif test "$_libvorbis" = yes ; then
4709 _tremor=no
4711 if test "$_tremor" = auto; then
4712 _tremor=no
4713 statement_check tremor/ivorbiscodec.h 'vorbis_packet_blocksize(0, 0)' -logg -lvorbisidec $_ld_lm && _tremor=yes
4715 if test "$_tremor" = yes ; then
4716 _vorbis=yes
4717 def_vorbis='#define CONFIG_OGGVORBIS 1'
4718 def_tremor='#define CONFIG_TREMOR 1'
4719 codecmodules="tremor(external) $codecmodules"
4720 res_comment="external Tremor"
4721 extra_ldflags="$extra_ldflags -logg -lvorbisidec"
4722 elif test "$_libvorbis" = yes ; then
4723 _vorbis=yes
4724 def_vorbis='#define CONFIG_OGGVORBIS 1'
4725 codecmodules="libvorbis $codecmodules"
4726 res_comment="libvorbis"
4727 extra_ldflags="$extra_ldflags -lvorbis -logg"
4728 else
4729 _vorbis=no
4730 nocodecmodules="libvorbis $nocodecmodules"
4732 echores "$_vorbis"
4734 echocheck "libspeex (version >= 1.1 required)"
4735 if test "$_speex" = auto ; then
4736 _speex=no
4737 cat > $TMPC << EOF
4738 #include <stddef.h>
4739 #include <speex/speex.h>
4740 int main(void) { SpeexBits bits; void *dec = NULL; speex_decode_int(dec, &bits, dec); return 0; }
4742 cc_check -lspeex $_ld_lm && _speex=yes
4744 if test "$_speex" = yes ; then
4745 def_speex='#define CONFIG_SPEEX 1'
4746 extra_ldflags="$extra_ldflags -lspeex"
4747 codecmodules="speex $codecmodules"
4748 else
4749 def_speex='#undef CONFIG_SPEEX'
4750 nocodecmodules="speex $nocodecmodules"
4752 echores "$_speex"
4754 echocheck "OggTheora support"
4755 if test "$_theora" = auto ; then
4756 _theora=no
4757 if pkg_config_add theora ; then
4758 _theora=yes
4761 if test "$_theora" = yes ; then
4762 def_theora='#define CONFIG_OGGTHEORA 1'
4763 codecmodules="libtheora $codecmodules"
4764 else
4765 def_theora='#undef CONFIG_OGGTHEORA'
4766 nocodecmodules="libtheora $nocodecmodules"
4768 echores "$_theora"
4770 # Any version of libmpg123 that knows MPG123_RESYNC_LIMIT shall be fine.
4771 # That is, 1.2.0 onwards. Recommened is 1.14 onwards, though.
4772 echocheck "mpg123 support"
4773 def_mpg123='#undef CONFIG_MPG123'
4774 if test "$_mpg123" = auto; then
4775 _mpg123=no
4776 pkg_config_add 'libmpg123 >= 1.2.0' && _mpg123=yes
4778 if test "$_mpg123" = yes ; then
4779 def_mpg123='#define CONFIG_MPG123 1'
4780 codecmodules="mpg123 $codecmodules"
4781 else
4782 nocodecmodules="mpg123 $nocodecmodules"
4784 echores "$_mpg123"
4786 echocheck "liba52 support"
4787 def_liba52='#undef CONFIG_LIBA52'
4788 if test "$_liba52" = auto ; then
4789 _liba52=no
4790 cat > $TMPC << EOF
4791 #include <inttypes.h>
4792 #include <a52dec/a52.h>
4793 int main(void) { a52_state_t *testHand; testHand=a52_init(0); return 0; }
4795 cc_check -la52 && _liba52=yes && extra_ldflags="$extra_ldflags -la52"
4797 if test "$_liba52" = yes ; then
4798 def_liba52='#define CONFIG_LIBA52 1'
4799 codecmodules="liba52 $codecmodules"
4800 else
4801 nocodecmodules="liba52 $nocodecmodules"
4803 echores "$_liba52"
4805 echocheck "libdca support"
4806 if test "$_libdca" = auto ; then
4807 _libdca=no
4808 for _ld_dca in -ldca -ldts ; do
4809 statement_check_broken stdint.h dts.h 'dts_init(0)' $_ld_dca $_ld_lm &&
4810 extra_ldflags="$extra_ldflags $_ld_dca" && _libdca=yes && break
4811 done
4813 if test "$_libdca" = yes ; then
4814 def_libdca='#define CONFIG_LIBDCA 1'
4815 codecmodules="libdca $codecmodules"
4816 else
4817 def_libdca='#undef CONFIG_LIBDCA'
4818 nocodecmodules="libdca $nocodecmodules"
4820 echores "$_libdca"
4822 echocheck "libmpcdec (musepack, version >= 1.2.1 required)"
4823 if test "$_musepack" = yes ; then
4824 _musepack=no
4825 cat > $TMPC << EOF
4826 #include <stddef.h>
4827 #include <mpcdec/mpcdec.h>
4828 int main(void) {
4829 mpc_streaminfo info;
4830 mpc_decoder decoder;
4831 mpc_decoder_set_streaminfo(&decoder, &info);
4832 mpc_decoder_decode_frame(&decoder, NULL, 0, NULL);
4833 return 0;
4836 cc_check -lmpcdec $_ld_lm && _musepack=yes
4838 if test "$_musepack" = yes ; then
4839 def_musepack='#define CONFIG_MUSEPACK 1'
4840 extra_ldflags="$extra_ldflags -lmpcdec"
4841 codecmodules="musepack $codecmodules"
4842 else
4843 def_musepack='#undef CONFIG_MUSEPACK'
4844 nocodecmodules="musepack $nocodecmodules"
4846 echores "$_musepack"
4849 echocheck "FAAD2 support"
4850 if test "$_faad" = auto ; then
4851 _faad=no
4852 cat > $TMPC << EOF
4853 #include <faad.h>
4854 #ifndef FAAD_MIN_STREAMSIZE
4855 #error Too old version
4856 #endif
4857 int main(void) { faacDecHandle testhand; faacDecFrameInfo testinfo;
4858 testhand = faacDecOpen(); faacDecInit(0, 0, 0, 0, 0); return 0; }
4860 cc_check -lfaad $_ld_lm && _faad=yes
4863 def_faad='#undef CONFIG_FAAD'
4864 if test "$_faad" = yes ; then
4865 def_faad='#define CONFIG_FAAD 1'
4866 extra_ldflags="$extra_ldflags -lfaad"
4867 codecmodules="faad2 $codecmodules"
4868 else
4869 nocodecmodules="faad2 $nocodecmodules"
4871 echores "$_faad"
4874 echocheck "LADSPA plugin support"
4875 if test "$_ladspa" = auto ; then
4876 _ladspa=no
4877 statement_check ladspa.h 'LADSPA_Descriptor ld = {0}' && _ladspa=yes
4879 if test "$_ladspa" = yes; then
4880 def_ladspa="#define CONFIG_LADSPA 1"
4881 else
4882 def_ladspa="#undef CONFIG_LADSPA"
4884 echores "$_ladspa"
4887 echocheck "libbs2b audio filter support"
4888 if test "$_libbs2b" = auto ; then
4889 _libbs2b=no
4890 if pkg_config_add libbs2b ; then
4891 _libbs2b=yes
4894 def_libbs2b="#undef CONFIG_LIBBS2B"
4895 test "$_libbs2b" = yes && def_libbs2b="#define CONFIG_LIBBS2B 1"
4896 echores "$_libbs2b"
4899 if test -z "$_codecsdir" ; then
4900 for dir in "$_libdir/codecs" "$_libdir/win32" /usr/local/lib/codecs \
4901 /usr/lib/codecs /usr/local/lib/win32 /usr/lib/win32 ; do
4902 if test -d "$dir" ; then
4903 _codecsdir="$dir"
4904 break;
4906 done
4908 # Fall back on default directory.
4909 if test -z "$_codecsdir" ; then
4910 _codecsdir="$_libdir/codecs"
4911 mingw32 && _codecsdir="codecs"
4915 echocheck "Win32 codecs"
4916 if test "$_win32dll" = auto ; then
4917 _win32dll=no
4918 if x86_32 && ! qnx; then
4919 _win32dll=yes
4922 if test "$_win32dll" = yes ; then
4923 def_win32dll='#define CONFIG_WIN32DLL 1'
4924 if ! win32 ; then
4925 def_win32_loader='#define WIN32_LOADER 1'
4926 _win32_emulation=yes
4927 else
4928 extra_ldflags="$extra_ldflags -ladvapi32 -lole32"
4929 res_comment="using native windows"
4931 codecmodules="win32 $codecmodules"
4932 else
4933 def_win32dll='#undef CONFIG_WIN32DLL'
4934 def_win32_loader='#undef WIN32_LOADER'
4935 nocodecmodules="win32 $nocodecmodules"
4937 echores "$_win32dll"
4940 echocheck "XAnim codecs"
4941 if test "$_xanim" = auto ; then
4942 _xanim=no
4943 res_comment="dynamic loader support needed"
4944 if test "$_dl" = yes ; then
4945 _xanim=yes
4948 if test "$_xanim" = yes ; then
4949 def_xanim='#define CONFIG_XANIM 1'
4950 codecmodules="xanim $codecmodules"
4951 else
4952 def_xanim='#undef CONFIG_XANIM'
4953 nocodecmodules="xanim $nocodecmodules"
4955 echores "$_xanim"
4958 echocheck "RealPlayer codecs"
4959 if test "$_real" = auto ; then
4960 _real=no
4961 res_comment="dynamic loader support needed"
4962 if test "$_dl" = yes || test "$_win32dll" = yes &&
4963 (linux || freebsd || netbsd || openbsd || dragonfly || darwin || win32) ; then
4964 _real=yes
4967 if test "$_real" = yes ; then
4968 def_real='#define CONFIG_REALCODECS 1'
4969 codecmodules="real $codecmodules"
4970 else
4971 def_real='#undef CONFIG_REALCODECS'
4972 nocodecmodules="real $nocodecmodules"
4974 echores "$_real"
4977 echocheck "QuickTime codecs"
4978 _qtx_emulation=no
4979 def_qtx_win32='#undef CONFIG_QTX_CODECS_WIN32'
4980 if test "$_qtx" = auto ; then
4981 test "$_win32dll" = yes || test "$quicktime" = yes && _qtx=yes
4983 if test "$_qtx" = yes ; then
4984 def_qtx='#define CONFIG_QTX_CODECS 1'
4985 win32 && _qtx_codecs_win32=yes && def_qtx_win32='#define CONFIG_QTX_CODECS_WIN32 1'
4986 codecmodules="qtx $codecmodules"
4987 darwin || win32 || _qtx_emulation=yes
4988 else
4989 def_qtx='#undef CONFIG_QTX_CODECS'
4990 nocodecmodules="qtx $nocodecmodules"
4992 echores "$_qtx"
4994 echocheck "LCMS2 support"
4995 if test "$_lcms2" = auto ; then
4996 _lcms2=no
4997 if pkg_config_add lcms2 ; then
4998 _lcms2=yes
5001 if test "$_lcms2" = yes; then
5002 def_lcms2="#define CONFIG_LCMS2 1"
5003 else
5004 def_lcms2="#undef CONFIG_LCMS2"
5006 echores "$_lcms2"
5009 # Test with > against Libav 0.8 versions which will NOT work rather than
5010 # specify minimum version, to allow (future) point releases to possibly work.
5011 all_libav_libs="libavutil > 51.21.0:libavcodec > 53.34.0:libavformat > 53.20.0:libswscale >= 2.0.0"
5012 echocheck "Libav ($all_libav_libs)"
5013 if test "$ffmpeg" = auto ; then
5014 IFS=":" # shell should not be used for programming
5015 if ! pkg_config_add $all_libav_libs ; then
5016 die "Unable to find development files for some of the required Libav libraries above. Aborting."
5019 echores "yes"
5021 def_ffmpeg_internals="#undef CONFIG_FFMPEG_INTERNALS"
5022 if ! test -z "$_ffmpeg_source" ; then
5023 def_ffmpeg_internals="#define CONFIG_FFMPEG_INTERNALS 1" && ffmpeg_internals=yes
5026 echocheck "libpostproc >= 52.0.0"
5027 if test "$libpostproc" = auto ; then
5028 libpostproc=no
5029 if pkg_config_add "libpostproc >= 52.0.0" ; then
5030 libpostproc=yes
5033 if test "$libpostproc" = yes ; then
5034 def_libpostproc='#define CONFIG_LIBPOSTPROC 1'
5035 else
5036 def_libpostproc='#undef CONFIG_LIBPOSTPROC'
5038 echores "$libpostproc"
5041 echocheck "libdv-0.9.5+"
5042 if test "$_libdv" = auto ; then
5043 _libdv=no
5044 statement_check libdv/dv.h 'dv_encoder_new(1, 1, 1)' -ldv $_ld_pthread $_ld_lm && _libdv=yes
5046 if test "$_libdv" = yes ; then
5047 def_libdv='#define CONFIG_LIBDV095 1'
5048 extra_ldflags="$extra_ldflags -ldv"
5049 codecmodules="libdv $codecmodules"
5050 else
5051 def_libdv='#undef CONFIG_LIBDV095'
5052 nocodecmodules="libdv $nocodecmodules"
5054 echores "$_libdv"
5057 echocheck "Xvid"
5058 if test "$_xvid" = auto ; then
5059 _xvid=no
5060 for _ld_tmp in "-lxvidcore $_ld_lm" "-lxvidcore $_ld_lm $_ld_pthread" ; do
5061 statement_check xvid.h 'xvid_global(0, 0, 0, 0)' $_ld_tmp &&
5062 extra_ldflags="$extra_ldflags $_ld_tmp" && _xvid=yes && break
5063 done
5066 if test "$_xvid" = yes ; then
5067 def_xvid='#define CONFIG_XVID4 1'
5068 codecmodules="xvid $codecmodules"
5069 else
5070 def_xvid='#undef CONFIG_XVID4'
5071 nocodecmodules="xvid $nocodecmodules"
5073 echores "$_xvid"
5076 echocheck "libnut"
5077 if test "$_libnut" = auto ; then
5078 _libnut=no
5079 statement_check libnut.h 'nut_context_tt * nut; nut_error(0)' -lnut && _libnut=yes
5082 if test "$_libnut" = yes ; then
5083 def_libnut='#define CONFIG_LIBNUT 1'
5084 extra_ldflags="$extra_ldflags -lnut"
5085 else
5086 def_libnut='#undef CONFIG_LIBNUT'
5088 echores "$_libnut"
5091 echocheck "UnRAR executable"
5092 if test "$_unrar_exec" = auto ; then
5093 _unrar_exec="yes"
5094 mingw32 && _unrar_exec="no"
5096 if test "$_unrar_exec" = yes ; then
5097 def_unrar_exec='#define CONFIG_UNRAR_EXEC 1'
5098 else
5099 def_unrar_exec='#undef CONFIG_UNRAR_EXEC'
5101 echores "$_unrar_exec"
5103 echocheck "TV interface"
5104 if test "$_tv" = yes ; then
5105 def_tv='#define CONFIG_TV 1'
5106 inputmodules="tv $inputmodules"
5107 else
5108 noinputmodules="tv $noinputmodules"
5109 def_tv='#undef CONFIG_TV'
5111 echores "$_tv"
5114 if freebsd || netbsd || openbsd || dragonfly || bsdos ; then
5115 echocheck "*BSD BT848 bt8xx header"
5116 _ioctl_bt848_h=no
5117 for file in "machine/ioctl_bt848.h" \
5118 "dev/bktr/ioctl_bt848.h" \
5119 "dev/video/bktr/ioctl_bt848.h" \
5120 "dev/ic/bt8xx.h" ; do
5121 cat > $TMPC <<EOF
5122 #include <sys/types.h>
5123 #include <sys/ioctl.h>
5124 #include <$file>
5125 int main(void) { ioctl(0, TVTUNER_GETFREQ, 0); return 0; }
5127 if cc_check ; then
5128 _ioctl_bt848_h=yes
5129 _ioctl_bt848_h_name="$file"
5130 break;
5132 done
5133 if test "$_ioctl_bt848_h" = yes ; then
5134 def_ioctl_bt848_h_name="#define IOCTL_BT848_H_NAME <$_ioctl_bt848_h_name>"
5135 res_comment="using $_ioctl_bt848_h_name"
5136 else
5137 def_ioctl_bt848_h_name="#undef IOCTL_BT848_H_NAME"
5139 echores "$_ioctl_bt848_h"
5141 echocheck "*BSD ioctl_meteor.h"
5142 _ioctl_meteor_h=no
5143 for ioctl_meteor_h_path in "machine/ioctl_meteor.h" "dev/bktr/ioctl_meteor.h" "dev/video/bktr/ioctl_meteor.h" ; do
5144 statement_check_broken "sys/types.h" "$ioctl_meteor_h_path" 'ioctl(0, METEORSINPUT, 0)' &&
5145 _ioctl_meteor_h=yes && break
5146 done
5147 if test "$_ioctl_meteor_h" = yes ; then
5148 def_ioctl_meteor_h_name="#define IOCTL_METEOR_H_NAME <$ioctl_meteor_h_path>"
5149 res_comment="using $ioctl_meteor_h_path"
5150 else
5151 def_ioctl_meteor_h_name="#undef IOCTL_METEOR_H_NAME"
5153 echores "$_ioctl_meteor_h"
5155 echocheck "*BSD BrookTree 848 TV interface"
5156 if test "$_tv_bsdbt848" = auto ; then
5157 _tv_bsdbt848=no
5158 if test "$_tv" = yes ; then
5159 cat > $TMPC <<EOF
5160 #include <sys/types.h>
5161 $def_ioctl_meteor_h_name
5162 $def_ioctl_bt848_h_name
5163 #ifdef IOCTL_METEOR_H_NAME
5164 #include IOCTL_METEOR_H_NAME
5165 #endif
5166 #ifdef IOCTL_BT848_H_NAME
5167 #include IOCTL_BT848_H_NAME
5168 #endif
5169 int main(void) {
5170 ioctl(0, METEORSINPUT, 0);
5171 ioctl(0, TVTUNER_GETFREQ, 0);
5172 return 0;
5175 cc_check && _tv_bsdbt848=yes
5178 if test "$_tv_bsdbt848" = yes ; then
5179 def_tv_bsdbt848='#define CONFIG_TV_BSDBT848 1'
5180 inputmodules="tv-bsdbt848 $inputmodules"
5181 else
5182 def_tv_bsdbt848='#undef CONFIG_TV_BSDBT848'
5183 noinputmodules="tv-bsdbt848 $noinputmodules"
5185 echores "$_tv_bsdbt848"
5186 fi #if freebsd || netbsd || openbsd || dragonfly || bsdos
5189 echocheck "DirectShow TV interface"
5190 if test "$_tv_dshow" = auto ; then
5191 _tv_dshow=no
5192 if test "$_tv" = yes && win32 ; then
5193 statement_check ole2.h 'void* p; CoCreateInstance((GUID*)&GUID_NULL, NULL, CLSCTX_INPROC_SERVER, &GUID_NULL, &p)' -lole32 -luuid && _tv_dshow=yes
5196 if test "$_tv_dshow" = yes ; then
5197 inputmodules="tv-dshow $inputmodules"
5198 def_tv_dshow='#define CONFIG_TV_DSHOW 1'
5199 extra_ldflags="$extra_ldflags -lole32 -luuid"
5200 else
5201 noinputmodules="tv-dshow $noinputmodules"
5202 def_tv_dshow='#undef CONFIG_TV_DSHOW'
5204 echores "$_tv_dshow"
5207 echocheck "Video 4 Linux TV interface"
5208 if test "$_tv_v4l1" = auto ; then
5209 _tv_v4l1=no
5210 if test "$_tv" = yes && linux ; then
5211 header_check_broken sys/time.h linux/videodev.h && _tv_v4l1=yes
5214 if test "$_tv_v4l1" = yes ; then
5215 _audio_input=yes
5216 _tv_v4l=yes
5217 def_tv_v4l='#define CONFIG_TV_V4L 1'
5218 def_tv_v4l1='#define CONFIG_TV_V4L1 1'
5219 inputmodules="tv-v4l $inputmodules"
5220 else
5221 noinputmodules="tv-v4l1 $noinputmodules"
5222 def_tv_v4l='#undef CONFIG_TV_V4L'
5224 echores "$_tv_v4l1"
5227 echocheck "Video 4 Linux 2 TV interface"
5228 if test "$_tv_v4l2" = auto ; then
5229 _tv_v4l2=no
5230 if test "$_tv" = yes && linux ; then
5231 header_check_broken sys/time.h linux/videodev2.h && _tv_v4l2=yes
5232 elif test "$_tv" = yes && test "$sys_videoio_h" = "yes" ; then
5233 _tv_v4l2=yes
5236 if test "$_tv_v4l2" = yes ; then
5237 _audio_input=yes
5238 _tv_v4l=yes
5239 def_tv_v4l='#define CONFIG_TV_V4L 1'
5240 def_tv_v4l2='#define CONFIG_TV_V4L2 1'
5241 inputmodules="tv-v4l2 $inputmodules"
5242 else
5243 noinputmodules="tv-v4l2 $noinputmodules"
5244 def_tv_v4l2='#undef CONFIG_TV_V4L2'
5246 echores "$_tv_v4l2"
5249 echocheck "Radio interface"
5250 if test "$_radio" = yes ; then
5251 def_radio='#define CONFIG_RADIO 1'
5252 inputmodules="radio $inputmodules"
5253 if test "$_alsa" != yes -a "$_ossaudio" != yes ; then
5254 _radio_capture=no
5256 if test "$_radio_capture" = yes ; then
5257 _audio_input=yes
5258 def_radio_capture="#define CONFIG_RADIO_CAPTURE 1"
5259 else
5260 def_radio_capture="#undef CONFIG_RADIO_CAPTURE"
5262 else
5263 noinputmodules="radio $noinputmodules"
5264 def_radio='#undef CONFIG_RADIO'
5265 def_radio_capture="#undef CONFIG_RADIO_CAPTURE"
5266 _radio_capture=no
5268 echores "$_radio"
5269 echocheck "Capture for Radio interface"
5270 echores "$_radio_capture"
5272 echocheck "Video 4 Linux 2 Radio interface"
5273 if test "$_radio_v4l2" = auto ; then
5274 _radio_v4l2=no
5275 if test "$_radio" = yes && linux ; then
5276 header_check linux/videodev2.h && _radio_v4l2=yes
5279 if test "$_radio_v4l2" = yes ; then
5280 def_radio_v4l2='#define CONFIG_RADIO_V4L2 1'
5281 else
5282 def_radio_v4l2='#undef CONFIG_RADIO_V4L2'
5284 echores "$_radio_v4l2"
5286 echocheck "Video 4 Linux Radio interface"
5287 if test "$_radio_v4l" = auto ; then
5288 _radio_v4l=no
5289 if test "$_radio" = yes && linux ; then
5290 header_check linux/videodev.h && _radio_v4l=yes
5293 if test "$_radio_v4l" = yes ; then
5294 def_radio_v4l='#define CONFIG_RADIO_V4L 1'
5295 else
5296 def_radio_v4l='#undef CONFIG_RADIO_V4L'
5298 echores "$_radio_v4l"
5300 if freebsd || netbsd || openbsd || dragonfly || bsdos &&
5301 test "$_radio" = yes && test "$_radio_bsdbt848" = auto ; then
5302 echocheck "*BSD BrookTree 848 Radio interface"
5303 _radio_bsdbt848=no
5304 cat > $TMPC <<EOF
5305 #include <sys/types.h>
5306 $def_ioctl_bt848_h_name
5307 #ifdef IOCTL_BT848_H_NAME
5308 #include IOCTL_BT848_H_NAME
5309 #endif
5310 int main(void) { ioctl(0, RADIO_GETFREQ, 0); return 0; }
5312 cc_check && _radio_bsdbt848=yes
5313 echores "$_radio_bsdbt848"
5314 fi #if freebsd || netbsd || openbsd || dragonfly || bsdos && _radio && _radio_bsdbt848
5316 if test "$_radio_bsdbt848" = yes ; then
5317 def_radio_bsdbt848='#define CONFIG_RADIO_BSDBT848 1'
5318 else
5319 def_radio_bsdbt848='#undef CONFIG_RADIO_BSDBT848'
5322 if test "$_radio_v4l" = no && test "$_radio_v4l2" = no &&
5323 test "$_radio_bsdbt848" = no && test "$_radio" = yes ; then
5324 die "Radio driver requires BSD BT848, V4L or V4L2!"
5327 echocheck "Video 4 Linux 2 MPEG PVR interface"
5328 if test "$_pvr" = auto ; then
5329 _pvr=no
5330 if test "$_tv_v4l2" = yes && linux ; then
5331 cat > $TMPC <<EOF
5332 #include <sys/time.h>
5333 #include <linux/videodev2.h>
5334 int main(void) { struct v4l2_ext_controls ext; return ext.controls->value; }
5336 cc_check && _pvr=yes
5339 if test "$_pvr" = yes ; then
5340 def_pvr='#define CONFIG_PVR 1'
5341 inputmodules="pvr $inputmodules"
5342 else
5343 noinputmodules="pvr $noinputmodules"
5344 def_pvr='#undef CONFIG_PVR'
5346 echores "$_pvr"
5349 echocheck "ftp"
5350 if test "$_ftp" = "auto" ; then
5351 test "$networking" = "yes" && ! beos && _ftp=yes
5353 if test "$_ftp" = yes ; then
5354 def_ftp='#define CONFIG_FTP 1'
5355 inputmodules="ftp $inputmodules"
5356 else
5357 noinputmodules="ftp $noinputmodules"
5358 def_ftp='#undef CONFIG_FTP'
5360 echores "$_ftp"
5362 echocheck "vstream client"
5363 if test "$_vstream" = auto ; then
5364 _vstream=no
5365 cat > $TMPC <<EOF
5366 #include <vstream-client.h>
5367 void vstream_error(const char *format, ... ) {}
5368 int main(void) { vstream_start(); return 0; }
5370 cc_check -lvstream-client && _vstream=yes
5372 if test "$_vstream" = yes ; then
5373 def_vstream='#define CONFIG_VSTREAM 1'
5374 inputmodules="vstream $inputmodules"
5375 extra_ldflags="$extra_ldflags -lvstream-client"
5376 else
5377 noinputmodules="vstream $noinputmodules"
5378 def_vstream='#undef CONFIG_VSTREAM'
5380 echores "$_vstream"
5383 echocheck "Subtitles sorting"
5384 if test "$_sortsub" = yes ; then
5385 def_sortsub='#define CONFIG_SORTSUB 1'
5386 else
5387 def_sortsub='#undef CONFIG_SORTSUB'
5389 echores "$_sortsub"
5392 echocheck "XMMS inputplugin support"
5393 if test "$_xmms" = yes ; then
5394 if ( xmms-config --version ) >/dev/null 2>&1 ; then
5395 _xmmsplugindir=$(xmms-config --input-plugin-dir)
5396 _xmmslibdir=$(xmms-config --exec-prefix)/lib
5397 else
5398 _xmmsplugindir=/usr/lib/xmms/Input
5399 _xmmslibdir=/usr/lib
5402 def_xmms='#define CONFIG_XMMS 1'
5403 if darwin ; then
5404 extra_ldflags="$extra_ldflags ${_xmmslibdir}/libxmms.dylib"
5405 else
5406 extra_ldflags="$extra_ldflags ${_xmmslibdir}/libxmms.so.1 -export-dynamic"
5408 else
5409 def_xmms='#undef CONFIG_XMMS'
5411 echores "$_xmms"
5413 if test "$_charset" != "noconv" ; then
5414 def_charset="#define MSG_CHARSET \"$_charset\""
5415 else
5416 def_charset="#undef MSG_CHARSET"
5417 _charset="UTF-8"
5420 #############################################################################
5422 echocheck "automatic gdb attach"
5423 if test "$_crash_debug" = yes ; then
5424 def_crash_debug='#define CONFIG_CRASH_DEBUG 1'
5425 else
5426 def_crash_debug='#undef CONFIG_CRASH_DEBUG'
5427 _crash_debug=no
5429 echores "$_crash_debug"
5431 echocheck "compiler support for noexecstack"
5432 if cflag_check -Wl,-z,noexecstack ; then
5433 extra_ldflags="-Wl,-z,noexecstack $extra_ldflags"
5434 echores "yes"
5435 else
5436 echores "no"
5439 echocheck "linker support for --nxcompat --no-seh --dynamicbase"
5440 if cflag_check "-Wl,--nxcompat -Wl,--no-seh -Wl,--dynamicbase" ; then
5441 extra_ldflags="-Wl,--nxcompat -Wl,--no-seh -Wl,--dynamicbase $extra_ldflags"
5442 echores "yes"
5443 else
5444 echores "no"
5448 # Dynamic linking flags
5449 # (FIXME: 'echocheck "dynamic linking"' above and modify here accordingly)
5450 _ld_dl_dynamic=''
5451 freebsd || netbsd || openbsd || dragonfly || bsdos && _ld_dl_dynamic='-rdynamic'
5452 if test "$_real" = yes || test "$_xanim" = yes && ! win32 && ! qnx && ! darwin ; then
5453 _ld_dl_dynamic='-rdynamic'
5456 extra_ldflags="$extra_ldflags $_ld_pthread $_ld_dl $_ld_dl_dynamic"
5457 bsdos && extra_ldflags="$extra_ldflags -ldvd"
5458 (netbsd || openbsd) && x86_32 && extra_ldflags="$extra_ldflags -li386"
5460 def_debug='#undef MP_DEBUG'
5461 test "$_debug" != "" && def_debug='#define MP_DEBUG 1'
5464 echocheck "joystick"
5465 def_joystick='#undef CONFIG_JOYSTICK'
5466 if test "$_joystick" = yes ; then
5467 if linux || freebsd ; then
5468 # TODO add some check
5469 def_joystick='#define CONFIG_JOYSTICK 1'
5470 else
5471 _joystick="no"
5472 res_comment="unsupported under $system_name"
5475 echores "$_joystick"
5477 echocheck "lirc"
5478 if test "$_lirc" = auto ; then
5479 _lirc=no
5480 header_check lirc/lirc_client.h -llirc_client && _lirc=yes
5482 if test "$_lirc" = yes ; then
5483 def_lirc='#define CONFIG_LIRC 1'
5484 libs_mplayer="$libs_mplayer -llirc_client"
5485 else
5486 def_lirc='#undef CONFIG_LIRC'
5488 echores "$_lirc"
5490 echocheck "lircc"
5491 if test "$_lircc" = auto ; then
5492 _lircc=no
5493 header_check lirc/lircc.h -llircc && _lircc=yes
5495 if test "$_lircc" = yes ; then
5496 def_lircc='#define CONFIG_LIRCC 1'
5497 libs_mplayer="$libs_mplayer -llircc"
5498 else
5499 def_lircc='#undef CONFIG_LIRCC'
5501 echores "$_lircc"
5503 #############################################################################
5505 CFLAGS="$CFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE"
5507 # This must be the last test to be performed. Any other tests following it
5508 # could fail due to linker errors. libdvdnavmini is intentionally not linked
5509 # against libdvdread (to permit MPlayer to use its own copy of the library).
5510 # So any compilation using the flags added here but not linking against
5511 # libdvdread can fail.
5512 echocheck "DVD support (libdvdnav)"
5513 if test "$_dvdread_internal" = yes && test ! -f "libdvdnav/dvdnav.c" ; then
5514 _dvdnav=no
5516 dvdnav_internal=no
5517 if test "$_dvdnav" = auto ; then
5518 if test "$_dvdread_internal" = yes ; then
5519 _dvdnav=yes
5520 dvdnav_internal=yes
5521 res_comment="internal"
5522 else
5523 $_dvdnavconfig --version --minilibs >> $TMPLOG 2>&1 || _dvdnav=no
5526 if test "$_dvdnav" = auto ; then
5527 _dvdnav=no
5528 _dvdnavdir=$($_dvdnavconfig --cflags)
5529 _dvdnavlibs=$($_dvdnavconfig --libs)
5530 statement_check_broken stdint.h dvdnav/dvdnav.h 'dvdnav_t *dvd = 0' $_dvdnavdir $_dvdnavlibs $_ld_dl $_ld_pthread && _dvdnav=yes
5532 if test "$_dvdnav" = yes ; then
5533 def_dvdnav='#define CONFIG_DVDNAV 1'
5534 if test "$dvdnav_internal" = yes ; then
5535 cflags_libdvdnav="-Ilibdvdnav"
5536 inputmodules="dvdnav(internal) $inputmodules"
5537 else
5538 extra_cflags="$extra_cflags $($_dvdnavconfig --cflags)"
5539 extra_ldflags="$extra_ldflags $($_dvdnavconfig --minilibs)"
5540 inputmodules="dvdnav $inputmodules"
5542 else
5543 def_dvdnav='#undef CONFIG_DVDNAV'
5544 noinputmodules="dvdnav $noinputmodules"
5546 echores "$_dvdnav"
5548 # DO NOT ADD ANY TESTS THAT USE LINKER FLAGS HERE (like cc_check).
5549 # Read dvdnav comment above.
5551 mak_enable () {
5552 list=$(echo $1 | tr '[a-z]' '[A-Z]')
5553 item=$(echo $2 | tr '[a-z]' '[A-Z]')
5554 nprefix=$3;
5555 for part in $list; do
5556 if $(echo $item | grep -q -E "(^| )$part($| )"); then
5557 echo "${nprefix}_$part = yes"
5559 done
5562 #############################################################################
5563 echo "Creating config.mak"
5564 cat > config.mak << EOF
5565 # -------- Generated by configure -----------
5567 # Ensure that locale settings do not interfere with shell commands.
5568 export LC_ALL = C
5570 CONFIGURATION = $configuration
5572 CHARSET = $_charset
5573 DOC_LANGS = $language_doc
5574 DOC_LANG_ALL = $doc_lang_all
5575 MAN_LANGS = $language_man
5576 MAN_LANG_ALL = $man_lang_all
5577 MSG_LANGS = $language_msg
5578 MSG_LANG_ALL = $msg_lang_all
5580 prefix = \$(DESTDIR)$_prefix
5581 BINDIR = \$(DESTDIR)$_bindir
5582 DATADIR = \$(DESTDIR)$_datadir
5583 LIBDIR = \$(DESTDIR)$_libdir
5584 MANDIR = \$(DESTDIR)$_mandir
5585 CONFDIR = \$(DESTDIR)$_confdir
5586 LOCALEDIR = \$(DESTDIR)$_localedir
5588 AR = $_ar
5589 AS = $_cc
5590 CC = $_cc
5591 INSTALL = $_install
5592 INSTALLSTRIP = $_install_strip
5593 WINDRES = $_windres
5595 CFLAGS = $WARNFLAGS $ERRORFLAGS $WARN_CFLAGS $CFLAGS $extra_cflags
5596 DEPFLAGS = $DEPFLAGS
5598 CFLAGS_LIBDVDCSS = $cflags_libdvdcss
5599 CFLAGS_LIBDVDCSS_DVDREAD = $cflags_libdvdcss_dvdread
5600 CFLAGS_LIBDVDNAV = $cflags_libdvdnav
5601 CFLAGS_NO_OMIT_LEAF_FRAME_POINTER = $cflags_no_omit_leaf_frame_pointer
5602 CFLAGS_STACKREALIGN = $cflags_stackrealign
5604 EXTRALIBS = $extra_ldflags $_ld_static $_ld_lm $extra_libs
5605 EXTRALIBS_MPLAYER = $libs_mplayer
5607 GETCH = $_getch
5608 TIMER = $_timer
5610 EXESUF = $_exesuf
5611 EXESUFS_ALL = .exe
5613 ARCH = $arch
5614 $(mak_enable "$arch_all" "$arch" ARCH)
5615 $(mak_enable "$subarch_all" "$subarch" ARCH)
5616 $(mak_enable "$cpuexts_all" "$cpuexts" HAVE)
5618 MPLAYER = $_mplayer
5620 NEED_GETTIMEOFDAY = $need_gettimeofday
5621 NEED_GLOB = $need_glob
5622 NEED_SETENV = $need_setenv
5623 NEED_SHMEM = $need_shmem
5624 NEED_STRSEP = $need_strsep
5625 NEED_SWAB = $need_swab
5626 NEED_VSSCANF = $need_vsscanf
5628 # features
5629 ALSA = $_alsa
5630 APPLE_IR = $_apple_ir
5631 APPLE_REMOTE = $_apple_remote
5632 AUDIO_INPUT = $_audio_input
5633 CACA = $_caca
5634 CDDA = $_cdda
5635 CDDB = $_cddb
5636 COCOA = $_cocoa
5637 COREAUDIO = $_coreaudio
5638 COREVIDEO = $_corevideo
5639 SHAREDBUFFER = $_sharedbuffer
5640 DIRECT3D = $_direct3d
5641 DIRECTFB = $_directfb
5642 DIRECTX = $_directx
5643 DVBIN = $_dvbin
5644 DVDNAV = $_dvdnav
5645 DVDNAV_INTERNAL = $dvdnav_internal
5646 DVDREAD = $_dvdread
5647 DVDREAD_INTERNAL = $_dvdread_internal
5648 DXR3 = $_dxr3
5649 FAAD = $_faad
5650 FASTMEMCPY = $_fastmemcpy
5651 FTP = $_ftp
5652 GIF = $_gif
5653 GL = $_gl
5654 GL_COCOA = $_gl_cocoa
5655 GL_WIN32 = $_gl_win32
5656 GL_X11 = $_gl_x11
5657 GL_SDL = $_gl_sdl
5658 HAVE_POSIX_SELECT = $_posix_select
5659 HAVE_SYS_MMAN_H = $_mman
5660 JACK = $_jack
5661 JOYSTICK = $_joystick
5662 JPEG = $_jpeg
5663 LADSPA = $_ladspa
5664 LIBA52 = $_liba52
5665 LIBASS = $_ass
5666 LIBBLURAY = $_bluray
5667 LIBBS2B = $_libbs2b
5668 LIBDCA = $_libdca
5669 LIBDV = $_libdv
5670 LIBDVDCSS_INTERNAL = $_libdvdcss_internal
5671 LIBMAD = $_mad
5672 LCMS2 = $_lcms2
5673 LIBNUT = $_libnut
5674 LIBPOSTPROC = $libpostproc
5675 LIBSMBCLIENT = $_smb
5676 LIBQUVI = $_libquvi
5677 LIBTHEORA = $_theora
5678 LIRC = $_lirc
5679 MACOSX_FINDER = $_macosx_finder
5680 MD5SUM = $_md5sum
5681 MNG = $_mng
5682 MPG123 = $_mpg123
5683 MUSEPACK = $_musepack
5684 NETWORKING = $networking
5685 OPENAL = $_openal
5686 OSS = $_ossaudio
5687 PE_EXECUTABLE = $_pe_executable
5688 PNG = $_png
5689 PNM = $_pnm
5690 PRIORITY = $_priority
5691 PULSE = $_pulse
5692 PORTAUDIO = $_portaudio
5693 PVR = $_pvr
5694 QTX_CODECS = $_qtx
5695 QTX_CODECS_WIN32 = $_qtx_codecs_win32
5696 QTX_EMULATION = $_qtx_emulation
5697 RADIO=$_radio
5698 RADIO_CAPTURE=$_radio_capture
5699 REAL_CODECS = $_real
5700 RSOUND = $_rsound
5701 SDL = $_sdl
5702 SPEEX = $_speex
5703 STREAM_CACHE = $_stream_cache
5704 TGA = $_tga
5705 TV = $_tv
5706 TV_BSDBT848 = $_tv_bsdbt848
5707 TV_DSHOW = $_tv_dshow
5708 TV_V4L = $_tv_v4l
5709 TV_V4L1 = $_tv_v4l1
5710 TV_V4L2 = $_tv_v4l2
5711 UNRAR_EXEC = $_unrar_exec
5712 V4L2 = $_v4l2
5713 VCD = $_vcd
5714 VDPAU = $_vdpau
5715 VORBIS = $_vorbis
5716 VSTREAM = $_vstream
5717 WIN32DLL = $_win32dll
5718 WIN32_EMULATION = $_win32_emulation
5719 X11 = $_x11
5720 XANIM_CODECS = $_xanim
5721 XMMS_PLUGINS = $_xmms
5722 XV = $_xv
5723 XVID4 = $_xvid
5724 YUV4MPEG = $_yuv4mpeg
5726 # FFmpeg
5727 FFMPEG_INTERNALS = $ffmpeg_internals
5728 FFMPEG_SOURCE_PATH = $_ffmpeg_source
5730 RANLIB = $_ranlib
5731 YASM = $_yasm
5732 YASMFLAGS = $YASMFLAGS
5734 CONFIG_VDPAU = $_vdpau
5735 CONFIG_ZLIB = $_zlib
5737 HAVE_PTHREADS = $_pthreads
5738 HAVE_SHM = $_shm
5739 HAVE_W32THREADS = $_w32threads
5740 HAVE_YASM = $have_yasm
5744 #############################################################################
5746 ff_config_enable () {
5747 list=$(echo $1 | tr '[a-z]' '[A-Z]')
5748 item=$(echo $2 | tr '[a-z]' '[A-Z]')
5749 _nprefix=$3;
5750 test -z "$_nprefix" && _nprefix='CONFIG'
5751 for part in $list; do
5752 if $(echo $item | grep -q -E "(^| )$part($| )"); then
5753 echo "#define ${_nprefix}_$part 1"
5754 else
5755 echo "#define ${_nprefix}_$part 0"
5757 done
5760 echo "Creating config.h"
5761 cat > $TMPH << EOF
5762 /*----------------------------------------------------------------------------
5763 ** This file has been automatically generated by configure any changes in it
5764 ** will be lost when you run configure again.
5765 ** Instead of modifying definitions here, use the --enable/--disable options
5766 ** of the configure script! See ./configure --help for details.
5767 *---------------------------------------------------------------------------*/
5769 #ifndef MPLAYER_CONFIG_H
5770 #define MPLAYER_CONFIG_H
5772 #define CONFIGURATION "$configuration"
5774 #define MPLAYER_DATADIR "$_datadir"
5775 #define MPLAYER_CONFDIR "$_confdir"
5776 #define MPLAYER_LOCALEDIR "$_localedir"
5778 $def_translation
5780 /* definitions needed by included libraries */
5781 #define HAVE_INTTYPES_H 1
5782 /* libdvdcss */
5783 #define HAVE_ERRNO_H 1
5784 /* libdvdcss + libdvdread */
5785 #define HAVE_LIMITS_H 1
5786 /* libdvdcss */
5787 #define HAVE_UNISTD_H 1
5788 /* libdvdread */
5789 #define STDC_HEADERS 1
5790 #define HAVE_MEMCPY 1
5791 /* libdvdnav */
5792 #define READ_CACHE_TRACE 0
5793 /* libdvdread */
5794 #define HAVE_DLFCN_H 1
5795 $def_dvdcss
5798 /* system headers */
5799 $def_alloca_h
5800 $def_altivec_h
5801 $def_malloc_h
5802 $def_mman_h
5803 $def_mman_has_map_failed
5804 $def_soundcard_h
5805 $def_sys_soundcard_h
5806 $def_sys_sysinfo_h
5807 $def_sys_videoio_h
5808 $def_termios_h
5809 $def_termios_sys_h
5810 $def_winsock2_h
5813 /* system functions */
5814 $def_gethostbyname2
5815 $def_gettimeofday
5816 $def_glob
5817 $def_langinfo
5818 $def_lrintf
5819 $def_map_memalign
5820 $def_memalign
5821 $def_nanosleep
5822 $def_posix_select
5823 $def_select
5824 $def_setenv
5825 $def_setmode
5826 $def_shm
5827 $def_strsep
5828 $def_swab
5829 $def_sysi86
5830 $def_sysi86_iv
5831 $def_termcap
5832 $def_termios
5833 $def_vsscanf
5836 /* system-specific features */
5837 $def_asmalign_pot
5838 $def_builtin_expect
5839 $def_dl
5840 $def_dos_paths
5841 $def_extern_asm
5842 $def_extern_prefix
5843 $def_iconv
5844 $def_kstat
5845 $def_macosx_bundle
5846 $def_macosx_finder
5847 $def_priority
5848 $def_quicktime
5849 $def_restrict_keyword
5850 $def_rtc
5851 $def_unrar_exec
5854 /* configurable options */
5855 $def_charset
5856 $def_crash_debug
5857 $def_debug
5858 $def_fastmemcpy
5859 $def_runtime_cpudetection
5860 $def_sighandler
5861 $def_sortsub
5862 $def_stream_cache
5863 $def_pthread_cache
5866 /* CPU stuff */
5867 #define __CPU__ $iproc
5868 $def_ebx_available
5869 $def_words_endian
5870 $def_bigendian
5871 $(ff_config_enable "$arch_all" "$arch" "ARCH")
5872 $(ff_config_enable "$subarch_all" "$subarch" "ARCH")
5873 $(ff_config_enable "$cpuexts_all" "$cpuexts" "HAVE")
5876 /* Blu-ray/DVD/VCD/CD */
5877 #define DEFAULT_CDROM_DEVICE "$default_cdrom_device"
5878 #define DEFAULT_DVD_DEVICE "$default_dvd_device"
5879 $def_bluray
5880 $def_bsdi_dvd
5881 $def_cdda
5882 $def_cddb
5883 $def_cdio
5884 $def_cdrom
5885 $def_dvd
5886 $def_dvd_bsd
5887 $def_dvd_darwin
5888 $def_dvd_linux
5889 $def_dvd_openbsd
5890 $def_dvdio
5891 $def_dvdnav
5892 $def_dvdread
5893 $def_hpux_scsi_h
5894 $def_sol_scsi_h
5895 $def_vcd
5898 /* codec libraries */
5899 $def_faad
5900 $def_liba52
5901 $def_libdca
5902 $def_libdv
5903 $def_mad
5904 $def_mpg123
5905 $def_musepack
5906 $def_speex
5907 $def_theora
5908 $def_tremor
5909 $def_vorbis
5910 $def_xvid
5911 $def_zlib
5913 $def_libpostproc
5914 $def_libnut
5917 /* binary codecs */
5918 $def_qtx
5919 $def_qtx_win32
5920 $def_real
5921 $def_win32_loader
5922 $def_win32dll
5923 $def_xanim
5924 $def_xmms
5925 #define BINARY_CODECS_PATH "$_codecsdir"
5926 #define XMMS_INPUT_PLUGIN_DIR "$_xmmsplugindir"
5929 /* Audio output drivers */
5930 $def_alsa
5931 $def_coreaudio
5932 $def_jack
5933 $def_nas
5934 $def_openal
5935 $def_openal_h
5936 $def_ossaudio
5937 $def_ossaudio_devdsp
5938 $def_ossaudio_devmixer
5939 $def_pulse
5940 $def_portaudio
5941 $def_rsound
5943 $def_ladspa
5944 $def_libbs2b
5947 /* input */
5948 $def_apple_ir
5949 $def_apple_remote
5950 $def_ioctl_bt848_h_name
5951 $def_ioctl_meteor_h_name
5952 $def_joystick
5953 $def_lirc
5954 $def_lircc
5955 $def_pvr
5956 $def_radio
5957 $def_radio_bsdbt848
5958 $def_radio_capture
5959 $def_radio_v4l
5960 $def_radio_v4l2
5961 $def_tv
5962 $def_tv_bsdbt848
5963 $def_tv_dshow
5964 $def_tv_v4l
5965 $def_tv_v4l1
5966 $def_tv_v4l2
5969 /* font stuff */
5970 $def_ass
5971 $def_enca
5973 /* networking */
5974 $def_closesocket
5975 $def_ftp
5976 $def_inet6
5977 $def_inet_aton
5978 $def_inet_pton
5979 $def_networking
5980 $def_smb
5981 $def_libquvi
5982 $def_socklen_t
5983 $def_vstream
5985 $def_lcms2
5988 /* libvo options */
5989 $def_caca
5990 $def_corevideo
5991 $def_cocoa
5992 $def_sharedbuffer
5993 $def_direct3d
5994 $def_directfb
5995 $def_directx
5996 $def_dvbin
5997 $def_gif
5998 $def_gif_4
5999 $def_gif_tvt_hack
6000 $def_gl
6001 $def_gl_cocoa
6002 $def_gl_win32
6003 $def_gl_x11
6004 $def_gl_sdl
6005 $def_jpeg
6006 $def_md5sum
6007 $def_mng
6008 $def_png
6009 $def_pnm
6010 $def_sdl
6011 $def_sdl_sdl_h
6012 $def_tga
6013 $def_v4l2
6014 $def_vdpau
6015 $def_vm
6016 $def_x11
6017 $def_xdpms
6018 $def_xf86keysym
6019 $def_xinerama
6020 $def_xss
6021 $def_xv
6022 $def_yuv4mpeg
6025 /* FFmpeg */
6026 $def_ffmpeg_internals
6028 $def_arpa_inet_h
6029 $def_bswap
6030 $def_dcbzl
6031 $def_exp2
6032 $def_exp2f
6033 $def_fast_64bit
6034 $def_fast_unaligned
6035 $def_llrint
6036 $def_log2
6037 $def_log2f
6038 $def_lrint
6039 $def_memalign_hack
6040 $def_mkstemp
6041 $def_posix_memalign
6042 $def_pthreads
6043 $def_round
6044 $def_roundf
6045 $def_threads
6046 $def_truncf
6047 $def_xform_asm
6048 $def_yasm
6050 #define HAVE_INLINE_ASM 1
6052 /* Use these registers in x86 inline asm. No proper detection yet. */
6053 #define HAVE_EBP_AVAILABLE 1
6055 #endif /* MPLAYER_CONFIG_H */
6058 # Do not overwrite an unchanged config.h to avoid superfluous rebuilds.
6059 cmp -s "$TMPH" config.h || mv -f "$TMPH" config.h
6061 #############################################################################
6063 cat << EOF
6065 Config files successfully generated by ./configure $configuration !
6067 Install prefix: $_prefix
6068 Data directory: $_datadir
6069 Config direct.: $_confdir
6071 Byte order: $_byte_order
6072 Optimizing for: $_optimizing
6074 Languages:
6075 Messages (in addition to English): $language_msg
6076 Manual pages: $language_man
6077 Documentation: $language_doc
6079 Enabled optional drivers:
6080 Input: $inputmodules
6081 Codecs: $codecmodules
6082 Audio output: $aomodules
6083 Video output: $vomodules
6085 Disabled optional drivers:
6086 Input: $noinputmodules
6087 Codecs: $nocodecmodules
6088 Audio output: $noaomodules
6089 Video output: $novomodules
6091 'config.h' and 'config.mak' contain your configuration options.
6092 Note: If you alter theses files (for instance CFLAGS) MPlayer may no longer
6093 compile *** DO NOT REPORT BUGS if you tweak these files ***
6095 'make' will now compile MPlayer and 'make install' will install it.
6096 Note: On non-Linux systems you might need to use 'gmake' instead of 'make'.
6101 cat <<EOF
6102 Check $TMPLOG if you wonder why an autodetection failed (make sure
6103 development headers/packages are installed).
6105 NOTE: The --enable-* parameters unconditionally force options on, completely
6106 skipping autodetection. This behavior is unlike what you may be used to from
6107 autoconf-based configure scripts that can decide to override you. This greater
6108 level of control comes at a price. You may have to provide the correct compiler
6109 and linker flags yourself.
6110 If you used one of these options (except --enable-runtime-cpudetection and
6111 similar ones that turn on internal features) and experience a compilation or
6112 linking failure, make sure you have passed the necessary compiler/linker flags
6113 to configure.
6115 If you suspect a bug, please read DOCS/HTML/$language_doc/bugreports.html.
6119 if test "$warn_cflags" = yes; then
6120 cat <<EOF
6122 MPlayer compilation will use the CPPFLAGS/CFLAGS/LDFLAGS/YASMFLAGS set by you,
6123 but:
6125 *** *** DO NOT REPORT BUGS IF IT DOES NOT COMPILE/WORK! *** ***
6127 It is strongly recommended to let MPlayer choose the correct CFLAGS!
6128 To do so, execute 'CFLAGS= ./configure <options>'
6133 # Last move:
6134 rm -rf "$mplayer_tmpdir"