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 --host-cc=COMPILER C compiler for tools needed while building [gcc]
475 --as=ASSEMBLER assembler to build MPlayer [as]
476 --nm=NM nm tool to build MPlayer [nm]
477 --yasm=YASM Yasm assembler to build MPlayer [yasm]
478 --ar=AR librarian to build MPlayer [ar]
479 --pkg-config=PKGCONFIG pkg-config to find some libraries [pkg-config]
480 --ranlib=RANLIB ranlib to build MPlayer [ranlib]
481 --windres=WINDRES windres to build MPlayer [windres]
482 --target=PLATFORM target platform (i386-linux, arm-linux, etc)
483 --enable-static build a statically linked binary
484 --with-install=PATH path to a custom install program
487 --enable-mmx enable MMX [autodetect]
488 --enable-mmxext enable MMX2 (Pentium III, Athlon) [autodetect]
489 --enable-3dnow enable 3DNow! [autodetect]
490 --enable-3dnowext enable extended 3DNow! [autodetect]
491 --enable-sse enable SSE [autodetect]
492 --enable-sse2 enable SSE2 [autodetect]
493 --enable-ssse3 enable SSSE3 [autodetect]
494 --enable-shm enable shm [autodetect]
495 --enable-altivec enable AltiVec (PowerPC) [autodetect]
496 --enable-armv5te enable DSP extensions (ARM) [autodetect]
497 --enable-armv6 enable ARMv6 (ARM) [autodetect]
498 --enable-armv6t2 enable ARMv6t2 (ARM) [autodetect]
499 --enable-armvfp enable ARM VFP (ARM) [autodetect]
500 --enable-neon enable NEON (ARM) [autodetect]
501 --enable-iwmmxt enable iWMMXt (ARM) [autodetect]
502 --disable-fastmemcpy disable 3DNow!/SSE/MMX optimized memcpy [enable]
503 --enable-big-endian force byte order to big-endian [autodetect]
504 --enable-debug[=1-3] compile-in debugging information [disable]
505 --enable-profile compile-in profiling information [disable]
506 --disable-sighandler disable sighandler for crashes [enable]
507 --enable-crash-debug enable automatic gdb attach on crash [disable]
509 Use these options if autodetection fails:
510 --extra-cflags=FLAGS extra CFLAGS
511 --extra-ldflags=FLAGS extra LDFLAGS
512 --extra-libs=FLAGS extra linker flags
513 --extra-libs-mplayer=FLAGS extra linker flags for MPlayer
515 --with-sdl-config=PATH path to sdl*-config
516 --with-dvdnav-config=PATH path to dvdnav-config
517 --with-dvdread-config=PATH path to dvdread-config
519 This configure script is NOT autoconf-based, even though its output is similar.
520 It will try to autodetect all configuration options. If you --enable an option
521 it will be forcefully turned on, skipping autodetection. This can break
522 compilation, so you need to know what you are doing.
527 # GOTCHA: the variables below defines the default behavior for autodetection
528 # and have - unless stated otherwise - at least 2 states : yes no
529 # If autodetection is available then the third state is: auto
553 test "$CC" && _cc
="$CC"
557 _runtime_cpudetection
=no
619 _dvdnavconfig
=dvdnav-config
620 _dvdreadconfig
=dvdread-config
622 _dvdread_internal
=auto
623 _libdvdcss_internal
=auto
709 def_dos_paths
="#define HAVE_DOS_PATHS 0"
710 def_stream_cache
="#define CONFIG_STREAM_CACHE 1"
711 def_priority
="#undef CONFIG_PRIORITY"
712 def_pthread_cache
="#undef PTHREAD_CACHE"
720 _prefix
=$
(echo $ac_option | cut
-d '=' -f 2)
723 _bindir
=$
(echo $ac_option | cut
-d '=' -f 2)
726 _datadir
=$
(echo $ac_option | cut
-d '=' -f 2)
729 _mandir
=$
(echo $ac_option | cut
-d '=' -f 2)
732 _confdir
=$
(echo $ac_option | cut
-d '=' -f 2)
735 _libdir
=$
(echo $ac_option | cut
-d '=' -f 2)
738 _codecsdir
=$
(echo $ac_option | cut
-d '=' -f 2)
741 _localedir
=$
(echo $ac_option | cut
-d '=' -f 2)
745 _install
=$
(echo $ac_option | cut
-d '=' -f 2 )
749 _sdlconfig
=$
(echo $ac_option | cut
-d '=' -f 2)
751 --with-dvdnav-config=*)
752 _dvdnavconfig
=$
(echo $ac_option | cut
-d '=' -f 2)
754 --with-dvdread-config=*)
755 _dvdreadconfig
=$
(echo $ac_option | cut
-d '=' -f 2)
759 extra_cflags
="$extra_cflags $(echo $ac_option | cut -d '=' -f 2-)"
762 extra_ldflags
="$extra_ldflags $(echo $ac_option | cut -d '=' -f 2-)"
765 extra_libs
=$
(echo $ac_option | cut
-d '=' -f 2)
767 --extra-libs-mplayer=*)
768 libs_mplayer
=$
(echo $ac_option | cut
-d '=' -f 2)
772 _target
=$
(echo $ac_option | cut
-d '=' -f 2)
775 _cc
=$
(echo $ac_option | cut
-d '=' -f 2)
778 _host_cc
=$
(echo $ac_option | cut
-d '=' -f 2)
781 _as
=$
(echo $ac_option | cut
-d '=' -f 2)
784 _nm
=$
(echo $ac_option | cut
-d '=' -f 2)
787 _yasm
=$
(echo $ac_option | cut
-d '=' -f 2)
790 _ar
=$
(echo $ac_option | cut
-d '=' -f 2)
793 _pkg_config
=$
(echo $ac_option | cut
-d '=' -f 2)
796 _ranlib
=$
(echo $ac_option | cut
-d '=' -f 2)
799 _windres
=$
(echo $ac_option | cut
-d '=' -f 2)
802 _charset
=$
(echo $ac_option | cut
-d '=' -f 2)
805 language_doc
=$
(echo $ac_option | cut
-d '=' -f 2)
808 language_man
=$
(echo $ac_option | cut
-d '=' -f 2)
811 language_msg
=$
(echo $ac_option | cut
-d '=' -f 2)
814 language
=$
(echo $ac_option | cut
-d '=' -f 2)
833 _debug
=$
(echo $_echo_n '-g'$_echo_c; echo $ac_option | cut
-d '=' -f 2)
838 --enable-translation) _translation
=yes ;;
839 --disable-translation) _translation
=no
;;
840 --enable-runtime-cpudetection) _runtime_cpudetection
=yes ;;
841 --disable-runtime-cpudetection) _runtime_cpudetection
=no
;;
842 --enable-cross-compile) _cross_compile
=yes ;;
843 --disable-cross-compile) _cross_compile
=no
;;
844 --enable-mplayer) _mplayer
=yes ;;
845 --disable-mplayer) _mplayer
=no
;;
846 --enable-x11) _x11
=yes ;;
847 --disable-x11) _x11
=no
;;
848 --enable-xshape) _xshape
=yes ;;
849 --disable-xshape) _xshape
=no
;;
850 --enable-xss) _xss
=yes ;;
851 --disable-xss) _xss
=no
;;
852 --enable-xv) _xv
=yes ;;
853 --disable-xv) _xv
=no
;;
854 --enable-vdpau) _vdpau
=yes ;;
855 --disable-vdpau) _vdpau
=no
;;
856 --enable-sdl) _sdl
=yes ;;
857 --disable-sdl) _sdl
=no
;;
858 --enable-direct3d) _direct3d
=yes ;;
859 --disable-direct3d) _direct3d
=no
;;
860 --enable-directx) _directx
=yes ;;
861 --disable-directx) _directx
=no
;;
862 --enable-win32waveout) _win32waveout
=yes ;;
863 --disable-win32waveout) _win32waveout
=no
;;
864 --enable-nas) _nas
=yes ;;
865 --disable-nas) _nas
=no
;;
866 --enable-png) _png
=yes ;;
867 --disable-png) _png
=no
;;
868 --enable-mng) _mng
=yes ;;
869 --disable-mng) _mng
=no
;;
870 --enable-jpeg) _jpeg
=yes ;;
871 --disable-jpeg) _jpeg
=no
;;
872 --enable-pnm) _pnm
=yes ;;
873 --disable-pnm) _pnm
=no
;;
874 --enable-md5sum) _md5sum
=yes ;;
875 --disable-md5sum) _md5sum
=no
;;
876 --enable-yuv4mpeg) _yuv4mpeg
=yes ;;
877 --disable-yuv4mpeg) _yuv4mpeg
=no
;;
878 --enable-gif) _gif
=yes ;;
879 --disable-gif) _gif
=no
;;
880 --enable-gl) _gl
=yes ;;
881 --disable-gl) _gl
=no
;;
882 --enable-ggi) _ggi
=yes ;;
883 --disable-ggi) _ggi
=no
;;
884 --enable-ggiwmh) _ggiwmh
=yes ;;
885 --disable-ggiwmh) _ggiwmh
=no
;;
886 --enable-aa) _aa
=yes ;;
887 --disable-aa) _aa
=no
;;
888 --enable-caca) _caca
=yes ;;
889 --disable-caca) _caca
=no
;;
890 --enable-svga) _svga
=yes ;;
891 --disable-svga) _svga
=no
;;
892 --enable-vesa) _vesa
=yes ;;
893 --disable-vesa) _vesa
=no
;;
894 --enable-fbdev) _fbdev
=yes ;;
895 --disable-fbdev) _fbdev
=no
;;
896 --enable-dvb) _dvb
=yes ;;
897 --disable-dvb) _dvb
=no
;;
898 --enable-dxr3) _dxr3
=yes ;;
899 --disable-dxr3) _dxr3
=no
;;
900 --enable-ivtv) _ivtv
=yes ;;
901 --disable-ivtv) _ivtv
=no
;;
902 --enable-v4l2) _v4l2
=yes ;;
903 --disable-v4l2) _v4l2
=no
;;
904 --enable-iconv) _iconv
=yes ;;
905 --disable-iconv) _iconv
=no
;;
906 --enable-langinfo) _langinfo
=yes ;;
907 --disable-langinfo) _langinfo
=no
;;
908 --enable-rtc) _rtc
=yes ;;
909 --disable-rtc) _rtc
=no
;;
910 --enable-libdv) _libdv
=yes ;;
911 --disable-libdv) _libdv
=no
;;
912 --enable-ossaudio) _ossaudio
=yes ;;
913 --disable-ossaudio) _ossaudio
=no
;;
914 --enable-rsound) _rsound
=yes ;;
915 --disable-rsound) _rsound
=no
;;
916 --enable-pulse) _pulse
=yes ;;
917 --disable-pulse) _pulse
=no
;;
918 --enable-portaudio) _portaudio
=yes ;;
919 --disable-portaudio) _portaudio
=no
;;
920 --enable-jack) _jack
=yes ;;
921 --disable-jack) _jack
=no
;;
922 --enable-openal) _openal
=yes ;;
923 --disable-openal) _openal
=no
;;
924 --enable-mad) _mad
=yes ;;
925 --disable-mad) _mad
=no
;;
926 --enable-libcdio) _libcdio
=yes ;;
927 --disable-libcdio) _libcdio
=no
;;
928 --enable-libvorbis) _libvorbis
=yes ;;
929 --disable-libvorbis) _libvorbis
=no
;;
930 --enable-speex) _speex
=yes ;;
931 --disable-speex) _speex
=no
;;
932 --enable-tremor) _tremor
=yes ;;
933 --disable-tremor) _tremor
=no
;;
934 --enable-theora) _theora
=yes ;;
935 --disable-theora) _theora
=no
;;
936 --enable-mpg123) _mpg123
=yes ;;
937 --disable-mpg123) _mpg123
=no
;;
938 --enable-liba52) _liba52
=yes ;;
939 --disable-liba52) _liba52
=no
;;
940 --enable-libdca) _libdca
=yes ;;
941 --disable-libdca) _libdca
=no
;;
942 --enable-musepack) _musepack
=yes ;;
943 --disable-musepack) _musepack
=no
;;
944 --enable-faad) _faad
=yes ;;
945 --disable-faad) _faad
=no
;;
946 --enable-ladspa) _ladspa
=yes ;;
947 --disable-ladspa) _ladspa
=no
;;
948 --enable-libbs2b) _libbs2b
=yes ;;
949 --disable-libbs2b) _libbs2b
=no
;;
950 --enable-xmms) _xmms
=yes ;;
951 --disable-xmms) _xmms
=no
;;
952 --enable-vcd) _vcd
=yes ;;
953 --disable-vcd) _vcd
=no
;;
954 --enable-bluray) _bluray
=yes ;;
955 --disable-bluray) _bluray
=no
;;
956 --enable-dvdread) _dvdread
=yes ;;
957 --disable-dvdread) _dvdread
=no
;;
958 --enable-dvdread-internal) _dvdread_internal
=yes ;;
959 --disable-dvdread-internal) _dvdread_internal
=no
;;
960 --enable-libdvdcss-internal) _libdvdcss_internal
=yes ;;
961 --disable-libdvdcss-internal) _libdvdcss_internal
=no
;;
962 --enable-dvdnav) _dvdnav
=yes ;;
963 --disable-dvdnav) _dvdnav
=no
;;
964 --enable-xanim) _xanim
=yes ;;
965 --disable-xanim) _xanim
=no
;;
966 --enable-real) _real
=yes ;;
967 --disable-real) _real
=no
;;
968 --enable-live) _live
=yes ;;
969 --disable-live) _live
=no
;;
970 --enable-nemesi) _nemesi
=yes ;;
971 --disable-nemesi) _nemesi
=no
;;
972 --enable-xinerama) _xinerama
=yes ;;
973 --disable-xinerama) _xinerama
=no
;;
974 --enable-mga) _mga
=yes ;;
975 --disable-mga) _mga
=no
;;
976 --enable-xmga) _xmga
=yes ;;
977 --disable-xmga) _xmga
=no
;;
978 --enable-vm) _vm
=yes ;;
979 --disable-vm) _vm
=no
;;
980 --enable-xf86keysym) _xf86keysym
=yes ;;
981 --disable-xf86keysym) _xf86keysym
=no
;;
982 --enable-sunaudio) _sunaudio
=yes ;;
983 --disable-sunaudio) _sunaudio
=no
;;
984 --enable-alsa) _alsa
=yes ;;
985 --disable-alsa) _alsa
=no
;;
986 --enable-tv) _tv
=yes ;;
987 --disable-tv) _tv
=no
;;
988 --enable-tv-bsdbt848) _tv_bsdbt848
=yes ;;
989 --disable-tv-bsdbt848) _tv_bsdbt848
=no
;;
990 --enable-tv-v4l1) _tv_v4l1
=yes ;;
991 --disable-tv-v4l1) _tv_v4l1
=no
;;
992 --enable-tv-v4l2) _tv_v4l2
=yes ;;
993 --disable-tv-v4l2) _tv_v4l2
=no
;;
994 --enable-tv-dshow) _tv_dshow
=yes ;;
995 --disable-tv-dshow) _tv_dshow
=no
;;
996 --enable-radio) _radio
=yes ;;
997 --enable-radio-capture) _radio_capture
=yes ;;
998 --disable-radio-capture) _radio_capture
=no
;;
999 --disable-radio) _radio
=no
;;
1000 --enable-radio-v4l) _radio_v4l
=yes ;;
1001 --disable-radio-v4l) _radio_v4l
=no
;;
1002 --enable-radio-v4l2) _radio_v4l2
=yes ;;
1003 --disable-radio-v4l2) _radio_v4l2
=no
;;
1004 --enable-radio-bsdbt848) _radio_bsdbt848
=yes ;;
1005 --disable-radio-bsdbt848) _radio_bsdbt848
=no
;;
1006 --enable-pvr) _pvr
=yes ;;
1007 --disable-pvr) _pvr
=no
;;
1008 --enable-fastmemcpy) _fastmemcpy
=yes ;;
1009 --disable-fastmemcpy) _fastmemcpy
=no
;;
1010 --enable-networking) networking
=yes ;;
1011 --disable-networking) networking
=no
;;
1012 --enable-winsock2_h) _winsock2_h
=yes ;;
1013 --disable-winsock2_h) _winsock2_h
=no
;;
1014 --enable-smb) _smb
=yes ;;
1015 --disable-smb) _smb
=no
;;
1016 --enable-joystick) _joystick
=yes ;;
1017 --disable-joystick) _joystick
=no
;;
1018 --enable-xvid) _xvid
=yes ;;
1019 --disable-xvid) _xvid
=no
;;
1020 --enable-libnut) _libnut
=yes ;;
1021 --disable-libnut) _libnut
=no
;;
1022 --enable-libav) ffmpeg
=yes ;;
1023 --ffmpeg-source-dir=*)
1024 _ffmpeg_source
=$
(echo $ac_option | cut
-d '=' -f 2 ) ;;
1026 --enable-lirc) _lirc
=yes ;;
1027 --disable-lirc) _lirc
=no
;;
1028 --enable-lircc) _lircc
=yes ;;
1029 --disable-lircc) _lircc
=no
;;
1030 --enable-apple-remote) _apple_remote
=yes ;;
1031 --disable-apple-remote) _apple_remote
=no
;;
1032 --enable-apple-ir) _apple_ir
=yes ;;
1033 --disable-apple-ir) _apple_ir
=no
;;
1034 --enable-termcap) _termcap
=yes ;;
1035 --disable-termcap) _termcap
=no
;;
1036 --enable-termios) _termios
=yes ;;
1037 --disable-termios) _termios
=no
;;
1038 --enable-3dfx) _3dfx
=yes ;;
1039 --disable-3dfx) _3dfx
=no
;;
1040 --enable-s3fb) _s3fb
=yes ;;
1041 --disable-s3fb) _s3fb
=no
;;
1042 --enable-wii) _wii
=yes ;;
1043 --disable-wii) _wii
=no
;;
1044 --enable-tdfxfb) _tdfxfb
=yes ;;
1045 --disable-tdfxfb) _tdfxfb
=no
;;
1046 --disable-tdfxvid) _tdfxvid
=no
;;
1047 --enable-tdfxvid) _tdfxvid
=yes ;;
1048 --disable-xvr100) _xvr100
=no
;;
1049 --enable-xvr100) _xvr100
=yes ;;
1050 --disable-tga) _tga
=no
;;
1051 --enable-tga) _tga
=yes ;;
1052 --enable-directfb) _directfb
=yes ;;
1053 --disable-directfb) _directfb
=no
;;
1054 --enable-bl) _bl
=yes ;;
1055 --disable-bl) _bl
=no
;;
1056 --enable-shm) _shm
=yes ;;
1057 --disable-shm) _shm
=no
;;
1058 --enable-select) _select
=yes ;;
1059 --disable-select) _select
=no
;;
1060 --enable-cddb) _cddb
=yes ;;
1061 --disable-cddb) _cddb
=no
;;
1062 --enable-big-endian) _big_endian
=yes ;;
1063 --disable-big-endian) _big_endian
=no
;;
1064 --enable-bitmap-font) _bitmap_font
=yes ;;
1065 --disable-bitmap-font) _bitmap_font
=no
;;
1066 --enable-freetype) _freetype
=yes ;;
1067 --disable-freetype) _freetype
=no
;;
1068 --enable-fontconfig) _fontconfig
=yes ;;
1069 --disable-fontconfig) _fontconfig
=no
;;
1070 --enable-unrarexec) _unrar_exec
=yes ;;
1071 --disable-unrarexec) _unrar_exec
=no
;;
1072 --enable-ftp) _ftp
=yes ;;
1073 --disable-ftp) _ftp
=no
;;
1074 --enable-vstream) _vstream
=yes ;;
1075 --disable-vstream) _vstream
=no
;;
1076 --enable-pthreads) _pthreads
=yes ;;
1077 --disable-pthreads) _pthreads
=no
;;
1078 --enable-w32threads) _w32threads
=yes ;;
1079 --disable-w32threads) _w32threads
=no
;;
1080 --enable-libass) _ass
=yes ;;
1081 --disable-libass) _ass
=no
;;
1082 --enable-rpath) _rpath
=yes ;;
1083 --disable-rpath) _rpath
=no
;;
1084 --enable-libpostproc) libpostproc
=yes ;;
1085 --disable-libpostproc) libpostproc
=no
;;
1087 --enable-fribidi) _fribidi
=yes ;;
1088 --disable-fribidi) _fribidi
=no
;;
1090 --enable-enca) _enca
=yes ;;
1091 --disable-enca) _enca
=no
;;
1093 --enable-inet6) _inet6
=yes ;;
1094 --disable-inet6) _inet6
=no
;;
1096 --enable-gethostbyname2) _gethostbyname2
=yes ;;
1097 --disable-gethostbyname2) _gethostbyname2
=no
;;
1099 --enable-dga1) _dga1
=yes ;;
1100 --disable-dga1) _dga1
=no
;;
1101 --enable-dga2) _dga2
=yes ;;
1102 --disable-dga2) _dga2
=no
;;
1104 --enable-qtx) _qtx
=yes ;;
1105 --disable-qtx) _qtx
=no
;;
1107 --enable-coreaudio) _coreaudio
=yes ;;
1108 --disable-coreaudio) _coreaudio
=no
;;
1109 --enable-corevideo) _corevideo
=yes ;;
1110 --disable-corevideo) _corevideo
=no
;;
1111 --enable-cocoa) _cocoa
=yes ;;
1112 --disable-cocoa) _cocoa
=no
;;
1113 --enable-sharedbuffer) _sharedbuffer
=yes ;;
1114 --disable-sharedbuffer) _sharedbuffer
=no
;;
1115 --enable-macosx-finder) _macosx_finder
=yes ;;
1116 --disable-macosx-finder) _macosx_finder
=no
;;
1117 --enable-macosx-bundle) _macosx_bundle
=yes ;;
1118 --disable-macosx-bundle) _macosx_bundle
=no
;;
1120 --enable-sortsub) _sortsub
=yes ;;
1121 --disable-sortsub) _sortsub
=no
;;
1123 --enable-crash-debug) _crash_debug
=yes ;;
1124 --disable-crash-debug) _crash_debug
=no
;;
1125 --enable-sighandler) _sighandler
=yes ;;
1126 --disable-sighandler) _sighandler
=no
;;
1127 --enable-win32dll) _win32dll
=yes ;;
1128 --disable-win32dll) _win32dll
=no
;;
1130 --enable-sse) _sse
=yes ;;
1131 --disable-sse) _sse
=no
;;
1132 --enable-sse2) _sse2
=yes ;;
1133 --disable-sse2) _sse2
=no
;;
1134 --enable-ssse3) _ssse3
=yes ;;
1135 --disable-ssse3) _ssse3
=no
;;
1136 --enable-mmxext) _mmxext
=yes ;;
1137 --disable-mmxext) _mmxext
=no
;;
1138 --enable-3dnow) _3dnow
=yes ;;
1139 --disable-3dnow) _3dnow
=no _3dnowext
=no
;;
1140 --enable-3dnowext) _3dnow
=yes _3dnowext
=yes ;;
1141 --disable-3dnowext) _3dnowext
=no
;;
1142 --enable-cmov) _cmov
=yes ;;
1143 --disable-cmov) _cmov
=no
;;
1144 --enable-fast-cmov) _fast_cmov
=yes ;;
1145 --disable-fast-cmov) _fast_cmov
=no
;;
1146 --enable-fast-clz) _fast_clz
=yes ;;
1147 --disable-fast-clz) _fast_clz
=no
;;
1148 --enable-altivec) _altivec
=yes ;;
1149 --disable-altivec) _altivec
=no
;;
1150 --enable-armv5te) _armv5te
=yes ;;
1151 --disable-armv5te) _armv5te
=no
;;
1152 --enable-armv6) _armv6
=yes ;;
1153 --disable-armv6) _armv6
=no
;;
1154 --enable-armv6t2) _armv6t2
=yes ;;
1155 --disable-armv6t2) _armv6t2
=no
;;
1156 --enable-armvfp) _armvfp
=yes ;;
1157 --disable-armvfp) _armvfp
=no
;;
1158 --enable-neon) neon
=yes ;;
1159 --disable-neon) neon
=no
;;
1160 --enable-iwmmxt) _iwmmxt
=yes ;;
1161 --disable-iwmmxt) _iwmmxt
=no
;;
1162 --enable-mmx) _mmx
=yes ;;
1163 --disable-mmx) # 3Dnow! and MMX2 require MMX
1164 _3dnow
=no _3dnowext
=no _mmx
=no _mmxext
=no
;;
1167 echo "Unknown parameter: $ac_option" >&2
1174 # Atmos: moved this here, to be correct, if --prefix is specified
1175 test -z "$_bindir" && _bindir
="$_prefix/bin"
1176 test -z "$_datadir" && _datadir
="$_prefix/share/mplayer"
1177 test -z "$_mandir" && _mandir
="$_prefix/share/man"
1178 test -z "$_confdir" && _confdir
="$_prefix/etc/mplayer"
1179 test -z "$_libdir" && _libdir
="$_prefix/lib"
1180 test -z "$_localedir" && _localedir
="$_prefix/share/locale"
1182 for tmpdir
in "$TMPDIR" "$TEMPDIR" "/tmp" ; do
1183 test "$tmpdir" && break
1186 mplayer_tmpdir
="$tmpdir/mplayer-configure-$RANDOM-$$"
1187 mkdir
$mplayer_tmpdir || die
"Unable to create tmpdir."
1192 echo Parameters configure was run with
: > "$TMPLOG"
1193 if test -n "$CFLAGS" ; then
1194 echo ${_echo_n} CFLAGS
="'$CFLAGS' ${_echo_c}" >> "$TMPLOG"
1196 if test -n "$PKG_CONFIG_PATH" ; then
1197 echo ${_echo_n} PKG_CONFIG_PATH
="'$PKG_CONFIG_PATH' ${_echo_c}" >> "$TMPLOG"
1199 echo .
/configure
$configuration >> "$TMPLOG"
1203 echocheck
"cross compilation"
1204 echores
$_cross_compile
1206 if test $_cross_compile = yes; then
1210 test "$_host_cc" || _host_cc
=cc
1215 if test $_cross_compile = yes ; then
1216 # Usually cross-compiler prefixes match with the target triplet
1217 test -n "$_target" && tool_prefix
="$_target"-
1220 test "$_ranlib" = auto
&& _ranlib
="$tool_prefix"ranlib
1221 test "$_windres" = auto
&& _windres
="$tool_prefix"windres
1222 test "$_ar" = auto
&& _ar
="$tool_prefix"ar
1223 test "$_yasm" = auto
&& _yasm
="$tool_prefix"yasm
1224 test "$_pkg_config" = auto
&& _pkg_config
="$tool_prefix"pkg-config
1226 if test "$_cc" = auto
; then
1227 if test -n "$tool_prefix" ; then
1228 _cc
="$tool_prefix"gcc
1234 # Determine our OS name and CPU architecture
1235 if test -z "$_target" ; then
1237 system_name
=$
(uname
-s 2>&1)
1238 case "$system_name" in
1239 Linux|FreeBSD|NetBSD|OpenBSD|DragonFly|BSD
/OS|Darwin|SunOS|QNX|GNU|BeOS|MorphOS|AIX|AmigaOS
)
1250 [cC
][yY
][gG
][wW
][iI
][nN
]*)
1260 system_name
="$system_name-UNKNOWN"
1265 # host's CPU/instruction set
1266 host_arch
=$
(uname
-p 2>&1)
1267 case "$host_arch" in
1268 i386|sparc|ppc|alpha|arm|mips|vax
)
1270 powerpc
) # Darwin returns 'powerpc'
1273 *) # uname -p on Linux returns 'unknown' for the processor type,
1274 # OpenBSD returns 'Intel Pentium/MMX ("Genuine Intel" 586-class)'
1276 # Maybe uname -m (machine hardware name) returns something we
1279 # x86/x86pc is used by QNX
1280 case "$(uname -m 2>&1)" in
1281 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
;;
1282 ia64
) host_arch
=ia64
;;
1283 macppc|ppc
) host_arch
=ppc
;;
1284 ppc64
) host_arch
=ppc64
;;
1285 alpha
) host_arch
=alpha
;;
1286 sparc
) host_arch
=sparc
;;
1287 sparc64
) host_arch
=sparc64
;;
1288 parisc
*|hppa
*|
9000*) host_arch
=hppa
;;
1289 arm
*|zaurus|cats
) host_arch
=arm
;;
1290 sh3|sh4|sh4a
) host_arch
=sh
;;
1291 s390
) host_arch
=s390
;;
1292 s390x
) host_arch
=s390x
;;
1293 *mips
*) host_arch
=mips
;;
1294 vax
) host_arch
=vax
;;
1295 xtensa
*) host_arch
=xtensa
;;
1296 *) host_arch
=UNKNOWN
;;
1300 else # if test -z "$_target"
1302 system_name
=$
(echo $_target | cut
-d '-' -f $i)
1303 case "$(echo $system_name | tr A-Z a-z)" in
1304 linux
) system_name
=Linux
;;
1305 freebsd
) system_name
=FreeBSD
;;
1306 gnu
/kfreebsd
) system_name
=FreeBSD
;;
1307 netbsd
) system_name
=NetBSD
;;
1308 bsd
/os
) system_name
=BSD
/OS
;;
1309 openbsd
) system_name
=OpenBSD
;;
1310 dragonfly
) system_name
=DragonFly
;;
1311 sunos
) system_name
=SunOS
;;
1312 qnx
) system_name
=QNX
;;
1313 morphos
) system_name
=MorphOS
;;
1314 amigaos
) system_name
=AmigaOS
;;
1315 mingw32
*) system_name
=MINGW32
;;
1320 # We need to convert underscores so that values like k6-2 and pentium-mmx can be passed
1321 host_arch
=$
(echo $_target | cut
-d '-' -f 1)
1322 if test $
(echo $host_arch) != "x86_64" ; then
1323 host_arch
=$
(echo $host_arch |
tr '_' '-')
1327 extra_cflags
="-I. $extra_cflags"
1328 _timer
=timer-linux.c
1331 extra_ldflags
="$extra_ldflags -L/usr/local/lib"
1332 extra_cflags
="$extra_cflags -I/usr/local/include"
1335 if netbsd || dragonfly
; then
1336 extra_ldflags
="$extra_ldflags -L/usr/pkg/lib"
1337 extra_cflags
="$extra_cflags -I/usr/pkg/include"
1341 extra_cflags
="-mdynamic-no-pic $extra_cflags"
1342 if test "$(basename $_cc)" != "clang" ; then
1343 extra_cflags
="-falign-loops=16 -shared-libgcc $extra_cflags"
1345 _timer
=timer-darwin.c
1349 extra_ldflags
="$extra_ldflags -lC"
1358 extra_cflags
="$extra_cflags -fno-common"
1359 # -lwinmm is always needed for osdep/timer-win2.c
1360 extra_ldflags
="$extra_ldflags -lwinmm"
1364 def_dos_paths
="#define HAVE_DOS_PATHS 1"
1365 def_priority
="#define CONFIG_PRIORITY 1"
1371 extra_cflags
="$extra_cflags -D__USE_MINGW_ANSI_STDIO=1"
1378 def_stream_cache
="#undef CONFIG_STREAM_CACHE"
1379 extra_cflags
="-DNEWLIB -D__USE_INLINE__ $extra_cflags"
1383 extra_ldflags
="$extra_ldflags -lph"
1386 TMPC
="$mplayer_tmpdir/tmp.c"
1387 TMPCPP
="$mplayer_tmpdir/tmp.cpp"
1388 TMPEXE
="$mplayer_tmpdir/tmp$_exesuf"
1389 TMPH
="$mplayer_tmpdir/tmp.h"
1390 TMPS
="$mplayer_tmpdir/tmp.S"
1392 if test "$_runtime_cpudetection" = yes && ! x86
&& ! ppc
; then
1393 die
"Runtime CPU detection only works for x86, x86-64 and PPC!"
1397 # Checking CC version...
1398 # Intel C++ Compilers (no autoselect, use CC=/some/binary ./configure)
1399 if test "$(basename $_cc)" = "icc" ||
test "$(basename $_cc)" = "ecc"; then
1400 echocheck
"$_cc version"
1402 cc_name
=$
($_cc -V 2>&1 |
head -n 1 | cut
-d ',' -f 1)
1403 cc_version
=$
($_cc -V 2>&1 |
head -n 1 | cut
-d ',' -f 2 | cut
-d ' ' -f 3)
1404 _cc_major
=$
(echo $cc_version | cut
-d '.' -f 1)
1405 _cc_minor
=$
(echo $cc_version | cut
-d '.' -f 2)
1406 # TODO verify older icc/ecc compatibility
1409 cc_version
="v. ?.??, bad"
1413 cc_version
="$cc_version, ok"
1416 cc_version
="$cc_version, bad"
1420 echores
"$cc_version"
1422 for _cc
in "$_cc" gcc cc
; do
1423 cc_name_tmp
=$
($_cc -v 2>&1 |
tail -n 1 | cut
-d ' ' -f 1)
1424 if test "$cc_name_tmp" = "gcc"; then
1425 cc_name
=$cc_name_tmp
1426 echocheck
"$_cc version"
1428 cc_version
=$
($_cc -dumpversion 2>&1)
1434 _cc_major
=$
(echo $cc_version | cut
-d '.' -f 1)
1435 _cc_minor
=$
(echo $cc_version | cut
-d '.' -f 2)
1436 _cc_mini
=$
(echo $cc_version | cut
-d '.' -f 3)
1439 echores
"$cc_version"
1442 if $_cc -v 2>&1 |
grep -q "clang"; then
1443 echocheck
"$_cc version"
1445 cc_version
=$
($_cc -dumpversion 2>&1)
1446 res_comment
="experimental support only"
1447 echores
"clang $cc_version"
1450 cc_name_tmp
=$
($_cc -V 2>&1 |
head -n 1 | cut
-d ' ' -f 2,3)
1451 if test "$cc_name_tmp" = "Sun C"; then
1452 echocheck
"$_cc version"
1454 cc_version
=$
($_cc -V 2>&1 |
head -n 1 | cut
-d ' ' -f 4)
1455 res_comment
="experimental support only"
1456 echores
"Sun C $cc_version"
1461 test "$cc_fail" = yes && die
"unsupported compiler version"
1463 echocheck
"working compiler"
1464 cflag_check
"" || die
"Compiler is not functioning correctly. Check your installation and custom CFLAGS $CFLAGS ."
1467 if test -z "$_target" && x86
; then
1470 int test[(int)sizeof(char *)-7];
1474 cc_check
&& host_arch
=x86_64 || host_arch
=i386
1478 test "$_host_cc" || _host_cc
=$_cc
1481 echo "Detected operating system: $system_name"
1482 echo "Detected host architecture: $host_arch"
1486 # now that we know what compiler should be used for compilation, try to find
1487 # out which assembler is used by the $_cc compiler
1488 if test "$_as" = auto
; then
1489 _as
=$
($_cc -print-prog-name=as
)
1490 test -z "$_as" && _as
=as
1493 if test "$_nm" = auto
; then
1494 _nm
=$
($_cc -print-prog-name=nm
)
1495 test -z "$_nm" && _nm
=nm
1498 # XXX: this should be ok..
1501 if test "$_runtime_cpudetection" = no
; then
1503 # Cygwin has /proc/cpuinfo, but only supports Intel CPUs
1504 # FIXME: Remove the cygwin check once AMD CPUs are supported
1505 if test -r /proc
/cpuinfo
&& ! cygwin
; then
1506 # Linux with /proc mounted, extract CPU information from it
1507 _cpuinfo
="cat /proc/cpuinfo"
1508 elif test -r /compat
/linux
/proc
/cpuinfo
&& ! x86
; then
1509 # FreeBSD with Linux emulation /proc mounted,
1510 # extract CPU information from it
1511 # Don't use it on x86 though, it never reports 3Dnow
1512 _cpuinfo
="cat /compat/linux/proc/cpuinfo"
1513 elif darwin
&& ! x86
; then
1514 # use hostinfo on Darwin
1517 # use 'lsattr' on AIX
1518 _cpuinfo
="lsattr -E -l proc0 -a type"
1520 # all other OSes try to extract CPU information from a small helper
1521 # program cpuinfo instead
1522 $_cc -o cpuinfo
$_exesuf cpuinfo.c
1523 _cpuinfo
="./cpuinfo$_exesuf"
1527 # gather more CPU information
1528 pname
=$
($_cpuinfo |
grep 'model name' | cut
-d ':' -f 2 |
head -n 1)
1529 pvendor
=$
($_cpuinfo |
grep 'vendor_id' | cut
-d ':' -f 2 | cut
-d ' ' -f 2 |
head -n 1)
1530 pfamily
=$
($_cpuinfo |
grep 'cpu family' | cut
-d ':' -f 2 | cut
-d ' ' -f 2 |
head -n 1)
1531 pmodel
=$
($_cpuinfo |
grep -v 'model name' |
grep 'model' | cut
-d ':' -f 2 | cut
-d ' ' -f 2 |
head -n 1)
1532 pstepping
=$
($_cpuinfo |
grep 'stepping' | cut
-d ':' -f 2 | cut
-d ' ' -f 2 |
head -n 1)
1534 exts
=$
($_cpuinfo |
egrep 'features|flags' | cut
-d ':' -f 2 |
head -n 1)
1536 pparam
=$
(echo $exts |
sed -e s
/xmm
/sse
/ -e s
/kni
/sse
/)
1537 # SSE implies MMX2, but not all SSE processors report the mmxext CPU flag.
1538 pparam
=$
(echo $pparam |
sed -e 's/sse/sse mmxext/')
1540 for ext
in $pparam ; do
1541 eval test \"\
$_$ext\" = auto
2>/dev
/null
&& eval _
$ext=kernel_check
1544 echocheck
"CPU vendor"
1545 echores
"$pvendor ($pfamily:$pmodel:$pstepping)"
1547 echocheck
"CPU type"
1551 fi # test "$_runtime_cpudetection" = no
1553 if x86
&& test "$_runtime_cpudetection" = no
; then
1555 if test "$1" = kernel_check
; then
1556 echocheck
"kernel support of $2"
1560 static void catch(int sig) { exit(1); }
1562 signal(SIGILL, catch);
1563 __asm__ volatile ("$3":::"memory"); return 0;
1567 if cc_check
&& tmp_run
; then
1570 _optimizing
="$_optimizing $2"
1575 echo "It seems that your kernel does not correctly support $2."
1576 echo "To use $2 extensions in MPlayer, you have to upgrade/recompile your kernel!"
1583 extcheck
$_mmx "mmx" "emms"
1584 extcheck
$_mmxext "mmxext" "sfence"
1585 extcheck
$_3dnow "3dnow" "femms"
1586 extcheck
$_3dnowext "3dnowext" "pswapd %%mm0, %%mm0"
1587 extcheck
$_sse "sse" "xorps %%xmm0, %%xmm0" || _gcc3_ext
="$_gcc3_ext -mno-sse"
1588 extcheck
$_sse2 "sse2" "xorpd %%xmm0, %%xmm0" || _gcc3_ext
="$_gcc3_ext -mno-sse2"
1589 extcheck
$_ssse3 "ssse3" "pabsd %%xmm0, %%xmm0"
1590 extcheck
$_cmov "cmov" "cmovb %%eax, %%ebx"
1592 if test "$_gcc3_ext" != ""; then
1593 # if we had to disable sse/sse2 because the active kernel does not
1594 # support this instruction set extension, we also have to tell
1595 # gcc3 to not generate sse/sse2 instructions for normal C code
1596 cflag_check
$_march $_gcc3_ext && _march
="$_march $_gcc3_ext"
1602 def_fast_64bit
='#define HAVE_FAST_64BIT 0'
1603 def_fast_unaligned
='#define HAVE_FAST_UNALIGNED 0'
1604 arch_all
='X86 IA64 SPARC ARM AVR32 SH4 PPC ALPHA MIPS PA_RISC S390 S390X VAX BFIN XTENSA TOMI GENERIC'
1605 subarch_all
='X86_32 X86_64 PPC64'
1606 case "$host_arch" in
1607 i
[3-9]86|x86|x86pc|k5|k6|k6-2|k6-3|pentium
*|athlon
*|i586-i686
)
1610 def_fast_unaligned
='#define HAVE_FAST_UNALIGNED 1'
1615 if test "$_runtime_cpudetection" = no
; then
1619 3) proc
=i386 iproc
=386 ;;
1620 4) proc
=i486 iproc
=486 ;;
1621 5) iproc
=586 # LGB: models are: K5/SSA5 K5 K5 K5 ? ? K6 K6 K6-2 K6-3
1622 # K6 model 13 are the K6-2+ and K6-III+, only differing in cache size.
1623 if test "$pmodel" -eq 9 -o "$pmodel" -eq 13; then
1625 elif test "$pmodel" -eq 5 -o "$pmodel" -eq 10; then
1627 elif test "$pmodel" -ge 8; then
1629 elif test "$pmodel" -ge 6; then
1636 # It's a bit difficult to determine the correct type of Family 6
1637 # AMD CPUs just from their signature. Instead, we check directly
1638 # whether it supports SSE.
1639 if test "$_sse" = yes; then
1640 # gcc treats athlon-xp, athlon-4 and athlon-mp similarly.
1643 # Again, gcc treats athlon and athlon-tbird similarly.
1648 # k8 cpu-type only supported in gcc >= 3.4.0, but that will be
1649 # caught and remedied in the optimization tests below.
1653 *) proc
=amdfam10 iproc
=686
1654 test $_fast_clz = "auto" && _fast_clz
=yes
1660 3) proc
=i386 iproc
=386 ;;
1661 4) proc
=i486 iproc
=486 ;;
1663 if test "$pmodel" -eq 4 ||
test "$pmodel" -eq 8; then
1664 proc
=pentium-mmx
# 4 is desktop, 8 is mobile
1670 if test "$pmodel" -ge 15; then
1672 elif test "$pmodel" -eq 9 -o "$pmodel" -ge 13; then
1674 elif test "$pmodel" -ge 7; then
1676 elif test "$pmodel" -ge 3; then
1681 test $_fast_clz = "auto" && _fast_clz
=yes
1684 # A nocona in 32-bit mode has no more capabilities than a prescott.
1685 if test "$pmodel" -ge 3; then
1689 test $_fast_clz = "auto" && _fast_clz
=yes
1691 test $_fast_cmov = "auto" && _fast_cmov
=no
1693 *) proc
=prescott iproc
=686 ;;
1699 if test "$pmodel" -ge 8; then
1701 elif test "$pmodel" -ge 4; then
1708 if test "$pmodel" -ge 9; then
1715 *) proc
=i686 iproc
=i686
;;
1720 3) proc
=i386 iproc
=386 ;;
1721 4) proc
=i486 iproc
=486 ;;
1722 *) proc
=i586 iproc
=586 ;;
1726 proc
=i586 iproc
=586 ;;
1728 test $_fast_clz = "auto" && _fast_clz
=no
1729 fi # test "$_runtime_cpudetection" = no
1732 # check that gcc supports our CPU, if not, fall back to earlier ones
1733 # LGB: check -mcpu and -march swithing step by step with enabling
1734 # to fall back till 386.
1736 # gcc >= 3.4.0 doesn't support -mcpu, we have to use -mtune instead
1738 if [ "$cc_vendor" = "gnu" ] && ([ "$_cc_major" -gt 3 ] ||
( [ "$_cc_major" = 3 ] && [ "$_cc_minor" -ge 4 ])) ; then
1744 echocheck
"GCC & CPU optimization abilities"
1745 if test "$_runtime_cpudetection" = no
; then
1746 if test $cc_vendor != "intel" && test $cc_vendor != "clang" ; then
1747 cflag_check
-march=native
&& proc
=native
1749 if test "$proc" = "amdfam10"; then
1750 cflag_check
-march=$proc $cpuopt=$proc || proc
=k8
1752 if test "$proc" = "k8"; then
1753 cflag_check
-march=$proc $cpuopt=$proc || proc
=athlon-xp
1755 if test "$proc" = "athlon-xp"; then
1756 cflag_check
-march=$proc $cpuopt=$proc || proc
=athlon
1758 if test "$proc" = "k6-3" ||
test "$proc" = "k6-2"; then
1759 cflag_check
-march=$proc $cpuopt=$proc || proc
=k6
1761 if test "$proc" = "k6" ||
test "$proc" = "c3"; then
1762 if ! cflag_check
-march=$proc $cpuopt=$proc; then
1763 if cflag_check
-march=i586
$cpuopt=i686
; then
1770 if test "$proc" = "prescott" ; then
1771 cflag_check
-march=$proc $cpuopt=$proc || proc
=pentium4
1773 if test "$proc" = "core2" ; then
1774 cflag_check
-march=$proc $cpuopt=$proc || proc
=pentium-m
1776 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
1777 cflag_check
-march=$proc $cpuopt=$proc || proc
=i686
1779 if test "$proc" = "i686" ||
test "$proc" = "pentium-mmx" ||
test "$proc" = "winchip-c6" ||
test "$proc" = "winchip2"; then
1780 cflag_check
-march=$proc $cpuopt=$proc || proc
=i586
1782 if test "$proc" = "i586"; then
1783 cflag_check
-march=$proc $cpuopt=$proc || proc
=i486
1785 if test "$proc" = "i486" ; then
1786 cflag_check
-march=$proc $cpuopt=$proc || proc
=i386
1788 if test "$proc" = "i386" ; then
1789 cflag_check
-march=$proc $cpuopt=$proc || proc
=error
1791 if test "$proc" = "error" ; then
1792 echores
"CPU optimization disabled. CPU not recognized or your compiler is too old."
1796 elif test "$proc" = "i586-i686"; then
1797 _march
="-march=i586"
1798 _mcpu
="$cpuopt=i686"
1801 _march
="-march=$proc"
1802 _mcpu
="$cpuopt=$proc"
1805 else # if test "$_runtime_cpudetection" = no
1806 _mcpu
="$cpuopt=generic"
1807 # at least i486 required, for bswap instruction
1808 _march
="-march=i486"
1809 cflag_check
$_mcpu || _mcpu
="$cpuopt=i686"
1810 cflag_check
$_mcpu || _mcpu
=""
1811 cflag_check
$_march $_mcpu || _march
=""
1814 ## Gabucino : --target takes effect here (hopefully...) by overwriting
1815 ## autodetected mcpu/march parameters
1816 if test "$_target" ; then
1817 # TODO: it may be a good idea to check GCC and fall back in all cases
1818 if test "$host_arch" = "i586-i686"; then
1819 _march
="-march=i586"
1820 _mcpu
="$cpuopt=i686"
1822 _march
="-march=$host_arch"
1823 _mcpu
="$cpuopt=$host_arch"
1831 i586|k5|k6|k6-2|k6-3|pentium|pentium-mmx
) iproc
=586 ;;
1832 i686|athlon
*|pentium
*) iproc
=686 ;;
1837 if test $_cmov = "yes" && test $_fast_cmov = "auto" ; then
1842 test $_fast_clz = "auto" && _fast_clz
=yes
1849 def_fast_64bit
='#define HAVE_FAST_64BIT 1'
1856 def_fast_unaligned
='#define HAVE_FAST_UNALIGNED 1'
1857 def_fast_64bit
='#define HAVE_FAST_64BIT 1'
1860 # gcc >= 3.4.0 doesn't support -mcpu, we have to use -mtune instead
1861 if test "$cc_vendor" = "gnu" && test "$_cc_major" -gt 3 -o "$_cc_major" -eq 3 -a "$_cc_minor" -ge 4 ; then
1866 if test "$_runtime_cpudetection" = no
; then
1871 test $_fast_clz = "auto" && _fast_clz
=no
1880 # 64-bit prescotts exist, but as far as GCC is concerned they
1881 # have the same capabilities as a nocona.
1883 test $_fast_cmov = "auto" && _fast_cmov
=no
1884 test $_fast_clz = "auto" && _fast_clz
=no
1891 fi # test "$_runtime_cpudetection" = no
1893 echocheck
"GCC & CPU optimization abilities"
1894 # This is a stripped-down version of the i386 fallback.
1895 if test "$_runtime_cpudetection" = no
; then
1896 if test $cc_vendor != "intel" && test $cc_vendor != "clang" ; then
1897 cflag_check
-march=native
&& proc
=native
1899 # --- AMD processors ---
1900 if test "$proc" = "amdfam10"; then
1901 cflag_check
-march=$proc $cpuopt=$proc || proc
=k8
1903 if test "$proc" = "k8"; then
1904 cflag_check
-march=$proc $cpuopt=$proc || proc
=athlon-xp
1906 # This will fail if gcc version < 3.3, which is ok because earlier
1907 # versions don't really support 64-bit on amd64.
1908 # Is this a valid assumption? -Corey
1909 if test "$proc" = "athlon-xp"; then
1910 cflag_check
-march=$proc $cpuopt=$proc || proc
=error
1912 # --- Intel processors ---
1913 if test "$proc" = "core2"; then
1914 cflag_check
-march=$proc $cpuopt=$proc || proc
=x86-64
1916 if test "$proc" = "x86-64"; then
1917 cflag_check
-march=$proc $cpuopt=$proc || proc
=nocona
1919 if test "$proc" = "nocona"; then
1920 cflag_check
-march=$proc $cpuopt=$proc || proc
=pentium4
1922 if test "$proc" = "pentium4"; then
1923 cflag_check
-march=$proc $cpuopt=$proc || proc
=error
1926 _march
="-march=$proc"
1927 _mcpu
="$cpuopt=$proc"
1928 if test "$proc" = "error" ; then
1929 echores
"CPU optimization disabled. CPU not recognized or your compiler is too old."
1933 else # if test "$_runtime_cpudetection" = no
1934 # x86-64 is an undocumented option, an intersection of k8 and nocona.
1935 _march
="-march=x86-64"
1936 _mcpu
="$cpuopt=generic"
1937 cflag_check
$_mcpu || _mcpu
="x86-64"
1938 cflag_check
$_mcpu || _mcpu
=""
1939 cflag_check
$_march $_mcpu || _march
=""
1943 test $_fast_cmov = "auto" && _fast_cmov
=yes
1944 test $_fast_clz = "auto" && _fast_clz
=yes
1952 if test "$host_arch" = "sparc64" ; then
1955 def_fast_64bit
='#define HAVE_FAST_64BIT 1'
1957 echocheck
"CPU type"
1959 case "$(echo $karch)" in
1964 sun4u
) proc
=ultrasparc _vis
='yes' ;;
1983 def_fast_unaligned
='#define HAVE_FAST_UNALIGNED 1'
1985 test $_fast_clz = "auto" && _fast_clz
=yes
1993 ppc|ppc64|powerpc|powerpc64
)
1995 def_dcbzl
='#define HAVE_DCBZL 0'
1996 def_fast_unaligned
='#define HAVE_FAST_UNALIGNED 1'
1999 if test "$host_arch" = "ppc64" -o "$host_arch" = "powerpc64" ; then
2001 def_fast_64bit
='#define HAVE_FAST_64BIT 1'
2003 echocheck
"CPU type"
2004 case $system_name in
2006 proc
=$
($_cpuinfo |
grep 'cpu' | cut
-d ':' -f 2 | cut
-d ',' -f 1 | cut
-b 2- |
head -n 1)
2007 if test -n "$($_cpuinfo | grep altivec)"; then
2008 test $_altivec = auto
&& _altivec
=yes
2012 proc
=$
($_cpuinfo |
grep "Processor type" | cut
-f 3 -d ' ' |
sed 's/ppc//')
2013 if [ $
(sysctl
-n hw.vectorunit
) -eq 1 -o \
2014 "$(sysctl -n hw.optional.altivec 2> /dev/null)" = "1" ]; then
2015 test $_altivec = auto
&& _altivec
=yes
2019 # only gcc 3.4 works reliably with AltiVec code under NetBSD
2021 2*|
3.0*|
3.1*|
3.2*|
3.3*)
2024 if [ $
(sysctl
-n machdep.altivec
) -eq 1 ]; then
2025 test $_altivec = auto
&& _altivec
=yes
2031 proc
=$
($_cpuinfo |
grep 'type' | cut
-f 2 -d ' ' |
sed 's/PowerPC_//')
2034 if test "$_altivec" = yes; then
2035 echores
"$proc altivec"
2041 echocheck
"GCC & CPU optimization abilities"
2043 if test -n "$proc"; then
2045 601) _march
='-mcpu=601' _mcpu
='-mtune=601' ;;
2046 603) _march
='-mcpu=603' _mcpu
='-mtune=603' ;;
2047 603e|
603ev
) _march
='-mcpu=603e' _mcpu
='-mtune=603e' ;;
2048 604|
604e|
604r|
604ev
) _march
='-mcpu=604' _mcpu
='-mtune=604' ;;
2049 740|
740/750|
745/755) _march
='-mcpu=740' _mcpu
='-mtune=740' ;;
2050 750|
750CX
) _march
='-mcpu=750' _mcpu
='-mtune=750' ;;
2051 POWER
) _march
='-mcpu=power' _mcpu
='-mtune=power' ;;
2052 POWER2
) _march
='-mcpu=power2' _mcpu
='-mtune=power2' ;;
2053 POWER3
) _march
='-mcpu=power3' _mcpu
='-mtune=power3' ;;
2056 # gcc 3.1(.1) and up supports 7400 and 7450
2057 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "1" ||
test "$_cc_major" -ge "4"; then
2059 7400*|
7410*) _march
='-mcpu=7400' _mcpu
='-mtune=7400' ;;
2060 7447*|
7450*|
7455*) _march
='-mcpu=7450' _mcpu
='-mtune=7450' ;;
2064 # gcc 3.2 and up supports 970
2065 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "3" ||
test "$_cc_major" -ge "4"; then
2067 970*|PPC970
*) _march
='-mcpu=970' _mcpu
='-mtune=970'
2068 def_dcbzl
='#define HAVE_DCBZL 1' ;;
2072 # gcc 3.3 and up supports POWER4
2073 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "3" ||
test "$_cc_major" -ge "4"; then
2075 POWER4
) _march
='-mcpu=power4' _mcpu
='-mtune=power4' ;;
2079 # gcc 3.4 and up supports 440*
2080 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "4" ||
test "$_cc_major" -ge "4"; then
2082 440EP
*) _march
='-mcpu=440fp' _mcpu
='-mtune=440fp' ;;
2083 440G
* ) _march
='-mcpu=440' _mcpu
='-mtune=440' ;;
2087 # gcc 4.0 and up supports POWER5
2088 if test "$_cc_major" -ge "4"; then
2090 POWER5
*) _march
='-mcpu=power5' _mcpu
='-mtune=power5' ;;
2096 if test -n "$_mcpu"; then
2097 _optimizing
=$
(echo $_mcpu | cut
-c 8-)
2098 echores
"$_optimizing"
2103 test $_fast_clz = "auto" && _fast_clz
=yes
2110 def_fast_64bit
='#define HAVE_FAST_64BIT 1'
2112 echocheck
"CPU type"
2115 unsigned long ver, mask;
2116 __asm__ ("implver %0" : "=r" (ver));
2117 __asm__ ("amask %1, %0" : "=r" (mask) : "r" (-1));
2118 printf("%ld-%x\n", ver, ~mask);
2122 $_cc -o "$TMPEXE" "$TMPC"
2123 case $
("$TMPEXE") in
2125 0-0) proc
="ev4"; _mvi
="0";;
2126 1-0) proc
="ev5"; _mvi
="0";;
2127 1-1) proc
="ev56"; _mvi
="0";;
2128 1-101) proc
="pca56"; _mvi
="1";;
2129 2-303) proc
="ev6"; _mvi
="1";;
2130 2-307) proc
="ev67"; _mvi
="1";;
2131 2-1307) proc
="ev68"; _mvi
="1";;
2135 echocheck
"GCC & CPU optimization abilities"
2136 if test "$proc" = "ev68" ; then
2137 cc_check
-mcpu=$proc || proc
=ev67
2139 if test "$proc" = "ev67" ; then
2140 cc_check
-mcpu=$proc || proc
=ev6
2145 test $_fast_clz = "auto" && _fast_clz
=yes
2154 test $_fast_clz = "auto" && _fast_clz
=yes
2188 echo "The architecture of your CPU ($host_arch) is not supported by this configure script"
2189 echo "It seems nobody has ported MPlayer to your OS or CPU type yet."
2190 die
"unsupported architecture $host_arch"
2192 esac # case "$host_arch" in
2194 if test "$_runtime_cpudetection" = yes ; then
2196 test "$_cmov" != no
&& _cmov
=yes
2198 test "$_mmx" != no
&& _mmx
=yes
2199 test "$_3dnow" != no
&& _3dnow
=yes
2200 test "$_3dnowext" != no
&& _3dnowext
=yes
2201 test "$_mmxext" != no
&& _mmxext
=yes
2202 test "$_sse" != no
&& _sse
=yes
2203 test "$_sse2" != no
&& _sse2
=yes
2204 test "$_ssse3" != no
&& _ssse3
=yes
2213 echocheck
"byte order"
2214 if test "$_big_endian" = auto
; then
2216 short ascii_name[] = {
2217 'M' << 8 | 'P', 'l' << 8 | 'a', 'y' << 8 | 'e', 'r' << 8 | 'B',
2218 'i' << 8 | 'g', 'E' << 8 | 'n', 'd' << 8 | 'i', 'a' << 8 | 'n', 0 };
2219 int main(void) { return (long)ascii_name; }
2222 if strings $TMPEXE |
grep -q -l MPlayerBigEndian
; then
2228 echo ${_echo_n} "failed to autodetect byte order, defaulting to ${_echo_c}"
2231 if test "$_big_endian" = yes ; then
2232 _byte_order
='big-endian'
2233 def_words_endian
='#define WORDS_BIGENDIAN 1'
2234 def_bigendian
='#define HAVE_BIGENDIAN 1'
2236 _byte_order
='little-endian'
2237 def_words_endian
='#undef WORDS_BIGENDIAN'
2238 def_bigendian
='#define HAVE_BIGENDIAN 0'
2240 echores
"$_byte_order"
2243 echocheck
"extern symbol prefix"
2247 cc_check
-c || die
"Symbol mangling check failed."
2248 sym
=$
($_nm -P -g $TMPEXE)
2249 extern_prefix
=${sym%%ff_extern*}
2250 def_extern_asm
="#define EXTERN_ASM $extern_prefix"
2251 def_extern_prefix
="#define EXTERN_PREFIX \"$extern_prefix\""
2252 echores
$extern_prefix
2255 echocheck
"assembler support of -pipe option"
2256 # -I. helps to detect compilers that just misunderstand -pipe like Sun C
2257 cflag_check
-pipe -I.
&& _pipe
="-pipe" && echores
"yes" || echores
"no"
2260 if darwin
&& test "$cc_vendor" = "gnu" ; then
2261 echocheck
"GCC support of -mstackrealign"
2262 # GCC 4.2 and some earlier Apple versions support this flag on x86. Since
2263 # Mac OS X/Intel has an ABI different from Windows this is needed to avoid
2264 # crashes when loading Win32 DLLs. Unfortunately some gcc versions create
2265 # wrong code with this flag, but this can be worked around by adding
2266 # -fno-unit-at-a-time as described in the blog post at
2267 # http://www.dribin.org/dave/blog/archives/2006/12/05/missing_third_param/
2269 __attribute__((noinline)) static int foo3(int i1, int i2, int i3) { return i3; }
2270 int main(void) { return foo3(1, 2, 3) == 3 ? 0 : 1; }
2272 cc_check
-O2 -mstackrealign && tmp_run
&& cflags_stackrealign
=-mstackrealign
2273 test -z "$cflags_stackrealign" && cc_check
-O2 -mstackrealign -fno-unit-at-a-time &&
2274 tmp_run
&& cflags_stackrealign
="-mstackrealign -fno-unit-at-a-time"
2275 test -n "$cflags_stackrealign" && echores
"yes" || echores
"no"
2276 fi # if darwin && test "$cc_vendor" = "gnu" ; then
2279 # Checking for CFLAGS
2281 if test "$_profile" != "" ||
test "$_debug" != "" ; then
2284 if test -z "$CFLAGS" ; then
2285 if test "$cc_vendor" = "intel" ; then
2286 CFLAGS
="-O2 $_debug $_profile $_march $_mcpu $_pipe -fomit-frame-pointer"
2287 WARNFLAGS
="-wd167 -wd556 -wd144"
2288 elif test "$cc_vendor" = "sun" ; then
2289 CFLAGS
="-O2 $_debug $_profile $_march $_mcpu $_pipe -xc99 -xregs=frameptr"
2290 elif test "$cc_vendor" = "clang"; then
2291 CFLAGS
="-O2 $_debug $_profile $_march $_pipe"
2292 WARNFLAGS
="-Wall -Wno-switch-enum -Wno-logical-op-parentheses -Wpointer-arith -Wundef -Wno-pointer-sign -Wmissing-prototypes"
2293 ERRORFLAGS
="-Werror=implicit-function-declaration"
2294 elif test "$cc_vendor" != "gnu" ; then
2295 CFLAGS
="-O2 $_debug $_profile $_march $_mcpu $_pipe"
2297 CFLAGS
="-O2 $_debug $_profile $_march $_mcpu $_pipe -ffast-math -fomit-frame-pointer"
2298 WARNFLAGS
="-Wall -Wno-switch -Wno-parentheses -Wpointer-arith -Wredundant-decls"
2299 ERRORFLAGS
="-Werror-implicit-function-declaration"
2300 extra_ldflags
="$extra_ldflags -ffast-math"
2306 if test "$cc_vendor" = "gnu" ; then
2307 cflag_check
-Wundef && WARNFLAGS
="-Wundef $WARNFLAGS"
2308 # -std=gnu99 is not a warning flag but is placed in WARN_CFLAGS because
2309 # that's the only variable specific to C now, and this option is not valid
2311 cflag_check
-std=gnu99
&& WARN_CFLAGS
="-std=gnu99 $WARN_CFLAGS"
2312 cflag_check
-Wno-pointer-sign && WARN_CFLAGS
="-Wno-pointer-sign $WARN_CFLAGS"
2313 cflag_check
-Wdisabled-optimization && WARN_CFLAGS
="-Wdisabled-optimization $WARN_CFLAGS"
2314 cflag_check
-Wmissing-prototypes && WARN_CFLAGS
="-Wmissing-prototypes $WARN_CFLAGS"
2315 cflag_check
-Wstrict-prototypes && WARN_CFLAGS
="-Wstrict-prototypes $WARN_CFLAGS"
2317 CFLAGS
="-D_ISOC99_SOURCE -D_BSD_SOURCE $CFLAGS"
2320 cflag_check
-mno-omit-leaf-frame-pointer && cflags_no_omit_leaf_frame_pointer
="-mno-omit-leaf-frame-pointer"
2321 cflag_check
-MD -MP && DEPFLAGS
="-MD -MP"
2324 if test -n "$LDFLAGS" ; then
2325 extra_ldflags
="$extra_ldflags $LDFLAGS"
2327 elif test "$cc_vendor" = "intel" ; then
2328 extra_ldflags
="$extra_ldflags -i-static"
2330 if test -n "$CPPFLAGS" ; then
2331 extra_cflags
="$extra_cflags $CPPFLAGS"
2338 # Checking assembler (_as) compatibility...
2339 # Added workaround for older as that reads from stdin by default - atmos
2340 as_version
=$
(echo '' |
$_as -version 2>&1 |
sed -n 's/^.*assembler \(version \)*\([0-9.]*\).*$/\2/p')
2341 echocheck
"assembler ($_as $as_version)"
2343 _pref_as_version
='2.9.1'
2345 if test "$_mmx" = yes ; then
2346 echo 'emms' >> $TMPS
2348 if test "$_3dnow" = yes ; then
2349 _pref_as_version
='2.10.1'
2350 echo 'femms' >> $TMPS
2352 if test "$_3dnowext" = yes ; then
2353 _pref_as_version
='2.10.1'
2354 echo 'pswapd %mm0, %mm0' >> $TMPS
2356 if test "$_mmxext" = yes ; then
2357 _pref_as_version
='2.10.1'
2358 echo 'movntq %mm0, (%eax)' >> $TMPS
2360 if test "$_sse" = yes ; then
2361 _pref_as_version
='2.10.1'
2362 echo 'xorps %xmm0, %xmm0' >> $TMPS
2364 #if test "$_sse2" = yes ; then
2365 # _pref_as_version='2.11'
2366 # echo 'xorpd %xmm0, %xmm0' >> $TMPS
2368 if test "$_cmov" = yes ; then
2369 _pref_as_version
='2.10.1'
2370 echo 'cmovb %eax, %ebx' >> $TMPS
2372 if test "$_ssse3" = yes ; then
2373 _pref_as_version
='2.16.92'
2374 echo 'pabsd %xmm0, %xmm1' >> $TMPS
2376 $_as $TMPS -o $TMPEXE > /dev
/null
2>&1 || as_verc_fail
=yes
2378 if test "$as_verc_fail" != yes ; then
2381 res_comment
="Upgrade binutils to ${_pref_as_version} or use --disable-ssse3 etc."
2383 die
"obsolete binutils version"
2393 #if !(defined(__PIC__) || defined(__pic__) || defined(PIC))
2394 #error PIC not enabled
2399 cc_check
&& pic
=yes && extra_cflags
="$extra_cflags -DPIC"
2405 echocheck
".align is a power of two"
2406 if test "$_asmalign_pot" = auto
; then
2408 inline_asm_check
'".align 3"' && _asmalign_pot
=yes
2410 if test "$_asmalign_pot" = "yes" ; then
2411 def_asmalign_pot
='#define ASMALIGN(ZEROBITS) ".align " #ZEROBITS "\n\t"'
2413 def_asmalign_pot
='#define ASMALIGN(ZEROBITS) ".align 1<<" #ZEROBITS "\n\t"'
2415 echores
$_asmalign_pot
2418 echocheck
"ebx availability"
2420 def_ebx_available
='#define HAVE_EBX_AVAILABLE 0'
2427 // just adding ebx to clobber list seems unreliable with some
2428 // compilers, e.g. Haiku's gcc 2.95
2430 // and the above check does not work for OSX 64 bit...
2431 __asm__ volatile("":::"%ebx");
2435 cc_check
&& ebx_available
=yes && def_ebx_available
='#define HAVE_EBX_AVAILABLE 1'
2436 echores
$ebx_available
2440 if test -z "$YASMFLAGS" ; then
2442 x86_64
&& objformat
="macho64" || objformat
="macho"
2448 # currently tested for Linux x86, x86_64
2449 YASMFLAGS
="-f $objformat"
2450 x86_64
&& YASMFLAGS
="$YASMFLAGS -DARCH_X86_64 -m amd64"
2451 test "$pic" = "yes" && YASMFLAGS
="$YASMFLAGS -DPIC"
2452 case "$objformat" in
2453 elf
) test $_debug && YASMFLAGS
="$YASMFLAGS -g dwarf2" ;;
2454 *) YASMFLAGS
="$YASMFLAGS -DPREFIX" ;;
2460 echo "pabsw xmm0, xmm0" > $TMPS
2461 yasm_check || _yasm
=""
2462 if test $_yasm ; then
2463 def_yasm
='#define HAVE_YASM 1'
2467 def_yasm
='#define HAVE_YASM 0'
2473 def_bswap
='#define HAVE_BSWAP 0'
2474 echo 'bswap %eax' > $TMPS
2475 $_as $TMPS -o $TMPEXE > /dev
/null
2>&1 && def_bswap
='#define HAVE_BSWAP 1' && bswap
=yes || bswap
=no
2480 #FIXME: This should happen before the check for CFLAGS..
2481 def_altivec_h
='#define HAVE_ALTIVEC_H 0'
2482 if ppc
&& ( test "$_altivec" = yes ||
test "$_runtime_cpudetection" = yes ) ; then
2484 # check if AltiVec is supported by the compiler, and how to enable it
2485 echocheck
"GCC AltiVec flags"
2486 if $
(cflag_check
-maltivec -mabi=altivec
) ; then
2487 _altivec_gcc_flags
="-maltivec -mabi=altivec"
2488 # check if <altivec.h> should be included
2489 if $
(header_check altivec.h
$_altivec_gcc_flags) ; then
2490 def_altivec_h
='#define HAVE_ALTIVEC_H 1'
2491 inc_altivec_h
='#include <altivec.h>'
2493 if $
(cflag_check
-faltivec) ; then
2494 _altivec_gcc_flags
="-faltivec"
2497 _altivec_gcc_flags
="none, AltiVec disabled"
2501 echores
"$_altivec_gcc_flags"
2503 # check if the compiler supports braces for vector declarations
2506 int main(void) { (vector int) {1}; return 0; }
2508 cc_check
$_altivec_gcc_flags || die
"You need a compiler that supports {} in AltiVec vector declarations."
2510 # Disable runtime cpudetection if we cannot generate AltiVec code or
2511 # AltiVec is disabled by the user.
2512 test "$_runtime_cpudetection" = yes && test "$_altivec" = no \
2513 && _runtime_cpudetection
=no
2515 # Show that we are optimizing for AltiVec (if enabled and supported).
2516 test "$_runtime_cpudetection" = no
&& test "$_altivec" = yes \
2517 && _optimizing
="$_optimizing altivec"
2519 # If AltiVec is enabled, make sure the correct flags turn up in CFLAGS.
2520 test "$_altivec" = yes && CFLAGS
="$CFLAGS $_altivec_gcc_flags"
2524 def_xform_asm
='#define HAVE_XFORM_ASM 0'
2526 echocheck
"XFORM ASM support"
2527 inline_asm_check
'"lwzx %1, %y0" :: "Z"(*(int*)0), "r"(0)' &&
2528 xform_asm
=yes && def_xform_asm
='#define HAVE_XFORM_ASM 1'
2529 echores
"$xform_asm"
2533 echocheck
"ARMv5TE (Enhanced DSP Extensions)"
2534 if test $_armv5te = "auto" ; then
2536 inline_asm_check
'"qadd r0, r0, r0"' && _armv5te
=yes
2540 test $_armv5te = "yes" && test $_fast_clz = "auto" && _fast_clz
=yes
2542 echocheck
"ARMv6 (SIMD instructions)"
2543 if test $_armv6 = "auto" ; then
2545 inline_asm_check
'"sadd16 r0, r0, r0"' && _armv6
=yes
2549 echocheck
"ARMv6t2 (SIMD instructions)"
2550 if test $_armv6t2 = "auto" ; then
2552 inline_asm_check
'"movt r0, #0"' && _armv6t2
=yes
2557 if test $_armvfp = "auto" ; then
2559 inline_asm_check
'"fadds s0, s0, s0"' && _armvfp
=yes
2563 echocheck
"ARM NEON"
2564 if test $neon = "auto" ; then
2566 inline_asm_check
'"vadd.i16 q0, q0, q0"' && neon
=yes
2570 echocheck
"iWMMXt (Intel XScale SIMD instructions)"
2571 if test $_iwmmxt = "auto" ; then
2573 inline_asm_check
'"wunpckelub wr6, wr4"' && _iwmmxt
=yes
2578 cpuexts_all
='ALTIVEC MMX MMX2 AMD3DNOW AMD3DNOWEXT SSE SSE2 SSSE3 FAST_CMOV CMOV FAST_CLZ ARMV5TE ARMV6 ARMV6T2 ARMVFP NEON IWMMXT MMI VIS MVI'
2579 test "$_altivec" = yes && cpuexts
="ALTIVEC $cpuexts"
2580 test "$_mmx" = yes && cpuexts
="MMX $cpuexts"
2581 test "$_mmxext" = yes && cpuexts
="MMX2 $cpuexts"
2582 test "$_3dnow" = yes && cpuexts
="AMD3DNOW $cpuexts"
2583 test "$_3dnowext" = yes && cpuexts
="AMD3DNOWEXT $cpuexts"
2584 test "$_sse" = yes && cpuexts
="SSE $cpuexts"
2585 test "$_sse2" = yes && cpuexts
="SSE2 $cpuexts"
2586 test "$_ssse3" = yes && cpuexts
="SSSE3 $cpuexts"
2587 test "$_cmov" = yes && cpuexts
="CMOV $cpuexts"
2588 test "$_fast_cmov" = yes && cpuexts
="FAST_CMOV $cpuexts"
2589 test "$_fast_clz" = yes && cpuexts
="FAST_CLZ $cpuexts"
2590 test "$_armv5te" = yes && cpuexts
="ARMV5TE $cpuexts"
2591 test "$_armv6" = yes && cpuexts
="ARMV6 $cpuexts"
2592 test "$_armv6t2" = yes && cpuexts
="ARMV6T2 $cpuexts"
2593 test "$_armvfp" = yes && cpuexts
="ARMVFP $cpuexts"
2594 test "$neon" = yes && cpuexts
="NEON $cpuexts"
2595 test "$_iwmmxt" = yes && cpuexts
="IWMMXT $cpuexts"
2596 test "$_vis" = yes && cpuexts
="VIS $cpuexts"
2597 test "$_mvi" = yes && cpuexts
="MVI $cpuexts"
2599 # Checking kernel version...
2600 if x86_32
&& linux
; then
2602 kernel_version
=$
(uname
-r 2>&1)
2603 echocheck
"$system_name kernel version"
2604 case "$kernel_version" in
2605 '') kernel_version
="?.??"; _k_verc_fail
=yes;;
2606 [0-1].
[0-9].
[0-9]*|
2.
[0-3].
[0-9]*)
2607 _k_verc_problem
=yes;;
2609 if test "$_k_verc_problem" = yes && test "$_sse" = yes ; then
2612 if test "$_k_verc_fail" ; then
2613 echores
"$kernel_version, fail"
2614 echo "WARNING! If you want to run MPlayer on this system, get prepared for problems!"
2615 echo "2.2.x has limited SSE support. Upgrade the kernel or use --disable-sse if you"
2616 echo "experience crashes. MPlayer tries to autodetect if your kernel correctly"
2617 echo "supports SSE, but you have been warned! If you are using a kernel older than"
2618 echo "2.2.x you must upgrade it to get SSE support!"
2619 # die "Your kernel is too old for this CPU." # works fine on some 2.2.x so don't die (later check will test)
2621 echores
"$kernel_version, ok"
2625 ######################
2626 # MAIN TESTS GO HERE #
2627 ######################
2631 if cflag_check
-lposix ; then
2632 extra_ldflags
="$extra_ldflags -lposix"
2639 if cflag_check
-lm ; then
2648 echocheck
"langinfo"
2649 if test "$_langinfo" = auto
; then
2651 statement_check langinfo.h
'nl_langinfo(CODESET)' && _langinfo
=yes
2653 if test "$_langinfo" = yes ; then
2654 def_langinfo
='#define HAVE_LANGINFO 1'
2656 def_langinfo
='#undef HAVE_LANGINFO'
2658 echores
"$_langinfo"
2661 echocheck
"translation support"
2662 if test "$_translation" = yes; then
2663 def_translation
="#define CONFIG_TRANSLATION 1"
2665 def_translation
="#undef CONFIG_TRANSLATION"
2667 echores
"$_translation"
2669 echocheck
"language"
2670 # Set preferred languages, "all" uses English as main language.
2671 test -z "$language" && language
=$LINGUAS
2672 test -z "$language_doc" && language_doc
=$language
2673 test -z "$language_man" && language_man
=$language
2674 test -z "$language_msg" && language_msg
=$language
2675 test -z "$language_msg" && language_msg
="all"
2676 language_doc
=$
(echo $language_doc |
tr , " ")
2677 language_man
=$
(echo $language_man |
tr , " ")
2678 language_msg
=$
(echo $language_msg |
tr , " ")
2680 test "$language_doc" = "all" && language_doc
=$doc_lang_all
2681 test "$language_man" = "all" && language_man
=$man_lang_all
2682 test "$language_msg" = "all" && language_msg
=$msg_lang_all
2684 if test "$_translation" != yes ; then
2688 # Prune non-existing translations from language lists.
2689 # Set message translation to the first available language.
2690 # Fall back on English.
2691 for lang
in $language_doc ; do
2692 test -d DOCS
/xml
/$lang && tmp_language_doc
="$tmp_language_doc $lang"
2694 language_doc
=$tmp_language_doc
2695 test -z "$language_doc" && language_doc
=en
2697 for lang
in $language_man ; do
2698 test -d DOCS
/man
/$lang && tmp_language_man
="$tmp_language_man $lang"
2700 language_man
=$tmp_language_man
2701 test -z "$language_man" && language_man
=en
2703 for lang
in $language_msg ; do
2704 test -f po
/$lang.po
&& tmp_language_msg
="$tmp_language_msg $lang"
2706 language_msg
=$tmp_language_msg
2708 echores
"messages (en+): $language_msg - man pages: $language_man - documentation: $language_doc"
2711 echocheck
"enable sighandler"
2712 if test "$_sighandler" = yes ; then
2713 def_sighandler
='#define CONFIG_SIGHANDLER 1'
2715 def_sighandler
='#undef CONFIG_SIGHANDLER'
2717 echores
"$_sighandler"
2719 echocheck
"runtime cpudetection"
2720 if test "$_runtime_cpudetection" = yes ; then
2721 _optimizing
="Runtime CPU-Detection enabled"
2722 def_runtime_cpudetection
='#define CONFIG_RUNTIME_CPUDETECT 1'
2724 def_runtime_cpudetection
='#define CONFIG_RUNTIME_CPUDETECT 0'
2726 echores
"$_runtime_cpudetection"
2729 echocheck
"restrict keyword"
2730 for restrict_keyword
in restrict __restrict __restrict__
; do
2731 echo "void foo(char * $restrict_keyword p); int main(void) { return 0; }" > $TMPC
2733 def_restrict_keyword
=$restrict_keyword
2737 if [ -n "$def_restrict_keyword" ]; then
2738 echores
"$def_restrict_keyword"
2742 # Avoid infinite recursion loop ("#define restrict restrict")
2743 if [ "$def_restrict_keyword" != "restrict" ]; then
2744 def_restrict_keyword
="#define restrict $def_restrict_keyword"
2746 def_restrict_keyword
=""
2750 echocheck
"__builtin_expect"
2751 # GCC branch prediction hint
2753 static int foo(int a) {
2754 a = __builtin_expect(a, 10);
2755 return a == 10 ? 0 : 1;
2757 int main(void) { return foo(10) && foo(0); }
2760 cc_check
&& _builtin_expect
=yes
2761 if test "$_builtin_expect" = yes ; then
2762 def_builtin_expect
='#define HAVE_BUILTIN_EXPECT 1'
2764 def_builtin_expect
='#undef HAVE_BUILTIN_EXPECT'
2766 echores
"$_builtin_expect"
2771 statement_check kstat.h
'kstat_open()' -lkstat && _kstat
=yes
2772 if test "$_kstat" = yes ; then
2773 def_kstat
="#define HAVE_LIBKSTAT 1"
2774 extra_ldflags
="$extra_ldflags -lkstat"
2776 def_kstat
="#undef HAVE_LIBKSTAT"
2782 # required for nanosleep on some systems
2784 statement_check
time.h
'nanosleep(0, 0)' -lposix4 && _posix4
=yes
2785 if test "$_posix4" = yes ; then
2786 extra_ldflags
="$extra_ldflags -lposix4"
2790 for func
in exp2 exp2f llrint log2 log2f lrint lrintf round roundf truncf
; do
2793 statement_check math.h
"${func}(2.0)" -D_ISOC99_SOURCE $_ld_lm && eval _
$func=yes
2794 if eval test "x\$_$func" = "xyes"; then
2795 eval def_
$func="\"#define HAVE_$(echo $func | tr '[a-z]' '[A-Z]') 1\""
2798 eval def_
$func="\"#define HAVE_$(echo $func | tr '[a-z]' '[A-Z]') 0\""
2806 define_statement_check
"_XOPEN_SOURCE 600" "stdlib.h" 'mkstemp("")' && _mkstemp
=yes
2807 if test "$_mkstemp" = yes ; then
2808 def_mkstemp
='#define HAVE_MKSTEMP 1'
2810 def_mkstemp
='#define HAVE_MKSTEMP 0'
2815 echocheck
"nanosleep"
2817 statement_check
time.h
'nanosleep(0, 0)' && _nanosleep
=yes
2818 if test "$_nanosleep" = yes ; then
2819 def_nanosleep
='#define HAVE_NANOSLEEP 1'
2821 def_nanosleep
='#undef HAVE_NANOSLEEP'
2823 echores
"$_nanosleep"
2827 # for Solaris (socket stuff is in -lsocket, gethostbyname and friends in -lnsl):
2828 # for BeOS (socket stuff is in -lsocket, gethostbyname and friends in -lbind):
2831 #include <sys/socket.h>
2832 int main(void) { gethostbyname(0); socket(AF_INET, SOCK_STREAM, 0); return 0; }
2835 for _ld_tmp
in "" "-lsocket -lbind" "-lsocket -ldnet" "-lsocket -lnsl" "-lnsl" "-lsocket" ; do
2836 cc_check
$_ld_tmp && _ld_sock
="$_ld_tmp" && _socklib
=yes && break
2838 test $_socklib = yes && test $_winsock2_h = auto
&& _winsock2_h
=no
2839 if test $_winsock2_h = auto
; then
2841 statement_check winsock2.h
'gethostbyname(0)' -lws2_32 && _ld_sock
="-lws2_32" && _winsock2_h
=yes
2843 test "$_ld_sock" && res_comment
="using $_ld_sock"
2847 if test $_winsock2_h = yes ; then
2849 def_winsock2_h
='#define HAVE_WINSOCK2_H 1'
2851 def_winsock2_h
='#define HAVE_WINSOCK2_H 0'
2855 echocheck
"arpa/inet.h"
2857 def_arpa_inet_h
='#define HAVE_ARPA_INET_H 0'
2858 header_check arpa
/inet.h
&& arpa_inet_h
=yes &&
2859 def_arpa_inet_h
='#define HAVE_ARPA_INET_H 1'
2860 echores
"$arpa_inet_h"
2863 echocheck
"inet_pton()"
2864 def_inet_pton
='#define HAVE_INET_PTON 0'
2866 for _ld_tmp
in "$_ld_sock" "$_ld_sock -lresolv" ; do
2867 statement_check arpa
/inet.h
'inet_pton(0, 0, 0)' $_ld_tmp && inet_pton
=yes && break
2869 if test $inet_pton = yes ; then
2870 test "$_ld_tmp" && res_comment
="using $_ld_tmp"
2871 def_inet_pton
='#define HAVE_INET_PTON 1'
2873 echores
"$inet_pton"
2876 echocheck
"inet_aton()"
2877 def_inet_aton
='#define HAVE_INET_ATON 0'
2879 for _ld_tmp
in "$_ld_sock" "$_ld_sock -lresolv" ; do
2880 statement_check arpa
/inet.h
'inet_aton(0, 0)' $_ld_tmp && inet_aton
=yes && break
2882 if test $inet_aton = yes ; then
2883 test "$_ld_tmp" && res_comment
="using $_ld_tmp"
2884 def_inet_aton
='#define HAVE_INET_ATON 1'
2886 echores
"$inet_aton"
2889 echocheck
"socklen_t"
2891 for header
in "sys/socket.h" "ws2tcpip.h" "sys/types.h" ; do
2892 statement_check
$header 'socklen_t v = 0' && _socklen_t
=yes && break
2894 if test "$_socklen_t" = yes ; then
2895 def_socklen_t
='#define HAVE_SOCKLEN_T 1'
2897 def_socklen_t
='#define HAVE_SOCKLEN_T 0'
2899 echores
"$_socklen_t"
2902 echocheck
"closesocket()"
2904 statement_check winsock2.h
'closesocket(~0)' $_ld_sock && _closesocket
=yes
2905 if test "$_closesocket" = yes ; then
2906 def_closesocket
='#define HAVE_CLOSESOCKET 1'
2908 def_closesocket
='#define HAVE_CLOSESOCKET 0'
2910 echores
"$_closesocket"
2913 echocheck
"networking"
2914 test $_winsock2_h = no
&& test $inet_pton = no
&&
2915 test $inet_aton = no
&& networking
=no
2916 if test "$networking" = yes ; then
2917 def_network
='#define CONFIG_NETWORK 1'
2918 def_networking
='#define CONFIG_NETWORKING 1'
2919 extra_ldflags
="$extra_ldflags $_ld_sock"
2920 inputmodules
="networking $inputmodules"
2922 noinputmodules
="networking $noinputmodules"
2923 def_network
='#define CONFIG_NETWORK 0'
2924 def_networking
='#undef CONFIG_NETWORKING'
2926 echores
"$networking"
2930 if test "$_inet6" = auto
; then
2932 #include <sys/types.h>
2933 #if !defined(_WIN32)
2934 #include <sys/socket.h>
2935 #include <netinet/in.h>
2937 #include <ws2tcpip.h>
2939 int main(void) { struct sockaddr_in6 six; socket(AF_INET6, SOCK_STREAM, AF_INET6); return 0; }
2942 if cc_check
$_ld_sock ; then
2946 if test "$_inet6" = yes ; then
2947 def_inet6
='#define HAVE_AF_INET6 1'
2949 def_inet6
='#undef HAVE_AF_INET6'
2954 echocheck
"gethostbyname2"
2955 if test "$_gethostbyname2" = auto
; then
2957 #include <sys/types.h>
2958 #include <sys/socket.h>
2960 int main(void) { gethostbyname2("", AF_INET); return 0; }
2967 if test "$_gethostbyname2" = yes ; then
2968 def_gethostbyname2
='#define HAVE_GETHOSTBYNAME2 1'
2970 def_gethostbyname2
='#undef HAVE_GETHOSTBYNAME2'
2972 echores
"$_gethostbyname2"
2975 echocheck
"inttypes.h (required)"
2977 header_check inttypes.h
&& _inttypes
=yes
2978 echores
"$_inttypes"
2980 if test "$_inttypes" = no
; then
2981 echocheck
"sys/bitypes.h (inttypes.h predecessor)"
2982 header_check sys
/bitypes.h
&& _inttypes
=yes
2983 if test "$_inttypes" = yes ; then
2984 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."
2986 die
"Cannot find header either inttypes.h or bitypes.h. There is no chance for compilation to succeed."
2991 echocheck
"malloc.h"
2993 header_check malloc.h
&& _malloc
=yes
2994 if test "$_malloc" = yes ; then
2995 def_malloc_h
='#define HAVE_MALLOC_H 1'
2997 def_malloc_h
='#define HAVE_MALLOC_H 0'
3002 echocheck
"memalign()"
3003 # XXX restrict to x86 ? extend to other CPUs/cacheline sizes ?
3004 def_memalign_hack
='#define CONFIG_MEMALIGN_HACK 0'
3006 statement_check malloc.h
'memalign(64, sizeof(char))' && _memalign
=yes
3007 if test "$_memalign" = yes ; then
3008 def_memalign
='#define HAVE_MEMALIGN 1'
3010 def_memalign
='#define HAVE_MEMALIGN 0'
3011 def_map_memalign
='#define memalign(a, b) malloc(b)'
3012 darwin || def_memalign_hack
='#define CONFIG_MEMALIGN_HACK 1'
3014 echores
"$_memalign"
3017 echocheck
"posix_memalign()"
3019 def_posix_memalign
='#define HAVE_POSIX_MEMALIGN 0'
3020 define_statement_check
"_XOPEN_SOURCE 600" "stdlib.h" 'posix_memalign(NULL, 0, 0)' &&
3021 posix_memalign
=yes && def_posix_memalign
='#define HAVE_POSIX_MEMALIGN 1'
3022 echores
"$posix_memalign"
3025 echocheck
"alloca.h"
3027 statement_check alloca.h
'alloca(0)' && _alloca
=yes
3029 def_alloca_h
='#define HAVE_ALLOCA_H 1'
3031 def_alloca_h
='#undef HAVE_ALLOCA_H'
3036 echocheck
"fastmemcpy"
3037 if test "$_fastmemcpy" = yes ; then
3038 def_fastmemcpy
='#define CONFIG_FASTMEMCPY 1'
3040 def_fastmemcpy
='#undef CONFIG_FASTMEMCPY'
3042 echores
"$_fastmemcpy"
3047 statement_check sys
/mman.h
'mmap(0, 0, 0, 0, 0, 0)' && _mman
=yes
3048 if test "$_mman" = yes ; then
3049 def_mman_h
='#define HAVE_SYS_MMAN_H 1'
3051 def_mman_h
='#undef HAVE_SYS_MMAN_H'
3055 _mman_has_map_failed
=no
3056 statement_check sys
/mman.h
'void *p = MAP_FAILED' && _mman_has_map_failed
=yes
3057 if test "$_mman_has_map_failed" = yes ; then
3058 def_mman_has_map_failed
=''
3060 def_mman_has_map_failed
='#define MAP_FAILED ((void *) -1)'
3063 echocheck
"dynamic loader"
3065 for _ld_tmp
in "" "-ldl"; do
3066 statement_check dlfcn.h
'dlopen("", 0)' $_ld_tmp && _ld_dl
="$_ld_tmp" && _dl
=yes && break
3068 if test "$_dl" = yes ; then
3069 def_dl
='#define HAVE_LIBDL 1'
3071 def_dl
='#undef HAVE_LIBDL'
3076 def_threads
='#define HAVE_THREADS 0'
3080 THREAD_CFLAGS
=-D_REENTRANT
3081 elif freebsd || netbsd || openbsd || bsdos
; then
3082 THREAD_CFLAGS
=-D_THREAD_SAFE
3084 if test "$_pthreads" = auto
; then
3086 #include <pthread.h>
3087 static void *func(void *arg) { return arg; }
3090 #ifdef PTW32_STATIC_LIB
3091 pthread_win32_process_attach_np();
3092 pthread_win32_thread_attach_np();
3094 return pthread_create (&tid, 0, func, 0) != 0;
3099 for _ld_tmp
in "-lpthreadGC2" "" "-lpthread" "-pthread" ; do
3100 # for crosscompilation, we cannot execute the program, be happy if we can link statically
3101 cc_check
$THREAD_CFLAGS $_ld_tmp && (tmp_run ||
test "$_ld_static") && _ld_pthread
="$_ld_tmp" && _pthreads
=yes && break
3103 if test "$_pthreads" = no
&& mingw32
; then
3104 _ld_tmp
="-lpthreadGC2 -lws2_32"
3105 cc_check
$_ld_tmp -DPTW32_STATIC_LIB && (tmp_run ||
test "$_ld_static") && _ld_pthread
="$_ld_tmp" && _pthreads
=yes && CFLAGS
="$CFLAGS -DPTW32_STATIC_LIB"
3109 if test "$_pthreads" = yes ; then
3110 test $_ld_pthread && res_comment
="using $_ld_pthread"
3111 def_pthreads
='#define HAVE_PTHREADS 1'
3112 def_threads
='#define HAVE_THREADS 1'
3113 extra_cflags
="$extra_cflags $THREAD_CFLAGS"
3115 res_comment
="v4l, v4l2, ao_nas, win32 loader disabled"
3116 def_pthreads
='#undef HAVE_PTHREADS'
3117 _nas
=no
; _tv_v4l1
=no
; _tv_v4l2
=no
3118 mingw32 || _win32dll
=no
3120 echores
"$_pthreads"
3123 if test "$_pthreads" = yes ; then
3124 def_pthread_cache
="#define PTHREAD_CACHE 1"
3127 def_stream_cache
="#undef CONFIG_STREAM_CACHE"
3131 echocheck
"w32threads"
3132 if test "$_pthreads" = yes ; then
3133 res_comment
="using pthread instead"
3136 if test "$_w32threads" = auto
; then
3138 mingw32
&& _w32threads
=yes
3140 test "$_w32threads" = yes && def_threads
='#define HAVE_THREADS 1'
3141 echores
"$_w32threads"
3144 if test "$_rpath" = yes ; then
3145 for I
in $
(echo $extra_ldflags |
sed 's/-L//g') ; do
3146 tmp
="$tmp $(echo $I | sed 's/.*/ -L& -Wl,-R&/')"
3153 if test "$_iconv" = auto
; then
3158 #define INBUFSIZE 1024
3159 #define OUTBUFSIZE 4096
3161 char inbuffer[INBUFSIZE];
3162 char outbuffer[OUTBUFSIZE];
3167 char *tocode="UTF-8";
3168 char *fromcode="cp1250";
3169 if ((icdsc = iconv_open(tocode, fromcode)) != (iconv_t)(-1)) {
3170 while ((numread = read(0, inbuffer, INBUFSIZE))) {
3171 char *iptr=inbuffer;
3172 char *optr=outbuffer;
3173 size_t inleft=numread;
3174 size_t outleft=OUTBUFSIZE;
3175 if (iconv(icdsc, &iptr, &inleft, &optr, &outleft)
3177 write(1, outbuffer, OUTBUFSIZE - outleft);
3180 if (iconv_close(icdsc) == -1)
3187 for _ld_tmp
in "" "-liconv" "-liconv $_ld_dl" ; do
3188 cc_check
$_ld_lm $_ld_tmp && extra_ldflags
="$extra_ldflags $_ld_tmp" &&
3191 if test "$_iconv" != yes ; then
3192 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."
3195 if test "$_iconv" = yes ; then
3196 def_iconv
='#define CONFIG_ICONV 1'
3198 def_iconv
='#undef CONFIG_ICONV'
3203 echocheck
"soundcard.h"
3205 def_soundcard_h
='#undef HAVE_SOUNDCARD_H'
3206 def_sys_soundcard_h
='#undef HAVE_SYS_SOUNDCARD_H'
3207 for _soundcard_header
in "sys/soundcard.h" "soundcard.h"; do
3208 header_check
$_soundcard_header && _soundcard_h
=yes &&
3209 res_comment
="$_soundcard_header" && break
3212 if test "$_soundcard_h" = yes ; then
3213 if test $_soundcard_header = "sys/soundcard.h"; then
3214 def_sys_soundcard_h
='#define HAVE_SYS_SOUNDCARD_H 1'
3216 def_soundcard_h
='#define HAVE_SOUNDCARD_H 1'
3219 echores
"$_soundcard_h"
3222 echocheck
"sys/videoio.h"
3224 def_sys_videoio_h
='#undef HAVE_SYS_VIDEOIO_H'
3225 header_check sys
/videoio.h
&& sys_videoio_h
=yes &&
3226 def_sys_videoio_h
='#define HAVE_SYS_VIDEOIO_H 1'
3227 echores
"$sys_videoio_h"
3230 echocheck
"sys/dvdio.h"
3232 # FreeBSD 8.1 has broken dvdio.h
3233 header_check_broken sys
/types.h sys
/dvdio.h
&& _dvdio
=yes
3234 if test "$_dvdio" = yes ; then
3235 def_dvdio
='#define DVD_STRUCT_IN_SYS_DVDIO_H 1'
3237 def_dvdio
='#undef DVD_STRUCT_IN_SYS_DVDIO_H'
3242 echocheck
"sys/cdio.h"
3244 # at least OpenSolaris has a broken cdio.h
3245 header_check_broken sys
/types.h sys
/cdio.h
&& _cdio
=yes
3246 if test "$_cdio" = yes ; then
3247 def_cdio
='#define DVD_STRUCT_IN_SYS_CDIO_H 1'
3249 def_cdio
='#undef DVD_STRUCT_IN_SYS_CDIO_H'
3254 echocheck
"linux/cdrom.h"
3256 header_check linux
/cdrom.h
&& _cdrom
=yes
3257 if test "$_cdrom" = yes ; then
3258 def_cdrom
='#define DVD_STRUCT_IN_LINUX_CDROM_H 1'
3260 def_cdrom
='#undef DVD_STRUCT_IN_LINUX_CDROM_H'
3267 header_check dvd.h
&& _dvd
=yes
3268 if test "$_dvd" = yes ; then
3269 def_dvd
='#define DVD_STRUCT_IN_DVD_H 1'
3271 def_dvd
='#undef DVD_STRUCT_IN_DVD_H'
3277 echocheck
"BSDI dvd.h"
3279 header_check dvd.h
&& _bsdi_dvd
=yes
3280 if test "$_bsdi_dvd" = yes ; then
3281 def_bsdi_dvd
='#define DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H 1'
3283 def_bsdi_dvd
='#undef DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H'
3285 echores
"$_bsdi_dvd"
3290 # also used by AIX, but AIX does not support VCD and/or libdvdread
3291 echocheck
"HP-UX SCSI header"
3293 header_check sys
/scsi.h
&& _hpux_scsi_h
=yes
3294 if test "$_hpux_scsi_h" = yes ; then
3295 def_hpux_scsi_h
='#define HPUX_SCTL_IO 1'
3297 def_hpux_scsi_h
='#undef HPUX_SCTL_IO'
3299 echores
"$_hpux_scsi_h"
3304 echocheck
"userspace SCSI headers (Solaris)"
3306 header_check sys
/scsi
/scsi_types.h
&&
3307 header_check_broken sys
/types.h sys
/scsi
/impl
/uscsi.h
&&
3309 if test "$_sol_scsi_h" = yes ; then
3310 def_sol_scsi_h
='#define SOLARIS_USCSI 1'
3312 def_sol_scsi_h
='#undef SOLARIS_USCSI'
3314 echores
"$_sol_scsi_h"
3319 if test "$_termcap" = auto
; then
3321 for _ld_tmp
in "-lncurses" "-ltinfo" "-ltermcap"; do
3322 statement_check term.h
'tgetent(0, 0)' $_ld_tmp &&
3323 extra_ldflags
="$extra_ldflags $_ld_tmp" && _termcap
=yes && break
3326 if test "$_termcap" = yes ; then
3327 def_termcap
='#define HAVE_TERMCAP 1'
3328 test $_ld_tmp && res_comment
="using $_ld_tmp"
3330 def_termcap
='#undef HAVE_TERMCAP'
3336 def_termios
='#undef HAVE_TERMIOS'
3337 def_termios_h
='#undef HAVE_TERMIOS_H'
3338 def_termios_sys_h
='#undef HAVE_SYS_TERMIOS_H'
3339 if test "$_termios" = auto
; then
3341 for _termios_header
in "termios.h" "sys/termios.h"; do
3342 header_check
$_termios_header && _termios
=yes &&
3343 res_comment
="using $_termios_header" && break
3347 if test "$_termios" = yes ; then
3348 def_termios
='#define HAVE_TERMIOS 1'
3349 if test "$_termios_header" = "termios.h" ; then
3350 def_termios_h
='#define HAVE_TERMIOS_H 1'
3352 def_termios_sys_h
='#define HAVE_SYS_TERMIOS_H 1'
3359 if test "$_shm" = auto
; then
3361 statement_check sys
/shm.h
'shmget(0, 0, 0); shmat(0, 0, 0); shmctl(0, 0, 0)' && _shm
=yes
3363 if test "$_shm" = yes ; then
3364 def_shm
='#define HAVE_SHM 1'
3366 def_shm
='#undef HAVE_SHM'
3371 echocheck
"strsep()"
3373 statement_check string.h
'char *s = "Hello, world!"; strsep(&s, ",")' && _strsep
=yes
3374 if test "$_strsep" = yes ; then
3375 def_strsep
='#define HAVE_STRSEP 1'
3378 def_strsep
='#undef HAVE_STRSEP'
3384 echocheck
"vsscanf()"
3386 #define _ISOC99_SOURCE
3389 int main(void) { va_list ap; vsscanf("foo", "bar", ap); return 0; }
3392 cc_check
&& _vsscanf
=yes
3393 if test "$_vsscanf" = yes ; then
3394 def_vsscanf
='#define HAVE_VSSCANF 1'
3397 def_vsscanf
='#undef HAVE_VSSCANF'
3405 define_statement_check
"_XOPEN_SOURCE 600" "unistd.h" 'int a, b; swab(&a, &b, 0)' ||
3406 statement_check
"string.h" 'int a, b; swab(&a, &b, 0)' && _swab
=yes
3407 if test "$_swab" = yes ; then
3408 def_swab
='#define HAVE_SWAB 1'
3411 def_swab
='#undef HAVE_SWAB'
3416 echocheck
"POSIX select()"
3420 #include <sys/types.h>
3422 #include <sys/time.h>
3424 int main(void) {int nfds = 1; fd_set readfds; struct timeval timeout; select(nfds, &readfds, NULL, NULL, &timeout); return 0; }
3427 def_posix_select
='#undef HAVE_POSIX_SELECT'
3428 cc_check
&& _posix_select
=yes &&
3429 def_posix_select
='#define HAVE_POSIX_SELECT 1'
3430 echores
"$_posix_select"
3433 echocheck
"audio select()"
3434 if test "$_select" = no
; then
3435 def_select
='#undef HAVE_AUDIO_SELECT'
3436 elif test "$_select" = yes ; then
3437 def_select
='#define HAVE_AUDIO_SELECT 1'
3442 echocheck
"gettimeofday()"
3444 statement_check sys
/time.h
'struct timeval tv; struct timezone tz; gettimeofday(&tv, &tz)' && _gettimeofday
=yes
3445 if test "$_gettimeofday" = yes ; then
3446 def_gettimeofday
='#define HAVE_GETTIMEOFDAY 1'
3447 need_gettimeofday
=no
3449 def_gettimeofday
='#undef HAVE_GETTIMEOFDAY'
3450 need_gettimeofday
=yes
3452 echores
"$_gettimeofday"
3457 statement_check glob.h
'glob("filename", 0, 0, 0)' && _glob
=yes
3459 if test "$_glob" = yes ; then
3460 def_glob
='#define HAVE_GLOB 1'
3462 def_glob
='#undef HAVE_GLOB'
3463 # HACK! need_glob currently enables compilation of a
3464 # win32-specific glob()-replacement.
3465 # Other OS neither need it nor can they use it (mf:// is disabled for them).
3466 win32
&& need_glob
=yes
3471 echocheck
"setenv()"
3473 statement_check stdlib.h
'setenv("", "", 0)' && _setenv
=yes
3474 if test "$_setenv" = yes ; then
3475 def_setenv
='#define HAVE_SETENV 1'
3478 def_setenv
='#undef HAVE_SETENV'
3484 echocheck
"setmode()"
3486 def_setmode
='#define HAVE_SETMODE 0'
3487 statement_check io.h
'setmode(0, 0)' && _setmode
=yes && def_setmode
='#define HAVE_SETMODE 1'
3492 echocheck
"sysi86()"
3494 statement_check sys
/sysi86.h
'sysi86(0)' && _sysi86
=yes
3495 if test "$_sysi86" = yes ; then
3496 def_sysi86
='#define HAVE_SYSI86 1'
3497 statement_check sys
/sysi86.h
'int sysi86(int, void*); sysi86(0)' && def_sysi86_iv
='#define HAVE_SYSI86_iv 1'
3499 def_sysi86
='#undef HAVE_SYSI86'
3505 echocheck
"sys/sysinfo.h"
3507 statement_check sys
/sysinfo.h
'struct sysinfo s_info; s_info.mem_unit=0; sysinfo(&s_info)' && _sys_sysinfo
=yes
3508 if test "$_sys_sysinfo" = yes ; then
3509 def_sys_sysinfo_h
='#define HAVE_SYS_SYSINFO_H 1'
3511 def_sys_sysinfo_h
='#undef HAVE_SYS_SYSINFO_H'
3513 echores
"$_sys_sysinfo"
3518 echocheck
"Mac OS X Finder Support"
3519 def_macosx_finder
='#undef CONFIG_MACOSX_FINDER'
3520 if test "$_macosx_finder" = yes ; then
3521 def_macosx_finder
='#define CONFIG_MACOSX_FINDER 1'
3522 extra_ldflags
="$extra_ldflags -framework Cocoa"
3524 echores
"$_macosx_finder"
3526 echocheck
"Mac OS X Bundle file locations"
3527 def_macosx_bundle
='#undef CONFIG_MACOSX_BUNDLE'
3528 test "$_macosx_bundle" = auto
&& _macosx_bundle
=$_macosx_finder
3529 if test "$_macosx_bundle" = yes ; then
3530 def_macosx_bundle
='#define CONFIG_MACOSX_BUNDLE 1'
3532 echores
"$_macosx_bundle"
3534 echocheck
"Apple Remote"
3535 if test "$_apple_remote" = auto
; then
3539 #include <IOKit/IOCFPlugIn.h>
3541 io_iterator_t hidObjectIterator = (io_iterator_t)NULL;
3542 CFMutableDictionaryRef hidMatchDictionary;
3543 IOReturn ioReturnValue;
3545 // Set up a matching dictionary to search the I/O Registry by class.
3546 // name for all HID class devices
3547 hidMatchDictionary = IOServiceMatching("AppleIRController");
3549 // Now search I/O Registry for matching devices.
3550 ioReturnValue = IOServiceGetMatchingServices(kIOMasterPortDefault,
3551 hidMatchDictionary, &hidObjectIterator);
3553 // If search is unsuccessful, return nonzero.
3554 if (ioReturnValue != kIOReturnSuccess ||
3555 !IOIteratorIsValid(hidObjectIterator)) {
3561 cc_check
-framework IOKit
&& _apple_remote
=yes
3563 if test "$_apple_remote" = yes ; then
3564 def_apple_remote
='#define CONFIG_APPLE_REMOTE 1'
3565 libs_mplayer
="$libs_mplayer -framework IOKit -framework Cocoa"
3567 def_apple_remote
='#undef CONFIG_APPLE_REMOTE'
3569 echores
"$_apple_remote"
3575 echocheck
"Apple IR"
3576 if test "$_apple_ir" = auto
; then
3578 statement_check linux
/input.h
'struct input_event ev; struct input_id id' && _apple_ir
=yes
3580 if test "$_apple_ir" = yes ; then
3581 def_apple_ir
='#define CONFIG_APPLE_IR 1'
3583 def_apple_ir
='#undef CONFIG_APPLE_IR'
3585 echores
"$_apple_ir"
3588 echocheck
"pkg-config"
3589 if $
($_pkg_config --version > /dev
/null
2>&1); then
3590 if test "$_ld_static"; then
3591 _pkg_config
="$_pkg_config --static"
3600 echocheck
"Samba support (libsmbclient)"
3601 if test "$_smb" = yes; then
3602 extra_ldflags
="$extra_ldflags -lsmbclient"
3604 if test "$_smb" = auto
; then
3606 for _ld_tmp
in "-lsmbclient" "-lsmbclient $_ld_dl" "-lsmbclient $_ld_dl -lnsl" "-lsmbclient $_ld_dl -lssl -lnsl" ; do
3607 statement_check libsmbclient.h
'smbc_opendir("smb://")' $_ld_tmp &&
3608 extra_ldflags
="$extra_ldflags $_ld_tmp" && _smb
=yes && break
3612 if test "$_smb" = yes; then
3613 def_smb
="#define CONFIG_LIBSMBCLIENT 1"
3614 inputmodules
="smb $inputmodules"
3616 def_smb
="#undef CONFIG_LIBSMBCLIENT"
3617 noinputmodules
="smb $noinputmodules"
3628 if test "$_tdfxfb" = yes ; then
3629 def_tdfxfb
='#define CONFIG_TDFXFB 1'
3630 vomodules
="tdfxfb $vomodules"
3632 def_tdfxfb
='#undef CONFIG_TDFXFB'
3633 novomodules
="tdfxfb $novomodules"
3638 if test "$_s3fb" = yes ; then
3639 def_s3fb
='#define CONFIG_S3FB 1'
3640 vomodules
="s3fb $vomodules"
3642 def_s3fb
='#undef CONFIG_S3FB'
3643 novomodules
="s3fb $novomodules"
3648 if test "$_wii" = yes ; then
3649 def_wii
='#define CONFIG_WII 1'
3650 vomodules
="wii $vomodules"
3652 def_wii
='#undef CONFIG_WII'
3653 novomodules
="wii $novomodules"
3658 if test "$_tdfxvid" = yes ; then
3659 def_tdfxvid
='#define CONFIG_TDFX_VID 1'
3660 vomodules
="tdfx_vid $vomodules"
3662 def_tdfxvid
='#undef CONFIG_TDFX_VID'
3663 novomodules
="tdfx_vid $novomodules"
3668 if test "$_xvr100" = auto
; then
3671 #include <sys/fbio.h>
3672 #include <sys/visual_io.h>
3674 struct vis_identifier ident;
3675 struct fbgattr attr;
3676 ioctl(0, VIS_GETIDENTIFIER, &ident);
3677 ioctl(0, FBIOGATTR, &attr);
3682 cc_check
&& _xvr100
=yes
3684 if test "$_xvr100" = yes ; then
3685 def_xvr100
='#define CONFIG_XVR100 1'
3686 vomodules
="xvr100 $vomodules"
3688 def_tdfxvid
='#undef CONFIG_XVR100'
3689 novomodules
="xvr100 $novomodules"
3694 if test "$_tga" = yes ; then
3695 def_tga
='#define CONFIG_TGA 1'
3696 vomodules
="tga $vomodules"
3698 def_tga
='#undef CONFIG_TGA'
3699 novomodules
="tga $novomodules"
3704 echocheck
"md5sum support"
3705 if test "$_md5sum" = yes; then
3706 def_md5sum
="#define CONFIG_MD5SUM 1"
3707 vomodules
="md5sum $vomodules"
3709 def_md5sum
="#undef CONFIG_MD5SUM"
3710 novomodules
="md5sum $novomodules"
3715 echocheck
"yuv4mpeg support"
3716 if test "$_yuv4mpeg" = yes; then
3717 def_yuv4mpeg
="#define CONFIG_YUV4MPEG 1"
3718 vomodules
="yuv4mpeg $vomodules"
3720 def_yuv4mpeg
="#undef CONFIG_YUV4MPEG"
3721 novomodules
="yuv4mpeg $novomodules"
3723 echores
"$_yuv4mpeg"
3727 if test "$_bl" = yes ; then
3728 def_bl
='#define CONFIG_BL 1'
3729 vomodules
="bl $vomodules"
3731 def_bl
='#undef CONFIG_BL'
3732 novomodules
="bl $novomodules"
3737 echocheck
"DirectFB"
3738 if test "$_directfb" = auto
; then
3741 #include <directfb.h>
3742 #include <directfb_version.h>
3743 #if (DIRECTFB_MAJOR_VERSION << 16 | DIRECTFB_MINOR_VERSION << 8 | DIRECTFB_MICRO_VERSION) < (0 << 16 | 9 << 8 | 22)
3744 #error "DirectFB version too old."
3746 int main(void) { DirectFBInit(0, 0); return 0; }
3748 for _inc_tmp
in "" -I/usr
/local
/include
/directfb
-I/usr
/include
/directfb
-I/usr
/local
/include
; do
3749 cc_check
$_inc_tmp -ldirectfb &&
3750 _directfb
=yes && extra_cflags
="$extra_cflags $_inc_tmp" && break
3753 if test "$_directfb" = yes ; then
3754 def_directfb
='#define CONFIG_DIRECTFB 1'
3755 vomodules
="directfb dfbmga $vomodules"
3756 libs_mplayer
="$libs_mplayer -ldirectfb"
3758 def_directfb
='#undef CONFIG_DIRECTFB'
3759 novomodules
="directfb dfbmga $novomodules"
3761 echores
"$_directfb"
3766 echocheck
"QuickTime"
3767 if test "$quicktime" = auto
; then
3769 statement_check QuickTime
/QuickTime.h
'ImageDescription *desc; EnterMovies(); ExitMovies()' -framework QuickTime
&& quicktime
=yes
3771 if test "$quicktime" = yes ; then
3772 extra_ldflags
="$extra_ldflags -framework QuickTime"
3773 def_quicktime
='#define CONFIG_QUICKTIME 1'
3775 def_quicktime
='#undef CONFIG_QUICKTIME'
3780 if test "$_cocoa" = auto
; then
3782 #include <CoreServices/CoreServices.h>
3783 #include <OpenGL/OpenGL.h>
3785 NSApplicationLoad();
3789 cc_check
-framework Cocoa
-framework OpenGL
&& _cocoa
=yes
3791 if test "$_cocoa" = yes ; then
3792 libs_mplayer
="$libs_mplayer -framework Cocoa -framework OpenGL"
3793 def_cocoa
='#define CONFIG_COCOA 1'
3795 def_cocoa
='#undef CONFIG_COCOA'
3799 echocheck
"CoreVideo"
3800 if test "$_cocoa" = yes && test "$_corevideo" = auto
; then
3802 #include <QuartzCore/CoreVideo.h>
3803 int main(void) { return 0; }
3806 cc_check
-framework Cocoa
-framework QuartzCore
-framework OpenGL
&& _corevideo
=yes
3808 if test "$_corevideo" = yes ; then
3809 vomodules
="corevideo $vomodules"
3810 libs_mplayer
="$libs_mplayer -framework QuartzCore"
3811 def_corevideo
='#define CONFIG_COREVIDEO 1'
3813 novomodules
="corevideo $novomodules"
3814 def_corevideo
='#undef CONFIG_COREVIDEO'
3816 echores
"$_corevideo"
3818 echocheck
"SharedBuffer"
3819 if test "$_sharedbuffer" = auto
; then
3822 NSApplicationLoad();
3826 cc_check
-framework Cocoa
&& _sharedbuffer
=yes
3828 if test "$_sharedbuffer" = yes ; then
3829 vomodules
="sharedbuffer $vomodules"
3830 libs_mplayer
="$libs_mplayer -framework Cocoa"
3831 def_sharedbuffer
='#define CONFIG_SHAREDBUFFER 1'
3833 novomodules
="sharedbuffer $novomodules"
3834 def_sharedbuffer
='#undef CONFIG_SHAREDBUFFER'
3836 echores
"$_sharedbuffer"
3838 depends_on_application_services
(){
3839 test "$_corevideo" = yes
3845 echocheck
"X11 headers presence"
3847 res_comment
="check if the dev(el) packages are installed"
3848 for I
in $
(echo $extra_cflags |
sed s
/-I//g
) /usr
/include
; do
3849 if test -f "$I/X11/Xlib.h" ; then
3855 if test $_cross_compile = no
; then
3856 for I
in /usr
/X11
/include
/usr
/X11R
7/include
/usr
/local
/include
/usr
/X11R
6/include \
3857 /usr
/include
/X11R6
/usr
/openwin
/include
; do
3858 if test -f "$I/X11/Xlib.h" ; then
3859 extra_cflags
="$extra_cflags -I$I"
3861 res_comment
="using $I"
3866 echores
"$_x11_headers"
3870 if test "$_x11" = auto
&& test "$_x11_headers" = yes ; then
3871 for I
in "" -L/usr
/X11R
7/lib
-L/usr
/local
/lib
-L/usr
/X11R
6/lib
-L/usr
/lib
/X11R6 \
3872 -L/usr
/X11
/lib
-L/usr
/lib32
-L/usr
/openwin
/lib
-L/usr
/local
/lib64
-L/usr
/X11R
6/lib64 \
3875 _ld_tmp
="$I -lXext -lX11 $_ld_pthread -Wl,-R$(echo $I | sed s/^-L//)"
3877 _ld_tmp
="$I -lXext -lX11 $_ld_pthread"
3879 statement_check X11
/Xutil.h
'XCreateWindow(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)' $_ld_tmp &&
3881 # Check that there aren't conflicting headers between ApplicationServices
3882 # and X11. On versions of Mac OSX prior to 10.7 the deprecated QuickDraw API
3883 # is included by -framework ApplicationServices and clashes with the X11
3884 # definition of the "Cursor" type.
3885 if darwin
&& depends_on_application_services
&& test "$_x11" = yes ; then
3887 header_check_broken ApplicationServices
/ApplicationServices.h \
3888 X11
/Xutil.h
$_ld_tmp && _x11
=yes
3890 if test "$_x11" = yes ; then
3891 libs_mplayer
="$libs_mplayer $_ld_tmp"
3896 if test "$_x11" = yes ; then
3897 def_x11
='#define CONFIG_X11 1'
3898 vomodules
="x11 xover $vomodules"
3901 def_x11
='#undef CONFIG_X11'
3902 novomodules
="x11 $novomodules"
3903 res_comment
="check if the dev(el) packages are installed"
3907 echocheck
"Xss screensaver extensions"
3908 if test "$_xss" = auto
; then
3910 statement_check
"X11/extensions/scrnsaver.h" 'XScreenSaverSuspend(NULL, True)' -lXss && _xss
=yes
3912 if test "$_xss" = yes ; then
3913 def_xss
='#define CONFIG_XSS 1'
3914 libs_mplayer
="$libs_mplayer -lXss"
3916 def_xss
='#undef CONFIG_XSS'
3923 if test "$_x11" = yes ; then
3925 #include <X11/Xmd.h>
3926 #include <X11/Xlib.h>
3927 #include <X11/Xutil.h>
3928 #include <X11/Xatom.h>
3929 #include <X11/extensions/dpms.h>
3930 int main(void) { DPMSQueryExtension(0, 0, 0); return 0; }
3932 cc_check
-lXdpms && _xdpms3
=yes
3933 statement_check_broken X11
/Xlib.h X11
/extensions
/dpms.h
'DPMSQueryExtension(0, 0, 0)' -lXext && _xdpms4
=yes
3935 if test "$_xdpms4" = yes ; then
3936 def_xdpms
='#define CONFIG_XDPMS 1'
3937 res_comment
="using Xdpms 4"
3939 elif test "$_xdpms3" = yes ; then
3940 def_xdpms
='#define CONFIG_XDPMS 1'
3941 libs_mplayer
="$libs_mplayer -lXdpms"
3942 res_comment
="using Xdpms 3"
3945 def_xdpms
='#undef CONFIG_XDPMS'
3951 if test "$_xv" = auto
&& test "$_x11" = yes ; then
3953 statement_check_broken X11
/Xlib.h X11
/extensions
/Xvlib.h
'XvGetPortAttribute(0, 0, 0, 0)' -lXv && _xv
=yes
3956 if test "$_xv" = yes ; then
3957 def_xv
='#define CONFIG_XV 1'
3958 libs_mplayer
="$libs_mplayer -lXv"
3959 vomodules
="xv $vomodules"
3961 def_xv
='#undef CONFIG_XV'
3962 novomodules
="xv $novomodules"
3968 if test "$_vdpau" = auto
&& test "$_x11" = yes ; then
3970 if test "$_dl" = yes ; then
3971 pkg_config_add
'vdpau >= 0.2' && _vdpau
=yes
3974 if test "$_vdpau" = yes ; then
3975 def_vdpau
='#define CONFIG_VDPAU 1'
3976 vomodules
="vdpau $vomodules"
3978 def_vdpau
='#define CONFIG_VDPAU 0'
3979 novomodules
="vdpau $novomodules"
3984 echocheck
"Xinerama"
3985 if test "$_xinerama" = auto
&& test "$_x11" = yes ; then
3987 statement_check X11
/extensions
/Xinerama.h
'XineramaIsActive(0)' -lXinerama && _xinerama
=yes
3990 if test "$_xinerama" = yes ; then
3991 def_xinerama
='#define CONFIG_XINERAMA 1'
3992 libs_mplayer
="$libs_mplayer -lXinerama"
3994 def_xinerama
='#undef CONFIG_XINERAMA'
3996 echores
"$_xinerama"
3999 # Note: the -lXxf86vm library is the VideoMode extension and though it's not
4000 # needed for DGA, AFAIK every distribution packages together with DGA stuffs
4001 # named 'X extensions' or something similar.
4002 # This check may be useful for future mplayer versions (to change resolution)
4003 # If you run into problems, remove '-lXxf86vm'.
4005 if test "$_vm" = auto
&& test "$_x11" = yes ; then
4007 statement_check_broken X11
/Xlib.h X11
/extensions
/xf86vmode.h
'XF86VidModeQueryExtension(0, 0, 0)' -lXxf86vm && _vm
=yes
4009 if test "$_vm" = yes ; then
4010 def_vm
='#define CONFIG_XF86VM 1'
4011 libs_mplayer
="$libs_mplayer -lXxf86vm"
4013 def_vm
='#undef CONFIG_XF86VM'
4017 # Check for the presence of special keycodes, like audio control buttons
4018 # that XFree86 might have. Used to be bundled with the xf86vm check, but
4019 # has nothing to do with xf86vm and XFree 3.x has xf86vm but does NOT
4020 # have these new keycodes.
4021 echocheck
"XF86keysym"
4022 if test "$_xf86keysym" = auto
&& test "$_x11" = yes ; then
4024 return_check X11
/XF86keysym.h XF86XK_AudioPause
&& _xf86keysym
=yes
4026 if test "$_xf86keysym" = yes ; then
4027 def_xf86keysym
='#define CONFIG_XF86XK 1'
4029 def_xf86keysym
='#undef CONFIG_XF86XK'
4031 echores
"$_xf86keysym"
4034 if test "$_dga2" = auto
&& test "$_x11" = yes ; then
4036 statement_check_broken X11
/Xlib.h X11
/extensions
/Xxf86dga.h
'XDGASetViewport(0, 0, 0, 0, 0)' -lXxf86dga && _dga2
=yes
4038 if test "$_dga1" = auto
&& test "$_dga2" = no
&& test "$_vm" = yes ; then
4040 statement_check_broken X11
/Xlib.h X11
/extensions
/Xxf86dga.h
'XF86DGASetViewPort(0, 0, 0, 0)' -lXxf86dga -lXxf86vm && _dga1
=yes
4044 def_dga
='#undef CONFIG_DGA'
4045 def_dga1
='#undef CONFIG_DGA1'
4046 def_dga2
='#undef CONFIG_DGA2'
4047 if test "$_dga1" = yes ; then
4049 def_dga1
='#define CONFIG_DGA1 1'
4050 res_comment
="using DGA 1.0"
4051 elif test "$_dga2" = yes ; then
4053 def_dga2
='#define CONFIG_DGA2 1'
4054 res_comment
="using DGA 2.0"
4056 if test "$_dga" = yes ; then
4057 def_dga
='#define CONFIG_DGA 1'
4058 libs_mplayer
="$libs_mplayer -lXxf86dga"
4059 vomodules
="dga $vomodules"
4061 novomodules
="dga $novomodules"
4067 if test "$_3dfx" = yes && test "$_dga" = yes ; then
4068 def_3dfx
='#define CONFIG_3DFX 1'
4069 vomodules
="3dfx $vomodules"
4072 def_3dfx
='#undef CONFIG_3DFX'
4073 novomodules
="3dfx $novomodules"
4079 if test "$_ggi" = auto
; then
4081 statement_check ggi
/ggi.h
'ggiInit()' -lggi && _ggi
=yes
4083 if test "$_ggi" = yes ; then
4084 def_ggi
='#define CONFIG_GGI 1'
4085 libs_mplayer
="$libs_mplayer -lggi"
4086 vomodules
="ggi $vomodules"
4088 def_ggi
='#undef CONFIG_GGI'
4089 novomodules
="ggi $novomodules"
4093 echocheck
"GGI extension: libggiwmh"
4094 if test "$_ggiwmh" = auto
; then
4096 statement_check ggi
/wmh.h
'ggiWmhInit()' -lggi -lggiwmh && _ggiwmh
=yes
4098 # needed to get right output on obscure combination
4099 # like --disable-ggi --enable-ggiwmh
4100 if test "$_ggi" = yes && test "$_ggiwmh" = yes ; then
4101 def_ggiwmh
='#define CONFIG_GGIWMH 1'
4102 libs_mplayer
="$libs_mplayer -lggiwmh"
4105 def_ggiwmh
='#undef CONFIG_GGIWMH'
4111 if test "$_aa" = auto
; then
4118 c = aa_autoinit(&aa_defparams);
4119 p = aa_getrenderparams();
4120 aa_autoinitkbd(c, 0);
4124 for _ld_tmp
in "-laa" ; do
4125 cc_check
$_ld_tmp && libs_mplayer
="$libs_mplayer $_ld_tmp" && _aa
=yes && break
4128 if test "$_aa" = yes ; then
4129 def_aa
='#define CONFIG_AA 1'
4131 libs_mplayer
="$libs_mplayer $(aalib-config --libs | cut -d " " -f 2,5,6)"
4133 vomodules
="aa $vomodules"
4135 def_aa
='#undef CONFIG_AA'
4136 novomodules
="aa $novomodules"
4142 if test "$_caca" = auto
; then
4144 if ( caca-config
--version ) >> "$TMPLOG" 2>&1 ; then
4147 #ifdef CACA_API_VERSION_1
4150 int main(void) { caca_init(); return 0; }
4152 cc_check $
(caca-config
--libs) && _caca
=yes
4155 if test "$_caca" = yes ; then
4156 def_caca
='#define CONFIG_CACA 1'
4157 extra_cflags
="$extra_cflags $(caca-config --cflags)"
4158 libs_mplayer
="$libs_mplayer $(caca-config --libs)"
4159 vomodules
="caca $vomodules"
4161 def_caca
='#undef CONFIG_CACA'
4162 novomodules
="caca $novomodules"
4168 if test "$_svga" = auto
; then
4170 header_check vga.h
-lvga $_ld_lm && _svga
=yes
4172 if test "$_svga" = yes ; then
4173 def_svga
='#define CONFIG_SVGALIB 1'
4174 libs_mplayer
="$libs_mplayer -lvga"
4175 vomodules
="svga $vomodules"
4177 def_svga
='#undef CONFIG_SVGALIB'
4178 novomodules
="svga $novomodules"
4184 if test "$_fbdev" = auto
; then
4188 if test "$_fbdev" = yes ; then
4189 def_fbdev
='#define CONFIG_FBDEV 1'
4190 vomodules
="fbdev $vomodules"
4192 def_fbdev
='#undef CONFIG_FBDEV'
4193 novomodules
="fbdev $novomodules"
4200 if test "$_dvb" = auto
; then
4204 #include <sys/ioctl.h>
4208 #include <linux/dvb/dmx.h>
4209 #include <linux/dvb/frontend.h>
4210 #include <linux/dvb/video.h>
4211 #include <linux/dvb/audio.h>
4212 int main(void) {return 0;}
4214 for _inc_tmp
in "" "-I/usr/src/DVB/include" ; do
4215 cc_check
$_inc_tmp && _dvb
=yes &&
4216 extra_cflags
="$extra_cflags $_inc_tmp" && break
4220 if test "$_dvb" = yes ; then
4222 inputmodules
="dvb $inputmodules"
4223 def_dvb
='#define CONFIG_DVB 1'
4224 def_dvbin
='#define CONFIG_DVBIN 1'
4225 aomodules
="mpegpes(dvb) $aomodules"
4226 vomodules
="mpegpes(dvb) $vomodules"
4229 noinputmodules
="dvb $noinputmodules"
4230 def_dvb
='#undef CONFIG_DVB'
4231 def_dvbin
='#undef CONFIG_DVBIN '
4232 aomodules
="mpegpes(file) $aomodules"
4233 vomodules
="mpegpes(file) $vomodules"
4237 echocheck
"PNG support"
4238 if test "$_png" = auto
; then
4245 printf("png.h : %s\n", PNG_LIBPNG_VER_STRING);
4246 printf("libpng: %s\n", png_libpng_ver);
4247 return strcmp(PNG_LIBPNG_VER_STRING, png_libpng_ver);
4250 cc_check
-lpng -lz $_ld_lm && _png
=yes
4253 if test "$_png" = yes ; then
4254 def_png
='#define CONFIG_PNG 1'
4255 extra_ldflags
="$extra_ldflags -lpng -lz"
4257 def_png
='#undef CONFIG_PNG'
4260 echocheck
"MNG support"
4261 if test "$_mng" = auto
; then
4263 return_statement_check libmng.h
'const char * p_ver = mng_version_text()' '!p_ver || p_ver[0] == 0' -lmng -lz $_ld_lm && _mng
=yes
4266 if test "$_mng" = yes ; then
4267 def_mng
='#define CONFIG_MNG 1'
4268 extra_ldflags
="$extra_ldflags -lmng -lz"
4270 def_mng
='#undef CONFIG_MNG'
4273 echocheck
"JPEG support"
4274 if test "$_jpeg" = auto
; then
4276 header_check_broken stdio.h jpeglib.h
-ljpeg $_ld_lm && _jpeg
=yes
4280 if test "$_jpeg" = yes ; then
4281 def_jpeg
='#define CONFIG_JPEG 1'
4282 vomodules
="jpeg $vomodules"
4283 extra_ldflags
="$extra_ldflags -ljpeg"
4285 def_jpeg
='#undef CONFIG_JPEG'
4286 novomodules
="jpeg $novomodules"
4291 echocheck
"PNM support"
4292 if test "$_pnm" = yes; then
4293 def_pnm
="#define CONFIG_PNM 1"
4294 vomodules
="pnm $vomodules"
4296 def_pnm
="#undef CONFIG_PNM"
4297 novomodules
="pnm $novomodules"
4303 echocheck
"GIF support"
4304 # This is to appease people who want to force gif support.
4305 # If it is forced to yes, then we still do checks to determine
4306 # which gif library to use.
4307 if test "$_gif" = yes ; then
4312 if test "$_gif" = auto
; then
4314 for _ld_gif
in "-lungif" "-lgif" ; do
4315 statement_check gif_lib.h
'QuantizeBuffer(0, 0, 0, 0, 0, 0, 0, 0)' $_ld_gif && _gif
=yes && break
4319 # If no library was found, and the user wants support forced,
4320 # then we force it on with libgif, as this is the safest
4321 # assumption IMHO. (libungif & libregif both create symbolic
4322 # links to libgif. We also assume that no x11 support is needed,
4323 # because if you are forcing this, then you _should_ know what
4324 # you are doing. [ Besides, package maintainers should never
4325 # have compiled x11 deps into libungif in the first place. ] )
4328 if test "$_force_gif" = yes && test "$_gif" = no
; then
4333 if test "$_gif" = yes ; then
4334 def_gif
='#define CONFIG_GIF 1'
4335 codecmodules
="gif $codecmodules"
4336 vomodules
="gif89a $vomodules"
4337 res_comment
="old version, some encoding functions disabled"
4338 def_gif_4
='#undef CONFIG_GIF_4'
4339 extra_ldflags
="$extra_ldflags $_ld_gif"
4345 #include <gif_lib.h>
4346 static void catch(int sig) { exit(1); }
4348 signal(SIGSEGV, catch); // catch segfault
4349 printf("EGifPutExtensionFirst is at address %p\n", EGifPutExtensionFirst);
4350 EGifSetGifVersion("89a"); // this will segfault a buggy gif lib.
4354 if cc_check
"$_ld_gif" ; then
4355 def_gif_4
='#define CONFIG_GIF_4 1'
4359 def_gif
='#undef CONFIG_GIF'
4360 def_gif_4
='#undef CONFIG_GIF_4'
4361 novomodules
="gif89a $novomodules"
4362 nocodecmodules
="gif $nocodecmodules"
4367 case "$_gif" in yes*)
4368 echocheck
"broken giflib workaround"
4369 def_gif_tvt_hack
='#define CONFIG_GIF_TVT_HACK 1'
4373 #include <gif_lib.h>
4375 GifFileType gif = {.UserData = NULL};
4376 printf("UserData is at address %p\n", gif.UserData);
4380 if cc_check
"$_ld_gif" ; then
4381 def_gif_tvt_hack
='#undef CONFIG_GIF_TVT_HACK'
4390 echocheck
"VESA support"
4391 if test "$_vesa" = auto
; then
4393 statement_check vbe.h
'vbeInit()' -lvbe -llrmi && _vesa
=yes
4395 if test "$_vesa" = yes ; then
4396 def_vesa
='#define CONFIG_VESA 1'
4397 libs_mplayer
="$libs_mplayer -lvbe -llrmi"
4398 vomodules
="vesa $vomodules"
4400 def_vesa
='#undef CONFIG_VESA'
4401 novomodules
="vesa $novomodules"
4413 def_sdl_sdl_h
="#undef CONFIG_SDL_SDL_H"
4414 if test -z "$_sdlconfig" ; then
4415 if ( sdl-config
--version ) >>"$TMPLOG" 2>&1 ; then
4416 _sdlconfig
="sdl-config"
4417 elif ( sdl11-config
--version ) >>"$TMPLOG" 2>&1 ; then
4418 _sdlconfig
="sdl11-config"
4423 if test "$_sdl" = auto ||
test "$_sdl" = yes ; then
4425 #ifdef CONFIG_SDL_SDL_H
4426 #include <SDL/SDL.h>
4431 // we allow SDL hacking our main() only on OSX
4434 int main(int argc, char *argv[]) {
4435 SDL_Init(SDL_INIT_VIDEO|SDL_INIT_NOPARACHUTE);
4440 for _ld_tmp
in "-lSDL" "-lSDL -lpthread" "-lSDL -lwinmm -lgdi32" "-lSDL -lwinmm -lgdi32 -ldxguid" ; do
4441 if cc_check
-DCONFIG_SDL_SDL_H $_inc_tmp $_ld_tmp ; then
4443 def_sdl_sdl_h
="#define CONFIG_SDL_SDL_H 1"
4447 if test "$_sdl" = no
&& "$_sdlconfig" --version >>"$TMPLOG" 2>&1 ; then
4448 res_comment
="using $_sdlconfig"
4450 _inc_tmp
="$($_sdlconfig --cflags | cut -d " " -f 1,5,6 | sed s/no-cygwin/cygwin/)"
4451 _ld_tmp
="$($_sdlconfig --libs | cut -d " " -f 1,4,6 | sed s/no-cygwin/cygwin/)"
4453 _inc_tmp
=$
($_sdlconfig --cflags |
sed s
/-Dmain=SDL_main
//)
4454 _ld_tmp
=$
($_sdlconfig --libs |
sed -e s
/-mwindows// -e s
/-lmingw32//)
4456 _inc_tmp
="$($_sdlconfig --cflags)"
4457 _ld_tmp
="$($_sdlconfig --libs)"
4459 if cc_check
$_inc_tmp $_ld_tmp >>"$TMPLOG" 2>&1 ; then
4461 elif cc_check
$_inc_tmp $_ld_tmp -lstdc++ >>"$TMPLOG" 2>&1 ; then
4462 # HACK for BeOS/Haiku SDL
4463 _ld_tmp
="$_ld_tmp -lstdc++"
4468 if test "$_sdl" = yes ; then
4469 def_sdl
='#define CONFIG_SDL 1'
4470 extra_cflags
="$extra_cflags $_inc_tmp"
4471 libs_mplayer
="$libs_mplayer $_ld_tmp"
4472 vomodules
="sdl $vomodules"
4473 aomodules
="sdl $aomodules"
4475 def_sdl
='#undef CONFIG_SDL'
4476 novomodules
="sdl $novomodules"
4477 noaomodules
="sdl $noaomodules"
4482 # make sure this stays below CoreVideo to avoid issues due to namespace
4483 # conflicts between -lGL and -framework OpenGL
4485 #Note: this test is run even with --enable-gl since we autodetect linker flags
4486 if (test "$_x11" = yes ||
test "$_sdl" = yes ||
test "$_cocoa" = yes || win32
) && test "$_gl" != no
; then
4489 #include <windows.h>
4491 #elif defined(GL_SDL)
4493 #ifdef CONFIG_SDL_SDL_H
4494 #include <SDL/SDL.h>
4499 // we allow SDL hacking our main() only on OSX
4504 #include <X11/Xlib.h>
4507 int main(int argc, char *argv[]) {
4510 wglCreateContext(dc);
4511 #elif defined(GL_SDL)
4512 SDL_GL_SwapBuffers();
4514 glXCreateContext(NULL, NULL, NULL, True);
4521 for _ld_tmp
in "" -lGL "-lGL -lXdamage" "-lGL $_ld_pthread" ; do
4522 if cc_check
$_ld_tmp $_ld_lm ; then
4525 libs_mplayer
="$libs_mplayer $_ld_tmp $_ld_dl"
4529 if cc_check
-DGL_WIN32 -lopengl32 ; then
4532 libs_mplayer
="$libs_mplayer -lopengl32 -lgdi32"
4534 if test "$_cocoa" = yes ; then
4538 # last so it can reuse any linker etc. flags detected before
4539 if test "$_sdl" = yes ; then
4540 if cc_check
-DGL_SDL ||
4541 cc_check
-DCONFIG_SDL_SDL_H -DGL_SDL ; then
4544 elif cc_check
-DGL_SDL -lGL ||
4545 cc_check
-DCONFIG_SDL_SDL_H -DGL_SDL -lGL ; then
4548 libs_mplayer
="$libs_mplayer -lGL"
4554 if test "$_gl" = yes ; then
4555 def_gl
='#define CONFIG_GL 1'
4556 res_comment
="backends:"
4557 if test "$_gl_cocoa" = yes ; then
4558 def_gl_cocoa
='#define CONFIG_GL_COCOA 1'
4559 res_comment
="$res_comment cocoa"
4561 if test "$_gl_win32" = yes ; then
4562 def_gl_win32
='#define CONFIG_GL_WIN32 1'
4563 res_comment
="$res_comment win32"
4565 if test "$_gl_x11" = yes ; then
4566 def_gl_x11
='#define CONFIG_GL_X11 1'
4567 res_comment
="$res_comment x11"
4569 if test "$_gl_sdl" = yes ; then
4570 def_gl_sdl
='#define CONFIG_GL_SDL 1'
4571 res_comment
="$res_comment sdl"
4573 vomodules
="opengl $vomodules"
4575 def_gl
='#undef CONFIG_GL'
4576 def_gl_cocoa
='#undef CONFIG_GL_COCOA'
4577 def_gl_win32
='#undef CONFIG_GL_WIN32'
4578 def_gl_x11
='#undef CONFIG_GL_X11'
4579 def_gl_sdl
='#undef CONFIG_GL_SDL'
4580 novomodules
="opengl $novomodules"
4587 echocheck
"Windows waveout"
4588 if test "$_win32waveout" = auto
; then
4590 header_check_broken windows.h mmsystem.h
-lwinmm && _win32waveout
=yes
4592 if test "$_win32waveout" = yes ; then
4593 def_win32waveout
='#define CONFIG_WIN32WAVEOUT 1'
4594 libs_mplayer
="$libs_mplayer -lwinmm"
4595 aomodules
="win32 $aomodules"
4597 def_win32waveout
='#undef CONFIG_WIN32WAVEOUT'
4598 noaomodules
="win32 $noaomodules"
4600 echores
"$_win32waveout"
4602 echocheck
"Direct3D"
4603 if test "$_direct3d" = auto
; then
4605 header_check d3d9.h
&& _direct3d
=yes
4607 if test "$_direct3d" = yes ; then
4608 def_direct3d
='#define CONFIG_DIRECT3D 1'
4609 vomodules
="direct3d $vomodules"
4611 def_direct3d
='#undef CONFIG_DIRECT3D'
4612 novomodules
="direct3d $novomodules"
4614 echores
"$_direct3d"
4617 if test "$_directx" = auto
; then
4621 int main(void) { return 0; }
4624 cc_check
-lgdi32 && _directx
=yes
4626 if test "$_directx" = yes ; then
4627 def_directx
='#define CONFIG_DIRECTX 1'
4628 libs_mplayer
="$libs_mplayer -lgdi32"
4629 vomodules
="directx $vomodules"
4630 aomodules
="dsound $aomodules"
4632 def_directx
='#undef CONFIG_DIRECTX'
4633 novomodules
="directx $novomodules"
4634 noaomodules
="dsound $noaomodules"
4642 if test "$_dxr3" = auto
; then
4644 header_check linux
/em8300.h
&& _dxr3
=yes
4646 if test "$_dxr3" = yes ; then
4647 def_dxr3
='#define CONFIG_DXR3 1'
4648 vomodules
="dxr3 $vomodules"
4650 def_dxr3
='#undef CONFIG_DXR3'
4651 novomodules
="dxr3 $novomodules"
4656 echocheck
"IVTV TV-Out (pre linux-2.6.24)"
4657 if test "$_ivtv" = auto
; then
4659 #include <sys/time.h>
4660 #include <linux/videodev2.h>
4661 #include <linux/ivtv.h>
4662 #include <sys/ioctl.h>
4664 struct ivtv_cfg_stop_decode sd;
4665 struct ivtv_cfg_start_decode sd1;
4666 ioctl(0, IVTV_IOC_START_DECODE, &sd1);
4667 ioctl(0, IVTV_IOC_STOP_DECODE, &sd);
4671 cc_check
&& _ivtv
=yes
4673 if test "$_ivtv" = yes ; then
4674 def_ivtv
='#define CONFIG_IVTV 1'
4675 vomodules
="ivtv $vomodules"
4676 aomodules
="ivtv $aomodules"
4678 def_ivtv
='#undef CONFIG_IVTV'
4679 novomodules
="ivtv $novomodules"
4680 noaomodules
="ivtv $noaomodules"
4685 echocheck
"V4L2 MPEG Decoder"
4686 if test "$_v4l2" = auto
; then
4688 #include <sys/time.h>
4689 #include <linux/videodev2.h>
4690 #include <linux/version.h>
4692 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22)
4693 #error kernel headers too old, need 2.6.22
4695 struct v4l2_ext_controls ctrls;
4696 ctrls.ctrl_class = V4L2_CTRL_CLASS_MPEG;
4701 cc_check
&& _v4l2
=yes
4703 if test "$_v4l2" = yes ; then
4704 def_v4l2
='#define CONFIG_V4L2_DECODER 1'
4705 vomodules
="v4l2 $vomodules"
4706 aomodules
="v4l2 $aomodules"
4708 def_v4l2
='#undef CONFIG_V4L2_DECODER'
4709 novomodules
="v4l2 $novomodules"
4710 noaomodules
="v4l2 $noaomodules"
4721 echocheck
"OSS Audio"
4722 if test "$_ossaudio" = auto
; then
4724 return_check
$_soundcard_header SNDCTL_DSP_SETFRAGMENT
&& _ossaudio
=yes
4726 if test "$_ossaudio" = yes ; then
4727 def_ossaudio
='#define CONFIG_OSS_AUDIO 1'
4728 aomodules
="oss $aomodules"
4730 #include <$_soundcard_header>
4731 #ifdef OPEN_SOUND_SYSTEM
4732 int main(void) { return 0; }
4734 #error Not the real thing
4738 cc_check
&& _real_ossaudio
=yes
4739 if test "$_real_ossaudio" = yes; then
4740 def_ossaudio_devdsp
='#define PATH_DEV_DSP "/dev/dsp"'
4741 # Check for OSS4 headers (override default headers)
4742 # Does not apply to systems where OSS4 is native (e.g. FreeBSD)
4743 if test -f /etc
/oss.conf
; then
4745 _ossinc
="$OSSLIBDIR/include"
4746 if test -f "$_ossinc/sys/soundcard.h"; then
4747 extra_cflags
="-I$_ossinc $extra_cflags"
4750 elif netbsd || openbsd
; then
4751 def_ossaudio_devdsp
='#define PATH_DEV_DSP "/dev/sound"'
4752 extra_ldflags
="$extra_ldflags -lossaudio"
4754 def_ossaudio_devdsp
='#define PATH_DEV_DSP "/dev/dsp"'
4756 def_ossaudio_devmixer
='#define PATH_DEV_MIXER "/dev/mixer"'
4758 def_ossaudio
='#undef CONFIG_OSS_AUDIO'
4759 def_ossaudio_devdsp
='#define PATH_DEV_DSP ""'
4760 def_ossaudio_devmixer
='#define PATH_DEV_MIXER ""'
4761 noaomodules
="oss $noaomodules"
4763 echores
"$_ossaudio"
4767 if test "$_rsound" = auto
; then
4769 statement_check rsound.h
'rsd_init(NULL);' -lrsound && _rsound
=yes
4773 if test "$_rsound" = yes ; then
4774 def_rsound
='#define CONFIG_RSOUND 1'
4775 aomodules
="rsound $aomodules"
4776 libs_mplayer
="$libs_mplayer -lrsound"
4778 def_rsound
='#undef CONFIG_RSOUND'
4779 noaomodules
="rsound $noaomodules"
4784 if test "$_nas" = auto
; then
4786 header_check audio
/audiolib.h
$_ld_lm -laudio -lXt && _nas
=yes
4788 if test "$_nas" = yes ; then
4789 def_nas
='#define CONFIG_NAS 1'
4790 libs_mplayer
="$libs_mplayer -laudio -lXt"
4791 aomodules
="nas $aomodules"
4793 noaomodules
="nas $noaomodules"
4794 def_nas
='#undef CONFIG_NAS'
4800 if test "$_pulse" = auto
; then
4802 if pkg_config_add
'libpulse >= 0.9' ; then
4808 if test "$_pulse" = yes ; then
4809 def_pulse
='#define CONFIG_PULSE 1'
4810 aomodules
="pulse $aomodules"
4812 def_pulse
='#undef CONFIG_PULSE'
4813 noaomodules
="pulse $noaomodules"
4817 echocheck
"PortAudio"
4818 if test "$_portaudio" = auto
&& test "$_pthreads" != yes ; then
4820 res_comment
="pthreads not enabled"
4822 if test "$_portaudio" = auto
; then
4824 if pkg_config_add
'portaudio-2.0 >= 19' ; then
4828 echores
"$_portaudio"
4830 if test "$_portaudio" = yes ; then
4831 def_portaudio
='#define CONFIG_PORTAUDIO 1'
4832 aomodules
="portaudio $aomodules"
4834 def_portaudio
='#undef CONFIG_PORTAUDIO'
4835 noaomodules
="portaudio $noaomodules"
4840 if test "$_jack" = auto
; then
4842 if pkg_config_add jack
; then
4847 if test "$_jack" = yes ; then
4848 def_jack
='#define CONFIG_JACK 1'
4849 aomodules
="jack $aomodules"
4851 noaomodules
="jack $noaomodules"
4856 if test "$_openal" = auto
; then
4860 #include <OpenAL/al.h>
4865 alSourceQueueBuffers(0, 0, 0);
4866 // alGetSourcei(0, AL_SAMPLE_OFFSET, 0);
4870 for I
in "-lopenal" "-lopenal32" "-framework OpenAL" ; do
4871 cc_check
$I && _openal
=yes && break
4872 cc_check
-DOPENAL_AL_H=1 $I && def_openal_h
='#define OPENAL_AL_H 1' && _openal
=yes && break
4874 test "$_openal" = yes && libs_mplayer
="$libs_mplayer $I"
4876 if test "$_openal" = yes ; then
4877 def_openal
='#define CONFIG_OPENAL 1'
4878 aomodules
="openal $aomodules"
4880 noaomodules
="openal $noaomodules"
4884 echocheck
"ALSA audio"
4885 if test "$_alloca" != yes ; then
4887 res_comment
="alloca missing"
4889 if test "$_alsa" = auto
; then
4891 if pkg_config_add
"alsa >= 1.0.9" ; then
4895 def_alsa
='#undef CONFIG_ALSA'
4896 if test "$_alsa" = yes ; then
4897 aomodules
="alsa $aomodules"
4898 def_alsa
='#define CONFIG_ALSA 1'
4900 noaomodules
="alsa $noaomodules"
4905 echocheck
"Sun audio"
4906 if test "$_sunaudio" = auto
; then
4908 #include <sys/types.h>
4909 #include <sys/audioio.h>
4910 int main(void) { audio_info_t info; AUDIO_INITINFO(&info); return 0; }
4913 cc_check
&& _sunaudio
=yes
4915 if test "$_sunaudio" = yes ; then
4916 def_sunaudio
='#define CONFIG_SUN_AUDIO 1'
4917 aomodules
="sun $aomodules"
4919 def_sunaudio
='#undef CONFIG_SUN_AUDIO'
4920 noaomodules
="sun $noaomodules"
4922 echores
"$_sunaudio"
4926 echocheck
"CoreAudio"
4927 if test "$_coreaudio" = auto
; then
4929 #include <CoreAudio/CoreAudio.h>
4930 #include <AudioToolbox/AudioToolbox.h>
4931 #include <AudioUnit/AudioUnit.h>
4932 int main(void) { return 0; }
4935 cc_check
-framework CoreAudio
-framework AudioUnit
-framework AudioToolbox
&& _coreaudio
=yes
4937 if test "$_coreaudio" = yes ; then
4938 libs_mplayer
="$libs_mplayer -framework CoreAudio -framework AudioUnit -framework AudioToolbox"
4939 def_coreaudio
='#define CONFIG_COREAUDIO 1'
4940 aomodules
="coreaudio $aomodules"
4942 def_coreaudio
='#undef CONFIG_COREAUDIO'
4943 noaomodules
="coreaudio $noaomodules"
4949 # set default CD/DVD devices
4951 default_cdrom_device
="D:"
4953 default_cdrom_device
="/dev/disk1"
4954 elif dragonfly
; then
4955 default_cdrom_device
="/dev/cd0"
4957 default_cdrom_device
="/dev/acd0"
4959 default_cdrom_device
="/dev/rcd0c"
4961 default_cdrom_device
="/vol/dev/aliases/cdrom0"
4962 # Modern Solaris versions use HAL instead of the vold daemon, the volfs
4963 # file system and the volfs service.
4964 test -r "/cdrom/cdrom0" && default_cdrom_device
="/cdrom/cdrom0"
4966 default_cdrom_device
="a1ide.device:2"
4968 default_cdrom_device
="/dev/cdrom"
4971 if win32 || dragonfly || freebsd || openbsd || sunos || amigaos
; then
4972 default_dvd_device
=$default_cdrom_device
4974 default_dvd_device
="/dev/rdiskN"
4976 default_dvd_device
="/dev/dvd"
4980 echocheck
"VCD support"
4981 if test "$_vcd" = auto
; then
4983 if linux || freebsd || netbsd || openbsd || dragonfly || bsdos || darwin || sunos
; then
4986 header_check
ddk
/ntddcdrm.h
&& _vcd
=yes
4989 if test "$_vcd" = yes; then
4990 inputmodules
="vcd $inputmodules"
4991 def_vcd
='#define CONFIG_VCD 1'
4993 def_vcd
='#undef CONFIG_VCD'
4994 noinputmodules
="vcd $noinputmodules"
4995 res_comment
="not supported on this OS"
5001 echocheck
"Blu-ray support"
5002 if test "$_bluray" = auto
; then
5004 pkg_config_add
'libbluray >= 0.2.1' && _bluray
=yes
5006 if test "$_bluray" = yes ; then
5007 def_bluray
='#define CONFIG_LIBBLURAY 1'
5008 inputmodules
="bluray $inputmodules"
5010 def_bluray
='#undef CONFIG_LIBBLURAY'
5011 noinputmodules
="bluray $noinputmodules"
5016 if test "$_dvdread_internal" = auto
&& test ! -f "libdvdread4/dvd_reader.c" ; then
5017 _dvdread_internal
=no
5019 if test "$_dvdread_internal" = auto
; then
5020 _dvdread_internal
=no
5022 if (linux || freebsd || netbsd || openbsd || dragonfly || sunos || hpux
) &&
5023 (test "$_dvd" = yes ||
test "$_cdrom" = yes ||
test "$_cdio" = yes ||
5024 test "$_dvdio" = yes ||
test "$_bsdi_dvd" = yes) ||
5025 darwin || win32
; then
5026 _dvdread_internal
=yes
5028 extra_cflags
="-Ilibdvdread4 $extra_cflags"
5030 elif test "$_dvdread" = auto
; then
5032 if test "$_dl" = yes; then
5033 _dvdreadcflags
=$
($_dvdreadconfig --cflags 2> /dev
/null
)
5034 _dvdreadlibs
=$
($_dvdreadconfig --libs 2> /dev
/null
)
5035 if header_check dvdread
/dvd_reader.h
$_dvdreadcflags $_dvdreadlibs $_ld_dl ; then
5037 extra_cflags
="$extra_cflags $_dvdreadcflags"
5038 extra_ldflags
="$extra_ldflags $_dvdreadlibs"
5039 res_comment
="external"
5044 if test "$_dvdread_internal" = yes; then
5045 def_dvdread
='#define CONFIG_DVDREAD 1'
5046 inputmodules
="dvdread(internal) $inputmodules"
5047 res_comment
="internal"
5048 elif test "$_dvdread" = yes; then
5049 def_dvdread
='#define CONFIG_DVDREAD 1'
5050 extra_ldflags
="$extra_ldflags -ldvdread"
5051 inputmodules
="dvdread(external) $inputmodules"
5052 res_comment
="external"
5054 def_dvdread
='#undef CONFIG_DVDREAD'
5055 noinputmodules
="dvdread $noinputmodules"
5060 echocheck
"internal libdvdcss"
5061 if test "$_libdvdcss_internal" = auto
; then
5062 _libdvdcss_internal
=no
5063 test "$_dvdread_internal" = yes && test -d libdvdcss
&& _libdvdcss_internal
=yes
5064 hpux
&& test "$_hpux_scsi_h" = no
&& _libdvdcss_internal
=no
5066 if test "$_libdvdcss_internal" = yes ; then
5067 if linux || netbsd || openbsd || bsdos
; then
5068 def_dvd_linux
='#define HAVE_LINUX_DVD_STRUCT 1'
5069 openbsd
&& def_dvd_openbsd
='#define HAVE_OPENBSD_DVD_STRUCT 1'
5070 elif freebsd || dragonfly
; then
5071 def_dvd_bsd
='#define HAVE_BSD_DVD_STRUCT 1'
5073 def_dvd_darwin
='#define DARWIN_DVD_IOCTL'
5074 extra_ldflags
="$extra_ldflags -framework IOKit -framework Carbon"
5076 cflags_libdvdcss
="-DSYS_CYGWIN -DWIN32"
5078 cflags_libdvdcss
="-DSYS_BEOS"
5080 cflags_libdvdcss_dvdread
="-Ilibdvdcss"
5081 def_dvdcss
="#define HAVE_DVDCSS_DVDCSS_H 1"
5082 inputmodules
="libdvdcss(internal) $inputmodules"
5084 noinputmodules
="libdvdcss(internal) $noinputmodules"
5086 echores
"$_libdvdcss_internal"
5090 if test "$_libcdio" = auto
; then
5092 if pkg_config_add libcdio_paranoia
; then
5096 if test "$_libcdio" = yes ; then
5098 def_cdda
='#define CONFIG_CDDA 1'
5099 test $_cddb = auto
&& test $networking = yes && _cddb
=yes
5100 inputmodules
="cdda $inputmodules"
5104 def_cdda
='#undef CONFIG_CDDA'
5105 noinputmodules
="cdda $noinputmodules"
5109 if test "$_cddb" = yes ; then
5110 def_cddb
='#define CONFIG_CDDB 1'
5111 inputmodules
="cddb $inputmodules"
5114 def_cddb
='#undef CONFIG_CDDB'
5115 noinputmodules
="cddb $noinputmodules"
5118 echocheck
"bitmap font support"
5119 if test "$_bitmap_font" = yes ; then
5120 def_bitmap_font
="#define CONFIG_BITMAP_FONT 1"
5122 def_bitmap_font
="#undef CONFIG_BITMAP_FONT"
5124 echores
"$_bitmap_font"
5127 echocheck
"freetype >= 2.0.9"
5129 # freetype depends on iconv
5130 if test "$_iconv" = no
; then
5132 res_comment
="iconv support needed"
5135 if test "$_freetype" = auto
; then
5136 if pkg_config_add freetype2
; then
5139 die
"Unable to find development files for libfreetype. Aborting. If you really mean to compile without FreeType support use --disable-freetype."
5142 if test "$_freetype" = yes ; then
5143 def_freetype
='#define CONFIG_FREETYPE 1'
5145 def_freetype
='#undef CONFIG_FREETYPE'
5147 echores
"$_freetype"
5149 if test "$_freetype" = no
; then
5151 res_comment
="FreeType support needed"
5153 echocheck
"fontconfig"
5154 if test "$_fontconfig" = auto
; then
5155 if pkg_config_add
'fontconfig >= 2.4.2' ; then
5158 die
"Unable to find development files for libfontconfig. Aborting. If you really mean to compile without fontconfig support use --disable-fontconfig."
5161 if test "$_fontconfig" = yes ; then
5162 def_fontconfig
='#define CONFIG_FONTCONFIG 1'
5164 def_fontconfig
='#undef CONFIG_FONTCONFIG'
5166 echores
"$_fontconfig"
5169 echocheck
"SSA/ASS support"
5170 if test "$_ass" = auto
; then
5171 if pkg_config_add libass
; then
5173 def_ass
='#define CONFIG_ASS 1'
5175 die
"Unable to find development files for libass. Aborting. If you really mean to compile without libass support use --disable-libass."
5178 def_ass
='#undef CONFIG_ASS'
5183 echocheck
"fribidi with charsets"
5184 if test "$_fribidi" = auto
; then
5186 if pkg_config_add fribidi
; then
5190 if test "$_fribidi" = yes ; then
5191 def_fribidi
='#define CONFIG_FRIBIDI 1'
5193 def_fribidi
='#undef CONFIG_FRIBIDI'
5199 if test "$_enca" = auto
; then
5201 statement_check enca.h
'enca_get_languages(NULL)' -lenca $_ld_lm && _enca
=yes
5203 if test "$_enca" = yes ; then
5204 def_enca
='#define CONFIG_ENCA 1'
5205 extra_ldflags
="$extra_ldflags -lenca"
5207 def_enca
='#undef CONFIG_ENCA'
5214 statement_check zlib.h
'inflate(0, Z_NO_FLUSH)' -lz && _zlib
=yes
5215 if test "$_zlib" = yes ; then
5216 def_zlib
='#define CONFIG_ZLIB 1'
5217 extra_ldflags
="$extra_ldflags -lz"
5219 def_zlib
='#define CONFIG_ZLIB 0'
5225 if test "$_rtc" = auto
; then
5227 #include <sys/ioctl.h>
5229 #include <linux/rtc.h>
5232 #define RTC_PIE_ON RTCIO_PIE_ON
5234 int main(void) { return RTC_PIE_ON; }
5237 cc_check
&& _rtc
=yes
5240 if test "$_rtc" = yes ; then
5241 def_rtc
='#define HAVE_RTC 1'
5243 def_rtc
='#undef HAVE_RTC'
5248 echocheck
"mad support"
5249 if test "$_mad" = auto
; then
5251 header_check mad.h
-lmad && _mad
=yes
5253 if test "$_mad" = yes ; then
5254 def_mad
='#define CONFIG_LIBMAD 1'
5255 extra_ldflags
="$extra_ldflags -lmad"
5256 codecmodules
="libmad $codecmodules"
5258 def_mad
='#undef CONFIG_LIBMAD'
5259 nocodecmodules
="libmad $nocodecmodules"
5263 echocheck
"OggVorbis support"
5264 if test "$_libvorbis" = auto
; then
5266 statement_check vorbis
/codec.h
'vorbis_packet_blocksize(0, 0)' -lvorbis -logg $_ld_lm && _libvorbis
=yes && _tremor
=no
5267 elif test "$_libvorbis" = yes ; then
5270 if test "$_tremor" = auto
; then
5272 statement_check tremor
/ivorbiscodec.h
'vorbis_packet_blocksize(0, 0)' -logg -lvorbisidec $_ld_lm && _tremor
=yes
5274 if test "$_tremor" = yes ; then
5276 def_vorbis
='#define CONFIG_OGGVORBIS 1'
5277 def_tremor
='#define CONFIG_TREMOR 1'
5278 codecmodules
="tremor(external) $codecmodules"
5279 res_comment
="external Tremor"
5280 extra_ldflags
="$extra_ldflags -logg -lvorbisidec"
5281 elif test "$_libvorbis" = yes ; then
5283 def_vorbis
='#define CONFIG_OGGVORBIS 1'
5284 codecmodules
="libvorbis $codecmodules"
5285 res_comment
="libvorbis"
5286 extra_ldflags
="$extra_ldflags -lvorbis -logg"
5289 nocodecmodules
="libvorbis $nocodecmodules"
5293 echocheck
"libspeex (version >= 1.1 required)"
5294 if test "$_speex" = auto
; then
5298 #include <speex/speex.h>
5299 int main(void) { SpeexBits bits; void *dec = NULL; speex_decode_int(dec, &bits, dec); return 0; }
5301 cc_check
-lspeex $_ld_lm && _speex
=yes
5303 if test "$_speex" = yes ; then
5304 def_speex
='#define CONFIG_SPEEX 1'
5305 extra_ldflags
="$extra_ldflags -lspeex"
5306 codecmodules
="speex $codecmodules"
5308 def_speex
='#undef CONFIG_SPEEX'
5309 nocodecmodules
="speex $nocodecmodules"
5313 echocheck
"OggTheora support"
5314 if test "$_theora" = auto
; then
5316 if pkg_config_add theora
; then
5320 if test "$_theora" = yes ; then
5321 def_theora
='#define CONFIG_OGGTHEORA 1'
5322 codecmodules
="libtheora $codecmodules"
5324 def_theora
='#undef CONFIG_OGGTHEORA'
5325 nocodecmodules
="libtheora $nocodecmodules"
5329 # Any version of libmpg123 that knows MPG123_RESYNC_LIMIT shall be fine.
5330 # That is, 1.2.0 onwards. Recommened is 1.14 onwards, though.
5331 echocheck
"mpg123 support"
5332 def_mpg123
='#undef CONFIG_MPG123'
5333 if test "$_mpg123" = auto
; then
5335 pkg_config_add
'libmpg123 >= 1.2.0' && _mpg123
=yes
5337 if test "$_mpg123" = yes ; then
5338 def_mpg123
='#define CONFIG_MPG123 1'
5339 codecmodules
="mpg123 $codecmodules"
5341 nocodecmodules
="mpg123 $nocodecmodules"
5345 echocheck
"liba52 support"
5346 def_liba52
='#undef CONFIG_LIBA52'
5347 if test "$_liba52" = auto
; then
5350 #include <inttypes.h>
5351 #include <a52dec/a52.h>
5352 int main(void) { a52_state_t *testHand; testHand=a52_init(0); return 0; }
5354 cc_check
-la52 && _liba52
=yes && extra_ldflags
="$extra_ldflags -la52"
5356 if test "$_liba52" = yes ; then
5357 def_liba52
='#define CONFIG_LIBA52 1'
5358 codecmodules
="liba52 $codecmodules"
5360 nocodecmodules
="liba52 $nocodecmodules"
5364 echocheck
"libdca support"
5365 if test "$_libdca" = auto
; then
5367 for _ld_dca
in -ldca -ldts ; do
5368 statement_check_broken stdint.h dts.h
'dts_init(0)' $_ld_dca $_ld_lm &&
5369 extra_ldflags
="$extra_ldflags $_ld_dca" && _libdca
=yes && break
5372 if test "$_libdca" = yes ; then
5373 def_libdca
='#define CONFIG_LIBDCA 1'
5374 codecmodules
="libdca $codecmodules"
5376 def_libdca
='#undef CONFIG_LIBDCA'
5377 nocodecmodules
="libdca $nocodecmodules"
5381 echocheck
"libmpcdec (musepack, version >= 1.2.1 required)"
5382 if test "$_musepack" = yes ; then
5386 #include <mpcdec/mpcdec.h>
5388 mpc_streaminfo info;
5389 mpc_decoder decoder;
5390 mpc_decoder_set_streaminfo(&decoder, &info);
5391 mpc_decoder_decode_frame(&decoder, NULL, 0, NULL);
5395 cc_check
-lmpcdec $_ld_lm && _musepack
=yes
5397 if test "$_musepack" = yes ; then
5398 def_musepack
='#define CONFIG_MUSEPACK 1'
5399 extra_ldflags
="$extra_ldflags -lmpcdec"
5400 codecmodules
="musepack $codecmodules"
5402 def_musepack
='#undef CONFIG_MUSEPACK'
5403 nocodecmodules
="musepack $nocodecmodules"
5405 echores
"$_musepack"
5408 echocheck
"FAAD2 support"
5409 if test "$_faad" = auto
; then
5413 #ifndef FAAD_MIN_STREAMSIZE
5414 #error Too old version
5416 int main(void) { faacDecHandle testhand; faacDecFrameInfo testinfo;
5417 testhand = faacDecOpen(); faacDecInit(0, 0, 0, 0, 0); return 0; }
5419 cc_check
-lfaad $_ld_lm && _faad
=yes
5422 def_faad
='#undef CONFIG_FAAD'
5423 if test "$_faad" = yes ; then
5424 def_faad
='#define CONFIG_FAAD 1'
5425 extra_ldflags
="$extra_ldflags -lfaad"
5426 codecmodules
="faad2 $codecmodules"
5428 nocodecmodules
="faad2 $nocodecmodules"
5433 echocheck
"LADSPA plugin support"
5434 if test "$_ladspa" = auto
; then
5436 statement_check ladspa.h
'LADSPA_Descriptor ld = {0}' && _ladspa
=yes
5438 if test "$_ladspa" = yes; then
5439 def_ladspa
="#define CONFIG_LADSPA 1"
5441 def_ladspa
="#undef CONFIG_LADSPA"
5446 echocheck
"libbs2b audio filter support"
5447 if test "$_libbs2b" = auto
; then
5449 if pkg_config_add libbs2b
; then
5453 def_libbs2b
="#undef CONFIG_LIBBS2B"
5454 test "$_libbs2b" = yes && def_libbs2b
="#define CONFIG_LIBBS2B 1"
5458 if test -z "$_codecsdir" ; then
5459 for dir
in "$_libdir/codecs" "$_libdir/win32" /usr
/local
/lib
/codecs \
5460 /usr
/lib
/codecs
/usr
/local
/lib
/win32
/usr
/lib
/win32
; do
5461 if test -d "$dir" ; then
5467 # Fall back on default directory.
5468 if test -z "$_codecsdir" ; then
5469 _codecsdir
="$_libdir/codecs"
5470 mingw32
&& _codecsdir
="codecs"
5474 echocheck
"Win32 codecs"
5475 if test "$_win32dll" = auto
; then
5477 if x86_32
&& ! qnx
; then
5481 if test "$_win32dll" = yes ; then
5482 def_win32dll
='#define CONFIG_WIN32DLL 1'
5484 def_win32_loader
='#define WIN32_LOADER 1'
5485 _win32_emulation
=yes
5487 extra_ldflags
="$extra_ldflags -ladvapi32 -lole32"
5488 res_comment
="using native windows"
5490 codecmodules
="win32 $codecmodules"
5492 def_win32dll
='#undef CONFIG_WIN32DLL'
5493 def_win32_loader
='#undef WIN32_LOADER'
5494 nocodecmodules
="win32 $nocodecmodules"
5496 echores
"$_win32dll"
5499 echocheck
"XAnim codecs"
5500 if test "$_xanim" = auto
; then
5502 res_comment
="dynamic loader support needed"
5503 if test "$_dl" = yes ; then
5507 if test "$_xanim" = yes ; then
5508 def_xanim
='#define CONFIG_XANIM 1'
5509 codecmodules
="xanim $codecmodules"
5511 def_xanim
='#undef CONFIG_XANIM'
5512 nocodecmodules
="xanim $nocodecmodules"
5517 echocheck
"RealPlayer codecs"
5518 if test "$_real" = auto
; then
5520 res_comment
="dynamic loader support needed"
5521 if test "$_dl" = yes ||
test "$_win32dll" = yes &&
5522 (linux || freebsd || netbsd || openbsd || dragonfly || darwin || win32
) ; then
5526 if test "$_real" = yes ; then
5527 def_real
='#define CONFIG_REALCODECS 1'
5528 codecmodules
="real $codecmodules"
5530 def_real
='#undef CONFIG_REALCODECS'
5531 nocodecmodules
="real $nocodecmodules"
5536 echocheck
"QuickTime codecs"
5538 def_qtx_win32
='#undef CONFIG_QTX_CODECS_WIN32'
5539 if test "$_qtx" = auto
; then
5540 test "$_win32dll" = yes ||
test "$quicktime" = yes && _qtx
=yes
5542 if test "$_qtx" = yes ; then
5543 def_qtx
='#define CONFIG_QTX_CODECS 1'
5544 win32
&& _qtx_codecs_win32
=yes && def_qtx_win32
='#define CONFIG_QTX_CODECS_WIN32 1'
5545 codecmodules
="qtx $codecmodules"
5546 darwin || win32 || _qtx_emulation
=yes
5548 def_qtx
='#undef CONFIG_QTX_CODECS'
5549 nocodecmodules
="qtx $nocodecmodules"
5553 echocheck
"Nemesi Streaming Media libraries"
5554 if test "$_nemesi" = auto
&& test "$networking" = yes ; then
5556 if pkg_config_add libnemesi
; then
5560 if test "$_nemesi" = yes; then
5562 def_nemesi
='#define CONFIG_LIBNEMESI 1'
5563 inputmodules
="nemesi $inputmodules"
5565 _native_rtsp
="$networking"
5567 def_nemesi
='#undef CONFIG_LIBNEMESI'
5568 noinputmodules
="nemesi $noinputmodules"
5572 echocheck
"LIVE555 Streaming Media libraries"
5573 if test "$_live" != no
&& test "$networking" = yes ; then
5574 cat > $TMPCPP << EOF
5575 #include <liveMedia.hh>
5576 #if (LIVEMEDIA_LIBRARY_VERSION_INT < 1141257600)
5577 #error Please upgrade to version 2006.03.03 or later of the "LIVE555 Streaming Media" libraries - available from <www.live555.com/liveMedia/>
5579 int main(void) { return 0; }
5583 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
5584 cxx_check
$I/liveMedia
/include
$I/UsageEnvironment
/include
$I/groupsock
/include
&&
5585 _livelibdir
=$
(echo $I|
sed s
/-I//) &&
5586 extra_ldflags
="$_livelibdir/liveMedia/libliveMedia.a \
5587 $_livelibdir/groupsock/libgroupsock.a \
5588 $_livelibdir/UsageEnvironment/libUsageEnvironment.a \
5589 $_livelibdir/BasicUsageEnvironment/libBasicUsageEnvironment.a \
5590 $extra_ldflags -lstdc++" \
5591 extra_cxxflags
="-I$_livelibdir/liveMedia/include \
5592 -I$_livelibdir/UsageEnvironment/include \
5593 -I$_livelibdir/BasicUsageEnvironment/include \
5594 -I$_livelibdir/groupsock/include" &&
5597 if test "$_live" != yes ; then
5598 ld_tmp
="-lliveMedia -lgroupsock -lUsageEnvironment -lBasicUsageEnvironment -lstdc++"
5599 if cxx_check
-I/usr
/include
/liveMedia
-I/usr
/include
/UsageEnvironment
-I/usr
/include
/groupsock
$ld_tmp; then
5604 if test "$_live" = yes && test "$networking" = yes; then
5605 test $_livelibdir && res_comment
="using $_livelibdir"
5606 def_live
='#define CONFIG_LIVE555 1'
5607 inputmodules
="live555 $inputmodules"
5608 elif test "$_live_dist" = yes && test "$networking" = yes; then
5609 res_comment
="using distribution version"
5611 def_live
='#define CONFIG_LIVE555 1'
5612 extra_ldflags
="$extra_ldflags $ld_tmp"
5613 extra_cxxflags
="-I/usr/include/liveMedia -I/usr/include/UsageEnvironment -I/usr/include/BasicUsageEnvironment -I/usr/include/groupsock"
5614 inputmodules
="live555 $inputmodules"
5617 def_live
='#undef CONFIG_LIVE555'
5618 noinputmodules
="live555 $noinputmodules"
5624 # Test with > against Libav 0.8 versions which will NOT work rather than
5625 # specify minimum version, to allow (future) point releases to possibly work.
5626 all_libav_libs
="libavutil > 51.21.0:libavcodec > 53.34.0:libavformat > 53.20.0:libswscale >= 2.0.0"
5627 echocheck
"Libav ($all_libav_libs)"
5628 if test "$ffmpeg" = auto
; then
5629 IFS
=":" # shell should not be used for programming
5630 if ! pkg_config_add
$all_libav_libs ; then
5631 die
"Unable to find development files for some of the required Libav libraries above. Aborting."
5636 def_ffmpeg_internals
="#undef CONFIG_FFMPEG_INTERNALS"
5637 if ! test -z "$_ffmpeg_source" ; then
5638 def_ffmpeg_internals
="#define CONFIG_FFMPEG_INTERNALS 1" && ffmpeg_internals
=yes
5641 echocheck
"libpostproc >= 52.0.0"
5642 if test "$libpostproc" = auto
; then
5644 if pkg_config_add
"libpostproc >= 52.0.0" ; then
5648 if test "$libpostproc" = yes ; then
5649 def_libpostproc
='#define CONFIG_LIBPOSTPROC 1'
5651 def_libpostproc
='#undef CONFIG_LIBPOSTPROC'
5653 echores
"$libpostproc"
5656 echocheck
"libdv-0.9.5+"
5657 if test "$_libdv" = auto
; then
5659 statement_check libdv
/dv.h
'dv_encoder_new(1, 1, 1)' -ldv $_ld_pthread $_ld_lm && _libdv
=yes
5661 if test "$_libdv" = yes ; then
5662 def_libdv
='#define CONFIG_LIBDV095 1'
5663 extra_ldflags
="$extra_ldflags -ldv"
5664 codecmodules
="libdv $codecmodules"
5666 def_libdv
='#undef CONFIG_LIBDV095'
5667 nocodecmodules
="libdv $nocodecmodules"
5673 if test "$_xvid" = auto
; then
5675 for _ld_tmp
in "-lxvidcore $_ld_lm" "-lxvidcore $_ld_lm $_ld_pthread" ; do
5676 statement_check xvid.h
'xvid_global(0, 0, 0, 0)' $_ld_tmp &&
5677 extra_ldflags
="$extra_ldflags $_ld_tmp" && _xvid
=yes && break
5681 if test "$_xvid" = yes ; then
5682 def_xvid
='#define CONFIG_XVID4 1'
5683 codecmodules
="xvid $codecmodules"
5685 def_xvid
='#undef CONFIG_XVID4'
5686 nocodecmodules
="xvid $nocodecmodules"
5692 if test "$_libnut" = auto
; then
5694 statement_check libnut.h
'nut_context_tt * nut; nut_error(0)' -lnut && _libnut
=yes
5697 if test "$_libnut" = yes ; then
5698 def_libnut
='#define CONFIG_LIBNUT 1'
5699 extra_ldflags
="$extra_ldflags -lnut"
5701 def_libnut
='#undef CONFIG_LIBNUT'
5705 # These VO checks must be done after the FFmpeg one
5706 echocheck
"/dev/mga_vid"
5707 if test "$_mga" = auto
; then
5709 test -c /dev
/mga_vid
&& _mga
=yes
5711 if test "$_mga" = yes ; then
5712 def_mga
='#define CONFIG_MGA 1'
5713 vomodules
="mga $vomodules"
5715 def_mga
='#undef CONFIG_MGA'
5716 novomodules
="mga $novomodules"
5722 if test "$_xmga" = auto
; then
5724 test "$_x11" = yes && test "$_mga" = yes && _xmga
=yes
5726 if test "$_xmga" = yes ; then
5727 def_xmga
='#define CONFIG_XMGA 1'
5728 vomodules
="xmga $vomodules"
5730 def_xmga
='#undef CONFIG_XMGA'
5731 novomodules
="xmga $novomodules"
5736 echocheck
"UnRAR executable"
5737 if test "$_unrar_exec" = auto
; then
5739 mingw32
&& _unrar_exec
="no"
5741 if test "$_unrar_exec" = yes ; then
5742 def_unrar_exec
='#define CONFIG_UNRAR_EXEC 1'
5744 def_unrar_exec
='#undef CONFIG_UNRAR_EXEC'
5746 echores
"$_unrar_exec"
5748 echocheck
"TV interface"
5749 if test "$_tv" = yes ; then
5750 def_tv
='#define CONFIG_TV 1'
5751 inputmodules
="tv $inputmodules"
5753 noinputmodules
="tv $noinputmodules"
5754 def_tv
='#undef CONFIG_TV'
5759 if freebsd || netbsd || openbsd || dragonfly || bsdos
; then
5760 echocheck
"*BSD BT848 bt8xx header"
5762 for file in "machine/ioctl_bt848.h" \
5763 "dev/bktr/ioctl_bt848.h" \
5764 "dev/video/bktr/ioctl_bt848.h" \
5765 "dev/ic/bt8xx.h" ; do
5767 #include <sys/types.h>
5768 #include <sys/ioctl.h>
5770 int main(void) { ioctl(0, TVTUNER_GETFREQ, 0); return 0; }
5774 _ioctl_bt848_h_name
="$file"
5778 if test "$_ioctl_bt848_h" = yes ; then
5779 def_ioctl_bt848_h_name
="#define IOCTL_BT848_H_NAME <$_ioctl_bt848_h_name>"
5780 res_comment
="using $_ioctl_bt848_h_name"
5782 def_ioctl_bt848_h_name
="#undef IOCTL_BT848_H_NAME"
5784 echores
"$_ioctl_bt848_h"
5786 echocheck
"*BSD ioctl_meteor.h"
5788 for ioctl_meteor_h_path
in "machine/ioctl_meteor.h" "dev/bktr/ioctl_meteor.h" "dev/video/bktr/ioctl_meteor.h" ; do
5789 statement_check_broken
"sys/types.h" "$ioctl_meteor_h_path" 'ioctl(0, METEORSINPUT, 0)' &&
5790 _ioctl_meteor_h
=yes && break
5792 if test "$_ioctl_meteor_h" = yes ; then
5793 def_ioctl_meteor_h_name
="#define IOCTL_METEOR_H_NAME <$ioctl_meteor_h_path>"
5794 res_comment
="using $ioctl_meteor_h_path"
5796 def_ioctl_meteor_h_name
="#undef IOCTL_METEOR_H_NAME"
5798 echores
"$_ioctl_meteor_h"
5800 echocheck
"*BSD BrookTree 848 TV interface"
5801 if test "$_tv_bsdbt848" = auto
; then
5803 if test "$_tv" = yes ; then
5805 #include <sys/types.h>
5806 $def_ioctl_meteor_h_name
5807 $def_ioctl_bt848_h_name
5808 #ifdef IOCTL_METEOR_H_NAME
5809 #include IOCTL_METEOR_H_NAME
5811 #ifdef IOCTL_BT848_H_NAME
5812 #include IOCTL_BT848_H_NAME
5815 ioctl(0, METEORSINPUT, 0);
5816 ioctl(0, TVTUNER_GETFREQ, 0);
5820 cc_check
&& _tv_bsdbt848
=yes
5823 if test "$_tv_bsdbt848" = yes ; then
5824 def_tv_bsdbt848
='#define CONFIG_TV_BSDBT848 1'
5825 inputmodules
="tv-bsdbt848 $inputmodules"
5827 def_tv_bsdbt848
='#undef CONFIG_TV_BSDBT848'
5828 noinputmodules
="tv-bsdbt848 $noinputmodules"
5830 echores
"$_tv_bsdbt848"
5831 fi #if freebsd || netbsd || openbsd || dragonfly || bsdos
5834 echocheck
"DirectShow TV interface"
5835 if test "$_tv_dshow" = auto
; then
5837 if test "$_tv" = yes && win32
; then
5838 statement_check ole2.h
'void* p; CoCreateInstance((GUID*)&GUID_NULL, NULL, CLSCTX_INPROC_SERVER, &GUID_NULL, &p)' -lole32 -luuid && _tv_dshow
=yes
5841 if test "$_tv_dshow" = yes ; then
5842 inputmodules
="tv-dshow $inputmodules"
5843 def_tv_dshow
='#define CONFIG_TV_DSHOW 1'
5844 extra_ldflags
="$extra_ldflags -lole32 -luuid"
5846 noinputmodules
="tv-dshow $noinputmodules"
5847 def_tv_dshow
='#undef CONFIG_TV_DSHOW'
5849 echores
"$_tv_dshow"
5852 echocheck
"Video 4 Linux TV interface"
5853 if test "$_tv_v4l1" = auto
; then
5855 if test "$_tv" = yes && linux
; then
5856 header_check_broken sys
/time.h linux
/videodev.h
&& _tv_v4l1
=yes
5859 if test "$_tv_v4l1" = yes ; then
5862 def_tv_v4l
='#define CONFIG_TV_V4L 1'
5863 def_tv_v4l1
='#define CONFIG_TV_V4L1 1'
5864 inputmodules
="tv-v4l $inputmodules"
5866 noinputmodules
="tv-v4l1 $noinputmodules"
5867 def_tv_v4l
='#undef CONFIG_TV_V4L'
5872 echocheck
"Video 4 Linux 2 TV interface"
5873 if test "$_tv_v4l2" = auto
; then
5875 if test "$_tv" = yes && linux
; then
5876 header_check_broken sys
/time.h linux
/videodev2.h
&& _tv_v4l2
=yes
5877 elif test "$_tv" = yes && test "$sys_videoio_h" = "yes" ; then
5881 if test "$_tv_v4l2" = yes ; then
5884 def_tv_v4l
='#define CONFIG_TV_V4L 1'
5885 def_tv_v4l2
='#define CONFIG_TV_V4L2 1'
5886 inputmodules
="tv-v4l2 $inputmodules"
5888 noinputmodules
="tv-v4l2 $noinputmodules"
5889 def_tv_v4l2
='#undef CONFIG_TV_V4L2'
5894 echocheck
"Radio interface"
5895 if test "$_radio" = yes ; then
5896 def_radio
='#define CONFIG_RADIO 1'
5897 inputmodules
="radio $inputmodules"
5898 if test "$_alsa" != yes -a "$_ossaudio" != yes ; then
5901 if test "$_radio_capture" = yes ; then
5903 def_radio_capture
="#define CONFIG_RADIO_CAPTURE 1"
5905 def_radio_capture
="#undef CONFIG_RADIO_CAPTURE"
5908 noinputmodules
="radio $noinputmodules"
5909 def_radio
='#undef CONFIG_RADIO'
5910 def_radio_capture
="#undef CONFIG_RADIO_CAPTURE"
5914 echocheck
"Capture for Radio interface"
5915 echores
"$_radio_capture"
5917 echocheck
"Video 4 Linux 2 Radio interface"
5918 if test "$_radio_v4l2" = auto
; then
5920 if test "$_radio" = yes && linux
; then
5921 header_check linux
/videodev2.h
&& _radio_v4l2
=yes
5924 if test "$_radio_v4l2" = yes ; then
5925 def_radio_v4l2
='#define CONFIG_RADIO_V4L2 1'
5927 def_radio_v4l2
='#undef CONFIG_RADIO_V4L2'
5929 echores
"$_radio_v4l2"
5931 echocheck
"Video 4 Linux Radio interface"
5932 if test "$_radio_v4l" = auto
; then
5934 if test "$_radio" = yes && linux
; then
5935 header_check linux
/videodev.h
&& _radio_v4l
=yes
5938 if test "$_radio_v4l" = yes ; then
5939 def_radio_v4l
='#define CONFIG_RADIO_V4L 1'
5941 def_radio_v4l
='#undef CONFIG_RADIO_V4L'
5943 echores
"$_radio_v4l"
5945 if freebsd || netbsd || openbsd || dragonfly || bsdos
&&
5946 test "$_radio" = yes && test "$_radio_bsdbt848" = auto
; then
5947 echocheck
"*BSD BrookTree 848 Radio interface"
5950 #include <sys/types.h>
5951 $def_ioctl_bt848_h_name
5952 #ifdef IOCTL_BT848_H_NAME
5953 #include IOCTL_BT848_H_NAME
5955 int main(void) { ioctl(0, RADIO_GETFREQ, 0); return 0; }
5957 cc_check
&& _radio_bsdbt848
=yes
5958 echores
"$_radio_bsdbt848"
5959 fi #if freebsd || netbsd || openbsd || dragonfly || bsdos && _radio && _radio_bsdbt848
5961 if test "$_radio_bsdbt848" = yes ; then
5962 def_radio_bsdbt848
='#define CONFIG_RADIO_BSDBT848 1'
5964 def_radio_bsdbt848
='#undef CONFIG_RADIO_BSDBT848'
5967 if test "$_radio_v4l" = no
&& test "$_radio_v4l2" = no
&&
5968 test "$_radio_bsdbt848" = no
&& test "$_radio" = yes ; then
5969 die
"Radio driver requires BSD BT848, V4L or V4L2!"
5972 echocheck
"Video 4 Linux 2 MPEG PVR interface"
5973 if test "$_pvr" = auto
; then
5975 if test "$_tv_v4l2" = yes && linux
; then
5977 #include <sys/time.h>
5978 #include <linux/videodev2.h>
5979 int main(void) { struct v4l2_ext_controls ext; return ext.controls->value; }
5981 cc_check
&& _pvr
=yes
5984 if test "$_pvr" = yes ; then
5985 def_pvr
='#define CONFIG_PVR 1'
5986 inputmodules
="pvr $inputmodules"
5988 noinputmodules
="pvr $noinputmodules"
5989 def_pvr
='#undef CONFIG_PVR'
5995 if test "$_ftp" = "auto" ; then
5996 test "$networking" = "yes" && ! beos
&& _ftp
=yes
5998 if test "$_ftp" = yes ; then
5999 def_ftp
='#define CONFIG_FTP 1'
6000 inputmodules
="ftp $inputmodules"
6002 noinputmodules
="ftp $noinputmodules"
6003 def_ftp
='#undef CONFIG_FTP'
6007 echocheck
"vstream client"
6008 if test "$_vstream" = auto
; then
6011 #include <vstream-client.h>
6012 void vstream_error(const char *format, ... ) {}
6013 int main(void) { vstream_start(); return 0; }
6015 cc_check
-lvstream-client && _vstream
=yes
6017 if test "$_vstream" = yes ; then
6018 def_vstream
='#define CONFIG_VSTREAM 1'
6019 inputmodules
="vstream $inputmodules"
6020 extra_ldflags
="$extra_ldflags -lvstream-client"
6022 noinputmodules
="vstream $noinputmodules"
6023 def_vstream
='#undef CONFIG_VSTREAM'
6028 echocheck
"Subtitles sorting"
6029 if test "$_sortsub" = yes ; then
6030 def_sortsub
='#define CONFIG_SORTSUB 1'
6032 def_sortsub
='#undef CONFIG_SORTSUB'
6037 echocheck
"XMMS inputplugin support"
6038 if test "$_xmms" = yes ; then
6039 if ( xmms-config
--version ) >/dev
/null
2>&1 ; then
6040 _xmmsplugindir
=$
(xmms-config
--input-plugin-dir)
6041 _xmmslibdir
=$
(xmms-config
--exec-prefix)/lib
6043 _xmmsplugindir
=/usr
/lib
/xmms
/Input
6044 _xmmslibdir
=/usr
/lib
6047 def_xmms
='#define CONFIG_XMMS 1'
6049 extra_ldflags
="$extra_ldflags ${_xmmslibdir}/libxmms.dylib"
6051 extra_ldflags
="$extra_ldflags ${_xmmslibdir}/libxmms.so.1 -export-dynamic"
6054 def_xmms
='#undef CONFIG_XMMS'
6058 if test "$_charset" != "noconv" ; then
6059 def_charset
="#define MSG_CHARSET \"$_charset\""
6061 def_charset
="#undef MSG_CHARSET"
6065 #############################################################################
6067 echocheck
"automatic gdb attach"
6068 if test "$_crash_debug" = yes ; then
6069 def_crash_debug
='#define CONFIG_CRASH_DEBUG 1'
6071 def_crash_debug
='#undef CONFIG_CRASH_DEBUG'
6074 echores
"$_crash_debug"
6076 echocheck
"compiler support for noexecstack"
6077 if cflag_check
-Wl,-z,noexecstack
; then
6078 extra_ldflags
="-Wl,-z,noexecstack $extra_ldflags"
6084 echocheck
"linker support for --nxcompat --no-seh --dynamicbase"
6085 if cflag_check
"-Wl,--nxcompat -Wl,--no-seh -Wl,--dynamicbase" ; then
6086 extra_ldflags
="-Wl,--nxcompat -Wl,--no-seh -Wl,--dynamicbase $extra_ldflags"
6093 # Dynamic linking flags
6094 # (FIXME: 'echocheck "dynamic linking"' above and modify here accordingly)
6096 freebsd || netbsd || openbsd || dragonfly || bsdos
&& _ld_dl_dynamic
='-rdynamic'
6097 if test "$_real" = yes ||
test "$_xanim" = yes && ! win32
&& ! qnx
&& ! darwin
&& ! sunos
; then
6098 _ld_dl_dynamic
='-rdynamic'
6101 extra_ldflags
="$extra_ldflags $_ld_pthread $_ld_dl $_ld_dl_dynamic"
6102 bsdos
&& extra_ldflags
="$extra_ldflags -ldvd"
6103 (netbsd || openbsd
) && x86_32
&& extra_ldflags
="$extra_ldflags -li386"
6105 def_debug
='#undef MP_DEBUG'
6106 test "$_debug" != "" && def_debug
='#define MP_DEBUG 1'
6109 echocheck
"joystick"
6110 def_joystick
='#undef CONFIG_JOYSTICK'
6111 if test "$_joystick" = yes ; then
6112 if linux || freebsd
; then
6113 # TODO add some check
6114 def_joystick
='#define CONFIG_JOYSTICK 1'
6117 res_comment
="unsupported under $system_name"
6120 echores
"$_joystick"
6123 if test "$_lirc" = auto
; then
6125 header_check lirc
/lirc_client.h
-llirc_client && _lirc
=yes
6127 if test "$_lirc" = yes ; then
6128 def_lirc
='#define CONFIG_LIRC 1'
6129 libs_mplayer
="$libs_mplayer -llirc_client"
6131 def_lirc
='#undef CONFIG_LIRC'
6136 if test "$_lircc" = auto
; then
6138 header_check lirc
/lircc.h
-llircc && _lircc
=yes
6140 if test "$_lircc" = yes ; then
6141 def_lircc
='#define CONFIG_LIRCC 1'
6142 libs_mplayer
="$libs_mplayer -llircc"
6144 def_lircc
='#undef CONFIG_LIRCC'
6148 #############################################################################
6150 CFLAGS
="$CFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE"
6152 CXXFLAGS
=" $CFLAGS -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS"
6154 # This must be the last test to be performed. Any other tests following it
6155 # could fail due to linker errors. libdvdnavmini is intentionally not linked
6156 # against libdvdread (to permit MPlayer to use its own copy of the library).
6157 # So any compilation using the flags added here but not linking against
6158 # libdvdread can fail.
6159 echocheck
"DVD support (libdvdnav)"
6160 if test "$_dvdread_internal" = yes && test ! -f "libdvdnav/dvdnav.c" ; then
6164 if test "$_dvdnav" = auto
; then
6165 if test "$_dvdread_internal" = yes ; then
6168 res_comment
="internal"
6170 $_dvdnavconfig --version --minilibs >> $TMPLOG 2>&1 || _dvdnav
=no
6173 if test "$_dvdnav" = auto
; then
6175 _dvdnavdir
=$
($_dvdnavconfig --cflags)
6176 _dvdnavlibs
=$
($_dvdnavconfig --libs)
6177 statement_check_broken stdint.h dvdnav
/dvdnav.h
'dvdnav_t *dvd = 0' $_dvdnavdir $_dvdnavlibs $_ld_dl $_ld_pthread && _dvdnav
=yes
6179 if test "$_dvdnav" = yes ; then
6180 def_dvdnav
='#define CONFIG_DVDNAV 1'
6181 if test "$dvdnav_internal" = yes ; then
6182 cflags_libdvdnav
="-Ilibdvdnav"
6183 inputmodules
="dvdnav(internal) $inputmodules"
6185 extra_cflags
="$extra_cflags $($_dvdnavconfig --cflags)"
6186 extra_ldflags
="$extra_ldflags $($_dvdnavconfig --minilibs)"
6187 inputmodules
="dvdnav $inputmodules"
6190 def_dvdnav
='#undef CONFIG_DVDNAV'
6191 noinputmodules
="dvdnav $noinputmodules"
6195 # DO NOT ADD ANY TESTS THAT USE LINKER FLAGS HERE (like cc_check).
6196 # Read dvdnav comment above.
6199 list
=$
(echo $1 |
tr '[a-z]' '[A-Z]')
6200 item
=$
(echo $2 |
tr '[a-z]' '[A-Z]')
6202 for part
in $list; do
6203 if $
(echo $item |
grep -q -E "(^| )$part($| )"); then
6204 echo "${nprefix}_$part = yes"
6209 #############################################################################
6210 echo "Creating config.mak"
6211 cat > config.mak
<< EOF
6212 # -------- Generated by configure -----------
6214 # Ensure that locale settings do not interfere with shell commands.
6217 CONFIGURATION = $configuration
6220 DOC_LANGS = $language_doc
6221 DOC_LANG_ALL = $doc_lang_all
6222 MAN_LANGS = $language_man
6223 MAN_LANG_ALL = $man_lang_all
6224 MSG_LANGS = $language_msg
6225 MSG_LANG_ALL = $msg_lang_all
6227 prefix = \$(DESTDIR)$_prefix
6228 BINDIR = \$(DESTDIR)$_bindir
6229 DATADIR = \$(DESTDIR)$_datadir
6230 LIBDIR = \$(DESTDIR)$_libdir
6231 MANDIR = \$(DESTDIR)$_mandir
6232 CONFDIR = \$(DESTDIR)$_confdir
6233 LOCALEDIR = \$(DESTDIR)$_localedir
6241 INSTALLSTRIP = $_install_strip
6244 CFLAGS = $WARNFLAGS $ERRORFLAGS $WARN_CFLAGS $CFLAGS $extra_cflags
6245 CXXFLAGS = $WARNFLAGS $ERRORFLAGS $CXXFLAGS $extra_cflags $extra_cxxflags
6246 DEPFLAGS = $DEPFLAGS
6248 CFLAGS_LIBDVDCSS = $cflags_libdvdcss
6249 CFLAGS_LIBDVDCSS_DVDREAD = $cflags_libdvdcss_dvdread
6250 CFLAGS_LIBDVDNAV = $cflags_libdvdnav
6251 CFLAGS_NO_OMIT_LEAF_FRAME_POINTER = $cflags_no_omit_leaf_frame_pointer
6252 CFLAGS_STACKREALIGN = $cflags_stackrealign
6254 EXTRALIBS = $extra_ldflags $_ld_static $_ld_lm $extra_libs
6255 EXTRALIBS_MPLAYER = $libs_mplayer
6264 $(mak_enable "$arch_all" "$arch" ARCH)
6265 $(mak_enable "$subarch_all" "$subarch" ARCH)
6266 $(mak_enable "$cpuexts_all" "$cpuexts" HAVE)
6270 NEED_GETTIMEOFDAY = $need_gettimeofday
6271 NEED_GLOB = $need_glob
6272 NEED_SETENV = $need_setenv
6273 NEED_SHMEM = $need_shmem
6274 NEED_STRSEP = $need_strsep
6275 NEED_SWAB = $need_swab
6276 NEED_VSSCANF = $need_vsscanf
6282 APPLE_IR = $_apple_ir
6283 APPLE_REMOTE = $_apple_remote
6284 AUDIO_INPUT = $_audio_input
6285 BITMAP_FONT = $_bitmap_font
6291 COREAUDIO = $_coreaudio
6292 COREVIDEO = $_corevideo
6293 SHAREDBUFFER = $_sharedbuffer
6295 DIRECT3D = $_direct3d
6296 DIRECTFB = $_directfb
6300 DVDNAV_INTERNAL = $dvdnav_internal
6302 DVDREAD_INTERNAL = $_dvdread_internal
6305 FASTMEMCPY = $_fastmemcpy
6307 FREETYPE = $_freetype
6312 GL_COCOA = $_gl_cocoa
6313 GL_WIN32 = $_gl_win32
6316 HAVE_POSIX_SELECT = $_posix_select
6317 HAVE_SYS_MMAN_H = $_mman
6320 JOYSTICK = $_joystick
6325 LIBBLURAY = $_bluray
6329 LIBDVDCSS_INTERNAL = $_libdvdcss_internal
6331 LIBNEMESI = $_nemesi
6333 LIBPOSTPROC = $libpostproc
6334 LIBSMBCLIENT = $_smb
6335 LIBTHEORA = $_theora
6338 MACOSX_FINDER = $_macosx_finder
6343 MUSEPACK = $_musepack
6345 NATIVE_RTSP = $_native_rtsp
6346 NETWORKING = $networking
6349 PE_EXECUTABLE = $_pe_executable
6352 PRIORITY = $_priority
6354 PORTAUDIO = $_portaudio
6357 QTX_CODECS_WIN32 = $_qtx_codecs_win32
6358 QTX_EMULATION = $_qtx_emulation
6360 RADIO_CAPTURE=$_radio_capture
6361 REAL_CODECS = $_real
6366 STREAM_CACHE = $_stream_cache
6367 SUNAUDIO = $_sunaudio
6373 TV_BSDBT848 = $_tv_bsdbt848
6374 TV_DSHOW = $_tv_dshow
6378 UNRAR_EXEC = $_unrar_exec
6386 WIN32DLL = $_win32dll
6387 WIN32WAVEOUT = $_win32waveout
6388 WIN32_EMULATION = $_win32_emulation
6390 XANIM_CODECS = $_xanim
6392 XMMS_PLUGINS = $_xmms
6396 YUV4MPEG = $_yuv4mpeg
6399 FFMPEG_INTERNALS = $ffmpeg_internals
6400 FFMPEG_SOURCE_PATH = $_ffmpeg_source
6404 YASMFLAGS = $YASMFLAGS
6406 CONFIG_VDPAU = $_vdpau
6407 CONFIG_ZLIB = $_zlib
6409 HAVE_PTHREADS = $_pthreads
6411 HAVE_W32THREADS = $_w32threads
6412 HAVE_YASM = $have_yasm
6416 #############################################################################
6418 ff_config_enable
() {
6419 list
=$
(echo $1 |
tr '[a-z]' '[A-Z]')
6420 item
=$
(echo $2 |
tr '[a-z]' '[A-Z]')
6422 test -z "$_nprefix" && _nprefix
='CONFIG'
6423 for part
in $list; do
6424 if $
(echo $item |
grep -q -E "(^| )$part($| )"); then
6425 echo "#define ${_nprefix}_$part 1"
6427 echo "#define ${_nprefix}_$part 0"
6432 echo "Creating config.h"
6434 /*----------------------------------------------------------------------------
6435 ** This file has been automatically generated by configure any changes in it
6436 ** will be lost when you run configure again.
6437 ** Instead of modifying definitions here, use the --enable/--disable options
6438 ** of the configure script! See ./configure --help for details.
6439 *---------------------------------------------------------------------------*/
6441 #ifndef MPLAYER_CONFIG_H
6442 #define MPLAYER_CONFIG_H
6444 /* Undefine this if you do not want to select mono audio (left or right)
6445 with a stereo MPEG layer 2/3 audio stream. The command line option
6446 -stereo has three possible values (0 for stereo, 1 for left-only, 2 for
6447 right-only), with 0 being the default.
6449 #define CONFIG_FAKE_MONO 1
6451 /* set up audio OUTBURST. Do not change this! */
6452 #define OUTBURST 512
6454 /* Enable fast OSD/SUB renderer (looks ugly, but uses less CPU power) */
6456 #undef FAST_OSD_TABLE
6460 #define CONFIGURATION "$configuration"
6462 #define MPLAYER_DATADIR "$_datadir"
6463 #define MPLAYER_CONFDIR "$_confdir"
6464 #define MPLAYER_LOCALEDIR "$_localedir"
6468 /* definitions needed by included libraries */
6469 #define HAVE_INTTYPES_H 1
6471 #define HAVE_ERRNO_H 1
6472 /* libdvdcss + libdvdread */
6473 #define HAVE_LIMITS_H 1
6475 #define HAVE_UNISTD_H 1
6477 #define STDC_HEADERS 1
6478 #define HAVE_MEMCPY 1
6480 #define READ_CACHE_TRACE 0
6482 #define HAVE_DLFCN_H 1
6486 /* system headers */
6491 $def_mman_has_map_failed
6493 $def_sys_soundcard_h
6501 /* system functions */
6524 /* system-specific features */
6537 $def_restrict_keyword
6542 /* configurable options */
6547 $def_runtime_cpudetection
6555 #define __CPU__ $iproc
6559 $(ff_config_enable "$arch_all" "$arch" "ARCH")
6560 $(ff_config_enable "$subarch_all" "$subarch" "ARCH")
6561 $(ff_config_enable "$cpuexts_all" "$cpuexts" "HAVE")
6564 /* Blu-ray/DVD/VCD/CD */
6565 #define DEFAULT_CDROM_DEVICE "$default_cdrom_device"
6566 #define DEFAULT_DVD_DEVICE "$default_dvd_device"
6586 /* codec libraries */
6613 #define BINARY_CODECS_PATH "$_codecsdir"
6614 #define XMMS_INPUT_PLUGIN_DIR "$_xmmsplugindir"
6617 /* Audio output drivers */
6625 $def_ossaudio_devdsp
6626 $def_ossaudio_devmixer
6640 $def_ioctl_bt848_h_name
6641 $def_ioctl_meteor_h_name
6741 $def_ffmpeg_internals
6765 #define HAVE_INLINE_ASM 1
6767 /* Use these registers in x86 inline asm. No proper detection yet. */
6768 #define HAVE_EBP_AVAILABLE 1
6770 #endif /* MPLAYER_CONFIG_H */
6773 # Do not overwrite an unchanged config.h to avoid superfluous rebuilds.
6774 cmp -s "$TMPH" config.h ||
mv -f "$TMPH" config.h
6776 #############################################################################
6780 Config files successfully generated by ./configure $configuration !
6782 Install prefix: $_prefix
6783 Data directory: $_datadir
6784 Config direct.: $_confdir
6786 Byte order: $_byte_order
6787 Optimizing for: $_optimizing
6790 Messages (in addition to English): $language_msg
6791 Manual pages: $language_man
6792 Documentation: $language_doc
6794 Enabled optional drivers:
6795 Input: $inputmodules
6796 Codecs: $codecmodules
6797 Audio output: $aomodules
6798 Video output: $vomodules
6800 Disabled optional drivers:
6801 Input: $noinputmodules
6802 Codecs: $nocodecmodules
6803 Audio output: $noaomodules
6804 Video output: $novomodules
6806 'config.h' and 'config.mak' contain your configuration options.
6807 Note: If you alter theses files (for instance CFLAGS) MPlayer may no longer
6808 compile *** DO NOT REPORT BUGS if you tweak these files ***
6810 'make' will now compile MPlayer and 'make install' will install it.
6811 Note: On non-Linux systems you might need to use 'gmake' instead of 'make'.
6817 Check $TMPLOG if you wonder why an autodetection failed (make sure
6818 development headers/packages are installed).
6820 NOTE: The --enable-* parameters unconditionally force options on, completely
6821 skipping autodetection. This behavior is unlike what you may be used to from
6822 autoconf-based configure scripts that can decide to override you. This greater
6823 level of control comes at a price. You may have to provide the correct compiler
6824 and linker flags yourself.
6825 If you used one of these options (except --enable-runtime-cpudetection and
6826 similar ones that turn on internal features) and experience a compilation or
6827 linking failure, make sure you have passed the necessary compiler/linker flags
6830 If you suspect a bug, please read DOCS/HTML/$language_doc/bugreports.html.
6834 if test "$warn_cflags" = yes; then
6837 MPlayer compilation will use the CPPFLAGS/CFLAGS/LDFLAGS/YASMFLAGS set by you,
6840 *** *** DO NOT REPORT BUGS IF IT DOES NOT COMPILE/WORK! *** ***
6842 It is strongly recommended to let MPlayer choose the correct CFLAGS!
6843 To do so, execute 'CFLAGS= ./configure <options>'
6849 rm -rf "$mplayer_tmpdir"