subs: always use sub decoder framework for libass rendering
[mplayer.git] / configure
blob2cf7affac1b5c0c9a2eeb11bd20ced15365fdbfc
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 --disable-vcd disable VCD support [autodetect]
334 --disable-bluray disable Blu-ray support [autodetect]
335 --disable-dvdnav disable libdvdnav [autodetect]
336 --disable-dvdread disable libdvdread [autodetect]
337 --disable-dvdread-internal disable internal libdvdread [autodetect]
338 --disable-libdvdcss-internal disable internal libdvdcss [autodetect]
339 --disable-cddb disable cddb [autodetect]
340 --disable-unrarexec disable using of UnRAR executable [enabled]
341 --disable-sortsub disable subtitle sorting [enabled]
342 --disable-enca disable ENCA charset oracle library [autodetect]
343 --enable-macosx-finder enable Mac OS X Finder invocation parameter
344 parsing [disabled]
345 --enable-macosx-bundle enable Mac OS X bundle file locations [autodetect]
346 --disable-inet6 disable IPv6 support [autodetect]
347 --disable-gethostbyname2 gethostbyname2 part of the C library [autodetect]
348 --disable-ftp disable FTP support [enabled]
349 --disable-vstream disable TiVo vstream client support [autodetect]
350 --disable-pthreads disable Posix threads support [autodetect]
351 --disable-w32threads disable Win32 threads support [autodetect]
352 --disable-libass disable subtitle rendering with libass [autodetect]
353 --enable-rpath enable runtime linker path for extra libs [disabled]
354 --disable-libpostproc disable postprocess filter (vf_pp) [autodetect]
356 Codecs:
357 --enable-gif enable GIF support [autodetect]
358 --enable-png enable PNG input/output support [autodetect]
359 --enable-mng enable MNG input support [autodetect]
360 --enable-jpeg enable JPEG input/output support [autodetect]
361 --enable-libcdio enable libcdio support [autodetect]
362 --disable-win32dll disable Win32 DLL support [autodetect]
363 --disable-qtx disable QuickTime codecs support [enabled]
364 --disable-xanim disable XAnim codecs support [enabled]
365 --disable-real disable RealPlayer codecs support [enabled]
366 --disable-xvid disable Xvid [autodetect]
367 --disable-libnut disable libnut [autodetect]
368 --enable-libav skip Libav autodetection [autodetect]
369 --disable-libvorbis disable libvorbis support [autodetect]
370 --disable-tremor disable Tremor [autodetect if no libvorbis]
371 --disable-speex disable Speex support [autodetect]
372 --enable-theora enable OggTheora libraries [autodetect]
373 --enable-faad enable FAAD2 (AAC) [autodetect]
374 --disable-ladspa disable LADSPA plugin support [autodetect]
375 --disable-libbs2b disable libbs2b audio filter support [autodetect]
376 --disable-libdv disable libdv 0.9.5 en/decoding support [autodetect]
377 --disable-mpg123 disable libmpg123 MP3 decoding support [autodetect]
378 --disable-mad disable libmad (MPEG audio) support [autodetect]
379 --enable-xmms enable XMMS input plugin support [disabled]
380 --enable-libdca enable libdca support [autodetect]
381 --disable-liba52 disable liba52 [autodetect]
382 --enable-musepack enable libmpcdec support (deprecated, libavcodec
383 Musepack decoder is preferred) [disabled]
385 Video output:
386 --enable-gl enable OpenGL video output [autodetect]
387 --enable-sdl enable SDL video output [autodetect]
388 --enable-caca enable CACA video output [autodetect]
389 --enable-direct3d enable Direct3D video output [autodetect]
390 --enable-directx enable DirectX video output [autodetect]
391 --enable-v4l2 enable V4L2 Decoder audio/video output [autodetect]
392 --enable-dvb enable DVB video input [autodetect]
393 --enable-xv enable Xv video output [autodetect]
394 --enable-vdpau enable VDPAU acceleration [autodetect]
395 --enable-vm enable XF86VidMode support [autodetect]
396 --enable-xinerama enable Xinerama support [autodetect]
397 --enable-x11 enable X11 video output [autodetect]
398 --enable-xshape enable XShape support [autodetect]
399 --disable-xss disable screensaver support via xss [autodetect]
400 --enable-directfb enable DirectFB video output [autodetect]
401 --disable-tga disable Targa video output [enable]
402 --disable-pnm disable PNM video output [enable]
403 --disable-md5sum disable md5sum video output [enable]
404 --disable-yuv4mpeg disable yuv4mpeg video output [enable]
405 --disable-corevideo disable CoreVideo video output [autodetect]
406 --disable-cocoa disable Cocoa OpenGL backend [autodetect]
407 --disable-sharedbuffer disable OSX shared buffer video output [autodetect]
409 Audio output:
410 --disable-alsa disable ALSA audio output [autodetect]
411 --disable-ossaudio disable OSS audio output [autodetect]
412 --disable-rsound disable RSound audio output [autodetect]
413 --disable-pulse disable Pulseaudio audio output [autodetect]
414 --disable-portaudio disable PortAudio audio output [autodetect]
415 --disable-jack disable JACK audio output [autodetect]
416 --enable-openal enable OpenAL audio output [disable]
417 --disable-coreaudio disable CoreAudio audio output [autodetect]
418 --disable-select disable using select() on the audio device [enable]
420 Language options:
421 --enable-translation enable support for translated output [disable]
422 --charset=charset convert the console messages to this character set
423 --language-doc=lang language to use for the documentation [en]
424 --language-man=lang language to use for the man pages [en]
425 --language-msg=lang extra languages for program messages [all]
426 --language=lang default language to use [en]
427 Specific options override --language. You can pass a list of languages separated
428 by whitespace or commas instead of a single language. Nonexisting translations
429 will be dropped from each list. All translations available in the list will be
430 installed. The value "all" will activate all translations. The LINGUAS
431 environment variable is honored. In all cases the fallback is English.
432 The program always supports English-language output; additional message
433 languages are only installed if --enable-translation is also specified.
434 Available values for --language-doc are: all $doc_lang_all
435 Available values for --language-man are: all $man_lang_all
436 Available values for --language-msg are: all $msg_lang_all
438 Miscellaneous options:
439 --enable-runtime-cpudetection enable runtime CPU detection [disable]
440 --enable-cross-compile enable cross-compilation [disable]
441 --cc=COMPILER C compiler to build MPlayer [gcc]
442 --as=ASSEMBLER assembler to build MPlayer [as]
443 --nm=NM nm tool to build MPlayer [nm]
444 --yasm=YASM Yasm assembler to build MPlayer [yasm]
445 --ar=AR librarian to build MPlayer [ar]
446 --pkg-config=PKGCONFIG pkg-config to find some libraries [pkg-config]
447 --ranlib=RANLIB ranlib to build MPlayer [ranlib]
448 --windres=WINDRES windres to build MPlayer [windres]
449 --target=PLATFORM target platform (i386-linux, arm-linux, etc)
450 --enable-static build a statically linked binary
451 --with-install=PATH path to a custom install program
453 Advanced options:
454 --enable-mmx enable MMX [autodetect]
455 --enable-mmxext enable MMX2 (Pentium III, Athlon) [autodetect]
456 --enable-3dnow enable 3DNow! [autodetect]
457 --enable-3dnowext enable extended 3DNow! [autodetect]
458 --enable-sse enable SSE [autodetect]
459 --enable-sse2 enable SSE2 [autodetect]
460 --enable-ssse3 enable SSSE3 [autodetect]
461 --enable-shm enable shm [autodetect]
462 --enable-altivec enable AltiVec (PowerPC) [autodetect]
463 --enable-armv5te enable DSP extensions (ARM) [autodetect]
464 --enable-armv6 enable ARMv6 (ARM) [autodetect]
465 --enable-armv6t2 enable ARMv6t2 (ARM) [autodetect]
466 --enable-armvfp enable ARM VFP (ARM) [autodetect]
467 --enable-neon enable NEON (ARM) [autodetect]
468 --enable-iwmmxt enable iWMMXt (ARM) [autodetect]
469 --disable-fastmemcpy disable 3DNow!/SSE/MMX optimized memcpy [enable]
470 --enable-big-endian force byte order to big-endian [autodetect]
471 --enable-debug[=1-3] compile-in debugging information [disable]
472 --enable-profile compile-in profiling information [disable]
473 --disable-sighandler disable sighandler for crashes [enable]
474 --enable-crash-debug enable automatic gdb attach on crash [disable]
476 Use these options if autodetection fails:
477 --extra-cflags=FLAGS extra CFLAGS
478 --extra-ldflags=FLAGS extra LDFLAGS
479 --extra-libs=FLAGS extra linker flags
480 --extra-libs-mplayer=FLAGS extra linker flags for MPlayer
482 --with-sdl-config=PATH path to sdl*-config
483 --with-dvdnav-config=PATH path to dvdnav-config
484 --with-dvdread-config=PATH path to dvdread-config
486 This configure script is NOT autoconf-based, even though its output is similar.
487 It will try to autodetect all configuration options. If you --enable an option
488 it will be forcefully turned on, skipping autodetection. This can break
489 compilation, so you need to know what you are doing.
491 exit 0
492 } #show_help()
494 # GOTCHA: the variables below defines the default behavior for autodetection
495 # and have - unless stated otherwise - at least 2 states : yes no
496 # If autodetection is available then the third state is: auto
497 _mmx=auto
498 _3dnow=auto
499 _3dnowext=auto
500 _mmxext=auto
501 _sse=auto
502 _sse2=auto
503 _ssse3=auto
504 _cmov=auto
505 _fast_cmov=auto
506 _fast_clz=auto
507 _armv5te=auto
508 _armv6=auto
509 _armv6t2=auto
510 _armvfp=auto
511 neon=auto
512 _iwmmxt=auto
513 _altivec=auto
514 _install=install
515 _pkg_config=auto
516 _ranlib=auto
517 _windres=auto
518 _cc=auto
519 _ar=auto
520 test "$CC" && _cc="$CC"
521 _as=auto
522 _nm=auto
523 _yasm=auto
524 _runtime_cpudetection=no
525 _cross_compile=no
526 _prefix="/usr/local"
527 ffmpeg=auto
528 ffmpeg_internals=no
529 _mplayer=yes
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 _xinerama=auto
584 _vm=auto
585 _xf86keysym=auto
586 _alsa=auto
587 _fastmemcpy=yes
588 _unrar_exec=auto
589 _win32dll=auto
590 _select=yes
591 _radio=no
592 _radio_capture=no
593 _radio_v4l=auto
594 _radio_v4l2=auto
595 _radio_bsdbt848=auto
596 _tv=yes
597 _tv_v4l1=auto
598 _tv_v4l2=auto
599 _tv_bsdbt848=auto
600 _tv_dshow=auto
601 _pvr=auto
602 networking=yes
603 _winsock2_h=auto
604 _smb=auto
605 _libquvi=auto
606 _joystick=no
607 _xvid=auto
608 _libnut=auto
609 _lirc=auto
610 _lircc=auto
611 _apple_remote=auto
612 _apple_ir=auto
613 _termcap=auto
614 _termios=auto
615 _tga=yes
616 _directfb=auto
617 #language=en
618 _shm=auto
619 _translation=no
620 _charset="UTF-8"
621 _crash_debug=no
622 _sighandler=yes
623 _libdv=auto
624 _cdda=auto
625 _cddb=auto
626 _big_endian=auto
627 _qtx=auto
628 _coreaudio=auto
629 _corevideo=auto
630 _cocoa=auto
631 _sharedbuffer=auto
632 quicktime=auto
633 _macosx_finder=no
634 _macosx_bundle=auto
635 _sortsub=yes
636 _enca=auto
637 _inet6=auto
638 _gethostbyname2=auto
639 _ftp=auto
640 _musepack=no
641 _vstream=auto
642 _pthreads=auto
643 _w32threads=auto
644 _ass=auto
645 _rpath=no
646 libpostproc=auto
647 _asmalign_pot=auto
648 _stream_cache=yes
649 _priority=no
650 def_dos_paths="#define HAVE_DOS_PATHS 0"
651 def_stream_cache="#define CONFIG_STREAM_CACHE 1"
652 def_priority="#undef CONFIG_PRIORITY"
653 def_pthread_cache="#undef PTHREAD_CACHE"
654 need_shmem=yes
655 for ac_option do
656 case "$ac_option" in
657 --help|-help|-h)
658 show_help
660 --prefix=*)
661 _prefix=$(echo $ac_option | cut -d '=' -f 2)
663 --bindir=*)
664 _bindir=$(echo $ac_option | cut -d '=' -f 2)
666 --datadir=*)
667 _datadir=$(echo $ac_option | cut -d '=' -f 2)
669 --mandir=*)
670 _mandir=$(echo $ac_option | cut -d '=' -f 2)
672 --confdir=*)
673 _confdir=$(echo $ac_option | cut -d '=' -f 2)
675 --libdir=*)
676 _libdir=$(echo $ac_option | cut -d '=' -f 2)
678 --codecsdir=*)
679 _codecsdir=$(echo $ac_option | cut -d '=' -f 2)
681 --localedir=*)
682 _localedir=$(echo $ac_option | cut -d '=' -f 2)
685 --with-install=*)
686 _install=$(echo $ac_option | cut -d '=' -f 2 )
689 --with-sdl-config=*)
690 _sdlconfig=$(echo $ac_option | cut -d '=' -f 2)
692 --with-dvdnav-config=*)
693 _dvdnavconfig=$(echo $ac_option | cut -d '=' -f 2)
695 --with-dvdread-config=*)
696 _dvdreadconfig=$(echo $ac_option | cut -d '=' -f 2)
699 --extra-cflags=*)
700 extra_cflags="$extra_cflags $(echo $ac_option | cut -d '=' -f 2-)"
702 --extra-ldflags=*)
703 extra_ldflags="$extra_ldflags $(echo $ac_option | cut -d '=' -f 2-)"
705 --extra-libs=*)
706 extra_libs=$(echo $ac_option | cut -d '=' -f 2)
708 --extra-libs-mplayer=*)
709 libs_mplayer=$(echo $ac_option | cut -d '=' -f 2)
712 --target=*)
713 _target=$(echo $ac_option | cut -d '=' -f 2)
715 --cc=*)
716 _cc=$(echo $ac_option | cut -d '=' -f 2)
718 --as=*)
719 _as=$(echo $ac_option | cut -d '=' -f 2)
721 --nm=*)
722 _nm=$(echo $ac_option | cut -d '=' -f 2)
724 --yasm=*)
725 _yasm=$(echo $ac_option | cut -d '=' -f 2)
727 --ar=*)
728 _ar=$(echo $ac_option | cut -d '=' -f 2)
730 --pkg-config=*)
731 _pkg_config=$(echo $ac_option | cut -d '=' -f 2)
733 --ranlib=*)
734 _ranlib=$(echo $ac_option | cut -d '=' -f 2)
736 --windres=*)
737 _windres=$(echo $ac_option | cut -d '=' -f 2)
739 --charset=*)
740 _charset=$(echo $ac_option | cut -d '=' -f 2)
742 --language-doc=*)
743 language_doc=$(echo $ac_option | cut -d '=' -f 2)
745 --language-man=*)
746 language_man=$(echo $ac_option | cut -d '=' -f 2)
748 --language-msg=*)
749 language_msg=$(echo $ac_option | cut -d '=' -f 2)
751 --language=*)
752 language=$(echo $ac_option | cut -d '=' -f 2)
755 --enable-static)
756 _ld_static='-static'
758 --disable-static)
759 _ld_static=''
761 --enable-profile)
762 _profile='-p'
764 --disable-profile)
765 _profile=
767 --enable-debug)
768 _debug='-g'
770 --enable-debug=*)
771 _debug=$(echo $_echo_n '-g'$_echo_c; echo $ac_option | cut -d '=' -f 2)
773 --disable-debug)
774 _debug=
776 --enable-translation) _translation=yes ;;
777 --disable-translation) _translation=no ;;
778 --enable-runtime-cpudetection) _runtime_cpudetection=yes ;;
779 --disable-runtime-cpudetection) _runtime_cpudetection=no ;;
780 --enable-cross-compile) _cross_compile=yes ;;
781 --disable-cross-compile) _cross_compile=no ;;
782 --enable-mplayer) _mplayer=yes ;;
783 --disable-mplayer) _mplayer=no ;;
784 --enable-x11) _x11=yes ;;
785 --disable-x11) _x11=no ;;
786 --enable-xshape) _xshape=yes ;;
787 --disable-xshape) _xshape=no ;;
788 --enable-xss) _xss=yes ;;
789 --disable-xss) _xss=no ;;
790 --enable-xv) _xv=yes ;;
791 --disable-xv) _xv=no ;;
792 --enable-vdpau) _vdpau=yes ;;
793 --disable-vdpau) _vdpau=no ;;
794 --enable-sdl) _sdl=yes ;;
795 --disable-sdl) _sdl=no ;;
796 --enable-direct3d) _direct3d=yes ;;
797 --disable-direct3d) _direct3d=no ;;
798 --enable-directx) _directx=yes ;;
799 --disable-directx) _directx=no ;;
800 --enable-png) _png=yes ;;
801 --disable-png) _png=no ;;
802 --enable-mng) _mng=yes ;;
803 --disable-mng) _mng=no ;;
804 --enable-jpeg) _jpeg=yes ;;
805 --disable-jpeg) _jpeg=no ;;
806 --enable-pnm) _pnm=yes ;;
807 --disable-pnm) _pnm=no ;;
808 --enable-md5sum) _md5sum=yes ;;
809 --disable-md5sum) _md5sum=no ;;
810 --enable-yuv4mpeg) _yuv4mpeg=yes ;;
811 --disable-yuv4mpeg) _yuv4mpeg=no ;;
812 --enable-gif) _gif=yes ;;
813 --disable-gif) _gif=no ;;
814 --enable-gl) _gl=yes ;;
815 --disable-gl) _gl=no ;;
816 --enable-caca) _caca=yes ;;
817 --disable-caca) _caca=no ;;
818 --enable-dvb) _dvb=yes ;;
819 --disable-dvb) _dvb=no ;;
820 --enable-v4l2) _v4l2=yes ;;
821 --disable-v4l2) _v4l2=no ;;
822 --enable-iconv) _iconv=yes ;;
823 --disable-iconv) _iconv=no ;;
824 --enable-langinfo) _langinfo=yes ;;
825 --disable-langinfo) _langinfo=no ;;
826 --enable-rtc) _rtc=yes ;;
827 --disable-rtc) _rtc=no ;;
828 --enable-libdv) _libdv=yes ;;
829 --disable-libdv) _libdv=no ;;
830 --enable-ossaudio) _ossaudio=yes ;;
831 --disable-ossaudio) _ossaudio=no ;;
832 --enable-rsound) _rsound=yes ;;
833 --disable-rsound) _rsound=no ;;
834 --enable-pulse) _pulse=yes ;;
835 --disable-pulse) _pulse=no ;;
836 --enable-portaudio) _portaudio=yes ;;
837 --disable-portaudio) _portaudio=no ;;
838 --enable-jack) _jack=yes ;;
839 --disable-jack) _jack=no ;;
840 --enable-openal) _openal=yes ;;
841 --disable-openal) _openal=no ;;
842 --enable-mad) _mad=yes ;;
843 --disable-mad) _mad=no ;;
844 --enable-libcdio) _libcdio=yes ;;
845 --disable-libcdio) _libcdio=no ;;
846 --enable-libvorbis) _libvorbis=yes ;;
847 --disable-libvorbis) _libvorbis=no ;;
848 --enable-speex) _speex=yes ;;
849 --disable-speex) _speex=no ;;
850 --enable-tremor) _tremor=yes ;;
851 --disable-tremor) _tremor=no ;;
852 --enable-theora) _theora=yes ;;
853 --disable-theora) _theora=no ;;
854 --enable-mpg123) _mpg123=yes ;;
855 --disable-mpg123) _mpg123=no ;;
856 --enable-liba52) _liba52=yes ;;
857 --disable-liba52) _liba52=no ;;
858 --enable-libdca) _libdca=yes ;;
859 --disable-libdca) _libdca=no ;;
860 --enable-musepack) _musepack=yes ;;
861 --disable-musepack) _musepack=no ;;
862 --enable-faad) _faad=yes ;;
863 --disable-faad) _faad=no ;;
864 --enable-ladspa) _ladspa=yes ;;
865 --disable-ladspa) _ladspa=no ;;
866 --enable-libbs2b) _libbs2b=yes ;;
867 --disable-libbs2b) _libbs2b=no ;;
868 --enable-xmms) _xmms=yes ;;
869 --disable-xmms) _xmms=no ;;
870 --enable-vcd) _vcd=yes ;;
871 --disable-vcd) _vcd=no ;;
872 --enable-bluray) _bluray=yes ;;
873 --disable-bluray) _bluray=no ;;
874 --enable-dvdread) _dvdread=yes ;;
875 --disable-dvdread) _dvdread=no ;;
876 --enable-dvdread-internal) _dvdread_internal=yes ;;
877 --disable-dvdread-internal) _dvdread_internal=no ;;
878 --enable-libdvdcss-internal) _libdvdcss_internal=yes ;;
879 --disable-libdvdcss-internal) _libdvdcss_internal=no ;;
880 --enable-dvdnav) _dvdnav=yes ;;
881 --disable-dvdnav) _dvdnav=no ;;
882 --enable-xanim) _xanim=yes ;;
883 --disable-xanim) _xanim=no ;;
884 --enable-real) _real=yes ;;
885 --disable-real) _real=no ;;
886 --enable-xinerama) _xinerama=yes ;;
887 --disable-xinerama) _xinerama=no ;;
888 --enable-vm) _vm=yes ;;
889 --disable-vm) _vm=no ;;
890 --enable-xf86keysym) _xf86keysym=yes ;;
891 --disable-xf86keysym) _xf86keysym=no ;;
892 --enable-alsa) _alsa=yes ;;
893 --disable-alsa) _alsa=no ;;
894 --enable-tv) _tv=yes ;;
895 --disable-tv) _tv=no ;;
896 --enable-tv-bsdbt848) _tv_bsdbt848=yes ;;
897 --disable-tv-bsdbt848) _tv_bsdbt848=no ;;
898 --enable-tv-v4l1) _tv_v4l1=yes ;;
899 --disable-tv-v4l1) _tv_v4l1=no ;;
900 --enable-tv-v4l2) _tv_v4l2=yes ;;
901 --disable-tv-v4l2) _tv_v4l2=no ;;
902 --enable-tv-dshow) _tv_dshow=yes ;;
903 --disable-tv-dshow) _tv_dshow=no ;;
904 --enable-radio) _radio=yes ;;
905 --enable-radio-capture) _radio_capture=yes ;;
906 --disable-radio-capture) _radio_capture=no ;;
907 --disable-radio) _radio=no ;;
908 --enable-radio-v4l) _radio_v4l=yes ;;
909 --disable-radio-v4l) _radio_v4l=no ;;
910 --enable-radio-v4l2) _radio_v4l2=yes ;;
911 --disable-radio-v4l2) _radio_v4l2=no ;;
912 --enable-radio-bsdbt848) _radio_bsdbt848=yes ;;
913 --disable-radio-bsdbt848) _radio_bsdbt848=no ;;
914 --enable-pvr) _pvr=yes ;;
915 --disable-pvr) _pvr=no ;;
916 --enable-fastmemcpy) _fastmemcpy=yes ;;
917 --disable-fastmemcpy) _fastmemcpy=no ;;
918 --enable-networking) networking=yes ;;
919 --disable-networking) networking=no ;;
920 --enable-winsock2_h) _winsock2_h=yes ;;
921 --disable-winsock2_h) _winsock2_h=no ;;
922 --enable-smb) _smb=yes ;;
923 --disable-smb) _smb=no ;;
924 --enable-libquvi) _libquvi=yes ;;
925 --disable-libquvi) _libquvi=no ;;
926 --enable-joystick) _joystick=yes ;;
927 --disable-joystick) _joystick=no ;;
928 --enable-xvid) _xvid=yes ;;
929 --disable-xvid) _xvid=no ;;
930 --enable-libnut) _libnut=yes ;;
931 --disable-libnut) _libnut=no ;;
932 --enable-libav) ffmpeg=yes ;;
933 --ffmpeg-source-dir=*)
934 _ffmpeg_source=$(echo $ac_option | cut -d '=' -f 2 ) ;;
936 --enable-lirc) _lirc=yes ;;
937 --disable-lirc) _lirc=no ;;
938 --enable-lircc) _lircc=yes ;;
939 --disable-lircc) _lircc=no ;;
940 --enable-apple-remote) _apple_remote=yes ;;
941 --disable-apple-remote) _apple_remote=no ;;
942 --enable-apple-ir) _apple_ir=yes ;;
943 --disable-apple-ir) _apple_ir=no ;;
944 --enable-termcap) _termcap=yes ;;
945 --disable-termcap) _termcap=no ;;
946 --enable-termios) _termios=yes ;;
947 --disable-termios) _termios=no ;;
948 --disable-tga) _tga=no ;;
949 --enable-tga) _tga=yes ;;
950 --enable-directfb) _directfb=yes ;;
951 --disable-directfb) _directfb=no ;;
952 --enable-shm) _shm=yes ;;
953 --disable-shm) _shm=no ;;
954 --enable-select) _select=yes ;;
955 --disable-select) _select=no ;;
956 --enable-cddb) _cddb=yes ;;
957 --disable-cddb) _cddb=no ;;
958 --enable-big-endian) _big_endian=yes ;;
959 --disable-big-endian) _big_endian=no ;;
960 --enable-unrarexec) _unrar_exec=yes ;;
961 --disable-unrarexec) _unrar_exec=no ;;
962 --enable-ftp) _ftp=yes ;;
963 --disable-ftp) _ftp=no ;;
964 --enable-vstream) _vstream=yes ;;
965 --disable-vstream) _vstream=no ;;
966 --enable-pthreads) _pthreads=yes ;;
967 --disable-pthreads) _pthreads=no ;;
968 --enable-w32threads) _w32threads=yes ;;
969 --disable-w32threads) _w32threads=no ;;
970 --enable-libass) _ass=yes ;;
971 --disable-libass) _ass=no ;;
972 --enable-rpath) _rpath=yes ;;
973 --disable-rpath) _rpath=no ;;
974 --enable-libpostproc) libpostproc=yes ;;
975 --disable-libpostproc) libpostproc=no ;;
977 --enable-enca) _enca=yes ;;
978 --disable-enca) _enca=no ;;
980 --enable-inet6) _inet6=yes ;;
981 --disable-inet6) _inet6=no ;;
983 --enable-gethostbyname2) _gethostbyname2=yes ;;
984 --disable-gethostbyname2) _gethostbyname2=no ;;
986 --enable-qtx) _qtx=yes ;;
987 --disable-qtx) _qtx=no ;;
989 --enable-coreaudio) _coreaudio=yes ;;
990 --disable-coreaudio) _coreaudio=no ;;
991 --enable-corevideo) _corevideo=yes ;;
992 --disable-corevideo) _corevideo=no ;;
993 --enable-cocoa) _cocoa=yes ;;
994 --disable-cocoa) _cocoa=no ;;
995 --enable-sharedbuffer) _sharedbuffer=yes ;;
996 --disable-sharedbuffer) _sharedbuffer=no ;;
997 --enable-macosx-finder) _macosx_finder=yes ;;
998 --disable-macosx-finder) _macosx_finder=no ;;
999 --enable-macosx-bundle) _macosx_bundle=yes ;;
1000 --disable-macosx-bundle) _macosx_bundle=no ;;
1002 --enable-sortsub) _sortsub=yes ;;
1003 --disable-sortsub) _sortsub=no ;;
1005 --enable-crash-debug) _crash_debug=yes ;;
1006 --disable-crash-debug) _crash_debug=no ;;
1007 --enable-sighandler) _sighandler=yes ;;
1008 --disable-sighandler) _sighandler=no ;;
1009 --enable-win32dll) _win32dll=yes ;;
1010 --disable-win32dll) _win32dll=no ;;
1012 --enable-sse) _sse=yes ;;
1013 --disable-sse) _sse=no ;;
1014 --enable-sse2) _sse2=yes ;;
1015 --disable-sse2) _sse2=no ;;
1016 --enable-ssse3) _ssse3=yes ;;
1017 --disable-ssse3) _ssse3=no ;;
1018 --enable-mmxext) _mmxext=yes ;;
1019 --disable-mmxext) _mmxext=no ;;
1020 --enable-3dnow) _3dnow=yes ;;
1021 --disable-3dnow) _3dnow=no _3dnowext=no ;;
1022 --enable-3dnowext) _3dnow=yes _3dnowext=yes ;;
1023 --disable-3dnowext) _3dnowext=no ;;
1024 --enable-cmov) _cmov=yes ;;
1025 --disable-cmov) _cmov=no ;;
1026 --enable-fast-cmov) _fast_cmov=yes ;;
1027 --disable-fast-cmov) _fast_cmov=no ;;
1028 --enable-fast-clz) _fast_clz=yes ;;
1029 --disable-fast-clz) _fast_clz=no ;;
1030 --enable-altivec) _altivec=yes ;;
1031 --disable-altivec) _altivec=no ;;
1032 --enable-armv5te) _armv5te=yes ;;
1033 --disable-armv5te) _armv5te=no ;;
1034 --enable-armv6) _armv6=yes ;;
1035 --disable-armv6) _armv6=no ;;
1036 --enable-armv6t2) _armv6t2=yes ;;
1037 --disable-armv6t2) _armv6t2=no ;;
1038 --enable-armvfp) _armvfp=yes ;;
1039 --disable-armvfp) _armvfp=no ;;
1040 --enable-neon) neon=yes ;;
1041 --disable-neon) neon=no ;;
1042 --enable-iwmmxt) _iwmmxt=yes ;;
1043 --disable-iwmmxt) _iwmmxt=no ;;
1044 --enable-mmx) _mmx=yes ;;
1045 --disable-mmx) # 3Dnow! and MMX2 require MMX
1046 _3dnow=no _3dnowext=no _mmx=no _mmxext=no ;;
1049 echo "Unknown parameter: $ac_option" >&2
1050 exit 1
1053 esac
1054 done
1056 # Atmos: moved this here, to be correct, if --prefix is specified
1057 test -z "$_bindir" && _bindir="$_prefix/bin"
1058 test -z "$_datadir" && _datadir="$_prefix/share/mplayer"
1059 test -z "$_mandir" && _mandir="$_prefix/share/man"
1060 test -z "$_confdir" && _confdir="$_prefix/etc/mplayer"
1061 test -z "$_libdir" && _libdir="$_prefix/lib"
1062 test -z "$_localedir" && _localedir="$_prefix/share/locale"
1064 for tmpdir in "$TMPDIR" "$TEMPDIR" "/tmp" ; do
1065 test "$tmpdir" && break
1066 done
1068 mplayer_tmpdir="$tmpdir/mplayer-configure-$RANDOM-$$"
1069 mkdir $mplayer_tmpdir || die "Unable to create tmpdir."
1071 TMPLOG="config.log"
1073 rm -f "$TMPLOG"
1074 echo Parameters configure was run with: > "$TMPLOG"
1075 if test -n "$CFLAGS" ; then
1076 echo ${_echo_n} CFLAGS="'$CFLAGS' ${_echo_c}" >> "$TMPLOG"
1078 if test -n "$PKG_CONFIG_PATH" ; then
1079 echo ${_echo_n} PKG_CONFIG_PATH="'$PKG_CONFIG_PATH' ${_echo_c}" >> "$TMPLOG"
1081 echo ./configure $configuration >> "$TMPLOG"
1082 echo >> "$TMPLOG"
1085 echocheck "cross compilation"
1086 echores $_cross_compile
1088 if test $_cross_compile = yes; then
1089 tmp_run() {
1090 return 0
1094 tool_prefix=""
1096 if test $_cross_compile = yes ; then
1097 # Usually cross-compiler prefixes match with the target triplet
1098 test -n "$_target" && tool_prefix="$_target"-
1101 test "$_ranlib" = auto && _ranlib="$tool_prefix"ranlib
1102 test "$_windres" = auto && _windres="$tool_prefix"windres
1103 test "$_ar" = auto && _ar="$tool_prefix"ar
1104 test "$_yasm" = auto && _yasm="$tool_prefix"yasm
1105 test "$_pkg_config" = auto && _pkg_config="$tool_prefix"pkg-config
1107 if test "$_cc" = auto ; then
1108 if test -n "$tool_prefix" ; then
1109 _cc="$tool_prefix"gcc
1110 else
1111 _cc=cc
1115 # Determine our OS name and CPU architecture
1116 if test -z "$_target" ; then
1117 # OS name
1118 system_name=$(uname -s 2>&1)
1119 case "$system_name" in
1120 Linux|FreeBSD|NetBSD|OpenBSD|DragonFly|BSD/OS|Darwin|QNX|GNU|BeOS|MorphOS|AIX|AmigaOS)
1122 Haiku)
1123 system_name=BeOS
1125 GNU/kFreeBSD)
1126 system_name=FreeBSD
1128 HP-UX*)
1129 system_name=HP-UX
1131 [cC][yY][gG][wW][iI][nN]*)
1132 system_name=CYGWIN
1134 MINGW32*)
1135 system_name=MINGW32
1137 OS/2*)
1138 system_name=OS/2
1141 system_name="$system_name-UNKNOWN"
1143 esac
1146 # host's CPU/instruction set
1147 host_arch=$(uname -p 2>&1)
1148 case "$host_arch" in
1149 i386|sparc|ppc|alpha|arm|mips|vax)
1151 powerpc) # Darwin returns 'powerpc'
1152 host_arch=ppc
1154 *) # uname -p on Linux returns 'unknown' for the processor type,
1155 # OpenBSD returns 'Intel Pentium/MMX ("Genuine Intel" 586-class)'
1157 # Maybe uname -m (machine hardware name) returns something we
1158 # recognize.
1160 # x86/x86pc is used by QNX
1161 case "$(uname -m 2>&1)" in
1162 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 ;;
1163 ia64) host_arch=ia64 ;;
1164 macppc|ppc) host_arch=ppc ;;
1165 ppc64) host_arch=ppc64 ;;
1166 alpha) host_arch=alpha ;;
1167 sparc) host_arch=sparc ;;
1168 sparc64) host_arch=sparc64 ;;
1169 parisc*|hppa*|9000*) host_arch=hppa ;;
1170 arm*|zaurus|cats) host_arch=arm ;;
1171 sh3|sh4|sh4a) host_arch=sh ;;
1172 s390) host_arch=s390 ;;
1173 s390x) host_arch=s390x ;;
1174 *mips*) host_arch=mips ;;
1175 vax) host_arch=vax ;;
1176 xtensa*) host_arch=xtensa ;;
1177 *) host_arch=UNKNOWN ;;
1178 esac
1180 esac
1181 else # if test -z "$_target"
1182 for i in 2 3; do
1183 system_name=$(echo $_target | cut -d '-' -f $i)
1184 case "$(echo $system_name | tr A-Z a-z)" in
1185 linux) system_name=Linux ;;
1186 freebsd) system_name=FreeBSD ;;
1187 gnu/kfreebsd) system_name=FreeBSD ;;
1188 netbsd) system_name=NetBSD ;;
1189 bsd/os) system_name=BSD/OS ;;
1190 openbsd) system_name=OpenBSD ;;
1191 dragonfly) system_name=DragonFly ;;
1192 qnx) system_name=QNX ;;
1193 morphos) system_name=MorphOS ;;
1194 amigaos) system_name=AmigaOS ;;
1195 mingw32*) system_name=MINGW32 ;;
1196 *) continue ;;
1197 esac
1198 break
1199 done
1200 # We need to convert underscores so that values like k6-2 and pentium-mmx can be passed
1201 host_arch=$(echo $_target | cut -d '-' -f 1)
1202 if test $(echo $host_arch) != "x86_64" ; then
1203 host_arch=$(echo $host_arch | tr '_' '-')
1207 extra_cflags="-I. $extra_cflags"
1208 _timer=timer-linux.c
1209 _getch=getch2.c
1210 if freebsd ; then
1211 extra_ldflags="$extra_ldflags -L/usr/local/lib"
1212 extra_cflags="$extra_cflags -I/usr/local/include"
1215 if netbsd || dragonfly ; then
1216 extra_ldflags="$extra_ldflags -L/usr/pkg/lib"
1217 extra_cflags="$extra_cflags -I/usr/pkg/include"
1220 if darwin; then
1221 extra_cflags="-mdynamic-no-pic $extra_cflags"
1222 _timer=timer-darwin.c
1225 if aix ; then
1226 extra_ldflags="$extra_ldflags -lC"
1229 if linux ; then
1230 _ranlib='true'
1233 if win32 ; then
1234 _exesuf=".exe"
1235 extra_cflags="$extra_cflags -fno-common"
1236 # -lwinmm is always needed for osdep/timer-win2.c
1237 extra_ldflags="$extra_ldflags -lwinmm"
1238 _pe_executable=yes
1239 _timer=timer-win2.c
1240 _priority=yes
1241 def_dos_paths="#define HAVE_DOS_PATHS 1"
1242 def_priority="#define CONFIG_PRIORITY 1"
1245 if mingw32 ; then
1246 _getch=getch2-win.c
1247 need_shmem=no
1248 extra_cflags="$extra_cflags -D__USE_MINGW_ANSI_STDIO=1"
1251 if amigaos ; then
1252 _select=no
1253 _sighandler=no
1254 _stream_cache=no
1255 def_stream_cache="#undef CONFIG_STREAM_CACHE"
1256 extra_cflags="-DNEWLIB -D__USE_INLINE__ $extra_cflags"
1259 if qnx ; then
1260 extra_ldflags="$extra_ldflags -lph"
1263 TMPC="$mplayer_tmpdir/tmp.c"
1264 TMPEXE="$mplayer_tmpdir/tmp$_exesuf"
1265 TMPH="$mplayer_tmpdir/tmp.h"
1266 TMPS="$mplayer_tmpdir/tmp.S"
1268 if test "$_runtime_cpudetection" = yes && ! x86 && ! ppc; then
1269 die "Runtime CPU detection only works for x86, x86-64 and PPC!"
1273 # Checking CC version...
1274 # Intel C++ Compilers (no autoselect, use CC=/some/binary ./configure)
1275 if test "$(basename $_cc)" = "icc" || test "$(basename $_cc)" = "ecc"; then
1276 echocheck "$_cc version"
1277 cc_vendor=intel
1278 cc_name=$($_cc -V 2>&1 | head -n 1 | cut -d ',' -f 1)
1279 cc_version=$($_cc -V 2>&1 | head -n 1 | cut -d ',' -f 2 | cut -d ' ' -f 3)
1280 _cc_major=$(echo $cc_version | cut -d '.' -f 1)
1281 _cc_minor=$(echo $cc_version | cut -d '.' -f 2)
1282 # TODO verify older icc/ecc compatibility
1283 case $cc_version in
1285 cc_version="v. ?.??, bad"
1286 cc_fail=yes
1288 10.1|11.0|11.1)
1289 cc_version="$cc_version, ok"
1292 cc_version="$cc_version, bad"
1293 cc_fail=yes
1295 esac
1296 echores "$cc_version"
1297 else
1298 for _cc in "$_cc" gcc cc ; do
1299 cc_name_tmp=$($_cc -v 2>&1 | tail -n 1 | cut -d ' ' -f 1)
1300 if test "$cc_name_tmp" = "gcc"; then
1301 cc_name=$cc_name_tmp
1302 echocheck "$_cc version"
1303 cc_vendor=gnu
1304 cc_version=$($_cc -dumpversion 2>&1)
1305 case $cc_version in
1306 2.96*)
1307 cc_fail=yes
1310 _cc_major=$(echo $cc_version | cut -d '.' -f 1)
1311 _cc_minor=$(echo $cc_version | cut -d '.' -f 2)
1312 _cc_mini=$(echo $cc_version | cut -d '.' -f 3)
1314 esac
1315 echores "$cc_version"
1316 break
1318 if $_cc -v 2>&1 | grep -q "clang"; then
1319 echocheck "$_cc version"
1320 cc_vendor=clang
1321 cc_version=$($_cc -dumpversion 2>&1)
1322 res_comment="experimental support only"
1323 echores "clang $cc_version"
1324 break
1326 cc_name_tmp=$($_cc -V 2>&1 | head -n 1 | cut -d ' ' -f 2,3)
1327 done
1328 fi # icc
1329 test "$cc_fail" = yes && die "unsupported compiler version"
1331 echocheck "working compiler"
1332 cflag_check "" || die "Compiler is not functioning correctly. Check your installation and custom CFLAGS $CFLAGS ."
1333 echo "yes"
1335 if test -z "$_target" && x86 ; then
1336 cat > $TMPC << EOF
1337 int main(void) {
1338 int test[(int)sizeof(char *)-7];
1339 return 0;
1342 cc_check && host_arch=x86_64 || host_arch=i386
1345 echo "Detected operating system: $system_name"
1346 echo "Detected host architecture: $host_arch"
1348 # ---
1350 # now that we know what compiler should be used for compilation, try to find
1351 # out which assembler is used by the $_cc compiler
1352 if test "$_as" = auto ; then
1353 _as=$($_cc -print-prog-name=as)
1354 test -z "$_as" && _as=as
1357 if test "$_nm" = auto ; then
1358 _nm=$($_cc -print-prog-name=nm)
1359 test -z "$_nm" && _nm=nm
1362 # XXX: this should be ok..
1363 _cpuinfo="echo"
1365 if test "$_runtime_cpudetection" = no ; then
1367 # Cygwin has /proc/cpuinfo, but only supports Intel CPUs
1368 # FIXME: Remove the cygwin check once AMD CPUs are supported
1369 if test -r /proc/cpuinfo && ! cygwin; then
1370 # Linux with /proc mounted, extract CPU information from it
1371 _cpuinfo="cat /proc/cpuinfo"
1372 elif test -r /compat/linux/proc/cpuinfo && ! x86 ; then
1373 # FreeBSD with Linux emulation /proc mounted,
1374 # extract CPU information from it
1375 # Don't use it on x86 though, it never reports 3Dnow
1376 _cpuinfo="cat /compat/linux/proc/cpuinfo"
1377 elif darwin && ! x86 ; then
1378 # use hostinfo on Darwin
1379 _cpuinfo="hostinfo"
1380 elif aix; then
1381 # use 'lsattr' on AIX
1382 _cpuinfo="lsattr -E -l proc0 -a type"
1383 elif x86; then
1384 # all other OSes try to extract CPU information from a small helper
1385 # program cpuinfo instead
1386 $_cc -o cpuinfo$_exesuf cpuinfo.c
1387 _cpuinfo="./cpuinfo$_exesuf"
1390 if x86 ; then
1391 # gather more CPU information
1392 pname=$($_cpuinfo | grep 'model name' | cut -d ':' -f 2 | head -n 1)
1393 pvendor=$($_cpuinfo | grep 'vendor_id' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1)
1394 pfamily=$($_cpuinfo | grep 'cpu family' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1)
1395 pmodel=$($_cpuinfo | grep -v 'model name' | grep 'model' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1)
1396 pstepping=$($_cpuinfo | grep 'stepping' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1)
1398 exts=$($_cpuinfo | egrep 'features|flags' | cut -d ':' -f 2 | head -n 1)
1400 pparam=$(echo $exts | sed -e s/xmm/sse/ -e s/kni/sse/)
1401 # SSE implies MMX2, but not all SSE processors report the mmxext CPU flag.
1402 pparam=$(echo $pparam | sed -e 's/sse/sse mmxext/')
1404 for ext in $pparam ; do
1405 eval test \"\$_$ext\" = auto 2>/dev/null && eval _$ext=kernel_check
1406 done
1408 echocheck "CPU vendor"
1409 echores "$pvendor ($pfamily:$pmodel:$pstepping)"
1411 echocheck "CPU type"
1412 echores "$pname"
1415 fi # test "$_runtime_cpudetection" = no
1417 if x86 && test "$_runtime_cpudetection" = no ; then
1418 extcheck() {
1419 if test "$1" = kernel_check ; then
1420 echocheck "kernel support of $2"
1421 cat > $TMPC <<EOF
1422 #include <stdlib.h>
1423 #include <signal.h>
1424 static void catch(int sig) { exit(1); }
1425 int main(void) {
1426 signal(SIGILL, catch);
1427 __asm__ volatile ("$3":::"memory"); return 0;
1431 if cc_check && tmp_run ; then
1432 eval _$2=yes
1433 echores "yes"
1434 _optimizing="$_optimizing $2"
1435 return 0
1436 else
1437 eval _$2=no
1438 echores "failed"
1439 echo "It seems that your kernel does not correctly support $2."
1440 echo "To use $2 extensions in MPlayer, you have to upgrade/recompile your kernel!"
1441 return 1
1444 return 0
1447 extcheck $_mmx "mmx" "emms"
1448 extcheck $_mmxext "mmxext" "sfence"
1449 extcheck $_3dnow "3dnow" "femms"
1450 extcheck $_3dnowext "3dnowext" "pswapd %%mm0, %%mm0"
1451 extcheck $_sse "sse" "xorps %%xmm0, %%xmm0" || _gcc3_ext="$_gcc3_ext -mno-sse"
1452 extcheck $_sse2 "sse2" "xorpd %%xmm0, %%xmm0" || _gcc3_ext="$_gcc3_ext -mno-sse2"
1453 extcheck $_ssse3 "ssse3" "pabsd %%xmm0, %%xmm0"
1454 extcheck $_cmov "cmov" "cmovb %%eax, %%ebx"
1456 if test "$_gcc3_ext" != ""; then
1457 # if we had to disable sse/sse2 because the active kernel does not
1458 # support this instruction set extension, we also have to tell
1459 # gcc3 to not generate sse/sse2 instructions for normal C code
1460 cflag_check $_march $_gcc3_ext && _march="$_march $_gcc3_ext"
1466 def_fast_64bit='#define HAVE_FAST_64BIT 0'
1467 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 0'
1468 arch_all='X86 IA64 SPARC ARM AVR32 SH4 PPC ALPHA MIPS PA_RISC S390 S390X VAX BFIN XTENSA TOMI GENERIC'
1469 subarch_all='X86_32 X86_64 PPC64'
1470 case "$host_arch" in
1471 i[3-9]86|x86|x86pc|k5|k6|k6-2|k6-3|pentium*|athlon*|i586-i686)
1472 arch='x86'
1473 subarch='x86_32'
1474 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
1475 iproc=486
1476 proc=i486
1479 if test "$_runtime_cpudetection" = no ; then
1480 case "$pvendor" in
1481 AuthenticAMD)
1482 case "$pfamily" in
1483 3) proc=i386 iproc=386 ;;
1484 4) proc=i486 iproc=486 ;;
1485 5) iproc=586 # LGB: models are: K5/SSA5 K5 K5 K5 ? ? K6 K6 K6-2 K6-3
1486 # K6 model 13 are the K6-2+ and K6-III+, only differing in cache size.
1487 if test "$pmodel" -eq 9 -o "$pmodel" -eq 13; then
1488 proc=k6-3
1489 elif test "$pmodel" -eq 5 -o "$pmodel" -eq 10; then
1490 proc=geode
1491 elif test "$pmodel" -ge 8; then
1492 proc=k6-2
1493 elif test "$pmodel" -ge 6; then
1494 proc=k6
1495 else
1496 proc=i586
1499 6) iproc=686
1500 # It's a bit difficult to determine the correct type of Family 6
1501 # AMD CPUs just from their signature. Instead, we check directly
1502 # whether it supports SSE.
1503 if test "$_sse" = yes; then
1504 # gcc treats athlon-xp, athlon-4 and athlon-mp similarly.
1505 proc=athlon-xp
1506 else
1507 # Again, gcc treats athlon and athlon-tbird similarly.
1508 proc=athlon
1511 15) iproc=686
1512 # k8 cpu-type only supported in gcc >= 3.4.0, but that will be
1513 # caught and remedied in the optimization tests below.
1514 proc=k8
1517 *) proc=amdfam10 iproc=686
1518 test $_fast_clz = "auto" && _fast_clz=yes
1520 esac
1522 GenuineIntel)
1523 case "$pfamily" in
1524 3) proc=i386 iproc=386 ;;
1525 4) proc=i486 iproc=486 ;;
1526 5) iproc=586
1527 if test "$pmodel" -eq 4 || test "$pmodel" -eq 8; then
1528 proc=pentium-mmx # 4 is desktop, 8 is mobile
1529 else
1530 proc=i586
1533 6) iproc=686
1534 if test "$pmodel" -ge 15; then
1535 proc=core2
1536 elif test "$pmodel" -eq 9 -o "$pmodel" -ge 13; then
1537 proc=pentium-m
1538 elif test "$pmodel" -ge 7; then
1539 proc=pentium3
1540 elif test "$pmodel" -ge 3; then
1541 proc=pentium2
1542 else
1543 proc=i686
1545 test $_fast_clz = "auto" && _fast_clz=yes
1547 15) iproc=686
1548 # A nocona in 32-bit mode has no more capabilities than a prescott.
1549 if test "$pmodel" -ge 3; then
1550 proc=prescott
1551 else
1552 proc=pentium4
1553 test $_fast_clz = "auto" && _fast_clz=yes
1555 test $_fast_cmov = "auto" && _fast_cmov=no
1557 *) proc=prescott iproc=686 ;;
1558 esac
1560 CentaurHauls)
1561 case "$pfamily" in
1562 5) iproc=586
1563 if test "$pmodel" -ge 8; then
1564 proc=winchip2
1565 elif test "$pmodel" -ge 4; then
1566 proc=winchip-c6
1567 else
1568 proc=i586
1571 6) iproc=686
1572 if test "$pmodel" -ge 9; then
1573 proc=c3-2
1574 else
1575 proc=c3
1576 iproc=586
1579 *) proc=i686 iproc=i686 ;;
1580 esac
1582 unknown)
1583 case "$pfamily" in
1584 3) proc=i386 iproc=386 ;;
1585 4) proc=i486 iproc=486 ;;
1586 *) proc=i586 iproc=586 ;;
1587 esac
1590 proc=i586 iproc=586 ;;
1591 esac
1592 test $_fast_clz = "auto" && _fast_clz=no
1593 fi # test "$_runtime_cpudetection" = no
1596 # check that gcc supports our CPU, if not, fall back to earlier ones
1597 # LGB: check -mcpu and -march swithing step by step with enabling
1598 # to fall back till 386.
1600 # gcc >= 3.4.0 doesn't support -mcpu, we have to use -mtune instead
1602 if [ "$cc_vendor" = "gnu" ] && ([ "$_cc_major" -gt 3 ] || ( [ "$_cc_major" = 3 ] && [ "$_cc_minor" -ge 4 ])) ; then
1603 cpuopt=-mtune
1604 else
1605 cpuopt=-mcpu
1608 echocheck "GCC & CPU optimization abilities"
1609 if test "$_runtime_cpudetection" = no ; then
1610 if test $cc_vendor != "intel" && test $cc_vendor != "clang" ; then
1611 cflag_check -march=native && proc=native
1613 if test "$proc" = "amdfam10"; then
1614 cflag_check -march=$proc $cpuopt=$proc || proc=k8
1616 if test "$proc" = "k8"; then
1617 cflag_check -march=$proc $cpuopt=$proc || proc=athlon-xp
1619 if test "$proc" = "athlon-xp"; then
1620 cflag_check -march=$proc $cpuopt=$proc || proc=athlon
1622 if test "$proc" = "k6-3" || test "$proc" = "k6-2"; then
1623 cflag_check -march=$proc $cpuopt=$proc || proc=k6
1625 if test "$proc" = "k6" || test "$proc" = "c3"; then
1626 if ! cflag_check -march=$proc $cpuopt=$proc; then
1627 if cflag_check -march=i586 $cpuopt=i686; then
1628 proc=i586-i686
1629 else
1630 proc=i586
1634 if test "$proc" = "prescott" ; then
1635 cflag_check -march=$proc $cpuopt=$proc || proc=pentium4
1637 if test "$proc" = "core2" ; then
1638 cflag_check -march=$proc $cpuopt=$proc || proc=pentium-m
1640 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
1641 cflag_check -march=$proc $cpuopt=$proc || proc=i686
1643 if test "$proc" = "i686" || test "$proc" = "pentium-mmx" || test "$proc" = "winchip-c6" || test "$proc" = "winchip2"; then
1644 cflag_check -march=$proc $cpuopt=$proc || proc=i586
1646 if test "$proc" = "i586"; then
1647 cflag_check -march=$proc $cpuopt=$proc || proc=i486
1649 if test "$proc" = "i486" ; then
1650 cflag_check -march=$proc $cpuopt=$proc || proc=i386
1652 if test "$proc" = "i386" ; then
1653 cflag_check -march=$proc $cpuopt=$proc || proc=error
1655 if test "$proc" = "error" ; then
1656 echores "CPU optimization disabled. CPU not recognized or your compiler is too old."
1657 _mcpu=""
1658 _march=""
1659 _optimizing=""
1660 elif test "$proc" = "i586-i686"; then
1661 _march="-march=i586"
1662 _mcpu="$cpuopt=i686"
1663 _optimizing="$proc"
1664 else
1665 _march="-march=$proc"
1666 _mcpu="$cpuopt=$proc"
1667 _optimizing="$proc"
1669 else # if test "$_runtime_cpudetection" = no
1670 _mcpu="$cpuopt=generic"
1671 # at least i486 required, for bswap instruction
1672 _march="-march=i486"
1673 cflag_check $_mcpu || _mcpu="$cpuopt=i686"
1674 cflag_check $_mcpu || _mcpu=""
1675 cflag_check $_march $_mcpu || _march=""
1678 ## Gabucino : --target takes effect here (hopefully...) by overwriting
1679 ## autodetected mcpu/march parameters
1680 if test "$_target" ; then
1681 # TODO: it may be a good idea to check GCC and fall back in all cases
1682 if test "$host_arch" = "i586-i686"; then
1683 _march="-march=i586"
1684 _mcpu="$cpuopt=i686"
1685 else
1686 _march="-march=$host_arch"
1687 _mcpu="$cpuopt=$host_arch"
1690 proc="$host_arch"
1692 case "$proc" in
1693 i386) iproc=386 ;;
1694 i486) iproc=486 ;;
1695 i586|k5|k6|k6-2|k6-3|pentium|pentium-mmx) iproc=586 ;;
1696 i686|athlon*|pentium*) iproc=686 ;;
1697 *) iproc=586 ;;
1698 esac
1701 if test $_cmov = "yes" && test $_fast_cmov = "auto" ; then
1702 _fast_cmov="yes"
1703 else
1704 _fast_cmov="no"
1706 test $_fast_clz = "auto" && _fast_clz=yes
1708 echores "$proc"
1711 ia64)
1712 arch='ia64'
1713 def_fast_64bit='#define HAVE_FAST_64BIT 1'
1714 iproc='ia64'
1717 x86_64|amd64)
1718 arch='x86'
1719 subarch='x86_64'
1720 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
1721 def_fast_64bit='#define HAVE_FAST_64BIT 1'
1722 iproc='x86_64'
1724 # gcc >= 3.4.0 doesn't support -mcpu, we have to use -mtune instead
1725 if test "$cc_vendor" = "gnu" && test "$_cc_major" -gt 3 -o "$_cc_major" -eq 3 -a "$_cc_minor" -ge 4 ; then
1726 cpuopt=-mtune
1727 else
1728 cpuopt=-mcpu
1730 if test "$_runtime_cpudetection" = no ; then
1731 case "$pvendor" in
1732 AuthenticAMD)
1733 case "$pfamily" in
1734 15) proc=k8
1735 test $_fast_clz = "auto" && _fast_clz=no
1737 *) proc=amdfam10;;
1738 esac
1740 GenuineIntel)
1741 case "$pfamily" in
1742 6) proc=core2;;
1744 # 64-bit prescotts exist, but as far as GCC is concerned they
1745 # have the same capabilities as a nocona.
1746 proc=nocona
1747 test $_fast_cmov = "auto" && _fast_cmov=no
1748 test $_fast_clz = "auto" && _fast_clz=no
1750 esac
1753 proc=error;;
1754 esac
1755 fi # test "$_runtime_cpudetection" = no
1757 echocheck "GCC & CPU optimization abilities"
1758 # This is a stripped-down version of the i386 fallback.
1759 if test "$_runtime_cpudetection" = no ; then
1760 if test $cc_vendor != "intel" && test $cc_vendor != "clang" ; then
1761 cflag_check -march=native && proc=native
1763 # --- AMD processors ---
1764 if test "$proc" = "amdfam10"; then
1765 cflag_check -march=$proc $cpuopt=$proc || proc=k8
1767 if test "$proc" = "k8"; then
1768 cflag_check -march=$proc $cpuopt=$proc || proc=athlon-xp
1770 # This will fail if gcc version < 3.3, which is ok because earlier
1771 # versions don't really support 64-bit on amd64.
1772 # Is this a valid assumption? -Corey
1773 if test "$proc" = "athlon-xp"; then
1774 cflag_check -march=$proc $cpuopt=$proc || proc=error
1776 # --- Intel processors ---
1777 if test "$proc" = "core2"; then
1778 cflag_check -march=$proc $cpuopt=$proc || proc=x86-64
1780 if test "$proc" = "x86-64"; then
1781 cflag_check -march=$proc $cpuopt=$proc || proc=nocona
1783 if test "$proc" = "nocona"; then
1784 cflag_check -march=$proc $cpuopt=$proc || proc=pentium4
1786 if test "$proc" = "pentium4"; then
1787 cflag_check -march=$proc $cpuopt=$proc || proc=error
1790 _march="-march=$proc"
1791 _mcpu="$cpuopt=$proc"
1792 if test "$proc" = "error" ; then
1793 echores "CPU optimization disabled. CPU not recognized or your compiler is too old."
1794 _mcpu=""
1795 _march=""
1797 else # if test "$_runtime_cpudetection" = no
1798 # x86-64 is an undocumented option, an intersection of k8 and nocona.
1799 _march="-march=x86-64"
1800 _mcpu="$cpuopt=generic"
1801 cflag_check $_mcpu || _mcpu="x86-64"
1802 cflag_check $_mcpu || _mcpu=""
1803 cflag_check $_march $_mcpu || _march=""
1806 _optimizing="$proc"
1807 test $_fast_cmov = "auto" && _fast_cmov=yes
1808 test $_fast_clz = "auto" && _fast_clz=yes
1810 echores "$proc"
1813 sparc|sparc64)
1814 arch='sparc'
1815 iproc='sparc'
1816 if test "$host_arch" = "sparc64" ; then
1817 _vis='yes'
1818 proc='ultrasparc'
1819 def_fast_64bit='#define HAVE_FAST_64BIT 1'
1820 else
1821 proc=v8
1823 _mcpu="-mcpu=$proc"
1824 _optimizing="$proc"
1827 arm*)
1828 arch='arm'
1829 iproc='arm'
1832 avr32)
1833 arch='avr32'
1834 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
1835 iproc='avr32'
1836 test $_fast_clz = "auto" && _fast_clz=yes
1839 sh|sh4)
1840 arch='sh4'
1841 iproc='sh4'
1844 ppc|ppc64|powerpc|powerpc64)
1845 arch='ppc'
1846 def_dcbzl='#define HAVE_DCBZL 0'
1847 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
1848 iproc='ppc'
1850 if test "$host_arch" = "ppc64" -o "$host_arch" = "powerpc64" ; then
1851 subarch='ppc64'
1852 def_fast_64bit='#define HAVE_FAST_64BIT 1'
1854 echocheck "CPU type"
1855 case $system_name in
1856 Linux)
1857 proc=$($_cpuinfo | grep 'cpu' | cut -d ':' -f 2 | cut -d ',' -f 1 | cut -b 2- | head -n 1)
1858 if test -n "$($_cpuinfo | grep altivec)"; then
1859 test $_altivec = auto && _altivec=yes
1862 Darwin)
1863 proc=$($_cpuinfo | grep "Processor type" | cut -f 3 -d ' ' | sed 's/ppc//')
1864 if [ $(sysctl -n hw.vectorunit) -eq 1 -o \
1865 "$(sysctl -n hw.optional.altivec 2> /dev/null)" = "1" ]; then
1866 test $_altivec = auto && _altivec=yes
1869 NetBSD)
1870 # only gcc 3.4 works reliably with AltiVec code under NetBSD
1871 case $cc_version in
1872 2*|3.0*|3.1*|3.2*|3.3*)
1875 if [ $(sysctl -n machdep.altivec) -eq 1 ]; then
1876 test $_altivec = auto && _altivec=yes
1879 esac
1881 AIX)
1882 proc=$($_cpuinfo | grep 'type' | cut -f 2 -d ' ' | sed 's/PowerPC_//')
1884 esac
1885 if test "$_altivec" = yes; then
1886 echores "$proc altivec"
1887 else
1888 _altivec=no
1889 echores "$proc"
1892 echocheck "GCC & CPU optimization abilities"
1894 if test -n "$proc"; then
1895 case "$proc" in
1896 601) _march='-mcpu=601' _mcpu='-mtune=601' ;;
1897 603) _march='-mcpu=603' _mcpu='-mtune=603' ;;
1898 603e|603ev) _march='-mcpu=603e' _mcpu='-mtune=603e' ;;
1899 604|604e|604r|604ev) _march='-mcpu=604' _mcpu='-mtune=604' ;;
1900 740|740/750|745/755) _march='-mcpu=740' _mcpu='-mtune=740' ;;
1901 750|750CX) _march='-mcpu=750' _mcpu='-mtune=750' ;;
1902 POWER) _march='-mcpu=power' _mcpu='-mtune=power' ;;
1903 POWER2) _march='-mcpu=power2' _mcpu='-mtune=power2' ;;
1904 POWER3) _march='-mcpu=power3' _mcpu='-mtune=power3' ;;
1905 *) ;;
1906 esac
1907 # gcc 3.1(.1) and up supports 7400 and 7450
1908 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "1" || test "$_cc_major" -ge "4"; then
1909 case "$proc" in
1910 7400*|7410*) _march='-mcpu=7400' _mcpu='-mtune=7400' ;;
1911 7447*|7450*|7455*) _march='-mcpu=7450' _mcpu='-mtune=7450' ;;
1912 *) ;;
1913 esac
1915 # gcc 3.2 and up supports 970
1916 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "3" || test "$_cc_major" -ge "4"; then
1917 case "$proc" in
1918 970*|PPC970*) _march='-mcpu=970' _mcpu='-mtune=970'
1919 def_dcbzl='#define HAVE_DCBZL 1' ;;
1920 *) ;;
1921 esac
1923 # gcc 3.3 and up supports POWER4
1924 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "3" || test "$_cc_major" -ge "4"; then
1925 case "$proc" in
1926 POWER4) _march='-mcpu=power4' _mcpu='-mtune=power4' ;;
1927 *) ;;
1928 esac
1930 # gcc 3.4 and up supports 440*
1931 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "4" || test "$_cc_major" -ge "4"; then
1932 case "$proc" in
1933 440EP*) _march='-mcpu=440fp' _mcpu='-mtune=440fp' ;;
1934 440G* ) _march='-mcpu=440' _mcpu='-mtune=440' ;;
1935 *) ;;
1936 esac
1938 # gcc 4.0 and up supports POWER5
1939 if test "$_cc_major" -ge "4"; then
1940 case "$proc" in
1941 POWER5*) _march='-mcpu=power5' _mcpu='-mtune=power5' ;;
1942 *) ;;
1943 esac
1947 if test -n "$_mcpu"; then
1948 _optimizing=$(echo $_mcpu | cut -c 8-)
1949 echores "$_optimizing"
1950 else
1951 echores "none"
1954 test $_fast_clz = "auto" && _fast_clz=yes
1958 alpha*)
1959 arch='alpha'
1960 iproc='alpha'
1961 def_fast_64bit='#define HAVE_FAST_64BIT 1'
1963 echocheck "CPU type"
1964 cat > $TMPC << EOF
1965 int main(void) {
1966 unsigned long ver, mask;
1967 __asm__ ("implver %0" : "=r" (ver));
1968 __asm__ ("amask %1, %0" : "=r" (mask) : "r" (-1));
1969 printf("%ld-%x\n", ver, ~mask);
1970 return 0;
1973 $_cc -o "$TMPEXE" "$TMPC"
1974 case $("$TMPEXE") in
1976 0-0) proc="ev4"; _mvi="0";;
1977 1-0) proc="ev5"; _mvi="0";;
1978 1-1) proc="ev56"; _mvi="0";;
1979 1-101) proc="pca56"; _mvi="1";;
1980 2-303) proc="ev6"; _mvi="1";;
1981 2-307) proc="ev67"; _mvi="1";;
1982 2-1307) proc="ev68"; _mvi="1";;
1983 esac
1984 echores "$proc"
1986 echocheck "GCC & CPU optimization abilities"
1987 if test "$proc" = "ev68" ; then
1988 cc_check -mcpu=$proc || proc=ev67
1990 if test "$proc" = "ev67" ; then
1991 cc_check -mcpu=$proc || proc=ev6
1993 _mcpu="-mcpu=$proc"
1994 echores "$proc"
1996 test $_fast_clz = "auto" && _fast_clz=yes
1998 _optimizing="$proc"
2001 mips*)
2002 arch='mips'
2003 iproc='mips'
2005 test $_fast_clz = "auto" && _fast_clz=yes
2009 hppa)
2010 arch='pa_risc'
2011 iproc='PA-RISC'
2014 s390)
2015 arch='s390'
2016 iproc='390'
2019 s390x)
2020 arch='s390x'
2021 iproc='390x'
2024 vax)
2025 arch='vax'
2026 iproc='vax'
2029 xtensa)
2030 arch='xtensa'
2031 iproc='xtensa'
2034 generic)
2035 arch='generic'
2039 echo "The architecture of your CPU ($host_arch) is not supported by this configure script"
2040 echo "It seems nobody has ported MPlayer to your OS or CPU type yet."
2041 die "unsupported architecture $host_arch"
2043 esac # case "$host_arch" in
2045 if test "$_runtime_cpudetection" = yes ; then
2046 if x86 ; then
2047 test "$_cmov" != no && _cmov=yes
2048 x86_32 && _cmov=no
2049 test "$_mmx" != no && _mmx=yes
2050 test "$_3dnow" != no && _3dnow=yes
2051 test "$_3dnowext" != no && _3dnowext=yes
2052 test "$_mmxext" != no && _mmxext=yes
2053 test "$_sse" != no && _sse=yes
2054 test "$_sse2" != no && _sse2=yes
2055 test "$_ssse3" != no && _ssse3=yes
2057 if ppc; then
2058 _altivec=yes
2063 # endian testing
2064 echocheck "byte order"
2065 if test "$_big_endian" = auto ; then
2066 cat > $TMPC <<EOF
2067 short ascii_name[] = {
2068 'M' << 8 | 'P', 'l' << 8 | 'a', 'y' << 8 | 'e', 'r' << 8 | 'B',
2069 'i' << 8 | 'g', 'E' << 8 | 'n', 'd' << 8 | 'i', 'a' << 8 | 'n', 0 };
2070 int main(void) { return (long)ascii_name; }
2072 if cc_check ; then
2073 if strings $TMPEXE | grep -q -l MPlayerBigEndian ; then
2074 _big_endian=yes
2075 else
2076 _big_endian=no
2078 else
2079 echo ${_echo_n} "failed to autodetect byte order, defaulting to ${_echo_c}"
2082 if test "$_big_endian" = yes ; then
2083 _byte_order='big-endian'
2084 def_words_endian='#define WORDS_BIGENDIAN 1'
2085 def_bigendian='#define HAVE_BIGENDIAN 1'
2086 else
2087 _byte_order='little-endian'
2088 def_words_endian='#undef WORDS_BIGENDIAN'
2089 def_bigendian='#define HAVE_BIGENDIAN 0'
2091 echores "$_byte_order"
2094 echocheck "extern symbol prefix"
2095 cat > $TMPC << EOF
2096 int ff_extern;
2098 cc_check -c || die "Symbol mangling check failed."
2099 sym=$($_nm -P -g $TMPEXE)
2100 extern_prefix=${sym%%ff_extern*}
2101 def_extern_asm="#define EXTERN_ASM $extern_prefix"
2102 def_extern_prefix="#define EXTERN_PREFIX \"$extern_prefix\""
2103 echores $extern_prefix
2106 echocheck "assembler support of -pipe option"
2107 # -I. helps to detect compilers that just misunderstand -pipe like Sun C
2108 cflag_check -pipe -I. && _pipe="-pipe" && echores "yes" || echores "no"
2111 if darwin && test "$cc_vendor" = "gnu" ; then
2112 echocheck "GCC support of -mstackrealign"
2113 # GCC 4.2 and some earlier Apple versions support this flag on x86. Since
2114 # Mac OS X/Intel has an ABI different from Windows this is needed to avoid
2115 # crashes when loading Win32 DLLs. Unfortunately some gcc versions create
2116 # wrong code with this flag, but this can be worked around by adding
2117 # -fno-unit-at-a-time as described in the blog post at
2118 # http://www.dribin.org/dave/blog/archives/2006/12/05/missing_third_param/
2119 cat > $TMPC << EOF
2120 __attribute__((noinline)) static int foo3(int i1, int i2, int i3) { return i3; }
2121 int main(void) { return foo3(1, 2, 3) == 3 ? 0 : 1; }
2123 cc_check -O2 -mstackrealign && tmp_run && cflags_stackrealign=-mstackrealign
2124 test -z "$cflags_stackrealign" && cc_check -O2 -mstackrealign -fno-unit-at-a-time &&
2125 tmp_run && cflags_stackrealign="-mstackrealign -fno-unit-at-a-time"
2126 test -n "$cflags_stackrealign" && echores "yes" || echores "no"
2127 fi # if darwin && test "$cc_vendor" = "gnu" ; then
2130 # Checking for CFLAGS
2131 _install_strip="-s"
2132 if test "$_profile" != "" || test "$_debug" != "" ; then
2133 _install_strip=
2135 if test -z "$CFLAGS" ; then
2136 if test "$cc_vendor" = "intel" ; then
2137 CFLAGS="-O2 $_debug $_profile $_march $_mcpu $_pipe -fomit-frame-pointer"
2138 WARNFLAGS="-wd167 -wd556 -wd144"
2139 elif test "$cc_vendor" = "clang"; then
2140 CFLAGS="-O2 $_debug $_profile $_march $_pipe"
2141 WARNFLAGS="-Wall -Wno-switch-enum -Wno-logical-op-parentheses -Wpointer-arith -Wundef -Wno-pointer-sign -Wmissing-prototypes"
2142 ERRORFLAGS="-Werror=implicit-function-declaration"
2143 elif test "$cc_vendor" != "gnu" ; then
2144 CFLAGS="-O2 $_debug $_profile $_march $_mcpu $_pipe"
2145 else
2146 CFLAGS="-O2 $_debug $_profile $_march $_mcpu $_pipe -ffast-math -fomit-frame-pointer"
2147 WARNFLAGS="-Wall -Wno-switch -Wno-parentheses -Wpointer-arith -Wredundant-decls"
2148 ERRORFLAGS="-Werror-implicit-function-declaration"
2149 extra_ldflags="$extra_ldflags -ffast-math"
2151 else
2152 warn_cflags=yes
2155 if darwin && test "$cc_vendor" = "gnu" ; then
2156 extra_cflags="-falign-loops=16 -shared-libgcc $extra_cflags"
2159 if test "$cc_vendor" = "gnu" ; then
2160 cflag_check -Wundef && WARNFLAGS="-Wundef $WARNFLAGS"
2161 # -std=gnu99 is not a warning flag but is placed in WARN_CFLAGS because
2162 # that's the only variable specific to C now, and this option is not valid
2163 # for C++.
2164 cflag_check -std=gnu99 && WARN_CFLAGS="-std=gnu99 $WARN_CFLAGS"
2165 cflag_check -Wno-pointer-sign && WARN_CFLAGS="-Wno-pointer-sign $WARN_CFLAGS"
2166 cflag_check -Wdisabled-optimization && WARN_CFLAGS="-Wdisabled-optimization $WARN_CFLAGS"
2167 cflag_check -Wmissing-prototypes && WARN_CFLAGS="-Wmissing-prototypes $WARN_CFLAGS"
2168 cflag_check -Wstrict-prototypes && WARN_CFLAGS="-Wstrict-prototypes $WARN_CFLAGS"
2169 else
2170 CFLAGS="-D_ISOC99_SOURCE -D_BSD_SOURCE $CFLAGS"
2173 cflag_check -mno-omit-leaf-frame-pointer && cflags_no_omit_leaf_frame_pointer="-mno-omit-leaf-frame-pointer"
2174 cflag_check -MD -MP && DEPFLAGS="-MD -MP"
2177 if test -n "$LDFLAGS" ; then
2178 extra_ldflags="$extra_ldflags $LDFLAGS"
2179 warn_cflags=yes
2180 elif test "$cc_vendor" = "intel" ; then
2181 extra_ldflags="$extra_ldflags -i-static"
2183 if test -n "$CPPFLAGS" ; then
2184 extra_cflags="$extra_cflags $CPPFLAGS"
2185 warn_cflags=yes
2190 if x86_32 ; then
2191 # Checking assembler (_as) compatibility...
2192 # Added workaround for older as that reads from stdin by default - atmos
2193 as_version=$(echo '' | $_as -version 2>&1 | sed -n 's/^.*assembler \(version \)*\([0-9.]*\).*$/\2/p')
2194 echocheck "assembler ($_as $as_version)"
2196 _pref_as_version='2.9.1'
2197 echo 'nop' > $TMPS
2198 if test "$_mmx" = yes ; then
2199 echo 'emms' >> $TMPS
2201 if test "$_3dnow" = yes ; then
2202 _pref_as_version='2.10.1'
2203 echo 'femms' >> $TMPS
2205 if test "$_3dnowext" = yes ; then
2206 _pref_as_version='2.10.1'
2207 echo 'pswapd %mm0, %mm0' >> $TMPS
2209 if test "$_mmxext" = yes ; then
2210 _pref_as_version='2.10.1'
2211 echo 'movntq %mm0, (%eax)' >> $TMPS
2213 if test "$_sse" = yes ; then
2214 _pref_as_version='2.10.1'
2215 echo 'xorps %xmm0, %xmm0' >> $TMPS
2217 #if test "$_sse2" = yes ; then
2218 # _pref_as_version='2.11'
2219 # echo 'xorpd %xmm0, %xmm0' >> $TMPS
2221 if test "$_cmov" = yes ; then
2222 _pref_as_version='2.10.1'
2223 echo 'cmovb %eax, %ebx' >> $TMPS
2225 if test "$_ssse3" = yes ; then
2226 _pref_as_version='2.16.92'
2227 echo 'pabsd %xmm0, %xmm1' >> $TMPS
2229 $_as $TMPS -o $TMPEXE > /dev/null 2>&1 || as_verc_fail=yes
2231 if test "$as_verc_fail" != yes ; then
2232 echores "ok"
2233 else
2234 res_comment="Upgrade binutils to ${_pref_as_version} or use --disable-ssse3 etc."
2235 echores "failed"
2236 die "obsolete binutils version"
2239 fi #if x86_32
2242 echocheck "PIC"
2243 pic=no
2244 cat > $TMPC << EOF
2245 int main(void) {
2246 #if !(defined(__PIC__) || defined(__pic__) || defined(PIC))
2247 #error PIC not enabled
2248 #endif
2249 return 0;
2252 cc_check && pic=yes && extra_cflags="$extra_cflags -DPIC"
2253 echores $pic
2256 if x86 ; then
2258 echocheck ".align is a power of two"
2259 if test "$_asmalign_pot" = auto ; then
2260 _asmalign_pot=no
2261 inline_asm_check '".align 3"' && _asmalign_pot=yes
2263 if test "$_asmalign_pot" = "yes" ; then
2264 def_asmalign_pot='#define ASMALIGN(ZEROBITS) ".align " #ZEROBITS "\n\t"'
2265 else
2266 def_asmalign_pot='#define ASMALIGN(ZEROBITS) ".align 1<<" #ZEROBITS "\n\t"'
2268 echores $_asmalign_pot
2271 echocheck "ebx availability"
2272 ebx_available=no
2273 def_ebx_available='#define HAVE_EBX_AVAILABLE 0'
2274 cat > $TMPC << EOF
2275 int main(void) {
2276 int x;
2277 __asm__ volatile(
2278 "xor %0, %0"
2279 :"=b"(x)
2280 // just adding ebx to clobber list seems unreliable with some
2281 // compilers, e.g. Haiku's gcc 2.95
2283 // and the above check does not work for OSX 64 bit...
2284 __asm__ volatile("":::"%ebx");
2285 return 0;
2288 cc_check && ebx_available=yes && def_ebx_available='#define HAVE_EBX_AVAILABLE 1'
2289 echores $ebx_available
2292 echocheck "yasm"
2293 if test -z "$YASMFLAGS" ; then
2294 if darwin ; then
2295 x86_64 && objformat="macho64" || objformat="macho"
2296 elif win32 ; then
2297 objformat="win32"
2298 else
2299 objformat="elf"
2301 # currently tested for Linux x86, x86_64
2302 YASMFLAGS="-f $objformat"
2303 x86_64 && YASMFLAGS="$YASMFLAGS -DARCH_X86_64 -m amd64"
2304 test "$pic" = "yes" && YASMFLAGS="$YASMFLAGS -DPIC"
2305 case "$objformat" in
2306 elf) test $_debug && YASMFLAGS="$YASMFLAGS -g dwarf2" ;;
2307 *) YASMFLAGS="$YASMFLAGS -DPREFIX" ;;
2308 esac
2309 else
2310 warn_cflags=yes
2313 echo "pabsw xmm0, xmm0" > $TMPS
2314 yasm_check || _yasm=""
2315 if test $_yasm ; then
2316 def_yasm='#define HAVE_YASM 1'
2317 have_yasm="yes"
2318 echores "$_yasm"
2319 else
2320 def_yasm='#define HAVE_YASM 0'
2321 have_yasm="no"
2322 echores "no"
2325 echocheck "bswap"
2326 def_bswap='#define HAVE_BSWAP 0'
2327 echo 'bswap %eax' > $TMPS
2328 $_as $TMPS -o $TMPEXE > /dev/null 2>&1 && def_bswap='#define HAVE_BSWAP 1' && bswap=yes || bswap=no
2329 echores "$bswap"
2330 fi #if x86
2333 #FIXME: This should happen before the check for CFLAGS..
2334 def_altivec_h='#define HAVE_ALTIVEC_H 0'
2335 if ppc && ( test "$_altivec" = yes || test "$_runtime_cpudetection" = yes ) ; then
2337 # check if AltiVec is supported by the compiler, and how to enable it
2338 echocheck "GCC AltiVec flags"
2339 if $(cflag_check -maltivec -mabi=altivec) ; then
2340 _altivec_gcc_flags="-maltivec -mabi=altivec"
2341 # check if <altivec.h> should be included
2342 if $(header_check altivec.h $_altivec_gcc_flags) ; then
2343 def_altivec_h='#define HAVE_ALTIVEC_H 1'
2344 inc_altivec_h='#include <altivec.h>'
2345 else
2346 if $(cflag_check -faltivec) ; then
2347 _altivec_gcc_flags="-faltivec"
2348 else
2349 _altivec=no
2350 _altivec_gcc_flags="none, AltiVec disabled"
2354 echores "$_altivec_gcc_flags"
2356 # check if the compiler supports braces for vector declarations
2357 cat > $TMPC << EOF
2358 $inc_altivec_h
2359 int main(void) { (vector int) {1}; return 0; }
2361 cc_check $_altivec_gcc_flags || die "You need a compiler that supports {} in AltiVec vector declarations."
2363 # Disable runtime cpudetection if we cannot generate AltiVec code or
2364 # AltiVec is disabled by the user.
2365 test "$_runtime_cpudetection" = yes && test "$_altivec" = no \
2366 && _runtime_cpudetection=no
2368 # Show that we are optimizing for AltiVec (if enabled and supported).
2369 test "$_runtime_cpudetection" = no && test "$_altivec" = yes \
2370 && _optimizing="$_optimizing altivec"
2372 # If AltiVec is enabled, make sure the correct flags turn up in CFLAGS.
2373 test "$_altivec" = yes && CFLAGS="$CFLAGS $_altivec_gcc_flags"
2376 if ppc ; then
2377 def_xform_asm='#define HAVE_XFORM_ASM 0'
2378 xform_asm=no
2379 echocheck "XFORM ASM support"
2380 inline_asm_check '"lwzx %1, %y0" :: "Z"(*(int*)0), "r"(0)' &&
2381 xform_asm=yes && def_xform_asm='#define HAVE_XFORM_ASM 1'
2382 echores "$xform_asm"
2385 if arm ; then
2386 echocheck "ARMv5TE (Enhanced DSP Extensions)"
2387 if test $_armv5te = "auto" ; then
2388 _armv5te=no
2389 inline_asm_check '"qadd r0, r0, r0"' && _armv5te=yes
2391 echores "$_armv5te"
2393 test $_armv5te = "yes" && test $_fast_clz = "auto" && _fast_clz=yes
2395 echocheck "ARMv6 (SIMD instructions)"
2396 if test $_armv6 = "auto" ; then
2397 _armv6=no
2398 inline_asm_check '"sadd16 r0, r0, r0"' && _armv6=yes
2400 echores "$_armv6"
2402 echocheck "ARMv6t2 (SIMD instructions)"
2403 if test $_armv6t2 = "auto" ; then
2404 _armv6t2=no
2405 inline_asm_check '"movt r0, #0"' && _armv6t2=yes
2407 echores "$_armv6t2"
2409 echocheck "ARM VFP"
2410 if test $_armvfp = "auto" ; then
2411 _armvfp=no
2412 inline_asm_check '"fadds s0, s0, s0"' && _armvfp=yes
2414 echores "$_armvfp"
2416 echocheck "ARM NEON"
2417 if test $neon = "auto" ; then
2418 neon=no
2419 inline_asm_check '"vadd.i16 q0, q0, q0"' && neon=yes
2421 echores "$neon"
2423 echocheck "iWMMXt (Intel XScale SIMD instructions)"
2424 if test $_iwmmxt = "auto" ; then
2425 _iwmmxt=no
2426 inline_asm_check '"wunpckelub wr6, wr4"' && _iwmmxt=yes
2428 echores "$_iwmmxt"
2431 cpuexts_all='ALTIVEC MMX MMX2 AMD3DNOW AMD3DNOWEXT SSE SSE2 SSSE3 FAST_CMOV CMOV FAST_CLZ ARMV5TE ARMV6 ARMV6T2 ARMVFP NEON IWMMXT MMI VIS MVI'
2432 test "$_altivec" = yes && cpuexts="ALTIVEC $cpuexts"
2433 test "$_mmx" = yes && cpuexts="MMX $cpuexts"
2434 test "$_mmxext" = yes && cpuexts="MMX2 $cpuexts"
2435 test "$_3dnow" = yes && cpuexts="AMD3DNOW $cpuexts"
2436 test "$_3dnowext" = yes && cpuexts="AMD3DNOWEXT $cpuexts"
2437 test "$_sse" = yes && cpuexts="SSE $cpuexts"
2438 test "$_sse2" = yes && cpuexts="SSE2 $cpuexts"
2439 test "$_ssse3" = yes && cpuexts="SSSE3 $cpuexts"
2440 test "$_cmov" = yes && cpuexts="CMOV $cpuexts"
2441 test "$_fast_cmov" = yes && cpuexts="FAST_CMOV $cpuexts"
2442 test "$_fast_clz" = yes && cpuexts="FAST_CLZ $cpuexts"
2443 test "$_armv5te" = yes && cpuexts="ARMV5TE $cpuexts"
2444 test "$_armv6" = yes && cpuexts="ARMV6 $cpuexts"
2445 test "$_armv6t2" = yes && cpuexts="ARMV6T2 $cpuexts"
2446 test "$_armvfp" = yes && cpuexts="ARMVFP $cpuexts"
2447 test "$neon" = yes && cpuexts="NEON $cpuexts"
2448 test "$_iwmmxt" = yes && cpuexts="IWMMXT $cpuexts"
2449 test "$_vis" = yes && cpuexts="VIS $cpuexts"
2450 test "$_mvi" = yes && cpuexts="MVI $cpuexts"
2452 # Checking kernel version...
2453 if x86_32 && linux ; then
2454 _k_verc_problem=no
2455 kernel_version=$(uname -r 2>&1)
2456 echocheck "$system_name kernel version"
2457 case "$kernel_version" in
2458 '') kernel_version="?.??"; _k_verc_fail=yes;;
2459 [0-1].[0-9].[0-9]*|2.[0-3].[0-9]*)
2460 _k_verc_problem=yes;;
2461 esac
2462 if test "$_k_verc_problem" = yes && test "$_sse" = yes ; then
2463 _k_verc_fail=yes
2465 if test "$_k_verc_fail" ; then
2466 echores "$kernel_version, fail"
2467 echo "WARNING! If you want to run MPlayer on this system, get prepared for problems!"
2468 echo "2.2.x has limited SSE support. Upgrade the kernel or use --disable-sse if you"
2469 echo "experience crashes. MPlayer tries to autodetect if your kernel correctly"
2470 echo "supports SSE, but you have been warned! If you are using a kernel older than"
2471 echo "2.2.x you must upgrade it to get SSE support!"
2472 # die "Your kernel is too old for this CPU." # works fine on some 2.2.x so don't die (later check will test)
2473 else
2474 echores "$kernel_version, ok"
2478 ######################
2479 # MAIN TESTS GO HERE #
2480 ######################
2483 echocheck "-lposix"
2484 if cflag_check -lposix ; then
2485 extra_ldflags="$extra_ldflags -lposix"
2486 echores "yes"
2487 else
2488 echores "no"
2491 echocheck "-lm"
2492 if cflag_check -lm ; then
2493 _ld_lm="-lm"
2494 echores "yes"
2495 else
2496 _ld_lm=""
2497 echores "no"
2501 echocheck "langinfo"
2502 if test "$_langinfo" = auto ; then
2503 _langinfo=no
2504 statement_check langinfo.h 'nl_langinfo(CODESET)' && _langinfo=yes
2506 if test "$_langinfo" = yes ; then
2507 def_langinfo='#define HAVE_LANGINFO 1'
2508 else
2509 def_langinfo='#undef HAVE_LANGINFO'
2511 echores "$_langinfo"
2514 echocheck "translation support"
2515 if test "$_translation" = yes; then
2516 def_translation="#define CONFIG_TRANSLATION 1"
2517 else
2518 def_translation="#undef CONFIG_TRANSLATION"
2520 echores "$_translation"
2522 echocheck "language"
2523 # Set preferred languages, "all" uses English as main language.
2524 test -z "$language" && language=$LINGUAS
2525 test -z "$language_doc" && language_doc=$language
2526 test -z "$language_man" && language_man=$language
2527 test -z "$language_msg" && language_msg=$language
2528 test -z "$language_msg" && language_msg="all"
2529 language_doc=$(echo $language_doc | tr , " ")
2530 language_man=$(echo $language_man | tr , " ")
2531 language_msg=$(echo $language_msg | tr , " ")
2533 test "$language_doc" = "all" && language_doc=$doc_lang_all
2534 test "$language_man" = "all" && language_man=$man_lang_all
2535 test "$language_msg" = "all" && language_msg=$msg_lang_all
2537 if test "$_translation" != yes ; then
2538 language_msg=""
2541 # Prune non-existing translations from language lists.
2542 # Set message translation to the first available language.
2543 # Fall back on English.
2544 for lang in $language_doc ; do
2545 test -d DOCS/xml/$lang && tmp_language_doc="$tmp_language_doc $lang"
2546 done
2547 language_doc=$tmp_language_doc
2548 test -z "$language_doc" && language_doc=en
2550 for lang in $language_man ; do
2551 test -d DOCS/man/$lang && tmp_language_man="$tmp_language_man $lang"
2552 done
2553 language_man=$tmp_language_man
2554 test -z "$language_man" && language_man=en
2556 for lang in $language_msg ; do
2557 test -f po/$lang.po && tmp_language_msg="$tmp_language_msg $lang"
2558 done
2559 language_msg=$tmp_language_msg
2561 echores "messages (en+): $language_msg - man pages: $language_man - documentation: $language_doc"
2564 echocheck "enable sighandler"
2565 if test "$_sighandler" = yes ; then
2566 def_sighandler='#define CONFIG_SIGHANDLER 1'
2567 else
2568 def_sighandler='#undef CONFIG_SIGHANDLER'
2570 echores "$_sighandler"
2572 echocheck "runtime cpudetection"
2573 if test "$_runtime_cpudetection" = yes ; then
2574 _optimizing="Runtime CPU-Detection enabled"
2575 def_runtime_cpudetection='#define CONFIG_RUNTIME_CPUDETECT 1'
2576 else
2577 def_runtime_cpudetection='#define CONFIG_RUNTIME_CPUDETECT 0'
2579 echores "$_runtime_cpudetection"
2582 echocheck "restrict keyword"
2583 for restrict_keyword in restrict __restrict __restrict__ ; do
2584 echo "void foo(char * $restrict_keyword p); int main(void) { return 0; }" > $TMPC
2585 if cc_check; then
2586 def_restrict_keyword=$restrict_keyword
2587 break;
2589 done
2590 if [ -n "$def_restrict_keyword" ]; then
2591 echores "$def_restrict_keyword"
2592 else
2593 echores "none"
2595 # Avoid infinite recursion loop ("#define restrict restrict")
2596 if [ "$def_restrict_keyword" != "restrict" ]; then
2597 def_restrict_keyword="#define restrict $def_restrict_keyword"
2598 else
2599 def_restrict_keyword=""
2603 echocheck "__builtin_expect"
2604 # GCC branch prediction hint
2605 cat > $TMPC << EOF
2606 static int foo(int a) {
2607 a = __builtin_expect(a, 10);
2608 return a == 10 ? 0 : 1;
2610 int main(void) { return foo(10) && foo(0); }
2612 _builtin_expect=no
2613 cc_check && _builtin_expect=yes
2614 if test "$_builtin_expect" = yes ; then
2615 def_builtin_expect='#define HAVE_BUILTIN_EXPECT 1'
2616 else
2617 def_builtin_expect='#undef HAVE_BUILTIN_EXPECT'
2619 echores "$_builtin_expect"
2622 echocheck "kstat"
2623 _kstat=no
2624 statement_check kstat.h 'kstat_open()' -lkstat && _kstat=yes
2625 if test "$_kstat" = yes ; then
2626 def_kstat="#define HAVE_LIBKSTAT 1"
2627 extra_ldflags="$extra_ldflags -lkstat"
2628 else
2629 def_kstat="#undef HAVE_LIBKSTAT"
2631 echores "$_kstat"
2634 echocheck "posix4"
2635 # required for nanosleep on some systems
2636 _posix4=no
2637 statement_check time.h 'nanosleep(0, 0)' -lposix4 && _posix4=yes
2638 if test "$_posix4" = yes ; then
2639 extra_ldflags="$extra_ldflags -lposix4"
2641 echores "$_posix4"
2643 for func in exp2 exp2f llrint log2 log2f lrint lrintf round roundf truncf; do
2644 echocheck $func
2645 eval _$func=no
2646 statement_check math.h "${func}(2.0)" -D_ISOC99_SOURCE $_ld_lm && eval _$func=yes
2647 if eval test "x\$_$func" = "xyes"; then
2648 eval def_$func="\"#define HAVE_$(echo $func | tr '[a-z]' '[A-Z]') 1\""
2649 echores yes
2650 else
2651 eval def_$func="\"#define HAVE_$(echo $func | tr '[a-z]' '[A-Z]') 0\""
2652 echores no
2654 done
2657 echocheck "mkstemp"
2658 _mkstemp=no
2659 define_statement_check "_XOPEN_SOURCE 600" "stdlib.h" 'mkstemp("")' && _mkstemp=yes
2660 if test "$_mkstemp" = yes ; then
2661 def_mkstemp='#define HAVE_MKSTEMP 1'
2662 else
2663 def_mkstemp='#define HAVE_MKSTEMP 0'
2665 echores "$_mkstemp"
2668 echocheck "nanosleep"
2669 _nanosleep=no
2670 statement_check time.h 'nanosleep(0, 0)' && _nanosleep=yes
2671 if test "$_nanosleep" = yes ; then
2672 def_nanosleep='#define HAVE_NANOSLEEP 1'
2673 else
2674 def_nanosleep='#undef HAVE_NANOSLEEP'
2676 echores "$_nanosleep"
2679 echocheck "socklib"
2680 # for Solaris (socket stuff is in -lsocket, gethostbyname and friends in -lnsl):
2681 # for BeOS (socket stuff is in -lsocket, gethostbyname and friends in -lbind):
2682 cat > $TMPC << EOF
2683 #include <netdb.h>
2684 #include <sys/socket.h>
2685 int main(void) { gethostbyname(0); socket(AF_INET, SOCK_STREAM, 0); return 0; }
2687 _socklib=no
2688 for _ld_tmp in "" "-lsocket -lbind" "-lsocket -ldnet" "-lsocket -lnsl" "-lnsl" "-lsocket" ; do
2689 cc_check $_ld_tmp && _ld_sock="$_ld_tmp" && _socklib=yes && break
2690 done
2691 test $_socklib = yes && test $_winsock2_h = auto && _winsock2_h=no
2692 if test $_winsock2_h = auto ; then
2693 _winsock2_h=no
2694 statement_check winsock2.h 'gethostbyname(0)' -lws2_32 && _ld_sock="-lws2_32" && _winsock2_h=yes
2696 test "$_ld_sock" && res_comment="using $_ld_sock"
2697 echores "$_socklib"
2700 if test $_winsock2_h = yes ; then
2701 _ld_sock="-lws2_32"
2702 def_winsock2_h='#define HAVE_WINSOCK2_H 1'
2703 else
2704 def_winsock2_h='#define HAVE_WINSOCK2_H 0'
2708 echocheck "arpa/inet.h"
2709 arpa_inet_h=no
2710 def_arpa_inet_h='#define HAVE_ARPA_INET_H 0'
2711 header_check arpa/inet.h && arpa_inet_h=yes &&
2712 def_arpa_inet_h='#define HAVE_ARPA_INET_H 1'
2713 echores "$arpa_inet_h"
2716 echocheck "inet_pton()"
2717 def_inet_pton='#define HAVE_INET_PTON 0'
2718 inet_pton=no
2719 for _ld_tmp in "$_ld_sock" "$_ld_sock -lresolv" ; do
2720 statement_check arpa/inet.h 'inet_pton(0, 0, 0)' $_ld_tmp && inet_pton=yes && break
2721 done
2722 if test $inet_pton = yes ; then
2723 test "$_ld_tmp" && res_comment="using $_ld_tmp"
2724 def_inet_pton='#define HAVE_INET_PTON 1'
2726 echores "$inet_pton"
2729 echocheck "inet_aton()"
2730 def_inet_aton='#define HAVE_INET_ATON 0'
2731 inet_aton=no
2732 for _ld_tmp in "$_ld_sock" "$_ld_sock -lresolv" ; do
2733 statement_check arpa/inet.h 'inet_aton(0, 0)' $_ld_tmp && inet_aton=yes && break
2734 done
2735 if test $inet_aton = yes ; then
2736 test "$_ld_tmp" && res_comment="using $_ld_tmp"
2737 def_inet_aton='#define HAVE_INET_ATON 1'
2739 echores "$inet_aton"
2742 echocheck "socklen_t"
2743 _socklen_t=no
2744 for header in "sys/socket.h" "ws2tcpip.h" "sys/types.h" ; do
2745 statement_check $header 'socklen_t v = 0' && _socklen_t=yes && break
2746 done
2747 if test "$_socklen_t" = yes ; then
2748 def_socklen_t='#define HAVE_SOCKLEN_T 1'
2749 else
2750 def_socklen_t='#define HAVE_SOCKLEN_T 0'
2752 echores "$_socklen_t"
2755 echocheck "closesocket()"
2756 _closesocket=no
2757 statement_check winsock2.h 'closesocket(~0)' $_ld_sock && _closesocket=yes
2758 if test "$_closesocket" = yes ; then
2759 def_closesocket='#define HAVE_CLOSESOCKET 1'
2760 else
2761 def_closesocket='#define HAVE_CLOSESOCKET 0'
2763 echores "$_closesocket"
2766 echocheck "networking"
2767 test $_winsock2_h = no && test $inet_pton = no &&
2768 test $inet_aton = no && networking=no
2769 if test "$networking" = yes ; then
2770 def_network='#define CONFIG_NETWORK 1'
2771 def_networking='#define CONFIG_NETWORKING 1'
2772 extra_ldflags="$extra_ldflags $_ld_sock"
2773 inputmodules="networking $inputmodules"
2774 else
2775 noinputmodules="networking $noinputmodules"
2776 def_network='#define CONFIG_NETWORK 0'
2777 def_networking='#undef CONFIG_NETWORKING'
2779 echores "$networking"
2782 echocheck "inet6"
2783 if test "$_inet6" = auto ; then
2784 cat > $TMPC << EOF
2785 #include <sys/types.h>
2786 #if !defined(_WIN32)
2787 #include <sys/socket.h>
2788 #include <netinet/in.h>
2789 #else
2790 #include <ws2tcpip.h>
2791 #endif
2792 int main(void) { struct sockaddr_in6 six; socket(AF_INET6, SOCK_STREAM, AF_INET6); return 0; }
2794 _inet6=no
2795 if cc_check $_ld_sock ; then
2796 _inet6=yes
2799 if test "$_inet6" = yes ; then
2800 def_inet6='#define HAVE_AF_INET6 1'
2801 else
2802 def_inet6='#undef HAVE_AF_INET6'
2804 echores "$_inet6"
2807 echocheck "gethostbyname2"
2808 if test "$_gethostbyname2" = auto ; then
2809 cat > $TMPC << EOF
2810 #include <sys/types.h>
2811 #include <sys/socket.h>
2812 #include <netdb.h>
2813 int main(void) { gethostbyname2("", AF_INET); return 0; }
2815 _gethostbyname2=no
2816 if cc_check ; then
2817 _gethostbyname2=yes
2820 if test "$_gethostbyname2" = yes ; then
2821 def_gethostbyname2='#define HAVE_GETHOSTBYNAME2 1'
2822 else
2823 def_gethostbyname2='#undef HAVE_GETHOSTBYNAME2'
2825 echores "$_gethostbyname2"
2828 echocheck "inttypes.h (required)"
2829 _inttypes=no
2830 header_check inttypes.h && _inttypes=yes
2831 echores "$_inttypes"
2833 if test "$_inttypes" = no ; then
2834 echocheck "sys/bitypes.h (inttypes.h predecessor)"
2835 header_check sys/bitypes.h && _inttypes=yes
2836 if test "$_inttypes" = yes ; then
2837 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."
2838 else
2839 die "Cannot find header either inttypes.h or bitypes.h. There is no chance for compilation to succeed."
2844 echocheck "malloc.h"
2845 _malloc=no
2846 header_check malloc.h && _malloc=yes
2847 if test "$_malloc" = yes ; then
2848 def_malloc_h='#define HAVE_MALLOC_H 1'
2849 else
2850 def_malloc_h='#define HAVE_MALLOC_H 0'
2852 echores "$_malloc"
2855 echocheck "memalign()"
2856 # XXX restrict to x86 ? extend to other CPUs/cacheline sizes ?
2857 def_memalign_hack='#define CONFIG_MEMALIGN_HACK 0'
2858 _memalign=no
2859 statement_check malloc.h 'memalign(64, sizeof(char))' && _memalign=yes
2860 if test "$_memalign" = yes ; then
2861 def_memalign='#define HAVE_MEMALIGN 1'
2862 else
2863 def_memalign='#define HAVE_MEMALIGN 0'
2864 def_map_memalign='#define memalign(a, b) malloc(b)'
2865 darwin || def_memalign_hack='#define CONFIG_MEMALIGN_HACK 1'
2867 echores "$_memalign"
2870 echocheck "posix_memalign()"
2871 posix_memalign=no
2872 def_posix_memalign='#define HAVE_POSIX_MEMALIGN 0'
2873 define_statement_check "_XOPEN_SOURCE 600" "stdlib.h" 'posix_memalign(NULL, 0, 0)' &&
2874 posix_memalign=yes && def_posix_memalign='#define HAVE_POSIX_MEMALIGN 1'
2875 echores "$posix_memalign"
2878 echocheck "alloca.h"
2879 _alloca=no
2880 statement_check alloca.h 'alloca(0)' && _alloca=yes
2881 if cc_check ; then
2882 def_alloca_h='#define HAVE_ALLOCA_H 1'
2883 else
2884 def_alloca_h='#undef HAVE_ALLOCA_H'
2886 echores "$_alloca"
2889 echocheck "fastmemcpy"
2890 if test "$_fastmemcpy" = yes ; then
2891 def_fastmemcpy='#define CONFIG_FASTMEMCPY 1'
2892 else
2893 def_fastmemcpy='#undef CONFIG_FASTMEMCPY'
2895 echores "$_fastmemcpy"
2898 echocheck "mman.h"
2899 _mman=no
2900 statement_check sys/mman.h 'mmap(0, 0, 0, 0, 0, 0)' && _mman=yes
2901 if test "$_mman" = yes ; then
2902 def_mman_h='#define HAVE_SYS_MMAN_H 1'
2903 else
2904 def_mman_h='#undef HAVE_SYS_MMAN_H'
2906 echores "$_mman"
2908 _mman_has_map_failed=no
2909 statement_check sys/mman.h 'void *p = MAP_FAILED' && _mman_has_map_failed=yes
2910 if test "$_mman_has_map_failed" = yes ; then
2911 def_mman_has_map_failed=''
2912 else
2913 def_mman_has_map_failed='#define MAP_FAILED ((void *) -1)'
2916 echocheck "dynamic loader"
2917 _dl=no
2918 for _ld_tmp in "" "-ldl"; do
2919 statement_check dlfcn.h 'dlopen("", 0)' $_ld_tmp && _ld_dl="$_ld_tmp" && _dl=yes && break
2920 done
2921 if test "$_dl" = yes ; then
2922 def_dl='#define HAVE_LIBDL 1'
2923 else
2924 def_dl='#undef HAVE_LIBDL'
2926 echores "$_dl"
2929 def_threads='#define HAVE_THREADS 0'
2931 echocheck "pthread"
2932 if linux ; then
2933 THREAD_CFLAGS=-D_REENTRANT
2934 elif freebsd || netbsd || openbsd || bsdos ; then
2935 THREAD_CFLAGS=-D_THREAD_SAFE
2937 if test "$_pthreads" = auto ; then
2938 cat > $TMPC << EOF
2939 #include <pthread.h>
2940 static void *func(void *arg) { return arg; }
2941 int main(void) {
2942 pthread_t tid;
2943 #ifdef PTW32_STATIC_LIB
2944 pthread_win32_process_attach_np();
2945 pthread_win32_thread_attach_np();
2946 #endif
2947 return pthread_create (&tid, 0, func, 0) != 0;
2950 _pthreads=no
2951 if ! hpux ; then
2952 for _ld_tmp in "-lpthreadGC2" "" "-lpthread" "-pthread" ; do
2953 # for crosscompilation, we cannot execute the program, be happy if we can link statically
2954 cc_check $THREAD_CFLAGS $_ld_tmp && (tmp_run || test "$_ld_static") && _ld_pthread="$_ld_tmp" && _pthreads=yes && break
2955 done
2956 if test "$_pthreads" = no && mingw32 ; then
2957 _ld_tmp="-lpthreadGC2 -lws2_32"
2958 cc_check $_ld_tmp -DPTW32_STATIC_LIB && (tmp_run || test "$_ld_static") && _ld_pthread="$_ld_tmp" && _pthreads=yes && CFLAGS="$CFLAGS -DPTW32_STATIC_LIB"
2962 if test "$_pthreads" = yes ; then
2963 test $_ld_pthread && res_comment="using $_ld_pthread"
2964 def_pthreads='#define HAVE_PTHREADS 1'
2965 def_threads='#define HAVE_THREADS 1'
2966 extra_cflags="$extra_cflags $THREAD_CFLAGS"
2967 else
2968 res_comment="v4l, v4l2, ao_nas, win32 loader disabled"
2969 def_pthreads='#undef HAVE_PTHREADS'
2970 _nas=no ; _tv_v4l1=no ; _tv_v4l2=no
2971 mingw32 || _win32dll=no
2973 echores "$_pthreads"
2975 if cygwin ; then
2976 if test "$_pthreads" = yes ; then
2977 def_pthread_cache="#define PTHREAD_CACHE 1"
2978 else
2979 _stream_cache=no
2980 def_stream_cache="#undef CONFIG_STREAM_CACHE"
2984 echocheck "w32threads"
2985 if test "$_pthreads" = yes ; then
2986 res_comment="using pthread instead"
2987 _w32threads=no
2989 if test "$_w32threads" = auto ; then
2990 _w32threads=no
2991 mingw32 && _w32threads=yes
2993 test "$_w32threads" = yes && def_threads='#define HAVE_THREADS 1'
2994 echores "$_w32threads"
2996 echocheck "rpath"
2997 if test "$_rpath" = yes ; then
2998 for I in $(echo $extra_ldflags | sed 's/-L//g') ; do
2999 tmp="$tmp $(echo $I | sed 's/.*/ -L& -Wl,-R&/')"
3000 done
3001 extra_ldflags=$tmp
3003 echores "$_rpath"
3005 echocheck "iconv"
3006 if test "$_iconv" = auto ; then
3007 cat > $TMPC << EOF
3008 #include <stdio.h>
3009 #include <unistd.h>
3010 #include <iconv.h>
3011 #define INBUFSIZE 1024
3012 #define OUTBUFSIZE 4096
3014 char inbuffer[INBUFSIZE];
3015 char outbuffer[OUTBUFSIZE];
3017 int main(void) {
3018 size_t numread;
3019 iconv_t icdsc;
3020 char *tocode="UTF-8";
3021 char *fromcode="cp1250";
3022 if ((icdsc = iconv_open(tocode, fromcode)) != (iconv_t)(-1)) {
3023 while ((numread = read(0, inbuffer, INBUFSIZE))) {
3024 char *iptr=inbuffer;
3025 char *optr=outbuffer;
3026 size_t inleft=numread;
3027 size_t outleft=OUTBUFSIZE;
3028 if (iconv(icdsc, &iptr, &inleft, &optr, &outleft)
3029 != (size_t)(-1)) {
3030 write(1, outbuffer, OUTBUFSIZE - outleft);
3033 if (iconv_close(icdsc) == -1)
3036 return 0;
3039 _iconv=no
3040 for _ld_tmp in "" "-liconv" "-liconv $_ld_dl" ; do
3041 cc_check $_ld_lm $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" &&
3042 _iconv=yes && break
3043 done
3044 if test "$_iconv" != yes ; then
3045 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."
3048 if test "$_iconv" = yes ; then
3049 def_iconv='#define CONFIG_ICONV 1'
3050 else
3051 def_iconv='#undef CONFIG_ICONV'
3053 echores "$_iconv"
3056 echocheck "soundcard.h"
3057 _soundcard_h=no
3058 def_soundcard_h='#undef HAVE_SOUNDCARD_H'
3059 def_sys_soundcard_h='#undef HAVE_SYS_SOUNDCARD_H'
3060 for _soundcard_header in "sys/soundcard.h" "soundcard.h"; do
3061 header_check $_soundcard_header && _soundcard_h=yes &&
3062 res_comment="$_soundcard_header" && break
3063 done
3065 if test "$_soundcard_h" = yes ; then
3066 if test $_soundcard_header = "sys/soundcard.h"; then
3067 def_sys_soundcard_h='#define HAVE_SYS_SOUNDCARD_H 1'
3068 else
3069 def_soundcard_h='#define HAVE_SOUNDCARD_H 1'
3072 echores "$_soundcard_h"
3075 echocheck "sys/videoio.h"
3076 sys_videoio_h=no
3077 def_sys_videoio_h='#undef HAVE_SYS_VIDEOIO_H'
3078 header_check sys/videoio.h && sys_videoio_h=yes &&
3079 def_sys_videoio_h='#define HAVE_SYS_VIDEOIO_H 1'
3080 echores "$sys_videoio_h"
3083 echocheck "sys/dvdio.h"
3084 _dvdio=no
3085 # FreeBSD 8.1 has broken dvdio.h
3086 header_check_broken sys/types.h sys/dvdio.h && _dvdio=yes
3087 if test "$_dvdio" = yes ; then
3088 def_dvdio='#define DVD_STRUCT_IN_SYS_DVDIO_H 1'
3089 else
3090 def_dvdio='#undef DVD_STRUCT_IN_SYS_DVDIO_H'
3092 echores "$_dvdio"
3095 echocheck "sys/cdio.h"
3096 _cdio=no
3097 # at least OpenSolaris has a broken cdio.h
3098 header_check_broken sys/types.h sys/cdio.h && _cdio=yes
3099 if test "$_cdio" = yes ; then
3100 def_cdio='#define DVD_STRUCT_IN_SYS_CDIO_H 1'
3101 else
3102 def_cdio='#undef DVD_STRUCT_IN_SYS_CDIO_H'
3104 echores "$_cdio"
3107 echocheck "linux/cdrom.h"
3108 _cdrom=no
3109 header_check linux/cdrom.h && _cdrom=yes
3110 if test "$_cdrom" = yes ; then
3111 def_cdrom='#define DVD_STRUCT_IN_LINUX_CDROM_H 1'
3112 else
3113 def_cdrom='#undef DVD_STRUCT_IN_LINUX_CDROM_H'
3115 echores "$_cdrom"
3118 echocheck "dvd.h"
3119 _dvd=no
3120 header_check dvd.h && _dvd=yes
3121 if test "$_dvd" = yes ; then
3122 def_dvd='#define DVD_STRUCT_IN_DVD_H 1'
3123 else
3124 def_dvd='#undef DVD_STRUCT_IN_DVD_H'
3126 echores "$_dvd"
3129 if bsdos; then
3130 echocheck "BSDI dvd.h"
3131 _bsdi_dvd=no
3132 header_check dvd.h && _bsdi_dvd=yes
3133 if test "$_bsdi_dvd" = yes ; then
3134 def_bsdi_dvd='#define DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H 1'
3135 else
3136 def_bsdi_dvd='#undef DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H'
3138 echores "$_bsdi_dvd"
3139 fi #if bsdos
3142 if hpux; then
3143 # also used by AIX, but AIX does not support VCD and/or libdvdread
3144 echocheck "HP-UX SCSI header"
3145 _hpux_scsi_h=no
3146 header_check sys/scsi.h && _hpux_scsi_h=yes
3147 if test "$_hpux_scsi_h" = yes ; then
3148 def_hpux_scsi_h='#define HPUX_SCTL_IO 1'
3149 else
3150 def_hpux_scsi_h='#undef HPUX_SCTL_IO'
3152 echores "$_hpux_scsi_h"
3153 fi #if hpux
3156 echocheck "termcap"
3157 if test "$_termcap" = auto ; then
3158 _termcap=no
3159 for _ld_tmp in "-lncurses" "-ltinfo" "-ltermcap"; do
3160 statement_check term.h 'tgetent(0, 0)' $_ld_tmp &&
3161 extra_ldflags="$extra_ldflags $_ld_tmp" && _termcap=yes && break
3162 done
3164 if test "$_termcap" = yes ; then
3165 def_termcap='#define HAVE_TERMCAP 1'
3166 test $_ld_tmp && res_comment="using $_ld_tmp"
3167 else
3168 def_termcap='#undef HAVE_TERMCAP'
3170 echores "$_termcap"
3173 echocheck "termios"
3174 def_termios='#undef HAVE_TERMIOS'
3175 def_termios_h='#undef HAVE_TERMIOS_H'
3176 def_termios_sys_h='#undef HAVE_SYS_TERMIOS_H'
3177 if test "$_termios" = auto ; then
3178 _termios=no
3179 for _termios_header in "termios.h" "sys/termios.h"; do
3180 header_check $_termios_header && _termios=yes &&
3181 res_comment="using $_termios_header" && break
3182 done
3185 if test "$_termios" = yes ; then
3186 def_termios='#define HAVE_TERMIOS 1'
3187 if test "$_termios_header" = "termios.h" ; then
3188 def_termios_h='#define HAVE_TERMIOS_H 1'
3189 else
3190 def_termios_sys_h='#define HAVE_SYS_TERMIOS_H 1'
3193 echores "$_termios"
3196 echocheck "shm"
3197 if test "$_shm" = auto ; then
3198 _shm=no
3199 statement_check sys/shm.h 'shmget(0, 0, 0); shmat(0, 0, 0); shmctl(0, 0, 0)' && _shm=yes
3201 if test "$_shm" = yes ; then
3202 def_shm='#define HAVE_SHM 1'
3203 else
3204 def_shm='#undef HAVE_SHM'
3206 echores "$_shm"
3209 echocheck "strsep()"
3210 _strsep=no
3211 statement_check string.h 'char *s = "Hello, world!"; strsep(&s, ",")' && _strsep=yes
3212 if test "$_strsep" = yes ; then
3213 def_strsep='#define HAVE_STRSEP 1'
3214 need_strsep=no
3215 else
3216 def_strsep='#undef HAVE_STRSEP'
3217 need_strsep=yes
3219 echores "$_strsep"
3222 echocheck "vsscanf()"
3223 cat > $TMPC << EOF
3224 #define _ISOC99_SOURCE
3225 #include <stdarg.h>
3226 #include <stdio.h>
3227 int main(void) { va_list ap; vsscanf("foo", "bar", ap); return 0; }
3229 _vsscanf=no
3230 cc_check && _vsscanf=yes
3231 if test "$_vsscanf" = yes ; then
3232 def_vsscanf='#define HAVE_VSSCANF 1'
3233 need_vsscanf=no
3234 else
3235 def_vsscanf='#undef HAVE_VSSCANF'
3236 need_vsscanf=yes
3238 echores "$_vsscanf"
3241 echocheck "swab()"
3242 _swab=no
3243 define_statement_check "_XOPEN_SOURCE 600" "unistd.h" 'int a, b; swab(&a, &b, 0)' ||
3244 statement_check "string.h" 'int a, b; swab(&a, &b, 0)' && _swab=yes
3245 if test "$_swab" = yes ; then
3246 def_swab='#define HAVE_SWAB 1'
3247 need_swab=no
3248 else
3249 def_swab='#undef HAVE_SWAB'
3250 need_swab=yes
3252 echores "$_swab"
3254 echocheck "POSIX select()"
3255 cat > $TMPC << EOF
3256 #include <stdio.h>
3257 #include <stdlib.h>
3258 #include <sys/types.h>
3259 #include <string.h>
3260 #include <sys/time.h>
3261 #include <unistd.h>
3262 int main(void) {int nfds = 1; fd_set readfds; struct timeval timeout; select(nfds, &readfds, NULL, NULL, &timeout); return 0; }
3264 _posix_select=no
3265 def_posix_select='#undef HAVE_POSIX_SELECT'
3266 cc_check && _posix_select=yes &&
3267 def_posix_select='#define HAVE_POSIX_SELECT 1'
3268 echores "$_posix_select"
3271 echocheck "audio select()"
3272 if test "$_select" = no ; then
3273 def_select='#undef HAVE_AUDIO_SELECT'
3274 elif test "$_select" = yes ; then
3275 def_select='#define HAVE_AUDIO_SELECT 1'
3277 echores "$_select"
3280 echocheck "gettimeofday()"
3281 _gettimeofday=no
3282 statement_check sys/time.h 'struct timeval tv; struct timezone tz; gettimeofday(&tv, &tz)' && _gettimeofday=yes
3283 if test "$_gettimeofday" = yes ; then
3284 def_gettimeofday='#define HAVE_GETTIMEOFDAY 1'
3285 need_gettimeofday=no
3286 else
3287 def_gettimeofday='#undef HAVE_GETTIMEOFDAY'
3288 need_gettimeofday=yes
3290 echores "$_gettimeofday"
3293 echocheck "glob()"
3294 _glob=no
3295 statement_check glob.h 'glob("filename", 0, 0, 0)' && _glob=yes
3296 need_glob=no
3297 if test "$_glob" = yes ; then
3298 def_glob='#define HAVE_GLOB 1'
3299 else
3300 def_glob='#undef HAVE_GLOB'
3301 # HACK! need_glob currently enables compilation of a
3302 # win32-specific glob()-replacement.
3303 # Other OS neither need it nor can they use it (mf:// is disabled for them).
3304 win32 && need_glob=yes
3306 echores "$_glob"
3309 echocheck "setenv()"
3310 _setenv=no
3311 statement_check stdlib.h 'setenv("", "", 0)' && _setenv=yes
3312 if test "$_setenv" = yes ; then
3313 def_setenv='#define HAVE_SETENV 1'
3314 need_setenv=no
3315 else
3316 def_setenv='#undef HAVE_SETENV'
3317 need_setenv=yes
3319 echores "$_setenv"
3322 echocheck "setmode()"
3323 _setmode=no
3324 def_setmode='#define HAVE_SETMODE 0'
3325 statement_check io.h 'setmode(0, 0)' && _setmode=yes && def_setmode='#define HAVE_SETMODE 1'
3326 echores "$_setmode"
3329 echocheck "sys/sysinfo.h"
3330 _sys_sysinfo=no
3331 statement_check sys/sysinfo.h 'struct sysinfo s_info; s_info.mem_unit=0; sysinfo(&s_info)' && _sys_sysinfo=yes
3332 if test "$_sys_sysinfo" = yes ; then
3333 def_sys_sysinfo_h='#define HAVE_SYS_SYSINFO_H 1'
3334 else
3335 def_sys_sysinfo_h='#undef HAVE_SYS_SYSINFO_H'
3337 echores "$_sys_sysinfo"
3340 if darwin; then
3342 echocheck "Mac OS X Finder Support"
3343 def_macosx_finder='#undef CONFIG_MACOSX_FINDER'
3344 if test "$_macosx_finder" = yes ; then
3345 def_macosx_finder='#define CONFIG_MACOSX_FINDER 1'
3346 extra_ldflags="$extra_ldflags -framework Cocoa"
3348 echores "$_macosx_finder"
3350 echocheck "Mac OS X Bundle file locations"
3351 def_macosx_bundle='#undef CONFIG_MACOSX_BUNDLE'
3352 test "$_macosx_bundle" = auto && _macosx_bundle=$_macosx_finder
3353 if test "$_macosx_bundle" = yes ; then
3354 def_macosx_bundle='#define CONFIG_MACOSX_BUNDLE 1'
3356 echores "$_macosx_bundle"
3358 echocheck "Apple Remote"
3359 if test "$_apple_remote" = auto ; then
3360 _apple_remote=no
3361 cat > $TMPC <<EOF
3362 #include <stdio.h>
3363 #include <IOKit/IOCFPlugIn.h>
3364 int main(void) {
3365 io_iterator_t hidObjectIterator = (io_iterator_t)NULL;
3366 CFMutableDictionaryRef hidMatchDictionary;
3367 IOReturn ioReturnValue;
3369 // Set up a matching dictionary to search the I/O Registry by class.
3370 // name for all HID class devices
3371 hidMatchDictionary = IOServiceMatching("AppleIRController");
3373 // Now search I/O Registry for matching devices.
3374 ioReturnValue = IOServiceGetMatchingServices(kIOMasterPortDefault,
3375 hidMatchDictionary, &hidObjectIterator);
3377 // If search is unsuccessful, return nonzero.
3378 if (ioReturnValue != kIOReturnSuccess ||
3379 !IOIteratorIsValid(hidObjectIterator)) {
3380 return 1;
3382 return 0;
3385 cc_check -framework IOKit && _apple_remote=yes
3387 if test "$_apple_remote" = yes ; then
3388 def_apple_remote='#define CONFIG_APPLE_REMOTE 1'
3389 libs_mplayer="$libs_mplayer -framework IOKit -framework Cocoa"
3390 else
3391 def_apple_remote='#undef CONFIG_APPLE_REMOTE'
3393 echores "$_apple_remote"
3395 fi #if darwin
3397 if linux; then
3399 echocheck "Apple IR"
3400 if test "$_apple_ir" = auto ; then
3401 _apple_ir=no
3402 statement_check linux/input.h 'struct input_event ev; struct input_id id' && _apple_ir=yes
3404 if test "$_apple_ir" = yes ; then
3405 def_apple_ir='#define CONFIG_APPLE_IR 1'
3406 else
3407 def_apple_ir='#undef CONFIG_APPLE_IR'
3409 echores "$_apple_ir"
3410 fi #if linux
3412 echocheck "pkg-config"
3413 if $($_pkg_config --version > /dev/null 2>&1); then
3414 if test "$_ld_static"; then
3415 _pkg_config="$_pkg_config --static"
3417 echores "yes"
3418 else
3419 _pkg_config=false
3420 echores "no"
3424 echocheck "Samba support (libsmbclient)"
3425 if test "$_smb" = yes; then
3426 extra_ldflags="$extra_ldflags -lsmbclient"
3428 if test "$_smb" = auto; then
3429 _smb=no
3430 for _ld_tmp in "-lsmbclient" "-lsmbclient $_ld_dl" "-lsmbclient $_ld_dl -lnsl" "-lsmbclient $_ld_dl -lssl -lnsl" ; do
3431 statement_check libsmbclient.h 'smbc_opendir("smb://")' $_ld_tmp &&
3432 extra_ldflags="$extra_ldflags $_ld_tmp" && _smb=yes && break
3433 done
3436 if test "$_smb" = yes; then
3437 def_smb="#define CONFIG_LIBSMBCLIENT 1"
3438 inputmodules="smb $inputmodules"
3439 else
3440 def_smb="#undef CONFIG_LIBSMBCLIENT"
3441 noinputmodules="smb $noinputmodules"
3443 echores "$_smb"
3445 echocheck "libquvi support"
3446 if test "$_libquvi" = auto ; then
3447 _libquvi=no
3448 if pkg_config_add libquvi ; then
3449 _libquvi=yes
3452 if test "$_libquvi" = yes; then
3453 def_libquvi="#define CONFIG_LIBQUVI 1"
3454 else
3455 def_libquvi="#undef CONFIG_LIBQUVI"
3457 echores "$_libquvi"
3459 #########
3460 # VIDEO #
3461 #########
3464 echocheck "tga"
3465 if test "$_tga" = yes ; then
3466 def_tga='#define CONFIG_TGA 1'
3467 vomodules="tga $vomodules"
3468 else
3469 def_tga='#undef CONFIG_TGA'
3470 novomodules="tga $novomodules"
3472 echores "$_tga"
3475 echocheck "md5sum support"
3476 if test "$_md5sum" = yes; then
3477 def_md5sum="#define CONFIG_MD5SUM 1"
3478 vomodules="md5sum $vomodules"
3479 else
3480 def_md5sum="#undef CONFIG_MD5SUM"
3481 novomodules="md5sum $novomodules"
3483 echores "$_md5sum"
3486 echocheck "yuv4mpeg support"
3487 if test "$_yuv4mpeg" = yes; then
3488 def_yuv4mpeg="#define CONFIG_YUV4MPEG 1"
3489 vomodules="yuv4mpeg $vomodules"
3490 else
3491 def_yuv4mpeg="#undef CONFIG_YUV4MPEG"
3492 novomodules="yuv4mpeg $novomodules"
3494 echores "$_yuv4mpeg"
3497 echocheck "DirectFB"
3498 if test "$_directfb" = auto ; then
3499 _directfb=no
3500 cat > $TMPC << EOF
3501 #include <directfb.h>
3502 #include <directfb_version.h>
3503 #if (DIRECTFB_MAJOR_VERSION << 16 | DIRECTFB_MINOR_VERSION << 8 | DIRECTFB_MICRO_VERSION) < (0 << 16 | 9 << 8 | 22)
3504 #error "DirectFB version too old."
3505 #endif
3506 int main(void) { DirectFBInit(0, 0); return 0; }
3508 for _inc_tmp in "" -I/usr/local/include/directfb -I/usr/include/directfb -I/usr/local/include; do
3509 cc_check $_inc_tmp -ldirectfb &&
3510 _directfb=yes && extra_cflags="$extra_cflags $_inc_tmp" && break
3511 done
3513 if test "$_directfb" = yes ; then
3514 def_directfb='#define CONFIG_DIRECTFB 1'
3515 vomodules="directfb $vomodules"
3516 libs_mplayer="$libs_mplayer -ldirectfb"
3517 else
3518 def_directfb='#undef CONFIG_DIRECTFB'
3519 novomodules="directfb $novomodules"
3521 echores "$_directfb"
3524 if darwin; then
3526 echocheck "QuickTime"
3527 if test "$quicktime" = auto ; then
3528 quicktime=no
3529 statement_check QuickTime/QuickTime.h 'ImageDescription *desc; EnterMovies(); ExitMovies()' -framework QuickTime && quicktime=yes
3531 if test "$quicktime" = yes ; then
3532 extra_ldflags="$extra_ldflags -framework QuickTime"
3533 def_quicktime='#define CONFIG_QUICKTIME 1'
3534 else
3535 def_quicktime='#undef CONFIG_QUICKTIME'
3537 echores $quicktime
3539 echocheck "Cocoa"
3540 if test "$_cocoa" = auto ; then
3541 cat > $TMPC <<EOF
3542 #include <CoreServices/CoreServices.h>
3543 #include <OpenGL/OpenGL.h>
3544 int main(void) {
3545 NSApplicationLoad();
3548 _cocoa=no
3549 cc_check -framework Cocoa -framework OpenGL && _cocoa=yes
3551 if test "$_cocoa" = yes ; then
3552 libs_mplayer="$libs_mplayer -framework Cocoa -framework OpenGL"
3553 def_cocoa='#define CONFIG_COCOA 1'
3554 else
3555 def_cocoa='#undef CONFIG_COCOA'
3557 echores "$_cocoa"
3559 echocheck "CoreVideo"
3560 if test "$_cocoa" = yes && test "$_corevideo" = auto ; then
3561 cat > $TMPC <<EOF
3562 #include <QuartzCore/CoreVideo.h>
3563 int main(void) { return 0; }
3565 _corevideo=no
3566 cc_check -framework Cocoa -framework QuartzCore -framework OpenGL && _corevideo=yes
3568 if test "$_corevideo" = yes ; then
3569 vomodules="corevideo $vomodules"
3570 libs_mplayer="$libs_mplayer -framework QuartzCore"
3571 def_corevideo='#define CONFIG_COREVIDEO 1'
3572 else
3573 novomodules="corevideo $novomodules"
3574 def_corevideo='#undef CONFIG_COREVIDEO'
3576 echores "$_corevideo"
3578 echocheck "SharedBuffer"
3579 if test "$_sharedbuffer" = auto ; then
3580 cat > $TMPC <<EOF
3581 int main(void) {
3582 NSApplicationLoad();
3585 _sharedbuffer=no
3586 cc_check -framework Cocoa && _sharedbuffer=yes
3588 if test "$_sharedbuffer" = yes ; then
3589 vomodules="sharedbuffer $vomodules"
3590 libs_mplayer="$libs_mplayer -framework Cocoa"
3591 def_sharedbuffer='#define CONFIG_SHAREDBUFFER 1'
3592 else
3593 novomodules="sharedbuffer $novomodules"
3594 def_sharedbuffer='#undef CONFIG_SHAREDBUFFER'
3596 echores "$_sharedbuffer"
3598 depends_on_application_services(){
3599 test "$_corevideo" = yes
3602 fi #if darwin
3605 echocheck "X11 headers presence"
3606 _x11_headers="no"
3607 res_comment="check if the dev(el) packages are installed"
3608 for I in $(echo $extra_cflags | sed s/-I//g) /usr/include ; do
3609 if test -f "$I/X11/Xlib.h" ; then
3610 _x11_headers="yes"
3611 res_comment=""
3612 break
3614 done
3615 if test $_cross_compile = no; then
3616 for I in /usr/X11/include /usr/X11R7/include /usr/local/include /usr/X11R6/include \
3617 /usr/include/X11R6 /usr/openwin/include ; do
3618 if test -f "$I/X11/Xlib.h" ; then
3619 extra_cflags="$extra_cflags -I$I"
3620 _x11_headers="yes"
3621 res_comment="using $I"
3622 break
3624 done
3626 echores "$_x11_headers"
3629 echocheck "X11"
3630 if test "$_x11" = auto && test "$_x11_headers" = yes ; then
3631 for I in "" -L/usr/X11R7/lib -L/usr/local/lib -L/usr/X11R6/lib -L/usr/lib/X11R6 \
3632 -L/usr/X11/lib -L/usr/lib32 -L/usr/openwin/lib -L/usr/local/lib64 -L/usr/X11R6/lib64 \
3633 -L/usr/lib ; do
3634 if netbsd; then
3635 _ld_tmp="$I -lXext -lX11 $_ld_pthread -Wl,-R$(echo $I | sed s/^-L//)"
3636 else
3637 _ld_tmp="$I -lXext -lX11 $_ld_pthread"
3639 statement_check X11/Xutil.h 'XCreateWindow(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)' $_ld_tmp &&
3640 _x11=yes
3641 # Check that there aren't conflicting headers between ApplicationServices
3642 # and X11. On versions of Mac OSX prior to 10.7 the deprecated QuickDraw API
3643 # is included by -framework ApplicationServices and clashes with the X11
3644 # definition of the "Cursor" type.
3645 if darwin && depends_on_application_services && test "$_x11" = yes ; then
3646 _x11=no
3647 header_check_broken ApplicationServices/ApplicationServices.h \
3648 X11/Xutil.h $_ld_tmp && _x11=yes
3650 if test "$_x11" = yes ; then
3651 libs_mplayer="$libs_mplayer $_ld_tmp"
3652 break
3654 done
3656 if test "$_x11" = yes ; then
3657 def_x11='#define CONFIG_X11 1'
3658 vomodules="x11 $vomodules"
3659 else
3660 _x11=no
3661 def_x11='#undef CONFIG_X11'
3662 novomodules="x11 $novomodules"
3663 res_comment="check if the dev(el) packages are installed"
3665 echores "$_x11"
3667 echocheck "Xss screensaver extensions"
3668 if test "$_xss" = auto ; then
3669 _xss=no
3670 statement_check "X11/extensions/scrnsaver.h" 'XScreenSaverSuspend(NULL, True)' -lXss && _xss=yes
3672 if test "$_xss" = yes ; then
3673 def_xss='#define CONFIG_XSS 1'
3674 libs_mplayer="$libs_mplayer -lXss"
3675 else
3676 def_xss='#undef CONFIG_XSS'
3678 echores "$_xss"
3680 echocheck "DPMS"
3681 _xdpms3=no
3682 _xdpms4=no
3683 if test "$_x11" = yes ; then
3684 cat > $TMPC <<EOF
3685 #include <X11/Xmd.h>
3686 #include <X11/Xlib.h>
3687 #include <X11/Xutil.h>
3688 #include <X11/Xatom.h>
3689 #include <X11/extensions/dpms.h>
3690 int main(void) { DPMSQueryExtension(0, 0, 0); return 0; }
3692 cc_check -lXdpms && _xdpms3=yes
3693 statement_check_broken X11/Xlib.h X11/extensions/dpms.h 'DPMSQueryExtension(0, 0, 0)' -lXext && _xdpms4=yes
3695 if test "$_xdpms4" = yes ; then
3696 def_xdpms='#define CONFIG_XDPMS 1'
3697 res_comment="using Xdpms 4"
3698 echores "yes"
3699 elif test "$_xdpms3" = yes ; then
3700 def_xdpms='#define CONFIG_XDPMS 1'
3701 libs_mplayer="$libs_mplayer -lXdpms"
3702 res_comment="using Xdpms 3"
3703 echores "yes"
3704 else
3705 def_xdpms='#undef CONFIG_XDPMS'
3706 echores "no"
3710 echocheck "Xv"
3711 if test "$_xv" = auto && test "$_x11" = yes ; then
3712 _xv=no
3713 statement_check_broken X11/Xlib.h X11/extensions/Xvlib.h 'XvGetPortAttribute(0, 0, 0, 0)' -lXv && _xv=yes
3716 if test "$_xv" = yes ; then
3717 def_xv='#define CONFIG_XV 1'
3718 libs_mplayer="$libs_mplayer -lXv"
3719 vomodules="xv $vomodules"
3720 else
3721 def_xv='#undef CONFIG_XV'
3722 novomodules="xv $novomodules"
3724 echores "$_xv"
3727 echocheck "VDPAU"
3728 if test "$_vdpau" = auto && test "$_x11" = yes ; then
3729 _vdpau=no
3730 if test "$_dl" = yes ; then
3731 pkg_config_add 'vdpau >= 0.2' && _vdpau=yes
3734 if test "$_vdpau" = yes ; then
3735 def_vdpau='#define CONFIG_VDPAU 1'
3736 vomodules="vdpau $vomodules"
3737 else
3738 def_vdpau='#define CONFIG_VDPAU 0'
3739 novomodules="vdpau $novomodules"
3741 echores "$_vdpau"
3744 echocheck "Xinerama"
3745 if test "$_xinerama" = auto && test "$_x11" = yes ; then
3746 _xinerama=no
3747 statement_check X11/extensions/Xinerama.h 'XineramaIsActive(0)' -lXinerama && _xinerama=yes
3750 if test "$_xinerama" = yes ; then
3751 def_xinerama='#define CONFIG_XINERAMA 1'
3752 libs_mplayer="$libs_mplayer -lXinerama"
3753 else
3754 def_xinerama='#undef CONFIG_XINERAMA'
3756 echores "$_xinerama"
3759 # Note: the -lXxf86vm library is the VideoMode extension and though it's not
3760 # needed for DGA, AFAIK every distribution packages together with DGA stuffs
3761 # named 'X extensions' or something similar.
3762 # This check may be useful for future mplayer versions (to change resolution)
3763 # If you run into problems, remove '-lXxf86vm'.
3764 echocheck "Xxf86vm"
3765 if test "$_vm" = auto && test "$_x11" = yes ; then
3766 _vm=no
3767 statement_check_broken X11/Xlib.h X11/extensions/xf86vmode.h 'XF86VidModeQueryExtension(0, 0, 0)' -lXxf86vm && _vm=yes
3769 if test "$_vm" = yes ; then
3770 def_vm='#define CONFIG_XF86VM 1'
3771 libs_mplayer="$libs_mplayer -lXxf86vm"
3772 else
3773 def_vm='#undef CONFIG_XF86VM'
3775 echores "$_vm"
3777 # Check for the presence of special keycodes, like audio control buttons
3778 # that XFree86 might have. Used to be bundled with the xf86vm check, but
3779 # has nothing to do with xf86vm and XFree 3.x has xf86vm but does NOT
3780 # have these new keycodes.
3781 echocheck "XF86keysym"
3782 if test "$_xf86keysym" = auto && test "$_x11" = yes ; then
3783 _xf86keysym=no
3784 return_check X11/XF86keysym.h XF86XK_AudioPause && _xf86keysym=yes
3786 if test "$_xf86keysym" = yes ; then
3787 def_xf86keysym='#define CONFIG_XF86XK 1'
3788 else
3789 def_xf86keysym='#undef CONFIG_XF86XK'
3791 echores "$_xf86keysym"
3794 echocheck "CACA"
3795 if test "$_caca" = auto ; then
3796 _caca=no
3797 if ( caca-config --version ) >> "$TMPLOG" 2>&1 ; then
3798 cat > $TMPC << EOF
3799 #include <caca.h>
3800 #ifdef CACA_API_VERSION_1
3801 #include <caca0.h>
3802 #endif
3803 int main(void) { caca_init(); return 0; }
3805 cc_check $(caca-config --libs) && _caca=yes
3808 if test "$_caca" = yes ; then
3809 def_caca='#define CONFIG_CACA 1'
3810 extra_cflags="$extra_cflags $(caca-config --cflags)"
3811 libs_mplayer="$libs_mplayer $(caca-config --libs)"
3812 vomodules="caca $vomodules"
3813 else
3814 def_caca='#undef CONFIG_CACA'
3815 novomodules="caca $novomodules"
3817 echores "$_caca"
3820 echocheck "DVB"
3821 if test "$_dvb" = auto ; then
3822 _dvb=no
3823 cat >$TMPC << EOF
3824 #include <poll.h>
3825 #include <sys/ioctl.h>
3826 #include <stdio.h>
3827 #include <time.h>
3828 #include <unistd.h>
3829 #include <linux/dvb/dmx.h>
3830 #include <linux/dvb/frontend.h>
3831 #include <linux/dvb/video.h>
3832 #include <linux/dvb/audio.h>
3833 int main(void) {return 0;}
3835 for _inc_tmp in "" "-I/usr/src/DVB/include" ; do
3836 cc_check $_inc_tmp && _dvb=yes &&
3837 extra_cflags="$extra_cflags $_inc_tmp" && break
3838 done
3840 echores "$_dvb"
3841 if test "$_dvb" = yes ; then
3842 _dvbin=yes
3843 inputmodules="dvb $inputmodules"
3844 def_dvbin='#define CONFIG_DVBIN 1'
3845 else
3846 _dvbin=no
3847 noinputmodules="dvb $noinputmodules"
3848 def_dvbin='#undef CONFIG_DVBIN '
3852 echocheck "PNG support"
3853 if test "$_png" = auto ; then
3854 _png=no
3855 cat > $TMPC << EOF
3856 #include <stdio.h>
3857 #include <string.h>
3858 #include <png.h>
3859 int main(void) {
3860 printf("png.h : %s\n", PNG_LIBPNG_VER_STRING);
3861 printf("libpng: %s\n", png_libpng_ver);
3862 return strcmp(PNG_LIBPNG_VER_STRING, png_libpng_ver);
3865 cc_check -lpng -lz $_ld_lm && _png=yes
3867 echores "$_png"
3868 if test "$_png" = yes ; then
3869 def_png='#define CONFIG_PNG 1'
3870 extra_ldflags="$extra_ldflags -lpng -lz"
3871 else
3872 def_png='#undef CONFIG_PNG'
3875 echocheck "MNG support"
3876 if test "$_mng" = auto ; then
3877 _mng=no
3878 return_statement_check libmng.h 'const char * p_ver = mng_version_text()' '!p_ver || p_ver[0] == 0' -lmng -lz $_ld_lm && _mng=yes
3880 echores "$_mng"
3881 if test "$_mng" = yes ; then
3882 def_mng='#define CONFIG_MNG 1'
3883 extra_ldflags="$extra_ldflags -lmng -lz"
3884 else
3885 def_mng='#undef CONFIG_MNG'
3888 echocheck "JPEG support"
3889 if test "$_jpeg" = auto ; then
3890 _jpeg=no
3891 header_check_broken stdio.h jpeglib.h -ljpeg $_ld_lm && _jpeg=yes
3893 echores "$_jpeg"
3895 if test "$_jpeg" = yes ; then
3896 def_jpeg='#define CONFIG_JPEG 1'
3897 vomodules="jpeg $vomodules"
3898 extra_ldflags="$extra_ldflags -ljpeg"
3899 else
3900 def_jpeg='#undef CONFIG_JPEG'
3901 novomodules="jpeg $novomodules"
3906 echocheck "PNM support"
3907 if test "$_pnm" = yes; then
3908 def_pnm="#define CONFIG_PNM 1"
3909 vomodules="pnm $vomodules"
3910 else
3911 def_pnm="#undef CONFIG_PNM"
3912 novomodules="pnm $novomodules"
3914 echores "$_pnm"
3918 echocheck "GIF support"
3919 # This is to appease people who want to force gif support.
3920 # If it is forced to yes, then we still do checks to determine
3921 # which gif library to use.
3922 if test "$_gif" = yes ; then
3923 _force_gif=yes
3924 _gif=auto
3927 if test "$_gif" = auto ; then
3928 _gif=no
3929 for _ld_gif in "-lungif" "-lgif" ; do
3930 statement_check gif_lib.h 'QuantizeBuffer(0, 0, 0, 0, 0, 0, 0, 0)' $_ld_gif && _gif=yes && break
3931 done
3934 # If no library was found, and the user wants support forced,
3935 # then we force it on with libgif, as this is the safest
3936 # assumption IMHO. (libungif & libregif both create symbolic
3937 # links to libgif. We also assume that no x11 support is needed,
3938 # because if you are forcing this, then you _should_ know what
3939 # you are doing. [ Besides, package maintainers should never
3940 # have compiled x11 deps into libungif in the first place. ] )
3941 # </rant>
3942 # --Joey
3943 if test "$_force_gif" = yes && test "$_gif" = no ; then
3944 _gif=yes
3945 _ld_gif="-lgif"
3948 if test "$_gif" = yes ; then
3949 def_gif='#define CONFIG_GIF 1'
3950 codecmodules="gif $codecmodules"
3951 vomodules="gif89a $vomodules"
3952 res_comment="old version, some encoding functions disabled"
3953 def_gif_4='#undef CONFIG_GIF_4'
3954 extra_ldflags="$extra_ldflags $_ld_gif"
3956 cat > $TMPC << EOF
3957 #include <signal.h>
3958 #include <stdio.h>
3959 #include <stdlib.h>
3960 #include <gif_lib.h>
3961 static void catch(int sig) { exit(1); }
3962 int main(void) {
3963 signal(SIGSEGV, catch); // catch segfault
3964 printf("EGifPutExtensionFirst is at address %p\n", EGifPutExtensionFirst);
3965 EGifSetGifVersion("89a"); // this will segfault a buggy gif lib.
3966 return 0;
3969 if cc_check "$_ld_gif" ; then
3970 def_gif_4='#define CONFIG_GIF_4 1'
3971 res_comment=""
3973 else
3974 def_gif='#undef CONFIG_GIF'
3975 def_gif_4='#undef CONFIG_GIF_4'
3976 novomodules="gif89a $novomodules"
3977 nocodecmodules="gif $nocodecmodules"
3979 echores "$_gif"
3982 case "$_gif" in yes*)
3983 echocheck "broken giflib workaround"
3984 def_gif_tvt_hack='#define CONFIG_GIF_TVT_HACK 1'
3986 cat > $TMPC << EOF
3987 #include <stdio.h>
3988 #include <gif_lib.h>
3989 int main(void) {
3990 GifFileType gif = {.UserData = NULL};
3991 printf("UserData is at address %p\n", gif.UserData);
3992 return 0;
3995 if cc_check "$_ld_gif" ; then
3996 def_gif_tvt_hack='#undef CONFIG_GIF_TVT_HACK'
3997 echores "disabled"
3998 else
3999 echores "enabled"
4002 esac
4005 #################
4006 # VIDEO + AUDIO #
4007 #################
4010 echocheck "SDL"
4011 _inc_tmp=""
4012 _ld_tmp=""
4013 def_sdl_sdl_h="#undef CONFIG_SDL_SDL_H"
4014 if test -z "$_sdlconfig" ; then
4015 if ( sdl-config --version ) >>"$TMPLOG" 2>&1 ; then
4016 _sdlconfig="sdl-config"
4017 elif ( sdl11-config --version ) >>"$TMPLOG" 2>&1 ; then
4018 _sdlconfig="sdl11-config"
4019 else
4020 _sdlconfig=false
4023 if test "$_sdl" = auto || test "$_sdl" = yes ; then
4024 cat > $TMPC << EOF
4025 #ifdef CONFIG_SDL_SDL_H
4026 #include <SDL/SDL.h>
4027 #else
4028 #include <SDL.h>
4029 #endif
4030 #ifndef __APPLE__
4031 // we allow SDL hacking our main() only on OSX
4032 #undef main
4033 #endif
4034 int main(int argc, char *argv[]) {
4035 SDL_Init(SDL_INIT_VIDEO|SDL_INIT_NOPARACHUTE);
4036 return 0;
4039 _sdl=no
4040 for _ld_tmp in "-lSDL" "-lSDL -lpthread" "-lSDL -lwinmm -lgdi32" "-lSDL -lwinmm -lgdi32 -ldxguid" ; do
4041 if cc_check -DCONFIG_SDL_SDL_H $_inc_tmp $_ld_tmp ; then
4042 _sdl=yes
4043 def_sdl_sdl_h="#define CONFIG_SDL_SDL_H 1"
4044 break
4046 done
4047 if test "$_sdl" = no && "$_sdlconfig" --version >>"$TMPLOG" 2>&1 ; then
4048 res_comment="using $_sdlconfig"
4049 if cygwin ; then
4050 _inc_tmp="$($_sdlconfig --cflags | cut -d " " -f 1,5,6 | sed s/no-cygwin/cygwin/)"
4051 _ld_tmp="$($_sdlconfig --libs | cut -d " " -f 1,4,6 | sed s/no-cygwin/cygwin/)"
4052 elif mingw32 ; then
4053 _inc_tmp=$($_sdlconfig --cflags | sed s/-Dmain=SDL_main//)
4054 _ld_tmp=$($_sdlconfig --libs | sed -e s/-mwindows// -e s/-lmingw32//)
4055 else
4056 _inc_tmp="$($_sdlconfig --cflags)"
4057 _ld_tmp="$($_sdlconfig --libs)"
4059 if cc_check $_inc_tmp $_ld_tmp >>"$TMPLOG" 2>&1 ; then
4060 _sdl=yes
4061 elif cc_check $_inc_tmp $_ld_tmp -lstdc++ >>"$TMPLOG" 2>&1 ; then
4062 # HACK for BeOS/Haiku SDL
4063 _ld_tmp="$_ld_tmp -lstdc++"
4064 _sdl=yes
4068 if test "$_sdl" = yes ; then
4069 def_sdl='#define CONFIG_SDL 1'
4070 extra_cflags="$extra_cflags $_inc_tmp"
4071 libs_mplayer="$libs_mplayer $_ld_tmp"
4072 vomodules="sdl $vomodules"
4073 aomodules="sdl $aomodules"
4074 else
4075 def_sdl='#undef CONFIG_SDL'
4076 novomodules="sdl $novomodules"
4077 noaomodules="sdl $noaomodules"
4079 echores "$_sdl"
4082 # make sure this stays below CoreVideo to avoid issues due to namespace
4083 # conflicts between -lGL and -framework OpenGL
4084 echocheck "OpenGL"
4085 #Note: this test is run even with --enable-gl since we autodetect linker flags
4086 if (test "$_x11" = yes || test "$_sdl" = yes || test "$_cocoa" = yes || win32) && test "$_gl" != no ; then
4087 cat > $TMPC << EOF
4088 #ifdef GL_WIN32
4089 #include <windows.h>
4090 #include <GL/gl.h>
4091 #elif defined(GL_SDL)
4092 #include <GL/gl.h>
4093 #ifdef CONFIG_SDL_SDL_H
4094 #include <SDL/SDL.h>
4095 #else
4096 #include <SDL.h>
4097 #endif
4098 #ifndef __APPLE__
4099 // we allow SDL hacking our main() only on OSX
4100 #undef main
4101 #endif
4102 #else
4103 #include <GL/gl.h>
4104 #include <X11/Xlib.h>
4105 #include <GL/glx.h>
4106 #endif
4107 int main(int argc, char *argv[]) {
4108 #ifdef GL_WIN32
4109 HDC dc;
4110 wglCreateContext(dc);
4111 #elif defined(GL_SDL)
4112 SDL_GL_SwapBuffers();
4113 #else
4114 glXCreateContext(NULL, NULL, NULL, True);
4115 #endif
4116 glFinish();
4117 return 0;
4120 _gl=no
4121 if test "$_x11" = yes ; then
4122 for _ld_tmp in "" -lGL "-lGL -lXdamage" "-lGL $_ld_pthread" ; do
4123 if cc_check $_ld_tmp $_ld_lm ; then
4124 _gl=yes
4125 _gl_x11=yes
4126 libs_mplayer="$libs_mplayer $_ld_tmp $_ld_dl"
4127 break
4129 done
4131 if win32 && cc_check -DGL_WIN32 -lopengl32 ; then
4132 _gl=yes
4133 _gl_win32=yes
4134 libs_mplayer="$libs_mplayer -lopengl32 -lgdi32"
4136 if test "$_cocoa" = yes ; then
4137 _gl=yes
4138 _gl_cocoa=yes
4140 # last so it can reuse any linker etc. flags detected before
4141 if test "$_sdl" = yes ; then
4142 if cc_check -DGL_SDL ||
4143 cc_check -DCONFIG_SDL_SDL_H -DGL_SDL ; then
4144 _gl=yes
4145 _gl_sdl=yes
4146 elif cc_check -DGL_SDL -lGL ||
4147 cc_check -DCONFIG_SDL_SDL_H -DGL_SDL -lGL ; then
4148 _gl=yes
4149 _gl_sdl=yes
4150 libs_mplayer="$libs_mplayer -lGL"
4153 else
4154 _gl=no
4156 if test "$_gl" = yes ; then
4157 def_gl='#define CONFIG_GL 1'
4158 res_comment="backends:"
4159 if test "$_gl_cocoa" = yes ; then
4160 def_gl_cocoa='#define CONFIG_GL_COCOA 1'
4161 res_comment="$res_comment cocoa"
4163 if test "$_gl_win32" = yes ; then
4164 def_gl_win32='#define CONFIG_GL_WIN32 1'
4165 res_comment="$res_comment win32"
4167 if test "$_gl_x11" = yes ; then
4168 def_gl_x11='#define CONFIG_GL_X11 1'
4169 res_comment="$res_comment x11"
4171 if test "$_gl_sdl" = yes ; then
4172 def_gl_sdl='#define CONFIG_GL_SDL 1'
4173 res_comment="$res_comment sdl"
4175 vomodules="opengl $vomodules"
4176 else
4177 def_gl='#undef CONFIG_GL'
4178 def_gl_cocoa='#undef CONFIG_GL_COCOA'
4179 def_gl_win32='#undef CONFIG_GL_WIN32'
4180 def_gl_x11='#undef CONFIG_GL_X11'
4181 def_gl_sdl='#undef CONFIG_GL_SDL'
4182 novomodules="opengl $novomodules"
4184 echores "$_gl"
4187 if win32; then
4189 echocheck "Direct3D"
4190 if test "$_direct3d" = auto ; then
4191 _direct3d=no
4192 header_check d3d9.h && _direct3d=yes
4194 if test "$_direct3d" = yes ; then
4195 def_direct3d='#define CONFIG_DIRECT3D 1'
4196 vomodules="direct3d $vomodules"
4197 else
4198 def_direct3d='#undef CONFIG_DIRECT3D'
4199 novomodules="direct3d $novomodules"
4201 echores "$_direct3d"
4203 echocheck "Directx"
4204 if test "$_directx" = auto ; then
4205 cat > $TMPC << EOF
4206 #include <ddraw.h>
4207 #include <dsound.h>
4208 int main(void) { return 0; }
4210 _directx=no
4211 cc_check -lgdi32 && _directx=yes
4213 if test "$_directx" = yes ; then
4214 def_directx='#define CONFIG_DIRECTX 1'
4215 libs_mplayer="$libs_mplayer -lgdi32"
4216 vomodules="directx $vomodules"
4217 aomodules="dsound $aomodules"
4218 else
4219 def_directx='#undef CONFIG_DIRECTX'
4220 novomodules="directx $novomodules"
4221 noaomodules="dsound $noaomodules"
4223 echores "$_directx"
4225 fi #if win32; then
4228 echocheck "V4L2 MPEG Decoder"
4229 if test "$_v4l2" = auto ; then
4230 cat > $TMPC << EOF
4231 #include <sys/time.h>
4232 #include <linux/videodev2.h>
4233 #include <linux/version.h>
4234 int main(void) {
4235 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22)
4236 #error kernel headers too old, need 2.6.22
4237 #endif
4238 struct v4l2_ext_controls ctrls;
4239 ctrls.ctrl_class = V4L2_CTRL_CLASS_MPEG;
4240 return 0;
4243 _v4l2=no
4244 cc_check && _v4l2=yes
4246 if test "$_v4l2" = yes ; then
4247 def_v4l2='#define CONFIG_V4L2_DECODER 1'
4248 vomodules="v4l2 $vomodules"
4249 aomodules="v4l2 $aomodules"
4250 else
4251 def_v4l2='#undef CONFIG_V4L2_DECODER'
4252 novomodules="v4l2 $novomodules"
4253 noaomodules="v4l2 $noaomodules"
4255 echores "$_v4l2"
4259 #########
4260 # AUDIO #
4261 #########
4264 echocheck "OSS Audio"
4265 if test "$_ossaudio" = auto ; then
4266 _ossaudio=no
4267 return_check $_soundcard_header SNDCTL_DSP_SETFRAGMENT && _ossaudio=yes
4269 if test "$_ossaudio" = yes ; then
4270 def_ossaudio='#define CONFIG_OSS_AUDIO 1'
4271 aomodules="oss $aomodules"
4272 cat > $TMPC << EOF
4273 #include <$_soundcard_header>
4274 #ifdef OPEN_SOUND_SYSTEM
4275 int main(void) { return 0; }
4276 #else
4277 #error Not the real thing
4278 #endif
4280 _real_ossaudio=no
4281 cc_check && _real_ossaudio=yes
4282 if test "$_real_ossaudio" = yes; then
4283 def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/dsp"'
4284 # Check for OSS4 headers (override default headers)
4285 # Does not apply to systems where OSS4 is native (e.g. FreeBSD)
4286 if test -f /etc/oss.conf; then
4287 . /etc/oss.conf
4288 _ossinc="$OSSLIBDIR/include"
4289 if test -f "$_ossinc/sys/soundcard.h"; then
4290 extra_cflags="-I$_ossinc $extra_cflags"
4293 elif netbsd || openbsd ; then
4294 def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/sound"'
4295 extra_ldflags="$extra_ldflags -lossaudio"
4296 else
4297 def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/dsp"'
4299 def_ossaudio_devmixer='#define PATH_DEV_MIXER "/dev/mixer"'
4300 else
4301 def_ossaudio='#undef CONFIG_OSS_AUDIO'
4302 def_ossaudio_devdsp='#define PATH_DEV_DSP ""'
4303 def_ossaudio_devmixer='#define PATH_DEV_MIXER ""'
4304 noaomodules="oss $noaomodules"
4306 echores "$_ossaudio"
4309 echocheck "RSound"
4310 if test "$_rsound" = auto ; then
4311 _rsound=no
4312 statement_check rsound.h 'rsd_init(NULL);' -lrsound && _rsound=yes
4314 echores "$_rsound"
4316 if test "$_rsound" = yes ; then
4317 def_rsound='#define CONFIG_RSOUND 1'
4318 aomodules="rsound $aomodules"
4319 libs_mplayer="$libs_mplayer -lrsound"
4320 else
4321 def_rsound='#undef CONFIG_RSOUND'
4322 noaomodules="rsound $noaomodules"
4326 echocheck "pulse"
4327 if test "$_pulse" = auto ; then
4328 _pulse=no
4329 if pkg_config_add 'libpulse >= 0.9' ; then
4330 _pulse=yes
4333 echores "$_pulse"
4335 if test "$_pulse" = yes ; then
4336 def_pulse='#define CONFIG_PULSE 1'
4337 aomodules="pulse $aomodules"
4338 else
4339 def_pulse='#undef CONFIG_PULSE'
4340 noaomodules="pulse $noaomodules"
4344 echocheck "PortAudio"
4345 if test "$_portaudio" = auto && test "$_pthreads" != yes ; then
4346 _portaudio=no
4347 res_comment="pthreads not enabled"
4349 if test "$_portaudio" = auto ; then
4350 _portaudio=no
4351 if pkg_config_add 'portaudio-2.0 >= 19' ; then
4352 _portaudio=yes
4355 echores "$_portaudio"
4357 if test "$_portaudio" = yes ; then
4358 def_portaudio='#define CONFIG_PORTAUDIO 1'
4359 aomodules="portaudio $aomodules"
4360 else
4361 def_portaudio='#undef CONFIG_PORTAUDIO'
4362 noaomodules="portaudio $noaomodules"
4366 echocheck "JACK"
4367 if test "$_jack" = auto ; then
4368 _jack=no
4369 if pkg_config_add jack ; then
4370 _jack=yes
4374 if test "$_jack" = yes ; then
4375 def_jack='#define CONFIG_JACK 1'
4376 aomodules="jack $aomodules"
4377 else
4378 noaomodules="jack $noaomodules"
4380 echores "$_jack"
4382 echocheck "OpenAL"
4383 if test "$_openal" = auto ; then
4384 _openal=no
4385 cat > $TMPC << EOF
4386 #ifdef OPENAL_AL_H
4387 #include <OpenAL/al.h>
4388 #else
4389 #include <AL/al.h>
4390 #endif
4391 int main(void) {
4392 alSourceQueueBuffers(0, 0, 0);
4393 // alGetSourcei(0, AL_SAMPLE_OFFSET, 0);
4394 return 0;
4397 for I in "-lopenal" "-lopenal32" "-framework OpenAL" ; do
4398 cc_check $I && _openal=yes && break
4399 cc_check -DOPENAL_AL_H=1 $I && def_openal_h='#define OPENAL_AL_H 1' && _openal=yes && break
4400 done
4401 test "$_openal" = yes && libs_mplayer="$libs_mplayer $I"
4403 if test "$_openal" = yes ; then
4404 def_openal='#define CONFIG_OPENAL 1'
4405 aomodules="openal $aomodules"
4406 else
4407 noaomodules="openal $noaomodules"
4409 echores "$_openal"
4411 echocheck "ALSA audio"
4412 if test "$_alloca" != yes ; then
4413 _alsa=no
4414 res_comment="alloca missing"
4416 if test "$_alsa" = auto ; then
4417 _alsa=no
4418 if pkg_config_add "alsa >= 1.0.9" ; then
4419 _alsa=yes
4422 def_alsa='#undef CONFIG_ALSA'
4423 if test "$_alsa" = yes ; then
4424 aomodules="alsa $aomodules"
4425 def_alsa='#define CONFIG_ALSA 1'
4426 else
4427 noaomodules="alsa $noaomodules"
4429 echores "$_alsa"
4432 if darwin; then
4433 echocheck "CoreAudio"
4434 if test "$_coreaudio" = auto ; then
4435 cat > $TMPC <<EOF
4436 #include <CoreAudio/CoreAudio.h>
4437 #include <AudioToolbox/AudioToolbox.h>
4438 #include <AudioUnit/AudioUnit.h>
4439 int main(void) { return 0; }
4441 _coreaudio=no
4442 cc_check -framework CoreAudio -framework AudioUnit -framework AudioToolbox && _coreaudio=yes
4444 if test "$_coreaudio" = yes ; then
4445 libs_mplayer="$libs_mplayer -framework CoreAudio -framework AudioUnit -framework AudioToolbox"
4446 def_coreaudio='#define CONFIG_COREAUDIO 1'
4447 aomodules="coreaudio $aomodules"
4448 else
4449 def_coreaudio='#undef CONFIG_COREAUDIO'
4450 noaomodules="coreaudio $noaomodules"
4452 echores $_coreaudio
4453 fi #if darwin
4456 # set default CD/DVD devices
4457 if win32 ; then
4458 default_cdrom_device="D:"
4459 elif darwin ; then
4460 default_cdrom_device="/dev/disk1"
4461 elif dragonfly ; then
4462 default_cdrom_device="/dev/cd0"
4463 elif freebsd ; then
4464 default_cdrom_device="/dev/acd0"
4465 elif openbsd ; then
4466 default_cdrom_device="/dev/rcd0c"
4467 elif amigaos ; then
4468 default_cdrom_device="a1ide.device:2"
4469 else
4470 default_cdrom_device="/dev/cdrom"
4473 if win32 || dragonfly || freebsd || openbsd || amigaos ; then
4474 default_dvd_device=$default_cdrom_device
4475 elif darwin ; then
4476 default_dvd_device="/dev/rdiskN"
4477 else
4478 default_dvd_device="/dev/dvd"
4482 echocheck "VCD support"
4483 if test "$_vcd" = auto; then
4484 _vcd=no
4485 if linux || freebsd || netbsd || openbsd || dragonfly || bsdos || darwin ; then
4486 _vcd=yes
4487 elif mingw32; then
4488 header_check ddk/ntddcdrm.h && _vcd=yes
4491 if test "$_vcd" = yes; then
4492 inputmodules="vcd $inputmodules"
4493 def_vcd='#define CONFIG_VCD 1'
4494 else
4495 def_vcd='#undef CONFIG_VCD'
4496 noinputmodules="vcd $noinputmodules"
4497 res_comment="not supported on this OS"
4499 echores "$_vcd"
4503 echocheck "Blu-ray support"
4504 if test "$_bluray" = auto ; then
4505 _bluray=no
4506 pkg_config_add 'libbluray >= 0.2.1' && _bluray=yes
4508 if test "$_bluray" = yes ; then
4509 def_bluray='#define CONFIG_LIBBLURAY 1'
4510 inputmodules="bluray $inputmodules"
4511 else
4512 def_bluray='#undef CONFIG_LIBBLURAY'
4513 noinputmodules="bluray $noinputmodules"
4515 echores "$_bluray"
4517 echocheck "dvdread"
4518 if test "$_dvdread_internal" = auto && test ! -f "libdvdread4/dvd_reader.c" ; then
4519 _dvdread_internal=no
4521 if test "$_dvdread_internal" = auto ; then
4522 _dvdread_internal=no
4523 _dvdread=no
4524 if (linux || freebsd || netbsd || openbsd || dragonfly || hpux) &&
4525 (test "$_dvd" = yes || test "$_cdrom" = yes || test "$_cdio" = yes ||
4526 test "$_dvdio" = yes || test "$_bsdi_dvd" = yes) ||
4527 darwin || win32; then
4528 _dvdread_internal=yes
4529 _dvdread=yes
4530 extra_cflags="-Ilibdvdread4 $extra_cflags"
4532 elif test "$_dvdread" = auto ; then
4533 _dvdread=no
4534 if test "$_dl" = yes; then
4535 _dvdreadcflags=$($_dvdreadconfig --cflags 2> /dev/null)
4536 _dvdreadlibs=$($_dvdreadconfig --libs 2> /dev/null)
4537 if header_check dvdread/dvd_reader.h $_dvdreadcflags $_dvdreadlibs $_ld_dl ; then
4538 _dvdread=yes
4539 extra_cflags="$extra_cflags $_dvdreadcflags"
4540 extra_ldflags="$extra_ldflags $_dvdreadlibs"
4541 res_comment="external"
4546 if test "$_dvdread_internal" = yes; then
4547 def_dvdread='#define CONFIG_DVDREAD 1'
4548 inputmodules="dvdread(internal) $inputmodules"
4549 res_comment="internal"
4550 elif test "$_dvdread" = yes; then
4551 def_dvdread='#define CONFIG_DVDREAD 1'
4552 extra_ldflags="$extra_ldflags -ldvdread"
4553 inputmodules="dvdread(external) $inputmodules"
4554 res_comment="external"
4555 else
4556 def_dvdread='#undef CONFIG_DVDREAD'
4557 noinputmodules="dvdread $noinputmodules"
4559 echores "$_dvdread"
4562 echocheck "internal libdvdcss"
4563 if test "$_libdvdcss_internal" = auto ; then
4564 _libdvdcss_internal=no
4565 test "$_dvdread_internal" = yes && test -d libdvdcss && _libdvdcss_internal=yes
4566 hpux && test "$_hpux_scsi_h" = no && _libdvdcss_internal=no
4568 if test "$_libdvdcss_internal" = yes ; then
4569 if linux || netbsd || openbsd || bsdos ; then
4570 def_dvd_linux='#define HAVE_LINUX_DVD_STRUCT 1'
4571 openbsd && def_dvd_openbsd='#define HAVE_OPENBSD_DVD_STRUCT 1'
4572 elif freebsd || dragonfly ; then
4573 def_dvd_bsd='#define HAVE_BSD_DVD_STRUCT 1'
4574 elif darwin ; then
4575 def_dvd_darwin='#define DARWIN_DVD_IOCTL'
4576 extra_ldflags="$extra_ldflags -framework IOKit -framework Carbon"
4577 elif cygwin ; then
4578 cflags_libdvdcss="-DSYS_CYGWIN -DWIN32"
4579 elif beos ; then
4580 cflags_libdvdcss="-DSYS_BEOS"
4582 cflags_libdvdcss_dvdread="-Ilibdvdcss"
4583 def_dvdcss="#define HAVE_DVDCSS_DVDCSS_H 1"
4584 inputmodules="libdvdcss(internal) $inputmodules"
4585 else
4586 noinputmodules="libdvdcss(internal) $noinputmodules"
4588 echores "$_libdvdcss_internal"
4591 echocheck "libcdio"
4592 if test "$_libcdio" = auto ; then
4593 _libcdio=no
4594 if pkg_config_add libcdio_paranoia ; then
4595 _libcdio=yes
4598 if test "$_libcdio" = yes ; then
4599 _cdda='yes'
4600 def_cdda='#define CONFIG_CDDA 1'
4601 test $_cddb = auto && test $networking = yes && _cddb=yes
4602 inputmodules="cdda $inputmodules"
4603 else
4604 _libcdio=no
4605 _cdda='no'
4606 def_cdda='#undef CONFIG_CDDA'
4607 noinputmodules="cdda $noinputmodules"
4609 echores "$_libcdio"
4611 if test "$_cddb" = yes ; then
4612 def_cddb='#define CONFIG_CDDB 1'
4613 inputmodules="cddb $inputmodules"
4614 else
4615 _cddb=no
4616 def_cddb='#undef CONFIG_CDDB'
4617 noinputmodules="cddb $noinputmodules"
4621 echocheck "SSA/ASS support"
4622 if test "$_ass" = auto ; then
4623 if pkg_config_add libass ; then
4624 _ass=yes
4625 def_ass='#define CONFIG_ASS 1'
4626 else
4627 die "Unable to find development files for libass. Aborting. If you really mean to compile without libass support use --disable-libass."
4629 else
4630 def_ass='#undef CONFIG_ASS'
4632 echores "$_ass"
4635 echocheck "ENCA"
4636 if test "$_enca" = auto ; then
4637 _enca=no
4638 statement_check enca.h 'enca_get_languages(NULL)' -lenca $_ld_lm && _enca=yes
4640 if test "$_enca" = yes ; then
4641 def_enca='#define CONFIG_ENCA 1'
4642 extra_ldflags="$extra_ldflags -lenca"
4643 else
4644 def_enca='#undef CONFIG_ENCA'
4646 echores "$_enca"
4649 echocheck "zlib"
4650 _zlib=no
4651 statement_check zlib.h 'inflate(0, Z_NO_FLUSH)' -lz && _zlib=yes
4652 if test "$_zlib" = yes ; then
4653 def_zlib='#define CONFIG_ZLIB 1'
4654 extra_ldflags="$extra_ldflags -lz"
4655 else
4656 def_zlib='#define CONFIG_ZLIB 0'
4658 echores "$_zlib"
4661 echocheck "RTC"
4662 if test "$_rtc" = auto ; then
4663 cat > $TMPC << EOF
4664 #include <sys/ioctl.h>
4665 #ifdef __linux__
4666 #include <linux/rtc.h>
4667 #else
4668 #include <rtc.h>
4669 #define RTC_PIE_ON RTCIO_PIE_ON
4670 #endif
4671 int main(void) { return RTC_PIE_ON; }
4673 _rtc=no
4674 cc_check && _rtc=yes
4675 ppc && _rtc=no
4677 if test "$_rtc" = yes ; then
4678 def_rtc='#define HAVE_RTC 1'
4679 else
4680 def_rtc='#undef HAVE_RTC'
4682 echores "$_rtc"
4685 echocheck "mad support"
4686 if test "$_mad" = auto ; then
4687 _mad=no
4688 header_check mad.h -lmad && _mad=yes
4690 if test "$_mad" = yes ; then
4691 def_mad='#define CONFIG_LIBMAD 1'
4692 extra_ldflags="$extra_ldflags -lmad"
4693 codecmodules="libmad $codecmodules"
4694 else
4695 def_mad='#undef CONFIG_LIBMAD'
4696 nocodecmodules="libmad $nocodecmodules"
4698 echores "$_mad"
4700 echocheck "OggVorbis support"
4701 if test "$_libvorbis" = auto; then
4702 _libvorbis=no
4703 statement_check vorbis/codec.h 'vorbis_packet_blocksize(0, 0)' -lvorbis -logg $_ld_lm && _libvorbis=yes && _tremor=no
4704 elif test "$_libvorbis" = yes ; then
4705 _tremor=no
4707 if test "$_tremor" = auto; then
4708 _tremor=no
4709 statement_check tremor/ivorbiscodec.h 'vorbis_packet_blocksize(0, 0)' -logg -lvorbisidec $_ld_lm && _tremor=yes
4711 if test "$_tremor" = yes ; then
4712 _vorbis=yes
4713 def_vorbis='#define CONFIG_OGGVORBIS 1'
4714 def_tremor='#define CONFIG_TREMOR 1'
4715 codecmodules="tremor(external) $codecmodules"
4716 res_comment="external Tremor"
4717 extra_ldflags="$extra_ldflags -logg -lvorbisidec"
4718 elif test "$_libvorbis" = yes ; then
4719 _vorbis=yes
4720 def_vorbis='#define CONFIG_OGGVORBIS 1'
4721 codecmodules="libvorbis $codecmodules"
4722 res_comment="libvorbis"
4723 extra_ldflags="$extra_ldflags -lvorbis -logg"
4724 else
4725 _vorbis=no
4726 nocodecmodules="libvorbis $nocodecmodules"
4728 echores "$_vorbis"
4730 echocheck "libspeex (version >= 1.1 required)"
4731 if test "$_speex" = auto ; then
4732 _speex=no
4733 cat > $TMPC << EOF
4734 #include <stddef.h>
4735 #include <speex/speex.h>
4736 int main(void) { SpeexBits bits; void *dec = NULL; speex_decode_int(dec, &bits, dec); return 0; }
4738 cc_check -lspeex $_ld_lm && _speex=yes
4740 if test "$_speex" = yes ; then
4741 def_speex='#define CONFIG_SPEEX 1'
4742 extra_ldflags="$extra_ldflags -lspeex"
4743 codecmodules="speex $codecmodules"
4744 else
4745 def_speex='#undef CONFIG_SPEEX'
4746 nocodecmodules="speex $nocodecmodules"
4748 echores "$_speex"
4750 echocheck "OggTheora support"
4751 if test "$_theora" = auto ; then
4752 _theora=no
4753 if pkg_config_add theora ; then
4754 _theora=yes
4757 if test "$_theora" = yes ; then
4758 def_theora='#define CONFIG_OGGTHEORA 1'
4759 codecmodules="libtheora $codecmodules"
4760 else
4761 def_theora='#undef CONFIG_OGGTHEORA'
4762 nocodecmodules="libtheora $nocodecmodules"
4764 echores "$_theora"
4766 # Any version of libmpg123 that knows MPG123_RESYNC_LIMIT shall be fine.
4767 # That is, 1.2.0 onwards. Recommened is 1.14 onwards, though.
4768 echocheck "mpg123 support"
4769 def_mpg123='#undef CONFIG_MPG123'
4770 if test "$_mpg123" = auto; then
4771 _mpg123=no
4772 pkg_config_add 'libmpg123 >= 1.2.0' && _mpg123=yes
4774 if test "$_mpg123" = yes ; then
4775 def_mpg123='#define CONFIG_MPG123 1'
4776 codecmodules="mpg123 $codecmodules"
4777 else
4778 nocodecmodules="mpg123 $nocodecmodules"
4780 echores "$_mpg123"
4782 echocheck "liba52 support"
4783 def_liba52='#undef CONFIG_LIBA52'
4784 if test "$_liba52" = auto ; then
4785 _liba52=no
4786 cat > $TMPC << EOF
4787 #include <inttypes.h>
4788 #include <a52dec/a52.h>
4789 int main(void) { a52_state_t *testHand; testHand=a52_init(0); return 0; }
4791 cc_check -la52 && _liba52=yes && extra_ldflags="$extra_ldflags -la52"
4793 if test "$_liba52" = yes ; then
4794 def_liba52='#define CONFIG_LIBA52 1'
4795 codecmodules="liba52 $codecmodules"
4796 else
4797 nocodecmodules="liba52 $nocodecmodules"
4799 echores "$_liba52"
4801 echocheck "libdca support"
4802 if test "$_libdca" = auto ; then
4803 _libdca=no
4804 for _ld_dca in -ldca -ldts ; do
4805 statement_check_broken stdint.h dts.h 'dts_init(0)' $_ld_dca $_ld_lm &&
4806 extra_ldflags="$extra_ldflags $_ld_dca" && _libdca=yes && break
4807 done
4809 if test "$_libdca" = yes ; then
4810 def_libdca='#define CONFIG_LIBDCA 1'
4811 codecmodules="libdca $codecmodules"
4812 else
4813 def_libdca='#undef CONFIG_LIBDCA'
4814 nocodecmodules="libdca $nocodecmodules"
4816 echores "$_libdca"
4818 echocheck "libmpcdec (musepack, version >= 1.2.1 required)"
4819 if test "$_musepack" = yes ; then
4820 _musepack=no
4821 cat > $TMPC << EOF
4822 #include <stddef.h>
4823 #include <mpcdec/mpcdec.h>
4824 int main(void) {
4825 mpc_streaminfo info;
4826 mpc_decoder decoder;
4827 mpc_decoder_set_streaminfo(&decoder, &info);
4828 mpc_decoder_decode_frame(&decoder, NULL, 0, NULL);
4829 return 0;
4832 cc_check -lmpcdec $_ld_lm && _musepack=yes
4834 if test "$_musepack" = yes ; then
4835 def_musepack='#define CONFIG_MUSEPACK 1'
4836 extra_ldflags="$extra_ldflags -lmpcdec"
4837 codecmodules="musepack $codecmodules"
4838 else
4839 def_musepack='#undef CONFIG_MUSEPACK'
4840 nocodecmodules="musepack $nocodecmodules"
4842 echores "$_musepack"
4845 echocheck "FAAD2 support"
4846 if test "$_faad" = auto ; then
4847 _faad=no
4848 cat > $TMPC << EOF
4849 #include <faad.h>
4850 #ifndef FAAD_MIN_STREAMSIZE
4851 #error Too old version
4852 #endif
4853 int main(void) { faacDecHandle testhand; faacDecFrameInfo testinfo;
4854 testhand = faacDecOpen(); faacDecInit(0, 0, 0, 0, 0); return 0; }
4856 cc_check -lfaad $_ld_lm && _faad=yes
4859 def_faad='#undef CONFIG_FAAD'
4860 if test "$_faad" = yes ; then
4861 def_faad='#define CONFIG_FAAD 1'
4862 extra_ldflags="$extra_ldflags -lfaad"
4863 codecmodules="faad2 $codecmodules"
4864 else
4865 nocodecmodules="faad2 $nocodecmodules"
4867 echores "$_faad"
4870 echocheck "LADSPA plugin support"
4871 if test "$_ladspa" = auto ; then
4872 _ladspa=no
4873 statement_check ladspa.h 'LADSPA_Descriptor ld = {0}' && _ladspa=yes
4875 if test "$_ladspa" = yes; then
4876 def_ladspa="#define CONFIG_LADSPA 1"
4877 else
4878 def_ladspa="#undef CONFIG_LADSPA"
4880 echores "$_ladspa"
4883 echocheck "libbs2b audio filter support"
4884 if test "$_libbs2b" = auto ; then
4885 _libbs2b=no
4886 if pkg_config_add libbs2b ; then
4887 _libbs2b=yes
4890 def_libbs2b="#undef CONFIG_LIBBS2B"
4891 test "$_libbs2b" = yes && def_libbs2b="#define CONFIG_LIBBS2B 1"
4892 echores "$_libbs2b"
4895 if test -z "$_codecsdir" ; then
4896 for dir in "$_libdir/codecs" "$_libdir/win32" /usr/local/lib/codecs \
4897 /usr/lib/codecs /usr/local/lib/win32 /usr/lib/win32 ; do
4898 if test -d "$dir" ; then
4899 _codecsdir="$dir"
4900 break;
4902 done
4904 # Fall back on default directory.
4905 if test -z "$_codecsdir" ; then
4906 _codecsdir="$_libdir/codecs"
4907 mingw32 && _codecsdir="codecs"
4911 echocheck "Win32 codecs"
4912 if test "$_win32dll" = auto ; then
4913 _win32dll=no
4914 if x86_32 && ! qnx; then
4915 _win32dll=yes
4918 if test "$_win32dll" = yes ; then
4919 def_win32dll='#define CONFIG_WIN32DLL 1'
4920 if ! win32 ; then
4921 def_win32_loader='#define WIN32_LOADER 1'
4922 _win32_emulation=yes
4923 else
4924 extra_ldflags="$extra_ldflags -ladvapi32 -lole32"
4925 res_comment="using native windows"
4927 codecmodules="win32 $codecmodules"
4928 else
4929 def_win32dll='#undef CONFIG_WIN32DLL'
4930 def_win32_loader='#undef WIN32_LOADER'
4931 nocodecmodules="win32 $nocodecmodules"
4933 echores "$_win32dll"
4936 echocheck "XAnim codecs"
4937 if test "$_xanim" = auto ; then
4938 _xanim=no
4939 res_comment="dynamic loader support needed"
4940 if test "$_dl" = yes ; then
4941 _xanim=yes
4944 if test "$_xanim" = yes ; then
4945 def_xanim='#define CONFIG_XANIM 1'
4946 codecmodules="xanim $codecmodules"
4947 else
4948 def_xanim='#undef CONFIG_XANIM'
4949 nocodecmodules="xanim $nocodecmodules"
4951 echores "$_xanim"
4954 echocheck "RealPlayer codecs"
4955 if test "$_real" = auto ; then
4956 _real=no
4957 res_comment="dynamic loader support needed"
4958 if test "$_dl" = yes || test "$_win32dll" = yes &&
4959 (linux || freebsd || netbsd || openbsd || dragonfly || darwin || win32) ; then
4960 _real=yes
4963 if test "$_real" = yes ; then
4964 def_real='#define CONFIG_REALCODECS 1'
4965 codecmodules="real $codecmodules"
4966 else
4967 def_real='#undef CONFIG_REALCODECS'
4968 nocodecmodules="real $nocodecmodules"
4970 echores "$_real"
4973 echocheck "QuickTime codecs"
4974 _qtx_emulation=no
4975 def_qtx_win32='#undef CONFIG_QTX_CODECS_WIN32'
4976 if test "$_qtx" = auto ; then
4977 test "$_win32dll" = yes || test "$quicktime" = yes && _qtx=yes
4979 if test "$_qtx" = yes ; then
4980 def_qtx='#define CONFIG_QTX_CODECS 1'
4981 win32 && _qtx_codecs_win32=yes && def_qtx_win32='#define CONFIG_QTX_CODECS_WIN32 1'
4982 codecmodules="qtx $codecmodules"
4983 darwin || win32 || _qtx_emulation=yes
4984 else
4985 def_qtx='#undef CONFIG_QTX_CODECS'
4986 nocodecmodules="qtx $nocodecmodules"
4988 echores "$_qtx"
4991 # Test with > against Libav 0.8 versions which will NOT work rather than
4992 # specify minimum version, to allow (future) point releases to possibly work.
4993 all_libav_libs="libavutil > 51.21.0:libavcodec > 53.34.0:libavformat > 53.20.0:libswscale >= 2.0.0"
4994 echocheck "Libav ($all_libav_libs)"
4995 if test "$ffmpeg" = auto ; then
4996 IFS=":" # shell should not be used for programming
4997 if ! pkg_config_add $all_libav_libs ; then
4998 die "Unable to find development files for some of the required Libav libraries above. Aborting."
5001 echores "yes"
5003 def_ffmpeg_internals="#undef CONFIG_FFMPEG_INTERNALS"
5004 if ! test -z "$_ffmpeg_source" ; then
5005 def_ffmpeg_internals="#define CONFIG_FFMPEG_INTERNALS 1" && ffmpeg_internals=yes
5008 echocheck "libpostproc >= 52.0.0"
5009 if test "$libpostproc" = auto ; then
5010 libpostproc=no
5011 if pkg_config_add "libpostproc >= 52.0.0" ; then
5012 libpostproc=yes
5015 if test "$libpostproc" = yes ; then
5016 def_libpostproc='#define CONFIG_LIBPOSTPROC 1'
5017 else
5018 def_libpostproc='#undef CONFIG_LIBPOSTPROC'
5020 echores "$libpostproc"
5023 echocheck "libdv-0.9.5+"
5024 if test "$_libdv" = auto ; then
5025 _libdv=no
5026 statement_check libdv/dv.h 'dv_encoder_new(1, 1, 1)' -ldv $_ld_pthread $_ld_lm && _libdv=yes
5028 if test "$_libdv" = yes ; then
5029 def_libdv='#define CONFIG_LIBDV095 1'
5030 extra_ldflags="$extra_ldflags -ldv"
5031 codecmodules="libdv $codecmodules"
5032 else
5033 def_libdv='#undef CONFIG_LIBDV095'
5034 nocodecmodules="libdv $nocodecmodules"
5036 echores "$_libdv"
5039 echocheck "Xvid"
5040 if test "$_xvid" = auto ; then
5041 _xvid=no
5042 for _ld_tmp in "-lxvidcore $_ld_lm" "-lxvidcore $_ld_lm $_ld_pthread" ; do
5043 statement_check xvid.h 'xvid_global(0, 0, 0, 0)' $_ld_tmp &&
5044 extra_ldflags="$extra_ldflags $_ld_tmp" && _xvid=yes && break
5045 done
5048 if test "$_xvid" = yes ; then
5049 def_xvid='#define CONFIG_XVID4 1'
5050 codecmodules="xvid $codecmodules"
5051 else
5052 def_xvid='#undef CONFIG_XVID4'
5053 nocodecmodules="xvid $nocodecmodules"
5055 echores "$_xvid"
5058 echocheck "libnut"
5059 if test "$_libnut" = auto ; then
5060 _libnut=no
5061 statement_check libnut.h 'nut_context_tt * nut; nut_error(0)' -lnut && _libnut=yes
5064 if test "$_libnut" = yes ; then
5065 def_libnut='#define CONFIG_LIBNUT 1'
5066 extra_ldflags="$extra_ldflags -lnut"
5067 else
5068 def_libnut='#undef CONFIG_LIBNUT'
5070 echores "$_libnut"
5073 echocheck "UnRAR executable"
5074 if test "$_unrar_exec" = auto ; then
5075 _unrar_exec="yes"
5076 mingw32 && _unrar_exec="no"
5078 if test "$_unrar_exec" = yes ; then
5079 def_unrar_exec='#define CONFIG_UNRAR_EXEC 1'
5080 else
5081 def_unrar_exec='#undef CONFIG_UNRAR_EXEC'
5083 echores "$_unrar_exec"
5085 echocheck "TV interface"
5086 if test "$_tv" = yes ; then
5087 def_tv='#define CONFIG_TV 1'
5088 inputmodules="tv $inputmodules"
5089 else
5090 noinputmodules="tv $noinputmodules"
5091 def_tv='#undef CONFIG_TV'
5093 echores "$_tv"
5096 if freebsd || netbsd || openbsd || dragonfly || bsdos ; then
5097 echocheck "*BSD BT848 bt8xx header"
5098 _ioctl_bt848_h=no
5099 for file in "machine/ioctl_bt848.h" \
5100 "dev/bktr/ioctl_bt848.h" \
5101 "dev/video/bktr/ioctl_bt848.h" \
5102 "dev/ic/bt8xx.h" ; do
5103 cat > $TMPC <<EOF
5104 #include <sys/types.h>
5105 #include <sys/ioctl.h>
5106 #include <$file>
5107 int main(void) { ioctl(0, TVTUNER_GETFREQ, 0); return 0; }
5109 if cc_check ; then
5110 _ioctl_bt848_h=yes
5111 _ioctl_bt848_h_name="$file"
5112 break;
5114 done
5115 if test "$_ioctl_bt848_h" = yes ; then
5116 def_ioctl_bt848_h_name="#define IOCTL_BT848_H_NAME <$_ioctl_bt848_h_name>"
5117 res_comment="using $_ioctl_bt848_h_name"
5118 else
5119 def_ioctl_bt848_h_name="#undef IOCTL_BT848_H_NAME"
5121 echores "$_ioctl_bt848_h"
5123 echocheck "*BSD ioctl_meteor.h"
5124 _ioctl_meteor_h=no
5125 for ioctl_meteor_h_path in "machine/ioctl_meteor.h" "dev/bktr/ioctl_meteor.h" "dev/video/bktr/ioctl_meteor.h" ; do
5126 statement_check_broken "sys/types.h" "$ioctl_meteor_h_path" 'ioctl(0, METEORSINPUT, 0)' &&
5127 _ioctl_meteor_h=yes && break
5128 done
5129 if test "$_ioctl_meteor_h" = yes ; then
5130 def_ioctl_meteor_h_name="#define IOCTL_METEOR_H_NAME <$ioctl_meteor_h_path>"
5131 res_comment="using $ioctl_meteor_h_path"
5132 else
5133 def_ioctl_meteor_h_name="#undef IOCTL_METEOR_H_NAME"
5135 echores "$_ioctl_meteor_h"
5137 echocheck "*BSD BrookTree 848 TV interface"
5138 if test "$_tv_bsdbt848" = auto ; then
5139 _tv_bsdbt848=no
5140 if test "$_tv" = yes ; then
5141 cat > $TMPC <<EOF
5142 #include <sys/types.h>
5143 $def_ioctl_meteor_h_name
5144 $def_ioctl_bt848_h_name
5145 #ifdef IOCTL_METEOR_H_NAME
5146 #include IOCTL_METEOR_H_NAME
5147 #endif
5148 #ifdef IOCTL_BT848_H_NAME
5149 #include IOCTL_BT848_H_NAME
5150 #endif
5151 int main(void) {
5152 ioctl(0, METEORSINPUT, 0);
5153 ioctl(0, TVTUNER_GETFREQ, 0);
5154 return 0;
5157 cc_check && _tv_bsdbt848=yes
5160 if test "$_tv_bsdbt848" = yes ; then
5161 def_tv_bsdbt848='#define CONFIG_TV_BSDBT848 1'
5162 inputmodules="tv-bsdbt848 $inputmodules"
5163 else
5164 def_tv_bsdbt848='#undef CONFIG_TV_BSDBT848'
5165 noinputmodules="tv-bsdbt848 $noinputmodules"
5167 echores "$_tv_bsdbt848"
5168 fi #if freebsd || netbsd || openbsd || dragonfly || bsdos
5171 echocheck "DirectShow TV interface"
5172 if test "$_tv_dshow" = auto ; then
5173 _tv_dshow=no
5174 if test "$_tv" = yes && win32 ; then
5175 statement_check ole2.h 'void* p; CoCreateInstance((GUID*)&GUID_NULL, NULL, CLSCTX_INPROC_SERVER, &GUID_NULL, &p)' -lole32 -luuid && _tv_dshow=yes
5178 if test "$_tv_dshow" = yes ; then
5179 inputmodules="tv-dshow $inputmodules"
5180 def_tv_dshow='#define CONFIG_TV_DSHOW 1'
5181 extra_ldflags="$extra_ldflags -lole32 -luuid"
5182 else
5183 noinputmodules="tv-dshow $noinputmodules"
5184 def_tv_dshow='#undef CONFIG_TV_DSHOW'
5186 echores "$_tv_dshow"
5189 echocheck "Video 4 Linux TV interface"
5190 if test "$_tv_v4l1" = auto ; then
5191 _tv_v4l1=no
5192 if test "$_tv" = yes && linux ; then
5193 header_check_broken sys/time.h linux/videodev.h && _tv_v4l1=yes
5196 if test "$_tv_v4l1" = yes ; then
5197 _audio_input=yes
5198 _tv_v4l=yes
5199 def_tv_v4l='#define CONFIG_TV_V4L 1'
5200 def_tv_v4l1='#define CONFIG_TV_V4L1 1'
5201 inputmodules="tv-v4l $inputmodules"
5202 else
5203 noinputmodules="tv-v4l1 $noinputmodules"
5204 def_tv_v4l='#undef CONFIG_TV_V4L'
5206 echores "$_tv_v4l1"
5209 echocheck "Video 4 Linux 2 TV interface"
5210 if test "$_tv_v4l2" = auto ; then
5211 _tv_v4l2=no
5212 if test "$_tv" = yes && linux ; then
5213 header_check_broken sys/time.h linux/videodev2.h && _tv_v4l2=yes
5214 elif test "$_tv" = yes && test "$sys_videoio_h" = "yes" ; then
5215 _tv_v4l2=yes
5218 if test "$_tv_v4l2" = yes ; then
5219 _audio_input=yes
5220 _tv_v4l=yes
5221 def_tv_v4l='#define CONFIG_TV_V4L 1'
5222 def_tv_v4l2='#define CONFIG_TV_V4L2 1'
5223 inputmodules="tv-v4l2 $inputmodules"
5224 else
5225 noinputmodules="tv-v4l2 $noinputmodules"
5226 def_tv_v4l2='#undef CONFIG_TV_V4L2'
5228 echores "$_tv_v4l2"
5231 echocheck "Radio interface"
5232 if test "$_radio" = yes ; then
5233 def_radio='#define CONFIG_RADIO 1'
5234 inputmodules="radio $inputmodules"
5235 if test "$_alsa" != yes -a "$_ossaudio" != yes ; then
5236 _radio_capture=no
5238 if test "$_radio_capture" = yes ; then
5239 _audio_input=yes
5240 def_radio_capture="#define CONFIG_RADIO_CAPTURE 1"
5241 else
5242 def_radio_capture="#undef CONFIG_RADIO_CAPTURE"
5244 else
5245 noinputmodules="radio $noinputmodules"
5246 def_radio='#undef CONFIG_RADIO'
5247 def_radio_capture="#undef CONFIG_RADIO_CAPTURE"
5248 _radio_capture=no
5250 echores "$_radio"
5251 echocheck "Capture for Radio interface"
5252 echores "$_radio_capture"
5254 echocheck "Video 4 Linux 2 Radio interface"
5255 if test "$_radio_v4l2" = auto ; then
5256 _radio_v4l2=no
5257 if test "$_radio" = yes && linux ; then
5258 header_check linux/videodev2.h && _radio_v4l2=yes
5261 if test "$_radio_v4l2" = yes ; then
5262 def_radio_v4l2='#define CONFIG_RADIO_V4L2 1'
5263 else
5264 def_radio_v4l2='#undef CONFIG_RADIO_V4L2'
5266 echores "$_radio_v4l2"
5268 echocheck "Video 4 Linux Radio interface"
5269 if test "$_radio_v4l" = auto ; then
5270 _radio_v4l=no
5271 if test "$_radio" = yes && linux ; then
5272 header_check linux/videodev.h && _radio_v4l=yes
5275 if test "$_radio_v4l" = yes ; then
5276 def_radio_v4l='#define CONFIG_RADIO_V4L 1'
5277 else
5278 def_radio_v4l='#undef CONFIG_RADIO_V4L'
5280 echores "$_radio_v4l"
5282 if freebsd || netbsd || openbsd || dragonfly || bsdos &&
5283 test "$_radio" = yes && test "$_radio_bsdbt848" = auto ; then
5284 echocheck "*BSD BrookTree 848 Radio interface"
5285 _radio_bsdbt848=no
5286 cat > $TMPC <<EOF
5287 #include <sys/types.h>
5288 $def_ioctl_bt848_h_name
5289 #ifdef IOCTL_BT848_H_NAME
5290 #include IOCTL_BT848_H_NAME
5291 #endif
5292 int main(void) { ioctl(0, RADIO_GETFREQ, 0); return 0; }
5294 cc_check && _radio_bsdbt848=yes
5295 echores "$_radio_bsdbt848"
5296 fi #if freebsd || netbsd || openbsd || dragonfly || bsdos && _radio && _radio_bsdbt848
5298 if test "$_radio_bsdbt848" = yes ; then
5299 def_radio_bsdbt848='#define CONFIG_RADIO_BSDBT848 1'
5300 else
5301 def_radio_bsdbt848='#undef CONFIG_RADIO_BSDBT848'
5304 if test "$_radio_v4l" = no && test "$_radio_v4l2" = no &&
5305 test "$_radio_bsdbt848" = no && test "$_radio" = yes ; then
5306 die "Radio driver requires BSD BT848, V4L or V4L2!"
5309 echocheck "Video 4 Linux 2 MPEG PVR interface"
5310 if test "$_pvr" = auto ; then
5311 _pvr=no
5312 if test "$_tv_v4l2" = yes && linux ; then
5313 cat > $TMPC <<EOF
5314 #include <sys/time.h>
5315 #include <linux/videodev2.h>
5316 int main(void) { struct v4l2_ext_controls ext; return ext.controls->value; }
5318 cc_check && _pvr=yes
5321 if test "$_pvr" = yes ; then
5322 def_pvr='#define CONFIG_PVR 1'
5323 inputmodules="pvr $inputmodules"
5324 else
5325 noinputmodules="pvr $noinputmodules"
5326 def_pvr='#undef CONFIG_PVR'
5328 echores "$_pvr"
5331 echocheck "ftp"
5332 if test "$_ftp" = "auto" ; then
5333 test "$networking" = "yes" && ! beos && _ftp=yes
5335 if test "$_ftp" = yes ; then
5336 def_ftp='#define CONFIG_FTP 1'
5337 inputmodules="ftp $inputmodules"
5338 else
5339 noinputmodules="ftp $noinputmodules"
5340 def_ftp='#undef CONFIG_FTP'
5342 echores "$_ftp"
5344 echocheck "vstream client"
5345 if test "$_vstream" = auto ; then
5346 _vstream=no
5347 cat > $TMPC <<EOF
5348 #include <vstream-client.h>
5349 void vstream_error(const char *format, ... ) {}
5350 int main(void) { vstream_start(); return 0; }
5352 cc_check -lvstream-client && _vstream=yes
5354 if test "$_vstream" = yes ; then
5355 def_vstream='#define CONFIG_VSTREAM 1'
5356 inputmodules="vstream $inputmodules"
5357 extra_ldflags="$extra_ldflags -lvstream-client"
5358 else
5359 noinputmodules="vstream $noinputmodules"
5360 def_vstream='#undef CONFIG_VSTREAM'
5362 echores "$_vstream"
5365 echocheck "Subtitles sorting"
5366 if test "$_sortsub" = yes ; then
5367 def_sortsub='#define CONFIG_SORTSUB 1'
5368 else
5369 def_sortsub='#undef CONFIG_SORTSUB'
5371 echores "$_sortsub"
5374 echocheck "XMMS inputplugin support"
5375 if test "$_xmms" = yes ; then
5376 if ( xmms-config --version ) >/dev/null 2>&1 ; then
5377 _xmmsplugindir=$(xmms-config --input-plugin-dir)
5378 _xmmslibdir=$(xmms-config --exec-prefix)/lib
5379 else
5380 _xmmsplugindir=/usr/lib/xmms/Input
5381 _xmmslibdir=/usr/lib
5384 def_xmms='#define CONFIG_XMMS 1'
5385 if darwin ; then
5386 extra_ldflags="$extra_ldflags ${_xmmslibdir}/libxmms.dylib"
5387 else
5388 extra_ldflags="$extra_ldflags ${_xmmslibdir}/libxmms.so.1 -export-dynamic"
5390 else
5391 def_xmms='#undef CONFIG_XMMS'
5393 echores "$_xmms"
5395 if test "$_charset" != "noconv" ; then
5396 def_charset="#define MSG_CHARSET \"$_charset\""
5397 else
5398 def_charset="#undef MSG_CHARSET"
5399 _charset="UTF-8"
5402 #############################################################################
5404 echocheck "automatic gdb attach"
5405 if test "$_crash_debug" = yes ; then
5406 def_crash_debug='#define CONFIG_CRASH_DEBUG 1'
5407 else
5408 def_crash_debug='#undef CONFIG_CRASH_DEBUG'
5409 _crash_debug=no
5411 echores "$_crash_debug"
5413 echocheck "compiler support for noexecstack"
5414 if cflag_check -Wl,-z,noexecstack ; then
5415 extra_ldflags="-Wl,-z,noexecstack $extra_ldflags"
5416 echores "yes"
5417 else
5418 echores "no"
5421 echocheck "linker support for --nxcompat --no-seh --dynamicbase"
5422 if cflag_check "-Wl,--nxcompat -Wl,--no-seh -Wl,--dynamicbase" ; then
5423 extra_ldflags="-Wl,--nxcompat -Wl,--no-seh -Wl,--dynamicbase $extra_ldflags"
5424 echores "yes"
5425 else
5426 echores "no"
5430 # Dynamic linking flags
5431 # (FIXME: 'echocheck "dynamic linking"' above and modify here accordingly)
5432 _ld_dl_dynamic=''
5433 freebsd || netbsd || openbsd || dragonfly || bsdos && _ld_dl_dynamic='-rdynamic'
5434 if test "$_real" = yes || test "$_xanim" = yes && ! win32 && ! qnx && ! darwin ; then
5435 _ld_dl_dynamic='-rdynamic'
5438 extra_ldflags="$extra_ldflags $_ld_pthread $_ld_dl $_ld_dl_dynamic"
5439 bsdos && extra_ldflags="$extra_ldflags -ldvd"
5440 (netbsd || openbsd) && x86_32 && extra_ldflags="$extra_ldflags -li386"
5442 def_debug='#undef MP_DEBUG'
5443 test "$_debug" != "" && def_debug='#define MP_DEBUG 1'
5446 echocheck "joystick"
5447 def_joystick='#undef CONFIG_JOYSTICK'
5448 if test "$_joystick" = yes ; then
5449 if linux || freebsd ; then
5450 # TODO add some check
5451 def_joystick='#define CONFIG_JOYSTICK 1'
5452 else
5453 _joystick="no"
5454 res_comment="unsupported under $system_name"
5457 echores "$_joystick"
5459 echocheck "lirc"
5460 if test "$_lirc" = auto ; then
5461 _lirc=no
5462 header_check lirc/lirc_client.h -llirc_client && _lirc=yes
5464 if test "$_lirc" = yes ; then
5465 def_lirc='#define CONFIG_LIRC 1'
5466 libs_mplayer="$libs_mplayer -llirc_client"
5467 else
5468 def_lirc='#undef CONFIG_LIRC'
5470 echores "$_lirc"
5472 echocheck "lircc"
5473 if test "$_lircc" = auto ; then
5474 _lircc=no
5475 header_check lirc/lircc.h -llircc && _lircc=yes
5477 if test "$_lircc" = yes ; then
5478 def_lircc='#define CONFIG_LIRCC 1'
5479 libs_mplayer="$libs_mplayer -llircc"
5480 else
5481 def_lircc='#undef CONFIG_LIRCC'
5483 echores "$_lircc"
5485 #############################################################################
5487 CFLAGS="$CFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE"
5489 # This must be the last test to be performed. Any other tests following it
5490 # could fail due to linker errors. libdvdnavmini is intentionally not linked
5491 # against libdvdread (to permit MPlayer to use its own copy of the library).
5492 # So any compilation using the flags added here but not linking against
5493 # libdvdread can fail.
5494 echocheck "DVD support (libdvdnav)"
5495 if test "$_dvdread_internal" = yes && test ! -f "libdvdnav/dvdnav.c" ; then
5496 _dvdnav=no
5498 dvdnav_internal=no
5499 if test "$_dvdnav" = auto ; then
5500 if test "$_dvdread_internal" = yes ; then
5501 _dvdnav=yes
5502 dvdnav_internal=yes
5503 res_comment="internal"
5504 else
5505 $_dvdnavconfig --version --minilibs >> $TMPLOG 2>&1 || _dvdnav=no
5508 if test "$_dvdnav" = auto ; then
5509 _dvdnav=no
5510 _dvdnavdir=$($_dvdnavconfig --cflags)
5511 _dvdnavlibs=$($_dvdnavconfig --libs)
5512 statement_check_broken stdint.h dvdnav/dvdnav.h 'dvdnav_t *dvd = 0' $_dvdnavdir $_dvdnavlibs $_ld_dl $_ld_pthread && _dvdnav=yes
5514 if test "$_dvdnav" = yes ; then
5515 def_dvdnav='#define CONFIG_DVDNAV 1'
5516 if test "$dvdnav_internal" = yes ; then
5517 cflags_libdvdnav="-Ilibdvdnav"
5518 inputmodules="dvdnav(internal) $inputmodules"
5519 else
5520 extra_cflags="$extra_cflags $($_dvdnavconfig --cflags)"
5521 extra_ldflags="$extra_ldflags $($_dvdnavconfig --minilibs)"
5522 inputmodules="dvdnav $inputmodules"
5524 else
5525 def_dvdnav='#undef CONFIG_DVDNAV'
5526 noinputmodules="dvdnav $noinputmodules"
5528 echores "$_dvdnav"
5530 # DO NOT ADD ANY TESTS THAT USE LINKER FLAGS HERE (like cc_check).
5531 # Read dvdnav comment above.
5533 mak_enable () {
5534 list=$(echo $1 | tr '[a-z]' '[A-Z]')
5535 item=$(echo $2 | tr '[a-z]' '[A-Z]')
5536 nprefix=$3;
5537 for part in $list; do
5538 if $(echo $item | grep -q -E "(^| )$part($| )"); then
5539 echo "${nprefix}_$part = yes"
5541 done
5544 #############################################################################
5545 echo "Creating config.mak"
5546 cat > config.mak << EOF
5547 # -------- Generated by configure -----------
5549 # Ensure that locale settings do not interfere with shell commands.
5550 export LC_ALL = C
5552 CONFIGURATION = $configuration
5554 CHARSET = $_charset
5555 DOC_LANGS = $language_doc
5556 DOC_LANG_ALL = $doc_lang_all
5557 MAN_LANGS = $language_man
5558 MAN_LANG_ALL = $man_lang_all
5559 MSG_LANGS = $language_msg
5560 MSG_LANG_ALL = $msg_lang_all
5562 prefix = \$(DESTDIR)$_prefix
5563 BINDIR = \$(DESTDIR)$_bindir
5564 DATADIR = \$(DESTDIR)$_datadir
5565 LIBDIR = \$(DESTDIR)$_libdir
5566 MANDIR = \$(DESTDIR)$_mandir
5567 CONFDIR = \$(DESTDIR)$_confdir
5568 LOCALEDIR = \$(DESTDIR)$_localedir
5570 AR = $_ar
5571 AS = $_cc
5572 CC = $_cc
5573 INSTALL = $_install
5574 INSTALLSTRIP = $_install_strip
5575 WINDRES = $_windres
5577 CFLAGS = $WARNFLAGS $ERRORFLAGS $WARN_CFLAGS $CFLAGS $extra_cflags
5578 DEPFLAGS = $DEPFLAGS
5580 CFLAGS_LIBDVDCSS = $cflags_libdvdcss
5581 CFLAGS_LIBDVDCSS_DVDREAD = $cflags_libdvdcss_dvdread
5582 CFLAGS_LIBDVDNAV = $cflags_libdvdnav
5583 CFLAGS_NO_OMIT_LEAF_FRAME_POINTER = $cflags_no_omit_leaf_frame_pointer
5584 CFLAGS_STACKREALIGN = $cflags_stackrealign
5586 EXTRALIBS = $extra_ldflags $_ld_static $_ld_lm $extra_libs
5587 EXTRALIBS_MPLAYER = $libs_mplayer
5589 GETCH = $_getch
5590 TIMER = $_timer
5592 EXESUF = $_exesuf
5593 EXESUFS_ALL = .exe
5595 ARCH = $arch
5596 $(mak_enable "$arch_all" "$arch" ARCH)
5597 $(mak_enable "$subarch_all" "$subarch" ARCH)
5598 $(mak_enable "$cpuexts_all" "$cpuexts" HAVE)
5600 MPLAYER = $_mplayer
5602 NEED_GETTIMEOFDAY = $need_gettimeofday
5603 NEED_GLOB = $need_glob
5604 NEED_SETENV = $need_setenv
5605 NEED_SHMEM = $need_shmem
5606 NEED_STRSEP = $need_strsep
5607 NEED_SWAB = $need_swab
5608 NEED_VSSCANF = $need_vsscanf
5610 # features
5611 ALSA = $_alsa
5612 APPLE_IR = $_apple_ir
5613 APPLE_REMOTE = $_apple_remote
5614 AUDIO_INPUT = $_audio_input
5615 CACA = $_caca
5616 CDDA = $_cdda
5617 CDDB = $_cddb
5618 COCOA = $_cocoa
5619 COREAUDIO = $_coreaudio
5620 COREVIDEO = $_corevideo
5621 SHAREDBUFFER = $_sharedbuffer
5622 DIRECT3D = $_direct3d
5623 DIRECTFB = $_directfb
5624 DIRECTX = $_directx
5625 DVBIN = $_dvbin
5626 DVDNAV = $_dvdnav
5627 DVDNAV_INTERNAL = $dvdnav_internal
5628 DVDREAD = $_dvdread
5629 DVDREAD_INTERNAL = $_dvdread_internal
5630 DXR3 = $_dxr3
5631 FAAD = $_faad
5632 FASTMEMCPY = $_fastmemcpy
5633 FTP = $_ftp
5634 GIF = $_gif
5635 GL = $_gl
5636 GL_COCOA = $_gl_cocoa
5637 GL_WIN32 = $_gl_win32
5638 GL_X11 = $_gl_x11
5639 GL_SDL = $_gl_sdl
5640 HAVE_POSIX_SELECT = $_posix_select
5641 HAVE_SYS_MMAN_H = $_mman
5642 JACK = $_jack
5643 JOYSTICK = $_joystick
5644 JPEG = $_jpeg
5645 LADSPA = $_ladspa
5646 LIBA52 = $_liba52
5647 LIBASS = $_ass
5648 LIBBLURAY = $_bluray
5649 LIBBS2B = $_libbs2b
5650 LIBDCA = $_libdca
5651 LIBDV = $_libdv
5652 LIBDVDCSS_INTERNAL = $_libdvdcss_internal
5653 LIBMAD = $_mad
5654 LIBNUT = $_libnut
5655 LIBPOSTPROC = $libpostproc
5656 LIBSMBCLIENT = $_smb
5657 LIBQUVI = $_libquvi
5658 LIBTHEORA = $_theora
5659 LIRC = $_lirc
5660 MACOSX_FINDER = $_macosx_finder
5661 MD5SUM = $_md5sum
5662 MNG = $_mng
5663 MPG123 = $_mpg123
5664 MUSEPACK = $_musepack
5665 NETWORKING = $networking
5666 OPENAL = $_openal
5667 OSS = $_ossaudio
5668 PE_EXECUTABLE = $_pe_executable
5669 PNG = $_png
5670 PNM = $_pnm
5671 PRIORITY = $_priority
5672 PULSE = $_pulse
5673 PORTAUDIO = $_portaudio
5674 PVR = $_pvr
5675 QTX_CODECS = $_qtx
5676 QTX_CODECS_WIN32 = $_qtx_codecs_win32
5677 QTX_EMULATION = $_qtx_emulation
5678 RADIO=$_radio
5679 RADIO_CAPTURE=$_radio_capture
5680 REAL_CODECS = $_real
5681 RSOUND = $_rsound
5682 SDL = $_sdl
5683 SPEEX = $_speex
5684 STREAM_CACHE = $_stream_cache
5685 TGA = $_tga
5686 TV = $_tv
5687 TV_BSDBT848 = $_tv_bsdbt848
5688 TV_DSHOW = $_tv_dshow
5689 TV_V4L = $_tv_v4l
5690 TV_V4L1 = $_tv_v4l1
5691 TV_V4L2 = $_tv_v4l2
5692 UNRAR_EXEC = $_unrar_exec
5693 V4L2 = $_v4l2
5694 VCD = $_vcd
5695 VDPAU = $_vdpau
5696 VORBIS = $_vorbis
5697 VSTREAM = $_vstream
5698 WIN32DLL = $_win32dll
5699 WIN32_EMULATION = $_win32_emulation
5700 X11 = $_x11
5701 XANIM_CODECS = $_xanim
5702 XMMS_PLUGINS = $_xmms
5703 XV = $_xv
5704 XVID4 = $_xvid
5705 YUV4MPEG = $_yuv4mpeg
5707 # FFmpeg
5708 FFMPEG_INTERNALS = $ffmpeg_internals
5709 FFMPEG_SOURCE_PATH = $_ffmpeg_source
5711 RANLIB = $_ranlib
5712 YASM = $_yasm
5713 YASMFLAGS = $YASMFLAGS
5715 CONFIG_VDPAU = $_vdpau
5716 CONFIG_ZLIB = $_zlib
5718 HAVE_PTHREADS = $_pthreads
5719 HAVE_SHM = $_shm
5720 HAVE_W32THREADS = $_w32threads
5721 HAVE_YASM = $have_yasm
5725 #############################################################################
5727 ff_config_enable () {
5728 list=$(echo $1 | tr '[a-z]' '[A-Z]')
5729 item=$(echo $2 | tr '[a-z]' '[A-Z]')
5730 _nprefix=$3;
5731 test -z "$_nprefix" && _nprefix='CONFIG'
5732 for part in $list; do
5733 if $(echo $item | grep -q -E "(^| )$part($| )"); then
5734 echo "#define ${_nprefix}_$part 1"
5735 else
5736 echo "#define ${_nprefix}_$part 0"
5738 done
5741 echo "Creating config.h"
5742 cat > $TMPH << EOF
5743 /*----------------------------------------------------------------------------
5744 ** This file has been automatically generated by configure any changes in it
5745 ** will be lost when you run configure again.
5746 ** Instead of modifying definitions here, use the --enable/--disable options
5747 ** of the configure script! See ./configure --help for details.
5748 *---------------------------------------------------------------------------*/
5750 #ifndef MPLAYER_CONFIG_H
5751 #define MPLAYER_CONFIG_H
5753 #define CONFIGURATION "$configuration"
5755 #define MPLAYER_DATADIR "$_datadir"
5756 #define MPLAYER_CONFDIR "$_confdir"
5757 #define MPLAYER_LOCALEDIR "$_localedir"
5759 $def_translation
5761 /* definitions needed by included libraries */
5762 #define HAVE_INTTYPES_H 1
5763 /* libdvdcss */
5764 #define HAVE_ERRNO_H 1
5765 /* libdvdcss + libdvdread */
5766 #define HAVE_LIMITS_H 1
5767 /* libdvdcss */
5768 #define HAVE_UNISTD_H 1
5769 /* libdvdread */
5770 #define STDC_HEADERS 1
5771 #define HAVE_MEMCPY 1
5772 /* libdvdnav */
5773 #define READ_CACHE_TRACE 0
5774 /* libdvdread */
5775 #define HAVE_DLFCN_H 1
5776 $def_dvdcss
5779 /* system headers */
5780 $def_alloca_h
5781 $def_altivec_h
5782 $def_malloc_h
5783 $def_mman_h
5784 $def_mman_has_map_failed
5785 $def_soundcard_h
5786 $def_sys_soundcard_h
5787 $def_sys_sysinfo_h
5788 $def_sys_videoio_h
5789 $def_termios_h
5790 $def_termios_sys_h
5791 $def_winsock2_h
5794 /* system functions */
5795 $def_gethostbyname2
5796 $def_gettimeofday
5797 $def_glob
5798 $def_langinfo
5799 $def_lrintf
5800 $def_map_memalign
5801 $def_memalign
5802 $def_nanosleep
5803 $def_posix_select
5804 $def_select
5805 $def_setenv
5806 $def_setmode
5807 $def_shm
5808 $def_strsep
5809 $def_swab
5810 $def_sysi86
5811 $def_sysi86_iv
5812 $def_termcap
5813 $def_termios
5814 $def_vsscanf
5817 /* system-specific features */
5818 $def_asmalign_pot
5819 $def_builtin_expect
5820 $def_dl
5821 $def_dos_paths
5822 $def_extern_asm
5823 $def_extern_prefix
5824 $def_iconv
5825 $def_kstat
5826 $def_macosx_bundle
5827 $def_macosx_finder
5828 $def_priority
5829 $def_quicktime
5830 $def_restrict_keyword
5831 $def_rtc
5832 $def_unrar_exec
5835 /* configurable options */
5836 $def_charset
5837 $def_crash_debug
5838 $def_debug
5839 $def_fastmemcpy
5840 $def_runtime_cpudetection
5841 $def_sighandler
5842 $def_sortsub
5843 $def_stream_cache
5844 $def_pthread_cache
5847 /* CPU stuff */
5848 #define __CPU__ $iproc
5849 $def_ebx_available
5850 $def_words_endian
5851 $def_bigendian
5852 $(ff_config_enable "$arch_all" "$arch" "ARCH")
5853 $(ff_config_enable "$subarch_all" "$subarch" "ARCH")
5854 $(ff_config_enable "$cpuexts_all" "$cpuexts" "HAVE")
5857 /* Blu-ray/DVD/VCD/CD */
5858 #define DEFAULT_CDROM_DEVICE "$default_cdrom_device"
5859 #define DEFAULT_DVD_DEVICE "$default_dvd_device"
5860 $def_bluray
5861 $def_bsdi_dvd
5862 $def_cdda
5863 $def_cddb
5864 $def_cdio
5865 $def_cdrom
5866 $def_dvd
5867 $def_dvd_bsd
5868 $def_dvd_darwin
5869 $def_dvd_linux
5870 $def_dvd_openbsd
5871 $def_dvdio
5872 $def_dvdnav
5873 $def_dvdread
5874 $def_hpux_scsi_h
5875 $def_sol_scsi_h
5876 $def_vcd
5879 /* codec libraries */
5880 $def_faad
5881 $def_liba52
5882 $def_libdca
5883 $def_libdv
5884 $def_mad
5885 $def_mpg123
5886 $def_musepack
5887 $def_speex
5888 $def_theora
5889 $def_tremor
5890 $def_vorbis
5891 $def_xvid
5892 $def_zlib
5894 $def_libpostproc
5895 $def_libnut
5898 /* binary codecs */
5899 $def_qtx
5900 $def_qtx_win32
5901 $def_real
5902 $def_win32_loader
5903 $def_win32dll
5904 $def_xanim
5905 $def_xmms
5906 #define BINARY_CODECS_PATH "$_codecsdir"
5907 #define XMMS_INPUT_PLUGIN_DIR "$_xmmsplugindir"
5910 /* Audio output drivers */
5911 $def_alsa
5912 $def_coreaudio
5913 $def_jack
5914 $def_nas
5915 $def_openal
5916 $def_openal_h
5917 $def_ossaudio
5918 $def_ossaudio_devdsp
5919 $def_ossaudio_devmixer
5920 $def_pulse
5921 $def_portaudio
5922 $def_rsound
5924 $def_ladspa
5925 $def_libbs2b
5928 /* input */
5929 $def_apple_ir
5930 $def_apple_remote
5931 $def_ioctl_bt848_h_name
5932 $def_ioctl_meteor_h_name
5933 $def_joystick
5934 $def_lirc
5935 $def_lircc
5936 $def_pvr
5937 $def_radio
5938 $def_radio_bsdbt848
5939 $def_radio_capture
5940 $def_radio_v4l
5941 $def_radio_v4l2
5942 $def_tv
5943 $def_tv_bsdbt848
5944 $def_tv_dshow
5945 $def_tv_v4l
5946 $def_tv_v4l1
5947 $def_tv_v4l2
5950 /* font stuff */
5951 $def_ass
5952 $def_enca
5954 /* networking */
5955 $def_closesocket
5956 $def_ftp
5957 $def_inet6
5958 $def_inet_aton
5959 $def_inet_pton
5960 $def_networking
5961 $def_smb
5962 $def_libquvi
5963 $def_socklen_t
5964 $def_vstream
5967 /* libvo options */
5968 $def_caca
5969 $def_corevideo
5970 $def_cocoa
5971 $def_sharedbuffer
5972 $def_direct3d
5973 $def_directfb
5974 $def_directx
5975 $def_dvbin
5976 $def_gif
5977 $def_gif_4
5978 $def_gif_tvt_hack
5979 $def_gl
5980 $def_gl_cocoa
5981 $def_gl_win32
5982 $def_gl_x11
5983 $def_gl_sdl
5984 $def_jpeg
5985 $def_md5sum
5986 $def_mng
5987 $def_png
5988 $def_pnm
5989 $def_sdl
5990 $def_sdl_sdl_h
5991 $def_tga
5992 $def_v4l2
5993 $def_vdpau
5994 $def_vm
5995 $def_x11
5996 $def_xdpms
5997 $def_xf86keysym
5998 $def_xinerama
5999 $def_xss
6000 $def_xv
6001 $def_yuv4mpeg
6004 /* FFmpeg */
6005 $def_ffmpeg_internals
6007 $def_arpa_inet_h
6008 $def_bswap
6009 $def_dcbzl
6010 $def_exp2
6011 $def_exp2f
6012 $def_fast_64bit
6013 $def_fast_unaligned
6014 $def_llrint
6015 $def_log2
6016 $def_log2f
6017 $def_lrint
6018 $def_memalign_hack
6019 $def_mkstemp
6020 $def_posix_memalign
6021 $def_pthreads
6022 $def_round
6023 $def_roundf
6024 $def_threads
6025 $def_truncf
6026 $def_xform_asm
6027 $def_yasm
6029 #define HAVE_INLINE_ASM 1
6031 /* Use these registers in x86 inline asm. No proper detection yet. */
6032 #define HAVE_EBP_AVAILABLE 1
6034 #endif /* MPLAYER_CONFIG_H */
6037 # Do not overwrite an unchanged config.h to avoid superfluous rebuilds.
6038 cmp -s "$TMPH" config.h || mv -f "$TMPH" config.h
6040 #############################################################################
6042 cat << EOF
6044 Config files successfully generated by ./configure $configuration !
6046 Install prefix: $_prefix
6047 Data directory: $_datadir
6048 Config direct.: $_confdir
6050 Byte order: $_byte_order
6051 Optimizing for: $_optimizing
6053 Languages:
6054 Messages (in addition to English): $language_msg
6055 Manual pages: $language_man
6056 Documentation: $language_doc
6058 Enabled optional drivers:
6059 Input: $inputmodules
6060 Codecs: $codecmodules
6061 Audio output: $aomodules
6062 Video output: $vomodules
6064 Disabled optional drivers:
6065 Input: $noinputmodules
6066 Codecs: $nocodecmodules
6067 Audio output: $noaomodules
6068 Video output: $novomodules
6070 'config.h' and 'config.mak' contain your configuration options.
6071 Note: If you alter theses files (for instance CFLAGS) MPlayer may no longer
6072 compile *** DO NOT REPORT BUGS if you tweak these files ***
6074 'make' will now compile MPlayer and 'make install' will install it.
6075 Note: On non-Linux systems you might need to use 'gmake' instead of 'make'.
6080 cat <<EOF
6081 Check $TMPLOG if you wonder why an autodetection failed (make sure
6082 development headers/packages are installed).
6084 NOTE: The --enable-* parameters unconditionally force options on, completely
6085 skipping autodetection. This behavior is unlike what you may be used to from
6086 autoconf-based configure scripts that can decide to override you. This greater
6087 level of control comes at a price. You may have to provide the correct compiler
6088 and linker flags yourself.
6089 If you used one of these options (except --enable-runtime-cpudetection and
6090 similar ones that turn on internal features) and experience a compilation or
6091 linking failure, make sure you have passed the necessary compiler/linker flags
6092 to configure.
6094 If you suspect a bug, please read DOCS/HTML/$language_doc/bugreports.html.
6098 if test "$warn_cflags" = yes; then
6099 cat <<EOF
6101 MPlayer compilation will use the CPPFLAGS/CFLAGS/LDFLAGS/YASMFLAGS set by you,
6102 but:
6104 *** *** DO NOT REPORT BUGS IF IT DOES NOT COMPILE/WORK! *** ***
6106 It is strongly recommended to let MPlayer choose the correct CFLAGS!
6107 To do so, execute 'CFLAGS= ./configure <options>'
6112 # Last move:
6113 rm -rf "$mplayer_tmpdir"