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
41 # Store the configure line that was used
44 # Prefer these macros to full length text !
45 # These macros only return an error code - NO display is done
50 cat "$source" >> "$TMPLOG"
52 echo "$_cc $WARNFLAGS $WARN_CFLAGS $CFLAGS $source $extra_cflags $_ld_static $extra_ldflags $libs_mplayer -o $TMPEXE $@" >> "$TMPLOG"
54 $_cc $WARNFLAGS $WARN_CFLAGS $CFLAGS "$source" $extra_cflags $_ld_static $extra_ldflags $libs_mplayer -o "$TMPEXE" "$@" >> "$TMPLOG" 2>&1
62 compile_check
$TMPC $@
66 compile_check
$TMPCPP $@
-lstdc++
71 int main(void) { return 0; }
73 compile_check
$TMPC $@
79 int main(void) { return 0; }
82 compile_check
$TMPC $@
88 int main(void) { return $2; }
91 compile_check
$TMPC $@
97 int main(void) { $2; return 0; }
101 compile_check
$TMPC $@
104 define_statement_check
() {
108 int main(void) { $3; return 0; }
111 compile_check
$TMPC $@
114 return_statement_check
() {
117 int main(void) { $2; return $3; }
120 compile_check
$TMPC $@
125 int main(void) { __asm__ volatile ($1); return 0; }
128 compile_check
$TMPC $@
131 # The following checks are special and should only be used with broken and
132 # non-selfsufficient headers that do not include all of their dependencies.
134 header_check_broken
() {
138 int main(void) { return 0; }
142 compile_check
$TMPC $@
145 statement_check_broken
() {
149 int main(void) { $3; return 0; }
152 compile_check
$TMPC $@
157 cat "$TMPS" >> "$TMPLOG"
159 echo "$_yasm $YASMFLAGS -o $TMPEXE $TMPS $@" >> "$TMPLOG"
161 $_yasm $YASMFLAGS -o "$TMPEXE" "$TMPS" "$@" >> "$TMPLOG" 2>&1
169 unset IFS
# shell should not be used for programming
171 echo "$_pkg_config --cflags $@" >> "$TMPLOG"
172 ctmp
=$
($_pkg_config --cflags "$@" 2>> "$TMPLOG") ||
return $?
174 echo "$_pkg_config --libs $@" >> "$TMPLOG"
175 ltmp
=$
($_pkg_config --libs "$@" 2>> "$TMPLOG") ||
return $?
177 echo "cflags: $ctmp" >> "$TMPLOG"
178 echo "libs: $ltmp" >> "$TMPLOG"
180 extra_cflags
="$extra_cflags $ctmp"
181 extra_ldflags
="$extra_ldflags $ltmp"
185 "$TMPEXE" >> "$TMPLOG" 2>&1
188 # Display error message, flushes tempfile, exit
193 rm -f "$TMPEXE" "$TMPC" "$TMPS" "$TMPCPP"
194 echo "Check \"$TMPLOG\" if you do not understand why it failed."
198 # OS test booleans functions
200 test "$(echo $system_name | tr A-Z a-z)" = "$(echo $1 | tr A-Z a-z)"
202 aix
() { issystem
"AIX"; }
203 amigaos
() { issystem
"AmigaOS"; }
204 beos
() { issystem
"BEOS"; }
205 bsdos
() { issystem
"BSD/OS"; }
206 cygwin
() { issystem
"CYGWIN"; }
207 darwin
() { issystem
"Darwin"; }
208 dragonfly
() { issystem
"DragonFly"; }
209 freebsd
() { issystem
"FreeBSD" || issystem
"GNU/kFreeBSD"; }
210 gnu
() { issystem
"GNU"; }
211 hpux
() { issystem
"HP-UX"; }
212 linux
() { issystem
"Linux"; }
213 mingw32
() { issystem
"MINGW32"; }
214 morphos
() { issystem
"MorphOS"; }
215 netbsd
() { issystem
"NetBSD"; }
216 openbsd
() { issystem
"OpenBSD"; }
217 qnx
() { issystem
"QNX"; }
218 sunos
() { issystem
"SunOS"; }
219 win32
() { cygwin || mingw32
; }
221 # arch test boolean functions
222 # x86/x86pc is used by QNX
225 i
[3-9]86|x86|x86pc|k5|k6|k6-2|k6-3|pentium
*|athlon
*|i586-i686
) return 0 ;;
232 x86_64|amd64
) return 0 ;;
243 ppc|ppc64|powerpc|powerpc64
) return 0;;
262 # Use this before starting a check
264 echo "============ Checking for $@ ============" >> "$TMPLOG"
265 echo ${_echo_n} "Checking for $@ ... ${_echo_c}"
268 # Use this to echo the results of a check
270 if test "$res_comment" ; then
271 res_comment
="($res_comment)"
273 echo "Result is: $@ $res_comment" >> "$TMPLOG"
274 echo "##########################################" >> "$TMPLOG"
276 echo "$@ $res_comment"
279 #############################################################################
281 # Check how echo works in this /bin/sh
283 -n) _echo_n
= _echo_c
='\c' ;; # SysV echo
284 *) _echo_n
='-n ' _echo_c
= ;; # BSD echo
288 ls po
/*.po
>/dev
/null
2>&1 && msg_lang_all
=$
(echo po
/*.po |
sed -e 's:po/\([^[:space:]]*\)\.po:\1:g')
289 man_lang_all
=$
(echo DOCS
/man
/??
/mplayer
.1 DOCS
/man
/??_??
/mplayer
.1 |
sed -e "s:DOCS/man/\(..\)/mplayer.1:\1:g" -e "s:DOCS/man/\(.._..\)/mplayer.1:\1:g")
290 doc_lang_all
=$
(echo DOCS
/xml
/??
/ DOCS
/xml
/??_??
/ |
sed -e "s:DOCS/xml/\(..\)/:\1:g" -e "s:DOCS/xml/\(.._..\)/:\1:g")
294 Usage: $0 [OPTIONS]...
297 -h, --help display this help and exit
299 Installation directories:
300 --prefix=DIR prefix directory for installation [/usr/local]
301 --bindir=DIR directory for installing binaries [PREFIX/bin]
302 --datadir=DIR directory for installing machine independent
303 data files (skins, etc) [PREFIX/share/mplayer]
304 --mandir=DIR directory for installing man pages [PREFIX/share/man]
305 --confdir=DIR directory for installing configuration files
307 --localedir=DIR directory for locale tree [PREFIX/share/locale]
308 --libdir=DIR directory for object code libraries [PREFIX/lib]
309 --codecsdir=DIR directory for binary codecs [LIBDIR/codecs]
312 --disable-mplayer disable MPlayer compilation [enable]
313 --enable-termcap use termcap database for key codes [autodetect]
314 --enable-termios use termios database for key codes [autodetect]
315 --disable-iconv disable iconv for encoding conversion [autodetect]
316 --disable-langinfo do not use langinfo [autodetect]
317 --enable-lirc enable LIRC (remote control) support [autodetect]
318 --enable-lircc enable LIRCCD (LIRC client daemon) input [autodetect]
319 --enable-joystick enable joystick support [disable]
320 --enable-apple-remote enable Apple Remote input (Mac OS X only) [autodetect]
321 --enable-apple-ir enable Apple IR Remote input (Linux only) [autodetect]
322 --disable-vm disable X video mode extensions [autodetect]
323 --disable-xf86keysym disable support for multimedia keys [autodetect]
324 --enable-radio enable radio interface [disable]
325 --enable-radio-capture enable radio capture (through PCI/line-in) [disable]
326 --disable-radio-v4l2 disable Video4Linux2 radio interface [autodetect]
327 --disable-radio-bsdbt848 disable BSD BT848 radio interface [autodetect]
328 --disable-tv disable TV interface (TV/DVB grabbers) [enable]
329 --disable-tv-v4l1 disable Video4Linux TV interface [autodetect]
330 --disable-tv-v4l2 disable Video4Linux2 TV interface [autodetect]
331 --disable-tv-bsdbt848 disable BSD BT848 interface [autodetect]
332 --disable-pvr disable Video4Linux2 MPEG PVR [autodetect]
333 --disable-rtc disable RTC (/dev/rtc) on Linux [autodetect]
334 --disable-networking disable networking [enable]
335 --enable-winsock2_h enable winsock2_h [autodetect]
336 --enable-smb enable Samba (SMB) input [autodetect]
337 --enable-live enable LIVE555 Streaming Media [disable]
338 --enable-nemesi enable Nemesi Streaming Media [autodetect]
339 --disable-vcd disable VCD support [autodetect]
340 --disable-bluray disable Blu-ray support [autodetect]
341 --disable-dvdnav disable libdvdnav [autodetect]
342 --disable-dvdread disable libdvdread [autodetect]
343 --disable-dvdread-internal disable internal libdvdread [autodetect]
344 --disable-libdvdcss-internal disable internal libdvdcss [autodetect]
345 --disable-cddb disable cddb [autodetect]
346 --disable-bitmap-font disable bitmap font support [enable]
347 --disable-freetype disable FreeType 2 font rendering [autodetect]
348 --disable-fontconfig disable fontconfig font lookup [autodetect]
349 --disable-unrarexec disable using of UnRAR executable [enabled]
350 --disable-sortsub disable subtitle sorting [enabled]
351 --enable-fribidi enable the FriBiDi libs [autodetect]
352 --disable-enca disable ENCA charset oracle library [autodetect]
353 --enable-macosx-finder enable Mac OS X Finder invocation parameter
355 --enable-macosx-bundle enable Mac OS X bundle file locations [autodetect]
356 --disable-inet6 disable IPv6 support [autodetect]
357 --disable-gethostbyname2 gethostbyname2 part of the C library [autodetect]
358 --disable-ftp disable FTP support [enabled]
359 --disable-vstream disable TiVo vstream client support [autodetect]
360 --disable-pthreads disable Posix threads support [autodetect]
361 --disable-w32threads disable Win32 threads support [autodetect]
362 --disable-libass disable subtitle rendering with libass [autodetect]
363 --enable-rpath enable runtime linker path for extra libs [disabled]
364 --disable-libpostproc disable postprocess filter (vf_pp) [autodetect]
367 --enable-gif enable GIF support [autodetect]
368 --enable-png enable PNG input/output support [autodetect]
369 --enable-mng enable MNG input support [autodetect]
370 --enable-jpeg enable JPEG input/output support [autodetect]
371 --enable-libcdio enable libcdio support [autodetect]
372 --disable-win32dll disable Win32 DLL support [autodetect]
373 --disable-qtx disable QuickTime codecs support [enabled]
374 --disable-xanim disable XAnim codecs support [enabled]
375 --disable-real disable RealPlayer codecs support [enabled]
376 --disable-xvid disable Xvid [autodetect]
377 --disable-libnut disable libnut [autodetect]
378 --enable-libav skip Libav autodetection [autodetect]
379 --disable-libvorbis disable libvorbis support [autodetect]
380 --disable-tremor disable Tremor [autodetect if no libvorbis]
381 --disable-speex disable Speex support [autodetect]
382 --enable-theora enable OggTheora libraries [autodetect]
383 --enable-faad enable FAAD2 (AAC) [autodetect]
384 --disable-ladspa disable LADSPA plugin support [autodetect]
385 --disable-libbs2b disable libbs2b audio filter support [autodetect]
386 --disable-libdv disable libdv 0.9.5 en/decoding support [autodetect]
387 --disable-mpg123 disable libmpg123 MP3 decoding support [autodetect]
388 --disable-mad disable libmad (MPEG audio) support [autodetect]
389 --enable-xmms enable XMMS input plugin support [disabled]
390 --enable-libdca enable libdca support [autodetect]
391 --disable-liba52 disable liba52 [autodetect]
392 --enable-musepack enable libmpcdec support (deprecated, libavcodec
393 Musepack decoder is preferred) [disabled]
396 --enable-gl enable OpenGL video output [autodetect]
397 --enable-dga2 enable DGA 2 support [autodetect]
398 --enable-dga1 enable DGA 1 support [autodetect]
399 --enable-vesa enable VESA video output [autodetect]
400 --enable-svga enable SVGAlib video output [autodetect]
401 --enable-sdl enable SDL video output [autodetect]
402 --enable-aa enable AAlib video output [autodetect]
403 --enable-caca enable CACA video output [autodetect]
404 --enable-ggi enable GGI video output [autodetect]
405 --enable-ggiwmh enable GGI libggiwmh extension [autodetect]
406 --enable-direct3d enable Direct3D video output [autodetect]
407 --enable-directx enable DirectX video output [autodetect]
408 --enable-dxr3 enable DXR3/H+ video output [autodetect]
409 --enable-ivtv enable IVTV TV-Out video output [autodetect]
410 --enable-v4l2 enable V4L2 Decoder audio/video output [autodetect]
411 --enable-dvb enable DVB video output [autodetect]
412 --enable-mga enable mga_vid video output [autodetect]
413 --enable-xmga enable mga_vid X11 video output [autodetect]
414 --enable-xv enable Xv video output [autodetect]
415 --enable-vdpau enable VDPAU acceleration [autodetect]
416 --enable-vm enable XF86VidMode support [autodetect]
417 --enable-xinerama enable Xinerama support [autodetect]
418 --enable-x11 enable X11 video output [autodetect]
419 --enable-xshape enable XShape support [autodetect]
420 --disable-xss disable screensaver support via xss [autodetect]
421 --enable-fbdev enable FBDev video output [autodetect]
422 --enable-3dfx enable obsolete /dev/3dfx video output [disable]
423 --enable-tdfxfb enable tdfxfb video output [disable]
424 --enable-s3fb enable s3fb (S3 ViRGE) video output [disable]
425 --enable-wii enable Nintendo Wii/GameCube video output [disable]
426 --enable-directfb enable DirectFB video output [autodetect]
427 --enable-bl enable Blinkenlights video output [disable]
428 --enable-tdfxvid enable tdfx_vid video output [disable]
429 --enable-xvr100 enable SUN XVR-100 video output [autodetect]
430 --disable-tga disable Targa video output [enable]
431 --disable-pnm disable PNM video output [enable]
432 --disable-md5sum disable md5sum video output [enable]
433 --disable-yuv4mpeg disable yuv4mpeg video output [enable]
434 --disable-corevideo disable CoreVideo video output [autodetect]
435 --disable-cocoa disable Cocoa OpenGL backend [autodetect]
436 --disable-sharedbuffer disable OSX shared buffer video output [autodetect]
439 --disable-alsa disable ALSA audio output [autodetect]
440 --disable-ossaudio disable OSS audio output [autodetect]
441 --disable-rsound disable RSound audio output [autodetect]
442 --disable-pulse disable Pulseaudio audio output [autodetect]
443 --disable-portaudio disable PortAudio audio output [autodetect]
444 --disable-jack disable JACK audio output [autodetect]
445 --enable-openal enable OpenAL audio output [disable]
446 --disable-nas disable NAS audio output [autodetect]
447 --disable-sunaudio disable Sun audio output [autodetect]
448 --disable-win32waveout disable Windows waveout audio output [autodetect]
449 --disable-coreaudio disable CoreAudio audio output [autodetect]
450 --disable-select disable using select() on the audio device [enable]
453 --enable-translation enable support for translated output [disable]
454 --charset=charset convert the console messages to this character set
455 --language-doc=lang language to use for the documentation [en]
456 --language-man=lang language to use for the man pages [en]
457 --language-msg=lang extra languages for program messages [all]
458 --language=lang default language to use [en]
459 Specific options override --language. You can pass a list of languages separated
460 by whitespace or commas instead of a single language. Nonexisting translations
461 will be dropped from each list. All translations available in the list will be
462 installed. The value "all" will activate all translations. The LINGUAS
463 environment variable is honored. In all cases the fallback is English.
464 The program always supports English-language output; additional message
465 languages are only installed if --enable-translation is also specified.
466 Available values for --language-doc are: all $doc_lang_all
467 Available values for --language-man are: all $man_lang_all
468 Available values for --language-msg are: all $msg_lang_all
470 Miscellaneous options:
471 --enable-runtime-cpudetection enable runtime CPU detection [disable]
472 --enable-cross-compile enable cross-compilation [disable]
473 --cc=COMPILER C compiler to build MPlayer [gcc]
474 --as=ASSEMBLER assembler to build MPlayer [as]
475 --nm=NM nm tool to build MPlayer [nm]
476 --yasm=YASM Yasm assembler to build MPlayer [yasm]
477 --ar=AR librarian to build MPlayer [ar]
478 --pkg-config=PKGCONFIG pkg-config to find some libraries [pkg-config]
479 --ranlib=RANLIB ranlib to build MPlayer [ranlib]
480 --windres=WINDRES windres to build MPlayer [windres]
481 --target=PLATFORM target platform (i386-linux, arm-linux, etc)
482 --enable-static build a statically linked binary
483 --with-install=PATH path to a custom install program
486 --enable-mmx enable MMX [autodetect]
487 --enable-mmxext enable MMX2 (Pentium III, Athlon) [autodetect]
488 --enable-3dnow enable 3DNow! [autodetect]
489 --enable-3dnowext enable extended 3DNow! [autodetect]
490 --enable-sse enable SSE [autodetect]
491 --enable-sse2 enable SSE2 [autodetect]
492 --enable-ssse3 enable SSSE3 [autodetect]
493 --enable-shm enable shm [autodetect]
494 --enable-altivec enable AltiVec (PowerPC) [autodetect]
495 --enable-armv5te enable DSP extensions (ARM) [autodetect]
496 --enable-armv6 enable ARMv6 (ARM) [autodetect]
497 --enable-armv6t2 enable ARMv6t2 (ARM) [autodetect]
498 --enable-armvfp enable ARM VFP (ARM) [autodetect]
499 --enable-neon enable NEON (ARM) [autodetect]
500 --enable-iwmmxt enable iWMMXt (ARM) [autodetect]
501 --disable-fastmemcpy disable 3DNow!/SSE/MMX optimized memcpy [enable]
502 --enable-big-endian force byte order to big-endian [autodetect]
503 --enable-debug[=1-3] compile-in debugging information [disable]
504 --enable-profile compile-in profiling information [disable]
505 --disable-sighandler disable sighandler for crashes [enable]
506 --enable-crash-debug enable automatic gdb attach on crash [disable]
508 Use these options if autodetection fails:
509 --extra-cflags=FLAGS extra CFLAGS
510 --extra-ldflags=FLAGS extra LDFLAGS
511 --extra-libs=FLAGS extra linker flags
512 --extra-libs-mplayer=FLAGS extra linker flags for MPlayer
514 --with-sdl-config=PATH path to sdl*-config
515 --with-dvdnav-config=PATH path to dvdnav-config
516 --with-dvdread-config=PATH path to dvdread-config
518 This configure script is NOT autoconf-based, even though its output is similar.
519 It will try to autodetect all configuration options. If you --enable an option
520 it will be forcefully turned on, skipping autodetection. This can break
521 compilation, so you need to know what you are doing.
526 # GOTCHA: the variables below defines the default behavior for autodetection
527 # and have - unless stated otherwise - at least 2 states : yes no
528 # If autodetection is available then the third state is: auto
552 test "$CC" && _cc
="$CC"
556 _runtime_cpudetection
=no
618 _dvdnavconfig
=dvdnav-config
619 _dvdreadconfig
=dvdread-config
621 _dvdread_internal
=auto
622 _libdvdcss_internal
=auto
708 def_dos_paths
="#define HAVE_DOS_PATHS 0"
709 def_stream_cache
="#define CONFIG_STREAM_CACHE 1"
710 def_priority
="#undef CONFIG_PRIORITY"
711 def_pthread_cache
="#undef PTHREAD_CACHE"
719 _prefix
=$
(echo $ac_option | cut
-d '=' -f 2)
722 _bindir
=$
(echo $ac_option | cut
-d '=' -f 2)
725 _datadir
=$
(echo $ac_option | cut
-d '=' -f 2)
728 _mandir
=$
(echo $ac_option | cut
-d '=' -f 2)
731 _confdir
=$
(echo $ac_option | cut
-d '=' -f 2)
734 _libdir
=$
(echo $ac_option | cut
-d '=' -f 2)
737 _codecsdir
=$
(echo $ac_option | cut
-d '=' -f 2)
740 _localedir
=$
(echo $ac_option | cut
-d '=' -f 2)
744 _install
=$
(echo $ac_option | cut
-d '=' -f 2 )
748 _sdlconfig
=$
(echo $ac_option | cut
-d '=' -f 2)
750 --with-dvdnav-config=*)
751 _dvdnavconfig
=$
(echo $ac_option | cut
-d '=' -f 2)
753 --with-dvdread-config=*)
754 _dvdreadconfig
=$
(echo $ac_option | cut
-d '=' -f 2)
758 extra_cflags
="$extra_cflags $(echo $ac_option | cut -d '=' -f 2-)"
761 extra_ldflags
="$extra_ldflags $(echo $ac_option | cut -d '=' -f 2-)"
764 extra_libs
=$
(echo $ac_option | cut
-d '=' -f 2)
766 --extra-libs-mplayer=*)
767 libs_mplayer
=$
(echo $ac_option | cut
-d '=' -f 2)
771 _target
=$
(echo $ac_option | cut
-d '=' -f 2)
774 _cc
=$
(echo $ac_option | cut
-d '=' -f 2)
777 _as
=$
(echo $ac_option | cut
-d '=' -f 2)
780 _nm
=$
(echo $ac_option | cut
-d '=' -f 2)
783 _yasm
=$
(echo $ac_option | cut
-d '=' -f 2)
786 _ar
=$
(echo $ac_option | cut
-d '=' -f 2)
789 _pkg_config
=$
(echo $ac_option | cut
-d '=' -f 2)
792 _ranlib
=$
(echo $ac_option | cut
-d '=' -f 2)
795 _windres
=$
(echo $ac_option | cut
-d '=' -f 2)
798 _charset
=$
(echo $ac_option | cut
-d '=' -f 2)
801 language_doc
=$
(echo $ac_option | cut
-d '=' -f 2)
804 language_man
=$
(echo $ac_option | cut
-d '=' -f 2)
807 language_msg
=$
(echo $ac_option | cut
-d '=' -f 2)
810 language
=$
(echo $ac_option | cut
-d '=' -f 2)
829 _debug
=$
(echo $_echo_n '-g'$_echo_c; echo $ac_option | cut
-d '=' -f 2)
834 --enable-translation) _translation
=yes ;;
835 --disable-translation) _translation
=no
;;
836 --enable-runtime-cpudetection) _runtime_cpudetection
=yes ;;
837 --disable-runtime-cpudetection) _runtime_cpudetection
=no
;;
838 --enable-cross-compile) _cross_compile
=yes ;;
839 --disable-cross-compile) _cross_compile
=no
;;
840 --enable-mplayer) _mplayer
=yes ;;
841 --disable-mplayer) _mplayer
=no
;;
842 --enable-x11) _x11
=yes ;;
843 --disable-x11) _x11
=no
;;
844 --enable-xshape) _xshape
=yes ;;
845 --disable-xshape) _xshape
=no
;;
846 --enable-xss) _xss
=yes ;;
847 --disable-xss) _xss
=no
;;
848 --enable-xv) _xv
=yes ;;
849 --disable-xv) _xv
=no
;;
850 --enable-vdpau) _vdpau
=yes ;;
851 --disable-vdpau) _vdpau
=no
;;
852 --enable-sdl) _sdl
=yes ;;
853 --disable-sdl) _sdl
=no
;;
854 --enable-direct3d) _direct3d
=yes ;;
855 --disable-direct3d) _direct3d
=no
;;
856 --enable-directx) _directx
=yes ;;
857 --disable-directx) _directx
=no
;;
858 --enable-win32waveout) _win32waveout
=yes ;;
859 --disable-win32waveout) _win32waveout
=no
;;
860 --enable-nas) _nas
=yes ;;
861 --disable-nas) _nas
=no
;;
862 --enable-png) _png
=yes ;;
863 --disable-png) _png
=no
;;
864 --enable-mng) _mng
=yes ;;
865 --disable-mng) _mng
=no
;;
866 --enable-jpeg) _jpeg
=yes ;;
867 --disable-jpeg) _jpeg
=no
;;
868 --enable-pnm) _pnm
=yes ;;
869 --disable-pnm) _pnm
=no
;;
870 --enable-md5sum) _md5sum
=yes ;;
871 --disable-md5sum) _md5sum
=no
;;
872 --enable-yuv4mpeg) _yuv4mpeg
=yes ;;
873 --disable-yuv4mpeg) _yuv4mpeg
=no
;;
874 --enable-gif) _gif
=yes ;;
875 --disable-gif) _gif
=no
;;
876 --enable-gl) _gl
=yes ;;
877 --disable-gl) _gl
=no
;;
878 --enable-ggi) _ggi
=yes ;;
879 --disable-ggi) _ggi
=no
;;
880 --enable-ggiwmh) _ggiwmh
=yes ;;
881 --disable-ggiwmh) _ggiwmh
=no
;;
882 --enable-aa) _aa
=yes ;;
883 --disable-aa) _aa
=no
;;
884 --enable-caca) _caca
=yes ;;
885 --disable-caca) _caca
=no
;;
886 --enable-svga) _svga
=yes ;;
887 --disable-svga) _svga
=no
;;
888 --enable-vesa) _vesa
=yes ;;
889 --disable-vesa) _vesa
=no
;;
890 --enable-fbdev) _fbdev
=yes ;;
891 --disable-fbdev) _fbdev
=no
;;
892 --enable-dvb) _dvb
=yes ;;
893 --disable-dvb) _dvb
=no
;;
894 --enable-dxr3) _dxr3
=yes ;;
895 --disable-dxr3) _dxr3
=no
;;
896 --enable-ivtv) _ivtv
=yes ;;
897 --disable-ivtv) _ivtv
=no
;;
898 --enable-v4l2) _v4l2
=yes ;;
899 --disable-v4l2) _v4l2
=no
;;
900 --enable-iconv) _iconv
=yes ;;
901 --disable-iconv) _iconv
=no
;;
902 --enable-langinfo) _langinfo
=yes ;;
903 --disable-langinfo) _langinfo
=no
;;
904 --enable-rtc) _rtc
=yes ;;
905 --disable-rtc) _rtc
=no
;;
906 --enable-libdv) _libdv
=yes ;;
907 --disable-libdv) _libdv
=no
;;
908 --enable-ossaudio) _ossaudio
=yes ;;
909 --disable-ossaudio) _ossaudio
=no
;;
910 --enable-rsound) _rsound
=yes ;;
911 --disable-rsound) _rsound
=no
;;
912 --enable-pulse) _pulse
=yes ;;
913 --disable-pulse) _pulse
=no
;;
914 --enable-portaudio) _portaudio
=yes ;;
915 --disable-portaudio) _portaudio
=no
;;
916 --enable-jack) _jack
=yes ;;
917 --disable-jack) _jack
=no
;;
918 --enable-openal) _openal
=yes ;;
919 --disable-openal) _openal
=no
;;
920 --enable-mad) _mad
=yes ;;
921 --disable-mad) _mad
=no
;;
922 --enable-libcdio) _libcdio
=yes ;;
923 --disable-libcdio) _libcdio
=no
;;
924 --enable-libvorbis) _libvorbis
=yes ;;
925 --disable-libvorbis) _libvorbis
=no
;;
926 --enable-speex) _speex
=yes ;;
927 --disable-speex) _speex
=no
;;
928 --enable-tremor) _tremor
=yes ;;
929 --disable-tremor) _tremor
=no
;;
930 --enable-theora) _theora
=yes ;;
931 --disable-theora) _theora
=no
;;
932 --enable-mpg123) _mpg123
=yes ;;
933 --disable-mpg123) _mpg123
=no
;;
934 --enable-liba52) _liba52
=yes ;;
935 --disable-liba52) _liba52
=no
;;
936 --enable-libdca) _libdca
=yes ;;
937 --disable-libdca) _libdca
=no
;;
938 --enable-musepack) _musepack
=yes ;;
939 --disable-musepack) _musepack
=no
;;
940 --enable-faad) _faad
=yes ;;
941 --disable-faad) _faad
=no
;;
942 --enable-ladspa) _ladspa
=yes ;;
943 --disable-ladspa) _ladspa
=no
;;
944 --enable-libbs2b) _libbs2b
=yes ;;
945 --disable-libbs2b) _libbs2b
=no
;;
946 --enable-xmms) _xmms
=yes ;;
947 --disable-xmms) _xmms
=no
;;
948 --enable-vcd) _vcd
=yes ;;
949 --disable-vcd) _vcd
=no
;;
950 --enable-bluray) _bluray
=yes ;;
951 --disable-bluray) _bluray
=no
;;
952 --enable-dvdread) _dvdread
=yes ;;
953 --disable-dvdread) _dvdread
=no
;;
954 --enable-dvdread-internal) _dvdread_internal
=yes ;;
955 --disable-dvdread-internal) _dvdread_internal
=no
;;
956 --enable-libdvdcss-internal) _libdvdcss_internal
=yes ;;
957 --disable-libdvdcss-internal) _libdvdcss_internal
=no
;;
958 --enable-dvdnav) _dvdnav
=yes ;;
959 --disable-dvdnav) _dvdnav
=no
;;
960 --enable-xanim) _xanim
=yes ;;
961 --disable-xanim) _xanim
=no
;;
962 --enable-real) _real
=yes ;;
963 --disable-real) _real
=no
;;
964 --enable-live) _live
=yes ;;
965 --disable-live) _live
=no
;;
966 --enable-nemesi) _nemesi
=yes ;;
967 --disable-nemesi) _nemesi
=no
;;
968 --enable-xinerama) _xinerama
=yes ;;
969 --disable-xinerama) _xinerama
=no
;;
970 --enable-mga) _mga
=yes ;;
971 --disable-mga) _mga
=no
;;
972 --enable-xmga) _xmga
=yes ;;
973 --disable-xmga) _xmga
=no
;;
974 --enable-vm) _vm
=yes ;;
975 --disable-vm) _vm
=no
;;
976 --enable-xf86keysym) _xf86keysym
=yes ;;
977 --disable-xf86keysym) _xf86keysym
=no
;;
978 --enable-sunaudio) _sunaudio
=yes ;;
979 --disable-sunaudio) _sunaudio
=no
;;
980 --enable-alsa) _alsa
=yes ;;
981 --disable-alsa) _alsa
=no
;;
982 --enable-tv) _tv
=yes ;;
983 --disable-tv) _tv
=no
;;
984 --enable-tv-bsdbt848) _tv_bsdbt848
=yes ;;
985 --disable-tv-bsdbt848) _tv_bsdbt848
=no
;;
986 --enable-tv-v4l1) _tv_v4l1
=yes ;;
987 --disable-tv-v4l1) _tv_v4l1
=no
;;
988 --enable-tv-v4l2) _tv_v4l2
=yes ;;
989 --disable-tv-v4l2) _tv_v4l2
=no
;;
990 --enable-tv-dshow) _tv_dshow
=yes ;;
991 --disable-tv-dshow) _tv_dshow
=no
;;
992 --enable-radio) _radio
=yes ;;
993 --enable-radio-capture) _radio_capture
=yes ;;
994 --disable-radio-capture) _radio_capture
=no
;;
995 --disable-radio) _radio
=no
;;
996 --enable-radio-v4l) _radio_v4l
=yes ;;
997 --disable-radio-v4l) _radio_v4l
=no
;;
998 --enable-radio-v4l2) _radio_v4l2
=yes ;;
999 --disable-radio-v4l2) _radio_v4l2
=no
;;
1000 --enable-radio-bsdbt848) _radio_bsdbt848
=yes ;;
1001 --disable-radio-bsdbt848) _radio_bsdbt848
=no
;;
1002 --enable-pvr) _pvr
=yes ;;
1003 --disable-pvr) _pvr
=no
;;
1004 --enable-fastmemcpy) _fastmemcpy
=yes ;;
1005 --disable-fastmemcpy) _fastmemcpy
=no
;;
1006 --enable-networking) networking
=yes ;;
1007 --disable-networking) networking
=no
;;
1008 --enable-winsock2_h) _winsock2_h
=yes ;;
1009 --disable-winsock2_h) _winsock2_h
=no
;;
1010 --enable-smb) _smb
=yes ;;
1011 --disable-smb) _smb
=no
;;
1012 --enable-joystick) _joystick
=yes ;;
1013 --disable-joystick) _joystick
=no
;;
1014 --enable-xvid) _xvid
=yes ;;
1015 --disable-xvid) _xvid
=no
;;
1016 --enable-libnut) _libnut
=yes ;;
1017 --disable-libnut) _libnut
=no
;;
1018 --enable-libav) ffmpeg
=yes ;;
1019 --ffmpeg-source-dir=*)
1020 _ffmpeg_source
=$
(echo $ac_option | cut
-d '=' -f 2 ) ;;
1022 --enable-lirc) _lirc
=yes ;;
1023 --disable-lirc) _lirc
=no
;;
1024 --enable-lircc) _lircc
=yes ;;
1025 --disable-lircc) _lircc
=no
;;
1026 --enable-apple-remote) _apple_remote
=yes ;;
1027 --disable-apple-remote) _apple_remote
=no
;;
1028 --enable-apple-ir) _apple_ir
=yes ;;
1029 --disable-apple-ir) _apple_ir
=no
;;
1030 --enable-termcap) _termcap
=yes ;;
1031 --disable-termcap) _termcap
=no
;;
1032 --enable-termios) _termios
=yes ;;
1033 --disable-termios) _termios
=no
;;
1034 --enable-3dfx) _3dfx
=yes ;;
1035 --disable-3dfx) _3dfx
=no
;;
1036 --enable-s3fb) _s3fb
=yes ;;
1037 --disable-s3fb) _s3fb
=no
;;
1038 --enable-wii) _wii
=yes ;;
1039 --disable-wii) _wii
=no
;;
1040 --enable-tdfxfb) _tdfxfb
=yes ;;
1041 --disable-tdfxfb) _tdfxfb
=no
;;
1042 --disable-tdfxvid) _tdfxvid
=no
;;
1043 --enable-tdfxvid) _tdfxvid
=yes ;;
1044 --disable-xvr100) _xvr100
=no
;;
1045 --enable-xvr100) _xvr100
=yes ;;
1046 --disable-tga) _tga
=no
;;
1047 --enable-tga) _tga
=yes ;;
1048 --enable-directfb) _directfb
=yes ;;
1049 --disable-directfb) _directfb
=no
;;
1050 --enable-bl) _bl
=yes ;;
1051 --disable-bl) _bl
=no
;;
1052 --enable-shm) _shm
=yes ;;
1053 --disable-shm) _shm
=no
;;
1054 --enable-select) _select
=yes ;;
1055 --disable-select) _select
=no
;;
1056 --enable-cddb) _cddb
=yes ;;
1057 --disable-cddb) _cddb
=no
;;
1058 --enable-big-endian) _big_endian
=yes ;;
1059 --disable-big-endian) _big_endian
=no
;;
1060 --enable-bitmap-font) _bitmap_font
=yes ;;
1061 --disable-bitmap-font) _bitmap_font
=no
;;
1062 --enable-freetype) _freetype
=yes ;;
1063 --disable-freetype) _freetype
=no
;;
1064 --enable-fontconfig) _fontconfig
=yes ;;
1065 --disable-fontconfig) _fontconfig
=no
;;
1066 --enable-unrarexec) _unrar_exec
=yes ;;
1067 --disable-unrarexec) _unrar_exec
=no
;;
1068 --enable-ftp) _ftp
=yes ;;
1069 --disable-ftp) _ftp
=no
;;
1070 --enable-vstream) _vstream
=yes ;;
1071 --disable-vstream) _vstream
=no
;;
1072 --enable-pthreads) _pthreads
=yes ;;
1073 --disable-pthreads) _pthreads
=no
;;
1074 --enable-w32threads) _w32threads
=yes ;;
1075 --disable-w32threads) _w32threads
=no
;;
1076 --enable-libass) _ass
=yes ;;
1077 --disable-libass) _ass
=no
;;
1078 --enable-rpath) _rpath
=yes ;;
1079 --disable-rpath) _rpath
=no
;;
1080 --enable-libpostproc) libpostproc
=yes ;;
1081 --disable-libpostproc) libpostproc
=no
;;
1083 --enable-fribidi) _fribidi
=yes ;;
1084 --disable-fribidi) _fribidi
=no
;;
1086 --enable-enca) _enca
=yes ;;
1087 --disable-enca) _enca
=no
;;
1089 --enable-inet6) _inet6
=yes ;;
1090 --disable-inet6) _inet6
=no
;;
1092 --enable-gethostbyname2) _gethostbyname2
=yes ;;
1093 --disable-gethostbyname2) _gethostbyname2
=no
;;
1095 --enable-dga1) _dga1
=yes ;;
1096 --disable-dga1) _dga1
=no
;;
1097 --enable-dga2) _dga2
=yes ;;
1098 --disable-dga2) _dga2
=no
;;
1100 --enable-qtx) _qtx
=yes ;;
1101 --disable-qtx) _qtx
=no
;;
1103 --enable-coreaudio) _coreaudio
=yes ;;
1104 --disable-coreaudio) _coreaudio
=no
;;
1105 --enable-corevideo) _corevideo
=yes ;;
1106 --disable-corevideo) _corevideo
=no
;;
1107 --enable-cocoa) _cocoa
=yes ;;
1108 --disable-cocoa) _cocoa
=no
;;
1109 --enable-sharedbuffer) _sharedbuffer
=yes ;;
1110 --disable-sharedbuffer) _sharedbuffer
=no
;;
1111 --enable-macosx-finder) _macosx_finder
=yes ;;
1112 --disable-macosx-finder) _macosx_finder
=no
;;
1113 --enable-macosx-bundle) _macosx_bundle
=yes ;;
1114 --disable-macosx-bundle) _macosx_bundle
=no
;;
1116 --enable-sortsub) _sortsub
=yes ;;
1117 --disable-sortsub) _sortsub
=no
;;
1119 --enable-crash-debug) _crash_debug
=yes ;;
1120 --disable-crash-debug) _crash_debug
=no
;;
1121 --enable-sighandler) _sighandler
=yes ;;
1122 --disable-sighandler) _sighandler
=no
;;
1123 --enable-win32dll) _win32dll
=yes ;;
1124 --disable-win32dll) _win32dll
=no
;;
1126 --enable-sse) _sse
=yes ;;
1127 --disable-sse) _sse
=no
;;
1128 --enable-sse2) _sse2
=yes ;;
1129 --disable-sse2) _sse2
=no
;;
1130 --enable-ssse3) _ssse3
=yes ;;
1131 --disable-ssse3) _ssse3
=no
;;
1132 --enable-mmxext) _mmxext
=yes ;;
1133 --disable-mmxext) _mmxext
=no
;;
1134 --enable-3dnow) _3dnow
=yes ;;
1135 --disable-3dnow) _3dnow
=no _3dnowext
=no
;;
1136 --enable-3dnowext) _3dnow
=yes _3dnowext
=yes ;;
1137 --disable-3dnowext) _3dnowext
=no
;;
1138 --enable-cmov) _cmov
=yes ;;
1139 --disable-cmov) _cmov
=no
;;
1140 --enable-fast-cmov) _fast_cmov
=yes ;;
1141 --disable-fast-cmov) _fast_cmov
=no
;;
1142 --enable-fast-clz) _fast_clz
=yes ;;
1143 --disable-fast-clz) _fast_clz
=no
;;
1144 --enable-altivec) _altivec
=yes ;;
1145 --disable-altivec) _altivec
=no
;;
1146 --enable-armv5te) _armv5te
=yes ;;
1147 --disable-armv5te) _armv5te
=no
;;
1148 --enable-armv6) _armv6
=yes ;;
1149 --disable-armv6) _armv6
=no
;;
1150 --enable-armv6t2) _armv6t2
=yes ;;
1151 --disable-armv6t2) _armv6t2
=no
;;
1152 --enable-armvfp) _armvfp
=yes ;;
1153 --disable-armvfp) _armvfp
=no
;;
1154 --enable-neon) neon
=yes ;;
1155 --disable-neon) neon
=no
;;
1156 --enable-iwmmxt) _iwmmxt
=yes ;;
1157 --disable-iwmmxt) _iwmmxt
=no
;;
1158 --enable-mmx) _mmx
=yes ;;
1159 --disable-mmx) # 3Dnow! and MMX2 require MMX
1160 _3dnow
=no _3dnowext
=no _mmx
=no _mmxext
=no
;;
1163 echo "Unknown parameter: $ac_option" >&2
1170 # Atmos: moved this here, to be correct, if --prefix is specified
1171 test -z "$_bindir" && _bindir
="$_prefix/bin"
1172 test -z "$_datadir" && _datadir
="$_prefix/share/mplayer"
1173 test -z "$_mandir" && _mandir
="$_prefix/share/man"
1174 test -z "$_confdir" && _confdir
="$_prefix/etc/mplayer"
1175 test -z "$_libdir" && _libdir
="$_prefix/lib"
1176 test -z "$_localedir" && _localedir
="$_prefix/share/locale"
1178 for tmpdir
in "$TMPDIR" "$TEMPDIR" "/tmp" ; do
1179 test "$tmpdir" && break
1182 mplayer_tmpdir
="$tmpdir/mplayer-configure-$RANDOM-$$"
1183 mkdir
$mplayer_tmpdir || die
"Unable to create tmpdir."
1188 echo Parameters configure was run with
: > "$TMPLOG"
1189 if test -n "$CFLAGS" ; then
1190 echo ${_echo_n} CFLAGS
="'$CFLAGS' ${_echo_c}" >> "$TMPLOG"
1192 if test -n "$PKG_CONFIG_PATH" ; then
1193 echo ${_echo_n} PKG_CONFIG_PATH
="'$PKG_CONFIG_PATH' ${_echo_c}" >> "$TMPLOG"
1195 echo .
/configure
$configuration >> "$TMPLOG"
1199 echocheck
"cross compilation"
1200 echores
$_cross_compile
1202 if test $_cross_compile = yes; then
1210 if test $_cross_compile = yes ; then
1211 # Usually cross-compiler prefixes match with the target triplet
1212 test -n "$_target" && tool_prefix
="$_target"-
1215 test "$_ranlib" = auto
&& _ranlib
="$tool_prefix"ranlib
1216 test "$_windres" = auto
&& _windres
="$tool_prefix"windres
1217 test "$_ar" = auto
&& _ar
="$tool_prefix"ar
1218 test "$_yasm" = auto
&& _yasm
="$tool_prefix"yasm
1219 test "$_pkg_config" = auto
&& _pkg_config
="$tool_prefix"pkg-config
1221 if test "$_cc" = auto
; then
1222 if test -n "$tool_prefix" ; then
1223 _cc
="$tool_prefix"gcc
1229 # Determine our OS name and CPU architecture
1230 if test -z "$_target" ; then
1232 system_name
=$
(uname
-s 2>&1)
1233 case "$system_name" in
1234 Linux|FreeBSD|NetBSD|OpenBSD|DragonFly|BSD
/OS|Darwin|SunOS|QNX|GNU|BeOS|MorphOS|AIX|AmigaOS
)
1245 [cC
][yY
][gG
][wW
][iI
][nN
]*)
1255 system_name
="$system_name-UNKNOWN"
1260 # host's CPU/instruction set
1261 host_arch
=$
(uname
-p 2>&1)
1262 case "$host_arch" in
1263 i386|sparc|ppc|alpha|arm|mips|vax
)
1265 powerpc
) # Darwin returns 'powerpc'
1268 *) # uname -p on Linux returns 'unknown' for the processor type,
1269 # OpenBSD returns 'Intel Pentium/MMX ("Genuine Intel" 586-class)'
1271 # Maybe uname -m (machine hardware name) returns something we
1274 # x86/x86pc is used by QNX
1275 case "$(uname -m 2>&1)" in
1276 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
;;
1277 ia64
) host_arch
=ia64
;;
1278 macppc|ppc
) host_arch
=ppc
;;
1279 ppc64
) host_arch
=ppc64
;;
1280 alpha
) host_arch
=alpha
;;
1281 sparc
) host_arch
=sparc
;;
1282 sparc64
) host_arch
=sparc64
;;
1283 parisc
*|hppa
*|
9000*) host_arch
=hppa
;;
1284 arm
*|zaurus|cats
) host_arch
=arm
;;
1285 sh3|sh4|sh4a
) host_arch
=sh
;;
1286 s390
) host_arch
=s390
;;
1287 s390x
) host_arch
=s390x
;;
1288 *mips
*) host_arch
=mips
;;
1289 vax
) host_arch
=vax
;;
1290 xtensa
*) host_arch
=xtensa
;;
1291 *) host_arch
=UNKNOWN
;;
1295 else # if test -z "$_target"
1297 system_name
=$
(echo $_target | cut
-d '-' -f $i)
1298 case "$(echo $system_name | tr A-Z a-z)" in
1299 linux
) system_name
=Linux
;;
1300 freebsd
) system_name
=FreeBSD
;;
1301 gnu
/kfreebsd
) system_name
=FreeBSD
;;
1302 netbsd
) system_name
=NetBSD
;;
1303 bsd
/os
) system_name
=BSD
/OS
;;
1304 openbsd
) system_name
=OpenBSD
;;
1305 dragonfly
) system_name
=DragonFly
;;
1306 sunos
) system_name
=SunOS
;;
1307 qnx
) system_name
=QNX
;;
1308 morphos
) system_name
=MorphOS
;;
1309 amigaos
) system_name
=AmigaOS
;;
1310 mingw32
*) system_name
=MINGW32
;;
1315 # We need to convert underscores so that values like k6-2 and pentium-mmx can be passed
1316 host_arch
=$
(echo $_target | cut
-d '-' -f 1)
1317 if test $
(echo $host_arch) != "x86_64" ; then
1318 host_arch
=$
(echo $host_arch |
tr '_' '-')
1322 extra_cflags
="-I. $extra_cflags"
1323 _timer
=timer-linux.c
1326 extra_ldflags
="$extra_ldflags -L/usr/local/lib"
1327 extra_cflags
="$extra_cflags -I/usr/local/include"
1330 if netbsd || dragonfly
; then
1331 extra_ldflags
="$extra_ldflags -L/usr/pkg/lib"
1332 extra_cflags
="$extra_cflags -I/usr/pkg/include"
1336 extra_cflags
="-mdynamic-no-pic $extra_cflags"
1337 _timer
=timer-darwin.c
1341 extra_ldflags
="$extra_ldflags -lC"
1350 extra_cflags
="$extra_cflags -fno-common"
1351 # -lwinmm is always needed for osdep/timer-win2.c
1352 extra_ldflags
="$extra_ldflags -lwinmm"
1356 def_dos_paths
="#define HAVE_DOS_PATHS 1"
1357 def_priority
="#define CONFIG_PRIORITY 1"
1363 extra_cflags
="$extra_cflags -D__USE_MINGW_ANSI_STDIO=1"
1370 def_stream_cache
="#undef CONFIG_STREAM_CACHE"
1371 extra_cflags
="-DNEWLIB -D__USE_INLINE__ $extra_cflags"
1375 extra_ldflags
="$extra_ldflags -lph"
1378 TMPC
="$mplayer_tmpdir/tmp.c"
1379 TMPCPP
="$mplayer_tmpdir/tmp.cpp"
1380 TMPEXE
="$mplayer_tmpdir/tmp$_exesuf"
1381 TMPH
="$mplayer_tmpdir/tmp.h"
1382 TMPS
="$mplayer_tmpdir/tmp.S"
1384 if test "$_runtime_cpudetection" = yes && ! x86
&& ! ppc
; then
1385 die
"Runtime CPU detection only works for x86, x86-64 and PPC!"
1389 # Checking CC version...
1390 # Intel C++ Compilers (no autoselect, use CC=/some/binary ./configure)
1391 if test "$(basename $_cc)" = "icc" ||
test "$(basename $_cc)" = "ecc"; then
1392 echocheck
"$_cc version"
1394 cc_name
=$
($_cc -V 2>&1 |
head -n 1 | cut
-d ',' -f 1)
1395 cc_version
=$
($_cc -V 2>&1 |
head -n 1 | cut
-d ',' -f 2 | cut
-d ' ' -f 3)
1396 _cc_major
=$
(echo $cc_version | cut
-d '.' -f 1)
1397 _cc_minor
=$
(echo $cc_version | cut
-d '.' -f 2)
1398 # TODO verify older icc/ecc compatibility
1401 cc_version
="v. ?.??, bad"
1405 cc_version
="$cc_version, ok"
1408 cc_version
="$cc_version, bad"
1412 echores
"$cc_version"
1414 for _cc
in "$_cc" gcc cc
; do
1415 cc_name_tmp
=$
($_cc -v 2>&1 |
tail -n 1 | cut
-d ' ' -f 1)
1416 if test "$cc_name_tmp" = "gcc"; then
1417 cc_name
=$cc_name_tmp
1418 echocheck
"$_cc version"
1420 cc_version
=$
($_cc -dumpversion 2>&1)
1426 _cc_major
=$
(echo $cc_version | cut
-d '.' -f 1)
1427 _cc_minor
=$
(echo $cc_version | cut
-d '.' -f 2)
1428 _cc_mini
=$
(echo $cc_version | cut
-d '.' -f 3)
1431 echores
"$cc_version"
1434 if $_cc -v 2>&1 |
grep -q "clang"; then
1435 echocheck
"$_cc version"
1437 cc_version
=$
($_cc -dumpversion 2>&1)
1438 res_comment
="experimental support only"
1439 echores
"clang $cc_version"
1442 cc_name_tmp
=$
($_cc -V 2>&1 |
head -n 1 | cut
-d ' ' -f 2,3)
1443 if test "$cc_name_tmp" = "Sun C"; then
1444 echocheck
"$_cc version"
1446 cc_version
=$
($_cc -V 2>&1 |
head -n 1 | cut
-d ' ' -f 4)
1447 res_comment
="experimental support only"
1448 echores
"Sun C $cc_version"
1453 test "$cc_fail" = yes && die
"unsupported compiler version"
1455 echocheck
"working compiler"
1456 cflag_check
"" || die
"Compiler is not functioning correctly. Check your installation and custom CFLAGS $CFLAGS ."
1459 if test -z "$_target" && x86
; then
1462 int test[(int)sizeof(char *)-7];
1466 cc_check
&& host_arch
=x86_64 || host_arch
=i386
1469 echo "Detected operating system: $system_name"
1470 echo "Detected host architecture: $host_arch"
1474 # now that we know what compiler should be used for compilation, try to find
1475 # out which assembler is used by the $_cc compiler
1476 if test "$_as" = auto
; then
1477 _as
=$
($_cc -print-prog-name=as
)
1478 test -z "$_as" && _as
=as
1481 if test "$_nm" = auto
; then
1482 _nm
=$
($_cc -print-prog-name=nm
)
1483 test -z "$_nm" && _nm
=nm
1486 # XXX: this should be ok..
1489 if test "$_runtime_cpudetection" = no
; then
1491 # Cygwin has /proc/cpuinfo, but only supports Intel CPUs
1492 # FIXME: Remove the cygwin check once AMD CPUs are supported
1493 if test -r /proc
/cpuinfo
&& ! cygwin
; then
1494 # Linux with /proc mounted, extract CPU information from it
1495 _cpuinfo
="cat /proc/cpuinfo"
1496 elif test -r /compat
/linux
/proc
/cpuinfo
&& ! x86
; then
1497 # FreeBSD with Linux emulation /proc mounted,
1498 # extract CPU information from it
1499 # Don't use it on x86 though, it never reports 3Dnow
1500 _cpuinfo
="cat /compat/linux/proc/cpuinfo"
1501 elif darwin
&& ! x86
; then
1502 # use hostinfo on Darwin
1505 # use 'lsattr' on AIX
1506 _cpuinfo
="lsattr -E -l proc0 -a type"
1508 # all other OSes try to extract CPU information from a small helper
1509 # program cpuinfo instead
1510 $_cc -o cpuinfo
$_exesuf cpuinfo.c
1511 _cpuinfo
="./cpuinfo$_exesuf"
1515 # gather more CPU information
1516 pname
=$
($_cpuinfo |
grep 'model name' | cut
-d ':' -f 2 |
head -n 1)
1517 pvendor
=$
($_cpuinfo |
grep 'vendor_id' | cut
-d ':' -f 2 | cut
-d ' ' -f 2 |
head -n 1)
1518 pfamily
=$
($_cpuinfo |
grep 'cpu family' | cut
-d ':' -f 2 | cut
-d ' ' -f 2 |
head -n 1)
1519 pmodel
=$
($_cpuinfo |
grep -v 'model name' |
grep 'model' | cut
-d ':' -f 2 | cut
-d ' ' -f 2 |
head -n 1)
1520 pstepping
=$
($_cpuinfo |
grep 'stepping' | cut
-d ':' -f 2 | cut
-d ' ' -f 2 |
head -n 1)
1522 exts
=$
($_cpuinfo |
egrep 'features|flags' | cut
-d ':' -f 2 |
head -n 1)
1524 pparam
=$
(echo $exts |
sed -e s
/xmm
/sse
/ -e s
/kni
/sse
/)
1525 # SSE implies MMX2, but not all SSE processors report the mmxext CPU flag.
1526 pparam
=$
(echo $pparam |
sed -e 's/sse/sse mmxext/')
1528 for ext
in $pparam ; do
1529 eval test \"\
$_$ext\" = auto
2>/dev
/null
&& eval _
$ext=kernel_check
1532 echocheck
"CPU vendor"
1533 echores
"$pvendor ($pfamily:$pmodel:$pstepping)"
1535 echocheck
"CPU type"
1539 fi # test "$_runtime_cpudetection" = no
1541 if x86
&& test "$_runtime_cpudetection" = no
; then
1543 if test "$1" = kernel_check
; then
1544 echocheck
"kernel support of $2"
1548 static void catch(int sig) { exit(1); }
1550 signal(SIGILL, catch);
1551 __asm__ volatile ("$3":::"memory"); return 0;
1555 if cc_check
&& tmp_run
; then
1558 _optimizing
="$_optimizing $2"
1563 echo "It seems that your kernel does not correctly support $2."
1564 echo "To use $2 extensions in MPlayer, you have to upgrade/recompile your kernel!"
1571 extcheck
$_mmx "mmx" "emms"
1572 extcheck
$_mmxext "mmxext" "sfence"
1573 extcheck
$_3dnow "3dnow" "femms"
1574 extcheck
$_3dnowext "3dnowext" "pswapd %%mm0, %%mm0"
1575 extcheck
$_sse "sse" "xorps %%xmm0, %%xmm0" || _gcc3_ext
="$_gcc3_ext -mno-sse"
1576 extcheck
$_sse2 "sse2" "xorpd %%xmm0, %%xmm0" || _gcc3_ext
="$_gcc3_ext -mno-sse2"
1577 extcheck
$_ssse3 "ssse3" "pabsd %%xmm0, %%xmm0"
1578 extcheck
$_cmov "cmov" "cmovb %%eax, %%ebx"
1580 if test "$_gcc3_ext" != ""; then
1581 # if we had to disable sse/sse2 because the active kernel does not
1582 # support this instruction set extension, we also have to tell
1583 # gcc3 to not generate sse/sse2 instructions for normal C code
1584 cflag_check
$_march $_gcc3_ext && _march
="$_march $_gcc3_ext"
1590 def_fast_64bit
='#define HAVE_FAST_64BIT 0'
1591 def_fast_unaligned
='#define HAVE_FAST_UNALIGNED 0'
1592 arch_all
='X86 IA64 SPARC ARM AVR32 SH4 PPC ALPHA MIPS PA_RISC S390 S390X VAX BFIN XTENSA TOMI GENERIC'
1593 subarch_all
='X86_32 X86_64 PPC64'
1594 case "$host_arch" in
1595 i
[3-9]86|x86|x86pc|k5|k6|k6-2|k6-3|pentium
*|athlon
*|i586-i686
)
1598 def_fast_unaligned
='#define HAVE_FAST_UNALIGNED 1'
1603 if test "$_runtime_cpudetection" = no
; then
1607 3) proc
=i386 iproc
=386 ;;
1608 4) proc
=i486 iproc
=486 ;;
1609 5) iproc
=586 # LGB: models are: K5/SSA5 K5 K5 K5 ? ? K6 K6 K6-2 K6-3
1610 # K6 model 13 are the K6-2+ and K6-III+, only differing in cache size.
1611 if test "$pmodel" -eq 9 -o "$pmodel" -eq 13; then
1613 elif test "$pmodel" -eq 5 -o "$pmodel" -eq 10; then
1615 elif test "$pmodel" -ge 8; then
1617 elif test "$pmodel" -ge 6; then
1624 # It's a bit difficult to determine the correct type of Family 6
1625 # AMD CPUs just from their signature. Instead, we check directly
1626 # whether it supports SSE.
1627 if test "$_sse" = yes; then
1628 # gcc treats athlon-xp, athlon-4 and athlon-mp similarly.
1631 # Again, gcc treats athlon and athlon-tbird similarly.
1636 # k8 cpu-type only supported in gcc >= 3.4.0, but that will be
1637 # caught and remedied in the optimization tests below.
1641 *) proc
=amdfam10 iproc
=686
1642 test $_fast_clz = "auto" && _fast_clz
=yes
1648 3) proc
=i386 iproc
=386 ;;
1649 4) proc
=i486 iproc
=486 ;;
1651 if test "$pmodel" -eq 4 ||
test "$pmodel" -eq 8; then
1652 proc
=pentium-mmx
# 4 is desktop, 8 is mobile
1658 if test "$pmodel" -ge 15; then
1660 elif test "$pmodel" -eq 9 -o "$pmodel" -ge 13; then
1662 elif test "$pmodel" -ge 7; then
1664 elif test "$pmodel" -ge 3; then
1669 test $_fast_clz = "auto" && _fast_clz
=yes
1672 # A nocona in 32-bit mode has no more capabilities than a prescott.
1673 if test "$pmodel" -ge 3; then
1677 test $_fast_clz = "auto" && _fast_clz
=yes
1679 test $_fast_cmov = "auto" && _fast_cmov
=no
1681 *) proc
=prescott iproc
=686 ;;
1687 if test "$pmodel" -ge 8; then
1689 elif test "$pmodel" -ge 4; then
1696 if test "$pmodel" -ge 9; then
1703 *) proc
=i686 iproc
=i686
;;
1708 3) proc
=i386 iproc
=386 ;;
1709 4) proc
=i486 iproc
=486 ;;
1710 *) proc
=i586 iproc
=586 ;;
1714 proc
=i586 iproc
=586 ;;
1716 test $_fast_clz = "auto" && _fast_clz
=no
1717 fi # test "$_runtime_cpudetection" = no
1720 # check that gcc supports our CPU, if not, fall back to earlier ones
1721 # LGB: check -mcpu and -march swithing step by step with enabling
1722 # to fall back till 386.
1724 # gcc >= 3.4.0 doesn't support -mcpu, we have to use -mtune instead
1726 if [ "$cc_vendor" = "gnu" ] && ([ "$_cc_major" -gt 3 ] ||
( [ "$_cc_major" = 3 ] && [ "$_cc_minor" -ge 4 ])) ; then
1732 echocheck
"GCC & CPU optimization abilities"
1733 if test "$_runtime_cpudetection" = no
; then
1734 if test $cc_vendor != "intel" && test $cc_vendor != "clang" ; then
1735 cflag_check
-march=native
&& proc
=native
1737 if test "$proc" = "amdfam10"; then
1738 cflag_check
-march=$proc $cpuopt=$proc || proc
=k8
1740 if test "$proc" = "k8"; then
1741 cflag_check
-march=$proc $cpuopt=$proc || proc
=athlon-xp
1743 if test "$proc" = "athlon-xp"; then
1744 cflag_check
-march=$proc $cpuopt=$proc || proc
=athlon
1746 if test "$proc" = "k6-3" ||
test "$proc" = "k6-2"; then
1747 cflag_check
-march=$proc $cpuopt=$proc || proc
=k6
1749 if test "$proc" = "k6" ||
test "$proc" = "c3"; then
1750 if ! cflag_check
-march=$proc $cpuopt=$proc; then
1751 if cflag_check
-march=i586
$cpuopt=i686
; then
1758 if test "$proc" = "prescott" ; then
1759 cflag_check
-march=$proc $cpuopt=$proc || proc
=pentium4
1761 if test "$proc" = "core2" ; then
1762 cflag_check
-march=$proc $cpuopt=$proc || proc
=pentium-m
1764 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
1765 cflag_check
-march=$proc $cpuopt=$proc || proc
=i686
1767 if test "$proc" = "i686" ||
test "$proc" = "pentium-mmx" ||
test "$proc" = "winchip-c6" ||
test "$proc" = "winchip2"; then
1768 cflag_check
-march=$proc $cpuopt=$proc || proc
=i586
1770 if test "$proc" = "i586"; then
1771 cflag_check
-march=$proc $cpuopt=$proc || proc
=i486
1773 if test "$proc" = "i486" ; then
1774 cflag_check
-march=$proc $cpuopt=$proc || proc
=i386
1776 if test "$proc" = "i386" ; then
1777 cflag_check
-march=$proc $cpuopt=$proc || proc
=error
1779 if test "$proc" = "error" ; then
1780 echores
"CPU optimization disabled. CPU not recognized or your compiler is too old."
1784 elif test "$proc" = "i586-i686"; then
1785 _march
="-march=i586"
1786 _mcpu
="$cpuopt=i686"
1789 _march
="-march=$proc"
1790 _mcpu
="$cpuopt=$proc"
1793 else # if test "$_runtime_cpudetection" = no
1794 _mcpu
="$cpuopt=generic"
1795 # at least i486 required, for bswap instruction
1796 _march
="-march=i486"
1797 cflag_check
$_mcpu || _mcpu
="$cpuopt=i686"
1798 cflag_check
$_mcpu || _mcpu
=""
1799 cflag_check
$_march $_mcpu || _march
=""
1802 ## Gabucino : --target takes effect here (hopefully...) by overwriting
1803 ## autodetected mcpu/march parameters
1804 if test "$_target" ; then
1805 # TODO: it may be a good idea to check GCC and fall back in all cases
1806 if test "$host_arch" = "i586-i686"; then
1807 _march
="-march=i586"
1808 _mcpu
="$cpuopt=i686"
1810 _march
="-march=$host_arch"
1811 _mcpu
="$cpuopt=$host_arch"
1819 i586|k5|k6|k6-2|k6-3|pentium|pentium-mmx
) iproc
=586 ;;
1820 i686|athlon
*|pentium
*) iproc
=686 ;;
1825 if test $_cmov = "yes" && test $_fast_cmov = "auto" ; then
1830 test $_fast_clz = "auto" && _fast_clz
=yes
1837 def_fast_64bit
='#define HAVE_FAST_64BIT 1'
1844 def_fast_unaligned
='#define HAVE_FAST_UNALIGNED 1'
1845 def_fast_64bit
='#define HAVE_FAST_64BIT 1'
1848 # gcc >= 3.4.0 doesn't support -mcpu, we have to use -mtune instead
1849 if test "$cc_vendor" = "gnu" && test "$_cc_major" -gt 3 -o "$_cc_major" -eq 3 -a "$_cc_minor" -ge 4 ; then
1854 if test "$_runtime_cpudetection" = no
; then
1859 test $_fast_clz = "auto" && _fast_clz
=no
1868 # 64-bit prescotts exist, but as far as GCC is concerned they
1869 # have the same capabilities as a nocona.
1871 test $_fast_cmov = "auto" && _fast_cmov
=no
1872 test $_fast_clz = "auto" && _fast_clz
=no
1879 fi # test "$_runtime_cpudetection" = no
1881 echocheck
"GCC & CPU optimization abilities"
1882 # This is a stripped-down version of the i386 fallback.
1883 if test "$_runtime_cpudetection" = no
; then
1884 if test $cc_vendor != "intel" && test $cc_vendor != "clang" ; then
1885 cflag_check
-march=native
&& proc
=native
1887 # --- AMD processors ---
1888 if test "$proc" = "amdfam10"; then
1889 cflag_check
-march=$proc $cpuopt=$proc || proc
=k8
1891 if test "$proc" = "k8"; then
1892 cflag_check
-march=$proc $cpuopt=$proc || proc
=athlon-xp
1894 # This will fail if gcc version < 3.3, which is ok because earlier
1895 # versions don't really support 64-bit on amd64.
1896 # Is this a valid assumption? -Corey
1897 if test "$proc" = "athlon-xp"; then
1898 cflag_check
-march=$proc $cpuopt=$proc || proc
=error
1900 # --- Intel processors ---
1901 if test "$proc" = "core2"; then
1902 cflag_check
-march=$proc $cpuopt=$proc || proc
=x86-64
1904 if test "$proc" = "x86-64"; then
1905 cflag_check
-march=$proc $cpuopt=$proc || proc
=nocona
1907 if test "$proc" = "nocona"; then
1908 cflag_check
-march=$proc $cpuopt=$proc || proc
=pentium4
1910 if test "$proc" = "pentium4"; then
1911 cflag_check
-march=$proc $cpuopt=$proc || proc
=error
1914 _march
="-march=$proc"
1915 _mcpu
="$cpuopt=$proc"
1916 if test "$proc" = "error" ; then
1917 echores
"CPU optimization disabled. CPU not recognized or your compiler is too old."
1921 else # if test "$_runtime_cpudetection" = no
1922 # x86-64 is an undocumented option, an intersection of k8 and nocona.
1923 _march
="-march=x86-64"
1924 _mcpu
="$cpuopt=generic"
1925 cflag_check
$_mcpu || _mcpu
="x86-64"
1926 cflag_check
$_mcpu || _mcpu
=""
1927 cflag_check
$_march $_mcpu || _march
=""
1931 test $_fast_cmov = "auto" && _fast_cmov
=yes
1932 test $_fast_clz = "auto" && _fast_clz
=yes
1940 if test "$host_arch" = "sparc64" ; then
1943 def_fast_64bit
='#define HAVE_FAST_64BIT 1'
1945 echocheck
"CPU type"
1947 case "$(echo $karch)" in
1952 sun4u
) proc
=ultrasparc _vis
='yes' ;;
1971 def_fast_unaligned
='#define HAVE_FAST_UNALIGNED 1'
1973 test $_fast_clz = "auto" && _fast_clz
=yes
1981 ppc|ppc64|powerpc|powerpc64
)
1983 def_dcbzl
='#define HAVE_DCBZL 0'
1984 def_fast_unaligned
='#define HAVE_FAST_UNALIGNED 1'
1987 if test "$host_arch" = "ppc64" -o "$host_arch" = "powerpc64" ; then
1989 def_fast_64bit
='#define HAVE_FAST_64BIT 1'
1991 echocheck
"CPU type"
1992 case $system_name in
1994 proc
=$
($_cpuinfo |
grep 'cpu' | cut
-d ':' -f 2 | cut
-d ',' -f 1 | cut
-b 2- |
head -n 1)
1995 if test -n "$($_cpuinfo | grep altivec)"; then
1996 test $_altivec = auto
&& _altivec
=yes
2000 proc
=$
($_cpuinfo |
grep "Processor type" | cut
-f 3 -d ' ' |
sed 's/ppc//')
2001 if [ $
(sysctl
-n hw.vectorunit
) -eq 1 -o \
2002 "$(sysctl -n hw.optional.altivec 2> /dev/null)" = "1" ]; then
2003 test $_altivec = auto
&& _altivec
=yes
2007 # only gcc 3.4 works reliably with AltiVec code under NetBSD
2009 2*|
3.0*|
3.1*|
3.2*|
3.3*)
2012 if [ $
(sysctl
-n machdep.altivec
) -eq 1 ]; then
2013 test $_altivec = auto
&& _altivec
=yes
2019 proc
=$
($_cpuinfo |
grep 'type' | cut
-f 2 -d ' ' |
sed 's/PowerPC_//')
2022 if test "$_altivec" = yes; then
2023 echores
"$proc altivec"
2029 echocheck
"GCC & CPU optimization abilities"
2031 if test -n "$proc"; then
2033 601) _march
='-mcpu=601' _mcpu
='-mtune=601' ;;
2034 603) _march
='-mcpu=603' _mcpu
='-mtune=603' ;;
2035 603e|
603ev
) _march
='-mcpu=603e' _mcpu
='-mtune=603e' ;;
2036 604|
604e|
604r|
604ev
) _march
='-mcpu=604' _mcpu
='-mtune=604' ;;
2037 740|
740/750|
745/755) _march
='-mcpu=740' _mcpu
='-mtune=740' ;;
2038 750|
750CX
) _march
='-mcpu=750' _mcpu
='-mtune=750' ;;
2039 POWER
) _march
='-mcpu=power' _mcpu
='-mtune=power' ;;
2040 POWER2
) _march
='-mcpu=power2' _mcpu
='-mtune=power2' ;;
2041 POWER3
) _march
='-mcpu=power3' _mcpu
='-mtune=power3' ;;
2044 # gcc 3.1(.1) and up supports 7400 and 7450
2045 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "1" ||
test "$_cc_major" -ge "4"; then
2047 7400*|
7410*) _march
='-mcpu=7400' _mcpu
='-mtune=7400' ;;
2048 7447*|
7450*|
7455*) _march
='-mcpu=7450' _mcpu
='-mtune=7450' ;;
2052 # gcc 3.2 and up supports 970
2053 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "3" ||
test "$_cc_major" -ge "4"; then
2055 970*|PPC970
*) _march
='-mcpu=970' _mcpu
='-mtune=970'
2056 def_dcbzl
='#define HAVE_DCBZL 1' ;;
2060 # gcc 3.3 and up supports POWER4
2061 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "3" ||
test "$_cc_major" -ge "4"; then
2063 POWER4
) _march
='-mcpu=power4' _mcpu
='-mtune=power4' ;;
2067 # gcc 3.4 and up supports 440*
2068 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "4" ||
test "$_cc_major" -ge "4"; then
2070 440EP
*) _march
='-mcpu=440fp' _mcpu
='-mtune=440fp' ;;
2071 440G
* ) _march
='-mcpu=440' _mcpu
='-mtune=440' ;;
2075 # gcc 4.0 and up supports POWER5
2076 if test "$_cc_major" -ge "4"; then
2078 POWER5
*) _march
='-mcpu=power5' _mcpu
='-mtune=power5' ;;
2084 if test -n "$_mcpu"; then
2085 _optimizing
=$
(echo $_mcpu | cut
-c 8-)
2086 echores
"$_optimizing"
2091 test $_fast_clz = "auto" && _fast_clz
=yes
2098 def_fast_64bit
='#define HAVE_FAST_64BIT 1'
2100 echocheck
"CPU type"
2103 unsigned long ver, mask;
2104 __asm__ ("implver %0" : "=r" (ver));
2105 __asm__ ("amask %1, %0" : "=r" (mask) : "r" (-1));
2106 printf("%ld-%x\n", ver, ~mask);
2110 $_cc -o "$TMPEXE" "$TMPC"
2111 case $
("$TMPEXE") in
2113 0-0) proc
="ev4"; _mvi
="0";;
2114 1-0) proc
="ev5"; _mvi
="0";;
2115 1-1) proc
="ev56"; _mvi
="0";;
2116 1-101) proc
="pca56"; _mvi
="1";;
2117 2-303) proc
="ev6"; _mvi
="1";;
2118 2-307) proc
="ev67"; _mvi
="1";;
2119 2-1307) proc
="ev68"; _mvi
="1";;
2123 echocheck
"GCC & CPU optimization abilities"
2124 if test "$proc" = "ev68" ; then
2125 cc_check
-mcpu=$proc || proc
=ev67
2127 if test "$proc" = "ev67" ; then
2128 cc_check
-mcpu=$proc || proc
=ev6
2133 test $_fast_clz = "auto" && _fast_clz
=yes
2142 test $_fast_clz = "auto" && _fast_clz
=yes
2176 echo "The architecture of your CPU ($host_arch) is not supported by this configure script"
2177 echo "It seems nobody has ported MPlayer to your OS or CPU type yet."
2178 die
"unsupported architecture $host_arch"
2180 esac # case "$host_arch" in
2182 if test "$_runtime_cpudetection" = yes ; then
2184 test "$_cmov" != no
&& _cmov
=yes
2186 test "$_mmx" != no
&& _mmx
=yes
2187 test "$_3dnow" != no
&& _3dnow
=yes
2188 test "$_3dnowext" != no
&& _3dnowext
=yes
2189 test "$_mmxext" != no
&& _mmxext
=yes
2190 test "$_sse" != no
&& _sse
=yes
2191 test "$_sse2" != no
&& _sse2
=yes
2192 test "$_ssse3" != no
&& _ssse3
=yes
2201 echocheck
"byte order"
2202 if test "$_big_endian" = auto
; then
2204 short ascii_name[] = {
2205 'M' << 8 | 'P', 'l' << 8 | 'a', 'y' << 8 | 'e', 'r' << 8 | 'B',
2206 'i' << 8 | 'g', 'E' << 8 | 'n', 'd' << 8 | 'i', 'a' << 8 | 'n', 0 };
2207 int main(void) { return (long)ascii_name; }
2210 if strings $TMPEXE |
grep -q -l MPlayerBigEndian
; then
2216 echo ${_echo_n} "failed to autodetect byte order, defaulting to ${_echo_c}"
2219 if test "$_big_endian" = yes ; then
2220 _byte_order
='big-endian'
2221 def_words_endian
='#define WORDS_BIGENDIAN 1'
2222 def_bigendian
='#define HAVE_BIGENDIAN 1'
2224 _byte_order
='little-endian'
2225 def_words_endian
='#undef WORDS_BIGENDIAN'
2226 def_bigendian
='#define HAVE_BIGENDIAN 0'
2228 echores
"$_byte_order"
2231 echocheck
"extern symbol prefix"
2235 cc_check
-c || die
"Symbol mangling check failed."
2236 sym
=$
($_nm -P -g $TMPEXE)
2237 extern_prefix
=${sym%%ff_extern*}
2238 def_extern_asm
="#define EXTERN_ASM $extern_prefix"
2239 def_extern_prefix
="#define EXTERN_PREFIX \"$extern_prefix\""
2240 echores
$extern_prefix
2243 echocheck
"assembler support of -pipe option"
2244 # -I. helps to detect compilers that just misunderstand -pipe like Sun C
2245 cflag_check
-pipe -I.
&& _pipe
="-pipe" && echores
"yes" || echores
"no"
2248 if darwin
&& test "$cc_vendor" = "gnu" ; then
2249 echocheck
"GCC support of -mstackrealign"
2250 # GCC 4.2 and some earlier Apple versions support this flag on x86. Since
2251 # Mac OS X/Intel has an ABI different from Windows this is needed to avoid
2252 # crashes when loading Win32 DLLs. Unfortunately some gcc versions create
2253 # wrong code with this flag, but this can be worked around by adding
2254 # -fno-unit-at-a-time as described in the blog post at
2255 # http://www.dribin.org/dave/blog/archives/2006/12/05/missing_third_param/
2257 __attribute__((noinline)) static int foo3(int i1, int i2, int i3) { return i3; }
2258 int main(void) { return foo3(1, 2, 3) == 3 ? 0 : 1; }
2260 cc_check
-O2 -mstackrealign && tmp_run
&& cflags_stackrealign
=-mstackrealign
2261 test -z "$cflags_stackrealign" && cc_check
-O2 -mstackrealign -fno-unit-at-a-time &&
2262 tmp_run
&& cflags_stackrealign
="-mstackrealign -fno-unit-at-a-time"
2263 test -n "$cflags_stackrealign" && echores
"yes" || echores
"no"
2264 fi # if darwin && test "$cc_vendor" = "gnu" ; then
2267 # Checking for CFLAGS
2269 if test "$_profile" != "" ||
test "$_debug" != "" ; then
2272 if test -z "$CFLAGS" ; then
2273 if test "$cc_vendor" = "intel" ; then
2274 CFLAGS
="-O2 $_debug $_profile $_march $_mcpu $_pipe -fomit-frame-pointer"
2275 WARNFLAGS
="-wd167 -wd556 -wd144"
2276 elif test "$cc_vendor" = "sun" ; then
2277 CFLAGS
="-O2 $_debug $_profile $_march $_mcpu $_pipe -xc99 -xregs=frameptr"
2278 elif test "$cc_vendor" = "clang"; then
2279 CFLAGS
="-O2 $_debug $_profile $_march $_pipe"
2280 WARNFLAGS
="-Wall -Wno-switch-enum -Wno-logical-op-parentheses -Wpointer-arith -Wundef -Wno-pointer-sign -Wmissing-prototypes"
2281 ERRORFLAGS
="-Werror=implicit-function-declaration"
2282 elif test "$cc_vendor" != "gnu" ; then
2283 CFLAGS
="-O2 $_debug $_profile $_march $_mcpu $_pipe"
2285 CFLAGS
="-O2 $_debug $_profile $_march $_mcpu $_pipe -ffast-math -fomit-frame-pointer"
2286 WARNFLAGS
="-Wall -Wno-switch -Wno-parentheses -Wpointer-arith -Wredundant-decls"
2287 ERRORFLAGS
="-Werror-implicit-function-declaration"
2288 extra_ldflags
="$extra_ldflags -ffast-math"
2294 if darwin
&& test "$cc_vendor" = "gnu" ; then
2295 extra_cflags
="-falign-loops=16 -shared-libgcc $extra_cflags"
2298 if test "$cc_vendor" = "gnu" ; then
2299 cflag_check
-Wundef && WARNFLAGS
="-Wundef $WARNFLAGS"
2300 # -std=gnu99 is not a warning flag but is placed in WARN_CFLAGS because
2301 # that's the only variable specific to C now, and this option is not valid
2303 cflag_check
-std=gnu99
&& WARN_CFLAGS
="-std=gnu99 $WARN_CFLAGS"
2304 cflag_check
-Wno-pointer-sign && WARN_CFLAGS
="-Wno-pointer-sign $WARN_CFLAGS"
2305 cflag_check
-Wdisabled-optimization && WARN_CFLAGS
="-Wdisabled-optimization $WARN_CFLAGS"
2306 cflag_check
-Wmissing-prototypes && WARN_CFLAGS
="-Wmissing-prototypes $WARN_CFLAGS"
2307 cflag_check
-Wstrict-prototypes && WARN_CFLAGS
="-Wstrict-prototypes $WARN_CFLAGS"
2309 CFLAGS
="-D_ISOC99_SOURCE -D_BSD_SOURCE $CFLAGS"
2312 cflag_check
-mno-omit-leaf-frame-pointer && cflags_no_omit_leaf_frame_pointer
="-mno-omit-leaf-frame-pointer"
2313 cflag_check
-MD -MP && DEPFLAGS
="-MD -MP"
2316 if test -n "$LDFLAGS" ; then
2317 extra_ldflags
="$extra_ldflags $LDFLAGS"
2319 elif test "$cc_vendor" = "intel" ; then
2320 extra_ldflags
="$extra_ldflags -i-static"
2322 if test -n "$CPPFLAGS" ; then
2323 extra_cflags
="$extra_cflags $CPPFLAGS"
2330 # Checking assembler (_as) compatibility...
2331 # Added workaround for older as that reads from stdin by default - atmos
2332 as_version
=$
(echo '' |
$_as -version 2>&1 |
sed -n 's/^.*assembler \(version \)*\([0-9.]*\).*$/\2/p')
2333 echocheck
"assembler ($_as $as_version)"
2335 _pref_as_version
='2.9.1'
2337 if test "$_mmx" = yes ; then
2338 echo 'emms' >> $TMPS
2340 if test "$_3dnow" = yes ; then
2341 _pref_as_version
='2.10.1'
2342 echo 'femms' >> $TMPS
2344 if test "$_3dnowext" = yes ; then
2345 _pref_as_version
='2.10.1'
2346 echo 'pswapd %mm0, %mm0' >> $TMPS
2348 if test "$_mmxext" = yes ; then
2349 _pref_as_version
='2.10.1'
2350 echo 'movntq %mm0, (%eax)' >> $TMPS
2352 if test "$_sse" = yes ; then
2353 _pref_as_version
='2.10.1'
2354 echo 'xorps %xmm0, %xmm0' >> $TMPS
2356 #if test "$_sse2" = yes ; then
2357 # _pref_as_version='2.11'
2358 # echo 'xorpd %xmm0, %xmm0' >> $TMPS
2360 if test "$_cmov" = yes ; then
2361 _pref_as_version
='2.10.1'
2362 echo 'cmovb %eax, %ebx' >> $TMPS
2364 if test "$_ssse3" = yes ; then
2365 _pref_as_version
='2.16.92'
2366 echo 'pabsd %xmm0, %xmm1' >> $TMPS
2368 $_as $TMPS -o $TMPEXE > /dev
/null
2>&1 || as_verc_fail
=yes
2370 if test "$as_verc_fail" != yes ; then
2373 res_comment
="Upgrade binutils to ${_pref_as_version} or use --disable-ssse3 etc."
2375 die
"obsolete binutils version"
2385 #if !(defined(__PIC__) || defined(__pic__) || defined(PIC))
2386 #error PIC not enabled
2391 cc_check
&& pic
=yes && extra_cflags
="$extra_cflags -DPIC"
2397 echocheck
".align is a power of two"
2398 if test "$_asmalign_pot" = auto
; then
2400 inline_asm_check
'".align 3"' && _asmalign_pot
=yes
2402 if test "$_asmalign_pot" = "yes" ; then
2403 def_asmalign_pot
='#define ASMALIGN(ZEROBITS) ".align " #ZEROBITS "\n\t"'
2405 def_asmalign_pot
='#define ASMALIGN(ZEROBITS) ".align 1<<" #ZEROBITS "\n\t"'
2407 echores
$_asmalign_pot
2410 echocheck
"ebx availability"
2412 def_ebx_available
='#define HAVE_EBX_AVAILABLE 0'
2419 // just adding ebx to clobber list seems unreliable with some
2420 // compilers, e.g. Haiku's gcc 2.95
2422 // and the above check does not work for OSX 64 bit...
2423 __asm__ volatile("":::"%ebx");
2427 cc_check
&& ebx_available
=yes && def_ebx_available
='#define HAVE_EBX_AVAILABLE 1'
2428 echores
$ebx_available
2432 if test -z "$YASMFLAGS" ; then
2434 x86_64
&& objformat
="macho64" || objformat
="macho"
2440 # currently tested for Linux x86, x86_64
2441 YASMFLAGS
="-f $objformat"
2442 x86_64
&& YASMFLAGS
="$YASMFLAGS -DARCH_X86_64 -m amd64"
2443 test "$pic" = "yes" && YASMFLAGS
="$YASMFLAGS -DPIC"
2444 case "$objformat" in
2445 elf
) test $_debug && YASMFLAGS
="$YASMFLAGS -g dwarf2" ;;
2446 *) YASMFLAGS
="$YASMFLAGS -DPREFIX" ;;
2452 echo "pabsw xmm0, xmm0" > $TMPS
2453 yasm_check || _yasm
=""
2454 if test $_yasm ; then
2455 def_yasm
='#define HAVE_YASM 1'
2459 def_yasm
='#define HAVE_YASM 0'
2465 def_bswap
='#define HAVE_BSWAP 0'
2466 echo 'bswap %eax' > $TMPS
2467 $_as $TMPS -o $TMPEXE > /dev
/null
2>&1 && def_bswap
='#define HAVE_BSWAP 1' && bswap
=yes || bswap
=no
2472 #FIXME: This should happen before the check for CFLAGS..
2473 def_altivec_h
='#define HAVE_ALTIVEC_H 0'
2474 if ppc
&& ( test "$_altivec" = yes ||
test "$_runtime_cpudetection" = yes ) ; then
2476 # check if AltiVec is supported by the compiler, and how to enable it
2477 echocheck
"GCC AltiVec flags"
2478 if $
(cflag_check
-maltivec -mabi=altivec
) ; then
2479 _altivec_gcc_flags
="-maltivec -mabi=altivec"
2480 # check if <altivec.h> should be included
2481 if $
(header_check altivec.h
$_altivec_gcc_flags) ; then
2482 def_altivec_h
='#define HAVE_ALTIVEC_H 1'
2483 inc_altivec_h
='#include <altivec.h>'
2485 if $
(cflag_check
-faltivec) ; then
2486 _altivec_gcc_flags
="-faltivec"
2489 _altivec_gcc_flags
="none, AltiVec disabled"
2493 echores
"$_altivec_gcc_flags"
2495 # check if the compiler supports braces for vector declarations
2498 int main(void) { (vector int) {1}; return 0; }
2500 cc_check
$_altivec_gcc_flags || die
"You need a compiler that supports {} in AltiVec vector declarations."
2502 # Disable runtime cpudetection if we cannot generate AltiVec code or
2503 # AltiVec is disabled by the user.
2504 test "$_runtime_cpudetection" = yes && test "$_altivec" = no \
2505 && _runtime_cpudetection
=no
2507 # Show that we are optimizing for AltiVec (if enabled and supported).
2508 test "$_runtime_cpudetection" = no
&& test "$_altivec" = yes \
2509 && _optimizing
="$_optimizing altivec"
2511 # If AltiVec is enabled, make sure the correct flags turn up in CFLAGS.
2512 test "$_altivec" = yes && CFLAGS
="$CFLAGS $_altivec_gcc_flags"
2516 def_xform_asm
='#define HAVE_XFORM_ASM 0'
2518 echocheck
"XFORM ASM support"
2519 inline_asm_check
'"lwzx %1, %y0" :: "Z"(*(int*)0), "r"(0)' &&
2520 xform_asm
=yes && def_xform_asm
='#define HAVE_XFORM_ASM 1'
2521 echores
"$xform_asm"
2525 echocheck
"ARMv5TE (Enhanced DSP Extensions)"
2526 if test $_armv5te = "auto" ; then
2528 inline_asm_check
'"qadd r0, r0, r0"' && _armv5te
=yes
2532 test $_armv5te = "yes" && test $_fast_clz = "auto" && _fast_clz
=yes
2534 echocheck
"ARMv6 (SIMD instructions)"
2535 if test $_armv6 = "auto" ; then
2537 inline_asm_check
'"sadd16 r0, r0, r0"' && _armv6
=yes
2541 echocheck
"ARMv6t2 (SIMD instructions)"
2542 if test $_armv6t2 = "auto" ; then
2544 inline_asm_check
'"movt r0, #0"' && _armv6t2
=yes
2549 if test $_armvfp = "auto" ; then
2551 inline_asm_check
'"fadds s0, s0, s0"' && _armvfp
=yes
2555 echocheck
"ARM NEON"
2556 if test $neon = "auto" ; then
2558 inline_asm_check
'"vadd.i16 q0, q0, q0"' && neon
=yes
2562 echocheck
"iWMMXt (Intel XScale SIMD instructions)"
2563 if test $_iwmmxt = "auto" ; then
2565 inline_asm_check
'"wunpckelub wr6, wr4"' && _iwmmxt
=yes
2570 cpuexts_all
='ALTIVEC MMX MMX2 AMD3DNOW AMD3DNOWEXT SSE SSE2 SSSE3 FAST_CMOV CMOV FAST_CLZ ARMV5TE ARMV6 ARMV6T2 ARMVFP NEON IWMMXT MMI VIS MVI'
2571 test "$_altivec" = yes && cpuexts
="ALTIVEC $cpuexts"
2572 test "$_mmx" = yes && cpuexts
="MMX $cpuexts"
2573 test "$_mmxext" = yes && cpuexts
="MMX2 $cpuexts"
2574 test "$_3dnow" = yes && cpuexts
="AMD3DNOW $cpuexts"
2575 test "$_3dnowext" = yes && cpuexts
="AMD3DNOWEXT $cpuexts"
2576 test "$_sse" = yes && cpuexts
="SSE $cpuexts"
2577 test "$_sse2" = yes && cpuexts
="SSE2 $cpuexts"
2578 test "$_ssse3" = yes && cpuexts
="SSSE3 $cpuexts"
2579 test "$_cmov" = yes && cpuexts
="CMOV $cpuexts"
2580 test "$_fast_cmov" = yes && cpuexts
="FAST_CMOV $cpuexts"
2581 test "$_fast_clz" = yes && cpuexts
="FAST_CLZ $cpuexts"
2582 test "$_armv5te" = yes && cpuexts
="ARMV5TE $cpuexts"
2583 test "$_armv6" = yes && cpuexts
="ARMV6 $cpuexts"
2584 test "$_armv6t2" = yes && cpuexts
="ARMV6T2 $cpuexts"
2585 test "$_armvfp" = yes && cpuexts
="ARMVFP $cpuexts"
2586 test "$neon" = yes && cpuexts
="NEON $cpuexts"
2587 test "$_iwmmxt" = yes && cpuexts
="IWMMXT $cpuexts"
2588 test "$_vis" = yes && cpuexts
="VIS $cpuexts"
2589 test "$_mvi" = yes && cpuexts
="MVI $cpuexts"
2591 # Checking kernel version...
2592 if x86_32
&& linux
; then
2594 kernel_version
=$
(uname
-r 2>&1)
2595 echocheck
"$system_name kernel version"
2596 case "$kernel_version" in
2597 '') kernel_version
="?.??"; _k_verc_fail
=yes;;
2598 [0-1].
[0-9].
[0-9]*|
2.
[0-3].
[0-9]*)
2599 _k_verc_problem
=yes;;
2601 if test "$_k_verc_problem" = yes && test "$_sse" = yes ; then
2604 if test "$_k_verc_fail" ; then
2605 echores
"$kernel_version, fail"
2606 echo "WARNING! If you want to run MPlayer on this system, get prepared for problems!"
2607 echo "2.2.x has limited SSE support. Upgrade the kernel or use --disable-sse if you"
2608 echo "experience crashes. MPlayer tries to autodetect if your kernel correctly"
2609 echo "supports SSE, but you have been warned! If you are using a kernel older than"
2610 echo "2.2.x you must upgrade it to get SSE support!"
2611 # die "Your kernel is too old for this CPU." # works fine on some 2.2.x so don't die (later check will test)
2613 echores
"$kernel_version, ok"
2617 ######################
2618 # MAIN TESTS GO HERE #
2619 ######################
2623 if cflag_check
-lposix ; then
2624 extra_ldflags
="$extra_ldflags -lposix"
2631 if cflag_check
-lm ; then
2640 echocheck
"langinfo"
2641 if test "$_langinfo" = auto
; then
2643 statement_check langinfo.h
'nl_langinfo(CODESET)' && _langinfo
=yes
2645 if test "$_langinfo" = yes ; then
2646 def_langinfo
='#define HAVE_LANGINFO 1'
2648 def_langinfo
='#undef HAVE_LANGINFO'
2650 echores
"$_langinfo"
2653 echocheck
"translation support"
2654 if test "$_translation" = yes; then
2655 def_translation
="#define CONFIG_TRANSLATION 1"
2657 def_translation
="#undef CONFIG_TRANSLATION"
2659 echores
"$_translation"
2661 echocheck
"language"
2662 # Set preferred languages, "all" uses English as main language.
2663 test -z "$language" && language
=$LINGUAS
2664 test -z "$language_doc" && language_doc
=$language
2665 test -z "$language_man" && language_man
=$language
2666 test -z "$language_msg" && language_msg
=$language
2667 test -z "$language_msg" && language_msg
="all"
2668 language_doc
=$
(echo $language_doc |
tr , " ")
2669 language_man
=$
(echo $language_man |
tr , " ")
2670 language_msg
=$
(echo $language_msg |
tr , " ")
2672 test "$language_doc" = "all" && language_doc
=$doc_lang_all
2673 test "$language_man" = "all" && language_man
=$man_lang_all
2674 test "$language_msg" = "all" && language_msg
=$msg_lang_all
2676 if test "$_translation" != yes ; then
2680 # Prune non-existing translations from language lists.
2681 # Set message translation to the first available language.
2682 # Fall back on English.
2683 for lang
in $language_doc ; do
2684 test -d DOCS
/xml
/$lang && tmp_language_doc
="$tmp_language_doc $lang"
2686 language_doc
=$tmp_language_doc
2687 test -z "$language_doc" && language_doc
=en
2689 for lang
in $language_man ; do
2690 test -d DOCS
/man
/$lang && tmp_language_man
="$tmp_language_man $lang"
2692 language_man
=$tmp_language_man
2693 test -z "$language_man" && language_man
=en
2695 for lang
in $language_msg ; do
2696 test -f po
/$lang.po
&& tmp_language_msg
="$tmp_language_msg $lang"
2698 language_msg
=$tmp_language_msg
2700 echores
"messages (en+): $language_msg - man pages: $language_man - documentation: $language_doc"
2703 echocheck
"enable sighandler"
2704 if test "$_sighandler" = yes ; then
2705 def_sighandler
='#define CONFIG_SIGHANDLER 1'
2707 def_sighandler
='#undef CONFIG_SIGHANDLER'
2709 echores
"$_sighandler"
2711 echocheck
"runtime cpudetection"
2712 if test "$_runtime_cpudetection" = yes ; then
2713 _optimizing
="Runtime CPU-Detection enabled"
2714 def_runtime_cpudetection
='#define CONFIG_RUNTIME_CPUDETECT 1'
2716 def_runtime_cpudetection
='#define CONFIG_RUNTIME_CPUDETECT 0'
2718 echores
"$_runtime_cpudetection"
2721 echocheck
"restrict keyword"
2722 for restrict_keyword
in restrict __restrict __restrict__
; do
2723 echo "void foo(char * $restrict_keyword p); int main(void) { return 0; }" > $TMPC
2725 def_restrict_keyword
=$restrict_keyword
2729 if [ -n "$def_restrict_keyword" ]; then
2730 echores
"$def_restrict_keyword"
2734 # Avoid infinite recursion loop ("#define restrict restrict")
2735 if [ "$def_restrict_keyword" != "restrict" ]; then
2736 def_restrict_keyword
="#define restrict $def_restrict_keyword"
2738 def_restrict_keyword
=""
2742 echocheck
"__builtin_expect"
2743 # GCC branch prediction hint
2745 static int foo(int a) {
2746 a = __builtin_expect(a, 10);
2747 return a == 10 ? 0 : 1;
2749 int main(void) { return foo(10) && foo(0); }
2752 cc_check
&& _builtin_expect
=yes
2753 if test "$_builtin_expect" = yes ; then
2754 def_builtin_expect
='#define HAVE_BUILTIN_EXPECT 1'
2756 def_builtin_expect
='#undef HAVE_BUILTIN_EXPECT'
2758 echores
"$_builtin_expect"
2763 statement_check kstat.h
'kstat_open()' -lkstat && _kstat
=yes
2764 if test "$_kstat" = yes ; then
2765 def_kstat
="#define HAVE_LIBKSTAT 1"
2766 extra_ldflags
="$extra_ldflags -lkstat"
2768 def_kstat
="#undef HAVE_LIBKSTAT"
2774 # required for nanosleep on some systems
2776 statement_check
time.h
'nanosleep(0, 0)' -lposix4 && _posix4
=yes
2777 if test "$_posix4" = yes ; then
2778 extra_ldflags
="$extra_ldflags -lposix4"
2782 for func
in exp2 exp2f llrint log2 log2f lrint lrintf round roundf truncf
; do
2785 statement_check math.h
"${func}(2.0)" -D_ISOC99_SOURCE $_ld_lm && eval _
$func=yes
2786 if eval test "x\$_$func" = "xyes"; then
2787 eval def_
$func="\"#define HAVE_$(echo $func | tr '[a-z]' '[A-Z]') 1\""
2790 eval def_
$func="\"#define HAVE_$(echo $func | tr '[a-z]' '[A-Z]') 0\""
2798 define_statement_check
"_XOPEN_SOURCE 600" "stdlib.h" 'mkstemp("")' && _mkstemp
=yes
2799 if test "$_mkstemp" = yes ; then
2800 def_mkstemp
='#define HAVE_MKSTEMP 1'
2802 def_mkstemp
='#define HAVE_MKSTEMP 0'
2807 echocheck
"nanosleep"
2809 statement_check
time.h
'nanosleep(0, 0)' && _nanosleep
=yes
2810 if test "$_nanosleep" = yes ; then
2811 def_nanosleep
='#define HAVE_NANOSLEEP 1'
2813 def_nanosleep
='#undef HAVE_NANOSLEEP'
2815 echores
"$_nanosleep"
2819 # for Solaris (socket stuff is in -lsocket, gethostbyname and friends in -lnsl):
2820 # for BeOS (socket stuff is in -lsocket, gethostbyname and friends in -lbind):
2823 #include <sys/socket.h>
2824 int main(void) { gethostbyname(0); socket(AF_INET, SOCK_STREAM, 0); return 0; }
2827 for _ld_tmp
in "" "-lsocket -lbind" "-lsocket -ldnet" "-lsocket -lnsl" "-lnsl" "-lsocket" ; do
2828 cc_check
$_ld_tmp && _ld_sock
="$_ld_tmp" && _socklib
=yes && break
2830 test $_socklib = yes && test $_winsock2_h = auto
&& _winsock2_h
=no
2831 if test $_winsock2_h = auto
; then
2833 statement_check winsock2.h
'gethostbyname(0)' -lws2_32 && _ld_sock
="-lws2_32" && _winsock2_h
=yes
2835 test "$_ld_sock" && res_comment
="using $_ld_sock"
2839 if test $_winsock2_h = yes ; then
2841 def_winsock2_h
='#define HAVE_WINSOCK2_H 1'
2843 def_winsock2_h
='#define HAVE_WINSOCK2_H 0'
2847 echocheck
"arpa/inet.h"
2849 def_arpa_inet_h
='#define HAVE_ARPA_INET_H 0'
2850 header_check arpa
/inet.h
&& arpa_inet_h
=yes &&
2851 def_arpa_inet_h
='#define HAVE_ARPA_INET_H 1'
2852 echores
"$arpa_inet_h"
2855 echocheck
"inet_pton()"
2856 def_inet_pton
='#define HAVE_INET_PTON 0'
2858 for _ld_tmp
in "$_ld_sock" "$_ld_sock -lresolv" ; do
2859 statement_check arpa
/inet.h
'inet_pton(0, 0, 0)' $_ld_tmp && inet_pton
=yes && break
2861 if test $inet_pton = yes ; then
2862 test "$_ld_tmp" && res_comment
="using $_ld_tmp"
2863 def_inet_pton
='#define HAVE_INET_PTON 1'
2865 echores
"$inet_pton"
2868 echocheck
"inet_aton()"
2869 def_inet_aton
='#define HAVE_INET_ATON 0'
2871 for _ld_tmp
in "$_ld_sock" "$_ld_sock -lresolv" ; do
2872 statement_check arpa
/inet.h
'inet_aton(0, 0)' $_ld_tmp && inet_aton
=yes && break
2874 if test $inet_aton = yes ; then
2875 test "$_ld_tmp" && res_comment
="using $_ld_tmp"
2876 def_inet_aton
='#define HAVE_INET_ATON 1'
2878 echores
"$inet_aton"
2881 echocheck
"socklen_t"
2883 for header
in "sys/socket.h" "ws2tcpip.h" "sys/types.h" ; do
2884 statement_check
$header 'socklen_t v = 0' && _socklen_t
=yes && break
2886 if test "$_socklen_t" = yes ; then
2887 def_socklen_t
='#define HAVE_SOCKLEN_T 1'
2889 def_socklen_t
='#define HAVE_SOCKLEN_T 0'
2891 echores
"$_socklen_t"
2894 echocheck
"closesocket()"
2896 statement_check winsock2.h
'closesocket(~0)' $_ld_sock && _closesocket
=yes
2897 if test "$_closesocket" = yes ; then
2898 def_closesocket
='#define HAVE_CLOSESOCKET 1'
2900 def_closesocket
='#define HAVE_CLOSESOCKET 0'
2902 echores
"$_closesocket"
2905 echocheck
"networking"
2906 test $_winsock2_h = no
&& test $inet_pton = no
&&
2907 test $inet_aton = no
&& networking
=no
2908 if test "$networking" = yes ; then
2909 def_network
='#define CONFIG_NETWORK 1'
2910 def_networking
='#define CONFIG_NETWORKING 1'
2911 extra_ldflags
="$extra_ldflags $_ld_sock"
2912 inputmodules
="networking $inputmodules"
2914 noinputmodules
="networking $noinputmodules"
2915 def_network
='#define CONFIG_NETWORK 0'
2916 def_networking
='#undef CONFIG_NETWORKING'
2918 echores
"$networking"
2922 if test "$_inet6" = auto
; then
2924 #include <sys/types.h>
2925 #if !defined(_WIN32)
2926 #include <sys/socket.h>
2927 #include <netinet/in.h>
2929 #include <ws2tcpip.h>
2931 int main(void) { struct sockaddr_in6 six; socket(AF_INET6, SOCK_STREAM, AF_INET6); return 0; }
2934 if cc_check
$_ld_sock ; then
2938 if test "$_inet6" = yes ; then
2939 def_inet6
='#define HAVE_AF_INET6 1'
2941 def_inet6
='#undef HAVE_AF_INET6'
2946 echocheck
"gethostbyname2"
2947 if test "$_gethostbyname2" = auto
; then
2949 #include <sys/types.h>
2950 #include <sys/socket.h>
2952 int main(void) { gethostbyname2("", AF_INET); return 0; }
2959 if test "$_gethostbyname2" = yes ; then
2960 def_gethostbyname2
='#define HAVE_GETHOSTBYNAME2 1'
2962 def_gethostbyname2
='#undef HAVE_GETHOSTBYNAME2'
2964 echores
"$_gethostbyname2"
2967 echocheck
"inttypes.h (required)"
2969 header_check inttypes.h
&& _inttypes
=yes
2970 echores
"$_inttypes"
2972 if test "$_inttypes" = no
; then
2973 echocheck
"sys/bitypes.h (inttypes.h predecessor)"
2974 header_check sys
/bitypes.h
&& _inttypes
=yes
2975 if test "$_inttypes" = yes ; then
2976 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."
2978 die
"Cannot find header either inttypes.h or bitypes.h. There is no chance for compilation to succeed."
2983 echocheck
"malloc.h"
2985 header_check malloc.h
&& _malloc
=yes
2986 if test "$_malloc" = yes ; then
2987 def_malloc_h
='#define HAVE_MALLOC_H 1'
2989 def_malloc_h
='#define HAVE_MALLOC_H 0'
2994 echocheck
"memalign()"
2995 # XXX restrict to x86 ? extend to other CPUs/cacheline sizes ?
2996 def_memalign_hack
='#define CONFIG_MEMALIGN_HACK 0'
2998 statement_check malloc.h
'memalign(64, sizeof(char))' && _memalign
=yes
2999 if test "$_memalign" = yes ; then
3000 def_memalign
='#define HAVE_MEMALIGN 1'
3002 def_memalign
='#define HAVE_MEMALIGN 0'
3003 def_map_memalign
='#define memalign(a, b) malloc(b)'
3004 darwin || def_memalign_hack
='#define CONFIG_MEMALIGN_HACK 1'
3006 echores
"$_memalign"
3009 echocheck
"posix_memalign()"
3011 def_posix_memalign
='#define HAVE_POSIX_MEMALIGN 0'
3012 define_statement_check
"_XOPEN_SOURCE 600" "stdlib.h" 'posix_memalign(NULL, 0, 0)' &&
3013 posix_memalign
=yes && def_posix_memalign
='#define HAVE_POSIX_MEMALIGN 1'
3014 echores
"$posix_memalign"
3017 echocheck
"alloca.h"
3019 statement_check alloca.h
'alloca(0)' && _alloca
=yes
3021 def_alloca_h
='#define HAVE_ALLOCA_H 1'
3023 def_alloca_h
='#undef HAVE_ALLOCA_H'
3028 echocheck
"fastmemcpy"
3029 if test "$_fastmemcpy" = yes ; then
3030 def_fastmemcpy
='#define CONFIG_FASTMEMCPY 1'
3032 def_fastmemcpy
='#undef CONFIG_FASTMEMCPY'
3034 echores
"$_fastmemcpy"
3039 statement_check sys
/mman.h
'mmap(0, 0, 0, 0, 0, 0)' && _mman
=yes
3040 if test "$_mman" = yes ; then
3041 def_mman_h
='#define HAVE_SYS_MMAN_H 1'
3043 def_mman_h
='#undef HAVE_SYS_MMAN_H'
3047 _mman_has_map_failed
=no
3048 statement_check sys
/mman.h
'void *p = MAP_FAILED' && _mman_has_map_failed
=yes
3049 if test "$_mman_has_map_failed" = yes ; then
3050 def_mman_has_map_failed
=''
3052 def_mman_has_map_failed
='#define MAP_FAILED ((void *) -1)'
3055 echocheck
"dynamic loader"
3057 for _ld_tmp
in "" "-ldl"; do
3058 statement_check dlfcn.h
'dlopen("", 0)' $_ld_tmp && _ld_dl
="$_ld_tmp" && _dl
=yes && break
3060 if test "$_dl" = yes ; then
3061 def_dl
='#define HAVE_LIBDL 1'
3063 def_dl
='#undef HAVE_LIBDL'
3068 def_threads
='#define HAVE_THREADS 0'
3072 THREAD_CFLAGS
=-D_REENTRANT
3073 elif freebsd || netbsd || openbsd || bsdos
; then
3074 THREAD_CFLAGS
=-D_THREAD_SAFE
3076 if test "$_pthreads" = auto
; then
3078 #include <pthread.h>
3079 static void *func(void *arg) { return arg; }
3082 #ifdef PTW32_STATIC_LIB
3083 pthread_win32_process_attach_np();
3084 pthread_win32_thread_attach_np();
3086 return pthread_create (&tid, 0, func, 0) != 0;
3091 for _ld_tmp
in "-lpthreadGC2" "" "-lpthread" "-pthread" ; do
3092 # for crosscompilation, we cannot execute the program, be happy if we can link statically
3093 cc_check
$THREAD_CFLAGS $_ld_tmp && (tmp_run ||
test "$_ld_static") && _ld_pthread
="$_ld_tmp" && _pthreads
=yes && break
3095 if test "$_pthreads" = no
&& mingw32
; then
3096 _ld_tmp
="-lpthreadGC2 -lws2_32"
3097 cc_check
$_ld_tmp -DPTW32_STATIC_LIB && (tmp_run ||
test "$_ld_static") && _ld_pthread
="$_ld_tmp" && _pthreads
=yes && CFLAGS
="$CFLAGS -DPTW32_STATIC_LIB"
3101 if test "$_pthreads" = yes ; then
3102 test $_ld_pthread && res_comment
="using $_ld_pthread"
3103 def_pthreads
='#define HAVE_PTHREADS 1'
3104 def_threads
='#define HAVE_THREADS 1'
3105 extra_cflags
="$extra_cflags $THREAD_CFLAGS"
3107 res_comment
="v4l, v4l2, ao_nas, win32 loader disabled"
3108 def_pthreads
='#undef HAVE_PTHREADS'
3109 _nas
=no
; _tv_v4l1
=no
; _tv_v4l2
=no
3110 mingw32 || _win32dll
=no
3112 echores
"$_pthreads"
3115 if test "$_pthreads" = yes ; then
3116 def_pthread_cache
="#define PTHREAD_CACHE 1"
3119 def_stream_cache
="#undef CONFIG_STREAM_CACHE"
3123 echocheck
"w32threads"
3124 if test "$_pthreads" = yes ; then
3125 res_comment
="using pthread instead"
3128 if test "$_w32threads" = auto
; then
3130 mingw32
&& _w32threads
=yes
3132 test "$_w32threads" = yes && def_threads
='#define HAVE_THREADS 1'
3133 echores
"$_w32threads"
3136 if test "$_rpath" = yes ; then
3137 for I
in $
(echo $extra_ldflags |
sed 's/-L//g') ; do
3138 tmp
="$tmp $(echo $I | sed 's/.*/ -L& -Wl,-R&/')"
3145 if test "$_iconv" = auto
; then
3150 #define INBUFSIZE 1024
3151 #define OUTBUFSIZE 4096
3153 char inbuffer[INBUFSIZE];
3154 char outbuffer[OUTBUFSIZE];
3159 char *tocode="UTF-8";
3160 char *fromcode="cp1250";
3161 if ((icdsc = iconv_open(tocode, fromcode)) != (iconv_t)(-1)) {
3162 while ((numread = read(0, inbuffer, INBUFSIZE))) {
3163 char *iptr=inbuffer;
3164 char *optr=outbuffer;
3165 size_t inleft=numread;
3166 size_t outleft=OUTBUFSIZE;
3167 if (iconv(icdsc, &iptr, &inleft, &optr, &outleft)
3169 write(1, outbuffer, OUTBUFSIZE - outleft);
3172 if (iconv_close(icdsc) == -1)
3179 for _ld_tmp
in "" "-liconv" "-liconv $_ld_dl" ; do
3180 cc_check
$_ld_lm $_ld_tmp && extra_ldflags
="$extra_ldflags $_ld_tmp" &&
3183 if test "$_iconv" != yes ; then
3184 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."
3187 if test "$_iconv" = yes ; then
3188 def_iconv
='#define CONFIG_ICONV 1'
3190 def_iconv
='#undef CONFIG_ICONV'
3195 echocheck
"soundcard.h"
3197 def_soundcard_h
='#undef HAVE_SOUNDCARD_H'
3198 def_sys_soundcard_h
='#undef HAVE_SYS_SOUNDCARD_H'
3199 for _soundcard_header
in "sys/soundcard.h" "soundcard.h"; do
3200 header_check
$_soundcard_header && _soundcard_h
=yes &&
3201 res_comment
="$_soundcard_header" && break
3204 if test "$_soundcard_h" = yes ; then
3205 if test $_soundcard_header = "sys/soundcard.h"; then
3206 def_sys_soundcard_h
='#define HAVE_SYS_SOUNDCARD_H 1'
3208 def_soundcard_h
='#define HAVE_SOUNDCARD_H 1'
3211 echores
"$_soundcard_h"
3214 echocheck
"sys/videoio.h"
3216 def_sys_videoio_h
='#undef HAVE_SYS_VIDEOIO_H'
3217 header_check sys
/videoio.h
&& sys_videoio_h
=yes &&
3218 def_sys_videoio_h
='#define HAVE_SYS_VIDEOIO_H 1'
3219 echores
"$sys_videoio_h"
3222 echocheck
"sys/dvdio.h"
3224 # FreeBSD 8.1 has broken dvdio.h
3225 header_check_broken sys
/types.h sys
/dvdio.h
&& _dvdio
=yes
3226 if test "$_dvdio" = yes ; then
3227 def_dvdio
='#define DVD_STRUCT_IN_SYS_DVDIO_H 1'
3229 def_dvdio
='#undef DVD_STRUCT_IN_SYS_DVDIO_H'
3234 echocheck
"sys/cdio.h"
3236 # at least OpenSolaris has a broken cdio.h
3237 header_check_broken sys
/types.h sys
/cdio.h
&& _cdio
=yes
3238 if test "$_cdio" = yes ; then
3239 def_cdio
='#define DVD_STRUCT_IN_SYS_CDIO_H 1'
3241 def_cdio
='#undef DVD_STRUCT_IN_SYS_CDIO_H'
3246 echocheck
"linux/cdrom.h"
3248 header_check linux
/cdrom.h
&& _cdrom
=yes
3249 if test "$_cdrom" = yes ; then
3250 def_cdrom
='#define DVD_STRUCT_IN_LINUX_CDROM_H 1'
3252 def_cdrom
='#undef DVD_STRUCT_IN_LINUX_CDROM_H'
3259 header_check dvd.h
&& _dvd
=yes
3260 if test "$_dvd" = yes ; then
3261 def_dvd
='#define DVD_STRUCT_IN_DVD_H 1'
3263 def_dvd
='#undef DVD_STRUCT_IN_DVD_H'
3269 echocheck
"BSDI dvd.h"
3271 header_check dvd.h
&& _bsdi_dvd
=yes
3272 if test "$_bsdi_dvd" = yes ; then
3273 def_bsdi_dvd
='#define DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H 1'
3275 def_bsdi_dvd
='#undef DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H'
3277 echores
"$_bsdi_dvd"
3282 # also used by AIX, but AIX does not support VCD and/or libdvdread
3283 echocheck
"HP-UX SCSI header"
3285 header_check sys
/scsi.h
&& _hpux_scsi_h
=yes
3286 if test "$_hpux_scsi_h" = yes ; then
3287 def_hpux_scsi_h
='#define HPUX_SCTL_IO 1'
3289 def_hpux_scsi_h
='#undef HPUX_SCTL_IO'
3291 echores
"$_hpux_scsi_h"
3296 echocheck
"userspace SCSI headers (Solaris)"
3298 header_check sys
/scsi
/scsi_types.h
&&
3299 header_check_broken sys
/types.h sys
/scsi
/impl
/uscsi.h
&&
3301 if test "$_sol_scsi_h" = yes ; then
3302 def_sol_scsi_h
='#define SOLARIS_USCSI 1'
3304 def_sol_scsi_h
='#undef SOLARIS_USCSI'
3306 echores
"$_sol_scsi_h"
3311 if test "$_termcap" = auto
; then
3313 for _ld_tmp
in "-lncurses" "-ltinfo" "-ltermcap"; do
3314 statement_check term.h
'tgetent(0, 0)' $_ld_tmp &&
3315 extra_ldflags
="$extra_ldflags $_ld_tmp" && _termcap
=yes && break
3318 if test "$_termcap" = yes ; then
3319 def_termcap
='#define HAVE_TERMCAP 1'
3320 test $_ld_tmp && res_comment
="using $_ld_tmp"
3322 def_termcap
='#undef HAVE_TERMCAP'
3328 def_termios
='#undef HAVE_TERMIOS'
3329 def_termios_h
='#undef HAVE_TERMIOS_H'
3330 def_termios_sys_h
='#undef HAVE_SYS_TERMIOS_H'
3331 if test "$_termios" = auto
; then
3333 for _termios_header
in "termios.h" "sys/termios.h"; do
3334 header_check
$_termios_header && _termios
=yes &&
3335 res_comment
="using $_termios_header" && break
3339 if test "$_termios" = yes ; then
3340 def_termios
='#define HAVE_TERMIOS 1'
3341 if test "$_termios_header" = "termios.h" ; then
3342 def_termios_h
='#define HAVE_TERMIOS_H 1'
3344 def_termios_sys_h
='#define HAVE_SYS_TERMIOS_H 1'
3351 if test "$_shm" = auto
; then
3353 statement_check sys
/shm.h
'shmget(0, 0, 0); shmat(0, 0, 0); shmctl(0, 0, 0)' && _shm
=yes
3355 if test "$_shm" = yes ; then
3356 def_shm
='#define HAVE_SHM 1'
3358 def_shm
='#undef HAVE_SHM'
3363 echocheck
"strsep()"
3365 statement_check string.h
'char *s = "Hello, world!"; strsep(&s, ",")' && _strsep
=yes
3366 if test "$_strsep" = yes ; then
3367 def_strsep
='#define HAVE_STRSEP 1'
3370 def_strsep
='#undef HAVE_STRSEP'
3376 echocheck
"vsscanf()"
3378 #define _ISOC99_SOURCE
3381 int main(void) { va_list ap; vsscanf("foo", "bar", ap); return 0; }
3384 cc_check
&& _vsscanf
=yes
3385 if test "$_vsscanf" = yes ; then
3386 def_vsscanf
='#define HAVE_VSSCANF 1'
3389 def_vsscanf
='#undef HAVE_VSSCANF'
3397 define_statement_check
"_XOPEN_SOURCE 600" "unistd.h" 'int a, b; swab(&a, &b, 0)' ||
3398 statement_check
"string.h" 'int a, b; swab(&a, &b, 0)' && _swab
=yes
3399 if test "$_swab" = yes ; then
3400 def_swab
='#define HAVE_SWAB 1'
3403 def_swab
='#undef HAVE_SWAB'
3408 echocheck
"POSIX select()"
3412 #include <sys/types.h>
3414 #include <sys/time.h>
3416 int main(void) {int nfds = 1; fd_set readfds; struct timeval timeout; select(nfds, &readfds, NULL, NULL, &timeout); return 0; }
3419 def_posix_select
='#undef HAVE_POSIX_SELECT'
3420 cc_check
&& _posix_select
=yes &&
3421 def_posix_select
='#define HAVE_POSIX_SELECT 1'
3422 echores
"$_posix_select"
3425 echocheck
"audio select()"
3426 if test "$_select" = no
; then
3427 def_select
='#undef HAVE_AUDIO_SELECT'
3428 elif test "$_select" = yes ; then
3429 def_select
='#define HAVE_AUDIO_SELECT 1'
3434 echocheck
"gettimeofday()"
3436 statement_check sys
/time.h
'struct timeval tv; struct timezone tz; gettimeofday(&tv, &tz)' && _gettimeofday
=yes
3437 if test "$_gettimeofday" = yes ; then
3438 def_gettimeofday
='#define HAVE_GETTIMEOFDAY 1'
3439 need_gettimeofday
=no
3441 def_gettimeofday
='#undef HAVE_GETTIMEOFDAY'
3442 need_gettimeofday
=yes
3444 echores
"$_gettimeofday"
3449 statement_check glob.h
'glob("filename", 0, 0, 0)' && _glob
=yes
3451 if test "$_glob" = yes ; then
3452 def_glob
='#define HAVE_GLOB 1'
3454 def_glob
='#undef HAVE_GLOB'
3455 # HACK! need_glob currently enables compilation of a
3456 # win32-specific glob()-replacement.
3457 # Other OS neither need it nor can they use it (mf:// is disabled for them).
3458 win32
&& need_glob
=yes
3463 echocheck
"setenv()"
3465 statement_check stdlib.h
'setenv("", "", 0)' && _setenv
=yes
3466 if test "$_setenv" = yes ; then
3467 def_setenv
='#define HAVE_SETENV 1'
3470 def_setenv
='#undef HAVE_SETENV'
3476 echocheck
"setmode()"
3478 def_setmode
='#define HAVE_SETMODE 0'
3479 statement_check io.h
'setmode(0, 0)' && _setmode
=yes && def_setmode
='#define HAVE_SETMODE 1'
3484 echocheck
"sysi86()"
3486 statement_check sys
/sysi86.h
'sysi86(0)' && _sysi86
=yes
3487 if test "$_sysi86" = yes ; then
3488 def_sysi86
='#define HAVE_SYSI86 1'
3489 statement_check sys
/sysi86.h
'int sysi86(int, void*); sysi86(0)' && def_sysi86_iv
='#define HAVE_SYSI86_iv 1'
3491 def_sysi86
='#undef HAVE_SYSI86'
3497 echocheck
"sys/sysinfo.h"
3499 statement_check sys
/sysinfo.h
'struct sysinfo s_info; s_info.mem_unit=0; sysinfo(&s_info)' && _sys_sysinfo
=yes
3500 if test "$_sys_sysinfo" = yes ; then
3501 def_sys_sysinfo_h
='#define HAVE_SYS_SYSINFO_H 1'
3503 def_sys_sysinfo_h
='#undef HAVE_SYS_SYSINFO_H'
3505 echores
"$_sys_sysinfo"
3510 echocheck
"Mac OS X Finder Support"
3511 def_macosx_finder
='#undef CONFIG_MACOSX_FINDER'
3512 if test "$_macosx_finder" = yes ; then
3513 def_macosx_finder
='#define CONFIG_MACOSX_FINDER 1'
3514 extra_ldflags
="$extra_ldflags -framework Cocoa"
3516 echores
"$_macosx_finder"
3518 echocheck
"Mac OS X Bundle file locations"
3519 def_macosx_bundle
='#undef CONFIG_MACOSX_BUNDLE'
3520 test "$_macosx_bundle" = auto
&& _macosx_bundle
=$_macosx_finder
3521 if test "$_macosx_bundle" = yes ; then
3522 def_macosx_bundle
='#define CONFIG_MACOSX_BUNDLE 1'
3524 echores
"$_macosx_bundle"
3526 echocheck
"Apple Remote"
3527 if test "$_apple_remote" = auto
; then
3531 #include <IOKit/IOCFPlugIn.h>
3533 io_iterator_t hidObjectIterator = (io_iterator_t)NULL;
3534 CFMutableDictionaryRef hidMatchDictionary;
3535 IOReturn ioReturnValue;
3537 // Set up a matching dictionary to search the I/O Registry by class.
3538 // name for all HID class devices
3539 hidMatchDictionary = IOServiceMatching("AppleIRController");
3541 // Now search I/O Registry for matching devices.
3542 ioReturnValue = IOServiceGetMatchingServices(kIOMasterPortDefault,
3543 hidMatchDictionary, &hidObjectIterator);
3545 // If search is unsuccessful, return nonzero.
3546 if (ioReturnValue != kIOReturnSuccess ||
3547 !IOIteratorIsValid(hidObjectIterator)) {
3553 cc_check
-framework IOKit
&& _apple_remote
=yes
3555 if test "$_apple_remote" = yes ; then
3556 def_apple_remote
='#define CONFIG_APPLE_REMOTE 1'
3557 libs_mplayer
="$libs_mplayer -framework IOKit -framework Cocoa"
3559 def_apple_remote
='#undef CONFIG_APPLE_REMOTE'
3561 echores
"$_apple_remote"
3567 echocheck
"Apple IR"
3568 if test "$_apple_ir" = auto
; then
3570 statement_check linux
/input.h
'struct input_event ev; struct input_id id' && _apple_ir
=yes
3572 if test "$_apple_ir" = yes ; then
3573 def_apple_ir
='#define CONFIG_APPLE_IR 1'
3575 def_apple_ir
='#undef CONFIG_APPLE_IR'
3577 echores
"$_apple_ir"
3580 echocheck
"pkg-config"
3581 if $
($_pkg_config --version > /dev
/null
2>&1); then
3582 if test "$_ld_static"; then
3583 _pkg_config
="$_pkg_config --static"
3592 echocheck
"Samba support (libsmbclient)"
3593 if test "$_smb" = yes; then
3594 extra_ldflags
="$extra_ldflags -lsmbclient"
3596 if test "$_smb" = auto
; then
3598 for _ld_tmp
in "-lsmbclient" "-lsmbclient $_ld_dl" "-lsmbclient $_ld_dl -lnsl" "-lsmbclient $_ld_dl -lssl -lnsl" ; do
3599 statement_check libsmbclient.h
'smbc_opendir("smb://")' $_ld_tmp &&
3600 extra_ldflags
="$extra_ldflags $_ld_tmp" && _smb
=yes && break
3604 if test "$_smb" = yes; then
3605 def_smb
="#define CONFIG_LIBSMBCLIENT 1"
3606 inputmodules
="smb $inputmodules"
3608 def_smb
="#undef CONFIG_LIBSMBCLIENT"
3609 noinputmodules
="smb $noinputmodules"
3620 if test "$_tdfxfb" = yes ; then
3621 def_tdfxfb
='#define CONFIG_TDFXFB 1'
3622 vomodules
="tdfxfb $vomodules"
3624 def_tdfxfb
='#undef CONFIG_TDFXFB'
3625 novomodules
="tdfxfb $novomodules"
3630 if test "$_s3fb" = yes ; then
3631 def_s3fb
='#define CONFIG_S3FB 1'
3632 vomodules
="s3fb $vomodules"
3634 def_s3fb
='#undef CONFIG_S3FB'
3635 novomodules
="s3fb $novomodules"
3640 if test "$_wii" = yes ; then
3641 def_wii
='#define CONFIG_WII 1'
3642 vomodules
="wii $vomodules"
3644 def_wii
='#undef CONFIG_WII'
3645 novomodules
="wii $novomodules"
3650 if test "$_tdfxvid" = yes ; then
3651 def_tdfxvid
='#define CONFIG_TDFX_VID 1'
3652 vomodules
="tdfx_vid $vomodules"
3654 def_tdfxvid
='#undef CONFIG_TDFX_VID'
3655 novomodules
="tdfx_vid $novomodules"
3660 if test "$_xvr100" = auto
; then
3663 #include <sys/fbio.h>
3664 #include <sys/visual_io.h>
3666 struct vis_identifier ident;
3667 struct fbgattr attr;
3668 ioctl(0, VIS_GETIDENTIFIER, &ident);
3669 ioctl(0, FBIOGATTR, &attr);
3674 cc_check
&& _xvr100
=yes
3676 if test "$_xvr100" = yes ; then
3677 def_xvr100
='#define CONFIG_XVR100 1'
3678 vomodules
="xvr100 $vomodules"
3680 def_tdfxvid
='#undef CONFIG_XVR100'
3681 novomodules
="xvr100 $novomodules"
3686 if test "$_tga" = yes ; then
3687 def_tga
='#define CONFIG_TGA 1'
3688 vomodules
="tga $vomodules"
3690 def_tga
='#undef CONFIG_TGA'
3691 novomodules
="tga $novomodules"
3696 echocheck
"md5sum support"
3697 if test "$_md5sum" = yes; then
3698 def_md5sum
="#define CONFIG_MD5SUM 1"
3699 vomodules
="md5sum $vomodules"
3701 def_md5sum
="#undef CONFIG_MD5SUM"
3702 novomodules
="md5sum $novomodules"
3707 echocheck
"yuv4mpeg support"
3708 if test "$_yuv4mpeg" = yes; then
3709 def_yuv4mpeg
="#define CONFIG_YUV4MPEG 1"
3710 vomodules
="yuv4mpeg $vomodules"
3712 def_yuv4mpeg
="#undef CONFIG_YUV4MPEG"
3713 novomodules
="yuv4mpeg $novomodules"
3715 echores
"$_yuv4mpeg"
3719 if test "$_bl" = yes ; then
3720 def_bl
='#define CONFIG_BL 1'
3721 vomodules
="bl $vomodules"
3723 def_bl
='#undef CONFIG_BL'
3724 novomodules
="bl $novomodules"
3729 echocheck
"DirectFB"
3730 if test "$_directfb" = auto
; then
3733 #include <directfb.h>
3734 #include <directfb_version.h>
3735 #if (DIRECTFB_MAJOR_VERSION << 16 | DIRECTFB_MINOR_VERSION << 8 | DIRECTFB_MICRO_VERSION) < (0 << 16 | 9 << 8 | 22)
3736 #error "DirectFB version too old."
3738 int main(void) { DirectFBInit(0, 0); return 0; }
3740 for _inc_tmp
in "" -I/usr
/local
/include
/directfb
-I/usr
/include
/directfb
-I/usr
/local
/include
; do
3741 cc_check
$_inc_tmp -ldirectfb &&
3742 _directfb
=yes && extra_cflags
="$extra_cflags $_inc_tmp" && break
3745 if test "$_directfb" = yes ; then
3746 def_directfb
='#define CONFIG_DIRECTFB 1'
3747 vomodules
="directfb dfbmga $vomodules"
3748 libs_mplayer
="$libs_mplayer -ldirectfb"
3750 def_directfb
='#undef CONFIG_DIRECTFB'
3751 novomodules
="directfb dfbmga $novomodules"
3753 echores
"$_directfb"
3758 echocheck
"QuickTime"
3759 if test "$quicktime" = auto
; then
3761 statement_check QuickTime
/QuickTime.h
'ImageDescription *desc; EnterMovies(); ExitMovies()' -framework QuickTime
&& quicktime
=yes
3763 if test "$quicktime" = yes ; then
3764 extra_ldflags
="$extra_ldflags -framework QuickTime"
3765 def_quicktime
='#define CONFIG_QUICKTIME 1'
3767 def_quicktime
='#undef CONFIG_QUICKTIME'
3772 if test "$_cocoa" = auto
; then
3774 #include <CoreServices/CoreServices.h>
3775 #include <OpenGL/OpenGL.h>
3777 NSApplicationLoad();
3781 cc_check
-framework Cocoa
-framework OpenGL
&& _cocoa
=yes
3783 if test "$_cocoa" = yes ; then
3784 libs_mplayer
="$libs_mplayer -framework Cocoa -framework OpenGL"
3785 def_cocoa
='#define CONFIG_COCOA 1'
3787 def_cocoa
='#undef CONFIG_COCOA'
3791 echocheck
"CoreVideo"
3792 if test "$_cocoa" = yes && test "$_corevideo" = auto
; then
3794 #include <QuartzCore/CoreVideo.h>
3795 int main(void) { return 0; }
3798 cc_check
-framework Cocoa
-framework QuartzCore
-framework OpenGL
&& _corevideo
=yes
3800 if test "$_corevideo" = yes ; then
3801 vomodules
="corevideo $vomodules"
3802 libs_mplayer
="$libs_mplayer -framework QuartzCore"
3803 def_corevideo
='#define CONFIG_COREVIDEO 1'
3805 novomodules
="corevideo $novomodules"
3806 def_corevideo
='#undef CONFIG_COREVIDEO'
3808 echores
"$_corevideo"
3810 echocheck
"SharedBuffer"
3811 if test "$_sharedbuffer" = auto
; then
3814 NSApplicationLoad();
3818 cc_check
-framework Cocoa
&& _sharedbuffer
=yes
3820 if test "$_sharedbuffer" = yes ; then
3821 vomodules
="sharedbuffer $vomodules"
3822 libs_mplayer
="$libs_mplayer -framework Cocoa"
3823 def_sharedbuffer
='#define CONFIG_SHAREDBUFFER 1'
3825 novomodules
="sharedbuffer $novomodules"
3826 def_sharedbuffer
='#undef CONFIG_SHAREDBUFFER'
3828 echores
"$_sharedbuffer"
3830 depends_on_application_services
(){
3831 test "$_corevideo" = yes
3837 echocheck
"X11 headers presence"
3839 res_comment
="check if the dev(el) packages are installed"
3840 for I
in $
(echo $extra_cflags |
sed s
/-I//g
) /usr
/include
; do
3841 if test -f "$I/X11/Xlib.h" ; then
3847 if test $_cross_compile = no
; then
3848 for I
in /usr
/X11
/include
/usr
/X11R
7/include
/usr
/local
/include
/usr
/X11R
6/include \
3849 /usr
/include
/X11R6
/usr
/openwin
/include
; do
3850 if test -f "$I/X11/Xlib.h" ; then
3851 extra_cflags
="$extra_cflags -I$I"
3853 res_comment
="using $I"
3858 echores
"$_x11_headers"
3862 if test "$_x11" = auto
&& test "$_x11_headers" = yes ; then
3863 for I
in "" -L/usr
/X11R
7/lib
-L/usr
/local
/lib
-L/usr
/X11R
6/lib
-L/usr
/lib
/X11R6 \
3864 -L/usr
/X11
/lib
-L/usr
/lib32
-L/usr
/openwin
/lib
-L/usr
/local
/lib64
-L/usr
/X11R
6/lib64 \
3867 _ld_tmp
="$I -lXext -lX11 $_ld_pthread -Wl,-R$(echo $I | sed s/^-L//)"
3869 _ld_tmp
="$I -lXext -lX11 $_ld_pthread"
3871 statement_check X11
/Xutil.h
'XCreateWindow(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)' $_ld_tmp &&
3873 # Check that there aren't conflicting headers between ApplicationServices
3874 # and X11. On versions of Mac OSX prior to 10.7 the deprecated QuickDraw API
3875 # is included by -framework ApplicationServices and clashes with the X11
3876 # definition of the "Cursor" type.
3877 if darwin
&& depends_on_application_services
&& test "$_x11" = yes ; then
3879 header_check_broken ApplicationServices
/ApplicationServices.h \
3880 X11
/Xutil.h
$_ld_tmp && _x11
=yes
3882 if test "$_x11" = yes ; then
3883 libs_mplayer
="$libs_mplayer $_ld_tmp"
3888 if test "$_x11" = yes ; then
3889 def_x11
='#define CONFIG_X11 1'
3890 vomodules
="x11 xover $vomodules"
3893 def_x11
='#undef CONFIG_X11'
3894 novomodules
="x11 $novomodules"
3895 res_comment
="check if the dev(el) packages are installed"
3899 echocheck
"Xss screensaver extensions"
3900 if test "$_xss" = auto
; then
3902 statement_check
"X11/extensions/scrnsaver.h" 'XScreenSaverSuspend(NULL, True)' -lXss && _xss
=yes
3904 if test "$_xss" = yes ; then
3905 def_xss
='#define CONFIG_XSS 1'
3906 libs_mplayer
="$libs_mplayer -lXss"
3908 def_xss
='#undef CONFIG_XSS'
3915 if test "$_x11" = yes ; then
3917 #include <X11/Xmd.h>
3918 #include <X11/Xlib.h>
3919 #include <X11/Xutil.h>
3920 #include <X11/Xatom.h>
3921 #include <X11/extensions/dpms.h>
3922 int main(void) { DPMSQueryExtension(0, 0, 0); return 0; }
3924 cc_check
-lXdpms && _xdpms3
=yes
3925 statement_check_broken X11
/Xlib.h X11
/extensions
/dpms.h
'DPMSQueryExtension(0, 0, 0)' -lXext && _xdpms4
=yes
3927 if test "$_xdpms4" = yes ; then
3928 def_xdpms
='#define CONFIG_XDPMS 1'
3929 res_comment
="using Xdpms 4"
3931 elif test "$_xdpms3" = yes ; then
3932 def_xdpms
='#define CONFIG_XDPMS 1'
3933 libs_mplayer
="$libs_mplayer -lXdpms"
3934 res_comment
="using Xdpms 3"
3937 def_xdpms
='#undef CONFIG_XDPMS'
3943 if test "$_xv" = auto
&& test "$_x11" = yes ; then
3945 statement_check_broken X11
/Xlib.h X11
/extensions
/Xvlib.h
'XvGetPortAttribute(0, 0, 0, 0)' -lXv && _xv
=yes
3948 if test "$_xv" = yes ; then
3949 def_xv
='#define CONFIG_XV 1'
3950 libs_mplayer
="$libs_mplayer -lXv"
3951 vomodules
="xv $vomodules"
3953 def_xv
='#undef CONFIG_XV'
3954 novomodules
="xv $novomodules"
3960 if test "$_vdpau" = auto
&& test "$_x11" = yes ; then
3962 if test "$_dl" = yes ; then
3963 pkg_config_add
'vdpau >= 0.2' && _vdpau
=yes
3966 if test "$_vdpau" = yes ; then
3967 def_vdpau
='#define CONFIG_VDPAU 1'
3968 vomodules
="vdpau $vomodules"
3970 def_vdpau
='#define CONFIG_VDPAU 0'
3971 novomodules
="vdpau $novomodules"
3976 echocheck
"Xinerama"
3977 if test "$_xinerama" = auto
&& test "$_x11" = yes ; then
3979 statement_check X11
/extensions
/Xinerama.h
'XineramaIsActive(0)' -lXinerama && _xinerama
=yes
3982 if test "$_xinerama" = yes ; then
3983 def_xinerama
='#define CONFIG_XINERAMA 1'
3984 libs_mplayer
="$libs_mplayer -lXinerama"
3986 def_xinerama
='#undef CONFIG_XINERAMA'
3988 echores
"$_xinerama"
3991 # Note: the -lXxf86vm library is the VideoMode extension and though it's not
3992 # needed for DGA, AFAIK every distribution packages together with DGA stuffs
3993 # named 'X extensions' or something similar.
3994 # This check may be useful for future mplayer versions (to change resolution)
3995 # If you run into problems, remove '-lXxf86vm'.
3997 if test "$_vm" = auto
&& test "$_x11" = yes ; then
3999 statement_check_broken X11
/Xlib.h X11
/extensions
/xf86vmode.h
'XF86VidModeQueryExtension(0, 0, 0)' -lXxf86vm && _vm
=yes
4001 if test "$_vm" = yes ; then
4002 def_vm
='#define CONFIG_XF86VM 1'
4003 libs_mplayer
="$libs_mplayer -lXxf86vm"
4005 def_vm
='#undef CONFIG_XF86VM'
4009 # Check for the presence of special keycodes, like audio control buttons
4010 # that XFree86 might have. Used to be bundled with the xf86vm check, but
4011 # has nothing to do with xf86vm and XFree 3.x has xf86vm but does NOT
4012 # have these new keycodes.
4013 echocheck
"XF86keysym"
4014 if test "$_xf86keysym" = auto
&& test "$_x11" = yes ; then
4016 return_check X11
/XF86keysym.h XF86XK_AudioPause
&& _xf86keysym
=yes
4018 if test "$_xf86keysym" = yes ; then
4019 def_xf86keysym
='#define CONFIG_XF86XK 1'
4021 def_xf86keysym
='#undef CONFIG_XF86XK'
4023 echores
"$_xf86keysym"
4026 if test "$_dga2" = auto
&& test "$_x11" = yes ; then
4028 statement_check_broken X11
/Xlib.h X11
/extensions
/Xxf86dga.h
'XDGASetViewport(0, 0, 0, 0, 0)' -lXxf86dga && _dga2
=yes
4030 if test "$_dga1" = auto
&& test "$_dga2" = no
&& test "$_vm" = yes ; then
4032 statement_check_broken X11
/Xlib.h X11
/extensions
/Xxf86dga.h
'XF86DGASetViewPort(0, 0, 0, 0)' -lXxf86dga -lXxf86vm && _dga1
=yes
4036 def_dga
='#undef CONFIG_DGA'
4037 def_dga1
='#undef CONFIG_DGA1'
4038 def_dga2
='#undef CONFIG_DGA2'
4039 if test "$_dga1" = yes ; then
4041 def_dga1
='#define CONFIG_DGA1 1'
4042 res_comment
="using DGA 1.0"
4043 elif test "$_dga2" = yes ; then
4045 def_dga2
='#define CONFIG_DGA2 1'
4046 res_comment
="using DGA 2.0"
4048 if test "$_dga" = yes ; then
4049 def_dga
='#define CONFIG_DGA 1'
4050 libs_mplayer
="$libs_mplayer -lXxf86dga"
4051 vomodules
="dga $vomodules"
4053 novomodules
="dga $novomodules"
4059 if test "$_3dfx" = yes && test "$_dga" = yes ; then
4060 def_3dfx
='#define CONFIG_3DFX 1'
4061 vomodules
="3dfx $vomodules"
4064 def_3dfx
='#undef CONFIG_3DFX'
4065 novomodules
="3dfx $novomodules"
4071 if test "$_ggi" = auto
; then
4073 statement_check ggi
/ggi.h
'ggiInit()' -lggi && _ggi
=yes
4075 if test "$_ggi" = yes ; then
4076 def_ggi
='#define CONFIG_GGI 1'
4077 libs_mplayer
="$libs_mplayer -lggi"
4078 vomodules
="ggi $vomodules"
4080 def_ggi
='#undef CONFIG_GGI'
4081 novomodules
="ggi $novomodules"
4085 echocheck
"GGI extension: libggiwmh"
4086 if test "$_ggiwmh" = auto
; then
4088 statement_check ggi
/wmh.h
'ggiWmhInit()' -lggi -lggiwmh && _ggiwmh
=yes
4090 # needed to get right output on obscure combination
4091 # like --disable-ggi --enable-ggiwmh
4092 if test "$_ggi" = yes && test "$_ggiwmh" = yes ; then
4093 def_ggiwmh
='#define CONFIG_GGIWMH 1'
4094 libs_mplayer
="$libs_mplayer -lggiwmh"
4097 def_ggiwmh
='#undef CONFIG_GGIWMH'
4103 if test "$_aa" = auto
; then
4110 c = aa_autoinit(&aa_defparams);
4111 p = aa_getrenderparams();
4112 aa_autoinitkbd(c, 0);
4116 for _ld_tmp
in "-laa" ; do
4117 cc_check
$_ld_tmp && libs_mplayer
="$libs_mplayer $_ld_tmp" && _aa
=yes && break
4120 if test "$_aa" = yes ; then
4121 def_aa
='#define CONFIG_AA 1'
4123 libs_mplayer
="$libs_mplayer $(aalib-config --libs | cut -d " " -f 2,5,6)"
4125 vomodules
="aa $vomodules"
4127 def_aa
='#undef CONFIG_AA'
4128 novomodules
="aa $novomodules"
4134 if test "$_caca" = auto
; then
4136 if ( caca-config
--version ) >> "$TMPLOG" 2>&1 ; then
4139 #ifdef CACA_API_VERSION_1
4142 int main(void) { caca_init(); return 0; }
4144 cc_check $
(caca-config
--libs) && _caca
=yes
4147 if test "$_caca" = yes ; then
4148 def_caca
='#define CONFIG_CACA 1'
4149 extra_cflags
="$extra_cflags $(caca-config --cflags)"
4150 libs_mplayer
="$libs_mplayer $(caca-config --libs)"
4151 vomodules
="caca $vomodules"
4153 def_caca
='#undef CONFIG_CACA'
4154 novomodules
="caca $novomodules"
4160 if test "$_svga" = auto
; then
4162 header_check vga.h
-lvga $_ld_lm && _svga
=yes
4164 if test "$_svga" = yes ; then
4165 def_svga
='#define CONFIG_SVGALIB 1'
4166 libs_mplayer
="$libs_mplayer -lvga"
4167 vomodules
="svga $vomodules"
4169 def_svga
='#undef CONFIG_SVGALIB'
4170 novomodules
="svga $novomodules"
4176 if test "$_fbdev" = auto
; then
4180 if test "$_fbdev" = yes ; then
4181 def_fbdev
='#define CONFIG_FBDEV 1'
4182 vomodules
="fbdev $vomodules"
4184 def_fbdev
='#undef CONFIG_FBDEV'
4185 novomodules
="fbdev $novomodules"
4192 if test "$_dvb" = auto
; then
4196 #include <sys/ioctl.h>
4200 #include <linux/dvb/dmx.h>
4201 #include <linux/dvb/frontend.h>
4202 #include <linux/dvb/video.h>
4203 #include <linux/dvb/audio.h>
4204 int main(void) {return 0;}
4206 for _inc_tmp
in "" "-I/usr/src/DVB/include" ; do
4207 cc_check
$_inc_tmp && _dvb
=yes &&
4208 extra_cflags
="$extra_cflags $_inc_tmp" && break
4212 if test "$_dvb" = yes ; then
4214 inputmodules
="dvb $inputmodules"
4215 def_dvb
='#define CONFIG_DVB 1'
4216 def_dvbin
='#define CONFIG_DVBIN 1'
4217 aomodules
="mpegpes(dvb) $aomodules"
4218 vomodules
="mpegpes(dvb) $vomodules"
4221 noinputmodules
="dvb $noinputmodules"
4222 def_dvb
='#undef CONFIG_DVB'
4223 def_dvbin
='#undef CONFIG_DVBIN '
4224 aomodules
="mpegpes(file) $aomodules"
4225 vomodules
="mpegpes(file) $vomodules"
4229 echocheck
"PNG support"
4230 if test "$_png" = auto
; then
4237 printf("png.h : %s\n", PNG_LIBPNG_VER_STRING);
4238 printf("libpng: %s\n", png_libpng_ver);
4239 return strcmp(PNG_LIBPNG_VER_STRING, png_libpng_ver);
4242 cc_check
-lpng -lz $_ld_lm && _png
=yes
4245 if test "$_png" = yes ; then
4246 def_png
='#define CONFIG_PNG 1'
4247 extra_ldflags
="$extra_ldflags -lpng -lz"
4249 def_png
='#undef CONFIG_PNG'
4252 echocheck
"MNG support"
4253 if test "$_mng" = auto
; then
4255 return_statement_check libmng.h
'const char * p_ver = mng_version_text()' '!p_ver || p_ver[0] == 0' -lmng -lz $_ld_lm && _mng
=yes
4258 if test "$_mng" = yes ; then
4259 def_mng
='#define CONFIG_MNG 1'
4260 extra_ldflags
="$extra_ldflags -lmng -lz"
4262 def_mng
='#undef CONFIG_MNG'
4265 echocheck
"JPEG support"
4266 if test "$_jpeg" = auto
; then
4268 header_check_broken stdio.h jpeglib.h
-ljpeg $_ld_lm && _jpeg
=yes
4272 if test "$_jpeg" = yes ; then
4273 def_jpeg
='#define CONFIG_JPEG 1'
4274 vomodules
="jpeg $vomodules"
4275 extra_ldflags
="$extra_ldflags -ljpeg"
4277 def_jpeg
='#undef CONFIG_JPEG'
4278 novomodules
="jpeg $novomodules"
4283 echocheck
"PNM support"
4284 if test "$_pnm" = yes; then
4285 def_pnm
="#define CONFIG_PNM 1"
4286 vomodules
="pnm $vomodules"
4288 def_pnm
="#undef CONFIG_PNM"
4289 novomodules
="pnm $novomodules"
4295 echocheck
"GIF support"
4296 # This is to appease people who want to force gif support.
4297 # If it is forced to yes, then we still do checks to determine
4298 # which gif library to use.
4299 if test "$_gif" = yes ; then
4304 if test "$_gif" = auto
; then
4306 for _ld_gif
in "-lungif" "-lgif" ; do
4307 statement_check gif_lib.h
'QuantizeBuffer(0, 0, 0, 0, 0, 0, 0, 0)' $_ld_gif && _gif
=yes && break
4311 # If no library was found, and the user wants support forced,
4312 # then we force it on with libgif, as this is the safest
4313 # assumption IMHO. (libungif & libregif both create symbolic
4314 # links to libgif. We also assume that no x11 support is needed,
4315 # because if you are forcing this, then you _should_ know what
4316 # you are doing. [ Besides, package maintainers should never
4317 # have compiled x11 deps into libungif in the first place. ] )
4320 if test "$_force_gif" = yes && test "$_gif" = no
; then
4325 if test "$_gif" = yes ; then
4326 def_gif
='#define CONFIG_GIF 1'
4327 codecmodules
="gif $codecmodules"
4328 vomodules
="gif89a $vomodules"
4329 res_comment
="old version, some encoding functions disabled"
4330 def_gif_4
='#undef CONFIG_GIF_4'
4331 extra_ldflags
="$extra_ldflags $_ld_gif"
4337 #include <gif_lib.h>
4338 static void catch(int sig) { exit(1); }
4340 signal(SIGSEGV, catch); // catch segfault
4341 printf("EGifPutExtensionFirst is at address %p\n", EGifPutExtensionFirst);
4342 EGifSetGifVersion("89a"); // this will segfault a buggy gif lib.
4346 if cc_check
"$_ld_gif" ; then
4347 def_gif_4
='#define CONFIG_GIF_4 1'
4351 def_gif
='#undef CONFIG_GIF'
4352 def_gif_4
='#undef CONFIG_GIF_4'
4353 novomodules
="gif89a $novomodules"
4354 nocodecmodules
="gif $nocodecmodules"
4359 case "$_gif" in yes*)
4360 echocheck
"broken giflib workaround"
4361 def_gif_tvt_hack
='#define CONFIG_GIF_TVT_HACK 1'
4365 #include <gif_lib.h>
4367 GifFileType gif = {.UserData = NULL};
4368 printf("UserData is at address %p\n", gif.UserData);
4372 if cc_check
"$_ld_gif" ; then
4373 def_gif_tvt_hack
='#undef CONFIG_GIF_TVT_HACK'
4382 echocheck
"VESA support"
4383 if test "$_vesa" = auto
; then
4385 statement_check vbe.h
'vbeInit()' -lvbe -llrmi && _vesa
=yes
4387 if test "$_vesa" = yes ; then
4388 def_vesa
='#define CONFIG_VESA 1'
4389 libs_mplayer
="$libs_mplayer -lvbe -llrmi"
4390 vomodules
="vesa $vomodules"
4392 def_vesa
='#undef CONFIG_VESA'
4393 novomodules
="vesa $novomodules"
4405 def_sdl_sdl_h
="#undef CONFIG_SDL_SDL_H"
4406 if test -z "$_sdlconfig" ; then
4407 if ( sdl-config
--version ) >>"$TMPLOG" 2>&1 ; then
4408 _sdlconfig
="sdl-config"
4409 elif ( sdl11-config
--version ) >>"$TMPLOG" 2>&1 ; then
4410 _sdlconfig
="sdl11-config"
4415 if test "$_sdl" = auto ||
test "$_sdl" = yes ; then
4417 #ifdef CONFIG_SDL_SDL_H
4418 #include <SDL/SDL.h>
4423 // we allow SDL hacking our main() only on OSX
4426 int main(int argc, char *argv[]) {
4427 SDL_Init(SDL_INIT_VIDEO|SDL_INIT_NOPARACHUTE);
4432 for _ld_tmp
in "-lSDL" "-lSDL -lpthread" "-lSDL -lwinmm -lgdi32" "-lSDL -lwinmm -lgdi32 -ldxguid" ; do
4433 if cc_check
-DCONFIG_SDL_SDL_H $_inc_tmp $_ld_tmp ; then
4435 def_sdl_sdl_h
="#define CONFIG_SDL_SDL_H 1"
4439 if test "$_sdl" = no
&& "$_sdlconfig" --version >>"$TMPLOG" 2>&1 ; then
4440 res_comment
="using $_sdlconfig"
4442 _inc_tmp
="$($_sdlconfig --cflags | cut -d " " -f 1,5,6 | sed s/no-cygwin/cygwin/)"
4443 _ld_tmp
="$($_sdlconfig --libs | cut -d " " -f 1,4,6 | sed s/no-cygwin/cygwin/)"
4445 _inc_tmp
=$
($_sdlconfig --cflags |
sed s
/-Dmain=SDL_main
//)
4446 _ld_tmp
=$
($_sdlconfig --libs |
sed -e s
/-mwindows// -e s
/-lmingw32//)
4448 _inc_tmp
="$($_sdlconfig --cflags)"
4449 _ld_tmp
="$($_sdlconfig --libs)"
4451 if cc_check
$_inc_tmp $_ld_tmp >>"$TMPLOG" 2>&1 ; then
4453 elif cc_check
$_inc_tmp $_ld_tmp -lstdc++ >>"$TMPLOG" 2>&1 ; then
4454 # HACK for BeOS/Haiku SDL
4455 _ld_tmp
="$_ld_tmp -lstdc++"
4460 if test "$_sdl" = yes ; then
4461 def_sdl
='#define CONFIG_SDL 1'
4462 extra_cflags
="$extra_cflags $_inc_tmp"
4463 libs_mplayer
="$libs_mplayer $_ld_tmp"
4464 vomodules
="sdl $vomodules"
4465 aomodules
="sdl $aomodules"
4467 def_sdl
='#undef CONFIG_SDL'
4468 novomodules
="sdl $novomodules"
4469 noaomodules
="sdl $noaomodules"
4474 # make sure this stays below CoreVideo to avoid issues due to namespace
4475 # conflicts between -lGL and -framework OpenGL
4477 #Note: this test is run even with --enable-gl since we autodetect linker flags
4478 if (test "$_x11" = yes ||
test "$_sdl" = yes ||
test "$_cocoa" = yes || win32
) && test "$_gl" != no
; then
4481 #include <windows.h>
4483 #elif defined(GL_SDL)
4485 #ifdef CONFIG_SDL_SDL_H
4486 #include <SDL/SDL.h>
4491 // we allow SDL hacking our main() only on OSX
4496 #include <X11/Xlib.h>
4499 int main(int argc, char *argv[]) {
4502 wglCreateContext(dc);
4503 #elif defined(GL_SDL)
4504 SDL_GL_SwapBuffers();
4506 glXCreateContext(NULL, NULL, NULL, True);
4513 if test "$_x11" = yes ; then
4514 for _ld_tmp
in "" -lGL "-lGL -lXdamage" "-lGL $_ld_pthread" ; do
4515 if cc_check
$_ld_tmp $_ld_lm ; then
4518 libs_mplayer
="$libs_mplayer $_ld_tmp $_ld_dl"
4523 if win32
&& cc_check
-DGL_WIN32 -lopengl32 ; then
4526 libs_mplayer
="$libs_mplayer -lopengl32 -lgdi32"
4528 if test "$_cocoa" = yes ; then
4532 # last so it can reuse any linker etc. flags detected before
4533 if test "$_sdl" = yes ; then
4534 if cc_check
-DGL_SDL ||
4535 cc_check
-DCONFIG_SDL_SDL_H -DGL_SDL ; then
4538 elif cc_check
-DGL_SDL -lGL ||
4539 cc_check
-DCONFIG_SDL_SDL_H -DGL_SDL -lGL ; then
4542 libs_mplayer
="$libs_mplayer -lGL"
4548 if test "$_gl" = yes ; then
4549 def_gl
='#define CONFIG_GL 1'
4550 res_comment
="backends:"
4551 if test "$_gl_cocoa" = yes ; then
4552 def_gl_cocoa
='#define CONFIG_GL_COCOA 1'
4553 res_comment
="$res_comment cocoa"
4555 if test "$_gl_win32" = yes ; then
4556 def_gl_win32
='#define CONFIG_GL_WIN32 1'
4557 res_comment
="$res_comment win32"
4559 if test "$_gl_x11" = yes ; then
4560 def_gl_x11
='#define CONFIG_GL_X11 1'
4561 res_comment
="$res_comment x11"
4563 if test "$_gl_sdl" = yes ; then
4564 def_gl_sdl
='#define CONFIG_GL_SDL 1'
4565 res_comment
="$res_comment sdl"
4567 vomodules
="opengl $vomodules"
4569 def_gl
='#undef CONFIG_GL'
4570 def_gl_cocoa
='#undef CONFIG_GL_COCOA'
4571 def_gl_win32
='#undef CONFIG_GL_WIN32'
4572 def_gl_x11
='#undef CONFIG_GL_X11'
4573 def_gl_sdl
='#undef CONFIG_GL_SDL'
4574 novomodules
="opengl $novomodules"
4581 echocheck
"Windows waveout"
4582 if test "$_win32waveout" = auto
; then
4584 header_check_broken windows.h mmsystem.h
-lwinmm && _win32waveout
=yes
4586 if test "$_win32waveout" = yes ; then
4587 def_win32waveout
='#define CONFIG_WIN32WAVEOUT 1'
4588 libs_mplayer
="$libs_mplayer -lwinmm"
4589 aomodules
="win32 $aomodules"
4591 def_win32waveout
='#undef CONFIG_WIN32WAVEOUT'
4592 noaomodules
="win32 $noaomodules"
4594 echores
"$_win32waveout"
4596 echocheck
"Direct3D"
4597 if test "$_direct3d" = auto
; then
4599 header_check d3d9.h
&& _direct3d
=yes
4601 if test "$_direct3d" = yes ; then
4602 def_direct3d
='#define CONFIG_DIRECT3D 1'
4603 vomodules
="direct3d $vomodules"
4605 def_direct3d
='#undef CONFIG_DIRECT3D'
4606 novomodules
="direct3d $novomodules"
4608 echores
"$_direct3d"
4611 if test "$_directx" = auto
; then
4615 int main(void) { return 0; }
4618 cc_check
-lgdi32 && _directx
=yes
4620 if test "$_directx" = yes ; then
4621 def_directx
='#define CONFIG_DIRECTX 1'
4622 libs_mplayer
="$libs_mplayer -lgdi32"
4623 vomodules
="directx $vomodules"
4624 aomodules
="dsound $aomodules"
4626 def_directx
='#undef CONFIG_DIRECTX'
4627 novomodules
="directx $novomodules"
4628 noaomodules
="dsound $noaomodules"
4636 if test "$_dxr3" = auto
; then
4638 header_check linux
/em8300.h
&& _dxr3
=yes
4640 if test "$_dxr3" = yes ; then
4641 def_dxr3
='#define CONFIG_DXR3 1'
4642 vomodules
="dxr3 $vomodules"
4644 def_dxr3
='#undef CONFIG_DXR3'
4645 novomodules
="dxr3 $novomodules"
4650 echocheck
"IVTV TV-Out (pre linux-2.6.24)"
4651 if test "$_ivtv" = auto
; then
4653 #include <sys/time.h>
4654 #include <linux/videodev2.h>
4655 #include <linux/ivtv.h>
4656 #include <sys/ioctl.h>
4658 struct ivtv_cfg_stop_decode sd;
4659 struct ivtv_cfg_start_decode sd1;
4660 ioctl(0, IVTV_IOC_START_DECODE, &sd1);
4661 ioctl(0, IVTV_IOC_STOP_DECODE, &sd);
4665 cc_check
&& _ivtv
=yes
4667 if test "$_ivtv" = yes ; then
4668 def_ivtv
='#define CONFIG_IVTV 1'
4669 vomodules
="ivtv $vomodules"
4670 aomodules
="ivtv $aomodules"
4672 def_ivtv
='#undef CONFIG_IVTV'
4673 novomodules
="ivtv $novomodules"
4674 noaomodules
="ivtv $noaomodules"
4679 echocheck
"V4L2 MPEG Decoder"
4680 if test "$_v4l2" = auto
; then
4682 #include <sys/time.h>
4683 #include <linux/videodev2.h>
4684 #include <linux/version.h>
4686 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22)
4687 #error kernel headers too old, need 2.6.22
4689 struct v4l2_ext_controls ctrls;
4690 ctrls.ctrl_class = V4L2_CTRL_CLASS_MPEG;
4695 cc_check
&& _v4l2
=yes
4697 if test "$_v4l2" = yes ; then
4698 def_v4l2
='#define CONFIG_V4L2_DECODER 1'
4699 vomodules
="v4l2 $vomodules"
4700 aomodules
="v4l2 $aomodules"
4702 def_v4l2
='#undef CONFIG_V4L2_DECODER'
4703 novomodules
="v4l2 $novomodules"
4704 noaomodules
="v4l2 $noaomodules"
4715 echocheck
"OSS Audio"
4716 if test "$_ossaudio" = auto
; then
4718 return_check
$_soundcard_header SNDCTL_DSP_SETFRAGMENT
&& _ossaudio
=yes
4720 if test "$_ossaudio" = yes ; then
4721 def_ossaudio
='#define CONFIG_OSS_AUDIO 1'
4722 aomodules
="oss $aomodules"
4724 #include <$_soundcard_header>
4725 #ifdef OPEN_SOUND_SYSTEM
4726 int main(void) { return 0; }
4728 #error Not the real thing
4732 cc_check
&& _real_ossaudio
=yes
4733 if test "$_real_ossaudio" = yes; then
4734 def_ossaudio_devdsp
='#define PATH_DEV_DSP "/dev/dsp"'
4735 # Check for OSS4 headers (override default headers)
4736 # Does not apply to systems where OSS4 is native (e.g. FreeBSD)
4737 if test -f /etc
/oss.conf
; then
4739 _ossinc
="$OSSLIBDIR/include"
4740 if test -f "$_ossinc/sys/soundcard.h"; then
4741 extra_cflags
="-I$_ossinc $extra_cflags"
4744 elif netbsd || openbsd
; then
4745 def_ossaudio_devdsp
='#define PATH_DEV_DSP "/dev/sound"'
4746 extra_ldflags
="$extra_ldflags -lossaudio"
4748 def_ossaudio_devdsp
='#define PATH_DEV_DSP "/dev/dsp"'
4750 def_ossaudio_devmixer
='#define PATH_DEV_MIXER "/dev/mixer"'
4752 def_ossaudio
='#undef CONFIG_OSS_AUDIO'
4753 def_ossaudio_devdsp
='#define PATH_DEV_DSP ""'
4754 def_ossaudio_devmixer
='#define PATH_DEV_MIXER ""'
4755 noaomodules
="oss $noaomodules"
4757 echores
"$_ossaudio"
4761 if test "$_rsound" = auto
; then
4763 statement_check rsound.h
'rsd_init(NULL);' -lrsound && _rsound
=yes
4767 if test "$_rsound" = yes ; then
4768 def_rsound
='#define CONFIG_RSOUND 1'
4769 aomodules
="rsound $aomodules"
4770 libs_mplayer
="$libs_mplayer -lrsound"
4772 def_rsound
='#undef CONFIG_RSOUND'
4773 noaomodules
="rsound $noaomodules"
4778 if test "$_nas" = auto
; then
4780 header_check audio
/audiolib.h
$_ld_lm -laudio -lXt && _nas
=yes
4782 if test "$_nas" = yes ; then
4783 def_nas
='#define CONFIG_NAS 1'
4784 libs_mplayer
="$libs_mplayer -laudio -lXt"
4785 aomodules
="nas $aomodules"
4787 noaomodules
="nas $noaomodules"
4788 def_nas
='#undef CONFIG_NAS'
4794 if test "$_pulse" = auto
; then
4796 if pkg_config_add
'libpulse >= 0.9' ; then
4802 if test "$_pulse" = yes ; then
4803 def_pulse
='#define CONFIG_PULSE 1'
4804 aomodules
="pulse $aomodules"
4806 def_pulse
='#undef CONFIG_PULSE'
4807 noaomodules
="pulse $noaomodules"
4811 echocheck
"PortAudio"
4812 if test "$_portaudio" = auto
&& test "$_pthreads" != yes ; then
4814 res_comment
="pthreads not enabled"
4816 if test "$_portaudio" = auto
; then
4818 if pkg_config_add
'portaudio-2.0 >= 19' ; then
4822 echores
"$_portaudio"
4824 if test "$_portaudio" = yes ; then
4825 def_portaudio
='#define CONFIG_PORTAUDIO 1'
4826 aomodules
="portaudio $aomodules"
4828 def_portaudio
='#undef CONFIG_PORTAUDIO'
4829 noaomodules
="portaudio $noaomodules"
4834 if test "$_jack" = auto
; then
4836 if pkg_config_add jack
; then
4841 if test "$_jack" = yes ; then
4842 def_jack
='#define CONFIG_JACK 1'
4843 aomodules
="jack $aomodules"
4845 noaomodules
="jack $noaomodules"
4850 if test "$_openal" = auto
; then
4854 #include <OpenAL/al.h>
4859 alSourceQueueBuffers(0, 0, 0);
4860 // alGetSourcei(0, AL_SAMPLE_OFFSET, 0);
4864 for I
in "-lopenal" "-lopenal32" "-framework OpenAL" ; do
4865 cc_check
$I && _openal
=yes && break
4866 cc_check
-DOPENAL_AL_H=1 $I && def_openal_h
='#define OPENAL_AL_H 1' && _openal
=yes && break
4868 test "$_openal" = yes && libs_mplayer
="$libs_mplayer $I"
4870 if test "$_openal" = yes ; then
4871 def_openal
='#define CONFIG_OPENAL 1'
4872 aomodules
="openal $aomodules"
4874 noaomodules
="openal $noaomodules"
4878 echocheck
"ALSA audio"
4879 if test "$_alloca" != yes ; then
4881 res_comment
="alloca missing"
4883 if test "$_alsa" = auto
; then
4885 if pkg_config_add
"alsa >= 1.0.9" ; then
4889 def_alsa
='#undef CONFIG_ALSA'
4890 if test "$_alsa" = yes ; then
4891 aomodules
="alsa $aomodules"
4892 def_alsa
='#define CONFIG_ALSA 1'
4894 noaomodules
="alsa $noaomodules"
4899 echocheck
"Sun audio"
4900 if test "$_sunaudio" = auto
; then
4902 #include <sys/types.h>
4903 #include <sys/audioio.h>
4904 int main(void) { audio_info_t info; AUDIO_INITINFO(&info); return 0; }
4907 cc_check
&& _sunaudio
=yes
4909 if test "$_sunaudio" = yes ; then
4910 def_sunaudio
='#define CONFIG_SUN_AUDIO 1'
4911 aomodules
="sun $aomodules"
4913 def_sunaudio
='#undef CONFIG_SUN_AUDIO'
4914 noaomodules
="sun $noaomodules"
4916 echores
"$_sunaudio"
4920 echocheck
"CoreAudio"
4921 if test "$_coreaudio" = auto
; then
4923 #include <CoreAudio/CoreAudio.h>
4924 #include <AudioToolbox/AudioToolbox.h>
4925 #include <AudioUnit/AudioUnit.h>
4926 int main(void) { return 0; }
4929 cc_check
-framework CoreAudio
-framework AudioUnit
-framework AudioToolbox
&& _coreaudio
=yes
4931 if test "$_coreaudio" = yes ; then
4932 libs_mplayer
="$libs_mplayer -framework CoreAudio -framework AudioUnit -framework AudioToolbox"
4933 def_coreaudio
='#define CONFIG_COREAUDIO 1'
4934 aomodules
="coreaudio $aomodules"
4936 def_coreaudio
='#undef CONFIG_COREAUDIO'
4937 noaomodules
="coreaudio $noaomodules"
4943 # set default CD/DVD devices
4945 default_cdrom_device
="D:"
4947 default_cdrom_device
="/dev/disk1"
4948 elif dragonfly
; then
4949 default_cdrom_device
="/dev/cd0"
4951 default_cdrom_device
="/dev/acd0"
4953 default_cdrom_device
="/dev/rcd0c"
4955 default_cdrom_device
="/vol/dev/aliases/cdrom0"
4956 # Modern Solaris versions use HAL instead of the vold daemon, the volfs
4957 # file system and the volfs service.
4958 test -r "/cdrom/cdrom0" && default_cdrom_device
="/cdrom/cdrom0"
4960 default_cdrom_device
="a1ide.device:2"
4962 default_cdrom_device
="/dev/cdrom"
4965 if win32 || dragonfly || freebsd || openbsd || sunos || amigaos
; then
4966 default_dvd_device
=$default_cdrom_device
4968 default_dvd_device
="/dev/rdiskN"
4970 default_dvd_device
="/dev/dvd"
4974 echocheck
"VCD support"
4975 if test "$_vcd" = auto
; then
4977 if linux || freebsd || netbsd || openbsd || dragonfly || bsdos || darwin || sunos
; then
4980 header_check
ddk
/ntddcdrm.h
&& _vcd
=yes
4983 if test "$_vcd" = yes; then
4984 inputmodules
="vcd $inputmodules"
4985 def_vcd
='#define CONFIG_VCD 1'
4987 def_vcd
='#undef CONFIG_VCD'
4988 noinputmodules
="vcd $noinputmodules"
4989 res_comment
="not supported on this OS"
4995 echocheck
"Blu-ray support"
4996 if test "$_bluray" = auto
; then
4998 pkg_config_add
'libbluray >= 0.2.1' && _bluray
=yes
5000 if test "$_bluray" = yes ; then
5001 def_bluray
='#define CONFIG_LIBBLURAY 1'
5002 inputmodules
="bluray $inputmodules"
5004 def_bluray
='#undef CONFIG_LIBBLURAY'
5005 noinputmodules
="bluray $noinputmodules"
5010 if test "$_dvdread_internal" = auto
&& test ! -f "libdvdread4/dvd_reader.c" ; then
5011 _dvdread_internal
=no
5013 if test "$_dvdread_internal" = auto
; then
5014 _dvdread_internal
=no
5016 if (linux || freebsd || netbsd || openbsd || dragonfly || sunos || hpux
) &&
5017 (test "$_dvd" = yes ||
test "$_cdrom" = yes ||
test "$_cdio" = yes ||
5018 test "$_dvdio" = yes ||
test "$_bsdi_dvd" = yes) ||
5019 darwin || win32
; then
5020 _dvdread_internal
=yes
5022 extra_cflags
="-Ilibdvdread4 $extra_cflags"
5024 elif test "$_dvdread" = auto
; then
5026 if test "$_dl" = yes; then
5027 _dvdreadcflags
=$
($_dvdreadconfig --cflags 2> /dev
/null
)
5028 _dvdreadlibs
=$
($_dvdreadconfig --libs 2> /dev
/null
)
5029 if header_check dvdread
/dvd_reader.h
$_dvdreadcflags $_dvdreadlibs $_ld_dl ; then
5031 extra_cflags
="$extra_cflags $_dvdreadcflags"
5032 extra_ldflags
="$extra_ldflags $_dvdreadlibs"
5033 res_comment
="external"
5038 if test "$_dvdread_internal" = yes; then
5039 def_dvdread
='#define CONFIG_DVDREAD 1'
5040 inputmodules
="dvdread(internal) $inputmodules"
5041 res_comment
="internal"
5042 elif test "$_dvdread" = yes; then
5043 def_dvdread
='#define CONFIG_DVDREAD 1'
5044 extra_ldflags
="$extra_ldflags -ldvdread"
5045 inputmodules
="dvdread(external) $inputmodules"
5046 res_comment
="external"
5048 def_dvdread
='#undef CONFIG_DVDREAD'
5049 noinputmodules
="dvdread $noinputmodules"
5054 echocheck
"internal libdvdcss"
5055 if test "$_libdvdcss_internal" = auto
; then
5056 _libdvdcss_internal
=no
5057 test "$_dvdread_internal" = yes && test -d libdvdcss
&& _libdvdcss_internal
=yes
5058 hpux
&& test "$_hpux_scsi_h" = no
&& _libdvdcss_internal
=no
5060 if test "$_libdvdcss_internal" = yes ; then
5061 if linux || netbsd || openbsd || bsdos
; then
5062 def_dvd_linux
='#define HAVE_LINUX_DVD_STRUCT 1'
5063 openbsd
&& def_dvd_openbsd
='#define HAVE_OPENBSD_DVD_STRUCT 1'
5064 elif freebsd || dragonfly
; then
5065 def_dvd_bsd
='#define HAVE_BSD_DVD_STRUCT 1'
5067 def_dvd_darwin
='#define DARWIN_DVD_IOCTL'
5068 extra_ldflags
="$extra_ldflags -framework IOKit -framework Carbon"
5070 cflags_libdvdcss
="-DSYS_CYGWIN -DWIN32"
5072 cflags_libdvdcss
="-DSYS_BEOS"
5074 cflags_libdvdcss_dvdread
="-Ilibdvdcss"
5075 def_dvdcss
="#define HAVE_DVDCSS_DVDCSS_H 1"
5076 inputmodules
="libdvdcss(internal) $inputmodules"
5078 noinputmodules
="libdvdcss(internal) $noinputmodules"
5080 echores
"$_libdvdcss_internal"
5084 if test "$_libcdio" = auto
; then
5086 if pkg_config_add libcdio_paranoia
; then
5090 if test "$_libcdio" = yes ; then
5092 def_cdda
='#define CONFIG_CDDA 1'
5093 test $_cddb = auto
&& test $networking = yes && _cddb
=yes
5094 inputmodules
="cdda $inputmodules"
5098 def_cdda
='#undef CONFIG_CDDA'
5099 noinputmodules
="cdda $noinputmodules"
5103 if test "$_cddb" = yes ; then
5104 def_cddb
='#define CONFIG_CDDB 1'
5105 inputmodules
="cddb $inputmodules"
5108 def_cddb
='#undef CONFIG_CDDB'
5109 noinputmodules
="cddb $noinputmodules"
5112 echocheck
"bitmap font support"
5113 if test "$_bitmap_font" = yes ; then
5114 def_bitmap_font
="#define CONFIG_BITMAP_FONT 1"
5116 def_bitmap_font
="#undef CONFIG_BITMAP_FONT"
5118 echores
"$_bitmap_font"
5121 echocheck
"freetype >= 2.0.9"
5123 # freetype depends on iconv
5124 if test "$_iconv" = no
; then
5126 res_comment
="iconv support needed"
5129 if test "$_freetype" = auto
; then
5130 if pkg_config_add freetype2
; then
5133 die
"Unable to find development files for libfreetype. Aborting. If you really mean to compile without FreeType support use --disable-freetype."
5136 if test "$_freetype" = yes ; then
5137 def_freetype
='#define CONFIG_FREETYPE 1'
5139 def_freetype
='#undef CONFIG_FREETYPE'
5141 echores
"$_freetype"
5143 if test "$_freetype" = no
; then
5145 res_comment
="FreeType support needed"
5147 echocheck
"fontconfig"
5148 if test "$_fontconfig" = auto
; then
5149 if pkg_config_add
'fontconfig >= 2.4.2' ; then
5152 die
"Unable to find development files for libfontconfig. Aborting. If you really mean to compile without fontconfig support use --disable-fontconfig."
5155 if test "$_fontconfig" = yes ; then
5156 def_fontconfig
='#define CONFIG_FONTCONFIG 1'
5158 def_fontconfig
='#undef CONFIG_FONTCONFIG'
5160 echores
"$_fontconfig"
5163 echocheck
"SSA/ASS support"
5164 if test "$_ass" = auto
; then
5165 if pkg_config_add libass
; then
5167 def_ass
='#define CONFIG_ASS 1'
5169 die
"Unable to find development files for libass. Aborting. If you really mean to compile without libass support use --disable-libass."
5172 def_ass
='#undef CONFIG_ASS'
5177 echocheck
"fribidi with charsets"
5178 if test "$_fribidi" = auto
; then
5180 if pkg_config_add fribidi
; then
5184 if test "$_fribidi" = yes ; then
5185 def_fribidi
='#define CONFIG_FRIBIDI 1'
5187 def_fribidi
='#undef CONFIG_FRIBIDI'
5193 if test "$_enca" = auto
; then
5195 statement_check enca.h
'enca_get_languages(NULL)' -lenca $_ld_lm && _enca
=yes
5197 if test "$_enca" = yes ; then
5198 def_enca
='#define CONFIG_ENCA 1'
5199 extra_ldflags
="$extra_ldflags -lenca"
5201 def_enca
='#undef CONFIG_ENCA'
5208 statement_check zlib.h
'inflate(0, Z_NO_FLUSH)' -lz && _zlib
=yes
5209 if test "$_zlib" = yes ; then
5210 def_zlib
='#define CONFIG_ZLIB 1'
5211 extra_ldflags
="$extra_ldflags -lz"
5213 def_zlib
='#define CONFIG_ZLIB 0'
5219 if test "$_rtc" = auto
; then
5221 #include <sys/ioctl.h>
5223 #include <linux/rtc.h>
5226 #define RTC_PIE_ON RTCIO_PIE_ON
5228 int main(void) { return RTC_PIE_ON; }
5231 cc_check
&& _rtc
=yes
5234 if test "$_rtc" = yes ; then
5235 def_rtc
='#define HAVE_RTC 1'
5237 def_rtc
='#undef HAVE_RTC'
5242 echocheck
"mad support"
5243 if test "$_mad" = auto
; then
5245 header_check mad.h
-lmad && _mad
=yes
5247 if test "$_mad" = yes ; then
5248 def_mad
='#define CONFIG_LIBMAD 1'
5249 extra_ldflags
="$extra_ldflags -lmad"
5250 codecmodules
="libmad $codecmodules"
5252 def_mad
='#undef CONFIG_LIBMAD'
5253 nocodecmodules
="libmad $nocodecmodules"
5257 echocheck
"OggVorbis support"
5258 if test "$_libvorbis" = auto
; then
5260 statement_check vorbis
/codec.h
'vorbis_packet_blocksize(0, 0)' -lvorbis -logg $_ld_lm && _libvorbis
=yes && _tremor
=no
5261 elif test "$_libvorbis" = yes ; then
5264 if test "$_tremor" = auto
; then
5266 statement_check tremor
/ivorbiscodec.h
'vorbis_packet_blocksize(0, 0)' -logg -lvorbisidec $_ld_lm && _tremor
=yes
5268 if test "$_tremor" = yes ; then
5270 def_vorbis
='#define CONFIG_OGGVORBIS 1'
5271 def_tremor
='#define CONFIG_TREMOR 1'
5272 codecmodules
="tremor(external) $codecmodules"
5273 res_comment
="external Tremor"
5274 extra_ldflags
="$extra_ldflags -logg -lvorbisidec"
5275 elif test "$_libvorbis" = yes ; then
5277 def_vorbis
='#define CONFIG_OGGVORBIS 1'
5278 codecmodules
="libvorbis $codecmodules"
5279 res_comment
="libvorbis"
5280 extra_ldflags
="$extra_ldflags -lvorbis -logg"
5283 nocodecmodules
="libvorbis $nocodecmodules"
5287 echocheck
"libspeex (version >= 1.1 required)"
5288 if test "$_speex" = auto
; then
5292 #include <speex/speex.h>
5293 int main(void) { SpeexBits bits; void *dec = NULL; speex_decode_int(dec, &bits, dec); return 0; }
5295 cc_check
-lspeex $_ld_lm && _speex
=yes
5297 if test "$_speex" = yes ; then
5298 def_speex
='#define CONFIG_SPEEX 1'
5299 extra_ldflags
="$extra_ldflags -lspeex"
5300 codecmodules
="speex $codecmodules"
5302 def_speex
='#undef CONFIG_SPEEX'
5303 nocodecmodules
="speex $nocodecmodules"
5307 echocheck
"OggTheora support"
5308 if test "$_theora" = auto
; then
5310 if pkg_config_add theora
; then
5314 if test "$_theora" = yes ; then
5315 def_theora
='#define CONFIG_OGGTHEORA 1'
5316 codecmodules
="libtheora $codecmodules"
5318 def_theora
='#undef CONFIG_OGGTHEORA'
5319 nocodecmodules
="libtheora $nocodecmodules"
5323 # Any version of libmpg123 that knows MPG123_RESYNC_LIMIT shall be fine.
5324 # That is, 1.2.0 onwards. Recommened is 1.14 onwards, though.
5325 echocheck
"mpg123 support"
5326 def_mpg123
='#undef CONFIG_MPG123'
5327 if test "$_mpg123" = auto
; then
5329 pkg_config_add
'libmpg123 >= 1.2.0' && _mpg123
=yes
5331 if test "$_mpg123" = yes ; then
5332 def_mpg123
='#define CONFIG_MPG123 1'
5333 codecmodules
="mpg123 $codecmodules"
5335 nocodecmodules
="mpg123 $nocodecmodules"
5339 echocheck
"liba52 support"
5340 def_liba52
='#undef CONFIG_LIBA52'
5341 if test "$_liba52" = auto
; then
5344 #include <inttypes.h>
5345 #include <a52dec/a52.h>
5346 int main(void) { a52_state_t *testHand; testHand=a52_init(0); return 0; }
5348 cc_check
-la52 && _liba52
=yes && extra_ldflags
="$extra_ldflags -la52"
5350 if test "$_liba52" = yes ; then
5351 def_liba52
='#define CONFIG_LIBA52 1'
5352 codecmodules
="liba52 $codecmodules"
5354 nocodecmodules
="liba52 $nocodecmodules"
5358 echocheck
"libdca support"
5359 if test "$_libdca" = auto
; then
5361 for _ld_dca
in -ldca -ldts ; do
5362 statement_check_broken stdint.h dts.h
'dts_init(0)' $_ld_dca $_ld_lm &&
5363 extra_ldflags
="$extra_ldflags $_ld_dca" && _libdca
=yes && break
5366 if test "$_libdca" = yes ; then
5367 def_libdca
='#define CONFIG_LIBDCA 1'
5368 codecmodules
="libdca $codecmodules"
5370 def_libdca
='#undef CONFIG_LIBDCA'
5371 nocodecmodules
="libdca $nocodecmodules"
5375 echocheck
"libmpcdec (musepack, version >= 1.2.1 required)"
5376 if test "$_musepack" = yes ; then
5380 #include <mpcdec/mpcdec.h>
5382 mpc_streaminfo info;
5383 mpc_decoder decoder;
5384 mpc_decoder_set_streaminfo(&decoder, &info);
5385 mpc_decoder_decode_frame(&decoder, NULL, 0, NULL);
5389 cc_check
-lmpcdec $_ld_lm && _musepack
=yes
5391 if test "$_musepack" = yes ; then
5392 def_musepack
='#define CONFIG_MUSEPACK 1'
5393 extra_ldflags
="$extra_ldflags -lmpcdec"
5394 codecmodules
="musepack $codecmodules"
5396 def_musepack
='#undef CONFIG_MUSEPACK'
5397 nocodecmodules
="musepack $nocodecmodules"
5399 echores
"$_musepack"
5402 echocheck
"FAAD2 support"
5403 if test "$_faad" = auto
; then
5407 #ifndef FAAD_MIN_STREAMSIZE
5408 #error Too old version
5410 int main(void) { faacDecHandle testhand; faacDecFrameInfo testinfo;
5411 testhand = faacDecOpen(); faacDecInit(0, 0, 0, 0, 0); return 0; }
5413 cc_check
-lfaad $_ld_lm && _faad
=yes
5416 def_faad
='#undef CONFIG_FAAD'
5417 if test "$_faad" = yes ; then
5418 def_faad
='#define CONFIG_FAAD 1'
5419 extra_ldflags
="$extra_ldflags -lfaad"
5420 codecmodules
="faad2 $codecmodules"
5422 nocodecmodules
="faad2 $nocodecmodules"
5427 echocheck
"LADSPA plugin support"
5428 if test "$_ladspa" = auto
; then
5430 statement_check ladspa.h
'LADSPA_Descriptor ld = {0}' && _ladspa
=yes
5432 if test "$_ladspa" = yes; then
5433 def_ladspa
="#define CONFIG_LADSPA 1"
5435 def_ladspa
="#undef CONFIG_LADSPA"
5440 echocheck
"libbs2b audio filter support"
5441 if test "$_libbs2b" = auto
; then
5443 if pkg_config_add libbs2b
; then
5447 def_libbs2b
="#undef CONFIG_LIBBS2B"
5448 test "$_libbs2b" = yes && def_libbs2b
="#define CONFIG_LIBBS2B 1"
5452 if test -z "$_codecsdir" ; then
5453 for dir
in "$_libdir/codecs" "$_libdir/win32" /usr
/local
/lib
/codecs \
5454 /usr
/lib
/codecs
/usr
/local
/lib
/win32
/usr
/lib
/win32
; do
5455 if test -d "$dir" ; then
5461 # Fall back on default directory.
5462 if test -z "$_codecsdir" ; then
5463 _codecsdir
="$_libdir/codecs"
5464 mingw32
&& _codecsdir
="codecs"
5468 echocheck
"Win32 codecs"
5469 if test "$_win32dll" = auto
; then
5471 if x86_32
&& ! qnx
; then
5475 if test "$_win32dll" = yes ; then
5476 def_win32dll
='#define CONFIG_WIN32DLL 1'
5478 def_win32_loader
='#define WIN32_LOADER 1'
5479 _win32_emulation
=yes
5481 extra_ldflags
="$extra_ldflags -ladvapi32 -lole32"
5482 res_comment
="using native windows"
5484 codecmodules
="win32 $codecmodules"
5486 def_win32dll
='#undef CONFIG_WIN32DLL'
5487 def_win32_loader
='#undef WIN32_LOADER'
5488 nocodecmodules
="win32 $nocodecmodules"
5490 echores
"$_win32dll"
5493 echocheck
"XAnim codecs"
5494 if test "$_xanim" = auto
; then
5496 res_comment
="dynamic loader support needed"
5497 if test "$_dl" = yes ; then
5501 if test "$_xanim" = yes ; then
5502 def_xanim
='#define CONFIG_XANIM 1'
5503 codecmodules
="xanim $codecmodules"
5505 def_xanim
='#undef CONFIG_XANIM'
5506 nocodecmodules
="xanim $nocodecmodules"
5511 echocheck
"RealPlayer codecs"
5512 if test "$_real" = auto
; then
5514 res_comment
="dynamic loader support needed"
5515 if test "$_dl" = yes ||
test "$_win32dll" = yes &&
5516 (linux || freebsd || netbsd || openbsd || dragonfly || darwin || win32
) ; then
5520 if test "$_real" = yes ; then
5521 def_real
='#define CONFIG_REALCODECS 1'
5522 codecmodules
="real $codecmodules"
5524 def_real
='#undef CONFIG_REALCODECS'
5525 nocodecmodules
="real $nocodecmodules"
5530 echocheck
"QuickTime codecs"
5532 def_qtx_win32
='#undef CONFIG_QTX_CODECS_WIN32'
5533 if test "$_qtx" = auto
; then
5534 test "$_win32dll" = yes ||
test "$quicktime" = yes && _qtx
=yes
5536 if test "$_qtx" = yes ; then
5537 def_qtx
='#define CONFIG_QTX_CODECS 1'
5538 win32
&& _qtx_codecs_win32
=yes && def_qtx_win32
='#define CONFIG_QTX_CODECS_WIN32 1'
5539 codecmodules
="qtx $codecmodules"
5540 darwin || win32 || _qtx_emulation
=yes
5542 def_qtx
='#undef CONFIG_QTX_CODECS'
5543 nocodecmodules
="qtx $nocodecmodules"
5547 echocheck
"Nemesi Streaming Media libraries"
5548 if test "$_nemesi" = auto
&& test "$networking" = yes ; then
5550 if pkg_config_add libnemesi
; then
5554 if test "$_nemesi" = yes; then
5556 def_nemesi
='#define CONFIG_LIBNEMESI 1'
5557 inputmodules
="nemesi $inputmodules"
5559 _native_rtsp
="$networking"
5561 def_nemesi
='#undef CONFIG_LIBNEMESI'
5562 noinputmodules
="nemesi $noinputmodules"
5566 echocheck
"LIVE555 Streaming Media libraries"
5567 if test "$_live" != no
&& test "$networking" = yes ; then
5568 cat > $TMPCPP << EOF
5569 #include <liveMedia.hh>
5570 #if (LIVEMEDIA_LIBRARY_VERSION_INT < 1141257600)
5571 #error Please upgrade to version 2006.03.03 or later of the "LIVE555 Streaming Media" libraries - available from <www.live555.com/liveMedia/>
5573 int main(void) { return 0; }
5577 for I
in $extra_cflags "-I$_libdir/live" "-I/usr/lib/live" "-I/usr/lib64/live" "-I/usr/local/live" "-I/usr/local/lib/live" ; do
5578 cxx_check
$I/liveMedia
/include
$I/UsageEnvironment
/include
$I/groupsock
/include
&&
5579 _livelibdir
=$
(echo $I|
sed s
/-I//) &&
5580 extra_ldflags
="$_livelibdir/liveMedia/libliveMedia.a \
5581 $_livelibdir/groupsock/libgroupsock.a \
5582 $_livelibdir/UsageEnvironment/libUsageEnvironment.a \
5583 $_livelibdir/BasicUsageEnvironment/libBasicUsageEnvironment.a \
5584 $extra_ldflags -lstdc++" \
5585 extra_cxxflags
="-I$_livelibdir/liveMedia/include \
5586 -I$_livelibdir/UsageEnvironment/include \
5587 -I$_livelibdir/BasicUsageEnvironment/include \
5588 -I$_livelibdir/groupsock/include" &&
5591 if test "$_live" != yes ; then
5592 ld_tmp
="-lliveMedia -lgroupsock -lUsageEnvironment -lBasicUsageEnvironment -lstdc++"
5593 if cxx_check
-I/usr
/include
/liveMedia
-I/usr
/include
/UsageEnvironment
-I/usr
/include
/groupsock
$ld_tmp; then
5598 if test "$_live" = yes && test "$networking" = yes; then
5599 test $_livelibdir && res_comment
="using $_livelibdir"
5600 def_live
='#define CONFIG_LIVE555 1'
5601 inputmodules
="live555 $inputmodules"
5602 elif test "$_live_dist" = yes && test "$networking" = yes; then
5603 res_comment
="using distribution version"
5605 def_live
='#define CONFIG_LIVE555 1'
5606 extra_ldflags
="$extra_ldflags $ld_tmp"
5607 extra_cxxflags
="-I/usr/include/liveMedia -I/usr/include/UsageEnvironment -I/usr/include/BasicUsageEnvironment -I/usr/include/groupsock"
5608 inputmodules
="live555 $inputmodules"
5611 def_live
='#undef CONFIG_LIVE555'
5612 noinputmodules
="live555 $noinputmodules"
5618 # Test with > against Libav 0.8 versions which will NOT work rather than
5619 # specify minimum version, to allow (future) point releases to possibly work.
5620 all_libav_libs
="libavutil > 51.21.0:libavcodec > 53.34.0:libavformat > 53.20.0:libswscale >= 2.0.0"
5621 echocheck
"Libav ($all_libav_libs)"
5622 if test "$ffmpeg" = auto
; then
5623 IFS
=":" # shell should not be used for programming
5624 if ! pkg_config_add
$all_libav_libs ; then
5625 die
"Unable to find development files for some of the required Libav libraries above. Aborting."
5630 def_ffmpeg_internals
="#undef CONFIG_FFMPEG_INTERNALS"
5631 if ! test -z "$_ffmpeg_source" ; then
5632 def_ffmpeg_internals
="#define CONFIG_FFMPEG_INTERNALS 1" && ffmpeg_internals
=yes
5635 echocheck
"libpostproc >= 52.0.0"
5636 if test "$libpostproc" = auto
; then
5638 if pkg_config_add
"libpostproc >= 52.0.0" ; then
5642 if test "$libpostproc" = yes ; then
5643 def_libpostproc
='#define CONFIG_LIBPOSTPROC 1'
5645 def_libpostproc
='#undef CONFIG_LIBPOSTPROC'
5647 echores
"$libpostproc"
5650 echocheck
"libdv-0.9.5+"
5651 if test "$_libdv" = auto
; then
5653 statement_check libdv
/dv.h
'dv_encoder_new(1, 1, 1)' -ldv $_ld_pthread $_ld_lm && _libdv
=yes
5655 if test "$_libdv" = yes ; then
5656 def_libdv
='#define CONFIG_LIBDV095 1'
5657 extra_ldflags
="$extra_ldflags -ldv"
5658 codecmodules
="libdv $codecmodules"
5660 def_libdv
='#undef CONFIG_LIBDV095'
5661 nocodecmodules
="libdv $nocodecmodules"
5667 if test "$_xvid" = auto
; then
5669 for _ld_tmp
in "-lxvidcore $_ld_lm" "-lxvidcore $_ld_lm $_ld_pthread" ; do
5670 statement_check xvid.h
'xvid_global(0, 0, 0, 0)' $_ld_tmp &&
5671 extra_ldflags
="$extra_ldflags $_ld_tmp" && _xvid
=yes && break
5675 if test "$_xvid" = yes ; then
5676 def_xvid
='#define CONFIG_XVID4 1'
5677 codecmodules
="xvid $codecmodules"
5679 def_xvid
='#undef CONFIG_XVID4'
5680 nocodecmodules
="xvid $nocodecmodules"
5686 if test "$_libnut" = auto
; then
5688 statement_check libnut.h
'nut_context_tt * nut; nut_error(0)' -lnut && _libnut
=yes
5691 if test "$_libnut" = yes ; then
5692 def_libnut
='#define CONFIG_LIBNUT 1'
5693 extra_ldflags
="$extra_ldflags -lnut"
5695 def_libnut
='#undef CONFIG_LIBNUT'
5699 # These VO checks must be done after the FFmpeg one
5700 echocheck
"/dev/mga_vid"
5701 if test "$_mga" = auto
; then
5703 test -c /dev
/mga_vid
&& _mga
=yes
5705 if test "$_mga" = yes ; then
5706 def_mga
='#define CONFIG_MGA 1'
5707 vomodules
="mga $vomodules"
5709 def_mga
='#undef CONFIG_MGA'
5710 novomodules
="mga $novomodules"
5716 if test "$_xmga" = auto
; then
5718 test "$_x11" = yes && test "$_mga" = yes && _xmga
=yes
5720 if test "$_xmga" = yes ; then
5721 def_xmga
='#define CONFIG_XMGA 1'
5722 vomodules
="xmga $vomodules"
5724 def_xmga
='#undef CONFIG_XMGA'
5725 novomodules
="xmga $novomodules"
5730 echocheck
"UnRAR executable"
5731 if test "$_unrar_exec" = auto
; then
5733 mingw32
&& _unrar_exec
="no"
5735 if test "$_unrar_exec" = yes ; then
5736 def_unrar_exec
='#define CONFIG_UNRAR_EXEC 1'
5738 def_unrar_exec
='#undef CONFIG_UNRAR_EXEC'
5740 echores
"$_unrar_exec"
5742 echocheck
"TV interface"
5743 if test "$_tv" = yes ; then
5744 def_tv
='#define CONFIG_TV 1'
5745 inputmodules
="tv $inputmodules"
5747 noinputmodules
="tv $noinputmodules"
5748 def_tv
='#undef CONFIG_TV'
5753 if freebsd || netbsd || openbsd || dragonfly || bsdos
; then
5754 echocheck
"*BSD BT848 bt8xx header"
5756 for file in "machine/ioctl_bt848.h" \
5757 "dev/bktr/ioctl_bt848.h" \
5758 "dev/video/bktr/ioctl_bt848.h" \
5759 "dev/ic/bt8xx.h" ; do
5761 #include <sys/types.h>
5762 #include <sys/ioctl.h>
5764 int main(void) { ioctl(0, TVTUNER_GETFREQ, 0); return 0; }
5768 _ioctl_bt848_h_name
="$file"
5772 if test "$_ioctl_bt848_h" = yes ; then
5773 def_ioctl_bt848_h_name
="#define IOCTL_BT848_H_NAME <$_ioctl_bt848_h_name>"
5774 res_comment
="using $_ioctl_bt848_h_name"
5776 def_ioctl_bt848_h_name
="#undef IOCTL_BT848_H_NAME"
5778 echores
"$_ioctl_bt848_h"
5780 echocheck
"*BSD ioctl_meteor.h"
5782 for ioctl_meteor_h_path
in "machine/ioctl_meteor.h" "dev/bktr/ioctl_meteor.h" "dev/video/bktr/ioctl_meteor.h" ; do
5783 statement_check_broken
"sys/types.h" "$ioctl_meteor_h_path" 'ioctl(0, METEORSINPUT, 0)' &&
5784 _ioctl_meteor_h
=yes && break
5786 if test "$_ioctl_meteor_h" = yes ; then
5787 def_ioctl_meteor_h_name
="#define IOCTL_METEOR_H_NAME <$ioctl_meteor_h_path>"
5788 res_comment
="using $ioctl_meteor_h_path"
5790 def_ioctl_meteor_h_name
="#undef IOCTL_METEOR_H_NAME"
5792 echores
"$_ioctl_meteor_h"
5794 echocheck
"*BSD BrookTree 848 TV interface"
5795 if test "$_tv_bsdbt848" = auto
; then
5797 if test "$_tv" = yes ; then
5799 #include <sys/types.h>
5800 $def_ioctl_meteor_h_name
5801 $def_ioctl_bt848_h_name
5802 #ifdef IOCTL_METEOR_H_NAME
5803 #include IOCTL_METEOR_H_NAME
5805 #ifdef IOCTL_BT848_H_NAME
5806 #include IOCTL_BT848_H_NAME
5809 ioctl(0, METEORSINPUT, 0);
5810 ioctl(0, TVTUNER_GETFREQ, 0);
5814 cc_check
&& _tv_bsdbt848
=yes
5817 if test "$_tv_bsdbt848" = yes ; then
5818 def_tv_bsdbt848
='#define CONFIG_TV_BSDBT848 1'
5819 inputmodules
="tv-bsdbt848 $inputmodules"
5821 def_tv_bsdbt848
='#undef CONFIG_TV_BSDBT848'
5822 noinputmodules
="tv-bsdbt848 $noinputmodules"
5824 echores
"$_tv_bsdbt848"
5825 fi #if freebsd || netbsd || openbsd || dragonfly || bsdos
5828 echocheck
"DirectShow TV interface"
5829 if test "$_tv_dshow" = auto
; then
5831 if test "$_tv" = yes && win32
; then
5832 statement_check ole2.h
'void* p; CoCreateInstance((GUID*)&GUID_NULL, NULL, CLSCTX_INPROC_SERVER, &GUID_NULL, &p)' -lole32 -luuid && _tv_dshow
=yes
5835 if test "$_tv_dshow" = yes ; then
5836 inputmodules
="tv-dshow $inputmodules"
5837 def_tv_dshow
='#define CONFIG_TV_DSHOW 1'
5838 extra_ldflags
="$extra_ldflags -lole32 -luuid"
5840 noinputmodules
="tv-dshow $noinputmodules"
5841 def_tv_dshow
='#undef CONFIG_TV_DSHOW'
5843 echores
"$_tv_dshow"
5846 echocheck
"Video 4 Linux TV interface"
5847 if test "$_tv_v4l1" = auto
; then
5849 if test "$_tv" = yes && linux
; then
5850 header_check_broken sys
/time.h linux
/videodev.h
&& _tv_v4l1
=yes
5853 if test "$_tv_v4l1" = yes ; then
5856 def_tv_v4l
='#define CONFIG_TV_V4L 1'
5857 def_tv_v4l1
='#define CONFIG_TV_V4L1 1'
5858 inputmodules
="tv-v4l $inputmodules"
5860 noinputmodules
="tv-v4l1 $noinputmodules"
5861 def_tv_v4l
='#undef CONFIG_TV_V4L'
5866 echocheck
"Video 4 Linux 2 TV interface"
5867 if test "$_tv_v4l2" = auto
; then
5869 if test "$_tv" = yes && linux
; then
5870 header_check_broken sys
/time.h linux
/videodev2.h
&& _tv_v4l2
=yes
5871 elif test "$_tv" = yes && test "$sys_videoio_h" = "yes" ; then
5875 if test "$_tv_v4l2" = yes ; then
5878 def_tv_v4l
='#define CONFIG_TV_V4L 1'
5879 def_tv_v4l2
='#define CONFIG_TV_V4L2 1'
5880 inputmodules
="tv-v4l2 $inputmodules"
5882 noinputmodules
="tv-v4l2 $noinputmodules"
5883 def_tv_v4l2
='#undef CONFIG_TV_V4L2'
5888 echocheck
"Radio interface"
5889 if test "$_radio" = yes ; then
5890 def_radio
='#define CONFIG_RADIO 1'
5891 inputmodules
="radio $inputmodules"
5892 if test "$_alsa" != yes -a "$_ossaudio" != yes ; then
5895 if test "$_radio_capture" = yes ; then
5897 def_radio_capture
="#define CONFIG_RADIO_CAPTURE 1"
5899 def_radio_capture
="#undef CONFIG_RADIO_CAPTURE"
5902 noinputmodules
="radio $noinputmodules"
5903 def_radio
='#undef CONFIG_RADIO'
5904 def_radio_capture
="#undef CONFIG_RADIO_CAPTURE"
5908 echocheck
"Capture for Radio interface"
5909 echores
"$_radio_capture"
5911 echocheck
"Video 4 Linux 2 Radio interface"
5912 if test "$_radio_v4l2" = auto
; then
5914 if test "$_radio" = yes && linux
; then
5915 header_check linux
/videodev2.h
&& _radio_v4l2
=yes
5918 if test "$_radio_v4l2" = yes ; then
5919 def_radio_v4l2
='#define CONFIG_RADIO_V4L2 1'
5921 def_radio_v4l2
='#undef CONFIG_RADIO_V4L2'
5923 echores
"$_radio_v4l2"
5925 echocheck
"Video 4 Linux Radio interface"
5926 if test "$_radio_v4l" = auto
; then
5928 if test "$_radio" = yes && linux
; then
5929 header_check linux
/videodev.h
&& _radio_v4l
=yes
5932 if test "$_radio_v4l" = yes ; then
5933 def_radio_v4l
='#define CONFIG_RADIO_V4L 1'
5935 def_radio_v4l
='#undef CONFIG_RADIO_V4L'
5937 echores
"$_radio_v4l"
5939 if freebsd || netbsd || openbsd || dragonfly || bsdos
&&
5940 test "$_radio" = yes && test "$_radio_bsdbt848" = auto
; then
5941 echocheck
"*BSD BrookTree 848 Radio interface"
5944 #include <sys/types.h>
5945 $def_ioctl_bt848_h_name
5946 #ifdef IOCTL_BT848_H_NAME
5947 #include IOCTL_BT848_H_NAME
5949 int main(void) { ioctl(0, RADIO_GETFREQ, 0); return 0; }
5951 cc_check
&& _radio_bsdbt848
=yes
5952 echores
"$_radio_bsdbt848"
5953 fi #if freebsd || netbsd || openbsd || dragonfly || bsdos && _radio && _radio_bsdbt848
5955 if test "$_radio_bsdbt848" = yes ; then
5956 def_radio_bsdbt848
='#define CONFIG_RADIO_BSDBT848 1'
5958 def_radio_bsdbt848
='#undef CONFIG_RADIO_BSDBT848'
5961 if test "$_radio_v4l" = no
&& test "$_radio_v4l2" = no
&&
5962 test "$_radio_bsdbt848" = no
&& test "$_radio" = yes ; then
5963 die
"Radio driver requires BSD BT848, V4L or V4L2!"
5966 echocheck
"Video 4 Linux 2 MPEG PVR interface"
5967 if test "$_pvr" = auto
; then
5969 if test "$_tv_v4l2" = yes && linux
; then
5971 #include <sys/time.h>
5972 #include <linux/videodev2.h>
5973 int main(void) { struct v4l2_ext_controls ext; return ext.controls->value; }
5975 cc_check
&& _pvr
=yes
5978 if test "$_pvr" = yes ; then
5979 def_pvr
='#define CONFIG_PVR 1'
5980 inputmodules
="pvr $inputmodules"
5982 noinputmodules
="pvr $noinputmodules"
5983 def_pvr
='#undef CONFIG_PVR'
5989 if test "$_ftp" = "auto" ; then
5990 test "$networking" = "yes" && ! beos
&& _ftp
=yes
5992 if test "$_ftp" = yes ; then
5993 def_ftp
='#define CONFIG_FTP 1'
5994 inputmodules
="ftp $inputmodules"
5996 noinputmodules
="ftp $noinputmodules"
5997 def_ftp
='#undef CONFIG_FTP'
6001 echocheck
"vstream client"
6002 if test "$_vstream" = auto
; then
6005 #include <vstream-client.h>
6006 void vstream_error(const char *format, ... ) {}
6007 int main(void) { vstream_start(); return 0; }
6009 cc_check
-lvstream-client && _vstream
=yes
6011 if test "$_vstream" = yes ; then
6012 def_vstream
='#define CONFIG_VSTREAM 1'
6013 inputmodules
="vstream $inputmodules"
6014 extra_ldflags
="$extra_ldflags -lvstream-client"
6016 noinputmodules
="vstream $noinputmodules"
6017 def_vstream
='#undef CONFIG_VSTREAM'
6022 echocheck
"Subtitles sorting"
6023 if test "$_sortsub" = yes ; then
6024 def_sortsub
='#define CONFIG_SORTSUB 1'
6026 def_sortsub
='#undef CONFIG_SORTSUB'
6031 echocheck
"XMMS inputplugin support"
6032 if test "$_xmms" = yes ; then
6033 if ( xmms-config
--version ) >/dev
/null
2>&1 ; then
6034 _xmmsplugindir
=$
(xmms-config
--input-plugin-dir)
6035 _xmmslibdir
=$
(xmms-config
--exec-prefix)/lib
6037 _xmmsplugindir
=/usr
/lib
/xmms
/Input
6038 _xmmslibdir
=/usr
/lib
6041 def_xmms
='#define CONFIG_XMMS 1'
6043 extra_ldflags
="$extra_ldflags ${_xmmslibdir}/libxmms.dylib"
6045 extra_ldflags
="$extra_ldflags ${_xmmslibdir}/libxmms.so.1 -export-dynamic"
6048 def_xmms
='#undef CONFIG_XMMS'
6052 if test "$_charset" != "noconv" ; then
6053 def_charset
="#define MSG_CHARSET \"$_charset\""
6055 def_charset
="#undef MSG_CHARSET"
6059 #############################################################################
6061 echocheck
"automatic gdb attach"
6062 if test "$_crash_debug" = yes ; then
6063 def_crash_debug
='#define CONFIG_CRASH_DEBUG 1'
6065 def_crash_debug
='#undef CONFIG_CRASH_DEBUG'
6068 echores
"$_crash_debug"
6070 echocheck
"compiler support for noexecstack"
6071 if cflag_check
-Wl,-z,noexecstack
; then
6072 extra_ldflags
="-Wl,-z,noexecstack $extra_ldflags"
6078 echocheck
"linker support for --nxcompat --no-seh --dynamicbase"
6079 if cflag_check
"-Wl,--nxcompat -Wl,--no-seh -Wl,--dynamicbase" ; then
6080 extra_ldflags
="-Wl,--nxcompat -Wl,--no-seh -Wl,--dynamicbase $extra_ldflags"
6087 # Dynamic linking flags
6088 # (FIXME: 'echocheck "dynamic linking"' above and modify here accordingly)
6090 freebsd || netbsd || openbsd || dragonfly || bsdos
&& _ld_dl_dynamic
='-rdynamic'
6091 if test "$_real" = yes ||
test "$_xanim" = yes && ! win32
&& ! qnx
&& ! darwin
&& ! sunos
; then
6092 _ld_dl_dynamic
='-rdynamic'
6095 extra_ldflags
="$extra_ldflags $_ld_pthread $_ld_dl $_ld_dl_dynamic"
6096 bsdos
&& extra_ldflags
="$extra_ldflags -ldvd"
6097 (netbsd || openbsd
) && x86_32
&& extra_ldflags
="$extra_ldflags -li386"
6099 def_debug
='#undef MP_DEBUG'
6100 test "$_debug" != "" && def_debug
='#define MP_DEBUG 1'
6103 echocheck
"joystick"
6104 def_joystick
='#undef CONFIG_JOYSTICK'
6105 if test "$_joystick" = yes ; then
6106 if linux || freebsd
; then
6107 # TODO add some check
6108 def_joystick
='#define CONFIG_JOYSTICK 1'
6111 res_comment
="unsupported under $system_name"
6114 echores
"$_joystick"
6117 if test "$_lirc" = auto
; then
6119 header_check lirc
/lirc_client.h
-llirc_client && _lirc
=yes
6121 if test "$_lirc" = yes ; then
6122 def_lirc
='#define CONFIG_LIRC 1'
6123 libs_mplayer
="$libs_mplayer -llirc_client"
6125 def_lirc
='#undef CONFIG_LIRC'
6130 if test "$_lircc" = auto
; then
6132 header_check lirc
/lircc.h
-llircc && _lircc
=yes
6134 if test "$_lircc" = yes ; then
6135 def_lircc
='#define CONFIG_LIRCC 1'
6136 libs_mplayer
="$libs_mplayer -llircc"
6138 def_lircc
='#undef CONFIG_LIRCC'
6142 #############################################################################
6144 CFLAGS
="$CFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE"
6146 CXXFLAGS
=" $CFLAGS -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS"
6148 # This must be the last test to be performed. Any other tests following it
6149 # could fail due to linker errors. libdvdnavmini is intentionally not linked
6150 # against libdvdread (to permit MPlayer to use its own copy of the library).
6151 # So any compilation using the flags added here but not linking against
6152 # libdvdread can fail.
6153 echocheck
"DVD support (libdvdnav)"
6154 if test "$_dvdread_internal" = yes && test ! -f "libdvdnav/dvdnav.c" ; then
6158 if test "$_dvdnav" = auto
; then
6159 if test "$_dvdread_internal" = yes ; then
6162 res_comment
="internal"
6164 $_dvdnavconfig --version --minilibs >> $TMPLOG 2>&1 || _dvdnav
=no
6167 if test "$_dvdnav" = auto
; then
6169 _dvdnavdir
=$
($_dvdnavconfig --cflags)
6170 _dvdnavlibs
=$
($_dvdnavconfig --libs)
6171 statement_check_broken stdint.h dvdnav
/dvdnav.h
'dvdnav_t *dvd = 0' $_dvdnavdir $_dvdnavlibs $_ld_dl $_ld_pthread && _dvdnav
=yes
6173 if test "$_dvdnav" = yes ; then
6174 def_dvdnav
='#define CONFIG_DVDNAV 1'
6175 if test "$dvdnav_internal" = yes ; then
6176 cflags_libdvdnav
="-Ilibdvdnav"
6177 inputmodules
="dvdnav(internal) $inputmodules"
6179 extra_cflags
="$extra_cflags $($_dvdnavconfig --cflags)"
6180 extra_ldflags
="$extra_ldflags $($_dvdnavconfig --minilibs)"
6181 inputmodules
="dvdnav $inputmodules"
6184 def_dvdnav
='#undef CONFIG_DVDNAV'
6185 noinputmodules
="dvdnav $noinputmodules"
6189 # DO NOT ADD ANY TESTS THAT USE LINKER FLAGS HERE (like cc_check).
6190 # Read dvdnav comment above.
6193 list
=$
(echo $1 |
tr '[a-z]' '[A-Z]')
6194 item
=$
(echo $2 |
tr '[a-z]' '[A-Z]')
6196 for part
in $list; do
6197 if $
(echo $item |
grep -q -E "(^| )$part($| )"); then
6198 echo "${nprefix}_$part = yes"
6203 #############################################################################
6204 echo "Creating config.mak"
6205 cat > config.mak
<< EOF
6206 # -------- Generated by configure -----------
6208 # Ensure that locale settings do not interfere with shell commands.
6211 CONFIGURATION = $configuration
6214 DOC_LANGS = $language_doc
6215 DOC_LANG_ALL = $doc_lang_all
6216 MAN_LANGS = $language_man
6217 MAN_LANG_ALL = $man_lang_all
6218 MSG_LANGS = $language_msg
6219 MSG_LANG_ALL = $msg_lang_all
6221 prefix = \$(DESTDIR)$_prefix
6222 BINDIR = \$(DESTDIR)$_bindir
6223 DATADIR = \$(DESTDIR)$_datadir
6224 LIBDIR = \$(DESTDIR)$_libdir
6225 MANDIR = \$(DESTDIR)$_mandir
6226 CONFDIR = \$(DESTDIR)$_confdir
6227 LOCALEDIR = \$(DESTDIR)$_localedir
6234 INSTALLSTRIP = $_install_strip
6237 CFLAGS = $WARNFLAGS $ERRORFLAGS $WARN_CFLAGS $CFLAGS $extra_cflags
6238 CXXFLAGS = $WARNFLAGS $ERRORFLAGS $CXXFLAGS $extra_cflags $extra_cxxflags
6239 DEPFLAGS = $DEPFLAGS
6241 CFLAGS_LIBDVDCSS = $cflags_libdvdcss
6242 CFLAGS_LIBDVDCSS_DVDREAD = $cflags_libdvdcss_dvdread
6243 CFLAGS_LIBDVDNAV = $cflags_libdvdnav
6244 CFLAGS_NO_OMIT_LEAF_FRAME_POINTER = $cflags_no_omit_leaf_frame_pointer
6245 CFLAGS_STACKREALIGN = $cflags_stackrealign
6247 EXTRALIBS = $extra_ldflags $_ld_static $_ld_lm $extra_libs
6248 EXTRALIBS_MPLAYER = $libs_mplayer
6257 $(mak_enable "$arch_all" "$arch" ARCH)
6258 $(mak_enable "$subarch_all" "$subarch" ARCH)
6259 $(mak_enable "$cpuexts_all" "$cpuexts" HAVE)
6263 NEED_GETTIMEOFDAY = $need_gettimeofday
6264 NEED_GLOB = $need_glob
6265 NEED_SETENV = $need_setenv
6266 NEED_SHMEM = $need_shmem
6267 NEED_STRSEP = $need_strsep
6268 NEED_SWAB = $need_swab
6269 NEED_VSSCANF = $need_vsscanf
6275 APPLE_IR = $_apple_ir
6276 APPLE_REMOTE = $_apple_remote
6277 AUDIO_INPUT = $_audio_input
6278 BITMAP_FONT = $_bitmap_font
6284 COREAUDIO = $_coreaudio
6285 COREVIDEO = $_corevideo
6286 SHAREDBUFFER = $_sharedbuffer
6288 DIRECT3D = $_direct3d
6289 DIRECTFB = $_directfb
6293 DVDNAV_INTERNAL = $dvdnav_internal
6295 DVDREAD_INTERNAL = $_dvdread_internal
6298 FASTMEMCPY = $_fastmemcpy
6300 FREETYPE = $_freetype
6305 GL_COCOA = $_gl_cocoa
6306 GL_WIN32 = $_gl_win32
6309 HAVE_POSIX_SELECT = $_posix_select
6310 HAVE_SYS_MMAN_H = $_mman
6313 JOYSTICK = $_joystick
6318 LIBBLURAY = $_bluray
6322 LIBDVDCSS_INTERNAL = $_libdvdcss_internal
6324 LIBNEMESI = $_nemesi
6326 LIBPOSTPROC = $libpostproc
6327 LIBSMBCLIENT = $_smb
6328 LIBTHEORA = $_theora
6331 MACOSX_FINDER = $_macosx_finder
6336 MUSEPACK = $_musepack
6338 NATIVE_RTSP = $_native_rtsp
6339 NETWORKING = $networking
6342 PE_EXECUTABLE = $_pe_executable
6345 PRIORITY = $_priority
6347 PORTAUDIO = $_portaudio
6350 QTX_CODECS_WIN32 = $_qtx_codecs_win32
6351 QTX_EMULATION = $_qtx_emulation
6353 RADIO_CAPTURE=$_radio_capture
6354 REAL_CODECS = $_real
6359 STREAM_CACHE = $_stream_cache
6360 SUNAUDIO = $_sunaudio
6366 TV_BSDBT848 = $_tv_bsdbt848
6367 TV_DSHOW = $_tv_dshow
6371 UNRAR_EXEC = $_unrar_exec
6379 WIN32DLL = $_win32dll
6380 WIN32WAVEOUT = $_win32waveout
6381 WIN32_EMULATION = $_win32_emulation
6383 XANIM_CODECS = $_xanim
6385 XMMS_PLUGINS = $_xmms
6389 YUV4MPEG = $_yuv4mpeg
6392 FFMPEG_INTERNALS = $ffmpeg_internals
6393 FFMPEG_SOURCE_PATH = $_ffmpeg_source
6397 YASMFLAGS = $YASMFLAGS
6399 CONFIG_VDPAU = $_vdpau
6400 CONFIG_ZLIB = $_zlib
6402 HAVE_PTHREADS = $_pthreads
6404 HAVE_W32THREADS = $_w32threads
6405 HAVE_YASM = $have_yasm
6409 #############################################################################
6411 ff_config_enable
() {
6412 list
=$
(echo $1 |
tr '[a-z]' '[A-Z]')
6413 item
=$
(echo $2 |
tr '[a-z]' '[A-Z]')
6415 test -z "$_nprefix" && _nprefix
='CONFIG'
6416 for part
in $list; do
6417 if $
(echo $item |
grep -q -E "(^| )$part($| )"); then
6418 echo "#define ${_nprefix}_$part 1"
6420 echo "#define ${_nprefix}_$part 0"
6425 echo "Creating config.h"
6427 /*----------------------------------------------------------------------------
6428 ** This file has been automatically generated by configure any changes in it
6429 ** will be lost when you run configure again.
6430 ** Instead of modifying definitions here, use the --enable/--disable options
6431 ** of the configure script! See ./configure --help for details.
6432 *---------------------------------------------------------------------------*/
6434 #ifndef MPLAYER_CONFIG_H
6435 #define MPLAYER_CONFIG_H
6437 /* Undefine this if you do not want to select mono audio (left or right)
6438 with a stereo MPEG layer 2/3 audio stream. The command line option
6439 -stereo has three possible values (0 for stereo, 1 for left-only, 2 for
6440 right-only), with 0 being the default.
6442 #define CONFIG_FAKE_MONO 1
6444 /* set up audio OUTBURST. Do not change this! */
6445 #define OUTBURST 512
6447 /* Enable fast OSD/SUB renderer (looks ugly, but uses less CPU power) */
6449 #undef FAST_OSD_TABLE
6453 #define CONFIGURATION "$configuration"
6455 #define MPLAYER_DATADIR "$_datadir"
6456 #define MPLAYER_CONFDIR "$_confdir"
6457 #define MPLAYER_LOCALEDIR "$_localedir"
6461 /* definitions needed by included libraries */
6462 #define HAVE_INTTYPES_H 1
6464 #define HAVE_ERRNO_H 1
6465 /* libdvdcss + libdvdread */
6466 #define HAVE_LIMITS_H 1
6468 #define HAVE_UNISTD_H 1
6470 #define STDC_HEADERS 1
6471 #define HAVE_MEMCPY 1
6473 #define READ_CACHE_TRACE 0
6475 #define HAVE_DLFCN_H 1
6479 /* system headers */
6484 $def_mman_has_map_failed
6486 $def_sys_soundcard_h
6494 /* system functions */
6517 /* system-specific features */
6530 $def_restrict_keyword
6535 /* configurable options */
6540 $def_runtime_cpudetection
6548 #define __CPU__ $iproc
6552 $(ff_config_enable "$arch_all" "$arch" "ARCH")
6553 $(ff_config_enable "$subarch_all" "$subarch" "ARCH")
6554 $(ff_config_enable "$cpuexts_all" "$cpuexts" "HAVE")
6557 /* Blu-ray/DVD/VCD/CD */
6558 #define DEFAULT_CDROM_DEVICE "$default_cdrom_device"
6559 #define DEFAULT_DVD_DEVICE "$default_dvd_device"
6579 /* codec libraries */
6606 #define BINARY_CODECS_PATH "$_codecsdir"
6607 #define XMMS_INPUT_PLUGIN_DIR "$_xmmsplugindir"
6610 /* Audio output drivers */
6618 $def_ossaudio_devdsp
6619 $def_ossaudio_devmixer
6633 $def_ioctl_bt848_h_name
6634 $def_ioctl_meteor_h_name
6734 $def_ffmpeg_internals
6758 #define HAVE_INLINE_ASM 1
6760 /* Use these registers in x86 inline asm. No proper detection yet. */
6761 #define HAVE_EBP_AVAILABLE 1
6763 #endif /* MPLAYER_CONFIG_H */
6766 # Do not overwrite an unchanged config.h to avoid superfluous rebuilds.
6767 cmp -s "$TMPH" config.h ||
mv -f "$TMPH" config.h
6769 #############################################################################
6773 Config files successfully generated by ./configure $configuration !
6775 Install prefix: $_prefix
6776 Data directory: $_datadir
6777 Config direct.: $_confdir
6779 Byte order: $_byte_order
6780 Optimizing for: $_optimizing
6783 Messages (in addition to English): $language_msg
6784 Manual pages: $language_man
6785 Documentation: $language_doc
6787 Enabled optional drivers:
6788 Input: $inputmodules
6789 Codecs: $codecmodules
6790 Audio output: $aomodules
6791 Video output: $vomodules
6793 Disabled optional drivers:
6794 Input: $noinputmodules
6795 Codecs: $nocodecmodules
6796 Audio output: $noaomodules
6797 Video output: $novomodules
6799 'config.h' and 'config.mak' contain your configuration options.
6800 Note: If you alter theses files (for instance CFLAGS) MPlayer may no longer
6801 compile *** DO NOT REPORT BUGS if you tweak these files ***
6803 'make' will now compile MPlayer and 'make install' will install it.
6804 Note: On non-Linux systems you might need to use 'gmake' instead of 'make'.
6810 Check $TMPLOG if you wonder why an autodetection failed (make sure
6811 development headers/packages are installed).
6813 NOTE: The --enable-* parameters unconditionally force options on, completely
6814 skipping autodetection. This behavior is unlike what you may be used to from
6815 autoconf-based configure scripts that can decide to override you. This greater
6816 level of control comes at a price. You may have to provide the correct compiler
6817 and linker flags yourself.
6818 If you used one of these options (except --enable-runtime-cpudetection and
6819 similar ones that turn on internal features) and experience a compilation or
6820 linking failure, make sure you have passed the necessary compiler/linker flags
6823 If you suspect a bug, please read DOCS/HTML/$language_doc/bugreports.html.
6827 if test "$warn_cflags" = yes; then
6830 MPlayer compilation will use the CPPFLAGS/CFLAGS/LDFLAGS/YASMFLAGS set by you,
6833 *** *** DO NOT REPORT BUGS IF IT DOES NOT COMPILE/WORK! *** ***
6835 It is strongly recommended to let MPlayer choose the correct CFLAGS!
6836 To do so, execute 'CFLAGS= ./configure <options>'
6842 rm -rf "$mplayer_tmpdir"