configure: remove --datadir and other obsolete things
[mplayer.git] / configure
blob1cd2cd3c7b9678a21144241acbf23c1d97279bb3
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.rst | sed -e "s:DOCS/man/\(..\)/mplayer.rst:\1:g" -e "s:DOCS/man/\(.._..\)/mplayer.rst:\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 --mandir=DIR directory for installing man pages [PREFIX/share/man]
298 --confdir=DIR directory for installing configuration files
299 [PREFIX/etc/mplayer]
300 --localedir=DIR directory for locale tree [PREFIX/share/locale]
301 --libdir=DIR directory for object code libraries [PREFIX/lib]
302 --codecsdir=DIR directory for binary codecs [LIBDIR/codecs]
304 Optional features:
305 --disable-mplayer disable MPlayer compilation [enable]
306 --enable-termcap use termcap database for key codes [autodetect]
307 --enable-termios use termios database for key codes [autodetect]
308 --disable-iconv disable iconv for encoding conversion [autodetect]
309 --disable-langinfo do not use langinfo [autodetect]
310 --enable-lirc enable LIRC (remote control) support [autodetect]
311 --enable-lircc enable LIRCCD (LIRC client daemon) input [autodetect]
312 --enable-joystick enable joystick support [disable]
313 --enable-apple-remote enable Apple Remote input (Mac OS X only) [autodetect]
314 --enable-apple-ir enable Apple IR Remote input (Linux only) [autodetect]
315 --disable-vm disable X video mode extensions [autodetect]
316 --disable-xf86keysym disable support for multimedia keys [autodetect]
317 --enable-radio enable radio interface [disable]
318 --enable-radio-capture enable radio capture (through PCI/line-in) [disable]
319 --disable-radio-v4l2 disable Video4Linux2 radio interface [autodetect]
320 --disable-radio-bsdbt848 disable BSD BT848 radio interface [autodetect]
321 --disable-tv disable TV interface (TV/DVB grabbers) [enable]
322 --disable-tv-v4l1 disable Video4Linux TV interface [autodetect]
323 --disable-tv-v4l2 disable Video4Linux2 TV interface [autodetect]
324 --disable-tv-bsdbt848 disable BSD BT848 interface [autodetect]
325 --disable-pvr disable Video4Linux2 MPEG PVR [autodetect]
326 --disable-rtc disable RTC (/dev/rtc) on Linux [autodetect]
327 --disable-networking disable networking [enable]
328 --enable-winsock2_h enable winsock2_h [autodetect]
329 --enable-smb enable Samba (SMB) input [autodetect]
330 --enable-libquvi enable libquvi [autodetect]
331 --enable-lcms2 enable LCMS2 support [autodetect]
332 --disable-vcd disable VCD support [autodetect]
333 --disable-bluray disable Blu-ray support [autodetect]
334 --disable-dvdnav disable libdvdnav [autodetect]
335 --disable-dvdread disable libdvdread [autodetect]
336 --disable-dvdread-internal disable internal libdvdread [autodetect]
337 --disable-libdvdcss-internal disable internal libdvdcss [autodetect]
338 --disable-cddb disable cddb [autodetect]
339 --disable-unrarexec disable using of UnRAR executable [enabled]
340 --disable-enca disable ENCA charset oracle library [autodetect]
341 --enable-macosx-finder enable Mac OS X Finder invocation parameter
342 parsing [disabled]
343 --enable-macosx-bundle enable Mac OS X bundle file locations [autodetect]
344 --disable-inet6 disable IPv6 support [autodetect]
345 --disable-gethostbyname2 gethostbyname2 part of the C library [autodetect]
346 --disable-ftp disable FTP support [enabled]
347 --disable-vstream disable TiVo vstream client support [autodetect]
348 --disable-pthreads disable Posix threads support [autodetect]
349 --disable-w32threads disable Win32 threads support [autodetect]
350 --disable-libass disable subtitle rendering with libass [autodetect]
351 --enable-rpath enable runtime linker path for extra libs [disabled]
352 --disable-libpostproc disable postprocess filter (vf_pp) [autodetect]
353 --disable-libavresample disable libavresample (sample format conversion) [autodetect]
355 Codecs:
356 --enable-gif enable GIF support [autodetect]
357 --enable-png enable PNG input/output support [autodetect]
358 --enable-mng enable MNG input support [autodetect]
359 --enable-jpeg enable JPEG input/output support [autodetect]
360 --enable-libcdio enable libcdio support [autodetect]
361 --disable-win32dll disable Win32 DLL support [autodetect]
362 --disable-qtx disable QuickTime codecs support [enabled]
363 --disable-xanim disable XAnim codecs support [enabled]
364 --disable-real disable RealPlayer codecs support [enabled]
365 --disable-xvid disable Xvid [autodetect]
366 --disable-libnut disable libnut [autodetect]
367 --enable-libav skip Libav autodetection [autodetect]
368 --disable-libvorbis disable libvorbis support [autodetect]
369 --disable-tremor disable Tremor [autodetect if no libvorbis]
370 --disable-speex disable Speex support [autodetect]
371 --enable-theora enable OggTheora libraries [autodetect]
372 --enable-faad enable FAAD2 (AAC) [autodetect]
373 --disable-ladspa disable LADSPA plugin support [autodetect]
374 --disable-libbs2b disable libbs2b audio filter support [autodetect]
375 --disable-libdv disable libdv 0.9.5 en/decoding support [autodetect]
376 --disable-mpg123 disable libmpg123 MP3 decoding support [autodetect]
377 --disable-mad disable libmad (MPEG audio) support [autodetect]
378 --enable-xmms enable XMMS input plugin support [disabled]
379 --enable-libdca enable libdca support [autodetect]
380 --disable-liba52 disable liba52 [autodetect]
381 --enable-musepack enable libmpcdec support (deprecated, libavcodec
382 Musepack decoder is preferred) [disabled]
384 Video output:
385 --enable-gl enable OpenGL video output [autodetect]
386 --enable-sdl enable SDL video output [autodetect]
387 --enable-caca enable CACA video output [autodetect]
388 --enable-direct3d enable Direct3D video output [autodetect]
389 --enable-directx enable DirectX video output [autodetect]
390 --enable-v4l2 enable V4L2 Decoder audio/video output [autodetect]
391 --enable-dvb enable DVB video input [autodetect]
392 --enable-xv enable Xv video output [autodetect]
393 --enable-vdpau enable VDPAU acceleration [autodetect]
394 --enable-vm enable XF86VidMode support [autodetect]
395 --enable-xinerama enable Xinerama support [autodetect]
396 --enable-x11 enable X11 video output [autodetect]
397 --disable-xss disable screensaver support via xss [autodetect]
398 --enable-directfb enable DirectFB video output [autodetect]
399 --disable-tga disable Targa video output [enable]
400 --disable-pnm disable PNM video output [enable]
401 --disable-md5sum disable md5sum video output [enable]
402 --disable-yuv4mpeg disable yuv4mpeg video output [enable]
403 --disable-corevideo disable CoreVideo video output [autodetect]
404 --disable-cocoa disable Cocoa OpenGL backend [autodetect]
405 --disable-sharedbuffer disable OSX shared buffer video output [autodetect]
407 Audio output:
408 --disable-alsa disable ALSA audio output [autodetect]
409 --disable-ossaudio disable OSS audio output [autodetect]
410 --disable-rsound disable RSound audio output [autodetect]
411 --disable-pulse disable Pulseaudio audio output [autodetect]
412 --disable-portaudio disable PortAudio audio output [autodetect]
413 --disable-jack disable JACK audio output [autodetect]
414 --enable-openal enable OpenAL audio output [disable]
415 --disable-coreaudio disable CoreAudio audio output [autodetect]
416 --disable-select disable using select() on the audio device [enable]
418 Language options:
419 --enable-translation enable support for translated output [disable]
420 --charset=charset convert the console messages to this character set
421 --language-doc=lang language to use for the documentation [en]
422 --language-man=lang language to use for the man pages [en]
423 --language-msg=lang extra languages for program messages [all]
424 --language=lang default language to use [en]
425 Specific options override --language. You can pass a list of languages separated
426 by whitespace or commas instead of a single language. Nonexisting translations
427 will be dropped from each list. All translations available in the list will be
428 installed. The value "all" will activate all translations. The LINGUAS
429 environment variable is honored. In all cases the fallback is English.
430 The program always supports English-language output; additional message
431 languages are only installed if --enable-translation is also specified.
432 Available values for --language-doc are: all $doc_lang_all
433 Available values for --language-man are: all $man_lang_all
434 Available values for --language-msg are: all $msg_lang_all
436 Miscellaneous options:
437 --enable-runtime-cpudetection enable runtime CPU detection [disable]
438 --enable-cross-compile enable cross-compilation [disable]
439 --cc=COMPILER C compiler to build MPlayer [gcc]
440 --as=ASSEMBLER assembler to build MPlayer [as]
441 --nm=NM nm tool to build MPlayer [nm]
442 --yasm=YASM Yasm assembler to build MPlayer [yasm]
443 --ar=AR librarian to build MPlayer [ar]
444 --pkg-config=PKGCONFIG pkg-config to find some libraries [pkg-config]
445 --ranlib=RANLIB ranlib to build MPlayer [ranlib]
446 --windres=WINDRES windres to build MPlayer [windres]
447 --target=PLATFORM target platform (i386-linux, arm-linux, etc)
448 --enable-static build a statically linked binary
449 --with-install=PATH path to a custom install program
451 Advanced options:
452 --enable-mmx enable MMX [autodetect]
453 --enable-mmxext enable MMX2 (Pentium III, Athlon) [autodetect]
454 --enable-3dnow enable 3DNow! [autodetect]
455 --enable-3dnowext enable extended 3DNow! [autodetect]
456 --enable-sse enable SSE [autodetect]
457 --enable-sse2 enable SSE2 [autodetect]
458 --enable-ssse3 enable SSSE3 [autodetect]
459 --enable-shm enable shm [autodetect]
460 --enable-altivec enable AltiVec (PowerPC) [autodetect]
461 --enable-armv5te enable DSP extensions (ARM) [autodetect]
462 --enable-armv6 enable ARMv6 (ARM) [autodetect]
463 --enable-armv6t2 enable ARMv6t2 (ARM) [autodetect]
464 --enable-armvfp enable ARM VFP (ARM) [autodetect]
465 --enable-neon enable NEON (ARM) [autodetect]
466 --enable-iwmmxt enable iWMMXt (ARM) [autodetect]
467 --disable-fastmemcpy disable 3DNow!/SSE/MMX optimized memcpy [enable]
468 --enable-big-endian force byte order to big-endian [autodetect]
469 --enable-debug[=1-3] compile-in debugging information [disable]
470 --enable-profile compile-in profiling information [disable]
471 --disable-sighandler disable sighandler for crashes [enable]
472 --enable-crash-debug enable automatic gdb attach on crash [disable]
474 Use these options if autodetection fails:
475 --extra-cflags=FLAGS extra CFLAGS
476 --extra-ldflags=FLAGS extra LDFLAGS
477 --extra-libs=FLAGS extra linker flags
478 --extra-libs-mplayer=FLAGS extra linker flags for MPlayer
480 --with-sdl-config=PATH path to sdl*-config
481 --with-dvdnav-config=PATH path to dvdnav-config
482 --with-dvdread-config=PATH path to dvdread-config
484 This configure script is NOT autoconf-based, even though its output is similar.
485 It will try to autodetect all configuration options. If you --enable an option
486 it will be forcefully turned on, skipping autodetection. This can break
487 compilation, so you need to know what you are doing.
489 exit 0
490 } #show_help()
492 # GOTCHA: the variables below defines the default behavior for autodetection
493 # and have - unless stated otherwise - at least 2 states : yes no
494 # If autodetection is available then the third state is: auto
495 _mmx=auto
496 _3dnow=auto
497 _3dnowext=auto
498 _mmxext=auto
499 _sse=auto
500 _sse2=auto
501 _ssse3=auto
502 _cmov=auto
503 _fast_cmov=auto
504 _fast_clz=auto
505 _armv5te=auto
506 _armv6=auto
507 _armv6t2=auto
508 _armvfp=auto
509 neon=auto
510 _iwmmxt=auto
511 _altivec=auto
512 _install=install
513 _pkg_config=auto
514 _ranlib=auto
515 _windres=auto
516 _cc=auto
517 _ar=auto
518 test "$CC" && _cc="$CC"
519 _as=auto
520 _nm=auto
521 _yasm=auto
522 _runtime_cpudetection=no
523 _cross_compile=no
524 _prefix="/usr/local"
525 ffmpeg=auto
526 ffmpeg_internals=no
527 _x11=auto
528 _xss=auto
529 _xv=auto
530 _vdpau=auto
531 _sdl=auto
532 _direct3d=auto
533 _directx=auto
534 _png=auto
535 _mng=auto
536 _jpeg=auto
537 _pnm=yes
538 _md5sum=yes
539 _yuv4mpeg=yes
540 _gif=auto
541 _gl=auto
542 _aa=auto
543 _caca=auto
544 _dvb=auto
545 _v4l2=auto
546 _iconv=auto
547 _langinfo=auto
548 _rtc=auto
549 _ossaudio=auto
550 _rsound=auto
551 _pulse=auto
552 _portaudio=auto
553 _jack=auto
554 _openal=no
555 _libcdio=auto
556 _mad=auto
557 _tremor=auto
558 _libvorbis=auto
559 _speex=auto
560 _theora=auto
561 _mpg123=auto
562 _liba52=auto
563 _libdca=auto
564 _faad=auto
565 _ladspa=auto
566 _libbs2b=auto
567 _xmms=no
568 _vcd=auto
569 _bluray=auto
570 _dvdnav=auto
571 _dvdnavconfig=dvdnav-config
572 _dvdreadconfig=dvdread-config
573 _dvdread=auto
574 _dvdread_internal=auto
575 _libdvdcss_internal=auto
576 _xanim=auto
577 _real=auto
578 _lcms2=auto
579 _xinerama=auto
580 _vm=auto
581 _xf86keysym=auto
582 _alsa=auto
583 _fastmemcpy=yes
584 _unrar_exec=auto
585 _win32dll=auto
586 _select=yes
587 _radio=no
588 _radio_capture=no
589 _radio_v4l=auto
590 _radio_v4l2=auto
591 _radio_bsdbt848=auto
592 _tv=yes
593 _tv_v4l1=auto
594 _tv_v4l2=auto
595 _tv_bsdbt848=auto
596 _tv_dshow=auto
597 _pvr=auto
598 networking=yes
599 _winsock2_h=auto
600 _smb=auto
601 _libquvi=auto
602 _joystick=no
603 _xvid=auto
604 _libnut=auto
605 _lirc=auto
606 _lircc=auto
607 _apple_remote=auto
608 _apple_ir=auto
609 _termcap=auto
610 _termios=auto
611 _tga=yes
612 _directfb=auto
613 #language=en
614 _shm=auto
615 _translation=no
616 _charset="UTF-8"
617 _crash_debug=no
618 _sighandler=yes
619 _libdv=auto
620 _cdda=auto
621 _cddb=auto
622 _big_endian=auto
623 _qtx=auto
624 _coreaudio=auto
625 _corevideo=auto
626 _cocoa=auto
627 _sharedbuffer=auto
628 quicktime=auto
629 _macosx_finder=no
630 _macosx_bundle=auto
631 _enca=auto
632 _inet6=auto
633 _gethostbyname2=auto
634 _ftp=auto
635 _musepack=no
636 _vstream=auto
637 _pthreads=auto
638 _w32threads=auto
639 _ass=auto
640 _rpath=no
641 libpostproc=auto
642 libavresample=auto
643 _asmalign_pot=auto
644 _stream_cache=yes
645 _priority=no
646 def_dos_paths="#define HAVE_DOS_PATHS 0"
647 def_stream_cache="#define CONFIG_STREAM_CACHE 1"
648 def_priority="#undef CONFIG_PRIORITY"
649 def_pthread_cache="#undef PTHREAD_CACHE"
650 need_shmem=yes
651 for ac_option do
652 case "$ac_option" in
653 --help|-help|-h)
654 show_help
656 --prefix=*)
657 _prefix=$(echo $ac_option | cut -d '=' -f 2)
659 --bindir=*)
660 _bindir=$(echo $ac_option | cut -d '=' -f 2)
662 --mandir=*)
663 _mandir=$(echo $ac_option | cut -d '=' -f 2)
665 --confdir=*)
666 _confdir=$(echo $ac_option | cut -d '=' -f 2)
668 --libdir=*)
669 _libdir=$(echo $ac_option | cut -d '=' -f 2)
671 --codecsdir=*)
672 _codecsdir=$(echo $ac_option | cut -d '=' -f 2)
674 --localedir=*)
675 _localedir=$(echo $ac_option | cut -d '=' -f 2)
678 --with-install=*)
679 _install=$(echo $ac_option | cut -d '=' -f 2 )
682 --with-sdl-config=*)
683 _sdlconfig=$(echo $ac_option | cut -d '=' -f 2)
685 --with-dvdnav-config=*)
686 _dvdnavconfig=$(echo $ac_option | cut -d '=' -f 2)
688 --with-dvdread-config=*)
689 _dvdreadconfig=$(echo $ac_option | cut -d '=' -f 2)
692 --extra-cflags=*)
693 extra_cflags="$extra_cflags $(echo $ac_option | cut -d '=' -f 2-)"
695 --extra-ldflags=*)
696 extra_ldflags="$extra_ldflags $(echo $ac_option | cut -d '=' -f 2-)"
698 --extra-libs=*)
699 extra_libs=$(echo $ac_option | cut -d '=' -f 2)
701 --extra-libs-mplayer=*)
702 libs_mplayer=$(echo $ac_option | cut -d '=' -f 2)
705 --target=*)
706 _target=$(echo $ac_option | cut -d '=' -f 2)
708 --cc=*)
709 _cc=$(echo $ac_option | cut -d '=' -f 2)
711 --as=*)
712 _as=$(echo $ac_option | cut -d '=' -f 2)
714 --nm=*)
715 _nm=$(echo $ac_option | cut -d '=' -f 2)
717 --yasm=*)
718 _yasm=$(echo $ac_option | cut -d '=' -f 2)
720 --ar=*)
721 _ar=$(echo $ac_option | cut -d '=' -f 2)
723 --pkg-config=*)
724 _pkg_config=$(echo $ac_option | cut -d '=' -f 2)
726 --ranlib=*)
727 _ranlib=$(echo $ac_option | cut -d '=' -f 2)
729 --windres=*)
730 _windres=$(echo $ac_option | cut -d '=' -f 2)
732 --charset=*)
733 _charset=$(echo $ac_option | cut -d '=' -f 2)
735 --language-doc=*)
736 language_doc=$(echo $ac_option | cut -d '=' -f 2)
738 --language-man=*)
739 language_man=$(echo $ac_option | cut -d '=' -f 2)
741 --language-msg=*)
742 language_msg=$(echo $ac_option | cut -d '=' -f 2)
744 --language=*)
745 language=$(echo $ac_option | cut -d '=' -f 2)
748 --enable-static)
749 _ld_static='-static'
751 --disable-static)
752 _ld_static=''
754 --enable-profile)
755 _profile='-p'
757 --disable-profile)
758 _profile=
760 --enable-debug)
761 _debug='-g'
763 --enable-debug=*)
764 _debug=$(echo $_echo_n '-g'$_echo_c; echo $ac_option | cut -d '=' -f 2)
766 --disable-debug)
767 _debug=
769 --enable-translation) _translation=yes ;;
770 --disable-translation) _translation=no ;;
771 --enable-runtime-cpudetection) _runtime_cpudetection=yes ;;
772 --disable-runtime-cpudetection) _runtime_cpudetection=no ;;
773 --enable-cross-compile) _cross_compile=yes ;;
774 --disable-cross-compile) _cross_compile=no ;;
775 --enable-x11) _x11=yes ;;
776 --disable-x11) _x11=no ;;
777 --enable-xss) _xss=yes ;;
778 --disable-xss) _xss=no ;;
779 --enable-xv) _xv=yes ;;
780 --disable-xv) _xv=no ;;
781 --enable-vdpau) _vdpau=yes ;;
782 --disable-vdpau) _vdpau=no ;;
783 --enable-sdl) _sdl=yes ;;
784 --disable-sdl) _sdl=no ;;
785 --enable-direct3d) _direct3d=yes ;;
786 --disable-direct3d) _direct3d=no ;;
787 --enable-directx) _directx=yes ;;
788 --disable-directx) _directx=no ;;
789 --enable-png) _png=yes ;;
790 --disable-png) _png=no ;;
791 --enable-mng) _mng=yes ;;
792 --disable-mng) _mng=no ;;
793 --enable-jpeg) _jpeg=yes ;;
794 --disable-jpeg) _jpeg=no ;;
795 --enable-pnm) _pnm=yes ;;
796 --disable-pnm) _pnm=no ;;
797 --enable-md5sum) _md5sum=yes ;;
798 --disable-md5sum) _md5sum=no ;;
799 --enable-yuv4mpeg) _yuv4mpeg=yes ;;
800 --disable-yuv4mpeg) _yuv4mpeg=no ;;
801 --enable-gif) _gif=yes ;;
802 --disable-gif) _gif=no ;;
803 --enable-gl) _gl=yes ;;
804 --disable-gl) _gl=no ;;
805 --enable-caca) _caca=yes ;;
806 --disable-caca) _caca=no ;;
807 --enable-dvb) _dvb=yes ;;
808 --disable-dvb) _dvb=no ;;
809 --enable-v4l2) _v4l2=yes ;;
810 --disable-v4l2) _v4l2=no ;;
811 --enable-iconv) _iconv=yes ;;
812 --disable-iconv) _iconv=no ;;
813 --enable-langinfo) _langinfo=yes ;;
814 --disable-langinfo) _langinfo=no ;;
815 --enable-rtc) _rtc=yes ;;
816 --disable-rtc) _rtc=no ;;
817 --enable-libdv) _libdv=yes ;;
818 --disable-libdv) _libdv=no ;;
819 --enable-ossaudio) _ossaudio=yes ;;
820 --disable-ossaudio) _ossaudio=no ;;
821 --enable-rsound) _rsound=yes ;;
822 --disable-rsound) _rsound=no ;;
823 --enable-pulse) _pulse=yes ;;
824 --disable-pulse) _pulse=no ;;
825 --enable-portaudio) _portaudio=yes ;;
826 --disable-portaudio) _portaudio=no ;;
827 --enable-jack) _jack=yes ;;
828 --disable-jack) _jack=no ;;
829 --enable-openal) _openal=yes ;;
830 --disable-openal) _openal=no ;;
831 --enable-mad) _mad=yes ;;
832 --disable-mad) _mad=no ;;
833 --enable-libcdio) _libcdio=yes ;;
834 --disable-libcdio) _libcdio=no ;;
835 --enable-libvorbis) _libvorbis=yes ;;
836 --disable-libvorbis) _libvorbis=no ;;
837 --enable-speex) _speex=yes ;;
838 --disable-speex) _speex=no ;;
839 --enable-tremor) _tremor=yes ;;
840 --disable-tremor) _tremor=no ;;
841 --enable-theora) _theora=yes ;;
842 --disable-theora) _theora=no ;;
843 --enable-mpg123) _mpg123=yes ;;
844 --disable-mpg123) _mpg123=no ;;
845 --enable-liba52) _liba52=yes ;;
846 --disable-liba52) _liba52=no ;;
847 --enable-libdca) _libdca=yes ;;
848 --disable-libdca) _libdca=no ;;
849 --enable-musepack) _musepack=yes ;;
850 --disable-musepack) _musepack=no ;;
851 --enable-faad) _faad=yes ;;
852 --disable-faad) _faad=no ;;
853 --enable-ladspa) _ladspa=yes ;;
854 --disable-ladspa) _ladspa=no ;;
855 --enable-libbs2b) _libbs2b=yes ;;
856 --disable-libbs2b) _libbs2b=no ;;
857 --enable-xmms) _xmms=yes ;;
858 --disable-xmms) _xmms=no ;;
859 --enable-vcd) _vcd=yes ;;
860 --disable-vcd) _vcd=no ;;
861 --enable-bluray) _bluray=yes ;;
862 --disable-bluray) _bluray=no ;;
863 --enable-dvdread) _dvdread=yes ;;
864 --disable-dvdread) _dvdread=no ;;
865 --enable-dvdread-internal) _dvdread_internal=yes ;;
866 --disable-dvdread-internal) _dvdread_internal=no ;;
867 --enable-libdvdcss-internal) _libdvdcss_internal=yes ;;
868 --disable-libdvdcss-internal) _libdvdcss_internal=no ;;
869 --enable-dvdnav) _dvdnav=yes ;;
870 --disable-dvdnav) _dvdnav=no ;;
871 --enable-xanim) _xanim=yes ;;
872 --disable-xanim) _xanim=no ;;
873 --enable-real) _real=yes ;;
874 --disable-real) _real=no ;;
875 --enable-lcms2) _lcms2=yes ;;
876 --disable-lcms2) _lcms2=no ;;
877 --enable-xinerama) _xinerama=yes ;;
878 --disable-xinerama) _xinerama=no ;;
879 --enable-vm) _vm=yes ;;
880 --disable-vm) _vm=no ;;
881 --enable-xf86keysym) _xf86keysym=yes ;;
882 --disable-xf86keysym) _xf86keysym=no ;;
883 --enable-alsa) _alsa=yes ;;
884 --disable-alsa) _alsa=no ;;
885 --enable-tv) _tv=yes ;;
886 --disable-tv) _tv=no ;;
887 --enable-tv-bsdbt848) _tv_bsdbt848=yes ;;
888 --disable-tv-bsdbt848) _tv_bsdbt848=no ;;
889 --enable-tv-v4l1) _tv_v4l1=yes ;;
890 --disable-tv-v4l1) _tv_v4l1=no ;;
891 --enable-tv-v4l2) _tv_v4l2=yes ;;
892 --disable-tv-v4l2) _tv_v4l2=no ;;
893 --enable-tv-dshow) _tv_dshow=yes ;;
894 --disable-tv-dshow) _tv_dshow=no ;;
895 --enable-radio) _radio=yes ;;
896 --enable-radio-capture) _radio_capture=yes ;;
897 --disable-radio-capture) _radio_capture=no ;;
898 --disable-radio) _radio=no ;;
899 --enable-radio-v4l) _radio_v4l=yes ;;
900 --disable-radio-v4l) _radio_v4l=no ;;
901 --enable-radio-v4l2) _radio_v4l2=yes ;;
902 --disable-radio-v4l2) _radio_v4l2=no ;;
903 --enable-radio-bsdbt848) _radio_bsdbt848=yes ;;
904 --disable-radio-bsdbt848) _radio_bsdbt848=no ;;
905 --enable-pvr) _pvr=yes ;;
906 --disable-pvr) _pvr=no ;;
907 --enable-fastmemcpy) _fastmemcpy=yes ;;
908 --disable-fastmemcpy) _fastmemcpy=no ;;
909 --enable-networking) networking=yes ;;
910 --disable-networking) networking=no ;;
911 --enable-winsock2_h) _winsock2_h=yes ;;
912 --disable-winsock2_h) _winsock2_h=no ;;
913 --enable-smb) _smb=yes ;;
914 --disable-smb) _smb=no ;;
915 --enable-libquvi) _libquvi=yes ;;
916 --disable-libquvi) _libquvi=no ;;
917 --enable-joystick) _joystick=yes ;;
918 --disable-joystick) _joystick=no ;;
919 --enable-xvid) _xvid=yes ;;
920 --disable-xvid) _xvid=no ;;
921 --enable-libnut) _libnut=yes ;;
922 --disable-libnut) _libnut=no ;;
923 --enable-libav) ffmpeg=yes ;;
924 --ffmpeg-source-dir=*)
925 _ffmpeg_source=$(echo $ac_option | cut -d '=' -f 2 ) ;;
927 --enable-lirc) _lirc=yes ;;
928 --disable-lirc) _lirc=no ;;
929 --enable-lircc) _lircc=yes ;;
930 --disable-lircc) _lircc=no ;;
931 --enable-apple-remote) _apple_remote=yes ;;
932 --disable-apple-remote) _apple_remote=no ;;
933 --enable-apple-ir) _apple_ir=yes ;;
934 --disable-apple-ir) _apple_ir=no ;;
935 --enable-termcap) _termcap=yes ;;
936 --disable-termcap) _termcap=no ;;
937 --enable-termios) _termios=yes ;;
938 --disable-termios) _termios=no ;;
939 --disable-tga) _tga=no ;;
940 --enable-tga) _tga=yes ;;
941 --enable-directfb) _directfb=yes ;;
942 --disable-directfb) _directfb=no ;;
943 --enable-shm) _shm=yes ;;
944 --disable-shm) _shm=no ;;
945 --enable-select) _select=yes ;;
946 --disable-select) _select=no ;;
947 --enable-cddb) _cddb=yes ;;
948 --disable-cddb) _cddb=no ;;
949 --enable-big-endian) _big_endian=yes ;;
950 --disable-big-endian) _big_endian=no ;;
951 --enable-unrarexec) _unrar_exec=yes ;;
952 --disable-unrarexec) _unrar_exec=no ;;
953 --enable-ftp) _ftp=yes ;;
954 --disable-ftp) _ftp=no ;;
955 --enable-vstream) _vstream=yes ;;
956 --disable-vstream) _vstream=no ;;
957 --enable-pthreads) _pthreads=yes ;;
958 --disable-pthreads) _pthreads=no ;;
959 --enable-w32threads) _w32threads=yes ;;
960 --disable-w32threads) _w32threads=no ;;
961 --enable-libass) _ass=yes ;;
962 --disable-libass) _ass=no ;;
963 --enable-rpath) _rpath=yes ;;
964 --disable-rpath) _rpath=no ;;
965 --enable-libpostproc) libpostproc=yes ;;
966 --disable-libpostproc) libpostproc=no ;;
967 --enable-libavresample) libavresample=yes ;;
968 --disable-libavresample) libavresample=no ;;
970 --enable-enca) _enca=yes ;;
971 --disable-enca) _enca=no ;;
973 --enable-inet6) _inet6=yes ;;
974 --disable-inet6) _inet6=no ;;
976 --enable-gethostbyname2) _gethostbyname2=yes ;;
977 --disable-gethostbyname2) _gethostbyname2=no ;;
979 --enable-qtx) _qtx=yes ;;
980 --disable-qtx) _qtx=no ;;
982 --enable-coreaudio) _coreaudio=yes ;;
983 --disable-coreaudio) _coreaudio=no ;;
984 --enable-corevideo) _corevideo=yes ;;
985 --disable-corevideo) _corevideo=no ;;
986 --enable-cocoa) _cocoa=yes ;;
987 --disable-cocoa) _cocoa=no ;;
988 --enable-sharedbuffer) _sharedbuffer=yes ;;
989 --disable-sharedbuffer) _sharedbuffer=no ;;
990 --enable-macosx-finder) _macosx_finder=yes ;;
991 --disable-macosx-finder) _macosx_finder=no ;;
992 --enable-macosx-bundle) _macosx_bundle=yes ;;
993 --disable-macosx-bundle) _macosx_bundle=no ;;
995 --enable-crash-debug) _crash_debug=yes ;;
996 --disable-crash-debug) _crash_debug=no ;;
997 --enable-sighandler) _sighandler=yes ;;
998 --disable-sighandler) _sighandler=no ;;
999 --enable-win32dll) _win32dll=yes ;;
1000 --disable-win32dll) _win32dll=no ;;
1002 --enable-sse) _sse=yes ;;
1003 --disable-sse) _sse=no ;;
1004 --enable-sse2) _sse2=yes ;;
1005 --disable-sse2) _sse2=no ;;
1006 --enable-ssse3) _ssse3=yes ;;
1007 --disable-ssse3) _ssse3=no ;;
1008 --enable-mmxext) _mmxext=yes ;;
1009 --disable-mmxext) _mmxext=no ;;
1010 --enable-3dnow) _3dnow=yes ;;
1011 --disable-3dnow) _3dnow=no _3dnowext=no ;;
1012 --enable-3dnowext) _3dnow=yes _3dnowext=yes ;;
1013 --disable-3dnowext) _3dnowext=no ;;
1014 --enable-cmov) _cmov=yes ;;
1015 --disable-cmov) _cmov=no ;;
1016 --enable-fast-cmov) _fast_cmov=yes ;;
1017 --disable-fast-cmov) _fast_cmov=no ;;
1018 --enable-fast-clz) _fast_clz=yes ;;
1019 --disable-fast-clz) _fast_clz=no ;;
1020 --enable-altivec) _altivec=yes ;;
1021 --disable-altivec) _altivec=no ;;
1022 --enable-armv5te) _armv5te=yes ;;
1023 --disable-armv5te) _armv5te=no ;;
1024 --enable-armv6) _armv6=yes ;;
1025 --disable-armv6) _armv6=no ;;
1026 --enable-armv6t2) _armv6t2=yes ;;
1027 --disable-armv6t2) _armv6t2=no ;;
1028 --enable-armvfp) _armvfp=yes ;;
1029 --disable-armvfp) _armvfp=no ;;
1030 --enable-neon) neon=yes ;;
1031 --disable-neon) neon=no ;;
1032 --enable-iwmmxt) _iwmmxt=yes ;;
1033 --disable-iwmmxt) _iwmmxt=no ;;
1034 --enable-mmx) _mmx=yes ;;
1035 --disable-mmx) # 3Dnow! and MMX2 require MMX
1036 _3dnow=no _3dnowext=no _mmx=no _mmxext=no ;;
1039 echo "Unknown parameter: $ac_option" >&2
1040 exit 1
1043 esac
1044 done
1046 # Atmos: moved this here, to be correct, if --prefix is specified
1047 test -z "$_bindir" && _bindir="$_prefix/bin"
1048 test -z "$_mandir" && _mandir="$_prefix/share/man"
1049 test -z "$_confdir" && _confdir="$_prefix/etc/mplayer"
1050 test -z "$_libdir" && _libdir="$_prefix/lib"
1051 test -z "$_localedir" && _localedir="$_prefix/share/locale"
1053 for tmpdir in "$TMPDIR" "$TEMPDIR" "/tmp" ; do
1054 test "$tmpdir" && break
1055 done
1057 mplayer_tmpdir="$tmpdir/mplayer-configure-$RANDOM-$$"
1058 mkdir $mplayer_tmpdir || die "Unable to create tmpdir."
1060 TMPLOG="config.log"
1062 rm -f "$TMPLOG"
1063 echo Parameters configure was run with: > "$TMPLOG"
1064 if test -n "$CFLAGS" ; then
1065 echo ${_echo_n} CFLAGS="'$CFLAGS' ${_echo_c}" >> "$TMPLOG"
1067 if test -n "$PKG_CONFIG_PATH" ; then
1068 echo ${_echo_n} PKG_CONFIG_PATH="'$PKG_CONFIG_PATH' ${_echo_c}" >> "$TMPLOG"
1070 echo ./configure $configuration >> "$TMPLOG"
1071 echo >> "$TMPLOG"
1074 echocheck "cross compilation"
1075 echores $_cross_compile
1077 if test $_cross_compile = yes; then
1078 tmp_run() {
1079 return 0
1083 tool_prefix=""
1085 if test $_cross_compile = yes ; then
1086 # Usually cross-compiler prefixes match with the target triplet
1087 test -n "$_target" && tool_prefix="$_target"-
1090 test "$_ranlib" = auto && _ranlib="$tool_prefix"ranlib
1091 test "$_windres" = auto && _windres="$tool_prefix"windres
1092 test "$_ar" = auto && _ar="$tool_prefix"ar
1093 test "$_yasm" = auto && _yasm="$tool_prefix"yasm
1094 test "$_pkg_config" = auto && _pkg_config="$tool_prefix"pkg-config
1096 if test "$_cc" = auto ; then
1097 if test -n "$tool_prefix" ; then
1098 _cc="$tool_prefix"gcc
1099 else
1100 _cc=cc
1104 # Determine our OS name and CPU architecture
1105 if test -z "$_target" ; then
1106 # OS name
1107 system_name=$(uname -s 2>&1)
1108 case "$system_name" in
1109 Linux|FreeBSD|NetBSD|OpenBSD|DragonFly|BSD/OS|Darwin|QNX|GNU|BeOS|MorphOS|AIX|AmigaOS)
1111 Haiku)
1112 system_name=BeOS
1114 GNU/kFreeBSD)
1115 system_name=FreeBSD
1117 HP-UX*)
1118 system_name=HP-UX
1120 [cC][yY][gG][wW][iI][nN]*)
1121 system_name=CYGWIN
1123 MINGW32*)
1124 system_name=MINGW32
1126 OS/2*)
1127 system_name=OS/2
1130 system_name="$system_name-UNKNOWN"
1132 esac
1135 # host's CPU/instruction set
1136 host_arch=$(uname -p 2>&1)
1137 case "$host_arch" in
1138 i386|sparc|ppc|alpha|arm|mips|vax)
1140 powerpc) # Darwin returns 'powerpc'
1141 host_arch=ppc
1143 *) # uname -p on Linux returns 'unknown' for the processor type,
1144 # OpenBSD returns 'Intel Pentium/MMX ("Genuine Intel" 586-class)'
1146 # Maybe uname -m (machine hardware name) returns something we
1147 # recognize.
1149 # x86/x86pc is used by QNX
1150 case "$(uname -m 2>&1)" in
1151 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 ;;
1152 ia64) host_arch=ia64 ;;
1153 macppc|ppc) host_arch=ppc ;;
1154 ppc64) host_arch=ppc64 ;;
1155 alpha) host_arch=alpha ;;
1156 sparc) host_arch=sparc ;;
1157 sparc64) host_arch=sparc64 ;;
1158 parisc*|hppa*|9000*) host_arch=hppa ;;
1159 arm*|zaurus|cats) host_arch=arm ;;
1160 sh3|sh4|sh4a) host_arch=sh ;;
1161 s390) host_arch=s390 ;;
1162 s390x) host_arch=s390x ;;
1163 *mips*) host_arch=mips ;;
1164 vax) host_arch=vax ;;
1165 xtensa*) host_arch=xtensa ;;
1166 *) host_arch=UNKNOWN ;;
1167 esac
1169 esac
1170 else # if test -z "$_target"
1171 for i in 2 3; do
1172 system_name=$(echo $_target | cut -d '-' -f $i)
1173 case "$(echo $system_name | tr A-Z a-z)" in
1174 linux) system_name=Linux ;;
1175 freebsd) system_name=FreeBSD ;;
1176 gnu/kfreebsd) system_name=FreeBSD ;;
1177 netbsd) system_name=NetBSD ;;
1178 bsd/os) system_name=BSD/OS ;;
1179 openbsd) system_name=OpenBSD ;;
1180 dragonfly) system_name=DragonFly ;;
1181 qnx) system_name=QNX ;;
1182 morphos) system_name=MorphOS ;;
1183 amigaos) system_name=AmigaOS ;;
1184 mingw32*) system_name=MINGW32 ;;
1185 *) continue ;;
1186 esac
1187 break
1188 done
1189 # We need to convert underscores so that values like k6-2 and pentium-mmx can be passed
1190 host_arch=$(echo $_target | cut -d '-' -f 1)
1191 if test $(echo $host_arch) != "x86_64" ; then
1192 host_arch=$(echo $host_arch | tr '_' '-')
1196 extra_cflags="-I. $extra_cflags"
1197 _timer=timer-linux.c
1198 _getch=getch2.c
1199 if freebsd ; then
1200 extra_ldflags="$extra_ldflags -L/usr/local/lib"
1201 extra_cflags="$extra_cflags -I/usr/local/include"
1204 if netbsd || dragonfly ; then
1205 extra_ldflags="$extra_ldflags -L/usr/pkg/lib"
1206 extra_cflags="$extra_cflags -I/usr/pkg/include"
1209 if darwin; then
1210 extra_cflags="-mdynamic-no-pic $extra_cflags"
1211 _timer=timer-darwin.c
1214 if aix ; then
1215 extra_ldflags="$extra_ldflags -lC"
1218 if linux ; then
1219 _ranlib='true'
1222 if win32 ; then
1223 _exesuf=".exe"
1224 extra_cflags="$extra_cflags -fno-common"
1225 # -lwinmm is always needed for osdep/timer-win2.c
1226 extra_ldflags="$extra_ldflags -lwinmm"
1227 _pe_executable=yes
1228 _timer=timer-win2.c
1229 _priority=yes
1230 def_dos_paths="#define HAVE_DOS_PATHS 1"
1231 def_priority="#define CONFIG_PRIORITY 1"
1234 if mingw32 ; then
1235 _getch=getch2-win.c
1236 need_shmem=no
1237 extra_cflags="$extra_cflags -D__USE_MINGW_ANSI_STDIO=1"
1240 if amigaos ; then
1241 _select=no
1242 _sighandler=no
1243 _stream_cache=no
1244 def_stream_cache="#undef CONFIG_STREAM_CACHE"
1245 extra_cflags="-DNEWLIB -D__USE_INLINE__ $extra_cflags"
1248 if qnx ; then
1249 extra_ldflags="$extra_ldflags -lph"
1252 TMPC="$mplayer_tmpdir/tmp.c"
1253 TMPEXE="$mplayer_tmpdir/tmp$_exesuf"
1254 TMPH="$mplayer_tmpdir/tmp.h"
1255 TMPS="$mplayer_tmpdir/tmp.S"
1257 if test "$_runtime_cpudetection" = yes && ! x86 && ! ppc; then
1258 die "Runtime CPU detection only works for x86, x86-64 and PPC!"
1261 _rst2man=rst2man
1262 if [ -f "$(which rst2man.py)" ] ; then
1263 _rst2man=rst2man.py
1266 # Checking CC version...
1267 # Intel C++ Compilers (no autoselect, use CC=/some/binary ./configure)
1268 if test "$(basename $_cc)" = "icc" || test "$(basename $_cc)" = "ecc"; then
1269 echocheck "$_cc version"
1270 cc_vendor=intel
1271 cc_name=$($_cc -V 2>&1 | head -n 1 | cut -d ',' -f 1)
1272 cc_version=$($_cc -V 2>&1 | head -n 1 | cut -d ',' -f 2 | cut -d ' ' -f 3)
1273 _cc_major=$(echo $cc_version | cut -d '.' -f 1)
1274 _cc_minor=$(echo $cc_version | cut -d '.' -f 2)
1275 # TODO verify older icc/ecc compatibility
1276 case $cc_version in
1278 cc_version="v. ?.??, bad"
1279 cc_fail=yes
1281 10.1|11.0|11.1)
1282 cc_version="$cc_version, ok"
1285 cc_version="$cc_version, bad"
1286 cc_fail=yes
1288 esac
1289 echores "$cc_version"
1290 else
1291 for _cc in "$_cc" gcc cc ; do
1292 cc_name_tmp=$($_cc -v 2>&1 | tail -n 1 | cut -d ' ' -f 1)
1293 if test "$cc_name_tmp" = "gcc"; then
1294 cc_name=$cc_name_tmp
1295 echocheck "$_cc version"
1296 cc_vendor=gnu
1297 cc_version=$($_cc -dumpversion 2>&1)
1298 case $cc_version in
1299 2.96*)
1300 cc_fail=yes
1303 _cc_major=$(echo $cc_version | cut -d '.' -f 1)
1304 _cc_minor=$(echo $cc_version | cut -d '.' -f 2)
1305 _cc_mini=$(echo $cc_version | cut -d '.' -f 3)
1307 esac
1308 echores "$cc_version"
1309 break
1311 if $_cc -v 2>&1 | grep -q "clang"; then
1312 echocheck "$_cc version"
1313 cc_vendor=clang
1314 cc_version=$($_cc -dumpversion 2>&1)
1315 res_comment="experimental support only"
1316 echores "clang $cc_version"
1317 break
1319 cc_name_tmp=$($_cc -V 2>&1 | head -n 1 | cut -d ' ' -f 2,3)
1320 done
1321 fi # icc
1322 test "$cc_fail" = yes && die "unsupported compiler version"
1324 echocheck "working compiler"
1325 cflag_check "" || die "Compiler is not functioning correctly. Check your installation and custom CFLAGS $CFLAGS ."
1326 echo "yes"
1328 if test -z "$_target" && x86 ; then
1329 cat > $TMPC << EOF
1330 int main(void) {
1331 int test[(int)sizeof(char *)-7];
1332 return 0;
1335 cc_check && host_arch=x86_64 || host_arch=i386
1338 echo "Detected operating system: $system_name"
1339 echo "Detected host architecture: $host_arch"
1341 # ---
1343 # now that we know what compiler should be used for compilation, try to find
1344 # out which assembler is used by the $_cc compiler
1345 if test "$_as" = auto ; then
1346 _as=$($_cc -print-prog-name=as)
1347 test -z "$_as" && _as=as
1350 if test "$_nm" = auto ; then
1351 _nm=$($_cc -print-prog-name=nm)
1352 test -z "$_nm" && _nm=nm
1355 # XXX: this should be ok..
1356 _cpuinfo="echo"
1358 if test "$_runtime_cpudetection" = no ; then
1360 # Cygwin has /proc/cpuinfo, but only supports Intel CPUs
1361 # FIXME: Remove the cygwin check once AMD CPUs are supported
1362 if test -r /proc/cpuinfo && ! cygwin; then
1363 # Linux with /proc mounted, extract CPU information from it
1364 _cpuinfo="cat /proc/cpuinfo"
1365 elif test -r /compat/linux/proc/cpuinfo && ! x86 ; then
1366 # FreeBSD with Linux emulation /proc mounted,
1367 # extract CPU information from it
1368 # Don't use it on x86 though, it never reports 3Dnow
1369 _cpuinfo="cat /compat/linux/proc/cpuinfo"
1370 elif darwin && ! x86 ; then
1371 # use hostinfo on Darwin
1372 _cpuinfo="hostinfo"
1373 elif aix; then
1374 # use 'lsattr' on AIX
1375 _cpuinfo="lsattr -E -l proc0 -a type"
1376 elif x86; then
1377 # all other OSes try to extract CPU information from a small helper
1378 # program cpuinfo instead
1379 $_cc -o cpuinfo$_exesuf cpuinfo.c
1380 _cpuinfo="./cpuinfo$_exesuf"
1383 if x86 ; then
1384 # gather more CPU information
1385 pname=$($_cpuinfo | grep 'model name' | cut -d ':' -f 2 | head -n 1)
1386 pvendor=$($_cpuinfo | grep 'vendor_id' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1)
1387 pfamily=$($_cpuinfo | grep 'cpu family' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1)
1388 pmodel=$($_cpuinfo | grep -v 'model name' | grep 'model' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1)
1389 pstepping=$($_cpuinfo | grep 'stepping' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1)
1391 exts=$($_cpuinfo | egrep 'features|flags' | cut -d ':' -f 2 | head -n 1)
1393 pparam=$(echo $exts | sed -e s/xmm/sse/ -e s/kni/sse/)
1394 # SSE implies MMX2, but not all SSE processors report the mmxext CPU flag.
1395 pparam=$(echo $pparam | sed -e 's/sse/sse mmxext/')
1397 for ext in $pparam ; do
1398 eval test \"\$_$ext\" = auto 2>/dev/null && eval _$ext=kernel_check
1399 done
1401 echocheck "CPU vendor"
1402 echores "$pvendor ($pfamily:$pmodel:$pstepping)"
1404 echocheck "CPU type"
1405 echores "$pname"
1408 fi # test "$_runtime_cpudetection" = no
1410 if x86 && test "$_runtime_cpudetection" = no ; then
1411 extcheck() {
1412 if test "$1" = kernel_check ; then
1413 echocheck "kernel support of $2"
1414 cat > $TMPC <<EOF
1415 #include <stdlib.h>
1416 #include <signal.h>
1417 static void catch(int sig) { exit(1); }
1418 int main(void) {
1419 signal(SIGILL, catch);
1420 __asm__ volatile ("$3":::"memory"); return 0;
1424 if cc_check && tmp_run ; then
1425 eval _$2=yes
1426 echores "yes"
1427 _optimizing="$_optimizing $2"
1428 return 0
1429 else
1430 eval _$2=no
1431 echores "failed"
1432 echo "It seems that your kernel does not correctly support $2."
1433 echo "To use $2 extensions in MPlayer, you have to upgrade/recompile your kernel!"
1434 return 1
1437 return 0
1440 extcheck $_mmx "mmx" "emms"
1441 extcheck $_mmxext "mmxext" "sfence"
1442 extcheck $_3dnow "3dnow" "femms"
1443 extcheck $_3dnowext "3dnowext" "pswapd %%mm0, %%mm0"
1444 extcheck $_sse "sse" "xorps %%xmm0, %%xmm0" || _gcc3_ext="$_gcc3_ext -mno-sse"
1445 extcheck $_sse2 "sse2" "xorpd %%xmm0, %%xmm0" || _gcc3_ext="$_gcc3_ext -mno-sse2"
1446 extcheck $_ssse3 "ssse3" "pabsd %%xmm0, %%xmm0"
1447 extcheck $_cmov "cmov" "cmovb %%eax, %%ebx"
1449 if test "$_gcc3_ext" != ""; then
1450 # if we had to disable sse/sse2 because the active kernel does not
1451 # support this instruction set extension, we also have to tell
1452 # gcc3 to not generate sse/sse2 instructions for normal C code
1453 cflag_check $_march $_gcc3_ext && _march="$_march $_gcc3_ext"
1459 def_fast_64bit='#define HAVE_FAST_64BIT 0'
1460 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 0'
1461 arch_all='X86 IA64 SPARC ARM AVR32 SH4 PPC ALPHA MIPS PA_RISC S390 S390X VAX BFIN XTENSA TOMI GENERIC'
1462 subarch_all='X86_32 X86_64 PPC64'
1463 case "$host_arch" in
1464 i[3-9]86|x86|x86pc|k5|k6|k6-2|k6-3|pentium*|athlon*|i586-i686)
1465 arch='x86'
1466 subarch='x86_32'
1467 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
1468 iproc=486
1469 proc=i486
1472 if test "$_runtime_cpudetection" = no ; then
1473 case "$pvendor" in
1474 AuthenticAMD)
1475 case "$pfamily" in
1476 3) proc=i386 iproc=386 ;;
1477 4) proc=i486 iproc=486 ;;
1478 5) iproc=586 # LGB: models are: K5/SSA5 K5 K5 K5 ? ? K6 K6 K6-2 K6-3
1479 # K6 model 13 are the K6-2+ and K6-III+, only differing in cache size.
1480 if test "$pmodel" -eq 9 -o "$pmodel" -eq 13; then
1481 proc=k6-3
1482 elif test "$pmodel" -eq 5 -o "$pmodel" -eq 10; then
1483 proc=geode
1484 elif test "$pmodel" -ge 8; then
1485 proc=k6-2
1486 elif test "$pmodel" -ge 6; then
1487 proc=k6
1488 else
1489 proc=i586
1492 6) iproc=686
1493 # It's a bit difficult to determine the correct type of Family 6
1494 # AMD CPUs just from their signature. Instead, we check directly
1495 # whether it supports SSE.
1496 if test "$_sse" = yes; then
1497 # gcc treats athlon-xp, athlon-4 and athlon-mp similarly.
1498 proc=athlon-xp
1499 else
1500 # Again, gcc treats athlon and athlon-tbird similarly.
1501 proc=athlon
1504 15) iproc=686
1505 # k8 cpu-type only supported in gcc >= 3.4.0, but that will be
1506 # caught and remedied in the optimization tests below.
1507 proc=k8
1510 *) proc=amdfam10 iproc=686
1511 test $_fast_clz = "auto" && _fast_clz=yes
1513 esac
1515 GenuineIntel)
1516 case "$pfamily" in
1517 3) proc=i386 iproc=386 ;;
1518 4) proc=i486 iproc=486 ;;
1519 5) iproc=586
1520 if test "$pmodel" -eq 4 || test "$pmodel" -eq 8; then
1521 proc=pentium-mmx # 4 is desktop, 8 is mobile
1522 else
1523 proc=i586
1526 6) iproc=686
1527 if test "$pmodel" -ge 15; then
1528 proc=core2
1529 elif test "$pmodel" -eq 9 -o "$pmodel" -ge 13; then
1530 proc=pentium-m
1531 elif test "$pmodel" -ge 7; then
1532 proc=pentium3
1533 elif test "$pmodel" -ge 3; then
1534 proc=pentium2
1535 else
1536 proc=i686
1538 test $_fast_clz = "auto" && _fast_clz=yes
1540 15) iproc=686
1541 # A nocona in 32-bit mode has no more capabilities than a prescott.
1542 if test "$pmodel" -ge 3; then
1543 proc=prescott
1544 else
1545 proc=pentium4
1546 test $_fast_clz = "auto" && _fast_clz=yes
1548 test $_fast_cmov = "auto" && _fast_cmov=no
1550 *) proc=prescott iproc=686 ;;
1551 esac
1553 CentaurHauls)
1554 case "$pfamily" in
1555 5) iproc=586
1556 if test "$pmodel" -ge 8; then
1557 proc=winchip2
1558 elif test "$pmodel" -ge 4; then
1559 proc=winchip-c6
1560 else
1561 proc=i586
1564 6) iproc=686
1565 if test "$pmodel" -ge 9; then
1566 proc=c3-2
1567 else
1568 proc=c3
1569 iproc=586
1572 *) proc=i686 iproc=i686 ;;
1573 esac
1575 unknown)
1576 case "$pfamily" in
1577 3) proc=i386 iproc=386 ;;
1578 4) proc=i486 iproc=486 ;;
1579 *) proc=i586 iproc=586 ;;
1580 esac
1583 proc=i586 iproc=586 ;;
1584 esac
1585 test $_fast_clz = "auto" && _fast_clz=no
1586 fi # test "$_runtime_cpudetection" = no
1589 # check that gcc supports our CPU, if not, fall back to earlier ones
1590 # LGB: check -mcpu and -march swithing step by step with enabling
1591 # to fall back till 386.
1593 # gcc >= 3.4.0 doesn't support -mcpu, we have to use -mtune instead
1595 if [ "$cc_vendor" = "gnu" ] && ([ "$_cc_major" -gt 3 ] || ( [ "$_cc_major" = 3 ] && [ "$_cc_minor" -ge 4 ])) ; then
1596 cpuopt=-mtune
1597 else
1598 cpuopt=-mcpu
1601 echocheck "GCC & CPU optimization abilities"
1602 if test "$_runtime_cpudetection" = no ; then
1603 if test $cc_vendor != "intel" && test $cc_vendor != "clang" ; then
1604 cflag_check -march=native && proc=native
1606 if test "$proc" = "amdfam10"; then
1607 cflag_check -march=$proc $cpuopt=$proc || proc=k8
1609 if test "$proc" = "k8"; then
1610 cflag_check -march=$proc $cpuopt=$proc || proc=athlon-xp
1612 if test "$proc" = "athlon-xp"; then
1613 cflag_check -march=$proc $cpuopt=$proc || proc=athlon
1615 if test "$proc" = "k6-3" || test "$proc" = "k6-2"; then
1616 cflag_check -march=$proc $cpuopt=$proc || proc=k6
1618 if test "$proc" = "k6" || test "$proc" = "c3"; then
1619 if ! cflag_check -march=$proc $cpuopt=$proc; then
1620 if cflag_check -march=i586 $cpuopt=i686; then
1621 proc=i586-i686
1622 else
1623 proc=i586
1627 if test "$proc" = "prescott" ; then
1628 cflag_check -march=$proc $cpuopt=$proc || proc=pentium4
1630 if test "$proc" = "core2" ; then
1631 cflag_check -march=$proc $cpuopt=$proc || proc=pentium-m
1633 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
1634 cflag_check -march=$proc $cpuopt=$proc || proc=i686
1636 if test "$proc" = "i686" || test "$proc" = "pentium-mmx" || test "$proc" = "winchip-c6" || test "$proc" = "winchip2"; then
1637 cflag_check -march=$proc $cpuopt=$proc || proc=i586
1639 if test "$proc" = "i586"; then
1640 cflag_check -march=$proc $cpuopt=$proc || proc=i486
1642 if test "$proc" = "i486" ; then
1643 cflag_check -march=$proc $cpuopt=$proc || proc=i386
1645 if test "$proc" = "i386" ; then
1646 cflag_check -march=$proc $cpuopt=$proc || proc=error
1648 if test "$proc" = "error" ; then
1649 echores "CPU optimization disabled. CPU not recognized or your compiler is too old."
1650 _mcpu=""
1651 _march=""
1652 _optimizing=""
1653 elif test "$proc" = "i586-i686"; then
1654 _march="-march=i586"
1655 _mcpu="$cpuopt=i686"
1656 _optimizing="$proc"
1657 else
1658 _march="-march=$proc"
1659 _mcpu="$cpuopt=$proc"
1660 _optimizing="$proc"
1662 else # if test "$_runtime_cpudetection" = no
1663 _mcpu="$cpuopt=generic"
1664 # at least i486 required, for bswap instruction
1665 _march="-march=i486"
1666 cflag_check $_mcpu || _mcpu="$cpuopt=i686"
1667 cflag_check $_mcpu || _mcpu=""
1668 cflag_check $_march $_mcpu || _march=""
1671 ## Gabucino : --target takes effect here (hopefully...) by overwriting
1672 ## autodetected mcpu/march parameters
1673 if test "$_target" ; then
1674 # TODO: it may be a good idea to check GCC and fall back in all cases
1675 if test "$host_arch" = "i586-i686"; then
1676 _march="-march=i586"
1677 _mcpu="$cpuopt=i686"
1678 else
1679 _march="-march=$host_arch"
1680 _mcpu="$cpuopt=$host_arch"
1683 proc="$host_arch"
1685 case "$proc" in
1686 i386) iproc=386 ;;
1687 i486) iproc=486 ;;
1688 i586|k5|k6|k6-2|k6-3|pentium|pentium-mmx) iproc=586 ;;
1689 i686|athlon*|pentium*) iproc=686 ;;
1690 *) iproc=586 ;;
1691 esac
1694 if test $_cmov = "yes" && test $_fast_cmov = "auto" ; then
1695 _fast_cmov="yes"
1696 else
1697 _fast_cmov="no"
1699 test $_fast_clz = "auto" && _fast_clz=yes
1701 echores "$proc"
1704 ia64)
1705 arch='ia64'
1706 def_fast_64bit='#define HAVE_FAST_64BIT 1'
1707 iproc='ia64'
1710 x86_64|amd64)
1711 arch='x86'
1712 subarch='x86_64'
1713 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
1714 def_fast_64bit='#define HAVE_FAST_64BIT 1'
1715 iproc='x86_64'
1717 # gcc >= 3.4.0 doesn't support -mcpu, we have to use -mtune instead
1718 if test "$cc_vendor" = "gnu" && test "$_cc_major" -gt 3 -o "$_cc_major" -eq 3 -a "$_cc_minor" -ge 4 ; then
1719 cpuopt=-mtune
1720 else
1721 cpuopt=-mcpu
1723 if test "$_runtime_cpudetection" = no ; then
1724 case "$pvendor" in
1725 AuthenticAMD)
1726 case "$pfamily" in
1727 15) proc=k8
1728 test $_fast_clz = "auto" && _fast_clz=no
1730 *) proc=amdfam10;;
1731 esac
1733 GenuineIntel)
1734 case "$pfamily" in
1735 6) proc=core2;;
1737 # 64-bit prescotts exist, but as far as GCC is concerned they
1738 # have the same capabilities as a nocona.
1739 proc=nocona
1740 test $_fast_cmov = "auto" && _fast_cmov=no
1741 test $_fast_clz = "auto" && _fast_clz=no
1743 esac
1746 proc=error;;
1747 esac
1748 fi # test "$_runtime_cpudetection" = no
1750 echocheck "GCC & CPU optimization abilities"
1751 # This is a stripped-down version of the i386 fallback.
1752 if test "$_runtime_cpudetection" = no ; then
1753 if test $cc_vendor != "intel" && test $cc_vendor != "clang" ; then
1754 cflag_check -march=native && proc=native
1756 # --- AMD processors ---
1757 if test "$proc" = "amdfam10"; then
1758 cflag_check -march=$proc $cpuopt=$proc || proc=k8
1760 if test "$proc" = "k8"; then
1761 cflag_check -march=$proc $cpuopt=$proc || proc=athlon-xp
1763 # This will fail if gcc version < 3.3, which is ok because earlier
1764 # versions don't really support 64-bit on amd64.
1765 # Is this a valid assumption? -Corey
1766 if test "$proc" = "athlon-xp"; then
1767 cflag_check -march=$proc $cpuopt=$proc || proc=error
1769 # --- Intel processors ---
1770 if test "$proc" = "core2"; then
1771 cflag_check -march=$proc $cpuopt=$proc || proc=x86-64
1773 if test "$proc" = "x86-64"; then
1774 cflag_check -march=$proc $cpuopt=$proc || proc=nocona
1776 if test "$proc" = "nocona"; then
1777 cflag_check -march=$proc $cpuopt=$proc || proc=pentium4
1779 if test "$proc" = "pentium4"; then
1780 cflag_check -march=$proc $cpuopt=$proc || proc=error
1783 _march="-march=$proc"
1784 _mcpu="$cpuopt=$proc"
1785 if test "$proc" = "error" ; then
1786 echores "CPU optimization disabled. CPU not recognized or your compiler is too old."
1787 _mcpu=""
1788 _march=""
1790 else # if test "$_runtime_cpudetection" = no
1791 # x86-64 is an undocumented option, an intersection of k8 and nocona.
1792 _march="-march=x86-64"
1793 _mcpu="$cpuopt=generic"
1794 cflag_check $_mcpu || _mcpu="x86-64"
1795 cflag_check $_mcpu || _mcpu=""
1796 cflag_check $_march $_mcpu || _march=""
1799 _optimizing="$proc"
1800 test $_fast_cmov = "auto" && _fast_cmov=yes
1801 test $_fast_clz = "auto" && _fast_clz=yes
1803 echores "$proc"
1806 sparc|sparc64)
1807 arch='sparc'
1808 iproc='sparc'
1809 if test "$host_arch" = "sparc64" ; then
1810 _vis='yes'
1811 proc='ultrasparc'
1812 def_fast_64bit='#define HAVE_FAST_64BIT 1'
1813 else
1814 proc=v8
1816 _mcpu="-mcpu=$proc"
1817 _optimizing="$proc"
1820 arm*)
1821 arch='arm'
1822 iproc='arm'
1825 avr32)
1826 arch='avr32'
1827 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
1828 iproc='avr32'
1829 test $_fast_clz = "auto" && _fast_clz=yes
1832 sh|sh4)
1833 arch='sh4'
1834 iproc='sh4'
1837 ppc|ppc64|powerpc|powerpc64)
1838 arch='ppc'
1839 def_dcbzl='#define HAVE_DCBZL 0'
1840 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
1841 iproc='ppc'
1843 if test "$host_arch" = "ppc64" -o "$host_arch" = "powerpc64" ; then
1844 subarch='ppc64'
1845 def_fast_64bit='#define HAVE_FAST_64BIT 1'
1847 echocheck "CPU type"
1848 case $system_name in
1849 Linux)
1850 proc=$($_cpuinfo | grep 'cpu' | cut -d ':' -f 2 | cut -d ',' -f 1 | cut -b 2- | head -n 1)
1851 if test -n "$($_cpuinfo | grep altivec)"; then
1852 test $_altivec = auto && _altivec=yes
1855 Darwin)
1856 proc=$($_cpuinfo | grep "Processor type" | cut -f 3 -d ' ' | sed 's/ppc//')
1857 if [ $(sysctl -n hw.vectorunit) -eq 1 -o \
1858 "$(sysctl -n hw.optional.altivec 2> /dev/null)" = "1" ]; then
1859 test $_altivec = auto && _altivec=yes
1862 NetBSD)
1863 # only gcc 3.4 works reliably with AltiVec code under NetBSD
1864 case $cc_version in
1865 2*|3.0*|3.1*|3.2*|3.3*)
1868 if [ $(sysctl -n machdep.altivec) -eq 1 ]; then
1869 test $_altivec = auto && _altivec=yes
1872 esac
1874 AIX)
1875 proc=$($_cpuinfo | grep 'type' | cut -f 2 -d ' ' | sed 's/PowerPC_//')
1877 esac
1878 if test "$_altivec" = yes; then
1879 echores "$proc altivec"
1880 else
1881 _altivec=no
1882 echores "$proc"
1885 echocheck "GCC & CPU optimization abilities"
1887 if test -n "$proc"; then
1888 case "$proc" in
1889 601) _march='-mcpu=601' _mcpu='-mtune=601' ;;
1890 603) _march='-mcpu=603' _mcpu='-mtune=603' ;;
1891 603e|603ev) _march='-mcpu=603e' _mcpu='-mtune=603e' ;;
1892 604|604e|604r|604ev) _march='-mcpu=604' _mcpu='-mtune=604' ;;
1893 740|740/750|745/755) _march='-mcpu=740' _mcpu='-mtune=740' ;;
1894 750|750CX) _march='-mcpu=750' _mcpu='-mtune=750' ;;
1895 POWER) _march='-mcpu=power' _mcpu='-mtune=power' ;;
1896 POWER2) _march='-mcpu=power2' _mcpu='-mtune=power2' ;;
1897 POWER3) _march='-mcpu=power3' _mcpu='-mtune=power3' ;;
1898 *) ;;
1899 esac
1900 # gcc 3.1(.1) and up supports 7400 and 7450
1901 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "1" || test "$_cc_major" -ge "4"; then
1902 case "$proc" in
1903 7400*|7410*) _march='-mcpu=7400' _mcpu='-mtune=7400' ;;
1904 7447*|7450*|7455*) _march='-mcpu=7450' _mcpu='-mtune=7450' ;;
1905 *) ;;
1906 esac
1908 # gcc 3.2 and up supports 970
1909 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "3" || test "$_cc_major" -ge "4"; then
1910 case "$proc" in
1911 970*|PPC970*) _march='-mcpu=970' _mcpu='-mtune=970'
1912 def_dcbzl='#define HAVE_DCBZL 1' ;;
1913 *) ;;
1914 esac
1916 # gcc 3.3 and up supports POWER4
1917 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "3" || test "$_cc_major" -ge "4"; then
1918 case "$proc" in
1919 POWER4) _march='-mcpu=power4' _mcpu='-mtune=power4' ;;
1920 *) ;;
1921 esac
1923 # gcc 3.4 and up supports 440*
1924 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "4" || test "$_cc_major" -ge "4"; then
1925 case "$proc" in
1926 440EP*) _march='-mcpu=440fp' _mcpu='-mtune=440fp' ;;
1927 440G* ) _march='-mcpu=440' _mcpu='-mtune=440' ;;
1928 *) ;;
1929 esac
1931 # gcc 4.0 and up supports POWER5
1932 if test "$_cc_major" -ge "4"; then
1933 case "$proc" in
1934 POWER5*) _march='-mcpu=power5' _mcpu='-mtune=power5' ;;
1935 *) ;;
1936 esac
1940 if test -n "$_mcpu"; then
1941 _optimizing=$(echo $_mcpu | cut -c 8-)
1942 echores "$_optimizing"
1943 else
1944 echores "none"
1947 test $_fast_clz = "auto" && _fast_clz=yes
1951 alpha*)
1952 arch='alpha'
1953 iproc='alpha'
1954 def_fast_64bit='#define HAVE_FAST_64BIT 1'
1956 echocheck "CPU type"
1957 cat > $TMPC << EOF
1958 int main(void) {
1959 unsigned long ver, mask;
1960 __asm__ ("implver %0" : "=r" (ver));
1961 __asm__ ("amask %1, %0" : "=r" (mask) : "r" (-1));
1962 printf("%ld-%x\n", ver, ~mask);
1963 return 0;
1966 $_cc -o "$TMPEXE" "$TMPC"
1967 case $("$TMPEXE") in
1969 0-0) proc="ev4"; _mvi="0";;
1970 1-0) proc="ev5"; _mvi="0";;
1971 1-1) proc="ev56"; _mvi="0";;
1972 1-101) proc="pca56"; _mvi="1";;
1973 2-303) proc="ev6"; _mvi="1";;
1974 2-307) proc="ev67"; _mvi="1";;
1975 2-1307) proc="ev68"; _mvi="1";;
1976 esac
1977 echores "$proc"
1979 echocheck "GCC & CPU optimization abilities"
1980 if test "$proc" = "ev68" ; then
1981 cc_check -mcpu=$proc || proc=ev67
1983 if test "$proc" = "ev67" ; then
1984 cc_check -mcpu=$proc || proc=ev6
1986 _mcpu="-mcpu=$proc"
1987 echores "$proc"
1989 test $_fast_clz = "auto" && _fast_clz=yes
1991 _optimizing="$proc"
1994 mips*)
1995 arch='mips'
1996 iproc='mips'
1998 test $_fast_clz = "auto" && _fast_clz=yes
2002 hppa)
2003 arch='pa_risc'
2004 iproc='PA-RISC'
2007 s390)
2008 arch='s390'
2009 iproc='390'
2012 s390x)
2013 arch='s390x'
2014 iproc='390x'
2017 vax)
2018 arch='vax'
2019 iproc='vax'
2022 xtensa)
2023 arch='xtensa'
2024 iproc='xtensa'
2027 generic)
2028 arch='generic'
2032 echo "The architecture of your CPU ($host_arch) is not supported by this configure script"
2033 echo "It seems nobody has ported MPlayer to your OS or CPU type yet."
2034 die "unsupported architecture $host_arch"
2036 esac # case "$host_arch" in
2038 if test "$_runtime_cpudetection" = yes ; then
2039 if x86 ; then
2040 test "$_cmov" != no && _cmov=yes
2041 x86_32 && _cmov=no
2042 test "$_mmx" != no && _mmx=yes
2043 test "$_3dnow" != no && _3dnow=yes
2044 test "$_3dnowext" != no && _3dnowext=yes
2045 test "$_mmxext" != no && _mmxext=yes
2046 test "$_sse" != no && _sse=yes
2047 test "$_sse2" != no && _sse2=yes
2048 test "$_ssse3" != no && _ssse3=yes
2050 if ppc; then
2051 _altivec=yes
2056 # endian testing
2057 echocheck "byte order"
2058 if test "$_big_endian" = auto ; then
2059 cat > $TMPC <<EOF
2060 short ascii_name[] = {
2061 'M' << 8 | 'P', 'l' << 8 | 'a', 'y' << 8 | 'e', 'r' << 8 | 'B',
2062 'i' << 8 | 'g', 'E' << 8 | 'n', 'd' << 8 | 'i', 'a' << 8 | 'n', 0 };
2063 int main(void) { return (long)ascii_name; }
2065 if cc_check ; then
2066 if strings $TMPEXE | grep -q -l MPlayerBigEndian ; then
2067 _big_endian=yes
2068 else
2069 _big_endian=no
2071 else
2072 echo ${_echo_n} "failed to autodetect byte order, defaulting to ${_echo_c}"
2075 if test "$_big_endian" = yes ; then
2076 _byte_order='big-endian'
2077 def_words_endian='#define WORDS_BIGENDIAN 1'
2078 def_bigendian='#define HAVE_BIGENDIAN 1'
2079 else
2080 _byte_order='little-endian'
2081 def_words_endian='#undef WORDS_BIGENDIAN'
2082 def_bigendian='#define HAVE_BIGENDIAN 0'
2084 echores "$_byte_order"
2087 echocheck "extern symbol prefix"
2088 cat > $TMPC << EOF
2089 int ff_extern;
2091 cc_check -c || die "Symbol mangling check failed."
2092 sym=$($_nm -P -g $TMPEXE)
2093 extern_prefix=${sym%%ff_extern*}
2094 def_extern_asm="#define EXTERN_ASM $extern_prefix"
2095 def_extern_prefix="#define EXTERN_PREFIX \"$extern_prefix\""
2096 echores $extern_prefix
2099 echocheck "assembler support of -pipe option"
2100 # -I. helps to detect compilers that just misunderstand -pipe like Sun C
2101 cflag_check -pipe -I. && _pipe="-pipe" && echores "yes" || echores "no"
2104 if darwin && test "$cc_vendor" = "gnu" ; then
2105 echocheck "GCC support of -mstackrealign"
2106 # GCC 4.2 and some earlier Apple versions support this flag on x86. Since
2107 # Mac OS X/Intel has an ABI different from Windows this is needed to avoid
2108 # crashes when loading Win32 DLLs. Unfortunately some gcc versions create
2109 # wrong code with this flag, but this can be worked around by adding
2110 # -fno-unit-at-a-time as described in the blog post at
2111 # http://www.dribin.org/dave/blog/archives/2006/12/05/missing_third_param/
2112 cat > $TMPC << EOF
2113 __attribute__((noinline)) static int foo3(int i1, int i2, int i3) { return i3; }
2114 int main(void) { return foo3(1, 2, 3) == 3 ? 0 : 1; }
2116 cc_check -O2 -mstackrealign && tmp_run && cflags_stackrealign=-mstackrealign
2117 test -z "$cflags_stackrealign" && cc_check -O2 -mstackrealign -fno-unit-at-a-time &&
2118 tmp_run && cflags_stackrealign="-mstackrealign -fno-unit-at-a-time"
2119 test -n "$cflags_stackrealign" && echores "yes" || echores "no"
2120 fi # if darwin && test "$cc_vendor" = "gnu" ; then
2123 # Checking for CFLAGS
2124 _install_strip="-s"
2125 if test "$_profile" != "" || test "$_debug" != "" ; then
2126 _install_strip=
2128 if test -z "$CFLAGS" ; then
2129 if test "$cc_vendor" = "intel" ; then
2130 CFLAGS="-O2 $_debug $_profile $_march $_mcpu $_pipe -fomit-frame-pointer"
2131 WARNFLAGS="-wd167 -wd556 -wd144"
2132 elif test "$cc_vendor" = "clang"; then
2133 CFLAGS="-O2 $_debug $_profile $_march $_pipe"
2134 WARNFLAGS="-Wall -Wno-switch-enum -Wno-logical-op-parentheses -Wpointer-arith -Wundef -Wno-pointer-sign -Wmissing-prototypes"
2135 ERRORFLAGS="-Werror=implicit-function-declaration"
2136 elif test "$cc_vendor" != "gnu" ; then
2137 CFLAGS="-O2 $_debug $_profile $_march $_mcpu $_pipe"
2138 else
2139 CFLAGS="-O2 $_debug $_profile $_march $_mcpu $_pipe -ffast-math -fomit-frame-pointer"
2140 WARNFLAGS="-Wall -Wno-switch -Wno-parentheses -Wpointer-arith -Wredundant-decls"
2141 ERRORFLAGS="-Werror-implicit-function-declaration"
2142 extra_ldflags="$extra_ldflags -ffast-math"
2144 else
2145 warn_cflags=yes
2148 if darwin && test "$cc_vendor" = "gnu" ; then
2149 extra_cflags="-falign-loops=16 -shared-libgcc $extra_cflags"
2152 if test "$cc_vendor" = "gnu" ; then
2153 cflag_check -Wundef && WARNFLAGS="-Wundef $WARNFLAGS"
2154 # -std=gnu99 is not a warning flag but is placed in WARN_CFLAGS because
2155 # that's the only variable specific to C now, and this option is not valid
2156 # for C++.
2157 cflag_check -std=gnu99 && WARN_CFLAGS="-std=gnu99 $WARN_CFLAGS"
2158 cflag_check -Wno-pointer-sign && WARN_CFLAGS="-Wno-pointer-sign $WARN_CFLAGS"
2159 cflag_check -Wdisabled-optimization && WARN_CFLAGS="-Wdisabled-optimization $WARN_CFLAGS"
2160 cflag_check -Wmissing-prototypes && WARN_CFLAGS="-Wmissing-prototypes $WARN_CFLAGS"
2161 cflag_check -Wstrict-prototypes && WARN_CFLAGS="-Wstrict-prototypes $WARN_CFLAGS"
2162 else
2163 CFLAGS="-D_ISOC99_SOURCE -D_BSD_SOURCE $CFLAGS"
2166 cflag_check -mno-omit-leaf-frame-pointer && cflags_no_omit_leaf_frame_pointer="-mno-omit-leaf-frame-pointer"
2167 cflag_check -MD -MP && DEPFLAGS="-MD -MP"
2170 if test -n "$LDFLAGS" ; then
2171 extra_ldflags="$extra_ldflags $LDFLAGS"
2172 warn_cflags=yes
2173 elif test "$cc_vendor" = "intel" ; then
2174 extra_ldflags="$extra_ldflags -i-static"
2176 if test -n "$CPPFLAGS" ; then
2177 extra_cflags="$extra_cflags $CPPFLAGS"
2178 warn_cflags=yes
2183 if x86_32 ; then
2184 # Checking assembler (_as) compatibility...
2185 # Added workaround for older as that reads from stdin by default - atmos
2186 as_version=$(echo '' | $_as -version 2>&1 | sed -n 's/^.*assembler \(version \)*\([0-9.]*\).*$/\2/p')
2187 echocheck "assembler ($_as $as_version)"
2189 _pref_as_version='2.9.1'
2190 echo 'nop' > $TMPS
2191 if test "$_mmx" = yes ; then
2192 echo 'emms' >> $TMPS
2194 if test "$_3dnow" = yes ; then
2195 _pref_as_version='2.10.1'
2196 echo 'femms' >> $TMPS
2198 if test "$_3dnowext" = yes ; then
2199 _pref_as_version='2.10.1'
2200 echo 'pswapd %mm0, %mm0' >> $TMPS
2202 if test "$_mmxext" = yes ; then
2203 _pref_as_version='2.10.1'
2204 echo 'movntq %mm0, (%eax)' >> $TMPS
2206 if test "$_sse" = yes ; then
2207 _pref_as_version='2.10.1'
2208 echo 'xorps %xmm0, %xmm0' >> $TMPS
2210 #if test "$_sse2" = yes ; then
2211 # _pref_as_version='2.11'
2212 # echo 'xorpd %xmm0, %xmm0' >> $TMPS
2214 if test "$_cmov" = yes ; then
2215 _pref_as_version='2.10.1'
2216 echo 'cmovb %eax, %ebx' >> $TMPS
2218 if test "$_ssse3" = yes ; then
2219 _pref_as_version='2.16.92'
2220 echo 'pabsd %xmm0, %xmm1' >> $TMPS
2222 $_as $TMPS -o $TMPEXE > /dev/null 2>&1 || as_verc_fail=yes
2224 if test "$as_verc_fail" != yes ; then
2225 echores "ok"
2226 else
2227 res_comment="Upgrade binutils to ${_pref_as_version} or use --disable-ssse3 etc."
2228 echores "failed"
2229 die "obsolete binutils version"
2232 fi #if x86_32
2235 echocheck "PIC"
2236 pic=no
2237 cat > $TMPC << EOF
2238 int main(void) {
2239 #if !(defined(__PIC__) || defined(__pic__) || defined(PIC))
2240 #error PIC not enabled
2241 #endif
2242 return 0;
2245 cc_check && pic=yes && extra_cflags="$extra_cflags -DPIC"
2246 echores $pic
2249 if x86 ; then
2251 echocheck ".align is a power of two"
2252 if test "$_asmalign_pot" = auto ; then
2253 _asmalign_pot=no
2254 inline_asm_check '".align 3"' && _asmalign_pot=yes
2256 if test "$_asmalign_pot" = "yes" ; then
2257 def_asmalign_pot='#define ASMALIGN(ZEROBITS) ".align " #ZEROBITS "\n\t"'
2258 else
2259 def_asmalign_pot='#define ASMALIGN(ZEROBITS) ".align 1<<" #ZEROBITS "\n\t"'
2261 echores $_asmalign_pot
2264 echocheck "ebx availability"
2265 ebx_available=no
2266 def_ebx_available='#define HAVE_EBX_AVAILABLE 0'
2267 cat > $TMPC << EOF
2268 int main(void) {
2269 int x;
2270 __asm__ volatile(
2271 "xor %0, %0"
2272 :"=b"(x)
2273 // just adding ebx to clobber list seems unreliable with some
2274 // compilers, e.g. Haiku's gcc 2.95
2276 // and the above check does not work for OSX 64 bit...
2277 __asm__ volatile("":::"%ebx");
2278 return 0;
2281 cc_check && ebx_available=yes && def_ebx_available='#define HAVE_EBX_AVAILABLE 1'
2282 echores $ebx_available
2285 echocheck "yasm"
2286 if test -z "$YASMFLAGS" ; then
2287 if darwin ; then
2288 x86_64 && objformat="macho64" || objformat="macho"
2289 elif win32 ; then
2290 objformat="win32"
2291 else
2292 objformat="elf"
2294 # currently tested for Linux x86, x86_64
2295 YASMFLAGS="-f $objformat"
2296 x86_64 && YASMFLAGS="$YASMFLAGS -DARCH_X86_64 -m amd64"
2297 test "$pic" = "yes" && YASMFLAGS="$YASMFLAGS -DPIC"
2298 case "$objformat" in
2299 elf) test $_debug && YASMFLAGS="$YASMFLAGS -g dwarf2" ;;
2300 *) YASMFLAGS="$YASMFLAGS -DPREFIX" ;;
2301 esac
2302 else
2303 warn_cflags=yes
2306 echo "pabsw xmm0, xmm0" > $TMPS
2307 yasm_check || _yasm=""
2308 if test $_yasm ; then
2309 def_yasm='#define HAVE_YASM 1'
2310 have_yasm="yes"
2311 echores "$_yasm"
2312 else
2313 def_yasm='#define HAVE_YASM 0'
2314 have_yasm="no"
2315 echores "no"
2318 echocheck "bswap"
2319 def_bswap='#define HAVE_BSWAP 0'
2320 echo 'bswap %eax' > $TMPS
2321 $_as $TMPS -o $TMPEXE > /dev/null 2>&1 && def_bswap='#define HAVE_BSWAP 1' && bswap=yes || bswap=no
2322 echores "$bswap"
2323 fi #if x86
2326 #FIXME: This should happen before the check for CFLAGS..
2327 def_altivec_h='#define HAVE_ALTIVEC_H 0'
2328 if ppc && ( test "$_altivec" = yes || test "$_runtime_cpudetection" = yes ) ; then
2330 # check if AltiVec is supported by the compiler, and how to enable it
2331 echocheck "GCC AltiVec flags"
2332 if $(cflag_check -maltivec -mabi=altivec) ; then
2333 _altivec_gcc_flags="-maltivec -mabi=altivec"
2334 # check if <altivec.h> should be included
2335 if $(header_check altivec.h $_altivec_gcc_flags) ; then
2336 def_altivec_h='#define HAVE_ALTIVEC_H 1'
2337 inc_altivec_h='#include <altivec.h>'
2338 else
2339 if $(cflag_check -faltivec) ; then
2340 _altivec_gcc_flags="-faltivec"
2341 else
2342 _altivec=no
2343 _altivec_gcc_flags="none, AltiVec disabled"
2347 echores "$_altivec_gcc_flags"
2349 # check if the compiler supports braces for vector declarations
2350 cat > $TMPC << EOF
2351 $inc_altivec_h
2352 int main(void) { (vector int) {1}; return 0; }
2354 cc_check $_altivec_gcc_flags || die "You need a compiler that supports {} in AltiVec vector declarations."
2356 # Disable runtime cpudetection if we cannot generate AltiVec code or
2357 # AltiVec is disabled by the user.
2358 test "$_runtime_cpudetection" = yes && test "$_altivec" = no \
2359 && _runtime_cpudetection=no
2361 # Show that we are optimizing for AltiVec (if enabled and supported).
2362 test "$_runtime_cpudetection" = no && test "$_altivec" = yes \
2363 && _optimizing="$_optimizing altivec"
2365 # If AltiVec is enabled, make sure the correct flags turn up in CFLAGS.
2366 test "$_altivec" = yes && CFLAGS="$CFLAGS $_altivec_gcc_flags"
2369 if ppc ; then
2370 def_xform_asm='#define HAVE_XFORM_ASM 0'
2371 xform_asm=no
2372 echocheck "XFORM ASM support"
2373 inline_asm_check '"lwzx %1, %y0" :: "Z"(*(int*)0), "r"(0)' &&
2374 xform_asm=yes && def_xform_asm='#define HAVE_XFORM_ASM 1'
2375 echores "$xform_asm"
2378 if arm ; then
2379 echocheck "ARMv5TE (Enhanced DSP Extensions)"
2380 if test $_armv5te = "auto" ; then
2381 _armv5te=no
2382 inline_asm_check '"qadd r0, r0, r0"' && _armv5te=yes
2384 echores "$_armv5te"
2386 test $_armv5te = "yes" && test $_fast_clz = "auto" && _fast_clz=yes
2388 echocheck "ARMv6 (SIMD instructions)"
2389 if test $_armv6 = "auto" ; then
2390 _armv6=no
2391 inline_asm_check '"sadd16 r0, r0, r0"' && _armv6=yes
2393 echores "$_armv6"
2395 echocheck "ARMv6t2 (SIMD instructions)"
2396 if test $_armv6t2 = "auto" ; then
2397 _armv6t2=no
2398 inline_asm_check '"movt r0, #0"' && _armv6t2=yes
2400 echores "$_armv6t2"
2402 echocheck "ARM VFP"
2403 if test $_armvfp = "auto" ; then
2404 _armvfp=no
2405 inline_asm_check '"fadds s0, s0, s0"' && _armvfp=yes
2407 echores "$_armvfp"
2409 echocheck "ARM NEON"
2410 if test $neon = "auto" ; then
2411 neon=no
2412 inline_asm_check '"vadd.i16 q0, q0, q0"' && neon=yes
2414 echores "$neon"
2416 echocheck "iWMMXt (Intel XScale SIMD instructions)"
2417 if test $_iwmmxt = "auto" ; then
2418 _iwmmxt=no
2419 inline_asm_check '"wunpckelub wr6, wr4"' && _iwmmxt=yes
2421 echores "$_iwmmxt"
2424 cpuexts_all='ALTIVEC MMX MMX2 AMD3DNOW AMD3DNOWEXT SSE SSE2 SSSE3 FAST_CMOV CMOV FAST_CLZ ARMV5TE ARMV6 ARMV6T2 ARMVFP NEON IWMMXT MMI VIS MVI'
2425 test "$_altivec" = yes && cpuexts="ALTIVEC $cpuexts"
2426 test "$_mmx" = yes && cpuexts="MMX $cpuexts"
2427 test "$_mmxext" = yes && cpuexts="MMX2 $cpuexts"
2428 test "$_3dnow" = yes && cpuexts="AMD3DNOW $cpuexts"
2429 test "$_3dnowext" = yes && cpuexts="AMD3DNOWEXT $cpuexts"
2430 test "$_sse" = yes && cpuexts="SSE $cpuexts"
2431 test "$_sse2" = yes && cpuexts="SSE2 $cpuexts"
2432 test "$_ssse3" = yes && cpuexts="SSSE3 $cpuexts"
2433 test "$_cmov" = yes && cpuexts="CMOV $cpuexts"
2434 test "$_fast_cmov" = yes && cpuexts="FAST_CMOV $cpuexts"
2435 test "$_fast_clz" = yes && cpuexts="FAST_CLZ $cpuexts"
2436 test "$_armv5te" = yes && cpuexts="ARMV5TE $cpuexts"
2437 test "$_armv6" = yes && cpuexts="ARMV6 $cpuexts"
2438 test "$_armv6t2" = yes && cpuexts="ARMV6T2 $cpuexts"
2439 test "$_armvfp" = yes && cpuexts="ARMVFP $cpuexts"
2440 test "$neon" = yes && cpuexts="NEON $cpuexts"
2441 test "$_iwmmxt" = yes && cpuexts="IWMMXT $cpuexts"
2442 test "$_vis" = yes && cpuexts="VIS $cpuexts"
2443 test "$_mvi" = yes && cpuexts="MVI $cpuexts"
2445 # Checking kernel version...
2446 if x86_32 && linux ; then
2447 _k_verc_problem=no
2448 kernel_version=$(uname -r 2>&1)
2449 echocheck "$system_name kernel version"
2450 case "$kernel_version" in
2451 '') kernel_version="?.??"; _k_verc_fail=yes;;
2452 [0-1].[0-9].[0-9]*|2.[0-3].[0-9]*)
2453 _k_verc_problem=yes;;
2454 esac
2455 if test "$_k_verc_problem" = yes && test "$_sse" = yes ; then
2456 _k_verc_fail=yes
2458 if test "$_k_verc_fail" ; then
2459 echores "$kernel_version, fail"
2460 echo "WARNING! If you want to run MPlayer on this system, get prepared for problems!"
2461 echo "2.2.x has limited SSE support. Upgrade the kernel or use --disable-sse if you"
2462 echo "experience crashes. MPlayer tries to autodetect if your kernel correctly"
2463 echo "supports SSE, but you have been warned! If you are using a kernel older than"
2464 echo "2.2.x you must upgrade it to get SSE support!"
2465 # die "Your kernel is too old for this CPU." # works fine on some 2.2.x so don't die (later check will test)
2466 else
2467 echores "$kernel_version, ok"
2471 ######################
2472 # MAIN TESTS GO HERE #
2473 ######################
2476 echocheck "-lposix"
2477 if cflag_check -lposix ; then
2478 extra_ldflags="$extra_ldflags -lposix"
2479 echores "yes"
2480 else
2481 echores "no"
2484 echocheck "-lm"
2485 if cflag_check -lm ; then
2486 _ld_lm="-lm"
2487 echores "yes"
2488 else
2489 _ld_lm=""
2490 echores "no"
2494 echocheck "langinfo"
2495 if test "$_langinfo" = auto ; then
2496 _langinfo=no
2497 statement_check langinfo.h 'nl_langinfo(CODESET)' && _langinfo=yes
2499 if test "$_langinfo" = yes ; then
2500 def_langinfo='#define HAVE_LANGINFO 1'
2501 else
2502 def_langinfo='#undef HAVE_LANGINFO'
2504 echores "$_langinfo"
2507 echocheck "translation support"
2508 if test "$_translation" = yes; then
2509 def_translation="#define CONFIG_TRANSLATION 1"
2510 else
2511 def_translation="#undef CONFIG_TRANSLATION"
2513 echores "$_translation"
2515 echocheck "language"
2516 # Set preferred languages, "all" uses English as main language.
2517 test -z "$language" && language=$LINGUAS
2518 test -z "$language_doc" && language_doc=$language
2519 test -z "$language_man" && language_man=$language
2520 test -z "$language_msg" && language_msg=$language
2521 test -z "$language_msg" && language_msg="all"
2522 language_doc=$(echo $language_doc | tr , " ")
2523 language_man=$(echo $language_man | tr , " ")
2524 language_msg=$(echo $language_msg | tr , " ")
2526 test "$language_doc" = "all" && language_doc=$doc_lang_all
2527 test "$language_man" = "all" && language_man=$man_lang_all
2528 test "$language_msg" = "all" && language_msg=$msg_lang_all
2530 if test "$_translation" != yes ; then
2531 language_msg=""
2534 # Prune non-existing translations from language lists.
2535 # Set message translation to the first available language.
2536 # Fall back on English.
2537 for lang in $language_doc ; do
2538 test -d DOCS/xml/$lang && tmp_language_doc="$tmp_language_doc $lang"
2539 done
2540 language_doc=$tmp_language_doc
2541 test -z "$language_doc" && language_doc=en
2543 for lang in $language_man ; do
2544 test -d DOCS/man/$lang && tmp_language_man="$tmp_language_man $lang"
2545 done
2546 language_man=$tmp_language_man
2547 test -z "$language_man" && language_man=en
2549 for lang in $language_msg ; do
2550 test -f po/$lang.po && tmp_language_msg="$tmp_language_msg $lang"
2551 done
2552 language_msg=$tmp_language_msg
2554 echores "messages (en+): $language_msg - man pages: $language_man - documentation: $language_doc"
2557 echocheck "enable sighandler"
2558 if test "$_sighandler" = yes ; then
2559 def_sighandler='#define CONFIG_SIGHANDLER 1'
2560 else
2561 def_sighandler='#undef CONFIG_SIGHANDLER'
2563 echores "$_sighandler"
2565 echocheck "runtime cpudetection"
2566 if test "$_runtime_cpudetection" = yes ; then
2567 _optimizing="Runtime CPU-Detection enabled"
2568 def_runtime_cpudetection='#define CONFIG_RUNTIME_CPUDETECT 1'
2569 else
2570 def_runtime_cpudetection='#define CONFIG_RUNTIME_CPUDETECT 0'
2572 echores "$_runtime_cpudetection"
2575 echocheck "restrict keyword"
2576 for restrict_keyword in restrict __restrict __restrict__ ; do
2577 echo "void foo(char * $restrict_keyword p); int main(void) { return 0; }" > $TMPC
2578 if cc_check; then
2579 def_restrict_keyword=$restrict_keyword
2580 break;
2582 done
2583 if [ -n "$def_restrict_keyword" ]; then
2584 echores "$def_restrict_keyword"
2585 else
2586 echores "none"
2588 # Avoid infinite recursion loop ("#define restrict restrict")
2589 if [ "$def_restrict_keyword" != "restrict" ]; then
2590 def_restrict_keyword="#define restrict $def_restrict_keyword"
2591 else
2592 def_restrict_keyword=""
2596 echocheck "__builtin_expect"
2597 # GCC branch prediction hint
2598 cat > $TMPC << EOF
2599 static int foo(int a) {
2600 a = __builtin_expect(a, 10);
2601 return a == 10 ? 0 : 1;
2603 int main(void) { return foo(10) && foo(0); }
2605 _builtin_expect=no
2606 cc_check && _builtin_expect=yes
2607 if test "$_builtin_expect" = yes ; then
2608 def_builtin_expect='#define HAVE_BUILTIN_EXPECT 1'
2609 else
2610 def_builtin_expect='#undef HAVE_BUILTIN_EXPECT'
2612 echores "$_builtin_expect"
2615 echocheck "kstat"
2616 _kstat=no
2617 statement_check kstat.h 'kstat_open()' -lkstat && _kstat=yes
2618 if test "$_kstat" = yes ; then
2619 def_kstat="#define HAVE_LIBKSTAT 1"
2620 extra_ldflags="$extra_ldflags -lkstat"
2621 else
2622 def_kstat="#undef HAVE_LIBKSTAT"
2624 echores "$_kstat"
2627 echocheck "posix4"
2628 # required for nanosleep on some systems
2629 _posix4=no
2630 statement_check time.h 'nanosleep(0, 0)' -lposix4 && _posix4=yes
2631 if test "$_posix4" = yes ; then
2632 extra_ldflags="$extra_ldflags -lposix4"
2634 echores "$_posix4"
2636 for func in exp2 exp2f llrint log2 log2f lrint lrintf round roundf truncf; do
2637 echocheck $func
2638 eval _$func=no
2639 statement_check math.h "${func}(2.0)" -D_ISOC99_SOURCE $_ld_lm && eval _$func=yes
2640 if eval test "x\$_$func" = "xyes"; then
2641 eval def_$func="\"#define HAVE_$(echo $func | tr '[a-z]' '[A-Z]') 1\""
2642 echores yes
2643 else
2644 eval def_$func="\"#define HAVE_$(echo $func | tr '[a-z]' '[A-Z]') 0\""
2645 echores no
2647 done
2650 echocheck "mkstemp"
2651 _mkstemp=no
2652 define_statement_check "_XOPEN_SOURCE 600" "stdlib.h" 'mkstemp("")' && _mkstemp=yes
2653 if test "$_mkstemp" = yes ; then
2654 def_mkstemp='#define HAVE_MKSTEMP 1'
2655 else
2656 def_mkstemp='#define HAVE_MKSTEMP 0'
2658 echores "$_mkstemp"
2661 echocheck "nanosleep"
2662 _nanosleep=no
2663 statement_check time.h 'nanosleep(0, 0)' && _nanosleep=yes
2664 if test "$_nanosleep" = yes ; then
2665 def_nanosleep='#define HAVE_NANOSLEEP 1'
2666 else
2667 def_nanosleep='#undef HAVE_NANOSLEEP'
2669 echores "$_nanosleep"
2672 echocheck "socklib"
2673 # for Solaris (socket stuff is in -lsocket, gethostbyname and friends in -lnsl):
2674 # for BeOS (socket stuff is in -lsocket, gethostbyname and friends in -lbind):
2675 cat > $TMPC << EOF
2676 #include <netdb.h>
2677 #include <sys/socket.h>
2678 int main(void) { gethostbyname(0); socket(AF_INET, SOCK_STREAM, 0); return 0; }
2680 _socklib=no
2681 for _ld_tmp in "" "-lsocket -lbind" "-lsocket -ldnet" "-lsocket -lnsl" "-lnsl" "-lsocket" ; do
2682 cc_check $_ld_tmp && _ld_sock="$_ld_tmp" && _socklib=yes && break
2683 done
2684 test $_socklib = yes && test $_winsock2_h = auto && _winsock2_h=no
2685 if test $_winsock2_h = auto ; then
2686 _winsock2_h=no
2687 statement_check winsock2.h 'gethostbyname(0)' -lws2_32 && _ld_sock="-lws2_32" && _winsock2_h=yes
2689 test "$_ld_sock" && res_comment="using $_ld_sock"
2690 echores "$_socklib"
2693 if test $_winsock2_h = yes ; then
2694 _ld_sock="-lws2_32"
2695 def_winsock2_h='#define HAVE_WINSOCK2_H 1'
2696 else
2697 def_winsock2_h='#define HAVE_WINSOCK2_H 0'
2701 echocheck "arpa/inet.h"
2702 arpa_inet_h=no
2703 def_arpa_inet_h='#define HAVE_ARPA_INET_H 0'
2704 header_check arpa/inet.h && arpa_inet_h=yes &&
2705 def_arpa_inet_h='#define HAVE_ARPA_INET_H 1'
2706 echores "$arpa_inet_h"
2709 echocheck "inet_pton()"
2710 def_inet_pton='#define HAVE_INET_PTON 0'
2711 inet_pton=no
2712 for _ld_tmp in "$_ld_sock" "$_ld_sock -lresolv" ; do
2713 statement_check arpa/inet.h 'inet_pton(0, 0, 0)' $_ld_tmp && inet_pton=yes && break
2714 done
2715 if test $inet_pton = yes ; then
2716 test "$_ld_tmp" && res_comment="using $_ld_tmp"
2717 def_inet_pton='#define HAVE_INET_PTON 1'
2719 echores "$inet_pton"
2722 echocheck "inet_aton()"
2723 def_inet_aton='#define HAVE_INET_ATON 0'
2724 inet_aton=no
2725 for _ld_tmp in "$_ld_sock" "$_ld_sock -lresolv" ; do
2726 statement_check arpa/inet.h 'inet_aton(0, 0)' $_ld_tmp && inet_aton=yes && break
2727 done
2728 if test $inet_aton = yes ; then
2729 test "$_ld_tmp" && res_comment="using $_ld_tmp"
2730 def_inet_aton='#define HAVE_INET_ATON 1'
2732 echores "$inet_aton"
2735 echocheck "socklen_t"
2736 _socklen_t=no
2737 for header in "sys/socket.h" "ws2tcpip.h" "sys/types.h" ; do
2738 statement_check $header 'socklen_t v = 0' && _socklen_t=yes && break
2739 done
2740 if test "$_socklen_t" = yes ; then
2741 def_socklen_t='#define HAVE_SOCKLEN_T 1'
2742 else
2743 def_socklen_t='#define HAVE_SOCKLEN_T 0'
2745 echores "$_socklen_t"
2748 echocheck "closesocket()"
2749 _closesocket=no
2750 statement_check winsock2.h 'closesocket(~0)' $_ld_sock && _closesocket=yes
2751 if test "$_closesocket" = yes ; then
2752 def_closesocket='#define HAVE_CLOSESOCKET 1'
2753 else
2754 def_closesocket='#define HAVE_CLOSESOCKET 0'
2756 echores "$_closesocket"
2759 echocheck "networking"
2760 test $_winsock2_h = no && test $inet_pton = no &&
2761 test $inet_aton = no && networking=no
2762 if test "$networking" = yes ; then
2763 def_network='#define CONFIG_NETWORK 1'
2764 def_networking='#define CONFIG_NETWORKING 1'
2765 extra_ldflags="$extra_ldflags $_ld_sock"
2766 inputmodules="networking $inputmodules"
2767 else
2768 noinputmodules="networking $noinputmodules"
2769 def_network='#define CONFIG_NETWORK 0'
2770 def_networking='#undef CONFIG_NETWORKING'
2772 echores "$networking"
2775 echocheck "inet6"
2776 if test "$_inet6" = auto ; then
2777 cat > $TMPC << EOF
2778 #include <sys/types.h>
2779 #if !defined(_WIN32)
2780 #include <sys/socket.h>
2781 #include <netinet/in.h>
2782 #else
2783 #include <ws2tcpip.h>
2784 #endif
2785 int main(void) { struct sockaddr_in6 six; socket(AF_INET6, SOCK_STREAM, AF_INET6); return 0; }
2787 _inet6=no
2788 if cc_check $_ld_sock ; then
2789 _inet6=yes
2792 if test "$_inet6" = yes ; then
2793 def_inet6='#define HAVE_AF_INET6 1'
2794 else
2795 def_inet6='#undef HAVE_AF_INET6'
2797 echores "$_inet6"
2800 echocheck "gethostbyname2"
2801 if test "$_gethostbyname2" = auto ; then
2802 cat > $TMPC << EOF
2803 #include <sys/types.h>
2804 #include <sys/socket.h>
2805 #include <netdb.h>
2806 int main(void) { gethostbyname2("", AF_INET); return 0; }
2808 _gethostbyname2=no
2809 if cc_check ; then
2810 _gethostbyname2=yes
2813 if test "$_gethostbyname2" = yes ; then
2814 def_gethostbyname2='#define HAVE_GETHOSTBYNAME2 1'
2815 else
2816 def_gethostbyname2='#undef HAVE_GETHOSTBYNAME2'
2818 echores "$_gethostbyname2"
2821 echocheck "inttypes.h (required)"
2822 _inttypes=no
2823 header_check inttypes.h && _inttypes=yes
2824 echores "$_inttypes"
2826 if test "$_inttypes" = no ; then
2827 echocheck "sys/bitypes.h (inttypes.h predecessor)"
2828 header_check sys/bitypes.h && _inttypes=yes
2829 if test "$_inttypes" = yes ; then
2830 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."
2831 else
2832 die "Cannot find header either inttypes.h or bitypes.h. There is no chance for compilation to succeed."
2837 echocheck "malloc.h"
2838 _malloc=no
2839 header_check malloc.h && _malloc=yes
2840 if test "$_malloc" = yes ; then
2841 def_malloc_h='#define HAVE_MALLOC_H 1'
2842 else
2843 def_malloc_h='#define HAVE_MALLOC_H 0'
2845 echores "$_malloc"
2848 echocheck "memalign()"
2849 # XXX restrict to x86 ? extend to other CPUs/cacheline sizes ?
2850 def_memalign_hack='#define CONFIG_MEMALIGN_HACK 0'
2851 _memalign=no
2852 statement_check malloc.h 'memalign(64, sizeof(char))' && _memalign=yes
2853 if test "$_memalign" = yes ; then
2854 def_memalign='#define HAVE_MEMALIGN 1'
2855 else
2856 def_memalign='#define HAVE_MEMALIGN 0'
2857 def_map_memalign='#define memalign(a, b) malloc(b)'
2858 darwin || def_memalign_hack='#define CONFIG_MEMALIGN_HACK 1'
2860 echores "$_memalign"
2863 echocheck "posix_memalign()"
2864 posix_memalign=no
2865 def_posix_memalign='#define HAVE_POSIX_MEMALIGN 0'
2866 define_statement_check "_XOPEN_SOURCE 600" "stdlib.h" 'posix_memalign(NULL, 0, 0)' &&
2867 posix_memalign=yes && def_posix_memalign='#define HAVE_POSIX_MEMALIGN 1'
2868 echores "$posix_memalign"
2871 echocheck "alloca.h"
2872 _alloca=no
2873 statement_check alloca.h 'alloca(0)' && _alloca=yes
2874 if cc_check ; then
2875 def_alloca_h='#define HAVE_ALLOCA_H 1'
2876 else
2877 def_alloca_h='#undef HAVE_ALLOCA_H'
2879 echores "$_alloca"
2882 echocheck "fastmemcpy"
2883 if test "$_fastmemcpy" = yes ; then
2884 def_fastmemcpy='#define CONFIG_FASTMEMCPY 1'
2885 else
2886 def_fastmemcpy='#undef CONFIG_FASTMEMCPY'
2888 echores "$_fastmemcpy"
2891 echocheck "mman.h"
2892 _mman=no
2893 statement_check sys/mman.h 'mmap(0, 0, 0, 0, 0, 0)' && _mman=yes
2894 if test "$_mman" = yes ; then
2895 def_mman_h='#define HAVE_SYS_MMAN_H 1'
2896 else
2897 def_mman_h='#undef HAVE_SYS_MMAN_H'
2899 echores "$_mman"
2901 _mman_has_map_failed=no
2902 statement_check sys/mman.h 'void *p = MAP_FAILED' && _mman_has_map_failed=yes
2903 if test "$_mman_has_map_failed" = yes ; then
2904 def_mman_has_map_failed=''
2905 else
2906 def_mman_has_map_failed='#define MAP_FAILED ((void *) -1)'
2909 echocheck "dynamic loader"
2910 _dl=no
2911 for _ld_tmp in "" "-ldl"; do
2912 statement_check dlfcn.h 'dlopen("", 0)' $_ld_tmp && _ld_dl="$_ld_tmp" && _dl=yes && break
2913 done
2914 if test "$_dl" = yes ; then
2915 def_dl='#define HAVE_LIBDL 1'
2916 else
2917 def_dl='#undef HAVE_LIBDL'
2919 echores "$_dl"
2922 def_threads='#define HAVE_THREADS 0'
2924 echocheck "pthread"
2925 if linux ; then
2926 THREAD_CFLAGS=-D_REENTRANT
2927 elif freebsd || netbsd || openbsd || bsdos ; then
2928 THREAD_CFLAGS=-D_THREAD_SAFE
2930 if test "$_pthreads" = auto ; then
2931 cat > $TMPC << EOF
2932 #include <pthread.h>
2933 static void *func(void *arg) { return arg; }
2934 int main(void) {
2935 pthread_t tid;
2936 #ifdef PTW32_STATIC_LIB
2937 pthread_win32_process_attach_np();
2938 pthread_win32_thread_attach_np();
2939 #endif
2940 return pthread_create (&tid, 0, func, 0) != 0;
2943 _pthreads=no
2944 if ! hpux ; then
2945 for _ld_tmp in "-lpthreadGC2" "" "-lpthread" "-pthread" ; do
2946 # for crosscompilation, we cannot execute the program, be happy if we can link statically
2947 cc_check $THREAD_CFLAGS $_ld_tmp && (tmp_run || test "$_ld_static") && _ld_pthread="$_ld_tmp" && _pthreads=yes && break
2948 done
2949 if test "$_pthreads" = no && mingw32 ; then
2950 _ld_tmp="-lpthreadGC2 -lws2_32"
2951 cc_check $_ld_tmp -DPTW32_STATIC_LIB && (tmp_run || test "$_ld_static") && _ld_pthread="$_ld_tmp" && _pthreads=yes && CFLAGS="$CFLAGS -DPTW32_STATIC_LIB"
2955 if test "$_pthreads" = yes ; then
2956 test $_ld_pthread && res_comment="using $_ld_pthread"
2957 def_pthreads='#define HAVE_PTHREADS 1'
2958 def_threads='#define HAVE_THREADS 1'
2959 extra_cflags="$extra_cflags $THREAD_CFLAGS"
2960 else
2961 res_comment="v4l, v4l2, win32 loader disabled"
2962 def_pthreads='#undef HAVE_PTHREADS'
2963 _tv_v4l1=no ; _tv_v4l2=no
2964 mingw32 || _win32dll=no
2966 echores "$_pthreads"
2968 if cygwin ; then
2969 if test "$_pthreads" = yes ; then
2970 def_pthread_cache="#define PTHREAD_CACHE 1"
2971 else
2972 _stream_cache=no
2973 def_stream_cache="#undef CONFIG_STREAM_CACHE"
2977 echocheck "w32threads"
2978 if test "$_pthreads" = yes ; then
2979 res_comment="using pthread instead"
2980 _w32threads=no
2982 if test "$_w32threads" = auto ; then
2983 _w32threads=no
2984 mingw32 && _w32threads=yes
2986 test "$_w32threads" = yes && def_threads='#define HAVE_THREADS 1'
2987 echores "$_w32threads"
2989 echocheck "rpath"
2990 if test "$_rpath" = yes ; then
2991 for I in $(echo $extra_ldflags | sed 's/-L//g') ; do
2992 tmp="$tmp $(echo $I | sed 's/.*/ -L& -Wl,-R&/')"
2993 done
2994 extra_ldflags=$tmp
2996 echores "$_rpath"
2998 echocheck "iconv"
2999 if test "$_iconv" = auto ; then
3000 cat > $TMPC << EOF
3001 #include <stdio.h>
3002 #include <unistd.h>
3003 #include <iconv.h>
3004 #define INBUFSIZE 1024
3005 #define OUTBUFSIZE 4096
3007 char inbuffer[INBUFSIZE];
3008 char outbuffer[OUTBUFSIZE];
3010 int main(void) {
3011 size_t numread;
3012 iconv_t icdsc;
3013 char *tocode="UTF-8";
3014 char *fromcode="cp1250";
3015 if ((icdsc = iconv_open(tocode, fromcode)) != (iconv_t)(-1)) {
3016 while ((numread = read(0, inbuffer, INBUFSIZE))) {
3017 char *iptr=inbuffer;
3018 char *optr=outbuffer;
3019 size_t inleft=numread;
3020 size_t outleft=OUTBUFSIZE;
3021 if (iconv(icdsc, &iptr, &inleft, &optr, &outleft)
3022 != (size_t)(-1)) {
3023 write(1, outbuffer, OUTBUFSIZE - outleft);
3026 if (iconv_close(icdsc) == -1)
3029 return 0;
3032 _iconv=no
3033 for _ld_tmp in "" "-liconv" "-liconv $_ld_dl" ; do
3034 cc_check $_ld_lm $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" &&
3035 _iconv=yes && break
3036 done
3037 if test "$_iconv" != yes ; then
3038 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."
3041 if test "$_iconv" = yes ; then
3042 def_iconv='#define CONFIG_ICONV 1'
3043 else
3044 def_iconv='#undef CONFIG_ICONV'
3046 echores "$_iconv"
3049 echocheck "soundcard.h"
3050 _soundcard_h=no
3051 def_soundcard_h='#undef HAVE_SOUNDCARD_H'
3052 def_sys_soundcard_h='#undef HAVE_SYS_SOUNDCARD_H'
3053 for _soundcard_header in "sys/soundcard.h" "soundcard.h"; do
3054 header_check $_soundcard_header && _soundcard_h=yes &&
3055 res_comment="$_soundcard_header" && break
3056 done
3058 if test "$_soundcard_h" = yes ; then
3059 if test $_soundcard_header = "sys/soundcard.h"; then
3060 def_sys_soundcard_h='#define HAVE_SYS_SOUNDCARD_H 1'
3061 else
3062 def_soundcard_h='#define HAVE_SOUNDCARD_H 1'
3065 echores "$_soundcard_h"
3068 echocheck "sys/videoio.h"
3069 sys_videoio_h=no
3070 def_sys_videoio_h='#undef HAVE_SYS_VIDEOIO_H'
3071 header_check sys/videoio.h && sys_videoio_h=yes &&
3072 def_sys_videoio_h='#define HAVE_SYS_VIDEOIO_H 1'
3073 echores "$sys_videoio_h"
3076 echocheck "sys/dvdio.h"
3077 _dvdio=no
3078 # FreeBSD 8.1 has broken dvdio.h
3079 header_check_broken sys/types.h sys/dvdio.h && _dvdio=yes
3080 if test "$_dvdio" = yes ; then
3081 def_dvdio='#define DVD_STRUCT_IN_SYS_DVDIO_H 1'
3082 else
3083 def_dvdio='#undef DVD_STRUCT_IN_SYS_DVDIO_H'
3085 echores "$_dvdio"
3088 echocheck "sys/cdio.h"
3089 _cdio=no
3090 # at least OpenSolaris has a broken cdio.h
3091 header_check_broken sys/types.h sys/cdio.h && _cdio=yes
3092 if test "$_cdio" = yes ; then
3093 def_cdio='#define DVD_STRUCT_IN_SYS_CDIO_H 1'
3094 else
3095 def_cdio='#undef DVD_STRUCT_IN_SYS_CDIO_H'
3097 echores "$_cdio"
3100 echocheck "linux/cdrom.h"
3101 _cdrom=no
3102 header_check linux/cdrom.h && _cdrom=yes
3103 if test "$_cdrom" = yes ; then
3104 def_cdrom='#define DVD_STRUCT_IN_LINUX_CDROM_H 1'
3105 else
3106 def_cdrom='#undef DVD_STRUCT_IN_LINUX_CDROM_H'
3108 echores "$_cdrom"
3111 echocheck "dvd.h"
3112 _dvd=no
3113 header_check dvd.h && _dvd=yes
3114 if test "$_dvd" = yes ; then
3115 def_dvd='#define DVD_STRUCT_IN_DVD_H 1'
3116 else
3117 def_dvd='#undef DVD_STRUCT_IN_DVD_H'
3119 echores "$_dvd"
3122 if bsdos; then
3123 echocheck "BSDI dvd.h"
3124 _bsdi_dvd=no
3125 header_check dvd.h && _bsdi_dvd=yes
3126 if test "$_bsdi_dvd" = yes ; then
3127 def_bsdi_dvd='#define DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H 1'
3128 else
3129 def_bsdi_dvd='#undef DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H'
3131 echores "$_bsdi_dvd"
3132 fi #if bsdos
3135 if hpux; then
3136 # also used by AIX, but AIX does not support VCD and/or libdvdread
3137 echocheck "HP-UX SCSI header"
3138 _hpux_scsi_h=no
3139 header_check sys/scsi.h && _hpux_scsi_h=yes
3140 if test "$_hpux_scsi_h" = yes ; then
3141 def_hpux_scsi_h='#define HPUX_SCTL_IO 1'
3142 else
3143 def_hpux_scsi_h='#undef HPUX_SCTL_IO'
3145 echores "$_hpux_scsi_h"
3146 fi #if hpux
3149 echocheck "termcap"
3150 if test "$_termcap" = auto ; then
3151 _termcap=no
3152 for _ld_tmp in "-lncurses" "-ltinfo" "-ltermcap"; do
3153 statement_check term.h 'tgetent(0, 0)' $_ld_tmp &&
3154 extra_ldflags="$extra_ldflags $_ld_tmp" && _termcap=yes && break
3155 done
3157 if test "$_termcap" = yes ; then
3158 def_termcap='#define HAVE_TERMCAP 1'
3159 test $_ld_tmp && res_comment="using $_ld_tmp"
3160 else
3161 def_termcap='#undef HAVE_TERMCAP'
3163 echores "$_termcap"
3166 echocheck "termios"
3167 def_termios='#undef HAVE_TERMIOS'
3168 def_termios_h='#undef HAVE_TERMIOS_H'
3169 def_termios_sys_h='#undef HAVE_SYS_TERMIOS_H'
3170 if test "$_termios" = auto ; then
3171 _termios=no
3172 for _termios_header in "termios.h" "sys/termios.h"; do
3173 header_check $_termios_header && _termios=yes &&
3174 res_comment="using $_termios_header" && break
3175 done
3178 if test "$_termios" = yes ; then
3179 def_termios='#define HAVE_TERMIOS 1'
3180 if test "$_termios_header" = "termios.h" ; then
3181 def_termios_h='#define HAVE_TERMIOS_H 1'
3182 else
3183 def_termios_sys_h='#define HAVE_SYS_TERMIOS_H 1'
3186 echores "$_termios"
3189 echocheck "shm"
3190 if test "$_shm" = auto ; then
3191 _shm=no
3192 statement_check sys/shm.h 'shmget(0, 0, 0); shmat(0, 0, 0); shmctl(0, 0, 0)' && _shm=yes
3194 if test "$_shm" = yes ; then
3195 def_shm='#define HAVE_SHM 1'
3196 else
3197 def_shm='#undef HAVE_SHM'
3199 echores "$_shm"
3202 echocheck "strsep()"
3203 _strsep=no
3204 statement_check string.h 'char *s = "Hello, world!"; strsep(&s, ",")' && _strsep=yes
3205 if test "$_strsep" = yes ; then
3206 def_strsep='#define HAVE_STRSEP 1'
3207 need_strsep=no
3208 else
3209 def_strsep='#undef HAVE_STRSEP'
3210 need_strsep=yes
3212 echores "$_strsep"
3215 echocheck "vsscanf()"
3216 cat > $TMPC << EOF
3217 #define _ISOC99_SOURCE
3218 #include <stdarg.h>
3219 #include <stdio.h>
3220 int main(void) { va_list ap; vsscanf("foo", "bar", ap); return 0; }
3222 _vsscanf=no
3223 cc_check && _vsscanf=yes
3224 if test "$_vsscanf" = yes ; then
3225 def_vsscanf='#define HAVE_VSSCANF 1'
3226 need_vsscanf=no
3227 else
3228 def_vsscanf='#undef HAVE_VSSCANF'
3229 need_vsscanf=yes
3231 echores "$_vsscanf"
3234 echocheck "swab()"
3235 _swab=no
3236 define_statement_check "_XOPEN_SOURCE 600" "unistd.h" 'int a, b; swab(&a, &b, 0)' ||
3237 statement_check "string.h" 'int a, b; swab(&a, &b, 0)' && _swab=yes
3238 if test "$_swab" = yes ; then
3239 def_swab='#define HAVE_SWAB 1'
3240 need_swab=no
3241 else
3242 def_swab='#undef HAVE_SWAB'
3243 need_swab=yes
3245 echores "$_swab"
3247 echocheck "POSIX select()"
3248 cat > $TMPC << EOF
3249 #include <stdio.h>
3250 #include <stdlib.h>
3251 #include <sys/types.h>
3252 #include <string.h>
3253 #include <sys/time.h>
3254 #include <unistd.h>
3255 int main(void) {int nfds = 1; fd_set readfds; struct timeval timeout; select(nfds, &readfds, NULL, NULL, &timeout); return 0; }
3257 _posix_select=no
3258 def_posix_select='#undef HAVE_POSIX_SELECT'
3259 cc_check && _posix_select=yes &&
3260 def_posix_select='#define HAVE_POSIX_SELECT 1'
3261 echores "$_posix_select"
3264 echocheck "audio select()"
3265 if test "$_select" = no ; then
3266 def_select='#undef HAVE_AUDIO_SELECT'
3267 elif test "$_select" = yes ; then
3268 def_select='#define HAVE_AUDIO_SELECT 1'
3270 echores "$_select"
3273 echocheck "gettimeofday()"
3274 _gettimeofday=no
3275 statement_check sys/time.h 'struct timeval tv; struct timezone tz; gettimeofday(&tv, &tz)' && _gettimeofday=yes
3276 if test "$_gettimeofday" = yes ; then
3277 def_gettimeofday='#define HAVE_GETTIMEOFDAY 1'
3278 need_gettimeofday=no
3279 else
3280 def_gettimeofday='#undef HAVE_GETTIMEOFDAY'
3281 need_gettimeofday=yes
3283 echores "$_gettimeofday"
3286 echocheck "glob()"
3287 _glob=no
3288 statement_check glob.h 'glob("filename", 0, 0, 0)' && _glob=yes
3289 need_glob=no
3290 if test "$_glob" = yes ; then
3291 def_glob='#define HAVE_GLOB 1'
3292 else
3293 def_glob='#undef HAVE_GLOB'
3294 # HACK! need_glob currently enables compilation of a
3295 # win32-specific glob()-replacement.
3296 # Other OS neither need it nor can they use it (mf:// is disabled for them).
3297 win32 && need_glob=yes
3299 echores "$_glob"
3302 echocheck "setenv()"
3303 _setenv=no
3304 statement_check stdlib.h 'setenv("", "", 0)' && _setenv=yes
3305 if test "$_setenv" = yes ; then
3306 def_setenv='#define HAVE_SETENV 1'
3307 need_setenv=no
3308 else
3309 def_setenv='#undef HAVE_SETENV'
3310 need_setenv=yes
3312 echores "$_setenv"
3315 echocheck "setmode()"
3316 _setmode=no
3317 def_setmode='#define HAVE_SETMODE 0'
3318 statement_check io.h 'setmode(0, 0)' && _setmode=yes && def_setmode='#define HAVE_SETMODE 1'
3319 echores "$_setmode"
3322 echocheck "sys/sysinfo.h"
3323 _sys_sysinfo=no
3324 statement_check sys/sysinfo.h 'struct sysinfo s_info; s_info.mem_unit=0; sysinfo(&s_info)' && _sys_sysinfo=yes
3325 if test "$_sys_sysinfo" = yes ; then
3326 def_sys_sysinfo_h='#define HAVE_SYS_SYSINFO_H 1'
3327 else
3328 def_sys_sysinfo_h='#undef HAVE_SYS_SYSINFO_H'
3330 echores "$_sys_sysinfo"
3333 if darwin; then
3335 echocheck "Mac OS X Finder Support"
3336 def_macosx_finder='#undef CONFIG_MACOSX_FINDER'
3337 if test "$_macosx_finder" = yes ; then
3338 def_macosx_finder='#define CONFIG_MACOSX_FINDER 1'
3339 extra_ldflags="$extra_ldflags -framework Cocoa"
3341 echores "$_macosx_finder"
3343 echocheck "Mac OS X Bundle file locations"
3344 def_macosx_bundle='#undef CONFIG_MACOSX_BUNDLE'
3345 test "$_macosx_bundle" = auto && _macosx_bundle=$_macosx_finder
3346 if test "$_macosx_bundle" = yes ; then
3347 def_macosx_bundle='#define CONFIG_MACOSX_BUNDLE 1'
3349 echores "$_macosx_bundle"
3351 echocheck "Apple Remote"
3352 if test "$_apple_remote" = auto ; then
3353 _apple_remote=no
3354 cat > $TMPC <<EOF
3355 #include <stdio.h>
3356 #include <IOKit/IOCFPlugIn.h>
3357 int main(void) {
3358 io_iterator_t hidObjectIterator = (io_iterator_t)NULL;
3359 CFMutableDictionaryRef hidMatchDictionary;
3360 IOReturn ioReturnValue;
3362 // Set up a matching dictionary to search the I/O Registry by class.
3363 // name for all HID class devices
3364 hidMatchDictionary = IOServiceMatching("AppleIRController");
3366 // Now search I/O Registry for matching devices.
3367 ioReturnValue = IOServiceGetMatchingServices(kIOMasterPortDefault,
3368 hidMatchDictionary, &hidObjectIterator);
3370 // If search is unsuccessful, return nonzero.
3371 if (ioReturnValue != kIOReturnSuccess ||
3372 !IOIteratorIsValid(hidObjectIterator)) {
3373 return 1;
3375 return 0;
3378 cc_check -framework IOKit && _apple_remote=yes
3380 if test "$_apple_remote" = yes ; then
3381 def_apple_remote='#define CONFIG_APPLE_REMOTE 1'
3382 libs_mplayer="$libs_mplayer -framework IOKit -framework Cocoa"
3383 else
3384 def_apple_remote='#undef CONFIG_APPLE_REMOTE'
3386 echores "$_apple_remote"
3388 fi #if darwin
3390 if linux; then
3392 echocheck "Apple IR"
3393 if test "$_apple_ir" = auto ; then
3394 _apple_ir=no
3395 statement_check linux/input.h 'struct input_event ev; struct input_id id' && _apple_ir=yes
3397 if test "$_apple_ir" = yes ; then
3398 def_apple_ir='#define CONFIG_APPLE_IR 1'
3399 else
3400 def_apple_ir='#undef CONFIG_APPLE_IR'
3402 echores "$_apple_ir"
3403 fi #if linux
3405 echocheck "pkg-config"
3406 if $($_pkg_config --version > /dev/null 2>&1); then
3407 if test "$_ld_static"; then
3408 _pkg_config="$_pkg_config --static"
3410 echores "yes"
3411 else
3412 _pkg_config=false
3413 echores "no"
3417 echocheck "Samba support (libsmbclient)"
3418 if test "$_smb" = yes; then
3419 extra_ldflags="$extra_ldflags -lsmbclient"
3421 if test "$_smb" = auto; then
3422 _smb=no
3423 for _ld_tmp in "-lsmbclient" "-lsmbclient $_ld_dl" "-lsmbclient $_ld_dl -lnsl" "-lsmbclient $_ld_dl -lssl -lnsl" ; do
3424 statement_check libsmbclient.h 'smbc_opendir("smb://")' $_ld_tmp &&
3425 extra_ldflags="$extra_ldflags $_ld_tmp" && _smb=yes && break
3426 done
3429 if test "$_smb" = yes; then
3430 def_smb="#define CONFIG_LIBSMBCLIENT 1"
3431 inputmodules="smb $inputmodules"
3432 else
3433 def_smb="#undef CONFIG_LIBSMBCLIENT"
3434 noinputmodules="smb $noinputmodules"
3436 echores "$_smb"
3438 echocheck "libquvi support"
3439 if test "$_libquvi" = auto ; then
3440 _libquvi=no
3441 if pkg_config_add 'libquvi >= 0.4.1' ; then
3442 _libquvi=yes
3445 if test "$_libquvi" = yes; then
3446 def_libquvi="#define CONFIG_LIBQUVI 1"
3447 else
3448 def_libquvi="#undef CONFIG_LIBQUVI"
3450 echores "$_libquvi"
3452 #########
3453 # VIDEO #
3454 #########
3457 echocheck "tga"
3458 if test "$_tga" = yes ; then
3459 def_tga='#define CONFIG_TGA 1'
3460 vomodules="tga $vomodules"
3461 else
3462 def_tga='#undef CONFIG_TGA'
3463 novomodules="tga $novomodules"
3465 echores "$_tga"
3468 echocheck "md5sum support"
3469 if test "$_md5sum" = yes; then
3470 def_md5sum="#define CONFIG_MD5SUM 1"
3471 vomodules="md5sum $vomodules"
3472 else
3473 def_md5sum="#undef CONFIG_MD5SUM"
3474 novomodules="md5sum $novomodules"
3476 echores "$_md5sum"
3479 echocheck "yuv4mpeg support"
3480 if test "$_yuv4mpeg" = yes; then
3481 def_yuv4mpeg="#define CONFIG_YUV4MPEG 1"
3482 vomodules="yuv4mpeg $vomodules"
3483 else
3484 def_yuv4mpeg="#undef CONFIG_YUV4MPEG"
3485 novomodules="yuv4mpeg $novomodules"
3487 echores "$_yuv4mpeg"
3490 echocheck "DirectFB"
3491 if test "$_directfb" = auto ; then
3492 _directfb=no
3493 cat > $TMPC << EOF
3494 #include <directfb.h>
3495 #include <directfb_version.h>
3496 #if (DIRECTFB_MAJOR_VERSION << 16 | DIRECTFB_MINOR_VERSION << 8 | DIRECTFB_MICRO_VERSION) < (0 << 16 | 9 << 8 | 22)
3497 #error "DirectFB version too old."
3498 #endif
3499 int main(void) { DirectFBInit(0, 0); return 0; }
3501 for _inc_tmp in "" -I/usr/local/include/directfb -I/usr/include/directfb -I/usr/local/include; do
3502 cc_check $_inc_tmp -ldirectfb &&
3503 _directfb=yes && extra_cflags="$extra_cflags $_inc_tmp" && break
3504 done
3506 if test "$_directfb" = yes ; then
3507 def_directfb='#define CONFIG_DIRECTFB 1'
3508 vomodules="directfb $vomodules"
3509 libs_mplayer="$libs_mplayer -ldirectfb"
3510 else
3511 def_directfb='#undef CONFIG_DIRECTFB'
3512 novomodules="directfb $novomodules"
3514 echores "$_directfb"
3517 if darwin; then
3519 echocheck "QuickTime"
3520 if test "$quicktime" = auto ; then
3521 quicktime=no
3522 statement_check QuickTime/QuickTime.h 'ImageDescription *desc; EnterMovies(); ExitMovies()' -framework QuickTime && quicktime=yes
3524 if test "$quicktime" = yes ; then
3525 extra_ldflags="$extra_ldflags -framework QuickTime"
3526 def_quicktime='#define CONFIG_QUICKTIME 1'
3527 else
3528 def_quicktime='#undef CONFIG_QUICKTIME'
3530 echores $quicktime
3532 echocheck "Cocoa"
3533 if test "$_cocoa" = auto ; then
3534 cat > $TMPC <<EOF
3535 #include <CoreServices/CoreServices.h>
3536 #include <OpenGL/OpenGL.h>
3537 int main(void) {
3538 NSApplicationLoad();
3541 _cocoa=no
3542 cc_check -framework IOKit -framework Cocoa -framework OpenGL && _cocoa=yes
3544 if test "$_cocoa" = yes ; then
3545 libs_mplayer="$libs_mplayer -framework IOKit -framework Cocoa -framework OpenGL"
3546 def_cocoa='#define CONFIG_COCOA 1'
3547 else
3548 def_cocoa='#undef CONFIG_COCOA'
3550 echores "$_cocoa"
3552 echocheck "CoreVideo"
3553 if test "$_cocoa" = yes && test "$_corevideo" = auto ; then
3554 cat > $TMPC <<EOF
3555 #include <QuartzCore/CoreVideo.h>
3556 int main(void) { return 0; }
3558 _corevideo=no
3559 cc_check -framework Cocoa -framework QuartzCore -framework OpenGL && _corevideo=yes
3561 if test "$_corevideo" = yes ; then
3562 vomodules="corevideo $vomodules"
3563 libs_mplayer="$libs_mplayer -framework QuartzCore"
3564 def_corevideo='#define CONFIG_COREVIDEO 1'
3565 else
3566 novomodules="corevideo $novomodules"
3567 def_corevideo='#undef CONFIG_COREVIDEO'
3569 echores "$_corevideo"
3571 echocheck "SharedBuffer"
3572 if test "$_sharedbuffer" = auto ; then
3573 cat > $TMPC <<EOF
3574 int main(void) {
3575 NSApplicationLoad();
3578 _sharedbuffer=no
3579 cc_check -framework Cocoa && _sharedbuffer=yes
3581 if test "$_sharedbuffer" = yes ; then
3582 vomodules="sharedbuffer $vomodules"
3583 libs_mplayer="$libs_mplayer -framework Cocoa"
3584 def_sharedbuffer='#define CONFIG_SHAREDBUFFER 1'
3585 else
3586 novomodules="sharedbuffer $novomodules"
3587 def_sharedbuffer='#undef CONFIG_SHAREDBUFFER'
3589 echores "$_sharedbuffer"
3591 depends_on_application_services(){
3592 test "$_corevideo" = yes
3595 fi #if darwin
3598 echocheck "X11 headers presence"
3599 _x11_headers="no"
3600 res_comment="check if the dev(el) packages are installed"
3601 for I in $(echo $extra_cflags | sed s/-I//g) /usr/include ; do
3602 if test -f "$I/X11/Xlib.h" ; then
3603 _x11_headers="yes"
3604 res_comment=""
3605 break
3607 done
3608 if test $_cross_compile = no; then
3609 for I in /usr/X11/include /usr/X11R7/include /usr/local/include /usr/X11R6/include \
3610 /usr/include/X11R6 /usr/openwin/include ; do
3611 if test -f "$I/X11/Xlib.h" ; then
3612 extra_cflags="$extra_cflags -I$I"
3613 _x11_headers="yes"
3614 res_comment="using $I"
3615 break
3617 done
3619 echores "$_x11_headers"
3622 echocheck "X11"
3623 if test "$_x11" = auto && test "$_x11_headers" = yes ; then
3624 for I in "" -L/usr/X11R7/lib -L/usr/local/lib -L/usr/X11R6/lib -L/usr/lib/X11R6 \
3625 -L/usr/X11/lib -L/usr/lib32 -L/usr/openwin/lib -L/usr/local/lib64 -L/usr/X11R6/lib64 \
3626 -L/usr/lib ; do
3627 if netbsd; then
3628 _ld_tmp="$I -lXext -lX11 $_ld_pthread -Wl,-R$(echo $I | sed s/^-L//)"
3629 else
3630 _ld_tmp="$I -lXext -lX11 $_ld_pthread"
3632 statement_check X11/Xutil.h 'XCreateWindow(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)' $_ld_tmp &&
3633 _x11=yes
3634 # Check that there aren't conflicting headers between ApplicationServices
3635 # and X11. On versions of Mac OSX prior to 10.7 the deprecated QuickDraw API
3636 # is included by -framework ApplicationServices and clashes with the X11
3637 # definition of the "Cursor" type.
3638 if darwin && depends_on_application_services && test "$_x11" = yes ; then
3639 _x11=no
3640 header_check_broken ApplicationServices/ApplicationServices.h \
3641 X11/Xutil.h $_ld_tmp && _x11=yes
3643 if test "$_x11" = yes ; then
3644 libs_mplayer="$libs_mplayer $_ld_tmp"
3645 break
3647 done
3649 if test "$_x11" = yes ; then
3650 def_x11='#define CONFIG_X11 1'
3651 vomodules="x11 $vomodules"
3652 else
3653 _x11=no
3654 def_x11='#undef CONFIG_X11'
3655 novomodules="x11 $novomodules"
3656 res_comment="check if the dev(el) packages are installed"
3658 echores "$_x11"
3660 echocheck "Xss screensaver extensions"
3661 if test "$_xss" = auto ; then
3662 _xss=no
3663 statement_check "X11/extensions/scrnsaver.h" 'XScreenSaverSuspend(NULL, True)' -lXss && _xss=yes
3665 if test "$_xss" = yes ; then
3666 def_xss='#define CONFIG_XSS 1'
3667 libs_mplayer="$libs_mplayer -lXss"
3668 else
3669 def_xss='#undef CONFIG_XSS'
3671 echores "$_xss"
3673 echocheck "DPMS"
3674 _xdpms3=no
3675 _xdpms4=no
3676 if test "$_x11" = yes ; then
3677 cat > $TMPC <<EOF
3678 #include <X11/Xmd.h>
3679 #include <X11/Xlib.h>
3680 #include <X11/Xutil.h>
3681 #include <X11/Xatom.h>
3682 #include <X11/extensions/dpms.h>
3683 int main(void) { DPMSQueryExtension(0, 0, 0); return 0; }
3685 cc_check -lXdpms && _xdpms3=yes
3686 statement_check_broken X11/Xlib.h X11/extensions/dpms.h 'DPMSQueryExtension(0, 0, 0)' -lXext && _xdpms4=yes
3688 if test "$_xdpms4" = yes ; then
3689 def_xdpms='#define CONFIG_XDPMS 1'
3690 res_comment="using Xdpms 4"
3691 echores "yes"
3692 elif test "$_xdpms3" = yes ; then
3693 def_xdpms='#define CONFIG_XDPMS 1'
3694 libs_mplayer="$libs_mplayer -lXdpms"
3695 res_comment="using Xdpms 3"
3696 echores "yes"
3697 else
3698 def_xdpms='#undef CONFIG_XDPMS'
3699 echores "no"
3703 echocheck "Xv"
3704 if test "$_xv" = auto && test "$_x11" = yes ; then
3705 _xv=no
3706 statement_check_broken X11/Xlib.h X11/extensions/Xvlib.h 'XvGetPortAttribute(0, 0, 0, 0)' -lXv && _xv=yes
3709 if test "$_xv" = yes ; then
3710 def_xv='#define CONFIG_XV 1'
3711 libs_mplayer="$libs_mplayer -lXv"
3712 vomodules="xv $vomodules"
3713 else
3714 def_xv='#undef CONFIG_XV'
3715 novomodules="xv $novomodules"
3717 echores "$_xv"
3720 echocheck "VDPAU"
3721 if test "$_vdpau" = auto && test "$_x11" = yes ; then
3722 _vdpau=no
3723 if test "$_dl" = yes ; then
3724 pkg_config_add 'vdpau >= 0.2' && _vdpau=yes
3727 if test "$_vdpau" = yes ; then
3728 def_vdpau='#define CONFIG_VDPAU 1'
3729 vomodules="vdpau $vomodules"
3730 else
3731 def_vdpau='#define CONFIG_VDPAU 0'
3732 novomodules="vdpau $novomodules"
3734 echores "$_vdpau"
3737 echocheck "Xinerama"
3738 if test "$_xinerama" = auto && test "$_x11" = yes ; then
3739 _xinerama=no
3740 statement_check X11/extensions/Xinerama.h 'XineramaIsActive(0)' -lXinerama && _xinerama=yes
3743 if test "$_xinerama" = yes ; then
3744 def_xinerama='#define CONFIG_XINERAMA 1'
3745 libs_mplayer="$libs_mplayer -lXinerama"
3746 else
3747 def_xinerama='#undef CONFIG_XINERAMA'
3749 echores "$_xinerama"
3752 # Note: the -lXxf86vm library is the VideoMode extension and though it's not
3753 # needed for DGA, AFAIK every distribution packages together with DGA stuffs
3754 # named 'X extensions' or something similar.
3755 # This check may be useful for future mplayer versions (to change resolution)
3756 # If you run into problems, remove '-lXxf86vm'.
3757 echocheck "Xxf86vm"
3758 if test "$_vm" = auto && test "$_x11" = yes ; then
3759 _vm=no
3760 statement_check_broken X11/Xlib.h X11/extensions/xf86vmode.h 'XF86VidModeQueryExtension(0, 0, 0)' -lXxf86vm && _vm=yes
3762 if test "$_vm" = yes ; then
3763 def_vm='#define CONFIG_XF86VM 1'
3764 libs_mplayer="$libs_mplayer -lXxf86vm"
3765 else
3766 def_vm='#undef CONFIG_XF86VM'
3768 echores "$_vm"
3770 # Check for the presence of special keycodes, like audio control buttons
3771 # that XFree86 might have. Used to be bundled with the xf86vm check, but
3772 # has nothing to do with xf86vm and XFree 3.x has xf86vm but does NOT
3773 # have these new keycodes.
3774 echocheck "XF86keysym"
3775 if test "$_xf86keysym" = auto && test "$_x11" = yes ; then
3776 _xf86keysym=no
3777 return_check X11/XF86keysym.h XF86XK_AudioPause && _xf86keysym=yes
3779 if test "$_xf86keysym" = yes ; then
3780 def_xf86keysym='#define CONFIG_XF86XK 1'
3781 else
3782 def_xf86keysym='#undef CONFIG_XF86XK'
3784 echores "$_xf86keysym"
3787 echocheck "CACA"
3788 if test "$_caca" = auto ; then
3789 _caca=no
3790 if ( caca-config --version ) >> "$TMPLOG" 2>&1 ; then
3791 cat > $TMPC << EOF
3792 #include <caca.h>
3793 #ifdef CACA_API_VERSION_1
3794 #include <caca0.h>
3795 #endif
3796 int main(void) { caca_init(); return 0; }
3798 cc_check $(caca-config --libs) && _caca=yes
3801 if test "$_caca" = yes ; then
3802 def_caca='#define CONFIG_CACA 1'
3803 extra_cflags="$extra_cflags $(caca-config --cflags)"
3804 libs_mplayer="$libs_mplayer $(caca-config --libs)"
3805 vomodules="caca $vomodules"
3806 else
3807 def_caca='#undef CONFIG_CACA'
3808 novomodules="caca $novomodules"
3810 echores "$_caca"
3813 echocheck "DVB"
3814 if test "$_dvb" = auto ; then
3815 _dvb=no
3816 cat >$TMPC << EOF
3817 #include <poll.h>
3818 #include <sys/ioctl.h>
3819 #include <stdio.h>
3820 #include <time.h>
3821 #include <unistd.h>
3822 #include <linux/dvb/dmx.h>
3823 #include <linux/dvb/frontend.h>
3824 #include <linux/dvb/video.h>
3825 #include <linux/dvb/audio.h>
3826 int main(void) {return 0;}
3828 for _inc_tmp in "" "-I/usr/src/DVB/include" ; do
3829 cc_check $_inc_tmp && _dvb=yes &&
3830 extra_cflags="$extra_cflags $_inc_tmp" && break
3831 done
3833 echores "$_dvb"
3834 if test "$_dvb" = yes ; then
3835 _dvbin=yes
3836 inputmodules="dvb $inputmodules"
3837 def_dvbin='#define CONFIG_DVBIN 1'
3838 else
3839 _dvbin=no
3840 noinputmodules="dvb $noinputmodules"
3841 def_dvbin='#undef CONFIG_DVBIN '
3845 echocheck "PNG support"
3846 if test "$_png" = auto ; then
3847 _png=no
3848 cat > $TMPC << EOF
3849 #include <stdio.h>
3850 #include <string.h>
3851 #include <png.h>
3852 int main(void) {
3853 printf("png.h : %s\n", PNG_LIBPNG_VER_STRING);
3854 printf("libpng: %s\n", png_libpng_ver);
3855 return strcmp(PNG_LIBPNG_VER_STRING, png_libpng_ver);
3858 cc_check -lpng -lz $_ld_lm && _png=yes
3860 echores "$_png"
3861 if test "$_png" = yes ; then
3862 def_png='#define CONFIG_PNG 1'
3863 extra_ldflags="$extra_ldflags -lpng -lz"
3864 else
3865 def_png='#undef CONFIG_PNG'
3868 echocheck "MNG support"
3869 if test "$_mng" = auto ; then
3870 _mng=no
3871 return_statement_check libmng.h 'const char * p_ver = mng_version_text()' '!p_ver || p_ver[0] == 0' -lmng -lz $_ld_lm && _mng=yes
3873 echores "$_mng"
3874 if test "$_mng" = yes ; then
3875 def_mng='#define CONFIG_MNG 1'
3876 extra_ldflags="$extra_ldflags -lmng -lz"
3877 else
3878 def_mng='#undef CONFIG_MNG'
3881 echocheck "JPEG support"
3882 if test "$_jpeg" = auto ; then
3883 _jpeg=no
3884 header_check_broken stdio.h jpeglib.h -ljpeg $_ld_lm && _jpeg=yes
3886 echores "$_jpeg"
3888 if test "$_jpeg" = yes ; then
3889 def_jpeg='#define CONFIG_JPEG 1'
3890 vomodules="jpeg $vomodules"
3891 extra_ldflags="$extra_ldflags -ljpeg"
3892 else
3893 def_jpeg='#undef CONFIG_JPEG'
3894 novomodules="jpeg $novomodules"
3899 echocheck "PNM support"
3900 if test "$_pnm" = yes; then
3901 def_pnm="#define CONFIG_PNM 1"
3902 vomodules="pnm $vomodules"
3903 else
3904 def_pnm="#undef CONFIG_PNM"
3905 novomodules="pnm $novomodules"
3907 echores "$_pnm"
3911 echocheck "GIF support"
3912 # This is to appease people who want to force gif support.
3913 # If it is forced to yes, then we still do checks to determine
3914 # which gif library to use.
3915 if test "$_gif" = yes ; then
3916 _force_gif=yes
3917 _gif=auto
3920 if test "$_gif" = auto ; then
3921 _gif=no
3922 for _ld_gif in "-lungif" "-lgif" ; do
3923 statement_check gif_lib.h 'QuantizeBuffer(0, 0, 0, 0, 0, 0, 0, 0)' $_ld_gif && _gif=yes && break
3924 done
3927 # If no library was found, and the user wants support forced,
3928 # then we force it on with libgif, as this is the safest
3929 # assumption IMHO. (libungif & libregif both create symbolic
3930 # links to libgif. We also assume that no x11 support is needed,
3931 # because if you are forcing this, then you _should_ know what
3932 # you are doing. [ Besides, package maintainers should never
3933 # have compiled x11 deps into libungif in the first place. ] )
3934 # </rant>
3935 # --Joey
3936 if test "$_force_gif" = yes && test "$_gif" = no ; then
3937 _gif=yes
3938 _ld_gif="-lgif"
3941 if test "$_gif" = yes ; then
3942 def_gif='#define CONFIG_GIF 1'
3943 codecmodules="gif $codecmodules"
3944 vomodules="gif89a $vomodules"
3945 res_comment="old version, some encoding functions disabled"
3946 def_gif_4='#undef CONFIG_GIF_4'
3947 extra_ldflags="$extra_ldflags $_ld_gif"
3949 cat > $TMPC << EOF
3950 #include <signal.h>
3951 #include <stdio.h>
3952 #include <stdlib.h>
3953 #include <gif_lib.h>
3954 static void catch(int sig) { exit(1); }
3955 int main(void) {
3956 signal(SIGSEGV, catch); // catch segfault
3957 printf("EGifPutExtensionFirst is at address %p\n", EGifPutExtensionFirst);
3958 EGifSetGifVersion("89a"); // this will segfault a buggy gif lib.
3959 return 0;
3962 if cc_check "$_ld_gif" ; then
3963 def_gif_4='#define CONFIG_GIF_4 1'
3964 res_comment=""
3966 else
3967 def_gif='#undef CONFIG_GIF'
3968 def_gif_4='#undef CONFIG_GIF_4'
3969 novomodules="gif89a $novomodules"
3970 nocodecmodules="gif $nocodecmodules"
3972 echores "$_gif"
3975 case "$_gif" in yes*)
3976 echocheck "broken giflib workaround"
3977 def_gif_tvt_hack='#define CONFIG_GIF_TVT_HACK 1'
3979 cat > $TMPC << EOF
3980 #include <stdio.h>
3981 #include <gif_lib.h>
3982 int main(void) {
3983 GifFileType gif = {.UserData = NULL};
3984 printf("UserData is at address %p\n", gif.UserData);
3985 return 0;
3988 if cc_check "$_ld_gif" ; then
3989 def_gif_tvt_hack='#undef CONFIG_GIF_TVT_HACK'
3990 echores "disabled"
3991 else
3992 echores "enabled"
3995 esac
3998 #################
3999 # VIDEO + AUDIO #
4000 #################
4003 echocheck "SDL"
4004 _inc_tmp=""
4005 _ld_tmp=""
4006 def_sdl_sdl_h="#undef CONFIG_SDL_SDL_H"
4007 if test -z "$_sdlconfig" ; then
4008 if ( sdl-config --version ) >>"$TMPLOG" 2>&1 ; then
4009 _sdlconfig="sdl-config"
4010 elif ( sdl11-config --version ) >>"$TMPLOG" 2>&1 ; then
4011 _sdlconfig="sdl11-config"
4012 else
4013 _sdlconfig=false
4016 if test "$_sdl" = auto || test "$_sdl" = yes ; then
4017 cat > $TMPC << EOF
4018 #ifdef CONFIG_SDL_SDL_H
4019 #include <SDL/SDL.h>
4020 #else
4021 #include <SDL.h>
4022 #endif
4023 #ifndef __APPLE__
4024 // we allow SDL hacking our main() only on OSX
4025 #undef main
4026 #endif
4027 int main(int argc, char *argv[]) {
4028 SDL_Init(SDL_INIT_VIDEO|SDL_INIT_NOPARACHUTE);
4029 return 0;
4032 _sdl=no
4033 for _ld_tmp in "-lSDL" "-lSDL -lpthread" "-lSDL -lwinmm -lgdi32" "-lSDL -lwinmm -lgdi32 -ldxguid" ; do
4034 if cc_check -DCONFIG_SDL_SDL_H $_inc_tmp $_ld_tmp ; then
4035 _sdl=yes
4036 def_sdl_sdl_h="#define CONFIG_SDL_SDL_H 1"
4037 break
4039 done
4040 if test "$_sdl" = no && "$_sdlconfig" --version >>"$TMPLOG" 2>&1 ; then
4041 res_comment="using $_sdlconfig"
4042 if cygwin ; then
4043 _inc_tmp="$($_sdlconfig --cflags | cut -d " " -f 1,5,6 | sed s/no-cygwin/cygwin/)"
4044 _ld_tmp="$($_sdlconfig --libs | cut -d " " -f 1,4,6 | sed s/no-cygwin/cygwin/)"
4045 elif mingw32 ; then
4046 _inc_tmp=$($_sdlconfig --cflags | sed s/-Dmain=SDL_main//)
4047 _ld_tmp=$($_sdlconfig --libs | sed -e s/-mwindows// -e s/-lmingw32//)
4048 else
4049 _inc_tmp="$($_sdlconfig --cflags)"
4050 _ld_tmp="$($_sdlconfig --libs)"
4052 if cc_check $_inc_tmp $_ld_tmp >>"$TMPLOG" 2>&1 ; then
4053 _sdl=yes
4054 elif cc_check $_inc_tmp $_ld_tmp -lstdc++ >>"$TMPLOG" 2>&1 ; then
4055 # HACK for BeOS/Haiku SDL
4056 _ld_tmp="$_ld_tmp -lstdc++"
4057 _sdl=yes
4061 if test "$_sdl" = yes ; then
4062 def_sdl='#define CONFIG_SDL 1'
4063 extra_cflags="$extra_cflags $_inc_tmp"
4064 libs_mplayer="$libs_mplayer $_ld_tmp"
4065 vomodules="sdl $vomodules"
4066 aomodules="sdl $aomodules"
4067 else
4068 def_sdl='#undef CONFIG_SDL'
4069 novomodules="sdl $novomodules"
4070 noaomodules="sdl $noaomodules"
4072 echores "$_sdl"
4075 # make sure this stays below CoreVideo to avoid issues due to namespace
4076 # conflicts between -lGL and -framework OpenGL
4077 echocheck "OpenGL"
4078 #Note: this test is run even with --enable-gl since we autodetect linker flags
4079 if (test "$_x11" = yes || test "$_sdl" = yes || test "$_cocoa" = yes || win32) && test "$_gl" != no ; then
4080 cat > $TMPC << EOF
4081 #ifdef GL_WIN32
4082 #include <windows.h>
4083 #include <GL/gl.h>
4084 #elif defined(GL_SDL)
4085 #include <GL/gl.h>
4086 #ifdef CONFIG_SDL_SDL_H
4087 #include <SDL/SDL.h>
4088 #else
4089 #include <SDL.h>
4090 #endif
4091 #ifndef __APPLE__
4092 // we allow SDL hacking our main() only on OSX
4093 #undef main
4094 #endif
4095 #else
4096 #include <GL/gl.h>
4097 #include <X11/Xlib.h>
4098 #include <GL/glx.h>
4099 #endif
4100 int main(int argc, char *argv[]) {
4101 #ifdef GL_WIN32
4102 HDC dc;
4103 wglCreateContext(dc);
4104 #elif defined(GL_SDL)
4105 SDL_GL_SwapBuffers();
4106 #else
4107 glXCreateContext(NULL, NULL, NULL, True);
4108 #endif
4109 glFinish();
4110 return 0;
4113 _gl=no
4114 if test "$_x11" = yes ; then
4115 for _ld_tmp in "" -lGL "-lGL -lXdamage" "-lGL $_ld_pthread" ; do
4116 if cc_check $_ld_tmp $_ld_lm ; then
4117 _gl=yes
4118 _gl_x11=yes
4119 libs_mplayer="$libs_mplayer $_ld_tmp $_ld_dl"
4120 break
4122 done
4124 if win32 && cc_check -DGL_WIN32 -lopengl32 ; then
4125 _gl=yes
4126 _gl_win32=yes
4127 libs_mplayer="$libs_mplayer -lopengl32 -lgdi32"
4129 if test "$_cocoa" = yes ; then
4130 _gl=yes
4131 _gl_cocoa=yes
4133 # last so it can reuse any linker etc. flags detected before
4134 if test "$_sdl" = yes ; then
4135 if cc_check -DGL_SDL ||
4136 cc_check -DCONFIG_SDL_SDL_H -DGL_SDL ; then
4137 _gl=yes
4138 _gl_sdl=yes
4139 elif cc_check -DGL_SDL -lGL ||
4140 cc_check -DCONFIG_SDL_SDL_H -DGL_SDL -lGL ; then
4141 _gl=yes
4142 _gl_sdl=yes
4143 libs_mplayer="$libs_mplayer -lGL"
4146 else
4147 _gl=no
4149 if test "$_gl" = yes ; then
4150 def_gl='#define CONFIG_GL 1'
4151 res_comment="backends:"
4152 if test "$_gl_cocoa" = yes ; then
4153 def_gl_cocoa='#define CONFIG_GL_COCOA 1'
4154 res_comment="$res_comment cocoa"
4156 if test "$_gl_win32" = yes ; then
4157 def_gl_win32='#define CONFIG_GL_WIN32 1'
4158 res_comment="$res_comment win32"
4160 if test "$_gl_x11" = yes ; then
4161 def_gl_x11='#define CONFIG_GL_X11 1'
4162 res_comment="$res_comment x11"
4164 if test "$_gl_sdl" = yes ; then
4165 def_gl_sdl='#define CONFIG_GL_SDL 1'
4166 res_comment="$res_comment sdl"
4168 vomodules="opengl $vomodules"
4169 else
4170 def_gl='#undef CONFIG_GL'
4171 def_gl_cocoa='#undef CONFIG_GL_COCOA'
4172 def_gl_win32='#undef CONFIG_GL_WIN32'
4173 def_gl_x11='#undef CONFIG_GL_X11'
4174 def_gl_sdl='#undef CONFIG_GL_SDL'
4175 novomodules="opengl $novomodules"
4177 echores "$_gl"
4180 if win32; then
4182 echocheck "Direct3D"
4183 if test "$_direct3d" = auto ; then
4184 _direct3d=no
4185 header_check d3d9.h && _direct3d=yes
4187 if test "$_direct3d" = yes ; then
4188 def_direct3d='#define CONFIG_DIRECT3D 1'
4189 vomodules="direct3d $vomodules"
4190 else
4191 def_direct3d='#undef CONFIG_DIRECT3D'
4192 novomodules="direct3d $novomodules"
4194 echores "$_direct3d"
4196 echocheck "Directx"
4197 if test "$_directx" = auto ; then
4198 cat > $TMPC << EOF
4199 #include <ddraw.h>
4200 #include <dsound.h>
4201 int main(void) { return 0; }
4203 _directx=no
4204 cc_check -lgdi32 && _directx=yes
4206 if test "$_directx" = yes ; then
4207 def_directx='#define CONFIG_DIRECTX 1'
4208 libs_mplayer="$libs_mplayer -lgdi32"
4209 vomodules="directx $vomodules"
4210 aomodules="dsound $aomodules"
4211 else
4212 def_directx='#undef CONFIG_DIRECTX'
4213 novomodules="directx $novomodules"
4214 noaomodules="dsound $noaomodules"
4216 echores "$_directx"
4218 fi #if win32; then
4221 echocheck "V4L2 MPEG Decoder"
4222 if test "$_v4l2" = auto ; then
4223 cat > $TMPC << EOF
4224 #include <sys/time.h>
4225 #include <linux/videodev2.h>
4226 #include <linux/version.h>
4227 int main(void) {
4228 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22)
4229 #error kernel headers too old, need 2.6.22
4230 #endif
4231 struct v4l2_ext_controls ctrls;
4232 ctrls.ctrl_class = V4L2_CTRL_CLASS_MPEG;
4233 return 0;
4236 _v4l2=no
4237 cc_check && _v4l2=yes
4239 if test "$_v4l2" = yes ; then
4240 def_v4l2='#define CONFIG_V4L2_DECODER 1'
4241 vomodules="v4l2 $vomodules"
4242 aomodules="v4l2 $aomodules"
4243 else
4244 def_v4l2='#undef CONFIG_V4L2_DECODER'
4245 novomodules="v4l2 $novomodules"
4246 noaomodules="v4l2 $noaomodules"
4248 echores "$_v4l2"
4252 #########
4253 # AUDIO #
4254 #########
4257 echocheck "OSS Audio"
4258 if test "$_ossaudio" = auto ; then
4259 _ossaudio=no
4260 return_check $_soundcard_header SNDCTL_DSP_SETFRAGMENT && _ossaudio=yes
4262 if test "$_ossaudio" = yes ; then
4263 def_ossaudio='#define CONFIG_OSS_AUDIO 1'
4264 aomodules="oss $aomodules"
4265 cat > $TMPC << EOF
4266 #include <$_soundcard_header>
4267 #ifdef OPEN_SOUND_SYSTEM
4268 int main(void) { return 0; }
4269 #else
4270 #error Not the real thing
4271 #endif
4273 _real_ossaudio=no
4274 cc_check && _real_ossaudio=yes
4275 if test "$_real_ossaudio" = yes; then
4276 def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/dsp"'
4277 # Check for OSS4 headers (override default headers)
4278 # Does not apply to systems where OSS4 is native (e.g. FreeBSD)
4279 if test -f /etc/oss.conf; then
4280 . /etc/oss.conf
4281 _ossinc="$OSSLIBDIR/include"
4282 if test -f "$_ossinc/sys/soundcard.h"; then
4283 extra_cflags="-I$_ossinc $extra_cflags"
4286 elif netbsd || openbsd ; then
4287 def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/sound"'
4288 extra_ldflags="$extra_ldflags -lossaudio"
4289 else
4290 def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/dsp"'
4292 def_ossaudio_devmixer='#define PATH_DEV_MIXER "/dev/mixer"'
4293 else
4294 def_ossaudio='#undef CONFIG_OSS_AUDIO'
4295 def_ossaudio_devdsp='#define PATH_DEV_DSP ""'
4296 def_ossaudio_devmixer='#define PATH_DEV_MIXER ""'
4297 noaomodules="oss $noaomodules"
4299 echores "$_ossaudio"
4302 echocheck "RSound"
4303 if test "$_rsound" = auto ; then
4304 _rsound=no
4305 statement_check rsound.h 'rsd_init(NULL);' -lrsound && _rsound=yes
4307 echores "$_rsound"
4309 if test "$_rsound" = yes ; then
4310 def_rsound='#define CONFIG_RSOUND 1'
4311 aomodules="rsound $aomodules"
4312 libs_mplayer="$libs_mplayer -lrsound"
4313 else
4314 def_rsound='#undef CONFIG_RSOUND'
4315 noaomodules="rsound $noaomodules"
4319 echocheck "pulse"
4320 if test "$_pulse" = auto ; then
4321 _pulse=no
4322 if pkg_config_add 'libpulse >= 0.9' ; then
4323 _pulse=yes
4326 echores "$_pulse"
4328 if test "$_pulse" = yes ; then
4329 def_pulse='#define CONFIG_PULSE 1'
4330 aomodules="pulse $aomodules"
4331 else
4332 def_pulse='#undef CONFIG_PULSE'
4333 noaomodules="pulse $noaomodules"
4337 echocheck "PortAudio"
4338 if test "$_portaudio" = auto && test "$_pthreads" != yes ; then
4339 _portaudio=no
4340 res_comment="pthreads not enabled"
4342 if test "$_portaudio" = auto ; then
4343 _portaudio=no
4344 if pkg_config_add 'portaudio-2.0 >= 19' ; then
4345 _portaudio=yes
4348 echores "$_portaudio"
4350 if test "$_portaudio" = yes ; then
4351 def_portaudio='#define CONFIG_PORTAUDIO 1'
4352 aomodules="portaudio $aomodules"
4353 else
4354 def_portaudio='#undef CONFIG_PORTAUDIO'
4355 noaomodules="portaudio $noaomodules"
4359 echocheck "JACK"
4360 if test "$_jack" = auto ; then
4361 _jack=no
4362 if pkg_config_add jack ; then
4363 _jack=yes
4367 if test "$_jack" = yes ; then
4368 def_jack='#define CONFIG_JACK 1'
4369 aomodules="jack $aomodules"
4370 else
4371 noaomodules="jack $noaomodules"
4373 echores "$_jack"
4375 echocheck "OpenAL"
4376 if test "$_openal" = auto ; then
4377 _openal=no
4378 cat > $TMPC << EOF
4379 #ifdef OPENAL_AL_H
4380 #include <OpenAL/al.h>
4381 #else
4382 #include <AL/al.h>
4383 #endif
4384 int main(void) {
4385 alSourceQueueBuffers(0, 0, 0);
4386 // alGetSourcei(0, AL_SAMPLE_OFFSET, 0);
4387 return 0;
4390 for I in "-lopenal" "-lopenal32" "-framework OpenAL" ; do
4391 cc_check $I && _openal=yes && break
4392 cc_check -DOPENAL_AL_H=1 $I && def_openal_h='#define OPENAL_AL_H 1' && _openal=yes && break
4393 done
4394 test "$_openal" = yes && libs_mplayer="$libs_mplayer $I"
4396 if test "$_openal" = yes ; then
4397 def_openal='#define CONFIG_OPENAL 1'
4398 aomodules="openal $aomodules"
4399 else
4400 noaomodules="openal $noaomodules"
4402 echores "$_openal"
4404 echocheck "ALSA audio"
4405 if test "$_alloca" != yes ; then
4406 _alsa=no
4407 res_comment="alloca missing"
4409 if test "$_alsa" = auto ; then
4410 _alsa=no
4411 if pkg_config_add "alsa >= 1.0.9" ; then
4412 _alsa=yes
4415 def_alsa='#undef CONFIG_ALSA'
4416 if test "$_alsa" = yes ; then
4417 aomodules="alsa $aomodules"
4418 def_alsa='#define CONFIG_ALSA 1'
4419 else
4420 noaomodules="alsa $noaomodules"
4422 echores "$_alsa"
4425 if darwin; then
4426 echocheck "CoreAudio"
4427 if test "$_coreaudio" = auto ; then
4428 cat > $TMPC <<EOF
4429 #include <CoreAudio/CoreAudio.h>
4430 #include <AudioToolbox/AudioToolbox.h>
4431 #include <AudioUnit/AudioUnit.h>
4432 int main(void) { return 0; }
4434 _coreaudio=no
4435 cc_check -framework CoreAudio -framework AudioUnit -framework AudioToolbox && _coreaudio=yes
4437 if test "$_coreaudio" = yes ; then
4438 libs_mplayer="$libs_mplayer -framework CoreAudio -framework AudioUnit -framework AudioToolbox"
4439 def_coreaudio='#define CONFIG_COREAUDIO 1'
4440 aomodules="coreaudio $aomodules"
4441 else
4442 def_coreaudio='#undef CONFIG_COREAUDIO'
4443 noaomodules="coreaudio $noaomodules"
4445 echores $_coreaudio
4446 fi #if darwin
4449 # set default CD/DVD devices
4450 if win32 ; then
4451 default_cdrom_device="D:"
4452 elif darwin ; then
4453 default_cdrom_device="/dev/disk1"
4454 elif dragonfly ; then
4455 default_cdrom_device="/dev/cd0"
4456 elif freebsd ; then
4457 default_cdrom_device="/dev/acd0"
4458 elif openbsd ; then
4459 default_cdrom_device="/dev/rcd0c"
4460 elif amigaos ; then
4461 default_cdrom_device="a1ide.device:2"
4462 else
4463 default_cdrom_device="/dev/cdrom"
4466 if win32 || dragonfly || freebsd || openbsd || amigaos ; then
4467 default_dvd_device=$default_cdrom_device
4468 elif darwin ; then
4469 default_dvd_device="/dev/rdiskN"
4470 else
4471 default_dvd_device="/dev/dvd"
4475 echocheck "VCD support"
4476 if test "$_vcd" = auto; then
4477 _vcd=no
4478 if linux || freebsd || netbsd || openbsd || dragonfly || bsdos || darwin ; then
4479 _vcd=yes
4480 elif mingw32; then
4481 header_check ddk/ntddcdrm.h && _vcd=yes
4484 if test "$_vcd" = yes; then
4485 inputmodules="vcd $inputmodules"
4486 def_vcd='#define CONFIG_VCD 1'
4487 else
4488 def_vcd='#undef CONFIG_VCD'
4489 noinputmodules="vcd $noinputmodules"
4490 res_comment="not supported on this OS"
4492 echores "$_vcd"
4496 echocheck "Blu-ray support"
4497 if test "$_bluray" = auto ; then
4498 _bluray=no
4499 pkg_config_add 'libbluray >= 0.2.1' && _bluray=yes
4501 if test "$_bluray" = yes ; then
4502 def_bluray='#define CONFIG_LIBBLURAY 1'
4503 inputmodules="bluray $inputmodules"
4504 else
4505 def_bluray='#undef CONFIG_LIBBLURAY'
4506 noinputmodules="bluray $noinputmodules"
4508 echores "$_bluray"
4510 echocheck "dvdread"
4511 if test "$_dvdread_internal" = auto && test ! -f "libdvdread4/dvd_reader.c" ; then
4512 _dvdread_internal=no
4514 if test "$_dvdread_internal" = auto ; then
4515 _dvdread_internal=no
4516 _dvdread=no
4517 if (linux || freebsd || netbsd || openbsd || dragonfly || hpux) &&
4518 (test "$_dvd" = yes || test "$_cdrom" = yes || test "$_cdio" = yes ||
4519 test "$_dvdio" = yes || test "$_bsdi_dvd" = yes) ||
4520 darwin || win32; then
4521 _dvdread_internal=yes
4522 _dvdread=yes
4523 extra_cflags="-Ilibdvdread4 $extra_cflags"
4525 elif test "$_dvdread" = auto ; then
4526 _dvdread=no
4527 if test "$_dl" = yes; then
4528 _dvdreadcflags=$($_dvdreadconfig --cflags 2> /dev/null)
4529 _dvdreadlibs=$($_dvdreadconfig --libs 2> /dev/null)
4530 if header_check dvdread/dvd_reader.h $_dvdreadcflags $_dvdreadlibs $_ld_dl ; then
4531 _dvdread=yes
4532 extra_cflags="$extra_cflags $_dvdreadcflags"
4533 extra_ldflags="$extra_ldflags $_dvdreadlibs"
4534 res_comment="external"
4539 if test "$_dvdread_internal" = yes; then
4540 def_dvdread='#define CONFIG_DVDREAD 1'
4541 inputmodules="dvdread(internal) $inputmodules"
4542 res_comment="internal"
4543 elif test "$_dvdread" = yes; then
4544 def_dvdread='#define CONFIG_DVDREAD 1'
4545 extra_ldflags="$extra_ldflags -ldvdread"
4546 inputmodules="dvdread(external) $inputmodules"
4547 res_comment="external"
4548 else
4549 def_dvdread='#undef CONFIG_DVDREAD'
4550 noinputmodules="dvdread $noinputmodules"
4552 echores "$_dvdread"
4555 echocheck "internal libdvdcss"
4556 if test "$_libdvdcss_internal" = auto ; then
4557 _libdvdcss_internal=no
4558 test "$_dvdread_internal" = yes && test -d libdvdcss && _libdvdcss_internal=yes
4559 hpux && test "$_hpux_scsi_h" = no && _libdvdcss_internal=no
4561 if test "$_libdvdcss_internal" = yes ; then
4562 if linux || netbsd || openbsd || bsdos ; then
4563 def_dvd_linux='#define HAVE_LINUX_DVD_STRUCT 1'
4564 openbsd && def_dvd_openbsd='#define HAVE_OPENBSD_DVD_STRUCT 1'
4565 elif freebsd || dragonfly ; then
4566 def_dvd_bsd='#define HAVE_BSD_DVD_STRUCT 1'
4567 elif darwin ; then
4568 def_dvd_darwin='#define DARWIN_DVD_IOCTL'
4569 extra_ldflags="$extra_ldflags -framework IOKit -framework Carbon"
4570 elif cygwin ; then
4571 cflags_libdvdcss="-DSYS_CYGWIN -DWIN32"
4572 elif beos ; then
4573 cflags_libdvdcss="-DSYS_BEOS"
4575 cflags_libdvdcss_dvdread="-Ilibdvdcss"
4576 def_dvdcss="#define HAVE_DVDCSS_DVDCSS_H 1"
4577 inputmodules="libdvdcss(internal) $inputmodules"
4578 else
4579 noinputmodules="libdvdcss(internal) $noinputmodules"
4581 echores "$_libdvdcss_internal"
4584 echocheck "libcdio"
4585 if test "$_libcdio" = auto ; then
4586 _libcdio=no
4587 if pkg_config_add libcdio_paranoia ; then
4588 _libcdio=yes
4591 if test "$_libcdio" = yes ; then
4592 _cdda='yes'
4593 def_cdda='#define CONFIG_CDDA 1'
4594 test $_cddb = auto && test $networking = yes && _cddb=yes
4595 inputmodules="cdda $inputmodules"
4596 else
4597 _libcdio=no
4598 _cdda='no'
4599 def_cdda='#undef CONFIG_CDDA'
4600 noinputmodules="cdda $noinputmodules"
4602 echores "$_libcdio"
4604 if test "$_cddb" = yes ; then
4605 def_cddb='#define CONFIG_CDDB 1'
4606 inputmodules="cddb $inputmodules"
4607 else
4608 _cddb=no
4609 def_cddb='#undef CONFIG_CDDB'
4610 noinputmodules="cddb $noinputmodules"
4614 echocheck "SSA/ASS support"
4615 if test "$_ass" = auto ; then
4616 if pkg_config_add libass ; then
4617 _ass=yes
4618 def_ass='#define CONFIG_ASS 1'
4619 else
4620 die "Unable to find development files for libass. Aborting. If you really mean to compile without libass support use --disable-libass."
4622 else
4623 def_ass='#undef CONFIG_ASS'
4625 echores "$_ass"
4628 echocheck "ENCA"
4629 if test "$_enca" = auto ; then
4630 _enca=no
4631 statement_check enca.h 'enca_get_languages(NULL)' -lenca $_ld_lm && _enca=yes
4633 if test "$_enca" = yes ; then
4634 def_enca='#define CONFIG_ENCA 1'
4635 extra_ldflags="$extra_ldflags -lenca"
4636 else
4637 def_enca='#undef CONFIG_ENCA'
4639 echores "$_enca"
4642 echocheck "zlib"
4643 _zlib=no
4644 statement_check zlib.h 'inflate(0, Z_NO_FLUSH)' -lz && _zlib=yes
4645 if test "$_zlib" = yes ; then
4646 def_zlib='#define CONFIG_ZLIB 1'
4647 extra_ldflags="$extra_ldflags -lz"
4648 else
4649 def_zlib='#define CONFIG_ZLIB 0'
4651 echores "$_zlib"
4654 echocheck "RTC"
4655 if test "$_rtc" = auto ; then
4656 cat > $TMPC << EOF
4657 #include <sys/ioctl.h>
4658 #ifdef __linux__
4659 #include <linux/rtc.h>
4660 #else
4661 #include <rtc.h>
4662 #define RTC_PIE_ON RTCIO_PIE_ON
4663 #endif
4664 int main(void) { return RTC_PIE_ON; }
4666 _rtc=no
4667 cc_check && _rtc=yes
4668 ppc && _rtc=no
4670 if test "$_rtc" = yes ; then
4671 def_rtc='#define HAVE_RTC 1'
4672 else
4673 def_rtc='#undef HAVE_RTC'
4675 echores "$_rtc"
4678 echocheck "mad support"
4679 if test "$_mad" = auto ; then
4680 _mad=no
4681 header_check mad.h -lmad && _mad=yes
4683 if test "$_mad" = yes ; then
4684 def_mad='#define CONFIG_LIBMAD 1'
4685 extra_ldflags="$extra_ldflags -lmad"
4686 codecmodules="libmad $codecmodules"
4687 else
4688 def_mad='#undef CONFIG_LIBMAD'
4689 nocodecmodules="libmad $nocodecmodules"
4691 echores "$_mad"
4693 echocheck "OggVorbis support"
4694 if test "$_libvorbis" = auto; then
4695 _libvorbis=no
4696 statement_check vorbis/codec.h 'vorbis_packet_blocksize(0, 0)' -lvorbis -logg $_ld_lm && _libvorbis=yes && _tremor=no
4697 elif test "$_libvorbis" = yes ; then
4698 _tremor=no
4700 if test "$_tremor" = auto; then
4701 _tremor=no
4702 statement_check tremor/ivorbiscodec.h 'vorbis_packet_blocksize(0, 0)' -logg -lvorbisidec $_ld_lm && _tremor=yes
4704 if test "$_tremor" = yes ; then
4705 _vorbis=yes
4706 def_vorbis='#define CONFIG_OGGVORBIS 1'
4707 def_tremor='#define CONFIG_TREMOR 1'
4708 codecmodules="tremor(external) $codecmodules"
4709 res_comment="external Tremor"
4710 extra_ldflags="$extra_ldflags -logg -lvorbisidec"
4711 elif test "$_libvorbis" = yes ; then
4712 _vorbis=yes
4713 def_vorbis='#define CONFIG_OGGVORBIS 1'
4714 codecmodules="libvorbis $codecmodules"
4715 res_comment="libvorbis"
4716 extra_ldflags="$extra_ldflags -lvorbis -logg"
4717 else
4718 _vorbis=no
4719 nocodecmodules="libvorbis $nocodecmodules"
4721 echores "$_vorbis"
4723 echocheck "libspeex (version >= 1.1 required)"
4724 if test "$_speex" = auto ; then
4725 _speex=no
4726 cat > $TMPC << EOF
4727 #include <stddef.h>
4728 #include <speex/speex.h>
4729 int main(void) { SpeexBits bits; void *dec = NULL; speex_decode_int(dec, &bits, dec); return 0; }
4731 cc_check -lspeex $_ld_lm && _speex=yes
4733 if test "$_speex" = yes ; then
4734 def_speex='#define CONFIG_SPEEX 1'
4735 extra_ldflags="$extra_ldflags -lspeex"
4736 codecmodules="speex $codecmodules"
4737 else
4738 def_speex='#undef CONFIG_SPEEX'
4739 nocodecmodules="speex $nocodecmodules"
4741 echores "$_speex"
4743 echocheck "OggTheora support"
4744 if test "$_theora" = auto ; then
4745 _theora=no
4746 if pkg_config_add theora ; then
4747 _theora=yes
4750 if test "$_theora" = yes ; then
4751 def_theora='#define CONFIG_OGGTHEORA 1'
4752 codecmodules="libtheora $codecmodules"
4753 else
4754 def_theora='#undef CONFIG_OGGTHEORA'
4755 nocodecmodules="libtheora $nocodecmodules"
4757 echores "$_theora"
4759 # Any version of libmpg123 that knows MPG123_RESYNC_LIMIT shall be fine.
4760 # That is, 1.2.0 onwards. Recommened is 1.14 onwards, though.
4761 echocheck "mpg123 support"
4762 def_mpg123='#undef CONFIG_MPG123'
4763 if test "$_mpg123" = auto; then
4764 _mpg123=no
4765 pkg_config_add 'libmpg123 >= 1.2.0' && _mpg123=yes
4767 if test "$_mpg123" = yes ; then
4768 def_mpg123='#define CONFIG_MPG123 1'
4769 codecmodules="mpg123 $codecmodules"
4770 else
4771 nocodecmodules="mpg123 $nocodecmodules"
4773 echores "$_mpg123"
4775 echocheck "liba52 support"
4776 def_liba52='#undef CONFIG_LIBA52'
4777 if test "$_liba52" = auto ; then
4778 _liba52=no
4779 cat > $TMPC << EOF
4780 #include <inttypes.h>
4781 #include <a52dec/a52.h>
4782 int main(void) { a52_state_t *testHand; testHand=a52_init(0); return 0; }
4784 cc_check -la52 && _liba52=yes && extra_ldflags="$extra_ldflags -la52"
4786 if test "$_liba52" = yes ; then
4787 def_liba52='#define CONFIG_LIBA52 1'
4788 codecmodules="liba52 $codecmodules"
4789 else
4790 nocodecmodules="liba52 $nocodecmodules"
4792 echores "$_liba52"
4794 echocheck "libdca support"
4795 if test "$_libdca" = auto ; then
4796 _libdca=no
4797 for _ld_dca in -ldca -ldts ; do
4798 statement_check_broken stdint.h dts.h 'dts_init(0)' $_ld_dca $_ld_lm &&
4799 extra_ldflags="$extra_ldflags $_ld_dca" && _libdca=yes && break
4800 done
4802 if test "$_libdca" = yes ; then
4803 def_libdca='#define CONFIG_LIBDCA 1'
4804 codecmodules="libdca $codecmodules"
4805 else
4806 def_libdca='#undef CONFIG_LIBDCA'
4807 nocodecmodules="libdca $nocodecmodules"
4809 echores "$_libdca"
4811 echocheck "libmpcdec (musepack, version >= 1.2.1 required)"
4812 if test "$_musepack" = yes ; then
4813 _musepack=no
4814 cat > $TMPC << EOF
4815 #include <stddef.h>
4816 #include <mpcdec/mpcdec.h>
4817 int main(void) {
4818 mpc_streaminfo info;
4819 mpc_decoder decoder;
4820 mpc_decoder_set_streaminfo(&decoder, &info);
4821 mpc_decoder_decode_frame(&decoder, NULL, 0, NULL);
4822 return 0;
4825 cc_check -lmpcdec $_ld_lm && _musepack=yes
4827 if test "$_musepack" = yes ; then
4828 def_musepack='#define CONFIG_MUSEPACK 1'
4829 extra_ldflags="$extra_ldflags -lmpcdec"
4830 codecmodules="musepack $codecmodules"
4831 else
4832 def_musepack='#undef CONFIG_MUSEPACK'
4833 nocodecmodules="musepack $nocodecmodules"
4835 echores "$_musepack"
4838 echocheck "FAAD2 support"
4839 if test "$_faad" = auto ; then
4840 _faad=no
4841 cat > $TMPC << EOF
4842 #include <faad.h>
4843 #ifndef FAAD_MIN_STREAMSIZE
4844 #error Too old version
4845 #endif
4846 int main(void) { faacDecHandle testhand; faacDecFrameInfo testinfo;
4847 testhand = faacDecOpen(); faacDecInit(0, 0, 0, 0, 0); return 0; }
4849 cc_check -lfaad $_ld_lm && _faad=yes
4852 def_faad='#undef CONFIG_FAAD'
4853 if test "$_faad" = yes ; then
4854 def_faad='#define CONFIG_FAAD 1'
4855 extra_ldflags="$extra_ldflags -lfaad"
4856 codecmodules="faad2 $codecmodules"
4857 else
4858 nocodecmodules="faad2 $nocodecmodules"
4860 echores "$_faad"
4863 echocheck "LADSPA plugin support"
4864 if test "$_ladspa" = auto ; then
4865 _ladspa=no
4866 statement_check ladspa.h 'LADSPA_Descriptor ld = {0}' && _ladspa=yes
4868 if test "$_ladspa" = yes; then
4869 def_ladspa="#define CONFIG_LADSPA 1"
4870 else
4871 def_ladspa="#undef CONFIG_LADSPA"
4873 echores "$_ladspa"
4876 echocheck "libbs2b audio filter support"
4877 if test "$_libbs2b" = auto ; then
4878 _libbs2b=no
4879 if pkg_config_add libbs2b ; then
4880 _libbs2b=yes
4883 def_libbs2b="#undef CONFIG_LIBBS2B"
4884 test "$_libbs2b" = yes && def_libbs2b="#define CONFIG_LIBBS2B 1"
4885 echores "$_libbs2b"
4888 if test -z "$_codecsdir" ; then
4889 for dir in "$_libdir/codecs" "$_libdir/win32" /usr/local/lib/codecs \
4890 /usr/lib/codecs /usr/local/lib/win32 /usr/lib/win32 ; do
4891 if test -d "$dir" ; then
4892 _codecsdir="$dir"
4893 break;
4895 done
4897 # Fall back on default directory.
4898 if test -z "$_codecsdir" ; then
4899 _codecsdir="$_libdir/codecs"
4900 mingw32 && _codecsdir="codecs"
4904 echocheck "Win32 codecs"
4905 if test "$_win32dll" = auto ; then
4906 _win32dll=no
4907 if x86_32 && ! qnx; then
4908 _win32dll=yes
4911 if test "$_win32dll" = yes ; then
4912 def_win32dll='#define CONFIG_WIN32DLL 1'
4913 if ! win32 ; then
4914 def_win32_loader='#define WIN32_LOADER 1'
4915 _win32_emulation=yes
4916 else
4917 extra_ldflags="$extra_ldflags -ladvapi32 -lole32"
4918 res_comment="using native windows"
4920 codecmodules="win32 $codecmodules"
4921 else
4922 def_win32dll='#undef CONFIG_WIN32DLL'
4923 def_win32_loader='#undef WIN32_LOADER'
4924 nocodecmodules="win32 $nocodecmodules"
4926 echores "$_win32dll"
4929 echocheck "XAnim codecs"
4930 if test "$_xanim" = auto ; then
4931 _xanim=no
4932 res_comment="dynamic loader support needed"
4933 if test "$_dl" = yes ; then
4934 _xanim=yes
4937 if test "$_xanim" = yes ; then
4938 def_xanim='#define CONFIG_XANIM 1'
4939 codecmodules="xanim $codecmodules"
4940 else
4941 def_xanim='#undef CONFIG_XANIM'
4942 nocodecmodules="xanim $nocodecmodules"
4944 echores "$_xanim"
4947 echocheck "RealPlayer codecs"
4948 if test "$_real" = auto ; then
4949 _real=no
4950 res_comment="dynamic loader support needed"
4951 if test "$_dl" = yes || test "$_win32dll" = yes &&
4952 (linux || freebsd || netbsd || openbsd || dragonfly || darwin || win32) ; then
4953 _real=yes
4956 if test "$_real" = yes ; then
4957 def_real='#define CONFIG_REALCODECS 1'
4958 codecmodules="real $codecmodules"
4959 else
4960 def_real='#undef CONFIG_REALCODECS'
4961 nocodecmodules="real $nocodecmodules"
4963 echores "$_real"
4966 echocheck "QuickTime codecs"
4967 _qtx_emulation=no
4968 def_qtx_win32='#undef CONFIG_QTX_CODECS_WIN32'
4969 if test "$_qtx" = auto ; then
4970 test "$_win32dll" = yes || test "$quicktime" = yes && _qtx=yes
4972 if test "$_qtx" = yes ; then
4973 def_qtx='#define CONFIG_QTX_CODECS 1'
4974 win32 && _qtx_codecs_win32=yes && def_qtx_win32='#define CONFIG_QTX_CODECS_WIN32 1'
4975 codecmodules="qtx $codecmodules"
4976 darwin || win32 || _qtx_emulation=yes
4977 else
4978 def_qtx='#undef CONFIG_QTX_CODECS'
4979 nocodecmodules="qtx $nocodecmodules"
4981 echores "$_qtx"
4983 echocheck "LCMS2 support"
4984 if test "$_lcms2" = auto ; then
4985 _lcms2=no
4986 if pkg_config_add lcms2 ; then
4987 _lcms2=yes
4990 if test "$_lcms2" = yes; then
4991 def_lcms2="#define CONFIG_LCMS2 1"
4992 else
4993 def_lcms2="#undef CONFIG_LCMS2"
4995 echores "$_lcms2"
4998 # Test with > against Libav 0.8 versions which will NOT work rather than
4999 # specify minimum version, to allow (future) point releases to possibly work.
5000 all_libav_libs="libavutil > 51.21.0:libavcodec > 53.34.0:libavformat > 53.20.0:libswscale >= 2.0.0"
5001 echocheck "Libav ($all_libav_libs)"
5002 if test "$ffmpeg" = auto ; then
5003 IFS=":" # shell should not be used for programming
5004 if ! pkg_config_add $all_libav_libs ; then
5005 die "Unable to find development files for some of the required Libav libraries above. Aborting."
5008 echores "yes"
5010 def_ffmpeg_internals="#undef CONFIG_FFMPEG_INTERNALS"
5011 if ! test -z "$_ffmpeg_source" ; then
5012 def_ffmpeg_internals="#define CONFIG_FFMPEG_INTERNALS 1" && ffmpeg_internals=yes
5015 echocheck "libpostproc >= 52.0.0"
5016 if test "$libpostproc" = auto ; then
5017 libpostproc=no
5018 if pkg_config_add "libpostproc >= 52.0.0" ; then
5019 libpostproc=yes
5022 if test "$libpostproc" = yes ; then
5023 def_libpostproc='#define CONFIG_LIBPOSTPROC 1'
5024 else
5025 def_libpostproc='#undef CONFIG_LIBPOSTPROC'
5027 echores "$libpostproc"
5029 echocheck "libavresample >= 1.0.0"
5030 if test "$libavresample" = auto ; then
5031 libavresample=no
5032 if pkg_config_add "libavresample >= 1.0.0" ; then
5033 libavresample=yes
5036 if test "$libavresample" = yes ; then
5037 def_libavresample='#define CONFIG_LIBAVRESAMPLE 1'
5038 else
5039 def_libavresample='#undef CONFIG_LIBAVRESAMPLE'
5041 echores "$libavresample"
5043 echocheck "libdv-0.9.5+"
5044 if test "$_libdv" = auto ; then
5045 _libdv=no
5046 statement_check libdv/dv.h 'dv_encoder_new(1, 1, 1)' -ldv $_ld_pthread $_ld_lm && _libdv=yes
5048 if test "$_libdv" = yes ; then
5049 def_libdv='#define CONFIG_LIBDV095 1'
5050 extra_ldflags="$extra_ldflags -ldv"
5051 codecmodules="libdv $codecmodules"
5052 else
5053 def_libdv='#undef CONFIG_LIBDV095'
5054 nocodecmodules="libdv $nocodecmodules"
5056 echores "$_libdv"
5059 echocheck "Xvid"
5060 if test "$_xvid" = auto ; then
5061 _xvid=no
5062 for _ld_tmp in "-lxvidcore $_ld_lm" "-lxvidcore $_ld_lm $_ld_pthread" ; do
5063 statement_check xvid.h 'xvid_global(0, 0, 0, 0)' $_ld_tmp &&
5064 extra_ldflags="$extra_ldflags $_ld_tmp" && _xvid=yes && break
5065 done
5068 if test "$_xvid" = yes ; then
5069 def_xvid='#define CONFIG_XVID4 1'
5070 codecmodules="xvid $codecmodules"
5071 else
5072 def_xvid='#undef CONFIG_XVID4'
5073 nocodecmodules="xvid $nocodecmodules"
5075 echores "$_xvid"
5078 echocheck "libnut"
5079 if test "$_libnut" = auto ; then
5080 _libnut=no
5081 statement_check libnut.h 'nut_context_tt * nut; nut_error(0)' -lnut && _libnut=yes
5084 if test "$_libnut" = yes ; then
5085 def_libnut='#define CONFIG_LIBNUT 1'
5086 extra_ldflags="$extra_ldflags -lnut"
5087 else
5088 def_libnut='#undef CONFIG_LIBNUT'
5090 echores "$_libnut"
5093 echocheck "UnRAR executable"
5094 if test "$_unrar_exec" = auto ; then
5095 _unrar_exec="yes"
5096 mingw32 && _unrar_exec="no"
5098 if test "$_unrar_exec" = yes ; then
5099 def_unrar_exec='#define CONFIG_UNRAR_EXEC 1'
5100 else
5101 def_unrar_exec='#undef CONFIG_UNRAR_EXEC'
5103 echores "$_unrar_exec"
5105 echocheck "TV interface"
5106 if test "$_tv" = yes ; then
5107 def_tv='#define CONFIG_TV 1'
5108 inputmodules="tv $inputmodules"
5109 else
5110 noinputmodules="tv $noinputmodules"
5111 def_tv='#undef CONFIG_TV'
5113 echores "$_tv"
5116 if freebsd || netbsd || openbsd || dragonfly || bsdos ; then
5117 echocheck "*BSD BT848 bt8xx header"
5118 _ioctl_bt848_h=no
5119 for file in "machine/ioctl_bt848.h" \
5120 "dev/bktr/ioctl_bt848.h" \
5121 "dev/video/bktr/ioctl_bt848.h" \
5122 "dev/ic/bt8xx.h" ; do
5123 cat > $TMPC <<EOF
5124 #include <sys/types.h>
5125 #include <sys/ioctl.h>
5126 #include <$file>
5127 int main(void) { ioctl(0, TVTUNER_GETFREQ, 0); return 0; }
5129 if cc_check ; then
5130 _ioctl_bt848_h=yes
5131 _ioctl_bt848_h_name="$file"
5132 break;
5134 done
5135 if test "$_ioctl_bt848_h" = yes ; then
5136 def_ioctl_bt848_h_name="#define IOCTL_BT848_H_NAME <$_ioctl_bt848_h_name>"
5137 res_comment="using $_ioctl_bt848_h_name"
5138 else
5139 def_ioctl_bt848_h_name="#undef IOCTL_BT848_H_NAME"
5141 echores "$_ioctl_bt848_h"
5143 echocheck "*BSD ioctl_meteor.h"
5144 _ioctl_meteor_h=no
5145 for ioctl_meteor_h_path in "machine/ioctl_meteor.h" "dev/bktr/ioctl_meteor.h" "dev/video/bktr/ioctl_meteor.h" ; do
5146 statement_check_broken "sys/types.h" "$ioctl_meteor_h_path" 'ioctl(0, METEORSINPUT, 0)' &&
5147 _ioctl_meteor_h=yes && break
5148 done
5149 if test "$_ioctl_meteor_h" = yes ; then
5150 def_ioctl_meteor_h_name="#define IOCTL_METEOR_H_NAME <$ioctl_meteor_h_path>"
5151 res_comment="using $ioctl_meteor_h_path"
5152 else
5153 def_ioctl_meteor_h_name="#undef IOCTL_METEOR_H_NAME"
5155 echores "$_ioctl_meteor_h"
5157 echocheck "*BSD BrookTree 848 TV interface"
5158 if test "$_tv_bsdbt848" = auto ; then
5159 _tv_bsdbt848=no
5160 if test "$_tv" = yes ; then
5161 cat > $TMPC <<EOF
5162 #include <sys/types.h>
5163 $def_ioctl_meteor_h_name
5164 $def_ioctl_bt848_h_name
5165 #ifdef IOCTL_METEOR_H_NAME
5166 #include IOCTL_METEOR_H_NAME
5167 #endif
5168 #ifdef IOCTL_BT848_H_NAME
5169 #include IOCTL_BT848_H_NAME
5170 #endif
5171 int main(void) {
5172 ioctl(0, METEORSINPUT, 0);
5173 ioctl(0, TVTUNER_GETFREQ, 0);
5174 return 0;
5177 cc_check && _tv_bsdbt848=yes
5180 if test "$_tv_bsdbt848" = yes ; then
5181 def_tv_bsdbt848='#define CONFIG_TV_BSDBT848 1'
5182 inputmodules="tv-bsdbt848 $inputmodules"
5183 else
5184 def_tv_bsdbt848='#undef CONFIG_TV_BSDBT848'
5185 noinputmodules="tv-bsdbt848 $noinputmodules"
5187 echores "$_tv_bsdbt848"
5188 fi #if freebsd || netbsd || openbsd || dragonfly || bsdos
5191 echocheck "DirectShow TV interface"
5192 if test "$_tv_dshow" = auto ; then
5193 _tv_dshow=no
5194 if test "$_tv" = yes && win32 ; then
5195 statement_check ole2.h 'void* p; CoCreateInstance((GUID*)&GUID_NULL, NULL, CLSCTX_INPROC_SERVER, &GUID_NULL, &p)' -lole32 -luuid && _tv_dshow=yes
5198 if test "$_tv_dshow" = yes ; then
5199 inputmodules="tv-dshow $inputmodules"
5200 def_tv_dshow='#define CONFIG_TV_DSHOW 1'
5201 extra_ldflags="$extra_ldflags -lole32 -luuid"
5202 else
5203 noinputmodules="tv-dshow $noinputmodules"
5204 def_tv_dshow='#undef CONFIG_TV_DSHOW'
5206 echores "$_tv_dshow"
5209 echocheck "Video 4 Linux TV interface"
5210 if test "$_tv_v4l1" = auto ; then
5211 _tv_v4l1=no
5212 if test "$_tv" = yes && linux ; then
5213 header_check_broken sys/time.h linux/videodev.h && _tv_v4l1=yes
5216 if test "$_tv_v4l1" = yes ; then
5217 _audio_input=yes
5218 _tv_v4l=yes
5219 def_tv_v4l='#define CONFIG_TV_V4L 1'
5220 def_tv_v4l1='#define CONFIG_TV_V4L1 1'
5221 inputmodules="tv-v4l $inputmodules"
5222 else
5223 noinputmodules="tv-v4l1 $noinputmodules"
5224 def_tv_v4l='#undef CONFIG_TV_V4L'
5226 echores "$_tv_v4l1"
5229 echocheck "Video 4 Linux 2 TV interface"
5230 if test "$_tv_v4l2" = auto ; then
5231 _tv_v4l2=no
5232 if test "$_tv" = yes && linux ; then
5233 header_check_broken sys/time.h linux/videodev2.h && _tv_v4l2=yes
5234 elif test "$_tv" = yes && test "$sys_videoio_h" = "yes" ; then
5235 _tv_v4l2=yes
5238 if test "$_tv_v4l2" = yes ; then
5239 _audio_input=yes
5240 _tv_v4l=yes
5241 def_tv_v4l='#define CONFIG_TV_V4L 1'
5242 def_tv_v4l2='#define CONFIG_TV_V4L2 1'
5243 inputmodules="tv-v4l2 $inputmodules"
5244 else
5245 noinputmodules="tv-v4l2 $noinputmodules"
5246 def_tv_v4l2='#undef CONFIG_TV_V4L2'
5248 echores "$_tv_v4l2"
5251 echocheck "Radio interface"
5252 if test "$_radio" = yes ; then
5253 def_radio='#define CONFIG_RADIO 1'
5254 inputmodules="radio $inputmodules"
5255 if test "$_alsa" != yes -a "$_ossaudio" != yes ; then
5256 _radio_capture=no
5258 if test "$_radio_capture" = yes ; then
5259 _audio_input=yes
5260 def_radio_capture="#define CONFIG_RADIO_CAPTURE 1"
5261 else
5262 def_radio_capture="#undef CONFIG_RADIO_CAPTURE"
5264 else
5265 noinputmodules="radio $noinputmodules"
5266 def_radio='#undef CONFIG_RADIO'
5267 def_radio_capture="#undef CONFIG_RADIO_CAPTURE"
5268 _radio_capture=no
5270 echores "$_radio"
5271 echocheck "Capture for Radio interface"
5272 echores "$_radio_capture"
5274 echocheck "Video 4 Linux 2 Radio interface"
5275 if test "$_radio_v4l2" = auto ; then
5276 _radio_v4l2=no
5277 if test "$_radio" = yes && linux ; then
5278 header_check linux/videodev2.h && _radio_v4l2=yes
5281 if test "$_radio_v4l2" = yes ; then
5282 def_radio_v4l2='#define CONFIG_RADIO_V4L2 1'
5283 else
5284 def_radio_v4l2='#undef CONFIG_RADIO_V4L2'
5286 echores "$_radio_v4l2"
5288 echocheck "Video 4 Linux Radio interface"
5289 if test "$_radio_v4l" = auto ; then
5290 _radio_v4l=no
5291 if test "$_radio" = yes && linux ; then
5292 header_check linux/videodev.h && _radio_v4l=yes
5295 if test "$_radio_v4l" = yes ; then
5296 def_radio_v4l='#define CONFIG_RADIO_V4L 1'
5297 else
5298 def_radio_v4l='#undef CONFIG_RADIO_V4L'
5300 echores "$_radio_v4l"
5302 if freebsd || netbsd || openbsd || dragonfly || bsdos &&
5303 test "$_radio" = yes && test "$_radio_bsdbt848" = auto ; then
5304 echocheck "*BSD BrookTree 848 Radio interface"
5305 _radio_bsdbt848=no
5306 cat > $TMPC <<EOF
5307 #include <sys/types.h>
5308 $def_ioctl_bt848_h_name
5309 #ifdef IOCTL_BT848_H_NAME
5310 #include IOCTL_BT848_H_NAME
5311 #endif
5312 int main(void) { ioctl(0, RADIO_GETFREQ, 0); return 0; }
5314 cc_check && _radio_bsdbt848=yes
5315 echores "$_radio_bsdbt848"
5316 fi #if freebsd || netbsd || openbsd || dragonfly || bsdos && _radio && _radio_bsdbt848
5318 if test "$_radio_bsdbt848" = yes ; then
5319 def_radio_bsdbt848='#define CONFIG_RADIO_BSDBT848 1'
5320 else
5321 def_radio_bsdbt848='#undef CONFIG_RADIO_BSDBT848'
5324 if test "$_radio_v4l" = no && test "$_radio_v4l2" = no &&
5325 test "$_radio_bsdbt848" = no && test "$_radio" = yes ; then
5326 die "Radio driver requires BSD BT848, V4L or V4L2!"
5329 echocheck "Video 4 Linux 2 MPEG PVR interface"
5330 if test "$_pvr" = auto ; then
5331 _pvr=no
5332 if test "$_tv_v4l2" = yes && linux ; then
5333 cat > $TMPC <<EOF
5334 #include <sys/time.h>
5335 #include <linux/videodev2.h>
5336 int main(void) { struct v4l2_ext_controls ext; return ext.controls->value; }
5338 cc_check && _pvr=yes
5341 if test "$_pvr" = yes ; then
5342 def_pvr='#define CONFIG_PVR 1'
5343 inputmodules="pvr $inputmodules"
5344 else
5345 noinputmodules="pvr $noinputmodules"
5346 def_pvr='#undef CONFIG_PVR'
5348 echores "$_pvr"
5351 echocheck "ftp"
5352 if test "$_ftp" = "auto" ; then
5353 test "$networking" = "yes" && ! beos && _ftp=yes
5355 if test "$_ftp" = yes ; then
5356 def_ftp='#define CONFIG_FTP 1'
5357 inputmodules="ftp $inputmodules"
5358 else
5359 noinputmodules="ftp $noinputmodules"
5360 def_ftp='#undef CONFIG_FTP'
5362 echores "$_ftp"
5364 echocheck "vstream client"
5365 if test "$_vstream" = auto ; then
5366 _vstream=no
5367 cat > $TMPC <<EOF
5368 #include <vstream-client.h>
5369 void vstream_error(const char *format, ... ) {}
5370 int main(void) { vstream_start(); return 0; }
5372 cc_check -lvstream-client && _vstream=yes
5374 if test "$_vstream" = yes ; then
5375 def_vstream='#define CONFIG_VSTREAM 1'
5376 inputmodules="vstream $inputmodules"
5377 extra_ldflags="$extra_ldflags -lvstream-client"
5378 else
5379 noinputmodules="vstream $noinputmodules"
5380 def_vstream='#undef CONFIG_VSTREAM'
5382 echores "$_vstream"
5385 echocheck "XMMS inputplugin support"
5386 if test "$_xmms" = yes ; then
5387 if ( xmms-config --version ) >/dev/null 2>&1 ; then
5388 _xmmsplugindir=$(xmms-config --input-plugin-dir)
5389 _xmmslibdir=$(xmms-config --exec-prefix)/lib
5390 else
5391 _xmmsplugindir=/usr/lib/xmms/Input
5392 _xmmslibdir=/usr/lib
5395 def_xmms='#define CONFIG_XMMS 1'
5396 if darwin ; then
5397 extra_ldflags="$extra_ldflags ${_xmmslibdir}/libxmms.dylib"
5398 else
5399 extra_ldflags="$extra_ldflags ${_xmmslibdir}/libxmms.so.1 -export-dynamic"
5401 else
5402 def_xmms='#undef CONFIG_XMMS'
5404 echores "$_xmms"
5406 if test "$_charset" != "noconv" ; then
5407 def_charset="#define MSG_CHARSET \"$_charset\""
5408 else
5409 def_charset="#undef MSG_CHARSET"
5410 _charset="UTF-8"
5413 #############################################################################
5415 echocheck "automatic gdb attach"
5416 if test "$_crash_debug" = yes ; then
5417 def_crash_debug='#define CONFIG_CRASH_DEBUG 1'
5418 else
5419 def_crash_debug='#undef CONFIG_CRASH_DEBUG'
5420 _crash_debug=no
5422 echores "$_crash_debug"
5424 echocheck "compiler support for noexecstack"
5425 if cflag_check -Wl,-z,noexecstack ; then
5426 extra_ldflags="-Wl,-z,noexecstack $extra_ldflags"
5427 echores "yes"
5428 else
5429 echores "no"
5432 echocheck "linker support for --nxcompat --no-seh --dynamicbase"
5433 if cflag_check "-Wl,--nxcompat -Wl,--no-seh -Wl,--dynamicbase" ; then
5434 extra_ldflags="-Wl,--nxcompat -Wl,--no-seh -Wl,--dynamicbase $extra_ldflags"
5435 echores "yes"
5436 else
5437 echores "no"
5441 # Dynamic linking flags
5442 # (FIXME: 'echocheck "dynamic linking"' above and modify here accordingly)
5443 _ld_dl_dynamic=''
5444 freebsd || netbsd || openbsd || dragonfly || bsdos && _ld_dl_dynamic='-rdynamic'
5445 if test "$_real" = yes || test "$_xanim" = yes && ! win32 && ! qnx && ! darwin ; then
5446 _ld_dl_dynamic='-rdynamic'
5449 extra_ldflags="$extra_ldflags $_ld_pthread $_ld_dl $_ld_dl_dynamic"
5450 bsdos && extra_ldflags="$extra_ldflags -ldvd"
5451 (netbsd || openbsd) && x86_32 && extra_ldflags="$extra_ldflags -li386"
5453 def_debug='#undef MP_DEBUG'
5454 test "$_debug" != "" && def_debug='#define MP_DEBUG 1'
5457 echocheck "joystick"
5458 def_joystick='#undef CONFIG_JOYSTICK'
5459 if test "$_joystick" = yes ; then
5460 if linux || freebsd ; then
5461 # TODO add some check
5462 def_joystick='#define CONFIG_JOYSTICK 1'
5463 else
5464 _joystick="no"
5465 res_comment="unsupported under $system_name"
5468 echores "$_joystick"
5470 echocheck "lirc"
5471 if test "$_lirc" = auto ; then
5472 _lirc=no
5473 header_check lirc/lirc_client.h -llirc_client && _lirc=yes
5475 if test "$_lirc" = yes ; then
5476 def_lirc='#define CONFIG_LIRC 1'
5477 libs_mplayer="$libs_mplayer -llirc_client"
5478 else
5479 def_lirc='#undef CONFIG_LIRC'
5481 echores "$_lirc"
5483 echocheck "lircc"
5484 if test "$_lircc" = auto ; then
5485 _lircc=no
5486 header_check lirc/lircc.h -llircc && _lircc=yes
5488 if test "$_lircc" = yes ; then
5489 def_lircc='#define CONFIG_LIRCC 1'
5490 libs_mplayer="$libs_mplayer -llircc"
5491 else
5492 def_lircc='#undef CONFIG_LIRCC'
5494 echores "$_lircc"
5496 #############################################################################
5498 CFLAGS="$CFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE"
5500 # This must be the last test to be performed. Any other tests following it
5501 # could fail due to linker errors. libdvdnavmini is intentionally not linked
5502 # against libdvdread (to permit MPlayer to use its own copy of the library).
5503 # So any compilation using the flags added here but not linking against
5504 # libdvdread can fail.
5505 echocheck "DVD support (libdvdnav)"
5506 if test "$_dvdread_internal" = yes && test ! -f "libdvdnav/dvdnav.c" ; then
5507 _dvdnav=no
5509 dvdnav_internal=no
5510 if test "$_dvdnav" = auto ; then
5511 if test "$_dvdread_internal" = yes ; then
5512 _dvdnav=yes
5513 dvdnav_internal=yes
5514 res_comment="internal"
5515 else
5516 $_dvdnavconfig --version --minilibs >> $TMPLOG 2>&1 || _dvdnav=no
5519 if test "$_dvdnav" = auto ; then
5520 _dvdnav=no
5521 _dvdnavdir=$($_dvdnavconfig --cflags)
5522 _dvdnavlibs=$($_dvdnavconfig --libs)
5523 statement_check_broken stdint.h dvdnav/dvdnav.h 'dvdnav_t *dvd = 0' $_dvdnavdir $_dvdnavlibs $_ld_dl $_ld_pthread && _dvdnav=yes
5525 if test "$_dvdnav" = yes ; then
5526 def_dvdnav='#define CONFIG_DVDNAV 1'
5527 if test "$dvdnav_internal" = yes ; then
5528 cflags_libdvdnav="-Ilibdvdnav"
5529 inputmodules="dvdnav(internal) $inputmodules"
5530 else
5531 extra_cflags="$extra_cflags $($_dvdnavconfig --cflags)"
5532 extra_ldflags="$extra_ldflags $($_dvdnavconfig --minilibs)"
5533 inputmodules="dvdnav $inputmodules"
5535 else
5536 def_dvdnav='#undef CONFIG_DVDNAV'
5537 noinputmodules="dvdnav $noinputmodules"
5539 echores "$_dvdnav"
5541 # DO NOT ADD ANY TESTS THAT USE LINKER FLAGS HERE (like cc_check).
5542 # Read dvdnav comment above.
5544 mak_enable () {
5545 list=$(echo $1 | tr '[a-z]' '[A-Z]')
5546 item=$(echo $2 | tr '[a-z]' '[A-Z]')
5547 nprefix=$3;
5548 for part in $list; do
5549 if $(echo $item | grep -q -E "(^| )$part($| )"); then
5550 echo "${nprefix}_$part = yes"
5552 done
5555 #############################################################################
5556 echo "Creating config.mak"
5557 cat > config.mak << EOF
5558 # -------- Generated by configure -----------
5560 # Ensure that locale settings do not interfere with shell commands.
5561 export LC_ALL = C
5563 CONFIGURATION = $configuration
5565 CHARSET = $_charset
5566 DOC_LANGS = $language_doc
5567 DOC_LANG_ALL = $doc_lang_all
5568 MAN_LANGS = $language_man
5569 MAN_LANG_ALL = $man_lang_all
5570 MSG_LANGS = $language_msg
5571 MSG_LANG_ALL = $msg_lang_all
5573 prefix = \$(DESTDIR)$_prefix
5574 BINDIR = \$(DESTDIR)$_bindir
5575 LIBDIR = \$(DESTDIR)$_libdir
5576 MANDIR = \$(DESTDIR)$_mandir
5577 CONFDIR = \$(DESTDIR)$_confdir
5578 LOCALEDIR = \$(DESTDIR)$_localedir
5580 AR = $_ar
5581 AS = $_cc
5582 CC = $_cc
5583 INSTALL = $_install
5584 INSTALLSTRIP = $_install_strip
5585 WINDRES = $_windres
5587 CFLAGS = $WARNFLAGS $ERRORFLAGS $WARN_CFLAGS $CFLAGS $extra_cflags
5588 DEPFLAGS = $DEPFLAGS
5590 CFLAGS_LIBDVDCSS = $cflags_libdvdcss
5591 CFLAGS_LIBDVDCSS_DVDREAD = $cflags_libdvdcss_dvdread
5592 CFLAGS_LIBDVDNAV = $cflags_libdvdnav
5593 CFLAGS_NO_OMIT_LEAF_FRAME_POINTER = $cflags_no_omit_leaf_frame_pointer
5594 CFLAGS_STACKREALIGN = $cflags_stackrealign
5596 EXTRALIBS = $extra_ldflags $_ld_static $_ld_lm $extra_libs
5597 EXTRALIBS_MPLAYER = $libs_mplayer
5599 GETCH = $_getch
5600 TIMER = $_timer
5601 RST2MAN = $_rst2man
5603 EXESUF = $_exesuf
5604 EXESUFS_ALL = .exe
5606 ARCH = $arch
5607 $(mak_enable "$arch_all" "$arch" ARCH)
5608 $(mak_enable "$subarch_all" "$subarch" ARCH)
5609 $(mak_enable "$cpuexts_all" "$cpuexts" HAVE)
5611 NEED_GETTIMEOFDAY = $need_gettimeofday
5612 NEED_GLOB = $need_glob
5613 NEED_SETENV = $need_setenv
5614 NEED_SHMEM = $need_shmem
5615 NEED_STRSEP = $need_strsep
5616 NEED_SWAB = $need_swab
5617 NEED_VSSCANF = $need_vsscanf
5619 # features
5620 ALSA = $_alsa
5621 APPLE_IR = $_apple_ir
5622 APPLE_REMOTE = $_apple_remote
5623 AUDIO_INPUT = $_audio_input
5624 CACA = $_caca
5625 CDDA = $_cdda
5626 CDDB = $_cddb
5627 COCOA = $_cocoa
5628 COREAUDIO = $_coreaudio
5629 COREVIDEO = $_corevideo
5630 SHAREDBUFFER = $_sharedbuffer
5631 DIRECT3D = $_direct3d
5632 DIRECTFB = $_directfb
5633 DIRECTX = $_directx
5634 DVBIN = $_dvbin
5635 DVDNAV = $_dvdnav
5636 DVDNAV_INTERNAL = $dvdnav_internal
5637 DVDREAD = $_dvdread
5638 DVDREAD_INTERNAL = $_dvdread_internal
5639 DXR3 = $_dxr3
5640 FAAD = $_faad
5641 FASTMEMCPY = $_fastmemcpy
5642 FTP = $_ftp
5643 GIF = $_gif
5644 GL = $_gl
5645 GL_COCOA = $_gl_cocoa
5646 GL_WIN32 = $_gl_win32
5647 GL_X11 = $_gl_x11
5648 GL_SDL = $_gl_sdl
5649 HAVE_POSIX_SELECT = $_posix_select
5650 HAVE_SYS_MMAN_H = $_mman
5651 JACK = $_jack
5652 JOYSTICK = $_joystick
5653 JPEG = $_jpeg
5654 LADSPA = $_ladspa
5655 LIBA52 = $_liba52
5656 LIBASS = $_ass
5657 LIBBLURAY = $_bluray
5658 LIBBS2B = $_libbs2b
5659 LIBDCA = $_libdca
5660 LIBDV = $_libdv
5661 LIBDVDCSS_INTERNAL = $_libdvdcss_internal
5662 LIBMAD = $_mad
5663 LCMS2 = $_lcms2
5664 LIBNUT = $_libnut
5665 LIBPOSTPROC = $libpostproc
5666 LIBAVRESAMPLE = $libavresample
5667 LIBSMBCLIENT = $_smb
5668 LIBQUVI = $_libquvi
5669 LIBTHEORA = $_theora
5670 LIRC = $_lirc
5671 MACOSX_FINDER = $_macosx_finder
5672 MD5SUM = $_md5sum
5673 MNG = $_mng
5674 MPG123 = $_mpg123
5675 MUSEPACK = $_musepack
5676 NETWORKING = $networking
5677 OPENAL = $_openal
5678 OSS = $_ossaudio
5679 PE_EXECUTABLE = $_pe_executable
5680 PNG = $_png
5681 PNM = $_pnm
5682 PRIORITY = $_priority
5683 PULSE = $_pulse
5684 PORTAUDIO = $_portaudio
5685 PVR = $_pvr
5686 QTX_CODECS = $_qtx
5687 QTX_CODECS_WIN32 = $_qtx_codecs_win32
5688 QTX_EMULATION = $_qtx_emulation
5689 RADIO=$_radio
5690 RADIO_CAPTURE=$_radio_capture
5691 REAL_CODECS = $_real
5692 RSOUND = $_rsound
5693 SDL = $_sdl
5694 SPEEX = $_speex
5695 STREAM_CACHE = $_stream_cache
5696 TGA = $_tga
5697 TV = $_tv
5698 TV_BSDBT848 = $_tv_bsdbt848
5699 TV_DSHOW = $_tv_dshow
5700 TV_V4L = $_tv_v4l
5701 TV_V4L1 = $_tv_v4l1
5702 TV_V4L2 = $_tv_v4l2
5703 UNRAR_EXEC = $_unrar_exec
5704 V4L2 = $_v4l2
5705 VCD = $_vcd
5706 VDPAU = $_vdpau
5707 VORBIS = $_vorbis
5708 VSTREAM = $_vstream
5709 WIN32DLL = $_win32dll
5710 WIN32_EMULATION = $_win32_emulation
5711 X11 = $_x11
5712 XANIM_CODECS = $_xanim
5713 XMMS_PLUGINS = $_xmms
5714 XV = $_xv
5715 XVID4 = $_xvid
5716 YUV4MPEG = $_yuv4mpeg
5718 # FFmpeg
5719 FFMPEG_INTERNALS = $ffmpeg_internals
5720 FFMPEG_SOURCE_PATH = $_ffmpeg_source
5722 RANLIB = $_ranlib
5723 YASM = $_yasm
5724 YASMFLAGS = $YASMFLAGS
5726 CONFIG_VDPAU = $_vdpau
5727 CONFIG_ZLIB = $_zlib
5729 HAVE_PTHREADS = $_pthreads
5730 HAVE_SHM = $_shm
5731 HAVE_W32THREADS = $_w32threads
5732 HAVE_YASM = $have_yasm
5736 #############################################################################
5738 ff_config_enable () {
5739 list=$(echo $1 | tr '[a-z]' '[A-Z]')
5740 item=$(echo $2 | tr '[a-z]' '[A-Z]')
5741 _nprefix=$3;
5742 test -z "$_nprefix" && _nprefix='CONFIG'
5743 for part in $list; do
5744 if $(echo $item | grep -q -E "(^| )$part($| )"); then
5745 echo "#define ${_nprefix}_$part 1"
5746 else
5747 echo "#define ${_nprefix}_$part 0"
5749 done
5752 echo "Creating config.h"
5753 cat > $TMPH << EOF
5754 /*----------------------------------------------------------------------------
5755 ** This file has been automatically generated by configure any changes in it
5756 ** will be lost when you run configure again.
5757 ** Instead of modifying definitions here, use the --enable/--disable options
5758 ** of the configure script! See ./configure --help for details.
5759 *---------------------------------------------------------------------------*/
5761 #ifndef MPLAYER_CONFIG_H
5762 #define MPLAYER_CONFIG_H
5764 #define CONFIGURATION "$configuration"
5766 #define MPLAYER_CONFDIR "$_confdir"
5767 #define MPLAYER_LOCALEDIR "$_localedir"
5769 $def_translation
5771 /* definitions needed by included libraries */
5772 #define HAVE_INTTYPES_H 1
5773 /* libdvdcss */
5774 #define HAVE_ERRNO_H 1
5775 /* libdvdcss + libdvdread */
5776 #define HAVE_LIMITS_H 1
5777 /* libdvdcss */
5778 #define HAVE_UNISTD_H 1
5779 /* libdvdread */
5780 #define STDC_HEADERS 1
5781 #define HAVE_MEMCPY 1
5782 /* libdvdnav */
5783 #define READ_CACHE_TRACE 0
5784 /* libdvdread */
5785 #define HAVE_DLFCN_H 1
5786 $def_dvdcss
5789 /* system headers */
5790 $def_alloca_h
5791 $def_altivec_h
5792 $def_malloc_h
5793 $def_mman_h
5794 $def_mman_has_map_failed
5795 $def_soundcard_h
5796 $def_sys_soundcard_h
5797 $def_sys_sysinfo_h
5798 $def_sys_videoio_h
5799 $def_termios_h
5800 $def_termios_sys_h
5801 $def_winsock2_h
5804 /* system functions */
5805 $def_gethostbyname2
5806 $def_gettimeofday
5807 $def_glob
5808 $def_langinfo
5809 $def_lrintf
5810 $def_map_memalign
5811 $def_memalign
5812 $def_nanosleep
5813 $def_posix_select
5814 $def_select
5815 $def_setenv
5816 $def_setmode
5817 $def_shm
5818 $def_strsep
5819 $def_swab
5820 $def_sysi86
5821 $def_sysi86_iv
5822 $def_termcap
5823 $def_termios
5824 $def_vsscanf
5827 /* system-specific features */
5828 $def_asmalign_pot
5829 $def_builtin_expect
5830 $def_dl
5831 $def_dos_paths
5832 $def_extern_asm
5833 $def_extern_prefix
5834 $def_iconv
5835 $def_kstat
5836 $def_macosx_bundle
5837 $def_macosx_finder
5838 $def_priority
5839 $def_quicktime
5840 $def_restrict_keyword
5841 $def_rtc
5842 $def_unrar_exec
5845 /* configurable options */
5846 $def_charset
5847 $def_crash_debug
5848 $def_debug
5849 $def_fastmemcpy
5850 $def_runtime_cpudetection
5851 $def_sighandler
5852 $def_stream_cache
5853 $def_pthread_cache
5856 /* CPU stuff */
5857 #define __CPU__ $iproc
5858 $def_ebx_available
5859 $def_words_endian
5860 $def_bigendian
5861 $(ff_config_enable "$arch_all" "$arch" "ARCH")
5862 $(ff_config_enable "$subarch_all" "$subarch" "ARCH")
5863 $(ff_config_enable "$cpuexts_all" "$cpuexts" "HAVE")
5866 /* Blu-ray/DVD/VCD/CD */
5867 #define DEFAULT_CDROM_DEVICE "$default_cdrom_device"
5868 #define DEFAULT_DVD_DEVICE "$default_dvd_device"
5869 $def_bluray
5870 $def_bsdi_dvd
5871 $def_cdda
5872 $def_cddb
5873 $def_cdio
5874 $def_cdrom
5875 $def_dvd
5876 $def_dvd_bsd
5877 $def_dvd_darwin
5878 $def_dvd_linux
5879 $def_dvd_openbsd
5880 $def_dvdio
5881 $def_dvdnav
5882 $def_dvdread
5883 $def_hpux_scsi_h
5884 $def_sol_scsi_h
5885 $def_vcd
5888 /* codec libraries */
5889 $def_faad
5890 $def_liba52
5891 $def_libdca
5892 $def_libdv
5893 $def_mad
5894 $def_mpg123
5895 $def_musepack
5896 $def_speex
5897 $def_theora
5898 $def_tremor
5899 $def_vorbis
5900 $def_xvid
5901 $def_zlib
5903 $def_libpostproc
5904 $def_libavresample
5905 $def_libnut
5908 /* binary codecs */
5909 $def_qtx
5910 $def_qtx_win32
5911 $def_real
5912 $def_win32_loader
5913 $def_win32dll
5914 $def_xanim
5915 $def_xmms
5916 #define BINARY_CODECS_PATH "$_codecsdir"
5917 #define XMMS_INPUT_PLUGIN_DIR "$_xmmsplugindir"
5920 /* Audio output drivers */
5921 $def_alsa
5922 $def_coreaudio
5923 $def_jack
5924 $def_openal
5925 $def_openal_h
5926 $def_ossaudio
5927 $def_ossaudio_devdsp
5928 $def_ossaudio_devmixer
5929 $def_pulse
5930 $def_portaudio
5931 $def_rsound
5933 $def_ladspa
5934 $def_libbs2b
5937 /* input */
5938 $def_apple_ir
5939 $def_apple_remote
5940 $def_ioctl_bt848_h_name
5941 $def_ioctl_meteor_h_name
5942 $def_joystick
5943 $def_lirc
5944 $def_lircc
5945 $def_pvr
5946 $def_radio
5947 $def_radio_bsdbt848
5948 $def_radio_capture
5949 $def_radio_v4l
5950 $def_radio_v4l2
5951 $def_tv
5952 $def_tv_bsdbt848
5953 $def_tv_dshow
5954 $def_tv_v4l
5955 $def_tv_v4l1
5956 $def_tv_v4l2
5959 /* font stuff */
5960 $def_ass
5961 $def_enca
5963 /* networking */
5964 $def_closesocket
5965 $def_ftp
5966 $def_inet6
5967 $def_inet_aton
5968 $def_inet_pton
5969 $def_networking
5970 $def_smb
5971 $def_libquvi
5972 $def_socklen_t
5973 $def_vstream
5975 $def_lcms2
5978 /* libvo options */
5979 $def_caca
5980 $def_corevideo
5981 $def_cocoa
5982 $def_sharedbuffer
5983 $def_direct3d
5984 $def_directfb
5985 $def_directx
5986 $def_dvbin
5987 $def_gif
5988 $def_gif_4
5989 $def_gif_tvt_hack
5990 $def_gl
5991 $def_gl_cocoa
5992 $def_gl_win32
5993 $def_gl_x11
5994 $def_gl_sdl
5995 $def_jpeg
5996 $def_md5sum
5997 $def_mng
5998 $def_png
5999 $def_pnm
6000 $def_sdl
6001 $def_sdl_sdl_h
6002 $def_tga
6003 $def_v4l2
6004 $def_vdpau
6005 $def_vm
6006 $def_x11
6007 $def_xdpms
6008 $def_xf86keysym
6009 $def_xinerama
6010 $def_xss
6011 $def_xv
6012 $def_yuv4mpeg
6015 /* FFmpeg */
6016 $def_ffmpeg_internals
6018 $def_arpa_inet_h
6019 $def_bswap
6020 $def_dcbzl
6021 $def_exp2
6022 $def_exp2f
6023 $def_fast_64bit
6024 $def_fast_unaligned
6025 $def_llrint
6026 $def_log2
6027 $def_log2f
6028 $def_lrint
6029 $def_memalign_hack
6030 $def_mkstemp
6031 $def_posix_memalign
6032 $def_pthreads
6033 $def_round
6034 $def_roundf
6035 $def_threads
6036 $def_truncf
6037 $def_xform_asm
6038 $def_yasm
6040 #define HAVE_INLINE_ASM 1
6042 /* Use these registers in x86 inline asm. No proper detection yet. */
6043 #define HAVE_EBP_AVAILABLE 1
6045 #endif /* MPLAYER_CONFIG_H */
6048 # Do not overwrite an unchanged config.h to avoid superfluous rebuilds.
6049 cmp -s "$TMPH" config.h || mv -f "$TMPH" config.h
6051 #############################################################################
6053 cat << EOF
6055 Config files successfully generated by ./configure $configuration !
6057 Install prefix: $_prefix
6058 Config direct.: $_confdir
6060 Byte order: $_byte_order
6061 Optimizing for: $_optimizing
6063 Languages:
6064 Messages (in addition to English): $language_msg
6065 Manual pages: $language_man
6066 Documentation: $language_doc
6068 Enabled optional drivers:
6069 Input: $inputmodules
6070 Codecs: $codecmodules
6071 Audio output: $aomodules
6072 Video output: $vomodules
6074 Disabled optional drivers:
6075 Input: $noinputmodules
6076 Codecs: $nocodecmodules
6077 Audio output: $noaomodules
6078 Video output: $novomodules
6080 'config.h' and 'config.mak' contain your configuration options.
6081 Note: If you alter theses files (for instance CFLAGS) MPlayer may no longer
6082 compile *** DO NOT REPORT BUGS if you tweak these files ***
6084 'make' will now compile MPlayer and 'make install' will install it.
6085 Note: On non-Linux systems you might need to use 'gmake' instead of 'make'.
6090 cat <<EOF
6091 Check $TMPLOG if you wonder why an autodetection failed (make sure
6092 development headers/packages are installed).
6094 NOTE: The --enable-* parameters unconditionally force options on, completely
6095 skipping autodetection. This behavior is unlike what you may be used to from
6096 autoconf-based configure scripts that can decide to override you. This greater
6097 level of control comes at a price. You may have to provide the correct compiler
6098 and linker flags yourself.
6099 If you used one of these options (except --enable-runtime-cpudetection and
6100 similar ones that turn on internal features) and experience a compilation or
6101 linking failure, make sure you have passed the necessary compiler/linker flags
6102 to configure.
6104 If you suspect a bug, please read DOCS/HTML/$language_doc/bugreports.html.
6108 if test "$warn_cflags" = yes; then
6109 cat <<EOF
6111 MPlayer compilation will use the CPPFLAGS/CFLAGS/LDFLAGS/YASMFLAGS set by you,
6112 but:
6114 *** *** DO NOT REPORT BUGS IF IT DOES NOT COMPILE/WORK! *** ***
6116 It is strongly recommended to let MPlayer choose the correct CFLAGS!
6117 To do so, execute 'CFLAGS= ./configure <options>'
6122 # Last move:
6123 rm -rf "$mplayer_tmpdir"