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 $@
67 int main(void) { return 0; }
69 compile_check
$TMPC $@
75 int main(void) { return 0; }
78 compile_check
$TMPC $@
84 int main(void) { return $2; }
87 compile_check
$TMPC $@
93 int main(void) { $2; return 0; }
97 compile_check
$TMPC $@
100 define_statement_check
() {
104 int main(void) { $3; return 0; }
107 compile_check
$TMPC $@
110 return_statement_check
() {
113 int main(void) { $2; return $3; }
116 compile_check
$TMPC $@
121 int main(void) { __asm__ volatile ($1); return 0; }
124 compile_check
$TMPC $@
127 # The following checks are special and should only be used with broken and
128 # non-selfsufficient headers that do not include all of their dependencies.
130 header_check_broken
() {
134 int main(void) { return 0; }
138 compile_check
$TMPC $@
141 statement_check_broken
() {
145 int main(void) { $3; return 0; }
148 compile_check
$TMPC $@
152 unset IFS
# shell should not be used for programming
154 echo "$_pkg_config --cflags $@" >> "$TMPLOG"
155 ctmp
=$
($_pkg_config --cflags "$@" 2>> "$TMPLOG") ||
return $?
157 echo "$_pkg_config --libs $@" >> "$TMPLOG"
158 ltmp
=$
($_pkg_config --libs "$@" 2>> "$TMPLOG") ||
return $?
160 echo "cflags: $ctmp" >> "$TMPLOG"
161 echo "libs: $ltmp" >> "$TMPLOG"
163 extra_cflags
="$extra_cflags $ctmp"
164 extra_ldflags
="$extra_ldflags $ltmp"
168 "$TMPEXE" >> "$TMPLOG" 2>&1
171 # Display error message, flushes tempfile, exit
176 rm -f "$TMPEXE" "$TMPC" "$TMPS"
177 echo "Check \"$TMPLOG\" if you do not understand why it failed."
181 # OS test booleans functions
183 test "$(echo $system_name | tr A-Z a-z)" = "$(echo $1 | tr A-Z a-z)"
185 aix
() { issystem
"AIX"; }
186 amigaos
() { issystem
"AmigaOS"; }
187 beos
() { issystem
"BEOS"; }
188 bsdos
() { issystem
"BSD/OS"; }
189 cygwin
() { issystem
"CYGWIN"; }
190 darwin
() { issystem
"Darwin"; }
191 dragonfly
() { issystem
"DragonFly"; }
192 freebsd
() { issystem
"FreeBSD" || issystem
"GNU/kFreeBSD"; }
193 gnu
() { issystem
"GNU"; }
194 hpux
() { issystem
"HP-UX"; }
195 linux
() { issystem
"Linux"; }
196 mingw32
() { issystem
"MINGW32"; }
197 morphos
() { issystem
"MorphOS"; }
198 netbsd
() { issystem
"NetBSD"; }
199 openbsd
() { issystem
"OpenBSD"; }
200 qnx
() { issystem
"QNX"; }
201 win32
() { cygwin || mingw32
; }
203 # arch test boolean functions
204 # x86/x86pc is used by QNX
207 i
[3-9]86|x86|x86pc|k5|k6|k6-2|k6-3|pentium
*|athlon
*|i586-i686
) return 0 ;;
214 x86_64|amd64
) return 0 ;;
225 ppc|ppc64|powerpc|powerpc64
) return 0;;
244 # Use this before starting a check
246 echo "============ Checking for $@ ============" >> "$TMPLOG"
247 echo ${_echo_n} "Checking for $@ ... ${_echo_c}"
250 # Use this to echo the results of a check
252 if test "$res_comment" ; then
253 res_comment
="($res_comment)"
255 echo "Result is: $@ $res_comment" >> "$TMPLOG"
256 echo "##########################################" >> "$TMPLOG"
258 echo "$@ $res_comment"
261 #############################################################################
263 # Check how echo works in this /bin/sh
265 -n) _echo_n
= _echo_c
='\c' ;; # SysV echo
266 *) _echo_n
='-n ' _echo_c
= ;; # BSD echo
270 ls po
/*.po
>/dev
/null
2>&1 && msg_lang_all
=$
(echo po
/*.po |
sed -e 's:po/\([^[:space:]]*\)\.po:\1:g')
271 man_lang_all
=$
(echo DOCS
/man
/*/mplayer.rst |
sed -e "s:DOCS/man/\(..\)/mplayer.rst:\1:g" -e "s:DOCS/man/\(.._..\)/mplayer.rst:\1:g")
272 doc_lang_all
=$
(echo DOCS
/xml
/??
/ DOCS
/xml
/??_??
/ |
sed -e "s:DOCS/xml/\(..\)/:\1:g" -e "s:DOCS/xml/\(.._..\)/:\1:g")
276 Usage: $0 [OPTIONS]...
279 -h, --help display this help and exit
281 Installation directories:
282 --prefix=DIR prefix directory for installation [/usr/local]
283 --bindir=DIR directory for installing binaries [PREFIX/bin]
284 --mandir=DIR directory for installing man pages [PREFIX/share/man]
285 --confdir=DIR directory for installing configuration files
287 --localedir=DIR directory for locale tree [PREFIX/share/locale]
288 --libdir=DIR directory for object code libraries [PREFIX/lib]
289 --codecsdir=DIR directory for binary codecs [LIBDIR/codecs]
292 --disable-mplayer disable MPlayer compilation [enable]
293 --enable-termcap use termcap database for key codes [autodetect]
294 --enable-termios use termios database for key codes [autodetect]
295 --disable-iconv disable iconv for encoding conversion [autodetect]
296 --disable-langinfo do not use langinfo [autodetect]
297 --enable-lirc enable LIRC (remote control) support [autodetect]
298 --enable-lircc enable LIRCCD (LIRC client daemon) input [autodetect]
299 --enable-joystick enable joystick support [disable]
300 --enable-apple-remote enable Apple Remote input (Mac OS X only) [autodetect]
301 --enable-apple-ir enable Apple IR Remote input (Linux only) [autodetect]
302 --disable-vm disable X video mode extensions [autodetect]
303 --disable-xf86keysym disable support for multimedia keys [autodetect]
304 --enable-radio enable radio interface [disable]
305 --enable-radio-capture enable radio capture (through PCI/line-in) [disable]
306 --disable-radio-v4l2 disable Video4Linux2 radio interface [autodetect]
307 --disable-radio-bsdbt848 disable BSD BT848 radio interface [autodetect]
308 --disable-tv disable TV interface (TV/DVB grabbers) [enable]
309 --disable-tv-v4l2 disable Video4Linux2 TV interface [autodetect]
310 --disable-tv-bsdbt848 disable BSD BT848 interface [autodetect]
311 --disable-pvr disable Video4Linux2 MPEG PVR [autodetect]
312 --disable-rtc disable RTC (/dev/rtc) on Linux [autodetect]
313 --disable-networking disable networking [enable]
314 --enable-winsock2_h enable winsock2_h [autodetect]
315 --enable-smb enable Samba (SMB) input [autodetect]
316 --enable-libquvi enable libquvi [autodetect]
317 --enable-lcms2 enable LCMS2 support [autodetect]
318 --disable-vcd disable VCD support [autodetect]
319 --disable-bluray disable Blu-ray support [autodetect]
320 --disable-dvdnav disable libdvdnav [autodetect]
321 --disable-dvdread disable libdvdread [autodetect]
322 --disable-dvdread-internal disable internal libdvdread [autodetect]
323 --disable-libdvdcss-internal disable internal libdvdcss [autodetect]
324 --disable-cddb disable cddb [autodetect]
325 --disable-unrarexec disable using of UnRAR executable [enabled]
326 --disable-enca disable ENCA charset oracle library [autodetect]
327 --enable-macosx-finder enable Mac OS X Finder invocation parameter
329 --enable-macosx-bundle enable Mac OS X bundle file locations [autodetect]
330 --disable-inet6 disable IPv6 support [autodetect]
331 --disable-gethostbyname2 gethostbyname2 part of the C library [autodetect]
332 --disable-ftp disable FTP support [enabled]
333 --disable-vstream disable TiVo vstream client support [autodetect]
334 --disable-pthreads disable Posix threads support [autodetect]
335 --disable-w32threads disable Win32 threads support [autodetect]
336 --disable-libass disable subtitle rendering with libass [autodetect]
337 --enable-rpath enable runtime linker path for extra libs [disabled]
338 --disable-libpostproc disable postprocess filter (vf_pp) [autodetect]
339 --disable-libavresample disable libavresample (sample format conversion) [autodetect]
342 --enable-gif enable GIF support [autodetect]
343 --enable-png enable PNG input/output support [autodetect]
344 --enable-mng enable MNG input support [autodetect]
345 --enable-jpeg enable JPEG input/output support [autodetect]
346 --enable-libcdio enable libcdio support [autodetect]
347 --disable-win32dll disable Win32 DLL support [autodetect]
348 --disable-qtx disable QuickTime codecs support [enabled]
349 --disable-xanim disable XAnim codecs support [enabled]
350 --disable-real disable RealPlayer codecs support [enabled]
351 --disable-xvid disable Xvid [autodetect]
352 --disable-libnut disable libnut [autodetect]
353 --enable-libav skip Libav autodetection [autodetect]
354 --disable-libvorbis disable libvorbis support [autodetect]
355 --disable-tremor disable Tremor [autodetect if no libvorbis]
356 --disable-speex disable Speex support [autodetect]
357 --enable-theora enable OggTheora libraries [autodetect]
358 --enable-faad enable FAAD2 (AAC) [autodetect]
359 --disable-ladspa disable LADSPA plugin support [autodetect]
360 --disable-libbs2b disable libbs2b audio filter support [autodetect]
361 --disable-libdv disable libdv 0.9.5 en/decoding support [autodetect]
362 --disable-mpg123 disable libmpg123 MP3 decoding support [autodetect]
363 --disable-mad disable libmad (MPEG audio) support [autodetect]
364 --enable-xmms enable XMMS input plugin support [disabled]
365 --enable-libdca enable libdca support [autodetect]
366 --disable-liba52 disable liba52 [autodetect]
367 --enable-musepack enable libmpcdec support (deprecated, libavcodec
368 Musepack decoder is preferred) [disabled]
371 --enable-gl enable OpenGL video output [autodetect]
372 --enable-sdl enable SDL video output [autodetect]
373 --enable-caca enable CACA video output [autodetect]
374 --enable-direct3d enable Direct3D video output [autodetect]
375 --enable-directx enable DirectX video output [autodetect]
376 --enable-v4l2 enable V4L2 Decoder audio/video output [autodetect]
377 --enable-dvb enable DVB video input [autodetect]
378 --enable-xv enable Xv video output [autodetect]
379 --enable-vdpau enable VDPAU acceleration [autodetect]
380 --enable-vm enable XF86VidMode support [autodetect]
381 --enable-xinerama enable Xinerama support [autodetect]
382 --enable-x11 enable X11 video output [autodetect]
383 --disable-xss disable screensaver support via xss [autodetect]
384 --enable-directfb enable DirectFB video output [autodetect]
385 --disable-tga disable Targa video output [enable]
386 --disable-pnm disable PNM video output [enable]
387 --disable-md5sum disable md5sum video output [enable]
388 --disable-yuv4mpeg disable yuv4mpeg video output [enable]
389 --disable-corevideo disable CoreVideo video output [autodetect]
390 --disable-cocoa disable Cocoa OpenGL backend [autodetect]
391 --disable-sharedbuffer disable OSX shared buffer video output [autodetect]
394 --disable-alsa disable ALSA audio output [autodetect]
395 --disable-ossaudio disable OSS audio output [autodetect]
396 --disable-rsound disable RSound audio output [autodetect]
397 --disable-pulse disable Pulseaudio audio output [autodetect]
398 --disable-portaudio disable PortAudio audio output [autodetect]
399 --disable-jack disable JACK audio output [autodetect]
400 --enable-openal enable OpenAL audio output [disable]
401 --disable-coreaudio disable CoreAudio audio output [autodetect]
402 --disable-select disable using select() on the audio device [enable]
405 --enable-translation enable support for translated output [disable]
406 --charset=charset convert the console messages to this character set
407 --language-doc=lang language to use for the documentation [en]
408 --language-man=lang language to use for the man pages [en]
409 --language-msg=lang extra languages for program messages [all]
410 --language=lang default language to use [en]
411 Specific options override --language. You can pass a list of languages separated
412 by whitespace or commas instead of a single language. Nonexisting translations
413 will be dropped from each list. All translations available in the list will be
414 installed. The value "all" will activate all translations. The LINGUAS
415 environment variable is honored. In all cases the fallback is English.
416 The program always supports English-language output; additional message
417 languages are only installed if --enable-translation is also specified.
418 Available values for --language-doc are: all $doc_lang_all
419 Available values for --language-man are: all $man_lang_all
420 Available values for --language-msg are: all $msg_lang_all
422 Miscellaneous options:
423 --enable-runtime-cpudetection enable runtime CPU detection [disable]
424 --enable-cross-compile enable cross-compilation [disable]
425 --cc=COMPILER C compiler to build MPlayer [gcc]
426 --pkg-config=PKGCONFIG pkg-config to find some libraries [pkg-config]
427 --windres=WINDRES windres to build MPlayer [windres]
428 --target=PLATFORM target platform (i386-linux, arm-linux, etc)
429 --enable-static build a statically linked binary
430 --with-install=PATH path to a custom install program
433 --enable-mmx enable MMX [autodetect]
434 --enable-mmxext enable MMX2 (Pentium III, Athlon) [autodetect]
435 --enable-3dnow enable 3DNow! [autodetect]
436 --enable-3dnowext enable extended 3DNow! [autodetect]
437 --enable-sse enable SSE [autodetect]
438 --enable-sse2 enable SSE2 [autodetect]
439 --enable-ssse3 enable SSSE3 [autodetect]
440 --enable-shm enable shm [autodetect]
441 --enable-altivec enable AltiVec (PowerPC) [autodetect]
442 --enable-armv5te enable DSP extensions (ARM) [autodetect]
443 --enable-armv6 enable ARMv6 (ARM) [autodetect]
444 --enable-armv6t2 enable ARMv6t2 (ARM) [autodetect]
445 --enable-armvfp enable ARM VFP (ARM) [autodetect]
446 --enable-neon enable NEON (ARM) [autodetect]
447 --enable-iwmmxt enable iWMMXt (ARM) [autodetect]
448 --disable-fastmemcpy disable 3DNow!/SSE/MMX optimized memcpy [enable]
449 --enable-big-endian force byte order to big-endian [autodetect]
450 --enable-debug[=1-3] compile-in debugging information [disable]
451 --enable-profile compile-in profiling information [disable]
452 --disable-sighandler disable sighandler for crashes [enable]
453 --enable-crash-debug enable automatic gdb attach on crash [disable]
455 Use these options if autodetection fails:
456 --extra-cflags=FLAGS extra CFLAGS
457 --extra-ldflags=FLAGS extra LDFLAGS
458 --extra-libs=FLAGS extra linker flags
459 --extra-libs-mplayer=FLAGS extra linker flags for MPlayer
461 --with-sdl-config=PATH path to sdl*-config
462 --with-dvdnav-config=PATH path to dvdnav-config
463 --with-dvdread-config=PATH path to dvdread-config
465 This configure script is NOT autoconf-based, even though its output is similar.
466 It will try to autodetect all configuration options. If you --enable an option
467 it will be forcefully turned on, skipping autodetection. This can break
468 compilation, so you need to know what you are doing.
473 # GOTCHA: the variables below defines the default behavior for autodetection
474 # and have - unless stated otherwise - at least 2 states : yes no
475 # If autodetection is available then the third state is: auto
497 test "$CC" && _cc
="$CC"
499 _runtime_cpudetection
=no
547 _dvdnavconfig
=dvdnav-config
548 _dvdreadconfig
=dvdread-config
550 _dvdread_internal
=auto
551 _libdvdcss_internal
=auto
620 def_dos_paths
="#define HAVE_DOS_PATHS 0"
621 def_stream_cache
="#define CONFIG_STREAM_CACHE 1"
622 def_priority
="#undef CONFIG_PRIORITY"
623 def_pthread_cache
="#undef PTHREAD_CACHE"
631 _prefix
=$
(echo $ac_option | cut
-d '=' -f 2)
634 _bindir
=$
(echo $ac_option | cut
-d '=' -f 2)
637 _mandir
=$
(echo $ac_option | cut
-d '=' -f 2)
640 _confdir
=$
(echo $ac_option | cut
-d '=' -f 2)
643 _libdir
=$
(echo $ac_option | cut
-d '=' -f 2)
646 _codecsdir
=$
(echo $ac_option | cut
-d '=' -f 2)
649 _localedir
=$
(echo $ac_option | cut
-d '=' -f 2)
653 _install
=$
(echo $ac_option | cut
-d '=' -f 2 )
657 _sdlconfig
=$
(echo $ac_option | cut
-d '=' -f 2)
659 --with-dvdnav-config=*)
660 _dvdnavconfig
=$
(echo $ac_option | cut
-d '=' -f 2)
662 --with-dvdread-config=*)
663 _dvdreadconfig
=$
(echo $ac_option | cut
-d '=' -f 2)
667 extra_cflags
="$extra_cflags $(echo $ac_option | cut -d '=' -f 2-)"
670 extra_ldflags
="$extra_ldflags $(echo $ac_option | cut -d '=' -f 2-)"
673 extra_libs
=$
(echo $ac_option | cut
-d '=' -f 2)
675 --extra-libs-mplayer=*)
676 libs_mplayer
=$
(echo $ac_option | cut
-d '=' -f 2)
680 _target
=$
(echo $ac_option | cut
-d '=' -f 2)
683 _cc
=$
(echo $ac_option | cut
-d '=' -f 2)
686 _pkg_config
=$
(echo $ac_option | cut
-d '=' -f 2)
689 _windres
=$
(echo $ac_option | cut
-d '=' -f 2)
692 _charset
=$
(echo $ac_option | cut
-d '=' -f 2)
695 language_doc
=$
(echo $ac_option | cut
-d '=' -f 2)
698 language_man
=$
(echo $ac_option | cut
-d '=' -f 2)
701 language_msg
=$
(echo $ac_option | cut
-d '=' -f 2)
704 language
=$
(echo $ac_option | cut
-d '=' -f 2)
723 _debug
=$
(echo $_echo_n '-g'$_echo_c; echo $ac_option | cut
-d '=' -f 2)
728 --enable-translation) _translation
=yes ;;
729 --disable-translation) _translation
=no
;;
730 --enable-runtime-cpudetection) _runtime_cpudetection
=yes ;;
731 --disable-runtime-cpudetection) _runtime_cpudetection
=no
;;
732 --enable-cross-compile) _cross_compile
=yes ;;
733 --disable-cross-compile) _cross_compile
=no
;;
734 --enable-x11) _x11
=yes ;;
735 --disable-x11) _x11
=no
;;
736 --enable-xss) _xss
=yes ;;
737 --disable-xss) _xss
=no
;;
738 --enable-xv) _xv
=yes ;;
739 --disable-xv) _xv
=no
;;
740 --enable-vdpau) _vdpau
=yes ;;
741 --disable-vdpau) _vdpau
=no
;;
742 --enable-sdl) _sdl
=yes ;;
743 --disable-sdl) _sdl
=no
;;
744 --enable-direct3d) _direct3d
=yes ;;
745 --disable-direct3d) _direct3d
=no
;;
746 --enable-directx) _directx
=yes ;;
747 --disable-directx) _directx
=no
;;
748 --enable-png) _png
=yes ;;
749 --disable-png) _png
=no
;;
750 --enable-mng) _mng
=yes ;;
751 --disable-mng) _mng
=no
;;
752 --enable-jpeg) _jpeg
=yes ;;
753 --disable-jpeg) _jpeg
=no
;;
754 --enable-pnm) _pnm
=yes ;;
755 --disable-pnm) _pnm
=no
;;
756 --enable-md5sum) _md5sum
=yes ;;
757 --disable-md5sum) _md5sum
=no
;;
758 --enable-yuv4mpeg) _yuv4mpeg
=yes ;;
759 --disable-yuv4mpeg) _yuv4mpeg
=no
;;
760 --enable-gif) _gif
=yes ;;
761 --disable-gif) _gif
=no
;;
762 --enable-gl) _gl
=yes ;;
763 --disable-gl) _gl
=no
;;
764 --enable-caca) _caca
=yes ;;
765 --disable-caca) _caca
=no
;;
766 --enable-dvb) _dvb
=yes ;;
767 --disable-dvb) _dvb
=no
;;
768 --enable-v4l2) _v4l2
=yes ;;
769 --disable-v4l2) _v4l2
=no
;;
770 --enable-iconv) _iconv
=yes ;;
771 --disable-iconv) _iconv
=no
;;
772 --enable-langinfo) _langinfo
=yes ;;
773 --disable-langinfo) _langinfo
=no
;;
774 --enable-rtc) _rtc
=yes ;;
775 --disable-rtc) _rtc
=no
;;
776 --enable-libdv) _libdv
=yes ;;
777 --disable-libdv) _libdv
=no
;;
778 --enable-ossaudio) _ossaudio
=yes ;;
779 --disable-ossaudio) _ossaudio
=no
;;
780 --enable-rsound) _rsound
=yes ;;
781 --disable-rsound) _rsound
=no
;;
782 --enable-pulse) _pulse
=yes ;;
783 --disable-pulse) _pulse
=no
;;
784 --enable-portaudio) _portaudio
=yes ;;
785 --disable-portaudio) _portaudio
=no
;;
786 --enable-jack) _jack
=yes ;;
787 --disable-jack) _jack
=no
;;
788 --enable-openal) _openal
=yes ;;
789 --disable-openal) _openal
=no
;;
790 --enable-mad) _mad
=yes ;;
791 --disable-mad) _mad
=no
;;
792 --enable-libcdio) _libcdio
=yes ;;
793 --disable-libcdio) _libcdio
=no
;;
794 --enable-libvorbis) _libvorbis
=yes ;;
795 --disable-libvorbis) _libvorbis
=no
;;
796 --enable-speex) _speex
=yes ;;
797 --disable-speex) _speex
=no
;;
798 --enable-tremor) _tremor
=yes ;;
799 --disable-tremor) _tremor
=no
;;
800 --enable-theora) _theora
=yes ;;
801 --disable-theora) _theora
=no
;;
802 --enable-mpg123) _mpg123
=yes ;;
803 --disable-mpg123) _mpg123
=no
;;
804 --enable-liba52) _liba52
=yes ;;
805 --disable-liba52) _liba52
=no
;;
806 --enable-libdca) _libdca
=yes ;;
807 --disable-libdca) _libdca
=no
;;
808 --enable-musepack) _musepack
=yes ;;
809 --disable-musepack) _musepack
=no
;;
810 --enable-faad) _faad
=yes ;;
811 --disable-faad) _faad
=no
;;
812 --enable-ladspa) _ladspa
=yes ;;
813 --disable-ladspa) _ladspa
=no
;;
814 --enable-libbs2b) _libbs2b
=yes ;;
815 --disable-libbs2b) _libbs2b
=no
;;
816 --enable-xmms) _xmms
=yes ;;
817 --disable-xmms) _xmms
=no
;;
818 --enable-vcd) _vcd
=yes ;;
819 --disable-vcd) _vcd
=no
;;
820 --enable-bluray) _bluray
=yes ;;
821 --disable-bluray) _bluray
=no
;;
822 --enable-dvdread) _dvdread
=yes ;;
823 --disable-dvdread) _dvdread
=no
;;
824 --enable-dvdread-internal) _dvdread_internal
=yes ;;
825 --disable-dvdread-internal) _dvdread_internal
=no
;;
826 --enable-libdvdcss-internal) _libdvdcss_internal
=yes ;;
827 --disable-libdvdcss-internal) _libdvdcss_internal
=no
;;
828 --enable-dvdnav) _dvdnav
=yes ;;
829 --disable-dvdnav) _dvdnav
=no
;;
830 --enable-xanim) _xanim
=yes ;;
831 --disable-xanim) _xanim
=no
;;
832 --enable-real) _real
=yes ;;
833 --disable-real) _real
=no
;;
834 --enable-lcms2) _lcms2
=yes ;;
835 --disable-lcms2) _lcms2
=no
;;
836 --enable-xinerama) _xinerama
=yes ;;
837 --disable-xinerama) _xinerama
=no
;;
838 --enable-vm) _vm
=yes ;;
839 --disable-vm) _vm
=no
;;
840 --enable-xf86keysym) _xf86keysym
=yes ;;
841 --disable-xf86keysym) _xf86keysym
=no
;;
842 --enable-alsa) _alsa
=yes ;;
843 --disable-alsa) _alsa
=no
;;
844 --enable-tv) _tv
=yes ;;
845 --disable-tv) _tv
=no
;;
846 --enable-tv-bsdbt848) _tv_bsdbt848
=yes ;;
847 --disable-tv-bsdbt848) _tv_bsdbt848
=no
;;
848 --enable-tv-v4l2) _tv_v4l2
=yes ;;
849 --disable-tv-v4l2) _tv_v4l2
=no
;;
850 --enable-tv-dshow) _tv_dshow
=yes ;;
851 --disable-tv-dshow) _tv_dshow
=no
;;
852 --enable-radio) _radio
=yes ;;
853 --enable-radio-capture) _radio_capture
=yes ;;
854 --disable-radio-capture) _radio_capture
=no
;;
855 --disable-radio) _radio
=no
;;
856 --enable-radio-v4l2) _radio_v4l2
=yes ;;
857 --disable-radio-v4l2) _radio_v4l2
=no
;;
858 --enable-radio-bsdbt848) _radio_bsdbt848
=yes ;;
859 --disable-radio-bsdbt848) _radio_bsdbt848
=no
;;
860 --enable-pvr) _pvr
=yes ;;
861 --disable-pvr) _pvr
=no
;;
862 --enable-fastmemcpy) _fastmemcpy
=yes ;;
863 --disable-fastmemcpy) _fastmemcpy
=no
;;
864 --enable-networking) networking
=yes ;;
865 --disable-networking) networking
=no
;;
866 --enable-winsock2_h) _winsock2_h
=yes ;;
867 --disable-winsock2_h) _winsock2_h
=no
;;
868 --enable-smb) _smb
=yes ;;
869 --disable-smb) _smb
=no
;;
870 --enable-libquvi) _libquvi
=yes ;;
871 --disable-libquvi) _libquvi
=no
;;
872 --enable-joystick) _joystick
=yes ;;
873 --disable-joystick) _joystick
=no
;;
874 --enable-xvid) _xvid
=yes ;;
875 --disable-xvid) _xvid
=no
;;
876 --enable-libnut) _libnut
=yes ;;
877 --disable-libnut) _libnut
=no
;;
878 --enable-libav) ffmpeg
=yes ;;
880 --enable-lirc) _lirc
=yes ;;
881 --disable-lirc) _lirc
=no
;;
882 --enable-lircc) _lircc
=yes ;;
883 --disable-lircc) _lircc
=no
;;
884 --enable-apple-remote) _apple_remote
=yes ;;
885 --disable-apple-remote) _apple_remote
=no
;;
886 --enable-apple-ir) _apple_ir
=yes ;;
887 --disable-apple-ir) _apple_ir
=no
;;
888 --enable-termcap) _termcap
=yes ;;
889 --disable-termcap) _termcap
=no
;;
890 --enable-termios) _termios
=yes ;;
891 --disable-termios) _termios
=no
;;
892 --disable-tga) _tga
=no
;;
893 --enable-tga) _tga
=yes ;;
894 --enable-directfb) _directfb
=yes ;;
895 --disable-directfb) _directfb
=no
;;
896 --enable-shm) _shm
=yes ;;
897 --disable-shm) _shm
=no
;;
898 --enable-select) _select
=yes ;;
899 --disable-select) _select
=no
;;
900 --enable-cddb) _cddb
=yes ;;
901 --disable-cddb) _cddb
=no
;;
902 --enable-big-endian) _big_endian
=yes ;;
903 --disable-big-endian) _big_endian
=no
;;
904 --enable-unrarexec) _unrar_exec
=yes ;;
905 --disable-unrarexec) _unrar_exec
=no
;;
906 --enable-ftp) _ftp
=yes ;;
907 --disable-ftp) _ftp
=no
;;
908 --enable-vstream) _vstream
=yes ;;
909 --disable-vstream) _vstream
=no
;;
910 --enable-pthreads) _pthreads
=yes ;;
911 --disable-pthreads) _pthreads
=no
;;
912 --enable-w32threads) _w32threads
=yes ;;
913 --disable-w32threads) _w32threads
=no
;;
914 --enable-libass) _ass
=yes ;;
915 --disable-libass) _ass
=no
;;
916 --enable-rpath) _rpath
=yes ;;
917 --disable-rpath) _rpath
=no
;;
918 --enable-libpostproc) libpostproc
=yes ;;
919 --disable-libpostproc) libpostproc
=no
;;
920 --enable-libavresample) libavresample
=yes ;;
921 --disable-libavresample) libavresample
=no
;;
923 --enable-enca) _enca
=yes ;;
924 --disable-enca) _enca
=no
;;
926 --enable-inet6) _inet6
=yes ;;
927 --disable-inet6) _inet6
=no
;;
929 --enable-gethostbyname2) _gethostbyname2
=yes ;;
930 --disable-gethostbyname2) _gethostbyname2
=no
;;
932 --enable-qtx) _qtx
=yes ;;
933 --disable-qtx) _qtx
=no
;;
935 --enable-coreaudio) _coreaudio
=yes ;;
936 --disable-coreaudio) _coreaudio
=no
;;
937 --enable-corevideo) _corevideo
=yes ;;
938 --disable-corevideo) _corevideo
=no
;;
939 --enable-cocoa) _cocoa
=yes ;;
940 --disable-cocoa) _cocoa
=no
;;
941 --enable-sharedbuffer) _sharedbuffer
=yes ;;
942 --disable-sharedbuffer) _sharedbuffer
=no
;;
943 --enable-macosx-finder) _macosx_finder
=yes ;;
944 --disable-macosx-finder) _macosx_finder
=no
;;
945 --enable-macosx-bundle) _macosx_bundle
=yes ;;
946 --disable-macosx-bundle) _macosx_bundle
=no
;;
948 --enable-crash-debug) _crash_debug
=yes ;;
949 --disable-crash-debug) _crash_debug
=no
;;
950 --enable-sighandler) _sighandler
=yes ;;
951 --disable-sighandler) _sighandler
=no
;;
952 --enable-win32dll) _win32dll
=yes ;;
953 --disable-win32dll) _win32dll
=no
;;
955 --enable-sse) _sse
=yes ;;
956 --disable-sse) _sse
=no
;;
957 --enable-sse2) _sse2
=yes ;;
958 --disable-sse2) _sse2
=no
;;
959 --enable-ssse3) _ssse3
=yes ;;
960 --disable-ssse3) _ssse3
=no
;;
961 --enable-mmxext) _mmxext
=yes ;;
962 --disable-mmxext) _mmxext
=no
;;
963 --enable-3dnow) _3dnow
=yes ;;
964 --disable-3dnow) _3dnow
=no _3dnowext
=no
;;
965 --enable-3dnowext) _3dnow
=yes _3dnowext
=yes ;;
966 --disable-3dnowext) _3dnowext
=no
;;
967 --enable-cmov) _cmov
=yes ;;
968 --disable-cmov) _cmov
=no
;;
969 --enable-fast-cmov) _fast_cmov
=yes ;;
970 --disable-fast-cmov) _fast_cmov
=no
;;
971 --enable-fast-clz) _fast_clz
=yes ;;
972 --disable-fast-clz) _fast_clz
=no
;;
973 --enable-altivec) _altivec
=yes ;;
974 --disable-altivec) _altivec
=no
;;
975 --enable-armv5te) _armv5te
=yes ;;
976 --disable-armv5te) _armv5te
=no
;;
977 --enable-armv6) _armv6
=yes ;;
978 --disable-armv6) _armv6
=no
;;
979 --enable-armv6t2) _armv6t2
=yes ;;
980 --disable-armv6t2) _armv6t2
=no
;;
981 --enable-armvfp) _armvfp
=yes ;;
982 --disable-armvfp) _armvfp
=no
;;
983 --enable-neon) neon
=yes ;;
984 --disable-neon) neon
=no
;;
985 --enable-iwmmxt) _iwmmxt
=yes ;;
986 --disable-iwmmxt) _iwmmxt
=no
;;
987 --enable-mmx) _mmx
=yes ;;
988 --disable-mmx) # 3Dnow! and MMX2 require MMX
989 _3dnow
=no _3dnowext
=no _mmx
=no _mmxext
=no
;;
992 echo "Unknown parameter: $ac_option" >&2
999 # Atmos: moved this here, to be correct, if --prefix is specified
1000 test -z "$_bindir" && _bindir
="$_prefix/bin"
1001 test -z "$_mandir" && _mandir
="$_prefix/share/man"
1002 test -z "$_confdir" && _confdir
="$_prefix/etc/mplayer"
1003 test -z "$_libdir" && _libdir
="$_prefix/lib"
1004 test -z "$_localedir" && _localedir
="$_prefix/share/locale"
1006 for tmpdir
in "$TMPDIR" "$TEMPDIR" "/tmp" ; do
1007 test "$tmpdir" && break
1010 mplayer_tmpdir
="$tmpdir/mplayer-configure-$RANDOM-$$"
1011 mkdir
$mplayer_tmpdir || die
"Unable to create tmpdir."
1016 echo Parameters configure was run with
: > "$TMPLOG"
1017 if test -n "$CFLAGS" ; then
1018 echo ${_echo_n} CFLAGS
="'$CFLAGS' ${_echo_c}" >> "$TMPLOG"
1020 if test -n "$PKG_CONFIG_PATH" ; then
1021 echo ${_echo_n} PKG_CONFIG_PATH
="'$PKG_CONFIG_PATH' ${_echo_c}" >> "$TMPLOG"
1023 echo .
/configure
$configuration >> "$TMPLOG"
1027 echocheck
"cross compilation"
1028 echores
$_cross_compile
1030 if test $_cross_compile = yes; then
1038 if test $_cross_compile = yes ; then
1039 # Usually cross-compiler prefixes match with the target triplet
1040 test -n "$_target" && tool_prefix
="$_target"-
1043 test "$_windres" = auto
&& _windres
="$tool_prefix"windres
1044 test "$_pkg_config" = auto
&& _pkg_config
="$tool_prefix"pkg-config
1046 if test "$_cc" = auto
; then
1047 if test -n "$tool_prefix" ; then
1048 _cc
="$tool_prefix"gcc
1054 # Determine our OS name and CPU architecture
1055 if test -z "$_target" ; then
1057 system_name
=$
(uname
-s 2>&1)
1058 case "$system_name" in
1059 Linux|FreeBSD|NetBSD|OpenBSD|DragonFly|BSD
/OS|Darwin|QNX|GNU|BeOS|MorphOS|AIX|AmigaOS
)
1070 [cC
][yY
][gG
][wW
][iI
][nN
]*)
1080 system_name
="$system_name-UNKNOWN"
1085 # host's CPU/instruction set
1086 host_arch
=$
(uname
-p 2>&1)
1087 case "$host_arch" in
1088 i386|sparc|ppc|alpha|arm|mips|vax
)
1090 powerpc
) # Darwin returns 'powerpc'
1093 *) # uname -p on Linux returns 'unknown' for the processor type,
1094 # OpenBSD returns 'Intel Pentium/MMX ("Genuine Intel" 586-class)'
1096 # Maybe uname -m (machine hardware name) returns something we
1099 # x86/x86pc is used by QNX
1100 case "$(uname -m 2>&1)" in
1101 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
;;
1102 ia64
) host_arch
=ia64
;;
1103 macppc|ppc
) host_arch
=ppc
;;
1104 ppc64
) host_arch
=ppc64
;;
1105 alpha
) host_arch
=alpha
;;
1106 sparc
) host_arch
=sparc
;;
1107 sparc64
) host_arch
=sparc64
;;
1108 parisc
*|hppa
*|
9000*) host_arch
=hppa
;;
1109 arm
*|zaurus|cats
) host_arch
=arm
;;
1110 sh3|sh4|sh4a
) host_arch
=sh
;;
1111 s390
) host_arch
=s390
;;
1112 s390x
) host_arch
=s390x
;;
1113 *mips
*) host_arch
=mips
;;
1114 vax
) host_arch
=vax
;;
1115 xtensa
*) host_arch
=xtensa
;;
1116 *) host_arch
=UNKNOWN
;;
1120 else # if test -z "$_target"
1122 system_name
=$
(echo $_target | cut
-d '-' -f $i)
1123 case "$(echo $system_name | tr A-Z a-z)" in
1124 linux
) system_name
=Linux
;;
1125 freebsd
) system_name
=FreeBSD
;;
1126 gnu
/kfreebsd
) system_name
=FreeBSD
;;
1127 netbsd
) system_name
=NetBSD
;;
1128 bsd
/os
) system_name
=BSD
/OS
;;
1129 openbsd
) system_name
=OpenBSD
;;
1130 dragonfly
) system_name
=DragonFly
;;
1131 qnx
) system_name
=QNX
;;
1132 morphos
) system_name
=MorphOS
;;
1133 amigaos
) system_name
=AmigaOS
;;
1134 mingw32
*) system_name
=MINGW32
;;
1139 # We need to convert underscores so that values like k6-2 and pentium-mmx can be passed
1140 host_arch
=$
(echo $_target | cut
-d '-' -f 1)
1141 if test $
(echo $host_arch) != "x86_64" ; then
1142 host_arch
=$
(echo $host_arch |
tr '_' '-')
1146 extra_cflags
="-I. $extra_cflags"
1147 _timer
=timer-linux.c
1150 extra_ldflags
="$extra_ldflags -L/usr/local/lib"
1151 extra_cflags
="$extra_cflags -I/usr/local/include"
1154 if netbsd || dragonfly
; then
1155 extra_ldflags
="$extra_ldflags -L/usr/pkg/lib"
1156 extra_cflags
="$extra_cflags -I/usr/pkg/include"
1160 extra_cflags
="-mdynamic-no-pic $extra_cflags"
1161 _timer
=timer-darwin.c
1165 extra_ldflags
="$extra_ldflags -lC"
1170 extra_cflags
="$extra_cflags -fno-common"
1171 # -lwinmm is always needed for osdep/timer-win2.c
1172 extra_ldflags
="$extra_ldflags -lwinmm"
1176 def_dos_paths
="#define HAVE_DOS_PATHS 1"
1177 def_priority
="#define CONFIG_PRIORITY 1"
1183 extra_cflags
="$extra_cflags -D__USE_MINGW_ANSI_STDIO=1"
1190 def_stream_cache
="#undef CONFIG_STREAM_CACHE"
1191 extra_cflags
="-DNEWLIB -D__USE_INLINE__ $extra_cflags"
1195 extra_ldflags
="$extra_ldflags -lph"
1198 TMPC
="$mplayer_tmpdir/tmp.c"
1199 TMPEXE
="$mplayer_tmpdir/tmp$_exesuf"
1200 TMPH
="$mplayer_tmpdir/tmp.h"
1201 TMPS
="$mplayer_tmpdir/tmp.S"
1203 if test "$_runtime_cpudetection" = yes && ! x86
&& ! ppc
; then
1204 die
"Runtime CPU detection only works for x86, x86-64 and PPC!"
1208 if [ -f "$(which rst2man.py)" ] ; then
1212 # Checking CC version...
1213 # Intel C++ Compilers (no autoselect, use CC=/some/binary ./configure)
1214 if test "$(basename $_cc)" = "icc" ||
test "$(basename $_cc)" = "ecc"; then
1215 echocheck
"$_cc version"
1217 cc_name
=$
($_cc -V 2>&1 |
head -n 1 | cut
-d ',' -f 1)
1218 cc_version
=$
($_cc -V 2>&1 |
head -n 1 | cut
-d ',' -f 2 | cut
-d ' ' -f 3)
1219 _cc_major
=$
(echo $cc_version | cut
-d '.' -f 1)
1220 _cc_minor
=$
(echo $cc_version | cut
-d '.' -f 2)
1221 # TODO verify older icc/ecc compatibility
1224 cc_version
="v. ?.??, bad"
1228 cc_version
="$cc_version, ok"
1231 cc_version
="$cc_version, bad"
1235 echores
"$cc_version"
1237 for _cc
in "$_cc" gcc cc
; do
1238 cc_name_tmp
=$
($_cc -v 2>&1 |
tail -n 1 | cut
-d ' ' -f 1)
1239 if test "$cc_name_tmp" = "gcc"; then
1240 cc_name
=$cc_name_tmp
1241 echocheck
"$_cc version"
1243 cc_version
=$
($_cc -dumpversion 2>&1)
1249 _cc_major
=$
(echo $cc_version | cut
-d '.' -f 1)
1250 _cc_minor
=$
(echo $cc_version | cut
-d '.' -f 2)
1251 _cc_mini
=$
(echo $cc_version | cut
-d '.' -f 3)
1254 echores
"$cc_version"
1257 if $_cc -v 2>&1 |
grep -q "clang"; then
1258 echocheck
"$_cc version"
1260 cc_version
=$
($_cc -dumpversion 2>&1)
1261 res_comment
="experimental support only"
1262 echores
"clang $cc_version"
1265 cc_name_tmp
=$
($_cc -V 2>&1 |
head -n 1 | cut
-d ' ' -f 2,3)
1268 test "$cc_fail" = yes && die
"unsupported compiler version"
1270 echocheck
"working compiler"
1271 cflag_check
"" || die
"Compiler is not functioning correctly. Check your installation and custom CFLAGS $CFLAGS ."
1274 if test -z "$_target" && x86
; then
1277 int test[(int)sizeof(char *)-7];
1281 cc_check
&& host_arch
=x86_64 || host_arch
=i386
1284 echo "Detected operating system: $system_name"
1285 echo "Detected host architecture: $host_arch"
1289 # XXX: this should be ok..
1292 if test "$_runtime_cpudetection" = no
; then
1294 # Cygwin has /proc/cpuinfo, but only supports Intel CPUs
1295 # FIXME: Remove the cygwin check once AMD CPUs are supported
1296 if test -r /proc
/cpuinfo
&& ! cygwin
; then
1297 # Linux with /proc mounted, extract CPU information from it
1298 _cpuinfo
="cat /proc/cpuinfo"
1299 elif test -r /compat
/linux
/proc
/cpuinfo
&& ! x86
; then
1300 # FreeBSD with Linux emulation /proc mounted,
1301 # extract CPU information from it
1302 # Don't use it on x86 though, it never reports 3Dnow
1303 _cpuinfo
="cat /compat/linux/proc/cpuinfo"
1304 elif darwin
&& ! x86
; then
1305 # use hostinfo on Darwin
1308 # use 'lsattr' on AIX
1309 _cpuinfo
="lsattr -E -l proc0 -a type"
1311 # all other OSes try to extract CPU information from a small helper
1312 # program cpuinfo instead
1313 $_cc -o cpuinfo
$_exesuf cpuinfo.c
1314 _cpuinfo
="./cpuinfo$_exesuf"
1318 # gather more CPU information
1319 pname
=$
($_cpuinfo |
grep 'model name' | cut
-d ':' -f 2 |
head -n 1)
1320 pvendor
=$
($_cpuinfo |
grep 'vendor_id' | cut
-d ':' -f 2 | cut
-d ' ' -f 2 |
head -n 1)
1321 pfamily
=$
($_cpuinfo |
grep 'cpu family' | cut
-d ':' -f 2 | cut
-d ' ' -f 2 |
head -n 1)
1322 pmodel
=$
($_cpuinfo |
grep -v 'model name' |
grep 'model' | cut
-d ':' -f 2 | cut
-d ' ' -f 2 |
head -n 1)
1323 pstepping
=$
($_cpuinfo |
grep 'stepping' | cut
-d ':' -f 2 | cut
-d ' ' -f 2 |
head -n 1)
1325 exts
=$
($_cpuinfo |
egrep 'features|flags' | cut
-d ':' -f 2 |
head -n 1)
1327 pparam
=$
(echo $exts |
sed -e s
/xmm
/sse
/ -e s
/kni
/sse
/)
1328 # SSE implies MMX2, but not all SSE processors report the mmxext CPU flag.
1329 pparam
=$
(echo $pparam |
sed -e 's/sse/sse mmxext/')
1331 for ext
in $pparam ; do
1332 eval test \"\
$_$ext\" = auto
2>/dev
/null
&& eval _
$ext=kernel_check
1335 echocheck
"CPU vendor"
1336 echores
"$pvendor ($pfamily:$pmodel:$pstepping)"
1338 echocheck
"CPU type"
1342 fi # test "$_runtime_cpudetection" = no
1344 if x86
&& test "$_runtime_cpudetection" = no
; then
1346 if test "$1" = kernel_check
; then
1347 echocheck
"kernel support of $2"
1351 static void catch(int sig) { exit(1); }
1353 signal(SIGILL, catch);
1354 __asm__ volatile ("$3":::"memory"); return 0;
1358 if cc_check
&& tmp_run
; then
1361 _optimizing
="$_optimizing $2"
1366 echo "It seems that your kernel does not correctly support $2."
1367 echo "To use $2 extensions in MPlayer, you have to upgrade/recompile your kernel!"
1374 extcheck
$_mmx "mmx" "emms"
1375 extcheck
$_mmxext "mmxext" "sfence"
1376 extcheck
$_3dnow "3dnow" "femms"
1377 extcheck
$_3dnowext "3dnowext" "pswapd %%mm0, %%mm0"
1378 extcheck
$_sse "sse" "xorps %%xmm0, %%xmm0" || _gcc3_ext
="$_gcc3_ext -mno-sse"
1379 extcheck
$_sse2 "sse2" "xorpd %%xmm0, %%xmm0" || _gcc3_ext
="$_gcc3_ext -mno-sse2"
1380 extcheck
$_ssse3 "ssse3" "pabsd %%xmm0, %%xmm0"
1381 extcheck
$_cmov "cmov" "cmovb %%eax, %%ebx"
1383 if test "$_gcc3_ext" != ""; then
1384 # if we had to disable sse/sse2 because the active kernel does not
1385 # support this instruction set extension, we also have to tell
1386 # gcc3 to not generate sse/sse2 instructions for normal C code
1387 cflag_check
$_march $_gcc3_ext && _march
="$_march $_gcc3_ext"
1393 def_fast_64bit
='#define HAVE_FAST_64BIT 0'
1394 def_fast_unaligned
='#define HAVE_FAST_UNALIGNED 0'
1395 arch_all
='X86 IA64 SPARC ARM AVR32 SH4 PPC ALPHA MIPS PA_RISC S390 S390X VAX BFIN XTENSA TOMI GENERIC'
1396 subarch_all
='X86_32 X86_64 PPC64'
1397 case "$host_arch" in
1398 i
[3-9]86|x86|x86pc|k5|k6|k6-2|k6-3|pentium
*|athlon
*|i586-i686
)
1401 def_fast_unaligned
='#define HAVE_FAST_UNALIGNED 1'
1406 if test "$_runtime_cpudetection" = no
; then
1410 3) proc
=i386 iproc
=386 ;;
1411 4) proc
=i486 iproc
=486 ;;
1412 5) iproc
=586 # LGB: models are: K5/SSA5 K5 K5 K5 ? ? K6 K6 K6-2 K6-3
1413 # K6 model 13 are the K6-2+ and K6-III+, only differing in cache size.
1414 if test "$pmodel" -eq 9 -o "$pmodel" -eq 13; then
1416 elif test "$pmodel" -eq 5 -o "$pmodel" -eq 10; then
1418 elif test "$pmodel" -ge 8; then
1420 elif test "$pmodel" -ge 6; then
1427 # It's a bit difficult to determine the correct type of Family 6
1428 # AMD CPUs just from their signature. Instead, we check directly
1429 # whether it supports SSE.
1430 if test "$_sse" = yes; then
1431 # gcc treats athlon-xp, athlon-4 and athlon-mp similarly.
1434 # Again, gcc treats athlon and athlon-tbird similarly.
1439 # k8 cpu-type only supported in gcc >= 3.4.0, but that will be
1440 # caught and remedied in the optimization tests below.
1444 *) proc
=amdfam10 iproc
=686
1445 test $_fast_clz = "auto" && _fast_clz
=yes
1451 3) proc
=i386 iproc
=386 ;;
1452 4) proc
=i486 iproc
=486 ;;
1454 if test "$pmodel" -eq 4 ||
test "$pmodel" -eq 8; then
1455 proc
=pentium-mmx
# 4 is desktop, 8 is mobile
1461 if test "$pmodel" -ge 15; then
1463 elif test "$pmodel" -eq 9 -o "$pmodel" -ge 13; then
1465 elif test "$pmodel" -ge 7; then
1467 elif test "$pmodel" -ge 3; then
1472 test $_fast_clz = "auto" && _fast_clz
=yes
1475 # A nocona in 32-bit mode has no more capabilities than a prescott.
1476 if test "$pmodel" -ge 3; then
1480 test $_fast_clz = "auto" && _fast_clz
=yes
1482 test $_fast_cmov = "auto" && _fast_cmov
=no
1484 *) proc
=prescott iproc
=686 ;;
1490 if test "$pmodel" -ge 8; then
1492 elif test "$pmodel" -ge 4; then
1499 if test "$pmodel" -ge 9; then
1506 *) proc
=i686 iproc
=i686
;;
1511 3) proc
=i386 iproc
=386 ;;
1512 4) proc
=i486 iproc
=486 ;;
1513 *) proc
=i586 iproc
=586 ;;
1517 proc
=i586 iproc
=586 ;;
1519 test $_fast_clz = "auto" && _fast_clz
=no
1520 fi # test "$_runtime_cpudetection" = no
1523 # check that gcc supports our CPU, if not, fall back to earlier ones
1524 # LGB: check -mcpu and -march swithing step by step with enabling
1525 # to fall back till 386.
1527 # gcc >= 3.4.0 doesn't support -mcpu, we have to use -mtune instead
1529 if [ "$cc_vendor" = "gnu" ] && ([ "$_cc_major" -gt 3 ] ||
( [ "$_cc_major" = 3 ] && [ "$_cc_minor" -ge 4 ])) ; then
1535 echocheck
"GCC & CPU optimization abilities"
1536 if test "$_runtime_cpudetection" = no
; then
1537 if test $cc_vendor != "intel" && test $cc_vendor != "clang" ; then
1538 cflag_check
-march=native
&& proc
=native
1540 if test "$proc" = "amdfam10"; then
1541 cflag_check
-march=$proc $cpuopt=$proc || proc
=k8
1543 if test "$proc" = "k8"; then
1544 cflag_check
-march=$proc $cpuopt=$proc || proc
=athlon-xp
1546 if test "$proc" = "athlon-xp"; then
1547 cflag_check
-march=$proc $cpuopt=$proc || proc
=athlon
1549 if test "$proc" = "k6-3" ||
test "$proc" = "k6-2"; then
1550 cflag_check
-march=$proc $cpuopt=$proc || proc
=k6
1552 if test "$proc" = "k6" ||
test "$proc" = "c3"; then
1553 if ! cflag_check
-march=$proc $cpuopt=$proc; then
1554 if cflag_check
-march=i586
$cpuopt=i686
; then
1561 if test "$proc" = "prescott" ; then
1562 cflag_check
-march=$proc $cpuopt=$proc || proc
=pentium4
1564 if test "$proc" = "core2" ; then
1565 cflag_check
-march=$proc $cpuopt=$proc || proc
=pentium-m
1567 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
1568 cflag_check
-march=$proc $cpuopt=$proc || proc
=i686
1570 if test "$proc" = "i686" ||
test "$proc" = "pentium-mmx" ||
test "$proc" = "winchip-c6" ||
test "$proc" = "winchip2"; then
1571 cflag_check
-march=$proc $cpuopt=$proc || proc
=i586
1573 if test "$proc" = "i586"; then
1574 cflag_check
-march=$proc $cpuopt=$proc || proc
=i486
1576 if test "$proc" = "i486" ; then
1577 cflag_check
-march=$proc $cpuopt=$proc || proc
=i386
1579 if test "$proc" = "i386" ; then
1580 cflag_check
-march=$proc $cpuopt=$proc || proc
=error
1582 if test "$proc" = "error" ; then
1583 echores
"CPU optimization disabled. CPU not recognized or your compiler is too old."
1587 elif test "$proc" = "i586-i686"; then
1588 _march
="-march=i586"
1589 _mcpu
="$cpuopt=i686"
1592 _march
="-march=$proc"
1593 _mcpu
="$cpuopt=$proc"
1596 else # if test "$_runtime_cpudetection" = no
1597 _mcpu
="$cpuopt=generic"
1598 # at least i486 required, for bswap instruction
1599 _march
="-march=i486"
1600 cflag_check
$_mcpu || _mcpu
="$cpuopt=i686"
1601 cflag_check
$_mcpu || _mcpu
=""
1602 cflag_check
$_march $_mcpu || _march
=""
1605 ## Gabucino : --target takes effect here (hopefully...) by overwriting
1606 ## autodetected mcpu/march parameters
1607 if test "$_target" ; then
1608 # TODO: it may be a good idea to check GCC and fall back in all cases
1609 if test "$host_arch" = "i586-i686"; then
1610 _march
="-march=i586"
1611 _mcpu
="$cpuopt=i686"
1613 _march
="-march=$host_arch"
1614 _mcpu
="$cpuopt=$host_arch"
1622 i586|k5|k6|k6-2|k6-3|pentium|pentium-mmx
) iproc
=586 ;;
1623 i686|athlon
*|pentium
*) iproc
=686 ;;
1628 if test $_cmov = "yes" && test $_fast_cmov = "auto" ; then
1633 test $_fast_clz = "auto" && _fast_clz
=yes
1640 def_fast_64bit
='#define HAVE_FAST_64BIT 1'
1647 def_fast_unaligned
='#define HAVE_FAST_UNALIGNED 1'
1648 def_fast_64bit
='#define HAVE_FAST_64BIT 1'
1651 # gcc >= 3.4.0 doesn't support -mcpu, we have to use -mtune instead
1652 if test "$cc_vendor" = "gnu" && test "$_cc_major" -gt 3 -o "$_cc_major" -eq 3 -a "$_cc_minor" -ge 4 ; then
1657 if test "$_runtime_cpudetection" = no
; then
1662 test $_fast_clz = "auto" && _fast_clz
=no
1671 # 64-bit prescotts exist, but as far as GCC is concerned they
1672 # have the same capabilities as a nocona.
1674 test $_fast_cmov = "auto" && _fast_cmov
=no
1675 test $_fast_clz = "auto" && _fast_clz
=no
1682 fi # test "$_runtime_cpudetection" = no
1684 echocheck
"GCC & CPU optimization abilities"
1685 # This is a stripped-down version of the i386 fallback.
1686 if test "$_runtime_cpudetection" = no
; then
1687 if test $cc_vendor != "intel" && test $cc_vendor != "clang" ; then
1688 cflag_check
-march=native
&& proc
=native
1690 # --- AMD processors ---
1691 if test "$proc" = "amdfam10"; then
1692 cflag_check
-march=$proc $cpuopt=$proc || proc
=k8
1694 if test "$proc" = "k8"; then
1695 cflag_check
-march=$proc $cpuopt=$proc || proc
=athlon-xp
1697 # This will fail if gcc version < 3.3, which is ok because earlier
1698 # versions don't really support 64-bit on amd64.
1699 # Is this a valid assumption? -Corey
1700 if test "$proc" = "athlon-xp"; then
1701 cflag_check
-march=$proc $cpuopt=$proc || proc
=error
1703 # --- Intel processors ---
1704 if test "$proc" = "core2"; then
1705 cflag_check
-march=$proc $cpuopt=$proc || proc
=x86-64
1707 if test "$proc" = "x86-64"; then
1708 cflag_check
-march=$proc $cpuopt=$proc || proc
=nocona
1710 if test "$proc" = "nocona"; then
1711 cflag_check
-march=$proc $cpuopt=$proc || proc
=pentium4
1713 if test "$proc" = "pentium4"; then
1714 cflag_check
-march=$proc $cpuopt=$proc || proc
=error
1717 _march
="-march=$proc"
1718 _mcpu
="$cpuopt=$proc"
1719 if test "$proc" = "error" ; then
1720 echores
"CPU optimization disabled. CPU not recognized or your compiler is too old."
1724 else # if test "$_runtime_cpudetection" = no
1725 # x86-64 is an undocumented option, an intersection of k8 and nocona.
1726 _march
="-march=x86-64"
1727 _mcpu
="$cpuopt=generic"
1728 cflag_check
$_mcpu || _mcpu
="x86-64"
1729 cflag_check
$_mcpu || _mcpu
=""
1730 cflag_check
$_march $_mcpu || _march
=""
1734 test $_fast_cmov = "auto" && _fast_cmov
=yes
1735 test $_fast_clz = "auto" && _fast_clz
=yes
1743 if test "$host_arch" = "sparc64" ; then
1746 def_fast_64bit
='#define HAVE_FAST_64BIT 1'
1761 def_fast_unaligned
='#define HAVE_FAST_UNALIGNED 1'
1763 test $_fast_clz = "auto" && _fast_clz
=yes
1771 ppc|ppc64|powerpc|powerpc64
)
1773 def_fast_unaligned
='#define HAVE_FAST_UNALIGNED 1'
1776 if test "$host_arch" = "ppc64" -o "$host_arch" = "powerpc64" ; then
1778 def_fast_64bit
='#define HAVE_FAST_64BIT 1'
1780 echocheck
"CPU type"
1781 case $system_name in
1783 proc
=$
($_cpuinfo |
grep 'cpu' | cut
-d ':' -f 2 | cut
-d ',' -f 1 | cut
-b 2- |
head -n 1)
1784 if test -n "$($_cpuinfo | grep altivec)"; then
1785 test $_altivec = auto
&& _altivec
=yes
1789 proc
=$
($_cpuinfo |
grep "Processor type" | cut
-f 3 -d ' ' |
sed 's/ppc//')
1790 if [ $
(sysctl
-n hw.vectorunit
) -eq 1 -o \
1791 "$(sysctl -n hw.optional.altivec 2> /dev/null)" = "1" ]; then
1792 test $_altivec = auto
&& _altivec
=yes
1796 # only gcc 3.4 works reliably with AltiVec code under NetBSD
1798 2*|
3.0*|
3.1*|
3.2*|
3.3*)
1801 if [ $
(sysctl
-n machdep.altivec
) -eq 1 ]; then
1802 test $_altivec = auto
&& _altivec
=yes
1808 proc
=$
($_cpuinfo |
grep 'type' | cut
-f 2 -d ' ' |
sed 's/PowerPC_//')
1811 if test "$_altivec" = yes; then
1812 echores
"$proc altivec"
1818 echocheck
"GCC & CPU optimization abilities"
1820 if test -n "$proc"; then
1822 601) _march
='-mcpu=601' _mcpu
='-mtune=601' ;;
1823 603) _march
='-mcpu=603' _mcpu
='-mtune=603' ;;
1824 603e|
603ev
) _march
='-mcpu=603e' _mcpu
='-mtune=603e' ;;
1825 604|
604e|
604r|
604ev
) _march
='-mcpu=604' _mcpu
='-mtune=604' ;;
1826 740|
740/750|
745/755) _march
='-mcpu=740' _mcpu
='-mtune=740' ;;
1827 750|
750CX
) _march
='-mcpu=750' _mcpu
='-mtune=750' ;;
1828 POWER
) _march
='-mcpu=power' _mcpu
='-mtune=power' ;;
1829 POWER2
) _march
='-mcpu=power2' _mcpu
='-mtune=power2' ;;
1830 POWER3
) _march
='-mcpu=power3' _mcpu
='-mtune=power3' ;;
1833 # gcc 3.1(.1) and up supports 7400 and 7450
1834 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "1" ||
test "$_cc_major" -ge "4"; then
1836 7400*|
7410*) _march
='-mcpu=7400' _mcpu
='-mtune=7400' ;;
1837 7447*|
7450*|
7455*) _march
='-mcpu=7450' _mcpu
='-mtune=7450' ;;
1841 # gcc 3.2 and up supports 970
1842 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "3" ||
test "$_cc_major" -ge "4"; then
1844 970*|PPC970
*) _march
='-mcpu=970' _mcpu
='-mtune=970' ;;
1848 # gcc 3.3 and up supports POWER4
1849 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "3" ||
test "$_cc_major" -ge "4"; then
1851 POWER4
) _march
='-mcpu=power4' _mcpu
='-mtune=power4' ;;
1855 # gcc 3.4 and up supports 440*
1856 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "4" ||
test "$_cc_major" -ge "4"; then
1858 440EP
*) _march
='-mcpu=440fp' _mcpu
='-mtune=440fp' ;;
1859 440G
* ) _march
='-mcpu=440' _mcpu
='-mtune=440' ;;
1863 # gcc 4.0 and up supports POWER5
1864 if test "$_cc_major" -ge "4"; then
1866 POWER5
*) _march
='-mcpu=power5' _mcpu
='-mtune=power5' ;;
1872 if test -n "$_mcpu"; then
1873 _optimizing
=$
(echo $_mcpu | cut
-c 8-)
1874 echores
"$_optimizing"
1879 test $_fast_clz = "auto" && _fast_clz
=yes
1886 def_fast_64bit
='#define HAVE_FAST_64BIT 1'
1888 echocheck
"CPU type"
1891 unsigned long ver, mask;
1892 __asm__ ("implver %0" : "=r" (ver));
1893 __asm__ ("amask %1, %0" : "=r" (mask) : "r" (-1));
1894 printf("%ld-%x\n", ver, ~mask);
1898 $_cc -o "$TMPEXE" "$TMPC"
1899 case $
("$TMPEXE") in
1901 0-0) proc
="ev4"; _mvi
="0";;
1902 1-0) proc
="ev5"; _mvi
="0";;
1903 1-1) proc
="ev56"; _mvi
="0";;
1904 1-101) proc
="pca56"; _mvi
="1";;
1905 2-303) proc
="ev6"; _mvi
="1";;
1906 2-307) proc
="ev67"; _mvi
="1";;
1907 2-1307) proc
="ev68"; _mvi
="1";;
1911 echocheck
"GCC & CPU optimization abilities"
1912 if test "$proc" = "ev68" ; then
1913 cc_check
-mcpu=$proc || proc
=ev67
1915 if test "$proc" = "ev67" ; then
1916 cc_check
-mcpu=$proc || proc
=ev6
1921 test $_fast_clz = "auto" && _fast_clz
=yes
1930 test $_fast_clz = "auto" && _fast_clz
=yes
1964 echo "The architecture of your CPU ($host_arch) is not supported by this configure script"
1965 echo "It seems nobody has ported MPlayer to your OS or CPU type yet."
1966 die
"unsupported architecture $host_arch"
1968 esac # case "$host_arch" in
1970 if test "$_runtime_cpudetection" = yes ; then
1972 test "$_cmov" != no
&& _cmov
=yes
1974 test "$_mmx" != no
&& _mmx
=yes
1975 test "$_3dnow" != no
&& _3dnow
=yes
1976 test "$_3dnowext" != no
&& _3dnowext
=yes
1977 test "$_mmxext" != no
&& _mmxext
=yes
1978 test "$_sse" != no
&& _sse
=yes
1979 test "$_sse2" != no
&& _sse2
=yes
1980 test "$_ssse3" != no
&& _ssse3
=yes
1989 echocheck
"byte order"
1990 if test "$_big_endian" = auto
; then
1992 short ascii_name[] = {
1993 'M' << 8 | 'P', 'l' << 8 | 'a', 'y' << 8 | 'e', 'r' << 8 | 'B',
1994 'i' << 8 | 'g', 'E' << 8 | 'n', 'd' << 8 | 'i', 'a' << 8 | 'n', 0 };
1995 int main(void) { return (long)ascii_name; }
1998 if strings $TMPEXE |
grep -q -l MPlayerBigEndian
; then
2004 echo ${_echo_n} "failed to autodetect byte order, defaulting to ${_echo_c}"
2007 if test "$_big_endian" = yes ; then
2008 _byte_order
='big-endian'
2009 def_words_endian
='#define WORDS_BIGENDIAN 1'
2010 def_bigendian
='#define HAVE_BIGENDIAN 1'
2012 _byte_order
='little-endian'
2013 def_words_endian
='#undef WORDS_BIGENDIAN'
2014 def_bigendian
='#define HAVE_BIGENDIAN 0'
2016 echores
"$_byte_order"
2019 echocheck
"assembler support of -pipe option"
2020 # -I. helps to detect compilers that just misunderstand -pipe like Sun C
2021 cflag_check
-pipe -I.
&& _pipe
="-pipe" && echores
"yes" || echores
"no"
2024 if darwin
&& test "$cc_vendor" = "gnu" ; then
2025 echocheck
"GCC support of -mstackrealign"
2026 # GCC 4.2 and some earlier Apple versions support this flag on x86. Since
2027 # Mac OS X/Intel has an ABI different from Windows this is needed to avoid
2028 # crashes when loading Win32 DLLs. Unfortunately some gcc versions create
2029 # wrong code with this flag, but this can be worked around by adding
2030 # -fno-unit-at-a-time as described in the blog post at
2031 # http://www.dribin.org/dave/blog/archives/2006/12/05/missing_third_param/
2033 __attribute__((noinline)) static int foo3(int i1, int i2, int i3) { return i3; }
2034 int main(void) { return foo3(1, 2, 3) == 3 ? 0 : 1; }
2036 cc_check
-O2 -mstackrealign && tmp_run
&& cflags_stackrealign
=-mstackrealign
2037 test -z "$cflags_stackrealign" && cc_check
-O2 -mstackrealign -fno-unit-at-a-time &&
2038 tmp_run
&& cflags_stackrealign
="-mstackrealign -fno-unit-at-a-time"
2039 test -n "$cflags_stackrealign" && echores
"yes" || echores
"no"
2040 fi # if darwin && test "$cc_vendor" = "gnu" ; then
2043 # Checking for CFLAGS
2045 if test "$_profile" != "" ||
test "$_debug" != "" ; then
2048 if test -z "$CFLAGS" ; then
2049 if test "$cc_vendor" = "intel" ; then
2050 CFLAGS
="-O2 $_debug $_profile $_march $_mcpu $_pipe -fomit-frame-pointer"
2051 WARNFLAGS
="-wd167 -wd556 -wd144"
2052 elif test "$cc_vendor" = "clang"; then
2053 CFLAGS
="-O2 $_debug $_profile $_march $_pipe"
2054 WARNFLAGS
="-Wall -Wno-switch-enum -Wno-logical-op-parentheses -Wpointer-arith -Wundef -Wno-pointer-sign -Wmissing-prototypes"
2055 ERRORFLAGS
="-Werror=implicit-function-declaration"
2056 elif test "$cc_vendor" != "gnu" ; then
2057 CFLAGS
="-O2 $_debug $_profile $_march $_mcpu $_pipe"
2059 CFLAGS
="-O2 $_debug $_profile $_march $_mcpu $_pipe -ffast-math -fomit-frame-pointer"
2060 WARNFLAGS
="-Wall -Wno-switch -Wno-parentheses -Wpointer-arith -Wredundant-decls"
2061 ERRORFLAGS
="-Werror-implicit-function-declaration"
2062 extra_ldflags
="$extra_ldflags -ffast-math"
2068 if darwin
&& test "$cc_vendor" = "gnu" ; then
2069 extra_cflags
="-falign-loops=16 -shared-libgcc $extra_cflags"
2072 if test "$cc_vendor" = "gnu" ; then
2073 cflag_check
-Wundef && WARNFLAGS
="-Wundef $WARNFLAGS"
2074 # -std=gnu99 is not a warning flag but is placed in WARN_CFLAGS because
2075 # that's the only variable specific to C now, and this option is not valid
2077 cflag_check
-std=gnu99
&& WARN_CFLAGS
="-std=gnu99 $WARN_CFLAGS"
2078 cflag_check
-Wno-pointer-sign && WARN_CFLAGS
="-Wno-pointer-sign $WARN_CFLAGS"
2079 cflag_check
-Wdisabled-optimization && WARN_CFLAGS
="-Wdisabled-optimization $WARN_CFLAGS"
2080 cflag_check
-Wmissing-prototypes && WARN_CFLAGS
="-Wmissing-prototypes $WARN_CFLAGS"
2081 cflag_check
-Wstrict-prototypes && WARN_CFLAGS
="-Wstrict-prototypes $WARN_CFLAGS"
2083 CFLAGS
="-D_ISOC99_SOURCE -D_BSD_SOURCE $CFLAGS"
2086 cflag_check
-mno-omit-leaf-frame-pointer && cflags_no_omit_leaf_frame_pointer
="-mno-omit-leaf-frame-pointer"
2087 cflag_check
-MD -MP && DEPFLAGS
="-MD -MP"
2090 if test -n "$LDFLAGS" ; then
2091 extra_ldflags
="$extra_ldflags $LDFLAGS"
2093 elif test "$cc_vendor" = "intel" ; then
2094 extra_ldflags
="$extra_ldflags -i-static"
2096 if test -n "$CPPFLAGS" ; then
2097 extra_cflags
="$extra_cflags $CPPFLAGS"
2107 #if !(defined(__PIC__) || defined(__pic__) || defined(PIC))
2108 #error PIC not enabled
2113 cc_check
&& pic
=yes && extra_cflags
="$extra_cflags -DPIC"
2119 echocheck
".align is a power of two"
2120 if test "$_asmalign_pot" = auto
; then
2122 inline_asm_check
'".align 3"' && _asmalign_pot
=yes
2124 if test "$_asmalign_pot" = "yes" ; then
2125 def_asmalign_pot
='#define ASMALIGN(ZEROBITS) ".align " #ZEROBITS "\n\t"'
2127 def_asmalign_pot
='#define ASMALIGN(ZEROBITS) ".align 1<<" #ZEROBITS "\n\t"'
2129 echores
$_asmalign_pot
2132 echocheck
"ebx availability"
2134 def_ebx_available
='#define HAVE_EBX_AVAILABLE 0'
2141 // just adding ebx to clobber list seems unreliable with some
2142 // compilers, e.g. Haiku's gcc 2.95
2144 // and the above check does not work for OSX 64 bit...
2145 __asm__ volatile("":::"%ebx");
2149 cc_check
&& ebx_available
=yes && def_ebx_available
='#define HAVE_EBX_AVAILABLE 1'
2150 echores
$ebx_available
2154 #FIXME: This should happen before the check for CFLAGS..
2155 def_altivec_h
='#define HAVE_ALTIVEC_H 0'
2156 if ppc
&& ( test "$_altivec" = yes ||
test "$_runtime_cpudetection" = yes ) ; then
2158 # check if AltiVec is supported by the compiler, and how to enable it
2159 echocheck
"GCC AltiVec flags"
2160 if $
(cflag_check
-maltivec -mabi=altivec
) ; then
2161 _altivec_gcc_flags
="-maltivec -mabi=altivec"
2162 # check if <altivec.h> should be included
2163 if $
(header_check altivec.h
$_altivec_gcc_flags) ; then
2164 def_altivec_h
='#define HAVE_ALTIVEC_H 1'
2165 inc_altivec_h
='#include <altivec.h>'
2167 if $
(cflag_check
-faltivec) ; then
2168 _altivec_gcc_flags
="-faltivec"
2171 _altivec_gcc_flags
="none, AltiVec disabled"
2175 echores
"$_altivec_gcc_flags"
2177 # check if the compiler supports braces for vector declarations
2180 int main(void) { (vector int) {1}; return 0; }
2182 cc_check
$_altivec_gcc_flags || die
"You need a compiler that supports {} in AltiVec vector declarations."
2184 # Disable runtime cpudetection if we cannot generate AltiVec code or
2185 # AltiVec is disabled by the user.
2186 test "$_runtime_cpudetection" = yes && test "$_altivec" = no \
2187 && _runtime_cpudetection
=no
2189 # Show that we are optimizing for AltiVec (if enabled and supported).
2190 test "$_runtime_cpudetection" = no
&& test "$_altivec" = yes \
2191 && _optimizing
="$_optimizing altivec"
2193 # If AltiVec is enabled, make sure the correct flags turn up in CFLAGS.
2194 test "$_altivec" = yes && CFLAGS
="$CFLAGS $_altivec_gcc_flags"
2198 echocheck
"ARMv5TE (Enhanced DSP Extensions)"
2199 if test $_armv5te = "auto" ; then
2201 inline_asm_check
'"qadd r0, r0, r0"' && _armv5te
=yes
2205 test $_armv5te = "yes" && test $_fast_clz = "auto" && _fast_clz
=yes
2207 echocheck
"ARMv6 (SIMD instructions)"
2208 if test $_armv6 = "auto" ; then
2210 inline_asm_check
'"sadd16 r0, r0, r0"' && _armv6
=yes
2214 echocheck
"ARMv6t2 (SIMD instructions)"
2215 if test $_armv6t2 = "auto" ; then
2217 inline_asm_check
'"movt r0, #0"' && _armv6t2
=yes
2222 if test $_armvfp = "auto" ; then
2224 inline_asm_check
'"fadds s0, s0, s0"' && _armvfp
=yes
2228 echocheck
"ARM NEON"
2229 if test $neon = "auto" ; then
2231 inline_asm_check
'"vadd.i16 q0, q0, q0"' && neon
=yes
2235 echocheck
"iWMMXt (Intel XScale SIMD instructions)"
2236 if test $_iwmmxt = "auto" ; then
2238 inline_asm_check
'"wunpckelub wr6, wr4"' && _iwmmxt
=yes
2243 cpuexts_all
='ALTIVEC MMX MMX2 AMD3DNOW AMD3DNOWEXT SSE SSE2 SSSE3 FAST_CMOV CMOV FAST_CLZ ARMV5TE ARMV6 ARMV6T2 ARMVFP NEON IWMMXT MMI VIS MVI'
2244 test "$_altivec" = yes && cpuexts
="ALTIVEC $cpuexts"
2245 test "$_mmx" = yes && cpuexts
="MMX $cpuexts"
2246 test "$_mmxext" = yes && cpuexts
="MMX2 $cpuexts"
2247 test "$_3dnow" = yes && cpuexts
="AMD3DNOW $cpuexts"
2248 test "$_3dnowext" = yes && cpuexts
="AMD3DNOWEXT $cpuexts"
2249 test "$_sse" = yes && cpuexts
="SSE $cpuexts"
2250 test "$_sse2" = yes && cpuexts
="SSE2 $cpuexts"
2251 test "$_ssse3" = yes && cpuexts
="SSSE3 $cpuexts"
2252 test "$_cmov" = yes && cpuexts
="CMOV $cpuexts"
2253 test "$_fast_cmov" = yes && cpuexts
="FAST_CMOV $cpuexts"
2254 test "$_fast_clz" = yes && cpuexts
="FAST_CLZ $cpuexts"
2255 test "$_armv5te" = yes && cpuexts
="ARMV5TE $cpuexts"
2256 test "$_armv6" = yes && cpuexts
="ARMV6 $cpuexts"
2257 test "$_armv6t2" = yes && cpuexts
="ARMV6T2 $cpuexts"
2258 test "$_armvfp" = yes && cpuexts
="ARMVFP $cpuexts"
2259 test "$neon" = yes && cpuexts
="NEON $cpuexts"
2260 test "$_iwmmxt" = yes && cpuexts
="IWMMXT $cpuexts"
2261 test "$_vis" = yes && cpuexts
="VIS $cpuexts"
2262 test "$_mvi" = yes && cpuexts
="MVI $cpuexts"
2264 # Checking kernel version...
2265 if x86_32
&& linux
; then
2267 kernel_version
=$
(uname
-r 2>&1)
2268 echocheck
"$system_name kernel version"
2269 case "$kernel_version" in
2270 '') kernel_version
="?.??"; _k_verc_fail
=yes;;
2271 [0-1].
[0-9].
[0-9]*|
2.
[0-3].
[0-9]*)
2272 _k_verc_problem
=yes;;
2274 if test "$_k_verc_problem" = yes && test "$_sse" = yes ; then
2277 if test "$_k_verc_fail" ; then
2278 echores
"$kernel_version, fail"
2279 echo "WARNING! If you want to run MPlayer on this system, get prepared for problems!"
2280 echo "2.2.x has limited SSE support. Upgrade the kernel or use --disable-sse if you"
2281 echo "experience crashes. MPlayer tries to autodetect if your kernel correctly"
2282 echo "supports SSE, but you have been warned! If you are using a kernel older than"
2283 echo "2.2.x you must upgrade it to get SSE support!"
2284 # die "Your kernel is too old for this CPU." # works fine on some 2.2.x so don't die (later check will test)
2286 echores
"$kernel_version, ok"
2290 ######################
2291 # MAIN TESTS GO HERE #
2292 ######################
2296 if cflag_check
-lposix ; then
2297 extra_ldflags
="$extra_ldflags -lposix"
2304 if cflag_check
-lm ; then
2313 echocheck
"langinfo"
2314 if test "$_langinfo" = auto
; then
2316 statement_check langinfo.h
'nl_langinfo(CODESET)' && _langinfo
=yes
2318 if test "$_langinfo" = yes ; then
2319 def_langinfo
='#define HAVE_LANGINFO 1'
2321 def_langinfo
='#undef HAVE_LANGINFO'
2323 echores
"$_langinfo"
2326 echocheck
"translation support"
2327 if test "$_translation" = yes; then
2328 def_translation
="#define CONFIG_TRANSLATION 1"
2330 def_translation
="#undef CONFIG_TRANSLATION"
2332 echores
"$_translation"
2334 echocheck
"language"
2335 # Set preferred languages, "all" uses English as main language.
2336 test -z "$language" && language
=$LINGUAS
2337 test -z "$language_doc" && language_doc
=$language
2338 test -z "$language_man" && language_man
=$language
2339 test -z "$language_msg" && language_msg
=$language
2340 test -z "$language_msg" && language_msg
="all"
2341 language_doc
=$
(echo $language_doc |
tr , " ")
2342 language_man
=$
(echo $language_man |
tr , " ")
2343 language_msg
=$
(echo $language_msg |
tr , " ")
2345 test "$language_doc" = "all" && language_doc
=$doc_lang_all
2346 test "$language_man" = "all" && language_man
=$man_lang_all
2347 test "$language_msg" = "all" && language_msg
=$msg_lang_all
2349 if test "$_translation" != yes ; then
2353 # Prune non-existing translations from language lists.
2354 # Set message translation to the first available language.
2355 # Fall back on English.
2356 for lang
in $language_doc ; do
2357 test -d DOCS
/xml
/$lang && tmp_language_doc
="$tmp_language_doc $lang"
2359 language_doc
=$tmp_language_doc
2360 test -z "$language_doc" && language_doc
=en
2362 for lang
in $language_man ; do
2363 test -d DOCS
/man
/$lang && tmp_language_man
="$tmp_language_man $lang"
2365 language_man
=$tmp_language_man
2366 test -z "$language_man" && language_man
=en
2368 for lang
in $language_msg ; do
2369 test -f po
/$lang.po
&& tmp_language_msg
="$tmp_language_msg $lang"
2371 language_msg
=$tmp_language_msg
2373 echores
"messages (en+): $language_msg - man pages: $language_man - documentation: $language_doc"
2376 echocheck
"enable sighandler"
2377 if test "$_sighandler" = yes ; then
2378 def_sighandler
='#define CONFIG_SIGHANDLER 1'
2380 def_sighandler
='#undef CONFIG_SIGHANDLER'
2382 echores
"$_sighandler"
2384 echocheck
"runtime cpudetection"
2385 if test "$_runtime_cpudetection" = yes ; then
2386 _optimizing
="Runtime CPU-Detection enabled"
2387 def_runtime_cpudetection
='#define CONFIG_RUNTIME_CPUDETECT 1'
2389 def_runtime_cpudetection
='#define CONFIG_RUNTIME_CPUDETECT 0'
2391 echores
"$_runtime_cpudetection"
2394 echocheck
"restrict keyword"
2395 for restrict_keyword
in restrict __restrict __restrict__
; do
2396 echo "void foo(char * $restrict_keyword p); int main(void) { return 0; }" > $TMPC
2398 def_restrict_keyword
=$restrict_keyword
2402 if [ -n "$def_restrict_keyword" ]; then
2403 echores
"$def_restrict_keyword"
2407 # Avoid infinite recursion loop ("#define restrict restrict")
2408 if [ "$def_restrict_keyword" != "restrict" ]; then
2409 def_restrict_keyword
="#define restrict $def_restrict_keyword"
2411 def_restrict_keyword
=""
2415 echocheck
"__builtin_expect"
2416 # GCC branch prediction hint
2418 static int foo(int a) {
2419 a = __builtin_expect(a, 10);
2420 return a == 10 ? 0 : 1;
2422 int main(void) { return foo(10) && foo(0); }
2425 cc_check
&& _builtin_expect
=yes
2426 if test "$_builtin_expect" = yes ; then
2427 def_builtin_expect
='#define HAVE_BUILTIN_EXPECT 1'
2429 def_builtin_expect
='#undef HAVE_BUILTIN_EXPECT'
2431 echores
"$_builtin_expect"
2436 statement_check kstat.h
'kstat_open()' -lkstat && _kstat
=yes
2437 if test "$_kstat" = yes ; then
2438 def_kstat
="#define HAVE_LIBKSTAT 1"
2439 extra_ldflags
="$extra_ldflags -lkstat"
2441 def_kstat
="#undef HAVE_LIBKSTAT"
2447 # required for nanosleep on some systems
2449 statement_check
time.h
'nanosleep(0, 0)' -lposix4 && _posix4
=yes
2450 if test "$_posix4" = yes ; then
2451 extra_ldflags
="$extra_ldflags -lposix4"
2456 echocheck
"nanosleep"
2458 statement_check
time.h
'nanosleep(0, 0)' && _nanosleep
=yes
2459 if test "$_nanosleep" = yes ; then
2460 def_nanosleep
='#define HAVE_NANOSLEEP 1'
2462 def_nanosleep
='#undef HAVE_NANOSLEEP'
2464 echores
"$_nanosleep"
2468 # for Solaris (socket stuff is in -lsocket, gethostbyname and friends in -lnsl):
2469 # for BeOS (socket stuff is in -lsocket, gethostbyname and friends in -lbind):
2472 #include <sys/socket.h>
2473 int main(void) { gethostbyname(0); socket(AF_INET, SOCK_STREAM, 0); return 0; }
2476 for _ld_tmp
in "" "-lsocket -lbind" "-lsocket -ldnet" "-lsocket -lnsl" "-lnsl" "-lsocket" ; do
2477 cc_check
$_ld_tmp && _ld_sock
="$_ld_tmp" && _socklib
=yes && break
2479 test $_socklib = yes && test $_winsock2_h = auto
&& _winsock2_h
=no
2480 if test $_winsock2_h = auto
; then
2482 statement_check winsock2.h
'gethostbyname(0)' -lws2_32 && _ld_sock
="-lws2_32" && _winsock2_h
=yes
2484 test "$_ld_sock" && res_comment
="using $_ld_sock"
2488 if test $_winsock2_h = yes ; then
2490 def_winsock2_h
='#define HAVE_WINSOCK2_H 1'
2492 def_winsock2_h
='#define HAVE_WINSOCK2_H 0'
2496 echocheck
"inet_pton()"
2497 def_inet_pton
='#define HAVE_INET_PTON 0'
2499 for _ld_tmp
in "$_ld_sock" "$_ld_sock -lresolv" ; do
2500 statement_check arpa
/inet.h
'inet_pton(0, 0, 0)' $_ld_tmp && inet_pton
=yes && break
2502 if test $inet_pton = yes ; then
2503 test "$_ld_tmp" && res_comment
="using $_ld_tmp"
2504 def_inet_pton
='#define HAVE_INET_PTON 1'
2506 echores
"$inet_pton"
2509 echocheck
"inet_aton()"
2510 def_inet_aton
='#define HAVE_INET_ATON 0'
2512 for _ld_tmp
in "$_ld_sock" "$_ld_sock -lresolv" ; do
2513 statement_check arpa
/inet.h
'inet_aton(0, 0)' $_ld_tmp && inet_aton
=yes && break
2515 if test $inet_aton = yes ; then
2516 test "$_ld_tmp" && res_comment
="using $_ld_tmp"
2517 def_inet_aton
='#define HAVE_INET_ATON 1'
2519 echores
"$inet_aton"
2522 echocheck
"socklen_t"
2524 for header
in "sys/socket.h" "ws2tcpip.h" "sys/types.h" ; do
2525 statement_check
$header 'socklen_t v = 0' && _socklen_t
=yes && break
2527 if test "$_socklen_t" = yes ; then
2528 def_socklen_t
='#define HAVE_SOCKLEN_T 1'
2530 def_socklen_t
='#define HAVE_SOCKLEN_T 0'
2532 echores
"$_socklen_t"
2535 echocheck
"closesocket()"
2537 statement_check winsock2.h
'closesocket(~0)' $_ld_sock && _closesocket
=yes
2538 if test "$_closesocket" = yes ; then
2539 def_closesocket
='#define HAVE_CLOSESOCKET 1'
2541 def_closesocket
='#define HAVE_CLOSESOCKET 0'
2543 echores
"$_closesocket"
2546 echocheck
"networking"
2547 test $_winsock2_h = no
&& test $inet_pton = no
&&
2548 test $inet_aton = no
&& networking
=no
2549 if test "$networking" = yes ; then
2550 def_network
='#define CONFIG_NETWORK 1'
2551 def_networking
='#define CONFIG_NETWORKING 1'
2552 extra_ldflags
="$extra_ldflags $_ld_sock"
2553 inputmodules
="networking $inputmodules"
2555 noinputmodules
="networking $noinputmodules"
2556 def_network
='#define CONFIG_NETWORK 0'
2557 def_networking
='#undef CONFIG_NETWORKING'
2559 echores
"$networking"
2563 if test "$_inet6" = auto
; then
2565 #include <sys/types.h>
2566 #if !defined(_WIN32)
2567 #include <sys/socket.h>
2568 #include <netinet/in.h>
2570 #include <ws2tcpip.h>
2572 int main(void) { struct sockaddr_in6 six; socket(AF_INET6, SOCK_STREAM, AF_INET6); return 0; }
2575 if cc_check
$_ld_sock ; then
2579 if test "$_inet6" = yes ; then
2580 def_inet6
='#define HAVE_AF_INET6 1'
2582 def_inet6
='#undef HAVE_AF_INET6'
2587 echocheck
"gethostbyname2"
2588 if test "$_gethostbyname2" = auto
; then
2590 #include <sys/types.h>
2591 #include <sys/socket.h>
2593 int main(void) { gethostbyname2("", AF_INET); return 0; }
2600 if test "$_gethostbyname2" = yes ; then
2601 def_gethostbyname2
='#define HAVE_GETHOSTBYNAME2 1'
2603 def_gethostbyname2
='#undef HAVE_GETHOSTBYNAME2'
2605 echores
"$_gethostbyname2"
2608 echocheck
"inttypes.h (required)"
2610 header_check inttypes.h
&& _inttypes
=yes
2611 echores
"$_inttypes"
2613 if test "$_inttypes" = no
; then
2614 echocheck
"sys/bitypes.h (inttypes.h predecessor)"
2615 header_check sys
/bitypes.h
&& _inttypes
=yes
2616 if test "$_inttypes" = yes ; then
2617 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."
2619 die
"Cannot find header either inttypes.h or bitypes.h. There is no chance for compilation to succeed."
2624 echocheck
"alloca.h"
2626 statement_check alloca.h
'alloca(0)' && _alloca
=yes
2628 def_alloca_h
='#define HAVE_ALLOCA_H 1'
2630 def_alloca_h
='#undef HAVE_ALLOCA_H'
2635 echocheck
"fastmemcpy"
2636 if test "$_fastmemcpy" = yes ; then
2637 def_fastmemcpy
='#define CONFIG_FASTMEMCPY 1'
2639 def_fastmemcpy
='#undef CONFIG_FASTMEMCPY'
2641 echores
"$_fastmemcpy"
2646 statement_check sys
/mman.h
'mmap(0, 0, 0, 0, 0, 0)' && _mman
=yes
2647 if test "$_mman" = yes ; then
2648 def_mman_h
='#define HAVE_SYS_MMAN_H 1'
2650 def_mman_h
='#undef HAVE_SYS_MMAN_H'
2654 _mman_has_map_failed
=no
2655 statement_check sys
/mman.h
'void *p = MAP_FAILED' && _mman_has_map_failed
=yes
2656 if test "$_mman_has_map_failed" = yes ; then
2657 def_mman_has_map_failed
=''
2659 def_mman_has_map_failed
='#define MAP_FAILED ((void *) -1)'
2662 echocheck
"dynamic loader"
2664 for _ld_tmp
in "" "-ldl"; do
2665 statement_check dlfcn.h
'dlopen("", 0)' $_ld_tmp && _ld_dl
="$_ld_tmp" && _dl
=yes && break
2667 if test "$_dl" = yes ; then
2668 def_dl
='#define HAVE_LIBDL 1'
2670 def_dl
='#undef HAVE_LIBDL'
2677 THREAD_CFLAGS
=-D_REENTRANT
2678 elif freebsd || netbsd || openbsd || bsdos
; then
2679 THREAD_CFLAGS
=-D_THREAD_SAFE
2681 if test "$_pthreads" = auto
; then
2683 #include <pthread.h>
2684 static void *func(void *arg) { return arg; }
2687 #ifdef PTW32_STATIC_LIB
2688 pthread_win32_process_attach_np();
2689 pthread_win32_thread_attach_np();
2691 return pthread_create (&tid, 0, func, 0) != 0;
2696 for _ld_tmp
in "-lpthreadGC2" "" "-lpthread" "-pthread" ; do
2697 # for crosscompilation, we cannot execute the program, be happy if we can link statically
2698 cc_check
$THREAD_CFLAGS $_ld_tmp && (tmp_run ||
test "$_ld_static") && _ld_pthread
="$_ld_tmp" && _pthreads
=yes && break
2700 if test "$_pthreads" = no
&& mingw32
; then
2701 _ld_tmp
="-lpthreadGC2 -lws2_32"
2702 cc_check
$_ld_tmp -DPTW32_STATIC_LIB && (tmp_run ||
test "$_ld_static") && _ld_pthread
="$_ld_tmp" && _pthreads
=yes && CFLAGS
="$CFLAGS -DPTW32_STATIC_LIB"
2706 if test "$_pthreads" = yes ; then
2707 test $_ld_pthread && res_comment
="using $_ld_pthread"
2708 def_pthreads
='#define HAVE_PTHREADS 1'
2709 extra_cflags
="$extra_cflags $THREAD_CFLAGS"
2711 res_comment
="v4l2, win32 loader disabled"
2712 def_pthreads
='#undef HAVE_PTHREADS'
2714 mingw32 || _win32dll
=no
2716 echores
"$_pthreads"
2719 if test "$_pthreads" = yes ; then
2720 def_pthread_cache
="#define PTHREAD_CACHE 1"
2723 def_stream_cache
="#undef CONFIG_STREAM_CACHE"
2727 echocheck
"w32threads"
2728 if test "$_pthreads" = yes ; then
2729 res_comment
="using pthread instead"
2732 if test "$_w32threads" = auto
; then
2734 mingw32
&& _w32threads
=yes
2736 echores
"$_w32threads"
2739 if test "$_rpath" = yes ; then
2740 for I
in $
(echo $extra_ldflags |
sed 's/-L//g') ; do
2741 tmp
="$tmp $(echo $I | sed 's/.*/ -L& -Wl,-R&/')"
2748 if test "$_iconv" = auto
; then
2753 #define INBUFSIZE 1024
2754 #define OUTBUFSIZE 4096
2756 char inbuffer[INBUFSIZE];
2757 char outbuffer[OUTBUFSIZE];
2762 char *tocode="UTF-8";
2763 char *fromcode="cp1250";
2764 if ((icdsc = iconv_open(tocode, fromcode)) != (iconv_t)(-1)) {
2765 while ((numread = read(0, inbuffer, INBUFSIZE))) {
2766 char *iptr=inbuffer;
2767 char *optr=outbuffer;
2768 size_t inleft=numread;
2769 size_t outleft=OUTBUFSIZE;
2770 if (iconv(icdsc, &iptr, &inleft, &optr, &outleft)
2772 write(1, outbuffer, OUTBUFSIZE - outleft);
2775 if (iconv_close(icdsc) == -1)
2782 for _ld_tmp
in "" "-liconv" "-liconv $_ld_dl" ; do
2783 cc_check
$_ld_lm $_ld_tmp && extra_ldflags
="$extra_ldflags $_ld_tmp" &&
2786 if test "$_iconv" != yes ; then
2787 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."
2790 if test "$_iconv" = yes ; then
2791 def_iconv
='#define CONFIG_ICONV 1'
2793 def_iconv
='#undef CONFIG_ICONV'
2798 echocheck
"soundcard.h"
2800 def_soundcard_h
='#undef HAVE_SOUNDCARD_H'
2801 def_sys_soundcard_h
='#undef HAVE_SYS_SOUNDCARD_H'
2802 for _soundcard_header
in "sys/soundcard.h" "soundcard.h"; do
2803 header_check
$_soundcard_header && _soundcard_h
=yes &&
2804 res_comment
="$_soundcard_header" && break
2807 if test "$_soundcard_h" = yes ; then
2808 if test $_soundcard_header = "sys/soundcard.h"; then
2809 def_sys_soundcard_h
='#define HAVE_SYS_SOUNDCARD_H 1'
2811 def_soundcard_h
='#define HAVE_SOUNDCARD_H 1'
2814 echores
"$_soundcard_h"
2817 echocheck
"sys/videoio.h"
2819 def_sys_videoio_h
='#undef HAVE_SYS_VIDEOIO_H'
2820 header_check sys
/videoio.h
&& sys_videoio_h
=yes &&
2821 def_sys_videoio_h
='#define HAVE_SYS_VIDEOIO_H 1'
2822 echores
"$sys_videoio_h"
2825 echocheck
"sys/dvdio.h"
2827 # FreeBSD 8.1 has broken dvdio.h
2828 header_check_broken sys
/types.h sys
/dvdio.h
&& _dvdio
=yes
2829 if test "$_dvdio" = yes ; then
2830 def_dvdio
='#define DVD_STRUCT_IN_SYS_DVDIO_H 1'
2832 def_dvdio
='#undef DVD_STRUCT_IN_SYS_DVDIO_H'
2837 echocheck
"sys/cdio.h"
2839 # at least OpenSolaris has a broken cdio.h
2840 header_check_broken sys
/types.h sys
/cdio.h
&& _cdio
=yes
2841 if test "$_cdio" = yes ; then
2842 def_cdio
='#define DVD_STRUCT_IN_SYS_CDIO_H 1'
2844 def_cdio
='#undef DVD_STRUCT_IN_SYS_CDIO_H'
2849 echocheck
"linux/cdrom.h"
2851 header_check linux
/cdrom.h
&& _cdrom
=yes
2852 if test "$_cdrom" = yes ; then
2853 def_cdrom
='#define DVD_STRUCT_IN_LINUX_CDROM_H 1'
2855 def_cdrom
='#undef DVD_STRUCT_IN_LINUX_CDROM_H'
2862 header_check dvd.h
&& _dvd
=yes
2863 if test "$_dvd" = yes ; then
2864 def_dvd
='#define DVD_STRUCT_IN_DVD_H 1'
2866 def_dvd
='#undef DVD_STRUCT_IN_DVD_H'
2872 echocheck
"BSDI dvd.h"
2874 header_check dvd.h
&& _bsdi_dvd
=yes
2875 if test "$_bsdi_dvd" = yes ; then
2876 def_bsdi_dvd
='#define DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H 1'
2878 def_bsdi_dvd
='#undef DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H'
2880 echores
"$_bsdi_dvd"
2885 # also used by AIX, but AIX does not support VCD and/or libdvdread
2886 echocheck
"HP-UX SCSI header"
2888 header_check sys
/scsi.h
&& _hpux_scsi_h
=yes
2889 if test "$_hpux_scsi_h" = yes ; then
2890 def_hpux_scsi_h
='#define HPUX_SCTL_IO 1'
2892 def_hpux_scsi_h
='#undef HPUX_SCTL_IO'
2894 echores
"$_hpux_scsi_h"
2899 if test "$_termcap" = auto
; then
2901 for _ld_tmp
in "-lncurses" "-ltinfo" "-ltermcap"; do
2902 statement_check term.h
'tgetent(0, 0)' $_ld_tmp &&
2903 extra_ldflags
="$extra_ldflags $_ld_tmp" && _termcap
=yes && break
2906 if test "$_termcap" = yes ; then
2907 def_termcap
='#define HAVE_TERMCAP 1'
2908 test $_ld_tmp && res_comment
="using $_ld_tmp"
2910 def_termcap
='#undef HAVE_TERMCAP'
2916 def_termios
='#undef HAVE_TERMIOS'
2917 def_termios_h
='#undef HAVE_TERMIOS_H'
2918 def_termios_sys_h
='#undef HAVE_SYS_TERMIOS_H'
2919 if test "$_termios" = auto
; then
2921 for _termios_header
in "termios.h" "sys/termios.h"; do
2922 header_check
$_termios_header && _termios
=yes &&
2923 res_comment
="using $_termios_header" && break
2927 if test "$_termios" = yes ; then
2928 def_termios
='#define HAVE_TERMIOS 1'
2929 if test "$_termios_header" = "termios.h" ; then
2930 def_termios_h
='#define HAVE_TERMIOS_H 1'
2932 def_termios_sys_h
='#define HAVE_SYS_TERMIOS_H 1'
2939 if test "$_shm" = auto
; then
2941 statement_check sys
/shm.h
'shmget(0, 0, 0); shmat(0, 0, 0); shmctl(0, 0, 0)' && _shm
=yes
2943 if test "$_shm" = yes ; then
2944 def_shm
='#define HAVE_SHM 1'
2946 def_shm
='#undef HAVE_SHM'
2951 echocheck
"strsep()"
2953 statement_check string.h
'char *s = "Hello, world!"; strsep(&s, ",")' && _strsep
=yes
2954 if test "$_strsep" = yes ; then
2955 def_strsep
='#define HAVE_STRSEP 1'
2958 def_strsep
='#undef HAVE_STRSEP'
2964 echocheck
"vsscanf()"
2966 #define _ISOC99_SOURCE
2969 int main(void) { va_list ap; vsscanf("foo", "bar", ap); return 0; }
2972 cc_check
&& _vsscanf
=yes
2973 if test "$_vsscanf" = yes ; then
2974 def_vsscanf
='#define HAVE_VSSCANF 1'
2977 def_vsscanf
='#undef HAVE_VSSCANF'
2985 define_statement_check
"_XOPEN_SOURCE 600" "unistd.h" 'int a, b; swab(&a, &b, 0)' ||
2986 statement_check
"string.h" 'int a, b; swab(&a, &b, 0)' && _swab
=yes
2987 if test "$_swab" = yes ; then
2988 def_swab
='#define HAVE_SWAB 1'
2991 def_swab
='#undef HAVE_SWAB'
2996 echocheck
"POSIX select()"
3000 #include <sys/types.h>
3002 #include <sys/time.h>
3004 int main(void) {int nfds = 1; fd_set readfds; struct timeval timeout; select(nfds, &readfds, NULL, NULL, &timeout); return 0; }
3007 def_posix_select
='#undef HAVE_POSIX_SELECT'
3008 cc_check
&& _posix_select
=yes &&
3009 def_posix_select
='#define HAVE_POSIX_SELECT 1'
3010 echores
"$_posix_select"
3013 echocheck
"audio select()"
3014 if test "$_select" = no
; then
3015 def_select
='#undef HAVE_AUDIO_SELECT'
3016 elif test "$_select" = yes ; then
3017 def_select
='#define HAVE_AUDIO_SELECT 1'
3022 echocheck
"gettimeofday()"
3024 statement_check sys
/time.h
'struct timeval tv; struct timezone tz; gettimeofday(&tv, &tz)' && _gettimeofday
=yes
3025 if test "$_gettimeofday" = yes ; then
3026 def_gettimeofday
='#define HAVE_GETTIMEOFDAY 1'
3027 need_gettimeofday
=no
3029 def_gettimeofday
='#undef HAVE_GETTIMEOFDAY'
3030 need_gettimeofday
=yes
3032 echores
"$_gettimeofday"
3037 statement_check glob.h
'glob("filename", 0, 0, 0)' && _glob
=yes
3039 if test "$_glob" = yes ; then
3040 def_glob
='#define HAVE_GLOB 1'
3042 def_glob
='#undef HAVE_GLOB'
3043 # HACK! need_glob currently enables compilation of a
3044 # win32-specific glob()-replacement.
3045 # Other OS neither need it nor can they use it (mf:// is disabled for them).
3046 win32
&& need_glob
=yes
3051 echocheck
"setenv()"
3053 statement_check stdlib.h
'setenv("", "", 0)' && _setenv
=yes
3054 if test "$_setenv" = yes ; then
3055 def_setenv
='#define HAVE_SETENV 1'
3058 def_setenv
='#undef HAVE_SETENV'
3064 echocheck
"setmode()"
3066 def_setmode
='#define HAVE_SETMODE 0'
3067 statement_check io.h
'setmode(0, 0)' && _setmode
=yes && def_setmode
='#define HAVE_SETMODE 1'
3071 echocheck
"sys/sysinfo.h"
3073 statement_check sys
/sysinfo.h
'struct sysinfo s_info; s_info.mem_unit=0; sysinfo(&s_info)' && _sys_sysinfo
=yes
3074 if test "$_sys_sysinfo" = yes ; then
3075 def_sys_sysinfo_h
='#define HAVE_SYS_SYSINFO_H 1'
3077 def_sys_sysinfo_h
='#undef HAVE_SYS_SYSINFO_H'
3079 echores
"$_sys_sysinfo"
3084 echocheck
"Mac OS X Finder Support"
3085 def_macosx_finder
='#undef CONFIG_MACOSX_FINDER'
3086 if test "$_macosx_finder" = yes ; then
3087 def_macosx_finder
='#define CONFIG_MACOSX_FINDER 1'
3088 extra_ldflags
="$extra_ldflags -framework Cocoa"
3090 echores
"$_macosx_finder"
3092 echocheck
"Mac OS X Bundle file locations"
3093 def_macosx_bundle
='#undef CONFIG_MACOSX_BUNDLE'
3094 test "$_macosx_bundle" = auto
&& _macosx_bundle
=$_macosx_finder
3095 if test "$_macosx_bundle" = yes ; then
3096 def_macosx_bundle
='#define CONFIG_MACOSX_BUNDLE 1'
3098 echores
"$_macosx_bundle"
3100 echocheck
"Apple Remote"
3101 if test "$_apple_remote" = auto
; then
3105 #include <IOKit/IOCFPlugIn.h>
3107 io_iterator_t hidObjectIterator = (io_iterator_t)NULL;
3108 CFMutableDictionaryRef hidMatchDictionary;
3109 IOReturn ioReturnValue;
3111 // Set up a matching dictionary to search the I/O Registry by class.
3112 // name for all HID class devices
3113 hidMatchDictionary = IOServiceMatching("AppleIRController");
3115 // Now search I/O Registry for matching devices.
3116 ioReturnValue = IOServiceGetMatchingServices(kIOMasterPortDefault,
3117 hidMatchDictionary, &hidObjectIterator);
3119 // If search is unsuccessful, return nonzero.
3120 if (ioReturnValue != kIOReturnSuccess ||
3121 !IOIteratorIsValid(hidObjectIterator)) {
3127 cc_check
-framework IOKit
&& _apple_remote
=yes
3129 if test "$_apple_remote" = yes ; then
3130 def_apple_remote
='#define CONFIG_APPLE_REMOTE 1'
3131 libs_mplayer
="$libs_mplayer -framework IOKit -framework Cocoa"
3133 def_apple_remote
='#undef CONFIG_APPLE_REMOTE'
3135 echores
"$_apple_remote"
3141 echocheck
"Apple IR"
3142 if test "$_apple_ir" = auto
; then
3144 statement_check linux
/input.h
'struct input_event ev; struct input_id id' && _apple_ir
=yes
3146 if test "$_apple_ir" = yes ; then
3147 def_apple_ir
='#define CONFIG_APPLE_IR 1'
3149 def_apple_ir
='#undef CONFIG_APPLE_IR'
3151 echores
"$_apple_ir"
3154 echocheck
"pkg-config"
3155 if $
($_pkg_config --version > /dev
/null
2>&1); then
3156 if test "$_ld_static"; then
3157 _pkg_config
="$_pkg_config --static"
3166 echocheck
"Samba support (libsmbclient)"
3167 if test "$_smb" = yes; then
3168 extra_ldflags
="$extra_ldflags -lsmbclient"
3170 if test "$_smb" = auto
; then
3172 for _ld_tmp
in "-lsmbclient" "-lsmbclient $_ld_dl" "-lsmbclient $_ld_dl -lnsl" "-lsmbclient $_ld_dl -lssl -lnsl" ; do
3173 statement_check libsmbclient.h
'smbc_opendir("smb://")' $_ld_tmp &&
3174 extra_ldflags
="$extra_ldflags $_ld_tmp" && _smb
=yes && break
3178 if test "$_smb" = yes; then
3179 def_smb
="#define CONFIG_LIBSMBCLIENT 1"
3180 inputmodules
="smb $inputmodules"
3182 def_smb
="#undef CONFIG_LIBSMBCLIENT"
3183 noinputmodules
="smb $noinputmodules"
3187 echocheck
"libquvi support"
3188 if test "$_libquvi" = auto
; then
3190 if pkg_config_add
'libquvi >= 0.4.1' ; then
3194 if test "$_libquvi" = yes; then
3195 def_libquvi
="#define CONFIG_LIBQUVI 1"
3197 def_libquvi
="#undef CONFIG_LIBQUVI"
3207 if test "$_tga" = yes ; then
3208 def_tga
='#define CONFIG_TGA 1'
3209 vomodules
="tga $vomodules"
3211 def_tga
='#undef CONFIG_TGA'
3212 novomodules
="tga $novomodules"
3217 echocheck
"md5sum support"
3218 if test "$_md5sum" = yes; then
3219 def_md5sum
="#define CONFIG_MD5SUM 1"
3220 vomodules
="md5sum $vomodules"
3222 def_md5sum
="#undef CONFIG_MD5SUM"
3223 novomodules
="md5sum $novomodules"
3228 echocheck
"yuv4mpeg support"
3229 if test "$_yuv4mpeg" = yes; then
3230 def_yuv4mpeg
="#define CONFIG_YUV4MPEG 1"
3231 vomodules
="yuv4mpeg $vomodules"
3233 def_yuv4mpeg
="#undef CONFIG_YUV4MPEG"
3234 novomodules
="yuv4mpeg $novomodules"
3236 echores
"$_yuv4mpeg"
3239 echocheck
"DirectFB"
3240 if test "$_directfb" = auto
; then
3243 #include <directfb.h>
3244 #include <directfb_version.h>
3245 #if (DIRECTFB_MAJOR_VERSION << 16 | DIRECTFB_MINOR_VERSION << 8 | DIRECTFB_MICRO_VERSION) < (0 << 16 | 9 << 8 | 22)
3246 #error "DirectFB version too old."
3248 int main(void) { DirectFBInit(0, 0); return 0; }
3250 for _inc_tmp
in "" -I/usr
/local
/include
/directfb
-I/usr
/include
/directfb
-I/usr
/local
/include
; do
3251 cc_check
$_inc_tmp -ldirectfb &&
3252 _directfb
=yes && extra_cflags
="$extra_cflags $_inc_tmp" && break
3255 if test "$_directfb" = yes ; then
3256 def_directfb
='#define CONFIG_DIRECTFB 1'
3257 vomodules
="directfb $vomodules"
3258 libs_mplayer
="$libs_mplayer -ldirectfb"
3260 def_directfb
='#undef CONFIG_DIRECTFB'
3261 novomodules
="directfb $novomodules"
3263 echores
"$_directfb"
3268 echocheck
"QuickTime"
3269 if test "$quicktime" = auto
; then
3271 statement_check QuickTime
/QuickTime.h
'ImageDescription *desc; EnterMovies(); ExitMovies()' -framework QuickTime
&& quicktime
=yes
3273 if test "$quicktime" = yes ; then
3274 extra_ldflags
="$extra_ldflags -framework QuickTime"
3275 def_quicktime
='#define CONFIG_QUICKTIME 1'
3277 def_quicktime
='#undef CONFIG_QUICKTIME'
3282 if test "$_cocoa" = auto
; then
3284 #include <CoreServices/CoreServices.h>
3285 #include <OpenGL/OpenGL.h>
3287 NSApplicationLoad();
3291 cc_check
-framework IOKit
-framework Cocoa
-framework OpenGL
&& _cocoa
=yes
3293 if test "$_cocoa" = yes ; then
3294 libs_mplayer
="$libs_mplayer -framework IOKit -framework Cocoa -framework OpenGL"
3295 def_cocoa
='#define CONFIG_COCOA 1'
3297 def_cocoa
='#undef CONFIG_COCOA'
3301 echocheck
"CoreVideo"
3302 if test "$_cocoa" = yes && test "$_corevideo" = auto
; then
3304 #include <QuartzCore/CoreVideo.h>
3305 int main(void) { return 0; }
3308 cc_check
-framework Cocoa
-framework QuartzCore
-framework OpenGL
&& _corevideo
=yes
3310 if test "$_corevideo" = yes ; then
3311 vomodules
="corevideo $vomodules"
3312 libs_mplayer
="$libs_mplayer -framework QuartzCore"
3313 def_corevideo
='#define CONFIG_COREVIDEO 1'
3315 novomodules
="corevideo $novomodules"
3316 def_corevideo
='#undef CONFIG_COREVIDEO'
3318 echores
"$_corevideo"
3320 echocheck
"SharedBuffer"
3321 if test "$_sharedbuffer" = auto
; then
3324 NSApplicationLoad();
3328 cc_check
-framework Cocoa
&& _sharedbuffer
=yes
3330 if test "$_sharedbuffer" = yes ; then
3331 vomodules
="sharedbuffer $vomodules"
3332 libs_mplayer
="$libs_mplayer -framework Cocoa"
3333 def_sharedbuffer
='#define CONFIG_SHAREDBUFFER 1'
3335 novomodules
="sharedbuffer $novomodules"
3336 def_sharedbuffer
='#undef CONFIG_SHAREDBUFFER'
3338 echores
"$_sharedbuffer"
3340 depends_on_application_services
(){
3341 test "$_corevideo" = yes
3347 echocheck
"X11 headers presence"
3349 res_comment
="check if the dev(el) packages are installed"
3350 for I
in $
(echo $extra_cflags |
sed s
/-I//g
) /usr
/include
; do
3351 if test -f "$I/X11/Xlib.h" ; then
3357 if test $_cross_compile = no
; then
3358 for I
in /usr
/X11
/include
/usr
/X11R
7/include
/usr
/local
/include
/usr
/X11R
6/include \
3359 /usr
/include
/X11R6
/usr
/openwin
/include
; do
3360 if test -f "$I/X11/Xlib.h" ; then
3361 extra_cflags
="$extra_cflags -I$I"
3363 res_comment
="using $I"
3368 echores
"$_x11_headers"
3372 if test "$_x11" = auto
&& test "$_x11_headers" = yes ; then
3373 for I
in "" -L/usr
/X11R
7/lib
-L/usr
/local
/lib
-L/usr
/X11R
6/lib
-L/usr
/lib
/X11R6 \
3374 -L/usr
/X11
/lib
-L/usr
/lib32
-L/usr
/openwin
/lib
-L/usr
/local
/lib64
-L/usr
/X11R
6/lib64 \
3377 _ld_tmp
="$I -lXext -lX11 $_ld_pthread -Wl,-R$(echo $I | sed s/^-L//)"
3379 _ld_tmp
="$I -lXext -lX11 $_ld_pthread"
3381 statement_check X11
/Xutil.h
'XCreateWindow(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)' $_ld_tmp &&
3383 # Check that there aren't conflicting headers between ApplicationServices
3384 # and X11. On versions of Mac OSX prior to 10.7 the deprecated QuickDraw API
3385 # is included by -framework ApplicationServices and clashes with the X11
3386 # definition of the "Cursor" type.
3387 if darwin
&& depends_on_application_services
&& test "$_x11" = yes ; then
3389 header_check_broken ApplicationServices
/ApplicationServices.h \
3390 X11
/Xutil.h
$_ld_tmp && _x11
=yes
3392 if test "$_x11" = yes ; then
3393 libs_mplayer
="$libs_mplayer $_ld_tmp"
3398 if test "$_x11" = yes ; then
3399 def_x11
='#define CONFIG_X11 1'
3400 vomodules
="x11 $vomodules"
3403 def_x11
='#undef CONFIG_X11'
3404 novomodules
="x11 $novomodules"
3405 res_comment
="check if the dev(el) packages are installed"
3409 echocheck
"Xss screensaver extensions"
3410 if test "$_xss" = auto
; then
3412 statement_check
"X11/extensions/scrnsaver.h" 'XScreenSaverSuspend(NULL, True)' -lXss && _xss
=yes
3414 if test "$_xss" = yes ; then
3415 def_xss
='#define CONFIG_XSS 1'
3416 libs_mplayer
="$libs_mplayer -lXss"
3418 def_xss
='#undef CONFIG_XSS'
3425 if test "$_x11" = yes ; then
3427 #include <X11/Xmd.h>
3428 #include <X11/Xlib.h>
3429 #include <X11/Xutil.h>
3430 #include <X11/Xatom.h>
3431 #include <X11/extensions/dpms.h>
3432 int main(void) { DPMSQueryExtension(0, 0, 0); return 0; }
3434 cc_check
-lXdpms && _xdpms3
=yes
3435 statement_check_broken X11
/Xlib.h X11
/extensions
/dpms.h
'DPMSQueryExtension(0, 0, 0)' -lXext && _xdpms4
=yes
3437 if test "$_xdpms4" = yes ; then
3438 def_xdpms
='#define CONFIG_XDPMS 1'
3439 res_comment
="using Xdpms 4"
3441 elif test "$_xdpms3" = yes ; then
3442 def_xdpms
='#define CONFIG_XDPMS 1'
3443 libs_mplayer
="$libs_mplayer -lXdpms"
3444 res_comment
="using Xdpms 3"
3447 def_xdpms
='#undef CONFIG_XDPMS'
3453 if test "$_xv" = auto
&& test "$_x11" = yes ; then
3455 statement_check_broken X11
/Xlib.h X11
/extensions
/Xvlib.h
'XvGetPortAttribute(0, 0, 0, 0)' -lXv && _xv
=yes
3458 if test "$_xv" = yes ; then
3459 def_xv
='#define CONFIG_XV 1'
3460 libs_mplayer
="$libs_mplayer -lXv"
3461 vomodules
="xv $vomodules"
3463 def_xv
='#undef CONFIG_XV'
3464 novomodules
="xv $novomodules"
3470 if test "$_vdpau" = auto
&& test "$_x11" = yes ; then
3472 if test "$_dl" = yes ; then
3473 pkg_config_add
'vdpau >= 0.2' && _vdpau
=yes
3476 if test "$_vdpau" = yes ; then
3477 def_vdpau
='#define CONFIG_VDPAU 1'
3478 vomodules
="vdpau $vomodules"
3480 def_vdpau
='#define CONFIG_VDPAU 0'
3481 novomodules
="vdpau $novomodules"
3486 echocheck
"Xinerama"
3487 if test "$_xinerama" = auto
&& test "$_x11" = yes ; then
3489 statement_check X11
/extensions
/Xinerama.h
'XineramaIsActive(0)' -lXinerama && _xinerama
=yes
3492 if test "$_xinerama" = yes ; then
3493 def_xinerama
='#define CONFIG_XINERAMA 1'
3494 libs_mplayer
="$libs_mplayer -lXinerama"
3496 def_xinerama
='#undef CONFIG_XINERAMA'
3498 echores
"$_xinerama"
3501 # Note: the -lXxf86vm library is the VideoMode extension and though it's not
3502 # needed for DGA, AFAIK every distribution packages together with DGA stuffs
3503 # named 'X extensions' or something similar.
3504 # This check may be useful for future mplayer versions (to change resolution)
3505 # If you run into problems, remove '-lXxf86vm'.
3507 if test "$_vm" = auto
&& test "$_x11" = yes ; then
3509 statement_check_broken X11
/Xlib.h X11
/extensions
/xf86vmode.h
'XF86VidModeQueryExtension(0, 0, 0)' -lXxf86vm && _vm
=yes
3511 if test "$_vm" = yes ; then
3512 def_vm
='#define CONFIG_XF86VM 1'
3513 libs_mplayer
="$libs_mplayer -lXxf86vm"
3515 def_vm
='#undef CONFIG_XF86VM'
3519 # Check for the presence of special keycodes, like audio control buttons
3520 # that XFree86 might have. Used to be bundled with the xf86vm check, but
3521 # has nothing to do with xf86vm and XFree 3.x has xf86vm but does NOT
3522 # have these new keycodes.
3523 echocheck
"XF86keysym"
3524 if test "$_xf86keysym" = auto
&& test "$_x11" = yes ; then
3526 return_check X11
/XF86keysym.h XF86XK_AudioPause
&& _xf86keysym
=yes
3528 if test "$_xf86keysym" = yes ; then
3529 def_xf86keysym
='#define CONFIG_XF86XK 1'
3531 def_xf86keysym
='#undef CONFIG_XF86XK'
3533 echores
"$_xf86keysym"
3537 if test "$_caca" = auto
; then
3539 pkg_config_add
'caca' && _caca
=yes
3541 if test "$_caca" = yes ; then
3542 def_caca
='#define CONFIG_CACA 1'
3543 vomodules
="caca $vomodules"
3545 def_caca
='#undef CONFIG_CACA'
3546 novomodules
="caca $novomodules"
3552 if test "$_dvb" = auto
; then
3556 #include <sys/ioctl.h>
3560 #include <linux/dvb/dmx.h>
3561 #include <linux/dvb/frontend.h>
3562 #include <linux/dvb/video.h>
3563 #include <linux/dvb/audio.h>
3564 int main(void) {return 0;}
3566 for _inc_tmp
in "" "-I/usr/src/DVB/include" ; do
3567 cc_check
$_inc_tmp && _dvb
=yes &&
3568 extra_cflags
="$extra_cflags $_inc_tmp" && break
3572 if test "$_dvb" = yes ; then
3574 inputmodules
="dvb $inputmodules"
3575 def_dvbin
='#define CONFIG_DVBIN 1'
3578 noinputmodules
="dvb $noinputmodules"
3579 def_dvbin
='#undef CONFIG_DVBIN '
3583 echocheck
"PNG support"
3584 if test "$_png" = auto
; then
3591 printf("png.h : %s\n", PNG_LIBPNG_VER_STRING);
3592 printf("libpng: %s\n", png_libpng_ver);
3593 return strcmp(PNG_LIBPNG_VER_STRING, png_libpng_ver);
3596 cc_check
-lpng -lz $_ld_lm && _png
=yes
3599 if test "$_png" = yes ; then
3600 def_png
='#define CONFIG_PNG 1'
3601 extra_ldflags
="$extra_ldflags -lpng -lz"
3603 def_png
='#undef CONFIG_PNG'
3606 echocheck
"MNG support"
3607 if test "$_mng" = auto
; then
3609 return_statement_check libmng.h
'const char * p_ver = mng_version_text()' '!p_ver || p_ver[0] == 0' -lmng -lz $_ld_lm && _mng
=yes
3612 if test "$_mng" = yes ; then
3613 def_mng
='#define CONFIG_MNG 1'
3614 extra_ldflags
="$extra_ldflags -lmng -lz"
3616 def_mng
='#undef CONFIG_MNG'
3619 echocheck
"JPEG support"
3620 if test "$_jpeg" = auto
; then
3622 header_check_broken stdio.h jpeglib.h
-ljpeg $_ld_lm && _jpeg
=yes
3626 if test "$_jpeg" = yes ; then
3627 def_jpeg
='#define CONFIG_JPEG 1'
3628 vomodules
="jpeg $vomodules"
3629 extra_ldflags
="$extra_ldflags -ljpeg"
3631 def_jpeg
='#undef CONFIG_JPEG'
3632 novomodules
="jpeg $novomodules"
3637 echocheck
"PNM support"
3638 if test "$_pnm" = yes; then
3639 def_pnm
="#define CONFIG_PNM 1"
3640 vomodules
="pnm $vomodules"
3642 def_pnm
="#undef CONFIG_PNM"
3643 novomodules
="pnm $novomodules"
3649 echocheck
"GIF support"
3650 # This is to appease people who want to force gif support.
3651 # If it is forced to yes, then we still do checks to determine
3652 # which gif library to use.
3653 if test "$_gif" = yes ; then
3658 if test "$_gif" = auto
; then
3660 for _ld_gif
in "-lungif" "-lgif" ; do
3661 statement_check gif_lib.h
'QuantizeBuffer(0, 0, 0, 0, 0, 0, 0, 0)' $_ld_gif && _gif
=yes && break
3665 # If no library was found, and the user wants support forced,
3666 # then we force it on with libgif, as this is the safest
3667 # assumption IMHO. (libungif & libregif both create symbolic
3668 # links to libgif. We also assume that no x11 support is needed,
3669 # because if you are forcing this, then you _should_ know what
3670 # you are doing. [ Besides, package maintainers should never
3671 # have compiled x11 deps into libungif in the first place. ] )
3674 if test "$_force_gif" = yes && test "$_gif" = no
; then
3679 if test "$_gif" = yes ; then
3680 def_gif
='#define CONFIG_GIF 1'
3681 codecmodules
="gif $codecmodules"
3682 vomodules
="gif89a $vomodules"
3683 res_comment
="old version, some encoding functions disabled"
3684 def_gif_4
='#undef CONFIG_GIF_4'
3685 extra_ldflags
="$extra_ldflags $_ld_gif"
3691 #include <gif_lib.h>
3692 static void catch(int sig) { exit(1); }
3694 signal(SIGSEGV, catch); // catch segfault
3695 printf("EGifPutExtensionFirst is at address %p\n", EGifPutExtensionFirst);
3696 EGifSetGifVersion("89a"); // this will segfault a buggy gif lib.
3700 if cc_check
"$_ld_gif" ; then
3701 def_gif_4
='#define CONFIG_GIF_4 1'
3705 def_gif
='#undef CONFIG_GIF'
3706 def_gif_4
='#undef CONFIG_GIF_4'
3707 novomodules
="gif89a $novomodules"
3708 nocodecmodules
="gif $nocodecmodules"
3713 case "$_gif" in yes*)
3714 echocheck
"broken giflib workaround"
3715 def_gif_tvt_hack
='#define CONFIG_GIF_TVT_HACK 1'
3719 #include <gif_lib.h>
3721 GifFileType gif = {.UserData = NULL};
3722 printf("UserData is at address %p\n", gif.UserData);
3726 if cc_check
"$_ld_gif" ; then
3727 def_gif_tvt_hack
='#undef CONFIG_GIF_TVT_HACK'
3744 def_sdl_sdl_h
="#undef CONFIG_SDL_SDL_H"
3745 if test -z "$_sdlconfig" ; then
3746 if ( sdl-config
--version ) >>"$TMPLOG" 2>&1 ; then
3747 _sdlconfig
="sdl-config"
3748 elif ( sdl11-config
--version ) >>"$TMPLOG" 2>&1 ; then
3749 _sdlconfig
="sdl11-config"
3754 if test "$_sdl" = auto ||
test "$_sdl" = yes ; then
3756 #ifdef CONFIG_SDL_SDL_H
3757 #include <SDL/SDL.h>
3762 // we allow SDL hacking our main() only on OSX
3765 int main(int argc, char *argv[]) {
3766 SDL_Init(SDL_INIT_VIDEO|SDL_INIT_NOPARACHUTE);
3771 for _ld_tmp
in "-lSDL" "-lSDL -lpthread" "-lSDL -lwinmm -lgdi32" "-lSDL -lwinmm -lgdi32 -ldxguid" ; do
3772 if cc_check
-DCONFIG_SDL_SDL_H $_inc_tmp $_ld_tmp ; then
3774 def_sdl_sdl_h
="#define CONFIG_SDL_SDL_H 1"
3778 if test "$_sdl" = no
&& "$_sdlconfig" --version >>"$TMPLOG" 2>&1 ; then
3779 res_comment
="using $_sdlconfig"
3781 _inc_tmp
="$($_sdlconfig --cflags | cut -d " " -f 1,5,6 | sed s/no-cygwin/cygwin/)"
3782 _ld_tmp
="$($_sdlconfig --libs | cut -d " " -f 1,4,6 | sed s/no-cygwin/cygwin/)"
3784 _inc_tmp
=$
($_sdlconfig --cflags |
sed s
/-Dmain=SDL_main
//)
3785 _ld_tmp
=$
($_sdlconfig --libs |
sed -e s
/-mwindows// -e s
/-lmingw32//)
3787 _inc_tmp
="$($_sdlconfig --cflags)"
3788 _ld_tmp
="$($_sdlconfig --libs)"
3790 if cc_check
$_inc_tmp $_ld_tmp >>"$TMPLOG" 2>&1 ; then
3792 elif cc_check
$_inc_tmp $_ld_tmp -lstdc++ >>"$TMPLOG" 2>&1 ; then
3793 # HACK for BeOS/Haiku SDL
3794 _ld_tmp
="$_ld_tmp -lstdc++"
3799 if test "$_sdl" = yes ; then
3800 def_sdl
='#define CONFIG_SDL 1'
3801 extra_cflags
="$extra_cflags $_inc_tmp"
3802 libs_mplayer
="$libs_mplayer $_ld_tmp"
3803 vomodules
="sdl $vomodules"
3804 aomodules
="sdl $aomodules"
3806 def_sdl
='#undef CONFIG_SDL'
3807 novomodules
="sdl $novomodules"
3808 noaomodules
="sdl $noaomodules"
3813 # make sure this stays below CoreVideo to avoid issues due to namespace
3814 # conflicts between -lGL and -framework OpenGL
3816 #Note: this test is run even with --enable-gl since we autodetect linker flags
3817 if (test "$_x11" = yes ||
test "$_sdl" = yes ||
test "$_cocoa" = yes || win32
) && test "$_gl" != no
; then
3820 #include <windows.h>
3822 #elif defined(GL_SDL)
3824 #ifdef CONFIG_SDL_SDL_H
3825 #include <SDL/SDL.h>
3830 // we allow SDL hacking our main() only on OSX
3835 #include <X11/Xlib.h>
3838 int main(int argc, char *argv[]) {
3841 wglCreateContext(dc);
3842 #elif defined(GL_SDL)
3843 SDL_GL_SwapBuffers();
3845 glXCreateContext(NULL, NULL, NULL, True);
3852 if test "$_x11" = yes ; then
3853 for _ld_tmp
in "" -lGL "-lGL -lXdamage" "-lGL $_ld_pthread" ; do
3854 if cc_check
$_ld_tmp $_ld_lm ; then
3857 libs_mplayer
="$libs_mplayer $_ld_tmp $_ld_dl"
3862 if win32
&& cc_check
-DGL_WIN32 -lopengl32 ; then
3865 libs_mplayer
="$libs_mplayer -lopengl32 -lgdi32"
3867 if test "$_cocoa" = yes ; then
3871 # last so it can reuse any linker etc. flags detected before
3872 if test "$_sdl" = yes ; then
3873 if cc_check
-DGL_SDL ||
3874 cc_check
-DCONFIG_SDL_SDL_H -DGL_SDL ; then
3877 elif cc_check
-DGL_SDL -lGL ||
3878 cc_check
-DCONFIG_SDL_SDL_H -DGL_SDL -lGL ; then
3881 libs_mplayer
="$libs_mplayer -lGL"
3887 if test "$_gl" = yes ; then
3888 def_gl
='#define CONFIG_GL 1'
3889 res_comment
="backends:"
3890 if test "$_gl_cocoa" = yes ; then
3891 def_gl_cocoa
='#define CONFIG_GL_COCOA 1'
3892 res_comment
="$res_comment cocoa"
3894 if test "$_gl_win32" = yes ; then
3895 def_gl_win32
='#define CONFIG_GL_WIN32 1'
3896 res_comment
="$res_comment win32"
3898 if test "$_gl_x11" = yes ; then
3899 def_gl_x11
='#define CONFIG_GL_X11 1'
3900 res_comment
="$res_comment x11"
3902 if test "$_gl_sdl" = yes ; then
3903 def_gl_sdl
='#define CONFIG_GL_SDL 1'
3904 res_comment
="$res_comment sdl"
3906 vomodules
="opengl $vomodules"
3908 def_gl
='#undef CONFIG_GL'
3909 def_gl_cocoa
='#undef CONFIG_GL_COCOA'
3910 def_gl_win32
='#undef CONFIG_GL_WIN32'
3911 def_gl_x11
='#undef CONFIG_GL_X11'
3912 def_gl_sdl
='#undef CONFIG_GL_SDL'
3913 novomodules
="opengl $novomodules"
3920 echocheck
"Direct3D"
3921 if test "$_direct3d" = auto
; then
3923 header_check d3d9.h
&& _direct3d
=yes
3925 if test "$_direct3d" = yes ; then
3926 def_direct3d
='#define CONFIG_DIRECT3D 1'
3927 vomodules
="direct3d $vomodules"
3929 def_direct3d
='#undef CONFIG_DIRECT3D'
3930 novomodules
="direct3d $novomodules"
3932 echores
"$_direct3d"
3935 if test "$_directx" = auto
; then
3939 int main(void) { return 0; }
3942 cc_check
-lgdi32 && _directx
=yes
3944 if test "$_directx" = yes ; then
3945 def_directx
='#define CONFIG_DIRECTX 1'
3946 libs_mplayer
="$libs_mplayer -lgdi32"
3947 vomodules
="directx $vomodules"
3948 aomodules
="dsound $aomodules"
3950 def_directx
='#undef CONFIG_DIRECTX'
3951 novomodules
="directx $novomodules"
3952 noaomodules
="dsound $noaomodules"
3959 echocheck
"V4L2 MPEG Decoder"
3960 if test "$_v4l2" = auto
; then
3962 #include <sys/time.h>
3963 #include <linux/videodev2.h>
3964 #include <linux/version.h>
3966 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22)
3967 #error kernel headers too old, need 2.6.22
3969 struct v4l2_ext_controls ctrls;
3970 ctrls.ctrl_class = V4L2_CTRL_CLASS_MPEG;
3975 cc_check
&& _v4l2
=yes
3977 if test "$_v4l2" = yes ; then
3978 def_v4l2
='#define CONFIG_V4L2_DECODER 1'
3979 vomodules
="v4l2 $vomodules"
3980 aomodules
="v4l2 $aomodules"
3982 def_v4l2
='#undef CONFIG_V4L2_DECODER'
3983 novomodules
="v4l2 $novomodules"
3984 noaomodules
="v4l2 $noaomodules"
3995 echocheck
"OSS Audio"
3996 if test "$_ossaudio" = auto
; then
3998 return_check
$_soundcard_header SNDCTL_DSP_SETFRAGMENT
&& _ossaudio
=yes
4000 if test "$_ossaudio" = yes ; then
4001 def_ossaudio
='#define CONFIG_OSS_AUDIO 1'
4002 aomodules
="oss $aomodules"
4004 #include <$_soundcard_header>
4005 #ifdef OPEN_SOUND_SYSTEM
4006 int main(void) { return 0; }
4008 #error Not the real thing
4012 cc_check
&& _real_ossaudio
=yes
4013 if test "$_real_ossaudio" = yes; then
4014 def_ossaudio_devdsp
='#define PATH_DEV_DSP "/dev/dsp"'
4015 # Check for OSS4 headers (override default headers)
4016 # Does not apply to systems where OSS4 is native (e.g. FreeBSD)
4017 if test -f /etc
/oss.conf
; then
4019 _ossinc
="$OSSLIBDIR/include"
4020 if test -f "$_ossinc/sys/soundcard.h"; then
4021 extra_cflags
="-I$_ossinc $extra_cflags"
4024 elif netbsd || openbsd
; then
4025 def_ossaudio_devdsp
='#define PATH_DEV_DSP "/dev/sound"'
4026 extra_ldflags
="$extra_ldflags -lossaudio"
4028 def_ossaudio_devdsp
='#define PATH_DEV_DSP "/dev/dsp"'
4030 def_ossaudio_devmixer
='#define PATH_DEV_MIXER "/dev/mixer"'
4032 def_ossaudio
='#undef CONFIG_OSS_AUDIO'
4033 def_ossaudio_devdsp
='#define PATH_DEV_DSP ""'
4034 def_ossaudio_devmixer
='#define PATH_DEV_MIXER ""'
4035 noaomodules
="oss $noaomodules"
4037 echores
"$_ossaudio"
4041 if test "$_rsound" = auto
; then
4043 statement_check rsound.h
'rsd_init(NULL);' -lrsound && _rsound
=yes
4047 if test "$_rsound" = yes ; then
4048 def_rsound
='#define CONFIG_RSOUND 1'
4049 aomodules
="rsound $aomodules"
4050 libs_mplayer
="$libs_mplayer -lrsound"
4052 def_rsound
='#undef CONFIG_RSOUND'
4053 noaomodules
="rsound $noaomodules"
4058 if test "$_pulse" = auto
; then
4060 if pkg_config_add
'libpulse >= 0.9' ; then
4066 if test "$_pulse" = yes ; then
4067 def_pulse
='#define CONFIG_PULSE 1'
4068 aomodules
="pulse $aomodules"
4070 def_pulse
='#undef CONFIG_PULSE'
4071 noaomodules
="pulse $noaomodules"
4075 echocheck
"PortAudio"
4076 if test "$_portaudio" = auto
&& test "$_pthreads" != yes ; then
4078 res_comment
="pthreads not enabled"
4080 if test "$_portaudio" = auto
; then
4082 if pkg_config_add
'portaudio-2.0 >= 19' ; then
4086 echores
"$_portaudio"
4088 if test "$_portaudio" = yes ; then
4089 def_portaudio
='#define CONFIG_PORTAUDIO 1'
4090 aomodules
="portaudio $aomodules"
4092 def_portaudio
='#undef CONFIG_PORTAUDIO'
4093 noaomodules
="portaudio $noaomodules"
4098 if test "$_jack" = auto
; then
4100 if pkg_config_add jack
; then
4105 if test "$_jack" = yes ; then
4106 def_jack
='#define CONFIG_JACK 1'
4107 aomodules
="jack $aomodules"
4109 noaomodules
="jack $noaomodules"
4114 if test "$_openal" = auto
; then
4118 #include <OpenAL/al.h>
4123 alSourceQueueBuffers(0, 0, 0);
4124 // alGetSourcei(0, AL_SAMPLE_OFFSET, 0);
4128 for I
in "-lopenal" "-lopenal32" "-framework OpenAL" ; do
4129 cc_check
$I && _openal
=yes && break
4130 cc_check
-DOPENAL_AL_H=1 $I && def_openal_h
='#define OPENAL_AL_H 1' && _openal
=yes && break
4132 test "$_openal" = yes && libs_mplayer
="$libs_mplayer $I"
4134 if test "$_openal" = yes ; then
4135 def_openal
='#define CONFIG_OPENAL 1'
4136 aomodules
="openal $aomodules"
4138 noaomodules
="openal $noaomodules"
4142 echocheck
"ALSA audio"
4143 if test "$_alloca" != yes ; then
4145 res_comment
="alloca missing"
4147 if test "$_alsa" = auto
; then
4149 if pkg_config_add
"alsa >= 1.0.9" ; then
4153 def_alsa
='#undef CONFIG_ALSA'
4154 if test "$_alsa" = yes ; then
4155 aomodules
="alsa $aomodules"
4156 def_alsa
='#define CONFIG_ALSA 1'
4158 noaomodules
="alsa $noaomodules"
4164 echocheck
"CoreAudio"
4165 if test "$_coreaudio" = auto
; then
4167 #include <CoreAudio/CoreAudio.h>
4168 #include <AudioToolbox/AudioToolbox.h>
4169 #include <AudioUnit/AudioUnit.h>
4170 int main(void) { return 0; }
4173 cc_check
-framework CoreAudio
-framework AudioUnit
-framework AudioToolbox
&& _coreaudio
=yes
4175 if test "$_coreaudio" = yes ; then
4176 libs_mplayer
="$libs_mplayer -framework CoreAudio -framework AudioUnit -framework AudioToolbox"
4177 def_coreaudio
='#define CONFIG_COREAUDIO 1'
4178 aomodules
="coreaudio $aomodules"
4180 def_coreaudio
='#undef CONFIG_COREAUDIO'
4181 noaomodules
="coreaudio $noaomodules"
4187 # set default CD/DVD devices
4189 default_cdrom_device
="D:"
4191 default_cdrom_device
="/dev/disk1"
4192 elif dragonfly
; then
4193 default_cdrom_device
="/dev/cd0"
4195 default_cdrom_device
="/dev/acd0"
4197 default_cdrom_device
="/dev/rcd0c"
4199 default_cdrom_device
="a1ide.device:2"
4201 default_cdrom_device
="/dev/cdrom"
4204 if win32 || dragonfly || freebsd || openbsd || amigaos
; then
4205 default_dvd_device
=$default_cdrom_device
4207 default_dvd_device
="/dev/rdiskN"
4209 default_dvd_device
="/dev/dvd"
4213 echocheck
"VCD support"
4214 if test "$_vcd" = auto
; then
4216 if linux || freebsd || netbsd || openbsd || dragonfly || bsdos || darwin
; then
4219 header_check
ddk
/ntddcdrm.h
&& _vcd
=yes
4222 if test "$_vcd" = yes; then
4223 inputmodules
="vcd $inputmodules"
4224 def_vcd
='#define CONFIG_VCD 1'
4226 def_vcd
='#undef CONFIG_VCD'
4227 noinputmodules
="vcd $noinputmodules"
4228 res_comment
="not supported on this OS"
4234 echocheck
"Blu-ray support"
4235 if test "$_bluray" = auto
; then
4237 pkg_config_add
'libbluray >= 0.2.1' && _bluray
=yes
4239 if test "$_bluray" = yes ; then
4240 def_bluray
='#define CONFIG_LIBBLURAY 1'
4241 inputmodules
="bluray $inputmodules"
4243 def_bluray
='#undef CONFIG_LIBBLURAY'
4244 noinputmodules
="bluray $noinputmodules"
4249 if test "$_dvdread_internal" = auto
&& test ! -f "libdvdread4/dvd_reader.c" ; then
4250 _dvdread_internal
=no
4252 if test "$_dvdread_internal" = auto
; then
4253 _dvdread_internal
=no
4255 if (linux || freebsd || netbsd || openbsd || dragonfly || hpux
) &&
4256 (test "$_dvd" = yes ||
test "$_cdrom" = yes ||
test "$_cdio" = yes ||
4257 test "$_dvdio" = yes ||
test "$_bsdi_dvd" = yes) ||
4258 darwin || win32
; then
4259 _dvdread_internal
=yes
4261 extra_cflags
="-Ilibdvdread4 $extra_cflags"
4263 elif test "$_dvdread" = auto
; then
4265 if test "$_dl" = yes; then
4266 _dvdreadcflags
=$
($_dvdreadconfig --cflags 2> /dev
/null
)
4267 _dvdreadlibs
=$
($_dvdreadconfig --libs 2> /dev
/null
)
4268 if header_check dvdread
/dvd_reader.h
$_dvdreadcflags $_dvdreadlibs $_ld_dl ; then
4270 extra_cflags
="$extra_cflags $_dvdreadcflags"
4271 extra_ldflags
="$extra_ldflags $_dvdreadlibs"
4272 res_comment
="external"
4277 if test "$_dvdread_internal" = yes; then
4278 def_dvdread
='#define CONFIG_DVDREAD 1'
4279 inputmodules
="dvdread(internal) $inputmodules"
4280 res_comment
="internal"
4281 elif test "$_dvdread" = yes; then
4282 def_dvdread
='#define CONFIG_DVDREAD 1'
4283 extra_ldflags
="$extra_ldflags -ldvdread"
4284 inputmodules
="dvdread(external) $inputmodules"
4285 res_comment
="external"
4287 def_dvdread
='#undef CONFIG_DVDREAD'
4288 noinputmodules
="dvdread $noinputmodules"
4293 echocheck
"internal libdvdcss"
4294 if test "$_libdvdcss_internal" = auto
; then
4295 _libdvdcss_internal
=no
4296 test "$_dvdread_internal" = yes && test -d libdvdcss
&& _libdvdcss_internal
=yes
4297 hpux
&& test "$_hpux_scsi_h" = no
&& _libdvdcss_internal
=no
4299 if test "$_libdvdcss_internal" = yes ; then
4300 if linux || netbsd || openbsd || bsdos
; then
4301 def_dvd_linux
='#define HAVE_LINUX_DVD_STRUCT 1'
4302 openbsd
&& def_dvd_openbsd
='#define HAVE_OPENBSD_DVD_STRUCT 1'
4303 elif freebsd || dragonfly
; then
4304 def_dvd_bsd
='#define HAVE_BSD_DVD_STRUCT 1'
4306 def_dvd_darwin
='#define DARWIN_DVD_IOCTL'
4307 extra_ldflags
="$extra_ldflags -framework IOKit -framework Carbon"
4309 cflags_libdvdcss
="-DSYS_CYGWIN -DWIN32"
4311 cflags_libdvdcss
="-DSYS_BEOS"
4313 cflags_libdvdcss_dvdread
="-Ilibdvdcss"
4314 def_dvdcss
="#define HAVE_DVDCSS_DVDCSS_H 1"
4315 inputmodules
="libdvdcss(internal) $inputmodules"
4317 noinputmodules
="libdvdcss(internal) $noinputmodules"
4319 echores
"$_libdvdcss_internal"
4323 if test "$_libcdio" = auto
; then
4325 if pkg_config_add libcdio_paranoia
; then
4329 if test "$_libcdio" = yes ; then
4331 def_cdda
='#define CONFIG_CDDA 1'
4332 test $_cddb = auto
&& test $networking = yes && _cddb
=yes
4333 inputmodules
="cdda $inputmodules"
4337 def_cdda
='#undef CONFIG_CDDA'
4338 noinputmodules
="cdda $noinputmodules"
4342 if test "$_cddb" = yes ; then
4343 def_cddb
='#define CONFIG_CDDB 1'
4344 inputmodules
="cddb $inputmodules"
4347 def_cddb
='#undef CONFIG_CDDB'
4348 noinputmodules
="cddb $noinputmodules"
4352 echocheck
"SSA/ASS support"
4353 if test "$_ass" = auto
; then
4354 if pkg_config_add libass
; then
4356 def_ass
='#define CONFIG_ASS 1'
4358 die
"Unable to find development files for libass. Aborting. If you really mean to compile without libass support use --disable-libass."
4361 def_ass
='#undef CONFIG_ASS'
4367 if test "$_enca" = auto
; then
4369 statement_check enca.h
'enca_get_languages(NULL)' -lenca $_ld_lm && _enca
=yes
4371 if test "$_enca" = yes ; then
4372 def_enca
='#define CONFIG_ENCA 1'
4373 extra_ldflags
="$extra_ldflags -lenca"
4375 def_enca
='#undef CONFIG_ENCA'
4382 statement_check zlib.h
'inflate(0, Z_NO_FLUSH)' -lz && _zlib
=yes
4383 if test "$_zlib" = yes ; then
4384 def_zlib
='#define CONFIG_ZLIB 1'
4385 extra_ldflags
="$extra_ldflags -lz"
4387 def_zlib
='#define CONFIG_ZLIB 0'
4393 if test "$_rtc" = auto
; then
4395 #include <sys/ioctl.h>
4397 #include <linux/rtc.h>
4400 #define RTC_PIE_ON RTCIO_PIE_ON
4402 int main(void) { return RTC_PIE_ON; }
4405 cc_check
&& _rtc
=yes
4408 if test "$_rtc" = yes ; then
4409 def_rtc
='#define HAVE_RTC 1'
4411 def_rtc
='#undef HAVE_RTC'
4416 echocheck
"mad support"
4417 if test "$_mad" = auto
; then
4419 header_check mad.h
-lmad && _mad
=yes
4421 if test "$_mad" = yes ; then
4422 def_mad
='#define CONFIG_LIBMAD 1'
4423 extra_ldflags
="$extra_ldflags -lmad"
4424 codecmodules
="libmad $codecmodules"
4426 def_mad
='#undef CONFIG_LIBMAD'
4427 nocodecmodules
="libmad $nocodecmodules"
4431 echocheck
"OggVorbis support"
4432 if test "$_libvorbis" = auto
; then
4434 statement_check vorbis
/codec.h
'vorbis_packet_blocksize(0, 0)' -lvorbis -logg $_ld_lm && _libvorbis
=yes && _tremor
=no
4435 elif test "$_libvorbis" = yes ; then
4438 if test "$_tremor" = auto
; then
4440 statement_check tremor
/ivorbiscodec.h
'vorbis_packet_blocksize(0, 0)' -logg -lvorbisidec $_ld_lm && _tremor
=yes
4442 if test "$_tremor" = yes ; then
4444 def_vorbis
='#define CONFIG_OGGVORBIS 1'
4445 def_tremor
='#define CONFIG_TREMOR 1'
4446 codecmodules
="tremor(external) $codecmodules"
4447 res_comment
="external Tremor"
4448 extra_ldflags
="$extra_ldflags -logg -lvorbisidec"
4449 elif test "$_libvorbis" = yes ; then
4451 def_vorbis
='#define CONFIG_OGGVORBIS 1'
4452 codecmodules
="libvorbis $codecmodules"
4453 res_comment
="libvorbis"
4454 extra_ldflags
="$extra_ldflags -lvorbis -logg"
4457 nocodecmodules
="libvorbis $nocodecmodules"
4461 echocheck
"libspeex (version >= 1.1 required)"
4462 if test "$_speex" = auto
; then
4466 #include <speex/speex.h>
4467 int main(void) { SpeexBits bits; void *dec = NULL; speex_decode_int(dec, &bits, dec); return 0; }
4469 cc_check
-lspeex $_ld_lm && _speex
=yes
4471 if test "$_speex" = yes ; then
4472 def_speex
='#define CONFIG_SPEEX 1'
4473 extra_ldflags
="$extra_ldflags -lspeex"
4474 codecmodules
="speex $codecmodules"
4476 def_speex
='#undef CONFIG_SPEEX'
4477 nocodecmodules
="speex $nocodecmodules"
4481 echocheck
"OggTheora support"
4482 if test "$_theora" = auto
; then
4484 if pkg_config_add theora
; then
4488 if test "$_theora" = yes ; then
4489 def_theora
='#define CONFIG_OGGTHEORA 1'
4490 codecmodules
="libtheora $codecmodules"
4492 def_theora
='#undef CONFIG_OGGTHEORA'
4493 nocodecmodules
="libtheora $nocodecmodules"
4497 # Any version of libmpg123 that knows MPG123_RESYNC_LIMIT shall be fine.
4498 # That is, 1.2.0 onwards. Recommened is 1.14 onwards, though.
4499 echocheck
"mpg123 support"
4500 def_mpg123
='#undef CONFIG_MPG123'
4501 if test "$_mpg123" = auto
; then
4503 pkg_config_add
'libmpg123 >= 1.2.0' && _mpg123
=yes
4505 if test "$_mpg123" = yes ; then
4506 def_mpg123
='#define CONFIG_MPG123 1'
4507 codecmodules
="mpg123 $codecmodules"
4509 nocodecmodules
="mpg123 $nocodecmodules"
4513 echocheck
"liba52 support"
4514 def_liba52
='#undef CONFIG_LIBA52'
4515 if test "$_liba52" = auto
; then
4518 #include <inttypes.h>
4519 #include <a52dec/a52.h>
4520 int main(void) { a52_state_t *testHand; testHand=a52_init(0); return 0; }
4522 cc_check
-la52 && _liba52
=yes && extra_ldflags
="$extra_ldflags -la52"
4524 if test "$_liba52" = yes ; then
4525 def_liba52
='#define CONFIG_LIBA52 1'
4526 codecmodules
="liba52 $codecmodules"
4528 nocodecmodules
="liba52 $nocodecmodules"
4532 echocheck
"libdca support"
4533 if test "$_libdca" = auto
; then
4535 for _ld_dca
in -ldca -ldts ; do
4536 statement_check_broken stdint.h dts.h
'dts_init(0)' $_ld_dca $_ld_lm &&
4537 extra_ldflags
="$extra_ldflags $_ld_dca" && _libdca
=yes && break
4540 if test "$_libdca" = yes ; then
4541 def_libdca
='#define CONFIG_LIBDCA 1'
4542 codecmodules
="libdca $codecmodules"
4544 def_libdca
='#undef CONFIG_LIBDCA'
4545 nocodecmodules
="libdca $nocodecmodules"
4549 echocheck
"libmpcdec (musepack, version >= 1.2.1 required)"
4550 if test "$_musepack" = yes ; then
4554 #include <mpcdec/mpcdec.h>
4556 mpc_streaminfo info;
4557 mpc_decoder decoder;
4558 mpc_decoder_set_streaminfo(&decoder, &info);
4559 mpc_decoder_decode_frame(&decoder, NULL, 0, NULL);
4563 cc_check
-lmpcdec $_ld_lm && _musepack
=yes
4565 if test "$_musepack" = yes ; then
4566 def_musepack
='#define CONFIG_MUSEPACK 1'
4567 extra_ldflags
="$extra_ldflags -lmpcdec"
4568 codecmodules
="musepack $codecmodules"
4570 def_musepack
='#undef CONFIG_MUSEPACK'
4571 nocodecmodules
="musepack $nocodecmodules"
4573 echores
"$_musepack"
4576 echocheck
"FAAD2 support"
4577 if test "$_faad" = auto
; then
4581 #ifndef FAAD_MIN_STREAMSIZE
4582 #error Too old version
4584 int main(void) { faacDecHandle testhand; faacDecFrameInfo testinfo;
4585 testhand = faacDecOpen(); faacDecInit(0, 0, 0, 0, 0); return 0; }
4587 cc_check
-lfaad $_ld_lm && _faad
=yes
4590 def_faad
='#undef CONFIG_FAAD'
4591 if test "$_faad" = yes ; then
4592 def_faad
='#define CONFIG_FAAD 1'
4593 extra_ldflags
="$extra_ldflags -lfaad"
4594 codecmodules
="faad2 $codecmodules"
4596 nocodecmodules
="faad2 $nocodecmodules"
4601 echocheck
"LADSPA plugin support"
4602 if test "$_ladspa" = auto
; then
4604 statement_check ladspa.h
'LADSPA_Descriptor ld = {0}' && _ladspa
=yes
4606 if test "$_ladspa" = yes; then
4607 def_ladspa
="#define CONFIG_LADSPA 1"
4609 def_ladspa
="#undef CONFIG_LADSPA"
4614 echocheck
"libbs2b audio filter support"
4615 if test "$_libbs2b" = auto
; then
4617 if pkg_config_add libbs2b
; then
4621 def_libbs2b
="#undef CONFIG_LIBBS2B"
4622 test "$_libbs2b" = yes && def_libbs2b
="#define CONFIG_LIBBS2B 1"
4626 if test -z "$_codecsdir" ; then
4627 for dir
in "$_libdir/codecs" "$_libdir/win32" /usr
/local
/lib
/codecs \
4628 /usr
/lib
/codecs
/usr
/local
/lib
/win32
/usr
/lib
/win32
; do
4629 if test -d "$dir" ; then
4635 # Fall back on default directory.
4636 if test -z "$_codecsdir" ; then
4637 _codecsdir
="$_libdir/codecs"
4638 mingw32
&& _codecsdir
="codecs"
4642 echocheck
"Win32 codecs"
4643 if test "$_win32dll" = auto
; then
4645 if x86_32
&& ! qnx
; then
4649 if test "$_win32dll" = yes ; then
4650 def_win32dll
='#define CONFIG_WIN32DLL 1'
4652 def_win32_loader
='#define WIN32_LOADER 1'
4653 _win32_emulation
=yes
4655 extra_ldflags
="$extra_ldflags -ladvapi32 -lole32"
4656 res_comment
="using native windows"
4658 codecmodules
="win32 $codecmodules"
4660 def_win32dll
='#undef CONFIG_WIN32DLL'
4661 def_win32_loader
='#undef WIN32_LOADER'
4662 nocodecmodules
="win32 $nocodecmodules"
4664 echores
"$_win32dll"
4667 echocheck
"XAnim codecs"
4668 if test "$_xanim" = auto
; then
4670 res_comment
="dynamic loader support needed"
4671 if test "$_dl" = yes ; then
4675 if test "$_xanim" = yes ; then
4676 def_xanim
='#define CONFIG_XANIM 1'
4677 codecmodules
="xanim $codecmodules"
4679 def_xanim
='#undef CONFIG_XANIM'
4680 nocodecmodules
="xanim $nocodecmodules"
4685 echocheck
"RealPlayer codecs"
4686 if test "$_real" = auto
; then
4688 res_comment
="dynamic loader support needed"
4689 if test "$_dl" = yes ||
test "$_win32dll" = yes &&
4690 (linux || freebsd || netbsd || openbsd || dragonfly || darwin || win32
) ; then
4694 if test "$_real" = yes ; then
4695 def_real
='#define CONFIG_REALCODECS 1'
4696 codecmodules
="real $codecmodules"
4698 def_real
='#undef CONFIG_REALCODECS'
4699 nocodecmodules
="real $nocodecmodules"
4704 echocheck
"QuickTime codecs"
4706 def_qtx_win32
='#undef CONFIG_QTX_CODECS_WIN32'
4707 if test "$_qtx" = auto
; then
4708 test "$_win32dll" = yes ||
test "$quicktime" = yes && _qtx
=yes
4710 if test "$_qtx" = yes ; then
4711 def_qtx
='#define CONFIG_QTX_CODECS 1'
4712 win32
&& _qtx_codecs_win32
=yes && def_qtx_win32
='#define CONFIG_QTX_CODECS_WIN32 1'
4713 codecmodules
="qtx $codecmodules"
4714 darwin || win32 || _qtx_emulation
=yes
4716 def_qtx
='#undef CONFIG_QTX_CODECS'
4717 nocodecmodules
="qtx $nocodecmodules"
4721 echocheck
"LCMS2 support"
4722 if test "$_lcms2" = auto
; then
4724 if pkg_config_add lcms2
; then
4728 if test "$_lcms2" = yes; then
4729 def_lcms2
="#define CONFIG_LCMS2 1"
4731 def_lcms2
="#undef CONFIG_LCMS2"
4736 all_libav_libs
="libavutil > 51.21.0:libavcodec >= 54.25.0:libavformat > 53.20.0:libswscale >= 2.0.0"
4737 echocheck
"Libav ($all_libav_libs)"
4738 if test "$ffmpeg" = auto
; then
4739 IFS
=":" # shell should not be used for programming
4740 if ! pkg_config_add
$all_libav_libs ; then
4741 die
"Unable to find development files for some of the required Libav libraries above. Aborting."
4746 echocheck
"libpostproc >= 52.0.0"
4747 if test "$libpostproc" = auto
; then
4749 if pkg_config_add
"libpostproc >= 52.0.0" ; then
4753 if test "$libpostproc" = yes ; then
4754 def_libpostproc
='#define CONFIG_LIBPOSTPROC 1'
4756 def_libpostproc
='#undef CONFIG_LIBPOSTPROC'
4758 echores
"$libpostproc"
4760 echocheck
"libavresample >= 1.0.0"
4761 if test "$libavresample" = auto
; then
4763 if pkg_config_add
"libavresample >= 1.0.0" ; then
4767 if test "$libavresample" = yes ; then
4768 def_libavresample
='#define CONFIG_LIBAVRESAMPLE 1'
4770 def_libavresample
='#undef CONFIG_LIBAVRESAMPLE'
4772 echores
"$libavresample"
4774 echocheck
"libdv-0.9.5+"
4775 if test "$_libdv" = auto
; then
4777 statement_check libdv
/dv.h
'dv_encoder_new(1, 1, 1)' -ldv $_ld_pthread $_ld_lm && _libdv
=yes
4779 if test "$_libdv" = yes ; then
4780 def_libdv
='#define CONFIG_LIBDV095 1'
4781 extra_ldflags
="$extra_ldflags -ldv"
4782 codecmodules
="libdv $codecmodules"
4784 def_libdv
='#undef CONFIG_LIBDV095'
4785 nocodecmodules
="libdv $nocodecmodules"
4791 if test "$_xvid" = auto
; then
4793 for _ld_tmp
in "-lxvidcore $_ld_lm" "-lxvidcore $_ld_lm $_ld_pthread" ; do
4794 statement_check xvid.h
'xvid_global(0, 0, 0, 0)' $_ld_tmp &&
4795 extra_ldflags
="$extra_ldflags $_ld_tmp" && _xvid
=yes && break
4799 if test "$_xvid" = yes ; then
4800 def_xvid
='#define CONFIG_XVID4 1'
4801 codecmodules
="xvid $codecmodules"
4803 def_xvid
='#undef CONFIG_XVID4'
4804 nocodecmodules
="xvid $nocodecmodules"
4810 if test "$_libnut" = auto
; then
4812 statement_check libnut.h
'nut_context_tt * nut; nut_error(0)' -lnut && _libnut
=yes
4815 if test "$_libnut" = yes ; then
4816 def_libnut
='#define CONFIG_LIBNUT 1'
4817 extra_ldflags
="$extra_ldflags -lnut"
4819 def_libnut
='#undef CONFIG_LIBNUT'
4824 echocheck
"UnRAR executable"
4825 if test "$_unrar_exec" = auto
; then
4827 mingw32
&& _unrar_exec
="no"
4829 if test "$_unrar_exec" = yes ; then
4830 def_unrar_exec
='#define CONFIG_UNRAR_EXEC 1'
4832 def_unrar_exec
='#undef CONFIG_UNRAR_EXEC'
4834 echores
"$_unrar_exec"
4836 echocheck
"TV interface"
4837 if test "$_tv" = yes ; then
4838 def_tv
='#define CONFIG_TV 1'
4839 inputmodules
="tv $inputmodules"
4841 noinputmodules
="tv $noinputmodules"
4842 def_tv
='#undef CONFIG_TV'
4847 if freebsd || netbsd || openbsd || dragonfly || bsdos
; then
4848 echocheck
"*BSD BT848 bt8xx header"
4850 for file in "machine/ioctl_bt848.h" \
4851 "dev/bktr/ioctl_bt848.h" \
4852 "dev/video/bktr/ioctl_bt848.h" \
4853 "dev/ic/bt8xx.h" ; do
4855 #include <sys/types.h>
4856 #include <sys/ioctl.h>
4858 int main(void) { ioctl(0, TVTUNER_GETFREQ, 0); return 0; }
4862 _ioctl_bt848_h_name
="$file"
4866 if test "$_ioctl_bt848_h" = yes ; then
4867 def_ioctl_bt848_h_name
="#define IOCTL_BT848_H_NAME <$_ioctl_bt848_h_name>"
4868 res_comment
="using $_ioctl_bt848_h_name"
4870 def_ioctl_bt848_h_name
="#undef IOCTL_BT848_H_NAME"
4872 echores
"$_ioctl_bt848_h"
4874 echocheck
"*BSD ioctl_meteor.h"
4876 for ioctl_meteor_h_path
in "machine/ioctl_meteor.h" "dev/bktr/ioctl_meteor.h" "dev/video/bktr/ioctl_meteor.h" ; do
4877 statement_check_broken
"sys/types.h" "$ioctl_meteor_h_path" 'ioctl(0, METEORSINPUT, 0)' &&
4878 _ioctl_meteor_h
=yes && break
4880 if test "$_ioctl_meteor_h" = yes ; then
4881 def_ioctl_meteor_h_name
="#define IOCTL_METEOR_H_NAME <$ioctl_meteor_h_path>"
4882 res_comment
="using $ioctl_meteor_h_path"
4884 def_ioctl_meteor_h_name
="#undef IOCTL_METEOR_H_NAME"
4886 echores
"$_ioctl_meteor_h"
4888 echocheck
"*BSD BrookTree 848 TV interface"
4889 if test "$_tv_bsdbt848" = auto
; then
4891 if test "$_tv" = yes ; then
4893 #include <sys/types.h>
4894 $def_ioctl_meteor_h_name
4895 $def_ioctl_bt848_h_name
4896 #ifdef IOCTL_METEOR_H_NAME
4897 #include IOCTL_METEOR_H_NAME
4899 #ifdef IOCTL_BT848_H_NAME
4900 #include IOCTL_BT848_H_NAME
4903 ioctl(0, METEORSINPUT, 0);
4904 ioctl(0, TVTUNER_GETFREQ, 0);
4908 cc_check
&& _tv_bsdbt848
=yes
4911 if test "$_tv_bsdbt848" = yes ; then
4912 def_tv_bsdbt848
='#define CONFIG_TV_BSDBT848 1'
4913 inputmodules
="tv-bsdbt848 $inputmodules"
4915 def_tv_bsdbt848
='#undef CONFIG_TV_BSDBT848'
4916 noinputmodules
="tv-bsdbt848 $noinputmodules"
4918 echores
"$_tv_bsdbt848"
4919 fi #if freebsd || netbsd || openbsd || dragonfly || bsdos
4922 echocheck
"DirectShow TV interface"
4923 if test "$_tv_dshow" = auto
; then
4925 if test "$_tv" = yes && win32
; then
4926 statement_check ole2.h
'void* p; CoCreateInstance((GUID*)&GUID_NULL, NULL, CLSCTX_INPROC_SERVER, &GUID_NULL, &p)' -lole32 -luuid && _tv_dshow
=yes
4929 if test "$_tv_dshow" = yes ; then
4930 inputmodules
="tv-dshow $inputmodules"
4931 def_tv_dshow
='#define CONFIG_TV_DSHOW 1'
4932 extra_ldflags
="$extra_ldflags -lole32 -luuid"
4934 noinputmodules
="tv-dshow $noinputmodules"
4935 def_tv_dshow
='#undef CONFIG_TV_DSHOW'
4937 echores
"$_tv_dshow"
4940 echocheck
"Video 4 Linux 2 TV interface"
4941 if test "$_tv_v4l2" = auto
; then
4943 if test "$_tv" = yes && linux
; then
4944 header_check_broken sys
/time.h linux
/videodev2.h
&& _tv_v4l2
=yes
4945 elif test "$_tv" = yes && test "$sys_videoio_h" = "yes" ; then
4949 if test "$_tv_v4l2" = yes ; then
4951 def_tv_v4l2
='#define CONFIG_TV_V4L2 1'
4952 inputmodules
="tv-v4l2 $inputmodules"
4954 noinputmodules
="tv-v4l2 $noinputmodules"
4955 def_tv_v4l2
='#undef CONFIG_TV_V4L2'
4960 echocheck
"Radio interface"
4961 if test "$_radio" = yes ; then
4962 def_radio
='#define CONFIG_RADIO 1'
4963 inputmodules
="radio $inputmodules"
4964 if test "$_alsa" != yes -a "$_ossaudio" != yes ; then
4967 if test "$_radio_capture" = yes ; then
4969 def_radio_capture
="#define CONFIG_RADIO_CAPTURE 1"
4971 def_radio_capture
="#undef CONFIG_RADIO_CAPTURE"
4974 noinputmodules
="radio $noinputmodules"
4975 def_radio
='#undef CONFIG_RADIO'
4976 def_radio_capture
="#undef CONFIG_RADIO_CAPTURE"
4980 echocheck
"Capture for Radio interface"
4981 echores
"$_radio_capture"
4983 echocheck
"Video 4 Linux 2 Radio interface"
4984 if test "$_radio_v4l2" = auto
; then
4986 if test "$_radio" = yes && linux
; then
4987 header_check linux
/videodev2.h
&& _radio_v4l2
=yes
4990 if test "$_radio_v4l2" = yes ; then
4991 def_radio_v4l2
='#define CONFIG_RADIO_V4L2 1'
4993 def_radio_v4l2
='#undef CONFIG_RADIO_V4L2'
4995 echores
"$_radio_v4l2"
4997 if freebsd || netbsd || openbsd || dragonfly || bsdos
&&
4998 test "$_radio" = yes && test "$_radio_bsdbt848" = auto
; then
4999 echocheck
"*BSD BrookTree 848 Radio interface"
5002 #include <sys/types.h>
5003 $def_ioctl_bt848_h_name
5004 #ifdef IOCTL_BT848_H_NAME
5005 #include IOCTL_BT848_H_NAME
5007 int main(void) { ioctl(0, RADIO_GETFREQ, 0); return 0; }
5009 cc_check
&& _radio_bsdbt848
=yes
5010 echores
"$_radio_bsdbt848"
5011 fi #if freebsd || netbsd || openbsd || dragonfly || bsdos && _radio && _radio_bsdbt848
5013 if test "$_radio_bsdbt848" = yes ; then
5014 def_radio_bsdbt848
='#define CONFIG_RADIO_BSDBT848 1'
5016 def_radio_bsdbt848
='#undef CONFIG_RADIO_BSDBT848'
5019 if test "$_radio_v4l2" = no
&&
5020 test "$_radio_bsdbt848" = no
&& test "$_radio" = yes ; then
5021 die
"Radio driver requires BSD BT848 or V4L2!"
5024 echocheck
"Video 4 Linux 2 MPEG PVR interface"
5025 if test "$_pvr" = auto
; then
5027 if test "$_tv_v4l2" = yes && linux
; then
5029 #include <sys/time.h>
5030 #include <linux/videodev2.h>
5031 int main(void) { struct v4l2_ext_controls ext; return ext.controls->value; }
5033 cc_check
&& _pvr
=yes
5036 if test "$_pvr" = yes ; then
5037 def_pvr
='#define CONFIG_PVR 1'
5038 inputmodules
="pvr $inputmodules"
5040 noinputmodules
="pvr $noinputmodules"
5041 def_pvr
='#undef CONFIG_PVR'
5047 if test "$_ftp" = "auto" ; then
5048 test "$networking" = "yes" && ! beos
&& _ftp
=yes
5050 if test "$_ftp" = yes ; then
5051 def_ftp
='#define CONFIG_FTP 1'
5052 inputmodules
="ftp $inputmodules"
5054 noinputmodules
="ftp $noinputmodules"
5055 def_ftp
='#undef CONFIG_FTP'
5059 echocheck
"vstream client"
5060 if test "$_vstream" = auto
; then
5063 #include <vstream-client.h>
5064 void vstream_error(const char *format, ... ) {}
5065 int main(void) { vstream_start(); return 0; }
5067 cc_check
-lvstream-client && _vstream
=yes
5069 if test "$_vstream" = yes ; then
5070 def_vstream
='#define CONFIG_VSTREAM 1'
5071 inputmodules
="vstream $inputmodules"
5072 extra_ldflags
="$extra_ldflags -lvstream-client"
5074 noinputmodules
="vstream $noinputmodules"
5075 def_vstream
='#undef CONFIG_VSTREAM'
5080 echocheck
"XMMS inputplugin support"
5081 if test "$_xmms" = yes ; then
5082 if ( xmms-config
--version ) >/dev
/null
2>&1 ; then
5083 _xmmsplugindir
=$
(xmms-config
--input-plugin-dir)
5084 _xmmslibdir
=$
(xmms-config
--exec-prefix)/lib
5086 _xmmsplugindir
=/usr
/lib
/xmms
/Input
5087 _xmmslibdir
=/usr
/lib
5090 def_xmms
='#define CONFIG_XMMS 1'
5092 extra_ldflags
="$extra_ldflags ${_xmmslibdir}/libxmms.dylib"
5094 extra_ldflags
="$extra_ldflags ${_xmmslibdir}/libxmms.so.1 -export-dynamic"
5097 def_xmms
='#undef CONFIG_XMMS'
5101 if test "$_charset" != "noconv" ; then
5102 def_charset
="#define MSG_CHARSET \"$_charset\""
5104 def_charset
="#undef MSG_CHARSET"
5108 #############################################################################
5110 echocheck
"automatic gdb attach"
5111 if test "$_crash_debug" = yes ; then
5112 def_crash_debug
='#define CONFIG_CRASH_DEBUG 1'
5114 def_crash_debug
='#undef CONFIG_CRASH_DEBUG'
5117 echores
"$_crash_debug"
5119 echocheck
"compiler support for noexecstack"
5120 if cflag_check
-Wl,-z,noexecstack
; then
5121 extra_ldflags
="-Wl,-z,noexecstack $extra_ldflags"
5127 echocheck
"linker support for --nxcompat --no-seh --dynamicbase"
5128 if cflag_check
"-Wl,--nxcompat -Wl,--no-seh -Wl,--dynamicbase" ; then
5129 extra_ldflags
="-Wl,--nxcompat -Wl,--no-seh -Wl,--dynamicbase $extra_ldflags"
5136 # Dynamic linking flags
5137 # (FIXME: 'echocheck "dynamic linking"' above and modify here accordingly)
5139 freebsd || netbsd || openbsd || dragonfly || bsdos
&& _ld_dl_dynamic
='-rdynamic'
5140 if test "$_real" = yes ||
test "$_xanim" = yes && ! win32
&& ! qnx
&& ! darwin
; then
5141 _ld_dl_dynamic
='-rdynamic'
5144 extra_ldflags
="$extra_ldflags $_ld_pthread $_ld_dl $_ld_dl_dynamic"
5145 bsdos
&& extra_ldflags
="$extra_ldflags -ldvd"
5146 (netbsd || openbsd
) && x86_32
&& extra_ldflags
="$extra_ldflags -li386"
5148 def_debug
='#undef MP_DEBUG'
5149 test "$_debug" != "" && def_debug
='#define MP_DEBUG 1'
5152 echocheck
"joystick"
5153 def_joystick
='#undef CONFIG_JOYSTICK'
5154 if test "$_joystick" = yes ; then
5155 if linux || freebsd
; then
5156 # TODO add some check
5157 def_joystick
='#define CONFIG_JOYSTICK 1'
5160 res_comment
="unsupported under $system_name"
5163 echores
"$_joystick"
5166 if test "$_lirc" = auto
; then
5168 header_check lirc
/lirc_client.h
-llirc_client && _lirc
=yes
5170 if test "$_lirc" = yes ; then
5171 def_lirc
='#define CONFIG_LIRC 1'
5172 libs_mplayer
="$libs_mplayer -llirc_client"
5174 def_lirc
='#undef CONFIG_LIRC'
5179 if test "$_lircc" = auto
; then
5181 header_check lirc
/lircc.h
-llircc && _lircc
=yes
5183 if test "$_lircc" = yes ; then
5184 def_lircc
='#define CONFIG_LIRCC 1'
5185 libs_mplayer
="$libs_mplayer -llircc"
5187 def_lircc
='#undef CONFIG_LIRCC'
5191 #############################################################################
5193 CFLAGS
="$CFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE"
5195 # This must be the last test to be performed. Any other tests following it
5196 # could fail due to linker errors. libdvdnavmini is intentionally not linked
5197 # against libdvdread (to permit MPlayer to use its own copy of the library).
5198 # So any compilation using the flags added here but not linking against
5199 # libdvdread can fail.
5200 echocheck
"DVD support (libdvdnav)"
5201 if test "$_dvdread_internal" = yes && test ! -f "libdvdnav/dvdnav.c" ; then
5205 if test "$_dvdnav" = auto
; then
5206 if test "$_dvdread_internal" = yes ; then
5209 res_comment
="internal"
5211 $_dvdnavconfig --version --minilibs >> $TMPLOG 2>&1 || _dvdnav
=no
5214 if test "$_dvdnav" = auto
; then
5216 _dvdnavdir
=$
($_dvdnavconfig --cflags)
5217 _dvdnavlibs
=$
($_dvdnavconfig --libs)
5218 statement_check_broken stdint.h dvdnav
/dvdnav.h
'dvdnav_t *dvd = 0' $_dvdnavdir $_dvdnavlibs $_ld_dl $_ld_pthread && _dvdnav
=yes
5220 if test "$_dvdnav" = yes ; then
5221 def_dvdnav
='#define CONFIG_DVDNAV 1'
5222 if test "$dvdnav_internal" = yes ; then
5223 cflags_libdvdnav
="-Ilibdvdnav"
5224 inputmodules
="dvdnav(internal) $inputmodules"
5226 extra_cflags
="$extra_cflags $($_dvdnavconfig --cflags)"
5227 extra_ldflags
="$extra_ldflags $($_dvdnavconfig --minilibs)"
5228 inputmodules
="dvdnav $inputmodules"
5231 def_dvdnav
='#undef CONFIG_DVDNAV'
5232 noinputmodules
="dvdnav $noinputmodules"
5236 # DO NOT ADD ANY TESTS THAT USE LINKER FLAGS HERE (like cc_check).
5237 # Read dvdnav comment above.
5240 list
=$
(echo $1 |
tr '[a-z]' '[A-Z]')
5241 item
=$
(echo $2 |
tr '[a-z]' '[A-Z]')
5243 for part
in $list; do
5244 if $
(echo $item |
grep -q -E "(^| )$part($| )"); then
5245 echo "${nprefix}_$part = yes"
5250 #############################################################################
5251 echo "Creating config.mak"
5252 cat > config.mak
<< EOF
5253 # -------- Generated by configure -----------
5255 # Ensure that locale settings do not interfere with shell commands.
5258 CONFIGURATION = $configuration
5261 DOC_LANGS = $language_doc
5262 DOC_LANG_ALL = $doc_lang_all
5263 MAN_LANGS = $language_man
5264 MAN_LANG_ALL = $man_lang_all
5265 MSG_LANGS = $language_msg
5266 MSG_LANG_ALL = $msg_lang_all
5268 prefix = \$(DESTDIR)$_prefix
5269 BINDIR = \$(DESTDIR)$_bindir
5270 LIBDIR = \$(DESTDIR)$_libdir
5271 MANDIR = \$(DESTDIR)$_mandir
5272 CONFDIR = \$(DESTDIR)$_confdir
5273 LOCALEDIR = \$(DESTDIR)$_localedir
5277 INSTALLSTRIP = $_install_strip
5280 CFLAGS = $WARNFLAGS $ERRORFLAGS $WARN_CFLAGS $CFLAGS $extra_cflags
5281 DEPFLAGS = $DEPFLAGS
5283 CFLAGS_LIBDVDCSS = $cflags_libdvdcss
5284 CFLAGS_LIBDVDCSS_DVDREAD = $cflags_libdvdcss_dvdread
5285 CFLAGS_LIBDVDNAV = $cflags_libdvdnav
5286 CFLAGS_NO_OMIT_LEAF_FRAME_POINTER = $cflags_no_omit_leaf_frame_pointer
5287 CFLAGS_STACKREALIGN = $cflags_stackrealign
5289 EXTRALIBS = $extra_ldflags $_ld_static $_ld_lm $extra_libs
5290 EXTRALIBS_MPLAYER = $libs_mplayer
5300 $(mak_enable "$arch_all" "$arch" ARCH)
5301 $(mak_enable "$subarch_all" "$subarch" ARCH)
5302 $(mak_enable "$cpuexts_all" "$cpuexts" HAVE)
5304 NEED_GETTIMEOFDAY = $need_gettimeofday
5305 NEED_GLOB = $need_glob
5306 NEED_SETENV = $need_setenv
5307 NEED_SHMEM = $need_shmem
5308 NEED_STRSEP = $need_strsep
5309 NEED_SWAB = $need_swab
5310 NEED_VSSCANF = $need_vsscanf
5314 APPLE_IR = $_apple_ir
5315 APPLE_REMOTE = $_apple_remote
5316 AUDIO_INPUT = $_audio_input
5321 COREAUDIO = $_coreaudio
5322 COREVIDEO = $_corevideo
5323 SHAREDBUFFER = $_sharedbuffer
5324 DIRECT3D = $_direct3d
5325 DIRECTFB = $_directfb
5329 DVDNAV_INTERNAL = $dvdnav_internal
5331 DVDREAD_INTERNAL = $_dvdread_internal
5334 FASTMEMCPY = $_fastmemcpy
5338 GL_COCOA = $_gl_cocoa
5339 GL_WIN32 = $_gl_win32
5342 HAVE_POSIX_SELECT = $_posix_select
5343 HAVE_SYS_MMAN_H = $_mman
5345 JOYSTICK = $_joystick
5350 LIBBLURAY = $_bluray
5354 LIBDVDCSS_INTERNAL = $_libdvdcss_internal
5358 LIBPOSTPROC = $libpostproc
5359 LIBAVRESAMPLE = $libavresample
5360 LIBSMBCLIENT = $_smb
5362 LIBTHEORA = $_theora
5364 MACOSX_FINDER = $_macosx_finder
5368 MUSEPACK = $_musepack
5369 NETWORKING = $networking
5372 PE_EXECUTABLE = $_pe_executable
5375 PRIORITY = $_priority
5377 PORTAUDIO = $_portaudio
5380 QTX_CODECS_WIN32 = $_qtx_codecs_win32
5381 QTX_EMULATION = $_qtx_emulation
5383 RADIO_CAPTURE=$_radio_capture
5384 REAL_CODECS = $_real
5388 STREAM_CACHE = $_stream_cache
5391 TV_BSDBT848 = $_tv_bsdbt848
5392 TV_DSHOW = $_tv_dshow
5394 UNRAR_EXEC = $_unrar_exec
5400 WIN32DLL = $_win32dll
5401 WIN32_EMULATION = $_win32_emulation
5403 XANIM_CODECS = $_xanim
5404 XMMS_PLUGINS = $_xmms
5407 YUV4MPEG = $_yuv4mpeg
5409 CONFIG_VDPAU = $_vdpau
5410 CONFIG_ZLIB = $_zlib
5412 HAVE_PTHREADS = $_pthreads
5414 HAVE_W32THREADS = $_w32threads
5418 #############################################################################
5420 ff_config_enable
() {
5421 list
=$
(echo $1 |
tr '[a-z]' '[A-Z]')
5422 item
=$
(echo $2 |
tr '[a-z]' '[A-Z]')
5424 test -z "$_nprefix" && _nprefix
='CONFIG'
5425 for part
in $list; do
5426 if $
(echo $item |
grep -q -E "(^| )$part($| )"); then
5427 echo "#define ${_nprefix}_$part 1"
5429 echo "#define ${_nprefix}_$part 0"
5434 echo "Creating config.h"
5436 /*----------------------------------------------------------------------------
5437 ** This file has been automatically generated by configure any changes in it
5438 ** will be lost when you run configure again.
5439 ** Instead of modifying definitions here, use the --enable/--disable options
5440 ** of the configure script! See ./configure --help for details.
5441 *---------------------------------------------------------------------------*/
5443 #ifndef MPLAYER_CONFIG_H
5444 #define MPLAYER_CONFIG_H
5446 #define CONFIGURATION "$configuration"
5448 #define MPLAYER_CONFDIR "$_confdir"
5449 #define MPLAYER_LOCALEDIR "$_localedir"
5453 /* definitions needed by included libraries */
5454 #define HAVE_INTTYPES_H 1
5456 #define HAVE_ERRNO_H 1
5457 /* libdvdcss + libdvdread */
5458 #define HAVE_LIMITS_H 1
5460 #define HAVE_UNISTD_H 1
5462 #define STDC_HEADERS 1
5463 #define HAVE_MEMCPY 1
5465 #define READ_CACHE_TRACE 0
5467 #define HAVE_DLFCN_H 1
5471 /* system headers */
5475 $def_mman_has_map_failed
5477 $def_sys_soundcard_h
5485 /* system functions */
5505 /* system-specific features */
5518 $def_restrict_keyword
5523 /* configurable options */
5528 $def_runtime_cpudetection
5535 #define __CPU__ $iproc
5539 $(ff_config_enable "$arch_all" "$arch" "ARCH")
5540 $(ff_config_enable "$subarch_all" "$subarch" "ARCH")
5541 $(ff_config_enable "$cpuexts_all" "$cpuexts" "HAVE")
5544 /* Blu-ray/DVD/VCD/CD */
5545 #define DEFAULT_CDROM_DEVICE "$default_cdrom_device"
5546 #define DEFAULT_DVD_DEVICE "$default_dvd_device"
5566 /* codec libraries */
5594 #define BINARY_CODECS_PATH "$_codecsdir"
5595 #define XMMS_INPUT_PLUGIN_DIR "$_xmmsplugindir"
5598 /* Audio output drivers */
5605 $def_ossaudio_devdsp
5606 $def_ossaudio_devmixer
5618 $def_ioctl_bt848_h_name
5619 $def_ioctl_meteor_h_name
5694 /* Use these registers in x86 inline asm. No proper detection yet. */
5695 #define HAVE_EBP_AVAILABLE 1
5697 #endif /* MPLAYER_CONFIG_H */
5700 # Do not overwrite an unchanged config.h to avoid superfluous rebuilds.
5701 cmp -s "$TMPH" config.h ||
mv -f "$TMPH" config.h
5703 #############################################################################
5707 Config files successfully generated by ./configure $configuration !
5709 Install prefix: $_prefix
5710 Config direct.: $_confdir
5712 Byte order: $_byte_order
5713 Optimizing for: $_optimizing
5716 Messages (in addition to English): $language_msg
5717 Manual pages: $language_man
5718 Documentation: $language_doc
5720 Enabled optional drivers:
5721 Input: $inputmodules
5722 Codecs: $codecmodules
5723 Audio output: $aomodules
5724 Video output: $vomodules
5726 Disabled optional drivers:
5727 Input: $noinputmodules
5728 Codecs: $nocodecmodules
5729 Audio output: $noaomodules
5730 Video output: $novomodules
5732 'config.h' and 'config.mak' contain your configuration options.
5733 Note: If you alter theses files (for instance CFLAGS) MPlayer may no longer
5734 compile *** DO NOT REPORT BUGS if you tweak these files ***
5736 'make' will now compile MPlayer and 'make install' will install it.
5737 Note: On non-Linux systems you might need to use 'gmake' instead of 'make'.
5743 Check $TMPLOG if you wonder why an autodetection failed (make sure
5744 development headers/packages are installed).
5746 NOTE: The --enable-* parameters unconditionally force options on, completely
5747 skipping autodetection. This behavior is unlike what you may be used to from
5748 autoconf-based configure scripts that can decide to override you. This greater
5749 level of control comes at a price. You may have to provide the correct compiler
5750 and linker flags yourself.
5751 If you used one of these options (except --enable-runtime-cpudetection and
5752 similar ones that turn on internal features) and experience a compilation or
5753 linking failure, make sure you have passed the necessary compiler/linker flags
5756 If you suspect a bug, please read DOCS/HTML/$language_doc/bugreports.html.
5760 if test "$warn_cflags" = yes; then
5763 MPlayer compilation will use the CPPFLAGS/CFLAGS/LDFLAGS set by you,
5766 *** *** DO NOT REPORT BUGS IF IT DOES NOT COMPILE/WORK! *** ***
5768 It is strongly recommended to let MPlayer choose the correct CFLAGS!
5769 To do so, execute 'CFLAGS= ./configure <options>'
5775 rm -rf "$mplayer_tmpdir"