docs: document --quvi-format
[mplayer.git] / configure
blob234c6639df13c1078f9a0d020549d6734f7f198f
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 _x11=auto
531 _xshape=auto
532 _xss=auto
533 _xv=auto
534 _vdpau=auto
535 _sdl=auto
536 _direct3d=auto
537 _directx=auto
538 _nas=auto
539 _png=auto
540 _mng=auto
541 _jpeg=auto
542 _pnm=yes
543 _md5sum=yes
544 _yuv4mpeg=yes
545 _gif=auto
546 _gl=auto
547 _aa=auto
548 _caca=auto
549 _dvb=auto
550 _v4l2=auto
551 _iconv=auto
552 _langinfo=auto
553 _rtc=auto
554 _ossaudio=auto
555 _rsound=auto
556 _pulse=auto
557 _portaudio=auto
558 _jack=auto
559 _openal=no
560 _libcdio=auto
561 _mad=auto
562 _tremor=auto
563 _libvorbis=auto
564 _speex=auto
565 _theora=auto
566 _mpg123=auto
567 _liba52=auto
568 _libdca=auto
569 _faad=auto
570 _ladspa=auto
571 _libbs2b=auto
572 _xmms=no
573 _vcd=auto
574 _bluray=auto
575 _dvdnav=auto
576 _dvdnavconfig=dvdnav-config
577 _dvdreadconfig=dvdread-config
578 _dvdread=auto
579 _dvdread_internal=auto
580 _libdvdcss_internal=auto
581 _xanim=auto
582 _real=auto
583 _lcms2=auto
584 _xinerama=auto
585 _vm=auto
586 _xf86keysym=auto
587 _alsa=auto
588 _fastmemcpy=yes
589 _unrar_exec=auto
590 _win32dll=auto
591 _select=yes
592 _radio=no
593 _radio_capture=no
594 _radio_v4l=auto
595 _radio_v4l2=auto
596 _radio_bsdbt848=auto
597 _tv=yes
598 _tv_v4l1=auto
599 _tv_v4l2=auto
600 _tv_bsdbt848=auto
601 _tv_dshow=auto
602 _pvr=auto
603 networking=yes
604 _winsock2_h=auto
605 _smb=auto
606 _libquvi=auto
607 _joystick=no
608 _xvid=auto
609 _libnut=auto
610 _lirc=auto
611 _lircc=auto
612 _apple_remote=auto
613 _apple_ir=auto
614 _termcap=auto
615 _termios=auto
616 _tga=yes
617 _directfb=auto
618 #language=en
619 _shm=auto
620 _translation=no
621 _charset="UTF-8"
622 _crash_debug=no
623 _sighandler=yes
624 _libdv=auto
625 _cdda=auto
626 _cddb=auto
627 _big_endian=auto
628 _qtx=auto
629 _coreaudio=auto
630 _corevideo=auto
631 _cocoa=auto
632 _sharedbuffer=auto
633 quicktime=auto
634 _macosx_finder=no
635 _macosx_bundle=auto
636 _sortsub=yes
637 _enca=auto
638 _inet6=auto
639 _gethostbyname2=auto
640 _ftp=auto
641 _musepack=no
642 _vstream=auto
643 _pthreads=auto
644 _w32threads=auto
645 _ass=auto
646 _rpath=no
647 libpostproc=auto
648 _asmalign_pot=auto
649 _stream_cache=yes
650 _priority=no
651 def_dos_paths="#define HAVE_DOS_PATHS 0"
652 def_stream_cache="#define CONFIG_STREAM_CACHE 1"
653 def_priority="#undef CONFIG_PRIORITY"
654 def_pthread_cache="#undef PTHREAD_CACHE"
655 need_shmem=yes
656 for ac_option do
657 case "$ac_option" in
658 --help|-help|-h)
659 show_help
661 --prefix=*)
662 _prefix=$(echo $ac_option | cut -d '=' -f 2)
664 --bindir=*)
665 _bindir=$(echo $ac_option | cut -d '=' -f 2)
667 --datadir=*)
668 _datadir=$(echo $ac_option | cut -d '=' -f 2)
670 --mandir=*)
671 _mandir=$(echo $ac_option | cut -d '=' -f 2)
673 --confdir=*)
674 _confdir=$(echo $ac_option | cut -d '=' -f 2)
676 --libdir=*)
677 _libdir=$(echo $ac_option | cut -d '=' -f 2)
679 --codecsdir=*)
680 _codecsdir=$(echo $ac_option | cut -d '=' -f 2)
682 --localedir=*)
683 _localedir=$(echo $ac_option | cut -d '=' -f 2)
686 --with-install=*)
687 _install=$(echo $ac_option | cut -d '=' -f 2 )
690 --with-sdl-config=*)
691 _sdlconfig=$(echo $ac_option | cut -d '=' -f 2)
693 --with-dvdnav-config=*)
694 _dvdnavconfig=$(echo $ac_option | cut -d '=' -f 2)
696 --with-dvdread-config=*)
697 _dvdreadconfig=$(echo $ac_option | cut -d '=' -f 2)
700 --extra-cflags=*)
701 extra_cflags="$extra_cflags $(echo $ac_option | cut -d '=' -f 2-)"
703 --extra-ldflags=*)
704 extra_ldflags="$extra_ldflags $(echo $ac_option | cut -d '=' -f 2-)"
706 --extra-libs=*)
707 extra_libs=$(echo $ac_option | cut -d '=' -f 2)
709 --extra-libs-mplayer=*)
710 libs_mplayer=$(echo $ac_option | cut -d '=' -f 2)
713 --target=*)
714 _target=$(echo $ac_option | cut -d '=' -f 2)
716 --cc=*)
717 _cc=$(echo $ac_option | cut -d '=' -f 2)
719 --as=*)
720 _as=$(echo $ac_option | cut -d '=' -f 2)
722 --nm=*)
723 _nm=$(echo $ac_option | cut -d '=' -f 2)
725 --yasm=*)
726 _yasm=$(echo $ac_option | cut -d '=' -f 2)
728 --ar=*)
729 _ar=$(echo $ac_option | cut -d '=' -f 2)
731 --pkg-config=*)
732 _pkg_config=$(echo $ac_option | cut -d '=' -f 2)
734 --ranlib=*)
735 _ranlib=$(echo $ac_option | cut -d '=' -f 2)
737 --windres=*)
738 _windres=$(echo $ac_option | cut -d '=' -f 2)
740 --charset=*)
741 _charset=$(echo $ac_option | cut -d '=' -f 2)
743 --language-doc=*)
744 language_doc=$(echo $ac_option | cut -d '=' -f 2)
746 --language-man=*)
747 language_man=$(echo $ac_option | cut -d '=' -f 2)
749 --language-msg=*)
750 language_msg=$(echo $ac_option | cut -d '=' -f 2)
752 --language=*)
753 language=$(echo $ac_option | cut -d '=' -f 2)
756 --enable-static)
757 _ld_static='-static'
759 --disable-static)
760 _ld_static=''
762 --enable-profile)
763 _profile='-p'
765 --disable-profile)
766 _profile=
768 --enable-debug)
769 _debug='-g'
771 --enable-debug=*)
772 _debug=$(echo $_echo_n '-g'$_echo_c; echo $ac_option | cut -d '=' -f 2)
774 --disable-debug)
775 _debug=
777 --enable-translation) _translation=yes ;;
778 --disable-translation) _translation=no ;;
779 --enable-runtime-cpudetection) _runtime_cpudetection=yes ;;
780 --disable-runtime-cpudetection) _runtime_cpudetection=no ;;
781 --enable-cross-compile) _cross_compile=yes ;;
782 --disable-cross-compile) _cross_compile=no ;;
783 --enable-x11) _x11=yes ;;
784 --disable-x11) _x11=no ;;
785 --enable-xshape) _xshape=yes ;;
786 --disable-xshape) _xshape=no ;;
787 --enable-xss) _xss=yes ;;
788 --disable-xss) _xss=no ;;
789 --enable-xv) _xv=yes ;;
790 --disable-xv) _xv=no ;;
791 --enable-vdpau) _vdpau=yes ;;
792 --disable-vdpau) _vdpau=no ;;
793 --enable-sdl) _sdl=yes ;;
794 --disable-sdl) _sdl=no ;;
795 --enable-direct3d) _direct3d=yes ;;
796 --disable-direct3d) _direct3d=no ;;
797 --enable-directx) _directx=yes ;;
798 --disable-directx) _directx=no ;;
799 --enable-png) _png=yes ;;
800 --disable-png) _png=no ;;
801 --enable-mng) _mng=yes ;;
802 --disable-mng) _mng=no ;;
803 --enable-jpeg) _jpeg=yes ;;
804 --disable-jpeg) _jpeg=no ;;
805 --enable-pnm) _pnm=yes ;;
806 --disable-pnm) _pnm=no ;;
807 --enable-md5sum) _md5sum=yes ;;
808 --disable-md5sum) _md5sum=no ;;
809 --enable-yuv4mpeg) _yuv4mpeg=yes ;;
810 --disable-yuv4mpeg) _yuv4mpeg=no ;;
811 --enable-gif) _gif=yes ;;
812 --disable-gif) _gif=no ;;
813 --enable-gl) _gl=yes ;;
814 --disable-gl) _gl=no ;;
815 --enable-caca) _caca=yes ;;
816 --disable-caca) _caca=no ;;
817 --enable-dvb) _dvb=yes ;;
818 --disable-dvb) _dvb=no ;;
819 --enable-v4l2) _v4l2=yes ;;
820 --disable-v4l2) _v4l2=no ;;
821 --enable-iconv) _iconv=yes ;;
822 --disable-iconv) _iconv=no ;;
823 --enable-langinfo) _langinfo=yes ;;
824 --disable-langinfo) _langinfo=no ;;
825 --enable-rtc) _rtc=yes ;;
826 --disable-rtc) _rtc=no ;;
827 --enable-libdv) _libdv=yes ;;
828 --disable-libdv) _libdv=no ;;
829 --enable-ossaudio) _ossaudio=yes ;;
830 --disable-ossaudio) _ossaudio=no ;;
831 --enable-rsound) _rsound=yes ;;
832 --disable-rsound) _rsound=no ;;
833 --enable-pulse) _pulse=yes ;;
834 --disable-pulse) _pulse=no ;;
835 --enable-portaudio) _portaudio=yes ;;
836 --disable-portaudio) _portaudio=no ;;
837 --enable-jack) _jack=yes ;;
838 --disable-jack) _jack=no ;;
839 --enable-openal) _openal=yes ;;
840 --disable-openal) _openal=no ;;
841 --enable-mad) _mad=yes ;;
842 --disable-mad) _mad=no ;;
843 --enable-libcdio) _libcdio=yes ;;
844 --disable-libcdio) _libcdio=no ;;
845 --enable-libvorbis) _libvorbis=yes ;;
846 --disable-libvorbis) _libvorbis=no ;;
847 --enable-speex) _speex=yes ;;
848 --disable-speex) _speex=no ;;
849 --enable-tremor) _tremor=yes ;;
850 --disable-tremor) _tremor=no ;;
851 --enable-theora) _theora=yes ;;
852 --disable-theora) _theora=no ;;
853 --enable-mpg123) _mpg123=yes ;;
854 --disable-mpg123) _mpg123=no ;;
855 --enable-liba52) _liba52=yes ;;
856 --disable-liba52) _liba52=no ;;
857 --enable-libdca) _libdca=yes ;;
858 --disable-libdca) _libdca=no ;;
859 --enable-musepack) _musepack=yes ;;
860 --disable-musepack) _musepack=no ;;
861 --enable-faad) _faad=yes ;;
862 --disable-faad) _faad=no ;;
863 --enable-ladspa) _ladspa=yes ;;
864 --disable-ladspa) _ladspa=no ;;
865 --enable-libbs2b) _libbs2b=yes ;;
866 --disable-libbs2b) _libbs2b=no ;;
867 --enable-xmms) _xmms=yes ;;
868 --disable-xmms) _xmms=no ;;
869 --enable-vcd) _vcd=yes ;;
870 --disable-vcd) _vcd=no ;;
871 --enable-bluray) _bluray=yes ;;
872 --disable-bluray) _bluray=no ;;
873 --enable-dvdread) _dvdread=yes ;;
874 --disable-dvdread) _dvdread=no ;;
875 --enable-dvdread-internal) _dvdread_internal=yes ;;
876 --disable-dvdread-internal) _dvdread_internal=no ;;
877 --enable-libdvdcss-internal) _libdvdcss_internal=yes ;;
878 --disable-libdvdcss-internal) _libdvdcss_internal=no ;;
879 --enable-dvdnav) _dvdnav=yes ;;
880 --disable-dvdnav) _dvdnav=no ;;
881 --enable-xanim) _xanim=yes ;;
882 --disable-xanim) _xanim=no ;;
883 --enable-real) _real=yes ;;
884 --disable-real) _real=no ;;
885 --enable-lcms2) _lcms2=yes ;;
886 --disable-lcms2) _lcms2=no ;;
887 --enable-xinerama) _xinerama=yes ;;
888 --disable-xinerama) _xinerama=no ;;
889 --enable-vm) _vm=yes ;;
890 --disable-vm) _vm=no ;;
891 --enable-xf86keysym) _xf86keysym=yes ;;
892 --disable-xf86keysym) _xf86keysym=no ;;
893 --enable-alsa) _alsa=yes ;;
894 --disable-alsa) _alsa=no ;;
895 --enable-tv) _tv=yes ;;
896 --disable-tv) _tv=no ;;
897 --enable-tv-bsdbt848) _tv_bsdbt848=yes ;;
898 --disable-tv-bsdbt848) _tv_bsdbt848=no ;;
899 --enable-tv-v4l1) _tv_v4l1=yes ;;
900 --disable-tv-v4l1) _tv_v4l1=no ;;
901 --enable-tv-v4l2) _tv_v4l2=yes ;;
902 --disable-tv-v4l2) _tv_v4l2=no ;;
903 --enable-tv-dshow) _tv_dshow=yes ;;
904 --disable-tv-dshow) _tv_dshow=no ;;
905 --enable-radio) _radio=yes ;;
906 --enable-radio-capture) _radio_capture=yes ;;
907 --disable-radio-capture) _radio_capture=no ;;
908 --disable-radio) _radio=no ;;
909 --enable-radio-v4l) _radio_v4l=yes ;;
910 --disable-radio-v4l) _radio_v4l=no ;;
911 --enable-radio-v4l2) _radio_v4l2=yes ;;
912 --disable-radio-v4l2) _radio_v4l2=no ;;
913 --enable-radio-bsdbt848) _radio_bsdbt848=yes ;;
914 --disable-radio-bsdbt848) _radio_bsdbt848=no ;;
915 --enable-pvr) _pvr=yes ;;
916 --disable-pvr) _pvr=no ;;
917 --enable-fastmemcpy) _fastmemcpy=yes ;;
918 --disable-fastmemcpy) _fastmemcpy=no ;;
919 --enable-networking) networking=yes ;;
920 --disable-networking) networking=no ;;
921 --enable-winsock2_h) _winsock2_h=yes ;;
922 --disable-winsock2_h) _winsock2_h=no ;;
923 --enable-smb) _smb=yes ;;
924 --disable-smb) _smb=no ;;
925 --enable-libquvi) _libquvi=yes ;;
926 --disable-libquvi) _libquvi=no ;;
927 --enable-joystick) _joystick=yes ;;
928 --disable-joystick) _joystick=no ;;
929 --enable-xvid) _xvid=yes ;;
930 --disable-xvid) _xvid=no ;;
931 --enable-libnut) _libnut=yes ;;
932 --disable-libnut) _libnut=no ;;
933 --enable-libav) ffmpeg=yes ;;
934 --ffmpeg-source-dir=*)
935 _ffmpeg_source=$(echo $ac_option | cut -d '=' -f 2 ) ;;
937 --enable-lirc) _lirc=yes ;;
938 --disable-lirc) _lirc=no ;;
939 --enable-lircc) _lircc=yes ;;
940 --disable-lircc) _lircc=no ;;
941 --enable-apple-remote) _apple_remote=yes ;;
942 --disable-apple-remote) _apple_remote=no ;;
943 --enable-apple-ir) _apple_ir=yes ;;
944 --disable-apple-ir) _apple_ir=no ;;
945 --enable-termcap) _termcap=yes ;;
946 --disable-termcap) _termcap=no ;;
947 --enable-termios) _termios=yes ;;
948 --disable-termios) _termios=no ;;
949 --disable-tga) _tga=no ;;
950 --enable-tga) _tga=yes ;;
951 --enable-directfb) _directfb=yes ;;
952 --disable-directfb) _directfb=no ;;
953 --enable-shm) _shm=yes ;;
954 --disable-shm) _shm=no ;;
955 --enable-select) _select=yes ;;
956 --disable-select) _select=no ;;
957 --enable-cddb) _cddb=yes ;;
958 --disable-cddb) _cddb=no ;;
959 --enable-big-endian) _big_endian=yes ;;
960 --disable-big-endian) _big_endian=no ;;
961 --enable-unrarexec) _unrar_exec=yes ;;
962 --disable-unrarexec) _unrar_exec=no ;;
963 --enable-ftp) _ftp=yes ;;
964 --disable-ftp) _ftp=no ;;
965 --enable-vstream) _vstream=yes ;;
966 --disable-vstream) _vstream=no ;;
967 --enable-pthreads) _pthreads=yes ;;
968 --disable-pthreads) _pthreads=no ;;
969 --enable-w32threads) _w32threads=yes ;;
970 --disable-w32threads) _w32threads=no ;;
971 --enable-libass) _ass=yes ;;
972 --disable-libass) _ass=no ;;
973 --enable-rpath) _rpath=yes ;;
974 --disable-rpath) _rpath=no ;;
975 --enable-libpostproc) libpostproc=yes ;;
976 --disable-libpostproc) libpostproc=no ;;
978 --enable-enca) _enca=yes ;;
979 --disable-enca) _enca=no ;;
981 --enable-inet6) _inet6=yes ;;
982 --disable-inet6) _inet6=no ;;
984 --enable-gethostbyname2) _gethostbyname2=yes ;;
985 --disable-gethostbyname2) _gethostbyname2=no ;;
987 --enable-qtx) _qtx=yes ;;
988 --disable-qtx) _qtx=no ;;
990 --enable-coreaudio) _coreaudio=yes ;;
991 --disable-coreaudio) _coreaudio=no ;;
992 --enable-corevideo) _corevideo=yes ;;
993 --disable-corevideo) _corevideo=no ;;
994 --enable-cocoa) _cocoa=yes ;;
995 --disable-cocoa) _cocoa=no ;;
996 --enable-sharedbuffer) _sharedbuffer=yes ;;
997 --disable-sharedbuffer) _sharedbuffer=no ;;
998 --enable-macosx-finder) _macosx_finder=yes ;;
999 --disable-macosx-finder) _macosx_finder=no ;;
1000 --enable-macosx-bundle) _macosx_bundle=yes ;;
1001 --disable-macosx-bundle) _macosx_bundle=no ;;
1003 --enable-sortsub) _sortsub=yes ;;
1004 --disable-sortsub) _sortsub=no ;;
1006 --enable-crash-debug) _crash_debug=yes ;;
1007 --disable-crash-debug) _crash_debug=no ;;
1008 --enable-sighandler) _sighandler=yes ;;
1009 --disable-sighandler) _sighandler=no ;;
1010 --enable-win32dll) _win32dll=yes ;;
1011 --disable-win32dll) _win32dll=no ;;
1013 --enable-sse) _sse=yes ;;
1014 --disable-sse) _sse=no ;;
1015 --enable-sse2) _sse2=yes ;;
1016 --disable-sse2) _sse2=no ;;
1017 --enable-ssse3) _ssse3=yes ;;
1018 --disable-ssse3) _ssse3=no ;;
1019 --enable-mmxext) _mmxext=yes ;;
1020 --disable-mmxext) _mmxext=no ;;
1021 --enable-3dnow) _3dnow=yes ;;
1022 --disable-3dnow) _3dnow=no _3dnowext=no ;;
1023 --enable-3dnowext) _3dnow=yes _3dnowext=yes ;;
1024 --disable-3dnowext) _3dnowext=no ;;
1025 --enable-cmov) _cmov=yes ;;
1026 --disable-cmov) _cmov=no ;;
1027 --enable-fast-cmov) _fast_cmov=yes ;;
1028 --disable-fast-cmov) _fast_cmov=no ;;
1029 --enable-fast-clz) _fast_clz=yes ;;
1030 --disable-fast-clz) _fast_clz=no ;;
1031 --enable-altivec) _altivec=yes ;;
1032 --disable-altivec) _altivec=no ;;
1033 --enable-armv5te) _armv5te=yes ;;
1034 --disable-armv5te) _armv5te=no ;;
1035 --enable-armv6) _armv6=yes ;;
1036 --disable-armv6) _armv6=no ;;
1037 --enable-armv6t2) _armv6t2=yes ;;
1038 --disable-armv6t2) _armv6t2=no ;;
1039 --enable-armvfp) _armvfp=yes ;;
1040 --disable-armvfp) _armvfp=no ;;
1041 --enable-neon) neon=yes ;;
1042 --disable-neon) neon=no ;;
1043 --enable-iwmmxt) _iwmmxt=yes ;;
1044 --disable-iwmmxt) _iwmmxt=no ;;
1045 --enable-mmx) _mmx=yes ;;
1046 --disable-mmx) # 3Dnow! and MMX2 require MMX
1047 _3dnow=no _3dnowext=no _mmx=no _mmxext=no ;;
1050 echo "Unknown parameter: $ac_option" >&2
1051 exit 1
1054 esac
1055 done
1057 # Atmos: moved this here, to be correct, if --prefix is specified
1058 test -z "$_bindir" && _bindir="$_prefix/bin"
1059 test -z "$_datadir" && _datadir="$_prefix/share/mplayer"
1060 test -z "$_mandir" && _mandir="$_prefix/share/man"
1061 test -z "$_confdir" && _confdir="$_prefix/etc/mplayer"
1062 test -z "$_libdir" && _libdir="$_prefix/lib"
1063 test -z "$_localedir" && _localedir="$_prefix/share/locale"
1065 for tmpdir in "$TMPDIR" "$TEMPDIR" "/tmp" ; do
1066 test "$tmpdir" && break
1067 done
1069 mplayer_tmpdir="$tmpdir/mplayer-configure-$RANDOM-$$"
1070 mkdir $mplayer_tmpdir || die "Unable to create tmpdir."
1072 TMPLOG="config.log"
1074 rm -f "$TMPLOG"
1075 echo Parameters configure was run with: > "$TMPLOG"
1076 if test -n "$CFLAGS" ; then
1077 echo ${_echo_n} CFLAGS="'$CFLAGS' ${_echo_c}" >> "$TMPLOG"
1079 if test -n "$PKG_CONFIG_PATH" ; then
1080 echo ${_echo_n} PKG_CONFIG_PATH="'$PKG_CONFIG_PATH' ${_echo_c}" >> "$TMPLOG"
1082 echo ./configure $configuration >> "$TMPLOG"
1083 echo >> "$TMPLOG"
1086 echocheck "cross compilation"
1087 echores $_cross_compile
1089 if test $_cross_compile = yes; then
1090 tmp_run() {
1091 return 0
1095 tool_prefix=""
1097 if test $_cross_compile = yes ; then
1098 # Usually cross-compiler prefixes match with the target triplet
1099 test -n "$_target" && tool_prefix="$_target"-
1102 test "$_ranlib" = auto && _ranlib="$tool_prefix"ranlib
1103 test "$_windres" = auto && _windres="$tool_prefix"windres
1104 test "$_ar" = auto && _ar="$tool_prefix"ar
1105 test "$_yasm" = auto && _yasm="$tool_prefix"yasm
1106 test "$_pkg_config" = auto && _pkg_config="$tool_prefix"pkg-config
1108 if test "$_cc" = auto ; then
1109 if test -n "$tool_prefix" ; then
1110 _cc="$tool_prefix"gcc
1111 else
1112 _cc=cc
1116 # Determine our OS name and CPU architecture
1117 if test -z "$_target" ; then
1118 # OS name
1119 system_name=$(uname -s 2>&1)
1120 case "$system_name" in
1121 Linux|FreeBSD|NetBSD|OpenBSD|DragonFly|BSD/OS|Darwin|QNX|GNU|BeOS|MorphOS|AIX|AmigaOS)
1123 Haiku)
1124 system_name=BeOS
1126 GNU/kFreeBSD)
1127 system_name=FreeBSD
1129 HP-UX*)
1130 system_name=HP-UX
1132 [cC][yY][gG][wW][iI][nN]*)
1133 system_name=CYGWIN
1135 MINGW32*)
1136 system_name=MINGW32
1138 OS/2*)
1139 system_name=OS/2
1142 system_name="$system_name-UNKNOWN"
1144 esac
1147 # host's CPU/instruction set
1148 host_arch=$(uname -p 2>&1)
1149 case "$host_arch" in
1150 i386|sparc|ppc|alpha|arm|mips|vax)
1152 powerpc) # Darwin returns 'powerpc'
1153 host_arch=ppc
1155 *) # uname -p on Linux returns 'unknown' for the processor type,
1156 # OpenBSD returns 'Intel Pentium/MMX ("Genuine Intel" 586-class)'
1158 # Maybe uname -m (machine hardware name) returns something we
1159 # recognize.
1161 # x86/x86pc is used by QNX
1162 case "$(uname -m 2>&1)" in
1163 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 ;;
1164 ia64) host_arch=ia64 ;;
1165 macppc|ppc) host_arch=ppc ;;
1166 ppc64) host_arch=ppc64 ;;
1167 alpha) host_arch=alpha ;;
1168 sparc) host_arch=sparc ;;
1169 sparc64) host_arch=sparc64 ;;
1170 parisc*|hppa*|9000*) host_arch=hppa ;;
1171 arm*|zaurus|cats) host_arch=arm ;;
1172 sh3|sh4|sh4a) host_arch=sh ;;
1173 s390) host_arch=s390 ;;
1174 s390x) host_arch=s390x ;;
1175 *mips*) host_arch=mips ;;
1176 vax) host_arch=vax ;;
1177 xtensa*) host_arch=xtensa ;;
1178 *) host_arch=UNKNOWN ;;
1179 esac
1181 esac
1182 else # if test -z "$_target"
1183 for i in 2 3; do
1184 system_name=$(echo $_target | cut -d '-' -f $i)
1185 case "$(echo $system_name | tr A-Z a-z)" in
1186 linux) system_name=Linux ;;
1187 freebsd) system_name=FreeBSD ;;
1188 gnu/kfreebsd) system_name=FreeBSD ;;
1189 netbsd) system_name=NetBSD ;;
1190 bsd/os) system_name=BSD/OS ;;
1191 openbsd) system_name=OpenBSD ;;
1192 dragonfly) system_name=DragonFly ;;
1193 qnx) system_name=QNX ;;
1194 morphos) system_name=MorphOS ;;
1195 amigaos) system_name=AmigaOS ;;
1196 mingw32*) system_name=MINGW32 ;;
1197 *) continue ;;
1198 esac
1199 break
1200 done
1201 # We need to convert underscores so that values like k6-2 and pentium-mmx can be passed
1202 host_arch=$(echo $_target | cut -d '-' -f 1)
1203 if test $(echo $host_arch) != "x86_64" ; then
1204 host_arch=$(echo $host_arch | tr '_' '-')
1208 extra_cflags="-I. $extra_cflags"
1209 _timer=timer-linux.c
1210 _getch=getch2.c
1211 if freebsd ; then
1212 extra_ldflags="$extra_ldflags -L/usr/local/lib"
1213 extra_cflags="$extra_cflags -I/usr/local/include"
1216 if netbsd || dragonfly ; then
1217 extra_ldflags="$extra_ldflags -L/usr/pkg/lib"
1218 extra_cflags="$extra_cflags -I/usr/pkg/include"
1221 if darwin; then
1222 extra_cflags="-mdynamic-no-pic $extra_cflags"
1223 _timer=timer-darwin.c
1226 if aix ; then
1227 extra_ldflags="$extra_ldflags -lC"
1230 if linux ; then
1231 _ranlib='true'
1234 if win32 ; then
1235 _exesuf=".exe"
1236 extra_cflags="$extra_cflags -fno-common"
1237 # -lwinmm is always needed for osdep/timer-win2.c
1238 extra_ldflags="$extra_ldflags -lwinmm"
1239 _pe_executable=yes
1240 _timer=timer-win2.c
1241 _priority=yes
1242 def_dos_paths="#define HAVE_DOS_PATHS 1"
1243 def_priority="#define CONFIG_PRIORITY 1"
1246 if mingw32 ; then
1247 _getch=getch2-win.c
1248 need_shmem=no
1249 extra_cflags="$extra_cflags -D__USE_MINGW_ANSI_STDIO=1"
1252 if amigaos ; then
1253 _select=no
1254 _sighandler=no
1255 _stream_cache=no
1256 def_stream_cache="#undef CONFIG_STREAM_CACHE"
1257 extra_cflags="-DNEWLIB -D__USE_INLINE__ $extra_cflags"
1260 if qnx ; then
1261 extra_ldflags="$extra_ldflags -lph"
1264 TMPC="$mplayer_tmpdir/tmp.c"
1265 TMPEXE="$mplayer_tmpdir/tmp$_exesuf"
1266 TMPH="$mplayer_tmpdir/tmp.h"
1267 TMPS="$mplayer_tmpdir/tmp.S"
1269 if test "$_runtime_cpudetection" = yes && ! x86 && ! ppc; then
1270 die "Runtime CPU detection only works for x86, x86-64 and PPC!"
1274 # Checking CC version...
1275 # Intel C++ Compilers (no autoselect, use CC=/some/binary ./configure)
1276 if test "$(basename $_cc)" = "icc" || test "$(basename $_cc)" = "ecc"; then
1277 echocheck "$_cc version"
1278 cc_vendor=intel
1279 cc_name=$($_cc -V 2>&1 | head -n 1 | cut -d ',' -f 1)
1280 cc_version=$($_cc -V 2>&1 | head -n 1 | cut -d ',' -f 2 | cut -d ' ' -f 3)
1281 _cc_major=$(echo $cc_version | cut -d '.' -f 1)
1282 _cc_minor=$(echo $cc_version | cut -d '.' -f 2)
1283 # TODO verify older icc/ecc compatibility
1284 case $cc_version in
1286 cc_version="v. ?.??, bad"
1287 cc_fail=yes
1289 10.1|11.0|11.1)
1290 cc_version="$cc_version, ok"
1293 cc_version="$cc_version, bad"
1294 cc_fail=yes
1296 esac
1297 echores "$cc_version"
1298 else
1299 for _cc in "$_cc" gcc cc ; do
1300 cc_name_tmp=$($_cc -v 2>&1 | tail -n 1 | cut -d ' ' -f 1)
1301 if test "$cc_name_tmp" = "gcc"; then
1302 cc_name=$cc_name_tmp
1303 echocheck "$_cc version"
1304 cc_vendor=gnu
1305 cc_version=$($_cc -dumpversion 2>&1)
1306 case $cc_version in
1307 2.96*)
1308 cc_fail=yes
1311 _cc_major=$(echo $cc_version | cut -d '.' -f 1)
1312 _cc_minor=$(echo $cc_version | cut -d '.' -f 2)
1313 _cc_mini=$(echo $cc_version | cut -d '.' -f 3)
1315 esac
1316 echores "$cc_version"
1317 break
1319 if $_cc -v 2>&1 | grep -q "clang"; then
1320 echocheck "$_cc version"
1321 cc_vendor=clang
1322 cc_version=$($_cc -dumpversion 2>&1)
1323 res_comment="experimental support only"
1324 echores "clang $cc_version"
1325 break
1327 cc_name_tmp=$($_cc -V 2>&1 | head -n 1 | cut -d ' ' -f 2,3)
1328 done
1329 fi # icc
1330 test "$cc_fail" = yes && die "unsupported compiler version"
1332 echocheck "working compiler"
1333 cflag_check "" || die "Compiler is not functioning correctly. Check your installation and custom CFLAGS $CFLAGS ."
1334 echo "yes"
1336 if test -z "$_target" && x86 ; then
1337 cat > $TMPC << EOF
1338 int main(void) {
1339 int test[(int)sizeof(char *)-7];
1340 return 0;
1343 cc_check && host_arch=x86_64 || host_arch=i386
1346 echo "Detected operating system: $system_name"
1347 echo "Detected host architecture: $host_arch"
1349 # ---
1351 # now that we know what compiler should be used for compilation, try to find
1352 # out which assembler is used by the $_cc compiler
1353 if test "$_as" = auto ; then
1354 _as=$($_cc -print-prog-name=as)
1355 test -z "$_as" && _as=as
1358 if test "$_nm" = auto ; then
1359 _nm=$($_cc -print-prog-name=nm)
1360 test -z "$_nm" && _nm=nm
1363 # XXX: this should be ok..
1364 _cpuinfo="echo"
1366 if test "$_runtime_cpudetection" = no ; then
1368 # Cygwin has /proc/cpuinfo, but only supports Intel CPUs
1369 # FIXME: Remove the cygwin check once AMD CPUs are supported
1370 if test -r /proc/cpuinfo && ! cygwin; then
1371 # Linux with /proc mounted, extract CPU information from it
1372 _cpuinfo="cat /proc/cpuinfo"
1373 elif test -r /compat/linux/proc/cpuinfo && ! x86 ; then
1374 # FreeBSD with Linux emulation /proc mounted,
1375 # extract CPU information from it
1376 # Don't use it on x86 though, it never reports 3Dnow
1377 _cpuinfo="cat /compat/linux/proc/cpuinfo"
1378 elif darwin && ! x86 ; then
1379 # use hostinfo on Darwin
1380 _cpuinfo="hostinfo"
1381 elif aix; then
1382 # use 'lsattr' on AIX
1383 _cpuinfo="lsattr -E -l proc0 -a type"
1384 elif x86; then
1385 # all other OSes try to extract CPU information from a small helper
1386 # program cpuinfo instead
1387 $_cc -o cpuinfo$_exesuf cpuinfo.c
1388 _cpuinfo="./cpuinfo$_exesuf"
1391 if x86 ; then
1392 # gather more CPU information
1393 pname=$($_cpuinfo | grep 'model name' | cut -d ':' -f 2 | head -n 1)
1394 pvendor=$($_cpuinfo | grep 'vendor_id' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1)
1395 pfamily=$($_cpuinfo | grep 'cpu family' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1)
1396 pmodel=$($_cpuinfo | grep -v 'model name' | grep 'model' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1)
1397 pstepping=$($_cpuinfo | grep 'stepping' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1)
1399 exts=$($_cpuinfo | egrep 'features|flags' | cut -d ':' -f 2 | head -n 1)
1401 pparam=$(echo $exts | sed -e s/xmm/sse/ -e s/kni/sse/)
1402 # SSE implies MMX2, but not all SSE processors report the mmxext CPU flag.
1403 pparam=$(echo $pparam | sed -e 's/sse/sse mmxext/')
1405 for ext in $pparam ; do
1406 eval test \"\$_$ext\" = auto 2>/dev/null && eval _$ext=kernel_check
1407 done
1409 echocheck "CPU vendor"
1410 echores "$pvendor ($pfamily:$pmodel:$pstepping)"
1412 echocheck "CPU type"
1413 echores "$pname"
1416 fi # test "$_runtime_cpudetection" = no
1418 if x86 && test "$_runtime_cpudetection" = no ; then
1419 extcheck() {
1420 if test "$1" = kernel_check ; then
1421 echocheck "kernel support of $2"
1422 cat > $TMPC <<EOF
1423 #include <stdlib.h>
1424 #include <signal.h>
1425 static void catch(int sig) { exit(1); }
1426 int main(void) {
1427 signal(SIGILL, catch);
1428 __asm__ volatile ("$3":::"memory"); return 0;
1432 if cc_check && tmp_run ; then
1433 eval _$2=yes
1434 echores "yes"
1435 _optimizing="$_optimizing $2"
1436 return 0
1437 else
1438 eval _$2=no
1439 echores "failed"
1440 echo "It seems that your kernel does not correctly support $2."
1441 echo "To use $2 extensions in MPlayer, you have to upgrade/recompile your kernel!"
1442 return 1
1445 return 0
1448 extcheck $_mmx "mmx" "emms"
1449 extcheck $_mmxext "mmxext" "sfence"
1450 extcheck $_3dnow "3dnow" "femms"
1451 extcheck $_3dnowext "3dnowext" "pswapd %%mm0, %%mm0"
1452 extcheck $_sse "sse" "xorps %%xmm0, %%xmm0" || _gcc3_ext="$_gcc3_ext -mno-sse"
1453 extcheck $_sse2 "sse2" "xorpd %%xmm0, %%xmm0" || _gcc3_ext="$_gcc3_ext -mno-sse2"
1454 extcheck $_ssse3 "ssse3" "pabsd %%xmm0, %%xmm0"
1455 extcheck $_cmov "cmov" "cmovb %%eax, %%ebx"
1457 if test "$_gcc3_ext" != ""; then
1458 # if we had to disable sse/sse2 because the active kernel does not
1459 # support this instruction set extension, we also have to tell
1460 # gcc3 to not generate sse/sse2 instructions for normal C code
1461 cflag_check $_march $_gcc3_ext && _march="$_march $_gcc3_ext"
1467 def_fast_64bit='#define HAVE_FAST_64BIT 0'
1468 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 0'
1469 arch_all='X86 IA64 SPARC ARM AVR32 SH4 PPC ALPHA MIPS PA_RISC S390 S390X VAX BFIN XTENSA TOMI GENERIC'
1470 subarch_all='X86_32 X86_64 PPC64'
1471 case "$host_arch" in
1472 i[3-9]86|x86|x86pc|k5|k6|k6-2|k6-3|pentium*|athlon*|i586-i686)
1473 arch='x86'
1474 subarch='x86_32'
1475 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
1476 iproc=486
1477 proc=i486
1480 if test "$_runtime_cpudetection" = no ; then
1481 case "$pvendor" in
1482 AuthenticAMD)
1483 case "$pfamily" in
1484 3) proc=i386 iproc=386 ;;
1485 4) proc=i486 iproc=486 ;;
1486 5) iproc=586 # LGB: models are: K5/SSA5 K5 K5 K5 ? ? K6 K6 K6-2 K6-3
1487 # K6 model 13 are the K6-2+ and K6-III+, only differing in cache size.
1488 if test "$pmodel" -eq 9 -o "$pmodel" -eq 13; then
1489 proc=k6-3
1490 elif test "$pmodel" -eq 5 -o "$pmodel" -eq 10; then
1491 proc=geode
1492 elif test "$pmodel" -ge 8; then
1493 proc=k6-2
1494 elif test "$pmodel" -ge 6; then
1495 proc=k6
1496 else
1497 proc=i586
1500 6) iproc=686
1501 # It's a bit difficult to determine the correct type of Family 6
1502 # AMD CPUs just from their signature. Instead, we check directly
1503 # whether it supports SSE.
1504 if test "$_sse" = yes; then
1505 # gcc treats athlon-xp, athlon-4 and athlon-mp similarly.
1506 proc=athlon-xp
1507 else
1508 # Again, gcc treats athlon and athlon-tbird similarly.
1509 proc=athlon
1512 15) iproc=686
1513 # k8 cpu-type only supported in gcc >= 3.4.0, but that will be
1514 # caught and remedied in the optimization tests below.
1515 proc=k8
1518 *) proc=amdfam10 iproc=686
1519 test $_fast_clz = "auto" && _fast_clz=yes
1521 esac
1523 GenuineIntel)
1524 case "$pfamily" in
1525 3) proc=i386 iproc=386 ;;
1526 4) proc=i486 iproc=486 ;;
1527 5) iproc=586
1528 if test "$pmodel" -eq 4 || test "$pmodel" -eq 8; then
1529 proc=pentium-mmx # 4 is desktop, 8 is mobile
1530 else
1531 proc=i586
1534 6) iproc=686
1535 if test "$pmodel" -ge 15; then
1536 proc=core2
1537 elif test "$pmodel" -eq 9 -o "$pmodel" -ge 13; then
1538 proc=pentium-m
1539 elif test "$pmodel" -ge 7; then
1540 proc=pentium3
1541 elif test "$pmodel" -ge 3; then
1542 proc=pentium2
1543 else
1544 proc=i686
1546 test $_fast_clz = "auto" && _fast_clz=yes
1548 15) iproc=686
1549 # A nocona in 32-bit mode has no more capabilities than a prescott.
1550 if test "$pmodel" -ge 3; then
1551 proc=prescott
1552 else
1553 proc=pentium4
1554 test $_fast_clz = "auto" && _fast_clz=yes
1556 test $_fast_cmov = "auto" && _fast_cmov=no
1558 *) proc=prescott iproc=686 ;;
1559 esac
1561 CentaurHauls)
1562 case "$pfamily" in
1563 5) iproc=586
1564 if test "$pmodel" -ge 8; then
1565 proc=winchip2
1566 elif test "$pmodel" -ge 4; then
1567 proc=winchip-c6
1568 else
1569 proc=i586
1572 6) iproc=686
1573 if test "$pmodel" -ge 9; then
1574 proc=c3-2
1575 else
1576 proc=c3
1577 iproc=586
1580 *) proc=i686 iproc=i686 ;;
1581 esac
1583 unknown)
1584 case "$pfamily" in
1585 3) proc=i386 iproc=386 ;;
1586 4) proc=i486 iproc=486 ;;
1587 *) proc=i586 iproc=586 ;;
1588 esac
1591 proc=i586 iproc=586 ;;
1592 esac
1593 test $_fast_clz = "auto" && _fast_clz=no
1594 fi # test "$_runtime_cpudetection" = no
1597 # check that gcc supports our CPU, if not, fall back to earlier ones
1598 # LGB: check -mcpu and -march swithing step by step with enabling
1599 # to fall back till 386.
1601 # gcc >= 3.4.0 doesn't support -mcpu, we have to use -mtune instead
1603 if [ "$cc_vendor" = "gnu" ] && ([ "$_cc_major" -gt 3 ] || ( [ "$_cc_major" = 3 ] && [ "$_cc_minor" -ge 4 ])) ; then
1604 cpuopt=-mtune
1605 else
1606 cpuopt=-mcpu
1609 echocheck "GCC & CPU optimization abilities"
1610 if test "$_runtime_cpudetection" = no ; then
1611 if test $cc_vendor != "intel" && test $cc_vendor != "clang" ; then
1612 cflag_check -march=native && proc=native
1614 if test "$proc" = "amdfam10"; then
1615 cflag_check -march=$proc $cpuopt=$proc || proc=k8
1617 if test "$proc" = "k8"; then
1618 cflag_check -march=$proc $cpuopt=$proc || proc=athlon-xp
1620 if test "$proc" = "athlon-xp"; then
1621 cflag_check -march=$proc $cpuopt=$proc || proc=athlon
1623 if test "$proc" = "k6-3" || test "$proc" = "k6-2"; then
1624 cflag_check -march=$proc $cpuopt=$proc || proc=k6
1626 if test "$proc" = "k6" || test "$proc" = "c3"; then
1627 if ! cflag_check -march=$proc $cpuopt=$proc; then
1628 if cflag_check -march=i586 $cpuopt=i686; then
1629 proc=i586-i686
1630 else
1631 proc=i586
1635 if test "$proc" = "prescott" ; then
1636 cflag_check -march=$proc $cpuopt=$proc || proc=pentium4
1638 if test "$proc" = "core2" ; then
1639 cflag_check -march=$proc $cpuopt=$proc || proc=pentium-m
1641 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
1642 cflag_check -march=$proc $cpuopt=$proc || proc=i686
1644 if test "$proc" = "i686" || test "$proc" = "pentium-mmx" || test "$proc" = "winchip-c6" || test "$proc" = "winchip2"; then
1645 cflag_check -march=$proc $cpuopt=$proc || proc=i586
1647 if test "$proc" = "i586"; then
1648 cflag_check -march=$proc $cpuopt=$proc || proc=i486
1650 if test "$proc" = "i486" ; then
1651 cflag_check -march=$proc $cpuopt=$proc || proc=i386
1653 if test "$proc" = "i386" ; then
1654 cflag_check -march=$proc $cpuopt=$proc || proc=error
1656 if test "$proc" = "error" ; then
1657 echores "CPU optimization disabled. CPU not recognized or your compiler is too old."
1658 _mcpu=""
1659 _march=""
1660 _optimizing=""
1661 elif test "$proc" = "i586-i686"; then
1662 _march="-march=i586"
1663 _mcpu="$cpuopt=i686"
1664 _optimizing="$proc"
1665 else
1666 _march="-march=$proc"
1667 _mcpu="$cpuopt=$proc"
1668 _optimizing="$proc"
1670 else # if test "$_runtime_cpudetection" = no
1671 _mcpu="$cpuopt=generic"
1672 # at least i486 required, for bswap instruction
1673 _march="-march=i486"
1674 cflag_check $_mcpu || _mcpu="$cpuopt=i686"
1675 cflag_check $_mcpu || _mcpu=""
1676 cflag_check $_march $_mcpu || _march=""
1679 ## Gabucino : --target takes effect here (hopefully...) by overwriting
1680 ## autodetected mcpu/march parameters
1681 if test "$_target" ; then
1682 # TODO: it may be a good idea to check GCC and fall back in all cases
1683 if test "$host_arch" = "i586-i686"; then
1684 _march="-march=i586"
1685 _mcpu="$cpuopt=i686"
1686 else
1687 _march="-march=$host_arch"
1688 _mcpu="$cpuopt=$host_arch"
1691 proc="$host_arch"
1693 case "$proc" in
1694 i386) iproc=386 ;;
1695 i486) iproc=486 ;;
1696 i586|k5|k6|k6-2|k6-3|pentium|pentium-mmx) iproc=586 ;;
1697 i686|athlon*|pentium*) iproc=686 ;;
1698 *) iproc=586 ;;
1699 esac
1702 if test $_cmov = "yes" && test $_fast_cmov = "auto" ; then
1703 _fast_cmov="yes"
1704 else
1705 _fast_cmov="no"
1707 test $_fast_clz = "auto" && _fast_clz=yes
1709 echores "$proc"
1712 ia64)
1713 arch='ia64'
1714 def_fast_64bit='#define HAVE_FAST_64BIT 1'
1715 iproc='ia64'
1718 x86_64|amd64)
1719 arch='x86'
1720 subarch='x86_64'
1721 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
1722 def_fast_64bit='#define HAVE_FAST_64BIT 1'
1723 iproc='x86_64'
1725 # gcc >= 3.4.0 doesn't support -mcpu, we have to use -mtune instead
1726 if test "$cc_vendor" = "gnu" && test "$_cc_major" -gt 3 -o "$_cc_major" -eq 3 -a "$_cc_minor" -ge 4 ; then
1727 cpuopt=-mtune
1728 else
1729 cpuopt=-mcpu
1731 if test "$_runtime_cpudetection" = no ; then
1732 case "$pvendor" in
1733 AuthenticAMD)
1734 case "$pfamily" in
1735 15) proc=k8
1736 test $_fast_clz = "auto" && _fast_clz=no
1738 *) proc=amdfam10;;
1739 esac
1741 GenuineIntel)
1742 case "$pfamily" in
1743 6) proc=core2;;
1745 # 64-bit prescotts exist, but as far as GCC is concerned they
1746 # have the same capabilities as a nocona.
1747 proc=nocona
1748 test $_fast_cmov = "auto" && _fast_cmov=no
1749 test $_fast_clz = "auto" && _fast_clz=no
1751 esac
1754 proc=error;;
1755 esac
1756 fi # test "$_runtime_cpudetection" = no
1758 echocheck "GCC & CPU optimization abilities"
1759 # This is a stripped-down version of the i386 fallback.
1760 if test "$_runtime_cpudetection" = no ; then
1761 if test $cc_vendor != "intel" && test $cc_vendor != "clang" ; then
1762 cflag_check -march=native && proc=native
1764 # --- AMD processors ---
1765 if test "$proc" = "amdfam10"; then
1766 cflag_check -march=$proc $cpuopt=$proc || proc=k8
1768 if test "$proc" = "k8"; then
1769 cflag_check -march=$proc $cpuopt=$proc || proc=athlon-xp
1771 # This will fail if gcc version < 3.3, which is ok because earlier
1772 # versions don't really support 64-bit on amd64.
1773 # Is this a valid assumption? -Corey
1774 if test "$proc" = "athlon-xp"; then
1775 cflag_check -march=$proc $cpuopt=$proc || proc=error
1777 # --- Intel processors ---
1778 if test "$proc" = "core2"; then
1779 cflag_check -march=$proc $cpuopt=$proc || proc=x86-64
1781 if test "$proc" = "x86-64"; then
1782 cflag_check -march=$proc $cpuopt=$proc || proc=nocona
1784 if test "$proc" = "nocona"; then
1785 cflag_check -march=$proc $cpuopt=$proc || proc=pentium4
1787 if test "$proc" = "pentium4"; then
1788 cflag_check -march=$proc $cpuopt=$proc || proc=error
1791 _march="-march=$proc"
1792 _mcpu="$cpuopt=$proc"
1793 if test "$proc" = "error" ; then
1794 echores "CPU optimization disabled. CPU not recognized or your compiler is too old."
1795 _mcpu=""
1796 _march=""
1798 else # if test "$_runtime_cpudetection" = no
1799 # x86-64 is an undocumented option, an intersection of k8 and nocona.
1800 _march="-march=x86-64"
1801 _mcpu="$cpuopt=generic"
1802 cflag_check $_mcpu || _mcpu="x86-64"
1803 cflag_check $_mcpu || _mcpu=""
1804 cflag_check $_march $_mcpu || _march=""
1807 _optimizing="$proc"
1808 test $_fast_cmov = "auto" && _fast_cmov=yes
1809 test $_fast_clz = "auto" && _fast_clz=yes
1811 echores "$proc"
1814 sparc|sparc64)
1815 arch='sparc'
1816 iproc='sparc'
1817 if test "$host_arch" = "sparc64" ; then
1818 _vis='yes'
1819 proc='ultrasparc'
1820 def_fast_64bit='#define HAVE_FAST_64BIT 1'
1821 else
1822 proc=v8
1824 _mcpu="-mcpu=$proc"
1825 _optimizing="$proc"
1828 arm*)
1829 arch='arm'
1830 iproc='arm'
1833 avr32)
1834 arch='avr32'
1835 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
1836 iproc='avr32'
1837 test $_fast_clz = "auto" && _fast_clz=yes
1840 sh|sh4)
1841 arch='sh4'
1842 iproc='sh4'
1845 ppc|ppc64|powerpc|powerpc64)
1846 arch='ppc'
1847 def_dcbzl='#define HAVE_DCBZL 0'
1848 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
1849 iproc='ppc'
1851 if test "$host_arch" = "ppc64" -o "$host_arch" = "powerpc64" ; then
1852 subarch='ppc64'
1853 def_fast_64bit='#define HAVE_FAST_64BIT 1'
1855 echocheck "CPU type"
1856 case $system_name in
1857 Linux)
1858 proc=$($_cpuinfo | grep 'cpu' | cut -d ':' -f 2 | cut -d ',' -f 1 | cut -b 2- | head -n 1)
1859 if test -n "$($_cpuinfo | grep altivec)"; then
1860 test $_altivec = auto && _altivec=yes
1863 Darwin)
1864 proc=$($_cpuinfo | grep "Processor type" | cut -f 3 -d ' ' | sed 's/ppc//')
1865 if [ $(sysctl -n hw.vectorunit) -eq 1 -o \
1866 "$(sysctl -n hw.optional.altivec 2> /dev/null)" = "1" ]; then
1867 test $_altivec = auto && _altivec=yes
1870 NetBSD)
1871 # only gcc 3.4 works reliably with AltiVec code under NetBSD
1872 case $cc_version in
1873 2*|3.0*|3.1*|3.2*|3.3*)
1876 if [ $(sysctl -n machdep.altivec) -eq 1 ]; then
1877 test $_altivec = auto && _altivec=yes
1880 esac
1882 AIX)
1883 proc=$($_cpuinfo | grep 'type' | cut -f 2 -d ' ' | sed 's/PowerPC_//')
1885 esac
1886 if test "$_altivec" = yes; then
1887 echores "$proc altivec"
1888 else
1889 _altivec=no
1890 echores "$proc"
1893 echocheck "GCC & CPU optimization abilities"
1895 if test -n "$proc"; then
1896 case "$proc" in
1897 601) _march='-mcpu=601' _mcpu='-mtune=601' ;;
1898 603) _march='-mcpu=603' _mcpu='-mtune=603' ;;
1899 603e|603ev) _march='-mcpu=603e' _mcpu='-mtune=603e' ;;
1900 604|604e|604r|604ev) _march='-mcpu=604' _mcpu='-mtune=604' ;;
1901 740|740/750|745/755) _march='-mcpu=740' _mcpu='-mtune=740' ;;
1902 750|750CX) _march='-mcpu=750' _mcpu='-mtune=750' ;;
1903 POWER) _march='-mcpu=power' _mcpu='-mtune=power' ;;
1904 POWER2) _march='-mcpu=power2' _mcpu='-mtune=power2' ;;
1905 POWER3) _march='-mcpu=power3' _mcpu='-mtune=power3' ;;
1906 *) ;;
1907 esac
1908 # gcc 3.1(.1) and up supports 7400 and 7450
1909 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "1" || test "$_cc_major" -ge "4"; then
1910 case "$proc" in
1911 7400*|7410*) _march='-mcpu=7400' _mcpu='-mtune=7400' ;;
1912 7447*|7450*|7455*) _march='-mcpu=7450' _mcpu='-mtune=7450' ;;
1913 *) ;;
1914 esac
1916 # gcc 3.2 and up supports 970
1917 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "3" || test "$_cc_major" -ge "4"; then
1918 case "$proc" in
1919 970*|PPC970*) _march='-mcpu=970' _mcpu='-mtune=970'
1920 def_dcbzl='#define HAVE_DCBZL 1' ;;
1921 *) ;;
1922 esac
1924 # gcc 3.3 and up supports POWER4
1925 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "3" || test "$_cc_major" -ge "4"; then
1926 case "$proc" in
1927 POWER4) _march='-mcpu=power4' _mcpu='-mtune=power4' ;;
1928 *) ;;
1929 esac
1931 # gcc 3.4 and up supports 440*
1932 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "4" || test "$_cc_major" -ge "4"; then
1933 case "$proc" in
1934 440EP*) _march='-mcpu=440fp' _mcpu='-mtune=440fp' ;;
1935 440G* ) _march='-mcpu=440' _mcpu='-mtune=440' ;;
1936 *) ;;
1937 esac
1939 # gcc 4.0 and up supports POWER5
1940 if test "$_cc_major" -ge "4"; then
1941 case "$proc" in
1942 POWER5*) _march='-mcpu=power5' _mcpu='-mtune=power5' ;;
1943 *) ;;
1944 esac
1948 if test -n "$_mcpu"; then
1949 _optimizing=$(echo $_mcpu | cut -c 8-)
1950 echores "$_optimizing"
1951 else
1952 echores "none"
1955 test $_fast_clz = "auto" && _fast_clz=yes
1959 alpha*)
1960 arch='alpha'
1961 iproc='alpha'
1962 def_fast_64bit='#define HAVE_FAST_64BIT 1'
1964 echocheck "CPU type"
1965 cat > $TMPC << EOF
1966 int main(void) {
1967 unsigned long ver, mask;
1968 __asm__ ("implver %0" : "=r" (ver));
1969 __asm__ ("amask %1, %0" : "=r" (mask) : "r" (-1));
1970 printf("%ld-%x\n", ver, ~mask);
1971 return 0;
1974 $_cc -o "$TMPEXE" "$TMPC"
1975 case $("$TMPEXE") in
1977 0-0) proc="ev4"; _mvi="0";;
1978 1-0) proc="ev5"; _mvi="0";;
1979 1-1) proc="ev56"; _mvi="0";;
1980 1-101) proc="pca56"; _mvi="1";;
1981 2-303) proc="ev6"; _mvi="1";;
1982 2-307) proc="ev67"; _mvi="1";;
1983 2-1307) proc="ev68"; _mvi="1";;
1984 esac
1985 echores "$proc"
1987 echocheck "GCC & CPU optimization abilities"
1988 if test "$proc" = "ev68" ; then
1989 cc_check -mcpu=$proc || proc=ev67
1991 if test "$proc" = "ev67" ; then
1992 cc_check -mcpu=$proc || proc=ev6
1994 _mcpu="-mcpu=$proc"
1995 echores "$proc"
1997 test $_fast_clz = "auto" && _fast_clz=yes
1999 _optimizing="$proc"
2002 mips*)
2003 arch='mips'
2004 iproc='mips'
2006 test $_fast_clz = "auto" && _fast_clz=yes
2010 hppa)
2011 arch='pa_risc'
2012 iproc='PA-RISC'
2015 s390)
2016 arch='s390'
2017 iproc='390'
2020 s390x)
2021 arch='s390x'
2022 iproc='390x'
2025 vax)
2026 arch='vax'
2027 iproc='vax'
2030 xtensa)
2031 arch='xtensa'
2032 iproc='xtensa'
2035 generic)
2036 arch='generic'
2040 echo "The architecture of your CPU ($host_arch) is not supported by this configure script"
2041 echo "It seems nobody has ported MPlayer to your OS or CPU type yet."
2042 die "unsupported architecture $host_arch"
2044 esac # case "$host_arch" in
2046 if test "$_runtime_cpudetection" = yes ; then
2047 if x86 ; then
2048 test "$_cmov" != no && _cmov=yes
2049 x86_32 && _cmov=no
2050 test "$_mmx" != no && _mmx=yes
2051 test "$_3dnow" != no && _3dnow=yes
2052 test "$_3dnowext" != no && _3dnowext=yes
2053 test "$_mmxext" != no && _mmxext=yes
2054 test "$_sse" != no && _sse=yes
2055 test "$_sse2" != no && _sse2=yes
2056 test "$_ssse3" != no && _ssse3=yes
2058 if ppc; then
2059 _altivec=yes
2064 # endian testing
2065 echocheck "byte order"
2066 if test "$_big_endian" = auto ; then
2067 cat > $TMPC <<EOF
2068 short ascii_name[] = {
2069 'M' << 8 | 'P', 'l' << 8 | 'a', 'y' << 8 | 'e', 'r' << 8 | 'B',
2070 'i' << 8 | 'g', 'E' << 8 | 'n', 'd' << 8 | 'i', 'a' << 8 | 'n', 0 };
2071 int main(void) { return (long)ascii_name; }
2073 if cc_check ; then
2074 if strings $TMPEXE | grep -q -l MPlayerBigEndian ; then
2075 _big_endian=yes
2076 else
2077 _big_endian=no
2079 else
2080 echo ${_echo_n} "failed to autodetect byte order, defaulting to ${_echo_c}"
2083 if test "$_big_endian" = yes ; then
2084 _byte_order='big-endian'
2085 def_words_endian='#define WORDS_BIGENDIAN 1'
2086 def_bigendian='#define HAVE_BIGENDIAN 1'
2087 else
2088 _byte_order='little-endian'
2089 def_words_endian='#undef WORDS_BIGENDIAN'
2090 def_bigendian='#define HAVE_BIGENDIAN 0'
2092 echores "$_byte_order"
2095 echocheck "extern symbol prefix"
2096 cat > $TMPC << EOF
2097 int ff_extern;
2099 cc_check -c || die "Symbol mangling check failed."
2100 sym=$($_nm -P -g $TMPEXE)
2101 extern_prefix=${sym%%ff_extern*}
2102 def_extern_asm="#define EXTERN_ASM $extern_prefix"
2103 def_extern_prefix="#define EXTERN_PREFIX \"$extern_prefix\""
2104 echores $extern_prefix
2107 echocheck "assembler support of -pipe option"
2108 # -I. helps to detect compilers that just misunderstand -pipe like Sun C
2109 cflag_check -pipe -I. && _pipe="-pipe" && echores "yes" || echores "no"
2112 if darwin && test "$cc_vendor" = "gnu" ; then
2113 echocheck "GCC support of -mstackrealign"
2114 # GCC 4.2 and some earlier Apple versions support this flag on x86. Since
2115 # Mac OS X/Intel has an ABI different from Windows this is needed to avoid
2116 # crashes when loading Win32 DLLs. Unfortunately some gcc versions create
2117 # wrong code with this flag, but this can be worked around by adding
2118 # -fno-unit-at-a-time as described in the blog post at
2119 # http://www.dribin.org/dave/blog/archives/2006/12/05/missing_third_param/
2120 cat > $TMPC << EOF
2121 __attribute__((noinline)) static int foo3(int i1, int i2, int i3) { return i3; }
2122 int main(void) { return foo3(1, 2, 3) == 3 ? 0 : 1; }
2124 cc_check -O2 -mstackrealign && tmp_run && cflags_stackrealign=-mstackrealign
2125 test -z "$cflags_stackrealign" && cc_check -O2 -mstackrealign -fno-unit-at-a-time &&
2126 tmp_run && cflags_stackrealign="-mstackrealign -fno-unit-at-a-time"
2127 test -n "$cflags_stackrealign" && echores "yes" || echores "no"
2128 fi # if darwin && test "$cc_vendor" = "gnu" ; then
2131 # Checking for CFLAGS
2132 _install_strip="-s"
2133 if test "$_profile" != "" || test "$_debug" != "" ; then
2134 _install_strip=
2136 if test -z "$CFLAGS" ; then
2137 if test "$cc_vendor" = "intel" ; then
2138 CFLAGS="-O2 $_debug $_profile $_march $_mcpu $_pipe -fomit-frame-pointer"
2139 WARNFLAGS="-wd167 -wd556 -wd144"
2140 elif test "$cc_vendor" = "clang"; then
2141 CFLAGS="-O2 $_debug $_profile $_march $_pipe"
2142 WARNFLAGS="-Wall -Wno-switch-enum -Wno-logical-op-parentheses -Wpointer-arith -Wundef -Wno-pointer-sign -Wmissing-prototypes"
2143 ERRORFLAGS="-Werror=implicit-function-declaration"
2144 elif test "$cc_vendor" != "gnu" ; then
2145 CFLAGS="-O2 $_debug $_profile $_march $_mcpu $_pipe"
2146 else
2147 CFLAGS="-O2 $_debug $_profile $_march $_mcpu $_pipe -ffast-math -fomit-frame-pointer"
2148 WARNFLAGS="-Wall -Wno-switch -Wno-parentheses -Wpointer-arith -Wredundant-decls"
2149 ERRORFLAGS="-Werror-implicit-function-declaration"
2150 extra_ldflags="$extra_ldflags -ffast-math"
2152 else
2153 warn_cflags=yes
2156 if darwin && test "$cc_vendor" = "gnu" ; then
2157 extra_cflags="-falign-loops=16 -shared-libgcc $extra_cflags"
2160 if test "$cc_vendor" = "gnu" ; then
2161 cflag_check -Wundef && WARNFLAGS="-Wundef $WARNFLAGS"
2162 # -std=gnu99 is not a warning flag but is placed in WARN_CFLAGS because
2163 # that's the only variable specific to C now, and this option is not valid
2164 # for C++.
2165 cflag_check -std=gnu99 && WARN_CFLAGS="-std=gnu99 $WARN_CFLAGS"
2166 cflag_check -Wno-pointer-sign && WARN_CFLAGS="-Wno-pointer-sign $WARN_CFLAGS"
2167 cflag_check -Wdisabled-optimization && WARN_CFLAGS="-Wdisabled-optimization $WARN_CFLAGS"
2168 cflag_check -Wmissing-prototypes && WARN_CFLAGS="-Wmissing-prototypes $WARN_CFLAGS"
2169 cflag_check -Wstrict-prototypes && WARN_CFLAGS="-Wstrict-prototypes $WARN_CFLAGS"
2170 else
2171 CFLAGS="-D_ISOC99_SOURCE -D_BSD_SOURCE $CFLAGS"
2174 cflag_check -mno-omit-leaf-frame-pointer && cflags_no_omit_leaf_frame_pointer="-mno-omit-leaf-frame-pointer"
2175 cflag_check -MD -MP && DEPFLAGS="-MD -MP"
2178 if test -n "$LDFLAGS" ; then
2179 extra_ldflags="$extra_ldflags $LDFLAGS"
2180 warn_cflags=yes
2181 elif test "$cc_vendor" = "intel" ; then
2182 extra_ldflags="$extra_ldflags -i-static"
2184 if test -n "$CPPFLAGS" ; then
2185 extra_cflags="$extra_cflags $CPPFLAGS"
2186 warn_cflags=yes
2191 if x86_32 ; then
2192 # Checking assembler (_as) compatibility...
2193 # Added workaround for older as that reads from stdin by default - atmos
2194 as_version=$(echo '' | $_as -version 2>&1 | sed -n 's/^.*assembler \(version \)*\([0-9.]*\).*$/\2/p')
2195 echocheck "assembler ($_as $as_version)"
2197 _pref_as_version='2.9.1'
2198 echo 'nop' > $TMPS
2199 if test "$_mmx" = yes ; then
2200 echo 'emms' >> $TMPS
2202 if test "$_3dnow" = yes ; then
2203 _pref_as_version='2.10.1'
2204 echo 'femms' >> $TMPS
2206 if test "$_3dnowext" = yes ; then
2207 _pref_as_version='2.10.1'
2208 echo 'pswapd %mm0, %mm0' >> $TMPS
2210 if test "$_mmxext" = yes ; then
2211 _pref_as_version='2.10.1'
2212 echo 'movntq %mm0, (%eax)' >> $TMPS
2214 if test "$_sse" = yes ; then
2215 _pref_as_version='2.10.1'
2216 echo 'xorps %xmm0, %xmm0' >> $TMPS
2218 #if test "$_sse2" = yes ; then
2219 # _pref_as_version='2.11'
2220 # echo 'xorpd %xmm0, %xmm0' >> $TMPS
2222 if test "$_cmov" = yes ; then
2223 _pref_as_version='2.10.1'
2224 echo 'cmovb %eax, %ebx' >> $TMPS
2226 if test "$_ssse3" = yes ; then
2227 _pref_as_version='2.16.92'
2228 echo 'pabsd %xmm0, %xmm1' >> $TMPS
2230 $_as $TMPS -o $TMPEXE > /dev/null 2>&1 || as_verc_fail=yes
2232 if test "$as_verc_fail" != yes ; then
2233 echores "ok"
2234 else
2235 res_comment="Upgrade binutils to ${_pref_as_version} or use --disable-ssse3 etc."
2236 echores "failed"
2237 die "obsolete binutils version"
2240 fi #if x86_32
2243 echocheck "PIC"
2244 pic=no
2245 cat > $TMPC << EOF
2246 int main(void) {
2247 #if !(defined(__PIC__) || defined(__pic__) || defined(PIC))
2248 #error PIC not enabled
2249 #endif
2250 return 0;
2253 cc_check && pic=yes && extra_cflags="$extra_cflags -DPIC"
2254 echores $pic
2257 if x86 ; then
2259 echocheck ".align is a power of two"
2260 if test "$_asmalign_pot" = auto ; then
2261 _asmalign_pot=no
2262 inline_asm_check '".align 3"' && _asmalign_pot=yes
2264 if test "$_asmalign_pot" = "yes" ; then
2265 def_asmalign_pot='#define ASMALIGN(ZEROBITS) ".align " #ZEROBITS "\n\t"'
2266 else
2267 def_asmalign_pot='#define ASMALIGN(ZEROBITS) ".align 1<<" #ZEROBITS "\n\t"'
2269 echores $_asmalign_pot
2272 echocheck "ebx availability"
2273 ebx_available=no
2274 def_ebx_available='#define HAVE_EBX_AVAILABLE 0'
2275 cat > $TMPC << EOF
2276 int main(void) {
2277 int x;
2278 __asm__ volatile(
2279 "xor %0, %0"
2280 :"=b"(x)
2281 // just adding ebx to clobber list seems unreliable with some
2282 // compilers, e.g. Haiku's gcc 2.95
2284 // and the above check does not work for OSX 64 bit...
2285 __asm__ volatile("":::"%ebx");
2286 return 0;
2289 cc_check && ebx_available=yes && def_ebx_available='#define HAVE_EBX_AVAILABLE 1'
2290 echores $ebx_available
2293 echocheck "yasm"
2294 if test -z "$YASMFLAGS" ; then
2295 if darwin ; then
2296 x86_64 && objformat="macho64" || objformat="macho"
2297 elif win32 ; then
2298 objformat="win32"
2299 else
2300 objformat="elf"
2302 # currently tested for Linux x86, x86_64
2303 YASMFLAGS="-f $objformat"
2304 x86_64 && YASMFLAGS="$YASMFLAGS -DARCH_X86_64 -m amd64"
2305 test "$pic" = "yes" && YASMFLAGS="$YASMFLAGS -DPIC"
2306 case "$objformat" in
2307 elf) test $_debug && YASMFLAGS="$YASMFLAGS -g dwarf2" ;;
2308 *) YASMFLAGS="$YASMFLAGS -DPREFIX" ;;
2309 esac
2310 else
2311 warn_cflags=yes
2314 echo "pabsw xmm0, xmm0" > $TMPS
2315 yasm_check || _yasm=""
2316 if test $_yasm ; then
2317 def_yasm='#define HAVE_YASM 1'
2318 have_yasm="yes"
2319 echores "$_yasm"
2320 else
2321 def_yasm='#define HAVE_YASM 0'
2322 have_yasm="no"
2323 echores "no"
2326 echocheck "bswap"
2327 def_bswap='#define HAVE_BSWAP 0'
2328 echo 'bswap %eax' > $TMPS
2329 $_as $TMPS -o $TMPEXE > /dev/null 2>&1 && def_bswap='#define HAVE_BSWAP 1' && bswap=yes || bswap=no
2330 echores "$bswap"
2331 fi #if x86
2334 #FIXME: This should happen before the check for CFLAGS..
2335 def_altivec_h='#define HAVE_ALTIVEC_H 0'
2336 if ppc && ( test "$_altivec" = yes || test "$_runtime_cpudetection" = yes ) ; then
2338 # check if AltiVec is supported by the compiler, and how to enable it
2339 echocheck "GCC AltiVec flags"
2340 if $(cflag_check -maltivec -mabi=altivec) ; then
2341 _altivec_gcc_flags="-maltivec -mabi=altivec"
2342 # check if <altivec.h> should be included
2343 if $(header_check altivec.h $_altivec_gcc_flags) ; then
2344 def_altivec_h='#define HAVE_ALTIVEC_H 1'
2345 inc_altivec_h='#include <altivec.h>'
2346 else
2347 if $(cflag_check -faltivec) ; then
2348 _altivec_gcc_flags="-faltivec"
2349 else
2350 _altivec=no
2351 _altivec_gcc_flags="none, AltiVec disabled"
2355 echores "$_altivec_gcc_flags"
2357 # check if the compiler supports braces for vector declarations
2358 cat > $TMPC << EOF
2359 $inc_altivec_h
2360 int main(void) { (vector int) {1}; return 0; }
2362 cc_check $_altivec_gcc_flags || die "You need a compiler that supports {} in AltiVec vector declarations."
2364 # Disable runtime cpudetection if we cannot generate AltiVec code or
2365 # AltiVec is disabled by the user.
2366 test "$_runtime_cpudetection" = yes && test "$_altivec" = no \
2367 && _runtime_cpudetection=no
2369 # Show that we are optimizing for AltiVec (if enabled and supported).
2370 test "$_runtime_cpudetection" = no && test "$_altivec" = yes \
2371 && _optimizing="$_optimizing altivec"
2373 # If AltiVec is enabled, make sure the correct flags turn up in CFLAGS.
2374 test "$_altivec" = yes && CFLAGS="$CFLAGS $_altivec_gcc_flags"
2377 if ppc ; then
2378 def_xform_asm='#define HAVE_XFORM_ASM 0'
2379 xform_asm=no
2380 echocheck "XFORM ASM support"
2381 inline_asm_check '"lwzx %1, %y0" :: "Z"(*(int*)0), "r"(0)' &&
2382 xform_asm=yes && def_xform_asm='#define HAVE_XFORM_ASM 1'
2383 echores "$xform_asm"
2386 if arm ; then
2387 echocheck "ARMv5TE (Enhanced DSP Extensions)"
2388 if test $_armv5te = "auto" ; then
2389 _armv5te=no
2390 inline_asm_check '"qadd r0, r0, r0"' && _armv5te=yes
2392 echores "$_armv5te"
2394 test $_armv5te = "yes" && test $_fast_clz = "auto" && _fast_clz=yes
2396 echocheck "ARMv6 (SIMD instructions)"
2397 if test $_armv6 = "auto" ; then
2398 _armv6=no
2399 inline_asm_check '"sadd16 r0, r0, r0"' && _armv6=yes
2401 echores "$_armv6"
2403 echocheck "ARMv6t2 (SIMD instructions)"
2404 if test $_armv6t2 = "auto" ; then
2405 _armv6t2=no
2406 inline_asm_check '"movt r0, #0"' && _armv6t2=yes
2408 echores "$_armv6t2"
2410 echocheck "ARM VFP"
2411 if test $_armvfp = "auto" ; then
2412 _armvfp=no
2413 inline_asm_check '"fadds s0, s0, s0"' && _armvfp=yes
2415 echores "$_armvfp"
2417 echocheck "ARM NEON"
2418 if test $neon = "auto" ; then
2419 neon=no
2420 inline_asm_check '"vadd.i16 q0, q0, q0"' && neon=yes
2422 echores "$neon"
2424 echocheck "iWMMXt (Intel XScale SIMD instructions)"
2425 if test $_iwmmxt = "auto" ; then
2426 _iwmmxt=no
2427 inline_asm_check '"wunpckelub wr6, wr4"' && _iwmmxt=yes
2429 echores "$_iwmmxt"
2432 cpuexts_all='ALTIVEC MMX MMX2 AMD3DNOW AMD3DNOWEXT SSE SSE2 SSSE3 FAST_CMOV CMOV FAST_CLZ ARMV5TE ARMV6 ARMV6T2 ARMVFP NEON IWMMXT MMI VIS MVI'
2433 test "$_altivec" = yes && cpuexts="ALTIVEC $cpuexts"
2434 test "$_mmx" = yes && cpuexts="MMX $cpuexts"
2435 test "$_mmxext" = yes && cpuexts="MMX2 $cpuexts"
2436 test "$_3dnow" = yes && cpuexts="AMD3DNOW $cpuexts"
2437 test "$_3dnowext" = yes && cpuexts="AMD3DNOWEXT $cpuexts"
2438 test "$_sse" = yes && cpuexts="SSE $cpuexts"
2439 test "$_sse2" = yes && cpuexts="SSE2 $cpuexts"
2440 test "$_ssse3" = yes && cpuexts="SSSE3 $cpuexts"
2441 test "$_cmov" = yes && cpuexts="CMOV $cpuexts"
2442 test "$_fast_cmov" = yes && cpuexts="FAST_CMOV $cpuexts"
2443 test "$_fast_clz" = yes && cpuexts="FAST_CLZ $cpuexts"
2444 test "$_armv5te" = yes && cpuexts="ARMV5TE $cpuexts"
2445 test "$_armv6" = yes && cpuexts="ARMV6 $cpuexts"
2446 test "$_armv6t2" = yes && cpuexts="ARMV6T2 $cpuexts"
2447 test "$_armvfp" = yes && cpuexts="ARMVFP $cpuexts"
2448 test "$neon" = yes && cpuexts="NEON $cpuexts"
2449 test "$_iwmmxt" = yes && cpuexts="IWMMXT $cpuexts"
2450 test "$_vis" = yes && cpuexts="VIS $cpuexts"
2451 test "$_mvi" = yes && cpuexts="MVI $cpuexts"
2453 # Checking kernel version...
2454 if x86_32 && linux ; then
2455 _k_verc_problem=no
2456 kernel_version=$(uname -r 2>&1)
2457 echocheck "$system_name kernel version"
2458 case "$kernel_version" in
2459 '') kernel_version="?.??"; _k_verc_fail=yes;;
2460 [0-1].[0-9].[0-9]*|2.[0-3].[0-9]*)
2461 _k_verc_problem=yes;;
2462 esac
2463 if test "$_k_verc_problem" = yes && test "$_sse" = yes ; then
2464 _k_verc_fail=yes
2466 if test "$_k_verc_fail" ; then
2467 echores "$kernel_version, fail"
2468 echo "WARNING! If you want to run MPlayer on this system, get prepared for problems!"
2469 echo "2.2.x has limited SSE support. Upgrade the kernel or use --disable-sse if you"
2470 echo "experience crashes. MPlayer tries to autodetect if your kernel correctly"
2471 echo "supports SSE, but you have been warned! If you are using a kernel older than"
2472 echo "2.2.x you must upgrade it to get SSE support!"
2473 # die "Your kernel is too old for this CPU." # works fine on some 2.2.x so don't die (later check will test)
2474 else
2475 echores "$kernel_version, ok"
2479 ######################
2480 # MAIN TESTS GO HERE #
2481 ######################
2484 echocheck "-lposix"
2485 if cflag_check -lposix ; then
2486 extra_ldflags="$extra_ldflags -lposix"
2487 echores "yes"
2488 else
2489 echores "no"
2492 echocheck "-lm"
2493 if cflag_check -lm ; then
2494 _ld_lm="-lm"
2495 echores "yes"
2496 else
2497 _ld_lm=""
2498 echores "no"
2502 echocheck "langinfo"
2503 if test "$_langinfo" = auto ; then
2504 _langinfo=no
2505 statement_check langinfo.h 'nl_langinfo(CODESET)' && _langinfo=yes
2507 if test "$_langinfo" = yes ; then
2508 def_langinfo='#define HAVE_LANGINFO 1'
2509 else
2510 def_langinfo='#undef HAVE_LANGINFO'
2512 echores "$_langinfo"
2515 echocheck "translation support"
2516 if test "$_translation" = yes; then
2517 def_translation="#define CONFIG_TRANSLATION 1"
2518 else
2519 def_translation="#undef CONFIG_TRANSLATION"
2521 echores "$_translation"
2523 echocheck "language"
2524 # Set preferred languages, "all" uses English as main language.
2525 test -z "$language" && language=$LINGUAS
2526 test -z "$language_doc" && language_doc=$language
2527 test -z "$language_man" && language_man=$language
2528 test -z "$language_msg" && language_msg=$language
2529 test -z "$language_msg" && language_msg="all"
2530 language_doc=$(echo $language_doc | tr , " ")
2531 language_man=$(echo $language_man | tr , " ")
2532 language_msg=$(echo $language_msg | tr , " ")
2534 test "$language_doc" = "all" && language_doc=$doc_lang_all
2535 test "$language_man" = "all" && language_man=$man_lang_all
2536 test "$language_msg" = "all" && language_msg=$msg_lang_all
2538 if test "$_translation" != yes ; then
2539 language_msg=""
2542 # Prune non-existing translations from language lists.
2543 # Set message translation to the first available language.
2544 # Fall back on English.
2545 for lang in $language_doc ; do
2546 test -d DOCS/xml/$lang && tmp_language_doc="$tmp_language_doc $lang"
2547 done
2548 language_doc=$tmp_language_doc
2549 test -z "$language_doc" && language_doc=en
2551 for lang in $language_man ; do
2552 test -d DOCS/man/$lang && tmp_language_man="$tmp_language_man $lang"
2553 done
2554 language_man=$tmp_language_man
2555 test -z "$language_man" && language_man=en
2557 for lang in $language_msg ; do
2558 test -f po/$lang.po && tmp_language_msg="$tmp_language_msg $lang"
2559 done
2560 language_msg=$tmp_language_msg
2562 echores "messages (en+): $language_msg - man pages: $language_man - documentation: $language_doc"
2565 echocheck "enable sighandler"
2566 if test "$_sighandler" = yes ; then
2567 def_sighandler='#define CONFIG_SIGHANDLER 1'
2568 else
2569 def_sighandler='#undef CONFIG_SIGHANDLER'
2571 echores "$_sighandler"
2573 echocheck "runtime cpudetection"
2574 if test "$_runtime_cpudetection" = yes ; then
2575 _optimizing="Runtime CPU-Detection enabled"
2576 def_runtime_cpudetection='#define CONFIG_RUNTIME_CPUDETECT 1'
2577 else
2578 def_runtime_cpudetection='#define CONFIG_RUNTIME_CPUDETECT 0'
2580 echores "$_runtime_cpudetection"
2583 echocheck "restrict keyword"
2584 for restrict_keyword in restrict __restrict __restrict__ ; do
2585 echo "void foo(char * $restrict_keyword p); int main(void) { return 0; }" > $TMPC
2586 if cc_check; then
2587 def_restrict_keyword=$restrict_keyword
2588 break;
2590 done
2591 if [ -n "$def_restrict_keyword" ]; then
2592 echores "$def_restrict_keyword"
2593 else
2594 echores "none"
2596 # Avoid infinite recursion loop ("#define restrict restrict")
2597 if [ "$def_restrict_keyword" != "restrict" ]; then
2598 def_restrict_keyword="#define restrict $def_restrict_keyword"
2599 else
2600 def_restrict_keyword=""
2604 echocheck "__builtin_expect"
2605 # GCC branch prediction hint
2606 cat > $TMPC << EOF
2607 static int foo(int a) {
2608 a = __builtin_expect(a, 10);
2609 return a == 10 ? 0 : 1;
2611 int main(void) { return foo(10) && foo(0); }
2613 _builtin_expect=no
2614 cc_check && _builtin_expect=yes
2615 if test "$_builtin_expect" = yes ; then
2616 def_builtin_expect='#define HAVE_BUILTIN_EXPECT 1'
2617 else
2618 def_builtin_expect='#undef HAVE_BUILTIN_EXPECT'
2620 echores "$_builtin_expect"
2623 echocheck "kstat"
2624 _kstat=no
2625 statement_check kstat.h 'kstat_open()' -lkstat && _kstat=yes
2626 if test "$_kstat" = yes ; then
2627 def_kstat="#define HAVE_LIBKSTAT 1"
2628 extra_ldflags="$extra_ldflags -lkstat"
2629 else
2630 def_kstat="#undef HAVE_LIBKSTAT"
2632 echores "$_kstat"
2635 echocheck "posix4"
2636 # required for nanosleep on some systems
2637 _posix4=no
2638 statement_check time.h 'nanosleep(0, 0)' -lposix4 && _posix4=yes
2639 if test "$_posix4" = yes ; then
2640 extra_ldflags="$extra_ldflags -lposix4"
2642 echores "$_posix4"
2644 for func in exp2 exp2f llrint log2 log2f lrint lrintf round roundf truncf; do
2645 echocheck $func
2646 eval _$func=no
2647 statement_check math.h "${func}(2.0)" -D_ISOC99_SOURCE $_ld_lm && eval _$func=yes
2648 if eval test "x\$_$func" = "xyes"; then
2649 eval def_$func="\"#define HAVE_$(echo $func | tr '[a-z]' '[A-Z]') 1\""
2650 echores yes
2651 else
2652 eval def_$func="\"#define HAVE_$(echo $func | tr '[a-z]' '[A-Z]') 0\""
2653 echores no
2655 done
2658 echocheck "mkstemp"
2659 _mkstemp=no
2660 define_statement_check "_XOPEN_SOURCE 600" "stdlib.h" 'mkstemp("")' && _mkstemp=yes
2661 if test "$_mkstemp" = yes ; then
2662 def_mkstemp='#define HAVE_MKSTEMP 1'
2663 else
2664 def_mkstemp='#define HAVE_MKSTEMP 0'
2666 echores "$_mkstemp"
2669 echocheck "nanosleep"
2670 _nanosleep=no
2671 statement_check time.h 'nanosleep(0, 0)' && _nanosleep=yes
2672 if test "$_nanosleep" = yes ; then
2673 def_nanosleep='#define HAVE_NANOSLEEP 1'
2674 else
2675 def_nanosleep='#undef HAVE_NANOSLEEP'
2677 echores "$_nanosleep"
2680 echocheck "socklib"
2681 # for Solaris (socket stuff is in -lsocket, gethostbyname and friends in -lnsl):
2682 # for BeOS (socket stuff is in -lsocket, gethostbyname and friends in -lbind):
2683 cat > $TMPC << EOF
2684 #include <netdb.h>
2685 #include <sys/socket.h>
2686 int main(void) { gethostbyname(0); socket(AF_INET, SOCK_STREAM, 0); return 0; }
2688 _socklib=no
2689 for _ld_tmp in "" "-lsocket -lbind" "-lsocket -ldnet" "-lsocket -lnsl" "-lnsl" "-lsocket" ; do
2690 cc_check $_ld_tmp && _ld_sock="$_ld_tmp" && _socklib=yes && break
2691 done
2692 test $_socklib = yes && test $_winsock2_h = auto && _winsock2_h=no
2693 if test $_winsock2_h = auto ; then
2694 _winsock2_h=no
2695 statement_check winsock2.h 'gethostbyname(0)' -lws2_32 && _ld_sock="-lws2_32" && _winsock2_h=yes
2697 test "$_ld_sock" && res_comment="using $_ld_sock"
2698 echores "$_socklib"
2701 if test $_winsock2_h = yes ; then
2702 _ld_sock="-lws2_32"
2703 def_winsock2_h='#define HAVE_WINSOCK2_H 1'
2704 else
2705 def_winsock2_h='#define HAVE_WINSOCK2_H 0'
2709 echocheck "arpa/inet.h"
2710 arpa_inet_h=no
2711 def_arpa_inet_h='#define HAVE_ARPA_INET_H 0'
2712 header_check arpa/inet.h && arpa_inet_h=yes &&
2713 def_arpa_inet_h='#define HAVE_ARPA_INET_H 1'
2714 echores "$arpa_inet_h"
2717 echocheck "inet_pton()"
2718 def_inet_pton='#define HAVE_INET_PTON 0'
2719 inet_pton=no
2720 for _ld_tmp in "$_ld_sock" "$_ld_sock -lresolv" ; do
2721 statement_check arpa/inet.h 'inet_pton(0, 0, 0)' $_ld_tmp && inet_pton=yes && break
2722 done
2723 if test $inet_pton = yes ; then
2724 test "$_ld_tmp" && res_comment="using $_ld_tmp"
2725 def_inet_pton='#define HAVE_INET_PTON 1'
2727 echores "$inet_pton"
2730 echocheck "inet_aton()"
2731 def_inet_aton='#define HAVE_INET_ATON 0'
2732 inet_aton=no
2733 for _ld_tmp in "$_ld_sock" "$_ld_sock -lresolv" ; do
2734 statement_check arpa/inet.h 'inet_aton(0, 0)' $_ld_tmp && inet_aton=yes && break
2735 done
2736 if test $inet_aton = yes ; then
2737 test "$_ld_tmp" && res_comment="using $_ld_tmp"
2738 def_inet_aton='#define HAVE_INET_ATON 1'
2740 echores "$inet_aton"
2743 echocheck "socklen_t"
2744 _socklen_t=no
2745 for header in "sys/socket.h" "ws2tcpip.h" "sys/types.h" ; do
2746 statement_check $header 'socklen_t v = 0' && _socklen_t=yes && break
2747 done
2748 if test "$_socklen_t" = yes ; then
2749 def_socklen_t='#define HAVE_SOCKLEN_T 1'
2750 else
2751 def_socklen_t='#define HAVE_SOCKLEN_T 0'
2753 echores "$_socklen_t"
2756 echocheck "closesocket()"
2757 _closesocket=no
2758 statement_check winsock2.h 'closesocket(~0)' $_ld_sock && _closesocket=yes
2759 if test "$_closesocket" = yes ; then
2760 def_closesocket='#define HAVE_CLOSESOCKET 1'
2761 else
2762 def_closesocket='#define HAVE_CLOSESOCKET 0'
2764 echores "$_closesocket"
2767 echocheck "networking"
2768 test $_winsock2_h = no && test $inet_pton = no &&
2769 test $inet_aton = no && networking=no
2770 if test "$networking" = yes ; then
2771 def_network='#define CONFIG_NETWORK 1'
2772 def_networking='#define CONFIG_NETWORKING 1'
2773 extra_ldflags="$extra_ldflags $_ld_sock"
2774 inputmodules="networking $inputmodules"
2775 else
2776 noinputmodules="networking $noinputmodules"
2777 def_network='#define CONFIG_NETWORK 0'
2778 def_networking='#undef CONFIG_NETWORKING'
2780 echores "$networking"
2783 echocheck "inet6"
2784 if test "$_inet6" = auto ; then
2785 cat > $TMPC << EOF
2786 #include <sys/types.h>
2787 #if !defined(_WIN32)
2788 #include <sys/socket.h>
2789 #include <netinet/in.h>
2790 #else
2791 #include <ws2tcpip.h>
2792 #endif
2793 int main(void) { struct sockaddr_in6 six; socket(AF_INET6, SOCK_STREAM, AF_INET6); return 0; }
2795 _inet6=no
2796 if cc_check $_ld_sock ; then
2797 _inet6=yes
2800 if test "$_inet6" = yes ; then
2801 def_inet6='#define HAVE_AF_INET6 1'
2802 else
2803 def_inet6='#undef HAVE_AF_INET6'
2805 echores "$_inet6"
2808 echocheck "gethostbyname2"
2809 if test "$_gethostbyname2" = auto ; then
2810 cat > $TMPC << EOF
2811 #include <sys/types.h>
2812 #include <sys/socket.h>
2813 #include <netdb.h>
2814 int main(void) { gethostbyname2("", AF_INET); return 0; }
2816 _gethostbyname2=no
2817 if cc_check ; then
2818 _gethostbyname2=yes
2821 if test "$_gethostbyname2" = yes ; then
2822 def_gethostbyname2='#define HAVE_GETHOSTBYNAME2 1'
2823 else
2824 def_gethostbyname2='#undef HAVE_GETHOSTBYNAME2'
2826 echores "$_gethostbyname2"
2829 echocheck "inttypes.h (required)"
2830 _inttypes=no
2831 header_check inttypes.h && _inttypes=yes
2832 echores "$_inttypes"
2834 if test "$_inttypes" = no ; then
2835 echocheck "sys/bitypes.h (inttypes.h predecessor)"
2836 header_check sys/bitypes.h && _inttypes=yes
2837 if test "$_inttypes" = yes ; then
2838 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."
2839 else
2840 die "Cannot find header either inttypes.h or bitypes.h. There is no chance for compilation to succeed."
2845 echocheck "malloc.h"
2846 _malloc=no
2847 header_check malloc.h && _malloc=yes
2848 if test "$_malloc" = yes ; then
2849 def_malloc_h='#define HAVE_MALLOC_H 1'
2850 else
2851 def_malloc_h='#define HAVE_MALLOC_H 0'
2853 echores "$_malloc"
2856 echocheck "memalign()"
2857 # XXX restrict to x86 ? extend to other CPUs/cacheline sizes ?
2858 def_memalign_hack='#define CONFIG_MEMALIGN_HACK 0'
2859 _memalign=no
2860 statement_check malloc.h 'memalign(64, sizeof(char))' && _memalign=yes
2861 if test "$_memalign" = yes ; then
2862 def_memalign='#define HAVE_MEMALIGN 1'
2863 else
2864 def_memalign='#define HAVE_MEMALIGN 0'
2865 def_map_memalign='#define memalign(a, b) malloc(b)'
2866 darwin || def_memalign_hack='#define CONFIG_MEMALIGN_HACK 1'
2868 echores "$_memalign"
2871 echocheck "posix_memalign()"
2872 posix_memalign=no
2873 def_posix_memalign='#define HAVE_POSIX_MEMALIGN 0'
2874 define_statement_check "_XOPEN_SOURCE 600" "stdlib.h" 'posix_memalign(NULL, 0, 0)' &&
2875 posix_memalign=yes && def_posix_memalign='#define HAVE_POSIX_MEMALIGN 1'
2876 echores "$posix_memalign"
2879 echocheck "alloca.h"
2880 _alloca=no
2881 statement_check alloca.h 'alloca(0)' && _alloca=yes
2882 if cc_check ; then
2883 def_alloca_h='#define HAVE_ALLOCA_H 1'
2884 else
2885 def_alloca_h='#undef HAVE_ALLOCA_H'
2887 echores "$_alloca"
2890 echocheck "fastmemcpy"
2891 if test "$_fastmemcpy" = yes ; then
2892 def_fastmemcpy='#define CONFIG_FASTMEMCPY 1'
2893 else
2894 def_fastmemcpy='#undef CONFIG_FASTMEMCPY'
2896 echores "$_fastmemcpy"
2899 echocheck "mman.h"
2900 _mman=no
2901 statement_check sys/mman.h 'mmap(0, 0, 0, 0, 0, 0)' && _mman=yes
2902 if test "$_mman" = yes ; then
2903 def_mman_h='#define HAVE_SYS_MMAN_H 1'
2904 else
2905 def_mman_h='#undef HAVE_SYS_MMAN_H'
2907 echores "$_mman"
2909 _mman_has_map_failed=no
2910 statement_check sys/mman.h 'void *p = MAP_FAILED' && _mman_has_map_failed=yes
2911 if test "$_mman_has_map_failed" = yes ; then
2912 def_mman_has_map_failed=''
2913 else
2914 def_mman_has_map_failed='#define MAP_FAILED ((void *) -1)'
2917 echocheck "dynamic loader"
2918 _dl=no
2919 for _ld_tmp in "" "-ldl"; do
2920 statement_check dlfcn.h 'dlopen("", 0)' $_ld_tmp && _ld_dl="$_ld_tmp" && _dl=yes && break
2921 done
2922 if test "$_dl" = yes ; then
2923 def_dl='#define HAVE_LIBDL 1'
2924 else
2925 def_dl='#undef HAVE_LIBDL'
2927 echores "$_dl"
2930 def_threads='#define HAVE_THREADS 0'
2932 echocheck "pthread"
2933 if linux ; then
2934 THREAD_CFLAGS=-D_REENTRANT
2935 elif freebsd || netbsd || openbsd || bsdos ; then
2936 THREAD_CFLAGS=-D_THREAD_SAFE
2938 if test "$_pthreads" = auto ; then
2939 cat > $TMPC << EOF
2940 #include <pthread.h>
2941 static void *func(void *arg) { return arg; }
2942 int main(void) {
2943 pthread_t tid;
2944 #ifdef PTW32_STATIC_LIB
2945 pthread_win32_process_attach_np();
2946 pthread_win32_thread_attach_np();
2947 #endif
2948 return pthread_create (&tid, 0, func, 0) != 0;
2951 _pthreads=no
2952 if ! hpux ; then
2953 for _ld_tmp in "-lpthreadGC2" "" "-lpthread" "-pthread" ; do
2954 # for crosscompilation, we cannot execute the program, be happy if we can link statically
2955 cc_check $THREAD_CFLAGS $_ld_tmp && (tmp_run || test "$_ld_static") && _ld_pthread="$_ld_tmp" && _pthreads=yes && break
2956 done
2957 if test "$_pthreads" = no && mingw32 ; then
2958 _ld_tmp="-lpthreadGC2 -lws2_32"
2959 cc_check $_ld_tmp -DPTW32_STATIC_LIB && (tmp_run || test "$_ld_static") && _ld_pthread="$_ld_tmp" && _pthreads=yes && CFLAGS="$CFLAGS -DPTW32_STATIC_LIB"
2963 if test "$_pthreads" = yes ; then
2964 test $_ld_pthread && res_comment="using $_ld_pthread"
2965 def_pthreads='#define HAVE_PTHREADS 1'
2966 def_threads='#define HAVE_THREADS 1'
2967 extra_cflags="$extra_cflags $THREAD_CFLAGS"
2968 else
2969 res_comment="v4l, v4l2, ao_nas, win32 loader disabled"
2970 def_pthreads='#undef HAVE_PTHREADS'
2971 _nas=no ; _tv_v4l1=no ; _tv_v4l2=no
2972 mingw32 || _win32dll=no
2974 echores "$_pthreads"
2976 if cygwin ; then
2977 if test "$_pthreads" = yes ; then
2978 def_pthread_cache="#define PTHREAD_CACHE 1"
2979 else
2980 _stream_cache=no
2981 def_stream_cache="#undef CONFIG_STREAM_CACHE"
2985 echocheck "w32threads"
2986 if test "$_pthreads" = yes ; then
2987 res_comment="using pthread instead"
2988 _w32threads=no
2990 if test "$_w32threads" = auto ; then
2991 _w32threads=no
2992 mingw32 && _w32threads=yes
2994 test "$_w32threads" = yes && def_threads='#define HAVE_THREADS 1'
2995 echores "$_w32threads"
2997 echocheck "rpath"
2998 if test "$_rpath" = yes ; then
2999 for I in $(echo $extra_ldflags | sed 's/-L//g') ; do
3000 tmp="$tmp $(echo $I | sed 's/.*/ -L& -Wl,-R&/')"
3001 done
3002 extra_ldflags=$tmp
3004 echores "$_rpath"
3006 echocheck "iconv"
3007 if test "$_iconv" = auto ; then
3008 cat > $TMPC << EOF
3009 #include <stdio.h>
3010 #include <unistd.h>
3011 #include <iconv.h>
3012 #define INBUFSIZE 1024
3013 #define OUTBUFSIZE 4096
3015 char inbuffer[INBUFSIZE];
3016 char outbuffer[OUTBUFSIZE];
3018 int main(void) {
3019 size_t numread;
3020 iconv_t icdsc;
3021 char *tocode="UTF-8";
3022 char *fromcode="cp1250";
3023 if ((icdsc = iconv_open(tocode, fromcode)) != (iconv_t)(-1)) {
3024 while ((numread = read(0, inbuffer, INBUFSIZE))) {
3025 char *iptr=inbuffer;
3026 char *optr=outbuffer;
3027 size_t inleft=numread;
3028 size_t outleft=OUTBUFSIZE;
3029 if (iconv(icdsc, &iptr, &inleft, &optr, &outleft)
3030 != (size_t)(-1)) {
3031 write(1, outbuffer, OUTBUFSIZE - outleft);
3034 if (iconv_close(icdsc) == -1)
3037 return 0;
3040 _iconv=no
3041 for _ld_tmp in "" "-liconv" "-liconv $_ld_dl" ; do
3042 cc_check $_ld_lm $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" &&
3043 _iconv=yes && break
3044 done
3045 if test "$_iconv" != yes ; then
3046 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."
3049 if test "$_iconv" = yes ; then
3050 def_iconv='#define CONFIG_ICONV 1'
3051 else
3052 def_iconv='#undef CONFIG_ICONV'
3054 echores "$_iconv"
3057 echocheck "soundcard.h"
3058 _soundcard_h=no
3059 def_soundcard_h='#undef HAVE_SOUNDCARD_H'
3060 def_sys_soundcard_h='#undef HAVE_SYS_SOUNDCARD_H'
3061 for _soundcard_header in "sys/soundcard.h" "soundcard.h"; do
3062 header_check $_soundcard_header && _soundcard_h=yes &&
3063 res_comment="$_soundcard_header" && break
3064 done
3066 if test "$_soundcard_h" = yes ; then
3067 if test $_soundcard_header = "sys/soundcard.h"; then
3068 def_sys_soundcard_h='#define HAVE_SYS_SOUNDCARD_H 1'
3069 else
3070 def_soundcard_h='#define HAVE_SOUNDCARD_H 1'
3073 echores "$_soundcard_h"
3076 echocheck "sys/videoio.h"
3077 sys_videoio_h=no
3078 def_sys_videoio_h='#undef HAVE_SYS_VIDEOIO_H'
3079 header_check sys/videoio.h && sys_videoio_h=yes &&
3080 def_sys_videoio_h='#define HAVE_SYS_VIDEOIO_H 1'
3081 echores "$sys_videoio_h"
3084 echocheck "sys/dvdio.h"
3085 _dvdio=no
3086 # FreeBSD 8.1 has broken dvdio.h
3087 header_check_broken sys/types.h sys/dvdio.h && _dvdio=yes
3088 if test "$_dvdio" = yes ; then
3089 def_dvdio='#define DVD_STRUCT_IN_SYS_DVDIO_H 1'
3090 else
3091 def_dvdio='#undef DVD_STRUCT_IN_SYS_DVDIO_H'
3093 echores "$_dvdio"
3096 echocheck "sys/cdio.h"
3097 _cdio=no
3098 # at least OpenSolaris has a broken cdio.h
3099 header_check_broken sys/types.h sys/cdio.h && _cdio=yes
3100 if test "$_cdio" = yes ; then
3101 def_cdio='#define DVD_STRUCT_IN_SYS_CDIO_H 1'
3102 else
3103 def_cdio='#undef DVD_STRUCT_IN_SYS_CDIO_H'
3105 echores "$_cdio"
3108 echocheck "linux/cdrom.h"
3109 _cdrom=no
3110 header_check linux/cdrom.h && _cdrom=yes
3111 if test "$_cdrom" = yes ; then
3112 def_cdrom='#define DVD_STRUCT_IN_LINUX_CDROM_H 1'
3113 else
3114 def_cdrom='#undef DVD_STRUCT_IN_LINUX_CDROM_H'
3116 echores "$_cdrom"
3119 echocheck "dvd.h"
3120 _dvd=no
3121 header_check dvd.h && _dvd=yes
3122 if test "$_dvd" = yes ; then
3123 def_dvd='#define DVD_STRUCT_IN_DVD_H 1'
3124 else
3125 def_dvd='#undef DVD_STRUCT_IN_DVD_H'
3127 echores "$_dvd"
3130 if bsdos; then
3131 echocheck "BSDI dvd.h"
3132 _bsdi_dvd=no
3133 header_check dvd.h && _bsdi_dvd=yes
3134 if test "$_bsdi_dvd" = yes ; then
3135 def_bsdi_dvd='#define DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H 1'
3136 else
3137 def_bsdi_dvd='#undef DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H'
3139 echores "$_bsdi_dvd"
3140 fi #if bsdos
3143 if hpux; then
3144 # also used by AIX, but AIX does not support VCD and/or libdvdread
3145 echocheck "HP-UX SCSI header"
3146 _hpux_scsi_h=no
3147 header_check sys/scsi.h && _hpux_scsi_h=yes
3148 if test "$_hpux_scsi_h" = yes ; then
3149 def_hpux_scsi_h='#define HPUX_SCTL_IO 1'
3150 else
3151 def_hpux_scsi_h='#undef HPUX_SCTL_IO'
3153 echores "$_hpux_scsi_h"
3154 fi #if hpux
3157 echocheck "termcap"
3158 if test "$_termcap" = auto ; then
3159 _termcap=no
3160 for _ld_tmp in "-lncurses" "-ltinfo" "-ltermcap"; do
3161 statement_check term.h 'tgetent(0, 0)' $_ld_tmp &&
3162 extra_ldflags="$extra_ldflags $_ld_tmp" && _termcap=yes && break
3163 done
3165 if test "$_termcap" = yes ; then
3166 def_termcap='#define HAVE_TERMCAP 1'
3167 test $_ld_tmp && res_comment="using $_ld_tmp"
3168 else
3169 def_termcap='#undef HAVE_TERMCAP'
3171 echores "$_termcap"
3174 echocheck "termios"
3175 def_termios='#undef HAVE_TERMIOS'
3176 def_termios_h='#undef HAVE_TERMIOS_H'
3177 def_termios_sys_h='#undef HAVE_SYS_TERMIOS_H'
3178 if test "$_termios" = auto ; then
3179 _termios=no
3180 for _termios_header in "termios.h" "sys/termios.h"; do
3181 header_check $_termios_header && _termios=yes &&
3182 res_comment="using $_termios_header" && break
3183 done
3186 if test "$_termios" = yes ; then
3187 def_termios='#define HAVE_TERMIOS 1'
3188 if test "$_termios_header" = "termios.h" ; then
3189 def_termios_h='#define HAVE_TERMIOS_H 1'
3190 else
3191 def_termios_sys_h='#define HAVE_SYS_TERMIOS_H 1'
3194 echores "$_termios"
3197 echocheck "shm"
3198 if test "$_shm" = auto ; then
3199 _shm=no
3200 statement_check sys/shm.h 'shmget(0, 0, 0); shmat(0, 0, 0); shmctl(0, 0, 0)' && _shm=yes
3202 if test "$_shm" = yes ; then
3203 def_shm='#define HAVE_SHM 1'
3204 else
3205 def_shm='#undef HAVE_SHM'
3207 echores "$_shm"
3210 echocheck "strsep()"
3211 _strsep=no
3212 statement_check string.h 'char *s = "Hello, world!"; strsep(&s, ",")' && _strsep=yes
3213 if test "$_strsep" = yes ; then
3214 def_strsep='#define HAVE_STRSEP 1'
3215 need_strsep=no
3216 else
3217 def_strsep='#undef HAVE_STRSEP'
3218 need_strsep=yes
3220 echores "$_strsep"
3223 echocheck "vsscanf()"
3224 cat > $TMPC << EOF
3225 #define _ISOC99_SOURCE
3226 #include <stdarg.h>
3227 #include <stdio.h>
3228 int main(void) { va_list ap; vsscanf("foo", "bar", ap); return 0; }
3230 _vsscanf=no
3231 cc_check && _vsscanf=yes
3232 if test "$_vsscanf" = yes ; then
3233 def_vsscanf='#define HAVE_VSSCANF 1'
3234 need_vsscanf=no
3235 else
3236 def_vsscanf='#undef HAVE_VSSCANF'
3237 need_vsscanf=yes
3239 echores "$_vsscanf"
3242 echocheck "swab()"
3243 _swab=no
3244 define_statement_check "_XOPEN_SOURCE 600" "unistd.h" 'int a, b; swab(&a, &b, 0)' ||
3245 statement_check "string.h" 'int a, b; swab(&a, &b, 0)' && _swab=yes
3246 if test "$_swab" = yes ; then
3247 def_swab='#define HAVE_SWAB 1'
3248 need_swab=no
3249 else
3250 def_swab='#undef HAVE_SWAB'
3251 need_swab=yes
3253 echores "$_swab"
3255 echocheck "POSIX select()"
3256 cat > $TMPC << EOF
3257 #include <stdio.h>
3258 #include <stdlib.h>
3259 #include <sys/types.h>
3260 #include <string.h>
3261 #include <sys/time.h>
3262 #include <unistd.h>
3263 int main(void) {int nfds = 1; fd_set readfds; struct timeval timeout; select(nfds, &readfds, NULL, NULL, &timeout); return 0; }
3265 _posix_select=no
3266 def_posix_select='#undef HAVE_POSIX_SELECT'
3267 cc_check && _posix_select=yes &&
3268 def_posix_select='#define HAVE_POSIX_SELECT 1'
3269 echores "$_posix_select"
3272 echocheck "audio select()"
3273 if test "$_select" = no ; then
3274 def_select='#undef HAVE_AUDIO_SELECT'
3275 elif test "$_select" = yes ; then
3276 def_select='#define HAVE_AUDIO_SELECT 1'
3278 echores "$_select"
3281 echocheck "gettimeofday()"
3282 _gettimeofday=no
3283 statement_check sys/time.h 'struct timeval tv; struct timezone tz; gettimeofday(&tv, &tz)' && _gettimeofday=yes
3284 if test "$_gettimeofday" = yes ; then
3285 def_gettimeofday='#define HAVE_GETTIMEOFDAY 1'
3286 need_gettimeofday=no
3287 else
3288 def_gettimeofday='#undef HAVE_GETTIMEOFDAY'
3289 need_gettimeofday=yes
3291 echores "$_gettimeofday"
3294 echocheck "glob()"
3295 _glob=no
3296 statement_check glob.h 'glob("filename", 0, 0, 0)' && _glob=yes
3297 need_glob=no
3298 if test "$_glob" = yes ; then
3299 def_glob='#define HAVE_GLOB 1'
3300 else
3301 def_glob='#undef HAVE_GLOB'
3302 # HACK! need_glob currently enables compilation of a
3303 # win32-specific glob()-replacement.
3304 # Other OS neither need it nor can they use it (mf:// is disabled for them).
3305 win32 && need_glob=yes
3307 echores "$_glob"
3310 echocheck "setenv()"
3311 _setenv=no
3312 statement_check stdlib.h 'setenv("", "", 0)' && _setenv=yes
3313 if test "$_setenv" = yes ; then
3314 def_setenv='#define HAVE_SETENV 1'
3315 need_setenv=no
3316 else
3317 def_setenv='#undef HAVE_SETENV'
3318 need_setenv=yes
3320 echores "$_setenv"
3323 echocheck "setmode()"
3324 _setmode=no
3325 def_setmode='#define HAVE_SETMODE 0'
3326 statement_check io.h 'setmode(0, 0)' && _setmode=yes && def_setmode='#define HAVE_SETMODE 1'
3327 echores "$_setmode"
3330 echocheck "sys/sysinfo.h"
3331 _sys_sysinfo=no
3332 statement_check sys/sysinfo.h 'struct sysinfo s_info; s_info.mem_unit=0; sysinfo(&s_info)' && _sys_sysinfo=yes
3333 if test "$_sys_sysinfo" = yes ; then
3334 def_sys_sysinfo_h='#define HAVE_SYS_SYSINFO_H 1'
3335 else
3336 def_sys_sysinfo_h='#undef HAVE_SYS_SYSINFO_H'
3338 echores "$_sys_sysinfo"
3341 if darwin; then
3343 echocheck "Mac OS X Finder Support"
3344 def_macosx_finder='#undef CONFIG_MACOSX_FINDER'
3345 if test "$_macosx_finder" = yes ; then
3346 def_macosx_finder='#define CONFIG_MACOSX_FINDER 1'
3347 extra_ldflags="$extra_ldflags -framework Cocoa"
3349 echores "$_macosx_finder"
3351 echocheck "Mac OS X Bundle file locations"
3352 def_macosx_bundle='#undef CONFIG_MACOSX_BUNDLE'
3353 test "$_macosx_bundle" = auto && _macosx_bundle=$_macosx_finder
3354 if test "$_macosx_bundle" = yes ; then
3355 def_macosx_bundle='#define CONFIG_MACOSX_BUNDLE 1'
3357 echores "$_macosx_bundle"
3359 echocheck "Apple Remote"
3360 if test "$_apple_remote" = auto ; then
3361 _apple_remote=no
3362 cat > $TMPC <<EOF
3363 #include <stdio.h>
3364 #include <IOKit/IOCFPlugIn.h>
3365 int main(void) {
3366 io_iterator_t hidObjectIterator = (io_iterator_t)NULL;
3367 CFMutableDictionaryRef hidMatchDictionary;
3368 IOReturn ioReturnValue;
3370 // Set up a matching dictionary to search the I/O Registry by class.
3371 // name for all HID class devices
3372 hidMatchDictionary = IOServiceMatching("AppleIRController");
3374 // Now search I/O Registry for matching devices.
3375 ioReturnValue = IOServiceGetMatchingServices(kIOMasterPortDefault,
3376 hidMatchDictionary, &hidObjectIterator);
3378 // If search is unsuccessful, return nonzero.
3379 if (ioReturnValue != kIOReturnSuccess ||
3380 !IOIteratorIsValid(hidObjectIterator)) {
3381 return 1;
3383 return 0;
3386 cc_check -framework IOKit && _apple_remote=yes
3388 if test "$_apple_remote" = yes ; then
3389 def_apple_remote='#define CONFIG_APPLE_REMOTE 1'
3390 libs_mplayer="$libs_mplayer -framework IOKit -framework Cocoa"
3391 else
3392 def_apple_remote='#undef CONFIG_APPLE_REMOTE'
3394 echores "$_apple_remote"
3396 fi #if darwin
3398 if linux; then
3400 echocheck "Apple IR"
3401 if test "$_apple_ir" = auto ; then
3402 _apple_ir=no
3403 statement_check linux/input.h 'struct input_event ev; struct input_id id' && _apple_ir=yes
3405 if test "$_apple_ir" = yes ; then
3406 def_apple_ir='#define CONFIG_APPLE_IR 1'
3407 else
3408 def_apple_ir='#undef CONFIG_APPLE_IR'
3410 echores "$_apple_ir"
3411 fi #if linux
3413 echocheck "pkg-config"
3414 if $($_pkg_config --version > /dev/null 2>&1); then
3415 if test "$_ld_static"; then
3416 _pkg_config="$_pkg_config --static"
3418 echores "yes"
3419 else
3420 _pkg_config=false
3421 echores "no"
3425 echocheck "Samba support (libsmbclient)"
3426 if test "$_smb" = yes; then
3427 extra_ldflags="$extra_ldflags -lsmbclient"
3429 if test "$_smb" = auto; then
3430 _smb=no
3431 for _ld_tmp in "-lsmbclient" "-lsmbclient $_ld_dl" "-lsmbclient $_ld_dl -lnsl" "-lsmbclient $_ld_dl -lssl -lnsl" ; do
3432 statement_check libsmbclient.h 'smbc_opendir("smb://")' $_ld_tmp &&
3433 extra_ldflags="$extra_ldflags $_ld_tmp" && _smb=yes && break
3434 done
3437 if test "$_smb" = yes; then
3438 def_smb="#define CONFIG_LIBSMBCLIENT 1"
3439 inputmodules="smb $inputmodules"
3440 else
3441 def_smb="#undef CONFIG_LIBSMBCLIENT"
3442 noinputmodules="smb $noinputmodules"
3444 echores "$_smb"
3446 echocheck "libquvi support"
3447 if test "$_libquvi" = auto ; then
3448 _libquvi=no
3449 if pkg_config_add 'libquvi >= 0.4.1' ; then
3450 _libquvi=yes
3453 if test "$_libquvi" = yes; then
3454 def_libquvi="#define CONFIG_LIBQUVI 1"
3455 else
3456 def_libquvi="#undef CONFIG_LIBQUVI"
3458 echores "$_libquvi"
3460 #########
3461 # VIDEO #
3462 #########
3465 echocheck "tga"
3466 if test "$_tga" = yes ; then
3467 def_tga='#define CONFIG_TGA 1'
3468 vomodules="tga $vomodules"
3469 else
3470 def_tga='#undef CONFIG_TGA'
3471 novomodules="tga $novomodules"
3473 echores "$_tga"
3476 echocheck "md5sum support"
3477 if test "$_md5sum" = yes; then
3478 def_md5sum="#define CONFIG_MD5SUM 1"
3479 vomodules="md5sum $vomodules"
3480 else
3481 def_md5sum="#undef CONFIG_MD5SUM"
3482 novomodules="md5sum $novomodules"
3484 echores "$_md5sum"
3487 echocheck "yuv4mpeg support"
3488 if test "$_yuv4mpeg" = yes; then
3489 def_yuv4mpeg="#define CONFIG_YUV4MPEG 1"
3490 vomodules="yuv4mpeg $vomodules"
3491 else
3492 def_yuv4mpeg="#undef CONFIG_YUV4MPEG"
3493 novomodules="yuv4mpeg $novomodules"
3495 echores "$_yuv4mpeg"
3498 echocheck "DirectFB"
3499 if test "$_directfb" = auto ; then
3500 _directfb=no
3501 cat > $TMPC << EOF
3502 #include <directfb.h>
3503 #include <directfb_version.h>
3504 #if (DIRECTFB_MAJOR_VERSION << 16 | DIRECTFB_MINOR_VERSION << 8 | DIRECTFB_MICRO_VERSION) < (0 << 16 | 9 << 8 | 22)
3505 #error "DirectFB version too old."
3506 #endif
3507 int main(void) { DirectFBInit(0, 0); return 0; }
3509 for _inc_tmp in "" -I/usr/local/include/directfb -I/usr/include/directfb -I/usr/local/include; do
3510 cc_check $_inc_tmp -ldirectfb &&
3511 _directfb=yes && extra_cflags="$extra_cflags $_inc_tmp" && break
3512 done
3514 if test "$_directfb" = yes ; then
3515 def_directfb='#define CONFIG_DIRECTFB 1'
3516 vomodules="directfb $vomodules"
3517 libs_mplayer="$libs_mplayer -ldirectfb"
3518 else
3519 def_directfb='#undef CONFIG_DIRECTFB'
3520 novomodules="directfb $novomodules"
3522 echores "$_directfb"
3525 if darwin; then
3527 echocheck "QuickTime"
3528 if test "$quicktime" = auto ; then
3529 quicktime=no
3530 statement_check QuickTime/QuickTime.h 'ImageDescription *desc; EnterMovies(); ExitMovies()' -framework QuickTime && quicktime=yes
3532 if test "$quicktime" = yes ; then
3533 extra_ldflags="$extra_ldflags -framework QuickTime"
3534 def_quicktime='#define CONFIG_QUICKTIME 1'
3535 else
3536 def_quicktime='#undef CONFIG_QUICKTIME'
3538 echores $quicktime
3540 echocheck "Cocoa"
3541 if test "$_cocoa" = auto ; then
3542 cat > $TMPC <<EOF
3543 #include <CoreServices/CoreServices.h>
3544 #include <OpenGL/OpenGL.h>
3545 int main(void) {
3546 NSApplicationLoad();
3549 _cocoa=no
3550 cc_check -framework Cocoa -framework OpenGL && _cocoa=yes
3552 if test "$_cocoa" = yes ; then
3553 libs_mplayer="$libs_mplayer -framework Cocoa -framework OpenGL"
3554 def_cocoa='#define CONFIG_COCOA 1'
3555 else
3556 def_cocoa='#undef CONFIG_COCOA'
3558 echores "$_cocoa"
3560 echocheck "CoreVideo"
3561 if test "$_cocoa" = yes && test "$_corevideo" = auto ; then
3562 cat > $TMPC <<EOF
3563 #include <QuartzCore/CoreVideo.h>
3564 int main(void) { return 0; }
3566 _corevideo=no
3567 cc_check -framework Cocoa -framework QuartzCore -framework OpenGL && _corevideo=yes
3569 if test "$_corevideo" = yes ; then
3570 vomodules="corevideo $vomodules"
3571 libs_mplayer="$libs_mplayer -framework QuartzCore"
3572 def_corevideo='#define CONFIG_COREVIDEO 1'
3573 else
3574 novomodules="corevideo $novomodules"
3575 def_corevideo='#undef CONFIG_COREVIDEO'
3577 echores "$_corevideo"
3579 echocheck "SharedBuffer"
3580 if test "$_sharedbuffer" = auto ; then
3581 cat > $TMPC <<EOF
3582 int main(void) {
3583 NSApplicationLoad();
3586 _sharedbuffer=no
3587 cc_check -framework Cocoa && _sharedbuffer=yes
3589 if test "$_sharedbuffer" = yes ; then
3590 vomodules="sharedbuffer $vomodules"
3591 libs_mplayer="$libs_mplayer -framework Cocoa"
3592 def_sharedbuffer='#define CONFIG_SHAREDBUFFER 1'
3593 else
3594 novomodules="sharedbuffer $novomodules"
3595 def_sharedbuffer='#undef CONFIG_SHAREDBUFFER'
3597 echores "$_sharedbuffer"
3599 depends_on_application_services(){
3600 test "$_corevideo" = yes
3603 fi #if darwin
3606 echocheck "X11 headers presence"
3607 _x11_headers="no"
3608 res_comment="check if the dev(el) packages are installed"
3609 for I in $(echo $extra_cflags | sed s/-I//g) /usr/include ; do
3610 if test -f "$I/X11/Xlib.h" ; then
3611 _x11_headers="yes"
3612 res_comment=""
3613 break
3615 done
3616 if test $_cross_compile = no; then
3617 for I in /usr/X11/include /usr/X11R7/include /usr/local/include /usr/X11R6/include \
3618 /usr/include/X11R6 /usr/openwin/include ; do
3619 if test -f "$I/X11/Xlib.h" ; then
3620 extra_cflags="$extra_cflags -I$I"
3621 _x11_headers="yes"
3622 res_comment="using $I"
3623 break
3625 done
3627 echores "$_x11_headers"
3630 echocheck "X11"
3631 if test "$_x11" = auto && test "$_x11_headers" = yes ; then
3632 for I in "" -L/usr/X11R7/lib -L/usr/local/lib -L/usr/X11R6/lib -L/usr/lib/X11R6 \
3633 -L/usr/X11/lib -L/usr/lib32 -L/usr/openwin/lib -L/usr/local/lib64 -L/usr/X11R6/lib64 \
3634 -L/usr/lib ; do
3635 if netbsd; then
3636 _ld_tmp="$I -lXext -lX11 $_ld_pthread -Wl,-R$(echo $I | sed s/^-L//)"
3637 else
3638 _ld_tmp="$I -lXext -lX11 $_ld_pthread"
3640 statement_check X11/Xutil.h 'XCreateWindow(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)' $_ld_tmp &&
3641 _x11=yes
3642 # Check that there aren't conflicting headers between ApplicationServices
3643 # and X11. On versions of Mac OSX prior to 10.7 the deprecated QuickDraw API
3644 # is included by -framework ApplicationServices and clashes with the X11
3645 # definition of the "Cursor" type.
3646 if darwin && depends_on_application_services && test "$_x11" = yes ; then
3647 _x11=no
3648 header_check_broken ApplicationServices/ApplicationServices.h \
3649 X11/Xutil.h $_ld_tmp && _x11=yes
3651 if test "$_x11" = yes ; then
3652 libs_mplayer="$libs_mplayer $_ld_tmp"
3653 break
3655 done
3657 if test "$_x11" = yes ; then
3658 def_x11='#define CONFIG_X11 1'
3659 vomodules="x11 $vomodules"
3660 else
3661 _x11=no
3662 def_x11='#undef CONFIG_X11'
3663 novomodules="x11 $novomodules"
3664 res_comment="check if the dev(el) packages are installed"
3666 echores "$_x11"
3668 echocheck "Xss screensaver extensions"
3669 if test "$_xss" = auto ; then
3670 _xss=no
3671 statement_check "X11/extensions/scrnsaver.h" 'XScreenSaverSuspend(NULL, True)' -lXss && _xss=yes
3673 if test "$_xss" = yes ; then
3674 def_xss='#define CONFIG_XSS 1'
3675 libs_mplayer="$libs_mplayer -lXss"
3676 else
3677 def_xss='#undef CONFIG_XSS'
3679 echores "$_xss"
3681 echocheck "DPMS"
3682 _xdpms3=no
3683 _xdpms4=no
3684 if test "$_x11" = yes ; then
3685 cat > $TMPC <<EOF
3686 #include <X11/Xmd.h>
3687 #include <X11/Xlib.h>
3688 #include <X11/Xutil.h>
3689 #include <X11/Xatom.h>
3690 #include <X11/extensions/dpms.h>
3691 int main(void) { DPMSQueryExtension(0, 0, 0); return 0; }
3693 cc_check -lXdpms && _xdpms3=yes
3694 statement_check_broken X11/Xlib.h X11/extensions/dpms.h 'DPMSQueryExtension(0, 0, 0)' -lXext && _xdpms4=yes
3696 if test "$_xdpms4" = yes ; then
3697 def_xdpms='#define CONFIG_XDPMS 1'
3698 res_comment="using Xdpms 4"
3699 echores "yes"
3700 elif test "$_xdpms3" = yes ; then
3701 def_xdpms='#define CONFIG_XDPMS 1'
3702 libs_mplayer="$libs_mplayer -lXdpms"
3703 res_comment="using Xdpms 3"
3704 echores "yes"
3705 else
3706 def_xdpms='#undef CONFIG_XDPMS'
3707 echores "no"
3711 echocheck "Xv"
3712 if test "$_xv" = auto && test "$_x11" = yes ; then
3713 _xv=no
3714 statement_check_broken X11/Xlib.h X11/extensions/Xvlib.h 'XvGetPortAttribute(0, 0, 0, 0)' -lXv && _xv=yes
3717 if test "$_xv" = yes ; then
3718 def_xv='#define CONFIG_XV 1'
3719 libs_mplayer="$libs_mplayer -lXv"
3720 vomodules="xv $vomodules"
3721 else
3722 def_xv='#undef CONFIG_XV'
3723 novomodules="xv $novomodules"
3725 echores "$_xv"
3728 echocheck "VDPAU"
3729 if test "$_vdpau" = auto && test "$_x11" = yes ; then
3730 _vdpau=no
3731 if test "$_dl" = yes ; then
3732 pkg_config_add 'vdpau >= 0.2' && _vdpau=yes
3735 if test "$_vdpau" = yes ; then
3736 def_vdpau='#define CONFIG_VDPAU 1'
3737 vomodules="vdpau $vomodules"
3738 else
3739 def_vdpau='#define CONFIG_VDPAU 0'
3740 novomodules="vdpau $novomodules"
3742 echores "$_vdpau"
3745 echocheck "Xinerama"
3746 if test "$_xinerama" = auto && test "$_x11" = yes ; then
3747 _xinerama=no
3748 statement_check X11/extensions/Xinerama.h 'XineramaIsActive(0)' -lXinerama && _xinerama=yes
3751 if test "$_xinerama" = yes ; then
3752 def_xinerama='#define CONFIG_XINERAMA 1'
3753 libs_mplayer="$libs_mplayer -lXinerama"
3754 else
3755 def_xinerama='#undef CONFIG_XINERAMA'
3757 echores "$_xinerama"
3760 # Note: the -lXxf86vm library is the VideoMode extension and though it's not
3761 # needed for DGA, AFAIK every distribution packages together with DGA stuffs
3762 # named 'X extensions' or something similar.
3763 # This check may be useful for future mplayer versions (to change resolution)
3764 # If you run into problems, remove '-lXxf86vm'.
3765 echocheck "Xxf86vm"
3766 if test "$_vm" = auto && test "$_x11" = yes ; then
3767 _vm=no
3768 statement_check_broken X11/Xlib.h X11/extensions/xf86vmode.h 'XF86VidModeQueryExtension(0, 0, 0)' -lXxf86vm && _vm=yes
3770 if test "$_vm" = yes ; then
3771 def_vm='#define CONFIG_XF86VM 1'
3772 libs_mplayer="$libs_mplayer -lXxf86vm"
3773 else
3774 def_vm='#undef CONFIG_XF86VM'
3776 echores "$_vm"
3778 # Check for the presence of special keycodes, like audio control buttons
3779 # that XFree86 might have. Used to be bundled with the xf86vm check, but
3780 # has nothing to do with xf86vm and XFree 3.x has xf86vm but does NOT
3781 # have these new keycodes.
3782 echocheck "XF86keysym"
3783 if test "$_xf86keysym" = auto && test "$_x11" = yes ; then
3784 _xf86keysym=no
3785 return_check X11/XF86keysym.h XF86XK_AudioPause && _xf86keysym=yes
3787 if test "$_xf86keysym" = yes ; then
3788 def_xf86keysym='#define CONFIG_XF86XK 1'
3789 else
3790 def_xf86keysym='#undef CONFIG_XF86XK'
3792 echores "$_xf86keysym"
3795 echocheck "CACA"
3796 if test "$_caca" = auto ; then
3797 _caca=no
3798 if ( caca-config --version ) >> "$TMPLOG" 2>&1 ; then
3799 cat > $TMPC << EOF
3800 #include <caca.h>
3801 #ifdef CACA_API_VERSION_1
3802 #include <caca0.h>
3803 #endif
3804 int main(void) { caca_init(); return 0; }
3806 cc_check $(caca-config --libs) && _caca=yes
3809 if test "$_caca" = yes ; then
3810 def_caca='#define CONFIG_CACA 1'
3811 extra_cflags="$extra_cflags $(caca-config --cflags)"
3812 libs_mplayer="$libs_mplayer $(caca-config --libs)"
3813 vomodules="caca $vomodules"
3814 else
3815 def_caca='#undef CONFIG_CACA'
3816 novomodules="caca $novomodules"
3818 echores "$_caca"
3821 echocheck "DVB"
3822 if test "$_dvb" = auto ; then
3823 _dvb=no
3824 cat >$TMPC << EOF
3825 #include <poll.h>
3826 #include <sys/ioctl.h>
3827 #include <stdio.h>
3828 #include <time.h>
3829 #include <unistd.h>
3830 #include <linux/dvb/dmx.h>
3831 #include <linux/dvb/frontend.h>
3832 #include <linux/dvb/video.h>
3833 #include <linux/dvb/audio.h>
3834 int main(void) {return 0;}
3836 for _inc_tmp in "" "-I/usr/src/DVB/include" ; do
3837 cc_check $_inc_tmp && _dvb=yes &&
3838 extra_cflags="$extra_cflags $_inc_tmp" && break
3839 done
3841 echores "$_dvb"
3842 if test "$_dvb" = yes ; then
3843 _dvbin=yes
3844 inputmodules="dvb $inputmodules"
3845 def_dvbin='#define CONFIG_DVBIN 1'
3846 else
3847 _dvbin=no
3848 noinputmodules="dvb $noinputmodules"
3849 def_dvbin='#undef CONFIG_DVBIN '
3853 echocheck "PNG support"
3854 if test "$_png" = auto ; then
3855 _png=no
3856 cat > $TMPC << EOF
3857 #include <stdio.h>
3858 #include <string.h>
3859 #include <png.h>
3860 int main(void) {
3861 printf("png.h : %s\n", PNG_LIBPNG_VER_STRING);
3862 printf("libpng: %s\n", png_libpng_ver);
3863 return strcmp(PNG_LIBPNG_VER_STRING, png_libpng_ver);
3866 cc_check -lpng -lz $_ld_lm && _png=yes
3868 echores "$_png"
3869 if test "$_png" = yes ; then
3870 def_png='#define CONFIG_PNG 1'
3871 extra_ldflags="$extra_ldflags -lpng -lz"
3872 else
3873 def_png='#undef CONFIG_PNG'
3876 echocheck "MNG support"
3877 if test "$_mng" = auto ; then
3878 _mng=no
3879 return_statement_check libmng.h 'const char * p_ver = mng_version_text()' '!p_ver || p_ver[0] == 0' -lmng -lz $_ld_lm && _mng=yes
3881 echores "$_mng"
3882 if test "$_mng" = yes ; then
3883 def_mng='#define CONFIG_MNG 1'
3884 extra_ldflags="$extra_ldflags -lmng -lz"
3885 else
3886 def_mng='#undef CONFIG_MNG'
3889 echocheck "JPEG support"
3890 if test "$_jpeg" = auto ; then
3891 _jpeg=no
3892 header_check_broken stdio.h jpeglib.h -ljpeg $_ld_lm && _jpeg=yes
3894 echores "$_jpeg"
3896 if test "$_jpeg" = yes ; then
3897 def_jpeg='#define CONFIG_JPEG 1'
3898 vomodules="jpeg $vomodules"
3899 extra_ldflags="$extra_ldflags -ljpeg"
3900 else
3901 def_jpeg='#undef CONFIG_JPEG'
3902 novomodules="jpeg $novomodules"
3907 echocheck "PNM support"
3908 if test "$_pnm" = yes; then
3909 def_pnm="#define CONFIG_PNM 1"
3910 vomodules="pnm $vomodules"
3911 else
3912 def_pnm="#undef CONFIG_PNM"
3913 novomodules="pnm $novomodules"
3915 echores "$_pnm"
3919 echocheck "GIF support"
3920 # This is to appease people who want to force gif support.
3921 # If it is forced to yes, then we still do checks to determine
3922 # which gif library to use.
3923 if test "$_gif" = yes ; then
3924 _force_gif=yes
3925 _gif=auto
3928 if test "$_gif" = auto ; then
3929 _gif=no
3930 for _ld_gif in "-lungif" "-lgif" ; do
3931 statement_check gif_lib.h 'QuantizeBuffer(0, 0, 0, 0, 0, 0, 0, 0)' $_ld_gif && _gif=yes && break
3932 done
3935 # If no library was found, and the user wants support forced,
3936 # then we force it on with libgif, as this is the safest
3937 # assumption IMHO. (libungif & libregif both create symbolic
3938 # links to libgif. We also assume that no x11 support is needed,
3939 # because if you are forcing this, then you _should_ know what
3940 # you are doing. [ Besides, package maintainers should never
3941 # have compiled x11 deps into libungif in the first place. ] )
3942 # </rant>
3943 # --Joey
3944 if test "$_force_gif" = yes && test "$_gif" = no ; then
3945 _gif=yes
3946 _ld_gif="-lgif"
3949 if test "$_gif" = yes ; then
3950 def_gif='#define CONFIG_GIF 1'
3951 codecmodules="gif $codecmodules"
3952 vomodules="gif89a $vomodules"
3953 res_comment="old version, some encoding functions disabled"
3954 def_gif_4='#undef CONFIG_GIF_4'
3955 extra_ldflags="$extra_ldflags $_ld_gif"
3957 cat > $TMPC << EOF
3958 #include <signal.h>
3959 #include <stdio.h>
3960 #include <stdlib.h>
3961 #include <gif_lib.h>
3962 static void catch(int sig) { exit(1); }
3963 int main(void) {
3964 signal(SIGSEGV, catch); // catch segfault
3965 printf("EGifPutExtensionFirst is at address %p\n", EGifPutExtensionFirst);
3966 EGifSetGifVersion("89a"); // this will segfault a buggy gif lib.
3967 return 0;
3970 if cc_check "$_ld_gif" ; then
3971 def_gif_4='#define CONFIG_GIF_4 1'
3972 res_comment=""
3974 else
3975 def_gif='#undef CONFIG_GIF'
3976 def_gif_4='#undef CONFIG_GIF_4'
3977 novomodules="gif89a $novomodules"
3978 nocodecmodules="gif $nocodecmodules"
3980 echores "$_gif"
3983 case "$_gif" in yes*)
3984 echocheck "broken giflib workaround"
3985 def_gif_tvt_hack='#define CONFIG_GIF_TVT_HACK 1'
3987 cat > $TMPC << EOF
3988 #include <stdio.h>
3989 #include <gif_lib.h>
3990 int main(void) {
3991 GifFileType gif = {.UserData = NULL};
3992 printf("UserData is at address %p\n", gif.UserData);
3993 return 0;
3996 if cc_check "$_ld_gif" ; then
3997 def_gif_tvt_hack='#undef CONFIG_GIF_TVT_HACK'
3998 echores "disabled"
3999 else
4000 echores "enabled"
4003 esac
4006 #################
4007 # VIDEO + AUDIO #
4008 #################
4011 echocheck "SDL"
4012 _inc_tmp=""
4013 _ld_tmp=""
4014 def_sdl_sdl_h="#undef CONFIG_SDL_SDL_H"
4015 if test -z "$_sdlconfig" ; then
4016 if ( sdl-config --version ) >>"$TMPLOG" 2>&1 ; then
4017 _sdlconfig="sdl-config"
4018 elif ( sdl11-config --version ) >>"$TMPLOG" 2>&1 ; then
4019 _sdlconfig="sdl11-config"
4020 else
4021 _sdlconfig=false
4024 if test "$_sdl" = auto || test "$_sdl" = yes ; then
4025 cat > $TMPC << EOF
4026 #ifdef CONFIG_SDL_SDL_H
4027 #include <SDL/SDL.h>
4028 #else
4029 #include <SDL.h>
4030 #endif
4031 #ifndef __APPLE__
4032 // we allow SDL hacking our main() only on OSX
4033 #undef main
4034 #endif
4035 int main(int argc, char *argv[]) {
4036 SDL_Init(SDL_INIT_VIDEO|SDL_INIT_NOPARACHUTE);
4037 return 0;
4040 _sdl=no
4041 for _ld_tmp in "-lSDL" "-lSDL -lpthread" "-lSDL -lwinmm -lgdi32" "-lSDL -lwinmm -lgdi32 -ldxguid" ; do
4042 if cc_check -DCONFIG_SDL_SDL_H $_inc_tmp $_ld_tmp ; then
4043 _sdl=yes
4044 def_sdl_sdl_h="#define CONFIG_SDL_SDL_H 1"
4045 break
4047 done
4048 if test "$_sdl" = no && "$_sdlconfig" --version >>"$TMPLOG" 2>&1 ; then
4049 res_comment="using $_sdlconfig"
4050 if cygwin ; then
4051 _inc_tmp="$($_sdlconfig --cflags | cut -d " " -f 1,5,6 | sed s/no-cygwin/cygwin/)"
4052 _ld_tmp="$($_sdlconfig --libs | cut -d " " -f 1,4,6 | sed s/no-cygwin/cygwin/)"
4053 elif mingw32 ; then
4054 _inc_tmp=$($_sdlconfig --cflags | sed s/-Dmain=SDL_main//)
4055 _ld_tmp=$($_sdlconfig --libs | sed -e s/-mwindows// -e s/-lmingw32//)
4056 else
4057 _inc_tmp="$($_sdlconfig --cflags)"
4058 _ld_tmp="$($_sdlconfig --libs)"
4060 if cc_check $_inc_tmp $_ld_tmp >>"$TMPLOG" 2>&1 ; then
4061 _sdl=yes
4062 elif cc_check $_inc_tmp $_ld_tmp -lstdc++ >>"$TMPLOG" 2>&1 ; then
4063 # HACK for BeOS/Haiku SDL
4064 _ld_tmp="$_ld_tmp -lstdc++"
4065 _sdl=yes
4069 if test "$_sdl" = yes ; then
4070 def_sdl='#define CONFIG_SDL 1'
4071 extra_cflags="$extra_cflags $_inc_tmp"
4072 libs_mplayer="$libs_mplayer $_ld_tmp"
4073 vomodules="sdl $vomodules"
4074 aomodules="sdl $aomodules"
4075 else
4076 def_sdl='#undef CONFIG_SDL'
4077 novomodules="sdl $novomodules"
4078 noaomodules="sdl $noaomodules"
4080 echores "$_sdl"
4083 # make sure this stays below CoreVideo to avoid issues due to namespace
4084 # conflicts between -lGL and -framework OpenGL
4085 echocheck "OpenGL"
4086 #Note: this test is run even with --enable-gl since we autodetect linker flags
4087 if (test "$_x11" = yes || test "$_sdl" = yes || test "$_cocoa" = yes || win32) && test "$_gl" != no ; then
4088 cat > $TMPC << EOF
4089 #ifdef GL_WIN32
4090 #include <windows.h>
4091 #include <GL/gl.h>
4092 #elif defined(GL_SDL)
4093 #include <GL/gl.h>
4094 #ifdef CONFIG_SDL_SDL_H
4095 #include <SDL/SDL.h>
4096 #else
4097 #include <SDL.h>
4098 #endif
4099 #ifndef __APPLE__
4100 // we allow SDL hacking our main() only on OSX
4101 #undef main
4102 #endif
4103 #else
4104 #include <GL/gl.h>
4105 #include <X11/Xlib.h>
4106 #include <GL/glx.h>
4107 #endif
4108 int main(int argc, char *argv[]) {
4109 #ifdef GL_WIN32
4110 HDC dc;
4111 wglCreateContext(dc);
4112 #elif defined(GL_SDL)
4113 SDL_GL_SwapBuffers();
4114 #else
4115 glXCreateContext(NULL, NULL, NULL, True);
4116 #endif
4117 glFinish();
4118 return 0;
4121 _gl=no
4122 if test "$_x11" = yes ; then
4123 for _ld_tmp in "" -lGL "-lGL -lXdamage" "-lGL $_ld_pthread" ; do
4124 if cc_check $_ld_tmp $_ld_lm ; then
4125 _gl=yes
4126 _gl_x11=yes
4127 libs_mplayer="$libs_mplayer $_ld_tmp $_ld_dl"
4128 break
4130 done
4132 if win32 && cc_check -DGL_WIN32 -lopengl32 ; then
4133 _gl=yes
4134 _gl_win32=yes
4135 libs_mplayer="$libs_mplayer -lopengl32 -lgdi32"
4137 if test "$_cocoa" = yes ; then
4138 _gl=yes
4139 _gl_cocoa=yes
4141 # last so it can reuse any linker etc. flags detected before
4142 if test "$_sdl" = yes ; then
4143 if cc_check -DGL_SDL ||
4144 cc_check -DCONFIG_SDL_SDL_H -DGL_SDL ; then
4145 _gl=yes
4146 _gl_sdl=yes
4147 elif cc_check -DGL_SDL -lGL ||
4148 cc_check -DCONFIG_SDL_SDL_H -DGL_SDL -lGL ; then
4149 _gl=yes
4150 _gl_sdl=yes
4151 libs_mplayer="$libs_mplayer -lGL"
4154 else
4155 _gl=no
4157 if test "$_gl" = yes ; then
4158 def_gl='#define CONFIG_GL 1'
4159 res_comment="backends:"
4160 if test "$_gl_cocoa" = yes ; then
4161 def_gl_cocoa='#define CONFIG_GL_COCOA 1'
4162 res_comment="$res_comment cocoa"
4164 if test "$_gl_win32" = yes ; then
4165 def_gl_win32='#define CONFIG_GL_WIN32 1'
4166 res_comment="$res_comment win32"
4168 if test "$_gl_x11" = yes ; then
4169 def_gl_x11='#define CONFIG_GL_X11 1'
4170 res_comment="$res_comment x11"
4172 if test "$_gl_sdl" = yes ; then
4173 def_gl_sdl='#define CONFIG_GL_SDL 1'
4174 res_comment="$res_comment sdl"
4176 vomodules="opengl $vomodules"
4177 else
4178 def_gl='#undef CONFIG_GL'
4179 def_gl_cocoa='#undef CONFIG_GL_COCOA'
4180 def_gl_win32='#undef CONFIG_GL_WIN32'
4181 def_gl_x11='#undef CONFIG_GL_X11'
4182 def_gl_sdl='#undef CONFIG_GL_SDL'
4183 novomodules="opengl $novomodules"
4185 echores "$_gl"
4188 if win32; then
4190 echocheck "Direct3D"
4191 if test "$_direct3d" = auto ; then
4192 _direct3d=no
4193 header_check d3d9.h && _direct3d=yes
4195 if test "$_direct3d" = yes ; then
4196 def_direct3d='#define CONFIG_DIRECT3D 1'
4197 vomodules="direct3d $vomodules"
4198 else
4199 def_direct3d='#undef CONFIG_DIRECT3D'
4200 novomodules="direct3d $novomodules"
4202 echores "$_direct3d"
4204 echocheck "Directx"
4205 if test "$_directx" = auto ; then
4206 cat > $TMPC << EOF
4207 #include <ddraw.h>
4208 #include <dsound.h>
4209 int main(void) { return 0; }
4211 _directx=no
4212 cc_check -lgdi32 && _directx=yes
4214 if test "$_directx" = yes ; then
4215 def_directx='#define CONFIG_DIRECTX 1'
4216 libs_mplayer="$libs_mplayer -lgdi32"
4217 vomodules="directx $vomodules"
4218 aomodules="dsound $aomodules"
4219 else
4220 def_directx='#undef CONFIG_DIRECTX'
4221 novomodules="directx $novomodules"
4222 noaomodules="dsound $noaomodules"
4224 echores "$_directx"
4226 fi #if win32; then
4229 echocheck "V4L2 MPEG Decoder"
4230 if test "$_v4l2" = auto ; then
4231 cat > $TMPC << EOF
4232 #include <sys/time.h>
4233 #include <linux/videodev2.h>
4234 #include <linux/version.h>
4235 int main(void) {
4236 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22)
4237 #error kernel headers too old, need 2.6.22
4238 #endif
4239 struct v4l2_ext_controls ctrls;
4240 ctrls.ctrl_class = V4L2_CTRL_CLASS_MPEG;
4241 return 0;
4244 _v4l2=no
4245 cc_check && _v4l2=yes
4247 if test "$_v4l2" = yes ; then
4248 def_v4l2='#define CONFIG_V4L2_DECODER 1'
4249 vomodules="v4l2 $vomodules"
4250 aomodules="v4l2 $aomodules"
4251 else
4252 def_v4l2='#undef CONFIG_V4L2_DECODER'
4253 novomodules="v4l2 $novomodules"
4254 noaomodules="v4l2 $noaomodules"
4256 echores "$_v4l2"
4260 #########
4261 # AUDIO #
4262 #########
4265 echocheck "OSS Audio"
4266 if test "$_ossaudio" = auto ; then
4267 _ossaudio=no
4268 return_check $_soundcard_header SNDCTL_DSP_SETFRAGMENT && _ossaudio=yes
4270 if test "$_ossaudio" = yes ; then
4271 def_ossaudio='#define CONFIG_OSS_AUDIO 1'
4272 aomodules="oss $aomodules"
4273 cat > $TMPC << EOF
4274 #include <$_soundcard_header>
4275 #ifdef OPEN_SOUND_SYSTEM
4276 int main(void) { return 0; }
4277 #else
4278 #error Not the real thing
4279 #endif
4281 _real_ossaudio=no
4282 cc_check && _real_ossaudio=yes
4283 if test "$_real_ossaudio" = yes; then
4284 def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/dsp"'
4285 # Check for OSS4 headers (override default headers)
4286 # Does not apply to systems where OSS4 is native (e.g. FreeBSD)
4287 if test -f /etc/oss.conf; then
4288 . /etc/oss.conf
4289 _ossinc="$OSSLIBDIR/include"
4290 if test -f "$_ossinc/sys/soundcard.h"; then
4291 extra_cflags="-I$_ossinc $extra_cflags"
4294 elif netbsd || openbsd ; then
4295 def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/sound"'
4296 extra_ldflags="$extra_ldflags -lossaudio"
4297 else
4298 def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/dsp"'
4300 def_ossaudio_devmixer='#define PATH_DEV_MIXER "/dev/mixer"'
4301 else
4302 def_ossaudio='#undef CONFIG_OSS_AUDIO'
4303 def_ossaudio_devdsp='#define PATH_DEV_DSP ""'
4304 def_ossaudio_devmixer='#define PATH_DEV_MIXER ""'
4305 noaomodules="oss $noaomodules"
4307 echores "$_ossaudio"
4310 echocheck "RSound"
4311 if test "$_rsound" = auto ; then
4312 _rsound=no
4313 statement_check rsound.h 'rsd_init(NULL);' -lrsound && _rsound=yes
4315 echores "$_rsound"
4317 if test "$_rsound" = yes ; then
4318 def_rsound='#define CONFIG_RSOUND 1'
4319 aomodules="rsound $aomodules"
4320 libs_mplayer="$libs_mplayer -lrsound"
4321 else
4322 def_rsound='#undef CONFIG_RSOUND'
4323 noaomodules="rsound $noaomodules"
4327 echocheck "pulse"
4328 if test "$_pulse" = auto ; then
4329 _pulse=no
4330 if pkg_config_add 'libpulse >= 0.9' ; then
4331 _pulse=yes
4334 echores "$_pulse"
4336 if test "$_pulse" = yes ; then
4337 def_pulse='#define CONFIG_PULSE 1'
4338 aomodules="pulse $aomodules"
4339 else
4340 def_pulse='#undef CONFIG_PULSE'
4341 noaomodules="pulse $noaomodules"
4345 echocheck "PortAudio"
4346 if test "$_portaudio" = auto && test "$_pthreads" != yes ; then
4347 _portaudio=no
4348 res_comment="pthreads not enabled"
4350 if test "$_portaudio" = auto ; then
4351 _portaudio=no
4352 if pkg_config_add 'portaudio-2.0 >= 19' ; then
4353 _portaudio=yes
4356 echores "$_portaudio"
4358 if test "$_portaudio" = yes ; then
4359 def_portaudio='#define CONFIG_PORTAUDIO 1'
4360 aomodules="portaudio $aomodules"
4361 else
4362 def_portaudio='#undef CONFIG_PORTAUDIO'
4363 noaomodules="portaudio $noaomodules"
4367 echocheck "JACK"
4368 if test "$_jack" = auto ; then
4369 _jack=no
4370 if pkg_config_add jack ; then
4371 _jack=yes
4375 if test "$_jack" = yes ; then
4376 def_jack='#define CONFIG_JACK 1'
4377 aomodules="jack $aomodules"
4378 else
4379 noaomodules="jack $noaomodules"
4381 echores "$_jack"
4383 echocheck "OpenAL"
4384 if test "$_openal" = auto ; then
4385 _openal=no
4386 cat > $TMPC << EOF
4387 #ifdef OPENAL_AL_H
4388 #include <OpenAL/al.h>
4389 #else
4390 #include <AL/al.h>
4391 #endif
4392 int main(void) {
4393 alSourceQueueBuffers(0, 0, 0);
4394 // alGetSourcei(0, AL_SAMPLE_OFFSET, 0);
4395 return 0;
4398 for I in "-lopenal" "-lopenal32" "-framework OpenAL" ; do
4399 cc_check $I && _openal=yes && break
4400 cc_check -DOPENAL_AL_H=1 $I && def_openal_h='#define OPENAL_AL_H 1' && _openal=yes && break
4401 done
4402 test "$_openal" = yes && libs_mplayer="$libs_mplayer $I"
4404 if test "$_openal" = yes ; then
4405 def_openal='#define CONFIG_OPENAL 1'
4406 aomodules="openal $aomodules"
4407 else
4408 noaomodules="openal $noaomodules"
4410 echores "$_openal"
4412 echocheck "ALSA audio"
4413 if test "$_alloca" != yes ; then
4414 _alsa=no
4415 res_comment="alloca missing"
4417 if test "$_alsa" = auto ; then
4418 _alsa=no
4419 if pkg_config_add "alsa >= 1.0.9" ; then
4420 _alsa=yes
4423 def_alsa='#undef CONFIG_ALSA'
4424 if test "$_alsa" = yes ; then
4425 aomodules="alsa $aomodules"
4426 def_alsa='#define CONFIG_ALSA 1'
4427 else
4428 noaomodules="alsa $noaomodules"
4430 echores "$_alsa"
4433 if darwin; then
4434 echocheck "CoreAudio"
4435 if test "$_coreaudio" = auto ; then
4436 cat > $TMPC <<EOF
4437 #include <CoreAudio/CoreAudio.h>
4438 #include <AudioToolbox/AudioToolbox.h>
4439 #include <AudioUnit/AudioUnit.h>
4440 int main(void) { return 0; }
4442 _coreaudio=no
4443 cc_check -framework CoreAudio -framework AudioUnit -framework AudioToolbox && _coreaudio=yes
4445 if test "$_coreaudio" = yes ; then
4446 libs_mplayer="$libs_mplayer -framework CoreAudio -framework AudioUnit -framework AudioToolbox"
4447 def_coreaudio='#define CONFIG_COREAUDIO 1'
4448 aomodules="coreaudio $aomodules"
4449 else
4450 def_coreaudio='#undef CONFIG_COREAUDIO'
4451 noaomodules="coreaudio $noaomodules"
4453 echores $_coreaudio
4454 fi #if darwin
4457 # set default CD/DVD devices
4458 if win32 ; then
4459 default_cdrom_device="D:"
4460 elif darwin ; then
4461 default_cdrom_device="/dev/disk1"
4462 elif dragonfly ; then
4463 default_cdrom_device="/dev/cd0"
4464 elif freebsd ; then
4465 default_cdrom_device="/dev/acd0"
4466 elif openbsd ; then
4467 default_cdrom_device="/dev/rcd0c"
4468 elif amigaos ; then
4469 default_cdrom_device="a1ide.device:2"
4470 else
4471 default_cdrom_device="/dev/cdrom"
4474 if win32 || dragonfly || freebsd || openbsd || amigaos ; then
4475 default_dvd_device=$default_cdrom_device
4476 elif darwin ; then
4477 default_dvd_device="/dev/rdiskN"
4478 else
4479 default_dvd_device="/dev/dvd"
4483 echocheck "VCD support"
4484 if test "$_vcd" = auto; then
4485 _vcd=no
4486 if linux || freebsd || netbsd || openbsd || dragonfly || bsdos || darwin ; then
4487 _vcd=yes
4488 elif mingw32; then
4489 header_check ddk/ntddcdrm.h && _vcd=yes
4492 if test "$_vcd" = yes; then
4493 inputmodules="vcd $inputmodules"
4494 def_vcd='#define CONFIG_VCD 1'
4495 else
4496 def_vcd='#undef CONFIG_VCD'
4497 noinputmodules="vcd $noinputmodules"
4498 res_comment="not supported on this OS"
4500 echores "$_vcd"
4504 echocheck "Blu-ray support"
4505 if test "$_bluray" = auto ; then
4506 _bluray=no
4507 pkg_config_add 'libbluray >= 0.2.1' && _bluray=yes
4509 if test "$_bluray" = yes ; then
4510 def_bluray='#define CONFIG_LIBBLURAY 1'
4511 inputmodules="bluray $inputmodules"
4512 else
4513 def_bluray='#undef CONFIG_LIBBLURAY'
4514 noinputmodules="bluray $noinputmodules"
4516 echores "$_bluray"
4518 echocheck "dvdread"
4519 if test "$_dvdread_internal" = auto && test ! -f "libdvdread4/dvd_reader.c" ; then
4520 _dvdread_internal=no
4522 if test "$_dvdread_internal" = auto ; then
4523 _dvdread_internal=no
4524 _dvdread=no
4525 if (linux || freebsd || netbsd || openbsd || dragonfly || hpux) &&
4526 (test "$_dvd" = yes || test "$_cdrom" = yes || test "$_cdio" = yes ||
4527 test "$_dvdio" = yes || test "$_bsdi_dvd" = yes) ||
4528 darwin || win32; then
4529 _dvdread_internal=yes
4530 _dvdread=yes
4531 extra_cflags="-Ilibdvdread4 $extra_cflags"
4533 elif test "$_dvdread" = auto ; then
4534 _dvdread=no
4535 if test "$_dl" = yes; then
4536 _dvdreadcflags=$($_dvdreadconfig --cflags 2> /dev/null)
4537 _dvdreadlibs=$($_dvdreadconfig --libs 2> /dev/null)
4538 if header_check dvdread/dvd_reader.h $_dvdreadcflags $_dvdreadlibs $_ld_dl ; then
4539 _dvdread=yes
4540 extra_cflags="$extra_cflags $_dvdreadcflags"
4541 extra_ldflags="$extra_ldflags $_dvdreadlibs"
4542 res_comment="external"
4547 if test "$_dvdread_internal" = yes; then
4548 def_dvdread='#define CONFIG_DVDREAD 1'
4549 inputmodules="dvdread(internal) $inputmodules"
4550 res_comment="internal"
4551 elif test "$_dvdread" = yes; then
4552 def_dvdread='#define CONFIG_DVDREAD 1'
4553 extra_ldflags="$extra_ldflags -ldvdread"
4554 inputmodules="dvdread(external) $inputmodules"
4555 res_comment="external"
4556 else
4557 def_dvdread='#undef CONFIG_DVDREAD'
4558 noinputmodules="dvdread $noinputmodules"
4560 echores "$_dvdread"
4563 echocheck "internal libdvdcss"
4564 if test "$_libdvdcss_internal" = auto ; then
4565 _libdvdcss_internal=no
4566 test "$_dvdread_internal" = yes && test -d libdvdcss && _libdvdcss_internal=yes
4567 hpux && test "$_hpux_scsi_h" = no && _libdvdcss_internal=no
4569 if test "$_libdvdcss_internal" = yes ; then
4570 if linux || netbsd || openbsd || bsdos ; then
4571 def_dvd_linux='#define HAVE_LINUX_DVD_STRUCT 1'
4572 openbsd && def_dvd_openbsd='#define HAVE_OPENBSD_DVD_STRUCT 1'
4573 elif freebsd || dragonfly ; then
4574 def_dvd_bsd='#define HAVE_BSD_DVD_STRUCT 1'
4575 elif darwin ; then
4576 def_dvd_darwin='#define DARWIN_DVD_IOCTL'
4577 extra_ldflags="$extra_ldflags -framework IOKit -framework Carbon"
4578 elif cygwin ; then
4579 cflags_libdvdcss="-DSYS_CYGWIN -DWIN32"
4580 elif beos ; then
4581 cflags_libdvdcss="-DSYS_BEOS"
4583 cflags_libdvdcss_dvdread="-Ilibdvdcss"
4584 def_dvdcss="#define HAVE_DVDCSS_DVDCSS_H 1"
4585 inputmodules="libdvdcss(internal) $inputmodules"
4586 else
4587 noinputmodules="libdvdcss(internal) $noinputmodules"
4589 echores "$_libdvdcss_internal"
4592 echocheck "libcdio"
4593 if test "$_libcdio" = auto ; then
4594 _libcdio=no
4595 if pkg_config_add libcdio_paranoia ; then
4596 _libcdio=yes
4599 if test "$_libcdio" = yes ; then
4600 _cdda='yes'
4601 def_cdda='#define CONFIG_CDDA 1'
4602 test $_cddb = auto && test $networking = yes && _cddb=yes
4603 inputmodules="cdda $inputmodules"
4604 else
4605 _libcdio=no
4606 _cdda='no'
4607 def_cdda='#undef CONFIG_CDDA'
4608 noinputmodules="cdda $noinputmodules"
4610 echores "$_libcdio"
4612 if test "$_cddb" = yes ; then
4613 def_cddb='#define CONFIG_CDDB 1'
4614 inputmodules="cddb $inputmodules"
4615 else
4616 _cddb=no
4617 def_cddb='#undef CONFIG_CDDB'
4618 noinputmodules="cddb $noinputmodules"
4622 echocheck "SSA/ASS support"
4623 if test "$_ass" = auto ; then
4624 if pkg_config_add libass ; then
4625 _ass=yes
4626 def_ass='#define CONFIG_ASS 1'
4627 else
4628 die "Unable to find development files for libass. Aborting. If you really mean to compile without libass support use --disable-libass."
4630 else
4631 def_ass='#undef CONFIG_ASS'
4633 echores "$_ass"
4636 echocheck "ENCA"
4637 if test "$_enca" = auto ; then
4638 _enca=no
4639 statement_check enca.h 'enca_get_languages(NULL)' -lenca $_ld_lm && _enca=yes
4641 if test "$_enca" = yes ; then
4642 def_enca='#define CONFIG_ENCA 1'
4643 extra_ldflags="$extra_ldflags -lenca"
4644 else
4645 def_enca='#undef CONFIG_ENCA'
4647 echores "$_enca"
4650 echocheck "zlib"
4651 _zlib=no
4652 statement_check zlib.h 'inflate(0, Z_NO_FLUSH)' -lz && _zlib=yes
4653 if test "$_zlib" = yes ; then
4654 def_zlib='#define CONFIG_ZLIB 1'
4655 extra_ldflags="$extra_ldflags -lz"
4656 else
4657 def_zlib='#define CONFIG_ZLIB 0'
4659 echores "$_zlib"
4662 echocheck "RTC"
4663 if test "$_rtc" = auto ; then
4664 cat > $TMPC << EOF
4665 #include <sys/ioctl.h>
4666 #ifdef __linux__
4667 #include <linux/rtc.h>
4668 #else
4669 #include <rtc.h>
4670 #define RTC_PIE_ON RTCIO_PIE_ON
4671 #endif
4672 int main(void) { return RTC_PIE_ON; }
4674 _rtc=no
4675 cc_check && _rtc=yes
4676 ppc && _rtc=no
4678 if test "$_rtc" = yes ; then
4679 def_rtc='#define HAVE_RTC 1'
4680 else
4681 def_rtc='#undef HAVE_RTC'
4683 echores "$_rtc"
4686 echocheck "mad support"
4687 if test "$_mad" = auto ; then
4688 _mad=no
4689 header_check mad.h -lmad && _mad=yes
4691 if test "$_mad" = yes ; then
4692 def_mad='#define CONFIG_LIBMAD 1'
4693 extra_ldflags="$extra_ldflags -lmad"
4694 codecmodules="libmad $codecmodules"
4695 else
4696 def_mad='#undef CONFIG_LIBMAD'
4697 nocodecmodules="libmad $nocodecmodules"
4699 echores "$_mad"
4701 echocheck "OggVorbis support"
4702 if test "$_libvorbis" = auto; then
4703 _libvorbis=no
4704 statement_check vorbis/codec.h 'vorbis_packet_blocksize(0, 0)' -lvorbis -logg $_ld_lm && _libvorbis=yes && _tremor=no
4705 elif test "$_libvorbis" = yes ; then
4706 _tremor=no
4708 if test "$_tremor" = auto; then
4709 _tremor=no
4710 statement_check tremor/ivorbiscodec.h 'vorbis_packet_blocksize(0, 0)' -logg -lvorbisidec $_ld_lm && _tremor=yes
4712 if test "$_tremor" = yes ; then
4713 _vorbis=yes
4714 def_vorbis='#define CONFIG_OGGVORBIS 1'
4715 def_tremor='#define CONFIG_TREMOR 1'
4716 codecmodules="tremor(external) $codecmodules"
4717 res_comment="external Tremor"
4718 extra_ldflags="$extra_ldflags -logg -lvorbisidec"
4719 elif test "$_libvorbis" = yes ; then
4720 _vorbis=yes
4721 def_vorbis='#define CONFIG_OGGVORBIS 1'
4722 codecmodules="libvorbis $codecmodules"
4723 res_comment="libvorbis"
4724 extra_ldflags="$extra_ldflags -lvorbis -logg"
4725 else
4726 _vorbis=no
4727 nocodecmodules="libvorbis $nocodecmodules"
4729 echores "$_vorbis"
4731 echocheck "libspeex (version >= 1.1 required)"
4732 if test "$_speex" = auto ; then
4733 _speex=no
4734 cat > $TMPC << EOF
4735 #include <stddef.h>
4736 #include <speex/speex.h>
4737 int main(void) { SpeexBits bits; void *dec = NULL; speex_decode_int(dec, &bits, dec); return 0; }
4739 cc_check -lspeex $_ld_lm && _speex=yes
4741 if test "$_speex" = yes ; then
4742 def_speex='#define CONFIG_SPEEX 1'
4743 extra_ldflags="$extra_ldflags -lspeex"
4744 codecmodules="speex $codecmodules"
4745 else
4746 def_speex='#undef CONFIG_SPEEX'
4747 nocodecmodules="speex $nocodecmodules"
4749 echores "$_speex"
4751 echocheck "OggTheora support"
4752 if test "$_theora" = auto ; then
4753 _theora=no
4754 if pkg_config_add theora ; then
4755 _theora=yes
4758 if test "$_theora" = yes ; then
4759 def_theora='#define CONFIG_OGGTHEORA 1'
4760 codecmodules="libtheora $codecmodules"
4761 else
4762 def_theora='#undef CONFIG_OGGTHEORA'
4763 nocodecmodules="libtheora $nocodecmodules"
4765 echores "$_theora"
4767 # Any version of libmpg123 that knows MPG123_RESYNC_LIMIT shall be fine.
4768 # That is, 1.2.0 onwards. Recommened is 1.14 onwards, though.
4769 echocheck "mpg123 support"
4770 def_mpg123='#undef CONFIG_MPG123'
4771 if test "$_mpg123" = auto; then
4772 _mpg123=no
4773 pkg_config_add 'libmpg123 >= 1.2.0' && _mpg123=yes
4775 if test "$_mpg123" = yes ; then
4776 def_mpg123='#define CONFIG_MPG123 1'
4777 codecmodules="mpg123 $codecmodules"
4778 else
4779 nocodecmodules="mpg123 $nocodecmodules"
4781 echores "$_mpg123"
4783 echocheck "liba52 support"
4784 def_liba52='#undef CONFIG_LIBA52'
4785 if test "$_liba52" = auto ; then
4786 _liba52=no
4787 cat > $TMPC << EOF
4788 #include <inttypes.h>
4789 #include <a52dec/a52.h>
4790 int main(void) { a52_state_t *testHand; testHand=a52_init(0); return 0; }
4792 cc_check -la52 && _liba52=yes && extra_ldflags="$extra_ldflags -la52"
4794 if test "$_liba52" = yes ; then
4795 def_liba52='#define CONFIG_LIBA52 1'
4796 codecmodules="liba52 $codecmodules"
4797 else
4798 nocodecmodules="liba52 $nocodecmodules"
4800 echores "$_liba52"
4802 echocheck "libdca support"
4803 if test "$_libdca" = auto ; then
4804 _libdca=no
4805 for _ld_dca in -ldca -ldts ; do
4806 statement_check_broken stdint.h dts.h 'dts_init(0)' $_ld_dca $_ld_lm &&
4807 extra_ldflags="$extra_ldflags $_ld_dca" && _libdca=yes && break
4808 done
4810 if test "$_libdca" = yes ; then
4811 def_libdca='#define CONFIG_LIBDCA 1'
4812 codecmodules="libdca $codecmodules"
4813 else
4814 def_libdca='#undef CONFIG_LIBDCA'
4815 nocodecmodules="libdca $nocodecmodules"
4817 echores "$_libdca"
4819 echocheck "libmpcdec (musepack, version >= 1.2.1 required)"
4820 if test "$_musepack" = yes ; then
4821 _musepack=no
4822 cat > $TMPC << EOF
4823 #include <stddef.h>
4824 #include <mpcdec/mpcdec.h>
4825 int main(void) {
4826 mpc_streaminfo info;
4827 mpc_decoder decoder;
4828 mpc_decoder_set_streaminfo(&decoder, &info);
4829 mpc_decoder_decode_frame(&decoder, NULL, 0, NULL);
4830 return 0;
4833 cc_check -lmpcdec $_ld_lm && _musepack=yes
4835 if test "$_musepack" = yes ; then
4836 def_musepack='#define CONFIG_MUSEPACK 1'
4837 extra_ldflags="$extra_ldflags -lmpcdec"
4838 codecmodules="musepack $codecmodules"
4839 else
4840 def_musepack='#undef CONFIG_MUSEPACK'
4841 nocodecmodules="musepack $nocodecmodules"
4843 echores "$_musepack"
4846 echocheck "FAAD2 support"
4847 if test "$_faad" = auto ; then
4848 _faad=no
4849 cat > $TMPC << EOF
4850 #include <faad.h>
4851 #ifndef FAAD_MIN_STREAMSIZE
4852 #error Too old version
4853 #endif
4854 int main(void) { faacDecHandle testhand; faacDecFrameInfo testinfo;
4855 testhand = faacDecOpen(); faacDecInit(0, 0, 0, 0, 0); return 0; }
4857 cc_check -lfaad $_ld_lm && _faad=yes
4860 def_faad='#undef CONFIG_FAAD'
4861 if test "$_faad" = yes ; then
4862 def_faad='#define CONFIG_FAAD 1'
4863 extra_ldflags="$extra_ldflags -lfaad"
4864 codecmodules="faad2 $codecmodules"
4865 else
4866 nocodecmodules="faad2 $nocodecmodules"
4868 echores "$_faad"
4871 echocheck "LADSPA plugin support"
4872 if test "$_ladspa" = auto ; then
4873 _ladspa=no
4874 statement_check ladspa.h 'LADSPA_Descriptor ld = {0}' && _ladspa=yes
4876 if test "$_ladspa" = yes; then
4877 def_ladspa="#define CONFIG_LADSPA 1"
4878 else
4879 def_ladspa="#undef CONFIG_LADSPA"
4881 echores "$_ladspa"
4884 echocheck "libbs2b audio filter support"
4885 if test "$_libbs2b" = auto ; then
4886 _libbs2b=no
4887 if pkg_config_add libbs2b ; then
4888 _libbs2b=yes
4891 def_libbs2b="#undef CONFIG_LIBBS2B"
4892 test "$_libbs2b" = yes && def_libbs2b="#define CONFIG_LIBBS2B 1"
4893 echores "$_libbs2b"
4896 if test -z "$_codecsdir" ; then
4897 for dir in "$_libdir/codecs" "$_libdir/win32" /usr/local/lib/codecs \
4898 /usr/lib/codecs /usr/local/lib/win32 /usr/lib/win32 ; do
4899 if test -d "$dir" ; then
4900 _codecsdir="$dir"
4901 break;
4903 done
4905 # Fall back on default directory.
4906 if test -z "$_codecsdir" ; then
4907 _codecsdir="$_libdir/codecs"
4908 mingw32 && _codecsdir="codecs"
4912 echocheck "Win32 codecs"
4913 if test "$_win32dll" = auto ; then
4914 _win32dll=no
4915 if x86_32 && ! qnx; then
4916 _win32dll=yes
4919 if test "$_win32dll" = yes ; then
4920 def_win32dll='#define CONFIG_WIN32DLL 1'
4921 if ! win32 ; then
4922 def_win32_loader='#define WIN32_LOADER 1'
4923 _win32_emulation=yes
4924 else
4925 extra_ldflags="$extra_ldflags -ladvapi32 -lole32"
4926 res_comment="using native windows"
4928 codecmodules="win32 $codecmodules"
4929 else
4930 def_win32dll='#undef CONFIG_WIN32DLL'
4931 def_win32_loader='#undef WIN32_LOADER'
4932 nocodecmodules="win32 $nocodecmodules"
4934 echores "$_win32dll"
4937 echocheck "XAnim codecs"
4938 if test "$_xanim" = auto ; then
4939 _xanim=no
4940 res_comment="dynamic loader support needed"
4941 if test "$_dl" = yes ; then
4942 _xanim=yes
4945 if test "$_xanim" = yes ; then
4946 def_xanim='#define CONFIG_XANIM 1'
4947 codecmodules="xanim $codecmodules"
4948 else
4949 def_xanim='#undef CONFIG_XANIM'
4950 nocodecmodules="xanim $nocodecmodules"
4952 echores "$_xanim"
4955 echocheck "RealPlayer codecs"
4956 if test "$_real" = auto ; then
4957 _real=no
4958 res_comment="dynamic loader support needed"
4959 if test "$_dl" = yes || test "$_win32dll" = yes &&
4960 (linux || freebsd || netbsd || openbsd || dragonfly || darwin || win32) ; then
4961 _real=yes
4964 if test "$_real" = yes ; then
4965 def_real='#define CONFIG_REALCODECS 1'
4966 codecmodules="real $codecmodules"
4967 else
4968 def_real='#undef CONFIG_REALCODECS'
4969 nocodecmodules="real $nocodecmodules"
4971 echores "$_real"
4974 echocheck "QuickTime codecs"
4975 _qtx_emulation=no
4976 def_qtx_win32='#undef CONFIG_QTX_CODECS_WIN32'
4977 if test "$_qtx" = auto ; then
4978 test "$_win32dll" = yes || test "$quicktime" = yes && _qtx=yes
4980 if test "$_qtx" = yes ; then
4981 def_qtx='#define CONFIG_QTX_CODECS 1'
4982 win32 && _qtx_codecs_win32=yes && def_qtx_win32='#define CONFIG_QTX_CODECS_WIN32 1'
4983 codecmodules="qtx $codecmodules"
4984 darwin || win32 || _qtx_emulation=yes
4985 else
4986 def_qtx='#undef CONFIG_QTX_CODECS'
4987 nocodecmodules="qtx $nocodecmodules"
4989 echores "$_qtx"
4991 echocheck "LCMS2 support"
4992 if test "$_lcms2" = auto ; then
4993 _lcms2=no
4994 if pkg_config_add lcms2 ; then
4995 _lcms2=yes
4998 if test "$_lcms2" = yes; then
4999 def_lcms2="#define CONFIG_LCMS2 1"
5000 else
5001 def_lcms2="#undef CONFIG_LCMS2"
5003 echores "$_lcms2"
5006 # Test with > against Libav 0.8 versions which will NOT work rather than
5007 # specify minimum version, to allow (future) point releases to possibly work.
5008 all_libav_libs="libavutil > 51.21.0:libavcodec > 53.34.0:libavformat > 53.20.0:libswscale >= 2.0.0"
5009 echocheck "Libav ($all_libav_libs)"
5010 if test "$ffmpeg" = auto ; then
5011 IFS=":" # shell should not be used for programming
5012 if ! pkg_config_add $all_libav_libs ; then
5013 die "Unable to find development files for some of the required Libav libraries above. Aborting."
5016 echores "yes"
5018 def_ffmpeg_internals="#undef CONFIG_FFMPEG_INTERNALS"
5019 if ! test -z "$_ffmpeg_source" ; then
5020 def_ffmpeg_internals="#define CONFIG_FFMPEG_INTERNALS 1" && ffmpeg_internals=yes
5023 echocheck "libpostproc >= 52.0.0"
5024 if test "$libpostproc" = auto ; then
5025 libpostproc=no
5026 if pkg_config_add "libpostproc >= 52.0.0" ; then
5027 libpostproc=yes
5030 if test "$libpostproc" = yes ; then
5031 def_libpostproc='#define CONFIG_LIBPOSTPROC 1'
5032 else
5033 def_libpostproc='#undef CONFIG_LIBPOSTPROC'
5035 echores "$libpostproc"
5038 echocheck "libdv-0.9.5+"
5039 if test "$_libdv" = auto ; then
5040 _libdv=no
5041 statement_check libdv/dv.h 'dv_encoder_new(1, 1, 1)' -ldv $_ld_pthread $_ld_lm && _libdv=yes
5043 if test "$_libdv" = yes ; then
5044 def_libdv='#define CONFIG_LIBDV095 1'
5045 extra_ldflags="$extra_ldflags -ldv"
5046 codecmodules="libdv $codecmodules"
5047 else
5048 def_libdv='#undef CONFIG_LIBDV095'
5049 nocodecmodules="libdv $nocodecmodules"
5051 echores "$_libdv"
5054 echocheck "Xvid"
5055 if test "$_xvid" = auto ; then
5056 _xvid=no
5057 for _ld_tmp in "-lxvidcore $_ld_lm" "-lxvidcore $_ld_lm $_ld_pthread" ; do
5058 statement_check xvid.h 'xvid_global(0, 0, 0, 0)' $_ld_tmp &&
5059 extra_ldflags="$extra_ldflags $_ld_tmp" && _xvid=yes && break
5060 done
5063 if test "$_xvid" = yes ; then
5064 def_xvid='#define CONFIG_XVID4 1'
5065 codecmodules="xvid $codecmodules"
5066 else
5067 def_xvid='#undef CONFIG_XVID4'
5068 nocodecmodules="xvid $nocodecmodules"
5070 echores "$_xvid"
5073 echocheck "libnut"
5074 if test "$_libnut" = auto ; then
5075 _libnut=no
5076 statement_check libnut.h 'nut_context_tt * nut; nut_error(0)' -lnut && _libnut=yes
5079 if test "$_libnut" = yes ; then
5080 def_libnut='#define CONFIG_LIBNUT 1'
5081 extra_ldflags="$extra_ldflags -lnut"
5082 else
5083 def_libnut='#undef CONFIG_LIBNUT'
5085 echores "$_libnut"
5088 echocheck "UnRAR executable"
5089 if test "$_unrar_exec" = auto ; then
5090 _unrar_exec="yes"
5091 mingw32 && _unrar_exec="no"
5093 if test "$_unrar_exec" = yes ; then
5094 def_unrar_exec='#define CONFIG_UNRAR_EXEC 1'
5095 else
5096 def_unrar_exec='#undef CONFIG_UNRAR_EXEC'
5098 echores "$_unrar_exec"
5100 echocheck "TV interface"
5101 if test "$_tv" = yes ; then
5102 def_tv='#define CONFIG_TV 1'
5103 inputmodules="tv $inputmodules"
5104 else
5105 noinputmodules="tv $noinputmodules"
5106 def_tv='#undef CONFIG_TV'
5108 echores "$_tv"
5111 if freebsd || netbsd || openbsd || dragonfly || bsdos ; then
5112 echocheck "*BSD BT848 bt8xx header"
5113 _ioctl_bt848_h=no
5114 for file in "machine/ioctl_bt848.h" \
5115 "dev/bktr/ioctl_bt848.h" \
5116 "dev/video/bktr/ioctl_bt848.h" \
5117 "dev/ic/bt8xx.h" ; do
5118 cat > $TMPC <<EOF
5119 #include <sys/types.h>
5120 #include <sys/ioctl.h>
5121 #include <$file>
5122 int main(void) { ioctl(0, TVTUNER_GETFREQ, 0); return 0; }
5124 if cc_check ; then
5125 _ioctl_bt848_h=yes
5126 _ioctl_bt848_h_name="$file"
5127 break;
5129 done
5130 if test "$_ioctl_bt848_h" = yes ; then
5131 def_ioctl_bt848_h_name="#define IOCTL_BT848_H_NAME <$_ioctl_bt848_h_name>"
5132 res_comment="using $_ioctl_bt848_h_name"
5133 else
5134 def_ioctl_bt848_h_name="#undef IOCTL_BT848_H_NAME"
5136 echores "$_ioctl_bt848_h"
5138 echocheck "*BSD ioctl_meteor.h"
5139 _ioctl_meteor_h=no
5140 for ioctl_meteor_h_path in "machine/ioctl_meteor.h" "dev/bktr/ioctl_meteor.h" "dev/video/bktr/ioctl_meteor.h" ; do
5141 statement_check_broken "sys/types.h" "$ioctl_meteor_h_path" 'ioctl(0, METEORSINPUT, 0)' &&
5142 _ioctl_meteor_h=yes && break
5143 done
5144 if test "$_ioctl_meteor_h" = yes ; then
5145 def_ioctl_meteor_h_name="#define IOCTL_METEOR_H_NAME <$ioctl_meteor_h_path>"
5146 res_comment="using $ioctl_meteor_h_path"
5147 else
5148 def_ioctl_meteor_h_name="#undef IOCTL_METEOR_H_NAME"
5150 echores "$_ioctl_meteor_h"
5152 echocheck "*BSD BrookTree 848 TV interface"
5153 if test "$_tv_bsdbt848" = auto ; then
5154 _tv_bsdbt848=no
5155 if test "$_tv" = yes ; then
5156 cat > $TMPC <<EOF
5157 #include <sys/types.h>
5158 $def_ioctl_meteor_h_name
5159 $def_ioctl_bt848_h_name
5160 #ifdef IOCTL_METEOR_H_NAME
5161 #include IOCTL_METEOR_H_NAME
5162 #endif
5163 #ifdef IOCTL_BT848_H_NAME
5164 #include IOCTL_BT848_H_NAME
5165 #endif
5166 int main(void) {
5167 ioctl(0, METEORSINPUT, 0);
5168 ioctl(0, TVTUNER_GETFREQ, 0);
5169 return 0;
5172 cc_check && _tv_bsdbt848=yes
5175 if test "$_tv_bsdbt848" = yes ; then
5176 def_tv_bsdbt848='#define CONFIG_TV_BSDBT848 1'
5177 inputmodules="tv-bsdbt848 $inputmodules"
5178 else
5179 def_tv_bsdbt848='#undef CONFIG_TV_BSDBT848'
5180 noinputmodules="tv-bsdbt848 $noinputmodules"
5182 echores "$_tv_bsdbt848"
5183 fi #if freebsd || netbsd || openbsd || dragonfly || bsdos
5186 echocheck "DirectShow TV interface"
5187 if test "$_tv_dshow" = auto ; then
5188 _tv_dshow=no
5189 if test "$_tv" = yes && win32 ; then
5190 statement_check ole2.h 'void* p; CoCreateInstance((GUID*)&GUID_NULL, NULL, CLSCTX_INPROC_SERVER, &GUID_NULL, &p)' -lole32 -luuid && _tv_dshow=yes
5193 if test "$_tv_dshow" = yes ; then
5194 inputmodules="tv-dshow $inputmodules"
5195 def_tv_dshow='#define CONFIG_TV_DSHOW 1'
5196 extra_ldflags="$extra_ldflags -lole32 -luuid"
5197 else
5198 noinputmodules="tv-dshow $noinputmodules"
5199 def_tv_dshow='#undef CONFIG_TV_DSHOW'
5201 echores "$_tv_dshow"
5204 echocheck "Video 4 Linux TV interface"
5205 if test "$_tv_v4l1" = auto ; then
5206 _tv_v4l1=no
5207 if test "$_tv" = yes && linux ; then
5208 header_check_broken sys/time.h linux/videodev.h && _tv_v4l1=yes
5211 if test "$_tv_v4l1" = yes ; then
5212 _audio_input=yes
5213 _tv_v4l=yes
5214 def_tv_v4l='#define CONFIG_TV_V4L 1'
5215 def_tv_v4l1='#define CONFIG_TV_V4L1 1'
5216 inputmodules="tv-v4l $inputmodules"
5217 else
5218 noinputmodules="tv-v4l1 $noinputmodules"
5219 def_tv_v4l='#undef CONFIG_TV_V4L'
5221 echores "$_tv_v4l1"
5224 echocheck "Video 4 Linux 2 TV interface"
5225 if test "$_tv_v4l2" = auto ; then
5226 _tv_v4l2=no
5227 if test "$_tv" = yes && linux ; then
5228 header_check_broken sys/time.h linux/videodev2.h && _tv_v4l2=yes
5229 elif test "$_tv" = yes && test "$sys_videoio_h" = "yes" ; then
5230 _tv_v4l2=yes
5233 if test "$_tv_v4l2" = yes ; then
5234 _audio_input=yes
5235 _tv_v4l=yes
5236 def_tv_v4l='#define CONFIG_TV_V4L 1'
5237 def_tv_v4l2='#define CONFIG_TV_V4L2 1'
5238 inputmodules="tv-v4l2 $inputmodules"
5239 else
5240 noinputmodules="tv-v4l2 $noinputmodules"
5241 def_tv_v4l2='#undef CONFIG_TV_V4L2'
5243 echores "$_tv_v4l2"
5246 echocheck "Radio interface"
5247 if test "$_radio" = yes ; then
5248 def_radio='#define CONFIG_RADIO 1'
5249 inputmodules="radio $inputmodules"
5250 if test "$_alsa" != yes -a "$_ossaudio" != yes ; then
5251 _radio_capture=no
5253 if test "$_radio_capture" = yes ; then
5254 _audio_input=yes
5255 def_radio_capture="#define CONFIG_RADIO_CAPTURE 1"
5256 else
5257 def_radio_capture="#undef CONFIG_RADIO_CAPTURE"
5259 else
5260 noinputmodules="radio $noinputmodules"
5261 def_radio='#undef CONFIG_RADIO'
5262 def_radio_capture="#undef CONFIG_RADIO_CAPTURE"
5263 _radio_capture=no
5265 echores "$_radio"
5266 echocheck "Capture for Radio interface"
5267 echores "$_radio_capture"
5269 echocheck "Video 4 Linux 2 Radio interface"
5270 if test "$_radio_v4l2" = auto ; then
5271 _radio_v4l2=no
5272 if test "$_radio" = yes && linux ; then
5273 header_check linux/videodev2.h && _radio_v4l2=yes
5276 if test "$_radio_v4l2" = yes ; then
5277 def_radio_v4l2='#define CONFIG_RADIO_V4L2 1'
5278 else
5279 def_radio_v4l2='#undef CONFIG_RADIO_V4L2'
5281 echores "$_radio_v4l2"
5283 echocheck "Video 4 Linux Radio interface"
5284 if test "$_radio_v4l" = auto ; then
5285 _radio_v4l=no
5286 if test "$_radio" = yes && linux ; then
5287 header_check linux/videodev.h && _radio_v4l=yes
5290 if test "$_radio_v4l" = yes ; then
5291 def_radio_v4l='#define CONFIG_RADIO_V4L 1'
5292 else
5293 def_radio_v4l='#undef CONFIG_RADIO_V4L'
5295 echores "$_radio_v4l"
5297 if freebsd || netbsd || openbsd || dragonfly || bsdos &&
5298 test "$_radio" = yes && test "$_radio_bsdbt848" = auto ; then
5299 echocheck "*BSD BrookTree 848 Radio interface"
5300 _radio_bsdbt848=no
5301 cat > $TMPC <<EOF
5302 #include <sys/types.h>
5303 $def_ioctl_bt848_h_name
5304 #ifdef IOCTL_BT848_H_NAME
5305 #include IOCTL_BT848_H_NAME
5306 #endif
5307 int main(void) { ioctl(0, RADIO_GETFREQ, 0); return 0; }
5309 cc_check && _radio_bsdbt848=yes
5310 echores "$_radio_bsdbt848"
5311 fi #if freebsd || netbsd || openbsd || dragonfly || bsdos && _radio && _radio_bsdbt848
5313 if test "$_radio_bsdbt848" = yes ; then
5314 def_radio_bsdbt848='#define CONFIG_RADIO_BSDBT848 1'
5315 else
5316 def_radio_bsdbt848='#undef CONFIG_RADIO_BSDBT848'
5319 if test "$_radio_v4l" = no && test "$_radio_v4l2" = no &&
5320 test "$_radio_bsdbt848" = no && test "$_radio" = yes ; then
5321 die "Radio driver requires BSD BT848, V4L or V4L2!"
5324 echocheck "Video 4 Linux 2 MPEG PVR interface"
5325 if test "$_pvr" = auto ; then
5326 _pvr=no
5327 if test "$_tv_v4l2" = yes && linux ; then
5328 cat > $TMPC <<EOF
5329 #include <sys/time.h>
5330 #include <linux/videodev2.h>
5331 int main(void) { struct v4l2_ext_controls ext; return ext.controls->value; }
5333 cc_check && _pvr=yes
5336 if test "$_pvr" = yes ; then
5337 def_pvr='#define CONFIG_PVR 1'
5338 inputmodules="pvr $inputmodules"
5339 else
5340 noinputmodules="pvr $noinputmodules"
5341 def_pvr='#undef CONFIG_PVR'
5343 echores "$_pvr"
5346 echocheck "ftp"
5347 if test "$_ftp" = "auto" ; then
5348 test "$networking" = "yes" && ! beos && _ftp=yes
5350 if test "$_ftp" = yes ; then
5351 def_ftp='#define CONFIG_FTP 1'
5352 inputmodules="ftp $inputmodules"
5353 else
5354 noinputmodules="ftp $noinputmodules"
5355 def_ftp='#undef CONFIG_FTP'
5357 echores "$_ftp"
5359 echocheck "vstream client"
5360 if test "$_vstream" = auto ; then
5361 _vstream=no
5362 cat > $TMPC <<EOF
5363 #include <vstream-client.h>
5364 void vstream_error(const char *format, ... ) {}
5365 int main(void) { vstream_start(); return 0; }
5367 cc_check -lvstream-client && _vstream=yes
5369 if test "$_vstream" = yes ; then
5370 def_vstream='#define CONFIG_VSTREAM 1'
5371 inputmodules="vstream $inputmodules"
5372 extra_ldflags="$extra_ldflags -lvstream-client"
5373 else
5374 noinputmodules="vstream $noinputmodules"
5375 def_vstream='#undef CONFIG_VSTREAM'
5377 echores "$_vstream"
5380 echocheck "Subtitles sorting"
5381 if test "$_sortsub" = yes ; then
5382 def_sortsub='#define CONFIG_SORTSUB 1'
5383 else
5384 def_sortsub='#undef CONFIG_SORTSUB'
5386 echores "$_sortsub"
5389 echocheck "XMMS inputplugin support"
5390 if test "$_xmms" = yes ; then
5391 if ( xmms-config --version ) >/dev/null 2>&1 ; then
5392 _xmmsplugindir=$(xmms-config --input-plugin-dir)
5393 _xmmslibdir=$(xmms-config --exec-prefix)/lib
5394 else
5395 _xmmsplugindir=/usr/lib/xmms/Input
5396 _xmmslibdir=/usr/lib
5399 def_xmms='#define CONFIG_XMMS 1'
5400 if darwin ; then
5401 extra_ldflags="$extra_ldflags ${_xmmslibdir}/libxmms.dylib"
5402 else
5403 extra_ldflags="$extra_ldflags ${_xmmslibdir}/libxmms.so.1 -export-dynamic"
5405 else
5406 def_xmms='#undef CONFIG_XMMS'
5408 echores "$_xmms"
5410 if test "$_charset" != "noconv" ; then
5411 def_charset="#define MSG_CHARSET \"$_charset\""
5412 else
5413 def_charset="#undef MSG_CHARSET"
5414 _charset="UTF-8"
5417 #############################################################################
5419 echocheck "automatic gdb attach"
5420 if test "$_crash_debug" = yes ; then
5421 def_crash_debug='#define CONFIG_CRASH_DEBUG 1'
5422 else
5423 def_crash_debug='#undef CONFIG_CRASH_DEBUG'
5424 _crash_debug=no
5426 echores "$_crash_debug"
5428 echocheck "compiler support for noexecstack"
5429 if cflag_check -Wl,-z,noexecstack ; then
5430 extra_ldflags="-Wl,-z,noexecstack $extra_ldflags"
5431 echores "yes"
5432 else
5433 echores "no"
5436 echocheck "linker support for --nxcompat --no-seh --dynamicbase"
5437 if cflag_check "-Wl,--nxcompat -Wl,--no-seh -Wl,--dynamicbase" ; then
5438 extra_ldflags="-Wl,--nxcompat -Wl,--no-seh -Wl,--dynamicbase $extra_ldflags"
5439 echores "yes"
5440 else
5441 echores "no"
5445 # Dynamic linking flags
5446 # (FIXME: 'echocheck "dynamic linking"' above and modify here accordingly)
5447 _ld_dl_dynamic=''
5448 freebsd || netbsd || openbsd || dragonfly || bsdos && _ld_dl_dynamic='-rdynamic'
5449 if test "$_real" = yes || test "$_xanim" = yes && ! win32 && ! qnx && ! darwin ; then
5450 _ld_dl_dynamic='-rdynamic'
5453 extra_ldflags="$extra_ldflags $_ld_pthread $_ld_dl $_ld_dl_dynamic"
5454 bsdos && extra_ldflags="$extra_ldflags -ldvd"
5455 (netbsd || openbsd) && x86_32 && extra_ldflags="$extra_ldflags -li386"
5457 def_debug='#undef MP_DEBUG'
5458 test "$_debug" != "" && def_debug='#define MP_DEBUG 1'
5461 echocheck "joystick"
5462 def_joystick='#undef CONFIG_JOYSTICK'
5463 if test "$_joystick" = yes ; then
5464 if linux || freebsd ; then
5465 # TODO add some check
5466 def_joystick='#define CONFIG_JOYSTICK 1'
5467 else
5468 _joystick="no"
5469 res_comment="unsupported under $system_name"
5472 echores "$_joystick"
5474 echocheck "lirc"
5475 if test "$_lirc" = auto ; then
5476 _lirc=no
5477 header_check lirc/lirc_client.h -llirc_client && _lirc=yes
5479 if test "$_lirc" = yes ; then
5480 def_lirc='#define CONFIG_LIRC 1'
5481 libs_mplayer="$libs_mplayer -llirc_client"
5482 else
5483 def_lirc='#undef CONFIG_LIRC'
5485 echores "$_lirc"
5487 echocheck "lircc"
5488 if test "$_lircc" = auto ; then
5489 _lircc=no
5490 header_check lirc/lircc.h -llircc && _lircc=yes
5492 if test "$_lircc" = yes ; then
5493 def_lircc='#define CONFIG_LIRCC 1'
5494 libs_mplayer="$libs_mplayer -llircc"
5495 else
5496 def_lircc='#undef CONFIG_LIRCC'
5498 echores "$_lircc"
5500 #############################################################################
5502 CFLAGS="$CFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE"
5504 # This must be the last test to be performed. Any other tests following it
5505 # could fail due to linker errors. libdvdnavmini is intentionally not linked
5506 # against libdvdread (to permit MPlayer to use its own copy of the library).
5507 # So any compilation using the flags added here but not linking against
5508 # libdvdread can fail.
5509 echocheck "DVD support (libdvdnav)"
5510 if test "$_dvdread_internal" = yes && test ! -f "libdvdnav/dvdnav.c" ; then
5511 _dvdnav=no
5513 dvdnav_internal=no
5514 if test "$_dvdnav" = auto ; then
5515 if test "$_dvdread_internal" = yes ; then
5516 _dvdnav=yes
5517 dvdnav_internal=yes
5518 res_comment="internal"
5519 else
5520 $_dvdnavconfig --version --minilibs >> $TMPLOG 2>&1 || _dvdnav=no
5523 if test "$_dvdnav" = auto ; then
5524 _dvdnav=no
5525 _dvdnavdir=$($_dvdnavconfig --cflags)
5526 _dvdnavlibs=$($_dvdnavconfig --libs)
5527 statement_check_broken stdint.h dvdnav/dvdnav.h 'dvdnav_t *dvd = 0' $_dvdnavdir $_dvdnavlibs $_ld_dl $_ld_pthread && _dvdnav=yes
5529 if test "$_dvdnav" = yes ; then
5530 def_dvdnav='#define CONFIG_DVDNAV 1'
5531 if test "$dvdnav_internal" = yes ; then
5532 cflags_libdvdnav="-Ilibdvdnav"
5533 inputmodules="dvdnav(internal) $inputmodules"
5534 else
5535 extra_cflags="$extra_cflags $($_dvdnavconfig --cflags)"
5536 extra_ldflags="$extra_ldflags $($_dvdnavconfig --minilibs)"
5537 inputmodules="dvdnav $inputmodules"
5539 else
5540 def_dvdnav='#undef CONFIG_DVDNAV'
5541 noinputmodules="dvdnav $noinputmodules"
5543 echores "$_dvdnav"
5545 # DO NOT ADD ANY TESTS THAT USE LINKER FLAGS HERE (like cc_check).
5546 # Read dvdnav comment above.
5548 mak_enable () {
5549 list=$(echo $1 | tr '[a-z]' '[A-Z]')
5550 item=$(echo $2 | tr '[a-z]' '[A-Z]')
5551 nprefix=$3;
5552 for part in $list; do
5553 if $(echo $item | grep -q -E "(^| )$part($| )"); then
5554 echo "${nprefix}_$part = yes"
5556 done
5559 #############################################################################
5560 echo "Creating config.mak"
5561 cat > config.mak << EOF
5562 # -------- Generated by configure -----------
5564 # Ensure that locale settings do not interfere with shell commands.
5565 export LC_ALL = C
5567 CONFIGURATION = $configuration
5569 CHARSET = $_charset
5570 DOC_LANGS = $language_doc
5571 DOC_LANG_ALL = $doc_lang_all
5572 MAN_LANGS = $language_man
5573 MAN_LANG_ALL = $man_lang_all
5574 MSG_LANGS = $language_msg
5575 MSG_LANG_ALL = $msg_lang_all
5577 prefix = \$(DESTDIR)$_prefix
5578 BINDIR = \$(DESTDIR)$_bindir
5579 DATADIR = \$(DESTDIR)$_datadir
5580 LIBDIR = \$(DESTDIR)$_libdir
5581 MANDIR = \$(DESTDIR)$_mandir
5582 CONFDIR = \$(DESTDIR)$_confdir
5583 LOCALEDIR = \$(DESTDIR)$_localedir
5585 AR = $_ar
5586 AS = $_cc
5587 CC = $_cc
5588 INSTALL = $_install
5589 INSTALLSTRIP = $_install_strip
5590 WINDRES = $_windres
5592 CFLAGS = $WARNFLAGS $ERRORFLAGS $WARN_CFLAGS $CFLAGS $extra_cflags
5593 DEPFLAGS = $DEPFLAGS
5595 CFLAGS_LIBDVDCSS = $cflags_libdvdcss
5596 CFLAGS_LIBDVDCSS_DVDREAD = $cflags_libdvdcss_dvdread
5597 CFLAGS_LIBDVDNAV = $cflags_libdvdnav
5598 CFLAGS_NO_OMIT_LEAF_FRAME_POINTER = $cflags_no_omit_leaf_frame_pointer
5599 CFLAGS_STACKREALIGN = $cflags_stackrealign
5601 EXTRALIBS = $extra_ldflags $_ld_static $_ld_lm $extra_libs
5602 EXTRALIBS_MPLAYER = $libs_mplayer
5604 GETCH = $_getch
5605 TIMER = $_timer
5607 EXESUF = $_exesuf
5608 EXESUFS_ALL = .exe
5610 ARCH = $arch
5611 $(mak_enable "$arch_all" "$arch" ARCH)
5612 $(mak_enable "$subarch_all" "$subarch" ARCH)
5613 $(mak_enable "$cpuexts_all" "$cpuexts" HAVE)
5615 NEED_GETTIMEOFDAY = $need_gettimeofday
5616 NEED_GLOB = $need_glob
5617 NEED_SETENV = $need_setenv
5618 NEED_SHMEM = $need_shmem
5619 NEED_STRSEP = $need_strsep
5620 NEED_SWAB = $need_swab
5621 NEED_VSSCANF = $need_vsscanf
5623 # features
5624 ALSA = $_alsa
5625 APPLE_IR = $_apple_ir
5626 APPLE_REMOTE = $_apple_remote
5627 AUDIO_INPUT = $_audio_input
5628 CACA = $_caca
5629 CDDA = $_cdda
5630 CDDB = $_cddb
5631 COCOA = $_cocoa
5632 COREAUDIO = $_coreaudio
5633 COREVIDEO = $_corevideo
5634 SHAREDBUFFER = $_sharedbuffer
5635 DIRECT3D = $_direct3d
5636 DIRECTFB = $_directfb
5637 DIRECTX = $_directx
5638 DVBIN = $_dvbin
5639 DVDNAV = $_dvdnav
5640 DVDNAV_INTERNAL = $dvdnav_internal
5641 DVDREAD = $_dvdread
5642 DVDREAD_INTERNAL = $_dvdread_internal
5643 DXR3 = $_dxr3
5644 FAAD = $_faad
5645 FASTMEMCPY = $_fastmemcpy
5646 FTP = $_ftp
5647 GIF = $_gif
5648 GL = $_gl
5649 GL_COCOA = $_gl_cocoa
5650 GL_WIN32 = $_gl_win32
5651 GL_X11 = $_gl_x11
5652 GL_SDL = $_gl_sdl
5653 HAVE_POSIX_SELECT = $_posix_select
5654 HAVE_SYS_MMAN_H = $_mman
5655 JACK = $_jack
5656 JOYSTICK = $_joystick
5657 JPEG = $_jpeg
5658 LADSPA = $_ladspa
5659 LIBA52 = $_liba52
5660 LIBASS = $_ass
5661 LIBBLURAY = $_bluray
5662 LIBBS2B = $_libbs2b
5663 LIBDCA = $_libdca
5664 LIBDV = $_libdv
5665 LIBDVDCSS_INTERNAL = $_libdvdcss_internal
5666 LIBMAD = $_mad
5667 LCMS2 = $_lcms2
5668 LIBNUT = $_libnut
5669 LIBPOSTPROC = $libpostproc
5670 LIBSMBCLIENT = $_smb
5671 LIBQUVI = $_libquvi
5672 LIBTHEORA = $_theora
5673 LIRC = $_lirc
5674 MACOSX_FINDER = $_macosx_finder
5675 MD5SUM = $_md5sum
5676 MNG = $_mng
5677 MPG123 = $_mpg123
5678 MUSEPACK = $_musepack
5679 NETWORKING = $networking
5680 OPENAL = $_openal
5681 OSS = $_ossaudio
5682 PE_EXECUTABLE = $_pe_executable
5683 PNG = $_png
5684 PNM = $_pnm
5685 PRIORITY = $_priority
5686 PULSE = $_pulse
5687 PORTAUDIO = $_portaudio
5688 PVR = $_pvr
5689 QTX_CODECS = $_qtx
5690 QTX_CODECS_WIN32 = $_qtx_codecs_win32
5691 QTX_EMULATION = $_qtx_emulation
5692 RADIO=$_radio
5693 RADIO_CAPTURE=$_radio_capture
5694 REAL_CODECS = $_real
5695 RSOUND = $_rsound
5696 SDL = $_sdl
5697 SPEEX = $_speex
5698 STREAM_CACHE = $_stream_cache
5699 TGA = $_tga
5700 TV = $_tv
5701 TV_BSDBT848 = $_tv_bsdbt848
5702 TV_DSHOW = $_tv_dshow
5703 TV_V4L = $_tv_v4l
5704 TV_V4L1 = $_tv_v4l1
5705 TV_V4L2 = $_tv_v4l2
5706 UNRAR_EXEC = $_unrar_exec
5707 V4L2 = $_v4l2
5708 VCD = $_vcd
5709 VDPAU = $_vdpau
5710 VORBIS = $_vorbis
5711 VSTREAM = $_vstream
5712 WIN32DLL = $_win32dll
5713 WIN32_EMULATION = $_win32_emulation
5714 X11 = $_x11
5715 XANIM_CODECS = $_xanim
5716 XMMS_PLUGINS = $_xmms
5717 XV = $_xv
5718 XVID4 = $_xvid
5719 YUV4MPEG = $_yuv4mpeg
5721 # FFmpeg
5722 FFMPEG_INTERNALS = $ffmpeg_internals
5723 FFMPEG_SOURCE_PATH = $_ffmpeg_source
5725 RANLIB = $_ranlib
5726 YASM = $_yasm
5727 YASMFLAGS = $YASMFLAGS
5729 CONFIG_VDPAU = $_vdpau
5730 CONFIG_ZLIB = $_zlib
5732 HAVE_PTHREADS = $_pthreads
5733 HAVE_SHM = $_shm
5734 HAVE_W32THREADS = $_w32threads
5735 HAVE_YASM = $have_yasm
5739 #############################################################################
5741 ff_config_enable () {
5742 list=$(echo $1 | tr '[a-z]' '[A-Z]')
5743 item=$(echo $2 | tr '[a-z]' '[A-Z]')
5744 _nprefix=$3;
5745 test -z "$_nprefix" && _nprefix='CONFIG'
5746 for part in $list; do
5747 if $(echo $item | grep -q -E "(^| )$part($| )"); then
5748 echo "#define ${_nprefix}_$part 1"
5749 else
5750 echo "#define ${_nprefix}_$part 0"
5752 done
5755 echo "Creating config.h"
5756 cat > $TMPH << EOF
5757 /*----------------------------------------------------------------------------
5758 ** This file has been automatically generated by configure any changes in it
5759 ** will be lost when you run configure again.
5760 ** Instead of modifying definitions here, use the --enable/--disable options
5761 ** of the configure script! See ./configure --help for details.
5762 *---------------------------------------------------------------------------*/
5764 #ifndef MPLAYER_CONFIG_H
5765 #define MPLAYER_CONFIG_H
5767 #define CONFIGURATION "$configuration"
5769 #define MPLAYER_DATADIR "$_datadir"
5770 #define MPLAYER_CONFDIR "$_confdir"
5771 #define MPLAYER_LOCALEDIR "$_localedir"
5773 $def_translation
5775 /* definitions needed by included libraries */
5776 #define HAVE_INTTYPES_H 1
5777 /* libdvdcss */
5778 #define HAVE_ERRNO_H 1
5779 /* libdvdcss + libdvdread */
5780 #define HAVE_LIMITS_H 1
5781 /* libdvdcss */
5782 #define HAVE_UNISTD_H 1
5783 /* libdvdread */
5784 #define STDC_HEADERS 1
5785 #define HAVE_MEMCPY 1
5786 /* libdvdnav */
5787 #define READ_CACHE_TRACE 0
5788 /* libdvdread */
5789 #define HAVE_DLFCN_H 1
5790 $def_dvdcss
5793 /* system headers */
5794 $def_alloca_h
5795 $def_altivec_h
5796 $def_malloc_h
5797 $def_mman_h
5798 $def_mman_has_map_failed
5799 $def_soundcard_h
5800 $def_sys_soundcard_h
5801 $def_sys_sysinfo_h
5802 $def_sys_videoio_h
5803 $def_termios_h
5804 $def_termios_sys_h
5805 $def_winsock2_h
5808 /* system functions */
5809 $def_gethostbyname2
5810 $def_gettimeofday
5811 $def_glob
5812 $def_langinfo
5813 $def_lrintf
5814 $def_map_memalign
5815 $def_memalign
5816 $def_nanosleep
5817 $def_posix_select
5818 $def_select
5819 $def_setenv
5820 $def_setmode
5821 $def_shm
5822 $def_strsep
5823 $def_swab
5824 $def_sysi86
5825 $def_sysi86_iv
5826 $def_termcap
5827 $def_termios
5828 $def_vsscanf
5831 /* system-specific features */
5832 $def_asmalign_pot
5833 $def_builtin_expect
5834 $def_dl
5835 $def_dos_paths
5836 $def_extern_asm
5837 $def_extern_prefix
5838 $def_iconv
5839 $def_kstat
5840 $def_macosx_bundle
5841 $def_macosx_finder
5842 $def_priority
5843 $def_quicktime
5844 $def_restrict_keyword
5845 $def_rtc
5846 $def_unrar_exec
5849 /* configurable options */
5850 $def_charset
5851 $def_crash_debug
5852 $def_debug
5853 $def_fastmemcpy
5854 $def_runtime_cpudetection
5855 $def_sighandler
5856 $def_sortsub
5857 $def_stream_cache
5858 $def_pthread_cache
5861 /* CPU stuff */
5862 #define __CPU__ $iproc
5863 $def_ebx_available
5864 $def_words_endian
5865 $def_bigendian
5866 $(ff_config_enable "$arch_all" "$arch" "ARCH")
5867 $(ff_config_enable "$subarch_all" "$subarch" "ARCH")
5868 $(ff_config_enable "$cpuexts_all" "$cpuexts" "HAVE")
5871 /* Blu-ray/DVD/VCD/CD */
5872 #define DEFAULT_CDROM_DEVICE "$default_cdrom_device"
5873 #define DEFAULT_DVD_DEVICE "$default_dvd_device"
5874 $def_bluray
5875 $def_bsdi_dvd
5876 $def_cdda
5877 $def_cddb
5878 $def_cdio
5879 $def_cdrom
5880 $def_dvd
5881 $def_dvd_bsd
5882 $def_dvd_darwin
5883 $def_dvd_linux
5884 $def_dvd_openbsd
5885 $def_dvdio
5886 $def_dvdnav
5887 $def_dvdread
5888 $def_hpux_scsi_h
5889 $def_sol_scsi_h
5890 $def_vcd
5893 /* codec libraries */
5894 $def_faad
5895 $def_liba52
5896 $def_libdca
5897 $def_libdv
5898 $def_mad
5899 $def_mpg123
5900 $def_musepack
5901 $def_speex
5902 $def_theora
5903 $def_tremor
5904 $def_vorbis
5905 $def_xvid
5906 $def_zlib
5908 $def_libpostproc
5909 $def_libnut
5912 /* binary codecs */
5913 $def_qtx
5914 $def_qtx_win32
5915 $def_real
5916 $def_win32_loader
5917 $def_win32dll
5918 $def_xanim
5919 $def_xmms
5920 #define BINARY_CODECS_PATH "$_codecsdir"
5921 #define XMMS_INPUT_PLUGIN_DIR "$_xmmsplugindir"
5924 /* Audio output drivers */
5925 $def_alsa
5926 $def_coreaudio
5927 $def_jack
5928 $def_nas
5929 $def_openal
5930 $def_openal_h
5931 $def_ossaudio
5932 $def_ossaudio_devdsp
5933 $def_ossaudio_devmixer
5934 $def_pulse
5935 $def_portaudio
5936 $def_rsound
5938 $def_ladspa
5939 $def_libbs2b
5942 /* input */
5943 $def_apple_ir
5944 $def_apple_remote
5945 $def_ioctl_bt848_h_name
5946 $def_ioctl_meteor_h_name
5947 $def_joystick
5948 $def_lirc
5949 $def_lircc
5950 $def_pvr
5951 $def_radio
5952 $def_radio_bsdbt848
5953 $def_radio_capture
5954 $def_radio_v4l
5955 $def_radio_v4l2
5956 $def_tv
5957 $def_tv_bsdbt848
5958 $def_tv_dshow
5959 $def_tv_v4l
5960 $def_tv_v4l1
5961 $def_tv_v4l2
5964 /* font stuff */
5965 $def_ass
5966 $def_enca
5968 /* networking */
5969 $def_closesocket
5970 $def_ftp
5971 $def_inet6
5972 $def_inet_aton
5973 $def_inet_pton
5974 $def_networking
5975 $def_smb
5976 $def_libquvi
5977 $def_socklen_t
5978 $def_vstream
5980 $def_lcms2
5983 /* libvo options */
5984 $def_caca
5985 $def_corevideo
5986 $def_cocoa
5987 $def_sharedbuffer
5988 $def_direct3d
5989 $def_directfb
5990 $def_directx
5991 $def_dvbin
5992 $def_gif
5993 $def_gif_4
5994 $def_gif_tvt_hack
5995 $def_gl
5996 $def_gl_cocoa
5997 $def_gl_win32
5998 $def_gl_x11
5999 $def_gl_sdl
6000 $def_jpeg
6001 $def_md5sum
6002 $def_mng
6003 $def_png
6004 $def_pnm
6005 $def_sdl
6006 $def_sdl_sdl_h
6007 $def_tga
6008 $def_v4l2
6009 $def_vdpau
6010 $def_vm
6011 $def_x11
6012 $def_xdpms
6013 $def_xf86keysym
6014 $def_xinerama
6015 $def_xss
6016 $def_xv
6017 $def_yuv4mpeg
6020 /* FFmpeg */
6021 $def_ffmpeg_internals
6023 $def_arpa_inet_h
6024 $def_bswap
6025 $def_dcbzl
6026 $def_exp2
6027 $def_exp2f
6028 $def_fast_64bit
6029 $def_fast_unaligned
6030 $def_llrint
6031 $def_log2
6032 $def_log2f
6033 $def_lrint
6034 $def_memalign_hack
6035 $def_mkstemp
6036 $def_posix_memalign
6037 $def_pthreads
6038 $def_round
6039 $def_roundf
6040 $def_threads
6041 $def_truncf
6042 $def_xform_asm
6043 $def_yasm
6045 #define HAVE_INLINE_ASM 1
6047 /* Use these registers in x86 inline asm. No proper detection yet. */
6048 #define HAVE_EBP_AVAILABLE 1
6050 #endif /* MPLAYER_CONFIG_H */
6053 # Do not overwrite an unchanged config.h to avoid superfluous rebuilds.
6054 cmp -s "$TMPH" config.h || mv -f "$TMPH" config.h
6056 #############################################################################
6058 cat << EOF
6060 Config files successfully generated by ./configure $configuration !
6062 Install prefix: $_prefix
6063 Data directory: $_datadir
6064 Config direct.: $_confdir
6066 Byte order: $_byte_order
6067 Optimizing for: $_optimizing
6069 Languages:
6070 Messages (in addition to English): $language_msg
6071 Manual pages: $language_man
6072 Documentation: $language_doc
6074 Enabled optional drivers:
6075 Input: $inputmodules
6076 Codecs: $codecmodules
6077 Audio output: $aomodules
6078 Video output: $vomodules
6080 Disabled optional drivers:
6081 Input: $noinputmodules
6082 Codecs: $nocodecmodules
6083 Audio output: $noaomodules
6084 Video output: $novomodules
6086 'config.h' and 'config.mak' contain your configuration options.
6087 Note: If you alter theses files (for instance CFLAGS) MPlayer may no longer
6088 compile *** DO NOT REPORT BUGS if you tweak these files ***
6090 'make' will now compile MPlayer and 'make install' will install it.
6091 Note: On non-Linux systems you might need to use 'gmake' instead of 'make'.
6096 cat <<EOF
6097 Check $TMPLOG if you wonder why an autodetection failed (make sure
6098 development headers/packages are installed).
6100 NOTE: The --enable-* parameters unconditionally force options on, completely
6101 skipping autodetection. This behavior is unlike what you may be used to from
6102 autoconf-based configure scripts that can decide to override you. This greater
6103 level of control comes at a price. You may have to provide the correct compiler
6104 and linker flags yourself.
6105 If you used one of these options (except --enable-runtime-cpudetection and
6106 similar ones that turn on internal features) and experience a compilation or
6107 linking failure, make sure you have passed the necessary compiler/linker flags
6108 to configure.
6110 If you suspect a bug, please read DOCS/HTML/$language_doc/bugreports.html.
6114 if test "$warn_cflags" = yes; then
6115 cat <<EOF
6117 MPlayer compilation will use the CPPFLAGS/CFLAGS/LDFLAGS/YASMFLAGS set by you,
6118 but:
6120 *** *** DO NOT REPORT BUGS IF IT DOES NOT COMPILE/WORK! *** ***
6122 It is strongly recommended to let MPlayer choose the correct CFLAGS!
6123 To do so, execute 'CFLAGS= ./configure <options>'
6128 # Last move:
6129 rm -rf "$mplayer_tmpdir"